smuxi-0.11/0000755000175000017500000000000012311344243013373 5ustar00meebeymeebey00000000000000smuxi-0.11/PROFILING0000644000175000017500000003011511655545675014675 0ustar00meebeymeebey00000000000000localhost --------- version: 0.5.19 40441 58859 18.4 seconds version: trunk 25073 [Main] DEBUG TRACE (null) - GnomeUI.SyncPage() 26329 [Main] DEBUG Meebey.Smuxi.FrontendGnome.GnomeUI (null) - SyncPage() done, syncing took: 1256 ms 12.5 seconds 26449 [Main] DEBUG TRACE (null) - GnomeUI.SyncPage() 41666 [Main] DEBUG Meebey.Smuxi.FrontendGnome.GnomeUI (null) - SyncPage() done, syncing took: 15217 ms 15.2 seconds remote (20 ms delay) -------------------- version: 0.5.19 4413737 [Main] DEBUG TRACE (null) - GnomeUI.SyncPage() 4487721 [Main] DEBUG Meebey.Smuxi.FrontendGnome.GnomeUI (null) - SyncPage() done 73.9 seconds 4487802 [Main] DEBUG TRACE (null) - GnomeUI.SyncPage() 4561784 [Main] DEBUG Meebey.Smuxi.FrontendGnome.GnomeUI (null) - SyncPage() done 73.9 seconds version: trunk 56529 [Main] DEBUG Meebey.Smuxi.FrontendGnome.GnomeUI (null) - SyncPage() syncing userlist 74757 [Main] DEBUG Meebey.Smuxi.FrontendGnome.GnomeUI (null) - SyncPage() done, syncing took: 18466 ms 18.2 seconds 74815 [Main] DEBUG TRACE (null) - GnomeUI.SyncPage() 92106 [Main] DEBUG Meebey.Smuxi.FrontendGnome.GnomeUI (null) - SyncPage() done, syncing took: 17291 ms 17.2 seconds 73539 [Main] DEBUG Meebey.Smuxi.FrontendGnome.GnomeUI (null) - SyncPage() done, syncing took: 3420 ms 91396 [Main] DEBUG Meebey.Smuxi.FrontendGnome.GnomeUI (null) - SyncPage() done, syncing took: 17833 ms version: 0.5.27 68423 [Main] DEBUG TRACE (null) - GnomeUI.SyncChat() 70083 [Main] DEBUG Smuxi.Frontend.Gnome.GnomeUI (null) - SyncChat() done, syncing took: 1660 ms CommandModel vorher: T 192.168.1.3:36853 -> 192.168.1.1:7689 [A] .NET..............1...4d429a65_b01b_415e_9d21_ac4e08a84ae3/7d733_13.rem........application/octet-stream..... ..ÿÿÿÿ...............Command.hSmuxi.Engine.IrcProtocolManager, smuxi-engine-irc, Version=0.0.0.0, Culture=ne utral, PublicKeyToken=null....................smuxi-engine......Smuxi.Engine.CommandModel....._Data._DataArr ay._Parameter._IsCommand._CommandCharacter._Command._FrontendManager._Chat..........Smuxi.Engine.FrontendMan ager.....Smuxi.Engine.ChatModel............../me http://www.test.de...........http://www.test.de......./.... ..me........................./me......http://www.test.de......System.Runtime.Remoting.ObjRef.....uri.typeInf o.envoyInfo.channelInfo.objrefFlags.....)System.Runtime.Remoting.IRemotingTypeInfo"System.Runtime.Remoting.I EnvoyInfo$System.Runtime.Remoting.IChannelInfo......44d429a65_b01b_415e_9d21_ac4e08a84ae3/62b29ef3_69.rem... ..........................44d429a65_b01b_415e_9d21_ac4e08a84ae3/62442999_67.rem.................... System.R untime.Remoting.TypeInfo.....serverType.serverHierarchy.interfacesImplemented........fSmuxi.Engine.FrontendM anager, smuxi-engine, Version=0.5.27.34709, Culture=neutral, PublicKeyToken=null...............#System.Runti me.Remoting.ChannelInfo.....channelData....................fSmuxi.Engine.PersonChatModel, smuxi-engine, Vers ion=0.5.27.34709, Culture=neu # T 192.168.1.3:36853 -> 192.168.1.1:7689 [AP] tral, PublicKeyToken=null......................................lSmuxi.Engine.PermanentRemoteObject, smuxi-en gine, Version=0.5.27.34709, Culture=neutral, PublicKeyToken=null..............bSmuxi.Engine.IFrontendUI, smu xi-engine, Version=0.5.27.34709, Culture=neutral, PublicKeyToken=null.................................muxi .Engine.ChatModel, smuxi-engine, Version=0.5.27.34709, Culture=neutral, PublicKeyToken=null. ...lSmuxi.Engin e.PermanentRemoteObject, smuxi-engine, Version=0.5.27.34709, Culture=neutral, PublicKeyToken=null..........! ...aSmuxi.Common.ITraceable, smuxi-common, Version=0.5.27.34708, Culture=neutral, PublicKeyToken=null....... ..."....#........3System.Runtime.Remoting.Channels.CrossAppDomainData....._ContextID._DomainID._processGuid. .............$...$be20e9cd-e50a-49c1-b55d-49327ff52fcd.....1System.Runtime.Remoting.Channels.ChannelDataStor e....._channelURIs._extraData..$System.Collections.DictionaryEntry[].%....."................&...$be20e9cd-e5 0a-49c1-b55d-49327ff52fcd.#........'.....%........(....tcp://192.168.1.1:7689.'........)....tcp://192.168.1. 1:7689. ## CommandModel nachher: T 192.168.0.1:33059 -> 192.168.0.1:7689 [AP] .NET..............2...fa8c4a1e_0082_4476_afe2_8d32fbb9a9e1/127ad3b_2.rem........application/octet-stream.... ...ÿÿÿÿ...............Command.]Smuxi.Engine.Session, smuxi-engine, Version=0.5.27.1312, Culture=neutral, Pub licKeyToken=null....................smuxi-engine......Smuxi.Engine.CommandModel.....X._FrontendManager._Chat .....Smuxi.Engine.FrontendManager.....Smuxi.Engine.PersonChatModel............................>....../me tes t http://www.test.de..test http://www.test.de.../..me......System.Runtime.Remoting.ObjRef.....uri.typeInfo.e nvoyInfo.channelInfo.objrefFlags.....)System.Runtime.Remoting.IRemotingTypeInfo"System.Runtime.Remoting.IEnv oyInfo$System.Runtime.Remoting.IChannelInfo......2fa8c4a1e_0082_4476_afe2_8d32fbb9a9e1/127ad6f_4.rem........ .....................3fa8c4a1e_0082_4476_afe2_8d32fbb9a9e1/127c601_12.rem.................... System.Runtime .Remoting.TypeInfo.....serverType.serverHierarchy.interfacesImplemented........eSmuxi.Engine.FrontendManager , smuxi-engine, Version=0.5.27.1312, Culture=neutral, PublicKeyToken=null...............#System.Runtime.Remo ting.ChannelInfo.....channelData....................eSmuxi.Engine.PersonChatModel, smuxi-engine, Version=0.5 .27.1312, Culture=neutral, PublicKeyToken=null......................................kSmuxi.Engine.PermanentR emoteObject, smuxi-engine, Version=0.5.27.1312, Culture=neutral, PublicKeyToken=null..............aSmuxi.Eng ine.IFrontendUI, smuxi-engine, Version=0.5.27.1312, Culture=neutral, PublicKeyToken=null.................... ............._Smuxi.Engine.ChatModel, smuxi-engine, Version=0.5.27.1312, Culture=neutral, PublicKeyToken=nul l.....kSmuxi.Engine.PermanentRemoteObject, smuxi-engine, Version=0.5.27.1312, Culture=neutral, PublicKeyToke n=null.............._Smuxi.Common.ITraceable, smuxi-common, Version=0.5.27.692, Culture=neutral, PublicKeyTo ken=null........................3System.Runtime.Remoting.Channels.CrossAppDomainData....._ContextID._DomainI D._processGuid..................$7cd52b30-e069-4160-9225-765543d4291b.....1System.Runtime.Remoting.Channels. ChannelDataStore....._channelURIs._extraData..$System.Collections.DictionaryEntry[]........................ ...$7cd52b30-e069-4160-9225-765543d4291b..........!.............."....tcp://192.168.0.1:7689.!........#....t cp://192.168.0.1:7689. # AddMessageToChat before: T 192.168.0.1:56235 -> 192.168.0.1:47823 [AP] .NET..............2...d1247a89_5e9d_4853_b7ae_60c30a8dcdbc/1d1cf61_2.rem........application/octet-stream.... ...ÿÿÿÿ...............AddMessageToChat.nSmuxi.Frontend.Gnome.GnomeUI, smuxi-frontend-gnome, Version=0.5.27.3 6611, Culture=neutral, PublicKeyToken=null.........................System.Runtime.Remoting.ObjRef.....uri.ty peInfo.envoyInfo.channelInfo.objrefFlags.....)System.Runtime.Remoting.IRemotingTypeInfo"System.Runtime.Remot ing.IEnvoyInfo$System.Runtime.Remoting.IChannelInfo......319adb18f_6915_450b_bf89_17538ff339ff/1d25ced_12.re m.....................smuxi-engine......Smuxi.Engine.MessageModel.....X................ System.Runtime.Remot ing.TypeInfo.....serverType.serverHierarchy.interfacesImplemented........eSmuxi.Engine.GroupChatModel, smuxi -engine, Version=0.5.27.36608, Culture=neutral, PublicKeyToken=null...............#System.Runtime.Remoting.C hannelInfo.....channelData...........Î.... ¦Å.¯òÉ...........ÿÿÿÿ..............smuxi-engine.....!Smuxi.Engine .TextMessagePartModel.....X................Ç...........ÿÿÿÿ..............smuxi-engine......Smuxi.Engine.Text Color.....X.....................ÿÿÿÿ.......ÿÿÿÿ..............smuxi-engine......Smuxi.Engine.TextColor.....X. ....................ÿÿÿÿ......<.......ÿÿÿÿ..............smuxi-engine.....!Smuxi.Engine.TextMessagePartModel. ....X................Í...........ÿÿÿÿ..............smuxi-engine......Smuxi.Engine.TextColor.....X........... ..........ÿ..........ÿÿÿÿ..............smuxi-engine......Smuxi.Engine.TextColor.....X.....................ÿÿ ÿÿ......meebey_.......ÿÿÿÿ..............smuxi-engine.....!Smuxi.Engine.TextMessagePartModel.....X........... .....È...........ÿÿÿÿ..............smuxi-engine......Smuxi.Engine.TextColor.....X.....................ÿÿÿÿ.. .....ÿÿÿÿ..............smuxi-engine......Smuxi.Engine.TextColor.....X.....................ÿÿÿÿ......> ...... .ÿÿÿÿ..............smuxi-engine.....!Smuxi.Engine.TextMessagePartModel.....X................Ê...........ÿÿÿÿ ..............smuxi-engine......Smuxi.Engine.TextColor.....X.....................ÿÿÿÿ.......ÿÿÿÿ............ ..smuxi-engine......Smuxi.Engine.TextColor.....X.....................ÿÿÿÿ......test...............`Smuxi.Eng ine.ChatModel, smuxi-engine, Version=0.5.27.36608, Culture=neutral, PublicKeyToken=null.....lSmuxi.Engine.Pe rmanentRemoteObject, smuxi-engine, Version=0.5.27.36608, Culture=neutral, PublicKeyToken=null..............a Smuxi.Common.ITraceable, smuxi-common, Version=0.5.27.36444, Culture=neutral, PublicKeyToken=null........... .............3System.Runtime.Remoting.Channels.CrossAppDomainData....._ContextID._DomainID._processGuid..... .............$484565a1-c1d3-4f44-a63a-5f669157be73.....1System.Runtime.Remoting.Channels.ChannelDataStore... .._channelURIs._extraData..$System.Collections.DictionaryEntry[].....................tcp://192.168.0.1:7689. ## AddMessageToChat after: T 192.168.0.1:59737 -> 192.168.0.1:40847 [AP] .NET......®.......2...e6666d53_7243_46d8_9d9b_1c747383eb93/1dc1084_2.rem........application/octet-stream.... ...ÿÿÿÿ...............AddMessageToChat.nSmuxi.Frontend.Gnome.GnomeUI, smuxi-frontend-gnome, Version=0.5.27.3 6971, Culture=neutral, PublicKeyToken=null.........................System.Runtime.Remoting.ObjRef.....uri.ty peInfo.envoyInfo.channelInfo.objrefFlags.....)System.Runtime.Remoting.IRemotingTypeInfo"System.Runtime.Remot ing.IEnvoyInfo$System.Runtime.Remoting.IChannelInfo......3793e4abc_bfb4_446f_8dec_197351e67051/1dc178f_11.re m.....................smuxi-engine......Smuxi.Engine.MessageModel.....X................ System.Runtime.Remot ing.TypeInfo.....serverType.serverHierarchy.interfacesImplemented........eSmuxi.Engine.GroupChatModel, smuxi -engine, Version=0.5.27.36969, Culture=neutral, PublicKeyToken=null...............#System.Runtime.Remoting.C hannelInfo.....channelData...........î.....ÑÂû°òÉ...........ÿÿÿÿ..............smuxi-engine.....!Smuxi.Engine .TextMessagePartModel.....X......................ÿÿÿÿÿÿÿÿ.....<.......ÿÿÿÿ..............smuxi-engine.....!Sm uxi.Engine.TextMessagePartModel.....X......................ÿ...ÿÿÿÿ.....meebey_.......ÿÿÿÿ..............smux i-engine.....!Smuxi.Engine.TextMessagePartModel.....X......................ÿÿÿÿÿÿÿÿ.....> .......ÿÿÿÿ....... .......smuxi-engine.....!Smuxi.Engine.TextMessagePartModel.....X......................ÿÿÿÿÿÿÿÿ.....test..... ..........`Smuxi.Engine.ChatModel, smuxi-engine, Version=0.5.27.36969, Culture=neutral, PublicKeyToken=null. ....lSmuxi.Engine.PermanentRemoteObject, smuxi-engine, Version=0.5.27.36969, Culture=neutral, PublicKeyToken =null..............aSmuxi.Common.ITraceable, smuxi-common, Version=0.5.27.36444, Culture=neutral, PublicKeyT oken=null........................3System.Runtime.Remoting.Channels.CrossAppDomainData....._ContextID._Domain ID._processGuid..................$7866e8ff-bce0-486a-9f52-d72137d29671.....1System.Runtime.Remoting.Channels .ChannelDataStore....._channelURIs._extraData..$System.Collections.DictionaryEntry[].....................tcp ://192.168.0.1:7689. # smuxi-0.11/programs.m40000644000175000017500000000036111700531605015470 0ustar00meebeymeebey00000000000000AC_DEFUN([SHAMROCK_FIND_PROGRAM], [ AC_PATH_PROG($1, $2, $3) AC_SUBST($1) ]) AC_DEFUN([SHAMROCK_FIND_PROGRAM_OR_BAIL], [ SHAMROCK_FIND_PROGRAM($1, $2, no) if test "x$$1" = "xno"; then AC_MSG_ERROR([You need to install '$2']) fi ]) smuxi-0.11/po-Engine-JabbR/0000755000175000017500000000000012311344242016171 5ustar00meebeymeebey00000000000000smuxi-0.11/po-Engine-JabbR/fi.po0000644000175000017500000000277512300202374017137 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/smuxi/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "" smuxi-0.11/po-Engine-JabbR/zh_CN.po0000644000175000017500000000335712300202374017537 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Dean Lee , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-13 08:22+0000\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/smuxi/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "JabbR 命令" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "房间加入失败。原因: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "消息发送失败。原因: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "连接失败! 原因: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "正在连接到 {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "正在重新连接到 {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "未连接" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "检索聊天信息失败。原因: {0}" smuxi-0.11/po-Engine-JabbR/POTFILES.skip0000644000175000017500000000044012300202374020301 0ustar00meebeymeebey00000000000000glade/ src/Common/ src/Engine/ src/Engine-Campfire/ src/Engine-IRC/ src/Engine-Twitter/ src/Engine-XMPP/ src/Frontend/ src/Frontend-GNOME/ src/Frontend-GNOME-IRC/ src/Frontend-GNOME-Twitter/ src/Frontend-GNOME-XMPP/ src/Frontend-STFL/ src/Frontend-SWF/ src/Frontend-WPF/ src/Server/ lib/ smuxi-0.11/po-Engine-JabbR/tr.po0000644000175000017500000000277412300202374017165 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/smuxi/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "" smuxi-0.11/po-Engine-JabbR/fa.po0000644000175000017500000000276612300202374017127 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Persian (http://www.transifex.com/projects/p/smuxi/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "" smuxi-0.11/po-Engine-JabbR/fr.po0000644000175000017500000000347012300202374017141 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Clément Bourgeois , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-13 21:38+0000\n" "Last-Translator: Clément Bourgeois \n" "Language-Team: French (http://www.transifex.com/projects/p/smuxi/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "Commandes JabbR" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "Impossible de rejoindre le canal. Raison : {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "Impossible d'envoyer le message. Raison : {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "Connexion échouée ! Raison : {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "Connexion à {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Reconnexion à {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "non connecté" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "Récupération des informations de discussion échouée. Raison : {0}" smuxi-0.11/po-Engine-JabbR/sv.po0000644000175000017500000000352412300202374017162 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Martin Bagge , 2013 # Mirco Bauer , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-11 16:10+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/smuxi/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sv\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "JabbR-kommandon" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "Anslutning till rum misslyckades. Anledning: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "Meddelandet kunde inte skickas. Anledning: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "Anslutning misslyckades! Anledning: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "Ansluter till {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Återansluter till {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "inte ansluten" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "Hämtning av chattinformation misslyckades. Anledning: {0}" smuxi-0.11/po-Engine-JabbR/cs.po0000644000175000017500000000355212300202374017140 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Mirco Bauer , 2013 # Ondřej Hošek , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-11 16:09+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Czech (http://www.transifex.com/projects/p/smuxi/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "Příkazy JabbR" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "Vstoupení do místnosti se nezdařilo. Důvod: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "Odeslání zprávy se nezdařilo. Důvod: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "Spojení se nezdařilo! Důvod: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "Spojuji se s {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Obnovuji spojení s {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "nepřipojen" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "Nezdařilo se získat informace o chatu. Důvod: {0}" smuxi-0.11/po-Engine-JabbR/nl.po0000644000175000017500000000344212311343665017155 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Jeroen Baten , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-26 12:57+0000\n" "Last-Translator: Jeroen Baten \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/smuxi/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "JabbR Commando's" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "Verbinden met ruimte mislukt. Reden: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "Verzenden van boodschap niet gelukt. Reden: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "Verbinden niet gelukt! Reden: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "Verbinden met {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Opnieuw verbinden met {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "niet verbonden" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "Ophalen van chatinformatie niet gelukt. Reden: {0}" smuxi-0.11/po-Engine-JabbR/da.po0000644000175000017500000000347612300202374017124 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Joe Hansen , 2013 # Mirco Bauer , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-11 16:10+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Danish (http://www.transifex.com/projects/p/smuxi/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "JabbR-kommandoer" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "Tilslutning til rum mislykkedes. Årsag: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "Send besked mislykkedes. Årsag: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "Forbindelse mislykkedes! Årsag: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "Forbinder til {0} ..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Genforbinder til {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "ikke forbundet" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "Hentning af snakinformation mislykkedes. Årsag: {0}" smuxi-0.11/po-Engine-JabbR/POTFILES.in0000644000175000017500000000005112300202374017737 0ustar00meebeymeebey00000000000000src/Engine-JabbR/JabbrProtocolManager.cs smuxi-0.11/po-Engine-JabbR/pt_BR.po0000644000175000017500000000301612300202374017534 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/smuxi/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "" smuxi-0.11/po-Engine-JabbR/LINGUAS0000644000175000017500000000005512311343665017226 0ustar00meebeymeebey00000000000000cs da de es fa fi fr nl pt_BR sv te tr zh_CN smuxi-0.11/po-Engine-JabbR/de.po0000644000175000017500000000352512300202374017123 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Bianca Mix , 2013 # Mirco Bauer , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-11 19:37+0000\n" "Last-Translator: Bianca Mix \n" "Language-Team: German (http://www.transifex.com/projects/p/smuxi/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "JabbR Befehle" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "Raum-betreten fehlgeschlagen. Grund: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "Senden der Nachricht fehlgeschlagen. Grund: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "Verbindung ist fehlgeschlagen! Ursache: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "Verbinde zu {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Verbinde erneut zu {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "nicht verbunden" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "Abfragen der Chat Informationen fehlgeschlagen. Grund: {0}" smuxi-0.11/po-Engine-JabbR/Makefile.in.in0000644000175000017500000001532612300202374020647 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE_ENGINE_JABBR@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/po-Engine-JabbR/es.po0000644000175000017500000000343712300202374017144 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # toote, 2013 # Mirco Bauer , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-11 16:10+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Spanish (http://www.transifex.com/projects/p/smuxi/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "Órdenes JabbR" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "Falló la entrada al canal. Razón: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "Falló el envío del mensaje. Razón: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "¡Falló la conexión! Razón: {0}" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "Conectando a {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Reconectando a {0}..." #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "no conectado" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "Falló la obtención de información de chat. Razón: {0}" smuxi-0.11/po-Engine-JabbR/te.po0000644000175000017500000000277412300202374017150 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:00+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/smuxi/language/te/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: te\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:103 msgid "JabbR Commands" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:136 #, csharp-format msgid "Joining room failed. Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:162 #, csharp-format msgid "Sending message failed. Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:230 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:243 #, csharp-format msgid "Connecting to {0}..." msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:340 #, csharp-format msgid "Reconnecting to {0}..." msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:433 msgid "not connected" msgstr "" #: ../src/Engine-JabbR/JabbrProtocolManager.cs:577 #, csharp-format msgid "Retrieving chat information failed. Reason: {0}" msgstr "" smuxi-0.11/expansions.m40000644000175000017500000000146611655545675016061 0ustar00meebeymeebey00000000000000AC_DEFUN([SHAMROCK_EXPAND_LIBDIR], [ expanded_libdir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac eval echo $libdir )` AC_SUBST(expanded_libdir) ]) AC_DEFUN([SHAMROCK_EXPAND_BINDIR], [ expanded_bindir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac eval echo $bindir )` AC_SUBST(expanded_bindir) ]) AC_DEFUN([SHAMROCK_EXPAND_DATADIR], [ case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac expanded_datadir=`(eval echo $datadir)` expanded_datadir=`(eval echo $expanded_datadir)` AC_SUBST(expanded_datadir) ]) smuxi-0.11/intltool.m40000644000175000017500000002772412311344225015515 0ustar00meebeymeebey00000000000000## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*- ## Copyright (C) 2001 Eazel, Inc. ## Author: Maciej Stachowiak ## Kenneth Christiansen ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## ## As a special exception to the GNU General Public License, if you ## distribute this file as part of a program that contains a ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) # serial 42 IT_PROG_INTLTOOL AC_DEFUN([IT_PROG_INTLTOOL], [ AC_PREREQ([2.50])dnl AC_REQUIRE([AM_NLS])dnl case "$am__api_version" in 1.[01234]) AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) ;; *) ;; esac INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` if test -n "$1"; then AC_MSG_CHECKING([for intltool >= $1]) AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) fi AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.]) fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi AC_SUBST([AM_DEFAULT_VERBOSITY]) INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' INTLTOOL__v_MERGE_0='@echo " ITMRG " [$]@;' AC_SUBST(INTLTOOL_V_MERGE) AC_SUBST(INTLTOOL__v_MERGE_) AC_SUBST(INTLTOOL__v_MERGE_0) INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' intltool__v_merge_options_0='-q' AC_SUBST(INTLTOOL_V_MERGE_OPTIONS) AC_SUBST(intltool__v_merge_options_) AC_SUBST(intltool__v_merge_options_0) INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< [$]@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< [$]@' else INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.[$][$]RANDOM && mkdir [$][$]_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u [$][$]_it_tmp_dir $< [$]@ && rmdir [$][$]_it_tmp_dir' fi INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' _IT_SUBST(INTLTOOL_DESKTOP_RULE) _IT_SUBST(INTLTOOL_DIRECTORY_RULE) _IT_SUBST(INTLTOOL_KEYS_RULE) _IT_SUBST(INTLTOOL_PROP_RULE) _IT_SUBST(INTLTOOL_OAF_RULE) _IT_SUBST(INTLTOOL_PONG_RULE) _IT_SUBST(INTLTOOL_SERVER_RULE) _IT_SUBST(INTLTOOL_SHEET_RULE) _IT_SUBST(INTLTOOL_SOUNDLIST_RULE) _IT_SUBST(INTLTOOL_UI_RULE) _IT_SUBST(INTLTOOL_XAM_RULE) _IT_SUBST(INTLTOOL_KBD_RULE) _IT_SUBST(INTLTOOL_XML_RULE) _IT_SUBST(INTLTOOL_XML_NOMERGE_RULE) _IT_SUBST(INTLTOOL_CAVES_RULE) _IT_SUBST(INTLTOOL_SCHEMAS_RULE) _IT_SUBST(INTLTOOL_THEME_RULE) _IT_SUBST(INTLTOOL_SERVICE_RULE) _IT_SUBST(INTLTOOL_POLICY_RULE) # Check the gettext tools to make sure they are GNU AC_PATH_PROG(XGETTEXT, xgettext) AC_PATH_PROG(MSGMERGE, msgmerge) AC_PATH_PROG(MSGFMT, msgfmt) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi AC_PATH_PROG(INTLTOOL_PERL, perl) if test -z "$INTLTOOL_PERL"; then AC_MSG_ERROR([perl not found]) fi AC_MSG_CHECKING([for perl >= 5.8.1]) $INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 if test $? -ne 0; then AC_MSG_ERROR([perl 5.8.1 is required for intltool]) else IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` AC_MSG_RESULT([$IT_PERL_VERSION]) fi if test "x$2" != "xno-xml"; then AC_MSG_CHECKING([for XML::Parser]) if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then AC_MSG_RESULT([ok]) else AC_MSG_ERROR([XML::Parser perl module is required for intltool]) fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile AC_SUBST(ALL_LINGUAS) # Set DATADIRNAME correctly if it is not set yet # (copied from glib-gettext.m4) if test -z "$DATADIRNAME"; then AC_LINK_IFELSE( [AC_LANG_PROGRAM([[]], [[extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr]])], [DATADIRNAME=share], [case $host in *-*-solaris*) dnl On Solaris, if bind_textdomain_codeset is in libc, dnl GNU format message catalog is always supported, dnl since both are added to the libc all together. dnl Hence, we'd like to go with DATADIRNAME=share dnl in this case. AC_CHECK_FUNC(bind_textdomain_codeset, [DATADIRNAME=share], [DATADIRNAME=lib]) ;; *) [DATADIRNAME=lib] ;; esac]) fi AC_SUBST(DATADIRNAME) IT_PO_SUBDIR([po]) ]) # IT_PO_SUBDIR(DIRNAME) # --------------------- # All po subdirs have to be declared with this macro; the subdir "po" is # declared by IT_PROG_INTLTOOL. # AC_DEFUN([IT_PO_SUBDIR], [AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. dnl dnl The following CONFIG_COMMANDS should be executed at the very end dnl of config.status. AC_CONFIG_COMMANDS_PRE([ AC_CONFIG_COMMANDS([$1/stamp-it], [ if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.]) fi rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" >"$1/stamp-it.tmp" [sed '/^#/d s/^[[].*] *// /^[ ]*$/d '"s|^| $ac_top_srcdir/|" \ "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" ] [sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r $1/POTFILES } ' "$1/Makefile.in" >"$1/Makefile"] rm -f "$1/Makefile.tmp" mv "$1/stamp-it.tmp" "$1/stamp-it" ]) ])dnl ]) # _IT_SUBST(VARIABLE) # ------------------- # Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST # AC_DEFUN([_IT_SUBST], [ AC_SUBST([$1]) m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) ] ) # deprecated macros AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) # A hint is needed for aclocal from Automake <= 1.9.4: # AC_DEFUN([AC_PROG_INTLTOOL], ...) smuxi-0.11/po-Engine-XMPP/0000755000175000017500000000000012311344242015775 5ustar00meebeymeebey00000000000000smuxi-0.11/po-Engine-XMPP/fi.po0000644000175000017500000001772112300202374016740 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/smuxi/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "" smuxi-0.11/po-Engine-XMPP/zh_CN.po0000644000175000017500000002277512300202374017350 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Dean Lee , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-13 08:35+0000\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/smuxi/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "服务器已关闭" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "相同资源被其他客户端登录占用,您已被断开连接" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "身份认证失败,用户名不存在或密码无效" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "如果您希望指定用户名与密码创建账号,请输入 /register" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "未连接" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "未找到联系人 {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "联系人 {0} 有 {1} 个已知资源" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "{0} 不是已知资源" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "联系人的 Jid: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "您与该联系人存在双向订阅关系" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "您未订阅该联系人,该联系人也未订阅您" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "您已订阅该联系人,但该联系人未订阅您" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "您未订阅该联系人,但该联系人订阅了您" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "无效联系人命令: {0}" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "{0} 命令" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "高级 {0} 命令" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "无效端口: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "有空优先级为: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "离开优先级为: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "优先级无效: {0} (有效的优先级从 -128 到 127)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "{0}{1} 有空" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "{0}{1} 离开" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "{0}{1} 长时间离开" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "{0}{1} 忙碌" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "{0}{1} 想要聊天" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "{0}{1} 离线" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "由于您已请求订阅,已自动允许 {0} 订阅您" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "{0}{1} 希望订阅您" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "{0}{1} 允许您订阅" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "由于您不再订阅 {0},已自动移除他对您在线状态的订阅" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "{0}{1} 拒绝/移除了您的订阅" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "{0}{1} 已取消订阅您" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "收到畸形错误消息: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "找不到 {0}{1} 的服务器" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "{0}{1} 已在使用您请求的资源" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "{0}, {1}, {2}{3} 当前没有有用的错误消息" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "您无权访问 {0}{1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "{0} 天" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "{0} 小时" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "{0} 分钟" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "{0} 秒" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr " 从 {0} ({1})" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "发生未知群聊错误: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "发生未处理的群聊错误: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "群聊 {0} 出错: {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "您被 {0} 邀请加入 {2},因为 {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "您被 {0} 邀请加入 {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "接受邀请 (加入房间)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "正在重新连接到 {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "将在 {1} 秒后重新连接到 {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "错误: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "已通过身份认证" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "使用代理: {0}:{1}" smuxi-0.11/po-Engine-XMPP/POTFILES.skip0000644000175000017500000000044112300202374020106 0ustar00meebeymeebey00000000000000glade/ src/Common/ src/Engine/ src/Engine-Campfire/ src/Engine-IRC/ src/Engine-JabbR/ src/Engine-Twitter/ src/Frontend/ src/Frontend-GNOME/ src/Frontend-GNOME-IRC/ src/Frontend-GNOME-Twitter/ src/Frontend-GNOME-XMPP/ src/Frontend-STFL/ src/Frontend-SWF/ src/Frontend-WPF/ src/Server/ lib/ smuxi-0.11/po-Engine-XMPP/tr.po0000644000175000017500000001772012300202374016766 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/smuxi/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "" smuxi-0.11/po-Engine-XMPP/fa.po0000644000175000017500000001771212300202374016730 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Persian (http://www.transifex.com/projects/p/smuxi/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "" smuxi-0.11/po-Engine-XMPP/fr.po0000644000175000017500000002423512300202374016747 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Clément Bourgeois , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-13 21:58+0000\n" "Last-Translator: Clément Bourgeois \n" "Language-Team: French (http://www.transifex.com/projects/p/smuxi/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "Le serveur a été coupé" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "Un autre client s'est connecté avec le même nom de resource, vous avez été déconnecté" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "Authentification échouée, mot de passe ou nom d'utilisateur incorrect" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "si vous souhaitez créer un compte avec le nom d'utilisateur et le mot de passe spécifié, tapez /register maintenant" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "non connecté" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "Impossible de trouver le contact {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "Le contact {0} a {1} ressource(s) connue(s)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "{0} n'est pas une ressource connue" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "Jid du contact : {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "Vous avez un abonnement mutuel avec ce contact" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "Vous n'avez pas d'abonnement avec ce contact ou ce contact n'est pas abonné à vous" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "Vous êtes abonné à ce contact, mais celui-ci ne s'est pas abonné à vous" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "Vous n'êtes pas abonné à ce contact, mais lui est abonné à vous" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "Commande contact invalide : {0}" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "Commandes {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "Commandes avancées {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "Port invalide : {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "La priorité pour Disponible est : {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "La priorité pour Parti est : {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "Priorité {0} invalide (les priorités valides sont comprises entre -128 et 127 inclus)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "{0}{1} est disponible" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "{0}{1} est parti" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "{0}{1} est parti depuis longtemps" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "{0}{1} ne veut pas être dérangé" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "{0}{1} veut discutter" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "{0}{1} est hors ligne" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "{0} a été automatiquement autorisé à s'abonner à vous car vous aviez une demande d'abonnement vers lui en attente" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "{0}{1} souhaite s'abonner à vous" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "{0}{1} vous a autorisé à vous abonner" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "L'abonnement de {0} pour votre présence a été automatiquement supprimé après la perte de l'abonnement vers le sien" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "{0}{1} a refusé/supprimé votre abonnement" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "{0}{1} s'est desabonné de vous" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "message d'erreur mal formé reçu : {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "le serveur de {0}{1} n'a pû être trouvé" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "{0}{1} utilise deja le nom de ressource demandé" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "Il n'y a pour l'instant aucun message d'erreur utile pour {0}, {1}, {2}{3}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "Vous n'avez pas la permission d'acceder à {0}{1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "{0} jours" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "{0} heures" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "{0} minutes" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "{0} secondes" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr "depuis {0} ({1})" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "Une erreur de chat de groupe s'est produite : {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "Une erreur de chat de groupe non gérée s'est produite : {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "Erreur dans la discussion de groupe {0} : {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "Vous avez été invité sur {2} par {0} ({1})" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "Vous avez été invité sur {1} par {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "Accepter l'invitation (rejoindre le canal)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "Reconnexion à {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "Reconnexion à {0} dans {1} seconde(s)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "Erreur : {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "Authentifié" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Utilisation du proxy : {0}:{1}" smuxi-0.11/po-Engine-XMPP/sv.po0000644000175000017500000002365612300202374016776 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Martin Bagge , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/smuxi/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sv\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "Servern har stängts av" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "En annan klient loggade in med samma resurs, du har kopplats bort" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "Autentisering misslyckades, antingen finns inte användarnamnet eller så är lösenordet fel" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "om du vill skapa ett konto med den specificerade användaren och lösenordet skriv då /register nu" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "inte ansluten" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "Kunde inte hitta kontakten {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "Kontakten {0} har {1} känd resurs" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "{0} är inte en känd resurs" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "Kontaktens Jid: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "Ni prenumererar på varandra" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "Du har inga prenumerationer med denna kontakt och den prenumererar inte på dig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "Du prenumererar på denna kontakt med den prenumererar inte på dig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "Du prenumererar inte på denna kontakt men den prenumererar på dig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "Felaktigt kontaktkommando: {0}" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "{0}-kommandon" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "Avancerade {0}-kommandon" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "Felaktig port: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "Prioritet för Tillgänglig är: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "Prioritet för Borta är: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "Felaktig prioritet: {0} (korrekta prioriteringar spänner från -128 till och med 127)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "{0}{1} är tillgänglig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "{0}{1} är borta" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "{0}{1} är borta sedan längre tid" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "{0}{1} vill inte bli störd" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "{0}{1} vill chatta" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "{0}{1} är inte ansluten" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "Tillät automatisk {0} att prenumerera på dig eftersom du redan frågar om att prenumerera" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "{0}{1} vill prenumerera på dig" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "{0}{1} tillät dig att prenumerera" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "Tog automatiskt bort prenumerationen för {0} eftersom du nekades kontraprenumeration" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "{0}{1} nekade/tog bort din prenumereration" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "{0}{1} slutade prenumerera på dig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "fick ett felaktigt formaterat felmeddelande: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "{0}{1} server kunde inte hittas" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "{0}{1} använder redan din begärda resurs" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "Det finns inget meningsfullt felmeddelande för {0}, {1}, {2}{3} " #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "Du har inte tillåtelse att komma åt {0}{1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "{0} dagar" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "{0} timmar" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "{0} minuter" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "{0} sekunder" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr "sedan {0} ({1})" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "Ett okänt fel i gruppchatten inträffade: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "Ett ohanterbart fel i gruppchatten inträffade: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "Fel i gruppchatt {0}: {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "Du har bjudits in till {2} av {0} med anledning {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "Du har bjudits in av {1} till {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "Acceptera inbjudan (anslut till rum)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "Återansluter till {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "Återansluter till {0} om {1} sekunder" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "Fel: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "Autentiserad" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Använder proxy: {0}:{1}" smuxi-0.11/po-Engine-XMPP/cs.po0000644000175000017500000002405112300202374016741 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Ondřej Hošek , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Czech (http://www.transifex.com/projects/p/smuxi/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "Server byl vypnut" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "Připojil se jiný klient se stejným zdrojem; Vaše připojení bylo ukončeno" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "Ověření přístupových dat se nezdařilo, buďto neexistuje uživatelské jméno anebo je heslo špatně" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "Pokud chcete vytvořit uživatelský účet s tímto jménem a heslem, zadejte /register" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "nepřipojen" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "Nemohu najít kontakt {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "Kontakt {0} ma {1} známých zdrojů" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "{0} není známý zdroj" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "JID kontaktu: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "Máte s tímto kontaktem vzájemné předplatné" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "Nejste předplatitelem tohoto kontaktu a tento kontakt není vaším předplatitelem." #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "Jste předplatitelem tohoto kontaktu, ale tento kontakt není vaším" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "Nejste předplatitelem tohoto kontaktu, ale tento kontakt je vaším" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "Neplatný příkaz pro kontakt: {0}" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "Příkazy {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "Pokročilé příkazy {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "Neplatný port: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "Priorita pro „přítomen“ je: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "Priorita pro „nepřítomen“ je: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "Neplatná priorita: {0} (platné priority jsou mezi -128 a 127 včetně)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "{0}{1} je přítomen" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "{0}{1} je pryč" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "{0}{1} je déle pryč" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "{0}{1} nechce být vyrušen" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "{0}{1} by rád chatoval" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "{0}{1} je offline" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "Automaticky přijímám předplatné Vašeho stavu od uživatele {0}, protože chcete předplatit jeho stav" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "{0}{1} si chce předplatit Váš stav" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "{0}{1} Vám povolil předplacení jeho stavu" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "Automaticky ukončuji uživateli {0} předplacení Vašeho stavu protože on ukončil Vaše předplaceni jeho stavu" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "{0}{1} odmítl/smazal Vaše předplatné jeho stavu" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "{0}{1} ukončil jeho předplatné Vašeho stavu" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "obdržena neplatná chybová zpráva: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "Server uživatele {0}{1} nebyl nalezen" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "{0}{1} už užívá Vámi vybraný zdroj" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "Zatím postrádám užitečnou chybovou zprávu pro {0}, {1}, {2}{3}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "Nemáte povolení k přístupu pro {0}{1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "{0} dnů" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "{0} hodin" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "{0} minut" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "{0} vteřin" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr "od {0} ({1})" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "Nastala neznámá chyba skupinového chatu: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "Nastala neošetřená chyba skupinového chatu: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "Chyba ve skupinovém chatu {0}: {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "{0} Vás zve do {2} protože {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "{0} Vás zve do {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "Přijmout pozvánku (vstoupit do místnosti)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "Opětovné připojování k {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "Opětovné připojování k {0} za {1} vteřin" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "Chyba: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "Ověřen" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Používám proxy: {0}:{1}" smuxi-0.11/po-Engine-XMPP/nl.po0000644000175000017500000002413612311343665016764 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Jeroen Baten , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-26 13:33+0000\n" "Last-Translator: Jeroen Baten \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/smuxi/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "De server is uitgeschakeld" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "Een andere client heeft zich aangemeld met dezelfde resource. U bent afgeschakeld." #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "Authenticatie niet gelukt. Gebruikersnaam bestaat niet of ongeldig wachtwoord" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "Als u een account wilt aanmaken met de gespecificeerde gebruiker en wachtwoord, type dan nu \"/register\"." #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "niet verbonden" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "Kon contact \"{0}\" niet vinden." #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "Contact {0} heeft {1} bekende resources" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "{0} is een onbekende resource" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "Contact's Jid: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "U heeft een dubbele subscriptie met dit contact" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "U heeft geen subscriptie met dit contact en dit contact volgt u niet." #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "U heeft een subscriptie met dit contact, maar dit contact heeft geen subscriptie met u" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "U heeft geen subscriptie met dit contact, maar dit contact heeft wel een subscriptie met u" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "Ongeldig Contact commando: {0}" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "{0} Commando's" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "Gevorderde {0} Commando's" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "Ongeldige poort: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "Prioriteit voor Beschikbaar is: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "Prioriteit voor Away is: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "Ongeldige prioriteit: {0} (geldige prioriteiten zijn tussen -128 en 127 inclusief)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "{0}{1} is beschikbaar" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "{0}{1} is weg" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "{0}{1} is voor langere tijd afwezig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "{0}{1} wenst niet gestoord te worden" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "{0}{1} wil praten" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "{0}{1} is offline" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "Heeft {0} automatisch toegestaan om naar u te subscriben omdat u al een verzoek om een subscriptie had ingediend" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "{0}{1} wil met u subscriben" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "{0}{1} heeft u toegestaan om te subscriben" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "Heeft automatisch {0}'s subscripties naar uw aanwezigheid verwijderd na het verlies van de subscriptie naar hun toe" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "{0}{1} weigerde/verwijderde uw subscriptie" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "{0}{1} verwijderde de subscribtie naar u toe" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "ontving een verhaspelde foutmelding: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "{0}{1}'s server kon niet gevonden worden" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "{0}{1} gebruikt reeds uw verzochte resource" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "Er is momenteel geen bruikbare foutmelding voor {0}, {1}, {2}{3}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "U heeft geen toestemming voor het benaderen van {0}{1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "{0} dagen" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "{0} uren" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "{0} minuten" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "{0} seconden" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr " sinds {0} ({1})" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "Een onbekende groupchat fout is opgetreden: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "Een niet afgehandelde groupchat fout is opgetreden: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "Fout in Groupchat {0}: {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "U bent uitgenodigd voor {2} door {0} vanwege {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "U bent uitgenodigd voor {1} door {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "Accepteer uitnodiging (verbind met ruimte)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "Opnieuw verbinden met {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "Opnieuw verbinden met {0} in {1} seconden" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "Fout: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "Geauthenticeerd" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Gebruikmakend van proxy: {0}:{1}" smuxi-0.11/po-Engine-XMPP/da.po0000644000175000017500000002370512300202374016725 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Joe Hansen , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Danish (http://www.transifex.com/projects/p/smuxi/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "Serveren har lukke ned" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "En anden klient loggede ind med den samme ressource, du er blevet frakoblet" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "Godkendelse mislykkedes, enten er brugernavnet ikkeeksisterende eller adgangskoden er ugyldig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "hvis du ønsker at oprette en konto med det angivne bruger og den angivne adgangskode så tast /register nu" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "ikke forbundet" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "Kunne ikke finde kontakt {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "Kontakt {0} har {1} kendte ressourcer" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "{0} er ikke en kendt ressource" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "Kontakts Jid: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "Du har et fælles abonnement med denne kontakt" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "Du har intet abonnement med denne kontakt og denne kontakt har ikke abonnement hos dig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "Du har abonnement med denne kontakt, men kontakten har ikke abonnement hos dig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "Du har ikke abonnement hos denne kontakt, men kontakten har abonnement hos dig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "Ugyldig kontaktkommando: {0}" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "{0} kommandoer" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "Avancerede {0} kommandoer" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "Ugyldig port: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "Prioritet for tilgængelig er: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "Prioritet for fraværende er: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "Ugyldig prioritet: {0} (gyldige prioriteter er mellem -128 og 127 inklusive)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "{0}{1} er tilgængelig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "{0}{1} er fraværende" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "{0}{1} er udvidet fraværende" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "{0}{1} ønsker ikke at blive forstyrret" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "{0}{1} ønsker at snakke" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "{0}{1} er frakoblet" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "Tilladte automatisk {0} at abonnere på dig, da du allerede anmoder om at abonnere" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "{0}{1} ønsker at abonnere på dig" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "{0}{1} lod dig abonnere" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "Fjernede automatisk {0}s abonnement til dine tilstedeværelser efter tab af abonnement til deres" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "{0}{1} nægtede/fjernede dit abonnement" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "{0}{1} fjernede sit abonnement fra dig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "modtog en forkert udformet fejlbesked: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "{0}{1}s server kunne ikke findes" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "{0}{1} bruger allerede din anmodte ressource" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "Der er i øjeblikket ingen brugbar fejlbesked for {0}, {1}, {2}{3}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "Du har ikke rettighed til at tilgå {0}{1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "{0} dage" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "{0} timer" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "{0} minutter" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "{0} sekunder" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr "siden {0}({1})" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "Der opstod en ukendt gruppesnak: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "Der opstod en uhåndteret gruppesnak: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "Fejl i gruppesnak {0}: {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "Du er blevet inviteret til {2} af {0} da {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "Du er blevet inviteret til {1} af {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "Accepter invitation (gå til rum)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "Genforbinder til {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "Genforbinder til {0} om {1} sekunder" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "Fejl: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "Godkendt" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Bruger proxy: {0}:{1}" smuxi-0.11/po-Engine-XMPP/POTFILES.in0000644000175000017500000000006612300202374017551 0ustar00meebeymeebey00000000000000src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs smuxi-0.11/po-Engine-XMPP/pt_BR.po0000644000175000017500000001774212300202374017353 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/smuxi/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "" smuxi-0.11/po-Engine-XMPP/LINGUAS0000644000175000017500000000005512311343665017032 0ustar00meebeymeebey00000000000000cs da de es fa fi fr nl pt_BR sv te tr zh_CN smuxi-0.11/po-Engine-XMPP/de.po0000644000175000017500000002423712300202374016732 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Bianca Mix , 2013 # Mirco Bauer , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-11 20:34+0000\n" "Last-Translator: Bianca Mix \n" "Language-Team: German (http://www.transifex.com/projects/p/smuxi/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "Der Server wurde heruntergefahren" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "Ein anderer Client hat sich mit der gleichen Ressource eingeloggt. Du wurdest getrennt" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "Authentifizierung ist fehlgeschlagen, entweder existiert der Benutzername nicht oder das Password ist ungültig" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "Wenn du ein Benutzerkonto mit dem angegebenen Benutzer und Passwort erstellen möchtest, tippe jetzt /register" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "nicht verbunden" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "Konnte den Kontakt nicht finden {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "Kontakt {0} hat {1} bekannte Ressourcen" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "{0} ist keine bekannte Ressource" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "Jid des Kontakts: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "Du hast ein gegenseitiges Abonnement mit diesem Kontakt" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "Du hast kein Abonnement bei diesem Kontakt und dieser Kontakt abonniert dich nicht" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "Du abonnierst diesen Kontakt, aber der Kontakt abonniert dich nicht" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "Du abonnierst diesen Kontakt nicht, aber der Kontakt abboniert dich." #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "Ungültiger Kontakt Befehl: {0}" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "{0} Befehle" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "Erweiterte {0} Befehle" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "Ungültiger Port: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "Priorität für verfügbar ist: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "Priorität für abwesend ist: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "Ungültige Priorität: {0} (gültige Prioritäten liegen zwischen -128 und 127 einschließlich)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "{0}{1} ist verfügbar" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "{0}{1} ist abwesend" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "{0}{1} ist länger abwesend" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "{0}{1} möchte nicht gestört werden" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "{0}{1} möchte chatten" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "{0}{1} ist offline" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "Automatisch zugelassen, dass {0} dich abonniert, da du bereits um Abonnement gebeten hast" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "{0}{1} möchte dich abonnieren" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "{0}{1} gestattet, dich zu abonnieren" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "Automatisch {0}s Abonnement zu deinen Präsenzen storniert, nachdem das Abonnement zu seinen verloren ging" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "{0}{1} lehnte ab/entfernte dein Abonnement" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "{0}{1} abboniert dich nicht mehr" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "schlecht strukturierte Fehlernachricht erhalten: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "{0}{1}s Server konnte nicht gefunden werden" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "{0}{1} benutzts bereits die gewünschte Ressource" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "Es gibt momentan keine nützliche Fehlermeldung für {0}, {1}, {2}{3}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "Du bist nicht berechtigt zuzugreifen auf {0}{1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "{0} Tage" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "{0} Stunden" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "{0} Minuten" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "{0} Sekunden" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr "seit {0} ({1})" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "Ein unbekannter Gruppenchat Fehler ist aufgetreten: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "Ein unbehandelter Gruppenchat Fehler ist aufgetreten: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "Fehler im Gruppenchat {0}: {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "Du wurdest wegen {1} nach {2} von {0} eingeladen" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "Du wurdest von {0} nach {1} eingeladen" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "Einladung akzeptieren (Raum betreten)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "Verbinde erneut zu {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "Verbinde erneut zu {0} in {1} Sekunden" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "Fehler: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "Authentifiziert" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Benutze Proxy: {0}:{1}" smuxi-0.11/po-Engine-XMPP/Makefile.in.in0000644000175000017500000001532512300202374020452 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE_ENGINE_XMPP@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/po-Engine-XMPP/es.po0000644000175000017500000002403612300202374016746 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # toote, 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Spanish (http://www.transifex.com/projects/p/smuxi/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "Se cerró el servidor." #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "Otro cliente inició sesión con su mismo recurso, se finalizó esta conexión" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "Falló la autenticación, el usuario no existe o la contraseña es inválida" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "si desea crear una cuenta con el usuario y contraseña especificados, ingrese /register ahora" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "no conectado" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "No se pudo encontrar el contact {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "El contacto {0} tiene {1} recursos conocidos" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "{0} no es un recurso conocido" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "Jid del contacto: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "Posee una subscripción mutua con este contacto" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "No tiene una subscripción con este contacto y este contacto no está subscripto a su cuenta" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "Está subscripto a este contacto, pero el contacto no está subscripto a su cuenta" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "No está subscripto a este contacto pero el contacto está subscripto a su cuenta" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "Orden de contacto inválida: {0}" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "Órdenes {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "Órdenes {0} avanzadas" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "Puerto inválido: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "La prioridad para «Disponible» es: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "La prioridad para «Ausente» es: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "Prioridad inválida: {0} (las prioridades válidas son entre -128 y 127 inclusive)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "{0}{1} está disponible" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "{0}{1} está ausente" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "{0}{1} está ausente de forma prolongada" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "{0}{1} no desea ser molestado" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "{0}{1} desea conversar" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "{0}{1} no está conectado" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "Se permitió automáticamente la subscripción de {0} a su cuenta debido a que había solicitado una subscripción" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "{0}{1} desea subscribirse a su cuenta" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "{0}{1} le permitió subscribirse" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "Se eliminó automáticamente la subscripción de {0} a su cuenta luego de perder su subscripción mutua" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "{0}{1} negó/eliminó su subscripción" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "{0}{1} se desubscribió de su cuenta" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "se recibió un mensaje de error inválido: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "no se encontró el servidor de {0}{1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "{0}{1} ya está utilizado el recurso solicitado" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "Actualmente no hay un mensaje de error útil para {0}, {1}, {2}{3}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "No tiene permisos para acceder a {0}{1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "{0} días" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "{0} horas" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "{0} minutos" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "{0} segundos" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr "desde {0} ({1})" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "Ocurrió un error desconocido en el chat grupal: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "Ocurrió un error sin control en el chat grupal: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "Error en el chat grupal {0}: {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "Ha sido invitado a {2} por {0} debido a {1}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "Ha sido invitado a {1} por {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "Aceptar invitación (entrar al canal)" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "Reconectado a {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "Reconectando a {0} en {1} segundos" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "Error: {0}" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "Autenticado" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Utilizando proxy: {0}:{1}" smuxi-0.11/po-Engine-XMPP/te.po0000644000175000017500000001772012300202374016751 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-11 16:07+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/smuxi/language/te/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: te\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:212 msgid "The Server has shut down" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:215 msgid "" "Another client logged in with the same resource, you have been disconnected" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:233 msgid "" "Authentication failed, either username does not exist or invalid password" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:237 msgid "" "if you want to create an account with the specified user and password, type " "/register now" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:359 msgid "not connected" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:818 #, csharp-format msgid "Could not find contact {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:824 #, csharp-format msgid "Contact {0} has {1} known resources" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:828 #, csharp-format msgid "{0} is not a known resource" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:836 #, csharp-format msgid "Contact's Jid: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:840 msgid "You have a mutual subscription with this contact" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:843 msgid "" "You have no subscription with this contact and this contact is not " "subscribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:846 msgid "" "You are subscribed to this contact, but the contact is not subcribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:849 msgid "" "You are not subscribed to this contact, but the contact is subcribed to you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:945 #, csharp-format msgid "Invalid Contact command: {0}" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:956 #, csharp-format msgid "{0} Commands" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:981 #, csharp-format msgid "Advanced {0} Commands" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1016 #, csharp-format msgid "Invalid port: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1051 #, csharp-format msgid "Priority for Available is: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1054 #, csharp-format msgid "Priority for Away is: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1062 #, csharp-format msgid "" "Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1641 #, csharp-format msgid "{0}{1} is available" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1645 #, csharp-format msgid "{0}{1} is away" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1649 #, csharp-format msgid "{0}{1} is extended away" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1653 #, csharp-format msgid "{0}{1} wishes not to be disturbed" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1657 #, csharp-format msgid "{0}{1} wants to chat" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1664 #, csharp-format msgid "{0}{1} is offline" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1670 #, csharp-format msgid "" "Automatically allowed {0} to subscribe to you, since you are already asking " "to subscribe" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1674 #, csharp-format msgid "{0}{1} wishes to subscribe to you" msgstr "" #. you can now see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1682 #, csharp-format msgid "{0}{1} allowed you to subscribe" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1689 #, csharp-format msgid "" "Automatically removed {0}'s subscription to your presences after losing the " "subscription to theirs" msgstr "" #. you cannot (anymore?) see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1696 #, csharp-format msgid "{0}{1} denied/removed your subscription" msgstr "" #. you might still be able to see their presences #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1701 #, csharp-format msgid "{0}{1} unsubscribed from you" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1705 #, csharp-format msgid "received a malformed error message: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1712 #, csharp-format msgid "{0}{1}'s server could not be found" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1715 #, csharp-format msgid "{0}{1} is already using your requested resource" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1722 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1744 #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1758 #, csharp-format msgid "There is currently no useful error message for {0}, {1}, {2}{3}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1735 #, csharp-format msgid "You do not have permission to access {0}{1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1785 #, csharp-format msgid "{0} days" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1791 #, csharp-format msgid "{0} hours" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1795 #, csharp-format msgid "{0} minutes" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1798 #, csharp-format msgid "{0} seconds" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1810 #, csharp-format msgid " since {0} ({1})" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1888 #, csharp-format msgid "An unknown groupchat error occurred: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1904 #, csharp-format msgid "An unhandled groupchat error occurred: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:1906 #, csharp-format msgid "Error in Groupchat {0}: {1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2277 #, csharp-format msgid "You have been invited to {2} by {0} because {1}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2283 #, csharp-format msgid "You have been invited to {1} by {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2304 msgid "Accept invite (join room)" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2471 #, csharp-format msgid "Reconnecting to {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2485 #, csharp-format msgid "Reconnecting to {0} in {1} seconds" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2515 #, csharp-format msgid "Error: {0}" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2527 msgid "Authenticated" msgstr "" #: ../src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs:2574 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "" smuxi-0.11/FEATURES0000644000175000017500000000043111655545675014560 0ustar00meebeymeebey00000000000000/** * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ */ - GTK+ frontend - GNOME frontend - multiplexed engine - multiple user support - multiple server connections - nickname completion - alt+# hotkey ("1" to "0" and "q" to "p") for tabs - controlling tabs with "/window" command smuxi-0.11/ltsugar.m40000644000175000017500000001042412311344225015317 0ustar00meebeymeebey00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) smuxi-0.11/ltoptions.m40000644000175000017500000003007312311344225015673 0ustar00meebeymeebey00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) smuxi-0.11/missing0000755000175000017500000001533012311344234014774 0ustar00meebeymeebey00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: smuxi-0.11/po-Server/0000755000175000017500000000000012311344242015254 5ustar00meebeymeebey00000000000000smuxi-0.11/po-Server/fi.po0000644000175000017500000001002612300202374016206 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Kalle Kaitala , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2013-08-23 06:17+0000\n" "Last-Translator: Kalle Kaitala \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/smuxi/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Lisää käyttäjä palvelimeen" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Muokkaa olemassaolevaa palvelimen käyttäjää" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Poista käyttäjä palvelimelta" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Listaa kaikki palvelimen käyttäjät" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Luotava, muokattava tai poistettava käyttäjä" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Käyttäjän salasana, jos luodaan tai muokataan käyttäjää" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "Vianetsinnän tuloste päälle" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "Optimoi viestipuskurit ja poistu (validit arvot: none, defrag, index, all)" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Näytä tämä aputeksti" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "Käyttö: smuxi-server [vaihtoehdot]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Vaihtoehdot:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Tuntematon vaihtoehto: '{0}'" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Komentorivin virhe: {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "Vain yhtä komennoista --add-user, --modify-user tai --delete-user voi käyttää kerralla." #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "Käyttäjänimen ilmoittaminen --username -komennolla on pakollista." #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "Käyttäjänimi ei saa olla tyhjä." #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "Salasanan ilmoittaminen --password -vaihtoehdolla on pakollista." #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "Salasana ei saa olla tyhjä." #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "Epäkelpo optimointiarvo välitetty komennolle --optimize-message-buffer, kelvolliset arvot ovat: {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "Käyttäjä \"{0}\" lisätty palvelimelle onnistuneesti." #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "Käyttäjää \"{0}\" muokattu onnistuneesti." #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "Käyttäjä \"{0}\" poistettu palvelimelta onnistuneesti." #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Käyttäjät:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "{0} viestipuskuria optimoitu onnistuneesti." #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "Viestipuskurien optimointi epäonnistui: {0}" smuxi-0.11/po-Server/zh_CN.po0000644000175000017500000000741112300202374016615 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Dean Lee , 2012 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2013-12-13 08:10+0000\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/smuxi/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "将用户添加到服务器" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "修改服务器上现存的用户" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "将用户从服务器删除" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "列出服务器上所有现存的用户" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "要创建、修改或删除的用户" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "要创建或修改的用户的密码" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "启用调试输出" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "优化信息缓存并退出 (有效值: none、defrag、index、all)" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "显示本帮助" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "用法: smuxi-server [选项]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "选项:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "未知选项: '{0}'" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "命令行错误: {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "--add-user、--modify-user 与 --delete-user 三者每次只能用一个。" #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "您必须通过 --username 选项指定用户名。" #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "用户名不能为空。" #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "您必须通过 --password 选项指定密码。" #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "密码不能为空。" #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "传递给 --optimize-message-buffer 的优化参数值无效,有效值有: {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "成功将用户 \"{0}\" 添加到服务器。" #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "成功修改用户 \"{0}\"。" #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "成功将用户 \"{0}\" 从服务器删除。" #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "用户:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "成功优化 {0} 块信息缓存。" #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "无法优化信息缓存: {0}" smuxi-0.11/po-Server/POTFILES.skip0000644000175000017500000000044612300202374017372 0ustar00meebeymeebey00000000000000glade/ src/Common/ src/Engine/ src/Engine-Campfire/ src/Engine-IRC/ src/Engine-JabbR/ src/Engine-XMPP/ src/Engine-Twitter/ src/Frontend/ src/Frontend-GNOME-IRC/ src/Frontend-GNOME-Twitter/ src/Frontend-GNOME-XMPP/ src/Frontend-GNOME/ src/Frontend-STFL/ src/Frontend-SWF/ src/Frontend-WPF/ lib/ smuxi-0.11/po-Server/tr.po0000644000175000017500000000663012300202374016243 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Umut Albayrak , 2011,2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2013-09-06 16:23+0000\n" "Last-Translator: Umut Albayrak \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/smuxi/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Sunucuya bir kişi ekle" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Sunucudaki kişiyi değiştir" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Sunucudaki kişiyi sil" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Sunucudaki tüm kişileri listele" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Oluşturulacak, değiştirilecek ya da silinecek kişiler" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Oluştururken ya da değiştirirken kişinin şifresi" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Yardımı göster" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Tercihler:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Bilinmeyen tercih: '{0}'" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Komut satırı hatası: '{0}'" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "" #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "" #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "Kullanıcı adı boş olmamalı" #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "" #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "Şifre boş olmamalı" #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "\"{0}\" kişisi başarıyla sunucuya eklendi" #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "\"{0}\" kişisi başarıyla değiştirildi" #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "\"{0}\" kişisi başarıyla sunucudan silindi" #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Kişiler:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "" #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "" smuxi-0.11/po-Server/pt.po0000644000175000017500000001517212300202374016242 0ustar00meebeymeebey00000000000000# Translation of smuxi-frontend messages to Portuguese # Copyright (C) 2010 the smuxi's copyright holder # This file is distributed under the same license as the smuxi-frontend package. # # Américo Monteiro , 2010. # Pedro Ribeiro , 2012. # msgid "" msgstr "" "Project-Id-Version: smuxi-frontend \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-07-25 06:26+0200\n" "PO-Revision-Date: 2012-07-30 09:16+0100\n" "Last-Translator: Pedro Ribeiro \n" "Language-Team: Portuguese \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Acrescentar utilizador ao Servidor" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Modificar utilizador existente" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Apagar utilizador do Servidor" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Listar todos os utilizadores do Servidor" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Utilizador a criar, modificar ou apagar" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Palavra-chave do utilizador ao criar ou modificar um utilizador" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "Ativar saída de debug" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "" "Optimizar buffers de mensagens e sair (valores válidos: none, defrag, index, " "all) " #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Mostrar esta ajuda" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "Utilização: smuxi-server [opções]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Opções:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Opção Desconhecida: '{0}'" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Erro na linha de comandos: {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a " "time." msgstr "" "Só pode ser usado um de --add-user, --modify-user ou --delete-user de cada " "vez." #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "Tem que indicar um nome de utilizador com a opção --username." #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "O nome de utilizador não deve estar vazio" #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "Tem que indicar uma palavra-chave com a opção --password." #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "A palavra-chave não deve estar vazia" #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values " "are: {0}" msgstr "" "Valor de optimização inválido passado para --optimize-message-buffer. Os " "valores válidos são: {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "Utilizador \"{0}\" adicionado ao servidor com sucesso." #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "Utilizador \"{0}\" modificado com sucesso." #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "Utilizador \"{0}\" removido do servidor com sucesso." #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Utilizadores:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "{0} buffers de mensagens optimizados com sucesso." #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "Falhou a optimização dos buffers de mensagens: {0}" #~ msgid "Engine does not exist." #~ msgstr "Não existe esse 'Engine'." #~ msgid "" #~ "Unknown channel ({0}) - only the following channel types are supported:" #~ msgstr "" #~ "Canal desconhecido ({0}) - apenas os seguintes tipos de canais são " #~ "suportados:" #~ msgid "" #~ "Registration with engine failed! The username and/or password were wrong " #~ "- please verify them." #~ msgstr "" #~ "O registo com o motor falhou! O nome de utilizador e/ou a palavra-passe " #~ "estavam errados - por favor verifique-os." #~ msgid "SSH client application was not found: " #~ msgstr "A aplicação cliente SSH não foi encontrada: " #~ msgid "" #~ "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty." #~ "exe)" #~ msgstr "" #~ "O cliente SSH tem de ser ou OpenSSH (ssh) ou Plink (plink.exe, não putty." #~ "exe)" #~ msgid "" #~ "The local SSH forwarding port {0} is already in use. Is there an old SSH " #~ "tunnel still active?" #~ msgstr "" #~ "O porto de encaminhamento de SSH local {0} já está em uso. Existe um " #~ "túnel SSH antigo ainda activo?" #~ msgid "" #~ "SSH tunnel setup failed (exit code: {0})\n" #~ "\n" #~ "SSH program: {1}\n" #~ "SSH parameters: {2}\n" #~ "\n" #~ "Program Error:\n" #~ "{3}\n" #~ "Program Output:\n" #~ "{4}\n" #~ msgstr "" #~ "Configuração do túnel SSH falhou (código ao terminar: {0})\n" #~ "\n" #~ "Programa SSH: {1}\n" #~ "Parâmetros SSH: {2}\n" #~ "\n" #~ "Erro do Programa:\n" #~ "{3}\n" #~ "Saída do Programa:\n" #~ "{4}\n" #~ msgid "SSH keyfile not found." #~ msgstr "Ficheiro de chaves SSH não encontrado." #~ msgid "SSH keyfile could not be read." #~ msgstr "Ficheiro de chaves SSH não pode ser lido." #~ msgid "" #~ "OpenSSH version number not found (exit code: {0})\n" #~ "\n" #~ "SSH program: {1}\n" #~ "\n" #~ "Program Error:\n" #~ "{2}\n" #~ "Program Output:\n" #~ "{3}\n" #~ msgstr "" #~ "Número de versão de OpenSSH não encontrado (código ao terminar: {0})\n" #~ "\n" #~ "Programa SSH: {1}\n" #~ "\n" #~ "Erro do Programa:\n" #~ "{2}\n" #~ "Saída do Programa:\n" #~ "{3}\n" #~ msgid "PuTTY / Plink requires a username to be set." #~ msgstr "PuTTY / Plink requer que seja definido um nome de utilizador." #~ msgid "" #~ "Plink version number not found (exit code: {0})\n" #~ "\n" #~ "SSH program: {1}\n" #~ "\n" #~ "Program Error:\n" #~ "{2}\n" #~ "Program Output:\n" #~ "{3}\n" #~ msgstr "" #~ "Número de versão de Plink não encontrado (código ao terminar: {0})\n" #~ "\n" #~ "Programa SSH: {1}\n" #~ "\n" #~ "Erro do Programa:\n" #~ "{2}\n" #~ "Saída do Programa:\n" #~ "{3}\n" smuxi-0.11/po-Server/fa.po0000644000175000017500000000556712300202374016214 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2013-08-19 12:20+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Persian (http://www.transifex.com/projects/p/smuxi/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "" #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "" #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "" #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "" #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "" #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "" #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "" #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "" #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "" #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "" smuxi-0.11/po-Server/fr.po0000644000175000017500000001022512300202374016220 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Clément Bourgeois , 2011 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2013-04-29 08:41+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: French (http://www.transifex.com/projects/p/smuxi/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Ajouter un utilisateur au serveur" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Modifier un utilisateur existant du serveur" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Supprimer un utilisateur du serveur" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Lister tous les utilisateurs existants du serveur" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Utilisateur à créer, modifier ou supprimer" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Mot de passe utilisé pendant la création ou la modification d'un utilisateur." #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "Activer la sortie de déboguage" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "Optimiser les tampons de messages et sortir (valeurs valides: none, defrag, index, all)" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Affiche cette aide" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "Usage : smuxi-server [options]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Options :" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Option inconnue : '{0}'" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Erreur de ligne de commande : {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "Les options -a|--add-user ou -m|--modify-user et -d|-delete-user ne peuvent pas être utilisées en même temps." #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "Vous devez spécifier un nom d'utilisateur avec l'option --username." #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "Le nom d'utilisateur ne peut pas être vide." #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "Vous devez spécifier un mot de passe avec l'option --password." #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "Le mot de passe ne peut pas être vide." #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "Valeur d'optimisation passée à --optimize-message-buffer invalide, les valeurs valides sont : {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "L'utilisateur \"{0}\" a été ajouté avec succès au serveur." #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "L'utilisateur \"{0}\" a été modifié avec succès." #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "L'utilisateur : \"{0}\" a été supprimé de la configuration avec succès." #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Utilisateurs :" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "Optimisation des tampons de messages {0} réalisée avec succès." #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "Impossible d'optimiser les tampon de messages : {0}" smuxi-0.11/po-Server/sv.po0000644000175000017500000000770612300202374016253 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # flugsio , 2011 # Martin Bagge , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2013-12-10 14:46+0000\n" "Last-Translator: Martin Bagge \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/smuxi/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sv\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Lägg till användare till server" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Redigera existerande användare på server" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Radera användare från server" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Visa alla existerande användare på server" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Användare att skapa, redigera eller radera" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Lösenord för användaren som skapas eller redigeras" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "Aktivera utskrift av fellogg" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "Optimera meddelandebuffertarna och avsluta (giltiga värden: none, defrag, index, all)" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Visa den här hjälpen" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "Använding: smuxi-server [flaggor]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Flaggor:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Okänd flagga: \"{0}\"" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Komandoradsfel: {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "Endast en av --add-user, --modify-user eller --delete-user kan användas i taget." #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "Du måste ange ett användarnamn med flaggan --username." #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "Användarnamnet får inte vara tomt." #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "Du måste ange ett lösenord med flaggan --pasword." #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "Lösenordet kan inte vara tomt." #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "Ogiltigt optimeringsvärde för --optimize-message-buffer, giltiga värden är: {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "Användaren \"{0}\" lades till korrekt i servern." #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "Användaren \"{0}\" redigerad.." #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "Användaren \"{0}\" raderades från servern." #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Användare:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "Lyckades optimera {0} meddelandebufftertar." #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "Misslyckades att optimera buffertar: {0}" smuxi-0.11/po-Server/cs.po0000644000175000017500000000777212300202374016233 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Ondřej Hošek , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2013-05-22 17:22+0000\n" "Last-Translator: Ondřej Hošek \n" "Language-Team: Czech (http://www.transifex.com/projects/p/smuxi/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Přidat uživatele na server" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Upravit existujícího uživatele serveru" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Smazat uživatele ze serveru" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Procházet všechny existující uživatele serveru" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Uživatel, který se má přidat, upravit či smazat" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Heslo vytvářeného či upravovaného uživatele" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "Povolit ladicí informace" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "Optimalizovat buffery zpráv a ukončit (platné hodnoty: none, defrag, index, all)" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Ukázat tuto nápovědu" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "Používání: smuxi-server [volby]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Volby:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Neznámá volba: '{0}'" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Chybný příkaz: {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "V současné době můžete použít jednu z těchto voleb: --add-user, --modify-user a --delete-user." #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "U volby --username musíte zadat uživatelské jméno." #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "Uživatelské jméno nemůže být prázdné." #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "U volby --password musíte zadat heslo." #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "Heslo nemůže být prázdné." #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "Neplatná hodnota předaná volbě --optimize-message-buffer; platné hodnoty jsou: {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "Uživatel \"{0}\" byl úspěšně přidán na server." #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "Uživatel \"{0}\" byl úspěšně upraven." #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "Uživatel \"{0}\" byl úspěšně smazán ze serveru." #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Uživatelé:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "Podařilo se optimalizovat buffery zpráv: {0}" #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "Optimalizace bufferů zpráv selhala: {0}" smuxi-0.11/po-Server/nl.po0000644000175000017500000001005112311343665016232 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Jeroen Baten , 2013 # Mirco Bauer , 2014 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2014-03-16 12:51+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/smuxi/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Voeg gebruiker toe aan Server" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Wijzig bestaande gebruiker van Server" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Verwijder gebruiker van Server" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Toon alle bestaande gebruikers van Server" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Gebruiker om te maken, wijzigen of verwijderen" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Wachtwoord van de gebruiker voor het maken of wijzigen van een gebruiker" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "Debuguitvoer aanzetten" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "Optimaliseer meldingenbuffers en sluit af (toegestande waardes: none, defrag, index, all)" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Toon deze helptekst" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "Gebruik: smuxi-server [opties]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Opties:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Onbekende optie: '{0}'" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Commandoregelfout: {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "Maximaal één van de --add-user, --modify-user, of --delete-user kan tegelijk worden gebruikt." #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "U dient een gebruikersnaam te specificeren met de --username optie." #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "Gebruikersnaam mag niet leeg zijn." #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "U dient een wachtwoord te specificeren met de --password optie." #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "Wachtwoord mag niet leeg zijn." #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "Ongeldige optimalisatiewaardes doorgegeven via --optimize-message-buffer, geldige waardes zijn: {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "Gebruiker \"{0}\" met succes toegevoegd aan de server." #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "Gebruiker \"{0}\" met succes gewijzigd." #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "Gebruiker \"{0}\" met succes verwijderd van de server." #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Gebruikers:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "Met succes {0} meldingenbuffers geoptimaliseerd." #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "Optimaliseren van meldingenbuffers is niet gelukt: {0}" smuxi-0.11/po-Server/da.po0000644000175000017500000000756112300202374016206 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Joe Hansen , 2011 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2013-04-29 08:41+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Danish (http://www.transifex.com/projects/p/smuxi/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Tilføj bruger til Server" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Ændr eksisterende bruger af Server" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Slet bruger fra Server" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Vis alle eksisterende brugere af Server" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Bruger at oprette, ændre eller slette" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Adgangskode på brugeren når en bruger oprettes eller ændres" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "Aktiver fejlsøgningsuddata" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "Optimer mellemlager for beskeder og afslut (gyldige værdier: none, defrag, index, all)" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Vis denne hjælp" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "Brug: smuxi-server [tilvalg]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Tilvalg:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Ukendt tilvalg: '{0}'" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Kommandolinjefejl: {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "Kun en af brugerne --add-user, --modify-user eller --delete-user kan bruges på samme tid." #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "Du skal angive et brugernavn med tilvalget --username." #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "Brugernavn må ikke være tomt." #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "Du skal angive en adgangskode med tilvalget --password." #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "Adgangskode må ikke være tomt." #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "Ugyldig optimeringsværdi sendt til --optimize-message-buffer, gyldige værdier er: {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "Bruger »{0}« tilføjet til server." #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "Bruger »{0}« ændret." #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "Bruger »{0}« slettet fra server." #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Brugere:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "Lykkedes med optimering af {0} beskedmellemlagre." #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "Kunne ikke optimere beskedmellemlagre: {0}" smuxi-0.11/po-Server/POTFILES.in0000644000175000017500000000005012300202374017021 0ustar00meebeymeebey00000000000000src/Server/Server.cs src/Server/Main.cs smuxi-0.11/po-Server/pt_BR.po0000644000175000017500000001000312300202374016611 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Leonardopf , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2013-07-10 20:52+0000\n" "Last-Translator: Leonardopf \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/smuxi/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Adicionar usuário ao Servidor" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Modificar usuário existente no Servidor" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Apagar usuário do Servidor" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Exibir todos usuários existentes do Servidor" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Usuário para criar, modificar ou apagar" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Senha do usuário ao criar ou modificar um usuário" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "Ativar saída em modo debug" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "Otimizar os buffers de mensagens e sair (Valores válidos: none, defrag, index, all)" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Mostrar esta ajuda" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "Modo de usar: smuxi-server [opções]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Opções:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Opção desconhecida: '{0}'" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Erro linha de comando: {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "No máximo um de --add-user, --modify-user, e --delete-user pode ser usado por vez." #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "Você deve especificar um nome de usuário com a opção --username." #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "Nome de usuário não pode estar vazio." #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "Você deve especificar uma senha com a opção --password." #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "Senha não pode estar vazia." #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "Valores de otimização invalido passados por --optimize-message-buffer. Os valores válidos são: {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "Usuário \"{0}\" adicionado com sucesso ao servidor." #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "Usuário \"{0}\" editado com sucesso." #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "Usuário \"{0}\" apagado com sucesso do servidor." #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Usuários:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "Otimização do buffers de mensagem de {0} feito com sucesso." #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "Erro ao otimizar buffers de mensagem: {0}" smuxi-0.11/po-Server/pl.po0000644000175000017500000001021512300202374016223 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:21+0100\n" "PO-Revision-Date: 2012-01-07 11:26+0000\n" "Last-Translator: lukasznaw \n" "Language-Team: Polish (http://www.transifex.net/projects/p/smuxi/team/pl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pl\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Dodaj nowego użytkownika do serwera" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Modyfikuj użytkownika istniejącego na serwerze" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Usuń użytkownika z serwera" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Pokaż wszystkich użytkowników istniejących na serwerze" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Użytkownik do stworzenia, modyfikacji albo usunięcia" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Hasło użytkownika podczas tworzenia/modyfikowania" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "Włącz debugowanie" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "" "Optymalizuj bufor(y) wiadomości i wyjdź (prawidłowe wartości: none, defrag, " "index, all)" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Pokaż tą pomoc" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "Zastosowanie: smuxi-server [opcje]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Opcje:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Nieznana opcja: '{0}'" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Błąd linii poleceń: {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "" "Najwyżej jedna komenda --add-user, --modify-user i --delete-user może być " "użyta w tym samym czasie." #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "Musisz podać nazwę użytkownika z opcją --username." #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "Nazwa użytkownika nie może być pusta." #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "Musisz podać hasło z opcją --password." #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "Hasło nie może być puste." #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "" "Nieprawidłowa wartość optymalizacji przekazana do --optimize-message-buffer," " prawidłowe wartości to: {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "Użytkownik \"{0}\" pomyślnie dodany do serwera." #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "Użytkownik \"{0}\" pomyślnie zmodyfikowany" #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "Użytkownik \"{0}\" pomyślnie usunięty z serwera." #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Użytkownicy" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "Pomyślnie zoptymalizowano {0} bufor(ów) wiadomości." #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "Nie udało się zoptymalizować {0} bufora(ów) wiadomości" smuxi-0.11/po-Server/LINGUAS0000644000175000017500000000007112311343665016307 0ustar00meebeymeebey00000000000000cs da de es fa fi fr hr it nl pl pt pt_BR sv te tr zh_CN smuxi-0.11/po-Server/it.po0000644000175000017500000000633712300202374016236 0ustar00meebeymeebey00000000000000# ITALIAN TRANSLATION OF SMUXI-SERVER. # COPYRIGHT (C) 2010 THE SMUXI-SERVER'S COPYRIGHT HOLDER # This file is distributed under the same license as the smuxi-server package. # # Vincenzo Campanella , 2010. # msgid "" msgstr "" "Project-Id-Version: smuxi-server\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2010-09-11 12:19+0200\n" "Last-Translator: Vincenzo Campanella \n" "Language-Team: Italian \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/Server/Main.cs:69 msgid "Add user to Server" msgstr "Aggiungi un utente al server" #: ../src/Server/Main.cs:78 msgid "Modify existing user of Server" msgstr "Modifica un utente esistente del server" #: ../src/Server/Main.cs:87 msgid "Delete user from Server" msgstr "Elimina un utente dal server" #: ../src/Server/Main.cs:96 msgid "List all existing users of Server" msgstr "Elenca tutti gli utenti esistenti del server" #: ../src/Server/Main.cs:105 msgid "User to create, modify or delete" msgstr "Utente da creare, modificare o eliminare" #: ../src/Server/Main.cs:114 msgid "Password of the user when creating or modifying a user" msgstr "Password dell'utente durante la creazione o la modifica di un utente" #: ../src/Server/Main.cs:123 msgid "Enable debug output" msgstr "Abilita l'output del debug" #: ../src/Server/Main.cs:131 msgid "Show this help" msgstr "Mostra questo aiuto" #: ../src/Server/Main.cs:133 msgid "Usage: smuxi-server [options]" msgstr "Utilizzo: smuxi-server [opzioni]" #: ../src/Server/Main.cs:135 msgid "Options:" msgstr "Opzioni:" #: ../src/Server/Main.cs:146 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Opzione sconosciuta: «{0}»" #: ../src/Server/Main.cs:170 #, csharp-format msgid "Command line error: {0}" msgstr "Errore da riga di comando: {0}" #: ../src/Server/Main.cs:214 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a " "time." msgstr "" "È possibile utilizzare contemporaneamente al massimo uno fra «--add-user», " "«--modify-user» e «--delete-user»." #: ../src/Server/Main.cs:224 msgid "You must specify a username with the --username option." msgstr "" "È necessario specificare un nome utente, mediante l'opzione «--username»." #: ../src/Server/Main.cs:230 msgid "Username must not be empty." msgstr "Il nome utente non può essere vuoto." #: ../src/Server/Main.cs:240 msgid "You must specify a password with the --password option." msgstr "" "È necessario specificare una password, mediante l'opzione «--password»." #: ../src/Server/Main.cs:246 msgid "Password must not be empty." msgstr "La password non può essere vuota." #: ../src/Server/Main.cs:263 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "L'utente «{0}» è stato aggiunto al server." #: ../src/Server/Main.cs:272 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "L'utente «{0}» è stato modificato." #: ../src/Server/Main.cs:281 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "L'utente «{0}» è stato eliminato dal server." #: ../src/Server/Main.cs:288 msgid "Users:" msgstr "Utenti:" smuxi-0.11/po-Server/de.po0000644000175000017500000001013012300202374016174 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Bianca Mix , 2011 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2013-04-29 08:41+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: German (http://www.transifex.com/projects/p/smuxi/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Benutzer zum Server hinzufügen" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Verändern eines bereits existierenden Benutzers des Servers" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Benutzer vom Server entfernen" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Liste alle vorhandenen Benutzer des Servers" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Benutzer, der erstellt, verändert oder entfernt werden soll" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Passwort für den Benutzer, wenn Benutzer erstellt oder verändert werden soll" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "Aktivieren der Ausgabe zur Fehlerbeseitigung" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "Optimiere Nachrichtenpuffer und Verlassen (Gültige Werte: none, defrag, index, all)" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Zeige diese Hilfe an" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "Verwendung: smuxi-server [options]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Optionen:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Unbekannte Auswahl: '{0}'" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Kommandozeilenfehler: {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "Höchstens einer der Optionen --add-user, --modify-user, und --delete-user darf gleichzeitig verwendet werden." #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "Sie müssen einen Benutzernamen mit der Option --username angeben." #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "Benutzername darf nicht leer sein." #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "Sie müssen ein Passwort mit der --password Option angeben." #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "Passwort darf nicht leer sein." #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "Ungültige Optimierungswerte übergeben an --optimize-message-buffer, gültige Werte sind: {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "Benutzer \"{0}\" wurde erfolgreich zum Server hinzugefügt." #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "Benutzer \"{0}\" wurde erfolgreich verändert." #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "Benutzer \"{0}\" wurde erfolgreich vom Server entfernt." #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Benutzer:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "Erfolgreich {0} Nachrichtenpuffer optimiert" #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "Optimierung der Nachrichtenpuffer fehlgeschlagen: {0}" smuxi-0.11/po-Server/Makefile.in.in0000644000175000017500000001532012300202374017724 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE_SERVER@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/po-Server/es.po0000644000175000017500000001010312300202374016213 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # toote, 2013 # Ricardo Hermosilla , 2012 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2013-12-10 19:01+0000\n" "Last-Translator: toote\n" "Language-Team: Spanish (http://www.transifex.com/projects/p/smuxi/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Agregar usuario al servidor" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Modificar un usuario existente en el servidor" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Borrar usuario del servidor" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Enumerar todos los usuarios existentes en el servidor" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Usuario a crear, modificar o borrar" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Contraseña del usuario que se está creando o modificando" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "Habilitar salida de depuración" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "Optimizar buffers de mensaje y salida (valores válidos: none, defrag, index, all)" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Mostrar esta ayuda" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "Modo de uso: smuxi-server [opciones]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Opciones:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Opción desconocida: «{0}»" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Error de línea de órdenes: {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "Sólo puede utilizar una de las siguientes opciones al mismo tiempo: --add-user, --modify-user o --delete-user." #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "Debe especificar un nombre de usuario con la opción --username." #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "El nombre de usuario no puede estar vacío." #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "Debe especificar una contraseña con la opción --password." #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "La contraseña no puede estar vacía." #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "Se pasó un valor de optimización inválido a pasado --optimize-message-buffer, los valores válidos son: {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "Se ha añadido correctamente el usuario «{0}» al servidor." #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "Se ha modificado correctamente el usuario «{0}»." #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "Se ha borrado correctamente el usuario «{0}» del servidor." #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Usuarios:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "Se optimizaron correctamente {0} buffers de mensaje." #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "Fallo al optimizar buffers de mensaje: {0}" smuxi-0.11/po-Server/te.po0000644000175000017500000000674012300202374016230 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # ప్రవీణ్ ఇళ్ళ , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:02+0100\n" "PO-Revision-Date: 2013-12-12 04:49+0000\n" "Last-Translator: ప్రవీణ్ ఇళ్ళ \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/smuxi/language/te/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: te\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "వాడుకరిని సేవకానికి జతచేయి" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "సేవకములో ఉన్నటువంటి వాడుకరిని సవరించు" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "వాడుకరిని సేవకము నుండి తొలగించు" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "ఈ సహాయాన్ని చూపించు" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "ఐచ్ఛికాలు:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "" #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "" #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "వాడుకరిపేరు ఖాళీగా ఉండకూడదు." #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "" #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "సంకేతపదం ఖాళీగా ఉండకూడదు." #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "" #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "" #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "" #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "వాడుకరులు:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "" #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "" smuxi-0.11/po-Server/hr.po0000644000175000017500000001017112300202374016222 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:21+0100\n" "PO-Revision-Date: 2012-01-08 10:34+0000\n" "Last-Translator: Matias M. \n" "Language-Team: Croatian (http://www.transifex.net/projects/p/smuxi/team/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hr\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2\n" #: ../src/Server/Main.cs:71 msgid "Add user to Server" msgstr "Dodaj korisnika na poslužitelj" #: ../src/Server/Main.cs:80 msgid "Modify existing user of Server" msgstr "Uredi postojećeg korisnika poslužitelja" #: ../src/Server/Main.cs:89 msgid "Delete user from Server" msgstr "Ukloni korisnika sa poslužitelja" #: ../src/Server/Main.cs:98 msgid "List all existing users of Server" msgstr "Ispiši sve postojeće korisnike poslužitelja" #: ../src/Server/Main.cs:107 msgid "User to create, modify or delete" msgstr "Korisnik za stvaranje, uređivanje ili uklanjanje" #: ../src/Server/Main.cs:116 msgid "Password of the user when creating or modifying a user" msgstr "Lozinka korisnika pri stvaranju ili uređivanju korisnika" #: ../src/Server/Main.cs:125 msgid "Enable debug output" msgstr "Omogući debug ispis" #: ../src/Server/Main.cs:133 msgid "" "Optimize message buffers and exit (valid values: none, defrag, index, all)" msgstr "" "Optimiziraj međuspremnike poruka i zatvori (važeće vrijednosti: none, " "defrag, index, all)" #: ../src/Server/Main.cs:146 msgid "Show this help" msgstr "Prikaži ovu pomoć" #: ../src/Server/Main.cs:148 msgid "Usage: smuxi-server [options]" msgstr "Upotreba: smuxi-server [opcije]" #: ../src/Server/Main.cs:150 msgid "Options:" msgstr "Opcije:" #: ../src/Server/Main.cs:161 #, csharp-format msgid "Unknown option: '{0}'" msgstr "Nepoznata opcija: '{0}'" #: ../src/Server/Main.cs:188 #, csharp-format msgid "Command line error: {0}" msgstr "Pogreška komandne linije: {0}" #: ../src/Server/Main.cs:232 msgid "" "At most one of --add-user, --modify-user, and --delete-user may be used at a" " time." msgstr "" "Najviše jedna naredba --add-user, --modify-user, ili --delete-user mogu biti" " korištene istovremeno." #: ../src/Server/Main.cs:242 msgid "You must specify a username with the --username option." msgstr "Morate odrediti korisničko ime sa --username opcijom." #: ../src/Server/Main.cs:248 msgid "Username must not be empty." msgstr "Korisničko ime ne smije biti prazno." #: ../src/Server/Main.cs:258 msgid "You must specify a password with the --password option." msgstr "Morate odrediti lozinku sa --password opcijom." #: ../src/Server/Main.cs:264 msgid "Password must not be empty." msgstr "Lozinka ne smije biti prazna." #: ../src/Server/Main.cs:283 #, csharp-format msgid "" "Invalid optimization value passed to --optimize-message-buffer, valid values" " are: {0}" msgstr "" "Nevažeća optimizacijska vrijednost dodijeljena --optimize-message-bufferu, " "važeće vrijednosti su: {0}" #: ../src/Server/Main.cs:303 #, csharp-format msgid "User \"{0}\" successfully added to server." msgstr "Dodavanje korisnika \"{0}\" na poslužitelj uspješno izvršeno." #: ../src/Server/Main.cs:312 #, csharp-format msgid "User \"{0}\" successfully modified." msgstr "Uređivanje korisnika \"{0}\" uspješno izvršeno." #: ../src/Server/Main.cs:321 #, csharp-format msgid "User \"{0}\" successfully deleted from server." msgstr "Uklanjanje korisnika \"{0}\" sa poslužitelja uspješno izvršeno." #: ../src/Server/Main.cs:328 msgid "Users:" msgstr "Korisnici:" #: ../src/Server/Main.cs:376 #, csharp-format msgid "Successfully optimized {0} message buffers." msgstr "Međuspremnici poruka {0} uspješno optimizirani." #: ../src/Server/Main.cs:389 #, csharp-format msgid "Failed to optimize message buffers: {0}" msgstr "Optimizacija međuspremnika poruka {0} nije uspjela." smuxi-0.11/po-Frontend-GNOME-IRC/0000755000175000017500000000000012311344243017044 5ustar00meebeymeebey00000000000000smuxi-0.11/po-Frontend-GNOME-IRC/fi.po0000644000175000017500000000436712300202374020010 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Kalle Kaitala , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-11-19 16:27+0000\n" "Last-Translator: Kalle Kaitala \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/smuxi/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "Yksityisviesti" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "Operaattori" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "Deop" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "Ääni" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "Poista Ääni" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "Potki" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "Potki + porttikielto" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "Porttikielto" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "Poista porttikielto" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "Kutsu..." #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "Versio" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "Aika" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "Finger" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "Userinfo" smuxi-0.11/po-Frontend-GNOME-IRC/zh_CN.po0000644000175000017500000000442312300202374020404 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Dean Lee , 2012 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-13 08:16+0000\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/smuxi/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "私聊" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "设为版主" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "撤销版主" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "设为认证用户" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "撤销认证用户" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "踢除" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "踢除 + 封禁" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "封禁" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "解封" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "详情" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "邀请加入" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "版本" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "用户时间" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "真实姓名与空闲时间" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "用户信息" smuxi-0.11/po-Frontend-GNOME-IRC/POTFILES.skip0000644000175000017500000000043212300202374021154 0ustar00meebeymeebey00000000000000glade/ src/Common/ src/Engine/ src/Engine-Campfire/ src/Engine-IRC/ src/Engine-JabbR/ src/Engine-XMPP/ src/Engine-Twitter/ src/Frontend/ src/Frontend-GNOME/ src/Frontend-GNOME-Twitter/ src/Frontend-GNOME-XMPP/ src/Frontend-STFL/ src/Frontend-SWF/ src/Frontend-WPF/ src/Server/ lib/ smuxi-0.11/po-Frontend-GNOME-IRC/tr.po0000644000175000017500000000414112300202374020025 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # zeugma , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-11-19 16:27+0000\n" "Last-Translator: zeugma \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/smuxi/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "Tekme" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "Sürüm" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "" smuxi-0.11/po-Frontend-GNOME-IRC/pt.po0000644000175000017500000000447512300202374020035 0ustar00meebeymeebey00000000000000# Translation of smuxi-frontend-gnome-irc messages to Portuguese # Copyright (C) 2010 the smuxi's copyright holder # This file is distributed under the same license as the smuxi-frontend-gnome-irc package. # # Américo Monteiro , 2010. msgid "" msgstr "" "Project-Id-Version: smuxi-frontend-gnome-irc \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-11 11:55+0200\n" "PO-Revision-Date: 2010-07-15 01:56+0100\n" "Last-Translator: Américo Monteiro \n" "Language-Team: Portuguese \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:340 msgid "Op" msgstr "Dar Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:344 msgid "Deop" msgstr "Retirar Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:348 msgid "Voice" msgstr "Dar Voz" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:352 msgid "Devoice" msgstr "Retirar Voz" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:356 msgid "Kick" msgstr "Expulsar" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:360 msgid "Kick + Ban" msgstr "Expulsar + Banir" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:364 msgid "Ban" msgstr "Banir" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:368 msgid "Unban" msgstr "Retirar dos Banidos" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:374 msgid "Query" msgstr "Questionar" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:378 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:61 msgid "Whois" msgstr "Quem é" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:382 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:65 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:391 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:72 msgid "Invite to" msgstr "Convidar para" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:72 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:77 msgid "Version" msgstr "Versão" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:82 msgid "Time" msgstr "Hora" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:87 msgid "Finger" msgstr "Finger" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:92 msgid "Userinfo" msgstr "Informação do utilizador" smuxi-0.11/po-Frontend-GNOME-IRC/fa.po0000644000175000017500000000405212300202374017767 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-11-19 16:27+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Persian (http://www.transifex.com/projects/p/smuxi/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "" smuxi-0.11/po-Frontend-GNOME-IRC/fr.po0000644000175000017500000000427312300202374020015 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-11-19 16:27+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: French (http://www.transifex.com/projects/p/smuxi/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "Chat privé" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "Opper" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "Enlever l'Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "Voicer" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "Enlever le Voice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "Kicker" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "Kicker + Bannir" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "Bannir" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "Enlever le ban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "Inviter à" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "Version" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "Temps" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "Finger" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "Userinfo" smuxi-0.11/po-Frontend-GNOME-IRC/sv.po0000644000175000017500000000445712300202374020042 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Martin Bagge , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-10 13:33+0000\n" "Last-Translator: Martin Bagge \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/smuxi/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sv\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "Privat" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "Gör till operatör" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "Ta bort operatörsskap" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "Ge \"voice\"-status" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "Ta bort voice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "Sparka" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "Sparka och stäng ute" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "Stäng ute" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "Upphäv utestängning" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "Användarinformation" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "Bjud in till" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "Version" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "Tid" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "Finger" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "Användarinformation" smuxi-0.11/po-Frontend-GNOME-IRC/en_GB.po0000644000175000017500000000423112300202374020352 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2009 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # Ryan Smith-Evans , 2009. # msgid "" msgstr "" "Project-Id-Version: smuxi 0.6.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-09 15:32+0100\n" "PO-Revision-Date: 2010-01-09 00:20+0100\n" "Last-Translator: Ryan Smith-Evans \n" "Language-Team: English (British)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:53 msgid "Op" msgstr "Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:57 msgid "Deop" msgstr "Deop" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:61 msgid "Voice" msgstr "Voice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:65 msgid "Devoice" msgstr "Devoice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:69 msgid "Kick" msgstr "Kick" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:73 msgid "Kick + Ban" msgstr "Kick + Ban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:77 msgid "Ban" msgstr "Ban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:81 msgid "Unban" msgstr "Unban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:87 msgid "Query" msgstr "Query" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:91 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:57 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:96 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:61 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:99 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:66 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:103 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:70 msgid "Version" msgstr "Version" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:107 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Time" msgstr "Time" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:111 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:78 msgid "Finger" msgstr "Finger" smuxi-0.11/po-Frontend-GNOME-IRC/cs.po0000644000175000017500000000441412300202374020010 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Ondřej Hošek , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-11-19 16:27+0000\n" "Last-Translator: Ondřej Hošek \n" "Language-Team: Czech (http://www.transifex.com/projects/p/smuxi/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "Soukromý rozhovor" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "Odebrat op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "Hlas" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "Odebrat hlas" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "Vykopnout" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "Vykopnout + Ban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "Ban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "Zrušit ban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "Kdo je" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "Pozvat na" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "Verze" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "Čas" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "Finger" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "Info o uživateli" smuxi-0.11/po-Frontend-GNOME-IRC/nl.po0000644000175000017500000000432612311343665020031 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Jeroen Baten , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-26 13:35+0000\n" "Last-Translator: Jeroen Baten \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/smuxi/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "Query" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "Deop" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "Voice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "Devoice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "Kick" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "Kick + Verban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "Verban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "Verbanning opheffen" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "Uitnodigen naar" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "Versie" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "Tijd" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "Wijs" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "Gebruikerinfo" smuxi-0.11/po-Frontend-GNOME-IRC/es_AR.po0000644000175000017500000000422012300202374020367 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2009 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # Juan Miguel Carrero , 2008. # msgid "" msgstr "" "Project-Id-Version: 0.6.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-09 15:32+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Damian Kleiman \n" "Language-Team: Spanish Spanish Localization \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:53 msgid "Op" msgstr "Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:57 msgid "Deop" msgstr "Deop" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:61 msgid "Voice" msgstr "Voz" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:65 msgid "Devoice" msgstr "Quitar Voz" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:69 msgid "Kick" msgstr "Patada" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:73 msgid "Kick + Ban" msgstr "Patada + Ban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:77 msgid "Ban" msgstr "Ban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:81 msgid "Unban" msgstr "Quitar Ban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:87 msgid "Query" msgstr "Privado" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:91 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:57 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:96 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:61 msgid "CTCP" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:99 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:66 msgid "Ping" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:103 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:70 msgid "Version" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:107 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Time" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:111 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:78 msgid "Finger" msgstr "" smuxi-0.11/po-Frontend-GNOME-IRC/da.po0000644000175000017500000000430012300202374017761 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-11-19 16:27+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Danish (http://www.transifex.com/projects/p/smuxi/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "Forespørgsel" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "Deop" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "Voice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "Devoice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "Smid ud" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "Smid ud + giv karantæne" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "Giv karantæne" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "Fjern karantæne" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "Hvem er" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "Inviter til" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "Version" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "Tid" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "Finger" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "Brugerinfo" smuxi-0.11/po-Frontend-GNOME-IRC/POTFILES.in0000644000175000017500000000017212300202374020615 0ustar00meebeymeebey00000000000000src/Frontend-GNOME-IRC/IrcGroupChatView.cs src/Frontend-GNOME-IRC/IrcPersonChatView.cs src/Frontend-GNOME-IRC/CtcpMenu.cs smuxi-0.11/po-Frontend-GNOME-IRC/pt_BR.po0000644000175000017500000000435512300202374020415 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Leonardopf , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-11-19 16:27+0000\n" "Last-Translator: Leonardopf \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/smuxi/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "Query" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "Deop" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "Voz" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "Retirado Voz" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "Expulso" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "Expulso + Banido" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "Banido" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "Desbanido" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "Convidar para" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "Version" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "Tempo" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "Finger" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "InfoUsuário" smuxi-0.11/po-Frontend-GNOME-IRC/ru.po0000644000175000017500000000422012300202374020024 0ustar00meebeymeebey00000000000000msgid "" msgstr "" "Project-Id-Version: smuxi 0.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: \n" "Last-Translator: Urmas \n" "Language-Team: None <->\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n%10==1 && n%100!=11 ? 3 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Poedit-Language: Russian\n" "X-Poedit-Country: RUSSIAN FEDERATION\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:340 msgid "Op" msgstr "Сделать оператором" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:344 msgid "Deop" msgstr "Убрать статус оператора" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:348 msgid "Voice" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:352 msgid "Devoice" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:356 msgid "Kick" msgstr "Выгнать" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:360 msgid "Kick + Ban" msgstr "Выгнать и запретить" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:364 msgid "Ban" msgstr "Запретить" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:368 msgid "Unban" msgstr "Разрешить" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:374 msgid "Query" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:378 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:61 msgid "Whois" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:382 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:65 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:391 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:72 msgid "Invite to" msgstr "Пригласить" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:72 msgid "Ping" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:77 msgid "Version" msgstr "Версия" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:82 msgid "Time" msgstr "Время" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:87 msgid "Finger" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:92 msgid "Userinfo" msgstr "" smuxi-0.11/po-Frontend-GNOME-IRC/pl.po0000644000175000017500000000454612300202374020024 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:22+0100\n" "PO-Revision-Date: 2012-01-06 20:01+0000\n" "Last-Translator: lukasznaw \n" "Language-Team: Polish (http://www.transifex.net/projects/p/smuxi/team/pl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pl\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:381 msgid "Op" msgstr "Daj opa" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:385 msgid "Deop" msgstr "Zabierz opa" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:389 msgid "Voice" msgstr "Daj voice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:393 msgid "Devoice" msgstr "Zabierz voice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:397 msgid "Kick" msgstr "Wyrzuć z kanału" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:401 msgid "Kick + Ban" msgstr "Wyrzuć z kanału i zbanuj" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:405 msgid "Ban" msgstr "Zbanuj" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:409 msgid "Unban" msgstr "Odbanuj" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:415 msgid "Query" msgstr "Zapytanie" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:419 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:64 msgid "Whois" msgstr "Kim jest" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:423 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:68 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:432 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:75 msgid "Invite to" msgstr "Zaproś na" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:72 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:77 msgid "Version" msgstr "Wersja" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:82 msgid "Time" msgstr "Czas" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:87 msgid "Finger" msgstr "Finger - informacje o osobie" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:92 msgid "Userinfo" msgstr "Informacje o użytkowniku" smuxi-0.11/po-Frontend-GNOME-IRC/LINGUAS0000644000175000017500000000011012311343665020070 0ustar00meebeymeebey00000000000000cs da de en_GB es es_AR fa fi fr hr it nl pl pt pt_BR ru sv te tr zh_CN smuxi-0.11/po-Frontend-GNOME-IRC/it.po0000644000175000017500000000455512300202374020025 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2010 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # David Paleino , 2008. # # Vincenzo Campanella , 2009-2010, 2010. msgid "" msgstr "" "Project-Id-Version: smuxi-frontend-gnome-irc\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2010-07-15 13:28+0200\n" "Last-Translator: Vincenzo Campanella \n" "Language-Team: Italian \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:340 msgid "Op" msgstr "Operatore" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:344 msgid "Deop" msgstr "Rimuovi l'operatore" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:348 msgid "Voice" msgstr "Dai la parola" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:352 msgid "Devoice" msgstr "Togli la parola" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:356 msgid "Kick" msgstr "Espelli (kick)" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:360 msgid "Kick + Ban" msgstr "Espelli (kick) e allontana (ban)" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:364 msgid "Ban" msgstr "Allontana (ban)" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:368 msgid "Unban" msgstr "Rimuovi l'allontanamento (unban)" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:374 msgid "Query" msgstr "Messaggio privato" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:378 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:61 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:382 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:65 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:391 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:72 msgid "Invite to" msgstr "Invita a" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:72 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:77 msgid "Version" msgstr "Versione" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:82 msgid "Time" msgstr "Ora" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:87 msgid "Finger" msgstr "Finger" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:92 msgid "Userinfo" msgstr "Informazioni sull'utente" smuxi-0.11/po-Frontend-GNOME-IRC/de.po0000644000175000017500000000423312300202374017772 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-11-19 16:27+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: German (http://www.transifex.com/projects/p/smuxi/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "Query" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "Deop" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "Voice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "Devoice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "Kick" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "Kick + Ban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "Ban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "Unban" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "Einladen zu" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "Version" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "Zeit" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "Finger" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "Benutzerinformationen" smuxi-0.11/po-Frontend-GNOME-IRC/Makefile.in.in0000644000175000017500000001533412300202374021520 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/po-Frontend-GNOME-IRC/es.po0000644000175000017500000000425612300202374020016 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # toote, 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-10 18:53+0000\n" "Last-Translator: toote\n" "Language-Team: Spanish (http://www.transifex.com/projects/p/smuxi/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "Consulta" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "Deop" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "Voz" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "Quitar voz" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "Expulsar" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "Expulsar + bloquear" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "Bloquear" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "Desbloquear" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "Invitar a" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "Versión" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "Hora" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "Finger" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "Información de usuario" smuxi-0.11/po-Frontend-GNOME-IRC/te.po0000644000175000017500000000406012300202374020010 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-10 18:22+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/smuxi/language/te/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: te\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:390 msgid "Query" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:396 msgid "Op" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:400 msgid "Deop" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:404 msgid "Voice" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:408 msgid "Devoice" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:412 msgid "Kick" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:416 msgid "Kick + Ban" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:420 msgid "Ban" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:424 msgid "Unban" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:430 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:63 msgid "Whois" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:434 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:67 msgid "CTCP" msgstr "" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:443 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:74 msgid "Invite to" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:73 msgid "Ping" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:78 msgid "Version" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:83 msgid "Time" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:88 msgid "Finger" msgstr "" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:93 msgid "Userinfo" msgstr "" smuxi-0.11/po-Frontend-GNOME-IRC/hr.po0000644000175000017500000000451212300202374020013 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:22+0100\n" "PO-Revision-Date: 2012-01-08 08:23+0000\n" "Last-Translator: Matias M. \n" "Language-Team: Croatian (http://www.transifex.net/projects/p/smuxi/team/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hr\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2\n" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:381 msgid "Op" msgstr "Dodijeli Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:385 msgid "Deop" msgstr "Oduzmi Op" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:389 msgid "Voice" msgstr "Dodijeli Voice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:393 msgid "Devoice" msgstr "Oduzmi Voice" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:397 msgid "Kick" msgstr "Izbaci" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:401 msgid "Kick + Ban" msgstr "Izbaci + zabrani" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:405 msgid "Ban" msgstr "Zabrani" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:409 msgid "Unban" msgstr "Skini zabranu" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:415 msgid "Query" msgstr "Upit" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:419 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:64 msgid "Whois" msgstr "Whois naredba" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:423 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:68 msgid "CTCP" msgstr "CTCP" #: ../src/Frontend-GNOME-IRC/IrcGroupChatView.cs:432 #: ../src/Frontend-GNOME-IRC/IrcPersonChatView.cs:75 msgid "Invite to" msgstr "Pozovi u" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:72 msgid "Ping" msgstr "Ping" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:77 msgid "Version" msgstr "Inačica" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:82 msgid "Time" msgstr "Vrijeme" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:87 msgid "Finger" msgstr "Finger naredba" #: ../src/Frontend-GNOME-IRC/CtcpMenu.cs:92 msgid "Userinfo" msgstr "Userinfo naredba" smuxi-0.11/BUGS0000644000175000017500000000052412257043746014074 0ustar00meebeymeebey00000000000000 For checking known bugs, please visit: https://www.smuxi.org/projects/smuxi/issues?set_filter=1&tracker_id=1 For checking known feature requests, please visit: https://www.smuxi.org/projects/smuxi/issues?set_filter=1&tracker_id=2 For reporting a new bugs or feature request, please visit: https://www.smuxi.org/projects/smuxi/issues/new smuxi-0.11/ltmain.sh0000644000175000017500000105202612311344225015221 0ustar00meebeymeebey00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.7" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 smuxi-0.11/glade/0000755000175000017500000000000012311344241014445 5ustar00meebeymeebey00000000000000smuxi-0.11/glade/smuxi-frontend-gnome.glade0000644000175000017500000066021612257043746021562 0ustar00meebeymeebey00000000000000 True Smuxi Preferences 700 600 dialog True vertical True 10 128 True True automatic automatic in True True False False False 0 True True False True 5 vertical 10 True 0 none True 12 True 5 2 5 5 True True The nickname to use. You can specify extra nicknames (separated by spaces) which will be used as fallbacks when the first choice is not available. By default $nick_ and $nick__ will be used as fallbacks. 1 2 True True 1 2 1 2 True True 1 2 2 3 True True Nickname(s): False False 0 True 1 GTK_FILL GTK_FILL True True Username: False False 0 True 1 1 2 GTK_FILL GTK_FILL True True Realname: False False 0 True 1 2 3 GTK_FILL GTK_FILL True 0 Encoding: 3 4 GTK_FILL True on 1 2 3 4 GTK_FILL GTK_FILL Automatically convert UTF-8 characters True True False True 1 2 4 5 GTK_FILL GTK_FILL True <b>General</b> True label_item False 0 True 0 none True 12 True 4 2 5 5 True 0 Type: GTK_FILL True 0 Host: 1 2 GTK_FILL True on 1 2 True 0 Username: 2 3 GTK_FILL True 0 Password: 3 4 GTK_FILL True 5 True True 0 True 5 True Port: False False 0 True True 5 0 0 65535 1 10 10 False False 1 False 5 1 1 2 1 2 True True 1 2 2 3 True 5 True True 0 Show Password True True False True False False 1 1 2 3 4 True <b>Network Proxy</b> True label_item False 1 True 0 none True 12 True 5 vertical 5 True vertical True True On Connect Commands: False False 0 True 1 False False 0 350 100 True True automatic in 100 True True word 1 0 True vertical True True On Startup Commands: False False 0 True 1 False False 0 350 100 True True automatic in 100 True True word 1 1 True <b>Global Commands</b> True label_item 2 True C_onnection True Notebook False tab True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True 5 vertical 5 True 0 none True 12 True 5 6 2 5 5 True True Timestamp Format: False False 0 True 1 GTK_FILL GTK_FILL True True Buffer Lines: False False 0 True 1 1 2 GTK_FILL GTK_FILL True True Engine Buffer Lines: False False 0 True 1 2 3 GTK_FILL GTK_FILL 60 True True 200 1 9999 1 10 10 1 True 1 2 1 2 60 True True 200 0 9999 1 10 10 1 True 1 2 2 3 60 True True ss = seconds mm = minutes hh = hours (01 - 12) HH = hours (00 - 23) tt = AM/PM dd = day MM = month yy/yyyy = year HH:mm 1 2 True 1 2 3 4 True 0 Persistency Type: 3 4 True 0 Volatile Buffer Lines: 4 5 True 0 Persistent Buffer Lines: 5 6 60 True True 200 0 10000 100 1000 10 1 True 1 2 4 5 60 True True 50000 0 1000000000 100 1000 10 1 True 1 2 5 6 True <b>Message Buffer</b> True label_item False False 0 True 0 none True 12 True vertical True True False True True 0 0 True 2 True gtk-cut False False 0 True Strip Colors True False False 1 False False 0 True True False True True 0 0 True 2 True gtk-cut False False 0 True Strip Formattings True False False 1 False False 1 True False True False True True 0 0 True 2 True gtk-cut False False 0 True Strip UTF-8 True False False 1 False False 2 True True False 1 True True 2 True gtk-execute 0 True Show Advanced Settings 1 False False 3 True <b>Advanced</b> True label_item False False 1 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK General False tab True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 vertical 5 0 True 12 True vertical True True False True True 0 0 True 2 True gtk-goto-top False False 0 True Top True False False 1 False False 0 True True False True TabPositionRadioButtonTop True 0 0 True 2 True gtk-goto-bottom False False 0 True Bottom True False False 1 False False 1 True True False True True TabPositionRadioButtonTop True 0 0 True 2 True gtk-goto-first False False 0 True Left True False False 1 False False 2 True True False True TabPositionRadioButtonTop True 0 0 True 2 True gtk-goto-last False False 0 True Right True False False 1 False False 3 None True True False True True TabPositionRadioButtonTop False False 4 True <b> Tabs Position </b> True label_item False 0 True 0 True 12 True 4 2 5 5 True True False 1 2 1 2 GTK_FILL True True False 1 2 2 3 GTK_FILL True True False 1 2 GTK_FILL True 0 Highlight 3 4 GTK_FILL True 0 Activity 1 2 GTK_FILL True 0 No Activity GTK_FILL True 0 Join/Part/Mode 2 3 GTK_FILL True True False 1 2 3 4 GTK_FILL True <b> Tab Colors </b> True label_item False 1 Automatically switch to newly opened person chats True True False True False 2 Automatically switch to newly opened group chats True True False True False 3 1 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Tree 1 False tab True 5 0 True 12 True vertical 5 True 5 3 2 5 5 True True Completion Character: False False 0 True 1 GTK_FILL GTK_FILL True True Command Character: False False 0 True 1 1 2 GTK_FILL GTK_FILL True True Command History Size: False False 0 True 1 2 3 GTK_FILL GTK_FILL 60 True True 30 1 9999 1 10 10 1 True 1 2 2 3 30 True True 1 / 1 2 1 2 30 True True 1 : 1 2 False False 0 Bash-Style Completion True True False True True False False 1 True <b> Entry Field </b> True label_item 2 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Input 2 False tab True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 vertical True 0 True 12 True 4 2 2 2 Nick Colors True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True 2 152 96 0 True 12 True vertical True True False True True True 0 0 True 2 True gtk-goto-first False False 0 True Left True False False 1 False False 0 True True False True UserListPositionRadioButtonLeft True 0 0 True 2 True gtk-goto-last False False 0 True Right True False False 1 False False 1 None True True False True True UserListPositionRadioButtonLeft False False 2 True <b> Person List Position </b> True label_item 3 4 True 0 True 12 True Override True True False True 0 True False True True 1 True <b> Font </b> True label_item 1 2 3 4 0 True 12 True vertical True True False True True True 0 0 True 2 True gtk-goto-top False False 0 True Top True False False 1 False False 0 True True False True TopicPositionRadioButtonTop True 0 0 True 2 True gtk-goto-bottom False False 0 True Bottom True False False 1 False False 1 None True True False True True TopicPositionRadioButtonTop False False 2 True <b> Topic Position </b> True label_item 2 3 True 0 True 12 True 2 3 5 5 True 0 Foreground 1 2 GTK_FILL True 0 Background 1 2 1 2 GTK_FILL True False True True #000000000000 2 3 GTK_FILL True False True True #000000000000 2 3 1 2 GTK_FILL Override True True False True GTK_FILL Override True True False True 1 2 GTK_FILL True <b> Color </b> True label_item 1 2 2 3 True 5 True 0 _Wrap Mode: True False 0 True False 1 2 1 2 True <b> Chat </b> True label_item False 0 True 0 True 12 True 5 vertical True vertical True 0 Highlight words: False False 0 True True automatic automatic in True True 1 0 Beep on highlight True True False True True False False 1 True <b> Highlighting </b> True label_item 1 3 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Output 3 False tab True 5 vertical 5 True 0 none True 12 True vertical Enable True True False True False 0 True vertical Show always True True False True True False 0 Show when window is minimized True True False True NotificationAreaIconRadioButtonAlways False 1 Show when window is closed True True False True NotificationAreaIconRadioButtonAlways False 2 1 True <b> Notification Area Icon </b> True label_item False 0 True 0 none True 12 Show Smuxi in the messaging menu True True False True True <b>Messaging Menu</b> True label_item False 1 True 0 none True 12 Show notification popups True True False True True <b>Notification Popups</b> True label_item False False 2 4 True Notification 4 False tab 1 True _Interface True Notebook 1 False tab True 5 True True automatic automatic in True True 0 True 5 vertical start gtk-add True True True False True False False 0 gtk-edit True True True False True False False 1 gtk-remove True True True False True False False 2 False 1 2 True _Servers True Notebook 2 False tab True 5 3 True _Filters True Notebook 3 False tab True 5 3 2 5 5 Enabled True True False True GTK_FILL GTK_FILL True 1 2 GTK_FILL GTK_FILL True 1 2 1 2 GTK_FILL GTK_FILL True 1 2 2 3 GTK_FILL GTK_FILL Log Filtered Messages True True False True 1 2 GTK_FILL GTK_FILL True gtk-open True True True True 0 True 1 2 3 GTK_FILL GTK_FILL 4 True _Logging True 4 False tab 1 2 True end gtk-apply -10 True False True True False True False False 0 gtk-ok -5 True True True False True False False 1 gtk-cancel -6 True True True False True False False 2 False end 0 GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 Smuxi - Server center-on-parent gtk-preferences dialog True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 6 2 5 5 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False False False 0 Show Password True True False True False False 1 1 2 4 5 Automatically connect to server at startup True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True 2 5 6 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 Password: 4 5 True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 2 3 4 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 Username: 3 4 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 2 2 3 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Port: 0 True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 0 65535 1 10 10 True 1 1 1 2 1 2 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 Protocol: GTK_FILL True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 2 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 Network: 2 3 GTK_FILL True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 Hostname: 1 2 GTK_FILL False 0 True vertical True True On Connect Commands: False False 0 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 False False 0 350 100 True True automatic in 152 168 True True word 1 5 1 1 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK end gtk-cancel -6 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True False False 0 gtk-ok -5 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True False False 1 False end 0 smuxi-0.11/lib/0000755000175000017500000000000012311344240014136 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/JabbR/0000755000175000017500000000000012311344240015116 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/JabbR/JabbR/0000755000175000017500000000000012311344240016076 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/JabbR/JabbR/Models/0000755000175000017500000000000012311344240017321 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/JabbR/JabbR/Models/ClientNotification.cs0000644000175000017500000000037212204443201023435 0ustar00meebeymeebey00000000000000namespace JabbR.Models { public class ClientNotification { public string Room { get; set; } public string ImageUrl { get; set; } public string Source { get; set; } public string Content { get; set; } } }smuxi-0.11/lib/JabbR/JabbR/Models/ClientMessage.cs0000644000175000017500000000030412204443201022366 0ustar00meebeymeebey00000000000000namespace JabbR.Models { public class ClientMessage { public string Id { get; set; } public string Content { get; set; } public string Room { get; set; } } }smuxi-0.11/lib/JabbR/JabbR.Client/0000755000175000017500000000000012311344240017313 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/JabbR/JabbR.Client/StreamExtensions.cs0000644000175000017500000000446012204443201023157 0ustar00meebeymeebey00000000000000// // Copyright 2011-2013 Microsoft Open Technologies, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // using System; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Threading.Tasks; namespace JabbR.Client { internal static class StreamExtensions { [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flowed back to the caller.")] public static Task ReadAsync(this Stream stream, byte[] buffer) { #if NETFX_CORE return stream.ReadAsync(buffer, 0, buffer.Length); #else try { return Task.Factory.FromAsync((cb, state) => stream.BeginRead(buffer, 0, buffer.Length, cb, state), ar => stream.EndRead(ar), null); } catch (Exception ex) { return TaskAsyncHelper.FromError(ex); } #endif } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared class.")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flowed back to the caller.")] public static Task WriteAsync(this Stream stream, byte[] buffer) { #if NETFX_CORE return stream.WriteAsync(buffer, 0, buffer.Length); #else try { return Task.Factory.FromAsync((cb, state) => stream.BeginWrite(buffer, 0, buffer.Length, cb, state), ar => stream.EndWrite(ar), null); } catch (Exception ex) { return TaskAsyncHelper.FromError(ex); } #endif } } } smuxi-0.11/lib/JabbR/JabbR.Client/JabbR.Client.csproj0000644000175000017500000000750112204443201022733 0ustar00meebeymeebey00000000000000 Debug AnyCPU 8.0.30703 2.0 {A4A1D183-FD80-4DBD-806F-883DDADD4967} Library Properties JabbR.Client JabbR.Client v4.0 512 ..\ true true full false bin\Debug\ DEBUG;TRACE prompt 4 false pdbonly true bin\Release\ TRACE prompt 4 false Models\ClientMessage.cs Models\ClientNotification.cs {A9AE40FF-1A21-414A-9FE7-3BE13644CC6D} Newtonsoft.Json {EB46B9C6-EE37-48F9-835E-E49580E40E0A} Microsoft.AspNet.SignalR.Client smuxi-0.11/lib/JabbR/JabbR.Client/TaskAsyncHelper.cs0000644000175000017500000012056312204443201022707 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Reflection; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Infrastructure; namespace JabbR.Client { internal static class TaskAsyncHelper { private static readonly Task _emptyTask = MakeTask(null); private static readonly Task _trueTask = MakeTask(true); private static readonly Task _falseTask = MakeTask(false); private static Task MakeTask(T value) { return FromResult(value); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Empty { get { return _emptyTask; } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task True { get { return _trueTask; } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task False { get { return _falseTask; } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task OrEmpty(this Task task) { return task ?? Empty; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task OrEmpty(this Task task) { return task ?? TaskCache.Empty; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromAsync(Func beginMethod, Action endMethod, object state) { try { return Task.Factory.FromAsync(beginMethod, endMethod, state); } catch (Exception ex) { return TaskAsyncHelper.FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromAsync(Func beginMethod, Func endMethod, object state) { try { return Task.Factory.FromAsync(beginMethod, endMethod, state); } catch (Exception ex) { return TaskAsyncHelper.FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Series(Func[] tasks, object[] state) { Task prev = TaskAsyncHelper.Empty; Task finalTask = TaskAsyncHelper.Empty; for (int i = 0; i < tasks.Length; i++) { prev = finalTask; finalTask = prev.Then(tasks[i], state[i]); } return finalTask; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static TTask Catch(this TTask task) where TTask : Task { return Catch(task, ex => { }); } #if PERFCOUNTERS public static TTask Catch(this TTask task, params IPerformanceCounter[] counters) where TTask : Task { return Catch(task, _ => { if (counters == null) { return; } for (var i = 0; i < counters.Length; i++) { counters[i].Increment(); } }); } #endif [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static TTask Catch(this TTask task, Action handler, object state) where TTask : Task { if (task != null && task.Status != TaskStatus.RanToCompletion) { if (task.Status == TaskStatus.Faulted) { ExecuteOnFaulted(handler, state, task.Exception); } else { AttachFaultedContinuation(task, handler, state); } } return task; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] private static void AttachFaultedContinuation(TTask task, Action handler, object state) where TTask : Task { task.ContinueWith(innerTask => { ExecuteOnFaulted(handler, state, innerTask.Exception); }, TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] private static void ExecuteOnFaulted(Action handler, object state, AggregateException exception) { // observe Exception #if !WINDOWS_PHONE && !SILVERLIGHT && !NETFX_CORE && !ANDROID && !IOS Trace.TraceError("SignalR exception thrown by Task: {0}", exception); #endif handler(exception, state); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static TTask Catch(this TTask task, Action handler) where TTask : Task { return task.Catch((ex, state) => ((Action)state).Invoke(ex), handler); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task ContinueWithNotComplete(this Task task, Action action) { if (task.IsCanceled) { action(); } else if (task.IsFaulted) { action(); } else { task.ContinueWith(t => { if (t.IsFaulted || t.IsCanceled) { action(); } }, TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.NotOnRanToCompletion); } return task; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static void ContinueWithNotComplete(this Task task, TaskCompletionSource tcs) { task.ContinueWith(t => { if (t.IsFaulted) { tcs.SetUnwrappedException(t.Exception); } else if (t.IsCanceled) { tcs.SetCanceled(); } }, TaskContinuationOptions.NotOnRanToCompletion); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static void ContinueWith(this Task task, TaskCompletionSource tcs) { task.ContinueWith(t => { if (t.IsFaulted) { tcs.TrySetUnwrappedException(t.Exception); } else if (t.IsCanceled) { tcs.TrySetCanceled(); } else { tcs.TrySetResult(null); } }, TaskContinuationOptions.ExecuteSynchronously); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static void ContinueWith(this Task task, TaskCompletionSource tcs) { task.ContinueWith(t => { if (t.IsFaulted) { tcs.TrySetUnwrappedException(t.Exception); } else if (t.IsCanceled) { tcs.TrySetCanceled(); } else { tcs.TrySetResult(t.Result); } }); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Return(this Task[] tasks) { return Then(tasks, () => { }); } // Then extesions [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Action successor) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor); default: return RunTask(task, successor); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor) { switch (task.Status) { case TaskStatus.Faulted: return FromError(task.Exception); case TaskStatus.Canceled: return Canceled(); case TaskStatus.RanToCompletion: return FromMethod(successor); default: return TaskRunners.RunTask(task, successor); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task[] tasks, Action successor) { if (tasks.Length == 0) { return FromMethod(successor); } var tcs = new TaskCompletionSource(); Task.Factory.ContinueWhenAll(tasks, completedTasks => { var faulted = completedTasks.FirstOrDefault(t => t.IsFaulted); if (faulted != null) { tcs.SetUnwrappedException(faulted.Exception); return; } var cancelled = completedTasks.FirstOrDefault(t => t.IsCanceled); if (cancelled != null) { tcs.SetCanceled(); return; } successor(); tcs.SetResult(null); }); return tcs.Task; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Action successor, T1 arg1) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, arg1); default: return GenericDelegates.ThenWithArgs(task, successor, arg1); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Action successor, T1 arg1, T2 arg2) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, arg1, arg2); default: return GenericDelegates.ThenWithArgs(task, successor, arg1, arg2); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor, T1 arg1) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, arg1); default: return GenericDelegates.ThenWithArgs(task, successor, arg1) .FastUnwrap(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor, T1 arg1, T2 arg2) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, arg1, arg2); default: return GenericDelegates.ThenWithArgs(task, successor, arg1, arg2) .FastUnwrap(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func> successor) { switch (task.Status) { case TaskStatus.Faulted: return FromError(task.Exception); case TaskStatus.Canceled: return Canceled(); case TaskStatus.RanToCompletion: return FromMethod(successor, task.Result); default: return TaskRunners>.RunTask(task, t => successor(t.Result)) .FastUnwrap(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor) { switch (task.Status) { case TaskStatus.Faulted: return FromError(task.Exception); case TaskStatus.Canceled: return Canceled(); case TaskStatus.RanToCompletion: return FromMethod(successor, task.Result); default: return TaskRunners.RunTask(task, t => successor(t.Result)); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor, T1 arg1) { switch (task.Status) { case TaskStatus.Faulted: return FromError(task.Exception); case TaskStatus.Canceled: return Canceled(); case TaskStatus.RanToCompletion: return FromMethod(successor, task.Result, arg1); default: return GenericDelegates.ThenWithArgs(task, successor, arg1); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor); default: return TaskRunners.RunTask(task, successor) .FastUnwrap(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func> successor) { switch (task.Status) { case TaskStatus.Faulted: return FromError(task.Exception); case TaskStatus.Canceled: return Canceled(); case TaskStatus.RanToCompletion: return FromMethod(successor); default: return TaskRunners>.RunTask(task, successor) .FastUnwrap(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Action successor) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, task.Result); default: return TaskRunners.RunTask(task, successor); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, task.Result); default: return TaskRunners.RunTask(task, t => successor(t.Result)) .FastUnwrap(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func, T1, Task> successor, T1 arg1) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, task, arg1); default: return GenericDelegates, T1, object>.ThenWithArgs(task, successor, arg1) .FastUnwrap(); } } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flowed to the caller")] [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Finally(this Task task, Action next, object state) { try { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: next(state); return task; case TaskStatus.RanToCompletion: return FromMethod(next, state); default: return RunTaskSynchronously(task, next, state, onlyOnSuccess: false); } } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task RunSynchronously(this Task task, Action successor) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor); default: return RunTaskSynchronously(task, state => ((Action)state).Invoke(), successor); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task FastUnwrap(this Task task) { var innerTask = (task.Status == TaskStatus.RanToCompletion) ? task.Result : null; return innerTask ?? task.Unwrap(); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task FastUnwrap(this Task> task) { var innerTask = (task.Status == TaskStatus.RanToCompletion) ? task.Result : null; return innerTask ?? task.Unwrap(); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Delay(TimeSpan timeOut) { #if NETFX_CORE return Task.Delay(timeOut); #else var tcs = new TaskCompletionSource(); var timer = new Timer(tcs.SetResult, null, timeOut, TimeSpan.FromMilliseconds(-1)); return tcs.Task.ContinueWith(_ => { timer.Dispose(); }, TaskContinuationOptions.ExecuteSynchronously); #endif } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Action func) { try { func(); return Empty; } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Action func, T1 arg) { try { func(arg); return Empty; } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Action func, T1 arg1, T2 arg2) { try { func(arg1, arg2); return Empty; } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func func) { try { return func(); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func> func) { try { return func(); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func func) { try { return FromResult(func()); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func func, T1 arg) { try { return func(arg); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func func, T1 arg1, T2 arg2) { try { return func(arg1, arg2); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func> func, T1 arg) { try { return func(arg); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func func, T1 arg) { try { return FromResult(func(arg)); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func> func, T1 arg1, T2 arg2) { try { return func(arg1, arg2); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func func, T1 arg1, T2 arg2) { try { return FromResult(func(arg1, arg2)); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task FromResult(T value) { var tcs = new TaskCompletionSource(); tcs.SetResult(value); return tcs.Task; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] internal static Task FromError(Exception e) { return FromError(e); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] internal static Task FromError(Exception e) { var tcs = new TaskCompletionSource(); tcs.SetUnwrappedException(e); return tcs.Task; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] internal static void SetUnwrappedException(this TaskCompletionSource tcs, Exception e) { var aggregateException = e as AggregateException; if (aggregateException != null) { tcs.SetException(aggregateException.InnerExceptions); } else { tcs.SetException(e); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] internal static bool TrySetUnwrappedException(this TaskCompletionSource tcs, Exception e) { var aggregateException = e as AggregateException; if (aggregateException != null) { return tcs.TrySetException(aggregateException.InnerExceptions); } else { return tcs.TrySetException(e); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] private static Task Canceled() { var tcs = new TaskCompletionSource(); tcs.SetCanceled(); return tcs.Task; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] private static Task Canceled() { var tcs = new TaskCompletionSource(); tcs.SetCanceled(); return tcs.Task; } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] private static Task RunTask(Task task, Action successor) { var tcs = new TaskCompletionSource(); task.ContinueWith(t => { if (t.IsFaulted) { tcs.SetUnwrappedException(t.Exception); } else if (t.IsCanceled) { tcs.SetCanceled(); } else { try { successor(); tcs.SetResult(null); } catch (Exception ex) { tcs.SetUnwrappedException(ex); } } }); return tcs.Task; } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] private static Task RunTaskSynchronously(Task task, Action next, object state, bool onlyOnSuccess = true) { var tcs = new TaskCompletionSource(); task.ContinueWith(t => { try { if (t.IsFaulted) { if (!onlyOnSuccess) { next(state); } tcs.SetUnwrappedException(t.Exception); } else if (t.IsCanceled) { if (!onlyOnSuccess) { next(state); } tcs.SetCanceled(); } else { next(state); tcs.SetResult(null); } } catch (Exception ex) { tcs.SetUnwrappedException(ex); } }, TaskContinuationOptions.ExecuteSynchronously); return tcs.Task; } private static class TaskRunners { [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] internal static Task RunTask(Task task, Action successor) { var tcs = new TaskCompletionSource(); task.ContinueWith(t => { if (t.IsFaulted) { tcs.SetUnwrappedException(t.Exception); } else if (t.IsCanceled) { tcs.SetCanceled(); } else { try { successor(t.Result); tcs.SetResult(null); } catch (Exception ex) { tcs.SetUnwrappedException(ex); } } }); return tcs.Task; } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] internal static Task RunTask(Task task, Func successor) { var tcs = new TaskCompletionSource(); task.ContinueWith(t => { if (t.IsFaulted) { tcs.SetUnwrappedException(t.Exception); } else if (t.IsCanceled) { tcs.SetCanceled(); } else { try { tcs.SetResult(successor()); } catch (Exception ex) { tcs.SetUnwrappedException(ex); } } }); return tcs.Task; } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] internal static Task RunTask(Task task, Func, TResult> successor) { var tcs = new TaskCompletionSource(); task.ContinueWith(t => { if (task.IsFaulted) { tcs.SetUnwrappedException(t.Exception); } else if (task.IsCanceled) { tcs.SetCanceled(); } else { try { tcs.SetResult(successor(t)); } catch (Exception ex) { tcs.SetUnwrappedException(ex); } } }); return tcs.Task; } } private static class GenericDelegates { internal static Task ThenWithArgs(Task task, Action successor, T1 arg1) { return RunTask(task, () => successor(arg1)); } internal static Task ThenWithArgs(Task task, Action successor, T1 arg1, T2 arg2) { return RunTask(task, () => successor(arg1, arg2)); } internal static Task ThenWithArgs(Task task, Func successor, T1 arg1) { return TaskRunners.RunTask(task, () => successor(arg1)); } internal static Task ThenWithArgs(Task task, Func successor, T1 arg1, T2 arg2) { return TaskRunners.RunTask(task, () => successor(arg1, arg2)); } internal static Task ThenWithArgs(Task task, Func successor, T1 arg1) { return TaskRunners.RunTask(task, t => successor(t.Result, arg1)); } internal static Task ThenWithArgs(Task task, Func successor, T1 arg1) { return TaskRunners.RunTask(task, () => successor(arg1)); } internal static Task ThenWithArgs(Task task, Func successor, T1 arg1, T2 arg2) { return TaskRunners.RunTask(task, () => successor(arg1, arg2)); } internal static Task> ThenWithArgs(Task task, Func> successor, T1 arg1) { return TaskRunners>.RunTask(task, t => successor(t.Result, arg1)); } internal static Task> ThenWithArgs(Task task, Func, T1, Task> successor, T1 arg1) { return TaskRunners>.RunTask(task, t => successor(t, arg1)); } } private static class TaskCache { public static Task Empty = MakeTask(default(T)); } } }smuxi-0.11/lib/JabbR/JabbR.Client/IAuthenticationProvider.cs0000644000175000017500000000057412204443201024451 0ustar00meebeymeebey00000000000000using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Client.Hubs; namespace JabbR.Client { /// /// Interface that wraps SignalR's IClientTransport and provides a way to add authentication information /// public interface IAuthenticationProvider { Task Connect(string userName, string password); } } smuxi-0.11/lib/JabbR/JabbR.Client/HttpHelper.cs0000644000175000017500000001012112204443201021712 0ustar00meebeymeebey00000000000000// // Copyright 2011-2013 Microsoft Open Technologies, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Net; using System.Text; using System.Threading.Tasks; namespace JabbR.Client { internal static class HttpHelper { [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flowed back to the caller.")] public static Task GetHttpResponseAsync(this HttpWebRequest request) { try { return Task.Factory.FromAsync(request.BeginGetResponse, ar => (HttpWebResponse)request.EndGetResponse(ar), null); } catch (Exception ex) { return TaskAsyncHelper.FromError(ex); } } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flowed back to the caller.")] public static Task GetHttpRequestStreamAsync(this HttpWebRequest request) { try { return Task.Factory.FromAsync(request.BeginGetRequestStream, request.EndGetRequestStream, null); } catch (Exception ex) { return TaskAsyncHelper.FromError(ex); } } public static Task GetAsync(string url, Action requestPreparer) { HttpWebRequest request = CreateWebRequest(url); if (requestPreparer != null) { requestPreparer(request); } return request.GetHttpResponseAsync(); } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Callers check for null return.")] public static string ReadAsString(this HttpWebResponse response) { try { using (response) { using (Stream stream = response.GetResponseStream()) { var reader = new StreamReader(stream); return reader.ReadToEnd(); } } } catch (Exception ex) { #if NET35 Debug.WriteLine(String.Format(System.Globalization.CultureInfo.InvariantCulture, "Failed to read response: {0}", ex)); #else Debug.WriteLine("Failed to read response: {0}", ex); #endif // Swallow exceptions when reading the response stream and just try again. return null; } } private static HttpWebRequest CreateWebRequest(string url) { HttpWebRequest request = null; #if WINDOWS_PHONE request = (HttpWebRequest)WebRequest.Create(url); request.AllowReadStreamBuffering = false; #elif SILVERLIGHT request = (HttpWebRequest)System.Net.Browser.WebRequestCreator.ClientHttp.Create(new Uri(url)); request.AllowReadStreamBuffering = false; #else request = (HttpWebRequest)WebRequest.Create(url); #endif return request; } } } smuxi-0.11/lib/JabbR/JabbR.Client/IJabbRClient.cs0000644000175000017500000000462712204443201022101 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Net; using System.Threading.Tasks; using JabbR.Client.Models; using JabbR.Models; using Microsoft.AspNet.SignalR.Client; namespace JabbR.Client { public interface IJabbRClient { event Action MessageReceived; event Action> LoggedOut; event Action UserJoined; event Action UserLeft; event Action Kicked; event Action PrivateMessage; event Action UserTyping; event Action GravatarChanged; event Action MeMessageReceived; event Action UsernameChanged; event Action NoteChanged; event Action FlagChanged; event Action TopicChanged; event Action OwnerAdded; event Action OwnerRemoved; event Action AddMessageContent; event Action JoinedRoom; event Action RoomCountChanged; event Action UserActivityChanged; event Action> UsersInactive; event Action Disconnected; event Action StateChanged; string SourceUrl { get; } bool AutoReconnect { get; set; } ICredentials Credentials { get; set; } Task Connect(string name, string password); Task GetUserInfo(); Task LogOut(); Task Send(string message, string roomName); Task Send(ClientMessage message); Task CreateRoom(string roomName); Task JoinRoom(string roomName); Task LeaveRoom(string roomName); Task SetFlag(string countryCode); Task SetNote(string noteText); Task SendPrivateMessage(string userName, string message); Task Kick(string userName, string roomName); Task CheckStatus(); Task SetTyping(string roomName); Task PostNotification(ClientNotification notification); Task PostNotification(ClientNotification notification, bool executeContentProviders); Task> GetPreviousMessages(string fromId); Task GetRoomInfo(string roomName); Task> GetRooms(); void Disconnect(); } } smuxi-0.11/lib/JabbR/JabbR.Client/Models/0000755000175000017500000000000012311344240020536 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/JabbR/JabbR.Client/Models/Room.cs0000644000175000017500000000102112204443201021771 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace JabbR.Client.Models { public class Room { public string Name { get; set; } public int Count { get; set; } public bool Private { get; set; } public string Topic { get; set; } public bool Closed { get; set; } public string Welcome { get; set; } public IEnumerable Users { get; set; } public IEnumerable Owners { get; set; } public IEnumerable RecentMessages { get; set; } } } smuxi-0.11/lib/JabbR/JabbR.Client/Models/User.cs0000644000175000017500000000116712204443201022006 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace JabbR.Client.Models { public class User { public string Name { get; set; } public string Hash { get; set; } public bool Active { get; set; } public UserStatus Status { get; set; } public string Note { get; set; } public string AfkNote { get; set; } public bool IsAfk { get; set; } public string Flag { get; set; } public string Country { get; set; } public DateTime LastActivity { get; set; } public bool IsAdmin { get; set; } } } smuxi-0.11/lib/JabbR/JabbR.Client/Models/UserStatus.cs0000644000175000017500000000017612204443201023211 0ustar00meebeymeebey00000000000000namespace JabbR.Client.Models { public enum UserStatus { Active, Inactive, Offline } } smuxi-0.11/lib/JabbR/JabbR.Client/Models/LogOnInfo.cs0000644000175000017500000000044512204443201022720 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace JabbR.Client.Models { public class LogOnInfo { public string UserId { get; set; } public IEnumerable Rooms { get; set; } public LogOnInfo() { Rooms = new List(); } } } smuxi-0.11/lib/JabbR/JabbR.Client/Models/Message.cs0000644000175000017500000000046212204443201022451 0ustar00meebeymeebey00000000000000using System; namespace JabbR.Client.Models { public class Message { public bool HtmlEncoded { get; set; } public string Id { get; set; } public string Content { get; set; } public DateTimeOffset When { get; set; } public User User { get; set; } } } smuxi-0.11/lib/JabbR/JabbR.Client/Properties/0000755000175000017500000000000012311344240021447 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/JabbR/JabbR.Client/Properties/AssemblyInfo.cs0000644000175000017500000000051412204443201024367 0ustar00meebeymeebey00000000000000using System.Reflection; [assembly: AssemblyTitle("JabbR.Client")] [assembly: AssemblyDescription(".NET Client for JabbR (https://github.com/davidfowl/JabbR)")] [assembly: AssemblyCompany("David Fowler")] [assembly: AssemblyProduct("JabbR.Client")] [assembly: AssemblyVersion("0.1")] [assembly: AssemblyFileVersion("1.0.0.0")] smuxi-0.11/lib/JabbR/JabbR.Client/JabbRClient.cs0000644000175000017500000003251612245370026021777 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Threading; using System.Threading.Tasks; using JabbR.Client.Models; using JabbR.Models; using Microsoft.AspNet.SignalR.Client; using Microsoft.AspNet.SignalR.Client.Http; using Microsoft.AspNet.SignalR.Client.Hubs; using Microsoft.AspNet.SignalR.Client.Transports; namespace JabbR.Client { public class JabbRClient : IJabbRClient { private readonly IAuthenticationProvider _authenticationProvider; private readonly Func _transportFactory; private IHubProxy _chat; private HubConnection _connection; public JabbRClient(string url) : this(url, authenticationProvider: null, transportFactory: () => new AutoTransport(new DefaultHttpClient())) { } public JabbRClient(string url, IAuthenticationProvider authenticationProvider, Func transportFactory) { SourceUrl = url; _authenticationProvider = authenticationProvider ?? new DefaultAuthenticationProvider(url); _transportFactory = transportFactory; TraceLevel = TraceLevels.All; } public event Action MessageReceived; public event Action> LoggedOut; public event Action UserJoined; public event Action UserLeft; public event Action Kicked; public event Action PrivateMessage; public event Action UserTyping; public event Action GravatarChanged; public event Action MeMessageReceived; public event Action UsernameChanged; public event Action NoteChanged; public event Action FlagChanged; public event Action TopicChanged; public event Action OwnerAdded; public event Action OwnerRemoved; public event Action AddMessageContent; public event Action JoinedRoom; // Global public event Action RoomCountChanged; public event Action UserActivityChanged; public event Action> UsersInactive; public string SourceUrl { get; private set; } public bool AutoReconnect { get; set; } public TextWriter TraceWriter { get; set; } public TraceLevels TraceLevel { get; set; } public HubConnection Connection { get { return _connection; } } public ICredentials Credentials { get { return _connection.Credentials; } set { _connection.Credentials = value; } } public event Action Disconnected { add { _connection.Closed += value; } remove { _connection.Closed -= value; } } public event Action StateChanged { add { _connection.StateChanged += value; } remove { _connection.StateChanged -= value; } } public Task Connect(string name, string password) { var taskCompletionSource = new TaskCompletionSource(); _authenticationProvider.Connect(name, password) .Then(connection => { _connection = connection; if (TraceWriter != null) { _connection.TraceWriter = TraceWriter; } _connection.TraceLevel = TraceLevel; _chat = _connection.CreateHubProxy("chat"); SubscribeToEvents(); return _connection.Start(_transportFactory()); }) .Then(tcs => LogOn(tcs), taskCompletionSource) .Catch(ex => taskCompletionSource.TrySetException(ex)); return taskCompletionSource.Task; } private void LogOn(TaskCompletionSource tcs) { IDisposable logOn = null; Action callback = logOnInfo => { if (logOn != null) { logOn.Dispose(); } tcs.TrySetResult(logOnInfo); }; // Wait for the logOn callback to get triggered logOn = _chat.On>(ClientEvents.LogOn, rooms => { callback(new LogOnInfo { Rooms = rooms, UserId = (string)_chat["id"] }); }); // Join JabbR _chat.Invoke("Join").ContinueWith(task => { if (task.IsFaulted) { tcs.TrySetUnwrappedException(task.Exception); } else if (task.IsCanceled) { tcs.TrySetCanceled(); } }, TaskContinuationOptions.NotOnRanToCompletion); } public Task GetUserInfo() { return _chat.Invoke("GetUserInfo"); } public Task LogOut() { return _chat.Invoke("LogOut"); } public Task Send(string message, string roomName) { return _chat.Invoke("Send", message, roomName); } public Task Send(ClientMessage message) { return _chat.Invoke("Send", message); } public Task PostNotification(ClientNotification notification, bool executeContentProviders) { return _chat.Invoke("PostNotification", notification, executeContentProviders); } public Task PostNotification(ClientNotification notification) { return _chat.Invoke("PostNotification", notification); } public Task CreateRoom(string roomName) { var tcs = new TaskCompletionSource(); IDisposable createRoom = null; createRoom = _chat.On(ClientEvents.RoomCreated, room => { createRoom.Dispose(); tcs.SetResult(null); }); SendCommand("create {0}", roomName).ContinueWithNotComplete(tcs); return tcs.Task; } public Task JoinRoom(string roomName) { var tcs = new TaskCompletionSource(); IDisposable joinRoom = null; joinRoom = _chat.On(ClientEvents.JoinRoom, room => { joinRoom.Dispose(); tcs.SetResult(null); }); SendCommand("join {0}", roomName).ContinueWithNotComplete(tcs); return tcs.Task; } public Task LeaveRoom(string roomName) { return SendCommand("leave {0}", roomName); } public Task SetFlag(string countryCode) { return SendCommand("flag {0}", countryCode); } public Task SetNote(string noteText) { return SendCommand("note {0}", noteText); } public Task SendPrivateMessage(string userName, string message) { return SendCommand("msg {0} {1}", userName, message); } public Task Kick(string userName, string roomName) { return SendCommand("kick {0} {1}", userName, roomName); } public Task CheckStatus() { return _chat.Invoke("CheckStatus"); } public Task SetTyping(string roomName) { return _chat.Invoke("Typing", roomName); } public Task> GetPreviousMessages(string fromId) { return _chat.Invoke>("GetPreviousMessages", fromId); } public Task GetRoomInfo(string roomName) { return _chat.Invoke("GetRoomInfo", roomName); } public Task> GetRooms() { return _chat.Invoke>("GetRooms"); } public void Disconnect() { _connection.Stop(); } private void SubscribeToEvents() { if (AutoReconnect) { Disconnected += OnDisconnected; } _chat.On(ClientEvents.AddMessage, (message, room) => { Execute(MessageReceived, messageReceived => messageReceived(message, room)); }); _chat.On>(ClientEvents.LogOut, rooms => { Execute(LoggedOut, loggedOut => loggedOut(rooms)); }); _chat.On(ClientEvents.AddUser, (user, room, isOwner) => { Execute(UserJoined, userJoined => userJoined(user, room, isOwner)); }); _chat.On(ClientEvents.Leave, (user, room) => { Execute(UserLeft, userLeft => userLeft(user, room)); }); _chat.On(ClientEvents.Kick, room => { Execute(Kicked, kicked => kicked(room)); }); _chat.On(ClientEvents.UpdateRoomCount, (room, count) => { Execute(RoomCountChanged, roomCountChanged => roomCountChanged(room, count)); }); _chat.On(ClientEvents.UpdateActivity, user => { Execute(UserActivityChanged, userActivityChanged => userActivityChanged(user)); }); _chat.On(ClientEvents.SendPrivateMessage, (from, to, message) => { Execute(PrivateMessage, privateMessage => privateMessage(from, to, message)); }); _chat.On>(ClientEvents.MarkInactive, (users) => { Execute(UsersInactive, usersInactive => usersInactive(users)); }); _chat.On(ClientEvents.SetTyping, (user, room) => { Execute(UserTyping, userTyping => userTyping(user, room)); }); _chat.On(ClientEvents.GravatarChanged, (user, room) => { Execute(GravatarChanged, gravatarChanged => gravatarChanged(user, room)); }); _chat.On(ClientEvents.MeMessageReceived, (user, content, room) => { Execute(MeMessageReceived, meMessageReceived => meMessageReceived(user, content, room)); }); _chat.On(ClientEvents.UsernameChanged, (oldUserName, user, room) => { Execute(UsernameChanged, usernameChanged => usernameChanged(oldUserName, user, room)); }); _chat.On(ClientEvents.NoteChanged, (user, room) => { Execute(NoteChanged, noteChanged => noteChanged(user, room)); }); _chat.On(ClientEvents.FlagChanged, (user, room) => { Execute(FlagChanged, flagChanged => flagChanged(user, room)); }); _chat.On(ClientEvents.TopicChanged, (room) => { Execute(TopicChanged, topicChanged => topicChanged(room)); }); _chat.On(ClientEvents.OwnerAdded, (user, room) => { Execute(OwnerAdded, ownerAdded => ownerAdded(user, room)); }); _chat.On(ClientEvents.OwnerRemoved, (user, room) => { Execute(OwnerRemoved, ownerRemoved => ownerRemoved(user, room)); }); _chat.On(ClientEvents.AddMessageContent, (messageId, extractedContent, roomName) => { Execute(AddMessageContent, addMessageContent => addMessageContent(messageId, extractedContent, roomName)); }); _chat.On(ClientEvents.JoinRoom, (room) => { Execute(JoinedRoom, joinedRoom => joinedRoom(room)); }); } private void OnDisconnected() { TaskAsyncHelper.Delay(TimeSpan.FromSeconds(5)).Then(() => { _connection.Start(_transportFactory()).Then(() => { // Join JabbR _chat.Invoke("Join", false); }); }); } private static void Execute(T handlers, Action action) where T : class { Task.Factory.StartNew(() => { if (handlers != null) { action(handlers); } }).Catch(); } private Task SendCommand(string command, params object[] args) { return _chat.Invoke("Send", String.Format("/" + command, args), ""); } } } smuxi-0.11/lib/JabbR/JabbR.Client/ClientEvents.cs0000644000175000017500000000301112204443201022236 0ustar00meebeymeebey00000000000000namespace JabbR.Client { public static class ClientEvents { public static readonly string AddMessage = "addMessage"; public static readonly string AddMessageContent = "addMessageContent"; public static readonly string AddUser = "addUser"; public static readonly string Leave = "leave"; public static readonly string LogOn = "logOn"; public static readonly string LogOut = "logOut"; public static readonly string Kick = "kick"; public static readonly string UpdateRoomCount = "updateRoomCount"; public static readonly string UpdateActivity = "updateActivity"; public static readonly string MarkInactive = "markInactive"; public static readonly string SendPrivateMessage = "sendPrivateMessage"; public static readonly string SetTyping = "setTyping"; public static readonly string JoinRoom = "joinRoom"; public static readonly string RoomCreated = "roomCreated"; public static readonly string GravatarChanged = "changeGravatar"; public static readonly string MeMessageReceived = "sendMeMessage"; public static readonly string UsernameChanged = "changeUserName"; public static readonly string NoteChanged = "changeNote"; public static readonly string FlagChanged = "changeFlag"; public static readonly string TopicChanged = "changeTopic"; public static readonly string OwnerAdded = "addOwner"; public static readonly string OwnerRemoved = "removeOwner"; } } smuxi-0.11/lib/JabbR/JabbR.Client/DefaultAuthenticationProvider.cs0000644000175000017500000000464512204443201025650 0ustar00meebeymeebey00000000000000using System; using System.Net; using System.Security; using System.Text; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Client.Hubs; namespace JabbR.Client { public class DefaultAuthenticationProvider : IAuthenticationProvider { private readonly string _url; public DefaultAuthenticationProvider(string url) { _url = url; } public Task Connect(string userName, string password) { var content = String.Format("username={0}&password={1}", Uri.EscapeUriString(userName), Uri.EscapeUriString(password)); var contentBytes = Encoding.ASCII.GetBytes(content); var authUri = new UriBuilder(_url) { Path = "account/login" }; var cookieJar = new CookieContainer(); var request = (HttpWebRequest)WebRequest.Create(authUri.Uri); request.CookieContainer = cookieJar; request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = contentBytes.Length; return request.GetHttpRequestStreamAsync() .Then(stream => stream.WriteAsync(contentBytes).Then(() => stream.Dispose())) .Then(() => request.GetHttpResponseAsync()) .Then(response => { var respStatusCode = response.StatusCode; if (respStatusCode < HttpStatusCode.OK || respStatusCode > (HttpStatusCode)299) { throw new WebException(String.Format("Response status code does not indicate success: {0}", respStatusCode)); } // Verify the cookie var cookie = cookieJar.GetCookies(new Uri(_url)); if (cookie == null || cookie["jabbr.id"] == null) { throw new SecurityException("Didn't get a cookie from JabbR! Ensure your User Name/Password are correct"); } // Create a hub connection and give it our cookie jar var connection = new HubConnection(_url) { CookieContainer = cookieJar }; return connection; }); } } } smuxi-0.11/lib/osx/0000755000175000017500000000000012311344237014755 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/osx/Info.plist.in0000644000175000017500000000200012250426634017326 0ustar00meebeymeebey00000000000000 CFBundleDevelopmentRegion English CFBundleExecutable smuxi CFBundleIconFile smuxi.icns CFBundleIdentifier org.smuxi CFBundleInfoDictionaryVersion 6.0 CFBundleName Smuxi CFBundlePackageType APPL CFBundleShortVersionString @VERSION@ CFBundleSignature smxi CFBundleVersion @VERSION@ NSAppleScriptEnabled NO CFBundleURLTypes CFBundleURLName IRC CFBundleURLSchemes irc smuxi-0.11/lib/db4o-net/0000755000175000017500000000000012311344240015552 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/0000755000175000017500000000000012311344240020324 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o-2008.csproj0000755000175000017500000021440212250207071024717 0ustar00meebeymeebey00000000000000 Debug AnyCPU 9.0.30729 2.0 {600CD3BF-2ED2-4183-87F7-ADD78A968AE0} Library Properties Db4objects.Db4o Db4objects.Db4o v3.5 512 true ../db4objects.snk true full false bin\Debug\ TRACE;DEBUG;NET_3_5 prompt 4 bin\Debug\Db4objects.Db4o.xml 1591;1572;1573;1574;0419; full true bin\Release\ TRACE;NET_3_5 prompt 4 1591;1572;1573;1574;0419; bin\Release\Db4objects.Db4o.xml true 3.5 smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/0000755000175000017500000000000011700531646021623 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/compact/0000755000175000017500000000000011700531646023251 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/compact/Lock4.cs0000644000175000017500000000475611700531646024570 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using System; using System.Threading; namespace Db4objects.Db4o.Foundation { #if CF public class Lock4 { private volatile Thread lockedByThread; private volatile Thread waitReleased; private volatile Thread closureReleased; readonly AutoResetEvent waitEvent = new AutoResetEvent(false); readonly AutoResetEvent closureEvent = new AutoResetEvent(false); public void Awake() { AwakeWait(); } public Object Run(IClosure4 closure4) { EnterClosure(); try { return closure4.Run(); } finally { AwakeClosure(); } } public void Snooze(long timeout) { AwakeClosure(); WaitWait(timeout); EnterClosure(); } private void EnterClosure() { while (lockedByThread != Thread.CurrentThread) { while (!SetLock()) { WaitClosure(); } } } private void AwakeClosure() { lock (this) { RemoveLock(); closureReleased = Thread.CurrentThread; closureEvent.Set(); Thread.Sleep(0); if (closureReleased == Thread.CurrentThread) { closureEvent.Reset(); } } } private void AwakeWait() { lock (this) { waitReleased = Thread.CurrentThread; waitEvent.Set(); Thread.Sleep(0); if (waitReleased == Thread.CurrentThread) { waitEvent.Reset(); } } } private void WaitWait(long timeout) { waitEvent.WaitOne((int) timeout, false); waitReleased = Thread.CurrentThread; } private void WaitClosure() { closureEvent.WaitOne(); closureReleased = Thread.CurrentThread; } private bool SetLock() { lock (this) { if (lockedByThread == null) { lockedByThread = Thread.CurrentThread; return true; } return false; } } private void RemoveLock() { lock (this) { if (lockedByThread == Thread.CurrentThread) { lockedByThread = null; } } } } #endif }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/net/0000755000175000017500000000000011700531646022411 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/net/Compat.cs0000644000175000017500000000023011700531646024156 0ustar00meebeymeebey00000000000000/* Copyright (C) 2005 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o { #if !CF /// public class Compat { } #endif } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/net/SerializationConstructor.cs0000644000175000017500000000161511700531646030026 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Reflect.Core; namespace Db4objects.Db4o.Reflect.Net { #if !CF && !SILVERLIGHT /// Constructs objects by using System.Runtime.Serialization.FormatterServices.GetUninitializedObject /// and bypasses calls to user contructors this way. Not available on CompactFramework /// public class SerializationConstructor : IReflectConstructor { private Type _type; public SerializationConstructor(Type type){ _type = type; } public virtual IReflectClass[] GetParameterTypes() { return null; } #if NET_4_0 [System.Security.SecurityCritical] #endif public virtual object NewInstance(object[] parameters) { return System.Runtime.Serialization.FormatterServices.GetUninitializedObject(_type); } } #endif } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/net/TSerializable.cs0000644000175000017500000000252011700531646025471 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.IO; using Sharpen.Lang; using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { #if !CF && !SILVERLIGHT using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; /// /// translator for types that are marked with the Serializable attribute. /// The Serializable translator is provided to allow persisting objects that /// do not supply a convenient constructor. The use of this translator is /// recommended only if:
/// - the persistent type will never be refactored
/// - querying for type members is not necessary
///
public class TSerializable : IObjectConstructor { public Object OnStore(IObjectContainer objectContainer, Object obj) { MemoryStream memoryStream = new MemoryStream(); new BinaryFormatter().Serialize(memoryStream, obj); return memoryStream.GetBuffer(); } public void OnActivate(IObjectContainer objectContainer, Object obj, Object members) { } public Object OnInstantiate(IObjectContainer objectContainer, Object obj) { MemoryStream memoryStream = new MemoryStream((byte[])obj); return new BinaryFormatter().Deserialize(memoryStream); } public System.Type StoredClass() { return typeof(byte[]); } } #endif } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/net/Lock4.cs0000644000175000017500000000104211700531646023711 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.Threading; #if !CF namespace Db4objects.Db4o.Foundation { public class Lock4 { public void Awake() { Monitor.Pulse(this); } public Object Run(IClosure4 closure) { lock (this) { return closure.Run(); } } public void Snooze(long timeout) { Monitor.Wait(this, (int)timeout); } } } #endif smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/0000755000175000017500000000000011700531646023223 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Runtime.cs0000644000175000017500000001524011700531646025177 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.IO; using System.Reflection; using System.Threading; using Sharpen.Lang; namespace Sharpen { public class Runtime { private static long DIFFERENCE_IN_TICKS = 62135604000000; private static long RATIO = 10000; public static TextWriter Out { get { return Console.Out; } } public static TextWriter Err { get { return Console.Error; } } public static object GetArrayValue(object array, int i) { return ((Array)array).GetValue(i); } public static int GetArrayLength(object array) { return ((Array) array).Length; } public static void SetArrayValue(object array, int index, object value) { ((Array)array).SetValue(value, index); } private const BindingFlags AllMembers = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; private const BindingFlags DeclaredMembers = BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; private const BindingFlags DeclaredMembersIncludingStatic = DeclaredMembers | BindingFlags.Static; public static FieldInfo GetDeclaredField(Type type, string name) { return type.GetField(name, DeclaredMembersIncludingStatic); } public static FieldInfo[] GetDeclaredFields(Type type) { return type.GetFields(DeclaredMembersIncludingStatic); } public static MethodInfo GetDeclaredMethod(Type type, string name, Type[] parameterTypes) { return type.GetMethod(name, DeclaredMembers, null, parameterTypes, null); } public static MethodInfo GetMethod(Type type, string name, Type[] parameterTypes) { return type.GetMethod(name, AllMembers, null, parameterTypes, null); } public static Type[] GetParameterTypes(MethodBase method) { ParameterInfo[] parameters = method.GetParameters(); Type[] types = new Type[parameters.Length]; for (int i=0; i _cache = new Dictionary(); #endif } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Lang/ThreadLocal.cs0000644000175000017500000000144311700531646026617 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace Sharpen.Lang { #if CF class ThreadLocal : Db4objects.Db4o.Foundation.ThreadLocal4 { } #else class ThreadLocal { [ThreadStatic] private static Dictionary _locals; public object Get() { object value; if (Locals.TryGetValue(this, out value)) return value; return null; } public void Set(object value) { if (value == null) Locals.Remove(this); else Locals[this] = value; } private static Dictionary Locals { get { Dictionary value = _locals; if (value == null) _locals = value = new Dictionary(); return value; } } } #endif } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Lang/IdentityHashCodeProvider.cs0000644000175000017500000000233011700531646031334 0ustar00meebeymeebey00000000000000/* Copyright (C) 2005 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; namespace Sharpen.Lang { public class IdentityHashCodeProvider { #if !CF public static int IdentityHashCode(object obj) { return System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(obj); } #else public static int IdentityHashCode(object obj) { if (obj == null) return 0; return (int) _hashMethod.Invoke(null, new object[] { obj }); } private static MethodInfo _hashMethod = GetIdentityHashCodeMethod(); private static MethodInfo GetIdentityHashCodeMethod() { Assembly assembly = typeof(object).Assembly; try { Type t = assembly.GetType("System.PInvoke.EE"); return t.GetMethod( "Object_GetHashCode", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); } catch (Exception e) { } // We may be running the CF app on .NET Framework 1.1 // for profiling, let's give that a chance try { Type t = assembly.GetType( "System.Runtime.CompilerServices.RuntimeHelpers"); return t.GetMethod( "GetHashCode", BindingFlags.Public | BindingFlags.Static); } catch { } return null; } #endif } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Lang/TypeReferenceParser.cs0000644000175000017500000001346211700531646030356 0ustar00meebeymeebey00000000000000/* Copyright (C) 2005 Versant Inc. http://www.db4o.com */ using System; using System.Collections.Generic; using System.Globalization; using System.Reflection; namespace Sharpen.Lang { internal class TypeReferenceParser { private readonly TypeReferenceLexer _lexer; private readonly Stack _stack = new Stack(); public TypeReferenceParser(string input) { _lexer = new TypeReferenceLexer(input); } public TypeReference Parse() { SimpleTypeReference str = ParseSimpleTypeReference(); TypeReference returnValue = ParseQualifiedTypeReference(str); Token token = NextToken(); if (null != token) { switch (token.Kind) { case TokenKind.Comma: str.SetAssemblyName(ParseAssemblyName()); break; default: UnexpectedToken(TokenKind.Comma, token); break; } } return returnValue; } private TypeReference ParseQualifiedTypeReference(TypeReference elementType) { TypeReference returnValue = elementType; Token token; while (null != (token = NextToken())) { switch (token.Kind) { case TokenKind.LBrack: returnValue = ParseArrayTypeReference(returnValue); break; case TokenKind.PointerQualifier: returnValue = new PointerTypeReference(returnValue); break; default: Push(token); return returnValue; } } return returnValue; } private TypeReference ParseArrayTypeReference(TypeReference str) { int rank = 1; Token token = NextToken(); while (null != token && token.Kind == TokenKind.Comma) { ++rank; token = NextToken(); } AssertTokenKind(TokenKind.RBrack, token); return new ArrayTypeReference(str, rank); } private SimpleTypeReference ParseSimpleTypeReference() { Token id = Expect(TokenKind.Id); Token t = NextToken(); if (null == t) return new SimpleTypeReference(id.Value); while (TokenKind.NestedQualifier == t.Kind) { Token nestedId = Expect(TokenKind.Id); id.Value += "+" + nestedId.Value; t = NextToken(); if (null == t) return new SimpleTypeReference(id.Value); } if (t.Kind == TokenKind.GenericQualifier) { return ParseGenericTypeReference(id); } Push(t); return new SimpleTypeReference(id.Value); } private SimpleTypeReference ParseGenericTypeReference(Token id) { return InternalParseGenericTypeReference(id, 0); } private SimpleTypeReference InternalParseGenericTypeReference(Token id, int count) { Token argcToken = Expect(TokenKind.Number); id.Value += "`" + argcToken.Value; int argc = int.Parse(argcToken.Value); Token t = NextToken(); while (TokenKind.NestedQualifier == t.Kind) { Token nestedId = Expect(TokenKind.Id); id.Value += "+" + nestedId.Value; t = NextToken(); } if (IsInnerGenericTypeReference(t)) { return InternalParseGenericTypeReference(id, argc + count); } TypeReference[] args = new TypeReference[0]; if (!IsOpenGenericTypeDefinition(t)) { args = new TypeReference[argc + count]; AssertTokenKind(TokenKind.LBrack, t); for (int i = 0; i < args.Length; ++i) { if (i > 0) Expect(TokenKind.Comma); Expect(TokenKind.LBrack); args[i] = Parse(); Expect(TokenKind.RBrack); } Expect(TokenKind.RBrack); } else { Push(t); } return new GenericTypeReference(id.Value, args); } private static bool IsOpenGenericTypeDefinition(Token t) { return t.Kind != TokenKind.LBrack; } private static bool IsInnerGenericTypeReference(Token t) { return TokenKind.GenericQualifier == t.Kind; } public AssemblyName ParseAssemblyName() { Token simpleName = Expect(TokenKind.Id); AssemblyName assemblyName = new AssemblyName(); assemblyName.Name = simpleName.Value; if (!CommaIdEquals()) return assemblyName; Token version = Expect(TokenKind.VersionNumber); assemblyName.Version = new Version(version.Value); if (!CommaIdEquals()) return assemblyName; Token culture = Expect(TokenKind.Id); if ("neutral" == culture.Value) { assemblyName.CultureInfo = CultureInfo.InvariantCulture; } else { #if SILVERLIGHT assemblyName.CultureInfo = CultureInfo.InvariantCulture; #else assemblyName.CultureInfo = CultureInfo.CreateSpecificCulture(culture.Value); #endif } if (!CommaIdEquals()) return assemblyName; Token token = NextToken(); if ("null" != token.Value) { assemblyName.SetPublicKeyToken(ParsePublicKeyToken(token.Value)); } return assemblyName; } static byte[] ParsePublicKeyToken(string token) { int len = token.Length / 2; byte[] bytes = new byte[len]; for (int i = 0; i < len; ++i) { bytes[i] = byte.Parse(token.Substring(i * 2, 2), NumberStyles.HexNumber); } return bytes; } private bool CommaIdEquals() { Token token = NextToken(); if (null == token) return false; if (token.Kind != TokenKind.Comma) { Push(token); return false; } AssertTokenKind(TokenKind.Comma, token); Expect(TokenKind.Id); Expect(TokenKind.Equals); return true; } Token Expect(TokenKind expected) { Token actual = NextToken(); AssertTokenKind(expected, actual); return actual; } private static void AssertTokenKind(TokenKind expected, Token actual) { if (null == actual || actual.Kind != expected) { UnexpectedToken(expected, actual); } } private static void UnexpectedToken(TokenKind expectedKind, Token actual) { throw new ArgumentException(string.Format("Unexpected Token: '{0}' (Expected kind: '{1}')", actual, expectedKind)); } private void Push(Token token) { _stack.Push(token); } private Token NextToken() { return _stack.Count > 0 ? _stack.Pop() : _lexer.NextToken(); } } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Lang/TypeReference.cs0000644000175000017500000001523211700531646027176 0ustar00meebeymeebey00000000000000/* Copyright (C) 2005 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; using System.Text; namespace Sharpen.Lang { public abstract class TypeReference { public static TypeReference FromString(string s) { if (null == s) throw new ArgumentNullException("s"); return new TypeReferenceParser(s).Parse(); } public static TypeReference FromType(Type type) { if (null == type) throw new ArgumentNullException("type"); return FromString(type.AssemblyQualifiedName); } public abstract string SimpleName { get; } public abstract AssemblyName AssemblyName { get; } public abstract Type Resolve(); public abstract void AppendTypeName(StringBuilder builder); public override string ToString() { return GetUnversionedName(); } public string GetUnversionedName() { StringBuilder builder = new StringBuilder(); AppendUnversionedName(builder); return builder.ToString(); } internal virtual void AppendUnversionedName(StringBuilder builder) { AppendTypeName(builder); AppendUnversionedAssemblyName(builder); } protected void AppendUnversionedAssemblyName(StringBuilder builder) { AssemblyName assemblyName = AssemblyName; if (null == assemblyName) return; builder.Append(", "); builder.Append(assemblyName.Name); } } public partial class SimpleTypeReference : TypeReference { protected string _simpleName; protected AssemblyName _assemblyName; internal SimpleTypeReference(string simpleName) { _simpleName = simpleName; } public override string SimpleName { get { return _simpleName; } } public override AssemblyName AssemblyName { get { return _assemblyName; } } public override Type Resolve() { return _assemblyName == null ? Type.GetType(SimpleName) : ResolveAssembly().GetType(SimpleName); } public override void AppendTypeName(StringBuilder builder) { builder.Append(SimpleName); } public override bool Equals(object obj) { SimpleTypeReference other = obj as SimpleTypeReference; if (null == other) return false; return _simpleName == other._simpleName; } internal void SetSimpleName(string simpleName) { _simpleName = simpleName; } internal void SetAssemblyName(AssemblyName assemblyName) { _assemblyName = assemblyName; } private Assembly ResolveAssembly() { #if SILVERLIGHT return ResolveAssemblySilverlight(); #else if (null == _assemblyName.Version) { return LoadUnversionedAssembly(_assemblyName); } Assembly found; try { found = Assembly.Load(_assemblyName); } catch (Exception) { AssemblyName unversioned = (AssemblyName)_assemblyName.Clone(); unversioned.Version = null; found = LoadUnversionedAssembly(unversioned); } return found; #endif } private Assembly LoadUnversionedAssembly(AssemblyName unversioned) { #if CF || SILVERLIGHT return Assembly.Load(unversioned); #else Assembly found = Assembly.LoadWithPartialName(unversioned.FullName); return found == null ? Assembly.Load(unversioned) : found; #endif } } public abstract class QualifiedTypeReference : TypeReference { protected TypeReference _elementType; protected QualifiedTypeReference(TypeReference elementType) { _elementType = elementType; } public override string SimpleName { get { return _elementType.SimpleName; } } public override AssemblyName AssemblyName { get { return _elementType.AssemblyName; } } public override void AppendTypeName(StringBuilder builder) { _elementType.AppendTypeName(builder); AppendQualifier(builder); } protected abstract void AppendQualifier(StringBuilder builder); } public class PointerTypeReference : QualifiedTypeReference { public PointerTypeReference(TypeReference elementType) : base(elementType) { } protected override void AppendQualifier(StringBuilder builder) { builder.Append('*'); } public override Type Resolve() { #if !CF return _elementType.Resolve().MakePointerType(); #else StringBuilder builder = new StringBuilder(); AppendTypeName(builder); return _elementType.Resolve().Assembly.GetType(builder.ToString(), true); #endif } } public class ArrayTypeReference : QualifiedTypeReference { public static Type MakeArrayType(Type elementType, int rank) { #if !CF if (rank == 1) return elementType.MakeArrayType(); return elementType.MakeArrayType(rank); #else if (rank == 1) return Array.CreateInstance(elementType, 0).GetType(); return Array.CreateInstance(elementType, new int[rank]).GetType(); #endif } private readonly int _rank; internal ArrayTypeReference(TypeReference elementType, int rank) : base(elementType) { _rank = rank; } public int Rank { get { return _rank; } } public override Type Resolve() { return MakeArrayType(_elementType.Resolve(), _rank); } protected override void AppendQualifier(StringBuilder builder) { builder.Append('['); for (int i = 1; i < _rank; ++i) { builder.Append(','); } builder.Append(']'); } } public class GenericTypeReference : SimpleTypeReference { private readonly TypeReference[] _genericArguments; internal GenericTypeReference(string simpleName, TypeReference[] genericArguments) : base(simpleName) { _genericArguments = genericArguments; } public TypeReference[] GenericArguments { get { return _genericArguments; } } public override Type Resolve() { Type baseType = base.Resolve(); return _genericArguments.Length > 0 ? baseType.MakeGenericType(Resolve(_genericArguments)) : baseType; } static Type[] Resolve(TypeReference[] typeRefs) { Type[] types = new Type[typeRefs.Length]; for (int i = 0; i < types.Length; ++i) { types[i] = typeRefs[i].Resolve(); } return types; } public override void AppendTypeName(StringBuilder builder) { builder.Append(_simpleName); AppendUnversionedGenericArguments(builder); } private void AppendUnversionedGenericArguments(StringBuilder builder) { if (_genericArguments.Length == 0) return; builder.Append("["); for (int i = 0; i < _genericArguments.Length; ++i) { if (i > 0) builder.Append(", "); builder.Append("["); _genericArguments[i].AppendUnversionedName(builder); builder.Append("]"); } builder.Append("]"); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Lang/Thread.cs0000644000175000017500000000457611700531646025656 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.Threading; namespace Sharpen.Lang { public class Thread : IRunnable { private IRunnable _target; private string _name; private System.Threading.Thread _thread; private bool _isDaemon; public Thread() { _target = this; } public Thread(IRunnable target, string name) { _target = target; SetName(name); } public Thread(IRunnable target) { _target = target; } public Thread(System.Threading.Thread thread) { _thread = thread; } public static Thread CurrentThread() { return new Thread(System.Threading.Thread.CurrentThread); } public virtual void Run() { } public void SetName(string name) { _name = name; #if !CF if (_thread != null && name != null) { try { _thread.Name = _name; } catch { } } #endif } public string GetName() { #if !CF return _thread != null ? _thread.Name : _name; #else return ""; #endif } public static void Sleep(long milliseconds) { System.Threading.Thread.Sleep((int)milliseconds); } public void Start() { _thread = new System.Threading.Thread(EntryPoint); _thread.IsBackground = _isDaemon; if (_name != null) { SetName(_name); } _thread.Start(); } public void Join() { if (_thread == null) return; _thread.Join(); } public void Join(int millisecondsTimeout) { if (_thread == null) return; _thread.Join(millisecondsTimeout); } public void SetDaemon(bool isDaemon) { _isDaemon = isDaemon; } public override bool Equals(object obj) { Thread other = (obj as Thread); if (other == null) return false; if (other == this) return true; if (_thread == null) return false; return _thread == other._thread; } public override int GetHashCode() { return _thread == null ? 37 : _thread.GetHashCode(); } private void EntryPoint() { try { _target.Run(); } catch (Exception e) { // don't let an unhandled exception bring // the process down Runtime.PrintStackTrace(e); } } public bool IsDaemon() { return _thread != null ? _thread.IsBackground : _isDaemon; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Lang/TypeReferenceLexer.cs0000644000175000017500000000662411700531646030203 0ustar00meebeymeebey00000000000000/* Copyright (C) 2005 Versant Inc. http://www.db4o.com */ using System; using System.Text; namespace Sharpen.Lang { internal enum TokenKind { Comma, Equals, Id, Number, VersionNumber, GenericQualifier, NestedQualifier, LBrack, RBrack, PointerQualifier } internal class Token { public TokenKind Kind; public string Value; public Token(TokenKind kind, string value) { this.Kind = kind; this.Value = value; //Console.WriteLine(this); } public override string ToString() { return string.Format("Token(Kind: {0}, Value: '{1}')", Kind, Value); } } internal class TypeReferenceLexer { string _input; int _index; StringBuilder _buffer; // TODO: get rid of StringBuilder and use string.Substring public TypeReferenceLexer(string input) { if (null == input) throw new ArgumentNullException("input"); _input = input; _index = 0; _buffer = new StringBuilder(input.Length); } bool AtEOF { get { return _index == _input.Length; } } public Token NextToken() { if (AtEOF) return null; char ch = Peek(); switch (ch) { case '*': return ConsumeSingleCharToken(ch, TokenKind.PointerQualifier); case '+': return ConsumeSingleCharToken(ch, TokenKind.NestedQualifier); case '[': return ConsumeSingleCharToken(ch, TokenKind.LBrack); case ']': return ConsumeSingleCharToken(ch, TokenKind.RBrack); case '=': return ConsumeSingleCharToken(ch, TokenKind.Equals); case ',': return ConsumeSingleCharToken(ch, TokenKind.Comma); case '`': return ConsumeSingleCharToken(ch, TokenKind.GenericQualifier); case ' ': Consume(); return NextToken(); default: if (IsIdStart(ch)) return Id(); if (char.IsDigit(ch)) return NumberOrVersion(); break; } throw new Exception(string.Format("Unexpected char '{0}'", ch)); } private static bool IsIdStart(char ch) { switch (ch) { case '_': case '<': // c# compiler generated classes return true; } return char.IsLetter(ch); } private Token Id() { do { char ch = Peek(); if (!char.IsLetterOrDigit(ch) && '.' != ch && '-' != ch && '_' != ch && '<' != ch && '>' != ch && ':' != ch && ' ' != ch) // assembly names can contain spaces { break; } ConsumeAndBuffer(ch); } while (!AtEOF); return TokenFromBuffer(TokenKind.Id); } private Token NumberOrVersion() { TokenKind kind = TokenKind.Number; do { char ch = Peek(); if ('.' == ch) { kind = TokenKind.VersionNumber; } else { if (!IsHexDigit(ch)) { break; } } ConsumeAndBuffer(ch); } while (!AtEOF); return TokenFromBuffer(kind); } private static bool IsHexDigit(char ch) { return char.IsDigit(ch) || IsHexLetter(ch); } private static bool IsHexLetter(char ch) { return (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f'); } private void ConsumeAndBuffer(char ch) { Consume(); _buffer.Append(ch); } private Token TokenFromBuffer(TokenKind kind) { Token token = new Token(kind, _buffer.ToString()); _buffer.Length = 0; return token; } private Token ConsumeSingleCharToken(char ch, TokenKind kind) { Consume(); return new Token(kind, new string(ch, 1)); } void Consume() { ++_index; } char Peek() { return _input[_index]; } } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Lang/Runnable.cs0000644000175000017500000000021111700531646026173 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ namespace Sharpen.Lang { public interface IRunnable { void Run(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Lang/Reflect.cs0000755000175000017500000000031011700531646026014 0ustar00meebeymeebey00000000000000namespace Sharpen.Lang.Reflect { // this namespace just exists because of a bug // in sharpen that makes it fail to realize that // a mapped namespace is not being used class __fixme__ { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Collections.cs0000644000175000017500000000231711700531646026033 0ustar00meebeymeebey00000000000000 using System.Collections; using System.Collections.Generic; namespace Sharpen { public class Collections { public static void AddAll(System.Collections.IList list, System.Collections.IEnumerable added) { foreach (object o in added) { list.Add(o); } } public static bool AddAll(ICollection list, System.Collections.Generic.IEnumerable added) { foreach (T o in added) { list.Add(o); } return true; } public static object Remove(IDictionary dictionary, object key) { object removed = dictionary[key]; dictionary.Remove(key); return removed; } public static object[] ToArray(ICollection collection) { object[] result = new object[collection.Count]; collection.CopyTo(result, 0); return result; } public static T[] ToArray(ICollection collection, T[] result) { collection.CopyTo(result, 0); return result; } public static T[] ToArray(ICollection collection, T[] result) { collection.CopyTo(result, 0); return result; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/0000755000175000017500000000000011700531646023532 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/BufferedOutputStream.cs0000644000175000017500000000136211700531646030202 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; namespace Sharpen.IO { public class BufferedOutputStream : IOutputStream { private IOutputStream _stream; public BufferedOutputStream(IOutputStream stream) { _stream = stream; } public BufferedOutputStream(IOutputStream stream, int bufferSize) { _stream = stream; } public void Write(int i) { _stream.Write(i); } public void Write(byte[] bytes) { _stream.Write(bytes); } public void Write(byte[] bytes, int offset, int length) { _stream.Write(bytes, offset, length); } public void Flush() { _stream.Flush(); } public void Close() { _stream.Close(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/OutputStream.cs0000644000175000017500000000110211700531646026527 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System.IO; namespace Sharpen.IO { public class OutputStream : StreamAdaptor, IOutputStream { public OutputStream(Stream stream) : base(stream) { } public void Write(int i) { _stream.WriteByte((byte)i); } public void Write(byte[] bytes) { _stream.Write(bytes, 0, bytes.Length); } public void Write(byte[] bytes, int offset, int length) { _stream.Write(bytes, offset, length); } public void Flush() { _stream.Flush(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/StreamAdaptor.cs0000644000175000017500000000057311700531646026634 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System.IO; namespace Sharpen.IO { public abstract class StreamAdaptor { protected readonly Stream _stream; public StreamAdaptor(Stream stream) { _stream = stream; } public Stream UnderlyingStream { get { return _stream; } } public void Close() { _stream.Close(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/BufferedInputStream.cs0000644000175000017500000000127111700531646030000 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; namespace Sharpen.IO { public class BufferedInputStream : IInputStream { private IInputStream _stream; public BufferedInputStream(IInputStream stream) { _stream = stream; } public BufferedInputStream(IInputStream stream, int bufferSize) { _stream = stream; } public int Read() { return _stream.Read(); } public int Read(byte[] bytes) { return _stream.Read(bytes); } public int Read(byte[] bytes, int offset, int length) { return _stream.Read(bytes, offset, length); } public void Close() { _stream.Close(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/FileInputStream.cs0000644000175000017500000000045711700531646027142 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.IO; namespace Sharpen.IO { public class FileInputStream : InputStream { public FileInputStream(File file) : base(new FileStream(file.GetPath(), FileMode.Open, FileAccess.Read)) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/FileOutputStream.cs0000644000175000017500000000046511700531646027342 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.IO; namespace Sharpen.IO { public class FileOutputStream : OutputStream { public FileOutputStream(File file) : base(new FileStream(file.GetPath(), FileMode.Create, FileAccess.Write)) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/IInputStream.cs0000644000175000017500000000027011700531646026444 0ustar00meebeymeebey00000000000000namespace Sharpen.IO { public interface IInputStream { int Read(); int Read(byte[] bytes); int Read(byte[] bytes, int offset, int length); void Close(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/IFilenameFilter.cs0000644000175000017500000000023311700531646027056 0ustar00meebeymeebey00000000000000using System; namespace Sharpen.IO { public interface IFilenameFilter { bool Accept(Sharpen.IO.File dir, String name); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/File.cs0000644000175000017500000000626111700531646024745 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.Collections.Generic; using System.IO; using Db4objects.Db4o.IO; namespace Sharpen.IO { public class File { public static readonly char separatorChar = Path.DirectorySeparatorChar; public static readonly string separator = separatorChar.ToString(); private readonly string _path; public File(string path) { _path = path; } public static implicit operator string(File file) { return file.GetAbsolutePath(); } public File(string dir, string file) { _path = dir == null ? file : Path.Combine(dir, file); } public virtual bool Delete() { #if SILVERLIGHT return SilverlightIO.Delete(_path); #else if (Exists()) { System.IO.File.Delete(_path); return !Exists(); } return false; #endif } public bool Exists() { #if CF string path = RemoveTrailingSlash(_path); #elif SILVERLIGHT string path = _path; return SilverlightIO.Exists(path); #else string path = _path; #endif return System.IO.File.Exists(path) || Directory.Exists(path); } private static string RemoveTrailingSlash(string path) { return (path.EndsWith("\\") || path.EndsWith("/")) ? path.Remove(path.Length - 1, 1) : path; } public string GetCanonicalPath() { return Path.GetFullPath(_path); } public File GetCanonicalFile() { return new File(GetCanonicalPath()); } public string GetAbsolutePath() { #if SILVERLIGHT return _path; #else return Path.GetFullPath(_path); #endif } public string GetName() { int index = _path.LastIndexOf(separator); return _path.Substring(index + 1); } public string GetPath() { return _path; } public bool IsDirectory() { #if CF || SILVERLIGHT return Exists(); #else return (System.IO.File.GetAttributes(_path) & FileAttributes.Directory) != 0; #endif } public long Length() { #if SILVERLIGHT return SilverlightIO.Length(_path); #else return new FileInfo(_path).Length; #endif } public string[] List() { #if SILVERLIGHT throw new NotImplementedException(); #else return Directory.GetFiles(_path); #endif } public bool Mkdir() { if (Exists()) { return false; } Directory.CreateDirectory(_path); return Exists(); } public bool Mkdirs() { if (Exists()) { return false; } int pos = _path.LastIndexOf(separator); if (pos > 0) { new File(_path.Substring(0, pos)).Mkdirs(); } return Mkdir(); } public void RenameTo(File file) { new FileInfo(_path).MoveTo(file.GetPath()); } public File[] ListFiles(IFilenameFilter filter) { String[] ss = List(); if (ss == null) return null; List v = new List(); for (int i = 0; i < ss.Length; i++) { if ((filter == null) || filter.Accept(this, ss[i])) { v.Add(new File(ss[i], this)); } } return v.ToArray(); } public override string ToString() { return _path; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/ByteArrayInputStream.cs0000644000175000017500000000042511700531646030160 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; using System.IO; namespace Sharpen.IO { public class ByteArrayInputStream : InputStream { public ByteArrayInputStream(byte[] initial) : base(new MemoryStream(initial)) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/IOutputStream.cs0000644000175000017500000000032111700531646026642 0ustar00meebeymeebey00000000000000namespace Sharpen.IO { public interface IOutputStream { void Write(int i); void Write(byte[] bytes); void Write(byte[] bytes, int offset, int length); void Flush(); void Close(); } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/InputStream.cs0000644000175000017500000000120311700531646026330 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System.IO; namespace Sharpen.IO { public class InputStream : StreamAdaptor, IInputStream { public InputStream(Stream stream) : base(stream) { } public int Read() { return _stream.ReadByte(); } public int Read(byte[] bytes) { return Read(bytes, 0, bytes.Length); } public int Read(byte[] bytes, int offset, int length) { return TranslateReadReturnValue(_stream.Read(bytes, offset, length)); } internal static int TranslateReadReturnValue(int read) { return (0 == read) ? -1 : read; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/RandomAccessFile.cs0000644000175000017500000000453311700531646027230 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2007 Versant Inc. http://www.db4o.com */ using System; using System.IO; using System.Runtime.InteropServices; namespace Sharpen.IO { public class RandomAccessFile { private readonly FileStream _stream; #if !CF && !MONO && !SILVERLIGHT #if NET_4_0 [System.Security.SecuritySafeCritical] #endif [DllImport("kernel32.dll", SetLastError = true)] static extern int FlushFileBuffers(Microsoft.Win32.SafeHandles.SafeFileHandle fileHandle); #endif public RandomAccessFile(String file, bool readOnly, bool lockFile) { _stream = new FileStream(file, FileMode.OpenOrCreate, readOnly ? FileAccess.Read : FileAccess.ReadWrite, lockFile ? FileShare.None : FileShare.ReadWrite ); } public RandomAccessFile(String file, String fileMode) : this(file, fileMode.Equals("r"), true) { } public FileStream Stream { get { return _stream; } } public void Close() { _stream.Close(); } public long Length() { return _stream.Length; } public int Read(byte[] bytes, int offset, int length) { return _stream.Read(bytes, offset, length); } public void Read(byte[] bytes) { _stream.Read(bytes, 0, bytes.Length); } public void Seek(long pos) { _stream.Seek(pos, SeekOrigin.Begin); } #if NET_4_0 [System.Security.SecuritySafeCritical] #endif public void Sync() { _stream.Flush(); #if !CF && !MONO && !SILVERLIGHT FlushFileBuffers(_stream.SafeFileHandle); #endif } public RandomAccessFile GetFD() { return this; } public void Write(byte[] bytes) { Write(bytes, 0, bytes.Length); } public void Write(byte[] bytes, int offset, int length) { try { _stream.Write(bytes, offset, length); } catch (NotSupportedException e) { throw new IOException("Not supported", e); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/IO/ByteArrayOutputStream.cs0000644000175000017500000000124311700531646030360 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; using System.IO; namespace Sharpen.IO { public class ByteArrayOutputStream : OutputStream { public ByteArrayOutputStream() : base(new MemoryStream()) { } public ByteArrayOutputStream(int size) : base(new MemoryStream(size)) { } public int Size() { return (int)Stream.Length; } public void WriteTo(OutputStream stream) { Stream.WriteTo(stream.UnderlyingStream); } public byte[] ToByteArray() { return Stream.ToArray(); } private MemoryStream Stream { get { return (MemoryStream)UnderlyingStream; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Util/0000755000175000017500000000000011700531646024140 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Util/Random.cs0000644000175000017500000000072411700531646025712 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System.Collections; namespace Sharpen.Util { public class Random { readonly System.Random _random = new System.Random(); public Random() { } public long NextLong() { return _random.Next(); } public int NextInt() { return _random.Next(int.MinValue, int.MaxValue); } public object NextInt(int ceiling) { return _random.Next(ceiling); } } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Util/ISet.cs0000644000175000017500000000037411700531646025337 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Text; namespace Sharpen.Util { public interface ISet: ICollection { bool Add(object element); bool Remove(object element); bool Contains(object element); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Util/HashSet.cs0000644000175000017500000000710311700531646026027 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2008 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Collections.Generic; namespace Sharpen.Util { public class HashSet : ISet, /* IList required for dRS */ IList { private readonly static object _object = new object(); // FIXME: dRS doesn't like using a dictionary here #if SILVERLIGHT private readonly List _elements = new List(); #else private readonly ArrayList _elements = new ArrayList(); #endif public HashSet() { } public HashSet(ICollection initialValues) { AddAll(initialValues); } public bool Add(object o) { if (Contains(o)) return false; _elements.Add(o); return true; } public bool AddAll(ICollection c) { bool changed = false; foreach (object o in c) { changed |= Add(o); } return changed; } public void Clear() { _elements.Clear(); } public bool Contains(object o) { return _elements.Contains(o); } public bool ContainsAll(ICollection c) { foreach (object o in c) { if (!Contains(o)) { return false; } } return true; } public bool IsEmpty { get { return _elements.Count == 0; } } public bool Remove(object o) { if (!Contains(o)) return false; _elements.Remove(o); return true; } public bool RemoveAll(ICollection c) { bool changed = false; foreach (object o in c) { changed |= Remove(o); } return changed; } public void CopyTo(Array array, int index) { #if SILVERLIGHT object[] objectArray = new object[array.Length]; int idx = 0; foreach (var a in array) { objectArray[idx++] = a; } _elements.CopyTo(objectArray, index); #else _elements.CopyTo(array, index); #endif } public int Count { get { return _elements.Count; } } public bool IsSynchronized { get { return false; } } public object SyncRoot { get { #if SILVERLIGHT throw new InvalidOperationException(); #else return _elements.SyncRoot; #endif } } public IEnumerator GetEnumerator() { return _elements.GetEnumerator(); } int IList.Add(object value) { ((ISet) this).Add(value); return 0; } void IList.Remove(object value) { ((ISet)this).Remove(value); } int IList.IndexOf(object value) { throw new NotImplementedException(); } void IList.Insert(int index, object value) { throw new NotImplementedException(); } void IList.RemoveAt(int index) { throw new NotImplementedException(); } object IList.this[int index] { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } bool IList.IsReadOnly { get { return false; } } bool IList.IsFixedSize { get { return false; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Util/Arrays.cs0000755000175000017500000000150111700531646025730 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace Sharpen.Util { public class Arrays { public static void Fill(T[] array, T value) { for (int i=0; i(T[] array, int fromIndex, int toIndex, T value) { for (int i = fromIndex; i < toIndex; ++i) { array[i] = value; } } public static bool Equals(T[] x, T[] y) { if (x == null) return y == null; if (y == null) return false; if (x.Length != y.Length) return false; for (int i = 0; i < x.Length; ++i) { if (!object.Equals(x[i], y[i])) return false; } return true; } public static List AsList(T[] array) { return new List(array); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Text/0000755000175000017500000000000011700531646024147 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Text/DecimalFormat.cs0000644000175000017500000000067711700531646027217 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2008 Versant Inc. http://www.db4o.com */ using System; namespace Sharpen.Text { public class DecimalFormat { private string _format; public DecimalFormat(string format) { _format = format; } public string Format(double number) { Double temp = (Double)number; return temp.ToString(_format); } } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Net/0000755000175000017500000000000011700531646023751 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Net/Socket.cs0000644000175000017500000000632611700531646025537 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; using System.IO; using System.Net; using Sharpen.IO; using NativeSocket=System.Net.Sockets.Socket; using System.Net.Sockets; namespace Sharpen.Net { public class Socket : SocketWrapper { #if SILVERLIGHT public Socket(string hostName, int port) { } } #else public Socket(string hostName, int port) { NativeSocket socket = new NativeSocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.Connect(new IPEndPoint(Resolve(hostName), port)); Initialize(socket); _toString = StringRepresentation(); } private static IPAddress Resolve(string hostName) { IPHostEntry found = Dns.GetHostEntry(hostName); foreach (IPAddress address in found.AddressList) { if (address.AddressFamily == AddressFamily.InterNetwork) { return address; } } throw new IOException("couldn't find suitable address for name '" + hostName + "'"); } public Socket(NativeSocket socket) { Initialize(socket); } public IInputStream GetInputStream() { return _in; } public IOutputStream GetOutputStream() { return _out; } public int GetPort() { return ((IPEndPoint) _delegate.RemoteEndPoint).Port; } override protected void Initialize(NativeSocket socket) { base.Initialize(socket); NetworkStream stream = new NetworkStream(_delegate); #if CF _in = new SocketInputStream(this); #else _in = new InputStream(stream); #endif _out = new OutputStream(stream); } public override string ToString() { return _toString; } private string StringRepresentation() { return ((IPEndPoint)_delegate.LocalEndPoint).Port + " => "+ UnderlyingSocket.RemoteEndPoint; } private IInputStream _in; private IOutputStream _out; private readonly string _toString; } #if CF internal class SocketInputStream : IInputStream { private readonly Socket _socket; public SocketInputStream(Socket socket) { _socket = socket; } public int Read() { byte[] buffer = new byte[1]; if (1 != Read(buffer)) { return -1; } return (int) buffer[0]; } public int Read(byte[] bytes) { return Read(bytes, 0, bytes.Length); } public int Read(byte[] bytes, int offset, int length) { try { if (_socket.SoTimeout > 0) { if (!UnderlyingSocket.Poll(_socket.SoTimeout*1000, SelectMode.SelectRead)) { throw new IOException("read timeout"); } } return InputStream.TranslateReadReturnValue( UnderlyingSocket.Receive(bytes, offset, length, SocketFlags.None)); } catch (ObjectDisposedException x) { throw new IOException(x.Message, x); } catch (SocketException x) { throw new IOException(x.Message, x); } } public void Close() { // nothing to do } private System.Net.Sockets.Socket UnderlyingSocket { get { return _socket.UnderlyingSocket; } } } #endif // CF #endif // SILVERLIGHT } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Net/ServerSocket.cs0000644000175000017500000000173411700531646026724 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; using System.Net; using System.Net.Sockets; using NativeSocket=System.Net.Sockets.Socket; namespace Sharpen.Net { public class ServerSocket : SocketWrapper { public ServerSocket(int port) { #if !SILVERLIGHT try { NativeSocket socket = new NativeSocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.Bind(new IPEndPoint(IPAddress.Any, port)); int maxPendingConnections = 42; socket.Listen(maxPendingConnections); Initialize(socket); } catch (SocketException e) { throw new System.IO.IOException(e.Message); } #endif } #if !SILVERLIGHT public Socket Accept() { return new Socket(_delegate.Accept()); } public int GetLocalPort() { return ((IPEndPoint)_delegate.LocalEndPoint).Port; } #endif } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Sharpen/Net/SocketWrapper.cs0000644000175000017500000000224311700531646027072 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; using System.Net.Sockets; using NativeSocket=System.Net.Sockets.Socket; namespace Sharpen.Net { public class SocketWrapper { protected NativeSocket _delegate; #if CF || SILVERLIGHT private int _soTimeout = 0; public int SoTimeout { get { return _soTimeout; } } #endif public NativeSocket UnderlyingSocket { get { return _delegate; } } protected virtual void Initialize(NativeSocket socket) { _delegate = socket; } public void SetSoTimeout(int timeout) { #if !CF && !SILVERLIGHT _delegate.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, timeout); _delegate.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, timeout); #else _soTimeout = timeout; #endif } public void Close() { if (_delegate.Connected) { try { _delegate.Shutdown(SocketShutdown.Both); } catch (Exception) { } } _delegate.Close(); } public bool IsConnected() { return _delegate.Connected; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/0000755000175000017500000000000011700531646024375 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Query/0000755000175000017500000000000011700531646025502 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Query/PredicatePlatform.cs0000755000175000017500000000106211700531646031440 0ustar00meebeymeebey00000000000000using System; namespace Db4objects.Db4o.Query { using System.Reflection; public sealed class PredicatePlatform { public static readonly string PredicatemethodName = "Match"; public static bool IsFilterMethod(MethodInfo method) { if (method.GetParameters().Length != 1) return false; return method.Name == PredicatemethodName; } public static T GetField(Object obj, string fieldName) { return (T) obj.GetType().GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance).GetValue(obj); } } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Query/EvaluationDelegate.cs0000644000175000017500000000026511700531646031576 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Query { public delegate void EvaluationDelegate(ICandidate candidate); } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Query/ISodaQueryFactory.cs0000644000175000017500000000123611700531646031410 0ustar00meebeymeebey00000000000000using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Query { public interface ISodaQueryFactory { /// /// creates a new SODA /// Query /// . ///

/// Linq queries are the recommended main db4o query interface. ///

/// Use /// QueryByExample(Object template) /// for simple Query-By-Example.

///
/// a new IQuery object IQuery Query(); } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Typehandlers/0000755000175000017500000000000011700531646027037 5ustar00meebeymeebey00000000000000DateTimeOffsetTypeHandler.cs0000644000175000017500000000577711700531646034332 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Typehandlers/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ #if !CF using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.native.Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Typehandlers { public class DateTimeOffsetTypeHandler : IValueTypeHandler, IQueryableTypeHandler, IIndexableTypeHandler { #region Implementation of ITypeHandler4 void ITypeHandler4.Delete(IDeleteContext context) { context.Seek(context.Offset() + LinkLength()); } void ITypeHandler4.Defragment(IDefragmentContext context) { IncrementOffset(context); } void ITypeHandler4.Write(IWriteContext context, object obj) { Write(context, (DateTimeOffset)obj); } bool IQueryableTypeHandler.DescendsIntoMembers() { return false; } object IValueTypeHandler.Read(IReadContext context) { return ReadFrom(context); } #endregion #region Implementation of IComparable4 IPreparedComparison IComparable4.PrepareComparison(IContext context, object obj) { return new ComparablePreparedComparison(obj); } #endregion #region Implementation of ILinkLengthAware int ILinkLengthAware.LinkLength() { return LinkLength(); } #endregion #region Implementation of IIndexable4 object IIndexable4.ReadIndexEntry(IContext context, ByteArrayBuffer reader) { return ReadFrom(reader); } void IIndexable4.WriteIndexEntry(IContext context, ByteArrayBuffer writer, object obj) { Write(writer, (DateTimeOffset) obj); } void IIndexable4.DefragIndexEntry(DefragmentContextImpl context) { IncrementOffset(context); } #endregion #region Implementation of IIndexableTypeHandler object IIndexableTypeHandler.IndexEntryToObject(IContext context, object indexEntry) { if (indexEntry.GetType() != typeof(DateTimeOffset)) { throw new InvalidOperationException(); } return indexEntry; } object IIndexableTypeHandler.ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer buffer) { return ReadFrom(buffer); } object IIndexableTypeHandler.ReadIndexEntry(IObjectIdContext context) { return ReadFrom(context); } #endregion private static void Write(IWriteBuffer context, DateTimeOffset dateTimeOffset) { context.WriteLong(dateTimeOffset.Ticks); context.WriteLong(dateTimeOffset.Offset.Ticks); } private static DateTimeOffset ReadFrom(IReadBuffer buffer) { long ticks = buffer.ReadLong(); long timeSpanTicks = buffer.ReadLong(); return new DateTimeOffset(ticks, new TimeSpan(timeSpanTicks)); } private static void IncrementOffset(IDefragmentContext context) { context.IncrementOffset(LinkLength()); } private static int LinkLength() { return Const4.LongLength + Const4.LongLength; } } } #endifSystemArrayTypeHandler.cs0000644000175000017500000001122511700531646033733 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Typehandlers/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Net; using Db4objects.Db4o.Internal.Handlers.Array; namespace Db4objects.Db4o.Typehandlers { public class SystemArrayTypeHandler : ICascadingTypeHandler, IVariableLengthTypeHandler, IValueTypeHandler { public virtual IPreparedComparison PrepareComparison(IContext context, object obj) { return ReadArrayHandler(context).PrepareComparison(context, obj); } public virtual void Write(IWriteContext context, object obj) { Array collection = (Array) obj; ClassMetadata elementType = DetectElementTypeHandler(Container(context), collection); WriteElementTypeId(context, elementType); new ArrayHandler(elementType.TypeHandler(), false).Write(context, obj); } public virtual object Read(IReadContext context) { return ReadArrayHandler(context).Read(context); } private static ArrayHandler ReadArrayHandler(IContext context) { ITypeHandler4 handler = ReadElementTypeHandler((IReadBuffer)context, context); return new ArrayHandler(handler, false); } public virtual void Delete(IDeleteContext context) { ReadArrayHandler(context).Delete(context); } public virtual void Defragment(IDefragmentContext context) { DefragmentElementHandlerId(context); ReadArrayHandler(context).Defragment(context); } public void CascadeActivation(IActivationContext context) { ICollection collection = ((ICollection)context.TargetObject()); foreach (object item in collection) { context.CascadeActivationToChild(item); } } public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { return this; } public virtual void CollectIDs(QueryingReadContext context) { ReadArrayHandler(context).CollectIDs(context); } private static void DefragmentElementHandlerId(IDefragmentContext context) { int offset = context.Offset(); context.CopyID(); context.Seek(offset); } private static ITypeHandler4 OpenTypeHandlerFrom(IContext context) { return context.Transaction().Container().Handlers.OpenTypeHandler(); } private static void WriteElementTypeId(IWriteContext context, ClassMetadata elementType) { context.WriteInt(elementType.GetID()); } private static ObjectContainerBase Container(IContext context) { return ((IInternalObjectContainer)context.ObjectContainer()).Container; } private static ITypeHandler4 ReadElementTypeHandler(IReadBuffer buffer, IContext context) { int elementHandlerId = buffer.ReadInt(); if (elementHandlerId == 0) return OpenTypeHandlerFrom(context); ITypeHandler4 elementHandler = Container(context).TypeHandlerForClassMetadataID(elementHandlerId); return elementHandler ?? OpenTypeHandlerFrom(context); } private static ClassMetadata DetectElementTypeHandler(ObjectContainerBase container, Array collection) { Type elementType = ElementTypeOf(collection); return container.ProduceClassMetadata(container.Reflector().ForClass(elementType)); } private static bool IsNullableInstance(Type elementType) { return elementType.IsGenericType && (elementType.GetGenericTypeDefinition() == typeof(Nullable<>)); } private static Type ElementTypeOf(Array array) { return array.GetType().GetElementType(); } } internal class SystemArrayPredicate : ITypeHandlerPredicate { public bool Match(IReflectClass classReflector) { if(classReflector == null) { return false; } Type type = NetReflector.ToNative(classReflector); return type == typeof(System.Array); } } } GenericCollectionTypeHandler.cs0000644000175000017500000001501511700531646035041 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Typehandlers/* Copyright (C) 2004 - 2008 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Collections.Generic; using Db4objects.Db4o.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Foundation.Collections; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Typehandlers { public class GenericCollectionTypeHandler : IReferenceTypeHandler, ICascadingTypeHandler, IVariableLengthTypeHandler, IQueryableTypeHandler { public virtual IPreparedComparison PrepareComparison(IContext context, object obj) { return null; } public virtual void Write(IWriteContext context, object obj) { ICollectionInitializer initializer = CollectionInitializer.For(obj); IEnumerable enumerable = (IEnumerable)obj; ClassMetadata elementType = DetectElementTypeErasingNullables(Container(context), enumerable); WriteElementTypeHandlerId(context, elementType); WriteElementCount(context, initializer); WriteElements(context, enumerable, elementType.TypeHandler()); } public virtual void Activate(IReferenceActivationContext context) { object collection = context.PersistentObject(); ICollectionInitializer initializer = CollectionInitializer.For(collection); initializer.Clear(); ReadElements(context, initializer, ReadElementTypeHandler(context, context)); initializer.FinishAdding(); } public virtual void Delete(IDeleteContext context) { if (!context.CascadeDelete()) return; ITypeHandler4 handler = ReadElementTypeHandler(context, context); int elementCount = context.ReadInt(); for (int i = elementCount; i > 0; i--) { handler.Delete(context); } } public virtual void Defragment(IDefragmentContext context) { DefragmentElementHandlerId(context); ITypeHandler4 handler = ReadElementTypeHandler(context, context); int elementCount = context.ReadInt(); for (int i = 0; i < elementCount; i++) { context.Defragment(handler); } } public void CascadeActivation(IActivationContext context) { IEnumerable collection = ((IEnumerable)context.TargetObject()); // TODO: detect the element type // and return immediately when it's a primitive foreach (object item in collection) { context.CascadeActivationToChild(item); } } public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { return this; } public virtual void CollectIDs(QueryingReadContext context) { ITypeHandler4 elementHandler = ReadElementTypeHandler(context, context); int elementCount = context.ReadInt(); for (int i = 0; i < elementCount; i++) { context.ReadId(elementHandler); } } private static void DefragmentElementHandlerId(IDefragmentContext context) { int offset = context.Offset(); context.CopyID(); context.Seek(offset); } private static ITypeHandler4 OpenTypeHandlerFrom(IContext context) { return context.Transaction().Container().Handlers.OpenTypeHandler(); } private static void ReadElements(IReadContext context, ICollectionInitializer initializer, ITypeHandler4 elementHandler) { int elementCount = context.ReadInt(); for (int i = 0; i < elementCount; i++) { initializer.Add(context.ReadObject(elementHandler)); } } private static void WriteElementTypeHandlerId(IWriteContext context, ClassMetadata type) { context.WriteInt(type.GetID()); } private static void WriteElementCount(IWriteBuffer context, ICollectionInitializer initializer) { context.WriteInt(initializer.Count()); } private static void WriteElements(IWriteContext context, IEnumerable enumerable, ITypeHandler4 elementHandler) { IEnumerator elements = enumerable.GetEnumerator(); while (elements.MoveNext()) { context.WriteObject(elementHandler, elements.Current); } } private static ObjectContainerBase Container(IContext context) { return ((IInternalObjectContainer)context.ObjectContainer()).Container; } private static ITypeHandler4 ReadElementTypeHandler(IReadBuffer buffer, IContext context) { int elementTypeId = buffer.ReadInt(); if (elementTypeId == 0) return OpenTypeHandlerFrom(context); ITypeHandler4 elementHandler = Container(context).TypeHandlerForClassMetadataID(elementTypeId); return elementHandler ?? OpenTypeHandlerFrom(context); } private static ClassMetadata DetectElementTypeErasingNullables(ObjectContainerBase container, IEnumerable collection) { Type elementType = ElementTypeOf(collection); if (IsNullableInstance(elementType)) { return container.ClassMetadataForReflectClass(container.Handlers.IclassObject); } return container.ProduceClassMetadata(container.Reflector().ForClass(elementType)); } private static bool IsNullableInstance(Type elementType) { return elementType.IsGenericType && (elementType.GetGenericTypeDefinition() == typeof(Nullable<>)); } private static Type ElementTypeOf(IEnumerable collection) { Type genericCollectionType = GenericCollectionTypeFor(collection.GetType()); return genericCollectionType.GetGenericArguments()[0]; } private static Type GenericCollectionTypeFor(Type type) { if (type == null) { throw new InvalidOperationException(); } if (IsGenericCollectionType(type)) { return type; } return GenericCollectionTypeFor(type.BaseType); } private static bool IsGenericCollectionType(Type type) { return type.IsGenericType && Array.IndexOf(_supportedCollections, type.GetGenericTypeDefinition()) >= 0; } public bool DescendsIntoMembers() { return true; } public void RegisterSupportedTypesWith(Action registrationAction) { foreach (Type collectionType in _supportedCollections) { registrationAction(collectionType); } } private static readonly Type[] _supportedCollections = new Type[] { typeof(List<>), typeof(LinkedList<>), typeof(Stack<>), typeof(Queue<>), typeof(System.Collections.ObjectModel.Collection<>), typeof(ActivatableList<>), #if NET_3_5 && ! CF typeof(HashSet<>), #endif }; } } ComparablePreparedComparison.cs0000644000175000017500000000121711700531646035073 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Typehandlers/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.native.Db4objects.Db4o.Typehandlers { sealed internal class ComparablePreparedComparison : IPreparedComparison where T : IComparable { public ComparablePreparedComparison(object source) { if (source is TransactionContext) { source = ((TransactionContext)source)._object; } _source = (IComparable)source; } public int CompareTo(object obj) { return _source.CompareTo(obj); } private readonly IComparable _source; } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Typehandlers/GuidTypeHandler.cs0000644000175000017500000000636711700531646032432 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ /* Copyright (C) 2009 Judah Himango */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.native.Db4objects.Db4o.Typehandlers; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Reflect.Net; namespace Db4objects.Db4o.Typehandlers { /// /// DB4O type handler for efficiently storing and activating System.Guid values. /// /// Judah Himango public class GuidTypeHandler: IValueTypeHandler, IQueryableTypeHandler, IIndexableTypeHandler { private const int GuidSize = 16; #region IValueTypeHandler Members public object Read(IReadContext context) { return ReadFrom(context); } #endregion #region ITypeHandler4 Members public bool CanHold(IReflectClass type) { return NetReflector.ToNative(type).Equals(typeof (Guid)); } public void Defragment(IDefragmentContext context) { IncrementOffset(context); } public void Delete(IDeleteContext context) { context.Seek(context.Offset() + GuidSize); } public void Write(IWriteContext context, object obj) { WriteGuid(obj, context); } #endregion #region IComparable4 Members public IPreparedComparison PrepareComparison(IContext context, object obj) { return new ComparablePreparedComparison(obj); } #endregion #region IQueryableTypeHandler Members public bool DescendsIntoMembers() { return false; } #endregion #region IIndexableTypeHandler Members public int LinkLength() { return GuidSize; } public object ReadIndexEntry(IContext context, ByteArrayBuffer reader) { return ReadFrom(reader); } public void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object obj) { WriteGuid(obj, writer); } public void DefragIndexEntry(DefragmentContextImpl context) { IncrementOffset(context); } public object IndexEntryToObject(IContext context, object indexEntry) { if (indexEntry.GetType() != typeof(Guid)) { throw new InvalidOperationException(); } return indexEntry; } public object ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer buffer) { return ReadFrom(buffer); } public object ReadIndexEntry(IObjectIdContext context) { return ReadFrom(context); } #endregion private static Guid ReadFrom(IReadBuffer buffer) { byte[] guidBytes = new byte[GuidSize]; buffer.ReadBytes(guidBytes); return new Guid(guidBytes); } private static void WriteGuid(object obj, IWriteBuffer context) { Guid id = (Guid)obj; context.WriteBytes(id.ToByteArray()); } private static void IncrementOffset(IDefragmentContext context) { context.IncrementOffset(GuidSize); } } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Typehandlers/CollectionTypeHandler.cs0000644000175000017500000000062111700531646033620 0ustar00meebeymeebey00000000000000/* Copyright (C) 2010 Versant Inc. http://www.db4o.com */ using System.Collections; namespace Db4objects.Db4o.Typehandlers { public partial class CollectionTypeHandler { private void AddToCollection(ICollection collection, object element) { ((IList)collection).Add(element); } private void ClearCollection(ICollection collection) { ((IList)collection).Clear(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Typehandlers/EnumTypeHandler.cs0000644000175000017500000001323511700531646032436 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2008 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Net; namespace Db4objects.Db4o.Typehandlers { public class EnumTypeHandler : IValueTypeHandler, ITypeFamilyTypeHandler, IIndexableTypeHandler { private class PreparedEnumComparison : IPreparedComparison { private readonly long _enumValue; public PreparedEnumComparison(object obj) { if (obj is TransactionContext) { obj = ((TransactionContext)obj)._object; } if (obj == null) return; _enumValue = ToLong(obj); } public int CompareTo(object obj) { if (obj is TransactionContext) { obj = ((TransactionContext)obj)._object; } if (obj == null) return 1; long other = ToLong(obj); if (_enumValue == other) return 0; if (_enumValue < other) return -1; return 1; } private static long ToLong(object obj) { if (obj is IndexEntry) { return ((IndexEntry)obj).EnumValue; } return Convert.ToInt64(obj); } } public IPreparedComparison PrepareComparison(IContext context, object obj) { return new PreparedEnumComparison(obj); } public void Delete(IDeleteContext context) { int offset = context.Offset() + Const4.IdLength + Const4.LongLength; context.Seek(offset); } public void Defragment(IDefragmentContext context) { context.CopyID(); context.IncrementOffset(Const4.LongLength); } public object Read(IReadContext context) { int classId = context.ReadInt(); long enumValue = context.ReadLong(); return ToEnum(context, classId, enumValue); } public void Write(IWriteContext context, object obj) { int classId = ClassMetadataIdFor(context, obj); context.WriteInt(classId); context.WriteLong(Convert.ToInt64(obj)); } public bool DescendsIntoMembers() { return false; } public int LinkLength() { return Const4.IdLength + Const4.LongLength; } public object ReadIndexEntry(IContext context, ByteArrayBuffer reader) { return new IndexEntry(reader.ReadInt(), reader.ReadLong()); } public void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object obj) { IndexEntry indexEntry = obj as IndexEntry; if (indexEntry == null) { indexEntry = new IndexEntry(ClassMetadataIdFor(context, obj), Convert.ToInt64(obj)); } writer.WriteInt(indexEntry.ClassMetadataId); writer.WriteLong(indexEntry.EnumValue); } public void DefragIndexEntry(DefragmentContextImpl context) { context.IncrementOffset(Const4.LongLength); } private static int ClassMetadataIdFor(IContext context, object obj) { IReflectClass claxx = Container(context).Reflector().ForObject(obj); ClassMetadata clazz = Container(context).ProduceClassMetadata(claxx); //TODO: Handle clazz == null!! Must not happen! return clazz.GetID(); } private static ITypeHandler4 StringTypeHandler(IContext context) { return Container(context).Handlers.TypeHandlerForClass(Container(context).Ext().Reflector().ForClass(typeof(string))); } private static ObjectContainerBase Container(IContext context) { return ((IInternalObjectContainer)context.ObjectContainer()).Container; } public object IndexEntryToObject(IContext context, object indexEntry) { IndexEntry entry = (IndexEntry) indexEntry; return ToEnum(context, entry.ClassMetadataId, entry.EnumValue); } public object ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer statefulBuffer) { return new IndexEntry(statefulBuffer.ReadInt(), statefulBuffer.ReadLong()); } public object ReadIndexEntry(IObjectIdContext context) { return new IndexEntry(context.ReadInt(), context.ReadLong()); } private static object ToEnum(IContext context, int classId, long enumValue) { ClassMetadata clazz = Container(context).ClassMetadataForID(classId); Type enumType = NetReflector.ToNative(clazz.ClassReflector()); return Enum.ToObject(enumType, enumValue); } private class IndexEntry { private readonly long _enumValue; private readonly int _classMetadataId; internal IndexEntry(int classMetadataId, long enumValue) { _classMetadataId = classMetadataId; _enumValue = enumValue; } internal long EnumValue { get { return _enumValue; } } internal int ClassMetadataId { get { return _classMetadataId; } } } } public class EnumTypeHandlerPredicate : ITypeHandlerPredicate { public bool Match(IReflectClass classReflector) { Type type = NetReflector.ToNative(classReflector); if(type == null) { return false; } return type.IsEnum; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Collections/0000755000175000017500000000000011700531646026653 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Collections/ArrayList4.cs0000644000175000017500000001636011700531646031206 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ #if !SILVERLIGHT using System; using System.Collections; using System.Collections.Generic; using Db4objects.Db4o.Activation; using Db4objects.Db4o.TA; namespace Db4objects.Db4o.Collections { public partial class ArrayList4 : IList, IList, IActivatable { #region Instance Variables [NonSerialized] private int modCount; #endregion public int IndexOf(E item) { return Array.IndexOf(GetElements(), item, 0, listSize); } public void Insert(int index, E item) { Add(index, item); } public int Add(object value) { CheckObjectType(value); Add((E) value); return Count - 1; } public bool Contains(object value) { CheckObjectType(value); return IndexOf(value) != -1; } public int IndexOf(object value) { CheckObjectType(value); IList self = this; return self.IndexOf((E) value); } public void Insert(int index, object value) { CheckObjectType(value); Insert(index, (E) value); } public void Remove(object value) { CheckObjectType(value); Remove((E)value); } public void RemoveAt(int index) { RemoveImpl(index); } object IList.this[int index] { get { return Get(index); } set { Set(index, (E) value); } } public E this[int index] { get { return Get(index); } set { Set(index, value); } } public void Add(E item) { Add(Count, item); } public bool Contains(E item) { return Contains((object) item); } public void CopyTo(E[] array, int arrayIndex) { CopyTo((Array) array, arrayIndex); } public bool Remove(E item) { int index = IndexOf(item); if (index == -1) return false; RemoveAt(index); return true; } public void CopyTo(Array array, int index) { if (null == array) throw new ArgumentNullException(); if (array.Rank != 1) throw new ArgumentException(); Array.Copy(GetElements(), 0, array, index, listSize); } public object SyncRoot { get { throw new NotSupportedException(); } } public bool IsSynchronized { get { return false; } } public bool IsReadOnly { get { return false; } } public bool IsFixedSize { get { return false; } } public IEnumerator GetEnumerator() { Activate(ActivationPurpose.Read); int version = modCount; int size = listSize; for (int i = 0; i < size; ++i) { if (version != modCount) { throw new InvalidOperationException(); } yield return elements[i]; }; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable) this).GetEnumerator(); } public override string ToString() { return String.Format("ArrayList4<{0}> (Count={1})", typeof(E).Name, Count); } #region Facility methods public void AddRange(IEnumerable collection) { } public int BinarySearch(E item) { return Array.BinarySearch(GetElements(), item); } public int BinarySearch(E item, IComparer comparer) { return Array.BinarySearch(GetElements(), item, comparer); } public int BinarySearch(int index, int count, E item, IComparer comparer) { return Array.BinarySearch(GetElements(), index, count, item, comparer); } #if !CF public ArrayList4 ConvertAll(Converter converter) { return new ArrayList4(Array.ConvertAll(GetElements(), converter)); } public bool Exists(Predicate match) { return Array.Exists(GetElements(), match); } public E Find(Predicate match) { return Array.Find(GetElements(), match); } public ArrayList4 FindAll(Predicate match) { return new ArrayList4(Array.FindAll(GetElements(), match)); } public int FindIndex(int startIndex, int count, Predicate match) { return Array.FindIndex(GetElements(), startIndex, count, match); } public E FindLast(Predicate match) { return Array.FindLast(GetElements(), match); } public int FindLastIndex(int startIndex, int count, Predicate match) { return Array.FindLastIndex(GetElements(), startIndex, count, match); } public void ForEach(Action action) { Array.ForEach(GetElements(), action); } #endif public void InsertRange(int index, IEnumerable collection) { AddAllImpl(index, new List(collection).ToArray()); } public void RemoveRange(int index, int count) { RemoveRangeImpl(index, count); } public void Sort(int index, int count, IComparer comparer) { Array.Sort(GetElements(), index, count, comparer); } public E[] ToArray() { E[] items = GetElements(); return items == null ? items : (E[]) items.Clone(); } public bool TrueForAll(Predicate match) { return Array.TrueForAll(GetElements(), match); } #endregion #region Sharpen Helper Methods private static E[] CollectionToArray(ICollection coll) { return new List(coll).ToArray(); } internal static void CheckIndex(int index, int from, int to) { if (index < from || index > to) { throw new ArgumentOutOfRangeException(String.Format("Index {0} must be in the range[{1} - {2}]", index, from, to)); } } private static E[] AllocateStorage(int size) { return new E[size]; } private static E DefaultValue() { return default(E); } #endregion #region Helper Methods private static void CheckObjectType(object value) { if (!(value is E)) { throw new ArgumentException(); } } private E[] GetElements() { Activate(ActivationPurpose.Read); return elements; } #endregion } } #endif smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Collections/ISet.cs0000644000175000017500000000051411700531646030046 0ustar00meebeymeebey00000000000000/* Copyright (C) 2010 Versant Inc. http://www.db4o.com */ using System.Collections.Generic; namespace Db4objects.Db4o.Collections { public interface ISet : ICollection { bool IsEmpty { get; } bool AddAll(IEnumerable ts); bool RemoveAll(IEnumerable ts); bool ContainsAll(IEnumerable ts); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Collections/ActivatableList.cs0000644000175000017500000001613511700531646032263 0ustar00meebeymeebey00000000000000/* Copyright (C) 2010 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using Db4objects.Db4o.Activation; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Collections { public class ActivatableList : ActivatableBase, IList, IActivatableCollection { public ActivatableList() { } public ActivatableList(IEnumerable source) { _list = new List(source); } public ActivatableList(int capacity) { _list = new List(capacity); } public ReadOnlyCollection AsReadOnly() { ActivateForRead(); return AsList().AsReadOnly(); } public IEnumerator GetEnumerator() { Activate(ActivationPurpose.Read); return _list.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } public void Add(T item) { ActivateForWrite(); AsList().Add(item); } public void AddRange(IEnumerable collection) { ActivateForWrite(); AsList().AddRange(collection); } public int BinarySearch(T item) { ActivateForRead(); return AsList().BinarySearch(item); } public int BinarySearch(int index, int count, T item, IComparer comparer) { ActivateForRead(); return AsList().BinarySearch(index, count, item, comparer); } public int BinarySearch(T item, IComparer comparer) { ActivateForRead(); return AsList().BinarySearch(item, comparer); } public void Clear() { ActivateForWrite(); AsList().Clear(); } public bool Contains(T item) { ActivateForRead(); return AsList().Contains(item); } public void CopyTo(T[] array, int arrayIndex) { ActivateForRead(); AsList().CopyTo(array, arrayIndex); } public void CopyTo(T[] array) { ActivateForRead(); AsList().CopyTo(array); } public void CopyTo(int index, T[] array, int arrayIndex, int count) { ActivateForRead(); AsList().CopyTo(index, array, arrayIndex, count); } public override bool Equals(object obj) { ActivateForRead(); return AsList().Equals(obj); } #if !SILVERLIGHT public bool Exists(Predicate match) { ActivateForRead(); return AsList().Exists(match); } public T Find(Predicate match) { ActivateForRead(); return AsList().Find(match); } public List FindAll(Predicate match) { ActivateForRead(); return AsList().FindAll(match); } public int FindIndex(Predicate match) { ActivateForRead(); return AsList().FindIndex(match); } public int FindIndex(int startIndex, Predicate match) { ActivateForRead(); return AsList().FindIndex(startIndex, match); } public int FindIndex(int startIndex, int count, Predicate match) { ActivateForRead(); return AsList().FindIndex(startIndex, count, match); } public T FindLast(Predicate match) { ActivateForRead(); return AsList().FindLast(match); } public int FindLastIndex(Predicate match) { ActivateForRead(); return AsList().FindLastIndex(match); } public int FindLastIndex(int startIndex, Predicate match) { ActivateForRead(); return AsList().FindLastIndex(startIndex, match); } public int FindLastIndex(int startIndex, int count, Predicate match) { ActivateForRead(); return AsList().FindLastIndex(startIndex, count, match); } #endif public void ForEach(Action action) { ActivateForRead(); AsList().ForEach(action); } public List GetRange(int index, int count) { ActivateForRead(); return AsList().GetRange(index, count); } public int IndexOf(T item) { ActivateForRead(); return AsList().IndexOf(item); } public int IndexOf(T item, int index) { ActivateForRead(); return AsList().IndexOf(item, index); } public int IndexOf(T item, int index, int count) { ActivateForRead(); return AsList().IndexOf(item, index, count); } public void InsertRange(int index, IEnumerable collection) { ActivateForWrite(); AsList().InsertRange(index, collection); } public int LastIndexOf(T item) { ActivateForRead(); return AsList().LastIndexOf(item); } public int LastIndexOf(T item, int index) { ActivateForRead(); return AsList().LastIndexOf(item, index); } public int LastIndexOf(T item, int index, int count) { ActivateForRead(); return AsList().LastIndexOf(item, index, count); } #if !SILVERLIGHT public int RemoveAll(Predicate match) { ActivateForWrite(); return AsList().RemoveAll(match); } #endif public void RemoveRange(int index, int count) { ActivateForWrite(); AsList().RemoveRange(index, count); } public void Reverse() { ActivateForWrite(); AsList().Reverse(); } public void Reverse(int index, int count) { ActivateForWrite(); AsList().Reverse(index, count); } public void Sort() { ActivateForWrite(); AsList().Sort(); } public void Sort(IComparer comparer) { ActivateForWrite(); AsList().Sort(comparer); } public void Sort(int index, int count, IComparer comparer) { ActivateForWrite(); AsList().Sort(index, count, comparer); } public void Sort(Comparison comparison) { ActivateForWrite(); AsList().Sort(comparison); } public T[] ToArray() { ActivateForRead(); return AsList().ToArray(); } public void TrimExcess() { ActivateForWrite(); AsList().TrimExcess(); } #if !SILVERLIGHT public bool TrueForAll(Predicate match) { ActivateForRead(); return AsList().TrueForAll(match); } public List ConvertAll(Converter converter) { ActivateForRead(); return AsList().ConvertAll(converter); } #endif public bool Remove(T item) { ActivateForWrite(); return AsList().Remove(item); } public int Count { get { ActivateForRead(); return AsList().Count; } } public int Capacity { get { ActivateForRead(); return AsList().Capacity; } set { ActivateForWrite(); AsList().Capacity = value; } } public bool IsReadOnly { get { ActivateForRead(); return AsIList().IsReadOnly; } } public void Insert(int index, T item) { ActivateForWrite(); AsList().Insert(index, item); } public void RemoveAt(int index) { ActivateForWrite(); AsList().RemoveAt(index); } public T this[int index] { get { ActivateForRead(); return AsList()[index]; } set { ActivateForWrite(); AsList()[index] = value; } } private List AsList() { if (_list == null) { _list = new List(); } return _list; } private IList AsIList() { return AsList(); } private List _list; } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Collections/IActivatableCollection.cs0000644000175000017500000000040211700531646033542 0ustar00meebeymeebey00000000000000/* Copyright (C) 2010 Versant Inc. http://www.db4o.com */ using System.Collections.Generic; using Db4objects.Db4o.TA; namespace Db4objects.Db4o.Collections { public interface IActivatableCollection : ICollection, IActivatable { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Collections/ArrayDictionary4.cs0000644000175000017500000001066211700531646032377 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; using Db4objects.Db4o.Activation; using Db4objects.Db4o.TA; namespace Db4objects.Db4o.Collections { public partial class ArrayDictionary4 : IDictionary, IActivatable { public bool IsReadOnly { get { return false; } } void ICollection>.Add(KeyValuePair item) { Add(item.Key, item.Value); } public void Add(K key, V value) { Activate(ActivationPurpose.Read); int index = IndexOfKey(key); if (index != -1) { throw new ArgumentException(string.Format("Key {0} already exists", key)); } Activate(ActivationPurpose.Write); Insert(key, value); } public bool Remove(K key) { Activate(ActivationPurpose.Read); int index = IndexOfKey(key); if (index == -1) return false; Delete(index); return true; } bool ICollection>.Contains(KeyValuePair pair) { Activate(ActivationPurpose.Read); int index = IndexOfKey(pair.Key); if (index == -1) return false; KeyValuePair thisKeyValuePair = new KeyValuePair(pair.Key, ValueAt(index)); return EqualityComparer>.Default.Equals(thisKeyValuePair, pair); } void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) { if (array == null) throw new ArgumentNullException(); if (arrayIndex < 0) throw new ArgumentOutOfRangeException(); if (arrayIndex >= array.Length || Count > (array.Length - arrayIndex)) throw new ArgumentException(); for (int i = 0; i < Count; i++) { KeyValuePair keyValuePair = new KeyValuePair(KeyAt(i), ValueAt(i)); array[arrayIndex + i] = keyValuePair; } } bool ICollection>.Remove(KeyValuePair pair) { if (!((ICollection>)this).Contains(pair)) return false; return Remove(pair.Key); } public bool TryGetValue(K key, out V value) { Activate(ActivationPurpose.Read); int index = IndexOfKey(key); if (index == -1) { value = default(V); return false; } value = ValueAt(index); return true; } public V this[K key] { get { Activate(ActivationPurpose.Read); int index = IndexOfKey(key); if (index == -1) throw new KeyNotFoundException(); return ValueAt(index); } set { Activate(ActivationPurpose.Read); int index = IndexOfKey(key); if (index == -1) { Add(key, value); } else { Activate(ActivationPurpose.Write); Replace(index, value); } } } public ICollection Keys { get { Activate(ActivationPurpose.Read); K[] keys = new K[_size]; Array.Copy(_keys, keys, _size); return keys; } } public bool ContainsKey(K key) { return ContainsKeyImpl(key); } public IEnumerator> GetEnumerator() { Activate(ActivationPurpose.Read); for (int i = 0; i < _size; ++i) { yield return new KeyValuePair(KeyAt(i), ValueAt(i)); } } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable>)this).GetEnumerator(); } private int IndexOfKey(K key) { if (key == null) throw new ArgumentNullException(); return Array.IndexOf(_keys, key); } #region Sharpen Helpers private static K DefaultKeyValue() { return default(K); } private static V DefaultValue() { return default(V); } private static K[] AllocateKeyStorage(int length) { return new K[length]; } private static V[] AllocateValueStorage(int length) { return new V[length]; } #endregion } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Collections/ActivatableDictionary.cs0000644000175000017500000001433111700531646033451 0ustar00meebeymeebey00000000000000/* Copyright (C) 2010 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Collections.Generic; #if !CF && !SILVERLIGHT using System.Reflection; using System.Runtime.Serialization; #endif using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Collections { [Serializable] public class ActivatableDictionary : ActivatableBase, IDictionary, IDictionary #if !CF && !SILVERLIGHT ,ISerializable ,IDeserializationCallback #endif { public ActivatableDictionary() { } public ActivatableDictionary(IEqualityComparer comparer) { _dictionary = new Dictionary(comparer); } public ActivatableDictionary(IDictionary dictionary, IEqualityComparer comparer) { _dictionary = new Dictionary(dictionary, comparer); } public ActivatableDictionary(IDictionary dictionary) { _dictionary = new Dictionary(dictionary); } public ActivatableDictionary(int capacity) { _dictionary = new Dictionary(capacity); } public ActivatableDictionary(int capacity, IEqualityComparer comparer) { _dictionary = new Dictionary(capacity, comparer); } #if !CF && !SILVERLIGHT protected ActivatableDictionary(SerializationInfo info, StreamingContext context) { Type type = typeof(Dictionary); ConstructorInfo ctor = type.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { typeof(SerializationInfo), typeof(StreamingContext) }, null); _dictionary = (IDictionary)ctor.Invoke(new object[] { info, context }); } #endif #region Implementation of IEnumerable public IEnumerator> GetEnumerator() { ActivateForRead(); return _dictionary.GetEnumerator(); } public void Remove(object key) { Remove((TKey) key); } object IDictionary.this[object key] { get { return this[(TKey) key]; } set { this[(TKey) key] = (TValue) value; } } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } #endregion #region Implementation of ICollection> public void Add(KeyValuePair item) { ActivateForWrite(); _dictionary.Add(item); } public bool Contains(object key) { return ContainsKey( (TKey) key); } public void Add(object key, object value) { Add( (TKey) key, (TValue) value); } public void Clear() { ActivateForWrite(); _dictionary.Clear(); } IDictionaryEnumerator IDictionary.GetEnumerator() { ActivateForRead(); return Cast().GetEnumerator(); } public bool Contains(KeyValuePair item) { ActivateForRead(); return _dictionary.Contains(item); } public void CopyTo(KeyValuePair[] array, int arrayIndex) { ActivateForRead(); _dictionary.CopyTo(array, arrayIndex); } public bool Remove(KeyValuePair item) { ActivateForWrite(); return _dictionary.Remove(item); } public void CopyTo(Array array, int index) { ActivateForRead(); Cast().CopyTo(array, index); } public int Count { get { ActivateForRead(); return _dictionary.Count; } } public object SyncRoot { get { return Cast().SyncRoot; } } public bool IsSynchronized { get { return Cast().IsSynchronized; } } ICollection IDictionary.Values { get { return Values; } } public bool IsReadOnly { get { return _dictionary.IsReadOnly; } } public bool IsFixedSize { get { return Cast().IsFixedSize; } } #endregion #region Implementation of IDictionary public bool ContainsKey(TKey key) { ActivateForRead(); return _dictionary.ContainsKey(key); } public void Add(TKey key, TValue value) { ActivateForWrite(); _dictionary.Add(key, value); } public bool Remove(TKey key) { ActivateForWrite(); return _dictionary.Remove(key); } public bool TryGetValue(TKey key, out TValue value) { ActivateForRead(); return _dictionary.TryGetValue(key, out value); } public TValue this[TKey key] { get { ActivateForRead(); return _dictionary[key]; } set { ActivateForWrite(); _dictionary[key] = value; } } public ICollection Keys { get { ActivateForRead(); return _dictionary.Keys; } } ICollection IDictionary.Keys { get { ActivateForRead(); return Cast().Keys; } } ICollection IDictionary.Values { get { ActivateForRead(); return _dictionary.Values; } } #endregion #region Dictionary methods public Dictionary.ValueCollection Values { get { ActivateForRead(); return ((Dictionary) _dictionary).Values; } } public bool ContainsValue(TValue value) { ActivateForRead(); return Cast>().ContainsValue(value); } public IEqualityComparer Comparer { get { return Cast>().Comparer; } } #endregion #if !CF && !SILVERLIGHT #region Implementation of ISerializable #if NET_4_0 [System.Security.SecurityCritical] #endif public void GetObjectData(SerializationInfo info, StreamingContext context) { ActivateForRead(); Cast().GetObjectData(info, context); } #endregion #region Implementation of IDeserializationCallback public void OnDeserialization(object sender) { Cast().OnDeserialization(sender); } #endregion #endif private T Cast() { return (T)_dictionary; } private readonly IDictionary _dictionary = new Dictionary(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/IO/0000755000175000017500000000000011700531646024704 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/IO/RandomAccessFileFactory.cs0000644000175000017500000000221111700531646031721 0ustar00meebeymeebey00000000000000using System; using System.IO; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Sharpen.IO; using File=Sharpen.IO.File; namespace Db4objects.Db4o.IO { public class RandomAccessFileFactory { public static RandomAccessFile NewRandomAccessFile(String path, bool readOnly, bool lockFile) { RandomAccessFile raf = null; bool ok = false; try { raf = new RandomAccessFile(path, readOnly, lockFile); if (lockFile) { Platform4.LockFile(path, raf); } ok = true; return raf; } catch (IOException x) { if (new File(path).Exists()) { throw new DatabaseFileLockedException(path, x); } throw new Db4oIOException(x); } finally { if(!ok && raf != null) { raf.Close(); } } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Diagnostic/0000755000175000017500000000000011700531646026461 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Diagnostic/DiagnosticToTrace.cs0000644000175000017500000000223111700531646032354 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Diagnostic { #if !CF /// prints Diagnostic messsages to the Console. /// /// prints Diagnostic messsages to System.Diagnostics.Trace. /// Install this /// Db4objects.Db4o.Diagnostic.IDiagnosticListener /// /// with:
/// commonConfig.Diagnostic.AddListener(new DiagnosticToTrace());
///
/// Db4objects.Db4o.Diagnostic.DiagnosticConfiguration /// public class DiagnosticToTrace : Db4objects.Db4o.Diagnostic.IDiagnosticListener { /// redirects Diagnostic messages to System.Diagnostics.Trace /// redirects Diagnostic messages to the Console. public virtual void OnDiagnostic(Db4objects.Db4o.Diagnostic.IDiagnostic d) { #if !SILVERLIGHT System.Diagnostics.Trace.WriteLine(d.ToString()); #endif } } #endif } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/TransientAttribute.cs0000644000175000017500000000111411700531646030554 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o { /// /// Marks a field or event as transient. /// /// /// Transient fields are not stored by db4o. ///
/// If you don't want a field to be stored by db4o, /// simply mark it with this attribute. ///
/// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Event)] public class TransientAttribute : Attribute { public TransientAttribute() { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Defragment/0000755000175000017500000000000011700531646026451 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Defragment/AvailableTypeFilter.cs0000644000175000017500000000101111700531646032661 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using System; namespace Db4objects.Db4o.Defragment { public class AvailableTypeFilter : IStoredClassFilter { /// StoredClass instance to be checked /// true, if the given StoredClass instance should be accepted, false otherwise. /// public bool Accept(IStoredClass storedClass) { return System.Type.GetType(storedClass.GetName(),false)!=null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/0000755000175000017500000000000011700531646026151 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Marshall/0000755000175000017500000000000011700531646027714 5ustar00meebeymeebey00000000000000MarshallingConstants0.cs0000644000175000017500000000026211700531646034402 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Marshallusing System; namespace Db4objects.Db4o.Internal.Marshall { public class MarshallingConstants0 { public static readonly DateTime NullDate = DateTime.MinValue; } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/ObjectContainerBase.cs0000644000175000017500000001461211700531646032350 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2008 Versant Inc. http://www.db4o.com */ using System.Collections.Generic; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal { using System; using Query; using Query.Result; using Query.Processor; using Ext; public partial class ObjectContainerBase { void IDisposable.Dispose() { Close(); } public IObjectSet Query(Predicate match, System.Collections.IComparer comparer) { if (null == match) throw new ArgumentNullException("match"); return Query(null, match, new ComparerAdaptor(comparer)); } class GenericComparerAdaptor : IQueryComparator { private readonly IComparer _comparer; public GenericComparerAdaptor(IComparer comparer) { _comparer = comparer; } public int Compare(object first, object second) { return _comparer.Compare((T)first, (T)second); } } class GenericComparisonAdaptor : DelegateEnvelope, IQueryComparator { public GenericComparisonAdaptor(Comparison comparer) : base(comparer) { } public int Compare(object first, object second) { Comparison _comparer = (Comparison)GetContent(); return _comparer((T)first, (T)second); } } public IList Query(Predicate match) { return Query(null, match); } public IList Query(Transaction trans, Predicate match) { return ExecuteNativeQuery(trans, match, null); } public IList Query(Predicate match, IComparer comparer) { return Query(null, match, comparer); } public IList Query(Transaction trans, Predicate match, IComparer comparer) { IQueryComparator comparator = null != comparer ? new GenericComparerAdaptor(comparer) : null; return ExecuteNativeQuery(trans, match, comparator); } public IList Query(Predicate match, Comparison comparison) { return Query(null, match, comparison); } public IList Query(Transaction trans, Predicate match, Comparison comparison) { IQueryComparator comparator = null != comparison ? new GenericComparisonAdaptor(comparison) : null; return ExecuteNativeQuery(trans, match, comparator); } public IList Query(Type extent) { return Query(null, extent, null); } public IList Query(Transaction trans, Type extent) { return Query(trans, extent, null); } public IList Query(Type extent, IComparer comparer) { return Query(null, extent, comparer); } public IList Query(Transaction trans, Type extent, IComparer comparer) { lock (Lock()) { trans = CheckTransaction(trans); QQuery query = (QQuery)Query(trans); query.Constrain(extent); if (null != comparer) query.SortBy(new GenericComparerAdaptor(comparer)); IQueryResult queryResult = query.GetQueryResult(); return new GenericObjectSetFacade(queryResult); } } public IList Query() { return Query(typeof(Extent)); } public IList Query(IComparer comparer) { return Query(typeof(Extent), comparer); } private IList ExecuteNativeQuery(Transaction trans, Predicate match, IQueryComparator comparator) { if (null == match) throw new ArgumentNullException("match"); lock (Lock()) { IQuery query = Query(CheckTransaction(trans)); return (IList) ((QQuery)query).TriggeringQueryEvents(Closures4.ForDelegate( delegate() { return GetNativeQueryHandler().Execute(query, match, comparator); })); } } public delegate R SyncExecClosure(); public R SyncExec(SyncExecClosure closure) { return (R)SyncExec(new SyncExecClosure4(closure)); } public class SyncExecClosure4 : IClosure4 { private readonly SyncExecClosure _closure; public SyncExecClosure4(SyncExecClosure closure) { _closure = closure; } #region Implementation of IClosure4 public object Run() { return _closure.Invoke(); } #endregion } private object AsTopLevelCall(IFunction4 block, Transaction trans) { trans = CheckTransaction(trans); BeginTopLevelCall(); try { return block.Apply(trans); } catch(Db4oRecoverableException exc) { throw; } catch(SystemException exc) { throw; } catch(Exception exc) { FatalShutdown(exc); } finally { EndTopLevelCall(); } // should never happen - just to make compiler happy throw new Db4oException(); } public void WithEnvironment(Action4 action) { WithEnvironment(new RunnableAction(action)); } } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/0000755000175000017500000000000011700531646027711 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/DateTimeHandler6.cs0000644000175000017500000000160311700531646033320 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { class DateTimeHandler6 : DateTimeHandler { protected override object ReadKind(IReadContext context, DateTime dateTime) { return dateTime; } protected override void WriteKind(IWriteContext context, DateTime dateTime) { // do nothing } protected override DateTime ReadKind (DateTime dateTime, byte[] bytes, int offset) { return dateTime; } protected override void WriteKind(DateTime dateTime, byte[] bytes, int offset) { // do nothing } //public override int LinkLength() //{ // return base.LinkLength() - Const4.LongLength; //} } } WeakReferenceHandlerQueue.cs0000644000175000017500000000271011700531646035172 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/* Copyright (C) 2004 - 2007 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Internal.Handlers { internal class WeakReferenceHandlerQueue { private List4 _list; internal void Add(WeakReferenceHandler reference) { lock(this){ _list = new List4(_list, reference); } } internal void Poll(ObjectContainerBase objectContainer) { List4 remove = null; lock(this){ System.Collections.IEnumerator i = new Iterator4Impl(_list); _list = null; while(i.MoveNext()){ WeakReferenceHandler refHandler = (WeakReferenceHandler)i.Current; if(refHandler.IsAlive){ _list = new List4(_list, refHandler); }else{ remove = new List4(remove, refHandler.ObjectReference); } } } System.Collections.IEnumerator j = new Iterator4Impl(remove); while (j.MoveNext()) { lock (objectContainer.Lock()) { if (objectContainer.IsClosed()) { return; } objectContainer.RemoveFromAllReferenceSystems(j.Current); } } } } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/UShortHandler.cs0000644000175000017500000000312011700531646032756 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2007 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { public class UShortHandler : IntegralTypeHandler { public override Object DefaultValue(){ return (ushort)0; } public override Object Read(byte[] bytes, int offset){ offset += 1; return (ushort) (bytes[offset] & 255 | (bytes[--offset] & 255) << 8); } public override int TypeID(){ return 24; } public override void Write(Object obj, byte[] bytes, int offset){ ushort us = (ushort)obj; offset += 2; bytes[--offset] = (byte)us; bytes[--offset] = (byte)(us >>= 8); } public override object Read(IReadContext context) { byte[] bytes = new byte[2]; context.ReadBytes(bytes); return (ushort)( bytes[1] & 255 | (bytes[0] & 255) << 8 ); } public override void Write(IWriteContext context, object obj) { ushort us = (ushort)obj; context.WriteBytes( new byte[] { (byte)(us>>8), (byte)us, }); } public override IPreparedComparison InternalPrepareComparison(object obj) { return new PreparedComparisonFor(((ushort)obj)); } } } WeakReferenceHandler.cs0000644000175000017500000000115711700531646034171 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/* Copyright (C) 2004 - 2007 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Internal.Handlers { internal class WeakReferenceHandler { private readonly WeakReference _reference; public object ObjectReference; internal WeakReferenceHandler(Object queue, Object objectRef, Object obj) { _reference = new WeakReference(obj, false); ObjectReference = objectRef; ((WeakReferenceHandlerQueue)queue).Add(this); } public object Get() { return _reference.Target; } public bool IsAlive { get { return _reference.IsAlive; } } } }PreparedComparisonFor.cs0000644000175000017500000000106111700531646034423 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Internal.Handlers { internal class PreparedComparisonFor : IPreparedComparison where T : IComparable { private readonly T _source; public PreparedComparisonFor(T source) { _source = source; } public int CompareTo(object obj) { T target = ((T)obj); return _source.CompareTo(target); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/StructHandler.cs0000644000175000017500000000031411700531646033020 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2007 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Internal.Handlers { abstract public class StructHandler : NetTypeHandler { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/ULongHandler.cs0000644000175000017500000000426111700531646032565 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2007 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { public class ULongHandler : IntegralTypeHandler { public override Object DefaultValue(){ return (ulong)0; } public override void Write(object obj, byte[] bytes, int offset){ ulong ul = (ulong)obj; for (int i = 0; i < 8; i++){ bytes[offset++] = (byte)(int)(ul >> (7 - i) * 8); } } public override int TypeID(){ return 23; } public override Object Read(byte[] bytes, int offset){ ulong ul = 0; for (int i = 0; i < 8; i++) { ul = (ul << 8) + (ulong)(bytes[offset++] & 255); } return ul; } public override object Read(IReadContext context) { byte[] bytes = new byte[8]; context.ReadBytes(bytes); return (ulong)( (ulong)bytes[7] & 255 | (ulong)(bytes[6] & 255) << 8 | (ulong)(bytes[5] & 255) << 16 | (ulong)(bytes[4] & 255) << 24 | (ulong)(bytes[3] & 255) << 32 | (ulong)(bytes[2] & 255) << 40 | (ulong)(bytes[1] & 255) << 48 | (ulong)(bytes[0] & 255) << 56 ); } public override void Write(IWriteContext context, object obj) { ulong ui = (ulong)obj; context.WriteBytes( new byte[] { (byte)(ui>>56), (byte)(ui>>48), (byte)(ui>>40), (byte)(ui>>32), (byte)(ui>>24), (byte)(ui>>16), (byte)(ui>>8), (byte)ui, }); } public override IPreparedComparison InternalPrepareComparison(object obj) { return new PreparedComparisonFor(((ulong)obj)); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/DecimalHandler.cs0000644000175000017500000000535411700531646033103 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2007 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { public class DecimalHandler : IntegralTypeHandler { public override Object DefaultValue(){ return (decimal)0; } public override Object Read(byte[] bytes, int offset){ int[] ints = new int[4]; offset += 3; for(int i = 0; i < 4; i ++){ ints[i] = (bytes[offset] & 255 | (bytes[--offset] & 255) << 8 | (bytes[--offset] & 255) << 16 | bytes[--offset] << 24); offset +=7; } return new Decimal(ints); } public override int TypeID(){ return 21; } public override void Write(Object obj, byte[] bytes, int offset){ decimal dec = (decimal)obj; int[] ints = Decimal.GetBits(dec); offset += 4; for(int i = 0; i < 4; i ++){ bytes[--offset] = (byte)ints[i]; bytes[--offset] = (byte)(ints[i] >>= 8); bytes[--offset] = (byte)(ints[i] >>= 8); bytes[--offset] = (byte)(ints[i] >>= 8); offset += 8; } } public override object Read(IReadContext context) { byte[] bytes = new byte[16]; int[] ints = new int[4]; int offset = 4; context.ReadBytes(bytes); for (int i = 0; i < 4; i++) { ints[i] = ( bytes[--offset] & 255 | (bytes[--offset] & 255) << 8 | (bytes[--offset] & 255) << 16 | (bytes[--offset] & 255) << 24 ); offset += 8; } return new Decimal(ints); } public override void Write(IWriteContext context, object obj) { decimal dec = (decimal)obj; byte[] bytes = new byte[16]; int offset = 4; int[] ints = Decimal.GetBits(dec); for (int i = 0; i < 4; i++) { bytes[--offset] = (byte)ints[i]; bytes[--offset] = (byte)(ints[i] >>= 8); bytes[--offset] = (byte)(ints[i] >>= 8); bytes[--offset] = (byte)(ints[i] >>= 8); offset += 8; } context.WriteBytes(bytes); } public override IPreparedComparison InternalPrepareComparison(object obj) { return new PreparedComparisonFor(((decimal) obj)); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/UIntHandler.cs0000644000175000017500000000357311700531646032425 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2007 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { public class UIntHandler : IntegralTypeHandler { public override Object DefaultValue(){ return (uint)0; } public override Object Read(byte[] bytes, int offset){ offset += 3; return (uint) (bytes[offset] & 255 | (bytes[--offset] & 255) << 8 | (bytes[--offset] & 255) << 16 | bytes[--offset] << 24); } public override int TypeID(){ return 22; } public override void Write(Object obj, byte[] bytes, int offset){ uint ui = (uint)obj; offset += 4; bytes[--offset] = (byte)ui; bytes[--offset] = (byte)(ui >>= 8); bytes[--offset] = (byte)(ui >>= 8); bytes[--offset] = (byte)(ui >>= 8); } public override object Read(IReadContext context) { byte[] bytes = new byte[4]; context.ReadBytes(bytes); return (uint)( bytes[3] & 255 | (bytes[2] & 255) << 8 | (bytes[1] & 255) << 16 | (bytes[0] & 255) << 24 ); } public override void Write(IWriteContext context, object obj) { uint ui = (uint)obj; context.WriteBytes( new byte[] { (byte)(ui>>24), (byte)(ui>>16), (byte)(ui>>8), (byte)ui, }); } public override IPreparedComparison InternalPrepareComparison(object obj) { return new PreparedComparisonFor(((uint)obj)); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/DateTimeHandler.cs0000644000175000017500000000476311700531646033244 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2007 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Marshall; using Sharpen; namespace Db4objects.Db4o.Internal.Handlers { public class DateTimeHandler : StructHandler { public override Object DefaultValue() { return DateTime.MinValue; } public override Object Read(byte[] bytes, int offset) { long ticks = 0; for (int i = 0; i < 8; i++) { ticks = (ticks << 8) + (bytes[offset++] & 255); } return ReadKind(new DateTime(ticks), bytes, offset); } protected virtual DateTime ReadKind (DateTime dateTime, byte[] bytes, int offset) { int kind = 0; for (int i = 0; i < 4; i++) { kind = (kind << 8) + (bytes[offset++] & 255); } return DateTime.SpecifyKind(dateTime, (DateTimeKind)kind); } public override int TypeID() { return 25; } public override void Write(object obj, byte[] bytes, int offset) { long ticks = ((DateTime)obj).Ticks; for (int i = 0; i < 8; i++) { bytes[offset++] = (byte)(int)(ticks >> (7 - i) * 8); } WriteKind((DateTime)obj, bytes, offset); } protected virtual void WriteKind(DateTime dateTime, byte[] bytes, int offset) { int kind = (int) dateTime.Kind; for (int i = 0; i < 4; i++) { bytes[offset++] = (byte)(int)(kind >> (3 - i) * 8); } } public override object Read(IReadContext context) { long ticks = context.ReadLong(); DateTime dateTime = new DateTime(ticks); return ReadKind(context, dateTime); } protected virtual object ReadKind(IReadContext context, DateTime dateTime) { DateTimeKind kind = (DateTimeKind) context.ReadInt(); return DateTime.SpecifyKind(dateTime, kind); } public override void Write(IWriteContext context, object obj) { DateTime dateTime = (DateTime)obj; long ticks = dateTime.Ticks; context.WriteLong(ticks); WriteKind(context, dateTime); } protected virtual void WriteKind(IWriteContext context, DateTime dateTime) { context.WriteInt((int) dateTime.Kind); } public override IPreparedComparison InternalPrepareComparison(object obj) { return new PreparedComparisonFor(((DateTime)obj)); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/SByteHandler.cs0000644000175000017500000000244611700531646032572 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2007 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers { public class SByteHandler : IntegralTypeHandler { public override object Coerce(IReflectClass claxx, object obj) { return Coercion4.ToSByte(obj); } public override Object DefaultValue(){ return (sbyte)0; } public override Object Read(byte[] bytes, int offset){ return (sbyte) ((bytes[offset]) - 128) ; } public override int TypeID(){ return 20; } public override void Write(Object obj, byte[] bytes, int offset){ bytes[offset] = (byte)(((sbyte)obj) + 128); } public override object Read(IReadContext context) { return (sbyte)(context.ReadByte() - 128); } public override void Write(IWriteContext context, object obj) { context.WriteByte((byte)(((sbyte)obj) + 128)); } public override IPreparedComparison InternalPrepareComparison(object obj) { return new PreparedComparisonFor(((sbyte)obj)); } } } IntegralTypeHandler.cs0000644000175000017500000000031311700531646034063 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/* Copyright (C) 2004 - 2007 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Internal.Handlers { abstract public class IntegralTypeHandler : NetTypeHandler { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Handlers/DateHandler.cs0000644000175000017500000000113411700531646032412 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Internal.Handlers { public class DateHandler : DateHandlerBase { public override object DefaultValue() { return DateTime.MinValue; } public override object PrimitiveNull() { return DateTime.MinValue; } public override object NullRepresentationInUntypedArrays() { return null; } public override object CopyValue(object from, object to) { // nothing to do since we already have a immutable // copy return from; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Query/0000755000175000017500000000000011700531646027256 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Query/INQOptimizer.cs0000755000175000017500000000031111700531646032135 0ustar00meebeymeebey00000000000000using System.Reflection; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Query { public interface INQOptimizer { void Optimize(IQuery q, object predicate, MethodBase method); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Query/ObjectSetFacade.cs0000644000175000017500000000714611700531646032563 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal.Query.Result; namespace Db4objects.Db4o.Internal.Query { /// /// List based objectSet implementation /// /// public class ObjectSetFacade : IExtObjectSet, System.Collections.IList { public readonly StatefulQueryResult _delegate; public ObjectSetFacade(IQueryResult qr) { _delegate = new StatefulQueryResult(qr); } #region IObjectSet Members public Object Get(int index) { return _delegate.Get(index); } public void Sort(Db4objects.Db4o.Query.IQueryComparator cmp) { _delegate.Sort(cmp); } public long[] GetIDs() { return _delegate.GetIDs(); } public IExtObjectSet Ext() { return this; } public bool MoveNext() { return Enumerator().MoveNext(); } private IEnumerator _enumerator; private IEnumerator Enumerator() { if (null == _enumerator) { _enumerator = GetEnumerator(); } return _enumerator; } public object Current { get { return Enumerator().Current; } } public bool HasNext() { return _delegate.HasNext(); } public Object Next() { return _delegate.Next(); } public void Reset() { _delegate.Reset(); } public int Size() { return _delegate.Size(); } private Object Lock() { return _delegate.Lock(); } private IObjectContainer ObjectContainer() { return _delegate.ObjectContainer(); } public StatefulQueryResult Delegate_() { return _delegate; } #endregion #region IList Members public bool IsReadOnly { get { return true; } } public object this[int index] { get { return _delegate.Get(index); } set { throw new NotSupportedException(); } } public void RemoveAt(int index) { throw new NotSupportedException(); } public void Insert(int index, object value) { throw new NotSupportedException(); } public void Remove(object value) { throw new NotSupportedException(); } public bool Contains(object value) { return IndexOf(value) >= 0; } public void Clear() { throw new NotSupportedException(); } public int IndexOf(object value) { return _delegate.IndexOf(value); } public int Add(object value) { throw new NotSupportedException(); } public bool IsFixedSize { get { return true; } } #endregion #region ICollection Members public bool IsSynchronized { get { return true; } } public int Count { get { return Size(); } } public void CopyTo(Array array, int index) { lock (Lock()) { int i = 0; int s = _delegate.Size(); while (i < s) { array.SetValue(_delegate.Get(i), index + i); i++; } } } public object SyncRoot { get { return Lock(); } } #endregion public System.Collections.IEnumerator GetEnumerator() { IEnumerator enumerator = _delegate.GetEnumerator(); object current; while (MoveNext(enumerator, out current)) { yield return current; } } private bool MoveNext(IEnumerator enumerator, out object current) { lock (_delegate.Lock()) { if (enumerator.MoveNext()) { current = enumerator.Current; return true; } } current = null; return false; } } } GenericObjectSetFacade.cs0000644000175000017500000001013711700531646033773 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Query/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal.Query.Result; namespace Db4objects.Db4o.Internal.Query { /// /// List based objectSet implementation /// /// public class GenericObjectSetFacade : System.Collections.Generic.IList { public readonly StatefulQueryResult _delegate; public GenericObjectSetFacade(IQueryResult qr) { _delegate = new StatefulQueryResult(qr); } #region IList Members public bool IsReadOnly { get { return true; } } public T this[int index] { get { return (T)_delegate.Get(index); } set { throw new NotSupportedException(); } } public void RemoveAt(int index) { throw new NotSupportedException(); } public void Insert(int index, T value) { throw new NotSupportedException(); } public bool Remove(T value) { throw new NotSupportedException(); } public bool Contains(T value) { return IndexOf(value) >= 0; } public void Clear() { throw new NotSupportedException(); } public int IndexOf(T value) { return _delegate.IndexOf(value); } public void Add(T value) { throw new NotSupportedException(); } public bool IsFixedSize { get { return true; } } #endregion #region ICollection Members public bool IsSynchronized { get { return true; } } public int Count { get { return _delegate.Size(); } } public void CopyTo(T[] array, int index) { lock (this.SyncRoot) { int i = 0; int s = this.Count; while (i < s) { array[index + i] = this[i]; i++; } } } public object SyncRoot { get { return _delegate.Lock(); } } #endregion #region IEnumerable Members class ObjectSetImplEnumerator : System.Collections.IEnumerator, System.Collections.Generic.IEnumerator { System.Collections.Generic.IList _result; int _next = 0; public ObjectSetImplEnumerator(System.Collections.Generic.IList result) { _result = result; } public void Reset() { _next = 0; } object System.Collections.IEnumerator.Current { get { return _result[_next - 1]; } } public bool MoveNext() { if (_next < _result.Count) { ++_next; return true; } return false; } public T Current { get { return _result[_next - 1]; } } public void Dispose() { } } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return new ObjectSetImplEnumerator(this); } #endregion #region IEnumerable implementation public System.Collections.Generic.IEnumerator GetEnumerator() { return new ObjectSetImplEnumerator(this); } #endregion } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Query/NQOptimizerFactory.cs0000644000175000017500000000061211700531646033355 0ustar00meebeymeebey00000000000000/* Copyright (C) 2006 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Query { using System; public class NQOptimizerFactory { public static INQOptimizer CreateExpressionBuilder() { Type type = Type.GetType("Db4objects.Db4o.NativeQueries.NQOptimizer, Db4objects.Db4o.NativeQueries", true); return (INQOptimizer)Activator.CreateInstance(type); } } } EvaluationDelegateWrapper.cs0000644000175000017500000000413711700531646034636 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Query/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; using Db4objects.Db4o; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Query { // TODO: Use DelegateEnvelope to build a generic delegate translator internal class DelegateEnvelope { System.Type _delegateType; object _target; System.Type _type; string _method; [NonSerialized] Delegate _content; public DelegateEnvelope() { } public DelegateEnvelope(Delegate content) { _content = content; Marshal(); } protected Delegate GetContent() { if (null == _content) { _content = Unmarshal(); } return _content; } private void Marshal() { _delegateType = _content.GetType(); _target = _content.Target; _method = _content.Method.Name; _type = _content.Method.DeclaringType; } private Delegate Unmarshal() { if (null == _target) { return Delegate.CreateDelegate(_delegateType, null, _type.GetMethod(_method, BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public)); } return Delegate.CreateDelegate(_delegateType, _target, _target.GetType().GetMethod(_method, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)); } } internal class EvaluationDelegateWrapper : DelegateEnvelope, IEvaluation { public EvaluationDelegateWrapper() { } public EvaluationDelegateWrapper(EvaluationDelegate evaluation) : base(evaluation) { } EvaluationDelegate GetEvaluationDelegate() { return (EvaluationDelegate)GetContent(); } public void Evaluate(ICandidate candidate) { // use starting _ for PascalCase conversion purposes EvaluationDelegate _evaluation = GetEvaluationDelegate(); _evaluation(candidate); } } }SilverlightArrayListExtensions.cs0000644000175000017500000000042511700531646035736 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Queryusing System.Collections; namespace Db4objects.Db4o.Internal.Query { #if SILVERLIGHT public static class SilverlightArrayListExtensions { public static void Sort(this ArrayList self, IComparer comparer) { self.Sort(comparer.Compare); } } #endif } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Query/NativeQueryHandler.cs0000644000175000017500000001673211700531646033370 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.IO; using System.Reflection; using Db4objects.Db4o.Diagnostic; using Db4objects.Db4o.Query; using Db4objects.Db4o.Internal.Query.Result; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Diagnostic; namespace Db4objects.Db4o.Internal.Query { public class NativeQueryHandler { private IObjectContainer _container; private INQOptimizer _builder; public event QueryExecutionHandler QueryExecution; public event QueryOptimizationFailureHandler QueryOptimizationFailure; public NativeQueryHandler(IObjectContainer container) { _container = container; } public virtual Db4objects.Db4o.IObjectSet Execute(Db4objects.Db4o.Query.IQuery query, Db4objects.Db4o.Query.Predicate predicate, Db4objects.Db4o.Query.IQueryComparator comparator) { Db4objects.Db4o.Query.IQuery q = ConfigureQuery(query, predicate); q.SortBy(comparator); return q.Execute(); } public virtual System.Collections.Generic.IList Execute(Db4objects.Db4o.Query.IQuery query, System.Predicate match, Db4objects.Db4o.Query.IQueryComparator comparator) { #if CF return ExecuteUnoptimized(QueryForExtent(query, comparator), match); #else // XXX: check GetDelegateList().Length // only 1 delegate must be allowed // although we could use it as a filter chain // (and) return ExecuteImpl(query, match, match.Target, match.Method, match, comparator); #endif } public static System.Collections.Generic.IList ExecuteEnhancedFilter(IObjectContainer container, IDb4oEnhancedFilter predicate) { return NQHandler(container).ExecuteEnhancedFilter(predicate); } public System.Collections.Generic.IList ExecuteEnhancedFilter(IDb4oEnhancedFilter filter) { IQuery query = _container.Query(); query.Constrain(typeof(T)); filter.OptimizeQuery(query); OnQueryExecution(filter, QueryExecutionKind.PreOptimized); return WrapQueryResult(query); } private static NativeQueryHandler NQHandler(IObjectContainer container) { return ((ObjectContainerBase)container).GetNativeQueryHandler(); } private System.Collections.Generic.IList ExecuteImpl( Db4objects.Db4o.Query.IQuery query, object originalPredicate, object matchTarget, System.Reflection.MethodBase matchMethod, System.Predicate match, Db4objects.Db4o.Query.IQueryComparator comparator) { Db4objects.Db4o.Query.IQuery q = QueryForExtent(query, comparator); try { if (OptimizeNativeQueries()) { OptimizeQuery(q, matchTarget, matchMethod); OnQueryExecution(originalPredicate, QueryExecutionKind.DynamicallyOptimized); return WrapQueryResult(q); } } catch(FileNotFoundException fnfe) { NativeQueryOptimizerNotLoaded(fnfe); } catch(TargetInvocationException tie) { NativeQueryOptimizerNotLoaded(tie); } catch(TypeLoadException tle) { NativeQueryOptimizerNotLoaded(tle); } catch (System.Exception e) { OnQueryOptimizationFailure(e); NativeQueryUnoptimized(e); } return ExecuteUnoptimized(q, match); } private void NativeQueryUnoptimized(Exception e) { DiagnosticProcessor dp = Container()._handlers.DiagnosticProcessor(); if (dp.Enabled()) dp.NativeQueryUnoptimized(null, e); } private void NativeQueryOptimizerNotLoaded(Exception exception) { DiagnosticProcessor dp = Container()._handlers.DiagnosticProcessor(); if (dp.Enabled()) dp.NativeQueryOptimizerNotLoaded(Db4o.Diagnostic.NativeQueryOptimizerNotLoaded.NqNotPresent, exception); } private System.Collections.Generic.IList ExecuteUnoptimized(IQuery q, Predicate match) { q.Constrain(new GenericPredicateEvaluation(match)); OnQueryExecution(match, QueryExecutionKind.Unoptimized); return WrapQueryResult(q); } private Db4objects.Db4o.Query.IQuery QueryForExtent(Db4objects.Db4o.Query.IQuery query, Db4objects.Db4o.Query.IQueryComparator comparator) { query.Constrain(typeof(Extent)); query.SortBy(comparator); return query; } private static System.Collections.Generic.IList WrapQueryResult(Db4objects.Db4o.Query.IQuery query) { IQueryResult queryResult = ((QQuery)query).GetQueryResult(); return new GenericObjectSetFacade(queryResult); } private Db4objects.Db4o.Query.IQuery ConfigureQuery(Db4objects.Db4o.Query.IQuery query, Db4objects.Db4o.Query.Predicate predicate) { IDb4oEnhancedFilter filter = predicate as IDb4oEnhancedFilter; if (null != filter) { filter.OptimizeQuery(query); OnQueryExecution(predicate, QueryExecutionKind.PreOptimized); return query; } query.Constrain(predicate.ExtentType()); try { if (OptimizeNativeQueries()) { OptimizeQuery(query, predicate, predicate.GetFilterMethod()); OnQueryExecution(predicate, QueryExecutionKind.DynamicallyOptimized); return query; } } catch (System.Exception e) { OnQueryOptimizationFailure(e); if (OptimizeNativeQueries()) { DiagnosticProcessor dp = Container()._handlers.DiagnosticProcessor(); if (dp.Enabled()) dp.NativeQueryUnoptimized(predicate, e); } } query.Constrain(new Db4objects.Db4o.Internal.Query.PredicateEvaluation(predicate)); OnQueryExecution(predicate, QueryExecutionKind.Unoptimized); return query; } private ObjectContainerBase Container() { return ((ObjectContainerBase)_container); } private bool OptimizeNativeQueries() { return _container.Ext().Configure().OptimizeNativeQueries(); } void OptimizeQuery(Db4objects.Db4o.Query.IQuery q, object predicate, System.Reflection.MethodBase filterMethod) { if (_builder == null) _builder = NQOptimizerFactory.CreateExpressionBuilder(); _builder.Optimize(q, predicate, filterMethod); } private void OnQueryExecution(object predicate, QueryExecutionKind kind) { if (null == QueryExecution) return; QueryExecution(this, new QueryExecutionEventArgs(predicate, kind)); } private void OnQueryOptimizationFailure(System.Exception e) { if (null == QueryOptimizationFailure) return; QueryOptimizationFailure(this, new QueryOptimizationFailureEventArgs(e)); } } class GenericPredicateEvaluation : DelegateEnvelope, Db4objects.Db4o.Query.IEvaluation { public GenericPredicateEvaluation() { // for db4o c/s when CallConstructors == true } public GenericPredicateEvaluation(System.Predicate predicate) : base(predicate) { } public void Evaluate(Db4objects.Db4o.Query.ICandidate candidate) { // use starting _ for PascalCase conversion purposes System.Predicate _predicate = (System.Predicate)GetContent(); candidate.Include(_predicate((T)candidate.GetObject())); } } } QueryExecutionHandler.cs0000644000175000017500000000126111700531646034015 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Query/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Query { public enum QueryExecutionKind { Unoptimized, DynamicallyOptimized, PreOptimized } public class QueryExecutionEventArgs : System.EventArgs { private object _predicate; private QueryExecutionKind _kind; public QueryExecutionEventArgs(object predicate, QueryExecutionKind kind) { _predicate = predicate; _kind = kind; } public object Predicate { get { return _predicate; } } public QueryExecutionKind ExecutionKind { get { return _kind; } } } public delegate void QueryExecutionHandler(object sender, QueryExecutionEventArgs args); }QueryOptimizationFailureHandler.cs0000644000175000017500000000073411700531646036054 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Query/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Query { public class QueryOptimizationFailureEventArgs : System.EventArgs { System.Exception _reason; public QueryOptimizationFailureEventArgs(System.Exception e) { _reason = e; } public System.Exception Reason { get { return _reason; } } } public delegate void QueryOptimizationFailureHandler(object sender, QueryOptimizationFailureEventArgs args); }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Const4.cs0000644000175000017500000000032211700531646027647 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2008 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal { public sealed partial class Const4 { public const int MaxStackDepth = 20; } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Convert/0000755000175000017500000000000011700531646027571 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Convert/Conversions/0000755000175000017500000000000011700531646032101 5ustar00meebeymeebey00000000000000DropGuidClassIndexes_7_12.cs0000644000175000017500000000064411700531646037130 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Reflect.Net; namespace Db4objects.Db4o.Internal.Convert.Conversions { public partial class DropGuidClassIndexes_7_12 : DropClassIndexesConversion { protected override bool Accept(ClassMetadata classmetadata) { return NetReflector.ToNative(classmetadata.ClassReflector()) == typeof(Guid); } } } ReindexNetDateTime_7_8.cs0000644000175000017500000000262311700531646036513 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Net; namespace Db4objects.Db4o.Internal.Convert.Conversions { partial class ReindexNetDateTime_7_8 : Conversion { public override void Convert(ConversionStage.SystemUpStage stage) { ReindexDateTimeFields(stage); } private static void ReindexDateTimeFields(ConversionStage stage) { DateTimeFieldReindexer reindexer = new DateTimeFieldReindexer(); ClassMetadataIterator i = stage.File().ClassCollection().Iterator(); while (i.MoveNext()) { ClassMetadata classmetadata = i.CurrentClass(); classmetadata.TraverseDeclaredFields(reindexer); } } private class DateTimeFieldReindexer : IProcedure4 { public void Apply(object field) { if (!((FieldMetadata)field).HasIndex()) { return; } ReindexDateTimeField(((FieldMetadata)field)); } private static void ReindexDateTimeField(IStoredField field) { IReflectClass claxx = field.GetStoredType(); if (claxx == null) { return; } Type t = NetReflector.ToNative(claxx); if (t == typeof(DateTime) || t == typeof(DateTime?)) { field.DropIndex(); field.CreateIndex(); } } } } } DropClassIndexesConversion.cs0000644000175000017500000000116411700531646037633 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Convert.Conversions { public abstract class DropClassIndexesConversion : Conversion { public override void Convert(ConversionStage.SystemUpStage stage) { LocalObjectContainer file = stage.File(); ClassMetadataIterator i = file.ClassCollection().Iterator(); while (i.MoveNext()) { ClassMetadata classmetadata = i.CurrentClass(); if (Accept(classmetadata)) { classmetadata.DropClassIndex(); } } } protected abstract bool Accept(ClassMetadata classmetadata); } } DropEnumClassIndexes_7_10.cs0000644000175000017500000000071011700531646037134 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Reflect.Net; namespace Db4objects.Db4o.Internal.Convert.Conversions { public partial class DropEnumClassIndexes_7_10 : DropClassIndexesConversion { protected override bool Accept(ClassMetadata classmetadata) { Type type = NetReflector.ToNative(classmetadata.ClassReflector()); return type != null ? type.IsEnum : false; } } } DropDateTimeOffsetClassIndexes_7_12.cs0000644000175000017500000000076011700531646041102 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Reflect.Net; namespace Db4objects.Db4o.Internal.Convert.Conversions { public partial class DropDateTimeOffsetClassIndexes_7_12 : DropClassIndexesConversion { protected override bool Accept(ClassMetadata classmetadata) { #if CF || SILVERLIGHT return false; #else return NetReflector.ToNative(classmetadata.ClassReflector()) == typeof(DateTimeOffset); #endif } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Encoding/0000755000175000017500000000000011700531646027677 5ustar00meebeymeebey00000000000000UTF8StringEncoding.cs0000644000175000017500000000101611700531646033531 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Encoding/* Copyright (C) 2008 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Internal.Encoding { public class UTF8StringEncoding : BuiltInStringEncoding { public override byte[] Encode(String str) { return System.Text.Encoding.UTF8.GetBytes(str); } public override String Decode(byte[] bytes, int start, int length) { return System.Text.Encoding.UTF8.GetString(bytes, start, length); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/IInternalObjectContainer.cs0000644000175000017500000000036411700531646033362 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Internal { public partial interface IInternalObjectContainer { void WithEnvironment(Action4 action); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Collections/0000755000175000017500000000000011700531646030427 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Collections/BigSet.cs0000644000175000017500000000263011700531646032134 0ustar00meebeymeebey00000000000000/* Copyright (C) 2010 Versant Inc. http://www.db4o.com */ using System.Collections; using System.Collections.Generic; namespace Db4objects.Db4o.Internal.Collections { public partial class BigSet { #region Implementation of ICollection void ICollection.Add(E item) { Add(item); } bool ICollection.Contains(E item) { return Contains(item); } void ICollection.CopyTo(E[] array, int arrayIndex) { throw new System.NotImplementedException(); } bool ICollection.Remove(E item) { return Remove(item); } public bool IsReadOnly { get { return false; } } IEnumerator IEnumerable.GetEnumerator() { IEnumerator iterator = BTreeIterator(); while (iterator.MoveNext()) { yield return (E)Element((int) iterator.Current); } } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } #endregion #region Implementation of ISet bool Db4o.Collections.ISet.RemoveAll(IEnumerable es) { bool result = false; foreach (E e in es) { if (Remove(e)) { result = true; } } return result; } bool Db4o.Collections.ISet.ContainsAll(IEnumerable es) { foreach (E e in es) { if (!Contains(e)) { return false; } } return true; } #endregion } } LegacyDb4oAssemblyNameMapper.cs0000644000175000017500000000517011700531646034007 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using System.Text; using Db4objects.Db4o.Internal.Encoding; namespace Db4objects.Db4o.Internal { internal class LegacyDb4oAssemblyNameMapper { static LegacyDb4oAssemblyNameMapper() { LatinStringIO stringIO = new UnicodeStringIO(); oldAssemblies = new byte[oldAssemblyNames.Length][]; for (int i = 0; i < oldAssemblyNames.Length; i++) { oldAssemblies[i] = stringIO.Write(oldAssemblyNames[i]); } } internal byte[] MappedNameFor(byte[] nameBytes) { for (int i = 0; i < oldAssemblyNames.Length; i++) { byte[] assemblyName = oldAssemblies[i]; int j = assemblyName.Length - 1; for (int k = nameBytes.Length - 1; k >= 0; k--) { if (nameBytes[k] != assemblyName[j]) { break; } j--; if (j < 0) { return UpdateInternalClassName(nameBytes, i); } } } return nameBytes; } private static byte[] UpdateInternalClassName(byte[] bytes, int candidateMatchingAssemblyIndex) { UnicodeStringIO io = new UnicodeStringIO(); string typeFQN = io.Read(bytes); string[] assemblyNameParts = typeFQN.Split(','); if (assemblyNameParts[1].Trim() != oldAssemblyNames[candidateMatchingAssemblyIndex]) { return bytes; } string typeName = assemblyNameParts[0]; return io.Write(FullyQualifiedNameFor(typeName).ToString()); } private static StringBuilder FullyQualifiedNameFor(string typeName) { StringBuilder typeNameBuffer = new StringBuilder(typeName); ApplyNameSpaceRenamings(typeNameBuffer); typeNameBuffer.Append(", "); typeNameBuffer.Append(GetCurrentAssemblyName()); return typeNameBuffer; } private static void ApplyNameSpaceRenamings(StringBuilder typeNameBuffer) { foreach (string[] renaming in NamespaceRenamings) { typeNameBuffer.Replace(renaming[0], renaming[1]); } } private static string GetCurrentAssemblyName() { return typeof(Platform4).Assembly.GetName().Name; } private static readonly string[] oldAssemblyNames = new string[] { "db4o-4.0-net1", "db4o-4.0-compact1" }; private static readonly byte[][] oldAssemblies; private static readonly string[][] NamespaceRenamings = new string[][] { new string[] { "com.db4o.ext", "Db4objects.Db4o.Ext"}, new string[] { "com.db4o.inside", "Db4objects.Db4o.Internal"}, new string[] { "com.db4o", "Db4objects.Db4o"}, }; } } GenericTypeHandlerPredicate.cs0000644000175000017500000000136611700531646033764 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/* Copyright (C) 2008 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Net; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.native.Db4objects.Db4o.Internal { public class GenericTypeHandlerPredicate : ITypeHandlerPredicate { private readonly Type _genericType; public GenericTypeHandlerPredicate(Type genericType) { _genericType = genericType; } public bool Match(IReflectClass classReflector) { Type type = NetReflector.ToNative(classReflector); if (type == null) { return false; } if (!type.IsGenericType) { return false; } return type.GetGenericTypeDefinition() == _genericType; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/ReflectPlatform.cs0000644000175000017500000000211611700531646031571 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; using Sharpen.Lang; namespace Db4objects.Db4o.Internal { public class ReflectPlatform { public static Type ForName(string typeName) { try { return TypeReference.FromString(typeName).Resolve(); } catch { return null; } } public static object CreateInstance(string typeName) { return ReflectPlatform.CreateInstance(ForName(typeName)); } public static object CreateInstance(Type type) { try { return Activator.CreateInstance(type); } catch { return null; } } public static string FullyQualifiedName(Type type) { return TypeReference.FromType(type).GetUnversionedName(); } public static bool IsNamedClass(Type type) { return true; } public static string SimpleName(Type type) { return type.Name; } } } TypeHandlerConfigurationDotNet.cs0000644000175000017500000000766011700531646034517 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections.Generic; using Db4objects.Db4o.Collections; using Db4objects.Db4o.Internal.Collections; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Net; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { class TypeHandlerConfigurationDotNet : TypeHandlerConfiguration { public TypeHandlerConfigurationDotNet(Config4Impl config) : base(config) { ListTypeHandler(new CollectionTypeHandler()); MapTypeHandler(new MapTypeHandler()); } public override void Apply() { #if !SILVERLIGHT RegisterCollection(typeof(System.Collections.ArrayList)); RegisterCollection(typeof (System.Collections.CollectionBase)); RegisterMap(typeof (System.Collections.Hashtable)); RegisterMap(typeof (System.Collections.Specialized.HybridDictionary)); #if !CF RegisterMap(typeof (System.Collections.DictionaryBase)); #endif #endif RegisterGenericTypeHandlers(); RegisterBigSetTypeHandler(); RegisterSystemArrayTypeHandler(); } private void RegisterBigSetTypeHandler() { RegisterGenericTypeHandler(typeof(BigSet<>), new BigSetTypeHandler()); } private void RegisterGenericTypeHandlers() { GenericCollectionTypeHandler handler = new GenericCollectionTypeHandler(); handler.RegisterSupportedTypesWith(delegate(Type type) { RegisterGenericTypeHandler(type, handler); }); #if NET_3_5 && ! CF _config.Reflector().RegisterCollection(new GenericCollectionTypePredicate(typeof(HashSet<>))); #endif Type[] dictionaryTypes = new Type[] { typeof(ActivatableDictionary<,>), typeof(Dictionary<,>), #if !SILVERLIGHT typeof(SortedList<,>), #if !CF typeof(SortedDictionary<,>), #endif #endif }; _config.RegisterTypeHandler(new GenericTypeHandlerPredicate(dictionaryTypes), new MapTypeHandler()); } private void RegisterGenericTypeHandler(Type genericTypeDefinition, ITypeHandler4 handler) { _config.RegisterTypeHandler(new GenericTypeHandlerPredicate(genericTypeDefinition), handler); } internal class GenericTypeHandlerPredicate : ITypeHandlerPredicate { private readonly Type[] _genericTypes; internal GenericTypeHandlerPredicate(params Type[] genericType) { _genericTypes = genericType; } public bool Match(IReflectClass classReflector) { Type type = NetReflector.ToNative(classReflector); if (type == null) { return false; } if (!type.IsGenericType) { return false; } return ((IList) _genericTypes).Contains(type.GetGenericTypeDefinition()); } } private void RegisterSystemArrayTypeHandler() { _config.RegisterTypeHandler(new SystemArrayPredicate(), new SystemArrayTypeHandler()); } internal class GenericCollectionTypePredicate : IReflectClassPredicate { private readonly Type _type; internal GenericCollectionTypePredicate(Type t) { _type = t; } public bool Match(IReflectClass classReflector) { Type type = NetReflector.ToNative(classReflector); if (type == null) { return false; } if (!type.IsGenericType) { return false; } return _type == type.GetGenericTypeDefinition(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/ComparerAdaptor.cs0000644000175000017500000000104211700531646031560 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; using System.Text; namespace Db4objects.Db4o.Internal { class ComparerAdaptor : Db4objects.Db4o.Query.IQueryComparator { private System.Collections.IComparer _comparer; public ComparerAdaptor(System.Collections.IComparer comparer) { _comparer = comparer; } public int Compare(object first, object second) { return _comparer.Compare(first, second); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Platform4.cs0000644000175000017500000005441011700531646030354 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.IO; using Db4objects.Db4o.Config; using Db4objects.Db4o.Config.Attributes; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Query; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Query; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; using Db4objects.Db4o.Reflect.Net; using Db4objects.Db4o.Typehandlers; using Sharpen.IO; namespace Db4objects.Db4o.Internal { /// public class Platform4 { private static readonly LegacyDb4oAssemblyNameMapper _assemlbyNameMapper = new LegacyDb4oAssemblyNameMapper(); private static List _containersToBeShutdown; private static readonly object _shutdownStreamsLock = new object(); public static object[] CollectionToArray(ObjectContainerBase stream, object obj) { Collection4 col = FlattenCollection(stream, obj); object[] ret = new object[col.Size()]; col.ToArray(ret); return ret; } internal static void AddShutDownHook(ObjectContainerBase container) { lock (_shutdownStreamsLock) { if (_containersToBeShutdown == null) { _containersToBeShutdown = new List(); #if !CF && !SILVERLIGHT AppDomain.CurrentDomain.ProcessExit += OnShutDown; AppDomain.CurrentDomain.DomainUnload += OnShutDown; #endif } _containersToBeShutdown.Add(container); } } internal static byte[] Serialize(Object obj) { throw new NotSupportedException(); } internal static Object Deserialize(byte[] bytes) { throw new NotSupportedException(); } internal static bool CanSetAccessible() { return true; } internal static IReflector CreateReflector(Object config) { #if USE_FAST_REFLECTOR && !CF && !SILVERLIGHT return new Db4objects.Db4o.Internal.Reflect.FastNetReflector(); #else return new NetReflector(); #endif } public static IReflector ReflectorForType(Type typeInstance) { #if USE_FAST_REFLECTOR && !CF && !SILVERLIGHT return new Db4objects.Db4o.Internal.Reflect.FastNetReflector(); #else return new NetReflector(); #endif } internal static Object CreateReferenceQueue() { return new WeakReferenceHandlerQueue(); } public static Object CreateWeakReference(Object obj) { return new WeakReference(obj, false); } internal static Object CreateActiveObjectReference(Object referenceQueue, Object yapObject, Object obj) { return new WeakReferenceHandler(referenceQueue, yapObject, obj); } internal static long DoubleToLong(double a_double) { #if CF || SILVERLIGHT byte[] bytes = BitConverter.GetBytes(a_double); return BitConverter.ToInt64(bytes, 0); #else return BitConverter.DoubleToInt64Bits(a_double); #endif } internal static QConEvaluation EvaluationCreate(Transaction a_trans, Object example) { if (example is IEvaluation || example is EvaluationDelegate) { return new QConEvaluation(a_trans, example); } return null; } internal static void EvaluationEvaluate(Object a_evaluation, ICandidate a_candidate) { IEvaluation eval = a_evaluation as IEvaluation; if (eval != null) { eval.Evaluate(a_candidate); } else { // use starting _ for PascalCase conversion purposes EvaluationDelegate _ed = a_evaluation as EvaluationDelegate; if (_ed != null) { _ed(a_candidate); } } } internal static Config4Class ExtendConfiguration(IReflectClass clazz, IConfiguration config, Config4Class classConfig) { Type t = GetNetType(clazz); if (t == null) { return classConfig; } ConfigurationIntrospector a = new ConfigurationIntrospector(t, classConfig, config); a.Apply(); return a.ClassConfiguration; } internal static Collection4 FlattenCollection(ObjectContainerBase stream, Object obj) { Collection4 collection41 = new Collection4(); FlattenCollection1(stream, obj, collection41); return collection41; } internal static void FlattenCollection1(ObjectContainerBase stream, Object obj, Collection4 collection4) { Array arr = obj as Array; if (arr != null) { IReflectArray reflectArray = stream.Reflector().Array(); Object[] flat = new Object[arr.Length]; reflectArray.Flatten(obj, reflectArray.Dimensions(obj), 0, flat, 0); for (int i = 0; i < flat.Length; i++) { FlattenCollection1(stream, flat[i], collection4); } } else { // If obj implements IEnumerable, add all elements to collection4 IEnumerator enumerator = GetCollectionEnumerator(obj, true); // Add elements to collection if conversion was succesful if (enumerator != null) { if (enumerator is IDictionaryEnumerator) { IDictionaryEnumerator dictEnumerator = enumerator as IDictionaryEnumerator; while (enumerator.MoveNext()) { FlattenCollection1(stream, dictEnumerator.Key, collection4); } } else { while (enumerator.MoveNext()) { // recursive call to flatten Collections in Collections FlattenCollection1(stream, enumerator.Current, collection4); } } } else { // If obj is not a Collection, it still needs to be collected. collection4.Add(obj); } } } internal static void ForEachCollectionElement(Object obj, IVisitor4 visitor) { IEnumerator enumerator = GetCollectionEnumerator(obj, false); if (enumerator != null) { // If obj is a map (IDictionary in .NET speak) call Visit() with the key // otherwise use the element itself if (enumerator is IDictionaryEnumerator) { IDictionaryEnumerator dictEnumerator = enumerator as IDictionaryEnumerator; while (enumerator.MoveNext()) { visitor.Visit(dictEnumerator.Key); } } else { while (enumerator.MoveNext()) { visitor.Visit(enumerator.Current); } } } } internal static String Format(DateTime date, bool showSeconds) { String fmt = "yyyy-MM-dd"; if (showSeconds) { fmt += " HH:mm:ss"; } return date.ToString(fmt); } internal static IEnumerator GetCollectionEnumerator(object obj, bool allowArray) { IEnumerable enumerable = obj as IEnumerable; if (enumerable == null) return null; if (obj is string) return null; if (!allowArray && obj is Array) return null; return enumerable.GetEnumerator(); } internal static void GetDefaultConfiguration(Config4Impl config) { if (IsCompact()) { config.SingleThreadedClient(true); } Translate(config, typeof(Delegate), new TNull()); Translate(config, typeof(Type), new TType()); // TODO: unnecessary? Translate(config, typeof(Type).GetType(), new TType()); #if !CF && !SILVERLIGHT if (IsMono()) { Translate(config, new Exception(), new TSerializable()); } #endif #if !SILVERLIGHT Translate(config, new ArrayList(), new TList()); Translate(config, new Hashtable(), new TDictionary()); Translate(config, new Queue(), new TQueue()); Translate(config, new Stack(), new TStack()); #endif Translate(config, CultureInfo.InvariantCulture, new TCultureInfo()); if (!IsCompact()) { Translate(config, "System.Collections.SortedList, mscorlib", new TDictionary()); } new TypeHandlerConfigurationDotNet(config).Apply(); config.ObjectClass(typeof (ActivatableBase)).Indexed(false); } public static bool IsCompact() { #if CF || SILVERLIGHT return true; #else return false; #endif } internal static bool IsMono() { return null != Type.GetType("System.MonoType, mscorlib"); } public static Object GetTypeForClass(Object obj) { return obj; } internal static Object GetYapRefObject(Object obj) { WeakReferenceHandler refHandler = obj as WeakReferenceHandler; if (refHandler != null) { return refHandler.Get(); } return obj; } internal static bool HasCollections() { return true; } public static bool NeedsLockFileThread() { return false; } public static bool HasWeakReferences() { return true; } internal static bool IgnoreAsConstraint(Object obj) { Type t = obj.GetType(); if (t.IsEnum) { if (System.Convert.ToInt32(obj) == 0) { return true; } } return false; } internal static bool IsCollectionTranslator(Config4Class config4class) { if (config4class != null) { IObjectTranslator ot = config4class.GetTranslator(); if (ot != null) { #if SILVERLIGHT return false; #else return ot is TList || ot is TDictionary || ot is TQueue || ot is TStack; #endif } } return false; } public static bool IsConnected(Sharpen.Net.Socket socket) { if (socket == null) { return false; } return socket.IsConnected(); } internal static bool IsStruct(IReflectClass claxx) { if (claxx == null) { return false; } System.Type netClass = GetNetType(claxx); if (netClass == null) { return false; } return netClass.IsValueType; } internal static void KillYapRef(Object obj) { WeakReferenceHandler yr = obj as WeakReferenceHandler; if (yr != null) { yr.ObjectReference = null; } } internal static double LongToDouble(long l) { #if CF || SILVERLIGHT byte[] bytes = BitConverter.GetBytes(l); return BitConverter.ToDouble(bytes, 0); #else return BitConverter.Int64BitsToDouble(l); #endif } internal static void LockFile(string path, object file) { #if !CF && !SILVERLIGHT try { FileStream stream = ((RandomAccessFile) file).Stream; stream.Lock(0, 1); } catch (IOException x) { throw new DatabaseFileLockedException(path,x); } #endif } internal static void UnlockFile(string path, object file) { // do nothing. C# RAF is unlocked automatically upon closing } internal static void MarkTransient(String marker) { NetField.MarkTransient(marker); } internal static bool CallConstructor() { return false; } internal static void PollReferenceQueue(Object container, Object referenceQueue) { ((WeakReferenceHandlerQueue)referenceQueue).Poll((ObjectContainerBase)container); } public static void RegisterCollections(GenericReflector reflector) { // reflector.RegisterCollectionUpdateDepth( // typeof(IDictionary), // 3); } internal static void RemoveShutDownHook(ObjectContainerBase container) { lock (_shutdownStreamsLock) { if (_containersToBeShutdown != null) { _containersToBeShutdown.Remove(container); } } } public static void SetAccessible(Object obj) { // do nothing } private static void OnShutDown(object sender, EventArgs args) { lock (_shutdownStreamsLock) { foreach (ObjectContainerBase container in _containersToBeShutdown.ToArray()) { container.ShutdownHook(); // this will remove the stream for the list } } } public static bool StoreStaticFieldValues(IReflector reflector, IReflectClass clazz) { return false; } private static void Translate(IConfiguration config, object obj, IObjectTranslator translator) { config.ObjectClass(obj).Translate(translator); } public static byte[] UpdateClassName(byte[] nameBytes) { return _assemlbyNameMapper.MappedNameFor(nameBytes); } public static Object WeakReferenceTarget(Object weakRef) { WeakReference wr = weakRef as WeakReference; if (wr != null) { return wr.Target; } return weakRef; } internal static object WrapEvaluation(object evaluation) { #if CF || SILVERLIGHT // FIXME: How to better support EvaluationDelegate on the CompactFramework? return evaluation; #else return (evaluation is EvaluationDelegate) ? new EvaluationDelegateWrapper((EvaluationDelegate)evaluation) : evaluation; #endif } public static bool IsTransient(IReflectClass clazz) { Type type = GetNetType(clazz); if (null == type) return false; return IsTransient(type); } public static bool IsTransient(Type type) { return type.IsPointer || type.IsSubclassOf(typeof(Delegate)) #if CF || SILVERLIGHT ; #else || type == typeof(System.Reflection.Pointer); #endif } private static Type GetNetType(IReflectClass clazz) { if (null == clazz) { return null; } NetClass netClass = clazz as NetClass; if (null != netClass) { return netClass.GetNetType(); } IReflectClass claxx = clazz.GetDelegate(); if (claxx == clazz) { return null; } return GetNetType(claxx); } public static NetTypeHandler[] Types(IReflector reflector) { return new NetTypeHandler[] { new SByteHandler(), new DecimalHandler(), new UIntHandler(), new ULongHandler(), new UShortHandler(), }; } public static bool IsSimple(Type a_class) { for (int i1 = 0; i1 < SIMPLE_CLASSES.Length; i1++) { if (a_class == SIMPLE_CLASSES[i1]) { return true; } } return false; } private static Type[] SIMPLE_CLASSES = { typeof(Int32), typeof(Int64), typeof(Single), typeof(Boolean), typeof(Double), typeof(Byte), typeof(Char), typeof(Int16), typeof(String), }; public static DateTime Now() { return DateTime.Now; } internal static bool IsJavaEnum(IReflector genericReflector, IReflectClass iReflectClass) { return false; } internal static bool IsEnum(IReflector genericReflector, IReflectClass iReflectClass) { Type type = GetNetType(iReflectClass); if(type == null) { return false; } return type.IsEnum; } public static bool UseNativeSerialization() { return false; } public static void RegisterPlatformHandlers(ObjectContainerBase container) { EnumTypeHandler enumTypeHandler = new EnumTypeHandler(); container.ConfigImpl.RegisterTypeHandler(new EnumTypeHandlerPredicate(), enumTypeHandler); container.Handlers.RegisterHandlerVersion(enumTypeHandler, 4, new StandardReferenceTypeHandler()); container.Handlers.RegisterHandlerVersion(enumTypeHandler, 0, new StandardReferenceTypeHandler0()); GuidTypeHandler guidTypeHandler = new GuidTypeHandler(); container.ConfigImpl.RegisterTypeHandler(new SingleClassTypeHandlerPredicate(typeof(Guid)), guidTypeHandler); container.Handlers.RegisterHandlerVersion(guidTypeHandler, 8, new StandardReferenceTypeHandler()); DateTimeHandler dateTimeHandler = new DateTimeHandler(); container.Handlers.RegisterNetTypeHandler(dateTimeHandler); container.Handlers.RegisterHandlerVersion(dateTimeHandler, 6, new DateTimeHandler6()); #if !CF DateTimeOffsetTypeHandler dateTimeOffsetHandler = new DateTimeOffsetTypeHandler(); container.ConfigImpl.RegisterTypeHandler(new SingleClassTypeHandlerPredicate(typeof(DateTimeOffset)), dateTimeOffsetHandler); container.Handlers.RegisterHandlerVersion(dateTimeOffsetHandler, 9, new StandardReferenceTypeHandler()); #endif } public static Type[] PrimitiveTypes() { return PRIMITIVE_TYPES; } public static object NullValue(Type type) { if(_nullValues == null) { InitNullValues(); } return _nullValues.Get(type); } private static void InitNullValues() { _nullValues = new Hashtable4(); _nullValues.Put(typeof(int), 0); _nullValues.Put(typeof(uint), (uint)0); _nullValues.Put(typeof(byte), (byte)0); _nullValues.Put(typeof(short), (short)0); _nullValues.Put(typeof(float), (float)0); _nullValues.Put(typeof(double), (double)0); _nullValues.Put(typeof(ulong), (ulong)0); _nullValues.Put(typeof(long), (long)0); _nullValues.Put(typeof(bool), false); _nullValues.Put(typeof(char), (char)0); _nullValues.Put(typeof(sbyte), (sbyte)0); _nullValues.Put(typeof(decimal), (decimal)0); _nullValues.Put(typeof(ushort), (ushort)0); _nullValues.Put(typeof(DateTime), DateTime.MinValue); } private static Hashtable4 _nullValues; public static Type NullableTypeFor(Type primitiveType) { if(_primitive2Wrapper == null) InitPrimitive2Wrapper(); Type wrapperClazz = (Type)_primitive2Wrapper.Get(primitiveType); if(wrapperClazz==null) throw new NotImplementedException(); return wrapperClazz; } private static void InitPrimitive2Wrapper() { _primitive2Wrapper = new Hashtable4(); foreach (Type type in PRIMITIVE_TYPES) { _primitive2Wrapper.Put(type, ConcreteNullableTypeFor(type)); } } private static Type ConcreteNullableTypeFor(Type type) { return typeof (Nullable<>).MakeGenericType(type); } private static Hashtable4 _primitive2Wrapper; private static readonly Type[] PRIMITIVE_TYPES = new Type[] { typeof(int), typeof(uint), typeof(byte), typeof(short), typeof(float), typeof(double), typeof(ulong), typeof(long), typeof(bool), typeof(char), typeof(sbyte), typeof(decimal), typeof(ushort), typeof(DateTime), }; public static void ThrowUncheckedException(Exception exc) { throw exc; } public static sbyte ToSByte(byte b) { return (sbyte)b; } } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/ObjectContainerSession.cs0000644000175000017500000000443011700531646033116 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2008 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Query; using Db4objects.Db4o.Internal.Query.Result; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal { /// public partial class ObjectContainerSession { void System.IDisposable.Dispose() { Close(); } public IObjectSet Query(Db4objects.Db4o.Query.Predicate match, System.Collections.IComparer comparer) { return _server.Query(_transaction, match, new ComparerAdaptor(comparer)); } public System.Collections.Generic.IList Query(Predicate match) { return _server.Query(_transaction, match); } public System.Collections.Generic.IList Query(Predicate match, System.Collections.Generic.IComparer comparer) { return _server.Query(_transaction, match, comparer); } public System.Collections.Generic.IList Query(Predicate match, System.Comparison comparison) { return _server.Query(_transaction, match, comparison); } public System.Collections.Generic.IList Query(System.Type extent) { return _server.Query(_transaction, extent, null); } public System.Collections.Generic.IList Query(System.Type extent, System.Collections.Generic.IComparer comparer) { return _server.Query(_transaction, extent, comparer); } public System.Collections.Generic.IList Query() { return Query(typeof(Extent)); } public System.Collections.Generic.IList Query(System.Collections.Generic.IComparer comparer) { return Query(typeof(Extent), comparer); } public void WithEnvironment(Action4 action) { _server.WithEnvironment(new RunnableAction(action)); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Config4Impl.cs0000644000175000017500000000145311700531646030616 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Internal { public partial class Config4Impl { private static ILegacyClientServerFactory DefaultClientServerFactory() { Assembly csAssembly = Assembly.Load(ClientServerAssemblyName()); return (ILegacyClientServerFactory) Activator.CreateInstance(csAssembly.GetType("Db4objects.Db4o.CS.Internal.Config.LegacyClientServerFactoryImpl")); } private static string ClientServerAssemblyName() { Assembly db4oAssembly = typeof(IObjectContainer).Assembly; string db4oAssemblySimpleName = db4oAssembly.GetName().Name; return db4oAssembly.FullName.Replace(db4oAssemblySimpleName, "Db4objects.Db4o.CS"); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/TagAttribute.cs0000644000175000017500000000070411700531646031100 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Internal { [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] public class TagAttribute : Attribute { public TagAttribute(string tag) { this.tag = tag; } public string Tag { get { return tag; } } private string tag; } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Reflect/0000755000175000017500000000000011700531646027535 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Reflect/FastNetReflector.cs0000644000175000017500000000345611700531646033306 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2008 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal.Reflect.Emitters; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Net; namespace Db4objects.Db4o.Internal.Reflect { #if !CF public class FastNetReflector : NetReflector { override protected IReflectClass CreateClass(Type forType) { return new FastNetClass(Parent(), this, forType); } public override object DeepClone(object obj) { return new FastNetReflector(); } } class FastNetClass : NetClass { public FastNetClass(IReflector reflector, NetReflector netReflector, Type clazz) : base(reflector, netReflector, clazz) { } protected override IReflectField CreateField(FieldInfo field) { return new FastNetField(_reflector, field); } } class FastNetField : NetField { private Getter _getter; private Setter _setter; public FastNetField(IReflector reflector, FieldInfo field) : base(reflector, field) { } public override object Get(object onObject) { if (null == _getter) _getter = AccessorFactory.GetterFor(_field); try { return _getter(onObject); } catch (FieldAccessException) { _getter = _field.GetValue; return _getter(onObject); } catch (Exception e) { throw new Db4oException(e); } } public override void Set(object onObject, object attribute) { if (null == _setter) _setter = AccessorFactory.SetterFor(_field); try { _setter(onObject, attribute); } catch (FieldAccessException) { _setter = _field.SetValue; _setter(onObject, attribute); } catch (Exception e) { throw new Db4oException(e); } } } #endif } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Reflect/Emitters/0000755000175000017500000000000011700531646031331 5ustar00meebeymeebey00000000000000AccessorFactory.cs0000644000175000017500000000276111700531646034701 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Reflect/Emittersusing System; using System.Collections.Generic; using System.Reflection; namespace Db4objects.Db4o.Internal.Reflect.Emitters { #if !CF public delegate void Setter(object o, object value); public delegate object Getter(object o); public static class AccessorFactory { private static readonly Dictionary _getters = new Dictionary(); private static readonly Dictionary _setters = new Dictionary(); public static Setter SetterFor(FieldInfo field) { return Produce(_setters, field, EmitSetter); } public static Getter GetterFor(FieldInfo field) { return Produce(_getters, field, EmitGetter); } private delegate TEmitter Producer(FieldInfo field); private static TEmitter Produce(Dictionary cache, FieldInfo field, Producer producer) { TEmitter emitter; lock (cache) { if (!cache.TryGetValue(field, out emitter)) { emitter = producer(field); cache[field] = emitter; } } return emitter; } private static Setter EmitSetter(FieldInfo field) { try { return new SetFieldEmitter(field).Emit(); } catch { return delegate { }; } } private static Getter EmitGetter(FieldInfo field) { try { return new GetFieldEmitter(field).Emit(); } catch { return delegate { return null; }; } } } #endif } SetFieldEmitter.cs0000644000175000017500000000312511700531646034633 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Reflect/Emitters/* Copyright (C) 2004 - 2008 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; #if !CF using System.Reflection.Emit; #endif namespace Db4objects.Db4o.Internal.Reflect.Emitters { #if !CF class SetFieldEmitter : Emitter { public SetFieldEmitter(FieldInfo field) : base(field, typeof(void), new Type[] { typeof(object), typeof(object) }) { } public Setter Emit() { EmitMethodBody(); return (Setter) CreateDelegate(); } private void EmitMethodBody() { if (_field.IsStatic) { EmitLoadValue(); _il.Emit(OpCodes.Stsfld, _field); } else { EmitLoadTargetObject(_field.DeclaringType); EmitLoadValue(); _il.Emit(OpCodes.Stfld, _field); } _il.Emit(OpCodes.Ret); } private void EmitLoadValue() { if (_field.FieldType.IsValueType) { EmitLoadValueType(); } else { EmitLoadReferenceType(); } } private void EmitLoadReferenceType() { _il.Emit(OpCodes.Ldarg_1); _il.Emit(OpCodes.Castclass, _field.FieldType); } private void EmitLoadValueType() { Type fieldType = _field.FieldType; _il.Emit(OpCodes.Ldarg_1); Label nonNull = _il.DefineLabel(); _il.Emit(OpCodes.Brtrue_S, nonNull); _il.DeclareLocal(fieldType); _il.Emit(OpCodes.Ldloc_0); Label end = _il.DefineLabel(); _il.Emit(OpCodes.Br_S, end); _il.MarkLabel(nonNull); _il.Emit(OpCodes.Ldarg_1); _il.Emit(OpCodes.Unbox, fieldType); _il.Emit(OpCodes.Ldobj, fieldType); _il.MarkLabel(end); } } #endif } GetFieldEmitter.cs0000644000175000017500000000203011700531646034611 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Reflect/Emitters/* Copyright (C) 2004 - 2008 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; #if !CF using System.Reflection.Emit; #endif using System.Runtime.CompilerServices; namespace Db4objects.Db4o.Internal.Reflect.Emitters { #if !CF class GetFieldEmitter : Emitter { public GetFieldEmitter(FieldInfo field) : base(field, typeof(object), new Type[] { typeof(object) }) { } public Getter Emit() { EmitMethodBody(); return (Getter)CreateDelegate (); } private void EmitMethodBody() { if (_field.IsStatic) { // make sure type is initialized before // accessing any static fields RuntimeHelpers.RunClassConstructor(_field.DeclaringType.TypeHandle); _il.Emit(OpCodes.Ldsfld, _field); } else { EmitLoadTargetObject(_field.DeclaringType); _il.Emit(OpCodes.Ldfld, _field); } EmitReturn(); } protected void EmitReturn() { BoxIfNeeded(_field.FieldType); _il.Emit(OpCodes.Ret); } } #endif } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Internal/Reflect/Emitters/Emitter.cs0000644000175000017500000000226611700531646033277 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2008 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; #if !CF using System.Reflection.Emit; #endif namespace Db4objects.Db4o.Internal.Reflect.Emitters { #if !CF internal class Emitter { private readonly DynamicMethod _dynamicMethod; protected readonly FieldInfo _field; protected readonly ILGenerator _il; public Emitter(FieldInfo field, Type returnType, Type[] paramTypes) { _field = field; _dynamicMethod = new DynamicMethod(_field.DeclaringType.Name + "$" + _field.Name, returnType, paramTypes, _field.DeclaringType); _il = _dynamicMethod.GetILGenerator(); } protected void BoxIfNeeded(Type type) { if (!type.IsValueType) return; _il.Emit(OpCodes.Box, type); } protected void EmitLoadTargetObject(Type expectedType) { _il.Emit(OpCodes.Ldarg_0); // target object is the first argument if (expectedType.IsValueType) { _il.Emit(OpCodes.Unbox, expectedType); } else { _il.Emit(OpCodes.Castclass, expectedType); } } protected Delegate CreateDelegate() { return _dynamicMethod.CreateDelegate(typeof(T)); } } #endif }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Dynamic.cs0000644000175000017500000000240311700531646026307 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; namespace Db4objects.Db4o { /// public class Dynamic { private const BindingFlags AllMembers = BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public; public static object GetProperty(object obj, string prop){ if(obj != null){ Type type = TypeForObject(obj); try { PropertyInfo pi = type.GetProperty(prop, AllMembers); return pi.GetValue(obj,null); } catch { } } return null; } public static void SetProperty(object obj, string prop, object val){ if(obj != null){ Type type = TypeForObject(obj); try { PropertyInfo pi = type.GetProperty(prop, AllMembers); pi.SetValue(obj, val, null); } catch { } } } private static Type TypeForObject(object obj){ Type type = obj as Type; if(type != null){ return type; } return obj.GetType(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/0000755000175000017500000000000011700531646025602 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/TQueue.cs0000644000175000017500000000170011700531646027337 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ #if !SILVERLIGHT using System; using System.Collections; namespace Db4objects.Db4o.Config { /// public class TQueue : IObjectTranslator { public void OnActivate(IObjectContainer objectContainer, object obj, object members) { Queue queue = (Queue) obj; queue.Clear(); if (members != null) { object[] elements = (object[])members; for (int i = 0; i < elements.Length; i++) { queue.Enqueue(elements[i]); } } } public Object OnStore(IObjectContainer objectContainer, object obj) { Queue queue = (Queue)obj; int count = queue.Count; object[] elements = new object[count]; IEnumerator e = queue.GetEnumerator(); e.Reset(); for (int i = 0; i < count; i++) { e.MoveNext(); elements[i] = e.Current; } return elements; } public System.Type StoredClass() { return typeof(object[]); } } } #endifsmuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/TClass.cs0000644000175000017500000000023711700531646027324 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using Sharpen.Lang; using Db4objects.Db4o; namespace Db4objects.Db4o.Config { }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/TTransient.cs0000644000175000017500000000131511700531646030224 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using Sharpen.Lang; using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// public class TTransient : IObjectConstructor { public void OnActivate(IObjectContainer objectContainer, object obj, object members) { } public object OnStore(IObjectContainer objectContainer, object obj) { return null; } public System.Type StoredClass() { return typeof(object); } public object OnInstantiate(IObjectContainer objectContainer, object storedObject) { return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/TList.cs0000644000175000017500000000202511700531646027167 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Sharpen.Lang; using Db4objects.Db4o; namespace Db4objects.Db4o.Config { /// public class TList : IObjectTranslator { public void OnActivate(IObjectContainer objectContainer, object obj, object members){ IList list = (IList)obj; list.Clear(); if(members != null){ object[] elements = (object[]) members; for(int i = 0; i < elements.Length; i++){ list.Add(elements[i]); } } } public Object OnStore(IObjectContainer objectContainer, object obj){ IList list = (IList)obj; object[] elements = new object[list.Count]; for(int i = 0; i < list.Count; i++){ elements[i] = list[i]; } return elements; } public System.Type StoredClass(){ return typeof(object[]); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/TStack.cs0000644000175000017500000000217211700531646027324 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ #if !SILVERLIGHT using System; using System.Collections; namespace Db4objects.Db4o.Config { /// public class TStack : IObjectTranslator { public void OnActivate(IObjectContainer objectContainer, object obj, object members){ Stack stack = (Stack)obj; if(members != null){ object[] elements = (object[]) members; for(int i = elements.Length - 1; i >= 0 ; i--){ stack.Push(elements[i]); } } } public Object OnStore(IObjectContainer objectContainer, object obj){ Stack stack = (Stack)obj; int count = stack.Count; object[] elements = new object[count]; IEnumerator e = stack.GetEnumerator(); e.Reset(); for(int i = 0; i < count; i++){ e.MoveNext(); elements[i] = e.Current; } return elements; } public System.Type StoredClass(){ return typeof(object[]); } } } #endifsmuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/TCultureInfo.cs0000644000175000017500000000132011700531646030510 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.Globalization; using Sharpen.Lang; using Db4objects.Db4o; namespace Db4objects.Db4o.Config { /// public class TCultureInfo : IObjectConstructor { public Object OnInstantiate(IObjectContainer store, object stored) { return new CultureInfo((string)stored); } public Object OnStore(IObjectContainer store, object obj) { CultureInfo culture = (CultureInfo)obj; return culture.Name; } public void OnActivate(IObjectContainer container, object applicationObject, object storedObject) { } public Type StoredClass() { return typeof(string); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/TDictionary.cs0000644000175000017500000000255311700531646030367 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Sharpen.Lang; using Db4objects.Db4o; namespace Db4objects.Db4o.Config { /// public class TDictionary : IObjectTranslator { public void OnActivate(IObjectContainer objectContainer, object obj, object members){ IDictionary dict = (IDictionary)obj; dict.Clear(); if(members != null){ Entry[] entries = (Entry[]) members; for(int i = 0; i < entries.Length; i++){ if(entries[i].key != null && entries[i].value != null){ dict[entries[i].key] = entries[i].value; } } } } public Object OnStore(IObjectContainer objectContainer, object obj){ IDictionary dict = (IDictionary)obj; Entry[] entries = new Entry[dict.Count]; IDictionaryEnumerator e = dict.GetEnumerator(); e.Reset(); for(int i = 0; i < dict.Count; i++){ e.MoveNext(); entries[i] = new Entry(); entries[i].key = e.Key; entries[i].value = e.Value; } return entries; } public System.Type StoredClass(){ return typeof(Entry[]); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/TType.cs0000644000175000017500000000201611700531646027175 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ using System; using Sharpen.Lang; using Db4objects.Db4o; namespace Db4objects.Db4o.Config { /// public class TType : IObjectConstructor { public void OnActivate(IObjectContainer objectContainer, object obj, object members) { } public Object OnInstantiate(IObjectContainer objectContainer, object obj) { if (obj != null) { try { return TypeReference.FromString((string) obj).Resolve(); } catch { } } return null; } public Object OnStore(IObjectContainer objectContainer, object obj) { if (obj == null) return null; return TypeReference.FromType((Type)obj).GetUnversionedName(); } public Type StoredClass() { return typeof(string); } } }smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/Attributes/0000755000175000017500000000000011700531646027730 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/Attributes/IDb4oAttribute.cs0000644000175000017500000000036011700531646033043 0ustar00meebeymeebey00000000000000/* Copyright (C) 2006 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Config.Attributes { interface IDb4oAttribute { void Apply (object subject, ConfigurationIntrospector introspector); } } ConfigurationIntrospector.cs0000644000175000017500000000267611700531646035436 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/Attributes/* Copyright (C) 2006 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Config.Attributes { class ConfigurationIntrospector { private readonly Type _type; private Config4Class _classConfig; private readonly IConfiguration _config; public ConfigurationIntrospector(Type type, Config4Class classConfig, IConfiguration config) { if (null == type) throw new ArgumentNullException("type"); if (null == config) throw new ArgumentNullException("config"); _type = type; _classConfig = classConfig; _config = config; } public Type Type { get { return _type; } } public Config4Class ClassConfiguration { get { if (null == _classConfig) { _classConfig = (Config4Class)_config.ObjectClass(_type); } return _classConfig; } } public IConfiguration IConfiguration { get { return _config; } } public void Apply() { Apply(_type); foreach (FieldInfo field in _type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)) Apply(field); } private void Apply(ICustomAttributeProvider provider) { foreach (object o in provider.GetCustomAttributes(false)) { IDb4oAttribute attr = o as IDb4oAttribute; if (null == attr) continue; attr.Apply(provider, this); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Config/Attributes/IndexedAttribute.cs0000644000175000017500000000074211700531646033526 0ustar00meebeymeebey00000000000000/* Copyright (C) 2006 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; namespace Db4objects.Db4o.Config.Attributes { [AttributeUsage(AttributeTargets.Field)] public class IndexedAttribute : Attribute, IDb4oAttribute { void IDb4oAttribute.Apply(object subject, ConfigurationIntrospector introspector) { FieldInfo field = (FieldInfo)subject; introspector.ClassConfiguration.ObjectField(field.Name).Indexed(true); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/IObjectContainer.cs0000644000175000017500000005645311700531646030123 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 1010 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Qlin; using Db4objects.Db4o.Query; namespace Db4objects.Db4o { /// the interface to a db4o database, stand-alone or client/server. /// /// the interface to a db4o database, stand-alone or client/server. ///

The IObjectContainer interface provides methods /// to store, query and delete objects and to commit and rollback /// transactions.

/// An IObjectContainer can either represent a stand-alone database /// or a connection to a /// db4o server /// . ///

An IObjectContainer also represents a transaction. All work /// with db4o always is transactional. Both /// Db4objects.Db4o.IObjectContainer.Commit /// and /// Db4objects.Db4o.IObjectContainer.Rollback /// start new transactions immediately. For working /// against the same database with multiple transactions, open a db4o server /// with /// Db4objects.Db4o.Db4o.OpenServer /// and /// connect locally /// or /// over TCP /// . ///
/// IExtObjectContainer for extended functionality. /// public interface IObjectContainer : System.IDisposable, ISodaQueryFactory { /// activates all members on a stored object to the specified depth. /// /// activates all members on a stored object to the specified depth. ///

/// See /// "Why activation" /// for an explanation why activation is necessary.

/// The activate method activates a graph of persistent objects in memory. /// Only deactivated objects in the graph will be touched: their /// fields will be loaded from the database. /// The activate methods starts from a /// root object and traverses all member objects to the depth specified by the /// depth parameter. The depth parameter is the distance in "field hops" /// (object.field.field) away from the root object. The nodes at 'depth' level /// away from the root (for a depth of 3: object.member.member) will be instantiated /// but deactivated, their fields will be null. /// The activation depth of individual classes can be overruled /// with the methods /// MaximumActivationDepth() /// /// and /// MinimumActivationDepth() /// /// in the /// ObjectClass interface /// .

/// A successful call to activate triggers Activating and Activated callback methods, /// which can be used for cascaded activation.

///
/// Why activation? /// Using callbacks /// the object to be activated. /// /// the member /// depth /// to which activate is to cascade. /// void Activate(object obj, int depth); /// closes this IObjectContainer. /// /// closes this IObjectContainer. ///

A call to Close() automatically performs a /// Commit() /// . ///

Note that every session opened with Db4oFactory.OpenFile() requires one /// Close()call, even if the same filename was used multiple times.

/// Use while(!Close()){} to kill all sessions using this container.

///
/// /// success - true denotes that the last used instance of this container /// and the database file were closed. /// bool Close(); /// commits the running transaction. /// /// commits the running transaction. ///

Transactions are back-to-back. A call to commit will starts /// a new transaction immedidately. ///
void Commit(); /// deactivates a stored object by setting all members to NULL. /// /// /// deactivates a stored object by setting all members to NULL. ///
Primitive types will be set to their default values. /// Calls to this method save memory. /// The method has no effect, if the passed object is not stored in the /// IObjectContainer.

/// Deactivate() triggers Deactivating and Deactivated callbacks. ///

/// Be aware that calling this method with a depth parameter greater than /// 1 sets members on member objects to null. This may have side effects /// in other places of the application.

///
/// Using callbacks /// Why activation? /// the object to be deactivated. /// /// the member /// depth /// /// to which deactivate is to cascade. /// void Deactivate(object obj, int depth); /// deletes a stored object permanently. /// /// deletes a stored object permanently. ///

Note that this method has to be called for every single object /// individually. Delete does not recurse to object members. Simple /// and array member types are destroyed. ///

Object members of the passed object remain untouched, unless /// cascaded deletes are /// configured for the class /// or for /// one of the member fields /// . ///

The method has no effect, if /// the passed object is not stored in the IObjectContainer. ///

A subsequent call to /// Store() with the same object newly stores the object /// to the IObjectContainer.

/// Delete() triggers Deleting and Deleted callbacks, /// which can be also used for cascaded deletes.

///
/// Db4objects.Db4o.Config.IObjectClass.CascadeOnDelete /// /// Db4objects.Db4o.Config.IObjectField.CascadeOnDelete /// /// Using callbacks /// /// the object to be deleted from the /// IObjectContainer.
/// void Delete(object obj); /// returns an IObjectContainer with extended functionality. /// /// returns an IObjectContainer with extended functionality. ///

Every IObjectContainer that db4o provides can be casted to /// an IExtObjectContainer. This method is supplied for your convenience /// to work without a cast. ///

The IObjectContainer functionality is split to two interfaces /// to allow newcomers to focus on the essential methods.

///
/// this, casted to IExtObjectContainer Db4objects.Db4o.Ext.IExtObjectContainer Ext(); /// Query-By-Example interface to retrieve objects. /// /// Query-By-Example interface to retrieve objects. ///

QueryByExample() creates an /// IObjectSet /// containing /// all objects in the IObjectContainer that match the passed /// template object.

/// Calling QueryByExample(null) returns all objects stored in the /// IObjectContainer.


/// Query Evaluation ///
All non-null members of the template object are compared against /// all stored objects of the same class. /// Primitive type members are ignored if they are 0 or false respectively. ///

Arrays and all supported Collection classes are /// evaluated for containment. Differences in Length/Count/Size() are /// ignored. ///

Consult the documentation of the IConfiguration package to /// configure class-specific behaviour.


/// Returned Objects
/// The objects returned in the /// IObjectSet /// are instantiated /// and activated to the preconfigured depth of 5. The /// activation depth /// may be configured /// globally /// or /// individually for classes /// . ///

/// db4o keeps track of all instantiatied objects. Queries will return /// references to these objects instead of instantiating them a second time. ///

/// Objects newly activated by QueryByExample() can respond to the Activating callback /// method. ///

///
/// object to be used as an example to find all matching objects.

/// /// /// /// IObjectSet /// containing all found objects.

///
/// Why activation? /// Using callbacks Db4objects.Db4o.IObjectSet QueryByExample(object template); /// /// creates a new SODA /// Query /// . ///

/// Linq queries are the recommended main db4o query interface. ///

/// Use /// QueryByExample(Object template) /// for simple Query-By-Example.

///
/// a new IQuery object Db4objects.Db4o.Query.IQuery Query(); /// queries for all instances of a class. /// queries for all instances of a class. /// the class to query for. /// /// the /// Db4objects.Db4o.IObjectSet /// returned by the query. /// Db4objects.Db4o.IObjectSet Query(System.Type clazz); /// Native Query Interface. /// /// Native Query Interface. ///

Native Queries allow typesafe, compile-time checked and refactorable /// querying, following object-oriented principles. Native Queries expressions /// are written as if one or more lines of code would be run against all /// instances of a class. A Native Query expression should return true to mark /// specific instances as part of the result set. /// db4o will attempt to optimize native query expressions and execute them /// against indexes and without instantiating actual objects, where this is /// possible.

/// Example:

/// ///
/// IList <Cat> cats = db.Query <Cat> (delegate(Cat cat) {
///    return cat.Name == "Occam";
/// });
///
/// Summing up the above:
/// In order to run a Native Query, you can use the delegate notation /// with a delegate method taking the extend type as a parameter and /// returning bool. True is returned for the objects that are to be included in the result.
///

///
/// /// the /// Db4objects.Db4o.Query.Predicate /// containing the native query expression. /// /// /// the /// Db4objects.Db4o.IObjectSet /// returned by the query. /// Db4objects.Db4o.IObjectSet Query(Db4objects.Db4o.Query.Predicate predicate); /// Native Query Interface. /// /// Native Query Interface. Queries as with /// Db4objects.Db4o.IObjectContainer.Query(Predicate) /// , /// but will sort the resulting /// Db4objects.Db4o.IObjectSet /// according to the given /// Db4objects.Db4o.Query.IQueryComparator /// . /// /// /// the /// Db4objects.Db4o.Query.Predicate /// containing the native query expression. /// /// /// the /// Db4objects.Db4o.Query.IQueryComparator /// specifiying the sort order of the result /// /// /// the /// Db4objects.Db4o.IObjectSet /// returned by the query. /// Db4objects.Db4o.IObjectSet Query(Db4objects.Db4o.Query.Predicate predicate, Db4objects.Db4o.Query.IQueryComparator comparator); /// Native Query Interface. /// /// Native Query Interface. Queries as with /// Db4objects.Db4o.IObjectContainer.Query(Predicate) /// , /// but will sort the resulting /// Db4objects.Db4o.IObjectSet /// according to the given /// System.Collections.IComparer /// . /// /// /// the /// Db4objects.Db4o.Query.Predicate /// containing the native query expression. /// /// /// the /// System.Collections.IComparer /// specifiying the sort order of the result /// /// /// the /// Db4objects.Db4o.IObjectSet /// returned by the query. /// Db4objects.Db4o.IObjectSet Query(Db4objects.Db4o.Query.Predicate predicate, System.Collections.IComparer comparer); /// rolls back the running transaction. /// /// rolls back the running transaction. ///

Transactions are back-to-back. A call to rollback will starts /// a new transaction immedidately. ///

rollback will not restore modified objects in memory. They /// can be refreshed from the database by calling /// Db4objects.Db4o.Ext.IExtObjectContainer.Refresh /// /// . ///
void Rollback(); /// newly stores objects or updates stored objects. /// /// newly stores objects or updates stored objects. ///

An object not yet stored in the IObjectContainer will be /// stored when it is passed to Store(). An object already stored /// in the IObjectContainer will be updated. ///

Updates
/// - will affect all simple type object members.
/// - links to object members that are already stored will be updated.
/// - new object members will be newly stored. The algorithm traverses down /// new members, as long as further new members are found.
/// - object members that are already stored will not be updated /// themselves.
Every object member needs to be updated individually with a /// call to Store() unless a deep /// global /// or /// class-specific /// update depth was configured or cascaded updates were /// defined in the class /// or in /// one of the member fields /// . /// Depending if the passed object is newly stored or updated, Creating/Created or /// Updaing/Updated callback method is triggered. /// Callbacks /// might also be used for cascaded updates.

///
/// the object to be stored or updated. /// IExtObjectContainer#Store(object, depth) /// /// Db4objects.Db4o.Config.IConfiguration.UpdateDepth /// /// Db4objects.Db4o.Config.IObjectClass.UpdateDepth /// /// Db4objects.Db4o.Config.IObjectClass.CascadeOnUpdate /// /// Db4objects.Db4o.Config.IObjectField.CascadeOnUpdate /// /// Using callbacks void Store(object obj); /// .NET 2.0 Native Query interface. /// /// Native Query Interface. ///

Native Queries allow typesafe, compile-time checked and refactorable /// querying, following object-oriented principles. Native Queries expressions /// are written as if one or more lines of code would be run against all /// instances of a class. A Native Query expression should return true to mark /// specific instances as part of the result set. /// db4o will attempt to optimize native query expressions and execute them /// against indexes and without instantiating actual objects, where this is /// possible.

/// Example:

/// ///
/// IList <Cat> cats = db.Query <Cat> (delegate(Cat cat) {
///    return cat.Name == "Occam";
/// });
///
/// Summing up the above:
/// In order to run a Native Query, you can use the delegate notation /// with a delegate method taking the extend type as a parameter and /// returning bool. True is returned for the objects that are to be included in the result.
///

///
/// /// use an anonymous delegate that takes a single paramter and returns /// a bool value, see the syntax example above /// /// /// the /// Db4objects.Db4o.IObjectSet /// returned by the query. /// System.Collections.Generic.IList Query(System.Predicate match); /// Native Query Interface. /// /// Native Query Interface. Queries as with /// Db4objects.Db4o.IObjectContainer.Query(Predicate) /// , /// but will sort the resulting /// Db4objects.Db4o.IObjectSet /// according to the given /// System.Collections.Generic.IComparer /// . /// /// /// the /// Db4objects.Db4o.Query.Predicate /// containing the native query expression. /// /// /// the /// System.Collections.Generic.IComparer /// specifiying the sort order of the result /// /// /// the /// Db4objects.Db4o.IObjectSet /// returned by the query. /// System.Collections.Generic.IList Query(System.Predicate match, System.Collections.Generic.IComparer comparer); /// Native Query Interface. /// /// Native Query Interface. Queries as with /// Db4objects.Db4o.IObjectContainer.Query(Predicate) /// , /// but will sort the resulting /// Db4objects.Db4o.IObjectSet /// according to the given /// System.Comparison /// . /// /// /// the /// Db4objects.Db4o.Query.Predicate /// containing the native query expression. /// /// /// the /// System.Comparison /// specifiying the sort order of the result /// /// /// the /// Db4objects.Db4o.IObjectSet /// returned by the query. /// System.Collections.Generic.IList Query(System.Predicate match, System.Comparison comparison); /// /// queries for all instances of the type extent, returning /// a IList of ElementType which must be assignable from /// extent. /// System.Collections.Generic.IList Query(System.Type extent); /// /// queries for all instances of the type extent. /// System.Collections.Generic.IList Query(); /// /// queries for all instances of the type extent sorting with the specified comparer. /// System.Collections.Generic.IList Query(System.Collections.Generic.IComparer comparer); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/0000755000175000017500000000000011700531646026503 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/Coercion4.cs0000644000175000017500000000355711700531646030671 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Foundation { public class Coercion4 { public static object ToByte(object obj) { if (obj is byte) return obj; IConvertible convertible = obj as IConvertible; if (null != convertible) return convertible.ToByte(null); return Db4objects.Db4o.Foundation.No4.Instance; } public static object ToSByte(object obj) { if (obj is sbyte) return obj; IConvertible convertible = obj as IConvertible; if (null != convertible) return convertible.ToSByte(null); return Db4objects.Db4o.Foundation.No4.Instance; } public static object ToShort(object obj) { if (obj is short) return obj; IConvertible convertible = obj as IConvertible; if (null != convertible) return convertible.ToInt16(null); return Db4objects.Db4o.Foundation.No4.Instance; } public static object ToInt(object obj) { if (obj is int) return obj; IConvertible convertible = obj as IConvertible; if (null != convertible) return convertible.ToInt32(null); return Db4objects.Db4o.Foundation.No4.Instance; } public static object ToLong(object obj) { if (obj is long) return obj; IConvertible convertible = obj as IConvertible; if (null != convertible) return convertible.ToInt64(null); return Db4objects.Db4o.Foundation.No4.Instance; } public static object ToFloat(object obj) { if (obj is float) return obj; IConvertible convertible = obj as IConvertible; if (null != convertible) return convertible.ToSingle(null); return Db4objects.Db4o.Foundation.No4.Instance; } public static object ToDouble(object obj) { if (obj is double) return obj; IConvertible convertible = obj as IConvertible; if (null != convertible) return convertible.ToDouble(null); return Db4objects.Db4o.Foundation.No4.Instance; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/Iterators.cs0000644000175000017500000000245211700531646031011 0ustar00meebeymeebey00000000000000using System.Collections; using System.Collections.Generic; namespace Db4objects.Db4o.Foundation { public delegate B Function(A a); public struct Tuple { public A a; public B b; public Tuple(A a, B b) { this.a = a; this.b = b; } } public partial class Iterators { public static IEnumerator Map(System.Array array, IFunction4 function) { return Map(array.GetEnumerator(), function); } public static IEnumerable Cast(IEnumerable source) { foreach (object o in source) yield return (T) o; } public static IEnumerable> Zip(IEnumerable @as, IEnumerable bs) { return Zip(Cast(@as), Cast(bs)); } public static IEnumerable> Zip(IEnumerable @as, IEnumerable bs) { IEnumerator bsEnumerator = bs.GetEnumerator(); foreach (A a in @as) { if (!bsEnumerator.MoveNext()) { yield break; } yield return new Tuple(a, bsEnumerator.Current); } } public static IEnumerable Unique(IEnumerable enumerable) { Hashtable seen = new Hashtable(); foreach (object item in enumerable) { if (seen.ContainsKey(item)) continue; seen.Add(item, item); yield return item; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/My.cs0000644000175000017500000000040011700531646027411 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { public class My { public static TService Instance { get { return (TService)Environments.My(typeof(TService)); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/Collections/0000755000175000017500000000000011700531646030761 5ustar00meebeymeebey00000000000000CollectionInitializer.cs0000644000175000017500000001436611700531646035542 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/Collections/* Copyright (C) 2008 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Collections.Generic; #if CF using System.Reflection; #endif namespace Db4objects.Db4o.Foundation.Collections { public interface ICollectionInitializer { void Clear(); void Add(object o); void FinishAdding(); int Count(); } public sealed class CollectionInitializer { private static readonly Dictionary _initializerByType = new Dictionary(); static CollectionInitializer() { _initializerByType[typeof (ICollection<>)] = typeof (CollectionInitializerImpl<>); _initializerByType[typeof(Stack<>)] = typeof(StackInitializer<>); _initializerByType[typeof(Queue<>)] = typeof(QueueInitializer<>); #if NET_3_5 && ! CF _initializerByType[typeof (HashSet<>)] = typeof (HashSetInitializer<>); #endif } public static ICollectionInitializer For(object destination) { if (IsNonGenericList(destination)) { return new ListInitializer((IList)destination); } return InitializerFor(destination); } private static ICollectionInitializer InitializerFor(object destination) { Type destinationType = destination.GetType(); if (!destinationType.IsGenericType) { throw new ArgumentException("Unknown collection: " + destination); } Type containerType = GenericContainerTypeFor(destination); if (containerType != null) { return GetInitializer(destination, _initializerByType[containerType]); } throw new ArgumentException("Unknown collection: " + destination); } private static Type GenericContainerTypeFor(object destination) { Type containerType = destination.GetType().GetGenericTypeDefinition(); while (containerType != null && !_initializerByType.ContainsKey(containerType)) { foreach (Type interfaceType in containerType.GetInterfaces()) { if (!interfaceType.IsGenericType) { continue; } Type genericInterfaceType = interfaceType.GetGenericTypeDefinition(); if (_initializerByType.ContainsKey(genericInterfaceType)) { return genericInterfaceType; } } containerType = containerType.BaseType; } return containerType; } private static ICollectionInitializer GetInitializer(object destination, Type initializerType) { ICollectionInitializer initializer = null; Type containedElementType = ContainerElementTypeFor(destination); if (containedElementType != null) { Type genericProtocolType = initializerType.MakeGenericType(containedElementType); initializer = InstantiateInitializer(destination, genericProtocolType); } return initializer; } private static bool IsNonGenericList(object destination) { return !destination.GetType().IsGenericType && destination is IList; } private static ICollectionInitializer InstantiateInitializer(object destination, Type genericProtocolType) { #if !CF return (ICollectionInitializer) Activator.CreateInstance(genericProtocolType, destination); #else ConstructorInfo constructor = genericProtocolType.GetConstructors()[0]; return (ICollectionInitializer) constructor.Invoke(new object[] {destination}); #endif } private static Type ContainerElementTypeFor(object destination) { Type containerType = destination.GetType(); return containerType.GetGenericArguments()[0]; } private sealed class ListInitializer : ICollectionInitializer { private readonly IList _list; public ListInitializer(IList list) { _list = list; } public void Clear() { _list.Clear(); } public void Add(object o) { _list.Add(o); } public int Count() { return _list.Count; } public void FinishAdding() { } } private sealed class CollectionInitializerImpl : ICollectionInitializer { private readonly ICollection _collection; public CollectionInitializerImpl(ICollection collection) { _collection = collection; } public void Clear() { _collection.Clear(); } public int Count() { return _collection.Count; } public void Add(object o) { _collection.Add((T)o); } public void FinishAdding() { } } private sealed class StackInitializer : ICollectionInitializer { private readonly Stack _stack; private readonly Stack _tempStack; public StackInitializer(Stack stack) { _stack= stack; _tempStack = new Stack(); } public void Clear() { _tempStack.Clear(); _stack.Clear(); } public int Count() { return _stack.Count; } public void Add(object o) { _tempStack.Push((T) o); } public void FinishAdding() { foreach(T item in _tempStack) { _stack.Push(item); } _tempStack.Clear(); } } private sealed class QueueInitializer : ICollectionInitializer { private readonly Queue _queue; public QueueInitializer(Queue queue) { _queue = queue; } public void Clear() { _queue.Clear(); } public int Count() { return _queue.Count; } public void Add(object o) { _queue.Enqueue((T) o); } public void FinishAdding() { } } #if NET_3_5 && ! CF private sealed class HashSetInitializer : ICollectionInitializer { private readonly HashSet _hashSet; public HashSetInitializer(HashSet stack) { _hashSet = stack; } public void Clear() { _hashSet.Clear(); } public void Add(object o) { _hashSet.Add((T)o); } public int Count() { return _hashSet.Count; } public void FinishAdding() { } } #endif } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/Environments.cs0000644000175000017500000000174211700531646031525 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Foundation { public partial class Environments { public static string DefaultImplementationFor(Type type) { string implName = ("." + type.Name.Substring(1) + "Impl"); if (type.Namespace.IndexOf(".Internal.") > 0) return type.Namespace + implName + ", " + AssemblyNameFor(type); int lastDot = type.Namespace.LastIndexOf('.'); string typeName = type.Namespace.Substring(0, lastDot) + ".Internal." + type.Namespace.Substring(lastDot + 1) + implName; return typeName + ", " + AssemblyNameFor(type); } private static string AssemblyNameFor(Type type) { #if SILVERLIGHT string fullyQualifiedTypeName = type.AssemblyQualifiedName; int assemblyNameSeparator = fullyQualifiedTypeName.IndexOf(','); return fullyQualifiedTypeName.Substring(assemblyNameSeparator + 1); #else return type.Assembly.GetName().Name; #endif } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/IO/0000755000175000017500000000000011700531646027012 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/IO/File4.cs0000644000175000017500000000114111700531646030301 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 Versant Inc. http://www.db4o.com */ #if !SILVERLIGHT using System; using System.IO; namespace Db4objects.Db4o.Foundation.IO { public class File4 { public static void Delete(string file) { if (File.Exists(file)) { File.Delete(file); } } public static void Copy(string from, string to) { File.Copy(from, to, true); } public static long Size(string filePath) { return new System.IO.FileInfo(filePath).Length; } } } #endif smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/CRC32.cs0000644000175000017500000000254311700531646027612 0ustar00meebeymeebey00000000000000namespace Db4objects.Db4o.Foundation { public class CRC32 { private static uint[] crcTable; static CRC32() { BuildCRCTable(); } private static void BuildCRCTable() { uint Crc32Polynomial = 0xEDB88320; uint i; uint j; uint crc; crcTable = new uint[256]; for (i = 0; i <= 255; i++) { crc = i; for (j = 8; j > 0; j--) { if ((crc & 1) == 1) { crc = ((crc) >> (1 & 0x1f)) ^ Crc32Polynomial; } else { crc = crc >> (1 & 0x1f); } } crcTable[i] = crc; } } public static long CheckSum(byte[] buffer, int start, int count) { uint temp1; uint temp2; int i = start; uint crc = 0xFFFFFFFF; while (count-- != 0) { temp1 = (crc) >> (8 & 0x1f); temp2 = crcTable[(crc ^ buffer[i++]) & 0xFF]; crc = temp1 ^ temp2; } return (long)~crc & 0xFFFFFFFFL; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/SignatureGenerator.cs0000644000175000017500000000165511700531646032651 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Foundation { public sealed class SignatureGenerator { private static Random _random = new Random(); private static int _counter; public static string GenerateSignature() { string signature = ToHexString(Environment.TickCount); signature += Pad(ToHexString(_random.Next())); signature += Guid.NewGuid(); signature += ToHexString(_counter++); return signature; } private static string ToHexString(int i) { return i.ToString("X"); } private static string ToHexString(long l) { return l.ToString("X"); } private static string Pad(String str) { return (str + "XXXXXXXX").Substring(0, 8); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/RunnableAction.cs0000644000175000017500000000057111700531646031741 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using Sharpen.Lang; namespace Db4objects.Db4o.Foundation { public delegate void Action4(); public class RunnableAction : IRunnable { private readonly Action4 _action; public RunnableAction(Action4 action) { _action = action; } public void Run() { _action(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Foundation/Closures4.cs0000644000175000017500000000104211700531646030712 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2008 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { class Closures4 { public delegate object Closure(); public static IClosure4 ForDelegate(Closure @delegate) { return new Closure4OverDelegate(@delegate); } internal class Closure4OverDelegate : IClosure4 { private Closure _delegate; public Closure4OverDelegate(Closure @delegate) { _delegate = @delegate; } public object Run() { return _delegate(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Reflect/0000755000175000017500000000000011700531646025761 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Reflect/Net/0000755000175000017500000000000011700531646026507 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Reflect/Net/NetConstructor.cs0000644000175000017500000000207111700531646032032 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Reflect.Net { /// Reflection implementation for Constructor to map to .NET reflection. public class NetConstructor : Db4objects.Db4o.Reflect.Core.IReflectConstructor { private readonly Db4objects.Db4o.Reflect.IReflector reflector; private readonly System.Reflection.ConstructorInfo constructor; public NetConstructor(Db4objects.Db4o.Reflect.IReflector reflector, System.Reflection.ConstructorInfo constructor) { this.reflector = reflector; this.constructor = constructor; Db4objects.Db4o.Internal.Platform4.SetAccessible(constructor); } public virtual Db4objects.Db4o.Reflect.IReflectClass[] GetParameterTypes() { return Db4objects.Db4o.Reflect.Net.NetReflector.ToMeta(reflector, Sharpen.Runtime.GetParameterTypes(constructor)); } public virtual object NewInstance(object[] parameters) { try { return constructor.Invoke(parameters); } catch { return null; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Reflect/Net/NetReflector.cs0000644000175000017500000001053411700531646031435 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Reflect.Net { public class NetReflector : IReflector { protected IReflector _parent; private IReflectArray _array; private IReflectorConfiguration _config; public NetReflector(IReflectorConfiguration config) { _config = config; } public NetReflector() : this(new DefaultConfiguration()) { } public virtual IReflectArray Array() { if(_array == null) { _array = new NetArray(Parent()); } return _array; } public virtual object DeepClone(object obj) { return new NetReflector(_config); } public virtual IReflectClass ForClass(Type forType) { if(forType == null) { return null; } Type underlyingType = GetUnderlyingType(forType); if (underlyingType.IsPrimitive) { return CreateClass(forType); } return CreateClass(underlyingType); } protected virtual IReflectClass CreateClass(Type type) { if(type == null) { return null; } return new NetClass(Parent(), this, type); } private static Type GetUnderlyingType(Type type) { if(type == null) { return null; } Type underlyingType = Nullable.GetUnderlyingType(type); if (underlyingType != null) { return underlyingType; } return type; } public virtual IReflectClass ForName(string className) { try { Type type = ReflectPlatform.ForName(className); if (type == null) return null; return ForClass(type); } catch { } return null; } public virtual IReflectClass ForObject(object a_object) { if (a_object == null) { return null; } return Parent().ForClass(a_object.GetType()); } public virtual bool IsCollection(IReflectClass candidate) { if (candidate.IsArray()) { return false; } NetClass netClass = candidate as NetClass; if (null == netClass) { return false; } return typeof(System.Collections.ICollection).IsAssignableFrom(netClass.GetNetType()); } public virtual bool MethodCallsSupported() { return true; } public static IReflectClass[] ToMeta(IReflector reflector, Type[] clazz) { IReflectClass[] claxx = null; if (clazz != null) { claxx = new IReflectClass[clazz.Length]; for (int i = 0; i < clazz.Length; i++) { if (clazz[i] != null) { claxx[i] = reflector.ForClass(clazz[i]); } } } return claxx; } public static Type[] ToNative(IReflectClass[] claxx) { Type[] clazz = null; if (claxx != null) { clazz = new Type[claxx.Length]; for (int i = 0; i < claxx.Length; i++) { if (claxx[i] != null) { IReflectClass reflectClass = claxx[i]; clazz[i] = ToNative(reflectClass); } } } return clazz; } public static Type ToNative(IReflectClass reflectClass) { NetClass netClass = reflectClass.GetDelegate() as NetClass; if(netClass == null) { return null; } return netClass.GetNetType(); } public virtual void SetParent(IReflector reflector) { _parent = reflector; } public virtual void Configuration(IReflectorConfiguration config) { _config = config; } public virtual IReflectorConfiguration Configuration() { return _config; } public virtual object NullValue(IReflectClass clazz) { return Platform4.NullValue(ToNative(clazz)); } protected IReflector Parent() { if(_parent == null) { return this; } return _parent; } private class DefaultConfiguration : IReflectorConfiguration { public bool TestConstructors() { return false; } public bool CallConstructor(IReflectClass clazz) { return false; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Reflect/Net/NetField.cs0000644000175000017500000000577011700531646030541 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Reflect.Net { public class NetField : IReflectField { private readonly IReflector _reflector; protected readonly FieldInfo _field; private static IList _transientMarkers; public NetField(IReflector reflector, FieldInfo field) { _reflector = reflector; _field = field; } public override string ToString() { return string.Format("NetField({0})", _field); } public virtual string GetName() { return _field.Name; } public virtual IReflectClass GetFieldType() { return _reflector.ForClass(_field.FieldType); } public virtual bool IsPublic() { return _field.IsPublic; } public virtual bool IsStatic() { return _field.IsStatic; } public virtual bool IsTransient() { return IsTransient(_field); } public virtual void SetAccessible() { } public virtual object Get(object onObject) { try { return _field.GetValue(onObject); } catch(Exception e) { throw new Db4oException(e); } } public virtual void Set(object onObject, object attribute) { try { _field.SetValue(onObject, attribute); } catch(Exception e) { throw new Db4oException(e); } } public object IndexEntry(object orig) { return orig; } public IReflectClass IndexType() { return GetFieldType(); } public static bool IsTransient(FieldInfo field) { if (field.IsNotSerialized) return true; if (field.IsDefined(typeof(TransientAttribute), true)) return true; if (_transientMarkers == null) return false; return CheckForTransient(field.GetCustomAttributes(true)); } private static bool CheckForTransient(object[] attributes) { if (attributes == null) return false; foreach (object attribute in attributes) { string attributeName = attribute.GetType().FullName; if (_transientMarkers.Contains(attributeName)) return true; } return false; } public static void MarkTransient(Type attributeType) { MarkTransient(attributeType.FullName); } public static void MarkTransient(string attributeName) { if (_transientMarkers == null) { _transientMarkers = new List(); } else if (_transientMarkers.Contains(attributeName)) { return; } _transientMarkers.Add(attributeName); } public static void ResetTransientMarkers() { _transientMarkers = null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Db4objects.Db4o/Reflect/Net/NetArray.cs0000644000175000017500000000723611700531646030573 0ustar00meebeymeebey00000000000000/* Copyright (C) 2007 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Reflect.Net { public class NetArray : Db4objects.Db4o.Reflect.Core.AbstractReflectArray { public NetArray(IReflector reflector) : base(reflector) { } private static Type GetNetType(IReflectClass clazz) { return ((NetClass)clazz).GetNetType(); } public override void Analyze(object obj, ArrayInfo info) { info.Nullable(IsNullableType(obj.GetType())); } private bool IsNullableType(Type type) { if (type.IsArray) { return IsNullableType(type.GetElementType()); } Type underlyingType = Nullable.GetUnderlyingType(type); return underlyingType != null; } public override object NewInstance(IReflectClass componentType, ArrayInfo info) { Type type = GetNetType(componentType); if (info.Nullable()) { type = NullableType(type); } MultidimensionalArrayInfo multiDimensionalInfo = info as MultidimensionalArrayInfo; if (multiDimensionalInfo == null) { return System.Array.CreateInstance(type, info.ElementCount()); } int[] dimensions = multiDimensionalInfo.Dimensions(); if (dimensions.Length == 1) { return UnfoldArrayCreation(type, dimensions, 0); } return UnfoldArrayCreation(GetArrayType(type, dimensions.Length - 1), dimensions, 0); } private Type NullableType(Type type) { if(IsNullableType(type)) { return type; } return typeof(Nullable<>).MakeGenericType(new Type[] { type }); } public override object NewInstance(IReflectClass componentType, int[] dimensions) { Type type = GetNetType(componentType); if (dimensions.Length == 1) { return UnfoldArrayCreation(type, dimensions, 0); } return UnfoldArrayCreation(GetArrayType(type, dimensions.Length - 1), dimensions, 0); } private static object UnfoldArrayCreation(Type type, int[] dimensions, int dimensionIndex) { int length = dimensions[dimensionIndex]; Array array = Array.CreateInstance(type, length); if (dimensionIndex == dimensions.Length - 1) { return array; } for (int i=0; iReflection implementation for Class to map to .NET reflection. /// Reflection implementation for Class to map to .NET reflection. public class NetClass : IConstructorAwareReflectClass { protected readonly IReflector _reflector; private readonly NetReflector _netReflector; private readonly Type _type; private ReflectConstructorSpec _constructor; private string _name; private IReflectField[] _fields; public NetClass(IReflector reflector, NetReflector netReflector, Type clazz) { if(reflector == null) { throw new ArgumentNullException("reflector"); } if(netReflector == null) { throw new ArgumentNullException("netReflector"); } _reflector = reflector; _netReflector = netReflector; _type = clazz; _constructor = ReflectConstructorSpec.UnspecifiedConstructor; } public virtual IReflectClass GetComponentType() { return _reflector.ForClass(_type.GetElementType()); } private IReflectConstructor[] GetDeclaredConstructors() { ConstructorInfo[] constructors = _type.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); IReflectConstructor[] reflectors = new IReflectConstructor[constructors.Length]; for (int i = 0; i < constructors.Length; i++) { reflectors[i] = new NetConstructor(_reflector, constructors[i]); } return reflectors; } public virtual IReflectField GetDeclaredField(string name) { foreach (IReflectField field in GetDeclaredFields()) { if (field.GetName() == name) return field; } return null; } public virtual IReflectField[] GetDeclaredFields() { if (_fields == null) { _fields = CreateDeclaredFieldsArray(); } return _fields; } private IReflectField[] CreateDeclaredFieldsArray() { FieldInfo[] fields = Sharpen.Runtime.GetDeclaredFields(_type); IReflectField[] reflectors = new IReflectField[fields.Length]; for (int i = 0; i < reflectors.Length; i++) { reflectors[i] = CreateField(fields[i]); } return reflectors; } protected virtual IReflectField CreateField(FieldInfo field) { return new NetField(_reflector, field); } public virtual IReflectClass GetDelegate() { return this; } public virtual IReflectMethod GetMethod(string methodName, IReflectClass[] paramClasses) { try { Type[] parameterTypes = NetReflector.ToNative(paramClasses); MethodInfo method = GetMethod(_type, methodName, parameterTypes); if (method == null) { return null; } return new NetMethod(_reflector, method); } catch { return null; } } private static MethodInfo GetMethod(Type type, string methodName, Type[] parameterTypes) { MethodInfo found = Sharpen.Runtime.GetDeclaredMethod(type, methodName, parameterTypes); if (found != null) return found; Type baseType = type.BaseType; if (null == baseType) return null; return GetMethod(baseType, methodName, parameterTypes); } public virtual string GetName() { if (_name == null) { _name = TypeReference.FromType(_type).GetUnversionedName(); } return _name; } public virtual IReflectClass GetSuperclass() { return _reflector.ForClass(_type.BaseType); } public virtual bool IsAbstract() { return _type.IsAbstract; } public virtual bool IsArray() { return _type.IsArray; } public virtual bool IsAssignableFrom(IReflectClass type) { if (!(type is NetClass)) { return false; } return _type.IsAssignableFrom(((NetClass)type).GetNetType()); } public virtual bool IsInstance(object obj) { return _type.IsInstanceOfType(obj); } public virtual bool IsInterface() { return _type.IsInterface; } public virtual bool IsCollection() { return _reflector.IsCollection(this); } public virtual bool IsPrimitive() { return _type.IsPrimitive || _type == typeof(DateTime) || _type == typeof(decimal); } public virtual object NewInstance() { CreateConstructor(); return _constructor.NewInstance(); } public virtual Type GetNetType() { return _type; } public virtual IReflector Reflector() { return _reflector; } public virtual IReflectConstructor GetSerializableConstructor() { #if !CF && !SILVERLIGHT return new SerializationConstructor(GetNetType()); #else return null; #endif } public override string ToString() { return "NetClass(" + _type + ")"; } public virtual object NullValue() { return _netReflector.NullValue(this); } private void CreateConstructor() { if(!_constructor.CanBeInstantiated().IsUnspecified()) { return; } _constructor = ConstructorSupport.CreateConstructor(this, _type, _netReflector.Configuration(), GetDeclaredConstructors()); } public virtual bool EnsureCanBeInstantiated() { CreateConstructor(); return _constructor.CanBeInstantiated().DefiniteYes(); } public bool IsImmutable() { return IsPrimitive() || Platform4.IsSimple(_type); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/0000755000175000017500000000000011700531646024117 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/System/0000755000175000017500000000000011700531646025403 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/System/Collections/0000755000175000017500000000000011700531646027661 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/System/Collections/ArrayList.cs0000644000175000017500000000046511700531646032127 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ #if SILVERLIGHT using System.Collections.Generic; namespace System.Collections { public class ArrayList : List { public ArrayList(int capacity) : base(capacity) { } public ArrayList() { } } } #endifsmuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/System/Collections/Hashtable.cs0000644000175000017500000000062011700531646032101 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ #if SILVERLIGHT using System.Collections.Generic; namespace System.Collections { public class Hashtable : Dictionary { public Hashtable() { } public Hashtable(int capacity) : base(capacity) { } public bool Contains(object key) { return ContainsKey(key); } } } #endifsmuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/System/Serializable.cs0000644000175000017500000000024311700531646030337 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ #if SILVERLIGHT namespace System { public class Serializable : Attribute { } } #endifsmuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/System/NonSerialized.cs0000644000175000017500000000030711700531646030500 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; #if SILVERLIGHT namespace System { public class NonSerialized : TransientAttribute { } } #endifsmuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/Db4objects.Db4o/0000755000175000017500000000000011700531646026671 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/Db4objects.Db4o/IO/0000755000175000017500000000000011700531646027200 5ustar00meebeymeebey00000000000000IsolatedStorageFileBin.cs0000644000175000017500000001073311700531646033776 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/Db4objects.Db4o/IO/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ #if SILVERLIGHT using System; using System.IO; using System.IO.IsolatedStorage; using Db4objects.Db4o.Ext; using Sharpen.Lang; using Sharpen.Util; namespace Db4objects.Db4o.IO { class IsolatedStorageFileBin : IBin { private readonly IsolatedStorageFileStream _fileStream; private string _fullPath; internal IsolatedStorageFileBin(BinConfiguration config, IsolatedStorageFile store) { Action cleanUp = Close; try { _fileStream = OpenFile(config, store); cleanUp = () => {}; } catch (IsolatedStorageException e) { ThrowMappedException(e, config.Uri(), store); } finally { cleanUp(); } } internal string Path { get { return _fullPath; } } private static void ThrowMappedException(Exception e, string path, IsolatedStorageFile store) { if (store.FileExists(path)) { throw new DatabaseFileLockedException(path, e); } throw new Db4oIOException(e); } private IsolatedStorageFileStream OpenFile(BinConfiguration config, IsolatedStorageFile store) { _fullPath = config.Uri(); string path = config.Uri(); IsolatedStorageFileStream stream = new IsolatedStorageFileStream(path, FileModeFor(store, path), FileAccessFor(config), FileShareFor(config), store); Fill(stream, config.InitialLength(), 0); return stream; } private static FileMode FileModeFor(IsolatedStorageFile store, string path) { return store.FileExists(path) ? FileMode.Open : FileMode.CreateNew; } private static void Fill(Stream stream, long length, byte value) { if (length > 0) { byte[] bytes = new byte[length]; Arrays.Fill(bytes, value); stream.Write(bytes, 0, bytes.Length); } } private static FileShare FileShareFor(BinConfiguration config) { return config.LockFile() ? FileShare.None : FileShare.ReadWrite; } private static FileAccess FileAccessFor(BinConfiguration config) { return config.ReadOnly() ? FileAccess.Read : FileAccess.ReadWrite; } #region IBin Members public long Length() { return _fileStream.Length; } public int Read(long position, byte[] bytes, int bytesToRead) { try { Seek(position); return _fileStream.Read(bytes, 0, bytesToRead); } catch (IOException e) { throw new Db4oIOException(e); } } public void Write(long position, byte[] bytes, int bytesToWrite) { try { Seek(position); _fileStream.Write(bytes, 0, bytesToWrite); } catch (NotSupportedException e) { throw new Db4oIOException(e); } } public void Sync() { _fileStream.Flush(); } public void Sync(IRunnable runnable) { Sync(); runnable.Run(); Sync(); } public int SyncRead(long position, byte[] bytes, int bytesToRead) { return Read(position, bytes, bytesToRead); } public void Close() { if (_fileStream != null) { _fileStream.Close(); RaiseOnCloseEvent(); } } #endregion private void Seek(long position) { if (DTrace.enabled) { DTrace.RegularSeek.Log(position); } _fileStream.Seek(position, SeekOrigin.Begin); } private void RaiseOnCloseEvent() { Action onClose = OnClose; if (onClose != null) { onClose(this, EventArgs.Empty); } } internal event Action OnClose; } } #endif smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/Db4objects.Db4o/IO/SilverlightIO.cs0000644000175000017500000000204411700531646032253 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ #if SILVERLIGHT using System; using System.IO; using System.IO.IsolatedStorage; namespace Db4objects.Db4o.IO { public static class SilverlightIO { public static bool Exists(string path) { return ExistsIn(IsolatedStorageFile.GetUserStoreForApplication(), path); } private static bool ExistsIn(IsolatedStorageFile storage, string path) { return storage.FileExists(path); } public static bool Delete(string path) { IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication(); if (ExistsIn(storage, path)) { storage.DeleteFile(path); return !ExistsIn(storage, path); } return false; } public static long Length(string path) { IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication(); using (IsolatedStorageFileStream fileStream = storage.OpenFile(path, FileMode.Open, FileAccess.Read, FileShare.Read)) { return fileStream.Length; } } } } #endifIsolatedStorageStorage.cs0000644000175000017500000000525011700531646034070 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/Db4objects.Db4o/IO/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ #if SILVERLIGHT using System.Collections.Generic; using System.IO.IsolatedStorage; using System.IO; namespace Db4objects.Db4o.IO { public class IsolatedStorageStorage : IStorage { private static readonly IsolatedStorageFile _store = IsolatedStorageFile.GetUserStoreForApplication(); private static readonly IDictionary _openBins = new Dictionary(); #region IStorage Members public IBin Open(BinConfiguration config) { IsolatedStorageFileBin bin = new IsolatedStorageFileBin(config, _store); AddToOpenBinsCollection(bin); RegisterForOnCloseEvent(bin); return bin; } public bool Exists(string uri) { return _store.FileExists(uri) && FileSize(uri) > 0; } public void Delete(string uri) { if (_store.FileExists(uri)) { _store.DeleteFile(uri); } } public void Rename(string oldUri, string newUri) { if (_store.FileExists(oldUri)) { Copy(oldUri, newUri); Delete(oldUri); } } private static void Copy(string from, string to) { using (IsolatedStorageFileStream fromStream = _store.OpenFile(from, FileMode.Open, FileAccess.Read, FileShare.None)) { using(IsolatedStorageFileStream toStream = _store.OpenFile(to, FileMode.CreateNew, FileAccess.Write, FileShare.None)) { byte []buffer = new byte[1024 * 1024]; int count = fromStream.Read(buffer, 0, buffer.Length); while (count > 0) { toStream.Write(buffer, 0, count); count = fromStream.Read(buffer, 0, buffer.Length); } } } } #endregion public static long FileSize(string uri) { lock (_openBins) { if (IsBinAlreadyOpen(uri)) { IsolatedStorageFileBin bin = _openBins[uri]; return bin.Length(); } using (IsolatedStorageFileStream fileStream = _store.OpenFile(uri, FileMode.Open, FileAccess.Read, FileShare.None)) { return fileStream.Length; } } } private static bool IsBinAlreadyOpen(string uri) { return _openBins.ContainsKey(uri); } private static void RegisterForOnCloseEvent(IsolatedStorageFileBin bin) { bin.OnClose += (sender, arg) => RemoveFromOpenBinCollection(((IsolatedStorageFileBin)sender).Path); } private static void RemoveFromOpenBinCollection(string path) { lock (_openBins) { if (_openBins.ContainsKey(path)) { _openBins.Remove(path); } } } private static void AddToOpenBinsCollection(IsolatedStorageFileBin bin) { _openBins[bin.Path] = bin; } } } #endif smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/Db4objects.Db4o/Internal/0000755000175000017500000000000011700531646030445 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/Db4objects.Db4o/Internal/BlobImpl.cs0000644000175000017500000000156411700531646032502 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ #if SILVERLIGHT namespace Db4objects.Db4o.Internal { public class BlobImpl : IDb4oTypeImpl { public void SetTrans(Transaction a_trans) { throw new System.NotImplementedException(); } public bool CanBind() { throw new System.NotImplementedException(); } public object CreateDefault(Transaction trans) { throw new System.NotImplementedException(); } public bool HasClassIndex() { throw new System.NotImplementedException(); } public void SetObjectReference(ObjectReference @ref) { throw new System.NotImplementedException(); } public object StoredTo(Transaction trans) { throw new System.NotImplementedException(); } public void PreDeactivate() { throw new System.NotImplementedException(); } } } #endifsmuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/Db4objects.Db4o/Config/0000755000175000017500000000000011700531646030076 5ustar00meebeymeebey00000000000000SilverlightSupport.cs0000644000175000017500000000135211700531646034240 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/Db4objects.Db4o/Config/* Copyright (C) 2010 Versant Inc. http://www.db4o.com */ #if SILVERLIGHT using Db4objects.Db4o.IO; namespace Db4objects.Db4o.Config { /// /// Configures the database to be used in a Silverlight application. /// /// /// This configuration item basically configures db4o to use Silverlight isolatad storage. /// If your Silverlight application may run "out of browser" you may want to not add this. /// public class SilverlightSupport : IEmbeddedConfigurationItem { public void Prepare(IEmbeddedConfiguration configuration) { configuration.File.Storage = new IsolatedStorageStorage(); } public void Apply(IEmbeddedObjectContainer db) { } } } #endifsmuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/Db4objects.Db4o/Foundation/0000755000175000017500000000000011700531646030777 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/Db4objects.Db4o/Foundation/IO/0000755000175000017500000000000011700531646031306 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/native/Silverlight/Db4objects.Db4o/Foundation/IO/File4.cs0000644000175000017500000000211211700531646032574 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ #if SILVERLIGHT using System; using System.IO; using System.IO.IsolatedStorage; namespace Db4objects.Db4o.Foundation.IO { public class File4 { public static void Delete(string file) { IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication(); if (storageFile.FileExists(file)) { storageFile.DeleteFile(file); } } public static void Copy(string from, string to) { throw new NotImplementedException(); } public static bool Exists(string file) { IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication(); return storageFile.FileExists(file); } public static long Size(string filePath) { using (IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication()) { using (IsolatedStorageFileStream fileStream = storageFile.OpenFile(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { return fileStream.Length; } } } } } #endif smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Properties/0000755000175000017500000000000011700531646022471 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Properties/AssemblyInfo.cs0000755000175000017500000000162411700531646025421 0ustar00meebeymeebey00000000000000/* Copyright (C) 2009 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; using System.Security; [assembly: AssemblyTitle("db4o - database for objects")] [assembly: AssemblyCompany("Versant Corp., Redwood City, CA, USA")] [assembly: AssemblyProduct("db4o - database for objects")] [assembly: AssemblyCopyright("Versant Corp. 2000 - 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyName("")] // attributes are automatically set by the build [assembly: AssemblyVersion("8.0.183.14430")] [assembly: AssemblyKeyFile("")] [assembly: AssemblyConfiguration(".NET")] [assembly: AssemblyDescription("Db4objects.Db4o 8.0.183.14430 (.NET)")] #if !CF && !SILVERLIGHT [assembly: AllowPartiallyTrustedCallers] #endif #if NET_4_0 [assembly: SecurityRules(SecurityRuleSet.Level1)] #endif [assembly: CLSCompliant(true)]smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/0000755000175000017500000000000011700531646023107 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Messaging/0000755000175000017500000000000011700531646025024 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Messaging/IMessageSender.cs0000644000175000017500000000274611700531646030222 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Messaging { /// message sender for client/server messaging. /// /// message sender for client/server messaging. ///

db4o allows using the client/server TCP connection to send /// messages from the client to the server. Any object that can be /// stored to a db4o database file may be used as a message.

/// For an example see Reference documentation:
/// http://developer.db4o.com/Resources/view.aspx/Reference/Client-Server/Messaging
/// http://developer.db4o.com/Resources/view.aspx/Reference/Client-Server/Remote_Code_Execution

/// See Also:
/// Db4objects.Db4o.Config.IClientServerConfiguration.GetMessageSender() /// /// ,
/// IMessageRecipient /// ,
/// Db4objects.Db4o.Config.IClientServerConfiguration.SetMessageRecipient(IMessageRecipient) /// ///
public interface IMessageSender { /// sends a message to the server. /// sends a message to the server. /// the message parameter, any object may be used. void Send(object obj); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Messaging/IMessageRecipient.cs0000644000175000017500000000333111700531646030713 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Messaging; namespace Db4objects.Db4o.Messaging { /// message recipient for client/server messaging. /// /// message recipient for client/server messaging. ///

db4o allows using the client/server TCP connection to send /// messages from the client to the server. Any object that can be /// stored to a db4o database file may be used as a message.

/// For an example see Reference documentation:
/// http://developer.db4o.com/Resources/view.aspx/Reference/Client-Server/Messaging
/// http://developer.db4o.com/Resources/view.aspx/Reference/Client-Server/Remote_Code_Execution

/// See Also:
/// ClientServerConfiguration.setMessageRecipient(MessageRecipient) /// ,
/// IMessageSender /// ,
/// Db4objects.Db4o.Config.IClientServerConfiguration.GetMessageSender() /// /// ,
/// MessageRecipientWithContext ///
///
public interface IMessageRecipient { /// the method called upon the arrival of messages. /// the method called upon the arrival of messages. /// contextual information for the message. /// the message received. void ProcessMessage(IMessageContext context, object message); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Messaging/IMessageContext.cs0000644000175000017500000000176411700531646030425 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Messaging; namespace Db4objects.Db4o.Messaging { /// Additional message-related information. /// Additional message-related information. public interface IMessageContext { /// The container the message was dispatched to. /// The container the message was dispatched to. IObjectContainer Container { get; } /// The sender of the current message. /// /// The sender of the current message. /// The reference can be used to send a reply to it. /// IMessageSender Sender { get; } /// The transaction the current message has been sent with. /// The transaction the current message has been sent with. Db4objects.Db4o.Internal.Transaction Transaction { get; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/StaticField.cs0000644000175000017500000000064311700531646025634 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o { /// /// public class StaticField : IInternal4 { public string name; public object value; public StaticField() { } public StaticField(string name_, object value_) { name = name_; value = value_; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Marshall/0000755000175000017500000000000011700531646024652 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Marshall/IWriteContext.cs0000644000175000017500000000372511700531646027760 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Marshall { /// /// this interface is passed to internal class /// Db4objects.Db4o.Typehandlers.ITypeHandler4 /// /// during marshaling /// and provides methods to marshal objects. /// public interface IWriteContext : IContext, IWriteBuffer { /// /// makes sure the object is stored and writes the ID of /// the object to the context. /// /// /// makes sure the object is stored and writes the ID of /// the object to the context. /// Use this method for first class objects only (objects that /// have an identity in the database). If the object can potentially /// be a primitive type, do not use this method but use /// a matching /// IWriteBuffer /// method instead. /// /// the object to write. void WriteObject(object obj); /// /// writes sub-objects, in cases where the /// Db4objects.Db4o.Typehandlers.ITypeHandler4 /// /// is known. /// /// typehandler to be used to write the object. /// the object to write void WriteObject(ITypeHandler4 handler, object obj); /// /// reserves a buffer with a specific length at the current /// position, to be written in a later step. /// /// /// reserves a buffer with a specific length at the current /// position, to be written in a later step. /// /// the length to be reserved. /// the ReservedBuffer IReservedBuffer Reserve(int length); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Marshall/IReadContext.cs0000644000175000017500000000210111700531646027524 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Marshall { /// /// this interface is passed to internal class /// Db4objects.Db4o.Typehandlers.ITypeHandler4 /// /// when instantiating objects. /// public interface IReadContext : IContext, IReadBuffer { /// /// Interprets the current position in the context as /// an ID and returns the object with this ID. /// /// /// Interprets the current position in the context as /// an ID and returns the object with this ID. /// /// the object object ReadObject(); /// /// reads sub-objects, in cases where the /// Db4objects.Db4o.Typehandlers.ITypeHandler4 /// /// is known. /// object ReadObject(ITypeHandler4 handler); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Marshall/IReservedBuffer.cs0000644000175000017500000000157311700531646030231 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Marshall { /// a reserved buffer within a write buffer. /// /// a reserved buffer within a write buffer. /// The usecase this class was written for: A null bitmap should be at the /// beginning of a slot to allow lazy processing. During writing the content /// of the null bitmap is not yet fully known until all members are processed. /// With the Reservedbuffer the space in the slot can be occupied and writing /// can happen after all members are processed. /// public interface IReservedBuffer { /// writes a byte array to the reserved buffer. /// writes a byte array to the reserved buffer. /// the byte array. void WriteBytes(byte[] bytes); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Marshall/IBufferContext.cs0000644000175000017500000000040611700531646030070 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Marshall { /// public interface IBufferContext : IReadBuffer, IContext { IReadBuffer Buffer(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Marshall/IContext.cs0000644000175000017500000000111311700531646026732 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o.Marshall { /// /// common functionality for /// IReadContext /// and /// IWriteContext /// and /// Db4objects.Db4o.Internal.Delete.IDeleteContext /// /// /// public interface IContext { IObjectContainer ObjectContainer(); Db4objects.Db4o.Internal.Transaction Transaction(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Marshall/IWriteBuffer.cs0000644000175000017500000000162711700531646027544 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Marshall { /// a buffer interface with write methods. /// a buffer interface with write methods. public interface IWriteBuffer { /// writes a single byte to the buffer. /// writes a single byte to the buffer. /// the byte void WriteByte(byte b); /// writes an array of bytes to the buffer /// the byte array void WriteBytes(byte[] bytes); /// writes an int to the buffer. /// writes an int to the buffer. /// the int void WriteInt(int i); /// writes a long to the buffer /// the long void WriteLong(long l); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Marshall/IReadBuffer.cs0000644000175000017500000000330511700531646027320 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Marshall { /// /// a buffer interface with methods to read and to position /// the read pointer in the buffer. /// /// /// a buffer interface with methods to read and to position /// the read pointer in the buffer. /// public interface IReadBuffer { /// returns the current offset in the buffer /// the offset int Offset(); BitMap4 ReadBitMap(int bitCount); /// reads a byte from the buffer. /// reads a byte from the buffer. /// the byte byte ReadByte(); /// reads an array of bytes from the buffer. /// /// reads an array of bytes from the buffer. /// The length of the array that is passed as a parameter specifies the /// number of bytes that are to be read. The passed bytes buffer parameter /// is directly filled. /// /// the byte array to read the bytes into. void ReadBytes(byte[] bytes); /// reads an int from the buffer. /// reads an int from the buffer. /// the int int ReadInt(); /// reads a long from the buffer. /// reads a long from the buffer. /// the long long ReadLong(); /// positions the read pointer at the specified position /// the desired position in the buffer void Seek(int offset); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Marshall/IReferenceActivationContext.cs0000644000175000017500000000062111700531646032576 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Marshall { /// this interface is passed to reference type handlers. /// this interface is passed to reference type handlers. public interface IReferenceActivationContext : IReadContext { object PersistentObject(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Types/0000755000175000017500000000000011700531646024213 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Types/IBlob.cs0000644000175000017500000001340111700531646025530 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Types; namespace Db4objects.Db4o.Types { /// /// the db4o Blob type to store blobs independent of the main database /// file and allows to perform asynchronous upload and download operations. /// /// /// the db4o Blob type to store blobs independent of the main database /// file and allows to perform asynchronous upload and download operations. ///

/// Usage:
/// - Define Blob fields on your user classes.
/// - As soon as an object of your class is stored, db4o automatically /// takes care that the Blob field is set.
/// - Call readFrom to read a blob file into the db4o system.
/// - Call writeTo to write a blob file from within the db4o system.
/// - getStatus may help you to determine, whether data has been /// previously stored. It may also help you to track the completion /// of the current process. ///

/// db4o client/server carries out all blob operations in a separate /// thread on a specially dedicated socket. One socket is used for /// all blob operations and operations are queued. Your application /// may continue to access db4o while a blob is transferred in the /// background. ///
public interface IBlob : IDb4oType { /// returns the name of the file the blob was stored to. /// /// returns the name of the file the blob was stored to. ///

The method may return null, if the file was never /// stored. ///
/// String the name of the file. string GetFileName(); /// returns the status after the last read- or write-operation. /// /// returns the status after the last read- or write-operation. ///

The status value returned may be any of the following:
/// Db4objects.Db4o.Ext.Status.Unused /// no data was ever stored to the Blob field.
/// Db4objects.Db4o.Ext.Status.Available /// /// available data was previously stored to the Blob field.
/// Db4objects.Db4o.Ext.Status.Queued /// an operation was triggered and is waiting for it's turn in the Blob queue.
/// Db4objects.Db4o.Ext.Status.Completed /// /// the last operation on this field was completed successfully.
/// Db4objects.Db4o.Ext.Status.Processing /// /// for internal use only.
/// Db4objects.Db4o.Ext.Status.Error /// the last operation failed.
/// or a double between 0 and 1 that signifies the current completion percentage of the currently /// running operation.

the five /// Db4objects.Db4o.Ext.Status /// constants defined in this interface or a double /// between 0 and 1 that signifies the completion of the currently running operation.

///
/// status - the current status /// constants double GetStatus(); /// reads a file into the db4o system and stores it as a blob. /// /// reads a file into the db4o system and stores it as a blob. ///

/// In Client/Server mode db4o will open an additional socket and /// process writing data in an additional thread. ///

///
/// the file the blob is to be read from. /// in case of errors void ReadFrom(Sharpen.IO.File file); /// reads a file into the db4o system and stores it as a blob. /// /// reads a file into the db4o system and stores it as a blob. ///

/// db4o will use the local file system in Client/Server mode also. ///

///
/// the file the blob is to be read from. /// in case of errors void ReadLocal(Sharpen.IO.File file); /// writes stored blob data to a file. /// /// writes stored blob data to a file. ///

/// db4o will use the local file system in Client/Server mode also. ///

///
/// /// in case of errors and in case no blob /// data was stored /// /// the file the blob is to be written to. void WriteLocal(Sharpen.IO.File file); /// writes stored blob data to a file. /// /// writes stored blob data to a file. ///

/// In Client/Server mode db4o will open an additional socket and /// process writing data in an additional thread. ///

///
/// /// in case of errors and in case no blob /// data was stored /// /// the file the blob is to be written to. void WriteTo(Sharpen.IO.File file); /// Deletes the current file stored in this BLOB. /// Deletes the current file stored in this BLOB. /// /// in case of errors and in case no /// data was stored /// void DeleteFile(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Types/IUnversioned.cs0000644000175000017500000000052711700531646027160 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Types { /// /// marker interface to denote that version numbers and UUIDs should /// not be generated for a class that implements this interface /// /// public interface IUnversioned { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Types/IDb4oType.cs0000644000175000017500000000043411700531646026306 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Types { /// marker interface for all special db4o types. /// marker interface for all special db4o types. public interface IDb4oType { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Types/ITransientClass.cs0000644000175000017500000000052411700531646027611 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Types { /// Marker interface to denote that a class should not be stored by db4o. /// Marker interface to denote that a class should not be stored by db4o. public interface ITransientClass { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Db4oFactory.cs0000644000175000017500000005117211700531646025564 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Config; namespace Db4objects.Db4o { /// factory class to start db4o database engines. /// /// factory class to start db4o database engines. ///

This class provides static methods to
/// - open single-user databases /// OpenFile(string) ///
/// - open db4o servers /// OpenServer(string, int) ///
/// - connect to db4o servers /// OpenClient(string, int, string, string) /// ///
/// - provide access to the global configuration context /// Configure() ///
/// - print the version number of this db4o version /// Main(java.lang.String[]) /// ///
/// ExtDb4o for extended functionality. public class Db4oFactory { internal static readonly Config4Impl i_config = new Config4Impl(); static Db4oFactory() { Platform4.GetDefaultConfiguration(i_config); } /// prints the version name of this db4o version to System.out. /// /// prints the version name of this db4o version to System.out. /// public static void Main(string[] args) { Sharpen.Runtime.Out.WriteLine(Version()); } /// /// returns the global db4o /// IConfiguration /// context /// for the running CLR session. ///

/// The /// IConfiguration /// can be overriden in each /// ObjectContainer /// .

///
/// /// the global /// configuration /// context /// /// public static IConfiguration Configure() { return i_config; } /// /// Creates a fresh /// IConfiguration /// instance. /// /// a fresh, independent configuration with all options set to their default values /// [System.ObsoleteAttribute(@"Use Db4oEmbedded.NewConfiguration() instead.")] public static IConfiguration NewConfiguration() { Config4Impl config = new Config4Impl(); Platform4.GetDefaultConfiguration(config); return config; } /// /// Creates a clone of the global db4o /// IConfiguration /// . /// /// /// a fresh configuration with all option values set to the values /// currently configured for the global db4o configuration context /// [System.ObsoleteAttribute(@"use explicit configuration via Db4oEmbedded.NewConfiguration() instead" )] public static IConfiguration CloneConfiguration() { return (Config4Impl)((IDeepClone)Db4oFactory.Configure()).DeepClone(null); } /// /// Operates just like /// /// Db4objects.Db4o.Db4oFactory.OpenClient /// , but uses /// the global db4o /// IConfiguration /// context. /// opens an /// IObjectContainer /// client and connects it to the specified named server and port. ///

/// The server needs to /// allow access /// for the specified user and password. ///

/// A client /// IObjectContainer /// can be cast to /// IExtClient /// to use extended /// IExtObjectContainer /// /// and /// IExtClient /// methods. ///

/// This method is obsolete, see the Db4objects.Db4o.CS.Db4oClientServer class in /// Db4objects.Db4o.CS.dll for methods to open db4o servers and db4o clients. ///
/// /// a custom /// IConfiguration /// instance to be obtained via /// /// Db4objects.Db4o.Db4oEmbedded.NewConfiguration /// /// /// the host name /// the port the server is using /// the user name /// the user password /// /// an open /// IObjectContainer /// /// /// Db4objects.Db4o.IObjectServer.GrantAccess /// /// /// I/O operation failed or was unexpectedly interrupted. /// /// /// open operation failed because the database file /// is in old format and /// /// Db4objects.Db4o.Config.IConfiguration.AllowVersionUpdates /// /// /// is set to false. /// /// /// password supplied for the connection is /// invalid. /// public static IObjectContainer OpenClient(string hostName, int port, string user, string password) { return OpenClient(Db4oFactory.CloneConfiguration(), hostName, port, user, password ); } /// /// opens an /// IObjectContainer /// client and connects it to the specified named server and port. ///

/// The server needs to /// allow access /// for the specified user and password. ///

/// A client /// IObjectContainer /// can be cast to /// IExtClient /// to use extended /// IExtObjectContainer /// /// and /// IExtClient /// methods. ///

/// This method is obsolete, see the Db4objects.Db4o.CS.Db4oClientServer class in /// Db4objects.Db4o.CS.dll for methods to open db4o servers and db4o clients. ///
/// /// a custom /// IConfiguration /// instance to be obtained via /// /// Db4objects.Db4o.Db4oEmbedded.NewConfiguration /// /// /// the host name /// the port the server is using /// the user name /// the user password /// /// an open /// IObjectContainer /// /// /// Db4objects.Db4o.IObjectServer.GrantAccess /// /// /// I/O operation failed or was unexpectedly interrupted. /// /// /// open operation failed because the database file /// is in old format and /// /// Db4objects.Db4o.Config.IConfiguration.AllowVersionUpdates /// /// /// is set to false. /// /// /// password supplied for the connection is /// invalid. /// public static IObjectContainer OpenClient(IConfiguration config, string hostName, int port, string user, string password) { return ((Config4Impl)config).ClientServerFactory().OpenClient(config, hostName, port , user, password); } /// /// Operates just like /// Db4oFactory.OpenFile /// , but uses /// the global db4o /// IConfiguration /// context. /// opens an /// IObjectContainer /// on the specified database file for local use. ///

A database file can only be opened once, subsequent attempts to open /// another /// IObjectContainer /// against the same file will result in /// a /// DatabaseFileLockedException /// .

/// Database files can only be accessed for readwrite access from one process /// at one time. All versions except for db4o mobile edition use an /// internal mechanism to lock the database file for other processes. ///

/// ///
/// an absolute or relative path to the database file /// /// an open /// IObjectContainer /// /// /// IConfiguration.ReadOnly /// IConfiguration.Encrypt /// IConfiguration.Password /// /// I/O operation failed or was unexpectedly interrupted. /// /// /// /// the required database file is locked by /// another process. /// /// /// /// runtime /// configuration /// is not compatible /// with the configuration of the database file. /// /// /// /// open operation failed because the database file /// is in old format and /// /// IConfiguration.AllowVersionUpdates /// /// is set to false. /// /// /// database was configured as read-only. /// public static IObjectContainer OpenFile(string databaseFileName) { return Db4oFactory.OpenFile(CloneConfiguration(), databaseFileName); } /// /// opens an /// IObjectContainer /// on the specified database file for local use. ///

A database file can only be opened once, subsequent attempts to open /// another /// IObjectContainer /// against the same file will result in /// a /// DatabaseFileLockedException /// .

/// Database files can only be accessed for readwrite access from one process /// at one time. All versions except for db4o mobile edition use an /// internal mechanism to lock the database file for other processes. ///

/// ///
/// /// a custom /// IConfiguration /// instance to be obtained via /// Db4oFactory.NewConfiguration /// /// /// an absolute or relative path to the database file /// /// an open /// IObjectContainer /// /// /// IConfiguration.ReadOnly /// IConfiguration.Encrypt /// IConfiguration.Password /// /// I/O operation failed or was unexpectedly interrupted. /// /// /// /// the required database file is locked by /// another process. /// /// /// /// runtime /// configuration /// is not compatible /// with the configuration of the database file. /// /// /// /// open operation failed because the database file /// is in old format and /// /// IConfiguration.AllowVersionUpdates /// /// /// /// is set to false. /// /// /// /// database was configured as read-only. /// /// public static IObjectContainer OpenFile(IConfiguration config, string databaseFileName ) { return ObjectContainerFactory.OpenObjectContainer(Db4oLegacyConfigurationBridge.AsEmbeddedConfiguration (config), databaseFileName); } /// /// Operates just like /// /// Db4objects.Db4o.Db4oFactory.OpenServer /// /// , but uses /// the global db4o /// IConfiguration /// context. /// Opens an /// IObjectServer /// on the specified database file and port. ///

/// If the server does not need to listen on a port because it will only be used /// in embedded mode with /// /// Db4objects.Db4o.IObjectServer.OpenClient /// /// , specify '0' as the /// port number. ///

This method is obsolete, see the Db4objects.Db4o.CS.Db4oClientServer class in /// Db4objects.Db4o.CS.dll for methods to open db4o servers and db4o clients. ///
/// an absolute or relative path to the database file /// /// the port to be used, or 0, if the server should not open a port, /// because it will only be used with /// /// Db4objects.Db4o.IObjectServer.OpenClient /// /// . /// Specify a value < 0 if an arbitrary free port should be chosen - see /// /// Db4objects.Db4o.Ext.IExtObjectServer.Port /// /// . /// /// /// an /// IObjectServer /// listening /// on the specified port. /// /// /// Db4objects.Db4o.Config.IConfiguration.ReadOnly /// /// /// Db4objects.Db4o.Config.IConfiguration.Encrypt /// /// /// Db4objects.Db4o.Config.IConfiguration.Password /// /// /// I/O operation failed or was unexpectedly interrupted. /// /// /// the required database file is locked by /// another process. /// /// /// runtime /// configuration /// is not compatible /// with the configuration of the database file. /// /// /// open operation failed because the database file /// is in old format and /// /// Db4objects.Db4o.Config.IConfiguration.AllowVersionUpdates /// /// /// is set to false. /// /// /// database was configured as read-only. /// public static IObjectServer OpenServer(string databaseFileName, int port) { return OpenServer(CloneConfiguration(), databaseFileName, port); } /// /// opens an /// IObjectServer /// on the specified database file and port. ///

/// If the server does not need to listen on a port because it will only be used /// in embedded mode with /// /// Db4objects.Db4o.IObjectServer.OpenClient /// /// , specify '0' as the /// port number. ///

This method is obsolete, see the Db4objects.Db4o.CS.Db4oClientServer class in /// Db4objects.Db4o.CS.dll for methods to open db4o servers and db4o clients. ///
/// /// a custom /// IConfiguration /// instance to be obtained via /// /// Db4objects.Db4o.Db4oEmbedded.NewConfiguration /// /// /// an absolute or relative path to the database file /// /// the port to be used, or 0, if the server should not open a port, /// because it will only be used with /// /// Db4objects.Db4o.IObjectServer.OpenClient /// /// . /// Specify a value < 0 if an arbitrary free port should be chosen - see /// /// Db4objects.Db4o.Ext.IExtObjectServer.Port /// /// . /// /// /// an /// IObjectServer /// listening /// on the specified port. /// /// /// Db4objects.Db4o.Config.IConfiguration.ReadOnly /// /// /// Db4objects.Db4o.Config.IConfiguration.Encrypt /// /// /// Db4objects.Db4o.Config.IConfiguration.Password /// /// /// I/O operation failed or was unexpectedly interrupted. /// /// /// the required database file is locked by /// another process. /// /// /// runtime /// configuration /// is not compatible /// with the configuration of the database file. /// /// /// open operation failed because the database file /// is in old format and /// /// Db4objects.Db4o.Config.IConfiguration.AllowVersionUpdates /// /// /// is set to false. /// /// /// database was configured as read-only. /// public static IObjectServer OpenServer(IConfiguration config, string databaseFileName , int port) { return ((Config4Impl)config).ClientServerFactory().OpenServer(config, databaseFileName , port); } /// returns the version name of the used db4o version. /// /// returns the version name of the used db4o version. ///

///
/// version information as a String. public static string Version() { return "db4o " + Db4oVersion.Name; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/TA/0000755000175000017500000000000011700531646023413 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/TA/TransactionalActivator.cs0000644000175000017500000000160211700531646030420 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Activation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.TA { /// /// An /// Db4objects.Db4o.Activation.IActivator /// /// implementation that activates an object on a specific /// transaction. /// /// internal sealed class TransactionalActivator : IActivator { private readonly Transaction _transaction; private readonly ObjectReference _objectReference; public TransactionalActivator(Transaction transaction, ObjectReference objectReference ) { _objectReference = objectReference; _transaction = transaction; } public void Activate(ActivationPurpose purpose) { _objectReference.ActivateOn(_transaction, purpose); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/TA/IActivatable.cs0000644000175000017500000001251611700531646026277 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Activation; namespace Db4objects.Db4o.TA { /// /// IActivatable must be implemented by classes in order to support /// Transparent Activation. ///
///
/// The IActivatable interface may be added to persistent classes by hand /// or by using the db4o instrumentation (Db4oTools). ///
/// /// IActivatable must be implemented by classes in order to support /// Transparent Activation. ///
///
/// The IActivatable interface may be added to persistent classes by hand /// or by using the db4o instrumentation (Db4oTools). For further /// information on the enhancer see: ///
///
/// http://developer.db4o.com/Resources/view.aspx/Reference/Implementation_Strategies/Enhancement_Tools/Enhancement_For_.NET. ///
///
/// The basic idea for Transparent Activation is as follows: ///
/// Objects have an activation depth of 0, i.e. by default they are not /// activated at all. Whenever a method is called on such an object, the /// first thing to do before actually executing the method body is to /// activate the object to level 1, i.e. populating its direct members. ///
///
/// To illustrate this approach, we will use the following simple class. ///
///
/// /// public class Item { ///
   private Item _next;

///    public Item(Item next) {
///       _next = next;
///    }

///    public Item Next {
///      get {
///       return _next;
///      }
///    }
/// }

/// The basic sequence of actions to get the above scheme to work is the /// following:
///
/// - Whenever an object is instantiated from db4o, the database registers an /// activator for this object. To enable this, the object has to implement the /// IActivatable interface and provide the according Bind(IActivator) method. The /// default implementation of the bind method will simply store the given /// activator reference for later use.
///
/// /// public class Item implements IActivatable {
///    transient IActivator _activator;

///    public void Bind(IActivator activator) {
///       if (null != _activator) {
///          throw new IllegalStateException();
///       }
///       _activator = activator;
///    }

///    // ...
/// }

/// - The first action in every method body of an activatable object should be a /// call to the corresponding IActivator's Activate() method. (Note that this is /// not enforced by any interface, it is rather a convention, and other /// implementations are possible.)
///
/// /// public class Item implements IActivatable {
///    public void Activate() {
///       if (_activator == null) return;
///       _activator.Activate();
///    }

///    public Item Next() {
///      get {
///       Activate();
///       return _next;
///      }
///    }
/// }

/// - The Activate() method will check whether the object is already activated. /// If this is not the case, it will request the container to activate the object /// to level 1 and set the activated flag accordingly.
///
/// To instruct db4o to actually use these hooks (i.e. to register the database /// when instantiating an object), TransparentActivationSupport has to be /// registered with the db4o configuration.
///
/// /// ICommonConfiguration config = ...
/// config.Add(new TransparentActivationSupport());

///
///
public interface IActivatable { /// called by db4o upon instantiation. /// /// called by db4o upon instantiation.
///
/// The recommended implementation of this method is to store the passed /// Db4objects.Db4o.Activation.IActivator /// /// in a transient field of the object. ///
/// the Activator void Bind(IActivator activator); /// should be called by every reading field access of an object. /// /// should be called by every reading field access of an object.
///
/// The recommended implementation of this method is to call /// Db4objects.Db4o.Activation.IActivator.Activate(Db4objects.Db4o.Activation.ActivationPurpose) /// /// on the /// Db4objects.Db4o.Activation.IActivator /// /// that was previously passed to /// Bind(Db4objects.Db4o.Activation.IActivator) /// /// . ///
/// TODO void Activate(ActivationPurpose purpose); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/TA/NotTransparentActivationEnabled.cs0000644000175000017500000000170511700531646032224 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; using Db4objects.Db4o.Internal; using Db4objects.Db4o.TA; namespace Db4objects.Db4o.TA { public class NotTransparentActivationEnabled : DiagnosticBase { private ClassMetadata _class; public NotTransparentActivationEnabled(ClassMetadata clazz) { _class = clazz; } public override string Problem() { return "An object of class " + _class + " was stored. Instances of this class very likely are not subject to transparent activation."; } public override object Reason() { return _class; } public override string Solution() { return "Use a TA aware class with equivalent functionality or ensure that this class provides a sensible implementation of the " + typeof(IActivatable).FullName + " interface and the implicit TA hooks, either manually or by applying instrumentation."; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/TA/TransparentActivationSupport.cs0000644000175000017500000002306211700531646031665 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Activation; using Db4objects.Db4o.Config; using Db4objects.Db4o.Events; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Diagnostic; using Db4objects.Db4o.Internal.References; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.TA; namespace Db4objects.Db4o.TA { /// /// Configuration item that enables Transparent Activation Mode for this /// session. /// /// /// Configuration item that enables Transparent Activation Mode for this /// session. TA mode should be switched on explicitly for manual TA implementation: ///

/// commonConfiguration.Add(new TransparentActivationSupport()); ///
/// public class TransparentActivationSupport : IConfigurationItem { // TODO: unbindOnClose should be configurable public virtual void Prepare(IConfiguration configuration) { } // Nothing to do... /// /// Configures the just opened ObjectContainer by setting event listeners, /// which will be triggered when activation or de-activation is required. /// /// /// Configures the just opened ObjectContainer by setting event listeners, /// which will be triggered when activation or de-activation is required. /// /// the ObjectContainer to configure /// TransparentPersistenceSupport.Apply(Db4objects.Db4o.Internal.IInternalObjectContainer) /// public virtual void Apply(IInternalObjectContainer container) { if (IsTransparentActivationEnabledOn(container)) { return; } TransparentActivationDepthProviderImpl provider = new TransparentActivationDepthProviderImpl (); SetActivationDepthProvider(container, provider); IEventRegistry registry = EventRegistryFor(container); registry.Instantiated += new System.EventHandler (new _IEventListener4_45(this).OnEvent); registry.Created += new System.EventHandler (new _IEventListener4_50(this).OnEvent); registry.Closing += new System.EventHandler (new _IEventListener4_56(this).OnEvent); TransparentActivationSupport.TADiagnosticProcessor processor = new TransparentActivationSupport.TADiagnosticProcessor (this, container); registry.ClassRegistered += new System.EventHandler (new _IEventListener4_67(processor).OnEvent); } private sealed class _IEventListener4_45 { public _IEventListener4_45(TransparentActivationSupport _enclosing) { this._enclosing = _enclosing; } public void OnEvent(object sender, Db4objects.Db4o.Events.ObjectInfoEventArgs args ) { this._enclosing.BindActivatableToActivator((ObjectEventArgs)args); } private readonly TransparentActivationSupport _enclosing; } private sealed class _IEventListener4_50 { public _IEventListener4_50(TransparentActivationSupport _enclosing) { this._enclosing = _enclosing; } public void OnEvent(object sender, Db4objects.Db4o.Events.ObjectInfoEventArgs args ) { this._enclosing.BindActivatableToActivator((ObjectEventArgs)args); } private readonly TransparentActivationSupport _enclosing; } private sealed class _IEventListener4_56 { public _IEventListener4_56(TransparentActivationSupport _enclosing) { this._enclosing = _enclosing; } public void OnEvent(object sender, Db4objects.Db4o.Events.ObjectContainerEventArgs args) { IInternalObjectContainer objectContainer = (IInternalObjectContainer)((ObjectContainerEventArgs )args).ObjectContainer; this._enclosing.UnbindAll(objectContainer); if (!this._enclosing.IsEmbeddedClient(objectContainer)) { this._enclosing.SetActivationDepthProvider(objectContainer, null); } } private readonly TransparentActivationSupport _enclosing; } private sealed class _IEventListener4_67 { public _IEventListener4_67(TransparentActivationSupport.TADiagnosticProcessor processor ) { this.processor = processor; } public void OnEvent(object sender, Db4objects.Db4o.Events.ClassEventArgs args) { ClassEventArgs cea = (ClassEventArgs)args; processor.OnClassRegistered(cea.ClassMetadata()); } private readonly TransparentActivationSupport.TADiagnosticProcessor processor; } public static bool IsTransparentActivationEnabledOn(IInternalObjectContainer container ) { return ActivationProvider(container) is ITransparentActivationDepthProvider; } private void SetActivationDepthProvider(IInternalObjectContainer container, IActivationDepthProvider provider) { container.ConfigImpl.ActivationDepthProvider(provider); } private IEventRegistry EventRegistryFor(IObjectContainer container) { return EventRegistryFactory.ForObjectContainer(container); } private void UnbindAll(IInternalObjectContainer container) { Db4objects.Db4o.Internal.Transaction transaction = container.Transaction; // FIXME should that ever happen? if (transaction == null) { return; } IReferenceSystem referenceSystem = transaction.ReferenceSystem(); referenceSystem.TraverseReferences(new _IVisitor4_95(this)); } private sealed class _IVisitor4_95 : IVisitor4 { public _IVisitor4_95(TransparentActivationSupport _enclosing) { this._enclosing = _enclosing; } public void Visit(object obj) { this._enclosing.Unbind((ObjectReference)obj); } private readonly TransparentActivationSupport _enclosing; } private void Unbind(ObjectReference objectReference) { object obj = objectReference.GetObject(); if (obj == null || !(obj is IActivatable)) { return; } Bind(obj, null); } private void BindActivatableToActivator(ObjectEventArgs oea) { object obj = oea.Object; if (obj is IActivatable) { Db4objects.Db4o.Internal.Transaction transaction = (Db4objects.Db4o.Internal.Transaction )oea.Transaction(); ObjectReference objectReference = transaction.ReferenceForObject(obj); Bind(obj, ActivatorForObject(transaction, objectReference)); } } private void Bind(object activatable, IActivator activator) { ((IActivatable)activatable).Bind(activator); } private IActivator ActivatorForObject(Db4objects.Db4o.Internal.Transaction transaction , ObjectReference objectReference) { if (IsEmbeddedClient(transaction)) { return new TransactionalActivator(transaction, objectReference); } return objectReference; } private bool IsEmbeddedClient(Db4objects.Db4o.Internal.Transaction transaction) { return IsEmbeddedClient(transaction.ObjectContainer()); } internal virtual Db4objects.Db4o.Internal.Transaction Transaction(EventArgs args) { return (Db4objects.Db4o.Internal.Transaction)((TransactionalEventArgs)args).Transaction (); } protected static IActivationDepthProvider ActivationProvider(IInternalObjectContainer container) { return container.ConfigImpl.ActivationDepthProvider(); } private bool IsEmbeddedClient(IObjectContainer objectContainer) { return objectContainer is ObjectContainerSession; } private sealed class TADiagnosticProcessor { private readonly IInternalObjectContainer _container; public TADiagnosticProcessor(TransparentActivationSupport _enclosing, IInternalObjectContainer container) { this._enclosing = _enclosing; this._container = container; } public void OnClassRegistered(ClassMetadata clazz) { // if(Platform4.isDb4oClass(clazz.getName())) { // return; // } IReflectClass reflectClass = clazz.ClassReflector(); if (this.ActivatableClass().IsAssignableFrom(reflectClass)) { return; } if (this.HasNoActivatingFields(reflectClass)) { return; } NotTransparentActivationEnabled diagnostic = new NotTransparentActivationEnabled( clazz); DiagnosticProcessor processor = this._container.Handlers.DiagnosticProcessor(); processor.OnDiagnostic(diagnostic); } private IReflectClass ActivatableClass() { return this._container.Reflector().ForClass(typeof(IActivatable)); } private bool HasNoActivatingFields(IReflectClass clazz) { IReflectClass curClass = clazz; while (curClass != null) { IReflectField[] fields = curClass.GetDeclaredFields(); if (!this.HasNoActivatingFields(fields)) { return false; } curClass = curClass.GetSuperclass(); } return true; } private bool HasNoActivatingFields(IReflectField[] fields) { for (int i = 0; i < fields.Length; i++) { if (this.IsActivating(fields[i])) { return false; } } return true; } private bool IsActivating(IReflectField field) { IReflectClass fieldType = field.GetFieldType(); return fieldType != null && !fieldType.IsPrimitive(); } private readonly TransparentActivationSupport _enclosing; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/TA/DeactivatingRollbackStrategy.cs0000644000175000017500000000132411700531646031541 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.TA; namespace Db4objects.Db4o.TA { /// RollbackStrategy to deactivate all activated objects on rollback. /// RollbackStrategy to deactivate all activated objects on rollback. /// TransparentPersistenceSupport public class DeactivatingRollbackStrategy : IRollbackStrategy { /// deactivates each object. /// deactivates each object. public virtual void Rollback(IObjectContainer container, object obj) { container.Ext().Deactivate(obj); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/TA/IRollbackStrategy.cs0000644000175000017500000000157111700531646027333 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o.TA { /// Interface defining rollback behavior when Transparent Persistence mode is on. /// /// Interface defining rollback behavior when Transparent Persistence mode is on. /// /// TransparentPersistenceSupport public interface IRollbackStrategy { /// Method to be called per TP-enabled object when the transaction is rolled back. /// /// Method to be called per TP-enabled object when the transaction is rolled back. /// /// current ObjectContainer /// TP-enabled object void Rollback(IObjectContainer container, object obj); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/TA/IActivatableInstrumented.cs0000644000175000017500000000076211700531646030701 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.TA { /// /// Marker interface to declare a class already implements the required TA/TP hooks /// and does not want to be instrumented further. /// /// /// Marker interface to declare a class already implements the required TA/TP hooks /// and does not want to be instrumented further. /// public interface IActivatableInstrumented { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/TA/TransparentPersistenceSupport.cs0000644000175000017500000000501411700531646032045 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.TA; namespace Db4objects.Db4o.TA { /// /// Enables Transparent Persistence and Transparent Activation behaviours for /// the current session. /// /// /// Enables Transparent Persistence and Transparent Activation behaviours for /// the current session. ///

/// commonConfiguration.Add(new TransparentPersistenceSupport()); ///
/// Db4objects.Db4o.TA.TransparentActivationSupport /// public class TransparentPersistenceSupport : TransparentActivationSupport { private readonly IRollbackStrategy _rollbackStrategy; /// Creates a new instance of TransparentPersistenceSupport class /// /// RollbackStrategy interface implementation, which /// defines the actions to be taken on the object when the transaction is rolled back. /// public TransparentPersistenceSupport(IRollbackStrategy rollbackStrategy) { _rollbackStrategy = rollbackStrategy; } /// /// Creates a new instance of TransparentPersistenceSupport class /// with no rollback strategies defined. /// /// /// Creates a new instance of TransparentPersistenceSupport class /// with no rollback strategies defined. /// public TransparentPersistenceSupport() : this(null) { } /// Configures current ObjectContainer to support Transparent Activation and Transparent Persistence /// /// public override void Apply(IInternalObjectContainer container) { base.Apply(container); EnableTransparentPersistenceFor(container); } private void EnableTransparentPersistenceFor(IInternalObjectContainer container) { ITransparentActivationDepthProvider provider = (ITransparentActivationDepthProvider )ActivationProvider(container); provider.EnableTransparentPersistenceSupportFor(container, _rollbackStrategy); } public override void Prepare(IConfiguration configuration) { base.Prepare(configuration); ((Config4Impl)configuration).UpdateDepthProvider(new TPUpdateDepthProvider()); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Constraints/0000755000175000017500000000000011700531646025416 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Constraints/ConstraintViolationException.cs0000644000175000017500000000133611700531646033640 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Constraints { /// Base class for all constraint exceptions. /// Base class for all constraint exceptions. [System.Serializable] public class ConstraintViolationException : Db4oRecoverableException { /// /// ConstraintViolationException constructor with a specific /// message. /// /// /// ConstraintViolationException constructor with a specific /// message. /// /// exception message public ConstraintViolationException(string msg) : base(msg) { } } } UniqueFieldValueConstraintViolationException.cs0000644000175000017500000000265611700531646036717 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Constraints/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Constraints; namespace Db4objects.Db4o.Constraints { /// /// db4o-specific exception.

/// This exception can be thrown by a /// UniqueFieldValueConstraint /// on commit. ///
/// Db4objects.Db4o.Config.IObjectField.Indexed(bool) /// /// Db4objects.Db4o.Config.IConfiguration.Add(Db4objects.Db4o.Config.IConfigurationItem) /// [System.Serializable] public class UniqueFieldValueConstraintViolationException : ConstraintViolationException { /// /// Constructor with a message composed from the class and field /// name of the entity causing the exception. /// /// /// Constructor with a message composed from the class and field /// name of the entity causing the exception. /// /// class, which caused the exception /// field, which caused the exception public UniqueFieldValueConstraintViolationException(string className, string fieldName ) : base("class: " + className + " field: " + fieldName) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Constraints/UniqueFieldValueConstraint.cs0000644000175000017500000001105211700531646033220 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Config; using Db4objects.Db4o.Constraints; using Db4objects.Db4o.Events; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Core; namespace Db4objects.Db4o.Constraints { /// configures a field of a class to allow unique values only. /// configures a field of a class to allow unique values only. public class UniqueFieldValueConstraint : IConfigurationItem { protected readonly object _clazz; protected readonly string _fieldName; /// constructor to create a UniqueFieldValueConstraint. /// constructor to create a UniqueFieldValueConstraint. /// can be a class (Java) / Type (.NET) / instance of the class / fully qualified class name /// /// the name of the field that is to be unique. public UniqueFieldValueConstraint(object clazz, string fieldName) { _clazz = clazz; _fieldName = fieldName; } public virtual void Prepare(IConfiguration configuration) { } // Nothing to do... /// internal method, public for implementation reasons. /// internal method, public for implementation reasons. public virtual void Apply(IInternalObjectContainer objectContainer) { if (objectContainer.IsClient) { throw new InvalidOperationException(GetType().FullName + " should be configured on the server." ); } EventRegistryFactory.ForObjectContainer(objectContainer).Committing += new System.EventHandler (new _IEventListener4_46(this, objectContainer).OnEvent); } private sealed class _IEventListener4_46 { public _IEventListener4_46(UniqueFieldValueConstraint _enclosing, IInternalObjectContainer objectContainer) { this._enclosing = _enclosing; this.objectContainer = objectContainer; } private FieldMetadata _fieldMetaData; private void EnsureSingleOccurence(Transaction trans, IObjectInfoCollection col) { IEnumerator i = col.GetEnumerator(); while (i.MoveNext()) { IObjectInfo objectInfo = (IObjectInfo)i.Current; if (this.ReflectClass() != this._enclosing.ReflectorFor(trans, objectInfo.GetObject ())) { continue; } object obj = this.ObjectFor(trans, objectInfo); object fieldValue = this.FieldMetadata().GetOn(trans, obj); if (fieldValue == null) { continue; } IBTreeRange range = this.FieldMetadata().Search(trans, fieldValue); if (range.Size() > 1) { throw new UniqueFieldValueConstraintViolationException(this.ClassMetadata().GetName (), this.FieldMetadata().GetName()); } } } private bool IsClassMetadataAvailable() { return null != this.ClassMetadata(); } private FieldMetadata FieldMetadata() { if (this._fieldMetaData != null) { return this._fieldMetaData; } this._fieldMetaData = this.ClassMetadata().FieldMetadataForName(this._enclosing._fieldName ); return this._fieldMetaData; } private ClassMetadata ClassMetadata() { return objectContainer.ClassMetadataForReflectClass(this.ReflectClass()); } private IReflectClass ReflectClass() { return ReflectorUtils.ReflectClassFor(objectContainer.Reflector(), this._enclosing ._clazz); } public void OnEvent(object sender, Db4objects.Db4o.Events.CommitEventArgs args) { if (!this.IsClassMetadataAvailable()) { return; } CommitEventArgs commitEventArgs = (CommitEventArgs)args; Transaction trans = (Transaction)commitEventArgs.Transaction(); this.EnsureSingleOccurence(trans, commitEventArgs.Added); this.EnsureSingleOccurence(trans, commitEventArgs.Updated); } private object ObjectFor(Transaction trans, IObjectInfo info) { int id = (int)info.GetInternalID(); HardObjectReference @ref = HardObjectReference.PeekPersisted(trans, id, 1); return @ref._object; } private readonly UniqueFieldValueConstraint _enclosing; private readonly IInternalObjectContainer objectContainer; } private IReflectClass ReflectorFor(Transaction trans, object obj) { return trans.Container().Reflector().ForObject(obj); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IEmbeddedObjectContainer.cs0000644000175000017500000000327411700531646030240 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o { /// /// Represents a local ObjectContainer attached to a /// database file. /// /// /// Represents a local ObjectContainer attached to a /// database file. /// /// 7.10 public interface IEmbeddedObjectContainer : IObjectContainer { /// backs up a database file of an open ObjectContainer. /// /// backs up a database file of an open ObjectContainer. ///

While the backup is running, the ObjectContainer can continue to be /// used. Changes that are made while the backup is in progress, will be applied to /// the open ObjectContainer and to the backup.

/// While the backup is running, the ObjectContainer should not be closed.

/// If a file already exists at the specified path, it will be overwritten.

/// The /// Db4objects.Db4o.IO.IStorage /// used for backup is the one configured for this container. ///
/// a fully qualified path /// db4o database file was closed or failed to open. /// /// /// is thrown when the operation is not supported in current /// configuration/environment /// /// I/O operation failed or was unexpectedly interrupted. /// void Backup(string path); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Query/0000755000175000017500000000000011700531646024214 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Query/IEvaluation.cs0000644000175000017500000000347611700531646026775 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Query { /// for implementation of callback evaluations. /// /// for implementation of callback evaluations. ///

/// To constrain a /// IQuery /// node with your own callback /// Evaluation, construct an object that implements the /// Evaluation interface and register it by passing it /// to /// IQuery.Constrain(object) /// . ///

/// Evaluations are called as the last step during query execution, /// after all other constraints have been applied. Evaluations in higher /// level /// IQuery /// nodes in the query graph are called first. ///

Java client/server only:
/// db4o first attempts to use Java Serialization to allow to pass final /// variables to the server. Please make sure that all variables that are /// used within the /// Evaluate(ICandidate) /// method are Serializable. This may include /// the class an anonymous Evaluation object is created in. If db4o is /// not successful at using Serialization, the Evaluation is transported /// to the server in a db4o /// Db4objects.Db4o.IO.MemoryBin /// . In this case final variables can /// not be restored. ///
public interface IEvaluation { /// /// callback method during /// query execution /// . /// /// reference to the candidate persistent object. void Evaluate(ICandidate candidate); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Query/ICandidate.cs0000644000175000017500000000361511700531646026535 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o.Query { /// /// candidate for /// IEvaluation /// callbacks. ///

/// During /// query execution /// all registered /// IEvaluation /// callback /// handlers are called with /// ICandidate /// proxies that represent the persistent objects that /// meet all other /// IQuery /// criteria. ///

/// A /// ICandidate /// provides access to the persistent object it /// represents and allows to specify, whether it is to be included in the /// Db4objects.Db4o.IObjectSet /// resultset. ///
public interface ICandidate { /// /// returns the persistent object that is represented by this query /// ICandidate /// . /// /// Object the persistent object. object GetObject(); /// /// specify whether the Candidate is to be included in the /// Db4objects.Db4o.IObjectSet /// resultset. ///

/// This method may be called multiple times. The last call prevails. ///
/// inclusion. void Include(bool flag); /// /// returns the /// Db4objects.Db4o.IObjectContainer /// the Candidate object is stored in. /// /// /// the /// Db4objects.Db4o.IObjectContainer /// IObjectContainer ObjectContainer(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Query/IConstraint.cs0000644000175000017500000002631511700531646027007 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Query { /// /// constraint to limit the objects returned upon /// query execution /// . ///

/// Constraints are constructed by calling /// Db4objects.Db4o.Query.IQuery.Constrain /// /// . ///

/// Constraints can be joined with the methods /// Db4objects.Db4o.Query.IConstraint.And /// /// and /// Db4objects.Db4o.Query.IConstraint.Or /// /// . ///

/// The methods to modify the constraint evaluation algorithm may /// be merged, to construct combined evaluation rules. /// Examples: ///
    ///
  • Constraint.Smaller().Equal() for "smaller or equal"
  • ///
  • Constraint.Not().Like() for "not like"
  • ///
  • Constraint.Not().Greater().Equal() for "not greater or equal"
  • ///
///
public interface IConstraint { /// links two Constraints for AND evaluation. /// /// links two Constraints for AND evaluation. /// For example:
/// query.Constrain(typeof(Pilot));
/// query.Descend("points").Constrain(101).Smaller().And(query.Descend("name").Constrain("Test Pilot0"));
/// will retrieve all pilots with points less than 101 and name as "Test Pilot0"
///
/// /// the other /// Db4objects.Db4o.Query.IConstraint /// /// /// a new /// Db4objects.Db4o.Query.IConstraint /// , that can be used for further calls /// to /// And /// and /// Or /// IConstraint And(IConstraint with); /// links two Constraints for OR evaluation. /// /// links two Constraints for OR evaluation. /// For example:

/// query.Constrain(typeof(Pilot));
/// query.Descend("points").Constrain(101).Greater().Or(query.Descend("name").Constrain("Test Pilot0"));
/// will retrieve all pilots with points more than 101 or pilots with the name "Test Pilot0"
///
/// /// the other /// Db4objects.Db4o.Query.IConstraint /// /// /// a new /// Db4objects.Db4o.Query.IConstraint /// , that can be used for further calls /// to /// And /// and /// Or /// IConstraint Or(IConstraint with); /// /// Used in conjunction with /// Db4objects.Db4o.Query.IConstraint.Smaller /// /// or /// Db4objects.Db4o.Query.IConstraint.Greater /// /// to create constraints /// like "smaller or equal", "greater or equal". /// For example:
/// query.Constrain(typeof(Pilot));
/// query.Descend("points").Constrain(101).Smaller().Equal();
/// will return all pilots with points <= 101.
///
/// /// this /// Db4objects.Db4o.Query.IConstraint /// to allow the chaining of method calls. /// IConstraint Equal(); /// sets the evaluation mode to >. /// /// sets the evaluation mode to >. /// For example:
/// query.Constrain(typeof(Pilot));
/// query.Descend("points").Constrain(101).Greater()
/// will return all pilots with points > 101.
///
/// /// this /// Db4objects.Db4o.Query.IConstraint /// to allow the chaining of method calls. /// IConstraint Greater(); /// sets the evaluation mode to <. /// /// sets the evaluation mode to <. /// For example:
/// query.Constrain(typeof(Pilot));
/// query.Descend("points").Constrain(101).Smaller()
/// will return all pilots with points < 101.
///
/// /// this /// Db4objects.Db4o.Query.IConstraint /// to allow the chaining of method calls. /// IConstraint Smaller(); /// sets the evaluation mode to identity comparison. /// /// sets the evaluation mode to identity comparison. In this case only /// objects having the same database identity will be included in the result set. /// For example:
/// Pilot pilot = new Pilot("Test Pilot1", 100);
/// Car car = new Car("BMW", pilot);
/// container.Store(car);
/// // Change the name, the pilot instance stays the same
/// pilot.SetName("Test Pilot2");
/// // create a new car
/// car = new Car("Ferrari", pilot);
/// container.Store(car);
/// IQuery query = container.Query();
/// query.Constrain(typeof(Car));
/// // All cars having pilot with the same database identity
/// // will be retrieved. As we only created Pilot object once
/// // it should mean all car objects
/// query.Descend("_pilot").Constrain(pilot).Identity();

///
/// /// this /// Db4objects.Db4o.Query.IConstraint /// to allow the chaining of method calls. /// IConstraint Identity(); /// set the evaluation mode to object comparison (query by example). /// set the evaluation mode to object comparison (query by example). /// /// this /// IConstraint /// to allow the chaining of method calls. /// IConstraint ByExample(); /// sets the evaluation mode to "like" comparison. /// /// sets the evaluation mode to "like" comparison. This mode will include /// all objects having the constrain expression somewhere inside the string field. /// For example:
/// Pilot pilot = new Pilot("Test Pilot1", 100);
/// container.Store(pilot);
/// ...
/// query.Constrain(typeof(Pilot));
/// // All pilots with the name containing "est" will be retrieved
/// query.Descend("name").Constrain("est").Like();
///
/// /// this /// Db4objects.Db4o.Query.IConstraint /// to allow the chaining of method calls. /// IConstraint Like(); /// Sets the evaluation mode to string contains comparison. /// /// Sets the evaluation mode to string contains comparison. The contains comparison is case sensitive.
/// For example:
/// Pilot pilot = new Pilot("Test Pilot1", 100);
/// container.Store(pilot);
/// ...
/// query.Constrain(typeof(Pilot));
/// // All pilots with the name containing "est" will be retrieved
/// query.Descend("name").Constrain("est").Contains();
/// Like() for case insensitive string comparison ///
/// /// this /// Db4objects.Db4o.Query.IConstraint /// to allow the chaining of method calls. /// IConstraint Contains(); /// sets the evaluation mode to string StartsWith comparison. /// /// sets the evaluation mode to string StartsWith comparison. /// For example:
/// Pilot pilot = new Pilot("Test Pilot0", 100);
/// container.Store(pilot);
/// ...
/// query.Constrain(typeof(Pilot));
/// query.Descend("name").Constrain("Test").StartsWith(true);
///
/// comparison will be case sensitive if true, case insensitive otherwise /// /// /// this /// Db4objects.Db4o.Query.IConstraint /// to allow the chaining of method calls. /// IConstraint StartsWith(bool caseSensitive); /// sets the evaluation mode to string EndsWith comparison. /// /// sets the evaluation mode to string EndsWith comparison. /// For example:
/// Pilot pilot = new Pilot("Test Pilot0", 100);
/// container.Store(pilot);
/// ...
/// query.Constrain(typeof(Pilot));
/// query.Descend("name").Constrain("T0").EndsWith(false);
///
/// comparison will be case sensitive if true, case insensitive otherwise /// /// /// this /// Db4objects.Db4o.Query.IConstraint /// to allow the chaining of method calls. /// IConstraint EndsWith(bool caseSensitive); /// turns on Not() comparison. /// /// turns on Not() comparison. All objects not fullfilling the constrain condition will be returned. /// For example:
/// Pilot pilot = new Pilot("Test Pilot1", 100);
/// container.Store(pilot);
/// ...
/// query.Constrain(typeof(Pilot));
/// query.Descend("name").Constrain("t0").EndsWith(true).Not();
///
/// /// this /// Db4objects.Db4o.Query.IConstraint /// to allow the chaining of method calls. /// IConstraint Not(); /// /// returns the Object the query graph was constrained with to /// create this /// IConstraint /// . /// /// Object the constraining object. object GetObject(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Query/IQuery.cs0000644000175000017500000001367011700531646025770 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Query { /// handle to a node in a S.O.D.A. /// /// handle to a node in a S.O.D.A. query graph. ///

/// A node in the query graph can represent multiple /// classes, one class or an attribute of a class.

The graph /// is automatically extended with attributes of added constraints /// (see /// Constrain(object) /// ) and upon calls to /// Descend(string) /// that request nodes that do not yet exist. ///

/// References to joined nodes in the query graph can be obtained /// by "walking" along the nodes of the graph with the method /// Descend(string) /// . ///

/// Execute() /// evaluates the entire graph against all persistent objects. ///

/// Execute() /// can be called from any /// IQuery /// node /// of the graph. It will return an /// Db4objects.Db4o.IObjectSet /// filled with /// objects of the class/classes that the node, it was called from, /// represents.

/// Note:
/// Native queries /// are the recommended main query /// interface of db4o.
///
public interface IQuery { /// adds a constraint to this node. /// /// adds a constraint to this node. ///

/// If the constraint contains attributes that are not yet /// present in the query graph, the query graph is extended /// accordingly. ///

/// Special behaviour for: ///
    ///
  • class /// System.Type<T> /// : confine the result to objects of one /// class or to objects implementing an interface.
  • ///
  • interface /// IEvaluation /// : run /// evaluation callbacks against all candidates.
  • ///
///
/// the constraint to be added to this Query. /// /// /// IConstraint /// a new /// IConstraint /// for this /// query node or null for objects implementing the /// IEvaluation /// interface. /// IConstraint Constrain(object constraint); /// /// returns a /// IConstraints /// object that holds an array of all constraints on this node. /// /// /// /// IConstraints /// on this query node. /// IConstraints Constraints(); /// returns a reference to a descendant node in the query graph. /// /// returns a reference to a descendant node in the query graph. ///

If the node does not exist, it will be created. ///

/// All classes represented in the query node are tested, whether /// they contain a field with the specified field name. The /// descendant Query node will be created from all possible candidate /// classes. ///
/// path to the descendant. /// /// descendant /// IQuery /// node /// IQuery Descend(string fieldName); /// /// executes the /// IQuery /// . /// /// /// /// Db4objects.Db4o.IObjectSet /// - the result of the /// IQuery /// . /// IObjectSet Execute(); /// /// adds an ascending ordering criteria to this node of /// the query graph. /// /// /// adds an ascending ordering criteria to this node of /// the query graph. ///

/// If multiple ordering criteria are applied, the chronological /// order of method calls is relevant: criteria created by 'earlier' calls are /// considered more significant, i.e. 'later' criteria only have an effect /// for elements that are considered equal by all 'earlier' criteria. ///

///

/// As an example, consider a type with two int fields, and an instance set /// {(a:1,b:3),(a:2,b:2),(a:1,b:2),(a:2,b:3)}. The call sequence [orderAscending(a), /// orderDescending(b)] will result in [(a:1,b:3),(a:1,b:2),(a:2,b:3),(a:2,b:2)]. ///

///
/// /// this /// IQuery /// object to allow the chaining of method calls. /// IQuery OrderAscending(); /// /// adds a descending order criteria to this node of /// the query graph. /// /// /// adds a descending order criteria to this node of /// the query graph. ///

/// For semantics of multiple calls setting ordering criteria, see /// OrderAscending() /// . ///
/// /// this /// IQuery /// object to allow the chaining of method calls. /// IQuery OrderDescending(); /// Sort the resulting ObjectSet by the given comparator. /// Sort the resulting ObjectSet by the given comparator. /// The comparator to apply. /// /// this /// IQuery /// object to allow the chaining of method calls. /// IQuery SortBy(IQueryComparator comparator); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Query/IQueryComparator.cs0000644000175000017500000000107711700531646030016 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Query { /// /// This interface is not used in .NET. /// public interface IQueryComparator { /// Implement to compare two arguments for sorting. /// /// Implement to compare two arguments for sorting. /// Return a negative value, zero, or a positive value if /// the first argument is smaller, equal or greater than /// the second. /// int Compare(object first, object second); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Query/IConstraints.cs0000644000175000017500000000167311700531646027172 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Query { /// /// set of /// IConstraint /// objects. ///

This extension of the /// IConstraint /// interface allows /// setting the evaluation mode of all contained /// IConstraint /// objects with single calls. ///

/// See also /// IQuery.Constraints() /// . ///
public interface IConstraints : IConstraint { /// /// returns an array of the contained /// IConstraint /// objects. /// /// /// an array of the contained /// IConstraint /// objects. /// IConstraint[] ToArray(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Query/Predicate.cs0000644000175000017500000001340111700531646026442 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Query { /// Base class for native queries. /// /// Base class for native queries. ///

Native Queries provide the ability to run one or more lines /// of code against all instances of a class. Native query expressions should /// return true to mark specific instances as part of the result set. /// db4o will attempt to optimize native query expressions and run them /// against indexes and without instantiating actual objects, where this is /// possible.

/// The syntax of the enclosing object for the native query expression varies /// slightly, depending on the language version used. Here are some examples, /// how a simple native query will look like in some of the programming languages and /// dialects that db4o supports:

/// /// // C# .NET 2.0
/// IList <Cat> cats = db.Query <Cat> (delegate(Cat cat) {
///    return cat.Name == "Occam";
/// });
///
///
/// // Java JDK 5
/// List <Cat> cats = db.query(new Predicate<Cat>() {
///    public boolean match(Cat cat) {
///       return cat.getName().equals("Occam");
///    }
/// });
///
///
/// // Java JDK 1.2 to 1.4
/// List cats = db.query(new Predicate() {
///    public boolean match(Cat cat) {
///       return cat.getName().equals("Occam");
///    }
/// });
///
///
/// // Java JDK 1.1
/// ObjectSet cats = db.query(new CatOccam());
///
/// public static class CatOccam extends Predicate {
///    public boolean match(Cat cat) {
///       return cat.getName().equals("Occam");
///    }
/// });
///
///
/// // C# .NET 1.1
/// IList cats = db.Query(new CatOccam());
///
/// public class CatOccam : Predicate {
///    public boolean Match(Cat cat) {
///       return cat.Name == "Occam";
///    }
/// });
///
///
/// Summing up the above:
/// In order to run a Native Query, you can
/// - use the delegate notation for .NET 2.0.
/// - extend the Predicate class for all other language dialects

/// A class that extends Predicate is required to /// implement the #match() / #Match() method, following the native query /// conventions:
/// - The name of the method is "#match()" (Java) / "#Match()" (.NET).
/// - The method must be public public.
/// - The method returns a boolean.
/// - The method takes one parameter.
/// - The Type (.NET) / Class (Java) of the parameter specifies the extent.
/// - For all instances of the extent that are to be included into the /// resultset of the query, the match method should return true. For all /// instances that are not to be included, the match method should return /// false.

///
[System.Serializable] public abstract class Predicate { /// public for implementation reasons, please ignore. /// public for implementation reasons, please ignore. public static readonly string PredicatemethodName = "match"; private Type _extentType; [System.NonSerialized] private MethodInfo cachedFilterMethod = null; public Predicate() : this(null) { } public Predicate(Type extentType) { _extentType = extentType; } public virtual MethodInfo GetFilterMethod() { if (cachedFilterMethod != null) { return cachedFilterMethod; } MethodInfo[] methods = GetType().GetMethods(); for (int methodIdx = 0; methodIdx < methods.Length; methodIdx++) { MethodInfo method = methods[methodIdx]; if ((!method.Name.Equals(PredicatePlatform.PredicatemethodName)) || Sharpen.Runtime.GetParameterTypes (method).Length != 1) { continue; } cachedFilterMethod = method; string targetName = Sharpen.Runtime.GetParameterTypes(method)[0].FullName; if (!"java.lang.Object".Equals(targetName)) { break; } } if (cachedFilterMethod == null) { throw new ArgumentException("Invalid predicate."); } return cachedFilterMethod; } /// public for implementation reasons, please ignore. /// public for implementation reasons, please ignore. public virtual Type ExtentType() { if (_extentType == null) { _extentType = FilterParameterType(); } return _extentType; } private Type FilterParameterType() { return (Type)Sharpen.Runtime.GetParameterTypes(GetFilterMethod())[0]; } /// public for implementation reasons, please ignore. /// public for implementation reasons, please ignore. public virtual bool AppliesTo(object candidate) { try { MethodInfo filterMethod = GetFilterMethod(); Platform4.SetAccessible(filterMethod); object ret = filterMethod.Invoke(this, new object[] { candidate }); return ((bool)ret); } catch (Exception) { // TODO: log this exception somewhere? // e.printStackTrace(); return false; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/0000755000175000017500000000000011700531646023647 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/EmergencyShutdownReadOnlyException.cs0000644000175000017500000000101111700531646033156 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// A previous IO exception has switched the database file /// to read-only mode for controlled shutdown. /// /// /// A previous IO exception has switched the database file /// to read-only mode for controlled shutdown. /// [System.Serializable] public class EmergencyShutdownReadOnlyException : Db4oIOException { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/ISystemInfo.cs0000644000175000017500000000317611700531646026416 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Ext { /// provides information about system state and system settings. /// provides information about system state and system settings. public interface ISystemInfo { /// returns the number of entries in the Freespace Manager. /// /// returns the number of entries in the Freespace Manager. ///

A high value for the number of freespace entries /// is an indication that the database is fragmented and /// that defragment should be run. ///
/// the number of entries in the Freespace Manager. int FreespaceEntryCount(); /// returns the freespace size in the database in bytes. /// /// returns the freespace size in the database in bytes. ///

When db4o stores modified objects, it allocates /// a new slot for it. During commit the old slot is freed. /// Free slots are collected in the freespace manager, so /// they can be reused for other objects. ///

This method returns a sum of the size of all /// free slots in the database file. ///

To reclaim freespace run defragment. ///
/// the freespace size in the database in bytes. long FreespaceSize(); /// Returns the total size of the database on disk. /// Returns the total size of the database on disk. /// total size of database on disk long TotalSize(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/Db4oUnexpectedException.cs0000644000175000017500000000064711700531646030701 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Ext { /// Unexpected fatal error is encountered. /// Unexpected fatal error is encountered. [System.Serializable] public class Db4oUnexpectedException : Exception { public Db4oUnexpectedException(Exception cause) : base(cause.Message, cause) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/DatabaseReadOnlyException.cs0000644000175000017500000000126111700531646031217 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// db4o-specific exception.

/// This exception is thrown when a write operation is attempted /// on a database in a read-only mode. ///
/// /// db4o-specific exception.

/// This exception is thrown when a write operation is attempted /// on a database in a read-only mode. ///
/// [System.Serializable] public class DatabaseReadOnlyException : Db4oRecoverableException { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/Db4oException.cs0000644000175000017500000000361411700531646026651 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Ext { /// /// db4o exception wrapper: Exceptions occurring during internal processing /// will be proliferated to the client calling code encapsulated in an exception /// of this type. /// /// /// db4o exception wrapper: Exceptions occurring during internal processing /// will be proliferated to the client calling code encapsulated in an exception /// of this type. The original exception, if any, is available through /// Db4oException#getCause(). /// [System.Serializable] public class Db4oException : Exception { /// Simple constructor public Db4oException() : this(null, null) { } /// Constructor with an exception message specified /// exception message public Db4oException(string msg) : this(msg, null) { } /// Constructor with an exception cause specified /// exception cause public Db4oException(Exception cause) : this(null, cause) { } /// /// Constructor with an exception message selected /// from the internal message collection. /// /// /// Constructor with an exception message selected /// from the internal message collection. /// /// internal db4o message number public Db4oException(int messageConstant) : this(Db4objects.Db4o.Internal.Messages .Get(messageConstant)) { } /// Constructor with an exception message and cause specified /// exception message /// exception cause public Db4oException(string msg, Exception cause) : base(msg, cause) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/BackupInProgressException.cs0000644000175000017500000000103511700531646031275 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// db4o-specific exception. /// /// db4o-specific exception.

/// This exception is thrown when the current /// backup /// process encounters another backup process already running. ///
[System.Serializable] public class BackupInProgressException : Db4oRecoverableException { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/IExtObjectSet.cs0000644000175000017500000000314611700531646026656 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o.Ext { /// /// extended functionality for the /// IObjectSet /// interface. ///

Every db4o /// IObjectSet /// always is an ExtObjectSet so a cast is possible.

/// Db4objects.Db4o.IObjectSet.Ext() /// is a convenient method to perform the cast.

/// The ObjectSet functionality is split to two interfaces to allow newcomers to /// focus on the essential methods. ///
public interface IExtObjectSet : IObjectSet { /// returns an array of internal IDs that correspond to the contained objects. /// /// /// returns an array of internal IDs that correspond to the contained objects. ///

///
/// IExtObjectContainer.GetID(object) /// /// IExtObjectContainer.GetByID(long) /// long[] GetIDs(); /// returns the item at position [index] in this ObjectSet. /// /// returns the item at position [index] in this ObjectSet. ///

/// The object will be activated. ///
/// the index position in this ObjectSet. /// the activated object. object Get(int index); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/InvalidIDException.cs0000644000175000017500000000234311700531646027662 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// db4o-specific exception.

/// This exception is thrown when the supplied object ID /// is incorrect (outside the scope of the database IDs). ///
/// /// db4o-specific exception.

/// This exception is thrown when the supplied object ID /// is incorrect (outside the scope of the database IDs). ///
/// IExtObjectContainer.Bind(object, long) /// /// IExtObjectContainer.GetByID(long) /// [System.Serializable] public class InvalidIDException : Db4oRecoverableException { /// Constructor allowing to specify the exception cause /// cause exception public InvalidIDException(Exception cause) : base(cause) { } /// Constructor allowing to specify the offending id /// the offending id public InvalidIDException(int id) : base("id: " + id) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/IDb4oCallback.cs0000644000175000017500000000062211700531646026514 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Ext { /// generic callback interface. /// generic callback interface. public interface IDb4oCallback { /// the callback method /// the object passed to the callback method void Callback(object obj); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/ObjectNotStorableException.cs0000644000175000017500000000201011700531646031431 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Ext { /// /// this Exception is thrown, if objects can not be stored and if /// db4o is configured to throw Exceptions on storage failures. /// /// /// this Exception is thrown, if objects can not be stored and if /// db4o is configured to throw Exceptions on storage failures. /// /// Db4objects.Db4o.Config.IConfiguration.ExceptionsOnNotStorable(bool) [System.Serializable] public class ObjectNotStorableException : Db4oRecoverableException { public ObjectNotStorableException(IReflectClass a_class) : base(Db4objects.Db4o.Internal.Messages .Get(a_class.IsPrimitive() ? 59 : 45, a_class.GetName())) { } public ObjectNotStorableException(string message) : base(message) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/DatabaseMaximumSizeReachedException.cs0000644000175000017500000000160511700531646033230 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// db4o-specific exception.

/// This exception is thrown when the database file reaches the /// maximum allowed size. ///
/// /// db4o-specific exception.

/// This exception is thrown when the database file reaches the /// maximum allowed size. Upon throwing the exception the database is /// switched to the read-only mode.
/// The maximum database size is configurable /// and can reach up to 254GB. ///
/// Db4objects.Db4o.Config.IConfiguration.BlockSize(int) /// [System.Serializable] public class DatabaseMaximumSizeReachedException : Db4oRecoverableException { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/DatabaseClosedException.cs0000644000175000017500000000133611700531646030716 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// db4o-specific exception. /// /// db4o-specific exception.

/// This exception is thrown when the object container required for /// the current operation was closed or failed to open. ///
/// Db4objects.Db4o.Db4oFactory.OpenFile(string) /// /// Db4objects.Db4o.IObjectContainer.Close() /// [System.Serializable] public class DatabaseClosedException : Db4oFatalException { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/IExtObjectServer.cs0000644000175000017500000000652711700531646027377 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Ext { /// extended functionality for the ObjectServer interface. /// /// extended functionality for the ObjectServer interface. ///

Every ObjectServer also always is an ExtObjectServer /// so a cast is possible.

/// Db4objects.Db4o.IObjectServer.Ext() /// /// is a convenient method to perform the cast.

/// The functionality is split to two interfaces to allow newcomers to /// focus on the essential methods. ///
public interface IExtObjectServer : IObjectServer { /// backs up the database file used by the ObjectServer. /// /// backs up the database file used by the ObjectServer. ///

While the backup is running, the ObjectServer can continue to be /// used. Changes that are made while the backup is in progress, will be applied to /// the open ObjectServer and to the backup.

/// While the backup is running, the ObjectContainer should not be closed.

/// If a file already exists at the specified path, it will be overwritten.

///
/// a fully qualified path /// void Backup(string path); /// returns the number of connected clients. /// returns the number of connected clients. int ClientCount(); /// /// returns the /// Db4objects.Db4o.Config.IConfiguration /// /// context for this ObjectServer. ///

/// Upon opening an ObjectServer with any of the factory methods in the /// Db4objects.Db4o.Db4oFactory /// class, the global /// Db4objects.Db4o.Config.IConfiguration /// /// context /// is copied into the ObjectServer. The /// Db4objects.Db4o.Config.IConfiguration /// /// can be modified individually for /// each ObjectServer without any effects on the global settings.

///
/// the Configuration context for this ObjectServer /// Db4objects.Db4o.Db4oFactory.Configure() /// IConfiguration Configure(); /// returns the ObjectContainer used by the server. /// /// returns the ObjectContainer used by the server. ///

///
/// the ObjectContainer used by the server IObjectContainer ObjectContainer(); /// removes client access permissions for the specified user. /// /// removes client access permissions for the specified user. ///

///
/// the name of the user void RevokeAccess(string userName); /// The local port this server uses, 0 if disconnected or in embedded mode int Port(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/Db4oUUID.cs0000644000175000017500000000637111700531646025464 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Text; namespace Db4objects.Db4o.Ext { /// a unique universal identify for an object. /// /// a unique universal identify for an object.

The db4o UUID consists of /// two parts:
- an indexed long for fast access,
- the signature of the /// IObjectContainer /// the object was created with. ///

Db4oUUIDs are valid representations of objects over multiple /// ObjectContainers ///
public class Db4oUUID { private readonly long longPart; private readonly byte[] signaturePart; /// constructs a Db4oUUID from a long part and a signature part /// the long part /// the signature part public Db4oUUID(long longPart_, byte[] signaturePart_) { longPart = longPart_; signaturePart = signaturePart_; } /// returns the long part of this UUID. /// /// returns the long part of this UUID.

To uniquely identify an object /// universally, db4o uses an indexed long and a reference to the /// Db4oDatabase object it was created on. ///
/// the long part of this UUID. public virtual long GetLongPart() { return longPart; } /// returns the signature part of this UUID. /// /// returns the signature part of this UUID.



To uniquely /// identify an object universally, db4o uses an indexed long and a reference to /// the Db4oDatabase singleton object of the /// IObjectContainer /// it was created on. This method /// returns the signature of the Db4oDatabase object of the ObjectContainer: the /// signature of the origin ObjectContainer. ///
/// the signature of the Db4oDatabase for this UUID. public virtual byte[] GetSignaturePart() { return signaturePart; } public override bool Equals(object o) { if (this == o) { return true; } if (o == null || GetType() != o.GetType()) { return false; } Db4objects.Db4o.Ext.Db4oUUID other = (Db4objects.Db4o.Ext.Db4oUUID)o; if (longPart != other.longPart) { return false; } if (signaturePart == null) { return other.signaturePart == null; } if (signaturePart.Length != other.signaturePart.Length) { return false; } for (int i = 0; i < signaturePart.Length; i++) { if (signaturePart[i] != other.signaturePart[i]) { return false; } } return true; } public override int GetHashCode() { return (int)(longPart ^ ((longPart) >> (32 & 0x1f))); } public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append(GetType().FullName); sb.Append(" sig: "); for (int i = 0; i < signaturePart.Length; i++) { char c = (char)signaturePart[i]; sb.Append(c); } sb.Append(" long: "); sb.Append(longPart); return sb.ToString(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/IExtObjectContainer.cs0000644000175000017500000006454311700531646030055 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Ext; using Db4objects.Db4o.IO; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Ext { /// /// extended functionality for the /// IObjectContainer /// interface. ///

Every db4o /// IObjectContainer /// always is an ExtObjectContainer so a cast is possible.

/// ObjectContainer.ext() /// is a convenient method to perform the cast.

/// The ObjectContainer functionality is split to two interfaces to allow newcomers to /// focus on the essential methods. ///
public partial interface IExtObjectContainer : IObjectContainer { /// activates an object with the current activation strategy. /// /// activates an object with the current activation strategy. /// In regular activation mode the object will be activated to the /// global activation depth, ( see /// Db4objects.Db4o.Config.IConfiguration.ActivationDepth() /// /// ) /// and all configured settings for /// Db4objects.Db4o.Config.IObjectClass.MaximumActivationDepth(int) /// /// /// and /// Db4objects.Db4o.Config.IObjectClass.MaximumActivationDepth(int) /// /// will be respected.

/// In Transparent Activation Mode ( see /// Db4objects.Db4o.TA.TransparentActivationSupport /// /// ) /// the parameter object will only be activated, if it does not implement /// Db4objects.Db4o.TA.IActivatable /// . All referenced members that do not implement /// Db4objects.Db4o.TA.IActivatable /// will also be activated. Any /// Db4objects.Db4o.TA.IActivatable /// objects /// along the referenced graph will break cascading activation. ///
/// /// void Activate(object obj); /// deactivates an object. /// /// deactivates an object. /// Only the passed object will be deactivated, i.e, no object referenced by this /// object will be deactivated. /// /// the object to be deactivated. void Deactivate(object obj); /// backs up a database file of an open ObjectContainer. /// /// backs up a database file of an open ObjectContainer. ///

While the backup is running, the ObjectContainer can continue to be /// used. Changes that are made while the backup is in progress, will be applied to /// the open ObjectContainer and to the backup.

/// While the backup is running, the ObjectContainer should not be closed.

/// If a file already exists at the specified path, it will be overwritten.

/// The /// Db4objects.Db4o.IO.IStorage /// used for backup is the one configured for this container. ///
/// a fully qualified path /// db4o database file was closed or failed to open. /// /// /// is thrown when the operation is not supported in current /// configuration/environment /// /// I/O operation failed or was unexpectedly interrupted. /// /// /// void Backup(string path); /// backs up a database file of an open ObjectContainer. /// /// backs up a database file of an open ObjectContainer. ///

While the backup is running, the ObjectContainer can continue to be /// used. Changes that are made while the backup is in progress, will be applied to /// the open ObjectContainer and to the backup.

/// While the backup is running, the ObjectContainer should not be closed.

/// If a file already exists at the specified path, it will be overwritten.

/// This method is intended for cross-storage backups, i.e. backup from an in-memory /// database to a file. ///
/// /// the /// Db4objects.Db4o.IO.IStorage /// to be used for backup /// /// a fully qualified path /// db4o database file was closed or failed to open. /// /// /// is thrown when the operation is not supported in current /// configuration/environment /// /// I/O operation failed or was unexpectedly interrupted. /// /// /// void Backup(IStorage targetStorage, string path); /// binds an object to an internal object ID. /// /// binds an object to an internal object ID. ///

This method uses the ID parameter to load the /// corresponding stored object into memory and replaces this memory /// reference with the object parameter. The method may be used to replace /// objects or to reassociate an object with it's stored instance /// after closing and opening a database file. A subsequent call to /// set(Object) /// is /// necessary to update the stored object.

/// Requirements:
- The ID needs to be a valid internal object ID, /// previously retrieved with /// getID(Object) /// .
/// - The object parameter needs to be of the same class as the stored object.

///
/// GetID(object) /// the object that is to be bound /// the internal id the object is to be bound to /// db4o database file was closed or failed to open. /// /// /// when the provided id is outside the scope of the /// database IDs. /// /// /// void Bind(object obj, long id); /// returns the Configuration context for this ObjectContainer. /// /// returns the Configuration context for this ObjectContainer. ///

/// Upon opening an ObjectContainer with any of the factory methods in the /// Db4o class /// , the global /// IConfiguration /// context /// is copied into the ObjectContainer. The /// IConfiguration /// can be modified individually for /// each ObjectContainer without any effects on the global settings.

///
/// /// /// IConfiguration /// the Configuration /// context for this ObjectContainer /// /// Db4objects.Db4o.Db4oFactory.Configure() /// IConfiguration Configure(); /// returns a member at the specific path without activating intermediate objects. /// /// /// returns a member at the specific path without activating intermediate objects. ///

/// This method allows navigating from a persistent object to it's members in a /// performant way without activating or instantiating intermediate objects. ///
/// the parent object that is to be used as the starting point. /// an array of field names to navigate by /// the object at the specified path or null if no object is found object Descend(object obj, string[] path); /// returns the stored object for an internal ID. /// /// returns the stored object for an internal ID. ///

This is the fastest method for direct access to objects. Internal /// IDs can be obtained with /// getID(Object) /// . /// Objects will not be activated by this method. They will be returned in the /// activation state they are currently in, in the local cache.

/// Passing invalid id values to this method may result in all kinds of /// exceptions being thrown. OutOfMemoryError and arithmetic exceptions /// may occur. If an application is known to use invalid IDs, it is /// recommended to call this method within a catch-all block. ///
/// the internal ID /// /// the object associated with the passed ID or null, /// if no object is associated with this ID in this ObjectContainer. /// /// Why activation? /// /// db4o database file was closed or failed to open. /// /// /// when the provided id is outside the scope of the /// file length. /// /// /// object GetByID(long Id); /// /// returns a stored object for a /// Db4oUUID /// . ///

/// This method is intended for replication and for long-term /// external references to objects. To get a /// Db4oUUID /// for an /// object use /// GetObjectInfo(object) /// and /// IObjectInfo.GetUUID() /// .

/// Objects will not be activated by this method. They will be returned in the /// activation state they are currently in, in the local cache.

///
/// the UUID /// the object for the UUID /// Why activation? /// /// I/O operation failed or was unexpectedly interrupted. /// /// db4o database file was closed or failed to open. /// /// /// object GetByUUID(Db4oUUID uuid); /// returns the internal unique object ID. /// /// returns the internal unique object ID. ///

db4o assigns an internal ID to every object that is stored. IDs are /// guaranteed to be unique within one ObjectContainer. /// An object carries the same ID in every db4o session. Internal IDs can /// be used to look up objects with the very fast /// getByID /// method.

/// Internal IDs will change when a database is defragmented. Use /// GetObjectInfo(object) /// , /// IObjectInfo.GetUUID() /// and /// GetByUUID(Db4oUUID) /// for long-term external references to /// objects.

///
/// any object /// /// the associated internal ID or 0, if the passed /// object is not stored in this ObjectContainer. /// long GetID(object obj); /// /// returns the /// IObjectInfo /// for a stored object. ///

This method will return null, if the passed /// object is not stored to this ObjectContainer.

///
/// the stored object /// /// the /// IObjectInfo /// /// IObjectInfo GetObjectInfo(object obj); /// returns the Db4oDatabase object for this ObjectContainer. /// returns the Db4oDatabase object for this ObjectContainer. /// the Db4oDatabase identity object for this ObjectContainer. Db4oDatabase Identity(); /// tests if an object is activated. /// /// tests if an object is activated. ///

isActive returns false if an object is not /// stored within the ObjectContainer.

///
/// to be tested

/// true if the passed object is active. bool IsActive(object obj); /// tests if an object with this ID is currently cached. /// /// tests if an object with this ID is currently cached. ///

///
/// the internal ID bool IsCached(long Id); /// tests if this ObjectContainer is closed. /// /// tests if this ObjectContainer is closed. ///

///
/// true if this ObjectContainer is closed. bool IsClosed(); /// tests if an object is stored in this ObjectContainer. /// /// tests if an object is stored in this ObjectContainer. ///

///
/// to be tested

/// true if the passed object is stored. /// db4o database file was closed or failed to open. /// /// bool IsStored(object obj); /// /// returns all class representations that are known to this /// ObjectContainer because they have been used or stored. /// /// /// returns all class representations that are known to this /// ObjectContainer because they have been used or stored. /// /// /// all class representations that are known to this /// ObjectContainer because they have been used or stored. /// IReflectClass[] KnownClasses(); /// returns the main synchronization lock. /// /// returns the main synchronization lock. ///

/// Synchronize over this object to ensure exclusive access to /// the ObjectContainer.

/// Handle the use of this functionality with extreme care, /// since deadlocks can be produced with just two lines of code. ///
/// Object the ObjectContainer lock object object Lock(); /// opens a new ObjectContainer on top of this ObjectContainer. /// /// opens a new ObjectContainer on top of this ObjectContainer. /// The ObjectContainer will have it's own transaction and /// it's own reference system. /// /// the new ObjectContainer session. /// 8.0 IObjectContainer OpenSession(); /// /// returns a transient copy of a persistent object with all members set /// to the values that are currently stored to the database. /// /// /// returns a transient copy of a persistent object with all members set /// to the values that are currently stored to the database. ///

/// The returned objects have no connection to the database.

/// With the committed parameter it is possible to specify, /// whether the desired object should contain the committed values or the /// values that were set by the running transaction with /// Db4objects.Db4o.IObjectContainer.Store(object) /// /// . ///

A possible use case for this feature:
/// An application might want to check all changes applied to an object /// by the running transaction.

///
/// the object that is to be cloned /// the member depth to which the object is to be instantiated /// whether committed or set values are to be returned /// the object object PeekPersisted(object @object, int depth, bool committed); /// unloads all clean indices from memory and frees unused objects. /// /// unloads all clean indices from memory and frees unused objects. ///

Call commit() and purge() consecutively to achieve the best /// result possible. This method can have a negative impact /// on performance since indices will have to be reread before further /// inserts, updates or queries can take place. ///
void Purge(); /// unloads a specific object from the db4o reference mechanism. /// /// unloads a specific object from the db4o reference mechanism. ///

db4o keeps references to all newly stored and /// instantiated objects in memory, to be able to manage object identities. ///

With calls to this method it is possible to remove an object from the /// reference mechanism, to allow it to be garbage collected. You are not required to /// call this method in the .NET and JDK 1.2 versions, since objects are /// referred to by weak references and garbage collection happens /// automatically.

An object removed with purge(Object) is not /// "known" to the ObjectContainer afterwards, so this method may also be /// used to create multiple copies of objects.

purge(Object) has /// no influence on the persistence state of objects. "Purged" objects can be /// reretrieved with queries.

///
/// the object to be removed from the reference mechanism. void Purge(object obj); /// Return the reflector currently being used by db4objects. /// Return the reflector currently being used by db4objects. /// the current Reflector. GenericReflector Reflector(); /// refreshs all members on a stored object to the specified depth. /// /// refreshs all members on a stored object to the specified depth. ///

If a member object is not activated, it will be activated by this method. ///

The isolation used is READ COMMITTED. This method will read all objects /// and values that have been committed by other transactions.

///
/// the object to be refreshed. /// /// the member /// depth /// to which refresh is to cascade. /// void Refresh(object obj, int depth); /// releases a semaphore, if the calling transaction is the owner. /// releases a semaphore, if the calling transaction is the owner. /// the name of the semaphore to be released. void ReleaseSemaphore(string name); /// deep update interface to store or update objects. /// /// deep update interface to store or update objects. ///

In addition to the normal storage interface, /// ObjectContainer#set(Object) /// , /// this method allows a manual specification of the depth, the passed object is to be updated.

///
/// the object to be stored or updated. /// the depth to which the object is to be updated /// com.db4o.ObjectContainer#set void Store(object obj, int depth); /// attempts to set a semaphore. /// /// attempts to set a semaphore. ///

/// Semaphores are transient multi-purpose named flags for /// ObjectContainers /// . ///

/// A transaction that successfully sets a semaphore becomes /// the owner of the semaphore. Semaphores can only be owned /// by a single transaction at one point in time.

/// This method returns true, if the transaction already owned /// the semaphore before the method call or if it successfully /// acquires ownership of the semaphore.

/// The waitForAvailability parameter allows to specify a time /// in milliseconds to wait for other transactions to release /// the semaphore, in case the semaphore is already owned by /// another transaction.

/// Semaphores are released by the first occurrence of one of the /// following:
/// - the transaction releases the semaphore with /// ReleaseSemaphore(string) ///
- the transaction is closed with /// Db4objects.Db4o.IObjectContainer.Close() /// ///
- C/S only: the corresponding /// Db4objects.Db4o.IObjectServer /// is /// closed.
- C/S only: the client /// Db4objects.Db4o.IObjectContainer /// looses the connection and is timed /// out.

Semaphores are set immediately. They are independant of calling /// Db4objects.Db4o.IObjectContainer.Commit() /// /// or /// Db4objects.Db4o.IObjectContainer.Rollback() /// /// .

Possible use cases /// for semaphores:
- prevent other clients from inserting a singleton at the same time. /// A suggested name for the semaphore: "SINGLETON_" + Object#getClass().getName().
- lock /// objects. A suggested name: "LOCK_" + /// getID(Object) ///
- /// generate a unique client ID. A suggested name: "CLIENT_" + /// System.currentTimeMillis().

///
/// the name of the semaphore to be set /// /// the time in milliseconds to wait for other /// transactions to release the semaphore. The parameter may be zero, if /// the method is to return immediately. /// /// /// boolean flag ///
true, if the semaphore could be set or if the /// calling transaction already owned the semaphore. ///
false, if the semaphore is owned by another /// transaction. ///
bool SetSemaphore(string name, int waitForAvailability); /// /// returns a /// IStoredClass /// meta information object. ///

/// There are three options how to use this method.
/// Any of the following parameters are possible:
/// - a fully qualified class name.
/// - a Class object.
/// - any object to be used as a template.

///
/// class name, Class object, or example object.

/// /// an instance of an /// IStoredClass /// meta information object. /// IStoredClass StoredClass(object clazz); /// /// returns an array of all /// IStoredClass /// meta information objects. /// IStoredClass[] StoredClasses(); /// /// returns the /// ISystemInfo /// for this ObjectContainer. ///

The /// ISystemInfo /// supplies methods that provide /// information about system state and system settings of this /// ObjectContainer. ///
/// /// the /// ISystemInfo /// for this ObjectContainer. /// ISystemInfo SystemInfo(); /// returns the current transaction serial number. /// /// returns the current transaction serial number. ///

This serial number can be used to query for modified objects /// and for replication purposes. ///
/// the current transaction serial number. long Version(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/IStoredClass.cs0000644000175000017500000000602711700531646026542 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// the internal representation of a stored class. /// the internal representation of a stored class. public interface IStoredClass { /// returns the name of this stored class. /// returns the name of this stored class. string GetName(); /// returns an array of IDs of all stored object instances of this stored class. /// /// returns an array of IDs of all stored object instances of this stored class. /// long[] GetIDs(); /// returns the StoredClass for the parent of the class, this StoredClass represents. /// /// returns the StoredClass for the parent of the class, this StoredClass represents. /// IStoredClass GetParentStoredClass(); /// returns all stored fields of this stored class. /// returns all stored fields of this stored class. IStoredField[] GetStoredFields(); /// returns true if this StoredClass has a class index. /// returns true if this StoredClass has a class index. bool HasClassIndex(); /// renames this stored class. /// /// renames this stored class. ///

After renaming one or multiple classes the ObjectContainer has /// to be closed and reopened to allow internal caches to be refreshed. ///

.NET: As the name you should provide [Classname, Assemblyname]

///
/// the new name void Rename(string name); // TODO: add field creation /// returns an existing stored field of this stored class. /// returns an existing stored field of this stored class. /// the name of the field /// /// the type of the field. /// There are four possibilities how to supply the type:
/// - a Class object. (.NET: a Type object)
/// - a fully qualified classname.
/// - any object to be used as a template.

/// - null, if the first found field should be returned. /// /// /// the /// IStoredField /// IStoredField StoredField(string name, object type); /// /// Returns the number of instances of this class that have been persisted to the /// database, as seen by the transaction (container) that produces this StoredClass /// instance. /// /// /// Returns the number of instances of this class that have been persisted to the /// database, as seen by the transaction (container) that produces this StoredClass /// instance. /// /// The number of instances int InstanceCount(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/CompositeDb4oException.cs0000644000175000017500000000054311700531646030532 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Ext { [System.Serializable] public partial class CompositeDb4oException : Exception { public readonly Exception[] _exceptions; public CompositeDb4oException(Exception[] exceptions) { _exceptions = exceptions; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/IncompatibleFileFormatException.cs0000644000175000017500000000140211700531646032431 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// db4o-specific exception.

/// This exception is thrown when the database file format /// is not compatible with the applied configuration. ///
/// /// db4o-specific exception.

/// This exception is thrown when the database file format /// is not compatible with the applied configuration. ///
[System.Serializable] public class IncompatibleFileFormatException : Db4oFatalException { public IncompatibleFileFormatException() : base() { } public IncompatibleFileFormatException(string message) : base(message) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/InvalidSlotException.cs0000644000175000017500000000253411700531646030311 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// db4o-specific exception.

/// This exception is thrown when db4o reads slot /// information which is not valid (length or address). ///
/// /// db4o-specific exception.

/// This exception is thrown when db4o reads slot /// information which is not valid (length or address). ///
[System.Serializable] public class InvalidSlotException : Db4oRecoverableException { /// Constructor allowing to specify a detailed message. /// Constructor allowing to specify a detailed message. /// message public InvalidSlotException(string msg) : base(msg) { } /// Constructor allowing to specify the address, length and id. /// Constructor allowing to specify the address, length and id. /// offending address /// offending length /// id where the address and length were read. public InvalidSlotException(int address, int length, int id) : base("address: " + address + ", length : " + length + ", id : " + id) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/OldFormatException.cs0000644000175000017500000000143111700531646027743 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// db4o-specific exception.

/// This exception is thrown when an old file format was detected /// and /// Db4objects.Db4o.Config.IConfiguration.AllowVersionUpdates(bool) /// /// is set to false. ///
[System.Serializable] public class OldFormatException : Db4oFatalException { /// Constructor with the default message. /// Constructor with the default message. public OldFormatException() : base(Db4objects.Db4o.Internal.Messages.OldDatabaseFormat ) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/Status.cs0000644000175000017500000000103111700531646025454 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Ext { /// Static constants to describe the status of objects. /// Static constants to describe the status of objects. public class Status { public const double Unused = -1.0; public const double Available = -2.0; public const double Queued = -3.0; public const double Completed = -4.0; public const double Processing = -5.0; public const double Error = -99.0; } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/DatabaseFileLockedException.cs0000644000175000017500000000264211700531646031507 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// db4o-specific exception.

/// this Exception is thrown during any of the db4o open calls /// if the database file is locked by another process. ///
/// /// db4o-specific exception.

/// this Exception is thrown during any of the db4o open calls /// if the database file is locked by another process. ///
/// Db4objects.Db4o.Db4oFactory.OpenFile(string) /// [System.Serializable] public class DatabaseFileLockedException : Db4oFatalException { /// Constructor with a database description message /// message, which can help to identify the database /// public DatabaseFileLockedException(string databaseDescription) : base(databaseDescription ) { } /// Constructor with a database description and cause exception /// database description /// previous exception caused DatabaseFileLockedException public DatabaseFileLockedException(string databaseDescription, Exception cause) : base(databaseDescription, cause) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/InvalidPasswordException.cs0000644000175000017500000000116211700531646031166 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// db4o-specific exception.

/// This exception is thrown when a client tries to connect /// to a server with a wrong password or null password. ///
/// /// db4o-specific exception.

/// This exception is thrown when a client tries to connect /// to a server with a wrong password or null password. ///
[System.Serializable] public class InvalidPasswordException : Db4oRecoverableException { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/Db4oDatabase.cs0000644000175000017500000001653011700531646026420 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Query; using Db4objects.Db4o.Types; using Sharpen; namespace Db4objects.Db4o.Ext { /// Class to identify a database by it's signature. /// /// Class to identify a database by it's signature. ///

db4o UUID handling uses a reference to the Db4oDatabase object, that /// represents the database an object was created on. ///
/// /// public class Db4oDatabase : IDb4oType, IInternal4 { public static readonly Db4objects.Db4o.Ext.Db4oDatabase StaticIdentity = Debug4.staticIdentity ? new Db4objects.Db4o.Ext.Db4oDatabase(new byte[] { (byte)'d', (byte)'e', (byte )'b', (byte)'u', (byte)'g' }, 1) : null; public const int StaticId = -1; /// Field is public for implementation reasons, DO NOT TOUCH! public byte[] i_signature; /// /// Field is public for implementation reasons, DO NOT TOUCH! /// This field is badly named, it really is the creation time. /// /// /// Field is public for implementation reasons, DO NOT TOUCH! /// This field is badly named, it really is the creation time. /// public long i_uuid; private static readonly string CreationtimeField = "i_uuid"; /// cached ObjectContainer for getting the own ID. /// cached ObjectContainer for getting the own ID. [System.NonSerialized] private ObjectContainerBase i_stream; /// cached ID, only valid in combination with i_objectContainer [System.NonSerialized] private int i_id; /// constructor for persistence public Db4oDatabase() { } /// constructor for comparison and to store new ones public Db4oDatabase(byte[] signature, long creationTime) { // TODO: change to _creationTime with PersistentFormatUpdater // FIXME: make sure signature is null i_signature = signature; i_uuid = creationTime; } /// generates a new Db4oDatabase object with a unique signature. /// generates a new Db4oDatabase object with a unique signature. public static Db4objects.Db4o.Ext.Db4oDatabase Generate() { StatefulBuffer writer = new StatefulBuffer(null, 300); new LatinStringIO().Write(writer, SignatureGenerator.GenerateSignature()); return new Db4objects.Db4o.Ext.Db4oDatabase(writer.GetWrittenBytes(), Runtime.CurrentTimeMillis ()); } /// comparison by signature. /// comparison by signature. public override bool Equals(object obj) { if (obj == this) { return true; } if (obj == null || this.GetType() != obj.GetType()) { return false; } Db4objects.Db4o.Ext.Db4oDatabase other = (Db4objects.Db4o.Ext.Db4oDatabase)obj; if (null == other.i_signature || null == this.i_signature) { return false; } return Arrays4.Equals(other.i_signature, this.i_signature); } public override int GetHashCode() { return i_signature.GetHashCode(); } /// gets the db4o ID, and may cache it for performance reasons. /// gets the db4o ID, and may cache it for performance reasons. /// the db4o ID for the ObjectContainer public virtual int GetID(Transaction trans) { ObjectContainerBase stream = trans.Container(); if (stream != i_stream) { i_stream = stream; i_id = Bind(trans); } return i_id; } public virtual long GetCreationTime() { return i_uuid; } /// returns the unique signature public virtual byte[] GetSignature() { return i_signature; } public override string ToString() { return "db " + i_signature; } public virtual bool IsOlderThan(Db4objects.Db4o.Ext.Db4oDatabase peer) { if (peer == this) { throw new ArgumentException(); } if (i_uuid != peer.i_uuid) { return i_uuid < peer.i_uuid; } // the above logic has failed, both are the same // age but we still want to distinguish in some // way, to have an order in the ReplicationRecord // The following is arbitrary, it only needs to // be repeatable. // Let's distinguish by signature length if (i_signature.Length != peer.i_signature.Length) { return i_signature.Length < peer.i_signature.Length; } for (int i = 0; i < i_signature.Length; i++) { if (i_signature[i] != peer.i_signature[i]) { return i_signature[i] < peer.i_signature[i]; } } // This should never happen. // FIXME: Add a message and move to Messages. // throw new Exception(); } /// make sure this Db4oDatabase is stored. /// make sure this Db4oDatabase is stored. Return the ID. public virtual int Bind(Transaction trans) { ObjectContainerBase stream = trans.Container(); Db4objects.Db4o.Ext.Db4oDatabase stored = (Db4objects.Db4o.Ext.Db4oDatabase)stream .Db4oTypeStored(trans, this); if (stored == null) { return StoreAndGetId(trans); } if (stored == this) { return stream.GetID(trans, this); } if (i_uuid == 0) { i_uuid = stored.i_uuid; } stream.ShowInternalClasses(true); try { int id = stream.GetID(trans, stored); stream.Bind(trans, this, id); return id; } finally { stream.ShowInternalClasses(false); } } private int StoreAndGetId(Transaction trans) { ObjectContainerBase stream = trans.Container(); stream.ShowInternalClasses(true); try { stream.Store2(trans, this, stream.UpdateDepthProvider().ForDepth(2), false); return stream.GetID(trans, this); } finally { stream.ShowInternalClasses(false); } } /// find a Db4oDatabase with the same signature as this one public virtual Db4objects.Db4o.Ext.Db4oDatabase Query(Transaction trans) { // showInternalClasses(true); has to be set for this method to be successful if (i_uuid > 0) { // try fast query over uuid (creation time) first Db4objects.Db4o.Ext.Db4oDatabase res = Query(trans, true); if (res != null) { return res; } } // if not found, try to find with signature return Query(trans, false); } private Db4objects.Db4o.Ext.Db4oDatabase Query(Transaction trans, bool constrainByUUID ) { ObjectContainerBase stream = trans.Container(); IQuery q = stream.Query(trans); q.Constrain(GetType()); if (constrainByUUID) { q.Descend(CreationtimeField).Constrain(i_uuid); } IObjectSet objectSet = q.Execute(); while (objectSet.HasNext()) { Db4objects.Db4o.Ext.Db4oDatabase storedDatabase = (Db4objects.Db4o.Ext.Db4oDatabase )objectSet.Next(); stream.Activate(null, storedDatabase, new FixedActivationDepth(4)); if (storedDatabase.Equals(this)) { return storedDatabase; } } return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/Db4oRecoverableException.cs0000644000175000017500000000116611700531646031023 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { [System.Serializable] public class Db4oRecoverableException : Db4oException { public Db4oRecoverableException() : base() { } public Db4oRecoverableException(int messageConstant) : base(messageConstant) { } public Db4oRecoverableException(string msg, Exception cause) : base(msg, cause) { } public Db4oRecoverableException(string msg) : base(msg) { } public Db4oRecoverableException(Exception cause) : base(cause) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/Db4oIOException.cs0000644000175000017500000000173011700531646027076 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// db4o-specific exception.

/// This exception is thrown when a system IO exception /// is encounted by db4o process. ///
/// /// db4o-specific exception.

/// This exception is thrown when a system IO exception /// is encounted by db4o process. ///
[System.Serializable] public class Db4oIOException : Db4oFatalException { /// Constructor. /// Constructor. public Db4oIOException() : base() { } public Db4oIOException(string message) : base(message) { } /// Constructor allowing to specify the causing exception /// exception cause public Db4oIOException(Exception cause) : base(cause.Message, cause) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/IStoredField.cs0000644000175000017500000000663411700531646026524 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Ext { /// the internal representation of a field on a stored class. /// the internal representation of a field on a stored class. public interface IStoredField { /// creates an index on this field at runtime. /// creates an index on this field at runtime. void CreateIndex(); /// drops an existing index on this field at runtime. /// drops an existing index on this field at runtime. void DropIndex(); /// returns the field value on the passed object. /// /// returns the field value on the passed object. ///

This method will also work, if the field is not present in the current /// version of the class. ///

It is recommended to use this method for refactoring purposes, if fields /// are removed and the field values need to be copied to other fields. ///
object Get(object onObject); /// returns the name of the field. /// returns the name of the field. string GetName(); /// returns the Class (Java) / Type (.NET) of the field. /// /// returns the Class (Java) / Type (.NET) of the field. ///

For array fields this method will return the type of the array. /// Use /// IsArray() /// to detect arrays. ///
IReflectClass GetStoredType(); /// returns true if the field is an array. /// returns true if the field is an array. bool IsArray(); /// modifies the name of this stored field. /// /// modifies the name of this stored field. ///

After renaming one or multiple fields the ObjectContainer has /// to be closed and reopened to allow internal caches to be refreshed.

///
/// the new name void Rename(string name); /// /// specialized highspeed API to collect all values of a field for all instances /// of a class, if the field is indexed. /// /// /// specialized highspeed API to collect all values of a field for all instances /// of a class, if the field is indexed. ///

The field values will be taken directly from the index without the /// detour through class indexes or object instantiation. ///

/// If this method is used to get the values of a first class object index, /// deactivated objects will be passed to the visitor. ///
/// the visitor to be called with each index value. void TraverseValues(IVisitor4 visitor); /// Returns whether this field has an index or not. /// Returns whether this field has an index or not. /// true if this field has an index. bool HasIndex(); // will need for replication. Requested for 3.0 // // /** // * sets the field value on the passed object. // * @param onObject // * @param fieldValue // */ // public void set(Object onObject, Object fieldValue); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/IObjectInfoCollection.cs0000644000175000017500000000073411700531646030351 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; namespace Db4objects.Db4o.Ext { /// /// Interface to an iterable collection /// IObjectInfo /// objects.

/// ObjectInfoCollection is used reference a number of stored objects. ///
/// IObjectInfo public interface IObjectInfoCollection : IEnumerable { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/UnsupportedOldFormatException.cs0000644000175000017500000000077711700531646032230 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// This exception is thrown while reading old database /// files for which support has been dropped. /// /// /// This exception is thrown while reading old database /// files for which support has been dropped. /// [System.Serializable] public class UnsupportedOldFormatException : Db4oFatalException { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/IObjectCallbacks.cs0000644000175000017500000001110711700531646027315 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o.Ext { /// callback methods. /// /// callback methods. ///

/// This interface only serves as a list of all available callback methods. /// Every method is called individually, independantly of implementing this interface.

/// Using callbacks
/// Simply implement one or more of the listed methods in your application classes to /// do tasks before activation, deactivation, delete, new or update, to cancel the /// action about to be performed and to respond to the performed task. ///

Callback methods are typically used for: ///
- cascaded delete ///
- cascaded update ///
- cascaded activation ///
- restoring transient members on instantiation ///

Callback methods follow regular calling conventions. Methods in superclasses /// need to be called explicitely. ///

All method calls are implemented to occur only once, upon one event. ///
public interface IObjectCallbacks { /// called before an Object is activated. /// called before an Object is activated. /// the ObjectContainer the object is stored in. /// /// false to prevent activation. bool ObjectCanActivate(IObjectContainer container); /// called before an Object is deactivated. /// called before an Object is deactivated. /// the ObjectContainer the object is stored in. /// /// false to prevent deactivation. bool ObjectCanDeactivate(IObjectContainer container); /// called before an Object is deleted. /// /// called before an Object is deleted. ///

In a client/server setup this callback method will be executed on /// the server. ///
/// the ObjectContainer the object is stored in. /// /// false to prevent the object from being deleted. bool ObjectCanDelete(IObjectContainer container); /// called before an Object is stored the first time. /// called before an Object is stored the first time. /// the ObjectContainer is about to be stored to. /// /// false to prevent the object from being stored. bool ObjectCanNew(IObjectContainer container); /// called before a persisted Object is updated. /// called before a persisted Object is updated. /// the ObjectContainer the object is stored in. /// /// false to prevent the object from being updated. bool ObjectCanUpdate(IObjectContainer container); /// called upon activation of an object. /// called upon activation of an object. /// the ObjectContainer the object is stored in. /// void ObjectOnActivate(IObjectContainer container); /// called upon deactivation of an object. /// called upon deactivation of an object. /// the ObjectContainer the object is stored in. /// void ObjectOnDeactivate(IObjectContainer container); /// called after an object was deleted. /// /// called after an object was deleted. ///

In a client/server setup this callback method will be executed on /// the server. ///
/// the ObjectContainer the object was stored in. /// void ObjectOnDelete(IObjectContainer container); /// called after a new object was stored. /// called after a new object was stored. /// the ObjectContainer the object is stored to. /// void ObjectOnNew(IObjectContainer container); /// called after an object was updated. /// called after an object was updated. /// the ObjectContainer the object is stored in. /// void ObjectOnUpdate(IObjectContainer container); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/IExtClient.cs0000644000175000017500000000171211700531646026207 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// extended client functionality for the /// IExtObjectContainer /// interface. ///

Both /// Db4o.openClient() /// /// methods always /// return an ExtClient object so a cast is possible.

/// The ObjectContainer functionality is split into multiple interfaces to allow newcomers to /// focus on the essential methods. ///
public interface IExtClient : IExtObjectContainer { /// checks if the client is currently connected to a server. /// checks if the client is currently connected to a server. /// true if the client is alive. bool IsAlive(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/IObjectInfo.cs0000644000175000017500000000700211700531646026330 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// interface to the internal reference that an ObjectContainer /// holds for a stored object. /// /// /// interface to the internal reference that an ObjectContainer /// holds for a stored object. /// public interface IObjectInfo { /// returns the internal db4o ID. /// returns the internal db4o ID. long GetInternalID(); /// returns the object that is referenced. /// /// returns the object that is referenced. ///

This method may return null, if the object has /// been garbage collected. ///
/// /// the referenced object or null, if the object has /// been garbage collected. /// object GetObject(); /// returns a UUID representation of the referenced object. /// /// returns a UUID representation of the referenced object. /// UUID generation has to be turned on, in order to be able /// to use this feature: /// Db4objects.Db4o.Config.IConfiguration.GenerateUUIDs(Db4objects.Db4o.Config.ConfigScope) /// /// /// the UUID of the referenced object. Db4oUUID GetUUID(); /// /// returns the transaction serial number ("version") the referenced object /// was stored with last. /// /// /// returns the transaction serial number ("version") the referenced object /// was stored with last. Version number generation has to be turned on, in /// order to be able to use this feature: /// Db4objects.Db4o.Config.IConfiguration.GenerateVersionNumbers(Db4objects.Db4o.Config.ConfigScope) /// ///
/// This feature was replaced by /// GetCommitTimestamp() /// . The main /// difference is that the old version mechamism used to assign a serial /// timestamp to the object upon storing time, and the new commiTimestamp /// approach, assigns it upon commit time.
///
/// the version number. [System.ObsoleteAttribute(@"As of version 8.0 please use GetCommitTimestamp() instead." )] long GetVersion(); /// /// The serial timestamp the object is assigned to when it is commited.
///
/// You need to enable this feature before using it in /// Db4objects.Db4o.Config.IFileConfiguration.GenerateCommitTimestamps(bool) /// .
///
/// All the objects commited within the same transaction will receive the same commitTimestamp.
///
/// db4o replication system (dRS) relies on this feature.
///
/// the serial timestamp that was given to the object upon commit. /// Db4objects.Db4o.Config.IFileConfiguration.GenerateCommitTimestamps(bool) /// 8.0 long GetCommitTimestamp(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/VirtualField.cs0000644000175000017500000000153311700531646026572 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Ext { /// intended for future virtual fields on classes. /// /// intended for future virtual fields on classes. Currently only /// the constant for the virtual version field is found here. /// /// public class VirtualField { /// /// the field name of the virtual version field, to be used /// for querying. /// /// /// the field name of the virtual version field, to be used /// for querying. /// public static readonly string Version = Const4.VirtualFieldPrefix + "version"; public static readonly string CommitTimestamp = Const4.VirtualFieldPrefix + "commitTimestamp"; } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/Db4oFatalException.cs0000644000175000017500000000112211700531646027611 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { [System.Serializable] public class Db4oFatalException : Db4oException { public Db4oFatalException() : base() { } public Db4oFatalException(int messageConstant) : base(messageConstant) { } public Db4oFatalException(string msg, Exception cause) : base(msg, cause) { } public Db4oFatalException(string msg) : base(msg) { } public Db4oFatalException(Exception cause) : base(cause) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/Db4oIllegalStateException.cs0000644000175000017500000000126311700531646031142 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { /// /// The requested operation is not valid in the current state but the database /// continues to operate. /// /// /// The requested operation is not valid in the current state but the database /// continues to operate. /// [System.Serializable] public class Db4oIllegalStateException : Db4oRecoverableException { public Db4oIllegalStateException(string message) : base(message) { } public Db4oIllegalStateException(Exception cause) : base(cause) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Ext/Db4oFileHeaderCorruptionException.cs0000644000175000017500000000035511700531646032646 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Ext { [System.Serializable] public class Db4oFileHeaderCorruptionException : Db4oFatalException { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Rename.cs0000644000175000017500000000146211700531646024650 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o { /// /// Renaming actions are stored to the database file to make /// sure that they are only performed once. /// /// /// Renaming actions are stored to the database file to make /// sure that they are only performed once. /// /// /// public sealed class Rename : IInternal4 { public string rClass; public string rFrom; public string rTo; public Rename() { } public Rename(string aClass, string aFrom, string aTo) { rClass = aClass; rFrom = aFrom; rTo = aTo; } public bool IsField() { return rClass.Length != 0; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Db4oVersion.cs0000644000175000017500000000055411700531646025600 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o { /// public class Db4oVersion { public static readonly string Name = "8.0.183.14430"; public const int Major = 8; public const int Minor = 0; public const int Iteration = 183; public const int Revision = 14430; } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/ITransactionAware.cs0000644000175000017500000000036611700531646027021 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o { /// public interface ITransactionAware { void SetTrans(Transaction a_trans); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/0000755000175000017500000000000011700531646025551 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/IInstantiatingTypeHandler.cs0000644000175000017500000000217311700531646033170 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Typehandlers { public interface IInstantiatingTypeHandler : IReferenceTypeHandler { object Instantiate(IReadContext context); /// gets called when an object is to be written to the database. /// /// gets called when an object is to be written to the database. /// The method must only write data necessary to re instantiate the object, usually /// the immutable bits of information held by the object. For value /// types that means their complete state. /// Mutable state (only allowed in reference types) must be handled /// during /// IReferenceTypeHandler.Activate(Db4objects.Db4o.Marshall.IReferenceActivationContext) /// /// /// /// the object void WriteInstantiation(IWriteContext context, object obj); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/ITypeFamilyTypeHandler.cs0000644000175000017500000000046011700531646032434 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Typehandlers { /// public interface ITypeFamilyTypeHandler : IQueryableTypeHandler, ILinkLengthAware { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/IgnoreFieldsTypeHandler.cs0000644000175000017500000000272511700531646032620 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Typehandlers { /// Typehandler that ignores all fields on a class public class IgnoreFieldsTypeHandler : IReferenceTypeHandler, ICascadingTypeHandler { public static readonly ITypeHandler4 Instance = new Db4objects.Db4o.Typehandlers.IgnoreFieldsTypeHandler (); private IgnoreFieldsTypeHandler() { } public virtual void Defragment(IDefragmentContext context) { } // do nothing /// public virtual void Delete(IDeleteContext context) { } // do nothing public virtual void Activate(IReferenceActivationContext context) { } public virtual void Write(IWriteContext context, object obj) { } public virtual IPreparedComparison PrepareComparison(IContext context, object obj ) { return null; } public virtual void CascadeActivation(IActivationContext context) { } // do nothing public virtual void CollectIDs(QueryingReadContext context) { } // do nothing public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/IReferenceTypeHandler.cs0000644000175000017500000000075211700531646032253 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Typehandlers { public interface IReferenceTypeHandler : ITypeHandler4 { /// gets called when an object is to be activated. /// gets called when an object is to be activated. /// void Activate(IReferenceActivationContext context); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/IValueTypeHandler.cs0000644000175000017500000000104511700531646031425 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Typehandlers { public interface IValueTypeHandler : ITypeHandler4 { /// gets called when an value type is to be read from the database. /// gets called when an value type is to be read from the database. /// /// the read value type object Read(IReadContext context); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/Internal/0000755000175000017500000000000011700531646027325 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/Internal/KeyValueHandlerPair.cs0000644000175000017500000000074711700531646033523 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Typehandlers.Internal { /// public class KeyValueHandlerPair { public readonly ITypeHandler4 _keyHandler; public readonly ITypeHandler4 _valueHandler; public KeyValueHandlerPair(ITypeHandler4 keyHandler, ITypeHandler4 valueHandler) { _keyHandler = keyHandler; _valueHandler = valueHandler; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/CollectionTypeHandler.cs0000755000175000017500000001023111700531646032333 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Typehandlers { /// TypeHandler for Collections. /// /// TypeHandler for Collections. /// On the .NET side, usage is restricted to instances of IList. /// public partial class CollectionTypeHandler : IReferenceTypeHandler, ICascadingTypeHandler , IVariableLengthTypeHandler, IQueryableTypeHandler { public virtual IPreparedComparison PrepareComparison(IContext context, object obj ) { // TODO Auto-generated method stub return null; } public virtual void Write(IWriteContext context, object obj) { ICollection collection = (ICollection)obj; ITypeHandler4 elementHandler = DetectElementTypeHandler(Container(context), collection ); WriteElementClassMetadataId(context, elementHandler); WriteElementCount(context, collection); WriteElements(context, collection, elementHandler); } public virtual void Activate(IReferenceActivationContext context) { ICollection collection = (ICollection)((UnmarshallingContext)context).PersistentObject (); ClearCollection(collection); ITypeHandler4 elementHandler = ReadElementTypeHandler(context, context); int elementCount = context.ReadInt(); for (int i = 0; i < elementCount; i++) { object element = context.ReadObject(elementHandler); AddToCollection(collection, element); } } private void WriteElementCount(IWriteContext context, ICollection collection) { context.WriteInt(collection.Count); } private void WriteElements(IWriteContext context, ICollection collection, ITypeHandler4 elementHandler) { IEnumerator elements = collection.GetEnumerator(); while (elements.MoveNext()) { context.WriteObject(elementHandler, elements.Current); } } private ObjectContainerBase Container(IContext context) { return ((IInternalObjectContainer)context.ObjectContainer()).Container; } /// public virtual void Delete(IDeleteContext context) { if (!context.CascadeDelete()) { return; } ITypeHandler4 handler = ReadElementTypeHandler(context, context); int elementCount = context.ReadInt(); for (int i = elementCount; i > 0; i--) { handler.Delete(context); } } public virtual void Defragment(IDefragmentContext context) { ITypeHandler4 handler = ReadElementTypeHandler(context, context); int elementCount = context.ReadInt(); for (int i = 0; i < elementCount; i++) { handler.Defragment(context); } } public void CascadeActivation(IActivationContext context) { IEnumerator all = ((ICollection)context.TargetObject()).GetEnumerator(); while (all.MoveNext()) { context.CascadeActivationToChild(all.Current); } } public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { return this; } public virtual void CollectIDs(QueryingReadContext context) { ITypeHandler4 elementHandler = ReadElementTypeHandler(context, context); int elementCount = context.ReadInt(); for (int i = 0; i < elementCount; i++) { context.ReadId(elementHandler); } } private void WriteElementClassMetadataId(IWriteContext context, ITypeHandler4 elementHandler ) { context.WriteInt(0); } private ITypeHandler4 ReadElementTypeHandler(IReadBuffer buffer, IContext context ) { buffer.ReadInt(); return (ITypeHandler4)Container(context).Handlers.OpenTypeHandler(); } private ITypeHandler4 DetectElementTypeHandler(IInternalObjectContainer container , ICollection collection) { return (ITypeHandler4)container.Handlers.OpenTypeHandler(); } public virtual bool DescendsIntoMembers() { return true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/ITypeHandlerPredicate.cs0000644000175000017500000000154311700531646032254 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Typehandlers { /// /// Predicate to be able to select if a specific TypeHandler is /// applicable for a specific Type. /// /// /// Predicate to be able to select if a specific TypeHandler is /// applicable for a specific Type. /// public interface ITypeHandlerPredicate { /// /// return true if a TypeHandler is to be used for a specific /// Type /// /// /// the Type passed by db4o that is to /// be tested by this predicate. /// /// /// true if the TypeHandler is to be used for a specific /// Type. /// bool Match(IReflectClass classReflector); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/IQueryableTypeHandler.cs0000644000175000017500000000037111700531646032303 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Typehandlers { public interface IQueryableTypeHandler : ITypeHandler4 { bool DescendsIntoMembers(); } } SingleClassTypeHandlerPredicate.cs0000644000175000017500000000133011700531646034206 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Typehandlers { /// allows installing a Typehandler for a single class. /// allows installing a Typehandler for a single class. public sealed class SingleClassTypeHandlerPredicate : ITypeHandlerPredicate { private readonly Type _class; public SingleClassTypeHandlerPredicate(Type clazz) { _class = clazz; } public bool Match(IReflectClass candidate) { IReflectClass reflectClass = candidate.Reflector().ForClass(_class); return candidate == reflectClass; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/ICascadingTypeHandler.cs0000644000175000017500000000234511700531646032231 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Typehandlers { /// TypeHandler for objects with members. /// TypeHandler for objects with members. public interface ICascadingTypeHandler : ITypeHandler4 { /// /// will be called during activation if the handled /// object is already active /// /// void CascadeActivation(IActivationContext context); /// /// will be called during querying to ask for the handler /// to be used to collect children of the handled object /// /// /// ITypeHandler4 ReadCandidateHandler(QueryingReadContext context); /// /// will be called during querying to ask for IDs of member /// objects of the handled object. /// /// /// will be called during querying to ask for IDs of member /// objects of the handled object. /// /// void CollectIDs(QueryingReadContext context); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/MapTypeHandler.cs0000644000175000017500000001152411700531646030760 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; using Db4objects.Db4o.Typehandlers.Internal; namespace Db4objects.Db4o.Typehandlers { /// Typehandler for classes that implement IDictionary. /// Typehandler for classes that implement IDictionary. public class MapTypeHandler : IReferenceTypeHandler, ICascadingTypeHandler, IVariableLengthTypeHandler { public virtual IPreparedComparison PrepareComparison(IContext context, object obj ) { // TODO Auto-generated method stub return null; } public virtual void Write(IWriteContext context, object obj) { IDictionary map = (IDictionary)obj; KeyValueHandlerPair handlers = DetectKeyValueTypeHandlers(Container(context), map ); WriteClassMetadataIds(context, handlers); WriteElementCount(context, map); WriteElements(context, map, handlers); } public virtual void Activate(IReferenceActivationContext context) { UnmarshallingContext unmarshallingContext = (UnmarshallingContext)context; IDictionary map = (IDictionary)unmarshallingContext.PersistentObject(); map.Clear(); KeyValueHandlerPair handlers = ReadKeyValueTypeHandlers(context, context); int elementCount = context.ReadInt(); for (int i = 0; i < elementCount; i++) { object key = unmarshallingContext.ReadFullyActivatedObjectForKeys(handlers._keyHandler ); if (key == null && !unmarshallingContext.LastReferenceReadWasReallyNull()) { continue; } object value = context.ReadObject(handlers._valueHandler); map[key] = value; } } private void WriteElementCount(IWriteContext context, IDictionary map) { context.WriteInt(map.Count); } private void WriteElements(IWriteContext context, IDictionary map, KeyValueHandlerPair handlers) { IEnumerator elements = map.Keys.GetEnumerator(); while (elements.MoveNext()) { object key = elements.Current; context.WriteObject(handlers._keyHandler, key); context.WriteObject(handlers._valueHandler, map[key]); } } private ObjectContainerBase Container(IContext context) { return ((IInternalObjectContainer)context.ObjectContainer()).Container; } /// public virtual void Delete(IDeleteContext context) { if (!context.CascadeDelete()) { return; } KeyValueHandlerPair handlers = ReadKeyValueTypeHandlers(context, context); int elementCount = context.ReadInt(); for (int i = elementCount; i > 0; i--) { handlers._keyHandler.Delete(context); handlers._valueHandler.Delete(context); } } public virtual void Defragment(IDefragmentContext context) { KeyValueHandlerPair handlers = ReadKeyValueTypeHandlers(context, context); int elementCount = context.ReadInt(); for (int i = elementCount; i > 0; i--) { context.Defragment(handlers._keyHandler); context.Defragment(handlers._valueHandler); } } public void CascadeActivation(IActivationContext context) { IDictionary map = (IDictionary)context.TargetObject(); IEnumerator keys = (map).Keys.GetEnumerator(); while (keys.MoveNext()) { object key = keys.Current; context.CascadeActivationToChild(key); context.CascadeActivationToChild(map[key]); } } public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { return this; } public virtual void CollectIDs(QueryingReadContext context) { KeyValueHandlerPair handlers = ReadKeyValueTypeHandlers(context, context); int elementCount = context.ReadInt(); for (int i = 0; i < elementCount; i++) { context.ReadId(handlers._keyHandler); context.SkipId(handlers._valueHandler); } } private void WriteClassMetadataIds(IWriteContext context, KeyValueHandlerPair handlers ) { context.WriteInt(0); context.WriteInt(0); } private KeyValueHandlerPair ReadKeyValueTypeHandlers(IReadBuffer buffer, IContext context) { buffer.ReadInt(); buffer.ReadInt(); ITypeHandler4 untypedHandler = (ITypeHandler4)Container(context).Handlers.OpenTypeHandler (); return new KeyValueHandlerPair(untypedHandler, untypedHandler); } private KeyValueHandlerPair DetectKeyValueTypeHandlers(IInternalObjectContainer container , IDictionary map) { ITypeHandler4 untypedHandler = (ITypeHandler4)container.Handlers.OpenTypeHandler( ); return new KeyValueHandlerPair(untypedHandler, untypedHandler); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/IActivationContext.cs0000644000175000017500000000122111700531646031653 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Typehandlers { public interface IActivationContext : IContext { void CascadeActivationToTarget(); void CascadeActivationToChild(object obj); ObjectContainerBase Container(); object TargetObject(); Db4objects.Db4o.Internal.ClassMetadata ClassMetadata(); IActivationDepth Depth(); IActivationContext ForObject(object newTargetObject); IActivationContext Descend(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Typehandlers/ITypeHandler4.cs0000644000175000017500000000324511700531646030520 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Typehandlers { /// /// handles reading, writing, deleting, defragmenting and /// comparisons for types of objects.

/// Custom Typehandlers can be implemented to alter the default /// behaviour of storing all non-transient fields of an object.

///
/// /// /// Db4objects.Db4o.Config.IConfiguration.RegisterTypeHandler(ITypeHandlerPredicate, ITypeHandler4) /// /// /// public interface ITypeHandler4 { /// gets called when an object gets deleted. /// gets called when an object gets deleted. /// /// Db4objects.Db4o.Ext.Db4oIOException /// void Delete(IDeleteContext context); /// gets called when an object gets defragmented. /// gets called when an object gets defragmented. /// void Defragment(IDefragmentContext context); /// gets called when an object is to be written to the database. /// gets called when an object is to be written to the database. /// /// the object void Write(IWriteContext context, object obj); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Qlin/0000755000175000017500000000000011700531646024012 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Qlin/IQLin.cs0000644000175000017500000000357011700531646025322 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Qlin; namespace Db4objects.Db4o.Qlin { /// a node in a QLin ("Coolin") query. /// /// a node in a QLin ("Coolin") query. /// QLin is a new experimental query interface. /// We would really like to have LINQ for Java instead. /// /// 8.0 public interface IQLin { /// adds a where node to this QLin query. /// adds a where node to this QLin query. /// can be any of the following: IQLin Where(object expression); /// /// executes the QLin query and returns the result /// as an /// Db4objects.Db4o.IObjectSet /// . /// Note that ObjectSet extends List and Iterable /// on the platforms that support these interfaces. /// You may want to use these interfaces instead of /// working directly against an ObjectSet. /// IObjectSet Select(); // FIXME: The return value should not be as closely bound to db4o. // Collection is mutable, it's not nice. // Discuss !!! IQLin Equal(object obj); IQLin StartsWith(string @string); IQLin Limit(int size); IQLin Smaller(object obj); IQLin Greater(object obj); /// orders the query by the expression. /// /// orders the query by the expression. /// Use the /// QLinSupport.Ascending() /// and /// QLinSupport.Descending() /// helper methods to set the direction. /// IQLin OrderBy(object expression, QLinOrderByDirection direction); object SingleOrDefault(object defaultValue); object Single(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Qlin/Prototypes.cs0000644000175000017500000003344511700531646026542 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Qlin; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Core; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Qlin { /// creates prototype objects for classes. /// /// creates prototype objects for classes. Each field on prototype objects is set /// to a newly created object or primitive that can be identified either by it's /// identity or by an int ID that is generated by the system. Creation of fields /// is recursed to the depth specified in the constructor.
///
/// Allows analyzing expressions called on prototype objects to find the /// underlying field that delivers the return value of the expression. Passed /// expressions should not have side effects on objects, otherwise the /// "prototype world" will no longer work.
///
/// We plan to supply an ImmutableFieldClassLoader to instrument the code to /// throw on every modification. This ClassLoader could also supply information /// about all the method calls involved.
///
/// For now our approach only works if expressions are directly backed by a /// single field.
///
/// We were inspired for this approach when we saw that Thomas Mueller managed to /// map expressions to fields for his JaQu query interface, Kudos! /// http://www.h2database.com/html/jaqu.html
///
/// We took the idea a bit further and made it work for all primitives except for /// boolean and we plan to also get deeper expressions, collections and /// interfaces working nicely. ///
public class Prototypes { private readonly IReflector _reflector; private readonly Hashtable4 _prototypes = new Hashtable4(); private readonly bool _ignoreTransient; private readonly int _recursionDepth; public Prototypes(IReflector reflector, int recursionDepth, bool ignoreTransient) { _reflector = reflector; _recursionDepth = recursionDepth; _ignoreTransient = ignoreTransient; } public Prototypes() : this(DefaultReflector(), 5, false) { } /// returns a prototype object for a specific class. /// returns a prototype object for a specific class. public virtual object PrototypeForClass(Type clazz) { if (clazz == null) { throw new PrototypesException("Class can not be null"); } IReflectClass claxx = _reflector.ForClass(clazz); if (claxx == null) { throw new PrototypesException("Not found in the reflector: " + clazz); } string className = claxx.GetName(); Prototypes.Prototype prototype = (Prototypes.Prototype)_prototypes.Get(className); if (prototype != null) { return prototype.Object(); } prototype = new Prototypes.Prototype(this, claxx); _prototypes.Put(className, prototype); return prototype.Object(); } /// /// analyzes the passed expression and tries to find the path to the /// backing field that is accessed. /// /// /// analyzes the passed expression and tries to find the path to the /// backing field that is accessed. /// public virtual IEnumerator BackingFieldPath(Type clazz, object expression) { return BackingFieldPath(_reflector.ForClass(clazz), expression); } /// /// analyzes the passed expression and tries to find the path to the /// backing field that is accessed. /// /// /// analyzes the passed expression and tries to find the path to the /// backing field that is accessed. /// public virtual IEnumerator BackingFieldPath(IReflectClass claxx, object expression ) { return BackingFieldPath(claxx.GetName(), expression); } /// /// analyzes the passed expression and tries to find the path to the /// backing field that is accessed. /// /// /// analyzes the passed expression and tries to find the path to the /// backing field that is accessed. /// public virtual IEnumerator BackingFieldPath(string className, object expression) { Prototypes.Prototype prototype = (Prototypes.Prototype)_prototypes.Get(className); if (prototype == null) { return null; } return prototype.BackingFieldPath(_reflector, expression); } private class Prototype { private readonly IdentityHashtable4 _fieldsByIdentity = new IdentityHashtable4(); private readonly Hashtable4 _fieldsByIntId = new Hashtable4(); private readonly object _object; private int intIdGenerator; public Prototype(Prototypes _enclosing, IReflectClass claxx) { this._enclosing = _enclosing; this._object = (object)claxx.NewInstance(); if (this._object == null) { throw new PrototypesException("Prototype could not be created for class " + claxx .GetName()); } this.Analyze(this._object, claxx, this._enclosing._recursionDepth, null); } private void Analyze(object @object, IReflectClass claxx, int depth, List4 parentPath ) { if (depth < 0) { return; } ReflectorUtils.ForEachField(claxx, new _IProcedure4_130(this, parentPath, claxx, @object, depth)); } private sealed class _IProcedure4_130 : IProcedure4 { public _IProcedure4_130(Prototype _enclosing, List4 parentPath, IReflectClass claxx , object @object, int depth) { this._enclosing = _enclosing; this.parentPath = parentPath; this.claxx = claxx; this.@object = @object; this.depth = depth; } public void Apply(object field) { if (((IReflectField)field).IsStatic()) { return; } if (this._enclosing._enclosing._ignoreTransient && ((IReflectField)field).IsTransient ()) { return; } IReflectClass fieldType = ((IReflectField)field).GetFieldType(); List4 path = new List4(parentPath, ((IReflectField)field)); Prototypes.IntegerConverter converter = Prototypes.IntegerConverterforClassName(claxx .Reflector(), fieldType.GetName()); if (converter != null) { int id = ++this._enclosing.intIdGenerator; object integerRepresentation = converter.FromInteger(id); if (!Prototypes.TrySetField(((IReflectField)field), @object, integerRepresentation )) { return; } this._enclosing._fieldsByIntId.Put(id, new Pair(integerRepresentation, path)); return; } if (!fieldType.IsPrimitive()) { object identityInstance = fieldType.NewInstance(); if (identityInstance == null) { return; } if (!Prototypes.TrySetField(((IReflectField)field), @object, identityInstance)) { return; } this._enclosing._fieldsByIdentity.Put(identityInstance, path); this._enclosing.Analyze(identityInstance, claxx, depth - 1, path); } } private readonly Prototype _enclosing; private readonly List4 parentPath; private readonly IReflectClass claxx; private readonly object @object; private readonly int depth; } public virtual object Object() { return this._object; } public virtual IEnumerator BackingFieldPath(IReflector reflector, object expression ) { if (expression == null) { return null; } IReflectClass claxx = reflector.ForObject(expression); if (claxx == null) { return null; } Prototypes.IntegerConverter converter = Prototypes.IntegerConverterforClassName(reflector , claxx.GetName()); if (converter != null) { Pair entry = (Pair)this._fieldsByIntId.Get(converter.ToInteger(expression)); if (entry == null) { return null; } if (entry.first.Equals(expression)) { return this.AsIterator((List4)entry.second); } return null; } if (claxx.IsPrimitive()) { return null; } return this.AsIterator((List4)this._fieldsByIdentity.Get(expression)); } private IEnumerator AsIterator(List4 lastElement) { return Iterators.Revert(Iterators.Map(Iterators.Iterate(lastElement), new _IFunction4_198 ())); } private sealed class _IFunction4_198 : IFunction4 { public _IFunction4_198() { } public object Apply(object field) { return ((IReflectField)field).GetName(); } } private readonly Prototypes _enclosing; } private static Prototypes.IntegerConverter IntegerConverterforClassName(IReflector reflector, string className) { if (_integerConverters == null) { _integerConverters = new Hashtable4(); Prototypes.IntegerConverter[] converters = new Prototypes.IntegerConverter[] { new _IntegerConverter_211(), new _IntegerConverter_215(), new _IntegerConverter_219( ), new _IntegerConverter_223(), new _IntegerConverter_227(), new _IntegerConverter_231 (), new _IntegerConverter_235(), new _IntegerConverter_239() }; for (int converterIndex = 0; converterIndex < converters.Length; ++converterIndex) { Prototypes.IntegerConverter converter = converters[converterIndex]; _integerConverters.Put(converter.PrimitiveName(), converter); if (!converter.PrimitiveName().Equals(converter.WrapperName(reflector))) { _integerConverters.Put(converter.WrapperName(reflector), converter); } } } return (Prototypes.IntegerConverter)_integerConverters.Get(className); } private sealed class _IntegerConverter_211 : Prototypes.IntegerConverter { public _IntegerConverter_211() { } public override string PrimitiveName() { return typeof(int).FullName; } public override object FromInteger(int i) { return i; } } private sealed class _IntegerConverter_215 : Prototypes.IntegerConverter { public _IntegerConverter_215() { } public override string PrimitiveName() { return typeof(long).FullName; } public override object FromInteger(int i) { return System.Convert.ToInt64(i); } } private sealed class _IntegerConverter_219 : Prototypes.IntegerConverter { public _IntegerConverter_219() { } public override string PrimitiveName() { return typeof(double).FullName; } public override object FromInteger(int i) { return System.Convert.ToDouble(i); } } private sealed class _IntegerConverter_223 : Prototypes.IntegerConverter { public _IntegerConverter_223() { } public override string PrimitiveName() { return typeof(float).FullName; } public override object FromInteger(int i) { return System.Convert.ToSingle(i); } } private sealed class _IntegerConverter_227 : Prototypes.IntegerConverter { public _IntegerConverter_227() { } public override string PrimitiveName() { return typeof(byte).FullName; } public override object FromInteger(int i) { return (byte)i; } } private sealed class _IntegerConverter_231 : Prototypes.IntegerConverter { public _IntegerConverter_231() { } public override string PrimitiveName() { return typeof(char).FullName; } public override object FromInteger(int i) { return (char)i; } } private sealed class _IntegerConverter_235 : Prototypes.IntegerConverter { public _IntegerConverter_235() { } public override string PrimitiveName() { return typeof(short).FullName; } public override object FromInteger(int i) { return (short)i; } } private sealed class _IntegerConverter_239 : Prototypes.IntegerConverter { public _IntegerConverter_239() { } public override string PrimitiveName() { return typeof(string).FullName; } public override object FromInteger(int i) { return Prototypes.StringIdentifier + i; } public override int ToInteger(object obj) { if (!(obj is string)) { return -1; } string str = (string)obj; if (str.Length < Prototypes.StringIdentifier.Length) { return -1; } if (str.IndexOf(Prototypes.StringIdentifier) != 0) { return -1; } return int.Parse(Sharpen.Runtime.Substring(str, Prototypes.StringIdentifier.Length )); } } private static Hashtable4 _integerConverters; private abstract class IntegerConverter { public virtual string WrapperName(IReflector reflector) { return reflector.ForObject(FromInteger(1)).GetName(); } public abstract string PrimitiveName(); public abstract object FromInteger(int i); public virtual int ToInteger(object obj) { return int.Parse(((object)obj).ToString()); } } private static readonly string StringIdentifier = "QLinIdentity"; // Strings get prepended the following, so we can also use strings // without restrictions in queries. public virtual IReflector Reflector() { return _reflector; } // We could always use this, but we want to make users of this class // aware that they have control over the reflector and that it is // important. public static IReflector DefaultReflector() { return new GenericReflector(Platform4.ReflectorForType(typeof(Prototypes))); } private static bool TrySetField(IReflectField field, object onObject, object value ) { try { field.Set(onObject, value); } catch { return false; } return true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Qlin/QLinOrderByDirection.cs0000644000175000017500000000262411700531646030340 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Qlin { /// /// Internal implementation class, access should not be necessary, /// except for implementors. /// /// /// Internal implementation class, access should not be necessary, /// except for implementors. /// Use the static methods in /// QLinSupport /// /// QLinSupport.Ascending() /// and /// QLinSupport.Descending() /// /// public class QLinOrderByDirection { private readonly string _direction; private readonly bool _ascending; private QLinOrderByDirection(string direction, bool ascending) { _direction = direction; _ascending = ascending; } internal static readonly Db4objects.Db4o.Qlin.QLinOrderByDirection Ascending = new Db4objects.Db4o.Qlin.QLinOrderByDirection("ascending", true); internal static readonly Db4objects.Db4o.Qlin.QLinOrderByDirection Descending = new Db4objects.Db4o.Qlin.QLinOrderByDirection("descending", false); public virtual bool IsAscending() { return _ascending; } public virtual bool IsDescending() { return !_ascending; } public override string ToString() { return _direction; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Qlin/QLinException.cs0000644000175000017500000000076411700531646027072 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Qlin { /// /// exceptions to signal improper use of the /// IQLin /// query interface. /// [System.Serializable] public class QLinException : Db4oException { public QLinException(string message) : base(message) { } public QLinException(Exception cause) : base(cause) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Qlin/IQLinable.cs0000644000175000017500000000114511700531646026142 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Qlin; namespace Db4objects.Db4o.Qlin { /// support for the new experimental QLin ("Coolin") query interface. /// /// support for the new experimental QLin ("Coolin") query interface. /// We would really like to have LINQ for Java instead. /// /// 8.0 public interface IQLinable { /// /// starts a /// IQLin /// query against a class. /// IQLin From(Type clazz); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Qlin/QLinSupport.cs0000644000175000017500000001136511700531646026607 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Qlin; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Core; namespace Db4objects.Db4o.Qlin { /// /// static import support class for /// IQLin /// queries. /// /// 8.0 public class QLinSupport { /// /// returns a prototype object for a specific class /// to be passed to the where expression of a QLin /// query. /// /// /// returns a prototype object for a specific class /// to be passed to the where expression of a QLin /// query. /// /// IQLin.Where(object) public static object Prototype(Type clazz) { try { return _prototypes.PrototypeForClass(clazz); } catch (PrototypesException ex) { throw new QLinException(ex); } } /// sets the context for the next query on this thread. /// /// sets the context for the next query on this thread. /// This method should never have to be called manually. /// The framework should set the context up. /// public static void Context(IReflectClass claxx) { _context.Value = claxx; } /// sets the context for the next query on this thread. /// /// sets the context for the next query on this thread. /// This method should never have to be called manually. /// The framework should set the context up. /// public static void Context(Type clazz) { _context.Value = ReflectorUtils.ReflectClassFor(_prototypes.Reflector(), clazz); } /// /// shortcut for the /// Prototype(System.Type<T>) /// method. /// public static object P(Type clazz) { return Prototype(clazz); } /// /// parameter for /// IQLin.OrderBy(object, QLinOrderByDirection) /// /// public static QLinOrderByDirection Ascending() { return QLinOrderByDirection.Ascending; } /// /// parameter for /// IQLin.OrderBy(object, QLinOrderByDirection) /// /// public static QLinOrderByDirection Descending() { return QLinOrderByDirection.Descending; } /// public for implementors, do not use directly public static IEnumerator BackingFieldPath(object expression) { CheckForNull(expression); if (expression is IReflectField) { return Iterators.Iterate(new string[] { ((IReflectField)expression).GetName() }); } IEnumerator path = _prototypes.BackingFieldPath(((IReflectClass)_context.Value), expression); if (path != null) { return path; } return Iterators.Iterate(new string[] { FieldByFieldName(expression).GetName() }); } /// converts an expression to a single field. /// converts an expression to a single field. public static IReflectField Field(object expression) { CheckForNull(expression); if (expression is IReflectField) { return (IReflectField)expression; } IEnumerator path = _prototypes.BackingFieldPath(((IReflectClass)_context.Value), expression); if (path != null) { if (path.MoveNext()) { expression = path.Current; } if (path.MoveNext()) { path.Reset(); throw new QLinException("expression can not be converted to a single field. It evaluates to: " + Iterators.Join(path, "[", "]", ", ")); } } return FieldByFieldName(expression); } private static IReflectField FieldByFieldName(object expression) { if (expression is string) { IReflectField field = ReflectorUtils.Field(((IReflectClass)_context.Value), (string )expression); if (field != null) { return field; } } throw new QLinException("expression can not be mapped to a field"); } private static void CheckForNull(object expression) { if (expression == null) { throw new QLinException("expression can not be null"); } } private const bool IgnoreTransientFields = true; private const int RecursionDepth = 4; private static readonly Prototypes _prototypes = new Prototypes(Prototypes.DefaultReflector (), RecursionDepth, IgnoreTransientFields); private static readonly DynamicVariable _context = DynamicVariable.NewInstance(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Qlin/PrototypesException.cs0000644000175000017500000000062411700531646030412 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Qlin { /// exception for the the Prototypes world. /// exception for the the Prototypes world. [System.Serializable] public class PrototypesException : Exception { public PrototypesException(string message) : base(message) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Collections/0000755000175000017500000000000011700531646025365 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Collections/ArrayList4.cs0000644000175000017500000002006011700531646027710 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ #if !SILVERLIGHT using System; using System.Collections.Generic; using Db4objects.Db4o.Activation; using Sharpen; using Sharpen.Util; namespace Db4objects.Db4o.Collections { /// Transparent activatable ArrayList implementation. /// /// /// Transparent activatable ArrayList implementation. Implements IList /// interface using an array to store elements. Each ArrayList4 instance /// has a capacity, which indicates the size of the internal array. ///
///
/// When instantiated as a result of a query, all the internal members /// are NOT activated at all. When internal members are required to /// perform an operation, the instance transparently activates all the /// members. ///
/// System.Collections.ArrayList /// /// Db4objects.Db4o.TA.IActivatable /// public partial class ArrayList4 { private E[] elements; private int listSize; [System.NonSerialized] private IActivator _activator; /// activate basic implementation. /// activate basic implementation. /// Db4objects.Db4o.TA.IActivatable public virtual void Activate(ActivationPurpose purpose) { if (_activator != null) { _activator.Activate(purpose); } } /// bind basic implementation. /// bind basic implementation. /// Db4objects.Db4o.TA.IActivatable public virtual void Bind(IActivator activator) { if (_activator == activator) { return; } if (activator != null && _activator != null) { throw new InvalidOperationException(); } _activator = activator; } /// /// Initializes a new collection with the initial capacity = 10. /// public ArrayList4() : this(10) { } /// /// Initializes a collection with the members of the parameter collection. /// public ArrayList4(ICollection c) { E[] data = CollectionToArray(c); elements = AllocateStorage(data.Length); listSize = data.Length; System.Array.Copy(data, 0, elements, 0, data.Length); } /// /// Initializes a collection of the specified initial capacity. /// public ArrayList4(int initialCapacity) { if (initialCapacity < 0) { throw new ArgumentException(); } elements = AllocateStorage(initialCapacity); listSize = 0; } /// Inserts an element into the collection /// at the specified index. /// Inserts an element into the collection /// at the specified index. /// Db4objects.Db4o.TA.IActivatable /// internal virtual void Add(int index, E element) { CheckIndex(index, 0, Count); EnsureCapacity(Count + 1); ArrayCopyElements(index, index + 1, listSize - index); elements[index] = element; IncreaseSize(1); MarkModified(); } private void ArrayCopyElements(int sourceIndex, int targetIndex, int length) { ActivateForWrite(); System.Array.Copy(elements, sourceIndex, elements, targetIndex, length); } internal bool AddAllImpl(int index, E[] toBeAdded) { CheckIndex(index, 0, Count); int length = toBeAdded.Length; if (length == 0) { return false; } EnsureCapacity(Count + length); ArrayCopyElements(index, index + length, Count - index); System.Array.Copy(toBeAdded, 0, elements, index, length); IncreaseSize(length); MarkModified(); return true; } /// Removes all elements from the collection. /// Removes all elements from the collection. /// Db4objects.Db4o.TA.IActivatable /// public virtual void Clear() { int size = Count; ActivateForWrite(); Arrays.Fill(elements, 0, size, DefaultValue()); SetSize(0); MarkModified(); } /// Resizes the collection capacity to the specified size if the /// current capacity is less than the parameter value. /// Resizes the collection capacity to the specified size if the /// current capacity is less than the parameter value. /// Db4objects.Db4o.TA.IActivatable /// public virtual void EnsureCapacity(int minCapacity) { Activate(ActivationPurpose.Read); if (minCapacity <= Capacity()) { return; } Resize(minCapacity); } private int Capacity() { return elements.Length; } /// Returns the collection element at the specified index. /// Returns the collection element at the specified index. /// Db4objects.Db4o.TA.IActivatable /// public virtual E Get(int index) { CheckIndex(index, 0, Count - 1); return elements[index]; } /// Removes the collection element at the specified index. /// Removes the collection element at the specified index. /// Db4objects.Db4o.TA.IActivatable /// internal virtual E RemoveImpl(int index) { int size = Count; E element = this[index]; ArrayCopyElements(index + 1, index, size - index - 1); elements[size - 1] = DefaultValue(); DecreaseSize(1); MarkModified(); return element; } private void RemoveRangeImpl(int fromIndex, int count) { int size = Count; int toIndex = fromIndex + count; if ((fromIndex < 0 || fromIndex >= size || toIndex > size || toIndex < fromIndex)) { throw new IndexOutOfRangeException(); } if (count == 0) { return; } System.Array.Copy(elements, toIndex, elements, fromIndex, size - toIndex); Arrays.Fill(elements, size - count, size, DefaultValue()); DecreaseSize(count); MarkModified(); } /// Replaces the collection element with the specified object at the specified index. /// Replaces the collection element with the specified object at the specified index. /// Db4objects.Db4o.TA.IActivatable /// internal virtual E Set(int index, E element) { E oldValue = this[index]; ActivateForWrite(); elements[index] = element; return oldValue; } /// Returns the size of the collection. /// Returns the size of the collection. /// Db4objects.Db4o.TA.IActivatable /// public virtual int Count { get { Activate(ActivationPurpose.Read); return listSize; } } /// Resizes the collection to its actual size. /// Resizes the collection to its actual size. /// Db4objects.Db4o.TA.IActivatable /// public virtual void TrimExcess() { ActivateForWrite(); Resize(Count); } private void Resize(int minCapacity) { MarkModified(); E[] temp = AllocateStorage(minCapacity); System.Array.Copy(elements, 0, temp, 0, Count); elements = temp; } internal virtual void SetSize(int count) { listSize = count; } internal virtual void IncreaseSize(int count) { listSize += count; } internal virtual void DecreaseSize(int count) { listSize -= count; } internal virtual void MarkModified() { ++modCount; } private void ActivateForWrite() { Activate(ActivationPurpose.Write); } } } #endif // !SILVERLIGHT smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Collections/ArrayDictionary4.cs0000644000175000017500000001346211700531646031112 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections.Generic; using Db4objects.Db4o.Activation; using Sharpen; using Sharpen.Util; namespace Db4objects.Db4o.Collections { /// Transparent activatable IDictionary implementation. /// /// /// Transparent activatable IDictionary implementation. Implements IDictionary interface /// using two arrays to store keys and values. ///
///
/// When instantiated as a result of a query, all the internal members /// are NOT activated at all. When internal members are required to /// perform an operation, the instance transparently activates all the /// members. ///
/// System.Collections.IDictionary /// /// Db4objects.Db4o.TA.IActivatable /// public partial class ArrayDictionary4 { private K[] _keys; private V[] _values; private int _size; [System.NonSerialized] private IActivator _activator; /// /// Initializes a new collection with the initial capacity = 16. /// public ArrayDictionary4() : this(16) { } /// /// Initializes a collection of the specified initial capacity. /// public ArrayDictionary4(int initialCapacity) { InitializeBackingArray(initialCapacity); } /// activate basic implementation. /// activate basic implementation. /// Db4objects.Db4o.TA.IActivatable public virtual void Activate(ActivationPurpose purpose) { if (_activator != null) { _activator.Activate(purpose); } } /// bind basic implementation. /// bind basic implementation. /// Db4objects.Db4o.TA.IActivatable public virtual void Bind(IActivator activator) { if (_activator == activator) { return; } if (activator != null && _activator != null) { throw new InvalidOperationException(); } _activator = activator; } /// System.Collections.Generic.IDictionary implementation but transparently activates /// the members as required. /// System.Collections.Generic.IDictionary implementation but transparently activates /// the members as required. /// /// Db4objects.Db4o.TA.IActivatable /// public virtual void Clear() { Activate(ActivationPurpose.Write); _size = 0; Arrays.Fill(_keys, DefaultKeyValue()); Arrays.Fill(_values, DefaultValue()); } private bool ContainsKeyImpl(K key) { Activate(ActivationPurpose.Read); return IndexOfKey(key) != -1; } private V ValueAt(int index) { return _values[index]; } private K KeyAt(int i) { return _keys[i]; } private V Replace(int index, V value) { V oldValue = ValueAt(index); _values[index] = value; return oldValue; } /// Returns the number of elements in the collection. /// Returns the number of elements in the collection. The collection gets activated. /// /// Db4objects.Db4o.TA.IActivatable /// public virtual int Count { get { Activate(ActivationPurpose.Read); return _size; } } /// Returns the values of the collection. /// Returns the values of the collection. The collection gets activated. /// /// Db4objects.Db4o.TA.IActivatable /// public virtual ICollection Values { get { Activate(ActivationPurpose.Read); List list = new List(); for (int i = 0; i < _size; i++) { list.Add(ValueAt(i)); } return list; } } /// Returns the hash code of the collection. /// Returns the hash code of the collection. Collection members /// get activated as required. /// /// Db4objects.Db4o.TA.IActivatable /// public override int GetHashCode() { int hashCode = 0; foreach (KeyValuePair entry in this) { hashCode += entry.GetHashCode(); } return hashCode; } private void InitializeBackingArray(int length) { _keys = AllocateKeyStorage(length); _values = AllocateValueStorage(length); } private void Insert(K key, V value) { EnsureCapacity(); _keys[_size] = key; _values[_size] = value; _size++; } private void EnsureCapacity() { if (_size == _keys.Length) { int count = _keys.Length * 2; K[] newKeys = AllocateKeyStorage(count); V[] newValues = AllocateValueStorage(count); System.Array.Copy(_keys, 0, newKeys, 0, _size); System.Array.Copy(_values, 0, newValues, 0, _size); _keys = newKeys; _values = newValues; } } private V Delete(int index) { Activate(ActivationPurpose.Write); V value = ValueAt(index); for (int i = index; i < _size - 1; i++) { _keys[i] = _keys[i + 1]; _values[i] = _values[i + 1]; } _size--; _keys[_size] = DefaultKeyValue(); _values[_size] = DefaultValue(); return value; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Collections/CollectionFactory.cs0000644000175000017500000000463011700531646031342 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Collections; namespace Db4objects.Db4o.Collections { /// /// Collection factory with methods to create collections with behaviour /// that is optimized for db4o.

/// Example usage:
/// CollectionFactory.forObjectContainer(objectContainer).newBigSet(); ///
public class CollectionFactory { private readonly IObjectContainer _objectContainer; private CollectionFactory(IObjectContainer objectContainer) { _objectContainer = objectContainer; } /// returns a collection factory for an ObjectContainer /// - the ObjectContainer /// the CollectionFactory public static Db4objects.Db4o.Collections.CollectionFactory ForObjectContainer(IObjectContainer objectContainer) { if (IsClient(objectContainer)) { throw new NotSupportedException("CollectionFactory is not yet available for Client/Server." ); } return new Db4objects.Db4o.Collections.CollectionFactory(objectContainer); } /// /// creates a new BigSet.

/// Characteristics of BigSet:
/// - It is optimized by using a BTree of IDs of persistent objects.
/// - It can only hold persistent first class objects (no primitives, no strings, no objects that are not persistent)
/// - Objects are activated upon getting them from the BigSet. ///
/// /// creates a new BigSet.

/// Characteristics of BigSet:
/// - It is optimized by using a BTree of IDs of persistent objects.
/// - It can only hold persistent first class objects (no primitives, no strings, no objects that are not persistent)
/// - Objects are activated upon getting them from the BigSet. ///

/// BigSet is recommend whenever one object references a huge number of other objects and sorting is not required. ///
/// public virtual Db4objects.Db4o.Collections.ISet NewBigSet() { return new BigSet((LocalObjectContainer)_objectContainer); } private static bool IsClient(IObjectContainer oc) { return ((IInternalObjectContainer)oc).IsClient; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/User.cs0000644000175000017500000000063211700531646024355 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o { /// /// public class User : IInternal4 { public string name; public string password; public User() { } public User(string name_, string password_) { name = name_; password = password_; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IBlobTransport.cs0000644000175000017500000000103311700531646026337 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ #if !SILVERLIGHT using Db4objects.Db4o.Internal; namespace Db4objects.Db4o { /// public interface IBlobTransport { /// void WriteBlobTo(Transaction trans, BlobImpl blob); /// void ReadBlobFrom(Transaction trans, BlobImpl blob); void DeleteBlobFile(Transaction trans, BlobImpl blob); } } #endif // !SILVERLIGHT smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IBlobStatus.cs0000644000175000017500000000035411700531646025633 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o { /// /// com.db4o.internal.blobs public interface IBlobStatus { double GetStatus(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/0000755000175000017500000000000011700531646023416 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/BinDecorator.cs0000644000175000017500000000415711700531646026327 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.IO; using Sharpen.Lang; namespace Db4objects.Db4o.IO { /// Wrapper baseclass for all classes that wrap Bin. /// /// Wrapper baseclass for all classes that wrap Bin. /// Each class that adds functionality to a Bin must /// extend this class to allow db4o to access the /// delegate instance with /// StorageDecorator.Decorate(BinConfiguration, IBin) /// /// . /// public class BinDecorator : IBin { protected readonly IBin _bin; /// Default constructor. /// Default constructor. /// /// the /// IBin /// that is to be wrapped. /// public BinDecorator(IBin bin) { _bin = bin; } /// /// closes the BinDecorator and the underlying /// IBin /// . /// public virtual void Close() { _bin.Close(); } /// public virtual long Length() { return _bin.Length(); } /// IBin.Read(long, byte[], int) public virtual int Read(long position, byte[] bytes, int bytesToRead) { return _bin.Read(position, bytes, bytesToRead); } /// IBin.Sync() public virtual void Sync() { _bin.Sync(); } /// IBin.SyncRead(long, byte[], int) /// public virtual int SyncRead(long position, byte[] bytes, int bytesToRead) { return _bin.SyncRead(position, bytes, bytesToRead); } /// IBin.Write(long, byte[], int) public virtual void Write(long position, byte[] bytes, int bytesToWrite) { _bin.Write(position, bytes, bytesToWrite); } public virtual void Sync(IRunnable runnable) { _bin.Sync(runnable); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/VanillaIoAdapter.cs0000644000175000017500000000355311700531646027132 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.IO; namespace Db4objects.Db4o.IO { /// base class for IoAdapters that delegate to other IoAdapters (decorator pattern) /// [System.ObsoleteAttribute(@"use / instead.")] public abstract class VanillaIoAdapter : IoAdapter { protected IoAdapter _delegate; public VanillaIoAdapter(IoAdapter delegateAdapter) { _delegate = delegateAdapter; } /// protected VanillaIoAdapter(IoAdapter delegateAdapter, string path, bool lockFile, long initialLength, bool readOnly) : this(delegateAdapter.Open(path, lockFile, initialLength , readOnly)) { } /// public override void Close() { _delegate.Close(); } public override void Delete(string path) { _delegate.Delete(path); } public override bool Exists(string path) { return _delegate.Exists(path); } /// public override long GetLength() { return _delegate.GetLength(); } /// public override int Read(byte[] bytes, int length) { return _delegate.Read(bytes, length); } /// public override void Seek(long pos) { _delegate.Seek(pos); } /// public override void Sync() { _delegate.Sync(); } /// public override void Write(byte[] buffer, int length) { _delegate.Write(buffer, length); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/IBlockSize.cs0000644000175000017500000000113211700531646025740 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.IO { /// Block size registry. /// /// Block size registry. /// Accessible through the environment. /// /// Db4objects.Db4o.Foundation.Environments.My(System.Type<T>) /// /// 7.7 public interface IBlockSize { void Register(IListener4 listener); void Set(int newValue); int Value(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/IStorage.cs0000644000175000017500000000331411700531646025463 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.IO; namespace Db4objects.Db4o.IO { /// /// Base interface for Storage adapters that open a /// IBin /// to store db4o database data to. /// /// public interface IStorage { /// /// opens a /// IBin /// to store db4o database data. /// /// IBin Open(BinConfiguration config); /// returns true if a Bin (file or memory) exists with the passed name. /// returns true if a Bin (file or memory) exists with the passed name. bool Exists(string uri); /// Deletes the bin for the given URI from the storage. /// Deletes the bin for the given URI from the storage. /// 7.9 /// bin URI /// if the bin could not be deleted void Delete(string uri); /// Renames the bin for the given old URI to the new URI. /// /// Renames the bin for the given old URI to the new URI. If a bin for the new URI /// exists, it will be overwritten. /// /// 7.9 /// URI of the existing bin /// future URI of the bin /// if the bin could not be deleted void Rename(string oldUri, string newUri); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/PagingMemoryBin.cs0000644000175000017500000000617511700531646027005 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.IO; using Sharpen; using Sharpen.Lang; namespace Db4objects.Db4o.IO { /// internal class PagingMemoryBin : IBin { private readonly int _pageSize; private IList _pages = new ArrayList(); private int _lastPageLength; public PagingMemoryBin(int pageSize) : this(pageSize, 0) { } public PagingMemoryBin(int pageSize, long initialLength) { _pageSize = pageSize; EnsureLength(initialLength); } public virtual long Length() { if (_pages.Count == 0) { return 0; } return (_pages.Count - 1) * _pageSize + _lastPageLength; } /// public virtual int Read(long pos, byte[] buffer, int length) { long avail = Length() - pos; if (avail <= 0) { return -1; } int bytesToRead = Math.Min((int)avail, length); int offset = PageOffset(pos); int pageIdx = PageIdx(pos); int bytesRead = 0; while (bytesRead < bytesToRead) { byte[] curPage = ((byte[])_pages[pageIdx]); int chunkLength = Math.Min(length - bytesRead, _pageSize - offset); System.Array.Copy(curPage, offset, buffer, bytesRead, chunkLength); bytesRead += chunkLength; pageIdx++; offset = 0; } return bytesToRead; } /// public virtual void Sync() { } public virtual int SyncRead(long position, byte[] bytes, int bytesToRead) { return Read(position, bytes, bytesToRead); } public virtual void Close() { } /// public virtual void Write(long pos, byte[] buffer, int length) { EnsureLength(pos + length); int offset = PageOffset(pos); int pageIdx = PageIdx(pos); int bytesWritten = 0; while (bytesWritten < length) { byte[] curPage = ((byte[])_pages[pageIdx]); int chunkLength = Math.Min(length - bytesWritten, _pageSize - offset); System.Array.Copy(buffer, bytesWritten, curPage, offset, chunkLength); bytesWritten += chunkLength; pageIdx++; offset = 0; } } private void EnsureLength(long length) { if (length <= 0) { return; } long lastPos = length - 1; int lastPosPageIdx = PageIdx(lastPos); int lastPosPageLength = PageOffset(lastPos) + 1; if (lastPosPageIdx == _pages.Count - 1) { _lastPageLength = Math.Max(lastPosPageLength, _lastPageLength); return; } if (lastPosPageIdx < _pages.Count) { return; } for (int newPageIdx = _pages.Count; newPageIdx <= lastPosPageIdx; newPageIdx++) { _pages.Add(new byte[_pageSize]); } _lastPageLength = lastPosPageLength; } private int PageIdx(long pos) { return (int)(pos / _pageSize); } private int PageOffset(long pos) { return (int)(pos % _pageSize); } public virtual void Sync(IRunnable runnable) { runnable.Run(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/ThreadedSyncBin.cs0000644000175000017500000000650311700531646026757 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.IO; using Sharpen.Lang; namespace Db4objects.Db4o.IO { public class ThreadedSyncBin : BinDecorator { private const int OneSecond = 1000; private volatile IRunnable _syncRunnable; private volatile bool _closed; private readonly Thread _thread; private readonly Lock4 _lock = new Lock4(); public ThreadedSyncBin(IBin bin) : base(bin) { _thread = new Thread(new _IRunnable_23(this), "ThreadedSyncBin"); _thread.Start(); } private sealed class _IRunnable_23 : IRunnable { public _IRunnable_23(ThreadedSyncBin _enclosing) { this._enclosing = _enclosing; } public void Run() { IClosure4 closure = new _IClosure4_25(this); while (true) { this._enclosing._lock.Run(closure); if (this._enclosing._closed) { return; } } } private sealed class _IClosure4_25 : IClosure4 { public _IClosure4_25(_IRunnable_23 _enclosing) { this._enclosing = _enclosing; } public object Run() { this._enclosing._enclosing.RunSyncRunnable(); this._enclosing._enclosing._lock.Snooze(Db4objects.Db4o.IO.ThreadedSyncBin.OneSecond ); return null; } private readonly _IRunnable_23 _enclosing; } private readonly ThreadedSyncBin _enclosing; } public override void Close() { WaitForPendingSync(); _closed = true; _lock.Run(new _IClosure4_46(this)); base.Close(); } private sealed class _IClosure4_46 : IClosure4 { public _IClosure4_46(ThreadedSyncBin _enclosing) { this._enclosing = _enclosing; } public object Run() { this._enclosing._lock.Awake(); return null; } private readonly ThreadedSyncBin _enclosing; } private void WaitForPendingSync() { while (_syncRunnable != null) { if (Thread.CurrentThread() == _thread) { return; } } } public override long Length() { WaitForPendingSync(); return base.Length(); } public override int Read(long position, byte[] buffer, int bytesToRead) { WaitForPendingSync(); return base.Read(position, buffer, bytesToRead); } public override void Write(long position, byte[] bytes, int bytesToWrite) { WaitForPendingSync(); base.Write(position, bytes, bytesToWrite); } public override void Sync() { WaitForPendingSync(); base.Sync(); } public override void Sync(IRunnable runnable) { WaitForPendingSync(); _lock.Run(new _IClosure4_85(this, runnable)); } private sealed class _IClosure4_85 : IClosure4 { public _IClosure4_85(ThreadedSyncBin _enclosing, IRunnable runnable) { this._enclosing = _enclosing; this.runnable = runnable; } public object Run() { this._enclosing._syncRunnable = runnable; this._enclosing._lock.Awake(); return null; } private readonly ThreadedSyncBin _enclosing; private readonly IRunnable runnable; } internal void RunSyncRunnable() { IRunnable runnable = _syncRunnable; if (runnable != null) { base.Sync(); runnable.Run(); base.Sync(); _syncRunnable = null; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/DoublingGrowthStrategy.cs0000644000175000017500000000105311700531646030425 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.IO; namespace Db4objects.Db4o.IO { /// Strategy for file/byte array growth that will always double the current size /// public class DoublingGrowthStrategy : IGrowthStrategy { public virtual long NewSize(long curSize, long requiredSize) { if (curSize == 0) { return requiredSize; } long newSize = curSize; while (newSize < requiredSize) { newSize *= 2; } return newSize; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/ConstantGrowthStrategy.cs0000644000175000017500000000153711700531646030462 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.IO; namespace Db4objects.Db4o.IO { /// Strategy for file/byte array growth by a constant factor public class ConstantGrowthStrategy : IGrowthStrategy { private readonly int _growth; /// The constant growth size public ConstantGrowthStrategy(int growth) { _growth = growth; } /// /// returns the incremented size after the growth /// strategy has been applied /// /// the original size /// the new size public virtual long NewSize(long curSize, long requiredSize) { long newSize = curSize; while (newSize < requiredSize) { newSize += _growth; } return newSize; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/RandomAccessFileAdapter.cs0000644000175000017500000000727011700531646030416 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.IO; using Db4objects.Db4o; using Db4objects.Db4o.Ext; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Sharpen.IO; namespace Db4objects.Db4o.IO { /// IO adapter for random access files. /// IO adapter for random access files. [System.ObsoleteAttribute(@"Use instead.")] public class RandomAccessFileAdapter : IoAdapter { private string _path; private RandomAccessFile _delegate; public RandomAccessFileAdapter() { } /// protected RandomAccessFileAdapter(string path, bool lockFile, long initialLength, bool readOnly) { bool ok = false; try { _path = new Sharpen.IO.File(path).GetCanonicalPath(); _delegate = RandomAccessFileFactory.NewRandomAccessFile(_path, readOnly, lockFile ); if (initialLength > 0) { _delegate.Seek(initialLength - 1); _delegate.Write(new byte[] { 0 }); } ok = true; } catch (IOException e) { throw new Db4oIOException(e); } finally { if (!ok) { Close(); } } } /// public override void Close() { // FIXME: This is a temporary quickfix for a bug in Android. // Remove after Android has been fixed. try { if (_delegate != null) { _delegate.Seek(0); } } catch (IOException) { } // ignore Platform4.UnlockFile(_path, _delegate); try { if (_delegate != null) { _delegate.Close(); } } catch (IOException e) { throw new Db4oIOException(e); } } public override void Delete(string path) { new Sharpen.IO.File(path).Delete(); } public override bool Exists(string path) { Sharpen.IO.File existingFile = new Sharpen.IO.File(path); return existingFile.Exists() && existingFile.Length() > 0; } /// public override long GetLength() { try { return _delegate.Length(); } catch (IOException e) { throw new Db4oIOException(e); } } /// public override IoAdapter Open(string path, bool lockFile, long initialLength, bool readOnly) { return new Db4objects.Db4o.IO.RandomAccessFileAdapter(path, lockFile, initialLength , readOnly); } /// public override int Read(byte[] bytes, int length) { try { return _delegate.Read(bytes, 0, length); } catch (IOException e) { throw new Db4oIOException(e); } } /// public override void Seek(long pos) { if (DTrace.enabled) { DTrace.RegularSeek.Log(pos); } try { _delegate.Seek(pos); } catch (IOException e) { throw new Db4oIOException(e); } } /// public override void Sync() { try { _delegate.GetFD().Sync(); } catch (IOException e) { throw new Db4oIOException(e); } } /// public override void Write(byte[] buffer, int length) { try { _delegate.Write(buffer, 0, length); } catch (IOException e) { throw new Db4oIOException(e); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/ReadOnlyBin.cs0000644000175000017500000000064511700531646026120 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.IO; namespace Db4objects.Db4o.IO { /// public class ReadOnlyBin : BinDecorator { public ReadOnlyBin(IBin storage) : base(storage) { } public override void Write(long position, byte[] bytes, int bytesToWrite) { throw new Db4oIOException(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/CachingBin.cs0000644000175000017500000002420511700531646025735 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal.Caching; using Sharpen; using Sharpen.Lang; namespace Db4objects.Db4o.IO { /// internal class CachingBin : BinDecorator { private readonly int _pageSize; private readonly ICache4 _cache; private readonly IObjectPool _pagePool; private long _fileLength; private sealed class _IProcedure4_22 : IProcedure4 { public _IProcedure4_22(CachingBin _enclosing) { this._enclosing = _enclosing; } public void Apply(object discardedPage) { this._enclosing.FlushPage(((CachingBin.Page)discardedPage)); this._enclosing._pagePool.ReturnObject(((CachingBin.Page)discardedPage)); } private readonly CachingBin _enclosing; } private IProcedure4 _onDiscardPage; /// public CachingBin(IBin bin, ICache4 cache, int pageCount, int pageSize) : base(bin ) { _onDiscardPage = new _IProcedure4_22(this); _producerFromDisk = new _IFunction4_138(this); _producerFromPool = new _IFunction4_147(this); _pageSize = pageSize; _pagePool = new SimpleObjectPool(NewPagePool(pageCount)); _cache = cache; _fileLength = _bin.Length(); } private CachingBin.Page[] NewPagePool(int pageCount) { CachingBin.Page[] pages = new CachingBin.Page[pageCount]; for (int i = 0; i < pages.Length; ++i) { pages[i] = new CachingBin.Page(_pageSize); } return pages; } /// Reads the file into the buffer using pages from cache. /// /// Reads the file into the buffer using pages from cache. If the next page /// is not cached it will be read from the file. /// /// /// /// start position to read /// /// destination buffer /// how many bytes to read /// public override int Read(long pos, byte[] buffer, int length) { return ReadInternal(pos, buffer, length, false); } private int ReadInternal(long pos, byte[] buffer, int length, bool syncRead) { long startAddress = pos; int bytesToRead = length; int totalRead = 0; while (bytesToRead > 0) { CachingBin.Page page = syncRead ? SyncReadPage(startAddress) : GetPage(startAddress , _producerFromDisk); int readBytes = page.Read(buffer, totalRead, startAddress, bytesToRead); if (readBytes <= 0) { break; } bytesToRead -= readBytes; startAddress += readBytes; totalRead += readBytes; } return totalRead == 0 ? -1 : totalRead; } /// Writes the buffer to cache using pages /// start position to write /// source buffer /// how many bytes to write /// public override void Write(long pos, byte[] buffer, int length) { long startAddress = pos; int bytesToWrite = length; int bufferOffset = 0; while (bytesToWrite > 0) { // page doesn't need to loadFromDisk if the whole page is dirty bool loadFromDisk = (bytesToWrite < _pageSize) || (startAddress % _pageSize != 0); CachingBin.Page page = GetPage(startAddress, loadFromDisk); int writtenBytes = page.Write(buffer, bufferOffset, startAddress, bytesToWrite); bytesToWrite -= writtenBytes; startAddress += writtenBytes; bufferOffset += writtenBytes; } long endAddress = startAddress; _fileLength = Math.Max(endAddress, _fileLength); } /// Flushes cache to a physical storage /// public override void Sync() { FlushAllPages(); base.Sync(); } public override void Sync(IRunnable runnable) { FlushAllPages(); base.Sync(new _IRunnable_119(this, runnable)); } private sealed class _IRunnable_119 : IRunnable { public _IRunnable_119(CachingBin _enclosing, IRunnable runnable) { this._enclosing = _enclosing; this.runnable = runnable; } public void Run() { runnable.Run(); this._enclosing.FlushAllPages(); } private readonly CachingBin _enclosing; private readonly IRunnable runnable; } public override int SyncRead(long position, byte[] bytes, int bytesToRead) { return ReadInternal(position, bytes, bytesToRead, true); } /// Returns the file length /// public override long Length() { return _fileLength; } private sealed class _IFunction4_138 : IFunction4 { public _IFunction4_138(CachingBin _enclosing) { this._enclosing = _enclosing; } public object Apply(object pageAddress) { // in case that page is not found in the cache CachingBin.Page newPage = ((CachingBin.Page)this._enclosing._pagePool.BorrowObject ()); this._enclosing.LoadPage(newPage, ((long)pageAddress)); return newPage; } private readonly CachingBin _enclosing; } internal readonly IFunction4 _producerFromDisk; private sealed class _IFunction4_147 : IFunction4 { public _IFunction4_147(CachingBin _enclosing) { this._enclosing = _enclosing; } public object Apply(object pageAddress) { // in case that page is not found in the cache CachingBin.Page newPage = ((CachingBin.Page)this._enclosing._pagePool.BorrowObject ()); this._enclosing.ResetPageAddress(newPage, ((long)pageAddress)); return newPage; } private readonly CachingBin _enclosing; } internal readonly IFunction4 _producerFromPool; /// private CachingBin.Page GetPage(long startAddress, bool loadFromDisk) { IFunction4 producer = loadFromDisk ? _producerFromDisk : _producerFromPool; return GetPage(startAddress, producer); } private CachingBin.Page GetPage(long startAddress, IFunction4 producer) { CachingBin.Page page = ((CachingBin.Page)_cache.Produce(PageAddressFor(startAddress ), producer, _onDiscardPage)); page.EnsureEndAddress(_fileLength); return page; } private CachingBin.Page SyncReadPage(long startAddress) { CachingBin.Page page = new CachingBin.Page(_pageSize); LoadPage(page, startAddress); page.EnsureEndAddress(_fileLength); return page; } private long PageAddressFor(long startAddress) { return (startAddress / _pageSize) * _pageSize; } private void ResetPageAddress(CachingBin.Page page, long startAddress) { page._startAddress = startAddress; page._endAddress = startAddress + _pageSize; } /// protected virtual void FlushAllPages() { for (IEnumerator pIter = _cache.GetEnumerator(); pIter.MoveNext(); ) { CachingBin.Page p = ((CachingBin.Page)pIter.Current); FlushPage(p); } } /// private void FlushPage(CachingBin.Page page) { if (!page._dirty) { return; } WritePageToDisk(page); } /// private void LoadPage(CachingBin.Page page, long pos) { long startAddress = pos - pos % _pageSize; page._startAddress = startAddress; int count = _bin.Read(page._startAddress, page._buffer, page._bufferSize); if (count > 0) { page._endAddress = startAddress + count; } else { page._endAddress = startAddress; } } /// private void WritePageToDisk(CachingBin.Page page) { base.Write(page._startAddress, page._buffer, page.Size()); page._dirty = false; } private class Page { public readonly byte[] _buffer; public long _startAddress = -1; public long _endAddress; public readonly int _bufferSize; public bool _dirty; private byte[] zeroBytes; public Page(int size) { _bufferSize = size; _buffer = new byte[_bufferSize]; } internal virtual void EnsureEndAddress(long fileLength) { long bufferEndAddress = _startAddress + _bufferSize; if (_endAddress < bufferEndAddress && fileLength > _endAddress) { long newEndAddress = Math.Min(fileLength, bufferEndAddress); if (zeroBytes == null) { zeroBytes = new byte[_bufferSize]; } System.Array.Copy(zeroBytes, 0, _buffer, (int)(_endAddress - _startAddress), (int )(newEndAddress - _endAddress)); _endAddress = newEndAddress; } } internal virtual int Size() { return (int)(_endAddress - _startAddress); } internal virtual int Read(byte[] @out, int outOffset, long startAddress, int length ) { int bufferOffset = (int)(startAddress - _startAddress); int pageAvailbeDataSize = (int)(_endAddress - startAddress); int readBytes = Math.Min(pageAvailbeDataSize, length); if (readBytes <= 0) { // meaning reach EOF return -1; } System.Array.Copy(_buffer, bufferOffset, @out, outOffset, readBytes); return readBytes; } internal virtual int Write(byte[] data, int dataOffset, long startAddress, int length ) { int bufferOffset = (int)(startAddress - _startAddress); int pageAvailabeBufferSize = _bufferSize - bufferOffset; int writtenBytes = Math.Min(pageAvailabeBufferSize, length); System.Array.Copy(data, dataOffset, _buffer, bufferOffset, writtenBytes); long endAddress = startAddress + writtenBytes; if (endAddress > _endAddress) { _endAddress = endAddress; } _dirty = true; return writtenBytes; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/PagingMemoryStorage.cs0000644000175000017500000000553111700531646027674 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using System.IO; using Db4objects.Db4o.IO; namespace Db4objects.Db4o.IO { /// /// IStorage /// implementation that produces /// IBin /// instances /// that operate in memory. /// Use this /// IStorage /// to work with db4o as an in-memory database. /// public class PagingMemoryStorage : IStorage { private const int DefaultPagesize = 4096; private readonly IDictionary _binsByUri = new Hashtable(); private readonly int _pageSize; public PagingMemoryStorage() : this(DefaultPagesize) { } public PagingMemoryStorage(int pageSize) { _pageSize = pageSize; } /// /// returns true if a MemoryBin with the given URI name already exists /// in this Storage. /// /// /// returns true if a MemoryBin with the given URI name already exists /// in this Storage. /// public virtual bool Exists(string uri) { return _binsByUri.Contains(uri); } /// opens a MemoryBin for the given URI (name can be freely chosen). /// opens a MemoryBin for the given URI (name can be freely chosen). /// public virtual IBin Open(BinConfiguration config) { IBin bin = ProduceBin(config); return config.ReadOnly() ? new ReadOnlyBin(bin) : bin; } /// Returns the memory bin for the given URI for external use. /// Returns the memory bin for the given URI for external use. public virtual IBin Bin(string uri) { return ((IBin)_binsByUri[uri]); } /// Registers the given bin for this storage with the given URI. /// Registers the given bin for this storage with the given URI. public virtual void Bin(string uri, IBin bin) { _binsByUri[uri] = bin; } private IBin ProduceBin(BinConfiguration config) { IBin storage = Bin(config.Uri()); if (null != storage) { return storage; } IBin newStorage = new PagingMemoryBin(_pageSize, config.InitialLength()); _binsByUri[config.Uri()] = newStorage; return newStorage; } /// public virtual void Delete(string uri) { Sharpen.Collections.Remove(_binsByUri, uri); } /// public virtual void Rename(string oldUri, string newUri) { IBin bin = ((IBin)Sharpen.Collections.Remove(_binsByUri, oldUri)); if (bin == null) { throw new IOException("Bin not found: " + oldUri); } _binsByUri[newUri] = bin; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/StorageDecorator.cs0000644000175000017500000000241511700531646027216 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.IO; namespace Db4objects.Db4o.IO { /// Wrapper base class for all classes that wrap Storage. /// /// Wrapper base class for all classes that wrap Storage. /// Each class that adds functionality to a Storage must /// extend this class. /// /// public class StorageDecorator : IStorage { protected readonly IStorage _storage; public StorageDecorator(IStorage storage) { _storage = storage; } public virtual bool Exists(string uri) { return _storage.Exists(uri); } /// public virtual IBin Open(BinConfiguration config) { return Decorate(config, _storage.Open(config)); } protected virtual IBin Decorate(BinConfiguration config, IBin bin) { return bin; } /// public virtual void Delete(string uri) { _storage.Delete(uri); } /// public virtual void Rename(string oldUri, string newUri) { _storage.Rename(oldUri, newUri); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/MemoryStorage.cs0000644000175000017500000000556411700531646026554 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using System.IO; using Db4objects.Db4o.IO; namespace Db4objects.Db4o.IO { /// /// IStorage /// implementation that produces /// IBin /// instances /// that operate in memory. /// Use this /// IStorage /// to work with db4o as an in-memory database. /// public class MemoryStorage : IStorage { private readonly IDictionary _bins = new Hashtable(); private readonly IGrowthStrategy _growthStrategy; public MemoryStorage() : this(new DoublingGrowthStrategy()) { } public MemoryStorage(IGrowthStrategy growthStrategy) { _growthStrategy = growthStrategy; } /// /// returns true if a MemoryBin with the given URI name already exists /// in this Storage. /// /// /// returns true if a MemoryBin with the given URI name already exists /// in this Storage. /// public virtual bool Exists(string uri) { return _bins.Contains(uri); } /// opens a MemoryBin for the given URI (name can be freely chosen). /// opens a MemoryBin for the given URI (name can be freely chosen). /// public virtual IBin Open(BinConfiguration config) { IBin storage = ProduceStorage(config); return config.ReadOnly() ? new ReadOnlyBin(storage) : storage; } /// Returns the memory bin for the given URI for external use. /// Returns the memory bin for the given URI for external use. public virtual MemoryBin Bin(string uri) { return ((MemoryBin)_bins[uri]); } /// Registers the given bin for this storage with the given URI. /// Registers the given bin for this storage with the given URI. public virtual void Bin(string uri, MemoryBin bin) { _bins[uri] = bin; } private IBin ProduceStorage(BinConfiguration config) { IBin storage = Bin(config.Uri()); if (null != storage) { return storage; } MemoryBin newStorage = new MemoryBin(new byte[(int)config.InitialLength()], _growthStrategy ); _bins[config.Uri()] = newStorage; return newStorage; } /// public virtual void Delete(string uri) { Sharpen.Collections.Remove(_bins, uri); } /// public virtual void Rename(string oldUri, string newUri) { MemoryBin bin = ((MemoryBin)Sharpen.Collections.Remove(_bins, oldUri)); if (bin == null) { throw new IOException("Bin not found: " + oldUri); } _bins[newUri] = bin; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/FileStorage.cs0000644000175000017500000001107011700531646026150 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.IO; using Db4objects.Db4o; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation.IO; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Sharpen.IO; using Sharpen.Lang; namespace Db4objects.Db4o.IO { /// /// Storage adapter to store db4o database data to physical /// files on hard disc. /// /// /// Storage adapter to store db4o database data to physical /// files on hard disc. /// public class FileStorage : IStorage { /// /// opens a /// IBin /// on the specified URI (file system path). /// /// public virtual IBin Open(BinConfiguration config) { return new FileStorage.FileBin(config); } /// returns true if the specified file system path already exists. /// returns true if the specified file system path already exists. public virtual bool Exists(string uri) { Sharpen.IO.File file = new Sharpen.IO.File(uri); return file.Exists() && file.Length() > 0; } public class FileBin : IBin { private readonly string _path; private RandomAccessFile _file; /// public FileBin(BinConfiguration config) { bool ok = false; try { _path = new Sharpen.IO.File(config.Uri()).GetCanonicalPath(); _file = RandomAccessFileFactory.NewRandomAccessFile(_path, config.ReadOnly(), config .LockFile()); if (config.InitialLength() > 0) { Write(config.InitialLength() - 1, new byte[] { 0 }, 1); } ok = true; } catch (IOException e) { throw new Db4oIOException(e); } finally { if (!ok) { Close(); } } } /// public virtual void Close() { Platform4.UnlockFile(_path, _file); try { if (!IsClosed()) { _file.Close(); } } catch (IOException e) { throw new Db4oIOException(e); } finally { _file = null; } } internal virtual bool IsClosed() { return _file == null; } /// public virtual long Length() { try { return _file.Length(); } catch (IOException e) { throw new Db4oIOException(e); } } /// public virtual int Read(long pos, byte[] bytes, int length) { try { Seek(pos); if (DTrace.enabled) { DTrace.FileRead.LogLength(pos, length); } return _file.Read(bytes, 0, length); } catch (IOException e) { throw new Db4oIOException(e); } } /// internal virtual void Seek(long pos) { if (DTrace.enabled) { DTrace.RegularSeek.Log(pos); } _file.Seek(pos); } /// public virtual void Sync() { try { _file.GetFD().Sync(); } catch (IOException e) { throw new Db4oIOException(e); } } public virtual int SyncRead(long position, byte[] bytes, int bytesToRead) { return Read(position, bytes, bytesToRead); } /// public virtual void Write(long pos, byte[] buffer, int length) { CheckClosed(); try { Seek(pos); if (DTrace.enabled) { DTrace.FileWrite.LogLength(pos, length); } _file.Write(buffer, 0, length); } catch (IOException e) { throw new Db4oIOException(e); } } private void CheckClosed() { if (IsClosed()) { throw new Db4oIOException(); } } public virtual void Sync(IRunnable runnable) { Sync(); runnable.Run(); Sync(); } } /// public virtual void Delete(string uri) { File4.Delete(uri); } /// public virtual void Rename(string oldUri, string newUri) { System.IO.File.Move(oldUri, newUri); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/IGrowthStrategy.cs0000644000175000017500000000117011700531646027052 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.IO { /// Strategy for file/byte array growth. /// Strategy for file/byte array growth. public interface IGrowthStrategy { /// /// returns the incremented size after the growth /// strategy has been applied /// /// the original size /// /// the new size, after the growth strategy has been /// applied, must be bigger than curSize /// long NewSize(long curSize, long requiredSize); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/CachedIoAdapter.cs0000644000175000017500000003550711700531646026717 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal.Fileheader; using Sharpen; namespace Db4objects.Db4o.IO { /// /// CachedIoAdapter is an IOAdapter for random access files, which caches data /// for IO access. /// /// /// CachedIoAdapter is an IOAdapter for random access files, which caches data /// for IO access. Its functionality is similar to OS cache.
/// Example:
/// delegateAdapter = new RandomAccessFileAdapter();
/// config.Io(new CachedIoAdapter(delegateAdapter));
///
public class CachedIoAdapter : IoAdapter { private CachedIoAdapter.Page _head; private CachedIoAdapter.Page _tail; private long _position; private int _pageSize; private int _pageCount; private long _fileLength; private long _filePointer; private IoAdapter _io; private bool _readOnly; private static int DefaultPageSize = 1024; private static int DefaultPageCount = 64; /// /// Creates an instance of CachedIoAdapter with the default page size and /// page count. /// /// /// Creates an instance of CachedIoAdapter with the default page size and /// page count. /// /// delegate IO adapter (RandomAccessFileAdapter by default) public CachedIoAdapter(IoAdapter ioAdapter) : this(ioAdapter, DefaultPageSize, DefaultPageCount ) { } /// /// Creates an instance of CachedIoAdapter with a custom page size and page /// count.
///
/// delegate IO adapter (RandomAccessFileAdapter by default) /// cache page size /// allocated amount of pages public CachedIoAdapter(IoAdapter ioAdapter, int pageSize, int pageCount) { // private Hashtable4 _posPageMap = new Hashtable4(PAGE_COUNT); _io = ioAdapter; _pageSize = pageSize; _pageCount = pageCount; } /// Creates an instance of CachedIoAdapter with extended parameters.
/// database file path /// determines if the file should be locked /// initial file length, new writes will start from this point /// /// /// /// if the file should be used in read-onlyt mode. /// /// delegate IO adapter (RandomAccessFileAdapter by default) /// cache page size /// allocated amount of pages /// public CachedIoAdapter(string path, bool lockFile, long initialLength, bool readOnly , IoAdapter io, int pageSize, int pageCount) { _readOnly = readOnly; _pageSize = pageSize; _pageCount = pageCount; InitCache(); InitIOAdaptor(path, lockFile, initialLength, readOnly, io); _position = initialLength; _filePointer = initialLength; _fileLength = _io.GetLength(); } /// Creates and returns a new CachedIoAdapter
/// database file path /// determines if the file should be locked /// initial file length, new writes will start from this point /// /// public override IoAdapter Open(string path, bool lockFile, long initialLength, bool readOnly) { return new Db4objects.Db4o.IO.CachedIoAdapter(path, lockFile, initialLength, readOnly , _io, _pageSize, _pageCount); } /// Deletes the database file /// file path public override void Delete(string path) { _io.Delete(path); } /// Checks if the file exists /// file path public override bool Exists(string path) { return _io.Exists(path); } /// private void InitIOAdaptor(string path, bool lockFile, long initialLength, bool readOnly , IoAdapter io) { _io = io.Open(path, lockFile, initialLength, readOnly); } private void InitCache() { _head = new CachedIoAdapter.Page(_pageSize); _head._prev = null; CachedIoAdapter.Page page = _head; CachedIoAdapter.Page next = _head; for (int i = 0; i < _pageCount - 1; ++i) { next = new CachedIoAdapter.Page(_pageSize); page._next = next; next._prev = page; page = next; } _tail = next; } /// Reads the file into the buffer using pages from cache. /// /// Reads the file into the buffer using pages from cache. If the next page /// is not cached it will be read from the file. /// /// destination buffer /// how many bytes to read /// public override int Read(byte[] buffer, int length) { long startAddress = _position; int bytesToRead = length; int totalRead = 0; while (bytesToRead > 0) { CachedIoAdapter.Page page = GetPage(startAddress, true); int readBytes = page.Read(buffer, totalRead, startAddress, bytesToRead); MovePageToHead(page); if (readBytes <= 0) { break; } bytesToRead -= readBytes; startAddress += readBytes; totalRead += readBytes; } _position = startAddress; return totalRead == 0 ? -1 : totalRead; } /// Writes the buffer to cache using pages /// source buffer /// how many bytes to write /// public override void Write(byte[] buffer, int length) { ValidateReadOnly(); long startAddress = _position; int bytesToWrite = length; int bufferOffset = 0; while (bytesToWrite > 0) { // page doesn't need to loadFromDisk if the whole page is dirty bool loadFromDisk = (bytesToWrite < _pageSize) || (startAddress % _pageSize != 0); CachedIoAdapter.Page page = GetPage(startAddress, loadFromDisk); page.EnsureEndAddress(GetLength()); int writtenBytes = page.Write(buffer, bufferOffset, startAddress, bytesToWrite); FlushIfHeaderBlockPage(page); MovePageToHead(page); bytesToWrite -= writtenBytes; startAddress += writtenBytes; bufferOffset += writtenBytes; } long endAddress = startAddress; _position = endAddress; _fileLength = Math.Max(endAddress, _fileLength); } private void FlushIfHeaderBlockPage(CachedIoAdapter.Page page) { if (ContainsHeaderBlock(page)) { FlushPage(page); } } private void ValidateReadOnly() { if (_readOnly) { throw new Db4oIOException(); } } /// Flushes cache to a physical storage /// public override void Sync() { ValidateReadOnly(); FlushAllPages(); _io.Sync(); } /// Returns the file length /// public override long GetLength() { return _fileLength; } /// Flushes and closes the file /// public override void Close() { try { FlushAllPages(); } finally { _io.Close(); } } public override IoAdapter DelegatedIoAdapter() { return _io.DelegatedIoAdapter(); } /// private CachedIoAdapter.Page GetPage(long startAddress, bool loadFromDisk) { CachedIoAdapter.Page page = GetPageFromCache(startAddress); if (page != null) { if (ContainsHeaderBlock(page)) { GetPageFromDisk(page, startAddress); } page.EnsureEndAddress(_fileLength); return page; } // in case that page is not found in the cache page = GetFreePageFromCache(); if (loadFromDisk) { GetPageFromDisk(page, startAddress); } else { ResetPageAddress(page, startAddress); } return page; } private bool ContainsHeaderBlock(CachedIoAdapter.Page page) { return page.StartAddress() <= FileHeader1.HeaderLength; } private void ResetPageAddress(CachedIoAdapter.Page page, long startAddress) { page.StartAddress(startAddress); page.EndAddress(startAddress + _pageSize); } /// private CachedIoAdapter.Page GetFreePageFromCache() { if (!_tail.IsFree()) { FlushPage(_tail); } // _posPageMap.remove(new Long(tail.startPosition / PAGE_SIZE)); return _tail; } /// private CachedIoAdapter.Page GetPageFromCache(long pos) { CachedIoAdapter.Page page = _head; while (page != null) { if (page.Contains(pos)) { return page; } page = page._next; } return null; } // Page page = (Page) _posPageMap.get(new Long(pos/PAGE_SIZE)); // return page; /// private void FlushAllPages() { CachedIoAdapter.Page node = _head; while (node != null) { FlushPage(node); node = node._next; } } /// private void FlushPage(CachedIoAdapter.Page page) { if (!page._dirty) { return; } IoSeek(page.StartAddress()); WritePageToDisk(page); return; } /// private void GetPageFromDisk(CachedIoAdapter.Page page, long pos) { long startAddress = pos - pos % _pageSize; page.StartAddress(startAddress); IoSeek(page._startAddress); int count = IoRead(page); if (count > 0) { page.EndAddress(startAddress + count); } else { page.EndAddress(startAddress); } } // _posPageMap.put(new Long(page.startPosition / PAGE_SIZE), page); /// private int IoRead(CachedIoAdapter.Page page) { int count = _io.Read(page._buffer); if (count > 0) { _filePointer = page._startAddress + count; } return count; } private void MovePageToHead(CachedIoAdapter.Page page) { if (page == _head) { return; } if (page == _tail) { CachedIoAdapter.Page tempTail = _tail._prev; tempTail._next = null; _tail._next = _head; _tail._prev = null; _head._prev = page; _head = _tail; _tail = tempTail; } else { page._prev._next = page._next; page._next._prev = page._prev; page._next = _head; _head._prev = page; page._prev = null; _head = page; } } /// private void WritePageToDisk(CachedIoAdapter.Page page) { ValidateReadOnly(); try { _io.Write(page._buffer, page.Size()); _filePointer = page.EndAddress(); page._dirty = false; } catch (Db4oIOException e) { _readOnly = true; throw; } } /// Moves the pointer to the specified file position /// position within the file /// public override void Seek(long pos) { _position = pos; } /// private void IoSeek(long pos) { if (_filePointer != pos) { _io.Seek(pos); _filePointer = pos; } } private class Page { internal byte[] _buffer; internal long _startAddress = -1; internal long _endAddress; internal readonly int _bufferSize; internal bool _dirty; internal CachedIoAdapter.Page _prev; internal CachedIoAdapter.Page _next; private byte[] zeroBytes; public Page(int size) { _bufferSize = size; _buffer = new byte[_bufferSize]; } internal virtual void EnsureEndAddress(long fileLength) { long bufferEndAddress = _startAddress + _bufferSize; if (_endAddress < bufferEndAddress && fileLength > _endAddress) { long newEndAddress = Math.Min(fileLength, bufferEndAddress); if (zeroBytes == null) { zeroBytes = new byte[_bufferSize]; } System.Array.Copy(zeroBytes, 0, _buffer, (int)(_endAddress - _startAddress), (int )(newEndAddress - _endAddress)); _endAddress = newEndAddress; } } internal virtual long EndAddress() { return _endAddress; } internal virtual void StartAddress(long address) { _startAddress = address; } internal virtual long StartAddress() { return _startAddress; } internal virtual void EndAddress(long address) { _endAddress = address; } internal virtual int Size() { return (int)(_endAddress - _startAddress); } internal virtual int Read(byte[] @out, int outOffset, long startAddress, int length ) { int bufferOffset = (int)(startAddress - _startAddress); int pageAvailbeDataSize = (int)(_endAddress - startAddress); int readBytes = Math.Min(pageAvailbeDataSize, length); if (readBytes <= 0) { // meaning reach EOF return -1; } System.Array.Copy(_buffer, bufferOffset, @out, outOffset, readBytes); return readBytes; } internal virtual int Write(byte[] data, int dataOffset, long startAddress, int length ) { int bufferOffset = (int)(startAddress - _startAddress); int pageAvailabeBufferSize = _bufferSize - bufferOffset; int writtenBytes = Math.Min(pageAvailabeBufferSize, length); System.Array.Copy(data, dataOffset, _buffer, bufferOffset, writtenBytes); long endAddress = startAddress + writtenBytes; if (endAddress > _endAddress) { _endAddress = endAddress; } _dirty = true; return writtenBytes; } internal virtual bool Contains(long address) { return (_startAddress != -1 && address >= _startAddress && address < _startAddress + _bufferSize); } internal virtual bool IsFree() { return _startAddress == -1; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/BlockAwareBinWindow.cs0000644000175000017500000000466211700531646027610 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.IO; namespace Db4objects.Db4o.IO { /// Bounded handle into an IoAdapter: Can only access a restricted area. /// Bounded handle into an IoAdapter: Can only access a restricted area. /// public class BlockAwareBinWindow { private BlockAwareBin _bin; private int _blockOff; private int _len; private bool _disabled; /// The delegate I/O adapter /// The block offset address into the I/O adapter that maps to the start index (0) of this window /// /// The size of this window in bytes public BlockAwareBinWindow(BlockAwareBin io, int blockOff, int len) { _bin = io; _blockOff = blockOff; _len = len; _disabled = false; } /// Size of this I/O adapter window in bytes. public virtual int Length() { return _len; } /// Offset in bytes relative to the window start /// Data to write into the window starting from the given offset /// /// public virtual void Write(int off, byte[] data) { CheckBounds(off, data); _bin.BlockWrite(_blockOff + off, data); } /// Offset in bytes relative to the window start /// Data buffer to read from the window starting from the given offset /// /// /// public virtual int Read(int off, byte[] data) { CheckBounds(off, data); return _bin.BlockRead(_blockOff + off, data); } /// Disable IO Adapter Window public virtual void Disable() { _disabled = true; } /// Flush IO Adapter Window public virtual void Flush() { if (!_disabled) { _bin.Sync(); } } private void CheckBounds(int off, byte[] data) { if (_disabled) { throw new InvalidOperationException(); } if (data == null || off < 0 || off + data.Length > _len) { throw new ArgumentException(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/BlockAwareBin.cs0000644000175000017500000001415411700531646026415 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.IO; using Sharpen.Lang; namespace Db4objects.Db4o.IO { /// public class BlockAwareBin : BinDecorator { private const int CopySize = 4096; private bool _readOnly; private readonly IBlockSize _blockSize = ((IBlockSize)Environments.My(typeof(IBlockSize ))); public BlockAwareBin(IBin bin) : base(bin) { } /// converts address and address offset to an absolute address protected long RegularAddress(int blockAddress, int blockAddressOffset) { if (0 == BlockSize()) { throw new InvalidOperationException(); } return (long)blockAddress * BlockSize() + blockAddressOffset; } /// copies a block within a file in block mode /// public virtual void BlockCopy(int oldAddress, int oldAddressOffset, int newAddress , int newAddressOffset, int length) { Copy(RegularAddress(oldAddress, oldAddressOffset), RegularAddress(newAddress, newAddressOffset ), length); } /// copies a block within a file in absolute mode /// public virtual void Copy(long oldAddress, long newAddress, int length) { if (DTrace.enabled) { DTrace.IoCopy.LogLength(newAddress, length); } if (length > CopySize) { byte[] buffer = new byte[CopySize]; int pos = 0; while (pos + CopySize < length) { Copy(buffer, oldAddress + pos, newAddress + pos); pos += CopySize; } oldAddress += pos; newAddress += pos; length -= pos; } Copy(new byte[length], oldAddress, newAddress); } /// private void Copy(byte[] buffer, long oldAddress, long newAddress) { Read(oldAddress, buffer); Write(oldAddress, buffer); } /// reads a buffer at the seeked address /// the number of bytes read and returned /// public virtual int BlockRead(int address, int offset, byte[] buffer) { return BlockRead(address, offset, buffer, buffer.Length); } /// implement to read a buffer at the seeked address /// public virtual int BlockRead(int address, int offset, byte[] bytes, int length) { return Read(RegularAddress(address, offset), bytes, length); } /// reads a buffer at the seeked address /// the number of bytes read and returned /// public virtual int BlockRead(int address, byte[] buffer) { return BlockRead(address, 0, buffer, buffer.Length); } /// implement to read a buffer at the seeked address /// public virtual int BlockRead(int address, byte[] bytes, int length) { return BlockRead(address, 0, bytes, length); } /// reads a buffer at the seeked address /// the number of bytes read and returned /// public virtual int Read(long pos, byte[] buffer) { return Read(pos, buffer, buffer.Length); } /// reads a buffer at the seeked address /// the number of bytes read and returned /// public virtual void BlockWrite(int address, int offset, byte[] buffer) { BlockWrite(address, offset, buffer, buffer.Length); } /// implement to read a buffer at the seeked address /// public virtual void BlockWrite(int address, int offset, byte[] bytes, int length) { Write(RegularAddress(address, offset), bytes, length); } /// reads a buffer at the seeked address /// the number of bytes read and returned /// public virtual void BlockWrite(int address, byte[] buffer) { BlockWrite(address, 0, buffer, buffer.Length); } /// implement to read a buffer at the seeked address /// public virtual void BlockWrite(int address, byte[] bytes, int length) { BlockWrite(address, 0, bytes, length); } public override void Sync() { ValidateReadOnly(); try { base.Sync(); } catch (Db4oIOException e) { _readOnly = true; throw; } } public override void Sync(IRunnable runnable) { ValidateReadOnly(); try { base.Sync(runnable); } catch (Db4oIOException e) { _readOnly = true; throw; } } /// writes a buffer to the seeked address /// public virtual void Write(long pos, byte[] bytes) { ValidateReadOnly(); try { Write(pos, bytes, bytes.Length); } catch (Db4oIOException e) { _readOnly = true; throw; } } private void ValidateReadOnly() { if (_readOnly) { throw new EmergencyShutdownReadOnlyException(); } } /// returns the block size currently used public virtual int BlockSize() { return _blockSize.Value(); } /// outside call to set the block size of this adapter public virtual void BlockSize(int blockSize) { if (blockSize < 1) { throw new ArgumentException(); } _blockSize.Set(blockSize); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/IoAdapter.cs0000644000175000017500000001262011700531646025616 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.IO; namespace Db4objects.Db4o.IO { /// Base class for database file adapters, both for file and memory databases. /// /// Base class for database file adapters, both for file and memory databases. /// [System.ObsoleteAttribute(@"Use classes that implement instead. The new functionality has been split: is the factory class to open adapters. is the actual implementation of IO access." )] public abstract class IoAdapter { private const int CopySize = 4096; private int _blockSize; /// converts address and address offset to an absolute address protected long RegularAddress(int blockAddress, int blockAddressOffset) { if (0 == _blockSize) { throw new InvalidOperationException(); } return (long)blockAddress * _blockSize + blockAddressOffset; } /// copies a block within a file in block mode /// public virtual void BlockCopy(int oldAddress, int oldAddressOffset, int newAddress , int newAddressOffset, int length) { Copy(RegularAddress(oldAddress, oldAddressOffset), RegularAddress(newAddress, newAddressOffset ), length); } /// sets the read/write pointer in the file using block mode /// public virtual void BlockSeek(int address) { BlockSeek(address, 0); } /// sets the read/write pointer in the file using block mode /// public virtual void BlockSeek(int address, int offset) { Seek(RegularAddress(address, offset)); } /// outside call to set the block size of this adapter public virtual void BlockSize(int blockSize) { if (blockSize < 1) { throw new ArgumentException(); } _blockSize = blockSize; } /// implement to close the adapter /// public abstract void Close(); /// copies a block within a file in absolute mode /// public virtual void Copy(long oldAddress, long newAddress, int length) { if (DTrace.enabled) { DTrace.IoCopy.LogLength(newAddress, length); } if (length > CopySize) { byte[] buffer = new byte[CopySize]; int pos = 0; while (pos + CopySize < length) { Copy(buffer, oldAddress + pos, newAddress + pos); pos += CopySize; } oldAddress += pos; newAddress += pos; length -= pos; } Copy(new byte[length], oldAddress, newAddress); } /// private void Copy(byte[] buffer, long oldAddress, long newAddress) { Seek(oldAddress); Read(buffer); Seek(newAddress); Write(buffer); } /// deletes the given path from whatever 'file system' is addressed public abstract void Delete(string path); /// checks whether a file exists public abstract bool Exists(string path); /// implement to return the absolute length of the file /// public abstract long GetLength(); /// implement to open the file /// public abstract IoAdapter Open(string path, bool lockFile, long initialLength, bool readOnly); /// reads a buffer at the seeked address /// the number of bytes read and returned /// public virtual int Read(byte[] buffer) { return Read(buffer, buffer.Length); } /// implement to read a buffer at the seeked address /// public abstract int Read(byte[] bytes, int length); /// implement to set the read/write pointer in the file, absolute mode /// public abstract void Seek(long pos); /// implement to flush the file contents to storage /// public abstract void Sync(); /// writes a buffer to the seeked address /// public virtual void Write(byte[] bytes) { Write(bytes, bytes.Length); } /// implement to write a buffer at the seeked address /// public abstract void Write(byte[] buffer, int length); /// returns the block size currently used public virtual int BlockSize() { return _blockSize; } /// Delegated IO Adapter /// reference to itself public virtual IoAdapter DelegatedIoAdapter() { return this; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/SynchronizedBin.cs0000644000175000017500000000177511700531646027067 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.IO; using Sharpen.Lang; namespace Db4objects.Db4o.IO { /// public class SynchronizedBin : BinDecorator { public SynchronizedBin(IBin bin) : base(bin) { } public override void Close() { lock (_bin) { base.Close(); } } public override long Length() { lock (_bin) { return base.Length(); } } public override int Read(long position, byte[] buffer, int bytesToRead) { lock (_bin) { return base.Read(position, buffer, bytesToRead); } } public override void Write(long position, byte[] bytes, int bytesToWrite) { lock (_bin) { base.Write(position, bytes, bytesToWrite); } } public override void Sync() { lock (_bin) { base.Sync(); } } public override void Sync(IRunnable runnable) { lock (_bin) { base.Sync(runnable); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/IBin.cs0000644000175000017500000000527211700531646024574 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Sharpen.Lang; namespace Db4objects.Db4o.IO { /// /// Representation of a container for storage of db4o /// database data (to file, to memory). /// /// /// Representation of a container for storage of db4o /// database data (to file, to memory). /// public interface IBin { /// returns the length of the Bin (on disc, in memory). /// returns the length of the Bin (on disc, in memory). long Length(); /// /// reads a given number of bytes into an array of bytes at an /// offset position. /// /// /// reads a given number of bytes into an array of bytes at an /// offset position. /// /// the offset position to read at /// the byte array to read bytes into /// the number of bytes to be read /// int Read(long position, byte[] bytes, int bytesToRead); /// /// writes a given number of bytes from an array of bytes at /// an offset position /// /// the offset position to write at /// the array of bytes to write /// the number of bytes to write void Write(long position, byte[] bytes, int bytesToWrite); /// /// flushes the buffer content to the physical storage /// media. /// /// /// flushes the buffer content to the physical storage /// media. /// void Sync(); /// runs the Runnable between two calls to sync(); void Sync(IRunnable runnable); /// /// reads a given number of bytes into an array of bytes at an /// offset position. /// /// /// reads a given number of bytes into an array of bytes at an /// offset position. In contrast to the normal /// Read(long, byte[], int) /// method, the Bin should ensure direct access to the raw storage medium. /// No caching should take place. /// /// the offset position to read at /// the byte array to read bytes into /// the number of bytes to be read /// int SyncRead(long position, byte[] bytes, int bytesToRead); /// closes the Bin. /// closes the Bin. void Close(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/BinConfiguration.cs0000644000175000017500000000243011700531646027204 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.IO { /// public class BinConfiguration { private readonly string _uri; private readonly bool _lockFile; private readonly long _initialLength; private readonly bool _readOnly; private readonly int _blockSize; public BinConfiguration(string uri, bool lockFile, long initialLength, bool readOnly ) : this(uri, lockFile, initialLength, readOnly, 1) { } public BinConfiguration(string uri, bool lockFile, long initialLength, bool readOnly , int blockSize) { _uri = uri; _lockFile = lockFile; _initialLength = initialLength; _readOnly = readOnly; _blockSize = blockSize; } public virtual string Uri() { return _uri; } public virtual bool LockFile() { return _lockFile; } public virtual long InitialLength() { return _initialLength; } public virtual bool ReadOnly() { return _readOnly; } public virtual int BlockSize() { return _blockSize; } public override string ToString() { return "BinConfiguration(Uri: " + _uri + ", Locked: " + _lockFile + ", ReadOnly: " + _readOnly + ", BlockSize: " + _blockSize + ")"; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/MemoryBin.cs0000644000175000017500000000534311700531646025653 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.IO; using Sharpen; using Sharpen.Lang; namespace Db4objects.Db4o.IO { public class MemoryBin : IBin { private byte[] _bytes; private int _length; private IGrowthStrategy _growthStrategy; public MemoryBin(int initialSize, IGrowthStrategy growthStrategy) : this(new byte [initialSize], growthStrategy) { } public MemoryBin(byte[] bytes, IGrowthStrategy growthStrategy) { _bytes = bytes; _length = bytes.Length; _growthStrategy = growthStrategy; } public virtual long Length() { return _length; } public virtual long BufferSize() { return _bytes.Length; } /// public virtual int Read(long pos, byte[] bytes, int length) { long avail = _length - pos; if (avail <= 0) { return -1; } int read = Math.Min((int)avail, length); System.Array.Copy(_bytes, (int)pos, bytes, 0, read); return read; } /// public virtual void Sync() { } public virtual int SyncRead(long position, byte[] bytes, int bytesToRead) { return Read(position, bytes, bytesToRead); } public virtual void Close() { } /// Returns a copy of the raw data contained in this bin for external processing. /// /// /// Returns a copy of the raw data contained in this bin for external processing. /// Access to the data is not guarded by synchronisation. If this method is called /// while the MemoryBin is in use, it is possible that the returned byte array is /// not consistent. /// public virtual byte[] Data() { byte[] data = new byte[_length]; System.Array.Copy(_bytes, 0, data, 0, _length); return data; } /// for internal processing only. /// for internal processing only. /// public virtual void Write(long pos, byte[] buffer, int length) { if (pos + length > _bytes.Length) { long newSize = _growthStrategy.NewSize(_bytes.Length, pos + length); // if (pos + length > newSize) { // newSize = pos + length; // } byte[] temp = new byte[(int)newSize]; System.Array.Copy(_bytes, 0, temp, 0, _length); _bytes = temp; } System.Array.Copy(buffer, 0, _bytes, (int)pos, length); pos += length; if (pos > _length) { _length = (int)pos; } } public virtual void Sync(IRunnable runnable) { runnable.Run(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/IoAdapterStorage.cs0000644000175000017500000000434711700531646027152 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.IO; using Sharpen.Lang; namespace Db4objects.Db4o.IO { /// public class IoAdapterStorage : IStorage { private readonly IoAdapter _io; public IoAdapterStorage(IoAdapter io) { _io = io; } public virtual bool Exists(string uri) { return _io.Exists(uri); } /// public virtual IBin Open(BinConfiguration config) { IoAdapterStorage.IoAdapterBin bin = new IoAdapterStorage.IoAdapterBin(_io.Open(config .Uri(), config.LockFile(), config.InitialLength(), config.ReadOnly())); ((IBlockSize)Environments.My(typeof(IBlockSize))).Register(bin); return bin; } internal class IoAdapterBin : IBin, IListener4 { private readonly IoAdapter _io; public IoAdapterBin(IoAdapter io) { _io = io; } public virtual void Close() { _io.Close(); } public virtual long Length() { return _io.GetLength(); } public virtual int Read(long position, byte[] buffer, int bytesToRead) { _io.Seek(position); return _io.Read(buffer, bytesToRead); } public virtual void Sync() { _io.Sync(); } public virtual int SyncRead(long position, byte[] bytes, int bytesToRead) { return Read(position, bytes, bytesToRead); } public virtual void Write(long position, byte[] bytes, int bytesToWrite) { _io.Seek(position); _io.Write(bytes, bytesToWrite); } public virtual void BlockSize(int blockSize) { _io.BlockSize(blockSize); } public virtual void OnEvent(object @event) { BlockSize((((int)@event))); } public virtual void Sync(IRunnable runnable) { Sync(); runnable.Run(); Sync(); } } /// public virtual void Delete(string uri) { _io.Delete(uri); } /// public virtual void Rename(string oldUri, string newUri) { throw new NotImplementedException(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/NonFlushingStorage.cs0000644000175000017500000000210211700531646027517 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.IO; using Sharpen.Lang; namespace Db4objects.Db4o.IO { /// /// Storage adapter that does not pass flush calls /// on to its delegate. /// /// /// Storage adapter that does not pass flush calls /// on to its delegate. /// You can use this /// IStorage /// for improved db4o /// speed at the risk of corrupted database files in /// case of system failure. /// public class NonFlushingStorage : StorageDecorator { public NonFlushingStorage(IStorage storage) : base(storage) { } protected override IBin Decorate(BinConfiguration config, IBin storage) { return new NonFlushingStorage.NonFlushingBin(storage); } private class NonFlushingBin : BinDecorator { public NonFlushingBin(IBin storage) : base(storage) { } public override void Sync() { } public override void Sync(IRunnable runnable) { runnable.Run(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IO/CachingStorage.cs0000644000175000017500000000625011700531646026631 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal.Caching; namespace Db4objects.Db4o.IO { /// /// Caching storage adapter to cache db4o database data in memory /// until the underlying /// IBin /// is instructed to flush its /// data when /// IBin.Sync() /// is called.

/// You can override the /// NewCache() /// method if you want to /// work with a different caching strategy. ///
public class CachingStorage : StorageDecorator { private static int DefaultPageCount = 64; private static int DefaultPageSize = 1024; private int _pageCount; private int _pageSize; /// /// default constructor to create a Caching storage with the default /// page count of 64 and the default page size of 1024. /// /// /// default constructor to create a Caching storage with the default /// page count of 64 and the default page size of 1024. /// /// /// the /// IStorage /// to be cached. /// public CachingStorage(IStorage storage) : this(storage, DefaultPageCount, DefaultPageSize ) { } /// /// constructor to set up a CachingStorage with a configured page count /// and page size /// /// /// the /// IStorage /// to be cached. /// /// the number of pages the cache should use. /// the size of the pages the cache should use. public CachingStorage(IStorage storage, int pageCount, int pageSize) : base(storage ) { _pageCount = pageCount; _pageSize = pageSize; } /// opens a Bin for the given URI. /// opens a Bin for the given URI. /// public override IBin Open(BinConfiguration config) { IBin storage = base.Open(config); if (config.ReadOnly()) { return new ReadOnlyBin(new CachingStorage.NonFlushingCachingBin(storage, NewCache (), _pageCount, _pageSize)); } return new CachingBin(storage, NewCache(), _pageCount, _pageSize); } /// /// override this method if you want to work with a different caching /// strategy than the default LRU2Q cache. /// /// /// override this method if you want to work with a different caching /// strategy than the default LRU2Q cache. /// protected virtual ICache4 NewCache() { return CacheFactory.NewLRULongCache(_pageCount); } private sealed class NonFlushingCachingBin : CachingBin { /// public NonFlushingCachingBin(IBin bin, ICache4 cache, int pageCount, int pageSize ) : base(bin, cache, pageCount, pageSize) { } protected override void FlushAllPages() { } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Db4oEmbedded.cs0000644000175000017500000001215511700531646025644 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Config; namespace Db4objects.Db4o { /// Factory class to open db4o instances in embedded /// mode. /// Factory class to open db4o instances in embedded mode. /// /// Db4objects.Db4o.CS.Db4oClientServer in /// Db4objects.Db4o.CS.dll for methods to open db4o servers and db4o /// clients. /// 7.5 public class Db4oEmbedded { /// /// Creates a fresh /// IEmbeddedConfiguration /// instance. /// /// a fresh, independent configuration with all options set to their default values /// public static IEmbeddedConfiguration NewConfiguration() { return new EmbeddedConfigurationImpl(Db4oFactory.NewConfiguration()); } /// /// opens an /// IObjectContainer /// on the specified database file for local use. ///
///
/// A database file can only be opened once, subsequent attempts to /// open another /// IObjectContainer /// against the same file will result in a /// DatabaseFileLockedException /// . ///
///
/// Database files can only be accessed for readwrite access from one /// process at one time. All versions except for db4o mobile edition /// use an internal mechanism to lock the database file for other /// processes. ///
///
///
/// /// a custom /// IConfiguration /// instance to be obtained via /// newConfiguration /// /// an absolute or relative path to the database /// file /// /// an open /// IObjectContainer /// /// /// Db4objects.Db4o.Config.IConfiguration.ReadOnly /// Db4objects.Db4o.Config.IConfiguration.Encrypt /// /// /// Db4objects.Db4o.Config.IConfiguration.Password /// I/O operation failed or was unexpectedly /// interrupted. /// the required database file is locked by /// another process. /// /// runtime /// configuration /// is not compatible with the configuration of the database file. /// /// /// open operation failed because the database file is in old format /// and /// /// Db4objects.Db4o.Config.IConfiguration.AllowVersionUpdates /// is set to false. /// /// database was configured as read-only. /// public static IEmbeddedObjectContainer OpenFile(IEmbeddedConfiguration config, string databaseFileName) { if (null == config) { throw new ArgumentNullException(); } return ObjectContainerFactory.OpenObjectContainer(config, databaseFileName); } /// /// Same as calling /// OpenFile(Db4objects.Db4o.Config.IEmbeddedConfiguration, string) /// /// with a fresh configuration ( /// NewConfiguration() /// ). /// /// an absolute or relative path to the database file /// OpenFile(Db4objects.Db4o.Config.IEmbeddedConfiguration, string) /// /// /// /// /// /// public static IEmbeddedObjectContainer OpenFile(string databaseFileName) { return OpenFile(NewConfiguration(), databaseFileName); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/0000755000175000017500000000000011700531646025173 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/DefragmentRecommendation.cs0000644000175000017500000000241311700531646032463 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { /// Diagnostic to recommend Defragment when needed. /// Diagnostic to recommend Defragment when needed. public class DefragmentRecommendation : DiagnosticBase { private readonly DefragmentRecommendation.DefragmentRecommendationReason _reason; public DefragmentRecommendation(DefragmentRecommendation.DefragmentRecommendationReason reason) { _reason = reason; } public class DefragmentRecommendationReason { internal readonly string _message; public DefragmentRecommendationReason(string reason) { _message = reason; } public static readonly DefragmentRecommendation.DefragmentRecommendationReason DeleteEmbeded = new DefragmentRecommendation.DefragmentRecommendationReason("Delete Embedded not supported on old file format." ); } public override string Problem() { return "Database file format is old or database is highly fragmented."; } public override object Reason() { return _reason._message; } public override string Solution() { return "Defragment the database."; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/NativeQueryOptimizerNotLoaded.cs0000644000175000017500000000251111700531646033472 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { public class NativeQueryOptimizerNotLoaded : DiagnosticBase { private int _reason; private readonly Exception _details; public const int NqNotPresent = 1; public const int NqConstructionFailed = 2; public NativeQueryOptimizerNotLoaded(int reason, Exception details) { _reason = reason; _details = details; } public override string Problem() { return "Native Query Optimizer could not be loaded"; } public override object Reason() { switch (_reason) { case NqNotPresent: { return AppendDetails("Native query not present."); } case NqConstructionFailed: { return AppendDetails("Native query couldn't be instantiated."); } default: { return AppendDetails("Reason not specified."); break; } } } public override string Solution() { return "If you to have the native queries optimized, please check that the native query jar is present in the class-path."; } private object AppendDetails(string reason) { if (_details == null) { return reason; } return reason + "\n" + _details.ToString(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/DiagnosticBase.cs0000644000175000017500000000145211700531646030403 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { /// base class for Diagnostic messages public abstract class DiagnosticBase : IDiagnostic { /// returns the reason for the message public abstract object Reason(); /// returns the potential problem that triggered the message public abstract string Problem(); /// suggests a possible solution for the possible problem public abstract string Solution(); public override string ToString() { return ":: db4o " + Db4oVersion.Name + " Diagnostics ::\n " + Reason() + " :: " + Problem() + "\n " + Solution(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/LoadedFromClassIndex.cs0000644000175000017500000000164511700531646031522 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { /// Diagnostic, if query was required to load candidate set from class index. /// /// Diagnostic, if query was required to load candidate set from class index. /// public class LoadedFromClassIndex : DiagnosticBase { private readonly string _className; public LoadedFromClassIndex(string className) { _className = className; } public override object Reason() { return _className; } public override string Problem() { return "Query candidate set could not be loaded from a field index"; } public override string Solution() { return "Consider indexing fields that you query for: " + "Db4o.configure().objectClass([class]).objectField([fieldName]).indexed(true)"; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/DescendIntoTranslator.cs0000644000175000017500000000210211700531646031766 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { /// /// Query tries to descend into a field of a class that is configured to be translated /// (and thus cannot be descended into). /// /// /// Query tries to descend into a field of a class that is configured to be translated /// (and thus cannot be descended into). /// public class DescendIntoTranslator : DiagnosticBase { private string className; private string fieldName; public DescendIntoTranslator(string className_, string fieldName_) { className = className_; fieldName = fieldName_; } public override string Problem() { return "Query descends into field(s) of translated class."; } public override object Reason() { return className + "." + fieldName; } public override string Solution() { return "Consider dropping the translator configuration or resort to evaluations/unoptimized NQs."; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/DeletionFailed.cs0000644000175000017500000000121111700531646030365 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { /// Diagnostic on failed delete. /// Diagnostic on failed delete. public class DeletionFailed : DiagnosticBase { public override string Problem() { return "Cascading delete to members failed. Possible reasons: db4o engine updates, corruption, changed class hierarchies."; } public override object Reason() { return string.Empty; } public override string Solution() { return "Running Defragment may fix."; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/UpdateDepthGreaterOne.cs0000644000175000017500000000200611700531646031703 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { /// Diagnostic, if update depth greater than 1. /// Diagnostic, if update depth greater than 1. public class UpdateDepthGreaterOne : DiagnosticBase { private readonly int _depth; public UpdateDepthGreaterOne(int depth) { _depth = depth; } public override object Reason() { return "Db4o.configure().updateDepth(" + _depth + ")"; } public override string Problem() { return "A global update depth greater than 1 is not recommended"; } public override string Solution() { return "Increasing the global update depth to a value greater than 1 is only recommended for" + " testing, not for production use. If individual deep updates are needed, consider using" + " ExtObjectContainer#set(object, depth) and make sure to profile the performance of each call."; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/DiagnosticToConsole.cs0000644000175000017500000000176411700531646031444 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { /// prints Diagnostic messsages to the Console. /// /// prints Diagnostic messages to the Console. /// Install this /// Db4objects.Db4o.Diagnostic.IDiagnosticListener /// /// with:
/// commonConfig.Diagnostic.AddListener(new DiagnosticToConsole());
///
/// Db4objects.Db4o.Diagnostic.IDiagnosticConfiguration /// public class DiagnosticToConsole : IDiagnosticListener { /// redirects Diagnostic messages to the Console. /// redirects Diagnostic messages to the Console. public virtual void OnDiagnostic(IDiagnostic d) { Sharpen.Runtime.Out.WriteLine(d.ToString()); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/NativeQueryNotOptimized.cs0000644000175000017500000000253311700531646032347 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Diagnostic; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Diagnostic { /// Diagnostic, if Native Query can not be run optimized. /// Diagnostic, if Native Query can not be run optimized. public class NativeQueryNotOptimized : DiagnosticBase { private readonly Predicate _predicate; private readonly Exception _details; public NativeQueryNotOptimized(Predicate predicate, Exception details) { _predicate = predicate; _details = details; } public override object Reason() { if (_details == null) { return _predicate; } return _predicate != null ? _predicate.ToString() : string.Empty + "\n" + _details .Message; } public override string Problem() { return "Native Query Predicate could not be run optimized"; } public override string Solution() { return "This Native Query was run by instantiating all objects of the candidate class. " + "Consider simplifying the expression in the Native Query method. If you feel that " + "the Native Query processor should understand your code better, you are invited to " + "post yout query code to db4o forums at http://developer.db4o.com/forums"; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/IDiagnosticConfiguration.cs0000644000175000017500000000247011700531646032452 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { /// provides methods to configure the behaviour of db4o /// diagnostics. /// /// provides methods to configure the behaviour of db4o diagnostics. ///
///
/// Diagnostic system can be enabled on a running db4o database to /// notify a user about possible problems or misconfigurations. /// Diagnostic listeners can be be added and removed with calls to this /// interface. To install the most basic listener call: ///
/// commonConfig.Diagnostic.AddListener(new /// DiagnosticToConsole()); ///
/// IConfiguration.Diagnostic /// /// IDiagnosticListener /// public interface IDiagnosticConfiguration { /// adds a DiagnosticListener to listen to Diagnostic messages. /// adds a DiagnosticListener to listen to Diagnostic messages. void AddListener(IDiagnosticListener listener); /// removes all DiagnosticListeners. /// removes all DiagnosticListeners. void RemoveAllListeners(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/IDiagnostic.cs0000644000175000017500000000172111700531646027720 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Diagnostic { /// /// Marker interface for Diagnostic messages

/// Diagnostic system can be enabled on a running db4o database /// to notify a user about possible problems or misconfigurations. ///
/// /// Marker interface for Diagnostic messages

/// Diagnostic system can be enabled on a running db4o database /// to notify a user about possible problems or misconfigurations. Diagnostic /// messages must implement this interface and are usually derived from /// DiagnosticBase /// class. A separate Diagnostic implementation /// should be used for each problem. ///
/// DiagnosticBase /// IDiagnosticConfiguration public interface IDiagnostic { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/ClassHasNoFields.cs0000644000175000017500000000153211700531646030650 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { /// Diagnostic, if class has no fields. /// Diagnostic, if class has no fields. public class ClassHasNoFields : DiagnosticBase { private readonly string _className; public ClassHasNoFields(string className) { _className = className; } public override object Reason() { return _className; } public override string Problem() { return "Class does not contain any persistent fields"; } public override string Solution() { return "Every class in the hierarchy requires overhead for the maintenance of a class index." + " Consider removing this class from the hierarchy, if it is not needed."; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/IDiagnosticListener.cs0000644000175000017500000000146711700531646031435 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { /// listens to Diagnostic messages. /// /// listens to Diagnostic messages. ///

Create a class that implements this listener interface and add /// the listener by calling commonConfig.Diagnostic.AddListener(). ///
/// Db4objects.Db4o.Diagnostic.IDiagnosticConfiguration /// public interface IDiagnosticListener { /// this method will be called with Diagnostic messages. /// this method will be called with Diagnostic messages. void OnDiagnostic(IDiagnostic d); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/MissingClass.cs0000644000175000017500000000115711700531646030125 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { /// Diagnostic if class not found public class MissingClass : DiagnosticBase { public readonly string _className; public MissingClass(string className) { _className = className; } public override string Problem() { return "Class not found in classpath."; } public override object Reason() { return _className; } public override string Solution() { return "Check your classpath."; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Diagnostic/ObjectFieldDoesNotExist.cs0000644000175000017500000000171011700531646032204 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; namespace Db4objects.Db4o.Diagnostic { /// /// Diagnostic if /// Db4objects.Db4o.Config.IObjectClass.ObjectField(string) /// /// was called on a /// field that does not exist. /// public class ObjectFieldDoesNotExist : DiagnosticBase { public readonly string _className; public readonly string _fieldName; public ObjectFieldDoesNotExist(string className, string fieldName) { _className = className; _fieldName = fieldName; } public override string Problem() { return "ObjectField was configured but does not exist."; } public override object Reason() { return _className + "." + _fieldName; } public override string Solution() { return "Check your configuration."; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/0000755000175000017500000000000011700531646024353 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/IEventRegistry.cs0000644000175000017500000003226411700531646027634 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Events { /// /// Provides a way to register event handlers for specific IObjectContainer events.
/// EventRegistry methods represent events available for registering callbacks. /// EventRegistry instance can be obtained from EventRegistryFactory. /// EventRegistry registry = EventRegistryFactory.ForObjectContainer(container); /// A new callback can be registered for an event with the following code: /// /// private static void OnCreated(object sender, ObjectInfoEventArgs args) /// { /// Object obj = args.Object; /// if (obj is Pilot) /// { /// Console.WriteLine(obj.ToString()); /// } /// } /// registry.Created+=new System.EventHandler<ObjectInfoEventArgs>(OnCreated); /// /// EventRegistryFactory ///
public interface IEventRegistry { /// /// This event is fired upon a query start and can be used to gather /// query statistics. /// /// /// This event is fired upon a query start and can be used to gather /// query statistics. /// The query object is available from /// QueryEventArgs /// event parameter.
///
/// event /// QueryEventArgs event System.EventHandler QueryStarted; /// /// This event is fired upon a query end and can be used to gather /// query statistics. /// /// /// This event is fired upon a query end and can be used to gather /// query statistics. /// The query object is available from /// QueryEventArgs /// event parameter.
///
/// event /// QueryEventArgs event System.EventHandler QueryFinished; /// This event is fired before an object is saved for the first time. /// /// This event is fired before an object is saved for the first time. /// The object can be obtained from /// CancellableObjectEventArgs /// event parameter. The action can be cancelled using /// CancellableObjectEventArgs.Cancel() /// /// /// event /// CancellableObjectEventArgs /// Db4objects.Db4o.IObjectContainer.Store(object) /// event System.EventHandler Creating; /// This event is fired before an object is activated. /// /// This event is fired before an object is activated. /// The object can be obtained from /// CancellableObjectEventArgs /// event parameter. The action can be cancelled using /// CancellableObjectEventArgs.Cancel() /// /// /// event /// CancellableObjectEventArgs /// Db4objects.Db4o.IObjectContainer.Activate(object, int) /// event System.EventHandler Activating; /// This event is fired before an object is updated. /// /// This event is fired before an object is updated. /// The object can be obtained from /// CancellableObjectEventArgs /// event parameter. The action can be cancelled using /// CancellableObjectEventArgs.Cancel() /// /// /// event /// CancellableObjectEventArgs /// Db4objects.Db4o.IObjectContainer.Store(object) /// event System.EventHandler Updating; /// This event is fired before an object is deleted. /// /// This event is fired before an object is deleted. /// The object can be obtained from /// CancellableObjectEventArgs /// event parameter. The action can be cancelled using /// CancellableObjectEventArgs.Cancel() /// ///

/// Note, that this event is not available in networked client/server /// mode and will throw an exception when attached to a client ObjectContainer. ///
/// event /// CancellableObjectEventArgs /// Db4objects.Db4o.IObjectContainer.Delete(object) /// event System.EventHandler Deleting; /// This event is fired before an object is deactivated. /// /// This event is fired before an object is deactivated. /// The object can be obtained from /// CancellableObjectEventArgs /// event parameter. The action can be cancelled using /// CancellableObjectEventArgs.Cancel() /// /// /// event /// CancellableObjectEventArgs /// Db4objects.Db4o.IObjectContainer.Deactivate(object, int) /// event System.EventHandler Deactivating; /// This event is fired after an object is activated. /// /// This event is fired after an object is activated. /// The object can be obtained from the /// ObjectInfoEventArgs /// event parameter.

/// The event can be used to trigger some post-activation /// functionality. ///
/// event /// ObjectInfoEventArgs /// Db4objects.Db4o.IObjectContainer.Activate(object, int) /// event System.EventHandler Activated; /// This event is fired after an object is created (saved for the first time). /// /// /// This event is fired after an object is created (saved for the first time). /// The object can be obtained from the /// ObjectInfoEventArgs /// event parameter.

/// The event can be used to trigger some post-creation /// functionality. ///
/// event /// ObjectEventArgs /// Db4objects.Db4o.IObjectContainer.Store(object) /// event System.EventHandler Created; /// This event is fired after an object is updated. /// /// This event is fired after an object is updated. /// The object can be obtained from the /// ObjectInfoEventArgs /// event parameter.

/// The event can be used to trigger some post-update /// functionality. ///
/// event /// ObjectInfoEventArgs /// Db4objects.Db4o.IObjectContainer.Store(object) /// event System.EventHandler Updated; /// This event is fired after an object is deleted. /// /// This event is fired after an object is deleted. /// The object can be obtained from the /// ObjectInfoEventArgs /// event parameter.

/// The event can be used to trigger some post-deletion /// functionality.

/// Note, that this event is not available in networked client/server /// mode and will throw an exception when attached to a client ObjectContainer. ///
/// event /// ObjectEventArgs /// Db4objects.Db4o.IObjectContainer.Delete(object) /// event System.EventHandler Deleted; /// This event is fired after an object is deactivated. /// /// This event is fired after an object is deactivated. /// The object can be obtained from the /// ObjectInfoEventArgs /// event parameter.

/// The event can be used to trigger some post-deactivation /// functionality. ///
/// event /// ObjectEventArgs /// Db4objects.Db4o.IObjectContainer.Delete(object) /// event System.EventHandler Deactivated; /// This event is fired just before a transaction is committed. /// /// This event is fired just before a transaction is committed. /// The transaction and a list of the modified objects can /// be obtained from the /// CommitEventArgs /// event parameter.

/// Committing event gives a user a chance to interrupt the commit /// and rollback the transaction. ///
/// event /// CommitEventArgs /// Db4objects.Db4o.IObjectContainer.Commit() /// event System.EventHandler Committing; /// This event is fired after a transaction has been committed. /// /// This event is fired after a transaction has been committed. /// The transaction and a list of the modified objects can /// be obtained from the /// CommitEventArgs /// event parameter.

/// The event can be used to trigger some post-commit functionality. ///
/// event /// CommitEventArgs /// Db4objects.Db4o.IObjectContainer.Commit() /// event System.EventHandler Committed; /// This event is fired when a persistent object is instantiated. /// /// This event is fired when a persistent object is instantiated. /// The object can be obtained from the /// ObjectInfoEventArgs /// event parameter. /// /// event /// ObjectInfoEventArgs event System.EventHandler Instantiated; /// This event is fired when a new class is registered with metadata. /// /// This event is fired when a new class is registered with metadata. /// The class information can be obtained from /// ClassEventArgs /// event parameter. /// /// event /// ClassEventArgs event System.EventHandler ClassRegistered; /// /// This event is fired when the /// Db4objects.Db4o.IObjectContainer.Close() /// /// is /// called. /// /// event event System.EventHandler Closing; /// /// This event is fired when the /// Db4objects.Db4o.IObjectContainer /// has /// finished its startup procedure. /// /// event event System.EventHandler Opened; } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/CommitEventArgs.cs0000644000175000017500000000232611700531646027754 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Events; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Events { /// Arguments for commit time related events. /// Arguments for commit time related events. /// IEventRegistry public class CommitEventArgs : TransactionalEventArgs { private readonly CallbackObjectInfoCollections _collections; private readonly bool _isOwnCommit; public CommitEventArgs(Transaction transaction, CallbackObjectInfoCollections collections , bool isOwnCommit) : base(transaction) { _collections = collections; _isOwnCommit = isOwnCommit; } /// Returns a iteration public virtual IObjectInfoCollection Added { get { return _collections.added; } } public virtual IObjectInfoCollection Deleted { get { return _collections.deleted; } } public virtual IObjectInfoCollection Updated { get { return _collections.updated; } } public virtual bool IsOwnCommit() { return _isOwnCommit; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/ObjectInfoEventArgs.cs0000644000175000017500000000114411700531646030543 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Events; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Events { public class ObjectInfoEventArgs : ObjectEventArgs { private readonly IObjectInfo _info; public ObjectInfoEventArgs(Transaction transaction, IObjectInfo info) : base(transaction ) { _info = info; } public override object Object { get { return _info.GetObject(); } } public virtual IObjectInfo Info { get { return _info; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/TransactionalEventArgs.cs0000644000175000017500000000111511700531646031321 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; namespace Db4objects.Db4o.Events { public class TransactionalEventArgs : EventArgs { private readonly Db4objects.Db4o.Internal.Transaction _transaction; public TransactionalEventArgs(Db4objects.Db4o.Internal.Transaction transaction) { _transaction = transaction; } public virtual object Transaction() { return _transaction; } public virtual IObjectContainer ObjectContainer() { return _transaction.ObjectContainer(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/ClassEventArgs.cs0000644000175000017500000000067011700531646027571 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Events { public class ClassEventArgs : EventArgs { private Db4objects.Db4o.Internal.ClassMetadata _clazz; public ClassEventArgs(Db4objects.Db4o.Internal.ClassMetadata clazz) { _clazz = clazz; } public virtual Db4objects.Db4o.Internal.ClassMetadata ClassMetadata() { return _clazz; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/EventException.cs0000644000175000017500000000155611700531646027651 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Events { /// /// db4o-specific exception.

/// Exception thrown during event dispatching if a client /// provided event handler throws.

/// The exception thrown by the client can be retrieved by /// calling EventException.InnerException. ///
/// /// db4o-specific exception.

/// Exception thrown during event dispatching if a client /// provided event handler throws.

/// The exception thrown by the client can be retrieved by /// calling EventException.InnerException. ///
[System.Serializable] public class EventException : Db4oRecoverableException { public EventException(Exception exc) : base(exc) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/StringEventArgs.cs0000644000175000017500000000062411700531646027771 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Events { /// 7.12 public class StringEventArgs : EventArgs { public StringEventArgs(string message) { _message = message; } public virtual string Message { get { return _message; } } private readonly string _message; } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/ObjectContainerEventArgs.cs0000644000175000017500000000122411700531646031571 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; namespace Db4objects.Db4o.Events { /// Arguments for container related events. /// Arguments for container related events. /// IEventRegistry public class ObjectContainerEventArgs : EventArgs { private readonly IObjectContainer _container; public ObjectContainerEventArgs(IObjectContainer container) { _container = container; } public virtual IObjectContainer ObjectContainer { get { return _container; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/ICancellableEventArgs.cs0000644000175000017500000000157311700531646031025 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Events { /// Argument for events related to cancellable actions. /// Argument for events related to cancellable actions. /// IEventRegistry public interface ICancellableEventArgs { /// Queries if the action was already cancelled by some event listener. /// Queries if the action was already cancelled by some event listener. bool IsCancelled { get; } /// Cancels the action related to this event. /// /// Cancels the action related to this event. /// Although the related action will be cancelled all the registered /// listeners will still receive the event. /// void Cancel(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/ObjectEventArgs.cs0000644000175000017500000000152111700531646027726 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Events; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Events { /// Arguments for object related events. /// Arguments for object related events. /// IEventRegistry public abstract class ObjectEventArgs : TransactionalEventArgs { /// Creates a new instance for the specified object. /// Creates a new instance for the specified object. protected ObjectEventArgs(Transaction transaction) : base(transaction) { } /// The object that triggered this event. /// The object that triggered this event. public abstract object Object { get; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/QueryEventArgs.cs0000644000175000017500000000203111700531646027622 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Events; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Events { /// /// Arguments for /// Db4objects.Db4o.Query.IQuery /// related events. /// /// IEventRegistry public class QueryEventArgs : TransactionalEventArgs { private IQuery _query; /// /// Creates a new instance for the specified /// Db4objects.Db4o.Query.IQuery /// instance. /// public QueryEventArgs(Transaction transaction, IQuery q) : base(transaction) { _query = q; } /// /// The /// Db4objects.Db4o.Query.IQuery /// which triggered the event. /// public virtual IQuery Query { get { return _query; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/CancellableObjectEventArgs.cs0000644000175000017500000000315711700531646032043 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Events; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Events { /// Argument for object related events which can be cancelled. /// Argument for object related events which can be cancelled. /// IEventRegistry /// ICancellableEventArgs public class CancellableObjectEventArgs : ObjectInfoEventArgs, ICancellableEventArgs { private bool _cancelled; private object _object; /// Creates a new instance for the specified object. /// Creates a new instance for the specified object. public CancellableObjectEventArgs(Transaction transaction, IObjectInfo objectInfo , object obj) : base(transaction, objectInfo) { _object = obj; } /// ICancellableEventArgs.Cancel() public virtual void Cancel() { _cancelled = true; } /// ICancellableEventArgs.IsCancelled() /// public virtual bool IsCancelled { get { return _cancelled; } } public override object Object { get { return _object; } } public override IObjectInfo Info { get { IObjectInfo info = base.Info; if (null == info) { throw new InvalidOperationException(); } return info; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Events/EventRegistryFactory.cs0000644000175000017500000000265011700531646031047 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Events; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Callbacks; using Db4objects.Db4o.Internal.Events; namespace Db4objects.Db4o.Events { /// /// Provides an interface for getting an /// IEventRegistry /// from an /// Db4objects.Db4o.IObjectContainer /// . /// public class EventRegistryFactory { /// /// Returns an /// IEventRegistry /// for registering events with the specified container. /// public static IEventRegistry ForObjectContainer(IObjectContainer objectContainer) { if (null == objectContainer) { throw new ArgumentNullException(); } IInternalObjectContainer container = ((IInternalObjectContainer)objectContainer); ICallbacks callbacks = container.Callbacks(); if (callbacks is IEventRegistry) { return (IEventRegistry)callbacks; } if (callbacks is NullCallbacks) { EventRegistryImpl impl = container.NewEventRegistry(); container.Callbacks(impl); return impl; } // TODO: create a MulticastingCallbacks and register both // the current one and the new one throw new ArgumentException(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/0000755000175000017500000000000011700531646025163 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/DefragmentConfig.cs0000644000175000017500000002221211700531646030713 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Ext; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Config; namespace Db4objects.Db4o.Defragment { /// Configuration for a defragmentation run. /// Configuration for a defragmentation run. /// Defragment public class DefragmentConfig { public const bool Debug = false; public static readonly string BackupSuffix = "backup"; private string _origPath; private string _backupPath; private string _tempPath; private IIdMapping _mapping; private IConfiguration _config; private IStoredClassFilter _storedClassFilter = null; private bool _forceBackupDelete = false; private bool _readOnly = true; private int _objectCommitFrequency; private IStorage _backupStorage; /// Creates a configuration for a defragmentation run. /// /// Creates a configuration for a defragmentation run. The backup and mapping /// file paths are generated from the original path by appending the default /// suffixes. All properties other than the provided paths are set to FALSE /// by default. /// /// /// The path to the file to be defragmented. Must exist and must be /// a valid db4o file. /// public DefragmentConfig(string origPath) : this(origPath, origPath + "." + BackupSuffix ) { } /// Creates a configuration for a defragmentation run with in-memory mapping. /// /// /// Creates a configuration for a defragmentation run with in-memory mapping. /// All properties other than the provided paths are set to FALSE by default. /// /// /// The path to the file to be defragmented. Must exist and must be /// a valid db4o file. /// /// /// The path to the backup of the original file. No file should /// exist at this position, otherwise it will be OVERWRITTEN if forceBackupDelete() /// is set to true! /// public DefragmentConfig(string origPath, string backupPath) : this(origPath, backupPath , new InMemoryIdMapping()) { } /// Creates a configuration for a defragmentation run. /// /// Creates a configuration for a defragmentation run. All properties other /// than the provided paths are set to FALSE by default. /// /// /// The path to the file to be defragmented. Must exist and must be /// a valid db4o file. /// /// /// The path to the backup of the original file. No file should /// exist at this position, otherwise it will be OVERWRITTEN if forceBackupDelete() /// is set to true! /// /// /// The Id mapping to be used internally. Pass either a /// InMemoryIdMapping /// for fastest defragment or a /// DatabaseIdMapping /// for low memory consumption. /// public DefragmentConfig(string origPath, string backupPath, IIdMapping mapping) { _origPath = origPath; _backupPath = backupPath; _mapping = mapping; } /// The path to the file to be defragmented. public virtual string OrigPath() { return _origPath; } /// The path to the backup of the original file. public virtual string BackupPath() { return _backupPath; } /// The temporary ID mapping used internally. For internal use only. public virtual IIdMapping Mapping() { return _mapping; } /// /// The /// IStoredClassFilter /// used to select stored class extents to /// be included into the defragmented file. /// public virtual IStoredClassFilter StoredClassFilter() { return (_storedClassFilter == null ? Nullfilter : _storedClassFilter); } /// /// The /// IStoredClassFilter /// used to select stored class extents to /// be included into the defragmented file. /// public virtual void StoredClassFilter(IStoredClassFilter storedClassFilter) { _storedClassFilter = storedClassFilter; } /// true, if an existing backup file should be deleted, false otherwise. public virtual bool ForceBackupDelete() { return _forceBackupDelete; } /// true, if an existing backup file should be deleted, false otherwise. /// public virtual void ForceBackupDelete(bool forceBackupDelete) { _forceBackupDelete = forceBackupDelete; } /// /// allows turning on and off readonly mode.

/// When changed classes are likely to be detected defragment, it may be required /// to open the original database in read/write mode. ///
/// /// allows turning on and off readonly mode.

/// When changed classes are likely to be detected defragment, it may be required /// to open the original database in read/write mode.

/// Readonly mode is the default setting. ///
/// false, to turn off readonly mode. public virtual void ReadOnly(bool flag) { _readOnly = flag; } /// true, if the original database file is to be opened in readonly mode. public virtual bool ReadOnly() { return _readOnly; } /// /// The db4o /// IConfiguration /// to be applied /// during the defragment process. /// public virtual IConfiguration Db4oConfig() { if (_config == null) { _config = VanillaDb4oConfig(1); } return _config; } /// /// The db4o /// IConfiguration /// to be applied /// during the defragment process. /// [System.ObsoleteAttribute(@"since 7.9: use Db4oConfig(Db4objects.Db4o.Config.IEmbeddedConfiguration) instead" )] public virtual void Db4oConfig(IConfiguration config) { _config = config; } /// /// The db4o /// IEmbeddedConfiguration /// to be applied /// during the defragment process. /// /// 7.9 public virtual void Db4oConfig(IEmbeddedConfiguration config) { _config = ((EmbeddedConfigurationImpl)config).Legacy(); } public virtual int ObjectCommitFrequency() { return _objectCommitFrequency; } /// /// The number of processed object (slots) that should trigger an /// intermediate commit of the target file. Default: 0, meaning: never. /// public virtual void ObjectCommitFrequency(int objectCommitFrequency) { _objectCommitFrequency = objectCommitFrequency; } /// /// Instruct the defragment process to upgrade the source file to the current db4o /// version prior to defragmenting it. /// /// /// Instruct the defragment process to upgrade the source file to the current db4o /// version prior to defragmenting it. Use this option if your source file has been created /// with an older db4o version than the one you are using. /// /// The location for an intermediate, upgraded version of the source file. /// public virtual void UpgradeFile(string tempPath) { _tempPath = tempPath; } public virtual bool FileNeedsUpgrade() { return _tempPath != null; } public virtual string TempPath() { return (_tempPath != null ? _tempPath : _backupPath); } public virtual int BlockSize() { return ((Config4Impl)Db4oConfig()).BlockSize(); } protected class NullFilter : IStoredClassFilter { public virtual bool Accept(IStoredClass storedClass) { return true; } } private static readonly IStoredClassFilter Nullfilter = new DefragmentConfig.NullFilter (); public static IConfiguration VanillaDb4oConfig(int blockSize) { IConfiguration config = Db4oFactory.NewConfiguration(); config.WeakReferences(false); config.BlockSize(blockSize); return config; } public virtual IConfiguration ClonedDb4oConfig() { return (IConfiguration)((Config4Impl)Db4oConfig()).DeepClone(null); } public virtual void BackupStorage(IStorage backupStorage) { _backupStorage = backupStorage; } public virtual IStorage BackupStorage() { if (_backupStorage != null) { return _backupStorage; } return _config.Storage; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/DatabaseIdMapping.cs0000644000175000017500000001427111700531646031014 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Mapping; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Defragment { /// Database based mapping for IDs during a defragmentation run. /// /// Database based mapping for IDs during a defragmentation run. /// Use this mapping to keep memory consumption lower than when /// using the /// InMemoryIdMapping /// . /// /// Defragment public class DatabaseIdMapping : AbstractIdMapping { private string _fileName; private LocalObjectContainer _mappingDb; private BTree _idTree; private BTree _slotTree; private MappedIDPair _cache = new MappedIDPair(0, 0); private DatabaseIdMapping.BTreeSpec _treeSpec = null; private int _commitFrequency = 0; private int _idInsertCount = 0; private int _slotInsertCount = 0; /// Will maintain the ID mapping as a BTree in the file with the given path. /// /// /// Will maintain the ID mapping as a BTree in the file with the given path. /// If a file exists in this location, it will be DELETED. /// Node size and cache height of the tree will be the default values used by /// the BTree implementation. The tree will never commit. /// /// The location where the BTree file should be created. public DatabaseIdMapping(string fileName) : this(fileName, null, 0) { } /// Will maintain the ID mapping as a BTree in the file with the given path. /// /// /// Will maintain the ID mapping as a BTree in the file with the given path. /// If a file exists in this location, it will be DELETED. /// /// The location where the BTree file should be created. /// The size of a BTree node /// The number of inserts after which a commit should be issued (<=0: never commit) /// public DatabaseIdMapping(string fileName, int nodeSize, int commitFrequency) : this (fileName, new DatabaseIdMapping.BTreeSpec(nodeSize), commitFrequency) { } private DatabaseIdMapping(string fileName, DatabaseIdMapping.BTreeSpec treeSpec, int commitFrequency) { // <=0 : never commit _fileName = fileName; _treeSpec = treeSpec; _commitFrequency = commitFrequency; } public override int MappedId(int oldID) { if (_cache.Orig() == oldID) { return _cache.Mapped(); } int classID = MappedClassID(oldID); if (classID != 0) { return classID; } IBTreeRange range = _idTree.SearchRange(Trans(), new MappedIDPair(oldID, 0)); IEnumerator pointers = range.Pointers(); if (pointers.MoveNext()) { BTreePointer pointer = (BTreePointer)pointers.Current; _cache = (MappedIDPair)pointer.Key(); return _cache.Mapped(); } return 0; } protected override void MapNonClassIDs(int origID, int mappedID) { _cache = new MappedIDPair(origID, mappedID); _idTree.Add(Trans(), _cache); if (_commitFrequency > 0) { _idInsertCount++; if (_commitFrequency == _idInsertCount) { _idTree.Commit(Trans()); _idInsertCount = 0; } } } /// public override void Open() { _mappingDb = DefragmentServicesImpl.FreshTempFile(_fileName, 1); _idTree = (_treeSpec == null ? new BTree(Trans(), 0, new MappedIDPairHandler()) : new BTree(Trans(), 0, new MappedIDPairHandler(), _treeSpec.NodeSize())); _slotTree = (_treeSpec == null ? new BTree(Trans(), 0, new BTreeIdSystem.IdSlotMappingHandler ()) : new BTree(Trans(), 0, new BTreeIdSystem.IdSlotMappingHandler(), _treeSpec. NodeSize())); } public override void Close() { _mappingDb.Close(); } private Transaction Trans() { return _mappingDb.SystemTransaction(); } private class BTreeSpec { private int _nodeSize; public BTreeSpec(int nodeSize) { _nodeSize = nodeSize; } public virtual int NodeSize() { return _nodeSize; } } public override void MapId(int id, Slot slot) { _slotTree.Add(Trans(), new IdSlotMapping(id, slot.Address(), slot.Length())); if (_commitFrequency > 0) { _slotInsertCount++; if (_commitFrequency == _slotInsertCount) { _slotTree.Commit(Trans()); _slotInsertCount = 0; } } } public override IVisitable SlotChanges() { return new _IVisitable_137(this); } private sealed class _IVisitable_137 : IVisitable { public _IVisitable_137(DatabaseIdMapping _enclosing) { this._enclosing = _enclosing; } public void Accept(IVisitor4 outSideVisitor) { this._enclosing._slotTree.TraverseKeys(this._enclosing.Trans(), new _IVisitor4_139 (outSideVisitor)); } private sealed class _IVisitor4_139 : IVisitor4 { public _IVisitor4_139(IVisitor4 outSideVisitor) { this.outSideVisitor = outSideVisitor; } public void Visit(object idSlotMapping) { SlotChange slotChange = new SlotChange(((IdSlotMapping)idSlotMapping)._id); slotChange.NotifySlotCreated(((IdSlotMapping)idSlotMapping).Slot()); outSideVisitor.Visit(slotChange); } private readonly IVisitor4 outSideVisitor; } private readonly DatabaseIdMapping _enclosing; } public override int AddressForId(int id) { IBTreeRange range = _slotTree.SearchRange(Trans(), new IdSlotMapping(id, 0, 0)); IEnumerator pointers = range.Pointers(); if (pointers.MoveNext()) { BTreePointer pointer = (BTreePointer)pointers.Current; return ((IdSlotMapping)pointer.Key())._address; } return 0; } public override void Commit() { _mappingDb.Commit(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/FirstPassCommand.cs0000644000175000017500000000461611700531646030736 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Metadata; namespace Db4objects.Db4o.Defragment { /// /// First step in the defragmenting process: Allocates pointer slots in the target file for /// each ID (but doesn't fill them in, yet) and registers the mapping from source pointer address /// to target pointer address. /// /// /// First step in the defragmenting process: Allocates pointer slots in the target file for /// each ID (but doesn't fill them in, yet) and registers the mapping from source pointer address /// to target pointer address. /// /// public sealed class FirstPassCommand : IPassCommand { private IDMappingCollector _collector = new IDMappingCollector(); public void ProcessClass(DefragmentServicesImpl context, ClassMetadata classMetadata , int id, int classIndexID) { _collector.CreateIDMapping(context, id, true); classMetadata.TraverseAllAspects(new _TraverseFieldCommand_24(this, context)); } private sealed class _TraverseFieldCommand_24 : TraverseFieldCommand { public _TraverseFieldCommand_24(FirstPassCommand _enclosing, DefragmentServicesImpl context) { this._enclosing = _enclosing; this.context = context; } protected override void Process(FieldMetadata field) { if (!field.IsVirtual() && field.HasIndex()) { this._enclosing.ProcessBTree(context, field.GetIndex(context.SystemTrans())); } } private readonly FirstPassCommand _enclosing; private readonly DefragmentServicesImpl context; } public void ProcessObjectSlot(DefragmentServicesImpl context, ClassMetadata classMetadata , int sourceID) { _collector.CreateIDMapping(context, sourceID, false); } /// public void ProcessClassCollection(DefragmentServicesImpl context) { _collector.CreateIDMapping(context, context.SourceClassCollectionID(), false); } public void ProcessBTree(DefragmentServicesImpl context, BTree btree) { context.RegisterBTreeIDs(btree, _collector); } public void Flush(DefragmentServicesImpl context) { _collector.Flush(context); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/IDMappingCollector.cs0000644000175000017500000000234511700531646031175 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Defragment { public class IDMappingCollector { private const int IdBatchSize = 4096; private TreeInt _ids; internal virtual void CreateIDMapping(DefragmentServicesImpl context, int objectID , bool isClassID) { if (BatchFull()) { Flush(context); } _ids = TreeInt.Add(_ids, (isClassID ? -objectID : objectID)); } private bool BatchFull() { return _ids != null && _ids.Size() == IdBatchSize; } public virtual void Flush(DefragmentServicesImpl context) { if (_ids == null) { return; } IEnumerator idIter = new TreeKeyIterator(_ids); while (idIter.MoveNext()) { int objectID = ((int)idIter.Current); bool isClassID = false; if (objectID < 0) { objectID = -objectID; isClassID = true; } // seen object ids don't come by here anymore - any other candidates? context.MapIDs(objectID, context.TargetNewId(), isClassID); } context.Mapping().Commit(); _ids = null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/DefragmentInfo.cs0000644000175000017500000000146511700531646030410 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Defragment { /// A message from the defragmentation process. /// /// A message from the defragmentation process. This is a stub only /// and will be refined. /// Currently instances of these class will only be created and sent /// to registered listeners when invalid IDs are encountered during /// the defragmentation process. These probably are harmless and the /// result of a user-initiated delete operation. /// /// Defragment public class DefragmentInfo { private string _msg; public DefragmentInfo(string msg) { _msg = msg; } public override string ToString() { return _msg; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/IIdMapping.cs0000644000175000017500000000404311700531646027474 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Defragment { /// The ID mapping used internally during a defragmentation run. /// The ID mapping used internally during a defragmentation run. /// Defragment public interface IIdMapping { /// Returns a previously registered mapping ID for the given ID if it exists. /// /// Returns a previously registered mapping ID for the given ID if it exists. /// /// The original ID /// The mapping ID for the given original ID or 0, if none has been registered. /// int MappedId(int origId); /// Registers a mapping for the given IDs. /// Registers a mapping for the given IDs. /// The original ID /// The ID to be mapped to the original ID. /// true if the given original ID specifies a class slot, false otherwise. /// void MapId(int origId, int mappedId, bool isClassId); /// Maps an ID to a slot /// /// void MapId(int id, Slot slot); /// provides a Visitable of all mappings of IDs to slots. /// provides a Visitable of all mappings of IDs to slots. IVisitable SlotChanges(); /// Prepares the mapping for use. /// Prepares the mapping for use. /// void Open(); /// Shuts down the mapping after use. /// Shuts down the mapping after use. void Close(); /// returns the slot address for an ID int AddressForId(int id); void Commit(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/IDefragmentListener.cs0000644000175000017500000000154711700531646031414 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Defragment; namespace Db4objects.Db4o.Defragment { /// Listener for defragmentation process messages. /// Listener for defragmentation process messages. /// Defragment public interface IDefragmentListener { /// /// This method will be called when the defragment process encounters /// file layout anomalies during the defragmentation process. /// /// /// This method will be called when the defragment process encounters /// file layout anomalies during the defragmentation process. /// /// The message from the defragmentation process. void NotifyDefragmentInfo(DefragmentInfo info); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/IStoredClassFilter.cs0000644000175000017500000000103011700531646031211 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Defragment { /// Filter for StoredClass instances. /// Filter for StoredClass instances. public interface IStoredClassFilter { /// StoredClass instance to be checked /// true, if the given StoredClass instance should be accepted, false otherwise. /// bool Accept(IStoredClass storedClass); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/PassCommand.cs0000644000175000017500000000254011700531646027720 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Defragment { /// Implements one step in the defragmenting process. /// Implements one step in the defragmenting process. /// internal interface IPassCommand { /// /// void ProcessObjectSlot(DefragmentServicesImpl context, ClassMetadata classMetadata , int id); /// /// void ProcessClass(DefragmentServicesImpl context, ClassMetadata classMetadata, int id, int classIndexID); /// /// void ProcessClassCollection(DefragmentServicesImpl context); /// /// void ProcessBTree(DefragmentServicesImpl context, BTree btree); void Flush(DefragmentServicesImpl context); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/SecondPassCommand.cs0000644000175000017500000001237711700531646031065 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Defragment { /// /// Second step in the defragmenting process: Fills in target file pointer slots, copies /// content slots from source to target and triggers ID remapping therein by calling the /// appropriate db4o/marshaller defrag() implementations. /// /// /// Second step in the defragmenting process: Fills in target file pointer slots, copies /// content slots from source to target and triggers ID remapping therein by calling the /// appropriate db4o/marshaller defrag() implementations. During the process, the actual address /// mappings for the content slots are registered for use with string indices. /// /// internal sealed class SecondPassCommand : IPassCommand { protected readonly int _objectCommitFrequency; protected int _objectCount = 0; public SecondPassCommand(int objectCommitFrequency) { _objectCommitFrequency = objectCommitFrequency; } /// /// public void ProcessClass(DefragmentServicesImpl services, ClassMetadata classMetadata , int id, int classIndexID) { if (services.MappedID(id, -1) == -1) { Sharpen.Runtime.Err.WriteLine("MAPPING NOT FOUND: " + id); } DefragmentContextImpl.ProcessCopy(services, id, new _ISlotCopyHandler_34(classMetadata , classIndexID)); } private sealed class _ISlotCopyHandler_34 : ISlotCopyHandler { public _ISlotCopyHandler_34(ClassMetadata classMetadata, int classIndexID) { this.classMetadata = classMetadata; this.classIndexID = classIndexID; } public void ProcessCopy(DefragmentContextImpl context) { classMetadata.DefragClass(context, classIndexID); } private readonly ClassMetadata classMetadata; private readonly int classIndexID; } /// /// public void ProcessObjectSlot(DefragmentServicesImpl services, ClassMetadata classMetadata , int id) { ByteArrayBuffer sourceBuffer = services.SourceBufferByID(id); DefragmentContextImpl.ProcessCopy(services, id, new _ISlotCopyHandler_43(this, services ), sourceBuffer); } private sealed class _ISlotCopyHandler_43 : ISlotCopyHandler { public _ISlotCopyHandler_43(SecondPassCommand _enclosing, DefragmentServicesImpl services) { this._enclosing = _enclosing; this.services = services; } public void ProcessCopy(DefragmentContextImpl context) { ClassMetadata.DefragObject(context); if (this._enclosing._objectCommitFrequency > 0) { this._enclosing._objectCount++; if (this._enclosing._objectCount == this._enclosing._objectCommitFrequency) { services.TargetCommit(); services.Mapping().Commit(); this._enclosing._objectCount = 0; } } } private readonly SecondPassCommand _enclosing; private readonly DefragmentServicesImpl services; } /// /// public void ProcessClassCollection(DefragmentServicesImpl services) { DefragmentContextImpl.ProcessCopy(services, services.SourceClassCollectionID(), new _ISlotCopyHandler_59(services)); } private sealed class _ISlotCopyHandler_59 : ISlotCopyHandler { public _ISlotCopyHandler_59(DefragmentServicesImpl services) { this.services = services; } public void ProcessCopy(DefragmentContextImpl context) { int acceptedClasses = 0; int numClassesOffset = context.TargetBuffer().Offset(); acceptedClasses = this.CopyAcceptedClasses(context, acceptedClasses); this.WriteIntAt(context.TargetBuffer(), numClassesOffset, acceptedClasses); } private int CopyAcceptedClasses(DefragmentContextImpl context, int acceptedClasses ) { int numClasses = context.ReadInt(); for (int classIdx = 0; classIdx < numClasses; classIdx++) { int classId = context.SourceBuffer().ReadInt(); if (!this.Accept(classId)) { continue; } ++acceptedClasses; context.WriteMappedID(classId); } return acceptedClasses; } private void WriteIntAt(ByteArrayBuffer target, int offset, int value) { int currentOffset = target.Offset(); target.Seek(offset); target.WriteInt(value); target.Seek(currentOffset); } private bool Accept(int classId) { return services.Accept(services.ClassMetadataForId(classId)); } private readonly DefragmentServicesImpl services; } /// /// public void ProcessBTree(DefragmentServicesImpl context, BTree btree) { btree.DefragBTree(context); } public void Flush(DefragmentServicesImpl context) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/InMemoryIdMapping.cs0000644000175000017500000000544511700531646031052 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Defragment { /// In-memory mapping for IDs during a defragmentation run. /// /// In-memory mapping for IDs during a defragmentation run. /// This is faster than the /// DatabaseIdMapping /// but /// it uses more memory. If you have OutOfMemory conditions /// with this id mapping, use the /// DatabaseIdMapping /// instead. /// /// Defragment public class InMemoryIdMapping : AbstractIdMapping { private IdSlotTree _idsToSlots; private Tree _tree; public override int MappedId(int oldID) { int classID = MappedClassID(oldID); if (classID != 0) { return classID; } TreeIntObject res = (TreeIntObject)TreeInt.Find(_tree, oldID); if (res != null) { return ((int)res._object); } return 0; } public override void Open() { } public override void Close() { } protected override void MapNonClassIDs(int origID, int mappedID) { _tree = Tree.Add(_tree, new TreeIntObject(origID, mappedID)); } public override int AddressForId(int id) { IdSlotTree node = (IdSlotTree)_idsToSlots.Find(id); if (node == null) { throw new InvalidOperationException(); } return node.Slot().Address(); } public override void MapId(int id, Slot slot) { IdSlotTree idSlotMapping = new IdSlotTree(id, slot); _idsToSlots = ((IdSlotTree)Tree.Add(_idsToSlots, idSlotMapping)); } public override IVisitable SlotChanges() { return new _IVisitable_62(this); } private sealed class _IVisitable_62 : IVisitable { public _IVisitable_62(InMemoryIdMapping _enclosing) { this._enclosing = _enclosing; } public void Accept(IVisitor4 outSideVisitor) { Tree.Traverse(this._enclosing._idsToSlots, new _IVisitor4_64(outSideVisitor)); } private sealed class _IVisitor4_64 : IVisitor4 { public _IVisitor4_64(IVisitor4 outSideVisitor) { this.outSideVisitor = outSideVisitor; } public void Visit(object idSlotMapping) { SlotChange slotChange = new SlotChange(((TreeInt)idSlotMapping)._key); slotChange.NotifySlotCreated(((IdSlotTree)idSlotMapping).Slot()); outSideVisitor.Visit(slotChange); } private readonly IVisitor4 outSideVisitor; } private readonly InMemoryIdMapping _enclosing; } public override void Commit() { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/Defragment.cs0000644000175000017500000003475711700531646027606 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.IO; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Classindex; using Db4objects.Db4o.Internal.Mapping; namespace Db4objects.Db4o.Defragment { /// defragments database files. /// /// defragments database files. ///
///
/// db4o structures storage inside database files as free and occupied /// slots, very much like a file system - and just like a file system it /// can be fragmented. ///
///
/// The simplest way to defragment a database file: ///
///
/// Defragment.Defrag("sample.yap"); /// ///
///
/// This will move the file to "sample.yap.backup", then create a /// defragmented version of this file in the original position, using a /// temporary file "sample.yap.mapping". If the backup file already /// exists, this will throw an exception and no action will be taken. ///
///
/// For more detailed configuration of the defragmentation process, /// provide a DefragmentConfig instance: ///
///
/// /// DefragmentConfig config=new /// DefragmentConfig("sample.yap","sample.bap",new /// BTreeIDMapping("sample.map")); ///
/// config.ForceBackupDelete(true); ///
/// config.StoredClassFilter(new AvailableClassFilter()); ///
/// config.Db4oConfig(db4oConfig); ///
/// Defragment.Defrag(config); ///
///
///
/// This will move the file to "sample.bap", then create a defragmented /// version of this file in the original position, using a temporary /// file "sample.map" for BTree mapping. If the backup file already /// exists, it will be deleted. The defragmentation process will skip /// all classes that have instances stored within the yap file, but that /// are not available on the class path (through the current /// classloader). Custom db4o configuration options are read from the /// IConfiguration /// passed as db4oConfig. /// Note: /// For some specific, non-default configuration settings like UUID /// generation, etc., you /// must /// pass an appropriate db4o configuration, just like you'd use it /// within your application for normal database operation. ///
public class Defragment { /// /// Renames the file at the given original path to a backup file and then /// builds a defragmented version of the file in the original place. /// /// /// Renames the file at the given original path to a backup file and then /// builds a defragmented version of the file in the original place. /// /// The path to the file to be defragmented. /// if the original file cannot be moved to the backup location /// public static void Defrag(string origPath) { Defrag(new DefragmentConfig(origPath), new Defragment.NullListener()); } /// /// Renames the file at the given original path to the given backup file and /// then builds a defragmented version of the file in the original place. /// /// /// Renames the file at the given original path to the given backup file and /// then builds a defragmented version of the file in the original place. /// /// The path to the file to be defragmented. /// The path to the backup file to be created. /// if the original file cannot be moved to the backup location /// public static void Defrag(string origPath, string backupPath) { Defrag(new DefragmentConfig(origPath, backupPath), new Defragment.NullListener()); } /// /// Renames the file at the configured original path to the configured backup /// path and then builds a defragmented version of the file in the original /// place. /// /// /// Renames the file at the configured original path to the configured backup /// path and then builds a defragmented version of the file in the original /// place. /// /// The configuration for this defragmentation run. /// if the original file cannot be moved to the backup location /// public static void Defrag(DefragmentConfig config) { Defrag(config, new Defragment.NullListener()); } /// /// Renames the file at the configured original path to the configured backup /// path and then builds a defragmented version of the file in the original /// place. /// /// /// Renames the file at the configured original path to the configured backup /// path and then builds a defragmented version of the file in the original /// place. /// /// The configuration for this defragmentation run. /// /// A listener for status notifications during the defragmentation /// process. /// /// if the original file cannot be moved to the backup location /// public static void Defrag(DefragmentConfig config, IDefragmentListener listener) { IStorage storage = config.Db4oConfig().Storage; EnsureFileExists(storage, config.OrigPath()); IStorage backupStorage = config.BackupStorage(); if (backupStorage.Exists(config.BackupPath())) { if (!config.ForceBackupDelete()) { throw new IOException("Could not use '" + config.BackupPath() + "' as backup path - file exists." ); } } // Always delete, because !exists can indicate length == 0 backupStorage.Delete(config.BackupPath()); MoveToBackup(config); if (config.FileNeedsUpgrade()) { UpgradeFile(config); } DefragmentServicesImpl services = new DefragmentServicesImpl(config, listener); try { FirstPass(services, config); services.CommitIds(); SecondPass(services, config); services.CommitIds(); DefragUnindexed(services); services.CommitIds(); services.DefragIdToTimestampBtree(); services.ReplaceClassMetadataRepository(); } catch (CorruptionException exc) { Sharpen.Runtime.PrintStackTrace(exc); } finally { services.Close(); } } /// private static void MoveToBackup(DefragmentConfig config) { IStorage origStorage = config.Db4oConfig().Storage; if (origStorage == config.BackupStorage()) { origStorage.Rename(config.OrigPath(), config.BackupPath()); return; } CopyBin(origStorage, config.BackupStorage(), config.OrigPath(), config.BackupPath ()); origStorage.Delete(config.OrigPath()); } /// private static void CopyBin(IStorage sourceStorage, IStorage targetStorage, string sourcePath, string targetPath) { IBin origBin = sourceStorage.Open(new BinConfiguration(sourcePath, true, 0, true) ); try { IBin backupBin = targetStorage.Open(new BinConfiguration(targetPath, true, origBin .Length(), false)); try { byte[] buffer = new byte[4096]; int bytesRead = -1; int pos = 0; while ((bytesRead = origBin.Read(pos, buffer, buffer.Length)) >= 0) { backupBin.Write(pos, buffer, bytesRead); pos += bytesRead; } } finally { SyncAndClose(backupBin); } } finally { SyncAndClose(origBin); } } private static void SyncAndClose(IBin bin) { try { bin.Sync(); } finally { bin.Close(); } } /// private static void EnsureFileExists(IStorage storage, string origPath) { if (!storage.Exists(origPath)) { throw new IOException("Source database file '" + origPath + "' does not exist."); } } /// private static void UpgradeFile(DefragmentConfig config) { CopyBin(config.BackupStorage(), config.BackupStorage(), config.BackupPath(), config .TempPath()); IConfiguration db4oConfig = (IConfiguration)((Config4Impl)config.Db4oConfig()).DeepClone (null); db4oConfig.Storage = config.BackupStorage(); db4oConfig.AllowVersionUpdates(true); IObjectContainer db = Db4oFactory.OpenFile(db4oConfig, config.TempPath()); db.Close(); } private static void DefragUnindexed(DefragmentServicesImpl services) { IdSource unindexedIDs = services.UnindexedIDs(); while (unindexedIDs.HasMoreIds()) { int origID = unindexedIDs.NextId(); DefragmentContextImpl.ProcessCopy(services, origID, new _ISlotCopyHandler_208()); } } private sealed class _ISlotCopyHandler_208 : ISlotCopyHandler { public _ISlotCopyHandler_208() { } public void ProcessCopy(DefragmentContextImpl context) { ClassMetadata.DefragObject(context); } } /// /// private static void FirstPass(DefragmentServicesImpl context, DefragmentConfig config ) { // System.out.println("FIRST"); Pass(context, config, new FirstPassCommand()); } /// /// private static void SecondPass(DefragmentServicesImpl context, DefragmentConfig config ) { // System.out.println("SECOND"); Pass(context, config, new SecondPassCommand(config.ObjectCommitFrequency())); } /// /// private static void Pass(DefragmentServicesImpl context, DefragmentConfig config, IPassCommand command) { command.ProcessClassCollection(context); IStoredClass[] classes = context.StoredClasses(DefragmentServicesImpl.Sourcedb); for (int classIdx = 0; classIdx < classes.Length; classIdx++) { ClassMetadata classMetadata = (ClassMetadata)classes[classIdx]; if (!config.StoredClassFilter().Accept(classMetadata)) { continue; } ProcessClass(context, classMetadata, command); command.Flush(context); if (config.ObjectCommitFrequency() > 0) { context.TargetCommit(); } } BTree uuidIndex = context.SourceUuidIndex(); if (uuidIndex != null) { command.ProcessBTree(context, uuidIndex); } command.Flush(context); context.TargetCommit(); } // TODO order of class index/object slot processing is crucial: // - object slots before field indices (object slots register addresses for // use by string indices) // - class index before object slots, otherwise phantom btree entries from // deletions appear in the source class index?!? // reproducable with SelectiveCascadingDeleteTestCase and ObjectSetTestCase // - investigate. /// /// private static void ProcessClass(DefragmentServicesImpl context, ClassMetadata curClass , IPassCommand command) { ProcessClassIndex(context, curClass, command); if (!ParentHasIndex(curClass)) { ProcessObjectsForClass(context, curClass, command); } ProcessClassAndFieldIndices(context, curClass, command); } private static bool ParentHasIndex(ClassMetadata curClass) { ClassMetadata parentClass = curClass.GetAncestor(); while (parentClass != null) { if (parentClass.HasClassIndex()) { return true; } parentClass = parentClass.GetAncestor(); } return false; } private static void ProcessObjectsForClass(DefragmentServicesImpl context, ClassMetadata curClass, IPassCommand command) { context.TraverseAll(curClass, new _IVisitor4_284(command, context, curClass)); } private sealed class _IVisitor4_284 : IVisitor4 { public _IVisitor4_284(IPassCommand command, DefragmentServicesImpl context, ClassMetadata curClass) { this.command = command; this.context = context; this.curClass = curClass; } public void Visit(object obj) { int id = ((int)obj); try { // FIXME bubble up exceptions command.ProcessObjectSlot(context, curClass, id); } catch (CorruptionException e) { Sharpen.Runtime.PrintStackTrace(e); } catch (IOException e) { Sharpen.Runtime.PrintStackTrace(e); } } private readonly IPassCommand command; private readonly DefragmentServicesImpl context; private readonly ClassMetadata curClass; } /// /// private static void ProcessClassAndFieldIndices(DefragmentServicesImpl context, ClassMetadata curClass, IPassCommand command) { int sourceClassIndexID = 0; int targetClassIndexID = 0; if (curClass.HasClassIndex()) { sourceClassIndexID = curClass.Index().Id(); targetClassIndexID = context.MappedID(sourceClassIndexID, -1); } command.ProcessClass(context, curClass, curClass.GetID(), targetClassIndexID); } /// /// private static void ProcessClassIndex(DefragmentServicesImpl context, ClassMetadata curClass, IPassCommand command) { if (curClass.HasClassIndex()) { BTreeClassIndexStrategy indexStrategy = (BTreeClassIndexStrategy)curClass.Index(); BTree btree = indexStrategy.Btree(); command.ProcessBTree(context, btree); } } internal class NullListener : IDefragmentListener { public virtual void NotifyDefragmentInfo(DefragmentInfo info) { } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/AbstractIdMapping.cs0000644000175000017500000000251111700531646031045 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Defragment { /// Base class for defragment ID mappings. /// Base class for defragment ID mappings. /// Defragment public abstract class AbstractIdMapping : IIdMapping { private Hashtable4 _classIDs = new Hashtable4(); public void MapId(int origID, int mappedID, bool isClassID) { if (isClassID) { MapClassIDs(origID, mappedID); return; } MapNonClassIDs(origID, mappedID); } protected virtual int MappedClassID(int origID) { object obj = _classIDs.Get(origID); if (obj == null) { return 0; } return ((int)obj); } private void MapClassIDs(int oldID, int newID) { _classIDs.Put(oldID, newID); } protected abstract void MapNonClassIDs(int origID, int mappedID); public abstract int AddressForId(int arg1); public abstract void Close(); public abstract void Commit(); public abstract void MapId(int arg1, Slot arg2); public abstract int MappedId(int arg1); public abstract void Open(); public abstract IVisitable SlotChanges(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/DefragmentServicesImpl.cs0000644000175000017500000003735411700531646032130 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Classindex; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Mapping; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Defragment { /// public class DefragmentServicesImpl : IDefragmentServices { public abstract class DbSelector { internal DbSelector() { } internal abstract LocalObjectContainer Db(DefragmentServicesImpl context); internal virtual Db4objects.Db4o.Internal.Transaction Transaction(DefragmentServicesImpl context) { return Db(context).SystemTransaction(); } } private sealed class _DbSelector_39 : DefragmentServicesImpl.DbSelector { public _DbSelector_39() { } internal override LocalObjectContainer Db(DefragmentServicesImpl context) { return context._sourceDb; } } public static readonly DefragmentServicesImpl.DbSelector Sourcedb = new _DbSelector_39 (); private sealed class _DbSelector_45 : DefragmentServicesImpl.DbSelector { public _DbSelector_45() { } internal override LocalObjectContainer Db(DefragmentServicesImpl context) { return context._targetDb; } } public static readonly DefragmentServicesImpl.DbSelector Targetdb = new _DbSelector_45 (); private readonly LocalObjectContainer _sourceDb; private readonly LocalObjectContainer _targetDb; private readonly IIdMapping _mapping; private IDefragmentListener _listener; private IQueue4 _unindexed = new NonblockingQueue(); private DefragmentConfig _defragConfig; /// public DefragmentServicesImpl(DefragmentConfig defragConfig, IDefragmentListener listener) { _listener = listener; Config4Impl originalConfig = (Config4Impl)defragConfig.Db4oConfig(); IStorage storage = defragConfig.BackupStorage(); if (defragConfig.ReadOnly()) { storage = new NonFlushingStorage(storage); } Config4Impl sourceConfig = PrepareConfig(originalConfig, storage, defragConfig.ReadOnly ()); _sourceDb = (LocalObjectContainer)Db4oFactory.OpenFile(sourceConfig, defragConfig .TempPath()).Ext(); _sourceDb.ShowInternalClasses(true); defragConfig.Db4oConfig().BlockSize(_sourceDb.BlockSize()); if (!originalConfig.GenerateCommitTimestamps().DefiniteNo()) { defragConfig.Db4oConfig().GenerateCommitTimestamps(_sourceDb.Config().GenerateCommitTimestamps ().DefiniteYes()); } _targetDb = FreshTargetFile(defragConfig); _mapping = defragConfig.Mapping(); _mapping.Open(); _defragConfig = defragConfig; } private Config4Impl PrepareConfig(Config4Impl originalConfig, IStorage storage, bool readOnly) { Config4Impl sourceConfig = (Config4Impl)originalConfig.DeepClone(null); sourceConfig.WeakReferences(false); sourceConfig.Storage = storage; sourceConfig.ReadOnly(readOnly); return sourceConfig; } /// internal static LocalObjectContainer FreshTempFile(string fileName, int blockSize ) { FileStorage storage = new FileStorage(); storage.Delete(fileName); IConfiguration db4oConfig = DefragmentConfig.VanillaDb4oConfig(blockSize); db4oConfig.ObjectClass(typeof(IdSlotMapping)).ObjectField("_id").Indexed(true); db4oConfig.Storage = storage; return (LocalObjectContainer)Db4oFactory.OpenFile(db4oConfig, fileName).Ext(); } /// internal static LocalObjectContainer FreshTargetFile(DefragmentConfig config) { config.Db4oConfig().Storage.Delete(config.OrigPath()); return (LocalObjectContainer)Db4oFactory.OpenFile(config.ClonedDb4oConfig(), config .OrigPath()); } public virtual int MappedID(int oldID, int defaultID) { int mapped = InternalMappedID(oldID); return (mapped != 0 ? mapped : defaultID); } /// public virtual int StrictMappedID(int oldID) { int mapped = InternalMappedID(oldID); if (mapped == 0) { throw new MappingNotFoundException(oldID); } return mapped; } public virtual int MappedID(int id) { if (id == 0) { return 0; } int mapped = InternalMappedID(id); if (mapped == 0) { _listener.NotifyDefragmentInfo(new DefragmentInfo("No mapping found for ID " + id )); return Const4.InvalidObjectId; } return mapped; } /// private int InternalMappedID(int oldID) { if (oldID == 0) { return 0; } int mappedId = _mapping.MappedId(oldID); if (mappedId == 0 && _sourceDb.Handlers.IsSystemHandler(oldID)) { return oldID; } return mappedId; } public virtual void MapIDs(int oldID, int newID, bool isClassID) { _mapping.MapId(oldID, newID, isClassID); } public virtual void Close() { _sourceDb.Close(); _targetDb.Close(); _mapping.Close(); } public virtual ByteArrayBuffer BufferByID(DefragmentServicesImpl.DbSelector selector , int id) { Slot slot = CommittedSlot(selector, id); return BufferByAddress(selector, slot.Address(), slot.Length()); } private Slot CommittedSlot(DefragmentServicesImpl.DbSelector selector, int id) { return selector.Db(this).IdSystem().CommittedSlot(id); } /// public virtual ByteArrayBuffer SourceBufferByAddress(int address, int length) { return BufferByAddress(Sourcedb, address, length); } /// public virtual ByteArrayBuffer TargetBufferByAddress(int address, int length) { return BufferByAddress(Targetdb, address, length); } public virtual ByteArrayBuffer BufferByAddress(DefragmentServicesImpl.DbSelector selector, int address, int length) { return selector.Db(this).DecryptedBufferByAddress(address, length); } /// public virtual StatefulBuffer TargetStatefulBufferByAddress(int address, int length ) { return _targetDb.ReadWriterByAddress(Targetdb.Transaction(this), address, length); } public virtual Slot AllocateTargetSlot(int length) { return _targetDb.AllocateSlot(length); } public virtual void TargetWriteBytes(DefragmentContextImpl context, int address) { context.Write(_targetDb, address); } public virtual void TargetWriteBytes(ByteArrayBuffer reader, int address) { _targetDb.WriteBytes(reader, address, 0); } public virtual IStoredClass[] StoredClasses(DefragmentServicesImpl.DbSelector selector ) { LocalObjectContainer db = selector.Db(this); db.ShowInternalClasses(true); try { return db.ClassCollection().StoredClasses(); } finally { db.ShowInternalClasses(false); } } public virtual LatinStringIO StringIO() { return _sourceDb.StringIO(); } public virtual void TargetCommit() { _targetDb.Commit(); } public virtual ITypeHandler4 SourceHandler(int id) { return _sourceDb.TypeHandlerForClassMetadataID(id); } public virtual int SourceClassCollectionID() { return _sourceDb.ClassCollection().GetID(); } private Hashtable4 _classIndices = new Hashtable4(16); public virtual int ClassIndexID(ClassMetadata classMetadata) { return ClassIndex(classMetadata).Id(); } public virtual void TraverseAll(ClassMetadata classMetadata, IVisitor4 command) { if (!classMetadata.HasClassIndex()) { return; } classMetadata.Index().TraverseAll(Sourcedb.Transaction(this), command); } public virtual void TraverseAllIndexSlots(ClassMetadata classMetadata, IVisitor4 command) { IEnumerator slotIDIter = classMetadata.Index().AllSlotIDs(Sourcedb.Transaction(this )); while (slotIDIter.MoveNext()) { command.Visit(slotIDIter.Current); } } public virtual void TraverseAllIndexSlots(BTree btree, IVisitor4 command) { IEnumerator slotIDIter = btree.AllNodeIds(Sourcedb.Transaction(this)); while (slotIDIter.MoveNext()) { command.Visit(slotIDIter.Current); } } public virtual void RegisterBTreeIDs(BTree btree, IDMappingCollector collector) { collector.CreateIDMapping(this, btree.GetID(), false); TraverseAllIndexSlots(btree, new _IVisitor4_244(this, collector)); } private sealed class _IVisitor4_244 : IVisitor4 { public _IVisitor4_244(DefragmentServicesImpl _enclosing, IDMappingCollector collector ) { this._enclosing = _enclosing; this.collector = collector; } public void Visit(object obj) { int id = ((int)obj); collector.CreateIDMapping(this._enclosing, id, false); } private readonly DefragmentServicesImpl _enclosing; private readonly IDMappingCollector collector; } public virtual int DatabaseIdentityID(DefragmentServicesImpl.DbSelector selector) { LocalObjectContainer db = selector.Db(this); Db4oDatabase identity = db.Identity(); if (identity == null) { return 0; } return identity.GetID(selector.Transaction(this)); } private IClassIndexStrategy ClassIndex(ClassMetadata classMetadata) { IClassIndexStrategy classIndex = (IClassIndexStrategy)_classIndices.Get(classMetadata ); if (classIndex == null) { classIndex = new BTreeClassIndexStrategy(classMetadata); _classIndices.Put(classMetadata, classIndex); classIndex.Initialize(_targetDb); } return classIndex; } public virtual Db4objects.Db4o.Internal.Transaction SystemTrans() { return Sourcedb.Transaction(this); } public virtual void CopyIdentity() { _targetDb.SetIdentity(_sourceDb.Identity()); } public virtual void ReplaceClassMetadataRepository() { Db4objects.Db4o.Internal.Transaction systemTransaction = _targetDb.SystemTransaction (); // Can't use strictMappedID because the repository ID can // be lower than HandlerRegisrtry _highestBuiltinTypeID and // the ClassRepository ID would be treated as a system handler // and the unmapped ID would be returned. int newRepositoryId = _mapping.MappedId(SourceClassCollectionID()); int sourceIdentityID = DatabaseIdentityID(DefragmentServicesImpl.Sourcedb); int targetIdentityID = _mapping.MappedId(sourceIdentityID); int targetUuidIndexID = _mapping.MappedId(SourceUuidIndexID()); int oldIdentityId = _targetDb.SystemData().Identity().GetID(systemTransaction); int oldRepositoryId = _targetDb.ClassCollection().GetID(); ClassMetadataRepository oldRepository = _targetDb.ClassCollection(); ClassMetadataRepository newRepository = new ClassMetadataRepository(systemTransaction ); newRepository.SetID(newRepositoryId); newRepository.Read(systemTransaction); newRepository.InitOnUp(systemTransaction); _targetDb.SystemData().ClassCollectionID(newRepositoryId); _targetDb.ReplaceClassMetadataRepository(newRepository); _targetDb.SystemData().UuidIndexId(targetUuidIndexID); Db4oDatabase identity = (Db4oDatabase)_targetDb.GetByID(systemTransaction, targetIdentityID ); _targetDb.SetIdentity(identity); ClassMetadataIterator iterator = oldRepository.Iterator(); while (iterator.MoveNext()) { ClassMetadata classMetadata = iterator.CurrentClass(); BTreeClassIndexStrategy index = (BTreeClassIndexStrategy)classMetadata.Index(); index.Btree().Free(_targetDb.LocalSystemTransaction()); FreeById(classMetadata.GetID()); } FreeById(oldIdentityId); FreeById(oldRepositoryId); } public virtual void DefragIdToTimestampBtree() { if (_sourceDb.SystemData().IdToTimestampIndexId() == 0) { return; } LocalTransaction targetTransaction = (LocalTransaction)_targetDb.SystemTransaction (); LocalTransaction sourceTransaction = (LocalTransaction)_sourceDb.SystemTransaction (); CommitTimestampSupport target = targetTransaction.CommitTimestampSupport(); CommitTimestampSupport source = sourceTransaction.CommitTimestampSupport(); if (source.IdToTimestamp() == null) { return; } source.IdToTimestamp().TraverseKeys(sourceTransaction, new _IVisitor4_336(this, target , targetTransaction)); } private sealed class _IVisitor4_336 : IVisitor4 { public _IVisitor4_336(DefragmentServicesImpl _enclosing, CommitTimestampSupport target , LocalTransaction targetTransaction) { this._enclosing = _enclosing; this.target = target; this.targetTransaction = targetTransaction; } public void Visit(object te) { int mappedID = this._enclosing.MappedID(((CommitTimestampSupport.TimestampEntry)te ).ParentID()); target.Put(targetTransaction, mappedID, ((CommitTimestampSupport.TimestampEntry)te ).GetCommitTimestamp()); } private readonly DefragmentServicesImpl _enclosing; private readonly CommitTimestampSupport target; private readonly LocalTransaction targetTransaction; } private void FreeById(int id) { _targetDb.SystemTransaction().IdSystem().NotifySlotDeleted(id, SlotChangeFactory. SystemObjects); } public virtual ByteArrayBuffer SourceBufferByID(int sourceID) { return BufferByID(Sourcedb, sourceID); } public virtual BTree SourceUuidIndex() { if (SourceUuidIndexID() == 0) { return null; } return _sourceDb.UUIDIndex().GetIndex(SystemTrans()); } public virtual void TargetUuidIndexID(int id) { _targetDb.SystemData().UuidIndexId(id); } public virtual int SourceUuidIndexID() { return _sourceDb.SystemData().UuidIndexId(); } public virtual int SourceIdToTimestampIndexID() { return _sourceDb.SystemData().IdToTimestampIndexId(); } public virtual ClassMetadata ClassMetadataForId(int id) { return _sourceDb.ClassMetadataForID(id); } public virtual void RegisterUnindexed(int id) { _unindexed.Add(id); } public virtual IdSource UnindexedIDs() { return new IdSource(_unindexed); } public virtual ObjectHeader SourceObjectHeader(ByteArrayBuffer buffer) { return new ObjectHeader(_sourceDb, buffer); } public virtual int BlockSize() { return _sourceDb.BlockSize(); } public virtual int SourceAddressByID(int sourceID) { return CommittedSlot(Sourcedb, sourceID).Address(); } public virtual int TargetAddressByID(int sourceID) { return _mapping.AddressForId(sourceID); } public virtual bool Accept(IStoredClass klass) { return this._defragConfig.StoredClassFilter().Accept(klass); } public virtual int TargetNewId() { return _targetDb.IdSystem().NewId(); } public virtual IIdMapping Mapping() { return _mapping; } public virtual void CommitIds() { FreespaceCommitter freespaceCommitter = new FreespaceCommitter(_targetDb.FreespaceManager ()); freespaceCommitter.TransactionalIdSystem(SystemTrans().IdSystem()); _targetDb.IdSystem().Commit(Mapping().SlotChanges(), freespaceCommitter); freespaceCommitter.Commit(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Defragment/IDefragmentServices.cs0000644000175000017500000000315711700531646031411 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Mapping; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Defragment { /// Encapsulates services involving source and target database files during defragmenting. /// /// Encapsulates services involving source and target database files during defragmenting. /// /// public interface IDefragmentServices : IIDMapping { /// ByteArrayBuffer SourceBufferByAddress(int address, int length); /// ByteArrayBuffer TargetBufferByAddress(int address, int length); ByteArrayBuffer SourceBufferByID(int sourceID); Slot AllocateTargetSlot(int targetLength); void TargetWriteBytes(ByteArrayBuffer targetPointerReader, int targetAddress); Transaction SystemTrans(); void TargetWriteBytes(DefragmentContextImpl context, int targetAddress); void TraverseAllIndexSlots(BTree tree, IVisitor4 visitor4); void RegisterBTreeIDs(BTree tree, IDMappingCollector collector); ClassMetadata ClassMetadataForId(int id); int MappedID(int id); void RegisterUnindexed(int id); IdSource UnindexedIDs(); int SourceAddressByID(int sourceID); int TargetAddressByID(int sourceID); int TargetNewId(); IIdMapping Mapping(); void CommitIds(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/0000755000175000017500000000000011700531646024663 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/PrimitiveTypeMetadata.cs0000644000175000017500000001331211700531646031465 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Metadata; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public class PrimitiveTypeMetadata : ClassMetadata { private const int HashcodeForNull = 283636383; public PrimitiveTypeMetadata(ObjectContainerBase container, ITypeHandler4 handler , int id, IReflectClass classReflector) : base(container, classReflector) { _aspects = FieldMetadata.EmptyArray; _typeHandler = handler; _id = id; } public PrimitiveTypeMetadata(ObjectContainerBase container) : base(container) { _typeHandler = null; } public override void CascadeActivation(IActivationContext context) { } // Override // do nothing internal sealed override void AddToIndex(Transaction trans, int id) { } // Override // Primitive Indices will be created later. internal override bool AllowsQueries() { return false; } internal override void CacheDirty(Collection4 col) { } // do nothing public override bool DescendOnCascadingActivation() { return false; } /// public override void Delete(IDeleteContext context) { if (context.IsLegacyHandlerVersion()) { context.ReadInt(); context.DefragmentRecommended(); } } internal override void DeleteMembers(DeleteContextImpl context, ArrayType arrayType , bool isUpdate) { if (arrayType == ArrayType.PlainArray) { new ArrayHandler(TypeHandler(), true).DeletePrimitiveEmbedded((StatefulBuffer)context .Buffer(), this); } else { if (arrayType == ArrayType.MultidimensionalArray) { new MultidimensionalArrayHandler(TypeHandler(), true).DeletePrimitiveEmbedded((StatefulBuffer )context.Buffer(), this); } } } public override bool HasClassIndex() { return false; } public override object Instantiate(UnmarshallingContext context) { object obj = context.PersistentObject(); if (obj == null) { obj = context.Read(TypeHandler()); context.SetObjectWeak(obj); } context.SetStateClean(); return obj; } public override object InstantiateTransient(UnmarshallingContext context) { return Handlers4.ReadValueType(context, CorrectHandlerVersion(context)); } internal override void InstantiateFields(UnmarshallingContext context) { throw new NotImplementedException(); } public override bool IsArray() { return _id == Handlers4.AnyArrayId || _id == Handlers4.AnyArrayNId; } public override bool HasIdentity() { return false; } public override bool IsStronglyTyped() { return false; } public override IPreparedComparison PrepareComparison(IContext context, object source ) { return Handlers4.PrepareComparisonFor(TypeHandler(), context, source); } public override ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { if (IsArray()) { return TypeHandler(); } return null; } // @Override // public ObjectID readObjectID(InternalReadContext context){ // if(_handler instanceof ClassMetadata){ // return ((ClassMetadata)_handler).readObjectID(context); // } // if(Handlers4.handlesArray(_handler)){ // // TODO: Here we should theoretically read through the array and collect candidates. // // The respective construct is wild: "Contains query through an array in an array." // // Ignore for now. // return ObjectID.IGNORE; // } // return ObjectID.NOT_POSSIBLE; // } internal override void RemoveFromIndex(Transaction ta, int id) { } // do nothing public sealed override bool WriteObjectBegin() { return false; } public override string ToString() { return GetType().FullName + "(" + TypeHandler() + ")"; } public override void Defragment(IDefragmentContext context) { CorrectHandlerVersion(context).Defragment(context); } public override object WrapWithTransactionContext(Transaction transaction, object value) { return value; } public override ITypeHandler4 DelegateTypeHandler(IContext context) { return TypeHandler(); } public override bool Equals(object obj) { if (!(obj is Db4objects.Db4o.Internal.PrimitiveTypeMetadata)) { return false; } Db4objects.Db4o.Internal.PrimitiveTypeMetadata other = (Db4objects.Db4o.Internal.PrimitiveTypeMetadata )obj; if (TypeHandler() == null) { return other.TypeHandler() == null; } return TypeHandler().Equals(other.TypeHandler()); } public override int GetHashCode() { if (TypeHandler() == null) { return HashcodeForNull; } return TypeHandler().GetHashCode(); } public virtual object DeepClone(object context) { throw new InvalidOperationException(); } protected override IAspectTraversalStrategy DetectAspectTraversalStrategy() { return new _IAspectTraversalStrategy_178(); } private sealed class _IAspectTraversalStrategy_178 : IAspectTraversalStrategy { public _IAspectTraversalStrategy_178() { } public void TraverseAllAspects(ITraverseAspectCommand command) { } } // do nothing } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/VersionFieldMetadata.cs0000644000175000017500000000332011700531646031242 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal { /// public class VersionFieldMetadata : VirtualFieldMetadata { internal VersionFieldMetadata() : base(Handlers4.LongId, new LongHandler()) { SetName(VirtualField.Version); } /// public override void AddFieldIndex(ObjectIdContextImpl context) { StatefulBuffer buffer = (StatefulBuffer)context.Buffer(); buffer.WriteLong(context.Transaction().Container().GenerateTimeStampId()); } public override void Delete(DeleteContextImpl context, bool isUpdate) { context.Seek(context.Offset() + LinkLength()); } internal override void Instantiate1(ObjectReferenceContext context) { context.ObjectReference().VirtualAttributes().i_version = context.ReadLong(); } internal override void Marshall(Transaction trans, ObjectReference @ref, IWriteBuffer buffer, bool isMigrating, bool isNew) { VirtualAttributes attr = @ref.VirtualAttributes(); if (!isMigrating) { attr.i_version = trans.Container().GenerateTimeStampId(); } if (attr == null) { buffer.WriteLong(0); } else { buffer.WriteLong(attr.i_version); } } public override int LinkLength() { return Const4.LongLength; } internal override void MarshallIgnore(IWriteBuffer buffer) { buffer.WriteLong(0); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ClassMetadataRepository.cs0000644000175000017500000004423511700531646032030 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Metadata; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal { /// public sealed class ClassMetadataRepository : PersistentBase { private Collection4 _classes; private Hashtable4 _creating; private readonly Transaction _systemTransaction; private Hashtable4 _classMetadataByBytes; private Hashtable4 _classMetadataByClass; private Hashtable4 _classMetadataByName; private Hashtable4 _classMetadataByID; private int _classMetadataCreationDepth; private IQueue4 _initClassMetadataOnUp; private readonly PendingClassInits _classInits; public ClassMetadataRepository(Transaction systemTransaction) { _systemTransaction = systemTransaction; _initClassMetadataOnUp = new NonblockingQueue(); _classInits = new PendingClassInits(_systemTransaction); } public void AddClassMetadata(ClassMetadata clazz) { Container().SetDirtyInSystemTransaction(this); _classes.Add(clazz); if (clazz.StateUnread()) { _classMetadataByBytes.Put(clazz.i_nameBytes, clazz); } else { _classMetadataByClass.Put(clazz.ClassReflector(), clazz); } RegisterClassMetadataById(clazz); } private void RegisterClassMetadataById(ClassMetadata clazz) { if (clazz.GetID() == 0) { clazz.Write(_systemTransaction); } _classMetadataByID.Put(clazz.GetID(), clazz); } private byte[] AsBytes(string str) { return Container().StringIO().Write(str); } public void AttachQueryNode(string fieldName, IVisitor4 visitor) { ClassMetadataIterator i = Iterator(); while (i.MoveNext()) { ClassMetadata classMetadata = i.CurrentClass(); if (!classMetadata.IsInternal()) { classMetadata.TraverseAllAspects(new _TraverseFieldCommand_65(fieldName, visitor, classMetadata)); } } } private sealed class _TraverseFieldCommand_65 : TraverseFieldCommand { public _TraverseFieldCommand_65(string fieldName, IVisitor4 visitor, ClassMetadata classMetadata) { this.fieldName = fieldName; this.visitor = visitor; this.classMetadata = classMetadata; } protected override void Process(FieldMetadata field) { if (field.CanAddToQuery(fieldName)) { visitor.Visit(new object[] { classMetadata, field }); } } private readonly string fieldName; private readonly IVisitor4 visitor; private readonly ClassMetadata classMetadata; } public void IterateTopLevelClasses(IVisitor4 visitor) { ClassMetadataIterator i = Iterator(); while (i.MoveNext()) { ClassMetadata classMetadata = i.CurrentClass(); if (!classMetadata.IsInternal()) { if (classMetadata.GetAncestor() == null) { visitor.Visit(classMetadata); } } } } internal void CheckChanges() { IEnumerator i = _classes.GetEnumerator(); while (i.MoveNext()) { ((ClassMetadata)i.Current).CheckChanges(); } } internal bool CreateClassMetadata(ClassMetadata clazz, IReflectClass reflectClazz ) { bool result = false; _classMetadataCreationDepth++; try { IReflectClass parentReflectClazz = reflectClazz.GetSuperclass(); ClassMetadata parentClazz = null; if (parentReflectClazz != null && !parentReflectClazz.Equals(Container()._handlers .IclassObject)) { parentClazz = ProduceClassMetadata(parentReflectClazz); } result = Container().CreateClassMetadata(clazz, reflectClazz, parentClazz); } finally { _classMetadataCreationDepth--; } InitClassMetadataOnUp(); return result; } private void EnsureAllClassesRead() { bool allClassesRead = false; while (!allClassesRead) { Collection4 unreadClasses = new Collection4(); int numClasses = _classes.Size(); IEnumerator classIter = _classes.GetEnumerator(); while (classIter.MoveNext()) { ClassMetadata clazz = (ClassMetadata)classIter.Current; if (clazz.StateUnread()) { unreadClasses.Add(clazz); } } IEnumerator unreadIter = unreadClasses.GetEnumerator(); while (unreadIter.MoveNext()) { ClassMetadata clazz = (ClassMetadata)unreadIter.Current; clazz = ReadClassMetadata(clazz, null); if (clazz.ClassReflector() == null) { clazz.ForceRead(); } } allClassesRead = (_classes.Size() == numClasses); } ApplyReadAs(); } internal bool FieldExists(string field) { ClassMetadataIterator i = Iterator(); while (i.MoveNext()) { if (i.CurrentClass().FieldMetadataForName(field) != null) { return true; } } return false; } public Collection4 ForInterface(IReflectClass claxx) { Collection4 col = new Collection4(); ClassMetadataIterator i = Iterator(); while (i.MoveNext()) { ClassMetadata clazz = i.CurrentClass(); IReflectClass candidate = clazz.ClassReflector(); if (!candidate.IsInterface()) { if (claxx.IsAssignableFrom(candidate)) { col.Add(clazz); IEnumerator j = new Collection4(col).GetEnumerator(); while (j.MoveNext()) { ClassMetadata existing = (ClassMetadata)j.Current; if (existing != clazz) { ClassMetadata higher = clazz.GetHigherHierarchy(existing); if (higher != null) { if (higher == clazz) { col.Remove(existing); } else { col.Remove(clazz); } } } } } } } return col; } public override byte GetIdentifier() { return Const4.Yapclasscollection; } internal ClassMetadata GetActiveClassMetadata(IReflectClass reflectClazz) { return (ClassMetadata)_classMetadataByClass.Get(reflectClazz); } internal ClassMetadata ClassMetadataForReflectClass(IReflectClass reflectClazz) { ClassMetadata cached = (ClassMetadata)_classMetadataByClass.Get(reflectClazz); if (cached != null) { return cached; } return ReadClassMetadata(reflectClazz); } private ClassMetadata ReadClassMetadata(IReflectClass reflectClazz) { ClassMetadata clazz = (ClassMetadata)_classMetadataByBytes.Remove(GetNameBytes(reflectClazz .GetName())); if (clazz == null) { return null; } return ReadClassMetadata(clazz, reflectClazz); } internal ClassMetadata ProduceClassMetadata(IReflectClass reflectClazz) { ClassMetadata classMetadata = ClassMetadataForReflectClass(reflectClazz); if (classMetadata != null) { return classMetadata; } ClassMetadata classBeingCreated = (ClassMetadata)_creating.Get(reflectClazz); if (classBeingCreated != null) { return classBeingCreated; } ClassMetadata newClassMetadata = new ClassMetadata(Container(), reflectClazz); _creating.Put(reflectClazz, newClassMetadata); try { if (!CreateClassMetadata(newClassMetadata, reflectClazz)) { return null; } // ObjectContainerBase#createClassMetadata may add the ClassMetadata already, // so we have to check again if (!IsRegistered(reflectClazz)) { AddClassMetadata(newClassMetadata); _classInits.Process(newClassMetadata); } else { RegisterClassMetadataById(newClassMetadata); if (newClassMetadata.AspectsAreNull()) { _classInits.Process(newClassMetadata); } } Container().SetDirtyInSystemTransaction(this); } finally { _creating.Remove(reflectClazz); } return newClassMetadata; } private bool IsRegistered(IReflectClass reflectClazz) { return _classMetadataByClass.Get(reflectClazz) != null; } internal ClassMetadata ClassMetadataForId(int id) { ClassMetadata classMetadata = (ClassMetadata)_classMetadataByID.Get(id); if (null == classMetadata) { return null; } return ReadClassMetadata(classMetadata, null); } public int ClassMetadataIdForName(string name) { ClassMetadata classMetadata = (ClassMetadata)_classMetadataByBytes.Get(GetNameBytes (name)); if (classMetadata == null) { classMetadata = FindInitializedClassByName(name); } if (classMetadata != null) { return classMetadata.GetID(); } return 0; } public ClassMetadata GetClassMetadata(string name) { ClassMetadata classMetadata = (ClassMetadata)_classMetadataByBytes.Remove(GetNameBytes (name)); if (classMetadata == null) { classMetadata = FindInitializedClassByName(name); } if (classMetadata != null) { classMetadata = ReadClassMetadata(classMetadata, null); } return classMetadata; } private ClassMetadata FindInitializedClassByName(string name) { ClassMetadata classMetadata = (ClassMetadata)_classMetadataByName.Get(name); if (classMetadata != null) { return classMetadata; } ClassMetadataIterator i = Iterator(); while (i.MoveNext()) { classMetadata = (ClassMetadata)i.Current; if (name.Equals(classMetadata.GetName())) { _classMetadataByName.Put(name, classMetadata); return classMetadata; } } return null; } public int GetClassMetadataID(string name) { ClassMetadata clazz = (ClassMetadata)_classMetadataByBytes.Get(GetNameBytes(name) ); if (clazz != null) { return clazz.GetID(); } return 0; } internal byte[] GetNameBytes(string name) { return AsBytes(ResolveAliasRuntimeName(name)); } private string ResolveAliasRuntimeName(string name) { return Container().ConfigImpl.ResolveAliasRuntimeName(name); } public void InitOnUp(Transaction systemTrans) { _classMetadataCreationDepth++; systemTrans.Container().ShowInternalClasses(true); try { IEnumerator i = _classes.GetEnumerator(); while (i.MoveNext()) { ((ClassMetadata)i.Current).InitOnUp(systemTrans); } } finally { systemTrans.Container().ShowInternalClasses(false); _classMetadataCreationDepth--; } InitClassMetadataOnUp(); } internal void InitTables(int size) { _classes = new Collection4(); _classMetadataByBytes = new Hashtable4(size); if (size < 16) { size = 16; } _classMetadataByClass = new Hashtable4(size); _classMetadataByName = new Hashtable4(size); _classMetadataByID = new Hashtable4(size); _creating = new Hashtable4(1); } private void InitClassMetadataOnUp() { if (_classMetadataCreationDepth != 0) { return; } ClassMetadata clazz = (ClassMetadata)_initClassMetadataOnUp.Next(); while (clazz != null) { clazz.InitOnUp(_systemTransaction); clazz = (ClassMetadata)_initClassMetadataOnUp.Next(); } } public ClassMetadataIterator Iterator() { return new ClassMetadataIterator(this, new ArrayIterator4(_classes.ToArray())); } private class ClassIDIterator : MappingIterator { public ClassIDIterator(Collection4 classes) : base(classes.GetEnumerator()) { } protected override object Map(object current) { return ((ClassMetadata)current).GetID(); } } public IEnumerator Ids() { return new ClassMetadataRepository.ClassIDIterator(_classes); } public override int OwnLength() { return Const4.ObjectLength + Const4.IntLength + (_classes.Size() * Const4.IdLength ); } internal void Purge() { IEnumerator i = _classes.GetEnumerator(); while (i.MoveNext()) { ((ClassMetadata)i.Current).Purge(); } } public sealed override void ReadThis(Transaction trans, ByteArrayBuffer buffer) { int classCount = buffer.ReadInt(); InitTables(classCount); ObjectContainerBase container = Container(); int[] ids = ReadMetadataIds(buffer, classCount); ByteArrayBuffer[] metadataSlots = container.ReadSlotBuffers(trans, ids); for (int i = 0; i < classCount; ++i) { ClassMetadata classMetadata = new ClassMetadata(container, null); classMetadata.SetID(ids[i]); _classes.Add(classMetadata); _classMetadataByID.Put(ids[i], classMetadata); byte[] name = classMetadata.ReadName1(trans, metadataSlots[i]); if (name != null) { _classMetadataByBytes.Put(name, classMetadata); } } ApplyReadAs(); } private int[] ReadMetadataIds(ByteArrayBuffer buffer, int classCount) { int[] ids = new int[classCount]; for (int i = 0; i < classCount; ++i) { ids[i] = buffer.ReadInt(); } return ids; } internal Hashtable4 ClassByBytes() { return _classMetadataByBytes; } private void ApplyReadAs() { Hashtable4 readAs = Container().ConfigImpl.ReadAs(); IEnumerator i = readAs.Iterator(); while (i.MoveNext()) { IEntry4 entry = (IEntry4)i.Current; string dbName = (string)entry.Key(); string useName = (string)entry.Value(); byte[] dbbytes = GetNameBytes(dbName); byte[] useBytes = GetNameBytes(useName); if (ClassByBytes().Get(useBytes) == null) { ClassMetadata clazz = (ClassMetadata)ClassByBytes().Get(dbbytes); if (clazz != null) { clazz.i_nameBytes = useBytes; clazz.SetConfig(ConfigClass(dbName)); ClassByBytes().Remove(dbbytes); ClassByBytes().Put(useBytes, clazz); } } } } private Config4Class ConfigClass(string name) { return Container().ConfigImpl.ConfigClass(name); } public ClassMetadata ReadClassMetadata(ClassMetadata classMetadata, IReflectClass clazz) { if (classMetadata == null) { throw new ArgumentNullException(); } if (!classMetadata.StateUnread()) { return classMetadata; } _classMetadataCreationDepth++; try { classMetadata.CreateConfigAndConstructor(_classMetadataByBytes, clazz); IReflectClass claxx = classMetadata.ClassReflector(); if (claxx != null) { _classMetadataByClass.Put(claxx, classMetadata); classMetadata.ReadThis(); classMetadata.CheckChanges(); _initClassMetadataOnUp.Add(classMetadata); } } finally { _classMetadataCreationDepth--; } InitClassMetadataOnUp(); return classMetadata; } public void CheckAllClassChanges() { IEnumerator i = _classMetadataByID.Keys(); while (i.MoveNext()) { int classMetadataID = ((int)i.Current); ClassMetadataForId(classMetadataID); } } public void RefreshClasses() { ClassMetadataRepository rereader = new ClassMetadataRepository(_systemTransaction ); rereader._id = _id; rereader.Read(Container().SystemTransaction()); IEnumerator i = rereader._classes.GetEnumerator(); while (i.MoveNext()) { ClassMetadata clazz = (ClassMetadata)i.Current; RefreshClass(clazz); } i = _classes.GetEnumerator(); while (i.MoveNext()) { ClassMetadata clazz = (ClassMetadata)i.Current; clazz.Refresh(); } } private void RefreshClass(ClassMetadata clazz) { if (_classMetadataByID.Get(clazz.GetID()) == null) { _classes.Add(clazz); _classMetadataByID.Put(clazz.GetID(), clazz); RefreshClassCache(clazz, null); } } public void RefreshClassCache(ClassMetadata clazz, IReflectClass oldReflector) { if (clazz.StateUnread()) { _classMetadataByBytes.Put(clazz.ReadName(_systemTransaction), clazz); } else { if (oldReflector != null) { _classMetadataByClass.Remove(oldReflector); } _classMetadataByClass.Put(clazz.ClassReflector(), clazz); } } internal void ReReadClassMetadata(ClassMetadata clazz) { if (clazz != null) { ReReadClassMetadata(clazz._ancestor); clazz.ReadName(_systemTransaction); clazz.ForceRead(); clazz.SetStateClean(); clazz.BitFalse(Const4.CheckedChanges); clazz.BitFalse(Const4.Reading); clazz.BitFalse(Const4.Continue); clazz.BitFalse(Const4.Dead); clazz.CheckChanges(); } } public IStoredClass[] StoredClasses() { EnsureAllClassesRead(); IStoredClass[] sclasses = new IStoredClass[_classes.Size()]; _classes.ToArray(sclasses); return sclasses; } public void WriteAllClasses() { Collection4 deadClasses = new Collection4(); IStoredClass[] storedClasses = StoredClasses(); for (int i = 0; i < storedClasses.Length; i++) { ClassMetadata clazz = (ClassMetadata)storedClasses[i]; clazz.SetStateDirty(); if (clazz.StateDead()) { deadClasses.Add(clazz); clazz.SetStateOK(); } } for (int i = 0; i < storedClasses.Length; i++) { ClassMetadata clazz = (ClassMetadata)storedClasses[i]; clazz.Write(_systemTransaction); } IEnumerator it = deadClasses.GetEnumerator(); while (it.MoveNext()) { ((ClassMetadata)it.Current).SetStateDead(); } } public override void WriteThis(Transaction trans, ByteArrayBuffer buffer) { buffer.WriteInt(_classes.Size()); IEnumerator i = _classes.GetEnumerator(); while (i.MoveNext()) { buffer.WriteIDOf(trans, i.Current); } } public override string ToString() { string str = "Active:\n"; IEnumerator i = _classes.GetEnumerator(); while (i.MoveNext()) { ClassMetadata clazz = (ClassMetadata)i.Current; str += clazz.GetID() + " " + clazz + "\n"; } return str; } internal ObjectContainerBase Container() { return _systemTransaction.Container(); } public override void SetID(int id) { if (Container().IsClient) { base.SetID(id); return; } if (_id == 0) { SystemData().ClassCollectionID(id); } base.SetID(id); } private SystemData SystemData() { return LocalSystemTransaction().LocalContainer().SystemData(); } private LocalTransaction LocalSystemTransaction() { return ((LocalTransaction)_systemTransaction); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/TransportObjectContainer.cs0000644000175000017500000002004311700531646032177 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Config; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Convert; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.References; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Internal.Weakref; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Types; using Sharpen.Lang; namespace Db4objects.Db4o.Internal { /// /// no reading /// no writing /// no updates /// no weak references /// navigation by ID only both sides need synchronised ClassCollections and /// MetaInformationCaches /// /// public class TransportObjectContainer : LocalObjectContainer { private readonly ObjectContainerBase _parent; private readonly MemoryBin _memoryBin; public TransportObjectContainer(ObjectContainerBase parent, MemoryBin memoryFile) : base(parent.Config()) { _memoryBin = memoryFile; _parent = parent; _lock = parent.Lock(); _showInternalClasses = parent._showInternalClasses; Open(); } protected override void Initialize1(IConfiguration config) { _handlers = _parent._handlers; _classCollection = _parent.ClassCollection(); _config = _parent.ConfigImpl; _references = WeakReferenceSupportFactory.DisabledWeakReferenceSupport(); } protected override void InitializeClassMetadataRepository() { } // do nothing, it's passed from the parent ObjectContainer protected override void InitalizeWeakReferenceSupport() { } // do nothing, no Weak references internal override void InitializeEssentialClasses() { } // do nothing protected override void InitializePostOpenExcludingTransportObjectContainer() { } // do nothing internal override void InitNewClassCollection() { } // do nothing internal override bool CanUpdate() { return false; } public override ClassMetadata ClassMetadataForID(int id) { return _parent.ClassMetadataForID(id); } internal override void ConfigureNewFile() { } // do nothing public override int ConverterVersion() { return Converter.Version; } protected virtual void DropReferences() { _config = null; } protected override void HandleExceptionOnClose(Exception exc) { } // do nothing here public sealed override Transaction NewTransaction(Transaction parentTransaction, IReferenceSystem referenceSystem, bool isSystemTransaction) { if (null != parentTransaction) { return parentTransaction; } return new TransactionObjectCarrier(this, null, new TransportIdSystem(this), referenceSystem ); } public override long CurrentVersion() { return 0; } public override IDb4oType Db4oTypeStored(Transaction a_trans, object a_object) { return null; } public override bool DispatchsEvents() { return false; } ~TransportObjectContainer() { } // do nothing public sealed override void Free(int a_address, int a_length) { } // do nothing public sealed override void Free(Slot slot) { } // do nothing public override Slot AllocateSlot(int length) { return AppendBytes(length); } protected override bool IsValidPointer(int id) { return id != 0 && base.IsValidPointer(id); } public override Db4oDatabase Identity() { return ((ExternalObjectContainer)_parent).Identity(); } public override bool MaintainsIndices() { return false; } public override long GenerateTimeStampId() { return _parent.GenerateTimeStampId(); } internal override void Message(string msg) { } // do nothing public override ClassMetadata ProduceClassMetadata(IReflectClass claxx) { return _parent.ProduceClassMetadata(claxx); } public override void RaiseCommitTimestamp(long a_minimumVersion) { } // do nothing internal override void ReadThis() { } // do nothing internal override bool StateMessages() { return false; } // overridden to do nothing in YapObjectCarrier public override void Shutdown() { ProcessPendingClassUpdates(); WriteDirtyClassMetadata(); Transaction.Commit(); } public sealed override void WriteHeader(bool startFileLockingThread, bool shuttingDown ) { } public class KnownObjectIdentity { public int _id; public KnownObjectIdentity(int id) { // do nothing _id = id; } } /// /// public override int StoreInternal(Transaction trans, object obj, IUpdateDepth depth , bool checkJustSet) { int id = _parent.GetID(null, obj); if (id > 0) { return base.StoreInternal(trans, new TransportObjectContainer.KnownObjectIdentity (id), depth, checkJustSet); } return base.StoreInternal(trans, obj, depth, checkJustSet); } public override object GetByID2(Transaction ta, int id) { object obj = base.GetByID2(ta, id); if (obj is TransportObjectContainer.KnownObjectIdentity) { TransportObjectContainer.KnownObjectIdentity oi = (TransportObjectContainer.KnownObjectIdentity )obj; Activate(oi); obj = _parent.GetByID(null, oi._id); } return obj; } public virtual void DeferredOpen() { Open(); } /// protected sealed override void OpenImpl() { CreateIdSystem(); if (_memoryBin.Length() == 0) { ConfigureNewFile(); CommitTransaction(); } else { ReadThis(); } } /// public override void Backup(IStorage targetStorage, string path) { throw new NotSupportedException(); } public override void BlockSize(int size) { } // do nothing, blocksize is always 1 public override void CloseTransaction(Transaction transaction, bool isSystemTransaction , bool rollbackOnClose) { } // do nothing protected override void ShutdownDataStorage() { DropReferences(); } public override long FileLength() { return _memoryBin.Length(); } public override string FileName() { return "Memory File"; } protected override bool HasShutDownHook() { return false; } public sealed override bool NeedsLockFileThread() { return false; } public override void ReadBytes(byte[] bytes, int address, int length) { try { _memoryBin.Read(address, bytes, length); } catch (Exception e) { Exceptions4.ThrowRuntimeException(13, e); } } public override void ReadBytes(byte[] bytes, int address, int addressOffset, int length) { ReadBytes(bytes, address + addressOffset, length); } public override void SyncFiles() { } public override void WriteBytes(ByteArrayBuffer buffer, int address, int addressOffset ) { _memoryBin.Write(address + addressOffset, buffer._buffer, buffer.Length()); } public override void OverwriteDeletedBytes(int a_address, int a_length) { } public override void Reserve(int byteCount) { throw new NotSupportedException(); } public override byte BlockSize() { return 1; } protected override void FatalStorageShutdown() { ShutdownDataStorage(); } public override IReferenceSystem CreateReferenceSystem() { return new HashcodeReferenceSystem(); } protected override void CreateIdSystem() { } // do nothing public override IRunnable CommitHook() { return Runnable4.DoNothing; } public override void SyncFiles(IRunnable runnable) { runnable.Run(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/TypeHandlerCloneContext.cs0000644000175000017500000000137711700531646031767 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public class TypeHandlerCloneContext { private readonly HandlerRegistry handlerRegistry; public readonly ITypeHandler4 original; private readonly int version; public TypeHandlerCloneContext(HandlerRegistry handlerRegistry_, ITypeHandler4 original_ , int version_) { handlerRegistry = handlerRegistry_; original = original_; version = version_; } public virtual ITypeHandler4 CorrectHandlerVersion(ITypeHandler4 typeHandler) { return handlerRegistry.CorrectHandlerVersion(typeHandler, version); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/NullTransactionListener.cs0000644000175000017500000000072711700531646032046 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o.Internal { public class NullTransactionListener : ITransactionListener { public static readonly ITransactionListener Instance = new Db4objects.Db4o.Internal.NullTransactionListener (); private NullTransactionListener() { } public virtual void PostRollback() { } public virtual void PreCommit() { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/DeleteInfo.cs0000644000175000017500000000121011700531646027222 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public class DeleteInfo : TreeInt { internal int _cascade; public ObjectReference _reference; public DeleteInfo(int id, ObjectReference reference, int cascade) : base(id) { _reference = reference; _cascade = cascade; } public override object ShallowClone() { Db4objects.Db4o.Internal.DeleteInfo deleteinfo = new Db4objects.Db4o.Internal.DeleteInfo (0, _reference, _cascade); return ShallowCloneInternal(deleteinfo); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/CallbackObjectInfoCollections.cs0000644000175000017500000000174211700531646033054 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public class CallbackObjectInfoCollections { public readonly IObjectInfoCollection added; public readonly IObjectInfoCollection updated; public readonly IObjectInfoCollection deleted; public static readonly Db4objects.Db4o.Internal.CallbackObjectInfoCollections Emtpy = Empty(); public CallbackObjectInfoCollections(IObjectInfoCollection added_, IObjectInfoCollection updated_, IObjectInfoCollection deleted_) { added = added_; updated = updated_; deleted = deleted_; } private static Db4objects.Db4o.Internal.CallbackObjectInfoCollections Empty() { return new Db4objects.Db4o.Internal.CallbackObjectInfoCollections(ObjectInfoCollectionImpl .Empty, ObjectInfoCollectionImpl.Empty, ObjectInfoCollectionImpl.Empty); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/0000755000175000017500000000000011700531646026426 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/SlotFormat0.cs0000644000175000017500000000142211700531646031126 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Marshall { /// public class SlotFormat0 : SlotFormat { protected override int HandlerVersion() { return 0; } public override bool IsIndirectedWithinSlot(ITypeHandler4 handler) { return false; } public override void WriteObjectClassID(ByteArrayBuffer buffer, int id) { buffer.WriteInt(id); } public override void SkipMarshallerInfo(ByteArrayBuffer reader) { } public override ObjectHeaderAttributes ReadHeaderAttributes(ByteArrayBuffer reader ) { return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/CollectIdContext.cs0000644000175000017500000000403211700531646032163 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public class CollectIdContext : ObjectHeaderContext { private readonly IdObjectCollector _collector; public CollectIdContext(Transaction transaction, IdObjectCollector collector, ObjectHeader oh, IReadBuffer buffer) : base(transaction, buffer, oh) { _collector = collector; } public CollectIdContext(Transaction transaction, ObjectHeader oh, IReadBuffer buffer ) : this(transaction, new IdObjectCollector(), oh, buffer) { } public static Db4objects.Db4o.Internal.Marshall.CollectIdContext ForID(Transaction transaction, int id) { return ForID(transaction, new IdObjectCollector(), id); } public static Db4objects.Db4o.Internal.Marshall.CollectIdContext ForID(Transaction transaction, IdObjectCollector collector, int id) { StatefulBuffer reader = transaction.Container().ReadStatefulBufferById(transaction , id); if (reader == null) { return null; } ObjectHeader oh = new ObjectHeader(transaction.Container(), reader); return new Db4objects.Db4o.Internal.Marshall.CollectIdContext(transaction, collector , oh, reader); } public virtual void AddId() { int id = ReadInt(); if (id <= 0) { return; } AddId(id); } private void AddId(int id) { _collector.AddId(id); } public override Db4objects.Db4o.Internal.ClassMetadata ClassMetadata() { return _objectHeader.ClassMetadata(); } public virtual TreeInt Ids() { return _collector.Ids(); } public virtual void ReadID(IReadsObjectIds objectIDHandler) { ObjectID objectID = objectIDHandler.ReadObjectID(this); if (objectID.IsValid()) { AddId(objectID._id); } } public virtual IdObjectCollector Collector() { return _collector; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/PrimitiveMarshaller1.cs0000644000175000017500000000203511700531646033021 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { public class PrimitiveMarshaller1 : PrimitiveMarshaller { public override bool UseNormalClassRead() { return false; } public override DateTime ReadDate(ByteArrayBuffer bytes) { return new DateTime(bytes.ReadLong()); } public override object ReadInteger(ByteArrayBuffer bytes) { return bytes.ReadInt(); } public override object ReadFloat(ByteArrayBuffer bytes) { return PrimitiveMarshaller0.UnmarshallFloat(bytes); } public override object ReadDouble(ByteArrayBuffer buffer) { return PrimitiveMarshaller0.UnmarshalDouble(buffer); } public override object ReadLong(ByteArrayBuffer buffer) { return buffer.ReadLong(); } public override object ReadShort(ByteArrayBuffer buffer) { return PrimitiveMarshaller0.UnmarshallShort(buffer); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/RawFieldSpec.cs0000644000175000017500000000412511700531646031267 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { public class RawFieldSpec { private readonly AspectType _type; private readonly string _name; private readonly int _fieldTypeID; private readonly bool _isPrimitive; private readonly bool _isArray; private readonly bool _isNArray; private readonly bool _isVirtual; private int _indexID; public RawFieldSpec(AspectType aspectType, string name, int fieldTypeID, byte attribs ) { _type = aspectType; _name = name; _fieldTypeID = fieldTypeID; BitMap4 bitmap = new BitMap4(attribs); _isPrimitive = bitmap.IsTrue(0); _isArray = bitmap.IsTrue(1); _isNArray = bitmap.IsTrue(2); _isVirtual = false; _indexID = 0; } public RawFieldSpec(AspectType aspectType, string name) { _type = aspectType; _name = name; _fieldTypeID = 0; _isPrimitive = false; _isArray = false; _isNArray = false; _isVirtual = true; _indexID = 0; } public virtual string Name() { return _name; } public virtual int FieldTypeID() { return _fieldTypeID; } public virtual bool IsPrimitive() { return _isPrimitive; } public virtual bool IsArray() { return _isArray; } public virtual bool IsNArray() { return _isNArray; } public virtual bool IsVirtual() { return _isVirtual; } public virtual bool IsVirtualField() { return IsVirtual() && IsField(); } public virtual bool IsField() { return _type.IsField(); } public virtual int IndexID() { return _indexID; } internal virtual void IndexID(int indexID) { _indexID = indexID; } public override string ToString() { return "RawFieldSpec(" + Name() + ")"; } public virtual bool IsFieldMetadata() { return _type.IsFieldMetadata(); } public virtual bool IsTranslator() { return _type.IsTranslator(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/ObjectReferenceContext.cs0000644000175000017500000000240311700531646033346 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Marshall { public class ObjectReferenceContext : ObjectHeaderContext, IObjectIdContext { protected readonly Db4objects.Db4o.Internal.ObjectReference _reference; public ObjectReferenceContext(Transaction transaction, IReadBuffer buffer, ObjectHeader objectHeader, Db4objects.Db4o.Internal.ObjectReference reference) : base(transaction , buffer, objectHeader) { _reference = reference; } public virtual int ObjectId() { return _reference.GetID(); } public override Db4objects.Db4o.Internal.ClassMetadata ClassMetadata() { Db4objects.Db4o.Internal.ClassMetadata classMetadata = _reference.ClassMetadata(); if (classMetadata == null) { throw new InvalidOperationException(); } return classMetadata; } public virtual Db4objects.Db4o.Internal.ObjectReference ObjectReference() { return _reference; } protected virtual Db4objects.Db4o.Internal.ByteArrayBuffer ByteArrayBuffer() { return (Db4objects.Db4o.Internal.ByteArrayBuffer)Buffer(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/SlotFormat.cs0000644000175000017500000000560611700531646031056 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Marshall { /// public abstract class SlotFormat { private static readonly Hashtable4 _versions = new Hashtable4(); private static readonly Db4objects.Db4o.Internal.Marshall.SlotFormat CurrentSlotFormat = new SlotFormatCurrent(); static SlotFormat() { new SlotFormat0(); new SlotFormat2(); } protected SlotFormat() { _versions.Put(HandlerVersion(), this); } public static Db4objects.Db4o.Internal.Marshall.SlotFormat ForHandlerVersion(int handlerVersion) { if (handlerVersion == HandlerRegistry.HandlerVersion) { return CurrentSlotFormat; } if (handlerVersion < 0 || handlerVersion > CurrentSlotFormat.HandlerVersion()) { throw new ArgumentException(); } Db4objects.Db4o.Internal.Marshall.SlotFormat slotFormat = (Db4objects.Db4o.Internal.Marshall.SlotFormat )_versions.Get(handlerVersion); if (slotFormat != null) { return slotFormat; } return ForHandlerVersion(handlerVersion + 1); } public override bool Equals(object obj) { if (!(obj is Db4objects.Db4o.Internal.Marshall.SlotFormat)) { return false; } return HandlerVersion() == ((Db4objects.Db4o.Internal.Marshall.SlotFormat)obj).HandlerVersion (); } public override int GetHashCode() { return HandlerVersion(); } protected abstract int HandlerVersion(); public abstract bool IsIndirectedWithinSlot(ITypeHandler4 handler); public static Db4objects.Db4o.Internal.Marshall.SlotFormat Current() { return CurrentSlotFormat; } public virtual object DoWithSlotIndirection(IReadBuffer buffer, ITypeHandler4 typeHandler , IClosure4 closure) { if (!IsIndirectedWithinSlot(typeHandler)) { return closure.Run(); } return DoWithSlotIndirection(buffer, closure); } public virtual object DoWithSlotIndirection(IReadBuffer buffer, IClosure4 closure ) { int payLoadOffset = buffer.ReadInt(); buffer.ReadInt(); // length, not used int savedOffset = buffer.Offset(); object res = null; if (payLoadOffset != 0) { buffer.Seek(payLoadOffset); res = closure.Run(); } buffer.Seek(savedOffset); return res; } public virtual void WriteObjectClassID(ByteArrayBuffer buffer, int id) { buffer.WriteInt(-id); } public virtual void SkipMarshallerInfo(ByteArrayBuffer reader) { reader.IncrementOffset(1); } public virtual ObjectHeaderAttributes ReadHeaderAttributes(ByteArrayBuffer reader ) { return new ObjectHeaderAttributes(reader); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/FieldMarshaller2.cs0000644000175000017500000000227411700531646032102 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public class FieldMarshaller2 : FieldMarshaller1 { private const int AspectTypeTagLength = 1; public override int MarshalledLength(ObjectContainerBase stream, ClassAspect aspect ) { return base.MarshalledLength(stream, aspect) + AspectTypeTagLength; } protected override RawFieldSpec ReadSpec(AspectType aspectType, ObjectContainerBase stream, ByteArrayBuffer reader) { return base.ReadSpec(AspectType.ForByte(reader.ReadByte()), stream, reader); } public override void Write(Transaction trans, ClassMetadata clazz, ClassAspect aspect , ByteArrayBuffer writer) { writer.WriteByte(aspect.AspectType()._id); base.Write(trans, clazz, aspect, writer); } public override void Defrag(ClassMetadata classMetadata, ClassAspect aspect, LatinStringIO sio, DefragmentContextImpl context) { context.ReadByte(); base.Defrag(classMetadata, aspect, sio, context); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/IdObjectCollector.cs0000644000175000017500000000126711700531646032315 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Marshall { /// public class IdObjectCollector { private TreeInt _ids; private List4 _objects; public virtual void AddId(int id) { _ids = (TreeInt)((TreeInt)Tree.Add(_ids, new TreeInt(id))); } public virtual TreeInt Ids() { return _ids; } public virtual void Add(object obj) { _objects = new List4(_objects, obj); } public virtual IEnumerator Objects() { return new Iterator4Impl(_objects); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/ClassMarshaller.cs0000644000175000017500000001476211700531646032047 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public abstract class ClassMarshaller { public MarshallerFamily _family; public virtual RawClassSpec ReadSpec(Transaction trans, ByteArrayBuffer reader) { byte[] nameBytes = ReadName(trans, reader); string className = trans.Container().StringIO().Read(nameBytes); ReadMetaClassID(reader); // skip int ancestorID = reader.ReadInt(); reader.IncrementOffset(Const4.IntLength); // index ID int numFields = reader.ReadInt(); return new RawClassSpec(className, ancestorID, numFields); } public virtual void Write(Transaction trans, ClassMetadata clazz, ByteArrayBuffer writer) { writer.WriteShortString(trans, clazz.NameToWrite()); int intFormerlyKnownAsMetaClassID = 0; writer.WriteInt(intFormerlyKnownAsMetaClassID); writer.WriteIDOf(trans, clazz._ancestor); WriteIndex(trans, clazz, writer); writer.WriteInt(clazz.DeclaredAspectCount()); clazz.TraverseDeclaredAspects(new _IProcedure4_39(this, trans, clazz, writer)); } private sealed class _IProcedure4_39 : IProcedure4 { public _IProcedure4_39(ClassMarshaller _enclosing, Transaction trans, ClassMetadata clazz, ByteArrayBuffer writer) { this._enclosing = _enclosing; this.trans = trans; this.clazz = clazz; this.writer = writer; } public void Apply(object arg) { this._enclosing._family._field.Write(trans, clazz, (ClassAspect)arg, writer); } private readonly ClassMarshaller _enclosing; private readonly Transaction trans; private readonly ClassMetadata clazz; private readonly ByteArrayBuffer writer; } protected virtual void WriteIndex(Transaction trans, ClassMetadata clazz, ByteArrayBuffer writer) { int indexID = clazz.Index().Write(trans); writer.WriteInt(IndexIDForWriting(indexID)); } protected abstract int IndexIDForWriting(int indexID); public byte[] ReadName(Transaction trans, ByteArrayBuffer reader) { return ReadName(trans.Container().StringIO(), reader); } public int ReadMetaClassID(ByteArrayBuffer reader) { return reader.ReadInt(); } private byte[] ReadName(LatinStringIO sio, ByteArrayBuffer reader) { byte[] nameBytes = sio.Bytes(reader); reader.IncrementOffset(nameBytes.Length); nameBytes = Platform4.UpdateClassName(nameBytes); return nameBytes; } public void Read(ObjectContainerBase stream, ClassMetadata clazz, ByteArrayBuffer reader) { clazz.SetAncestor(stream.ClassMetadataForID(reader.ReadInt())); // if(clazz.callConstructor()){ // // The logic further down checks the ancestor YapClass, whether // // or not it is allowed, not to call constructors. The ancestor // // YapClass may possibly have not been loaded yet. // clazz.createConstructor(true); // } clazz.CheckType(); ReadIndex(stream, clazz, reader); clazz._aspects = ReadAspects(stream, reader, clazz); } protected abstract void ReadIndex(ObjectContainerBase stream, ClassMetadata clazz , ByteArrayBuffer reader); private ClassAspect[] ReadAspects(ObjectContainerBase stream, ByteArrayBuffer reader , ClassMetadata clazz) { ClassAspect[] aspects = new ClassAspect[reader.ReadInt()]; for (int i = 0; i < aspects.Length; i++) { aspects[i] = _family._field.Read(stream, clazz, reader); aspects[i].SetHandle(i); } return aspects; } public virtual int MarshalledLength(ObjectContainerBase stream, ClassMetadata clazz ) { IntByRef len = new IntByRef(stream.StringIO().ShortLength(clazz.NameToWrite()) + Const4.ObjectLength + (Const4.IntLength * 2) + (Const4.IdLength)); len.value += clazz.Index().OwnLength(); clazz.TraverseDeclaredAspects(new _IProcedure4_108(this, len, stream)); return len.value; } private sealed class _IProcedure4_108 : IProcedure4 { public _IProcedure4_108(ClassMarshaller _enclosing, IntByRef len, ObjectContainerBase stream) { this._enclosing = _enclosing; this.len = len; this.stream = stream; } public void Apply(object arg) { len.value += this._enclosing._family._field.MarshalledLength(stream, (ClassAspect )arg); } private readonly ClassMarshaller _enclosing; private readonly IntByRef len; private readonly ObjectContainerBase stream; } public virtual void Defrag(ClassMetadata classMetadata, LatinStringIO sio, DefragmentContextImpl context, int classIndexID) { ReadName(sio, context.SourceBuffer()); ReadName(sio, context.TargetBuffer()); int metaClassID = 0; context.WriteInt(metaClassID); // ancestor ID context.CopyID(); context.WriteInt((classMetadata.HasClassIndex() ? IndexIDForWriting(classIndexID) : 0)); int aspectCount = context.ReadInt(); if (aspectCount > classMetadata.DeclaredAspectCount()) { throw new InvalidOperationException(); } IntByRef processedAspectCount = new IntByRef(0); classMetadata.TraverseDeclaredAspects(new _IProcedure4_136(this, processedAspectCount , aspectCount, classMetadata, sio, context)); } private sealed class _IProcedure4_136 : IProcedure4 { public _IProcedure4_136(ClassMarshaller _enclosing, IntByRef processedAspectCount , int aspectCount, ClassMetadata classMetadata, LatinStringIO sio, DefragmentContextImpl context) { this._enclosing = _enclosing; this.processedAspectCount = processedAspectCount; this.aspectCount = aspectCount; this.classMetadata = classMetadata; this.sio = sio; this.context = context; } public void Apply(object arg) { if (processedAspectCount.value >= aspectCount) { return; } ClassAspect aspect = (ClassAspect)arg; this._enclosing._family._field.Defrag(classMetadata, aspect, sio, context); processedAspectCount.value++; } private readonly ClassMarshaller _enclosing; private readonly IntByRef processedAspectCount; private readonly int aspectCount; private readonly ClassMetadata classMetadata; private readonly LatinStringIO sio; private readonly DefragmentContextImpl context; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/ObjectHeader.cs0000644000175000017500000000654711700531646031310 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public sealed class ObjectHeader { private readonly Db4objects.Db4o.Internal.ClassMetadata _classMetadata; public readonly MarshallerFamily _marshallerFamily; public readonly ObjectHeaderAttributes _headerAttributes; private int _handlerVersion; public ObjectHeader(ObjectContainerBase container, IReadWriteBuffer reader) : this (container, null, reader) { } public ObjectHeader(Db4objects.Db4o.Internal.ClassMetadata classMetadata, IReadWriteBuffer reader) : this(null, classMetadata, reader) { } private ObjectHeader(ObjectContainerBase container, Db4objects.Db4o.Internal.ClassMetadata classMetadata, IReadWriteBuffer reader) { int classID = reader.ReadInt(); _marshallerFamily = ReadMarshallerFamily(reader, classID); classID = NormalizeID(classID); _classMetadata = (classMetadata != null ? classMetadata : container.ClassMetadataForID (classID)); // This check has been added to cope with defragment in debug mode: SlotDefragment#setIdentity() // will trigger calling this constructor with a source db class metadata and a target db stream, // thus _classMetadata==null. There may be a better solution, since this call is just meant to // skip the object header. _headerAttributes = SlotFormat().ReadHeaderAttributes((ByteArrayBuffer)reader); } public static Db4objects.Db4o.Internal.Marshall.ObjectHeader Defrag(DefragmentContextImpl context) { ByteArrayBuffer source = context.SourceBuffer(); ByteArrayBuffer target = context.TargetBuffer(); Db4objects.Db4o.Internal.Marshall.ObjectHeader header = new Db4objects.Db4o.Internal.Marshall.ObjectHeader (context.Services().SystemTrans().Container(), null, source); int newID = context.Mapping().StrictMappedID(header.ClassMetadata().GetID()); Db4objects.Db4o.Internal.Marshall.SlotFormat slotFormat = header.SlotFormat(); slotFormat.WriteObjectClassID(target, newID); slotFormat.SkipMarshallerInfo(target); slotFormat.ReadHeaderAttributes(target); return header; } private Db4objects.Db4o.Internal.Marshall.SlotFormat SlotFormat() { return Db4objects.Db4o.Internal.Marshall.SlotFormat.ForHandlerVersion(HandlerVersion ()); } private MarshallerFamily ReadMarshallerFamily(IReadWriteBuffer reader, int classID ) { bool marshallerAware = MarshallerAware(classID); _handlerVersion = 0; if (marshallerAware) { _handlerVersion = reader.ReadByte(); } MarshallerFamily marshallerFamily = MarshallerFamily.Version(_handlerVersion); return marshallerFamily; } private bool MarshallerAware(int id) { return id < 0; } private int NormalizeID(int id) { return (id < 0 ? -id : id); } public Db4objects.Db4o.Internal.ClassMetadata ClassMetadata() { return _classMetadata; } public int HandlerVersion() { return _handlerVersion; } public static Db4objects.Db4o.Internal.Marshall.ObjectHeader ScrollBufferToContent (LocalObjectContainer container, ByteArrayBuffer buffer) { return new Db4objects.Db4o.Internal.Marshall.ObjectHeader(container, buffer); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/IHandlerVersionContext.cs0000644000175000017500000000051211700531646033354 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public interface IHandlerVersionContext : IContext { int HandlerVersion(); Db4objects.Db4o.Internal.Marshall.SlotFormat SlotFormat(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/QueryingReadContext.cs0000644000175000017500000001001111700531646032712 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Marshall { /// public class QueryingReadContext : AbstractReadContext, IHandlerVersionContext, IAspectVersionContext , IObjectIdContext { private readonly QCandidates _candidates; private readonly int _collectionID; private readonly int _handlerVersion; private IdObjectCollector _collector; private int _declaredAspectCount; private int _id; private QueryingReadContext(Transaction transaction, QCandidates candidates, int handlerVersion, IReadBuffer buffer, int collectionID, IdObjectCollector collector ) : base(transaction, buffer) { _candidates = candidates; _activationDepth = new LegacyActivationDepth(0); _collectionID = collectionID; _handlerVersion = handlerVersion; _collector = collector; } public QueryingReadContext(Transaction transaction, QCandidates candidates, int handlerVersion , IReadBuffer buffer, int collectionID) : this(transaction, candidates, handlerVersion , buffer, collectionID, new IdObjectCollector()) { } public QueryingReadContext(Transaction transaction, int handlerVersion, IReadBuffer buffer, int id) : this(transaction, null, handlerVersion, buffer, 0) { _id = id; } public QueryingReadContext(Transaction transaction, int handlerVersion, IReadBuffer buffer, int collectionID, IdObjectCollector collector) : this(transaction, null , handlerVersion, buffer, collectionID, collector) { } public virtual int CollectionID() { return _collectionID; } public virtual QCandidates Candidates() { return _candidates; } public override int HandlerVersion() { return _handlerVersion; } private void AddId(int id) { _collector.AddId(id); } public virtual TreeInt Ids() { return _collector.Ids(); } public virtual void Add(object obj) { int id = GetID(obj); if (id > 0) { AddId(id); return; } AddObjectWithoutId(obj); } private int GetID(object obj) { return Container().GetID(Transaction(), obj); } public virtual void ReadId(ITypeHandler4 handler) { ObjectID objectID = ObjectID.NotPossible; try { int offset = Offset(); if (handler is IReadsObjectIds) { objectID = ((IReadsObjectIds)handler).ReadObjectID(this); } if (objectID.IsValid()) { AddId(objectID._id); return; } if (objectID == ObjectID.NotPossible) { Seek(offset); // FIXME: there's no point in activating the object // just find its id // type handlers know how to do it object obj = Read(handler); if (obj != null) { int id = (int)GetID(obj); if (id > 0) { AddId(id); } else { AddObjectWithoutId(obj); } } } } catch (Exception) { } } // FIXME: Catchall private void AddObjectWithoutId(object obj) { _collector.Add(obj); } public virtual void SkipId(ITypeHandler4 handler) { if (handler is IReadsObjectIds) { ((IReadsObjectIds)handler).ReadObjectID(this); return; } // TODO: Optimize for just doing a seek here. Read(handler); } public virtual IEnumerator ObjectsWithoutId() { return _collector.Objects(); } public virtual int DeclaredAspectCount() { return _declaredAspectCount; } public virtual void DeclaredAspectCount(int count) { _declaredAspectCount = count; } public virtual IdObjectCollector Collector() { return _collector; } public virtual int ObjectId() { return _id; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/IInternalReadContext.cs0000644000175000017500000000135611700531646033010 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Marshall { /// public interface IInternalReadContext : IReadContext, IHandlerVersionContext { IReadBuffer Buffer(IReadBuffer buffer); IReadBuffer Buffer(); ObjectContainerBase Container(); int Offset(); object Read(ITypeHandler4 handler); object ReadAtCurrentSeekPosition(ITypeHandler4 handler); IReadWriteBuffer ReadIndirectedBuffer(); void Seek(int offset); int HandlerVersion(); void NotifyNullReferenceSkipped(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/PrimitiveMarshaller0.cs0000644000175000017500000000400511700531646033017 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { public class PrimitiveMarshaller0 : PrimitiveMarshaller { public override bool UseNormalClassRead() { return true; } public override DateTime ReadDate(ByteArrayBuffer bytes) { long value = bytes.ReadLong(); if (value == long.MaxValue) { return MarshallingConstants0.NullDate; } return new DateTime(value); } public override object ReadInteger(ByteArrayBuffer bytes) { int value = bytes.ReadInt(); if (value == int.MaxValue) { return null; } return value; } public override object ReadFloat(ByteArrayBuffer bytes) { float value = UnmarshallFloat(bytes); if (float.IsNaN(value)) { return null; } return value; } public override object ReadDouble(ByteArrayBuffer buffer) { double value = UnmarshalDouble(buffer); if (double.IsNaN(value)) { return null; } return value; } public override object ReadLong(ByteArrayBuffer buffer) { long value = buffer.ReadLong(); if (value == long.MaxValue) { return null; } return value; } public override object ReadShort(ByteArrayBuffer buffer) { short value = UnmarshallShort(buffer); if (value == short.MaxValue) { return null; } return value; } public static double UnmarshalDouble(ByteArrayBuffer buffer) { return Platform4.LongToDouble(buffer.ReadLong()); } public static float UnmarshallFloat(ByteArrayBuffer buffer) { return Sharpen.Runtime.IntBitsToFloat(buffer.ReadInt()); } public static short UnmarshallShort(ByteArrayBuffer buffer) { int ret = 0; for (int i = 0; i < Const4.ShortBytes; i++) { ret = (ret << 8) + (buffer._buffer[buffer._offset++] & unchecked((int)(0xff))); } return (short)ret; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/PrimitiveMarshaller.cs0000644000175000017500000000132711700531646032743 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { public abstract class PrimitiveMarshaller { public MarshallerFamily _family; public abstract bool UseNormalClassRead(); public abstract DateTime ReadDate(ByteArrayBuffer bytes); public abstract object ReadShort(ByteArrayBuffer buffer); public abstract object ReadInteger(ByteArrayBuffer buffer); public abstract object ReadFloat(ByteArrayBuffer buffer); public abstract object ReadDouble(ByteArrayBuffer buffer); public abstract object ReadLong(ByteArrayBuffer buffer); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/ClassMarshaller0.cs0000644000175000017500000000252411700531646032120 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Classindex; using Db4objects.Db4o.Internal.Convert.Conversions; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public class ClassMarshaller0 : ClassMarshaller { protected override void ReadIndex(ObjectContainerBase stream, ClassMetadata clazz , ByteArrayBuffer reader) { int indexID = reader.ReadInt(); if (!stream.MaintainsIndices() || !(stream is LocalObjectContainer)) { return; } if (Btree(clazz) != null) { return; } clazz.Index().Read(stream, ValidIndexId(indexID)); if (IsOldClassIndex(indexID)) { new ClassIndexesToBTrees_5_5().Convert((LocalObjectContainer)stream, indexID, Btree (clazz)); stream.SetDirtyInSystemTransaction(clazz); } } private BTree Btree(ClassMetadata clazz) { return BTreeClassIndexStrategy.Btree(clazz); } private int ValidIndexId(int indexID) { return IsOldClassIndex(indexID) ? 0 : -indexID; } private bool IsOldClassIndex(int indexID) { return indexID > 0; } protected override int IndexIDForWriting(int indexID) { return indexID; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/IFieldMarshaller.cs0000644000175000017500000000143011700531646032122 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public interface IFieldMarshaller { void Write(Transaction trans, ClassMetadata clazz, ClassAspect aspect, ByteArrayBuffer writer); RawFieldSpec ReadSpec(ObjectContainerBase stream, ByteArrayBuffer reader); FieldMetadata Read(ObjectContainerBase stream, ClassMetadata clazz, ByteArrayBuffer reader); int MarshalledLength(ObjectContainerBase stream, ClassAspect aspect); void Defrag(ClassMetadata classMetadata, ClassAspect aspect, LatinStringIO sio, DefragmentContextImpl context); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/ClassMarshaller2.cs0000644000175000017500000000115211700531646032116 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public class ClassMarshaller2 : ClassMarshaller { protected override void ReadIndex(ObjectContainerBase stream, ClassMetadata clazz , ByteArrayBuffer reader) { int indexID = reader.ReadInt(); if (indexID == 0) { return; } clazz.Index().Read(stream, indexID); } protected override int IndexIDForWriting(int indexID) { return indexID; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/MarshallingContextState.cs0000644000175000017500000000056111700531646033566 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Marshall { /// public class MarshallingContextState { internal readonly MarshallingBuffer _buffer; public MarshallingContextState(MarshallingBuffer buffer) { _buffer = buffer; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/AbstractReadContext.cs0000644000175000017500000001007411700531646032663 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Marshall { /// public abstract class AbstractReadContext : AbstractBufferContext, IInternalReadContext { protected IActivationDepth _activationDepth = UnknownActivationDepth.Instance; private bool _lastReferenceReadWasReallyNull = false; protected AbstractReadContext(Transaction transaction, IReadBuffer buffer) : base (transaction, buffer) { } protected AbstractReadContext(Transaction transaction) : this(transaction, null) { } public object Read(ITypeHandler4 handlerType) { return ReadObject(handlerType); } public object ReadObject(ITypeHandler4 handlerType) { if (null == handlerType) { throw new ArgumentNullException(); } ITypeHandler4 handler = HandlerRegistry.CorrectHandlerVersion(this, handlerType); return SlotFormat().DoWithSlotIndirection(this, handler, new _IClosure4_38(this, handler)); } private sealed class _IClosure4_38 : IClosure4 { public _IClosure4_38(AbstractReadContext _enclosing, ITypeHandler4 handler) { this._enclosing = _enclosing; this.handler = handler; } public object Run() { return this._enclosing.ReadAtCurrentSeekPosition(handler); } private readonly AbstractReadContext _enclosing; private readonly ITypeHandler4 handler; } public virtual object ReadAtCurrentSeekPosition(ITypeHandler4 handler) { if (Handlers4.UseDedicatedSlot(this, handler)) { return ReadObject(); } return Handlers4.ReadValueType(this, handler); } public object ReadObject() { int objectId = ReadInt(); if (objectId == 0) { _lastReferenceReadWasReallyNull = true; return null; } _lastReferenceReadWasReallyNull = false; if (objectId == Const4.InvalidObjectId) { return null; } ClassMetadata classMetadata = ClassMetadataForObjectId(objectId); if (null == classMetadata) { // TODO: throw here return null; } IActivationDepth depth = ActivationDepth().Descend(classMetadata); if (PeekPersisted()) { return Container().PeekPersisted(Transaction(), objectId, depth, false); } object obj = Container().GetByID2(Transaction(), objectId); if (null == obj) { return null; } // this is OK for boxed value types. They will not be added // to the list, since they will not be found in the ID tree. Container().StillToActivate(Container().ActivationContextFor(Transaction(), obj, depth)); return obj; } private ClassMetadata ClassMetadataForObjectId(int objectId) { // TODO: This method is *very* costly as is, since it reads // the whole slot once and doesn't reuse it. Optimize. HardObjectReference hardRef = Container().GetHardObjectReferenceById(Transaction( ), objectId); if (null == hardRef || hardRef._reference == null) { // com.db4o.db4ounit.common.querying.CascadeDeleteDeleted return null; } return hardRef._reference.ClassMetadata(); } protected virtual bool PeekPersisted() { return false; } public virtual IActivationDepth ActivationDepth() { return _activationDepth; } public virtual void ActivationDepth(IActivationDepth depth) { _activationDepth = depth; } public virtual IReadWriteBuffer ReadIndirectedBuffer() { int address = ReadInt(); int length = ReadInt(); if (address == 0) { return null; } return Container().DecryptedBufferByAddress(address, length); } public virtual bool LastReferenceReadWasReallyNull() { return _lastReferenceReadWasReallyNull; } public virtual void NotifyNullReferenceSkipped() { _lastReferenceReadWasReallyNull = true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/IMarshallingInfo.cs0000644000175000017500000000066111700531646032146 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public interface IMarshallingInfo : IAspectVersionContext { Db4objects.Db4o.Internal.ClassMetadata ClassMetadata(); IReadBuffer Buffer(); void BeginSlot(); bool IsNull(int fieldIndex); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/SlotFormatCurrent.cs0000644000175000017500000000120211700531646032405 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Marshall { /// public class SlotFormatCurrent : SlotFormat { protected override int HandlerVersion() { return HandlerRegistry.HandlerVersion; } public override bool IsIndirectedWithinSlot(ITypeHandler4 handler) { if (Handlers4.IsUntyped(handler)) { return false; } return Handlers4.IsVariableLength(handler) && Handlers4.IsValueType(handler); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/FieldMarshaller1.cs0000644000175000017500000000513211700531646032075 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public class FieldMarshaller1 : FieldMarshaller0 { private bool HasBTreeIndex(FieldMetadata field) { return !field.IsVirtual(); } public override void Write(Transaction trans, ClassMetadata clazz, ClassAspect aspect , ByteArrayBuffer writer) { base.Write(trans, clazz, aspect, writer); if (!(aspect is FieldMetadata)) { return; } FieldMetadata field = (FieldMetadata)aspect; if (!HasBTreeIndex(field)) { return; } writer.WriteIDOf(trans, field.GetIndex(trans)); } protected override RawFieldSpec ReadSpec(AspectType aspectType, ObjectContainerBase stream, ByteArrayBuffer reader) { RawFieldSpec spec = base.ReadSpec(aspectType, stream, reader); if (spec == null) { return null; } if (spec.IsVirtual()) { return spec; } int indexID = reader.ReadInt(); spec.IndexID(indexID); return spec; } protected override FieldMetadata FromSpec(RawFieldSpec spec, ObjectContainerBase stream, ClassMetadata containingClass) { FieldMetadata actualField = base.FromSpec(spec, stream, containingClass); if (spec == null) { return null; } if (spec.IndexID() != 0) { actualField.InitIndex(stream.SystemTransaction(), spec.IndexID()); } return actualField; } public override int MarshalledLength(ObjectContainerBase stream, ClassAspect aspect ) { int len = base.MarshalledLength(stream, aspect); if (!(aspect is FieldMetadata)) { return len; } FieldMetadata field = (FieldMetadata)aspect; if (!HasBTreeIndex(field)) { return len; } return len + Const4.IdLength; } public override void Defrag(ClassMetadata classMetadata, ClassAspect aspect, LatinStringIO sio, DefragmentContextImpl context) { base.Defrag(classMetadata, aspect, sio, context); if (!(aspect is FieldMetadata)) { return; } FieldMetadata field = (FieldMetadata)aspect; if (field.IsVirtual()) { return; } if (field.HasIndex()) { BTree index = field.GetIndex(context.SystemTrans()); int targetIndexID = context.CopyID(); if (targetIndexID != 0) { index.DefragBTree(context.Services()); } } else { context.WriteInt(0); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/SlotFormat2.cs0000644000175000017500000000077011700531646031135 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Marshall { /// public class SlotFormat2 : SlotFormat { protected override int HandlerVersion() { return 2; } public override bool IsIndirectedWithinSlot(ITypeHandler4 handler) { return Handlers4.IsVariableLength(handler); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/IAspectVersionContext.cs0000644000175000017500000000041211700531646033215 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Marshall { /// public interface IAspectVersionContext { int DeclaredAspectCount(); void DeclaredAspectCount(int count); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/RawClassSpec.cs0000644000175000017500000000122511700531646031307 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Marshall { /// public class RawClassSpec { private readonly string _name; private readonly int _superClassID; private readonly int _numFields; public RawClassSpec(string name, int superClassID, int numFields) { _name = name; _superClassID = superClassID; _numFields = numFields; } public virtual string Name() { return _name; } public virtual int SuperClassID() { return _superClassID; } public virtual int NumFields() { return _numFields; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/AbstractFieldMarshaller.cs0000644000175000017500000000205611700531646033502 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public abstract class AbstractFieldMarshaller : IFieldMarshaller { protected abstract RawFieldSpec ReadSpec(AspectType aspectType, ObjectContainerBase stream, ByteArrayBuffer reader); public virtual RawFieldSpec ReadSpec(ObjectContainerBase stream, ByteArrayBuffer reader) { return ReadSpec(AspectType.Field, stream, reader); } public abstract void Defrag(ClassMetadata arg1, ClassAspect arg2, LatinStringIO arg3 , DefragmentContextImpl arg4); public abstract int MarshalledLength(ObjectContainerBase arg1, ClassAspect arg2); public abstract FieldMetadata Read(ObjectContainerBase arg1, ClassMetadata arg2, ByteArrayBuffer arg3); public abstract void Write(Transaction arg1, ClassMetadata arg2, ClassAspect arg3 , ByteArrayBuffer arg4); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/UnmarshallingContext.cs0000644000175000017500000001124111700531646033125 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Marshall { /// Wraps the low-level details of reading a Buffer, which in turn is a glorified byte array. /// /// Wraps the low-level details of reading a Buffer, which in turn is a glorified byte array. /// /// public class UnmarshallingContext : ObjectReferenceContext, IHandlerVersionContext , IReferenceActivationContext { private object _object; private int _addToIDTree; private bool _checkIDTree; public UnmarshallingContext(Transaction transaction, ByteArrayBuffer buffer, ObjectReference @ref, int addToIDTree, bool checkIDTree) : base(transaction, buffer, null, @ref ) { _addToIDTree = addToIDTree; _checkIDTree = checkIDTree; } public UnmarshallingContext(Transaction transaction, ObjectReference @ref, int addToIDTree , bool checkIDTree) : this(transaction, null, @ref, addToIDTree, checkIDTree) { } public virtual object Read() { if (!BeginProcessing()) { return _object; } ReadBuffer(ObjectId()); if (Buffer() == null) { EndProcessing(); return _object; } ClassMetadata classMetadata = ReadObjectHeader(); if (classMetadata == null) { InvalidSlot(); EndProcessing(); return _object; } _reference.ClassMetadata(classMetadata); AdjustActivationDepth(); if (_checkIDTree) { object objectInCacheFromClassCreation = Transaction().ObjectForIdFromCache(ObjectId ()); if (objectInCacheFromClassCreation != null) { _object = objectInCacheFromClassCreation; EndProcessing(); return _object; } } if (PeekPersisted()) { _object = ClassMetadata().InstantiateTransient(this); } else { _object = ClassMetadata().Instantiate(this); } EndProcessing(); return _object; } private void InvalidSlot() { if (Container().Config().RecoveryMode()) { return; } throw new InvalidSlotException("id: " + ObjectId()); } private void AdjustActivationDepth() { if (UnknownActivationDepth.Instance == _activationDepth) { _activationDepth = Container().DefaultActivationDepth(ClassMetadata()); } } private IActivationDepthProvider ActivationDepthProvider() { return Container().ActivationDepthProvider(); } public virtual object ReadFullyActivatedObjectForKeys(ITypeHandler4 handler) { object obj = ReadObject(handler); if (obj == null) { return obj; } IActivationDepth activationDepth = ActivationDepthProvider().ActivationDepth(int.MaxValue , ActivationMode.Activate); Container().Activate(Transaction(), obj, activationDepth); return obj; } public virtual object ReadFieldValue(FieldMetadata field) { ReadBuffer(ObjectId()); if (Buffer() == null) { return null; } ClassMetadata classMetadata = ReadObjectHeader(); if (classMetadata == null) { return null; } return ReadFieldValue(classMetadata, field); } private object ReadFieldValue(ClassMetadata classMetadata, FieldMetadata field) { if (!classMetadata.SeekToField(this, field)) { return null; } return field.Read(this); } private ClassMetadata ReadObjectHeader() { _objectHeader = new ObjectHeader(Container(), ByteArrayBuffer()); ClassMetadata classMetadata = _objectHeader.ClassMetadata(); if (classMetadata == null) { return null; } return classMetadata; } private void ReadBuffer(int id) { if (Buffer() == null && id > 0) { Buffer(Container().ReadBufferById(Transaction(), id)); } } private bool BeginProcessing() { return _reference.BeginProcessing(); } private void EndProcessing() { _reference.EndProcessing(); } public virtual void SetStateClean() { _reference.SetStateClean(); } public virtual object PersistentObject() { return _object; } public virtual void SetObjectWeak(object obj) { _reference.SetObjectWeak(Container(), obj); } protected override bool PeekPersisted() { return _addToIDTree == Const4.Transient; } public virtual Config4Class ClassConfig() { return ClassMetadata().Config(); } public virtual void PersistentObject(object obj) { _object = obj; } } } AspectVersionContextImpl.cs0000644000175000017500000000175411700531646033661 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public class AspectVersionContextImpl : IAspectVersionContext { private readonly int _declaredAspectCount; private AspectVersionContextImpl(int count) { _declaredAspectCount = count; } public virtual int DeclaredAspectCount() { return _declaredAspectCount; } public virtual void DeclaredAspectCount(int count) { throw new InvalidOperationException(); } public static readonly Db4objects.Db4o.Internal.Marshall.AspectVersionContextImpl AlwaysEnabled = new Db4objects.Db4o.Internal.Marshall.AspectVersionContextImpl( int.MaxValue); public static readonly Db4objects.Db4o.Internal.Marshall.AspectVersionContextImpl CheckAlwaysEnabled = new Db4objects.Db4o.Internal.Marshall.AspectVersionContextImpl (int.MaxValue - 1); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/ObjectHeaderAttributes.cs0000644000175000017500000000112511700531646033342 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Marshall { /// public class ObjectHeaderAttributes { private readonly int _fieldCount; private readonly BitMap4 _nullBitMap; public ObjectHeaderAttributes(ByteArrayBuffer reader) { _fieldCount = reader.ReadInt(); _nullBitMap = reader.ReadBitMap(_fieldCount); } public virtual bool IsNull(int fieldIndex) { return _nullBitMap.IsTrue(fieldIndex); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/MarshallerFamily.cs0000644000175000017500000000751411700531646032220 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Convert.Conversions; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// /// Represents a db4o file format version, assembles all the marshallers /// needed to read/write this specific version. /// /// /// Represents a db4o file format version, assembles all the marshallers /// needed to read/write this specific version. /// A marshaller knows how to read/write certain types of values from/to its /// representation on disk for a given db4o file format version. /// Responsibilities are somewhat overlapping with TypeHandler's. /// /// public class MarshallerFamily { public class FamilyVersion { public const int PreMarshaller = 0; public const int Marshaller = 1; public const int BtreeFieldIndexes = 2; public const int ClassAspects = 3; } private static int CurrentVersion = MarshallerFamily.FamilyVersion.ClassAspects; public readonly ClassMarshaller _class; public readonly IFieldMarshaller _field; public readonly PrimitiveMarshaller _primitive; private readonly int _converterVersion; private readonly int _handlerVersion; private static readonly MarshallerFamily[] allVersions; static MarshallerFamily() { allVersions = new MarshallerFamily[HandlerRegistry.HandlerVersion + 1]; allVersions[0] = new MarshallerFamily(0, 0, new ClassMarshaller0(), new FieldMarshaller0 (), new PrimitiveMarshaller0()); // LEGACY => before 5.4 allVersions[1] = new MarshallerFamily(ClassIndexesToBTrees_5_5.Version, 1, new ClassMarshaller1 (), new FieldMarshaller0(), new PrimitiveMarshaller1()); allVersions[2] = new MarshallerFamily(FieldIndexesToBTrees_5_7.Version, 2, new ClassMarshaller2 (), new FieldMarshaller1(), new PrimitiveMarshaller1()); for (int i = 3; i < allVersions.Length; i++) { allVersions[i] = LatestFamily(i); } } public MarshallerFamily(int converterVersion, int handlerVersion, ClassMarshaller classMarshaller, IFieldMarshaller fieldMarshaller, PrimitiveMarshaller primitiveMarshaller ) { _converterVersion = converterVersion; _handlerVersion = handlerVersion; _class = classMarshaller; _class._family = this; _field = fieldMarshaller; _primitive = primitiveMarshaller; _primitive._family = this; } public static MarshallerFamily LatestFamily(int version) { return new MarshallerFamily(ClassAspects_7_4.Version, version, new ClassMarshaller2 (), new FieldMarshaller2(), new PrimitiveMarshaller1()); } public static MarshallerFamily Version(int n) { CheckIfVersionIsTooNew(n); return allVersions[n]; } private static void CheckIfVersionIsTooNew(int n) { if (n > allVersions.Length) { throw new IncompatibleFileFormatException("Databasefile was created with a newer db4o version. Marshaller version: " + n); } } public static MarshallerFamily Current() { if (CurrentVersion < MarshallerFamily.FamilyVersion.BtreeFieldIndexes) { throw new InvalidOperationException("Using old marshaller versions to write database files is not supported, source code has been removed." ); } return Version(CurrentVersion); } public static MarshallerFamily ForConverterVersion(int n) { MarshallerFamily result = allVersions[0]; for (int i = 1; i < allVersions.Length; i++) { if (allVersions[i]._converterVersion > n) { return result; } result = allVersions[i]; } return result; } public virtual int HandlerVersion() { return _handlerVersion; } } } UnknownTypeHandlerAspect.cs0000644000175000017500000000130211700531646033631 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Marshall { public class UnknownTypeHandlerAspect : FieldMetadata { public UnknownTypeHandlerAspect(ClassMetadata containingClass, string name) : base (containingClass, name) { } public override void DefragAspect(IDefragmentContext context) { throw new InvalidOperationException("Type handler for '" + ContainingClass() + "' could not be found. Defragment cannot proceed. " + " Please ensure all required types are available and try again."); } public override bool Alive() { return false; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/ObjectHeaderContext.cs0000644000175000017500000000272511700531646032647 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public class ObjectHeaderContext : AbstractReadContext, IMarshallingInfo, IHandlerVersionContext { protected ObjectHeader _objectHeader; private int _declaredAspectCount; public ObjectHeaderContext(Transaction transaction, IReadBuffer buffer, ObjectHeader objectHeader) : base(transaction, buffer) { _objectHeader = objectHeader; } public ObjectHeaderAttributes HeaderAttributes() { return _objectHeader._headerAttributes; } public bool IsNull(int fieldIndex) { return HeaderAttributes().IsNull(fieldIndex); } public override int HandlerVersion() { return _objectHeader.HandlerVersion(); } public virtual void BeginSlot() { } // do nothing public virtual ContextState SaveState() { return new ContextState(Offset()); } public virtual void RestoreState(ContextState state) { Seek(state._offset); } public virtual Db4objects.Db4o.Internal.ClassMetadata ClassMetadata() { return _objectHeader.ClassMetadata(); } public virtual int DeclaredAspectCount() { return _declaredAspectCount; } public virtual void DeclaredAspectCount(int count) { _declaredAspectCount = count; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/AspectType.cs0000644000175000017500000000257311700531646031045 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Internal.Marshall { /// public class AspectType { public readonly byte _id; public static readonly Db4objects.Db4o.Internal.Marshall.AspectType Field = new Db4objects.Db4o.Internal.Marshall.AspectType ((byte)1); public static readonly Db4objects.Db4o.Internal.Marshall.AspectType Translator = new Db4objects.Db4o.Internal.Marshall.AspectType((byte)2); public static readonly Db4objects.Db4o.Internal.Marshall.AspectType Typehandler = new Db4objects.Db4o.Internal.Marshall.AspectType((byte)3); private AspectType(byte id) { _id = id; } public static Db4objects.Db4o.Internal.Marshall.AspectType ForByte(byte b) { switch (b) { case 1: { return Field; } case 2: { return Translator; } case 3: { return Typehandler; } default: { throw new ArgumentException(); } } } public virtual bool IsFieldMetadata() { return IsField() || IsTranslator(); } public virtual bool IsTranslator() { return this == Db4objects.Db4o.Internal.Marshall.AspectType.Translator; } public virtual bool IsField() { return this == Db4objects.Db4o.Internal.Marshall.AspectType.Field; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/ContextState.cs0000644000175000017500000000043211700531646031401 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Marshall { /// public class ContextState { public readonly int _offset; public ContextState(int offset) { _offset = offset; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/MarshallingContext.cs0000644000175000017500000002231311700531646032564 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Marshall { /// public class MarshallingContext : IMarshallingInfo, IWriteContext { private const int HeaderLength = Const4.LeadingLength + Const4.IdLength + 1 + Const4 .IntLength; private readonly Db4objects.Db4o.Internal.Transaction _transaction; private readonly ObjectReference _reference; private IUpdateDepth _updateDepth; private readonly bool _isNew; private readonly BitMap4 _nullBitMap; private readonly MarshallingBuffer _writeBuffer; private MarshallingBuffer _currentBuffer; private ByteArrayBuffer _debugPrepend; private object _currentMarshalledObject; private object _currentIndexEntry; private int _declaredAspectCount; public MarshallingContext(Db4objects.Db4o.Internal.Transaction trans, ObjectReference @ref, IUpdateDepth updateDepth, bool isNew) { // YapClass ID // Marshaller Version // number of fields _transaction = trans; _reference = @ref; _nullBitMap = new BitMap4(AspectCount()); _updateDepth = ClassMetadata().AdjustUpdateDepth(trans, updateDepth); _isNew = isNew; _writeBuffer = new MarshallingBuffer(); _currentBuffer = _writeBuffer; } private int AspectCount() { return ClassMetadata().AspectCount(); } public virtual Db4objects.Db4o.Internal.ClassMetadata ClassMetadata() { return _reference.ClassMetadata(); } public virtual bool IsNew() { return _isNew; } public virtual bool IsNull(int fieldIndex) { // TODO Auto-generated method stub return false; } public virtual void IsNull(int fieldIndex, bool flag) { _nullBitMap.Set(fieldIndex, flag); } public virtual Db4objects.Db4o.Internal.Transaction Transaction() { return _transaction; } public virtual Slot AllocateNewSlot(int length) { if (_transaction is LocalTransaction) { return LocalContainer().AllocateSlotForNewUserObject(_transaction, ObjectID(), length ); } return new Slot(Slot.New, length); } private Slot AllocateUpdateSlot(int length) { if (_transaction is LocalTransaction) { return LocalContainer().AllocateSlotForUserObjectUpdate(Transaction(), ObjectID() , length); } return new Slot(Slot.Update, length); } private LocalObjectContainer LocalContainer() { return ((LocalTransaction)Transaction()).LocalContainer(); } public virtual Pointer4 AllocateSlot() { int length = Container().BlockConverter().BlockAlignedBytes(MarshalledLength()); Slot slot = IsNew() ? AllocateNewSlot(length) : AllocateUpdateSlot(length); return new Pointer4(ObjectID(), slot); } public virtual ByteArrayBuffer ToWriteBuffer(Pointer4 pointer) { ByteArrayBuffer buffer = new ByteArrayBuffer(pointer.Length()); _writeBuffer.MergeChildren(this, pointer.Address(), WriteBufferOffset()); WriteObjectClassID(buffer, ClassMetadata().GetID()); buffer.WriteByte(HandlerRegistry.HandlerVersion); buffer.WriteInt(AspectCount()); buffer.WriteBitMap(_nullBitMap); _writeBuffer.TransferContentTo(buffer); return buffer; } private int WriteBufferOffset() { return HeaderLength + _nullBitMap.MarshalledLength(); } public virtual int MarshalledLength() { int length = WriteBufferOffset(); _writeBuffer.CheckBlockAlignment(this, null, new IntByRef(length)); return length + _writeBuffer.MarshalledLength() + Const4.BracketsBytes; } public virtual int RequiredLength(MarshallingBuffer buffer, bool align) { if (!align) { return buffer.Length(); } return Container().BlockConverter().BlockAlignedBytes(buffer.Length()); } private void WriteObjectClassID(ByteArrayBuffer reader, int id) { reader.WriteInt(-id); } public virtual object GetObject() { return _reference.GetObject(); } public virtual Config4Class ClassConfiguration() { return ClassMetadata().Config(); } public virtual IUpdateDepth UpdateDepth() { return _updateDepth; } public virtual void UpdateDepth(IUpdateDepth depth) { _updateDepth = depth; } public virtual int ObjectID() { return _reference.GetID(); } public virtual object CurrentIndexEntry() { // TODO Auto-generated method stub return null; } public virtual ObjectContainerBase Container() { return Transaction().Container(); } public virtual IObjectContainer ObjectContainer() { return Transaction().ObjectContainer(); } public virtual void WriteByte(byte b) { PreWrite(); _currentBuffer.WriteByte(b); PostWrite(); } public virtual void WriteBytes(byte[] bytes) { PreWrite(); _currentBuffer.WriteBytes(bytes); PostWrite(); } public virtual void WriteInt(int i) { PreWrite(); _currentBuffer.WriteInt(i); PostWrite(); } public virtual void WriteLong(long l) { PreWrite(); _currentBuffer.WriteLong(l); PostWrite(); } private void PreWrite() { } private void PostWrite() { } public virtual void CreateChildBuffer(bool storeLengthInLink) { MarshallingBuffer childBuffer = _currentBuffer.AddChild(false, storeLengthInLink); _currentBuffer.ReserveChildLinkSpace(storeLengthInLink); _currentBuffer = childBuffer; } public virtual void BeginSlot() { _currentBuffer = _writeBuffer; } public virtual void WriteDeclaredAspectCount(int count) { _writeBuffer.WriteInt(count); } public virtual void DebugPrependNextWrite(ByteArrayBuffer prepend) { } public virtual void DebugWriteEnd(byte b) { _currentBuffer.WriteByte(b); } public virtual void WriteObject(object obj) { int id = Container().StoreInternal(Transaction(), obj, _updateDepth, true); WriteInt(id); _currentMarshalledObject = obj; _currentIndexEntry = id; } public virtual void WriteObject(ITypeHandler4 handler, object obj) { MarshallingContextState state = CurrentState(); WriteObjectWithCurrentState(handler, obj); RestoreState(state); } public virtual void WriteObjectWithCurrentState(ITypeHandler4 handler, object obj ) { if (Handlers4.UseDedicatedSlot(this, handler)) { WriteObject(obj); } else { if (obj == null) { WriteNullReference(handler); } else { CreateIndirectionWithinSlot(handler); handler.Write(this, obj); } } } private void WriteNullReference(ITypeHandler4 handler) { if (IsIndirectedWithinSlot(handler)) { WriteNullLink(); return; } Handlers4.Write(handler, this, Handlers4.NullRepresentationInUntypedArrays(handler )); } private void WriteNullLink() { WriteInt(0); WriteInt(0); } public virtual void AddIndexEntry(FieldMetadata fieldMetadata, object obj) { if (!_currentBuffer.HasParent()) { object indexEntry = (obj == _currentMarshalledObject) ? _currentIndexEntry : obj; if (_isNew || !UpdateDepth().CanSkip(_reference)) { fieldMetadata.AddIndexEntry(Transaction(), ObjectID(), indexEntry); } return; } _currentBuffer.RequestIndexEntry(fieldMetadata); } public virtual void PurgeFieldIndexEntriesOnUpdate(Db4objects.Db4o.Internal.Transaction transaction, ArrayType arrayType) { if (!UpdateDepth().CanSkip(_reference)) { transaction.WriteUpdateAdjustIndexes(_reference.GetID(), _reference.ClassMetadata (), arrayType); } } public virtual ObjectReference Reference() { return _reference; } public virtual void CreateIndirectionWithinSlot(ITypeHandler4 handler) { if (IsIndirectedWithinSlot(handler)) { CreateIndirectionWithinSlot(); } } public virtual void CreateIndirectionWithinSlot() { CreateChildBuffer(true); } private bool IsIndirectedWithinSlot(ITypeHandler4 handler) { return SlotFormat.Current().IsIndirectedWithinSlot(handler); } // FIXME: This method was just temporarily added to fulfill contract of MarshallingInfo // It will go, the buffer is never needed in new marshalling. public virtual IReadBuffer Buffer() { return null; } public virtual MarshallingContextState CurrentState() { return new MarshallingContextState(_currentBuffer); } public virtual void RestoreState(MarshallingContextState state) { _currentBuffer = state._buffer; } public virtual IReservedBuffer Reserve(int length) { PreWrite(); IReservedBuffer reservedBuffer = _currentBuffer.Reserve(length); PostWrite(); return reservedBuffer; } public virtual int DeclaredAspectCount() { return _declaredAspectCount; } public virtual void DeclaredAspectCount(int count) { _declaredAspectCount = count; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/FieldMarshaller0.cs0000644000175000017500000000742611700531646032104 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Marshall { /// public class FieldMarshaller0 : AbstractFieldMarshaller { public override int MarshalledLength(ObjectContainerBase stream, ClassAspect aspect ) { int len = stream.StringIO().ShortLength(aspect.GetName()); if (aspect is FieldMetadata) { FieldMetadata field = (FieldMetadata)aspect; if (field.NeedsArrayAndPrimitiveInfo()) { len += 1; } if (!(field is VirtualFieldMetadata)) { len += Const4.IdLength; } } return len; } protected override RawFieldSpec ReadSpec(AspectType aspectType, ObjectContainerBase stream, ByteArrayBuffer reader) { string name = StringHandler.ReadStringNoDebug(stream.Transaction.Context(), reader ); if (!aspectType.IsFieldMetadata()) { return new RawFieldSpec(aspectType, name); } if (name.IndexOf(Const4.VirtualFieldPrefix) == 0) { if (stream._handlers.VirtualFieldByName(name) != null) { return new RawFieldSpec(aspectType, name); } } int fieldTypeID = reader.ReadInt(); byte attribs = reader.ReadByte(); return new RawFieldSpec(aspectType, name, fieldTypeID, attribs); } public sealed override FieldMetadata Read(ObjectContainerBase stream, ClassMetadata containingClass, ByteArrayBuffer reader) { RawFieldSpec spec = ReadSpec(stream, reader); return FromSpec(spec, stream, containingClass); } protected virtual FieldMetadata FromSpec(RawFieldSpec spec, ObjectContainerBase stream , ClassMetadata containingClass) { if (spec == null) { return null; } string name = spec.Name(); if (spec.IsVirtualField()) { return stream._handlers.VirtualFieldByName(name); } if (spec.IsTranslator()) { return new TranslatedAspect(containingClass, name); } if (spec.IsField()) { return new FieldMetadata(containingClass, name, spec.FieldTypeID(), spec.IsPrimitive (), spec.IsArray(), spec.IsNArray()); } return new UnknownTypeHandlerAspect(containingClass, name); } public override void Write(Transaction trans, ClassMetadata clazz, ClassAspect aspect , ByteArrayBuffer writer) { writer.WriteShortString(trans, aspect.GetName()); if (!(aspect is FieldMetadata)) { return; } FieldMetadata field = (FieldMetadata)aspect; field.Alive(); if (field.IsVirtual()) { return; } ITypeHandler4 handler = field.GetHandler(); if (handler is StandardReferenceTypeHandler) { // TODO: ensure there is a test case, to make this happen if (((StandardReferenceTypeHandler)handler).ClassMetadata().GetID() == 0) { trans.Container().NeedsUpdate(clazz); } } writer.WriteInt(field.FieldTypeID()); BitMap4 bitmap = new BitMap4(3); bitmap.Set(0, field.IsPrimitive()); bitmap.Set(1, Handlers4.HandlesArray(handler)); bitmap.Set(2, Handlers4.HandlesMultidimensionalArray(handler)); // keep the order writer.WriteByte(bitmap.GetByte(0)); } public override void Defrag(ClassMetadata classMetadata, ClassAspect aspect, LatinStringIO sio, DefragmentContextImpl context) { context.IncrementStringOffset(sio); if (!(aspect is FieldMetadata)) { return; } if (((FieldMetadata)aspect).IsVirtual()) { return; } // handler ID context.CopyID(); // skip primitive/array/narray attributes context.IncrementOffset(1); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/ObjectIdContextImpl.cs0000644000175000017500000000114311700531646032626 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public class ObjectIdContextImpl : ObjectHeaderContext, IObjectIdContext { private readonly int _id; public ObjectIdContextImpl(Transaction transaction, IReadBuffer buffer, ObjectHeader objectHeader, int id) : base(transaction, buffer, objectHeader) { _id = id; } public virtual int ObjectId() { return _id; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/ClassMarshaller1.cs0000644000175000017500000000107511700531646032121 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public class ClassMarshaller1 : ClassMarshaller { protected override void ReadIndex(ObjectContainerBase stream, ClassMetadata clazz , ByteArrayBuffer reader) { int indexID = reader.ReadInt(); clazz.Index().Read(stream, -indexID); } protected override int IndexIDForWriting(int indexID) { return -indexID; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Marshall/IObjectIdContext.cs0000644000175000017500000000045311700531646032120 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Marshall { /// public interface IObjectIdContext : IHandlerVersionContext, IInternalReadContext { int ObjectId(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ICommittedCallbackDispatcher.cs0000644000175000017500000000051611700531646032676 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public interface ICommittedCallbackDispatcher { bool WillDispatchCommitted(); void DispatchCommitted(CallbackObjectInfoCollections committedInfo); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Replication/0000755000175000017500000000000011700531646027134 5ustar00meebeymeebey00000000000000IDb4oReplicationReferenceProvider.cs0000644000175000017500000000046711700531646036040 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Replication/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Replication; namespace Db4objects.Db4o.Internal.Replication { /// public interface IDb4oReplicationReferenceProvider { IDb4oReplicationReference ReferenceFor(object obj); } } IDb4oReplicationReference.cs0000644000175000017500000000046311700531646034321 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Replication/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Internal.Replication { /// public interface IDb4oReplicationReference { Db4oDatabase SignaturePart(); long LongPart(); long Version(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Exceptions4.cs0000644000175000017500000000303711700531646027422 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Internal { /// public class Exceptions4 { public static void ThrowRuntimeException(int code) { ThrowRuntimeException(code, null, null); } public static void ThrowRuntimeException(int code, Exception cause) { ThrowRuntimeException(code, null, cause); } public static void ThrowRuntimeException(int code, string msg) { ThrowRuntimeException(code, msg, null); } public static void ThrowRuntimeException(int code, string msg, Exception cause) { ThrowRuntimeException(code, msg, cause, true); } [System.ObsoleteAttribute] public static void ThrowRuntimeException(int code, string msg, Exception cause, bool doLog) { if (doLog) { Db4objects.Db4o.Internal.Messages.LogErr(Db4oFactory.Configure(), code, msg, cause ); } throw new Db4oException(Db4objects.Db4o.Internal.Messages.Get(code, msg)); } /// public static void CatchAllExceptDb4oException(Exception exc) { if (exc is Db4oException) { throw (Db4oException)exc; } } public static Exception ShouldNeverBeCalled() { throw new Exception(); } public static void ShouldNeverHappen() { throw new Exception(); } public static Exception VirtualException() { throw new Exception(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Mapping/0000755000175000017500000000000011700531646026256 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Mapping/IIDMapping.cs0000644000175000017500000000166611700531646030537 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Mapping { /// A mapping from db4o file source IDs/addresses to target IDs/addresses, used for defragmenting. /// /// A mapping from db4o file source IDs/addresses to target IDs/addresses, used for defragmenting. /// /// public interface IIDMapping { /// a mapping for the given id. if it does refer to a system handler or the empty reference (0), returns the given id. /// /// if the given id does not refer to a system handler or the empty reference (0) and if no mapping is found /// /// int StrictMappedID(int oldID); void MapIDs(int oldID, int newID, bool isClassID); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Mapping/MappedIDPair.cs0000644000175000017500000000102311700531646031040 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Mapping { /// public class MappedIDPair { private int _orig; private int _mapped; public MappedIDPair(int orig, int mapped) { _orig = orig; _mapped = mapped; } public virtual int Orig() { return _orig; } public virtual int Mapped() { return _mapped; } public override string ToString() { return _orig + "->" + _mapped; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Mapping/IdSource.cs0000644000175000017500000000067211700531646030327 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Internal.Mapping { public class IdSource { private readonly IQueue4 _queue; public IdSource(IQueue4 queue) { _queue = queue; } public virtual bool HasMoreIds() { return _queue.HasNext(); } public virtual int NextId() { return ((int)_queue.Next()); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Mapping/MappedIDPairHandler.cs0000644000175000017500000000424011700531646032342 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Mapping; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Mapping { /// public class MappedIDPairHandler : IIndexable4 { private readonly IntHandler _origHandler; private readonly IntHandler _mappedHandler; public MappedIDPairHandler() { _origHandler = new IntHandler(); _mappedHandler = new IntHandler(); } public virtual void DefragIndexEntry(DefragmentContextImpl context) { throw new NotImplementedException(); } public virtual int LinkLength() { return _origHandler.LinkLength() + _mappedHandler.LinkLength(); } public virtual object ReadIndexEntry(IContext context, ByteArrayBuffer reader) { int origID = ReadID(context, reader); int mappedID = ReadID(context, reader); return new MappedIDPair(origID, mappedID); } public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer reader, object obj) { MappedIDPair mappedIDs = (MappedIDPair)obj; _origHandler.WriteIndexEntry(context, reader, mappedIDs.Orig()); _mappedHandler.WriteIndexEntry(context, reader, mappedIDs.Mapped()); } private int ReadID(IContext context, ByteArrayBuffer a_reader) { return ((int)_origHandler.ReadIndexEntry(context, a_reader)); } public virtual IPreparedComparison PrepareComparison(IContext context, object source ) { MappedIDPair sourceIDPair = (MappedIDPair)source; int sourceID = sourceIDPair.Orig(); return new _IPreparedComparison_50(sourceID); } private sealed class _IPreparedComparison_50 : IPreparedComparison { public _IPreparedComparison_50(int sourceID) { this.sourceID = sourceID; } public int CompareTo(object target) { MappedIDPair targetIDPair = (MappedIDPair)target; int targetID = targetIDPair.Orig(); return sourceID == targetID ? 0 : (sourceID < targetID ? -1 : 1); } private readonly int sourceID; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Mapping/MappingNotFoundException.cs0000644000175000017500000000104711700531646033536 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Internal.Mapping { /// [System.Serializable] public class MappingNotFoundException : Exception { private const long serialVersionUID = -1771324770287654802L; private int _id; public MappingNotFoundException(int id) { this._id = id; } public virtual int Id() { return _id; } public override string ToString() { return base.ToString() + " : " + _id; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Messages.cs0000644000175000017500000001344711700531646026772 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.IO; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public sealed class Messages { public const int IncompatibleFormat = 17; public const int ClosedOrOpenFailed = 20; public const int FailedToShutdown = 28; public const int FatalMsgId = 44; public const int NotImplemented = 49; public const int OldDatabaseFormat = 65; public const int OnlyForIndexedFields = 66; public const int ClientServerUnsupported = 67; public const int CouldNotOpenPort = 30; public const int ServerListeningOnPort = 31; private static string[] i_messages; public static string Get(int a_code) { return Get(a_code, null); } public static string Get(int a_code, string param) { if (a_code < 0) { return param; } Load(); if (i_messages == null || a_code > i_messages.Length - 1) { return "msg[" + a_code + "]"; } string msg = i_messages[a_code]; if (param != null) { int pos = msg.IndexOf("%", 0); if (pos > -1) { msg = Sharpen.Runtime.Substring(msg, 0, pos) + "'" + param + "'" + Sharpen.Runtime.Substring (msg, pos + 1); } } return msg; } private static void Load() { if (i_messages == null) { i_messages = new string[] { string.Empty, "blocksize should be between 1 and 127" , "% close request", "% closed", "Exception opening %", "% opened O.K.", "Class %: Instantiation failed. \n Check custom ObjectConstructor code." , "Class %: Instantiation failed.\n Add a constructor for use with db4o, ideally with zero arguments." , "renaming %", "rename not possible. % already exists", "rename failed", "File close failed." , "File % not available for readwrite access.", "File read access failed.", "File not found: % Creating new file" , "Creation of file failed: %", "File write failed.", "File format incompatible: %" , "Uncaught Exception. Engine closed.", "writing log for %", "% is closed. close() was called or open() failed." , "Filename not specified.", "The database file is locked by another process.", "Class not available: %. Check CLASSPATH settings.", "finalized while performing a task.\n DO NOT USE CTRL + C OR System.exit() TO STOP THE ENGINE." , "Please mail the following to exception@db4o.com:\n ", "", "Creation of lock file failed: %" , "Previous session was not shut down correctly", "This method call is only possible on stored objects" , "Could not open port: %", "Server listening on port: %", "Client % connected." , "Client % timed out and closed.", "Connection closed by client %.", "Connection closed by server. %." , "% connected to server.", "The directory % can neither be found nor created.", "This blob was never stored.", "Blob file % not available.", "Failure finding blob filename." , "File does not exist %.", "Failed to connect to server.", "No blob data stored." , "Uncaught Exception. db4o engine closed.", "Add constructor that won't throw exceptions, configure constructor calls, configure exceptionsOnNotStorable(false) or provide a translator to class % and make sure the class is deployed to the server with the same package/namespace + assembly name." , "This method can only be called before opening the database file.", "AccessibleObject#setAccessible() is not available. Private fields can not be stored." , "ObjectTranslator could not be installed: %.", "Not implemented", "% closed by ShutdownHook." , string.Empty, "Add at least one ObjectContainer to the Cluster", "Unsupported Operation" , "Database password does not match user-provided password.", "Thread interrupted." , "Password can not be null.", "Classes does not match.", "rename() needs to be executed on the server." , "Primitive types like % can not be stored directly. Store and retrieve them in wrapper objects." , "Backups can not be run from clients and memory files.", "Backup in progress." , "Only use persisted first class objects as keys for IdentityHashMap.", "This functionality is only available from version 5.0 onwards." , "By convention a Predicate needs the following method: public boolean match(ExtentClass extent){}" , "Old database file format detected. To allow automatic updates call Db4o.configure().allowVersionUpdates(true)." , "This functionality is only available for indexed fields.", "This functionality is not supported for db4o clients in Client/Server mode." , "Invalid address: %", "Maximum file size reached" }; } } // unused // 5 // 10 // 15 // 20 // 25 // 30 // 35 // 40 // 45 // 50 // removed, can be reused // 55 // 60 // 65 // 66 // 67 // 69 public static void LogErr(IConfiguration config, int code, string msg, Exception t) { TextWriter ps = ((Config4Impl)SafeConfig(config)).ErrStream(); new MessageOutput(msg, code, ps); if (t != null) { new MessageOutput(null, 25, ps); Sharpen.Runtime.PrintStackTrace(t, ps); new MessageOutput(null, 26, ps, false); } } [System.ObsoleteAttribute(@"uses deprecated api")] private static IConfiguration SafeConfig(IConfiguration config) { if (config != null) { return config; } return Db4oFactory.Configure(); } public static void LogMsg(IConfiguration config, int code, string msg) { Config4Impl c4i = (Config4Impl)config; if (c4i.MessageLevel() > Const4.None) { new MessageOutput(msg, code, c4i.OutStream()); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/TransactionLocal.cs0000644000175000017500000000076011700531646030455 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// A transaction local variable. /// A transaction local variable. /// Transaction.Get(TransactionLocal) /// public class TransactionLocal { public virtual object InitialValueFor(Transaction transaction) { return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/LocalObjectContainer.cs0000644000175000017500000007276411700531646031256 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Convert; using Db4objects.Db4o.Internal.Events; using Db4objects.Db4o.Internal.Fileheader; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Qlin; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Query.Result; using Db4objects.Db4o.Internal.References; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Qlin; using Sharpen; using Sharpen.Lang; namespace Db4objects.Db4o.Internal { /// public abstract class LocalObjectContainer : ExternalObjectContainer, IInternalObjectContainer , IEmbeddedObjectContainer { protected FileHeader _fileHeader; private readonly Collection4 _dirtyClassMetadata = new Collection4(); private IFreespaceManager _freespaceManager; private bool i_isServer = false; private Lock4 _semaphoresLock = new Lock4(); private Hashtable4 _semaphores; private int _blockEndAddress; private Db4objects.Db4o.Internal.SystemData _systemData; private IIdSystem _idSystem; private readonly byte[] _pointerBuffer = new byte[Const4.PointerLength]; protected readonly ByteArrayBuffer _pointerIo = new ByteArrayBuffer(Const4.PointerLength ); internal LocalObjectContainer(IConfiguration config) : base(config) { } public override Transaction NewTransaction(Transaction parentTransaction, IReferenceSystem referenceSystem, bool isSystemTransaction) { ITransactionalIdSystem systemIdSystem = null; if (!isSystemTransaction) { systemIdSystem = SystemTransaction().IdSystem(); } IClosure4 idSystem = new _IClosure4_58(this); ITransactionalIdSystem transactionalIdSystem = NewTransactionalIdSystem(systemIdSystem , idSystem); return new LocalTransaction(this, parentTransaction, transactionalIdSystem, referenceSystem ); } private sealed class _IClosure4_58 : IClosure4 { public _IClosure4_58(LocalObjectContainer _enclosing) { this._enclosing = _enclosing; } public object Run() { return this._enclosing.IdSystem(); } private readonly LocalObjectContainer _enclosing; } public virtual ITransactionalIdSystem NewTransactionalIdSystem(ITransactionalIdSystem systemIdSystem, IClosure4 idSystem) { return new TransactionalIdSystemImpl(new _IClosure4_69(this), idSystem, (TransactionalIdSystemImpl )systemIdSystem); } private sealed class _IClosure4_69 : IClosure4 { public _IClosure4_69(LocalObjectContainer _enclosing) { this._enclosing = _enclosing; } public object Run() { return this._enclosing.FreespaceManager(); } private readonly LocalObjectContainer _enclosing; } public virtual IFreespaceManager FreespaceManager() { return _freespaceManager; } public virtual void BlockSizeReadFromFile(int size) { BlockSize(size); SetRegularEndAddress(FileLength()); } public virtual void SetRegularEndAddress(long address) { _blockEndAddress = _blockConverter.BytesToBlocks(address); } protected sealed override void Close2() { try { if (!_config.IsReadOnly()) { CommitTransaction(); Shutdown(); } } finally { ShutdownObjectContainer(); } } public override void Commit1(Transaction trans) { trans.Commit(); } internal virtual void ConfigureNewFile() { BlockSize(ConfigImpl.BlockSize()); _fileHeader = FileHeader.NewCurrentFileHeader(); SetRegularEndAddress(_fileHeader.Length()); NewSystemData(ConfigImpl.FreespaceSystem(), ConfigImpl.IdSystemType()); SystemData().ConverterVersion(Converter.Version); CreateStringIO(_systemData.StringEncoding()); CreateIdSystem(); InitializeClassMetadataRepository(); InitalizeWeakReferenceSupport(); GenerateNewIdentity(); AbstractFreespaceManager blockedFreespaceManager = AbstractFreespaceManager.CreateNew (this); InstallFreespaceManager(blockedFreespaceManager); InitNewClassCollection(); InitializeEssentialClasses(); _fileHeader.InitNew(this); blockedFreespaceManager.Start(0); } private void NewSystemData(byte freespaceSystemType, byte idSystemType) { _systemData = new Db4objects.Db4o.Internal.SystemData(); _systemData.StringEncoding(ConfigImpl.Encoding()); _systemData.FreespaceSystem(freespaceSystemType); _systemData.IdSystemType(idSystemType); } public override int ConverterVersion() { return _systemData.ConverterVersion(); } public override long CurrentVersion() { return _timeStampIdGenerator.Last(); } internal virtual void InitNewClassCollection() { // overridden in YapObjectCarrier to do nothing ClassCollection().InitTables(1); } public BTree CreateBTreeClassIndex(int id) { return new BTree(_transaction, id, new IDHandler()); } public AbstractQueryResult NewQueryResult(Transaction trans) { return NewQueryResult(trans, Config().EvaluationMode()); } public sealed override AbstractQueryResult NewQueryResult(Transaction trans, QueryEvaluationMode mode) { if (trans == null) { throw new ArgumentNullException(); } if (mode == QueryEvaluationMode.Immediate) { return new IdListQueryResult(trans); } return new HybridQueryResult(trans, mode); } public sealed override bool Delete4(Transaction transaction, ObjectReference @ref , object obj, int cascade, bool userCall) { int id = @ref.GetID(); StatefulBuffer reader = ReadStatefulBufferById(transaction, id); if (reader != null) { if (obj != null) { if ((!ShowInternalClasses()) && Const4.ClassInternal.IsAssignableFrom(obj.GetType ())) { return false; } } reader.SetCascadeDeletes(cascade); transaction.IdSystem().NotifySlotDeleted(id, SlotChangeFactory.UserObjects); ClassMetadata classMetadata = @ref.ClassMetadata(); classMetadata.Delete(reader, obj); return true; } return false; } public abstract long FileLength(); public abstract string FileName(); public virtual void Free(Slot slot) { if (slot.IsNull()) { return; } // TODO: This should really be an IllegalArgumentException but old database files // with index-based FreespaceManagers appear to deliver zeroed slots. // throw new IllegalArgumentException(); if (_freespaceManager == null) { // Can happen on early free before freespacemanager // is up, during conversion. return; } if (DTrace.enabled) { DTrace.FileFree.LogLength(slot.Address(), slot.Length()); } _freespaceManager.Free(slot); } public virtual void Free(int address, int a_length) { Free(new Slot(address, a_length)); } public virtual void GenerateNewIdentity() { lock (_lock) { SetIdentity(Db4oDatabase.Generate()); } } public override AbstractQueryResult QueryAllObjects(Transaction trans) { return GetAll(trans, Config().EvaluationMode()); } public virtual AbstractQueryResult GetAll(Transaction trans, QueryEvaluationMode mode) { AbstractQueryResult queryResult = NewQueryResult(trans, mode); queryResult.LoadFromClassIndexes(ClassCollection().Iterator()); return queryResult; } public virtual int AllocatePointerSlot() { int id = AllocateSlot(Const4.PointerLength).Address(); if (!IsValidPointer(id)) { return AllocatePointerSlot(); } // write a zero pointer first // to prevent delete interaction trouble WritePointer(id, Slot.Zero); if (DTrace.enabled) { DTrace.GetPointerSlot.Log(id); } return id; } protected virtual bool IsValidPointer(int id) { // We have to make sure that object IDs do not collide // with built-in type IDs. return !_handlers.IsSystemHandler(id); } public virtual Slot AllocateSlot(int length) { if (length <= 0) { throw new ArgumentException(); } if (_freespaceManager != null && _freespaceManager.IsStarted()) { Slot slot = _freespaceManager.AllocateSlot(length); if (slot != null) { if (DTrace.enabled) { DTrace.GetSlot.LogLength(slot.Address(), slot.Length()); } return slot; } while (GrowDatabaseByConfiguredSize()) { slot = _freespaceManager.AllocateSlot(length); if (slot != null) { if (DTrace.enabled) { DTrace.GetSlot.LogLength(slot.Address(), slot.Length()); } return slot; } } } Slot appendedSlot = AppendBytes(length); if (DTrace.enabled) { DTrace.GetSlot.LogLength(appendedSlot.Address(), appendedSlot.Length()); } return appendedSlot; } private bool GrowDatabaseByConfiguredSize() { int reservedStorageSpace = ConfigImpl.DatabaseGrowthSize(); if (reservedStorageSpace <= 0) { return false; } int reservedBlocks = _blockConverter.BytesToBlocks(reservedStorageSpace); int reservedBytes = _blockConverter.BlocksToBytes(reservedBlocks); Slot slot = new Slot(_blockEndAddress, reservedBlocks); if (Debug4.xbytes && Deploy.overwrite) { OverwriteDeletedBlockedSlot(slot); } else { WriteBytes(new ByteArrayBuffer(reservedBytes), _blockEndAddress, 0); } _freespaceManager.Free(_blockConverter.ToNonBlockedLength(slot)); _blockEndAddress += reservedBlocks; return true; } public Slot AppendBytes(long bytes) { int blockCount = _blockConverter.BytesToBlocks(bytes); int blockedStartAddress = _blockEndAddress; int blockedEndAddress = _blockEndAddress + blockCount; CheckBlockedAddress(blockedEndAddress); _blockEndAddress = blockedEndAddress; Slot slot = new Slot(blockedStartAddress, blockCount); if (Debug4.xbytes && Deploy.overwrite) { OverwriteDeletedBlockedSlot(slot); } return _blockConverter.ToNonBlockedLength(slot); } private void CheckBlockedAddress(int blockedAddress) { if (blockedAddress < 0) { SwitchToReadOnlyMode(); throw new DatabaseMaximumSizeReachedException(); } } private void SwitchToReadOnlyMode() { _config.ReadOnly(true); } // When a file gets opened, it uses the file size to determine where // new slots can be appended. If this method would not be called, the // freespace system could already contain a slot that points beyond // the end of the file and this space could be allocated and used twice, // for instance if a slot was allocated and freed without ever being // written to file. internal virtual void EnsureLastSlotWritten() { if (_blockEndAddress > _blockConverter.BytesToBlocks(FileLength())) { StatefulBuffer writer = CreateStatefulBuffer(SystemTransaction(), _blockEndAddress - 1, BlockSize()); writer.Write(); } } public override Db4oDatabase Identity() { return _systemData.Identity(); } public virtual void SetIdentity(Db4oDatabase identity) { lock (Lock()) { _systemData.Identity(identity); // The dirty TimeStampIdGenerator triggers writing of // the variable part of the systemdata. We need to // make it dirty here, so the new identity is persisted: _timeStampIdGenerator.Generate(); _fileHeader.WriteVariablePart(this); } } internal override bool IsServer() { return i_isServer; } public sealed override int IdForNewUserObject(Transaction trans) { return trans.IdSystem().NewId(SlotChangeFactory.UserObjects); } public override void RaiseCommitTimestamp(long minimumVersion) { lock (Lock()) { _timeStampIdGenerator.SetMinimumNext(minimumVersion); } } public override StatefulBuffer ReadStatefulBufferById(Transaction a_ta, int a_id) { return ReadStatefulBufferById(a_ta, a_id, false); } public override ByteArrayBuffer[] ReadSlotBuffers(Transaction transaction, int[] ids) { ByteArrayBuffer[] buffers = new ByteArrayBuffer[ids.Length]; for (int i = 0; i < ids.Length; ++i) { if (ids[i] == 0) { buffers[i] = null; } else { buffers[i] = ReadBufferById(transaction, ids[i]); } } return buffers; } public override ByteArrayBuffer ReadBufferById(Transaction trans, int id) { return ReadBufferById(trans, id, false); } public sealed override ByteArrayBuffer ReadBufferById(Transaction trans, int id, bool lastCommitted) { if (id <= 0) { throw new ArgumentException(); } Slot slot = lastCommitted ? trans.IdSystem().CommittedSlot(id) : trans.IdSystem() .CurrentSlot(id); if (DTrace.enabled) { DTrace.SlotRead.LogLength(id, slot); } return ReadBufferBySlot(slot); } public override StatefulBuffer ReadStatefulBufferById(Transaction trans, int id, bool lastCommitted) { if (id <= 0) { throw new ArgumentException(); } Slot slot = lastCommitted ? trans.IdSystem().CommittedSlot(id) : trans.IdSystem() .CurrentSlot(id); if (DTrace.enabled) { DTrace.SlotRead.LogLength(id, slot); } return ReadStatefulBufferBySlot(trans, id, slot); } public virtual ByteArrayBuffer ReadBufferBySlot(Slot slot) { if (Slot.IsNull(slot)) { return null; } if (DTrace.enabled) { DTrace.ReadSlot.LogLength(slot.Address(), slot.Length()); } ByteArrayBuffer buffer = new ByteArrayBuffer(slot.Length()); buffer.ReadEncrypt(this, slot.Address()); return buffer; } public virtual StatefulBuffer ReadStatefulBufferBySlot(Transaction trans, int id, Slot slot) { if (Slot.IsNull(slot)) { return null; } if (DTrace.enabled) { DTrace.ReadSlot.LogLength(slot.Address(), slot.Length()); } StatefulBuffer buffer = CreateStatefulBuffer(trans, slot.Address(), slot.Length() ); buffer.SetID(id); buffer.ReadEncrypt(this, slot.Address()); return buffer; } protected override bool DoFinalize() { return _fileHeader != null; } /// internal virtual void ReadThis() { NewSystemData(AbstractFreespaceManager.FmLegacyRam, StandardIdSystemFactory.Legacy ); BlockSizeReadFromFile(1); _fileHeader = FileHeader.Read(this); if (Config().GenerateCommitTimestamps().IsUnspecified()) { Config().GenerateCommitTimestamps(_systemData.IdToTimestampIndexId() != 0); } CreateStringIO(_systemData.StringEncoding()); CreateIdSystem(); InitializeClassMetadataRepository(); InitalizeWeakReferenceSupport(); SetNextTimeStampId(SystemData().LastTimeStampID()); ClassCollection().SetID(_systemData.ClassCollectionID()); ClassCollection().Read(SystemTransaction()); Converter.Convert(new ConversionStage.ClassCollectionAvailableStage(this)); _fileHeader.ReadIdentity(this); if (_config.IsReadOnly()) { return; } if (!ConfigImpl.CommitRecoveryDisabled()) { _fileHeader.CompleteInterruptedTransaction(this); } IFreespaceManager blockedFreespaceManager = AbstractFreespaceManager.CreateNew(this , _systemData.FreespaceSystem()); InstallFreespaceManager(blockedFreespaceManager); blockedFreespaceManager.Read(this, _systemData.InMemoryFreespaceSlot()); blockedFreespaceManager.Start(_systemData.BTreeFreespaceId()); _fileHeader = _fileHeader.Convert(this); if (FreespaceMigrationRequired(blockedFreespaceManager)) { MigrateFreespace(blockedFreespaceManager); } WriteHeader(true, false); if (Converter.Convert(new ConversionStage.SystemUpStage(this))) { _systemData.ConverterVersion(Converter.Version); _fileHeader.WriteVariablePart(this); Transaction.Commit(); } } private void InstallFreespaceManager(IFreespaceManager blockedFreespaceManager) { _freespaceManager = BlockSize() == 1 ? blockedFreespaceManager : new BlockAwareFreespaceManager (blockedFreespaceManager, _blockConverter); } protected virtual void CreateIdSystem() { _idSystem = StandardIdSystemFactory.NewInstance(this); } private bool FreespaceMigrationRequired(IFreespaceManager freespaceManager) { if (freespaceManager == null) { return false; } byte readSystem = _systemData.FreespaceSystem(); byte configuredSystem = ConfigImpl.FreespaceSystem(); if (freespaceManager.SystemType() == configuredSystem) { return false; } if (configuredSystem != 0) { return true; } return AbstractFreespaceManager.MigrationRequired(readSystem); } private void MigrateFreespace(IFreespaceManager oldFreespaceManager) { IFreespaceManager newFreespaceManager = AbstractFreespaceManager.CreateNew(this, ConfigImpl.FreespaceSystem()); newFreespaceManager.Start(0); SystemData().FreespaceSystem(ConfigImpl.FreespaceSystem()); InstallFreespaceManager(newFreespaceManager); AbstractFreespaceManager.Migrate(oldFreespaceManager, newFreespaceManager); _fileHeader.WriteVariablePart(this); } public sealed override void ReleaseSemaphore(string name) { ReleaseSemaphore(null, name); } public sealed override void ReleaseSemaphore(Transaction trans, string name) { lock (_lock) { if (_semaphores == null) { return; } } _semaphoresLock.Run(new _IClosure4_574(this, trans, name)); } private sealed class _IClosure4_574 : IClosure4 { public _IClosure4_574(LocalObjectContainer _enclosing, Transaction trans, string name) { this._enclosing = _enclosing; this.trans = trans; this.name = name; } public object Run() { Transaction transaction = this._enclosing.CheckTransaction(trans); if (this._enclosing._semaphores != null && transaction == this._enclosing._semaphores .Get(name)) { this._enclosing._semaphores.Remove(name); } this._enclosing._semaphoresLock.Awake(); return null; } private readonly LocalObjectContainer _enclosing; private readonly Transaction trans; private readonly string name; } public override void ReleaseSemaphores(Transaction trans) { if (_semaphores != null) { Hashtable4 semaphores = _semaphores; _semaphoresLock.Run(new _IClosure4_588(this, semaphores, trans)); } } private sealed class _IClosure4_588 : IClosure4 { public _IClosure4_588(LocalObjectContainer _enclosing, Hashtable4 semaphores, Transaction trans) { this._enclosing = _enclosing; this.semaphores = semaphores; this.trans = trans; } public object Run() { semaphores.ForEachKeyForIdentity(new _IVisitor4_589(semaphores), trans); this._enclosing._semaphoresLock.Awake(); return null; } private sealed class _IVisitor4_589 : IVisitor4 { public _IVisitor4_589(Hashtable4 semaphores) { this.semaphores = semaphores; } public void Visit(object a_object) { semaphores.Remove(a_object); } private readonly Hashtable4 semaphores; } private readonly LocalObjectContainer _enclosing; private readonly Hashtable4 semaphores; private readonly Transaction trans; } public sealed override void Rollback1(Transaction trans) { trans.Rollback(); } public sealed override void SetDirtyInSystemTransaction(PersistentBase a_object) { a_object.SetStateDirty(); a_object.CacheDirty(_dirtyClassMetadata); } public sealed override bool SetSemaphore(string name, int timeout) { return SetSemaphore(null, name, timeout); } public sealed override bool SetSemaphore(Transaction trans, string name, int timeout ) { if (name == null) { throw new ArgumentNullException(); } lock (_lock) { if (_semaphores == null) { _semaphores = new Hashtable4(10); } } BooleanByRef acquired = new BooleanByRef(); _semaphoresLock.Run(new _IClosure4_625(this, trans, name, acquired, timeout)); return acquired.value; } private sealed class _IClosure4_625 : IClosure4 { public _IClosure4_625(LocalObjectContainer _enclosing, Transaction trans, string name, BooleanByRef acquired, int timeout) { this._enclosing = _enclosing; this.trans = trans; this.name = name; this.acquired = acquired; this.timeout = timeout; } public object Run() { try { Transaction transaction = this._enclosing.CheckTransaction(trans); object candidateTransaction = this._enclosing._semaphores.Get(name); if (trans == candidateTransaction) { acquired.value = true; return null; } if (candidateTransaction == null) { this._enclosing._semaphores.Put(name, transaction); acquired.value = true; return null; } long endtime = Runtime.CurrentTimeMillis() + timeout; long waitTime = timeout; while (waitTime > 0) { this._enclosing._semaphoresLock.Awake(); this._enclosing._semaphoresLock.Snooze(waitTime); if (this._enclosing.ClassCollection() == null) { acquired.value = false; return null; } candidateTransaction = this._enclosing._semaphores.Get(name); if (candidateTransaction == null) { this._enclosing._semaphores.Put(name, transaction); acquired.value = true; return null; } waitTime = endtime - Runtime.CurrentTimeMillis(); } acquired.value = false; return null; } finally { this._enclosing._semaphoresLock.Awake(); } } private readonly LocalObjectContainer _enclosing; private readonly Transaction trans; private readonly string name; private readonly BooleanByRef acquired; private readonly int timeout; } public virtual void SetServer(bool flag) { i_isServer = flag; } public abstract void SyncFiles(); public abstract void SyncFiles(IRunnable runnable); protected override string DefaultToString() { return FileName(); } public override void Shutdown() { WriteHeader(false, true); } public void CommitTransaction() { _transaction.Commit(); } public abstract void WriteBytes(ByteArrayBuffer buffer, int blockedAddress, int addressOffset ); public sealed override void WriteDirtyClassMetadata() { WriteCachedDirty(); } private void WriteCachedDirty() { IEnumerator i = _dirtyClassMetadata.GetEnumerator(); while (i.MoveNext()) { PersistentBase dirty = (PersistentBase)i.Current; dirty.Write(SystemTransaction()); dirty.NotCachedDirty(); } _dirtyClassMetadata.Clear(); } public void WriteEncrypt(ByteArrayBuffer buffer, int address, int addressOffset) { _handlers.Encrypt(buffer); WriteBytes(buffer, address, addressOffset); _handlers.Decrypt(buffer); } public virtual void WriteHeader(bool startFileLockingThread, bool shuttingDown) { if (shuttingDown) { _freespaceManager.Write(this); _freespaceManager = null; } StatefulBuffer writer = CreateStatefulBuffer(SystemTransaction(), 0, _fileHeader. Length()); _fileHeader.WriteFixedPart(this, startFileLockingThread, shuttingDown, writer, BlockSize ()); if (shuttingDown) { EnsureLastSlotWritten(); } SyncFiles(); } public sealed override void WriteNew(Transaction trans, Pointer4 pointer, ClassMetadata classMetadata, ByteArrayBuffer buffer) { WriteEncrypt(buffer, pointer.Address(), 0); if (classMetadata == null) { return; } classMetadata.AddToIndex(trans, pointer.Id()); } // This is a reroute of writeBytes to write the free blocks // unchecked. public abstract void OverwriteDeletedBytes(int address, int length); public virtual void OverwriteDeletedBlockedSlot(Slot slot) { OverwriteDeletedBytes(slot.Address(), _blockConverter.BlocksToBytes(slot.Length() )); } public void WriteTransactionPointer(int pointer) { _fileHeader.WriteTransactionPointer(SystemTransaction(), pointer); } public Slot AllocateSlotForUserObjectUpdate(Transaction trans, int id, int length ) { Slot slot = AllocateSlot(length); trans.IdSystem().NotifySlotUpdated(id, slot, SlotChangeFactory.UserObjects); return slot; } public Slot AllocateSlotForNewUserObject(Transaction trans, int id, int length) { Slot slot = AllocateSlot(length); trans.IdSystem().NotifySlotCreated(id, slot, SlotChangeFactory.UserObjects); return slot; } public sealed override void WriteUpdate(Transaction trans, Pointer4 pointer, ClassMetadata classMetadata, ArrayType arrayType, ByteArrayBuffer buffer) { int address = pointer.Address(); if (address == 0) { address = AllocateSlotForUserObjectUpdate(trans, pointer.Id(), pointer.Length()). Address(); } WriteEncrypt(buffer, address, 0); } public virtual void SetNextTimeStampId(long val) { _timeStampIdGenerator.SetMinimumNext(val); } public override ISystemInfo SystemInfo() { return new SystemInfoFileImpl(this); } public virtual FileHeader GetFileHeader() { return _fileHeader; } public virtual void InstallDebugFreespaceManager(IFreespaceManager manager) { _freespaceManager = manager; } public virtual Db4objects.Db4o.Internal.SystemData SystemData() { return _systemData; } public override long[] GetIDsForClass(Transaction trans, ClassMetadata clazz) { IntArrayList ids = new IntArrayList(); clazz.Index().TraverseAll(trans, new _IVisitor4_792(ids)); return ids.AsLong(); } private sealed class _IVisitor4_792 : IVisitor4 { public _IVisitor4_792(IntArrayList ids) { this.ids = ids; } public void Visit(object obj) { ids.Add(((int)obj)); } private readonly IntArrayList ids; } public override IQueryResult ClassOnlyQuery(QQueryBase query, ClassMetadata clazz ) { if (!clazz.HasClassIndex()) { return new IdListQueryResult(query.Transaction()); } AbstractQueryResult queryResult = NewQueryResult(query.Transaction()); queryResult.LoadFromClassIndex(clazz); return queryResult; } public override IQueryResult ExecuteQuery(QQuery query) { AbstractQueryResult queryResult = NewQueryResult(query.Transaction()); queryResult.LoadFromQuery(query); return queryResult; } public virtual LocalTransaction LocalSystemTransaction() { return (LocalTransaction)SystemTransaction(); } public override int InstanceCount(ClassMetadata clazz, Transaction trans) { lock (Lock()) { return clazz.IndexEntryCount(trans); } } public override IObjectContainer OpenSession() { lock (Lock()) { return new ObjectContainerSession(this); } } public override bool IsDeleted(Transaction trans, int id) { return trans.IdSystem().IsDeleted(id); } public virtual void WritePointer(int id, Slot slot) { if (DTrace.enabled) { DTrace.WritePointer.Log(id); DTrace.WritePointer.LogLength(slot); } _pointerIo.Seek(0); _pointerIo.WriteInt(slot.Address()); _pointerIo.WriteInt(slot.Length()); WriteBytes(_pointerIo, id, 0); } public virtual Slot DebugReadPointerSlot(int id) { return null; } public Slot ReadPointerSlot(int id) { if (!IsValidId(id)) { throw new InvalidIDException(id); } ReadBytes(_pointerBuffer, id, Const4.PointerLength); int address = (_pointerBuffer[3] & 255) | (_pointerBuffer[2] & 255) << 8 | (_pointerBuffer [1] & 255) << 16 | _pointerBuffer[0] << 24; int length = (_pointerBuffer[7] & 255) | (_pointerBuffer[6] & 255) << 8 | (_pointerBuffer [5] & 255) << 16 | _pointerBuffer[4] << 24; if (!IsValidSlot(address, length)) { throw new InvalidSlotException(address, length, id); } return new Slot(address, length); } private bool IsValidId(int id) { return FileLength() >= id; } private bool IsValidSlot(int address, int length) { // just in case overflow long fileLength = FileLength(); bool validAddress = fileLength >= address; bool validLength = fileLength >= length; bool validSlot = fileLength >= (address + length); return validAddress && validLength && validSlot; } protected override void CloseIdSystem() { if (_idSystem != null) { _idSystem.Close(); } } public virtual IIdSystem IdSystem() { return _idSystem; } public virtual IRunnable CommitHook() { _systemData.LastTimeStampID(_timeStampIdGenerator.Last()); return _fileHeader.Commit(false); } public Slot AllocateSafeSlot(int length) { Slot reusedSlot = FreespaceManager().AllocateSafeSlot(length); if (reusedSlot != null) { return reusedSlot; } return AppendBytes(length); } public override EventRegistryImpl NewEventRegistry() { return new EventRegistryImpl(); } public virtual IQLin From(Type clazz) { return new QLinRoot(Query(), clazz); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ObjectTypeMetadata.cs0000644000175000017500000000125211700531646030723 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { public class ObjectTypeMetadata : PrimitiveTypeMetadata { public ObjectTypeMetadata(ObjectContainerBase container, ITypeHandler4 handler, int id, IReflectClass classReflector) : base(container, handler, id, classReflector ) { } public override object Instantiate(UnmarshallingContext context) { object @object = new object(); OnInstantiate(context, @object); return @object; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/PersistentBase.cs0000644000175000017500000000776511700531646030164 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal { /// public abstract class PersistentBase : Identifiable, IPersistent, ILinkLengthAware { internal virtual void CacheDirty(Collection4 col) { if (!BitIsTrue(Const4.CachedDirty)) { BitTrue(Const4.CachedDirty); col.Add(this); } } public virtual void Free(LocalTransaction trans) { IdSystem(trans.SystemTransaction()).NotifySlotDeleted(GetID(), SlotChangeFactory( )); } public int LinkLength() { return Const4.IdLength; } internal void NotCachedDirty() { BitFalse(Const4.CachedDirty); } public virtual void Read(Transaction trans) { if (!BeginProcessing()) { return; } try { Read(trans, ProduceReadBuffer(trans)); } finally { EndProcessing(); } } protected virtual void Read(Transaction trans, ByteArrayBuffer reader) { ReadThis(trans, reader); SetStateOnRead(reader); } protected ByteArrayBuffer ProduceReadBuffer(Transaction trans) { return ReadBufferById(trans); } protected virtual ByteArrayBuffer ReadBufferById(Transaction trans) { return trans.Container().ReadBufferById(trans, GetID()); } internal virtual void SetStateOnRead(ByteArrayBuffer reader) { if (BitIsTrue(Const4.CachedDirty)) { SetStateDirty(); } else { SetStateClean(); } } public virtual void Write(Transaction trans) { if (!WriteObjectBegin()) { return; } try { LocalObjectContainer container = (LocalObjectContainer)trans.Container(); if (DTrace.enabled) { DTrace.PersistentOwnLength.Log(GetID()); } int length = OwnLength(); length = container.BlockConverter().BlockAlignedBytes(length); Slot slot = container.AllocateSlot(length); if (IsNew()) { SetID(IdSystem(trans).NewId(SlotChangeFactory())); IdSystem(trans).NotifySlotCreated(_id, slot, SlotChangeFactory()); } else { IdSystem(trans).NotifySlotUpdated(_id, slot, SlotChangeFactory()); } if (DTrace.enabled) { DTrace.PersistentBaseNewSlot.LogLength(GetID(), slot); } ByteArrayBuffer writer = ProduceWriteBuffer(trans, length); WriteToFile(trans, writer, slot); } finally { EndProcessing(); } } public virtual ITransactionalIdSystem IdSystem(Transaction trans) { return trans.IdSystem(); } protected virtual ByteArrayBuffer ProduceWriteBuffer(Transaction trans, int length ) { return NewWriteBuffer(length); } protected virtual ByteArrayBuffer NewWriteBuffer(int length) { return new ByteArrayBuffer(length); } private void WriteToFile(Transaction trans, ByteArrayBuffer writer, Slot slot) { if (DTrace.enabled) { DTrace.PersistentbaseWrite.Log(GetID()); } LocalObjectContainer container = (LocalObjectContainer)trans.Container(); WriteThis(trans, writer); container.WriteEncrypt(writer, slot.Address(), 0); if (IsActive()) { SetStateClean(); } } public virtual bool WriteObjectBegin() { if (IsDirty()) { return BeginProcessing(); } return false; } public virtual void WriteOwnID(Transaction trans, ByteArrayBuffer writer) { Write(trans); writer.WriteInt(GetID()); } public virtual Db4objects.Db4o.Internal.Slots.SlotChangeFactory SlotChangeFactory () { return Db4objects.Db4o.Internal.Slots.SlotChangeFactory.SystemObjects; } public abstract byte GetIdentifier(); public abstract int OwnLength(); public abstract void ReadThis(Transaction arg1, ByteArrayBuffer arg2); public abstract void WriteThis(Transaction arg1, ByteArrayBuffer arg2); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ObjectContainerBase.cs0000644000175000017500000021475611700531646031075 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Callbacks; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Events; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Metadata; using Db4objects.Db4o.Internal.Query; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Query.Result; using Db4objects.Db4o.Internal.References; using Db4objects.Db4o.Internal.Replication; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Internal.Threading; using Db4objects.Db4o.Internal.Weakref; using Db4objects.Db4o.Query; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Core; using Db4objects.Db4o.Reflect.Generic; using Db4objects.Db4o.Typehandlers; using Db4objects.Db4o.Types; using Sharpen; using Sharpen.Lang; namespace Db4objects.Db4o.Internal { /// public abstract partial class ObjectContainerBase : System.IDisposable, ITransientClass , IInternal4, IObjectContainerSpec, IInternalObjectContainer { protected ClassMetadataRepository _classCollection; protected Config4Impl _config; private int _stackDepth; private readonly int _maxStackDepth; private readonly Db4objects.Db4o.Internal.References.ReferenceSystemRegistry _referenceSystemRegistry = new Db4objects.Db4o.Internal.References.ReferenceSystemRegistry(); private Tree _justPeeked; protected object _lock; private List4 _pendingClassUpdates; internal int _showInternalClasses = 0; private List4 _stillToActivate; private List4 _stillToDeactivate; private List4 _stillToSet; private bool _handlingStackLimitPendings = false; private Db4objects.Db4o.Internal.Transaction _systemTransaction; protected Db4objects.Db4o.Internal.Transaction _transaction; public HandlerRegistry _handlers; internal int _replicationCallState; internal IWeakReferenceSupport _references; private NativeQueryHandler _nativeQueryHandler; private ICallbacks _callbacks = new NullCallbacks(); protected readonly TimeStampIdGenerator _timeStampIdGenerator = new TimeStampIdGenerator (); private int _topLevelCallId = 1; private IntIdGenerator _topLevelCallIdGenerator = new IntIdGenerator(); private readonly IEnvironment _environment; private IReferenceSystemFactory _referenceSystemFactory; private string _name; protected IBlockConverter _blockConverter = new DisabledBlockConverter(); protected ObjectContainerBase(IConfiguration config) { // Collection of all classes // if (_classCollection == null) the engine is down. // the Configuration context for this ObjectContainer // Counts the number of toplevel calls into YapStream // currently used to resolve self-linking concurrency problems // in cylic links, stores only ClassMetadata objects // a value greater than 0 indicates class implementing the // "Internal" interface are visible in queries and can // be used. // used for ClassMetadata and ClassMetadataRepository // may be parent or equal to i_trans // used for Objects // all the per-YapStream references that we don't // want created in YapobjectCarrier // One of three constants in ReplicationHandler: NONE, OLD, NEW // Detailed replication variables are stored in i_handlers. // Call state has to be maintained here, so YapObjectCarrier (who shares i_handlers) does // not accidentally think it operates in a replication call. // weak reference management _lock = new object(); _config = (Config4Impl)config; _environment = CreateEnvironment(_config); _maxStackDepth = _config.MaxStackDepth(); } private IEnvironment CreateEnvironment(Config4Impl config) { ArrayList bindings = new ArrayList(); Sharpen.Collections.AddAll(bindings, config.EnvironmentContributions()); bindings.Add(this); // my(ObjectContainer.class) bindings.Add(config); // my(Configuration.class) return Environments.NewConventionBasedEnvironment(Sharpen.Collections.ToArray(bindings )); } protected virtual IEnvironment Environment() { return _environment; } /// protected void Open() { WithEnvironment(new _IRunnable_129(this)); } private sealed class _IRunnable_129 : IRunnable { public _IRunnable_129(ObjectContainerBase _enclosing) { this._enclosing = _enclosing; } public void Run() { bool ok = false; lock (this._enclosing._lock) { try { this._enclosing._name = this._enclosing.ConfigImpl.NameProvider().Name(this._enclosing ); this._enclosing.InitializeReferenceSystemFactory(this._enclosing._config); this._enclosing.InitializeTransactions(); this._enclosing.Initialize1(this._enclosing._config); this._enclosing.OpenImpl(); this._enclosing.InitializePostOpen(); this._enclosing.Callbacks().OpenOnFinished(this._enclosing); ok = true; } finally { if (!ok) { // TODO: This will swallow the causing exception if // an exception occurs during shutdown. this._enclosing.ShutdownObjectContainer(); } } } } private readonly ObjectContainerBase _enclosing; } private void InitializeReferenceSystemFactory(Config4Impl config) { _referenceSystemFactory = config.ReferenceSystemFactory(); } public virtual void WithEnvironment(IRunnable runnable) { Environments.RunWith(_environment, runnable); } /// protected abstract void OpenImpl(); public virtual IActivationDepth DefaultActivationDepth(ClassMetadata classMetadata ) { return ActivationDepthProvider().ActivationDepthFor(classMetadata, ActivationMode .Activate); } public virtual IActivationDepthProvider ActivationDepthProvider() { return ConfigImpl.ActivationDepthProvider(); } public void Activate(Db4objects.Db4o.Internal.Transaction trans, object obj) { lock (_lock) { Activate(trans, obj, DefaultActivationDepthForObject(obj)); } } public void Deactivate(Db4objects.Db4o.Internal.Transaction trans, object obj) { Deactivate(trans, obj, 1); } private IActivationDepth DefaultActivationDepthForObject(object obj) { ClassMetadata classMetadata = ClassMetadataForObject(obj); return DefaultActivationDepth(classMetadata); } public void Activate(Db4objects.Db4o.Internal.Transaction trans, object obj, IActivationDepth depth) { lock (_lock) { AsTopLevelCall(new _IFunction4_189(this, obj, depth), trans); } } private sealed class _IFunction4_189 : IFunction4 { public _IFunction4_189(ObjectContainerBase _enclosing, object obj, IActivationDepth depth) { this._enclosing = _enclosing; this.obj = obj; this.depth = depth; } public object Apply(object trans) { this._enclosing.StillToActivate(this._enclosing.ActivationContextFor(((Db4objects.Db4o.Internal.Transaction )trans), obj, depth)); this._enclosing.ActivatePending(((Db4objects.Db4o.Internal.Transaction)trans)); return null; } private readonly ObjectContainerBase _enclosing; private readonly object obj; private readonly IActivationDepth depth; } internal sealed class PendingActivation { public readonly ObjectReference @ref; public readonly IActivationDepth depth; public PendingActivation(ObjectReference ref_, IActivationDepth depth_) { this.@ref = ref_; this.depth = depth_; } } internal void ActivatePending(Transaction ta) { while (_stillToActivate != null) { // TODO: Optimize! A lightweight int array would be faster. IEnumerator i = new Iterator4Impl(_stillToActivate); _stillToActivate = null; while (i.MoveNext()) { ObjectContainerBase.PendingActivation item = (ObjectContainerBase.PendingActivation )i.Current; ObjectReference @ref = item.@ref; object obj = @ref.GetObject(); if (obj == null) { ta.RemoveReference(@ref); } else { @ref.ActivateInternal(ActivationContextFor(ta, obj, item.depth)); } } } } /// /// public virtual void Backup(string path) { Backup(ConfigImpl.Storage, path); } public virtual ActivationContext4 ActivationContextFor(Transaction ta, object obj , IActivationDepth depth) { return new ActivationContext4(ta, obj, depth); } /// /// public void Bind(Transaction trans, object obj, long id) { lock (_lock) { if (obj == null) { throw new ArgumentNullException(); } if (DTrace.enabled) { DTrace.Bind.Log(id, " ihc " + Runtime.IdentityHashCode(obj)); } trans = CheckTransaction(trans); int intID = (int)id; object oldObject = GetByID(trans, id); if (oldObject == null) { throw new ArgumentException("id"); } ObjectReference @ref = trans.ReferenceForId(intID); if (@ref == null) { throw new ArgumentException("obj"); } if (ReflectorForObject(obj) == @ref.ClassMetadata().ClassReflector()) { ObjectReference newRef = Bind2(trans, @ref, obj); newRef.VirtualAttributes(trans, false); } else { throw new Db4oException(Db4objects.Db4o.Internal.Messages.Get(57)); } } } public ObjectReference Bind2(Transaction trans, ObjectReference oldRef, object obj ) { int id = oldRef.GetID(); trans.RemoveReference(oldRef); ObjectReference newRef = new ObjectReference(ClassMetadataForObject(obj), id); newRef.SetObjectWeak(this, obj); newRef.SetStateDirty(); trans.ReferenceSystem().AddExistingReference(newRef); return newRef; } public virtual ClassMetadata ClassMetadataForObject(object obj) { return ProduceClassMetadata(ReflectorForObject(obj)); } public abstract byte BlockSize(); private bool BreakDeleteForEnum(ObjectReference reference, bool userCall) { return false; if (userCall) { return false; } if (reference == null) { return false; } return Platform4.IsEnum(Reflector(), reference.ClassMetadata().ClassReflector()); } internal virtual bool CanUpdate() { return true; } /// public void CheckClosed() { if (_classCollection == null) { throw new DatabaseClosedException(); } } /// protected void CheckReadOnly() { if (_config.IsReadOnly()) { throw new DatabaseReadOnlyException(); } } internal void ProcessPendingClassUpdates() { if (_pendingClassUpdates == null) { return; } IEnumerator i = new Iterator4Impl(_pendingClassUpdates); while (i.MoveNext()) { ClassMetadata classMetadata = (ClassMetadata)i.Current; classMetadata.SetStateDirty(); classMetadata.Write(_systemTransaction); } _pendingClassUpdates = null; } public Transaction CheckTransaction() { return CheckTransaction(null); } public Transaction CheckTransaction(Transaction ta) { CheckClosed(); if (ta != null) { return ta; } return Transaction; } public bool Close() { lock (_lock) { Callbacks().CloseOnStarted(this); if (DTrace.enabled) { DTrace.CloseCalled.Log(this.ToString()); } Close1(); return true; } } protected virtual void HandleExceptionOnClose(Exception exc) { FatalException(exc); } private void Close1() { if (IsClosed()) { return; } ProcessPendingClassUpdates(); if (StateMessages()) { LogMsg(2, ToString()); } Close2(); } protected abstract void Close2(); public void ShutdownObjectContainer() { if (DTrace.enabled) { DTrace.Close.Log(); } LogMsg(3, ToString()); lock (_lock) { CloseUserTransaction(); CloseSystemTransaction(); CloseIdSystem(); StopSession(); ShutdownDataStorage(); } } protected abstract void CloseIdSystem(); protected void CloseUserTransaction() { CloseTransaction(_transaction, false, false); } protected void CloseSystemTransaction() { CloseTransaction(_systemTransaction, true, false); } public abstract void CloseTransaction(Transaction transaction, bool isSystemTransaction , bool rollbackOnClose); protected abstract void ShutdownDataStorage(); /// /// public void Commit(Transaction trans) { lock (_lock) { if (DTrace.enabled) { DTrace.Commit.Log(); } CheckReadOnly(); AsTopLevelCall(new _IFunction4_399(this), trans); } } private sealed class _IFunction4_399 : IFunction4 { public _IFunction4_399(ObjectContainerBase _enclosing) { this._enclosing = _enclosing; } public object Apply(object trans) { this._enclosing.Commit1(((Transaction)trans)); ((Transaction)trans).CommitReferenceSystem(); return null; } private readonly ObjectContainerBase _enclosing; } private object AsTopLevelStore(IFunction4 block, Transaction trans) { trans = CheckTransaction(trans); object result = AsTopLevelCall(block, trans); if (_stackDepth == 0) { trans.ProcessDeletes(); } return result; } // should never happen - just to make compiler happy public virtual void FatalShutdown(Exception origExc) { try { StopSession(); FatalStorageShutdown(); } catch (Exception exc) { throw new CompositeDb4oException(new Exception[] { origExc, exc }); } Platform4.ThrowUncheckedException(origExc); } protected abstract void FatalStorageShutdown(); public abstract void Commit1(Transaction trans); public virtual IConfiguration Configure() { return ConfigImpl; } public virtual Config4Impl Config() { return ConfigImpl; } public abstract int ConverterVersion(); public abstract AbstractQueryResult NewQueryResult(Transaction trans, QueryEvaluationMode mode); protected void CreateStringIO(byte encoding) { StringIO(BuiltInStringEncoding.StringIoForEncoding(encoding, ConfigImpl.StringEncoding ())); } protected void InitializeTransactions() { _systemTransaction = NewSystemTransaction(); _transaction = NewUserTransaction(); } public abstract Transaction NewTransaction(Transaction parentTransaction, IReferenceSystem referenceSystem, bool isSystemTransaction); public virtual Transaction NewUserTransaction() { return NewTransaction(SystemTransaction(), CreateReferenceSystem(), false); } public virtual Transaction NewSystemTransaction() { return NewTransaction(null, CreateReferenceSystem(), true); } public abstract long CurrentVersion(); public virtual bool CreateClassMetadata(ClassMetadata classMeta, IReflectClass clazz , ClassMetadata superClassMeta) { return classMeta.Init(superClassMeta); } /// allows special handling for all Db4oType objects. /// /// allows special handling for all Db4oType objects. /// Redirected here from #set() so only instanceof check is necessary /// in the #set() method. /// /// object if handled here and #set() should not continue processing public virtual IDb4oType Db4oTypeStored(Transaction trans, object obj) { if (!(obj is Db4oDatabase)) { return null; } Db4oDatabase database = (Db4oDatabase)obj; if (trans.ReferenceForObject(obj) != null) { return database; } ShowInternalClasses(true); try { return database.Query(trans); } finally { ShowInternalClasses(false); } } /// public void Deactivate(Transaction trans, object obj, int depth) { lock (_lock) { AsTopLevelCall(new _IFunction4_516(this, obj, depth), trans); } } private sealed class _IFunction4_516 : IFunction4 { public _IFunction4_516(ObjectContainerBase _enclosing, object obj, int depth) { this._enclosing = _enclosing; this.obj = obj; this.depth = depth; } public object Apply(object trans) { this._enclosing.DeactivateInternal(((Transaction)trans), obj, this._enclosing.ActivationDepthProvider ().ActivationDepth(depth, ActivationMode.Deactivate)); return null; } private readonly ObjectContainerBase _enclosing; private readonly object obj; private readonly int depth; } private void DeactivateInternal(Transaction trans, object obj, IActivationDepth depth ) { StillToDeactivate(trans, obj, depth, true); DeactivatePending(trans); } private void DeactivatePending(Transaction trans) { while (_stillToDeactivate != null) { IEnumerator i = new Iterator4Impl(_stillToDeactivate); _stillToDeactivate = null; while (i.MoveNext()) { ObjectContainerBase.PendingActivation item = (ObjectContainerBase.PendingActivation )i.Current; item.@ref.Deactivate(trans, item.depth); } } } /// /// public void Delete(Transaction trans, object obj) { if (null == obj) { throw new ArgumentNullException(); } lock (Lock()) { trans = CheckTransaction(trans); CheckReadOnly(); Delete1(trans, obj, true); UnregisterFromTransparentPersistence(trans, obj); trans.ProcessDeletes(); } } public void Delete1(Transaction trans, object obj, bool userCall) { if (obj == null) { return; } ObjectReference @ref = trans.ReferenceForObject(obj); if (@ref == null) { return; } if (userCall) { GenerateCallIDOnTopLevel(); } AsTopLevelCall(new _IFunction4_565(this, @ref, obj, userCall), trans); } private sealed class _IFunction4_565 : IFunction4 { public _IFunction4_565(ObjectContainerBase _enclosing, ObjectReference @ref, object obj, bool userCall) { this._enclosing = _enclosing; this.@ref = @ref; this.obj = obj; this.userCall = userCall; } public object Apply(object trans) { this._enclosing.Delete2(((Transaction)trans), @ref, obj, 0, userCall); return null; } private readonly ObjectContainerBase _enclosing; private readonly ObjectReference @ref; private readonly object obj; private readonly bool userCall; } public void Delete2(Transaction trans, ObjectReference @ref, object obj, int cascade , bool userCall) { // This check is performed twice, here and in delete3, intentionally. if (BreakDeleteForEnum(@ref, userCall)) { return; } if (obj is Entry) { if (!FlagForDelete(@ref)) { return; } Delete3(trans, @ref, obj, cascade, userCall); return; } trans.Delete(@ref, @ref.GetID(), cascade); } internal void Delete3(Transaction trans, ObjectReference @ref, object obj, int cascade , bool userCall) { // The passed reference can be null, when calling from Transaction. if (@ref == null || !@ref.BeginProcessing()) { return; } // This check is performed twice, here and in delete2, intentionally. if (BreakDeleteForEnum(@ref, userCall)) { @ref.EndProcessing(); return; } if (!@ref.IsFlaggedForDelete()) { @ref.EndProcessing(); return; } ClassMetadata yc = @ref.ClassMetadata(); // We have to end processing temporarily here, otherwise the can delete callback // can't do anything at all with this object. @ref.EndProcessing(); ActivateForDeletionCallback(trans, yc, @ref, obj); if (!ObjectCanDelete(trans, yc, @ref)) { return; } @ref.BeginProcessing(); if (DTrace.enabled) { DTrace.Delete.Log(@ref.GetID()); } if (Delete4(trans, @ref, obj, cascade, userCall)) { ObjectOnDelete(trans, yc, @ref); if (ConfigImpl.MessageLevel() > Const4.State) { Message(string.Empty + @ref.GetID() + " delete " + @ref.ClassMetadata().GetName() ); } } @ref.EndProcessing(); } private void UnregisterFromTransparentPersistence(Transaction trans, object obj) { if (!(ActivationDepthProvider() is ITransparentActivationDepthProvider)) { return; } ITransparentActivationDepthProvider provider = (ITransparentActivationDepthProvider )ActivationDepthProvider(); provider.RemoveModified(obj, trans); } private void ActivateForDeletionCallback(Transaction trans, ClassMetadata classMetadata , ObjectReference @ref, object obj) { if (!@ref.IsActive() && (CaresAboutDeleting(classMetadata) || CaresAboutDeleted(classMetadata ))) { // Activate Objects for Callbacks, because in C/S mode Objects are not activated on the Server // FIXME: [TA] review activation depth IActivationDepth depth = classMetadata.AdjustCollectionDepthToBorders(new FixedActivationDepth (1)); Activate(trans, obj, depth); } } private bool CaresAboutDeleting(ClassMetadata yc) { return this._callbacks.CaresAboutDeleting() || yc.HasEventRegistered(SystemTransaction (), EventDispatchers.CanDelete); } private bool CaresAboutDeleted(ClassMetadata yc) { return this._callbacks.CaresAboutDeleted() || yc.HasEventRegistered(SystemTransaction (), EventDispatchers.Delete); } private bool ObjectCanDelete(Transaction transaction, ClassMetadata yc, IObjectInfo objectInfo) { return Callbacks().ObjectCanDelete(transaction, objectInfo) && yc.DispatchEvent(transaction , objectInfo.GetObject(), EventDispatchers.CanDelete); } private void ObjectOnDelete(Transaction transaction, ClassMetadata yc, IObjectInfo reference) { Callbacks().ObjectOnDelete(transaction, reference); yc.DispatchEvent(transaction, reference.GetObject(), EventDispatchers.Delete); } public abstract bool Delete4(Transaction ta, ObjectReference @ref, object obj, int a_cascade, bool userCall); internal virtual object Descend(Transaction trans, object obj, string[] path) { lock (_lock) { trans = CheckTransaction(trans); ObjectReference @ref = trans.ReferenceForObject(obj); if (@ref == null) { return null; } string fieldName = path[0]; if (fieldName == null) { return null; } ClassMetadata classMetadata = @ref.ClassMetadata(); ByRef foundField = new ByRef(); classMetadata.TraverseAllAspects(new _TraverseFieldCommand_693(fieldName, foundField )); FieldMetadata field = (FieldMetadata)foundField.value; if (field == null) { return null; } object child = @ref.IsActive() ? field.Get(trans, obj) : DescendMarshallingContext (trans, @ref).ReadFieldValue(field); if (path.Length == 1) { return child; } if (child == null) { return null; } string[] subPath = new string[path.Length - 1]; System.Array.Copy(path, 1, subPath, 0, path.Length - 1); return Descend(trans, child, subPath); } } private sealed class _TraverseFieldCommand_693 : TraverseFieldCommand { public _TraverseFieldCommand_693(string fieldName, ByRef foundField) { this.fieldName = fieldName; this.foundField = foundField; } protected override void Process(FieldMetadata field) { if (field.CanAddToQuery(fieldName)) { foundField.value = field; } } private readonly string fieldName; private readonly ByRef foundField; } private UnmarshallingContext DescendMarshallingContext(Transaction trans, ObjectReference @ref) { UnmarshallingContext context = new UnmarshallingContext(trans, @ref, Const4.AddToIdTree , false); context.ActivationDepth(ActivationDepthProvider().ActivationDepth(1, ActivationMode .Activate)); return context; } public virtual bool DetectSchemaChanges() { // overriden in YapClient return ConfigImpl.DetectSchemaChanges(); } public virtual bool DispatchsEvents() { return true; } protected virtual bool DoFinalize() { return true; } internal void ShutdownHook() { if (IsClosed()) { return; } if (AllOperationsCompleted()) { Db4objects.Db4o.Internal.Messages.LogErr(ConfigImpl, 50, ToString(), null); Close(); } else { ShutdownObjectContainer(); if (OperationIsProcessing()) { Db4objects.Db4o.Internal.Messages.LogErr(ConfigImpl, 24, null, null); } } } private bool OperationIsProcessing() { return _stackDepth > 0; } private bool AllOperationsCompleted() { return _stackDepth == 0; } internal virtual void FatalException(int msgID) { FatalException(null, msgID); } internal void FatalException(Exception t) { FatalException(t, Db4objects.Db4o.Internal.Messages.FatalMsgId); } internal void FatalException(Exception t, int msgID) { if (DTrace.enabled) { DTrace.FatalException.Log(t.ToString()); } Db4objects.Db4o.Internal.Messages.LogErr(ConfigImpl, (msgID == Db4objects.Db4o.Internal.Messages .FatalMsgId ? 18 : msgID), null, t); if (!IsClosed()) { ShutdownObjectContainer(); } throw new Db4oException(Db4objects.Db4o.Internal.Messages.Get(msgID)); } private bool ConfiguredForAutomaticShutDown() { return (ConfigImpl == null || ConfigImpl.AutomaticShutDown()); } internal virtual void Gc() { _references.Purge(); } public IObjectSet QueryByExample(Transaction trans, object template) { lock (_lock) { trans = CheckTransaction(trans); IQueryResult res = ((IQueryResult)AsTopLevelCall(new _IFunction4_810(this, template ), trans)); return new ObjectSetFacade(res); } } private sealed class _IFunction4_810 : IFunction4 { public _IFunction4_810(ObjectContainerBase _enclosing, object template) { this._enclosing = _enclosing; this.template = template; } public object Apply(object trans) { return this._enclosing.QueryByExampleInternal(((Transaction)trans), template); } private readonly ObjectContainerBase _enclosing; private readonly object template; } private IQueryResult QueryByExampleInternal(Transaction trans, object template) { if (template == null || template.GetType() == Const4.ClassObject || template == Const4 .ClassObject) { return QueryAllObjects(trans); } IQuery q = Query(trans); q.Constrain(template).ByExample(); return ExecuteQuery((QQuery)q); } public abstract AbstractQueryResult QueryAllObjects(Transaction ta); /// public object TryGetByID(Transaction ta, long id) { try { return GetByID(ta, id); } catch (InvalidSlotException) { } catch (InvalidIDException) { } // can happen return null // can happen return null return null; } /// /// public object GetByID(Transaction ta, long id) { lock (_lock) { if (id <= 0 || id >= int.MaxValue) { throw new ArgumentException(); } CheckClosed(); ta = CheckTransaction(ta); BeginTopLevelCall(); try { return GetByID2(ta, (int)id); } catch (Db4oRecoverableException exc) { throw; } catch (OutOfMemoryException e) { throw new Db4oRecoverableException(e); } catch (Exception e) { throw new Db4oRecoverableException(e); } finally { // Never shut down for getById() // There may be OutOfMemoryErrors or similar // The user may want to catch and continue working. EndTopLevelCall(); } } } public virtual object GetByID2(Transaction ta, int id) { object obj = ta.ObjectForIdFromCache(id); if (obj != null) { // Take care about handling the returned candidate reference. // If you loose the reference, weak reference management might // also. return obj; } return new ObjectReference(id).Read(ta, new LegacyActivationDepth(0), Const4.AddToIdTree , true); } public object GetActivatedObjectFromCache(Transaction ta, int id) { object obj = ta.ObjectForIdFromCache(id); if (obj == null) { return null; } Activate(ta, obj); return obj; } public object ReadActivatedObjectNotInCache(Transaction trans, int id) { object obj = AsTopLevelCall(new _IFunction4_892(id), trans); ActivatePending(trans); return obj; } private sealed class _IFunction4_892 : IFunction4 { public _IFunction4_892(int id) { this.id = id; } public object Apply(object trans) { return new ObjectReference(id).Read(((Transaction)trans), UnknownActivationDepth. Instance, Const4.AddToIdTree, true); } private readonly int id; } public object GetByUUID(Transaction trans, Db4oUUID uuid) { lock (_lock) { if (uuid == null) { return null; } HardObjectReference hardRef = GetHardReferenceBySignature(CheckTransaction(trans) , uuid.GetLongPart(), uuid.GetSignaturePart()); return hardRef._object; } } public virtual HardObjectReference GetHardReferenceBySignature(Transaction trans, long uuid, byte[] signature) { return UUIDIndex().GetHardObjectReferenceBySignature(trans, uuid, signature); } public int GetID(Transaction trans, object obj) { lock (_lock) { trans = CheckTransaction(trans); CheckClosed(); if (obj == null) { return 0; } ObjectReference yo = trans.ReferenceForObject(obj); if (yo != null) { return yo.GetID(); } return 0; } } public IObjectInfo GetObjectInfo(Transaction trans, object obj) { lock (_lock) { trans = CheckTransaction(trans); return trans.ReferenceForObject(obj); } } public HardObjectReference GetHardObjectReferenceById(Transaction trans, int id) { if (id <= 0) { return HardObjectReference.Invalid; } ObjectReference @ref = trans.ReferenceForId(id); if (@ref != null) { // Take care about handling the returned candidate reference. // If you loose the reference, weak reference management might also. object candidate = @ref.GetObject(); if (candidate != null) { return new HardObjectReference(@ref, candidate); } trans.RemoveReference(@ref); } @ref = new ObjectReference(id); object readObject = @ref.Read(trans, new LegacyActivationDepth(0), Const4.AddToIdTree , true); if (readObject == null) { return HardObjectReference.Invalid; } // check class creation side effect and simply retry recursively // if it hits: if (readObject != @ref.GetObject()) { return GetHardObjectReferenceById(trans, id); } return new HardObjectReference(@ref, readObject); } public StatefulBuffer CreateStatefulBuffer(Transaction trans, int address, int length ) { if (Debug4.ExceedsMaximumBlockSize(length)) { return null; } return new StatefulBuffer(trans, address, length); } public Transaction SystemTransaction() { return _systemTransaction; } public Transaction Transaction { get { return _transaction; } } public ClassMetadata ClassMetadataForReflectClass(IReflectClass claxx) { if (null == claxx) { throw new ArgumentNullException(); } if (HideClassForExternalUse(claxx)) { return null; } ClassMetadata classMetadata = _handlers.ClassMetadataForClass(claxx); if (classMetadata != null) { return classMetadata; } return _classCollection.ClassMetadataForReflectClass(claxx); } // TODO: Some ReflectClass implementations could hold a // reference to ClassMetadata to improve lookup performance here. public virtual ClassMetadata ProduceClassMetadata(IReflectClass claxx) { if (null == claxx) { throw new ArgumentNullException(); } if (HideClassForExternalUse(claxx)) { return null; } ClassMetadata classMetadata = _handlers.ClassMetadataForClass(claxx); if (classMetadata != null) { return classMetadata; } return _classCollection.ProduceClassMetadata(claxx); } /// /// Differentiating getActiveClassMetadata from getYapClass is a tuning /// optimization: If we initialize a YapClass, #set3() has to check for /// the possibility that class initialization associates the currently /// stored object with a previously stored static object, causing the /// object to be known afterwards. /// /// /// Differentiating getActiveClassMetadata from getYapClass is a tuning /// optimization: If we initialize a YapClass, #set3() has to check for /// the possibility that class initialization associates the currently /// stored object with a previously stored static object, causing the /// object to be known afterwards. /// In this call we only return active YapClasses, initialization /// is not done on purpose /// internal ClassMetadata GetActiveClassMetadata(IReflectClass claxx) { if (HideClassForExternalUse(claxx)) { return null; } return _classCollection.GetActiveClassMetadata(claxx); } private bool HideClassForExternalUse(IReflectClass claxx) { if ((!ShowInternalClasses()) && _handlers.IclassInternal.IsAssignableFrom(claxx)) { return true; } return false; } public virtual int ClassMetadataIdForName(string name) { return _classCollection.ClassMetadataIdForName(name); } public virtual ClassMetadata ClassMetadataForName(string name) { return ClassMetadataForID(ClassMetadataIdForName(name)); } public virtual ClassMetadata ClassMetadataForID(int id) { if (DTrace.enabled) { DTrace.ClassmetadataById.Log(id); } if (id == 0) { return null; } ClassMetadata classMetadata = _handlers.ClassMetadataForId(id); if (classMetadata != null) { return classMetadata; } return _classCollection.ClassMetadataForId(id); } public virtual HandlerRegistry Handlers { get { return _handlers; } } public virtual bool NeedsLockFileThread() { if (!Platform4.NeedsLockFileThread()) { return false; } if (ConfigImpl.IsReadOnly()) { return false; } return ConfigImpl.LockFile(); } protected virtual bool HasShutDownHook() { return ConfigImpl.AutomaticShutDown(); } protected virtual void Initialize1(IConfiguration config) { _config = InitializeConfig(config); _handlers = new HandlerRegistry(this, ConfigImpl.Encoding(), ConfigImpl.Reflector ()); if (_references != null) { Gc(); _references.Stop(); } _references = WeakReferenceSupportFactory.ForObjectContainer(this); if (HasShutDownHook()) { Platform4.AddShutDownHook(this); } _handlers.InitEncryption(ConfigImpl); _stillToSet = null; } private Config4Impl InitializeConfig(IConfiguration config) { Config4Impl impl = ((Config4Impl)config); impl.Container(this); impl.Reflector().SetTransaction(SystemTransaction()); impl.Reflector().Configuration(new ReflectorConfigurationImpl(impl)); impl.Taint(); return impl; } public virtual IReferenceSystem CreateReferenceSystem() { IReferenceSystem referenceSystem = _referenceSystemFactory.NewReferenceSystem(this ); _referenceSystemRegistry.AddReferenceSystem(referenceSystem); return referenceSystem; } protected virtual void InitalizeWeakReferenceSupport() { _references.Start(); } protected virtual void InitializeClassMetadataRepository() { _classCollection = new ClassMetadataRepository(_systemTransaction); } private void InitializePostOpen() { _showInternalClasses = 100000; InitializePostOpenExcludingTransportObjectContainer(); _showInternalClasses = 0; } protected virtual void InitializePostOpenExcludingTransportObjectContainer() { InitializeEssentialClasses(); Rename(ConfigImpl); _classCollection.InitOnUp(_systemTransaction); if (ConfigImpl.DetectSchemaChanges()) { if (!ConfigImpl.IsReadOnly()) { _systemTransaction.Commit(); } } ConfigImpl.ApplyConfigurationItems(this); } internal virtual void InitializeEssentialClasses() { for (int i = 0; i < Const4.EssentialClasses.Length; i++) { ProduceClassMetadata(Reflector().ForClass(Const4.EssentialClasses[i])); } } internal bool IsActive(Transaction trans, object obj) { lock (_lock) { trans = CheckTransaction(trans); if (obj != null) { ObjectReference @ref = trans.ReferenceForObject(obj); if (@ref != null) { return @ref.IsActive(); } } return false; } } public virtual bool IsCached(Transaction trans, long id) { lock (_lock) { trans = CheckTransaction(trans); return trans.ObjectForIdFromCache((int)id) != null; } } /// /// overridden in ClientObjectContainer /// The method allows checking whether will make it easier to refactor than /// an "instanceof YapClient" check. /// /// /// overridden in ClientObjectContainer /// The method allows checking whether will make it easier to refactor than /// an "instanceof YapClient" check. /// public virtual bool IsClient { get { return false; } } public bool IsClosed() { lock (_lock) { // this is set to null in close2 and is therefore our check for down. return _classCollection == null; } } internal virtual bool IsServer() { return false; } public bool IsStored(Transaction trans, object obj) { lock (_lock) { trans = CheckTransaction(trans); if (obj == null) { return false; } ObjectReference @ref = trans.ReferenceForObject(obj); if (@ref == null) { return false; } return !IsDeleted(trans, @ref.GetID()); } } public virtual IReflectClass[] KnownClasses() { lock (_lock) { CheckClosed(); return Reflector().KnownClasses(); } } public virtual ITypeHandler4 TypeHandlerForClass(IReflectClass claxx) { if (HideClassForExternalUse(claxx)) { return null; } ITypeHandler4 typeHandler = _handlers.TypeHandlerForClass(claxx); if (typeHandler != null) { return typeHandler; } return _classCollection.ProduceClassMetadata(claxx).TypeHandler(); } public virtual ITypeHandler4 TypeHandlerForClassMetadataID(int id) { if (id < 1) { return null; } ClassMetadata classMetadata = ClassMetadataForID(id); if (classMetadata == null) { return null; } return classMetadata.TypeHandler(); } public virtual object Lock() { return _lock; } public void LogMsg(int code, string msg) { Db4objects.Db4o.Internal.Messages.LogMsg(ConfigImpl, code, msg); } public virtual bool MaintainsIndices() { return true; } internal virtual void Message(string msg) { new MessageOutput(this, msg); } public void NeedsUpdate(ClassMetadata classMetadata) { _pendingClassUpdates = new List4(_pendingClassUpdates, classMetadata); } public virtual long GenerateTimeStampId() { return _timeStampIdGenerator.Generate(); } public abstract int IdForNewUserObject(Transaction trans); /// public virtual object PeekPersisted(Transaction trans, object obj, IActivationDepth depth, bool committed) { // TODO: peekPersisted is not stack overflow safe, if depth is too high. lock (_lock) { CheckClosed(); return AsTopLevelCall(new _IFunction4_1271(this, obj, committed, depth), trans); } } private sealed class _IFunction4_1271 : IFunction4 { public _IFunction4_1271(ObjectContainerBase _enclosing, object obj, bool committed , IActivationDepth depth) { this._enclosing = _enclosing; this.obj = obj; this.committed = committed; this.depth = depth; } public object Apply(object trans) { trans = this._enclosing.CheckTransaction(((Transaction)trans)); ObjectReference @ref = ((Transaction)trans).ReferenceForObject(obj); trans = committed ? this._enclosing._systemTransaction : ((Transaction)trans); object cloned = null; if (@ref != null) { cloned = this._enclosing.PeekPersisted(((Transaction)trans), @ref.GetID(), depth, true); } return cloned; } private readonly ObjectContainerBase _enclosing; private readonly object obj; private readonly bool committed; private readonly IActivationDepth depth; } public object PeekPersisted(Transaction trans, int id, IActivationDepth depth, bool resetJustPeeked) { if (resetJustPeeked) { _justPeeked = null; } else { TreeInt ti = new TreeInt(id); TreeIntObject tio = (TreeIntObject)Tree.Find(_justPeeked, ti); if (tio != null) { return tio._object; } } ObjectReference @ref = PeekReference(trans, id, depth, resetJustPeeked); return @ref.GetObject(); } public virtual ObjectReference PeekReference(Transaction trans, int id, IActivationDepth depth, bool resetJustPeeked) { ObjectReference @ref = new ObjectReference(id); @ref.PeekPersisted(trans, depth); if (resetJustPeeked) { _justPeeked = null; } return @ref; } internal virtual void Peeked(int id, object obj) { _justPeeked = Tree.Add(_justPeeked, new TreeIntObject(id, obj)); } public virtual void Purge() { lock (_lock) { CheckClosed(); Runtime.Gc(); Runtime.RunFinalization(); Runtime.Gc(); Gc(); _classCollection.Purge(); } } public void Purge(Transaction trans, object obj) { lock (_lock) { trans = CheckTransaction(trans); trans.RemoveObjectFromReferenceSystem(obj); } } internal void RemoveFromAllReferenceSystems(object obj) { if (obj == null) { return; } if (obj is ObjectReference) { _referenceSystemRegistry.RemoveReference((ObjectReference)obj); return; } _referenceSystemRegistry.RemoveObject(obj); } public NativeQueryHandler GetNativeQueryHandler() { lock (_lock) { if (null == _nativeQueryHandler) { _nativeQueryHandler = new NativeQueryHandler(this); } return _nativeQueryHandler; } } public IObjectSet Query(Transaction trans, Predicate predicate) { return Query(trans, predicate, (IQueryComparator)null); } public IObjectSet Query(Transaction trans, Predicate predicate, IQueryComparator comparator) { lock (_lock) { return GetNativeQueryHandler().Execute(Query(trans), predicate, comparator); } } public IObjectSet Query(Transaction trans, Type clazz) { return QueryByExample(trans, clazz); } public IQuery Query(Transaction ta) { return new QQuery(CheckTransaction(ta), null, null); } public abstract void RaiseCommitTimestamp(long minimumTimestamp); /// public abstract void ReadBytes(byte[] a_bytes, int a_address, int a_length); /// public abstract void ReadBytes(byte[] bytes, int address, int addressOffset, int length); /// public ByteArrayBuffer DecryptedBufferByAddress(int address, int length) { ByteArrayBuffer reader = RawBufferByAddress(address, length); _handlers.Decrypt(reader); return reader; } public virtual ByteArrayBuffer RawBufferByAddress(int address, int length) { CheckAddress(address); ByteArrayBuffer reader = new ByteArrayBuffer(length); ReadBytes(reader._buffer, address, length); return reader; } /// private void CheckAddress(int address) { if (address <= 0) { throw new ArgumentException("Invalid address offset: " + address); } } /// public StatefulBuffer ReadWriterByAddress(Transaction a_trans, int address, int length ) { CheckAddress(address); StatefulBuffer reader = CreateStatefulBuffer(a_trans, address, length); reader.ReadEncrypt(this, address); return reader; } public abstract StatefulBuffer ReadStatefulBufferById(Transaction trans, int id); public abstract StatefulBuffer ReadStatefulBufferById(Transaction trans, int id, bool lastCommitted); public abstract ByteArrayBuffer ReadBufferById(Transaction trans, int id); public abstract ByteArrayBuffer ReadBufferById(Transaction trans, int id, bool lastCommitted ); public abstract ByteArrayBuffer[] ReadSlotBuffers(Transaction trans, int[] ids); private void Reboot() { Commit(null); Close(); Open(); } public virtual GenericReflector Reflector() { return _handlers._reflector; } public void Refresh(Transaction trans, object obj, int depth) { lock (_lock) { RefreshInternal(trans, obj, depth); } } protected virtual void RefreshInternal(Transaction trans, object obj, int depth) { Activate(trans, obj, RefreshActivationDepth(depth)); } private IActivationDepth RefreshActivationDepth(int depth) { return ActivationDepthProvider().ActivationDepth(depth, ActivationMode.Refresh); } public abstract void ReleaseSemaphore(string name); public virtual void FlagAsHandled(ObjectReference @ref) { @ref.FlagAsHandled(_topLevelCallId); } internal virtual bool FlagForDelete(ObjectReference @ref) { if (@ref == null) { return false; } if (HandledInCurrentTopLevelCall(@ref)) { return false; } @ref.FlagForDelete(_topLevelCallId); return true; } public abstract void ReleaseSemaphores(Transaction ta); internal virtual void Rename(Config4Impl config) { bool renamedOne = false; if (config.Rename() != null) { renamedOne = ApplyRenames(config); } _classCollection.CheckChanges(); if (renamedOne) { Reboot(); } } protected virtual bool ApplyRenames(Config4Impl config) { bool renamed = false; IEnumerator i = config.Rename().GetEnumerator(); while (i.MoveNext()) { Rename ren = (Rename)i.Current; if (AlreadyApplied(ren)) { continue; } if (ApplyRename(ren)) { renamed = true; } } return renamed; } private bool ApplyRename(Rename ren) { if (ren.IsField()) { return ApplyFieldRename(ren); } return ApplyClassRename(ren); } private bool ApplyClassRename(Rename ren) { ClassMetadata classToRename = _classCollection.GetClassMetadata(ren.rFrom); if (classToRename == null) { return false; } ClassMetadata existing = _classCollection.GetClassMetadata(ren.rTo); if (existing != null) { LogMsg(9, "class " + ren.rTo); return false; } classToRename.SetName(ren.rTo); CommitRenameFor(ren, classToRename); return true; } private bool ApplyFieldRename(Rename ren) { ClassMetadata parentClass = _classCollection.GetClassMetadata(ren.rClass); if (parentClass == null) { return false; } if (!parentClass.RenameField(ren.rFrom, ren.rTo)) { return false; } CommitRenameFor(ren, parentClass); return true; } private void CommitRenameFor(Rename rename, ClassMetadata classMetadata) { SetDirtyInSystemTransaction(classMetadata); LogMsg(8, rename.rFrom + " to " + rename.rTo); DeleteInverseRenames(rename); // store the rename, so we only do it once Store(SystemTransaction(), rename); } private void DeleteInverseRenames(Rename rename) { // delete all that rename from the new name // to allow future backswitching IObjectSet inverseRenames = QueryInverseRenames(rename); while (inverseRenames.HasNext()) { Delete(SystemTransaction(), inverseRenames.Next()); } } private IObjectSet QueryInverseRenames(Rename ren) { return QueryByExample(SystemTransaction(), Renames.ForInverseQBE(ren)); } private bool AlreadyApplied(Rename ren) { return QueryByExample(SystemTransaction(), ren).Count != 0; } public bool HandledInCurrentTopLevelCall(ObjectReference @ref) { return @ref.IsFlaggedAsHandled(_topLevelCallId); } public abstract void Reserve(int byteCount); public void Rollback(Transaction trans) { lock (_lock) { trans = CheckTransaction(trans); CheckReadOnly(); Rollback1(trans); trans.RollbackReferenceSystem(); } } public abstract void Rollback1(Transaction trans); /// public virtual void Send(object obj) { // TODO: implement throw new NotSupportedException(); } /// /// public void Store(Transaction trans, object obj) { Store(trans, obj, UpdateDepthProvider().Unspecified(NullModifiedObjectQuery.Instance )); } /// /// public int Store(Transaction trans, object obj, IUpdateDepth depth) { lock (_lock) { try { ShowInternalClasses(true); return StoreInternal(trans, obj, depth, true); } finally { ShowInternalClasses(false); } } } /// /// public int StoreInternal(Transaction trans, object obj, bool checkJustSet) { return StoreInternal(trans, obj, UpdateDepthProvider().Unspecified(NullModifiedObjectQuery .Instance), checkJustSet); } /// /// public virtual int StoreInternal(Transaction trans, object obj, IUpdateDepth depth , bool checkJustSet) { CheckReadOnly(); return (((int)AsTopLevelStore(new _IFunction4_1599(this, obj, depth, checkJustSet ), trans))); } private sealed class _IFunction4_1599 : IFunction4 { public _IFunction4_1599(ObjectContainerBase _enclosing, object obj, IUpdateDepth depth, bool checkJustSet) { this._enclosing = _enclosing; this.obj = obj; this.depth = depth; this.checkJustSet = checkJustSet; } public object Apply(object trans) { return this._enclosing.StoreAfterReplication(((Transaction)trans), obj, depth, checkJustSet ); } private readonly ObjectContainerBase _enclosing; private readonly object obj; private readonly IUpdateDepth depth; private readonly bool checkJustSet; } public int StoreAfterReplication(Transaction trans, object obj, IUpdateDepth depth , bool checkJust) { if (obj is IDb4oType) { IDb4oType db4oType = Db4oTypeStored(trans, obj); if (db4oType != null) { return GetID(trans, db4oType); } } return Store2(trans, obj, depth, checkJust); } public void StoreByNewReplication(IDb4oReplicationReferenceProvider referenceProvider , object obj) { lock (_lock) { _replicationCallState = Const4.New; _handlers._replicationReferenceProvider = referenceProvider; try { Store2(CheckTransaction(), obj, UpdateDepthProvider().ForDepth(1), false); } finally { _replicationCallState = Const4.None; _handlers._replicationReferenceProvider = null; } } } public virtual void CheckStillToSet() { List4 postponedStillToSet = null; while (_stillToSet != null) { IEnumerator i = new Iterator4Impl(_stillToSet); _stillToSet = null; while (i.MoveNext()) { ObjectContainerBase.PendingSet item = (ObjectContainerBase.PendingSet)i.Current; ObjectReference @ref = item.@ref; Transaction trans = item.transaction; if (!@ref.ContinueSet(trans, item.depth)) { postponedStillToSet = new List4(postponedStillToSet, item); } } } _stillToSet = postponedStillToSet; } internal virtual void NotStorable(IReflectClass claxx, object obj) { if (!ConfigImpl.ExceptionsOnNotStorable()) { return; } if (claxx == null) { throw new ObjectNotStorableException(obj.ToString()); } if (_handlers.IsTransient(claxx)) { return; } throw new ObjectNotStorableException(claxx); } public int Store2(Transaction trans, object obj, IUpdateDepth updateDepth, bool checkJustSet ) { if (obj == null || (obj is ITransientClass)) { return 0; } ObjectAnalyzer analyzer = new ObjectAnalyzer(this, obj); analyzer.Analyze(trans); if (analyzer.NotStorable()) { return 0; } ObjectReference @ref = analyzer.ObjectReference(); if (@ref == null) { ClassMetadata classMetadata = analyzer.ClassMetadata(); if (!ObjectCanNew(trans, classMetadata, obj)) { return 0; } @ref = new ObjectReference(); @ref.Store(trans, classMetadata, obj); trans.AddNewReference(@ref); if (obj is IDb4oTypeImpl) { ((IDb4oTypeImpl)obj).SetTrans(trans); } if (ConfigImpl.MessageLevel() > Const4.State) { Message(string.Empty + @ref.GetID() + " new " + @ref.ClassMetadata().GetName()); } FlagAsHandled(@ref); StillToSet(trans, @ref, updateDepth); } else { if (@ref.IsFlaggedAsHandled(_topLevelCallId)) { AssertNotInCallback(); } if (CanUpdate()) { if (checkJustSet) { if ((!@ref.IsNew()) && HandledInCurrentTopLevelCall(@ref)) { return @ref.GetID(); } } if (updateDepth.SufficientDepth()) { FlagAsHandled(@ref); @ref.WriteUpdate(trans, updateDepth); } } } ProcessPendingClassUpdates(); return @ref.GetID(); } private void AssertNotInCallback() { if (InCallback.Value()) { throw new Db4oIllegalStateException("Objects must not be updated in callback"); } } private bool ObjectCanNew(Transaction transaction, ClassMetadata yc, object obj) { return Callbacks().ObjectCanNew(transaction, obj) && yc.DispatchEvent(transaction , obj, EventDispatchers.CanNew); } public abstract void SetDirtyInSystemTransaction(PersistentBase a_object); public abstract bool SetSemaphore(string name, int timeout); public abstract bool SetSemaphore(Transaction trans, string name, int timeout); public abstract void ReleaseSemaphore(Transaction trans, string name); internal virtual void StringIO(LatinStringIO io) { _handlers.StringIO(io); } internal bool ShowInternalClasses() { return IsServer() || _showInternalClasses > 0; } /// /// Objects implementing the "Internal4" marker interface are /// not visible to queries, unless this flag is set to true. /// /// /// Objects implementing the "Internal4" marker interface are /// not visible to queries, unless this flag is set to true. /// The caller should reset the flag after the call. /// public virtual void ShowInternalClasses(bool show) { lock (this) { if (show) { _showInternalClasses++; } else { _showInternalClasses--; } if (_showInternalClasses < 0) { _showInternalClasses = 0; } } } private bool StackIsSmall() { return _stackDepth < _maxStackDepth; } internal virtual bool StateMessages() { return true; } // overridden to do nothing in YapObjectCarrier internal List4 StillTo1(Transaction trans, List4 still, object obj, IActivationDepth depth) { if (obj == null || !depth.RequiresActivation()) { return still; } ObjectReference @ref = trans.ReferenceForObject(obj); if (@ref != null) { if (HandledInCurrentTopLevelCall(@ref)) { return still; } FlagAsHandled(@ref); return new List4(still, new ObjectContainerBase.PendingActivation(@ref, depth)); } IReflectClass clazz = ReflectorForObject(obj); if (clazz.IsArray()) { if (!clazz.GetComponentType().IsPrimitive()) { IEnumerator arr = ArrayHandler.Iterator(clazz, obj); while (arr.MoveNext()) { object current = arr.Current; if (current == null) { continue; } ClassMetadata classMetadata = ClassMetadataForObject(current); still = StillTo1(trans, still, current, depth.Descend(classMetadata)); } } return still; } else { if (obj is Entry) { still = StillTo1(trans, still, ((Entry)obj).key, depth); still = StillTo1(trans, still, ((Entry)obj).value, depth); } else { if (depth.Mode().IsDeactivate()) { // Special handling to deactivate .net structs ClassMetadata metadata = ClassMetadataForObject(obj); if (metadata != null && metadata.IsStruct()) { metadata.ForceDeactivation(trans, depth, obj); } } } } return still; } public void StillToActivate(IActivationContext context) { // TODO: We don't want the simple classes to search the hc_tree // Kick them out here. // if (a_object != null) { // Class clazz = a_object.getClass(); // if(! clazz.isPrimitive()){ if (ProcessedByImmediateActivation(context)) { return; } _stillToActivate = StillTo1(context.Transaction(), _stillToActivate, context.TargetObject (), context.Depth()); } private bool ProcessedByImmediateActivation(IActivationContext context) { if (!StackIsSmall()) { return false; } if (!context.Depth().RequiresActivation()) { return true; } ObjectReference @ref = context.Transaction().ReferenceForObject(context.TargetObject ()); if (@ref == null) { return false; } if (HandledInCurrentTopLevelCall(@ref)) { return true; } FlagAsHandled(@ref); IncStackDepth(); try { @ref.ActivateInternal(context); } finally { DecStackDepth(); } return true; } private int DecStackDepth() { int i = _stackDepth--; if (StackIsSmall() && !_handlingStackLimitPendings) { _handlingStackLimitPendings = true; try { HandleStackLimitPendings(); } finally { _handlingStackLimitPendings = false; } } return i; } private void HandleStackLimitPendings() { CheckStillToSet(); } // activatePending(); // deactivatePending(); private int IncStackDepth() { return _stackDepth++; } public void StillToDeactivate(Transaction trans, object a_object, IActivationDepth a_depth, bool a_forceUnknownDeactivate) { _stillToDeactivate = StillTo1(trans, _stillToDeactivate, a_object, a_depth); } internal class PendingSet { public readonly Transaction transaction; public readonly ObjectReference @ref; public readonly IUpdateDepth depth; public PendingSet(Transaction transaction_, ObjectReference ref_, IUpdateDepth depth_ ) { this.transaction = transaction_; this.@ref = ref_; this.depth = depth_; } } internal virtual void StillToSet(Transaction transaction, ObjectReference @ref, IUpdateDepth updateDepth) { if (StackIsSmall()) { if (@ref.ContinueSet(transaction, updateDepth)) { return; } } _stillToSet = new List4(_stillToSet, new ObjectContainerBase.PendingSet(transaction , @ref, updateDepth)); } protected void StopSession() { if (HasShutDownHook()) { Platform4.RemoveShutDownHook(this); } _classCollection = null; if (_references != null) { _references.Stop(); } _systemTransaction = null; _transaction = null; } public IStoredClass StoredClass(Transaction trans, object clazz) { lock (_lock) { trans = CheckTransaction(trans); IReflectClass claxx = ReflectorUtils.ReflectClassFor(Reflector(), clazz); if (claxx == null) { return null; } ClassMetadata classMetadata = ClassMetadataForReflectClass(claxx); if (classMetadata == null) { return null; } return new StoredClassImpl(trans, classMetadata); } } public virtual IStoredClass[] StoredClasses(Transaction trans) { lock (_lock) { trans = CheckTransaction(trans); IStoredClass[] classMetadata = _classCollection.StoredClasses(); IStoredClass[] storedClasses = new IStoredClass[classMetadata.Length]; for (int i = 0; i < classMetadata.Length; i++) { storedClasses[i] = new StoredClassImpl(trans, (ClassMetadata)classMetadata[i]); } return storedClasses; } } public virtual LatinStringIO StringIO() { return _handlers.StringIO(); } public abstract ISystemInfo SystemInfo(); private void BeginTopLevelCall() { if (DTrace.enabled) { DTrace.BeginTopLevelCall.Log(); } GenerateCallIDOnTopLevel(); IncStackDepth(); } private void EndTopLevelCall() { if (DTrace.enabled) { DTrace.EndTopLevelCall.Log(); } DecStackDepth(); GenerateCallIDOnTopLevel(); } private void GenerateCallIDOnTopLevel() { if (_stackDepth == 0) { _topLevelCallId = _topLevelCallIdGenerator.Next(); } } public virtual int StackDepth() { return _stackDepth; } public virtual void StackDepth(int depth) { _stackDepth = depth; } public virtual int TopLevelCallId() { return _topLevelCallId; } public virtual void TopLevelCallId(int id) { _topLevelCallId = id; } public virtual long Version() { lock (_lock) { return CurrentVersion(); } } public abstract void Shutdown(); public abstract void WriteDirtyClassMetadata(); public abstract void WriteNew(Transaction trans, Pointer4 pointer, ClassMetadata classMetadata, ByteArrayBuffer buffer); public abstract void WriteUpdate(Transaction trans, Pointer4 pointer, ClassMetadata classMetadata, ArrayType arrayType, ByteArrayBuffer buffer); public virtual ICallbacks Callbacks() { return _callbacks; } public virtual void Callbacks(ICallbacks cb) { if (cb == null) { throw new ArgumentException(); } _callbacks = cb; } public virtual Config4Impl ConfigImpl { get { return _config; } } public virtual UUIDFieldMetadata UUIDIndex() { return _handlers.Indexes()._uUID; } public virtual VersionFieldMetadata VersionIndex() { return _handlers.Indexes()._version; } public virtual CommitTimestampFieldMetadata CommitTimestampIndex() { return _handlers.Indexes()._commitTimestamp; } public virtual ClassMetadataRepository ClassCollection() { return _classCollection; } public abstract long[] GetIDsForClass(Transaction trans, ClassMetadata clazz); public abstract IQueryResult ClassOnlyQuery(QQueryBase queryBase, ClassMetadata clazz ); public abstract IQueryResult ExecuteQuery(QQuery query); public virtual void ReplicationCallState(int state) { _replicationCallState = state; } public virtual ReferenceSystemRegistry ReferenceSystemRegistry() { return _referenceSystemRegistry; } public virtual ObjectContainerBase Container { get { return this; } } public virtual void DeleteByID(Transaction transaction, int id, int cascadeDeleteDepth ) { if (id <= 0) { throw new ArgumentException("ID: " + id); } // return; if (cascadeDeleteDepth <= 0) { return; } object obj = GetByID2(transaction, id); if (obj == null) { return; } cascadeDeleteDepth--; IReflectClass claxx = ReflectorForObject(obj); if (claxx.IsCollection()) { cascadeDeleteDepth += 1; } ObjectReference @ref = transaction.ReferenceForId(id); if (@ref == null) { return; } Delete2(transaction, @ref, obj, cascadeDeleteDepth, false); } internal virtual IReflectClass ReflectorForObject(object obj) { return Reflector().ForObject(obj); } public virtual object SyncExec(IClosure4 block) { lock (_lock) { CheckClosed(); return block.Run(); } } public virtual void StoreAll(Transaction transaction, IEnumerator objects) { while (objects.MoveNext()) { Store(transaction, objects.Current); } } public virtual void StoreAll(Transaction transaction, IEnumerator objects, IUpdateDepth depth) { while (objects.MoveNext()) { Store(transaction, objects.Current, depth); } } public virtual void WithTransaction(Transaction transaction, IRunnable runnable) { lock (_lock) { Transaction old = _transaction; _transaction = transaction; try { runnable.Run(); } finally { _transaction = old; } } } public virtual IThreadPool4 ThreadPool() { return ((IThreadPool4)Environment().Provide(typeof(IThreadPool4))); } public virtual object NewWeakReference(ObjectReference referent, object obj) { return _references.NewWeakReference(referent, obj); } public sealed override string ToString() { if (_name != null) { return _name; } return DefaultToString(); } protected abstract string DefaultToString(); public abstract bool IsDeleted(Transaction trans, int id); public abstract void BlockSize(int size); public virtual IBlockConverter BlockConverter() { return _blockConverter; } protected virtual void CreateBlockConverter(int blockSize) { if (blockSize == 1) { _blockConverter = new DisabledBlockConverter(); } else { _blockConverter = new BlockSizeBlockConverter(blockSize); } } public virtual IUpdateDepthProvider UpdateDepthProvider() { return ConfigImpl.UpdateDepthProvider(); } public virtual void ReplaceClassMetadataRepository(ClassMetadataRepository repository ) { _classCollection = repository; } public long GenerateTransactionTimestamp(long forcedTimestamp) { lock (Lock()) { return CheckTransaction().GenerateTransactionTimestamp(forcedTimestamp); } } public void UseDefaultTransactionTimestamp() { lock (Lock()) { CheckTransaction().UseDefaultTransactionTimestamp(); } } public abstract void Activate(object arg1, int arg2); public abstract void Commit(); public abstract void Deactivate(object arg1, int arg2); public abstract void Delete(object arg1); public abstract IExtObjectContainer Ext(); public abstract IQuery Query(); public abstract IObjectSet Query(Type arg1); public abstract IObjectSet Query(Predicate arg1); public abstract IObjectSet Query(Predicate arg1, IQueryComparator arg2); public abstract IObjectSet QueryByExample(object arg1); public abstract void Rollback(); public abstract void Store(object arg1); public abstract void Activate(object arg1); public abstract void Backup(IStorage arg1, string arg2); public abstract void Bind(object arg1, long arg2); public abstract void Deactivate(object arg1); public abstract object Descend(object arg1, string[] arg2); public abstract object GetByID(long arg1); public abstract object GetByUUID(Db4oUUID arg1); public abstract long GetID(object arg1); public abstract IObjectInfo GetObjectInfo(object arg1); public abstract Db4oDatabase Identity(); public abstract bool IsActive(object arg1); public abstract bool IsCached(long arg1); public abstract bool IsStored(object arg1); public abstract IObjectContainer OpenSession(); public abstract object PeekPersisted(object arg1, int arg2, bool arg3); public abstract void Purge(object arg1); public abstract void Refresh(object arg1, int arg2); public abstract void Store(object arg1, int arg2); public abstract IStoredClass StoredClass(object arg1); public abstract IStoredClass[] StoredClasses(); public abstract int InstanceCount(ClassMetadata arg1, Transaction arg2); public abstract EventRegistryImpl NewEventRegistry(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Metadata/0000755000175000017500000000000011700531646026403 5ustar00meebeymeebey00000000000000IAspectTraversalStrategy.cs0000644000175000017500000000045511700531646033616 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Metadata/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Metadata; namespace Db4objects.Db4o.Internal.Metadata { /// public interface IAspectTraversalStrategy { void TraverseAllAspects(ITraverseAspectCommand command); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Metadata/ITraverseAspectCommand.cs0000644000175000017500000000070011700531646033272 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Metadata { /// public interface ITraverseAspectCommand { int DeclaredAspectCount(ClassMetadata classMetadata); bool Cancelled(); void ProcessAspectOnMissingClass(ClassAspect aspect, int currentSlot); void ProcessAspect(ClassAspect aspect, int currentSlot); } } StandardAspectTraversalStrategy.cs0000644000175000017500000000177611700531646035175 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Metadata/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Metadata; namespace Db4objects.Db4o.Internal.Metadata { /// public class StandardAspectTraversalStrategy : IAspectTraversalStrategy { private readonly ClassMetadata _classMetadata; public StandardAspectTraversalStrategy(ClassMetadata classMetadata) { _classMetadata = classMetadata; } public virtual void TraverseAllAspects(ITraverseAspectCommand command) { ClassMetadata classMetadata = _classMetadata; int currentSlot = 0; while (classMetadata != null) { int aspectCount = command.DeclaredAspectCount(classMetadata); for (int i = 0; i < aspectCount && !command.Cancelled(); i++) { command.ProcessAspect(classMetadata._aspects[i], currentSlot); currentSlot++; } if (command.Cancelled()) { return; } classMetadata = classMetadata._ancestor; } } } } MarshallingInfoTraverseAspectCommand.cs0000644000175000017500000000333111700531646036103 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Metadata/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Metadata; namespace Db4objects.Db4o.Internal.Metadata { /// public abstract class MarshallingInfoTraverseAspectCommand : ITraverseAspectCommand { private bool _cancelled = false; protected readonly IMarshallingInfo _marshallingInfo; public MarshallingInfoTraverseAspectCommand(IMarshallingInfo marshallingInfo) { _marshallingInfo = marshallingInfo; } public int DeclaredAspectCount(ClassMetadata classMetadata) { int aspectCount = InternalDeclaredAspectCount(classMetadata); _marshallingInfo.DeclaredAspectCount(aspectCount); return aspectCount; } protected virtual int InternalDeclaredAspectCount(ClassMetadata classMetadata) { return classMetadata.ReadAspectCount(_marshallingInfo.Buffer()); } public virtual bool Cancelled() { return _cancelled; } protected virtual void Cancel() { _cancelled = true; } public virtual bool Accept(ClassAspect aspect) { return true; } public virtual void ProcessAspectOnMissingClass(ClassAspect aspect, int currentSlot ) { if (_marshallingInfo.IsNull(currentSlot)) { return; } aspect.IncrementOffset(_marshallingInfo.Buffer()); } public virtual void ProcessAspect(ClassAspect aspect, int currentSlot) { if (Accept(aspect)) { ProcessAspect(aspect, currentSlot, _marshallingInfo.IsNull(currentSlot)); } _marshallingInfo.BeginSlot(); } protected abstract void ProcessAspect(ClassAspect aspect, int currentSlot, bool isNull ); } } ModifiedAspectTraversalStrategy.cs0000644000175000017500000000605311700531646035146 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Metadata/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Metadata; namespace Db4objects.Db4o.Internal.Metadata { /// public class ModifiedAspectTraversalStrategy : IAspectTraversalStrategy { private readonly IList _classDiffs; public ModifiedAspectTraversalStrategy(ClassMetadata classMetadata, IList ancestors ) { _classDiffs = new ArrayList(); _classDiffs.Add(new HierarchyAnalyzer.Same(classMetadata)); Sharpen.Collections.AddAll(_classDiffs, ancestors); } public virtual void TraverseAllAspects(ITraverseAspectCommand command) { int currentSlot = 0; for (IEnumerator diffIter = _classDiffs.GetEnumerator(); diffIter.MoveNext(); ) { HierarchyAnalyzer.Diff diff = ((HierarchyAnalyzer.Diff)diffIter.Current); ClassMetadata classMetadata = diff.ClassMetadata(); if (diff.IsRemoved()) { currentSlot = SkipAspectsOf(classMetadata, command, currentSlot); continue; } currentSlot = TraverseAspectsOf(classMetadata, command, currentSlot); if (command.Cancelled()) { return; } } } internal interface ITraverseAspectCommandProcessor { void Process(ITraverseAspectCommand command, ClassAspect currentAspect, int currentSlot ); } private int TraverseAspectsOf(ClassMetadata classMetadata, ITraverseAspectCommand command, int currentSlot) { return ProcessAspectsOf(classMetadata, command, currentSlot, new _ITraverseAspectCommandProcessor_49 ()); } private sealed class _ITraverseAspectCommandProcessor_49 : ModifiedAspectTraversalStrategy.ITraverseAspectCommandProcessor { public _ITraverseAspectCommandProcessor_49() { } public void Process(ITraverseAspectCommand command, ClassAspect currentAspect, int currentSlot) { command.ProcessAspect(currentAspect, currentSlot); } } private int ProcessAspectsOf(ClassMetadata classMetadata, ITraverseAspectCommand command, int currentSlot, ModifiedAspectTraversalStrategy.ITraverseAspectCommandProcessor processor) { int aspectCount = command.DeclaredAspectCount(classMetadata); for (int i = 0; i < aspectCount && !command.Cancelled(); i++) { processor.Process(command, classMetadata._aspects[i], currentSlot); currentSlot++; } return currentSlot; } private int SkipAspectsOf(ClassMetadata classMetadata, ITraverseAspectCommand command , int currentSlot) { return ProcessAspectsOf(classMetadata, command, currentSlot, new _ITraverseAspectCommandProcessor_70 ()); } private sealed class _ITraverseAspectCommandProcessor_70 : ModifiedAspectTraversalStrategy.ITraverseAspectCommandProcessor { public _ITraverseAspectCommandProcessor_70() { } public void Process(ITraverseAspectCommand command, ClassAspect currentAspect, int currentSlot) { command.ProcessAspectOnMissingClass(currentAspect, currentSlot); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Metadata/TraverseFieldCommand.cs0000644000175000017500000000151311700531646032770 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Metadata; namespace Db4objects.Db4o.Internal.Metadata { /// public abstract class TraverseFieldCommand : ITraverseAspectCommand { public virtual bool Cancelled() { return false; } public virtual int DeclaredAspectCount(ClassMetadata classMetadata) { return classMetadata.DeclaredAspectCount(); } public virtual void ProcessAspect(ClassAspect aspect, int currentSlot) { if (aspect is FieldMetadata) { Process((FieldMetadata)aspect); } } public virtual void ProcessAspectOnMissingClass(ClassAspect aspect, int currentSlot ) { } // do nothing protected abstract void Process(FieldMetadata field); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Metadata/HierarchyAnalyzer.cs0000644000175000017500000000703111700531646032357 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Metadata; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Metadata { /// public class HierarchyAnalyzer { public class Diff { private readonly Db4objects.Db4o.Internal.ClassMetadata _classMetadata; public Diff(Db4objects.Db4o.Internal.ClassMetadata classMetadata) { if (classMetadata == null) { throw new ArgumentNullException(); } _classMetadata = classMetadata; } public override bool Equals(object obj) { if (GetType() != obj.GetType()) { return false; } HierarchyAnalyzer.Diff other = (HierarchyAnalyzer.Diff)obj; return _classMetadata == other._classMetadata; } public override string ToString() { return ReflectPlatform.SimpleName(GetType()) + "(" + _classMetadata.GetName() + ")"; } public virtual Db4objects.Db4o.Internal.ClassMetadata ClassMetadata() { return _classMetadata; } public virtual bool IsRemoved() { return false; } } public class Same : HierarchyAnalyzer.Diff { public Same(ClassMetadata classMetadata) : base(classMetadata) { } } public class Removed : HierarchyAnalyzer.Diff { public Removed(ClassMetadata classMetadata) : base(classMetadata) { } public override bool IsRemoved() { return true; } } private ClassMetadata _storedClass; private IReflectClass _runtimeClass; private readonly IReflectClass _objectClass; public HierarchyAnalyzer(ClassMetadata storedClass, IReflectClass runtimeClass) { if (storedClass == null || runtimeClass == null) { throw new ArgumentNullException(); } _storedClass = storedClass; _runtimeClass = runtimeClass; _objectClass = runtimeClass.Reflector().ForClass(typeof(object)); } public virtual IList Analyze() { IList ancestors = new ArrayList(); ClassMetadata storedAncestor = _storedClass.GetAncestor(); IReflectClass runtimeAncestor = _runtimeClass.GetSuperclass(); while (storedAncestor != null) { if (runtimeAncestor == storedAncestor.ClassReflector()) { ancestors.Add(new HierarchyAnalyzer.Same(storedAncestor)); } else { do { ancestors.Add(new HierarchyAnalyzer.Removed(storedAncestor)); storedAncestor = storedAncestor.GetAncestor(); if (null == storedAncestor) { if (IsObject(runtimeAncestor)) { return ancestors; } ThrowUnsupportedAdd(runtimeAncestor); } if (runtimeAncestor == storedAncestor.ClassReflector()) { ancestors.Add(new HierarchyAnalyzer.Same(storedAncestor)); break; } } while (storedAncestor != null); } storedAncestor = storedAncestor.GetAncestor(); runtimeAncestor = runtimeAncestor.GetSuperclass(); } if (runtimeAncestor != null && (!IsObject(runtimeAncestor))) { ThrowUnsupportedAdd(runtimeAncestor); } return ancestors; } private void ThrowUnsupportedAdd(IReflectClass runtimeAncestor) { throw new InvalidOperationException("Unsupported class hierarchy change. Class " + runtimeAncestor.GetName() + " was added to hierarchy of " + _runtimeClass.GetName ()); } private bool IsObject(IReflectClass clazz) { return _objectClass == clazz; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Reflection4.cs0000644000175000017500000001442011700531646027371 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Reflection; using System.Text; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Sharpen; namespace Db4objects.Db4o.Internal { /// /// Use the methods in this class for system classes only, since they /// are not ClassLoader or Reflector-aware. /// TODO: this class should go to foundation.reflect, along with ReflectException and ReflectPlatform /// public class Reflection4 { public static object InvokeStatic(Type clazz, string methodName) { return Invoke(clazz, methodName, null, null, null); } /// public static object Invoke(object obj, string methodName) { return Invoke(obj.GetType(), methodName, null, null, obj); } /// public static object Invoke(object obj, string methodName, object[] @params) { Type[] paramClasses = new Type[@params.Length]; for (int i = 0; i < @params.Length; i++) { paramClasses[i] = @params[i].GetType(); } return Invoke(obj.GetType(), methodName, paramClasses, @params, obj); } /// public static object Invoke(object obj, string methodName, Type[] paramClasses, object [] @params) { return Invoke(obj.GetType(), methodName, paramClasses, @params, obj); } /// public static object Invoke(Type clazz, string methodName, Type[] paramClasses, object [] @params) { return Invoke(clazz, methodName, paramClasses, @params, null); } private static object Invoke(Type clazz, string methodName, Type[] paramClasses, object[] @params, object onObject) { return Invoke(@params, onObject, GetMethod(clazz, methodName, paramClasses)); } /// public static object Invoke(string className, string methodName, Type[] paramClasses , object[] @params, object onObject) { MethodInfo method = GetMethod(className, methodName, paramClasses); return Invoke(@params, onObject, method); } /// public static object Invoke(object[] @params, object onObject, MethodInfo method) { if (method == null) { return null; } Platform4.SetAccessible(method); try { return method.Invoke(onObject, @params); } catch (TargetInvocationException e) { throw new ReflectException(e.InnerException); } catch (ArgumentException e) { throw new ReflectException(e); } catch (MemberAccessException e) { throw new ReflectException(e); } } /// calling this method "method" will break C# conversion with the old converter /// public static MethodInfo GetMethod(string className, string methodName, Type[] paramClasses ) { Type clazz = ReflectPlatform.ForName(className); if (clazz == null) { return null; } return GetMethod(clazz, methodName, paramClasses); } public static MethodInfo GetMethod(Type clazz, string methodName, Type[] paramClasses ) { Type curclazz = clazz; while (curclazz != null) { try { return Sharpen.Runtime.GetDeclaredMethod(curclazz, methodName, paramClasses); } catch (Exception) { } curclazz = curclazz.BaseType; } return null; } /// public static object Invoke(object obj, string methodName, Type signature, object value) { return Invoke(obj, methodName, new Type[] { signature }, new object[] { value }); } public static FieldInfo GetField(Type clazz, string name) { Type curclazz = clazz; while (curclazz != null) { try { FieldInfo field = Sharpen.Runtime.GetDeclaredField(curclazz, name); Platform4.SetAccessible(field); if (field != null) { return field; } } catch (Exception) { } curclazz = curclazz.BaseType; } return null; } /// public static object GetFieldValue(object obj, string fieldName) { try { return GetField(obj.GetType(), fieldName).GetValue(obj); } catch (Exception e) { throw new ReflectException(e); } } public static object NewInstance(object template) { try { return System.Activator.CreateInstance(template.GetType()); } catch (Exception e) { throw new ReflectException(e); } } public static string Dump(object obj) { return DumpPreventRecursion(obj, new IdentitySet4(), 2); } private static string DumpPreventRecursion(object obj, IdentitySet4 dumped, int stackLimit ) { stackLimit--; if (obj == null) { return "null"; } Type clazz = obj.GetType(); if (Platform4.IsSimple(clazz)) { return obj.ToString(); } StringBuilder sb = new StringBuilder(); sb.Append(clazz.FullName); sb.Append(" ("); sb.Append(Runtime.IdentityHashCode(obj)); sb.Append(")"); if (dumped.Contains(obj) || stackLimit <= 0) { return sb.ToString(); } dumped.Add(obj); FieldInfo[] fields = Sharpen.Runtime.GetDeclaredFields(clazz); for (int fieldIndex = 0; fieldIndex < fields.Length; ++fieldIndex) { FieldInfo field = fields[fieldIndex]; Platform4.SetAccessible(field); try { if (field.GetValue(null) == field.GetValue(obj)) { continue; } } catch (Exception) { } // static field.getModifiers() wouldn't sharpen sb.Append("\n"); sb.Append("\t"); sb.Append(field.Name); sb.Append(": "); try { sb.Append(DumpPreventRecursion(field.GetValue(obj), dumped, stackLimit)); } catch (Exception e) { sb.Append("Exception caught: "); sb.Append(e); } } return sb.ToString(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/SystemInfoFileImpl.cs0000644000175000017500000000210311700531646030730 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Freespace; namespace Db4objects.Db4o.Internal { /// public class SystemInfoFileImpl : ISystemInfo { private LocalObjectContainer _file; public SystemInfoFileImpl(LocalObjectContainer file) { _file = file; } public virtual int FreespaceEntryCount() { if (!HasFreespaceManager()) { return 0; } return FreespaceManager().SlotCount(); } private bool HasFreespaceManager() { return FreespaceManager() != null; } private IFreespaceManager FreespaceManager() { return _file.FreespaceManager(); } public virtual long FreespaceSize() { if (!HasFreespaceManager()) { return 0; } long blockSize = _file.BlockSize(); long blockedSize = FreespaceManager().TotalFreespace(); return blockSize * blockedSize; } public virtual long TotalSize() { return _file.FileLength(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/0000755000175000017500000000000011700531646025402 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/ITransactionalIdSystem.cs0000644000175000017500000000203111700531646032322 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Ids { /// public interface ITransactionalIdSystem { void CollectCallBackInfo(ICallbackInfoCollector collector); bool IsDirty(); void Commit(FreespaceCommitter freespaceCommitter); Slot CommittedSlot(int id); Slot CurrentSlot(int id); void AccumulateFreeSlots(FreespaceCommitter freespaceCommitter, bool forFreespace ); void Rollback(); void Clear(); bool IsDeleted(int id); void NotifySlotUpdated(int id, Slot slot, SlotChangeFactory slotChangeFactory); void NotifySlotCreated(int id, Slot slot, SlotChangeFactory slotChangeFactory); void NotifySlotDeleted(int id, SlotChangeFactory slotChangeFactory); int NewId(SlotChangeFactory slotChangeFactory); int PrefetchID(); void PrefetchedIDConsumed(int id); void Close(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/PointerBasedIdSystem.cs0000644000175000017500000000561011700531646031774 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Internal.Transactionlog; namespace Db4objects.Db4o.Internal.Ids { /// public sealed class PointerBasedIdSystem : IIdSystem { internal readonly TransactionLogHandler _transactionLogHandler; private readonly LocalObjectContainer _container; public PointerBasedIdSystem(LocalObjectContainer container) { _container = container; _transactionLogHandler = NewTransactionLogHandler(container); } public int NewId() { return _container.AllocatePointerSlot(); } public Slot CommittedSlot(int id) { return _container.ReadPointerSlot(id); } public void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter) { Slot reservedSlot = _transactionLogHandler.AllocateSlot(false, CountSlotChanges(slotChanges )); freespaceCommitter.Commit(); _transactionLogHandler.ApplySlotChanges(slotChanges, CountSlotChanges(slotChanges ), reservedSlot); } private int CountSlotChanges(IVisitable slotChanges) { IntByRef slotChangeCount = new IntByRef(); slotChanges.Accept(new _IVisitor4_40(slotChangeCount)); return slotChangeCount.value; } private sealed class _IVisitor4_40 : IVisitor4 { public _IVisitor4_40(IntByRef slotChangeCount) { this.slotChangeCount = slotChangeCount; } public void Visit(object slotChange) { if (((SlotChange)slotChange).SlotModified()) { slotChangeCount.value++; } } private readonly IntByRef slotChangeCount; } public void ReturnUnusedIds(IVisitable visitable) { visitable.Accept(new _IVisitor4_51(this)); } private sealed class _IVisitor4_51 : IVisitor4 { public _IVisitor4_51(PointerBasedIdSystem _enclosing) { this._enclosing = _enclosing; } public void Visit(object id) { this._enclosing._container.Free((((int)id)), Const4.PointerLength); } private readonly PointerBasedIdSystem _enclosing; } private TransactionLogHandler NewTransactionLogHandler(LocalObjectContainer container ) { bool fileBased = container.Config().FileBasedTransactionLog() && container is IoAdaptedObjectContainer; if (!fileBased) { return new EmbeddedTransactionLogHandler(container); } string fileName = ((IoAdaptedObjectContainer)container).FileName(); return new FileBasedTransactionLogHandler(container, fileName); } public void Close() { _transactionLogHandler.Close(); } public void CompleteInterruptedTransaction(int transactionId1, int transactionId2 ) { _transactionLogHandler.CompleteInterruptedTransaction(transactionId1, transactionId2 ); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/IIdSystem.cs0000644000175000017500000000107211700531646027603 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Ids { /// public interface IIdSystem { int NewId(); Slot CommittedSlot(int id); void ReturnUnusedIds(IVisitable visitable); void Close(); void CompleteInterruptedTransaction(int transactionId1, int transactionId2); void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/IdSlotTree.cs0000644000175000017500000000244311700531646027752 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Ids { /// public class IdSlotTree : TreeInt { private readonly Db4objects.Db4o.Internal.Slots.Slot _slot; public IdSlotTree(int id, Db4objects.Db4o.Internal.Slots.Slot slot) : base(id) { _slot = slot; } public virtual Db4objects.Db4o.Internal.Slots.Slot Slot() { return _slot; } public override Tree OnAttemptToAddDuplicate(Tree oldNode) { _preceding = ((Tree)oldNode._preceding); _subsequent = ((Tree)oldNode._subsequent); _size = oldNode._size; return this; } public override int OwnLength() { return Const4.IntLength * 3; } // _key, _slot._address, _slot._length public override object Read(ByteArrayBuffer buffer) { int id = buffer.ReadInt(); Db4objects.Db4o.Internal.Slots.Slot slot = new Db4objects.Db4o.Internal.Slots.Slot (buffer.ReadInt(), buffer.ReadInt()); return new Db4objects.Db4o.Internal.Ids.IdSlotTree(id, slot); } public override void Write(ByteArrayBuffer buffer) { buffer.WriteInt(_key); buffer.WriteInt(_slot.Address()); buffer.WriteInt(_slot.Length()); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/TransactionalIdSystemImpl.cs0000644000175000017500000001261511700531646033044 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Ids { /// public class TransactionalIdSystemImpl : ITransactionalIdSystem { private IdSlotChanges _slotChanges; private Db4objects.Db4o.Internal.Ids.TransactionalIdSystemImpl _parentIdSystem; private readonly IClosure4 _globalIdSystem; public TransactionalIdSystemImpl(IClosure4 freespaceManager, IClosure4 globalIdSystem , Db4objects.Db4o.Internal.Ids.TransactionalIdSystemImpl parentIdSystem) { _globalIdSystem = globalIdSystem; _slotChanges = new IdSlotChanges(this, freespaceManager); _parentIdSystem = parentIdSystem; } public virtual void CollectCallBackInfo(ICallbackInfoCollector collector) { if (!_slotChanges.IsDirty()) { return; } _slotChanges.TraverseSlotChanges(new _IVisitor4_31(collector)); } private sealed class _IVisitor4_31 : IVisitor4 { public _IVisitor4_31(ICallbackInfoCollector collector) { this.collector = collector; } public void Visit(object slotChange) { int id = ((TreeInt)slotChange)._key; if (((SlotChange)slotChange).IsDeleted()) { if (!((SlotChange)slotChange).IsNew()) { collector.Deleted(id); } } else { if (((SlotChange)slotChange).IsNew()) { collector.Added(id); } else { collector.Updated(id); } } } private readonly ICallbackInfoCollector collector; } public virtual bool IsDirty() { return _slotChanges.IsDirty(); } public virtual void Commit(FreespaceCommitter freespaceCommitter) { IVisitable slotChangeVisitable = new _IVisitable_52(this); freespaceCommitter.TransactionalIdSystem(this); AccumulateFreeSlots(freespaceCommitter, false); GlobalIdSystem().Commit(slotChangeVisitable, freespaceCommitter); } private sealed class _IVisitable_52 : IVisitable { public _IVisitable_52(TransactionalIdSystemImpl _enclosing) { this._enclosing = _enclosing; } public void Accept(IVisitor4 visitor) { this._enclosing.TraverseSlotChanges(visitor); } private readonly TransactionalIdSystemImpl _enclosing; } public virtual void AccumulateFreeSlots(FreespaceCommitter accumulator, bool forFreespace ) { _slotChanges.AccumulateFreeSlots(accumulator, forFreespace, IsSystemIdSystem()); if (_parentIdSystem != null) { _parentIdSystem.AccumulateFreeSlots(accumulator, forFreespace); } } private bool IsSystemIdSystem() { return _parentIdSystem == null; } public virtual void CompleteInterruptedTransaction(int transactionId1, int transactionId2 ) { GlobalIdSystem().CompleteInterruptedTransaction(transactionId1, transactionId2); } public virtual Slot CommittedSlot(int id) { if (id == 0) { return null; } return GlobalIdSystem().CommittedSlot(id); } public virtual Slot CurrentSlot(int id) { Slot slot = ModifiedSlot(id); if (slot != null) { return slot; } return CommittedSlot(id); } public virtual Slot ModifiedSlot(int id) { if (id == 0) { return null; } SlotChange change = _slotChanges.FindSlotChange(id); if (change != null) { if (change.SlotModified()) { return change.NewSlot(); } } return ModifiedSlotInParentIdSystem(id); } public Slot ModifiedSlotInParentIdSystem(int id) { if (_parentIdSystem == null) { return null; } return _parentIdSystem.ModifiedSlot(id); } public virtual void Rollback() { _slotChanges.Rollback(); } public virtual void Clear() { _slotChanges.Clear(); } public virtual bool IsDeleted(int id) { return _slotChanges.IsDeleted(id); } public virtual void NotifySlotUpdated(int id, Slot slot, SlotChangeFactory slotChangeFactory ) { _slotChanges.NotifySlotUpdated(id, slot, slotChangeFactory); } private void TraverseSlotChanges(IVisitor4 visitor) { if (_parentIdSystem != null) { _parentIdSystem.TraverseSlotChanges(visitor); } _slotChanges.TraverseSlotChanges(visitor); } public virtual int NewId(SlotChangeFactory slotChangeFactory) { int id = AcquireId(); _slotChanges.ProduceSlotChange(id, slotChangeFactory).NotifySlotCreated(null); return id; } private int AcquireId() { return GlobalIdSystem().NewId(); } public virtual int PrefetchID() { int id = AcquireId(); _slotChanges.AddPrefetchedID(id); return id; } public virtual void PrefetchedIDConsumed(int id) { _slotChanges.PrefetchedIDConsumed(id); } public virtual void NotifySlotCreated(int id, Slot slot, SlotChangeFactory slotChangeFactory ) { _slotChanges.NotifySlotCreated(id, slot, slotChangeFactory); } public virtual void NotifySlotDeleted(int id, SlotChangeFactory slotChangeFactory ) { _slotChanges.NotifySlotDeleted(id, slotChangeFactory); } private IIdSystem GlobalIdSystem() { return ((IIdSystem)_globalIdSystem.Run()); } public virtual void Close() { _slotChanges.FreePrefetchedIDs(GlobalIdSystem()); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/TransportIdSystem.cs0000644000175000017500000000362711700531646031417 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Ids { /// public sealed class TransportIdSystem : ITransactionalIdSystem { private readonly LocalObjectContainer _container; public TransportIdSystem(LocalObjectContainer localObjectContainer) { _container = localObjectContainer; } public int NewId(SlotChangeFactory slotChangeFactory) { return _container.AllocatePointerSlot(); } public void NotifySlotCreated(int id, Slot slot, SlotChangeFactory slotChangeFactory ) { WritePointer(id, slot); } private void WritePointer(int id, Slot slot) { _container.WritePointer(id, slot); } public void NotifySlotUpdated(int id, Slot slot, SlotChangeFactory slotChangeFactory ) { WritePointer(id, slot); } public void NotifySlotDeleted(int id, SlotChangeFactory slotChangeFactory) { WritePointer(id, Slot.Zero); } public void Commit(FreespaceCommitter accumulator) { } // don't do anything public Slot CurrentSlot(int id) { return CommittedSlot(id); } public void CollectCallBackInfo(ICallbackInfoCollector collector) { } // do nothing public void Clear() { } // TODO Auto-generated method stub public Slot CommittedSlot(int id) { return _container.ReadPointerSlot(id); } public bool IsDeleted(int id) { return false; } public bool IsDirty() { return false; } public int PrefetchID() { return 0; } public void PrefetchedIDConsumed(int id) { } public void Rollback() { } public void Close() { } public void AccumulateFreeSlots(FreespaceCommitter freespaceCommitter, bool forFreespace ) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/IdSlotChanges.cs0000644000175000017500000001035311700531646030422 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Ids { public class IdSlotChanges { private readonly LockedTree _slotChanges = new LockedTree(); private readonly TransactionalIdSystemImpl _idSystem; private readonly IClosure4 _freespaceManager; private TreeInt _prefetchedIDs; public IdSlotChanges(TransactionalIdSystemImpl idSystem, IClosure4 freespaceManager ) { _idSystem = idSystem; _freespaceManager = freespaceManager; } public void AccumulateFreeSlots(FreespaceCommitter freespaceCommitter, bool forFreespace , bool traverseMutable) { IVisitor4 visitor = new _IVisitor4_27(this, freespaceCommitter, forFreespace); if (traverseMutable) { _slotChanges.TraverseMutable(visitor); } else { _slotChanges.TraverseLocked(visitor); } } private sealed class _IVisitor4_27 : IVisitor4 { public _IVisitor4_27(IdSlotChanges _enclosing, FreespaceCommitter freespaceCommitter , bool forFreespace) { this._enclosing = _enclosing; this.freespaceCommitter = freespaceCommitter; this.forFreespace = forFreespace; } public void Visit(object obj) { ((SlotChange)obj).AccumulateFreeSlot(this._enclosing._idSystem, freespaceCommitter , forFreespace); } private readonly IdSlotChanges _enclosing; private readonly FreespaceCommitter freespaceCommitter; private readonly bool forFreespace; } public virtual void Clear() { _slotChanges.Clear(); } public virtual void Rollback() { _slotChanges.TraverseLocked(new _IVisitor4_44(this)); } private sealed class _IVisitor4_44 : IVisitor4 { public _IVisitor4_44(IdSlotChanges _enclosing) { this._enclosing = _enclosing; } public void Visit(object slotChange) { ((SlotChange)slotChange).Rollback(this._enclosing.FreespaceManager()); } private readonly IdSlotChanges _enclosing; } public virtual bool IsDeleted(int id) { SlotChange slot = FindSlotChange(id); if (slot == null) { return false; } return slot.IsDeleted(); } public virtual SlotChange ProduceSlotChange(int id, SlotChangeFactory slotChangeFactory ) { if (DTrace.enabled) { DTrace.ProduceSlotChange.Log(id); } SlotChange slot = slotChangeFactory.NewInstance(id); _slotChanges.Add(slot); return (SlotChange)slot.AddedOrExisting(); } public SlotChange FindSlotChange(int id) { return (SlotChange)_slotChanges.Find(id); } public virtual void TraverseSlotChanges(IVisitor4 visitor) { _slotChanges.TraverseLocked(visitor); } public virtual bool IsDirty() { return !_slotChanges.IsEmpty(); } public virtual void ReadSlotChanges(ByteArrayBuffer buffer) { _slotChanges.Read(buffer, new SlotChange(0)); } public virtual void AddPrefetchedID(int id) { _prefetchedIDs = ((TreeInt)Tree.Add(_prefetchedIDs, new TreeInt(id))); } public virtual void PrefetchedIDConsumed(int id) { _prefetchedIDs = ((TreeInt)_prefetchedIDs.RemoveLike(new TreeInt(id))); } internal void FreePrefetchedIDs(IIdSystem idSystem) { if (_prefetchedIDs == null) { return; } idSystem.ReturnUnusedIds(_prefetchedIDs); _prefetchedIDs = null; } public virtual void NotifySlotCreated(int id, Slot slot, SlotChangeFactory slotChangeFactory ) { ProduceSlotChange(id, slotChangeFactory).NotifySlotCreated(slot); } internal virtual void NotifySlotUpdated(int id, Slot slot, SlotChangeFactory slotChangeFactory ) { ProduceSlotChange(id, slotChangeFactory).NotifySlotUpdated(FreespaceManager(), slot ); } public virtual void NotifySlotDeleted(int id, SlotChangeFactory slotChangeFactory ) { ProduceSlotChange(id, slotChangeFactory).NotifyDeleted(FreespaceManager()); } private IFreespaceManager FreespaceManager() { return ((IFreespaceManager)_freespaceManager.Run()); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/StandardIdSystemFactory.cs0000644000175000017500000000435311700531646032510 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Ids; namespace Db4objects.Db4o.Internal.Ids { /// public class StandardIdSystemFactory { public const byte Legacy = 0; public const byte PointerBased = 1; public const byte StackedBtree = 2; public const byte Default = StackedBtree; public const byte InMemory = 3; public const byte Custom = 4; public const byte SingleBtree = 5; public static IIdSystem NewInstance(LocalObjectContainer localContainer) { SystemData systemData = localContainer.SystemData(); byte idSystemType = systemData.IdSystemType(); switch (idSystemType) { case Legacy: { return new PointerBasedIdSystem(localContainer); } case PointerBased: { return new PointerBasedIdSystem(localContainer); } case StackedBtree: { InMemoryIdSystem inMemoryIdSystem = new InMemoryIdSystem(localContainer); BTreeIdSystem bTreeIdSystem = new BTreeIdSystem(localContainer, inMemoryIdSystem); systemData.FreespaceIdSystem(bTreeIdSystem.FreespaceIdSystem()); return new BTreeIdSystem(localContainer, bTreeIdSystem); } case SingleBtree: { InMemoryIdSystem smallInMemoryIdSystem = new InMemoryIdSystem(localContainer); BTreeIdSystem smallBTreeIdSystem = new BTreeIdSystem(localContainer, smallInMemoryIdSystem ); systemData.FreespaceIdSystem(smallBTreeIdSystem.FreespaceIdSystem()); return smallBTreeIdSystem; } case InMemory: { return new InMemoryIdSystem(localContainer); } case Custom: { IIdSystemFactory customIdSystemFactory = localContainer.ConfigImpl.CustomIdSystemFactory (); if (customIdSystemFactory == null) { throw new Db4oFatalException("Custom IdSystem configured but no factory was found. See IdSystemConfiguration#useCustomSystem()" ); } return customIdSystemFactory.NewInstance(localContainer); } default: { return new PointerBasedIdSystem(localContainer); break; } } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/FreespaceCommitter.cs0000644000175000017500000000403511700531646031514 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Ids { /// public class FreespaceCommitter { public static readonly Db4objects.Db4o.Internal.Ids.FreespaceCommitter DoNothing = new FreespaceCommitter.NullFreespaceCommitter(); private readonly IList _freeToUserFreespaceSystem = new ArrayList(); private readonly IList _freeToSystemFreespaceSystem = new ArrayList(); private readonly IFreespaceManager _freespaceManager; private ITransactionalIdSystem _transactionalIdSystem; public FreespaceCommitter(IFreespaceManager freespaceManager) { _freespaceManager = freespaceManager == null ? NullFreespaceManager.Instance : freespaceManager; } public virtual void Commit() { Apply(_freeToUserFreespaceSystem); _freespaceManager.BeginCommit(); _freespaceManager.Commit(); _transactionalIdSystem.AccumulateFreeSlots(this, true); Apply(_freeToSystemFreespaceSystem); _freespaceManager.EndCommit(); } private void Apply(IList toFree) { for (IEnumerator slotIter = toFree.GetEnumerator(); slotIter.MoveNext(); ) { Slot slot = ((Slot)slotIter.Current); _freespaceManager.Free(slot); } toFree.Clear(); } public virtual void TransactionalIdSystem(ITransactionalIdSystem transactionalIdSystem ) { _transactionalIdSystem = transactionalIdSystem; } private class NullFreespaceCommitter : FreespaceCommitter { public NullFreespaceCommitter() : base(NullFreespaceManager.Instance) { } public override void Commit() { } // do nothing } public virtual void DelayedFree(Slot slot, bool freeToSystemFreeSpaceSystem) { if (freeToSystemFreeSpaceSystem) { _freeToSystemFreespaceSystem.Add(slot); } else { _freeToUserFreespaceSystem.Add(slot); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/InMemoryIdSystem.cs0000644000175000017500000002015411700531646031154 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Ids { /// public class InMemoryIdSystem : IStackableIdSystem { private readonly LocalObjectContainer _container; private IdSlotTree _ids; private Slot _slot; private readonly SequentialIdGenerator _idGenerator; private int _childId; /// for testing purposes only. /// for testing purposes only. public InMemoryIdSystem(LocalObjectContainer container, int maxValidId) { _container = container; _idGenerator = new SequentialIdGenerator(new _IFunction4_32(this, maxValidId), _container .Handlers.LowestValidId(), maxValidId); } private sealed class _IFunction4_32 : IFunction4 { public _IFunction4_32(InMemoryIdSystem _enclosing, int maxValidId) { this._enclosing = _enclosing; this.maxValidId = maxValidId; } public object Apply(object start) { return this._enclosing.FindFreeId((((int)start)), maxValidId); } private readonly InMemoryIdSystem _enclosing; private readonly int maxValidId; } public InMemoryIdSystem(LocalObjectContainer container) : this(container, int.MaxValue ) { ReadThis(); } private void ReadThis() { SystemData systemData = _container.SystemData(); _slot = systemData.IdSystemSlot(); if (!Slot.IsNull(_slot)) { ByteArrayBuffer buffer = _container.ReadBufferBySlot(_slot); _childId = buffer.ReadInt(); _idGenerator.Read(buffer); _ids = (IdSlotTree)new TreeReader(buffer, new IdSlotTree(0, null)).Read(); } } public virtual void Close() { } // do nothing public virtual void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter ) { Slot oldSlot = _slot; Slot reservedSlot = AllocateSlot(false, EstimatedSlotLength(EstimateMappingCount( slotChanges))); // No more operations against the FreespaceManager. // Time to free old slots. freespaceCommitter.Commit(); slotChanges.Accept(new _IVisitor4_69(this)); WriteThis(reservedSlot); FreeSlot(oldSlot); } private sealed class _IVisitor4_69 : IVisitor4 { public _IVisitor4_69(InMemoryIdSystem _enclosing) { this._enclosing = _enclosing; } public void Visit(object slotChange) { if (!((SlotChange)slotChange).SlotModified()) { return; } if (((SlotChange)slotChange).RemoveId()) { this._enclosing._ids = (IdSlotTree)Tree.RemoveLike(this._enclosing._ids, new TreeInt (((TreeInt)slotChange)._key)); return; } if (DTrace.enabled) { DTrace.SlotCommitted.LogLength(((TreeInt)slotChange)._key, ((SlotChange)slotChange ).NewSlot()); } this._enclosing._ids = ((IdSlotTree)Tree.Add(this._enclosing._ids, new IdSlotTree (((TreeInt)slotChange)._key, ((SlotChange)slotChange).NewSlot()))); } private readonly InMemoryIdSystem _enclosing; } private Slot AllocateSlot(bool appendToFile, int slotLength) { if (!appendToFile) { Slot slot = _container.FreespaceManager().AllocateSafeSlot(slotLength); if (slot != null) { return slot; } } return _container.AppendBytes(slotLength); } private int EstimateMappingCount(IVisitable slotChanges) { IntByRef count = new IntByRef(); count.value = _ids == null ? 0 : _ids.Size(); slotChanges.Accept(new _IVisitor4_103(count)); return count.value; } private sealed class _IVisitor4_103 : IVisitor4 { public _IVisitor4_103(IntByRef count) { this.count = count; } public void Visit(object slotChange) { if (!((SlotChange)slotChange).SlotModified() || ((SlotChange)slotChange).RemoveId ()) { return; } count.value++; } private readonly IntByRef count; } private void WriteThis(Slot reservedSlot) { // We need a little dance here to keep filling free slots // with X bytes. The FreespaceManager would do it immediately // upon the free call, but then our CrashSimulatingTestCase // fails because we have the Xses in the file before flushing. Slot xByteSlot = null; int slotLength = SlotLength(); if (reservedSlot.Length() >= slotLength) { _slot = reservedSlot; reservedSlot = null; } else { _slot = AllocateSlot(true, slotLength); } ByteArrayBuffer buffer = new ByteArrayBuffer(_slot.Length()); buffer.WriteInt(_childId); _idGenerator.Write(buffer); TreeInt.Write(buffer, _ids); _container.WriteBytes(buffer, _slot.Address(), 0); _container.SystemData().IdSystemSlot(_slot); IRunnable commitHook = _container.CommitHook(); _container.SyncFiles(commitHook); FreeSlot(reservedSlot); } private void FreeSlot(Slot slot) { if (Slot.IsNull(slot)) { return; } IFreespaceManager freespaceManager = _container.FreespaceManager(); if (freespaceManager == null) { return; } freespaceManager.FreeSafeSlot(slot); } private int SlotLength() { return TreeInt.MarshalledLength(_ids) + _idGenerator.MarshalledLength() + Const4. IdLength; } private int EstimatedSlotLength(int estimatedCount) { IdSlotTree template = _ids; if (template == null) { template = new IdSlotTree(0, new Slot(0, 0)); } return template.MarshalledLength(estimatedCount) + _idGenerator.MarshalledLength( ) + Const4.IdLength; } public virtual Slot CommittedSlot(int id) { IdSlotTree idSlotMapping = (IdSlotTree)Tree.Find(_ids, new TreeInt(id)); if (idSlotMapping == null) { throw new InvalidIDException(id); } return idSlotMapping.Slot(); } public virtual void CompleteInterruptedTransaction(int address, int length) { } // do nothing public virtual int NewId() { int id = _idGenerator.NewId(); _ids = ((IdSlotTree)Tree.Add(_ids, new IdSlotTree(id, Slot.Zero))); return id; } private int FindFreeId(int start, int end) { if (_ids == null) { return start; } IntByRef lastId = new IntByRef(); IntByRef freeId = new IntByRef(); Tree.Traverse(_ids, new TreeInt(start), new _ICancellableVisitor4_204(lastId, start , freeId)); if (freeId.value > 0) { return freeId.value; } if (lastId.value < end) { return Math.Max(start, lastId.value + 1); } return 0; } private sealed class _ICancellableVisitor4_204 : ICancellableVisitor4 { public _ICancellableVisitor4_204(IntByRef lastId, int start, IntByRef freeId) { this.lastId = lastId; this.start = start; this.freeId = freeId; } public bool Visit(object node) { int id = ((TreeInt)node)._key; if (lastId.value == 0) { if (id > start) { freeId.value = start; return false; } lastId.value = id; return true; } if (id > lastId.value + 1) { freeId.value = lastId.value + 1; return false; } lastId.value = id; return true; } private readonly IntByRef lastId; private readonly int start; private readonly IntByRef freeId; } public virtual void ReturnUnusedIds(IVisitable visitable) { visitable.Accept(new _IVisitor4_233(this)); } private sealed class _IVisitor4_233 : IVisitor4 { public _IVisitor4_233(InMemoryIdSystem _enclosing) { this._enclosing = _enclosing; } public void Visit(object obj) { this._enclosing._ids = (IdSlotTree)Tree.RemoveLike(this._enclosing._ids, new TreeInt ((((int)obj)))); } private readonly InMemoryIdSystem _enclosing; } public virtual int ChildId() { return _childId; } public virtual void ChildId(int id) { _childId = id; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/IdSlotMapping.cs0000644000175000017500000000234411700531646030446 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Ids { /// public class IdSlotMapping { public int _id; public int _address; public int _length; public IdSlotMapping(int id, int address, int length) { // persistent and indexed in DatabaseIdMapping, don't change the name _id = id; _address = address; _length = length; } public IdSlotMapping(int id, Db4objects.Db4o.Internal.Slots.Slot slot) : this(id, slot.Address(), slot.Length()) { } public virtual Db4objects.Db4o.Internal.Slots.Slot Slot() { return new Db4objects.Db4o.Internal.Slots.Slot(_address, _length); } public virtual void Write(ByteArrayBuffer buffer) { buffer.WriteInt(_id); buffer.WriteInt(_address); buffer.WriteInt(_length); } public static Db4objects.Db4o.Internal.Ids.IdSlotMapping Read(ByteArrayBuffer buffer ) { return new Db4objects.Db4o.Internal.Ids.IdSlotMapping(buffer.ReadInt(), buffer.ReadInt (), buffer.ReadInt()); } public override string ToString() { return string.Empty + _id + ":" + _address + "," + _length; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/SequentialIdGenerator.cs0000644000175000017500000000446111700531646032174 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Ids { /// public class SequentialIdGenerator { private readonly int _minValidId; private readonly int _maxValidId; private int _idGenerator; private bool _overflow; private int _lastIdGenerator; private readonly IFunction4 _findFreeId; public SequentialIdGenerator(IFunction4 findFreeId, int initialValue, int minValidId , int maxValidId) { _findFreeId = findFreeId; _minValidId = minValidId; _maxValidId = maxValidId; InitializeGenerator(initialValue); } public SequentialIdGenerator(IFunction4 findFreeId, int minValidId, int maxValidId ) : this(findFreeId, minValidId - 1, minValidId, maxValidId) { } public virtual void Read(ByteArrayBuffer buffer) { InitializeGenerator(buffer.ReadInt()); } private void InitializeGenerator(int val) { if (val < 0) { _overflow = true; _idGenerator = -val; } else { _idGenerator = val; } _lastIdGenerator = _idGenerator; } public virtual void Write(ByteArrayBuffer buffer) { buffer.WriteInt(PersistentGeneratorValue()); } public virtual int PersistentGeneratorValue() { return _overflow ? -_idGenerator : _idGenerator; } public virtual int NewId() { AdjustIdGenerator(_idGenerator); if (!_overflow) { return _idGenerator; } int id = (((int)_findFreeId.Apply(_idGenerator))); if (id > 0) { AdjustIdGenerator(id - 1); return id; } id = (((int)_findFreeId.Apply(_minValidId))); if (id > 0) { AdjustIdGenerator(id - 1); return id; } throw new Db4oFatalException("Out of IDs"); } private void AdjustIdGenerator(int id) { if (id == _maxValidId) { _idGenerator = _minValidId; _overflow = true; return; } _idGenerator = id + 1; } public virtual int MarshalledLength() { return Const4.IntLength; } public virtual bool IsDirty() { return _idGenerator != _lastIdGenerator; } public virtual void SetClean() { _lastIdGenerator = _idGenerator; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/IStackableIdSystem.cs0000644000175000017500000000043211700531646031414 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Ids; namespace Db4objects.Db4o.Internal.Ids { /// public interface IStackableIdSystem : IIdSystem { int ChildId(); void ChildId(int id); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Ids/BTreeIdSystem.cs0000644000175000017500000002022011700531646030410 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Ids { /// public class BTreeIdSystem : IStackableIdSystem { private const int BtreeIdIndex = 0; private const int IdGeneratorIndex = 1; private const int ChildIdIndex = 2; private readonly LocalObjectContainer _container; private readonly IStackableIdSystem _parentIdSystem; private readonly ITransactionalIdSystem _transactionalIdSystem; private readonly SequentialIdGenerator _idGenerator; private BTree _bTree; private PersistentIntegerArray _persistentState; public BTreeIdSystem(LocalObjectContainer container, IStackableIdSystem parentIdSystem , int maxValidId) { _container = container; _parentIdSystem = parentIdSystem; _transactionalIdSystem = container.NewTransactionalIdSystem(null, new _IClosure4_40 (parentIdSystem)); int persistentArrayId = parentIdSystem.ChildId(); if (persistentArrayId == 0) { InitializeNew(); } else { InitializeExisting(persistentArrayId); } _idGenerator = new SequentialIdGenerator(new _IFunction4_52(this), IdGeneratorValue (), _container.Handlers.LowestValidId(), maxValidId); } private sealed class _IClosure4_40 : IClosure4 { public _IClosure4_40(IStackableIdSystem parentIdSystem) { this.parentIdSystem = parentIdSystem; } public object Run() { return parentIdSystem; } private readonly IStackableIdSystem parentIdSystem; } private sealed class _IFunction4_52 : IFunction4 { public _IFunction4_52(BTreeIdSystem _enclosing) { this._enclosing = _enclosing; } public object Apply(object start) { return this._enclosing.FindFreeId((((int)start))); } private readonly BTreeIdSystem _enclosing; } public BTreeIdSystem(LocalObjectContainer container, IStackableIdSystem idSystem) : this(container, idSystem, int.MaxValue) { } private void InitializeExisting(int persistentArrayId) { _persistentState = new PersistentIntegerArray(SlotChangeFactory.IdSystem, _transactionalIdSystem , persistentArrayId); _persistentState.Read(Transaction()); _bTree = new BTree(Transaction(), BTreeConfiguration(), BTreeId(), new BTreeIdSystem.IdSlotMappingHandler ()); } private Db4objects.Db4o.Internal.Btree.BTreeConfiguration BTreeConfiguration() { return new Db4objects.Db4o.Internal.Btree.BTreeConfiguration(_transactionalIdSystem , SlotChangeFactory.IdSystem, 64, false); } private int IdGeneratorValue() { return _persistentState.Array()[IdGeneratorIndex]; } private void IdGeneratorValue(int value) { _persistentState.Array()[IdGeneratorIndex] = value; } private int BTreeId() { return _persistentState.Array()[BtreeIdIndex]; } private void InitializeNew() { _bTree = new BTree(Transaction(), BTreeConfiguration(), new BTreeIdSystem.IdSlotMappingHandler ()); int idGeneratorValue = _container.Handlers.LowestValidId() - 1; _persistentState = new PersistentIntegerArray(SlotChangeFactory.IdSystem, _transactionalIdSystem , new int[] { _bTree.GetID(), idGeneratorValue, 0 }); _persistentState.Write(Transaction()); _parentIdSystem.ChildId(_persistentState.GetID()); } private int FindFreeId(int start) { throw new NotImplementedException(); } public virtual void Close() { } public virtual Slot CommittedSlot(int id) { IdSlotMapping mapping = (IdSlotMapping)_bTree.Search(Transaction(), new IdSlotMapping (id, 0, 0)); if (mapping == null) { throw new InvalidIDException(id); } return mapping.Slot(); } public virtual void CompleteInterruptedTransaction(int transactionId1, int transactionId2 ) { } // do nothing public virtual int NewId() { int id = _idGenerator.NewId(); _bTree.Add(Transaction(), new IdSlotMapping(id, 0, 0)); return id; } private Db4objects.Db4o.Internal.Transaction Transaction() { return _container.SystemTransaction(); } public virtual void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter ) { _container.FreespaceManager().BeginCommit(); slotChanges.Accept(new _IVisitor4_129(this)); // TODO: Maybe we want a BTree that doesn't allow duplicates. // Then we could do the following in one step without removing first. _bTree.Commit(Transaction()); IdGeneratorValue(_idGenerator.PersistentGeneratorValue()); if (_idGenerator.IsDirty()) { _idGenerator.SetClean(); _persistentState.SetStateDirty(); } if (_persistentState.IsDirty()) { _persistentState.Write(Transaction()); } _container.FreespaceManager().EndCommit(); _transactionalIdSystem.Commit(freespaceCommitter); _transactionalIdSystem.Clear(); } private sealed class _IVisitor4_129 : IVisitor4 { public _IVisitor4_129(BTreeIdSystem _enclosing) { this._enclosing = _enclosing; } public void Visit(object slotChange) { if (!((SlotChange)slotChange).SlotModified()) { return; } this._enclosing._bTree.Remove(this._enclosing.Transaction(), new IdSlotMapping((( TreeInt)slotChange)._key, 0, 0)); if (((SlotChange)slotChange).RemoveId()) { return; } this._enclosing._bTree.Add(this._enclosing.Transaction(), new IdSlotMapping(((TreeInt )slotChange)._key, ((SlotChange)slotChange).NewSlot())); if (DTrace.enabled) { DTrace.SlotMapped.LogLength(((TreeInt)slotChange)._key, ((SlotChange)slotChange). NewSlot()); } } private readonly BTreeIdSystem _enclosing; } public virtual void ReturnUnusedIds(IVisitable visitable) { visitable.Accept(new _IVisitor4_167(this)); } private sealed class _IVisitor4_167 : IVisitor4 { public _IVisitor4_167(BTreeIdSystem _enclosing) { this._enclosing = _enclosing; } public void Visit(object id) { this._enclosing._bTree.Remove(this._enclosing.Transaction(), new IdSlotMapping((( (int)id)), 0, 0)); } private readonly BTreeIdSystem _enclosing; } public class IdSlotMappingHandler : IIndexable4 { public virtual void DefragIndexEntry(DefragmentContextImpl context) { throw new NotImplementedException(); } public virtual object ReadIndexEntry(IContext context, ByteArrayBuffer buffer) { return IdSlotMapping.Read(buffer); } public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer buffer, object mapping) { ((IdSlotMapping)mapping).Write(buffer); } public virtual IPreparedComparison PrepareComparison(IContext context, object sourceMapping ) { return new _IPreparedComparison_190(sourceMapping); } private sealed class _IPreparedComparison_190 : IPreparedComparison { public _IPreparedComparison_190(object sourceMapping) { this.sourceMapping = sourceMapping; } public int CompareTo(object targetMapping) { return ((IdSlotMapping)sourceMapping)._id == ((IdSlotMapping)targetMapping)._id ? 0 : (((IdSlotMapping)sourceMapping)._id < ((IdSlotMapping)targetMapping)._id ? - 1 : 1); } private readonly object sourceMapping; } public int LinkLength() { return Const4.IntLength * 3; } } public virtual ITransactionalIdSystem FreespaceIdSystem() { return _transactionalIdSystem; } public virtual int ChildId() { return _persistentState.Array()[ChildIdIndex]; } public virtual void ChildId(int id) { _persistentState.Array()[ChildIdIndex] = id; _persistentState.SetStateDirty(); } public virtual void TraverseIds(IVisitor4 visitor) { _bTree.TraverseKeys(_container.SystemTransaction(), visitor); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/0000755000175000017500000000000011700531646026423 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Versions/0000755000175000017500000000000011700531646030233 5ustar00meebeymeebey00000000000000OpenTypeHandler2.cs0000644000175000017500000000123411700531646033626 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Versions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers.Versions; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers.Versions { /// public class OpenTypeHandler2 : OpenTypeHandler7 { public OpenTypeHandler2(ObjectContainerBase container) : base(container) { } protected override void SeekSecondaryOffset(IReadBuffer buffer, ITypeHandler4 typeHandler ) { if (Handlers4.HandlesPrimitiveArray(typeHandler)) { buffer.Seek(buffer.ReadInt()); } } } } OpenTypeHandler7.cs0000644000175000017500000000733011700531646033636 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Versions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers.Versions { public class OpenTypeHandler7 : OpenTypeHandler { public OpenTypeHandler7(ObjectContainerBase container) : base(container) { } public override object Read(IReadContext readContext) { IInternalReadContext context = (IInternalReadContext)readContext; int payloadOffset = context.ReadInt(); if (payloadOffset == 0) { context.NotifyNullReferenceSkipped(); return null; } int savedOffSet = context.Offset(); try { ITypeHandler4 typeHandler = ReadTypeHandler(context, payloadOffset); if (typeHandler == null) { return null; } if (IsPlainObject(typeHandler)) { return ReadPlainObject(readContext); } SeekSecondaryOffset(context, typeHandler); return context.ReadAtCurrentSeekPosition(typeHandler); } finally { context.Seek(savedOffSet); } } public override void Defragment(IDefragmentContext context) { int payLoadOffSet = context.ReadInt(); if (payLoadOffSet == 0) { return; } int savedOffSet = context.Offset(); context.Seek(payLoadOffSet); int classMetadataId = context.CopyIDReturnOriginalID(); ITypeHandler4 typeHandler = CorrectTypeHandlerVersionFor(context, classMetadataId ); if (typeHandler != null) { if (IsPlainObject(typeHandler)) { context.CopySlotlessID(); } else { SeekSecondaryOffset(context, typeHandler); context.Defragment(typeHandler); } } context.Seek(savedOffSet); } private object ReadPlainObject(IReadContext context) { int id = context.ReadInt(); Transaction transaction = context.Transaction(); object obj = transaction.ObjectForIdFromCache(id); if (obj != null) { return obj; } obj = new object(); AddReference(context, obj, id); return obj; } private void AddReference(IContext context, object obj, int id) { Transaction transaction = context.Transaction(); ObjectReference @ref = new _ObjectReference_74(id); @ref.ClassMetadata(transaction.Container().ClassMetadataForID(Handlers4.UntypedId )); @ref.SetObjectWeak(transaction.Container(), obj); transaction.AddNewReference(@ref); } private sealed class _ObjectReference_74 : ObjectReference { public _ObjectReference_74(int baseArg1) : base(baseArg1) { this._firstUpdate = true; } internal bool _firstUpdate; public override void WriteUpdate(Transaction transaction, IUpdateDepth updatedepth ) { if (!this._firstUpdate) { base.WriteUpdate(transaction, updatedepth); return; } this._firstUpdate = false; ObjectContainerBase container = transaction.Container(); this.SetStateClean(); MarshallingContext context = new MarshallingContext(transaction, this, updatedepth , false); Handlers4.Write(this.ClassMetadata().TypeHandler(), context, this.GetObject()); int length = this.Container().BlockConverter().BlockAlignedBytes(context.MarshalledLength ()); Slot slot = context.AllocateNewSlot(length); Pointer4 pointer = new Pointer4(this.GetID(), slot); ByteArrayBuffer buffer = context.ToWriteBuffer(pointer); container.WriteUpdate(transaction, pointer, this.ClassMetadata(), ArrayType.None, buffer); if (this.IsActive()) { this.SetStateClean(); } } } } } OpenTypeHandler0.cs0000644000175000017500000000625211700531646033631 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Versions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.IO; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers.Versions; using Db4objects.Db4o.Internal.Mapping; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers.Versions { /// public class OpenTypeHandler0 : OpenTypeHandler2 { public OpenTypeHandler0(ObjectContainerBase container) : base(container) { } public override object Read(IReadContext context) { return context.ReadObject(); } public override ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { int id = 0; int offset = context.Offset(); try { id = context.ReadInt(); } catch (Exception) { } context.Seek(offset); if (id != 0) { StatefulBuffer reader = context.Container().ReadStatefulBufferById(context.Transaction (), id); if (reader != null) { ObjectHeader oh = new ObjectHeader(context.Container(), reader); try { if (oh.ClassMetadata() != null) { context.Buffer(reader); return oh.ClassMetadata().SeekCandidateHandler(context); } } catch (Exception e) { } } } // TODO: Check Exception Types // Errors typically occur, if classes don't match return null; } public override ObjectID ReadObjectID(IInternalReadContext context) { int id = context.ReadInt(); return id == 0 ? ObjectID.IsNull : new ObjectID(id); } public override void Defragment(IDefragmentContext context) { int sourceId = context.SourceBuffer().ReadInt(); if (sourceId == 0) { context.TargetBuffer().WriteInt(0); return; } int targetId = 0; try { targetId = context.MappedID(sourceId); } catch (MappingNotFoundException) { targetId = CopyDependentSlot(context, sourceId); } context.TargetBuffer().WriteInt(targetId); } private int CopyDependentSlot(IDefragmentContext context, int sourceId) { try { ByteArrayBuffer sourceBuffer = context.SourceBufferById(sourceId); Slot targetPayloadSlot = context.AllocateTargetSlot(sourceBuffer.Length()); int targetId = context.Services().TargetNewId(); context.Services().MapIDs(sourceId, targetId, false); context.Services().Mapping().MapId(targetId, targetPayloadSlot); DefragmentContextImpl payloadContext = new DefragmentContextImpl(sourceBuffer, (DefragmentContextImpl )context); int clazzId = payloadContext.CopyIDReturnOriginalID(); ITypeHandler4 payloadHandler = payloadContext.TypeHandlerForId(clazzId); ITypeHandler4 versionedPayloadHandler = HandlerRegistry.CorrectHandlerVersion(payloadContext , payloadHandler); versionedPayloadHandler.Defragment(payloadContext); payloadContext.WriteToTarget(targetPayloadSlot.Address()); return targetId; } catch (IOException ioexc) { throw new Db4oIOException(ioexc); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/DateHandler0.cs0000644000175000017500000000075411700531646031213 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { /// public class DateHandler0 : DateHandler { public override object Read(IReadContext context) { long value = context.ReadLong(); if (value == long.MaxValue) { return PrimitiveNull(); } return new DateTime(value); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/DoubleHandler0.cs0000644000175000017500000000066511700531646031551 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { public class DoubleHandler0 : DoubleHandler { public override object Read(IReadContext context) { double value = (double)base.Read(context); if (double.IsNaN(value)) { return null; } return value; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/NetTypeHandler.cs0000644000175000017500000000502711700531646031644 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers { /// public abstract class NetTypeHandler : PrimitiveHandler, INetType { private int i_linkLength; public virtual string DotNetClassName() { string className = this.GetType().FullName; int pos = className.IndexOf(".Net"); if (pos >= 0) { return "System." + Sharpen.Runtime.Substring(className, pos + 4) + ", mscorlib"; } return DefaultValue().GetType().FullName; } public override void RegisterReflector(IReflector reflector) { base.RegisterReflector(reflector); byte[] bytes = new byte[65]; for (int i = 0; i < bytes.Length; i++) { bytes[i] = 55; } // TODO: Why 55? This is a '7'. Remove. Write(PrimitiveNull(), bytes, 0); for (int i = 0; i < bytes.Length; i++) { if (bytes[i] == 55) { i_linkLength = i; break; } } } public virtual int GetID() { return TypeID(); } // This method is needed for NetSimpleTypeHandler only during // initalisation and overloaded there. No abstract declaration // here, so we don't have to implement the methods on .NET. public virtual string GetName() { return DotNetClassName(); } public override int LinkLength() { return i_linkLength; } public override Type PrimitiveJavaClass() { return DefaultValue().GetType(); } protected override Type JavaClass() { return base.JavaClass(); } public abstract object Read(byte[] bytes, int offset); /// internal override object Read1(ByteArrayBuffer a_bytes) { int offset = a_bytes._offset; object ret = Read(a_bytes._buffer, a_bytes._offset); a_bytes._offset = offset + LinkLength(); return ret; } public abstract int TypeID(); public abstract void Write(object obj, byte[] bytes, int offset); public override void Write(object a_object, ByteArrayBuffer a_bytes) { int offset = a_bytes._offset; if (a_object != null) { Write(a_object, a_bytes._buffer, a_bytes._offset); } a_bytes._offset = offset + LinkLength(); } public override IPreparedComparison InternalPrepareComparison(object obj) { throw new NotImplementedException(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/DateHandlerBase.cs0000644000175000017500000000531311700531646031722 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers { /// Shared (java/.net) logic for Date handling. /// Shared (java/.net) logic for Date handling. public abstract class DateHandlerBase : LongHandler { public override object Coerce(IReflectClass claxx, object obj) { return ClassReflector().IsAssignableFrom(claxx) ? obj : No4.Instance; } public abstract object CopyValue(object from, object to); public abstract override object DefaultValue(); public abstract override object NullRepresentationInUntypedArrays(); public override Type PrimitiveJavaClass() { return null; } protected override Type JavaClass() { return DefaultValue().GetType(); } /// public override object Read(MarshallerFamily mf, StatefulBuffer writer, bool redirect ) { return mf._primitive.ReadDate(writer); } internal override object Read1(ByteArrayBuffer a_bytes) { return PrimitiveMarshaller().ReadDate(a_bytes); } public override void Write(object a_object, ByteArrayBuffer a_bytes) { // TODO: This is a temporary fix to prevent exceptions with // Marshaller.LEGACY. if (a_object == null) { a_object = new DateTime(0); } a_bytes.WriteLong(((DateTime)a_object).Ticks); } public static string Now() { return Platform4.Format(Platform4.Now(), true); } public override object Read(IReadContext context) { long milliseconds = ((long)base.Read(context)); return new DateTime(milliseconds); } public override void Write(IWriteContext context, object obj) { long milliseconds = ((DateTime)obj).Ticks; base.Write(context, milliseconds); } public override IPreparedComparison InternalPrepareComparison(object source) { long sourceDate = ((DateTime)source).Ticks; return new _IPreparedComparison_69(sourceDate); } private sealed class _IPreparedComparison_69 : IPreparedComparison { public _IPreparedComparison_69(long sourceDate) { this.sourceDate = sourceDate; } public int CompareTo(object target) { if (target == null) { return 1; } long targetDate = ((DateTime)target).Ticks; return sourceDate == targetDate ? 0 : (sourceDate < targetDate ? -1 : 1); } private readonly long sourceDate; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/HandlerVersion.cs0000644000175000017500000000116511700531646031700 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Handlers { /// public class HandlerVersion { public readonly int _number; public static readonly Db4objects.Db4o.Internal.Handlers.HandlerVersion Invalid = new Db4objects.Db4o.Internal.Handlers.HandlerVersion(-1); public HandlerVersion(int number) { _number = number; } public override bool Equals(object obj) { if (this == obj) { return true; } return ((Db4objects.Db4o.Internal.Handlers.HandlerVersion)obj)._number == _number; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/LongHandler.cs0000644000175000017500000000615311700531646031154 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers { /// public class LongHandler : PrimitiveHandler { private static readonly long Defaultvalue = System.Convert.ToInt64(0); public override object Coerce(IReflectClass claxx, object obj) { return Coercion4.ToLong(obj); } public override object DefaultValue() { return Defaultvalue; } public override Type PrimitiveJavaClass() { return typeof(long); } public override int LinkLength() { return Const4.LongLength; } /// public override object Read(MarshallerFamily mf, StatefulBuffer buffer, bool redirect ) { return mf._primitive.ReadLong(buffer); } internal override object Read1(ByteArrayBuffer a_bytes) { return a_bytes.ReadLong(); } public override void Write(object obj, ByteArrayBuffer buffer) { WriteLong(buffer, ((long)obj)); } public static void WriteLong(IWriteBuffer buffer, long val) { if (Deploy.debug && Deploy.debugLong) { string l_s = " " + val; new LatinStringIO().Write(buffer, Sharpen.Runtime.Substring(l_s, l_s.Length - Const4 .LongBytes)); } else { for (int i = 0; i < Const4.LongBytes; i++) { buffer.WriteByte((byte)(val >> ((Const4.LongBytes - 1 - i) * 8))); } } } public static long ReadLong(IReadBuffer buffer) { long ret = 0; if (Deploy.debug && Deploy.debugLong) { ret = long.Parse(new LatinStringIO().Read(buffer, Const4.LongBytes).Trim()); } else { for (int i = 0; i < Const4.LongBytes; i++) { ret = (ret << 8) + (buffer.ReadByte() & unchecked((int)(0xff))); } } return ret; } public override object Read(IReadContext context) { return context.ReadLong(); } public override void Write(IWriteContext context, object obj) { context.WriteLong(((long)obj)); } public static int Compare(long first, long second) { if (first == second) { return 0; } return first > second ? 1 : -1; } public override IPreparedComparison InternalPrepareComparison(object source) { long sourceLong = ((long)source); return new _IPreparedComparison_102(sourceLong); } private sealed class _IPreparedComparison_102 : IPreparedComparison { public _IPreparedComparison_102(long sourceLong) { this.sourceLong = sourceLong; } public int CompareTo(object target) { if (target == null) { return 1; } long targetLong = ((long)target); return LongHandler.Compare(sourceLong, targetLong); } private readonly long sourceLong; } } } IVariableLengthTypeHandler.cs0000644000175000017500000000061611700531646034036 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers { /// /// marker interface for TypeHandlers where the slot /// length can change, depending on the object stored /// /// public interface IVariableLengthTypeHandler : ITypeHandler4 { } } StandardReferenceTypeHandler0.cs0000644000175000017500000000233611700531646034476 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { /// public class StandardReferenceTypeHandler0 : StandardReferenceTypeHandler { protected override IMarshallingInfo EnsureFieldList(IMarshallingInfo context) { return new _IMarshallingInfo_16(context); } private sealed class _IMarshallingInfo_16 : IMarshallingInfo { public _IMarshallingInfo_16(IMarshallingInfo context) { this.context = context; } public void DeclaredAspectCount(int count) { context.DeclaredAspectCount(count); } public int DeclaredAspectCount() { return context.DeclaredAspectCount(); } public bool IsNull(int fieldIndex) { return false; } public ClassMetadata ClassMetadata() { return context.ClassMetadata(); } public IReadBuffer Buffer() { return context.Buffer(); } public void BeginSlot() { context.BeginSlot(); } private readonly IMarshallingInfo context; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/ByteHandler.cs0000644000175000017500000000362611700531646031162 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers { public sealed class ByteHandler : PrimitiveHandler { internal const int Length = 1 + Const4.AddedLength; private static readonly byte Defaultvalue = (byte)0; public override object Coerce(IReflectClass claxx, object obj) { return Coercion4.ToByte(obj); } public override object DefaultValue() { return Defaultvalue; } public override int LinkLength() { return Length; } public override Type PrimitiveJavaClass() { return typeof(byte); } internal override object Read1(ByteArrayBuffer a_bytes) { byte ret = a_bytes.ReadByte(); return ret; } public override void Write(object a_object, ByteArrayBuffer a_bytes) { a_bytes.WriteByte(((byte)a_object)); } public override object Read(IReadContext context) { byte byteValue = context.ReadByte(); return byteValue; } public override void Write(IWriteContext context, object obj) { context.WriteByte(((byte)obj)); } public override IPreparedComparison InternalPrepareComparison(object source) { byte sourceByte = ((byte)source); return new _IPreparedComparison_82(sourceByte); } private sealed class _IPreparedComparison_82 : IPreparedComparison { public _IPreparedComparison_82(byte sourceByte) { this.sourceByte = sourceByte; } public int CompareTo(object target) { if (target == null) { return 1; } byte targetByte = ((byte)target); return sourceByte == targetByte ? 0 : (sourceByte < targetByte ? -1 : 1); } private readonly byte sourceByte; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/ShortHandler.cs0000644000175000017500000000514211700531646031351 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers { public class ShortHandler : PrimitiveHandler { internal const int Length = Const4.ShortBytes + Const4.AddedLength; private static readonly short Defaultvalue = (short)0; public override object Coerce(IReflectClass claxx, object obj) { return Coercion4.ToShort(obj); } public override object DefaultValue() { return Defaultvalue; } public override int LinkLength() { return Length; } public override Type PrimitiveJavaClass() { return typeof(short); } /// public override object Read(MarshallerFamily mf, StatefulBuffer buffer, bool redirect ) { return mf._primitive.ReadShort(buffer); } internal override object Read1(ByteArrayBuffer buffer) { return PrimitiveMarshaller().ReadShort(buffer); } public override void Write(object a_object, ByteArrayBuffer a_bytes) { WriteShort(((short)a_object), a_bytes); } internal static void WriteShort(int a_short, ByteArrayBuffer a_bytes) { for (int i = 0; i < Const4.ShortBytes; i++) { a_bytes._buffer[a_bytes._offset++] = (byte)(a_short >> ((Const4.ShortBytes - 1 - i) * 8)); } } public override object Read(IReadContext context) { int value = ((context.ReadByte() & unchecked((int)(0xff))) << 8) + (context.ReadByte () & unchecked((int)(0xff))); return (short)value; } public override void Write(IWriteContext context, object obj) { int shortValue = ((short)obj); context.WriteBytes(new byte[] { (byte)(shortValue >> 8), (byte)shortValue }); } public override IPreparedComparison InternalPrepareComparison(object source) { short sourceShort = ((short)source); return new _IPreparedComparison_86(sourceShort); } private sealed class _IPreparedComparison_86 : IPreparedComparison { public _IPreparedComparison_86(short sourceShort) { this.sourceShort = sourceShort; } public int CompareTo(object target) { if (target == null) { return 1; } short targetShort = ((short)target); return sourceShort == targetShort ? 0 : (sourceShort < targetShort ? -1 : 1); } private readonly short sourceShort; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/BooleanHandler.cs0000644000175000017500000000462711700531646031640 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { /// public sealed class BooleanHandler : PrimitiveHandler { internal const int Length = 1 + Const4.AddedLength; private const byte True = (byte)'T'; private const byte False = (byte)'F'; private const byte Null = (byte)'N'; private static readonly bool Defaultvalue = false; public override object DefaultValue() { return Defaultvalue; } public override int LinkLength() { return Length; } public override Type PrimitiveJavaClass() { return typeof(bool); } internal override object Read1(ByteArrayBuffer a_bytes) { byte ret = a_bytes.ReadByte(); if (ret == True) { return true; } if (ret == False) { return false; } return null; } public override void Write(object obj, ByteArrayBuffer buffer) { buffer.WriteByte(GetEncodedByteValue(obj)); } private byte GetEncodedByteValue(object obj) { if (obj == null) { return Null; } if (((bool)obj)) { return True; } return False; } public override object Read(IReadContext context) { byte ret = context.ReadByte(); if (ret == True) { return true; } if (ret == False) { return false; } return null; } public override void Write(IWriteContext context, object obj) { context.WriteByte(GetEncodedByteValue(obj)); } public override object NullRepresentationInUntypedArrays() { return null; } public override IPreparedComparison InternalPrepareComparison(object source) { bool sourceBoolean = ((bool)source); return new _IPreparedComparison_111(sourceBoolean); } private sealed class _IPreparedComparison_111 : IPreparedComparison { public _IPreparedComparison_111(bool sourceBoolean) { this.sourceBoolean = sourceBoolean; } public int CompareTo(object target) { if (target == null) { return 1; } bool targetBoolean = ((bool)target); return sourceBoolean == targetBoolean ? 0 : (sourceBoolean ? 1 : -1); } private readonly bool sourceBoolean; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/FloatHandler0.cs0000644000175000017500000000066011700531646031377 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { public class FloatHandler0 : FloatHandler { public override object Read(IReadContext context) { float value = (float)base.Read(context); if (float.IsNaN(value)) { return null; } return value; } } } TypeHandlerPredicatePair.cs0000644000175000017500000000077211700531646033555 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers { /// public class TypeHandlerPredicatePair { public readonly ITypeHandlerPredicate _predicate; public readonly ITypeHandler4 _typeHandler; public TypeHandlerPredicatePair(ITypeHandlerPredicate predicate, ITypeHandler4 typeHandler ) { _predicate = predicate; _typeHandler = typeHandler; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/0000755000175000017500000000000011700531646027501 5ustar00meebeymeebey00000000000000MultidimensionalArrayHandler0.cs0000644000175000017500000000255011700531646035645 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers.Array { /// public class MultidimensionalArrayHandler0 : MultidimensionalArrayHandler3 { protected override ArrayVersionHelper CreateVersionHelper() { return new ArrayVersionHelper0(); } public override object Read(IReadContext readContext) { IInternalReadContext context = (IInternalReadContext)readContext; ByteArrayBuffer buffer = (ByteArrayBuffer)context.ReadIndirectedBuffer(); if (buffer == null) { return null; } // With the following line we ask the context to work with // a different buffer. Should this logic ever be needed by // a user handler, it should be implemented by using a Queue // in the UnmarshallingContext. // The buffer has to be set back from the outside! See below IReadBuffer contextBuffer = context.Buffer(buffer); object array = base.Read(context); // The context buffer has to be set back. context.Buffer(contextBuffer); return array; } public override void Defragment(IDefragmentContext context) { ArrayHandler0.Defragment(context, this); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/ArrayHandler0.cs0000644000175000017500000000603211700531646032465 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.IO; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Handlers.Array { /// public class ArrayHandler0 : ArrayHandler1 { protected override ArrayVersionHelper CreateVersionHelper() { return new ArrayVersionHelper0(); } protected override void WithContent(AbstractBufferContext context, IRunnable runnable ) { int address = context.ReadInt(); int length = context.ReadInt(); if (address == 0) { return; } IReadBuffer temp = context.Buffer(); ByteArrayBuffer indirectedBuffer = Container(context).DecryptedBufferByAddress(address , length); context.Buffer(indirectedBuffer); runnable.Run(); context.Buffer(temp); } /// public override void Delete(IDeleteContext context) { context.ReadSlot(); context.DefragmentRecommended(); } public override object Read(IReadContext readContext) { IInternalReadContext context = (IInternalReadContext)readContext; ByteArrayBuffer buffer = (ByteArrayBuffer)context.ReadIndirectedBuffer(); if (buffer == null) { return null; } // With the following line we ask the context to work with // a different buffer. Should this logic ever be needed by // a user handler, it should be implemented by using a Queue // in the UnmarshallingContext. // The buffer has to be set back from the outside! See below IReadBuffer contextBuffer = context.Buffer(buffer); object array = base.Read(context); // The context buffer has to be set back. context.Buffer(contextBuffer); return array; } public static void Defragment(IDefragmentContext context, ArrayHandler handler) { int sourceAddress = context.SourceBuffer().ReadInt(); int length = context.SourceBuffer().ReadInt(); if (sourceAddress == 0 && length == 0) { context.TargetBuffer().WriteInt(0); context.TargetBuffer().WriteInt(0); return; } Slot slot = context.AllocateMappedTargetSlot(sourceAddress, length); ByteArrayBuffer sourceBuffer = null; try { sourceBuffer = context.SourceBufferByAddress(sourceAddress, length); } catch (IOException exc) { throw new Db4oIOException(exc); } DefragmentContextImpl payloadContext = new DefragmentContextImpl(sourceBuffer, (DefragmentContextImpl )context); handler.DefragmentSlot(payloadContext); payloadContext.WriteToTarget(slot.Address()); context.TargetBuffer().WriteInt(slot.Address()); context.TargetBuffer().WriteInt(length); } public override void Defragment(IDefragmentContext context) { Defragment(context, this); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/ArrayHandler5.cs0000644000175000017500000000055411700531646032475 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Handlers.Array; namespace Db4objects.Db4o.Internal.Handlers.Array { /// public class ArrayHandler5 : ArrayHandler { protected override ArrayVersionHelper CreateVersionHelper() { return new ArrayVersionHelper5(); } } } MultidimensionalArrayHandler.cs0000644000175000017500000000751311700531646035571 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers.Array { /// n-dimensional array /// public class MultidimensionalArrayHandler : ArrayHandler { public MultidimensionalArrayHandler(ITypeHandler4 a_handler, bool a_isPrimitive) : base(a_handler, a_isPrimitive) { } public MultidimensionalArrayHandler() { } // required for reflection cloning public sealed override IEnumerator AllElements(ObjectContainerBase container, object array) { return AllElementsMultidimensional(ArrayReflector(container), array); } public static IEnumerator AllElementsMultidimensional(IReflectArray reflectArray, object array) { return new MultidimensionalArrayIterator(reflectArray, (object[])array); } protected static int ElementCount(int[] a_dim) { int elements = a_dim[0]; for (int i = 1; i < a_dim.Length; i++) { elements = elements * a_dim[i]; } return elements; } public sealed override byte Identifier() { return Const4.Yaparrayn; } protected override ArrayInfo NewArrayInfo() { return new MultidimensionalArrayInfo(); } protected override void ReadDimensions(ArrayInfo info, IReadBuffer buffer) { ReadDimensions(info, buffer, buffer.ReadInt()); } private void ReadDimensions(ArrayInfo info, IReadBuffer buffer, int dimensionCount ) { int[] dim = new int[dimensionCount]; for (int i = 0; i < dim.Length; i++) { dim[i] = buffer.ReadInt(); } ((MultidimensionalArrayInfo)info).Dimensions(dim); info.ElementCount(ElementCount(dim)); } protected override void ReadElements(IReadContext context, ArrayInfo info, object array) { if (array == null) { return; } object[] objects = new object[info.ElementCount()]; ReadInto(context, info, objects); ArrayReflector(Container(context)).Shape(objects, 0, array, ((MultidimensionalArrayInfo )info).Dimensions(), 0); } protected override void WriteDimensions(IWriteContext context, ArrayInfo info) { int[] dim = ((MultidimensionalArrayInfo)info).Dimensions(); context.WriteInt(dim.Length); for (int i = 0; i < dim.Length; i++) { context.WriteInt(dim[i]); } } protected override void WriteElements(IWriteContext context, object obj, ArrayInfo info) { IEnumerator objects = AllElements(Container(context), obj); if (HasNullBitmap(info)) { BitMap4 nullBitMap = new BitMap4(info.ElementCount()); IReservedBuffer nullBitMapBuffer = context.Reserve(nullBitMap.MarshalledLength()); int currentElement = 0; while (objects.MoveNext()) { object current = objects.Current; if (current == null) { nullBitMap.SetTrue(currentElement); } else { context.WriteObject(DelegateTypeHandler(), current); } currentElement++; } nullBitMapBuffer.WriteBytes(nullBitMap.Bytes()); } else { while (objects.MoveNext()) { context.WriteObject(DelegateTypeHandler(), objects.Current); } } } protected override void AnalyzeDimensions(ObjectContainerBase container, object obj , ArrayInfo info) { int[] dim = ArrayReflector(container).Dimensions(obj); ((MultidimensionalArrayInfo)info).Dimensions(dim); info.ElementCount(ElementCount(dim)); } public override ITypeHandler4 UnversionedTemplate() { return new Db4objects.Db4o.Internal.Handlers.Array.MultidimensionalArrayHandler(); } } } ArrayVersionHelper3.cs0000644000175000017500000000561211700531646033624 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers.Array { /// public class ArrayVersionHelper3 : ArrayVersionHelper5 { public override int ClassIDFromInfo(ObjectContainerBase container, ArrayInfo info ) { ClassMetadata classMetadata = container.ProduceClassMetadata(info.ReflectClass()); if (classMetadata == null) { // TODO: This one is a terrible low-frequency blunder !!! // If YapClass-ID == 99999 then we will get IGNORE back. // Discovered on adding the primitives return Const4.IgnoreId; } return classMetadata.GetID(); } public override int ClassIdToMarshalledClassId(int classID, bool primitive) { if (primitive) { classID -= Const4.Primitive; } return -classID; } public override IReflectClass ClassReflector(IReflector reflector, ClassMetadata classMetadata, bool isPrimitive) { IReflectClass primitiveClaxx = Handlers4.PrimitiveClassReflector(classMetadata, reflector ); if (primitiveClaxx != null) { return primitiveClaxx; } return base.ClassReflector(reflector, classMetadata, isPrimitive); } public override bool HasNullBitmap(ArrayInfo info) { return false; } public override bool IsPrimitive(IReflector reflector, IReflectClass claxx, ClassMetadata classMetadata) { return Handlers4.PrimitiveClassReflector(classMetadata, reflector) != null; return claxx.IsPrimitive(); } public override IReflectClass ReflectClassFromElementsEntry(ObjectContainerBase container , ArrayInfo info, int classID) { if (classID == Const4.IgnoreId) { // TODO: Here is a low-frequency mistake, extremely unlikely. // If classID == 99999 by accident then we will get ignore. return null; } info.Primitive(false); if (UseJavaHandling()) { if (classID < Const4.Primitive) { info.Primitive(true); classID -= Const4.Primitive; } } classID = -classID; ClassMetadata classMetadata = container.ClassMetadataForID(classID); if (classMetadata != null) { return ClassReflector(container.Reflector(), classMetadata, info.Primitive()); } return null; } public sealed override bool UseJavaHandling() { return !Deploy.csharp; } public override void WriteTypeInfo(IWriteContext context, ArrayInfo info) { } // do nothing, the byte for additional type information was added after format 3 public override void ReadTypeInfo(Transaction trans, IReadBuffer buffer, ArrayInfo info, int classID) { } // do nothing, the byte for additional type information was added after format 3 } } ArrayVersionHelper0.cs0000644000175000017500000000056011700531646033616 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Handlers.Array; namespace Db4objects.Db4o.Internal.Handlers.Array { /// public class ArrayVersionHelper0 : ArrayVersionHelper3 { public override bool IsPreVersion0Format(int elementCount) { return elementCount >= 0; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/ArrayHandler3.cs0000644000175000017500000000055511700531646032474 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Handlers.Array; namespace Db4objects.Db4o.Internal.Handlers.Array { /// public class ArrayHandler3 : ArrayHandler5 { protected override ArrayVersionHelper CreateVersionHelper() { return new ArrayVersionHelper3(); } } } MultidimensionalArrayHandler3.cs0000644000175000017500000000061411700531646035647 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Handlers.Array; namespace Db4objects.Db4o.Internal.Handlers.Array { /// public class MultidimensionalArrayHandler3 : MultidimensionalArrayHandler { protected override ArrayVersionHelper CreateVersionHelper() { return new ArrayVersionHelper3(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/ArrayHandler1.cs0000644000175000017500000000072711700531646032473 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers.Array { /// public class ArrayHandler1 : ArrayHandler3 { protected override bool HandleAsByteArray(IBufferContext context) { return false; } protected override bool HandleAsByteArray(object obj) { return false; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/ArrayHandler.cs0000644000175000017500000004572711700531646032423 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Handlers.Array { /// This is the latest version, the one that should be used. /// This is the latest version, the one that should be used. /// public class ArrayHandler : ICascadingTypeHandler, IComparable4, IValueTypeHandler , IVariableLengthTypeHandler, IVersionedTypeHandler, IQueryableTypeHandler { private ITypeHandler4 _handler; private bool _usePrimitiveClassReflector; protected readonly ArrayVersionHelper _versionHelper; public ArrayHandler() { _versionHelper = CreateVersionHelper(); } public ArrayHandler(ITypeHandler4 handler, bool usePrimitiveClassReflector) : this () { _handler = handler; _usePrimitiveClassReflector = usePrimitiveClassReflector; } protected virtual ArrayVersionHelper CreateVersionHelper() { return new ArrayVersionHelper(); } protected virtual IReflectArray ArrayReflector(ObjectContainerBase container) { return container.Reflector().Array(); } public virtual IEnumerator AllElements(ObjectContainerBase container, object a_object ) { return AllElements(ArrayReflector(container), a_object); } public static IEnumerator AllElements(IReflectArray reflectArray, object array) { return new ReflectArrayIterator(reflectArray, array); } public void CascadeActivation(IActivationContext context) { if (!Handlers4.IsCascading(_handler)) { return; } ObjectContainerBase container = context.Container(); IEnumerator all = AllElements(container, context.TargetObject()); while (all.MoveNext()) { context.CascadeActivationToChild(all.Current); } } internal virtual ObjectContainerBase Container(Transaction trans) { return trans.Container(); } public virtual void CollectIDs(QueryingReadContext context) { ITypeHandler4 handler = HandlerRegistry.CorrectHandlerVersion(context, _handler); ForEachElement(context, new _IRunnable_71(context, handler)); } private sealed class _IRunnable_71 : IRunnable { public _IRunnable_71(QueryingReadContext context, ITypeHandler4 handler) { this.context = context; this.handler = handler; } public void Run() { context.ReadId(handler); } private readonly QueryingReadContext context; private readonly ITypeHandler4 handler; } protected virtual ArrayInfo ForEachElement(AbstractBufferContext context, IRunnable elementRunnable) { ArrayInfo info = NewArrayInfo(); WithContent(context, new _IRunnable_80(this, context, info, elementRunnable)); return info; } private sealed class _IRunnable_80 : IRunnable { public _IRunnable_80(ArrayHandler _enclosing, AbstractBufferContext context, ArrayInfo info, IRunnable elementRunnable) { this._enclosing = _enclosing; this.context = context; this.info = info; this.elementRunnable = elementRunnable; } public void Run() { if (context.Buffer() == null) { return; } if (this._enclosing.IsUntypedByteArray(context)) { return; } this._enclosing.ReadInfo(context.Transaction(), context, info); int elementCount = info.ElementCount(); elementCount -= this._enclosing.ReducedCountForNullBitMap(info, context); for (int i = 0; i < elementCount; i++) { elementRunnable.Run(); } } private readonly ArrayHandler _enclosing; private readonly AbstractBufferContext context; private readonly ArrayInfo info; private readonly IRunnable elementRunnable; } protected virtual void WithContent(AbstractBufferContext context, IRunnable runnable ) { runnable.Run(); } private int ReducedCountForNullBitMap(ArrayInfo info, IReadBuffer context) { if (!HasNullBitmap(info)) { return 0; } return ReducedCountForNullBitMap(info.ElementCount(), ReadNullBitmap(context, info .ElementCount())); } private int ReducedCountForNullBitMap(int count, BitMap4 bitMap) { int nullCount = 0; for (int i = 0; i < count; i++) { if (bitMap.IsTrue(i)) { nullCount++; } } return nullCount; } /// public virtual void Delete(IDeleteContext context) { if (!CascadeDelete(context)) { return; } ForEachElement((AbstractBufferContext)context, new _IRunnable_127(this, context)); } private sealed class _IRunnable_127 : IRunnable { public _IRunnable_127(ArrayHandler _enclosing, IDeleteContext context) { this._enclosing = _enclosing; this.context = context; } public void Run() { this._enclosing._handler.Delete(context); } private readonly ArrayHandler _enclosing; private readonly IDeleteContext context; } private bool CascadeDelete(IDeleteContext context) { // FIXME: ValueType could reference objects, shouldn't they be deleted too? return context.CascadeDelete() && Handlers4.IsCascading(_handler); } // FIXME: This code has not been called in any test case when the // new ArrayMarshaller was written. // Apparently it only frees slots. // For now the code simply returns without freeing. /// public void DeletePrimitiveEmbedded(StatefulBuffer buffer, PrimitiveTypeMetadata classPrimitive) { buffer.ReadInt(); //int address = a_bytes.readInt(); buffer.ReadInt(); } //int length = a_bytes.readInt(); public override bool Equals(object obj) { if (!(obj is Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler)) { return false; } Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler other = (Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler )obj; if (other.Identifier() != Identifier()) { return false; } if (_handler == null) { return other._handler == null; } return _handler.Equals(other._handler) && _usePrimitiveClassReflector == other._usePrimitiveClassReflector; } public override int GetHashCode() { if (_handler == null) { return HashcodeForNull; } int hc = _handler.GetHashCode() >> 7; return _usePrimitiveClassReflector ? hc : -hc; } protected virtual bool HandleAsByteArray(object obj) { return obj.GetType() == typeof(byte[]); return obj is byte[]; } public virtual byte Identifier() { return Const4.Yaparray; } public virtual IReflectClass PrimitiveClassReflector(IReflector reflector) { return Handlers4.PrimitiveClassReflector(_handler, reflector); } protected virtual object ReadCreate(Transaction trans, IReadBuffer buffer, ArrayInfo info) { ReadInfo(trans, buffer, info); IReflectClass clazz = NewInstanceReflectClass(trans.Reflector(), info); if (clazz == null) { return null; } return NewInstance(ArrayReflector(Container(trans)), info, clazz); } protected object NewInstance(IReflectArray arrayReflector, ArrayInfo info, IReflectClass clazz) { return arrayReflector.NewInstance(clazz, info); } protected IReflectClass NewInstanceReflectClass(IReflector reflector, ArrayInfo info ) { if (_usePrimitiveClassReflector) { return PrimitiveClassReflector(reflector); } return info.ReflectClass(); } public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { return this; } protected virtual void ReadInfo(Transaction trans, IReadBuffer buffer, ArrayInfo info) { int classID = buffer.ReadInt(); if (IsPreVersion0Format(classID)) { throw new UnsupportedOldFormatException(); } else { _versionHelper.ReadTypeInfo(trans, buffer, info, classID); ReflectClassFromElementsEntry(Container(trans), info, classID); ReadDimensions(info, buffer); } if (Debug4.ExceedsMaximumArrayEntries(info.ElementCount(), _usePrimitiveClassReflector )) { info.ElementCount(0); } } protected virtual void ReadDimensions(ArrayInfo info, IReadBuffer buffer) { info.ElementCount(buffer.ReadInt()); } protected virtual bool IsPreVersion0Format(int elementCount) { return _versionHelper.IsPreVersion0Format(elementCount); } private void ReflectClassFromElementsEntry(ObjectContainerBase container, ArrayInfo info, int classID) { info.ReflectClass(_versionHelper.ReflectClassFromElementsEntry(container, info, classID )); } protected IReflectClass ClassReflector(IReflector reflector, Db4objects.Db4o.Internal.ClassMetadata classMetadata, bool isPrimitive) { return _versionHelper.ClassReflector(reflector, classMetadata, isPrimitive); } public static IEnumerator Iterator(IReflectClass claxx, object obj) { IReflectArray reflectArray = claxx.Reflector().Array(); if (reflectArray.IsNDimensional(claxx)) { return MultidimensionalArrayHandler.AllElementsMultidimensional(reflectArray, obj ); } return Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler.AllElements(reflectArray , obj); } protected virtual bool UseJavaHandling() { return _versionHelper.UseJavaHandling(); } protected virtual int ClassIDFromInfo(ObjectContainerBase container, ArrayInfo info ) { return _versionHelper.ClassIDFromInfo(container, info); } private int MarshalledClassID(ObjectContainerBase container, ArrayInfo info) { return ClassIdToMarshalledClassId(ClassIDFromInfo(container, info), info.Primitive ()); } public int ClassIdToMarshalledClassId(int classID, bool primitive) { return _versionHelper.ClassIdToMarshalledClassId(classID, primitive); } protected bool IsPrimitive(IReflector reflector, IReflectClass claxx, Db4objects.Db4o.Internal.ClassMetadata classMetadata) { return _versionHelper.IsPrimitive(reflector, claxx, classMetadata); } private IReflectClass ComponentType(ObjectContainerBase container, object obj) { return ArrayReflector(container).GetComponentType(container.Reflector().ForObject (obj)); } public virtual void Defragment(IDefragmentContext context) { if (context.ClassMetadata().HasIdentity()) { DefragmentSlot(context); } else { context.IncrementOffset(LinkLength()); } } public void DefragmentSlot(IDefragmentContext context) { if (IsUntypedByteArray(context)) { return; } int classIdOffset = context.TargetBuffer().Offset(); ArrayInfo info = NewArrayInfo(); ReadInfo(context.Transaction(), context, info); DefragmentWriteMappedClassId(context, info, classIdOffset); int elementCount = info.ElementCount(); if (HasNullBitmap(info)) { BitMap4 bitMap = ReadNullBitmap(context, elementCount); elementCount -= ReducedCountForNullBitMap(elementCount, bitMap); } ITypeHandler4 correctTypeHandlerVersion = CorrectHandlerVersion(context, _handler , info); for (int i = 0; i < elementCount; i++) { context.Defragment(correctTypeHandlerVersion); } } private ITypeHandler4 CorrectHandlerVersion(IDefragmentContext context, ITypeHandler4 handler, ArrayInfo info) { Db4objects.Db4o.Internal.ClassMetadata classMetadata = ClassMetadata(context, info ); return HandlerRegistry.CorrectHandlerVersion(context, handler, classMetadata); } private Db4objects.Db4o.Internal.ClassMetadata ClassMetadata(IDefragmentContext context , ArrayInfo info) { int classMetadataId = ClassIDFromInfo(Container(context), info); return Container(context).ClassMetadataForID(classMetadataId); } private void DefragmentWriteMappedClassId(IDefragmentContext context, ArrayInfo info , int classIdOffset) { ByteArrayBuffer targetBuffer = context.TargetBuffer(); int currentOffset = targetBuffer.Offset(); targetBuffer.Seek(classIdOffset); int classID = ClassIDFromInfo(Container(context), info); int mappedID = context.MappedID(classID); int marshalledMappedId = ClassIdToMarshalledClassId(mappedID, info.Primitive()); targetBuffer.WriteInt(marshalledMappedId); targetBuffer.Seek(currentOffset); } private bool IsUntypedByteArray(IBufferContext context) { return Handlers4.IsUntyped(_handler) && HandleAsByteArray(context); } protected virtual bool HandleAsByteArray(IBufferContext context) { int offset = context.Offset(); ArrayInfo info = NewArrayInfo(); ReadInfo(context.Transaction(), context, info); bool isByteArray = context.Transaction().Reflector().ForClass(typeof(byte)).Equals (info.ReflectClass()); context.Seek(offset); return isByteArray; } public virtual object Read(IReadContext context) { ArrayInfo info = NewArrayInfo(); object array = ReadCreate(context.Transaction(), context, info); ReadElements(context, info, array); return array; } protected virtual void ReadElements(IReadContext context, ArrayInfo info, object array) { ReadInto(context, info, array); } protected virtual ArrayInfo NewArrayInfo() { return new ArrayInfo(); } protected void ReadInto(IReadContext context, ArrayInfo info, object array) { if (array == null) { return; } if (HandleAsByteArray(array)) { context.ReadBytes((byte[])array); // byte[] performance optimisation return; } if (HasNullBitmap(info)) { BitMap4 nullBitMap = ReadNullBitmap(context, info.ElementCount()); for (int i = 0; i < info.ElementCount(); i++) { object obj = nullBitMap.IsTrue(i) ? null : context.ReadObject(_handler); ArrayReflector(Container(context)).Set(array, i, obj); } } else { for (int i = 0; i < info.ElementCount(); i++) { ArrayReflector(Container(context)).Set(array, i, context.ReadObject(_handler)); } } } protected virtual BitMap4 ReadNullBitmap(IReadBuffer context, int length) { return context.ReadBitMap(length); } protected bool HasNullBitmap(ArrayInfo info) { return _versionHelper.HasNullBitmap(info); } public virtual void Write(IWriteContext context, object obj) { ArrayInfo info = NewArrayInfo(); Analyze(Container(context), obj, info); WriteInfo(context, info); WriteElements(context, obj, info); } protected virtual void WriteElements(IWriteContext context, object obj, ArrayInfo info) { if (HandleAsByteArray(obj)) { context.WriteBytes((byte[])obj); } else { // byte[] performance optimisation if (HasNullBitmap(info)) { BitMap4 nullItems = NullItemsMap(ArrayReflector(Container(context)), obj); WriteNullBitmap(context, nullItems); for (int i = 0; i < info.ElementCount(); i++) { if (!nullItems.IsTrue(i)) { context.WriteObject(_handler, ArrayReflector(Container(context)).Get(obj, i)); } } } else { for (int i = 0; i < info.ElementCount(); i++) { context.WriteObject(_handler, ArrayReflector(Container(context)).Get(obj, i)); } } } } protected virtual void WriteInfo(IWriteContext context, ArrayInfo info) { WriteHeader(context, info); WriteDimensions(context, info); } private void WriteHeader(IWriteContext context, ArrayInfo info) { context.WriteInt(MarshalledClassID(Container(context), info)); _versionHelper.WriteTypeInfo(context, info); } protected virtual void WriteDimensions(IWriteContext context, ArrayInfo info) { context.WriteInt(info.ElementCount()); } protected void Analyze(ObjectContainerBase container, object obj, ArrayInfo info) { // TODO: Move as much analysis as possible to ReflectArray#analyze() ArrayReflector(container).Analyze(obj, info); IReflectClass claxx = ComponentType(container, obj); Db4objects.Db4o.Internal.ClassMetadata classMetadata = container.ProduceClassMetadata (claxx); bool primitive = IsPrimitive(container.Reflector(), claxx, classMetadata); if (primitive) { claxx = classMetadata.ClassReflector(); } info.Primitive(primitive); info.ReflectClass(claxx); AnalyzeDimensions(container, obj, info); } protected virtual void AnalyzeDimensions(ObjectContainerBase container, object obj , ArrayInfo info) { info.ElementCount(ArrayReflector(container).GetLength(obj)); } private void WriteNullBitmap(IWriteBuffer context, BitMap4 bitMap) { context.WriteBytes(bitMap.Bytes()); } protected virtual BitMap4 NullItemsMap(IReflectArray reflector, object array) { int arrayLength = reflector.GetLength(array); BitMap4 nullBitMap = new BitMap4(arrayLength); for (int i = 0; i < arrayLength; i++) { if (reflector.Get(array, i) == null) { nullBitMap.Set(i, true); } } return nullBitMap; } internal virtual ObjectContainerBase Container(IContext context) { return context.Transaction().Container(); } public virtual IPreparedComparison PrepareComparison(IContext context, object obj ) { return new PreparedArrayContainsComparison(context, this, _handler, obj); } public virtual int LinkLength() { return Const4.IndirectionLength; } public virtual ITypeHandler4 UnversionedTemplate() { return new Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler(); } public virtual object DeepClone(object context) { TypeHandlerCloneContext typeHandlerCloneContext = (TypeHandlerCloneContext)context; Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler original = (Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler )typeHandlerCloneContext.original; Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler cloned = (Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler )Reflection4.NewInstance(this); cloned._usePrimitiveClassReflector = original._usePrimitiveClassReflector; cloned._handler = typeHandlerCloneContext.CorrectHandlerVersion(original.DelegateTypeHandler ()); return cloned; } public virtual ITypeHandler4 DelegateTypeHandler() { return _handler; } private const int HashcodeForNull = 9141078; public override string ToString() { return "ArrayHandler(isPrimitive=" + _usePrimitiveClassReflector + ", handler=" + _handler + ")"; } public virtual bool DescendsIntoMembers() { return true; } } } ArrayVersionHelper5.cs0000644000175000017500000000060711700531646033625 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers.Array { /// public class ArrayVersionHelper5 : ArrayVersionHelper { public override bool HasNullBitmap(ArrayInfo info) { return !info.Primitive(); } } } MultidimensionalArrayIterator.cs0000644000175000017500000000312611700531646036001 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers.Array { /// public class MultidimensionalArrayIterator : IEnumerator { private readonly IReflectArray _reflectArray; private readonly object[] _array; private int _currentElement; private IEnumerator _delegate; public MultidimensionalArrayIterator(IReflectArray reflectArray, object[] array) { _reflectArray = reflectArray; _array = array; Reset(); } public virtual object Current { get { if (_delegate == null) { return _array[_currentElement]; } return _delegate.Current; } } public virtual bool MoveNext() { if (_delegate != null) { if (_delegate.MoveNext()) { return true; } _delegate = null; } _currentElement++; if (_currentElement >= _array.Length) { return false; } object obj = _array[_currentElement]; Type clazz = obj.GetType(); if (clazz.IsArray) { if (clazz.GetElementType().IsArray) { _delegate = new Db4objects.Db4o.Internal.Handlers.Array.MultidimensionalArrayIterator (_reflectArray, (object[])obj); } else { _delegate = new ReflectArrayIterator(_reflectArray, obj); } return MoveNext(); } return true; } public virtual void Reset() { _currentElement = -1; _delegate = null; } } } ReflectArrayIterator.cs0000644000175000017500000000122411700531646034045 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers.Array { /// internal sealed class ReflectArrayIterator : IndexedIterator { private readonly object _array; private readonly IReflectArray _reflectArray; public ReflectArrayIterator(IReflectArray reflectArray, object array) : base(reflectArray .GetLength(array)) { _reflectArray = reflectArray; _array = array; } protected override object Get(int index) { return _reflectArray.Get(_array, index); } } } ArrayVersionHelper.cs0000644000175000017500000000452611700531646033544 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/Array/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers.Array { /// public class ArrayVersionHelper { public virtual int ClassIDFromInfo(ObjectContainerBase container, ArrayInfo info) { ClassMetadata classMetadata = container.ProduceClassMetadata(info.ReflectClass()); if (classMetadata == null) { return 0; } return classMetadata.GetID(); } public virtual int ClassIdToMarshalledClassId(int classID, bool primitive) { return classID; } public virtual IReflectClass ClassReflector(IReflector reflector, ClassMetadata classMetadata , bool isPrimitive) { return isPrimitive ? Handlers4.PrimitiveClassReflector(classMetadata, reflector) : classMetadata.ClassReflector(); } public virtual bool UseJavaHandling() { return true; } public virtual bool HasNullBitmap(ArrayInfo info) { if (info.Nullable()) { return true; } return !info.Primitive(); } public virtual bool IsPreVersion0Format(int elementCount) { return false; } public virtual bool IsPrimitive(IReflector reflector, IReflectClass claxx, ClassMetadata classMetadata) { return claxx.IsPrimitive(); } public virtual IReflectClass ReflectClassFromElementsEntry(ObjectContainerBase container , ArrayInfo info, int classID) { if (classID == 0) { return null; } ClassMetadata classMetadata = container.ClassMetadataForID(classID); if (classMetadata == null) { return null; } return ClassReflector(container.Reflector(), classMetadata, info.Primitive()); } public virtual void WriteTypeInfo(IWriteContext context, ArrayInfo info) { BitMap4 typeInfoBitmap = new BitMap4(2); typeInfoBitmap.Set(0, info.Primitive()); typeInfoBitmap.Set(1, info.Nullable()); context.WriteByte(typeInfoBitmap.GetByte(0)); } public virtual void ReadTypeInfo(Transaction trans, IReadBuffer buffer, ArrayInfo info, int classID) { BitMap4 typeInfoBitmap = new BitMap4(buffer.ReadByte()); info.Primitive(typeInfoBitmap.IsTrue(0)); info.Nullable(typeInfoBitmap.IsTrue(1)); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/IntHandler0.cs0000644000175000017500000000066311700531646031067 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { /// public class IntHandler0 : IntHandler { public override object Read(IReadContext context) { int i = context.ReadInt(); if (i == int.MaxValue) { return null; } return i; } } } NullFieldAwareTypeHandler.cs0000644000175000017500000000404511700531646033674 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers { /// public class NullFieldAwareTypeHandler : IFieldAwareTypeHandler { public static readonly IFieldAwareTypeHandler Instance = new NullFieldAwareTypeHandler (); public virtual void AddFieldIndices(ObjectIdContextImpl context) { } public virtual void ClassMetadata(Db4objects.Db4o.Internal.ClassMetadata classMetadata ) { } public virtual void CollectIDs(CollectIdContext context, IPredicate4 predicate) { } public virtual void DeleteMembers(DeleteContextImpl deleteContext, bool isUpdate) { } public virtual void ReadVirtualAttributes(ObjectReferenceContext context) { } public virtual bool SeekToField(ObjectHeaderContext context, ClassAspect aspect) { return false; } public virtual void Defragment(IDefragmentContext context) { } /// public virtual void Delete(IDeleteContext context) { } public virtual void Activate(IReferenceActivationContext context) { } public virtual void Write(IWriteContext context, object obj) { } public virtual IPreparedComparison PrepareComparison(IContext context, object obj ) { return null; } public virtual ITypeHandler4 UnversionedTemplate() { return null; } public virtual object DeepClone(object context) { return null; } public virtual void CascadeActivation(IActivationContext context) { } public virtual void CollectIDs(QueryingReadContext context) { } public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/FloatHandler.cs0000644000175000017500000000420211700531646031313 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers { public class FloatHandler : IntHandler { private static readonly float Defaultvalue = System.Convert.ToSingle(0); public override object Coerce(IReflectClass claxx, object obj) { return Coercion4.ToFloat(obj); } public override object DefaultValue() { return Defaultvalue; } public override Type PrimitiveJavaClass() { return typeof(float); } /// public override object Read(MarshallerFamily mf, StatefulBuffer writer, bool redirect ) { return mf._primitive.ReadFloat(writer); } internal override object Read1(ByteArrayBuffer a_bytes) { return PrimitiveMarshaller().ReadFloat(a_bytes); } public override void Write(object a_object, ByteArrayBuffer a_bytes) { WriteInt(Sharpen.Runtime.FloatToIntBits(((float)a_object)), a_bytes); } public override object Read(IReadContext context) { return Sharpen.Runtime.IntBitsToFloat(context.ReadInt()); } public override void Write(IWriteContext context, object obj) { context.WriteInt(Sharpen.Runtime.FloatToIntBits(((float)obj))); } public override IPreparedComparison InternalPrepareComparison(object source) { float sourceFloat = ((float)source); return new _IPreparedComparison_54(sourceFloat); } private sealed class _IPreparedComparison_54 : IPreparedComparison { public _IPreparedComparison_54(float sourceFloat) { this.sourceFloat = sourceFloat; } public int CompareTo(object target) { if (target == null) { return 1; } float targetFloat = ((float)target); return sourceFloat == targetFloat ? 0 : (sourceFloat < targetFloat ? -1 : 1); } private readonly float sourceFloat; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/StringHandler0.cs0000644000175000017500000000417511700531646031605 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.IO; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { /// public class StringHandler0 : StringHandler { public override object Read(IReadContext context) { ByteArrayBuffer buffer = (ByteArrayBuffer)((IInternalReadContext)context).ReadIndirectedBuffer (); if (buffer == null) { return null; } return ReadString(context, buffer); } public override void Delete(IDeleteContext context) { context.DefragmentRecommended(); } public override void Defragment(IDefragmentContext context) { int sourceAddress = context.SourceBuffer().ReadInt(); int length = context.SourceBuffer().ReadInt(); if (sourceAddress == 0 && length == 0) { context.TargetBuffer().WriteInt(0); context.TargetBuffer().WriteInt(0); return; } int targetAddress = 0; try { targetAddress = context.CopySlotToNewMapped(sourceAddress, length); } catch (IOException exc) { throw new Db4oIOException(exc); } context.TargetBuffer().WriteInt(targetAddress); context.TargetBuffer().WriteInt(length); } /// /// public override object ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer buffer) { return buffer.Container().ReadWriterByAddress(buffer.Transaction(), buffer.ReadInt (), buffer.ReadInt()); } /// /// public override object ReadIndexEntry(IObjectIdContext context) { return context.Transaction().Container().ReadWriterByAddress(context.Transaction( ), context.ReadInt(), context.ReadInt()); } } } StandardReferenceTypeHandler.cs0000644000175000017500000005354711700531646034430 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Metadata; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers { /// public class StandardReferenceTypeHandler : IFieldAwareTypeHandler, IIndexableTypeHandler , IReadsObjectIds { private const int HashcodeForNull = 72483944; private Db4objects.Db4o.Internal.ClassMetadata _classMetadata; public StandardReferenceTypeHandler(Db4objects.Db4o.Internal.ClassMetadata classMetadata ) { ClassMetadata(classMetadata); } public StandardReferenceTypeHandler() { } public virtual void Defragment(IDefragmentContext context) { TraverseAllAspects(context, new _MarshallingInfoTraverseAspectCommand_35(context, EnsureFieldList(context))); } private sealed class _MarshallingInfoTraverseAspectCommand_35 : MarshallingInfoTraverseAspectCommand { public _MarshallingInfoTraverseAspectCommand_35(IDefragmentContext context, IMarshallingInfo baseArg1) : base(baseArg1) { this.context = context; } protected override int InternalDeclaredAspectCount(Db4objects.Db4o.Internal.ClassMetadata classMetadata) { return context.ReadInt(); } protected override void ProcessAspect(ClassAspect aspect, int currentSlot, bool isNull ) { if (!isNull) { aspect.DefragAspect(context); } } public override bool Accept(ClassAspect aspect) { return aspect.IsEnabledOn(context); } private readonly IDefragmentContext context; } /// public virtual void Delete(IDeleteContext context) { context.DeleteObject(); } public void ActivateAspects(UnmarshallingContext context) { BooleanByRef schemaUpdateDetected = new BooleanByRef(); ContextState savedState = context.SaveState(); ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_63(context , schemaUpdateDetected, EnsureFieldList(context)); // TODO: cant the aspect handle it itself? // Probably no because old aspect versions might not be able // to handle null... TraverseAllAspects(context, command); if (schemaUpdateDetected.value) { context.RestoreState(savedState); command = new _MarshallingInfoTraverseAspectCommand_94(context, EnsureFieldList(context )); TraverseAllAspects(context, command); } } private sealed class _MarshallingInfoTraverseAspectCommand_63 : MarshallingInfoTraverseAspectCommand { public _MarshallingInfoTraverseAspectCommand_63(UnmarshallingContext context, BooleanByRef schemaUpdateDetected, IMarshallingInfo baseArg1) : base(baseArg1) { this.context = context; this.schemaUpdateDetected = schemaUpdateDetected; } public override bool Accept(ClassAspect aspect) { return aspect.IsEnabledOn(context); } protected override void ProcessAspect(ClassAspect aspect, int currentSlot, bool isNull ) { if (aspect is FieldMetadata) { FieldMetadata field = (FieldMetadata)aspect; if (field.Updating()) { schemaUpdateDetected.value = true; } if (isNull) { if (field.GetStoredType() == null || !field.GetStoredType().IsPrimitive()) { field.Set(context.PersistentObject(), null); } return; } } aspect.Activate(context); } private readonly UnmarshallingContext context; private readonly BooleanByRef schemaUpdateDetected; } private sealed class _MarshallingInfoTraverseAspectCommand_94 : MarshallingInfoTraverseAspectCommand { public _MarshallingInfoTraverseAspectCommand_94(UnmarshallingContext context, IMarshallingInfo baseArg1) : base(baseArg1) { this.context = context; } protected override void ProcessAspect(ClassAspect aspect, int currentSlot, bool isNull ) { FieldMetadata field = (FieldMetadata)aspect; if (!isNull) { field.AttemptUpdate(context); } } public override bool Accept(ClassAspect aspect) { return aspect is FieldMetadata; } private readonly UnmarshallingContext context; } public virtual void Activate(IReferenceActivationContext context) { ActivateAspects((UnmarshallingContext)context); } public virtual void Write(IWriteContext context, object obj) { MarshallAspects(obj, (MarshallingContext)context); } public virtual void MarshallAspects(object obj, MarshallingContext context) { Transaction trans = context.Transaction(); ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_122(context , obj, trans, EnsureFieldList(context)); TraverseAllAspects(context, command); } private sealed class _MarshallingInfoTraverseAspectCommand_122 : MarshallingInfoTraverseAspectCommand { public _MarshallingInfoTraverseAspectCommand_122(MarshallingContext context, object obj, Transaction trans, IMarshallingInfo baseArg1) : base(baseArg1) { this.context = context; this.obj = obj; this.trans = trans; } protected override int InternalDeclaredAspectCount(Db4objects.Db4o.Internal.ClassMetadata classMetadata) { int aspectCount = classMetadata._aspects.Length; context.WriteDeclaredAspectCount(aspectCount); return aspectCount; } public override bool Accept(ClassAspect aspect) { return aspect.IsEnabledOn(context); } protected override void ProcessAspect(ClassAspect aspect, int currentSlot, bool isNull ) { object marshalledObject = obj; if (aspect is FieldMetadata) { FieldMetadata field = (FieldMetadata)aspect; marshalledObject = field.GetOrCreate(trans, obj); if (marshalledObject == null) { context.IsNull(currentSlot, true); field.AddIndexEntry(trans, context.ObjectID(), null); return; } } aspect.Marshall(context, marshalledObject); } public override void ProcessAspectOnMissingClass(ClassAspect aspect, int currentSlot ) { ((MarshallingContext)context).IsNull(currentSlot, true); } private readonly MarshallingContext context; private readonly object obj; private readonly Transaction trans; } public virtual IPreparedComparison PrepareComparison(IContext context, object source ) { if (source == null) { return Null.Instance; } if (source is int) { int id = ((int)source); return new StandardReferenceTypeHandler.PreparedComparisonImpl(id, null); } if (source is TransactionContext) { TransactionContext tc = (TransactionContext)source; object obj = tc._object; int id = IdFor(obj, tc._transaction); return new StandardReferenceTypeHandler.PreparedComparisonImpl(id, ReflectClassFor (obj)); } return PlatformComparisonFor(source); } private IPreparedComparison PlatformComparisonFor(object source) { if (source == null) { return new _IPreparedComparison_179(); } //TODO: Move the comparable wrapping to a .Net specific StandardStructHandler if (source is IComparable) { return new _IPreparedComparison_187(source); } throw new IllegalComparisonException(); } private sealed class _IPreparedComparison_179 : IPreparedComparison { public _IPreparedComparison_179() { } public int CompareTo(object obj) { return obj == null ? 0 : -1; } } private sealed class _IPreparedComparison_187 : IPreparedComparison { public _IPreparedComparison_187(object source) { this.source = source; } public int CompareTo(object obj) { if (obj == null) { return 1; } IComparable self = (IComparable)source; return self.CompareTo(obj); } private readonly object source; } private IReflectClass ReflectClassFor(object obj) { return ClassMetadata().Reflector().ForObject(obj); } private int IdFor(object @object, Transaction inTransaction) { return Stream().GetID(inTransaction, @object); } private ObjectContainerBase Stream() { return ClassMetadata().Container(); } public sealed class PreparedComparisonImpl : IPreparedComparison { private readonly int _id; private readonly IReflectClass _claxx; public PreparedComparisonImpl(int id, IReflectClass claxx) { _id = id; _claxx = claxx; } public int CompareTo(object obj) { if (obj is TransactionContext) { obj = ((TransactionContext)obj)._object; } if (obj == null) { return _id == 0 ? 0 : 1; } if (obj is int) { int targetInt = ((int)obj); return _id == targetInt ? 0 : (_id < targetInt ? -1 : 1); } if (_claxx != null) { if (_claxx.IsAssignableFrom(_claxx.Reflector().ForObject(obj))) { return 0; } } throw new IllegalComparisonException(); } } public void TraverseAllAspects(IMarshallingInfo context, ITraverseAspectCommand command ) { ClassMetadata classMetadata = ClassMetadata(); AssertClassMetadata(context.ClassMetadata()); classMetadata.TraverseAllAspects(command); } protected virtual IMarshallingInfo EnsureFieldList(IMarshallingInfo context) { return context; } private void AssertClassMetadata(ClassMetadata contextMetadata) { } // if (contextMetadata != classMetadata()) { // throw new IllegalStateException("expecting '" + classMetadata() + "', got '" + contextMetadata + "'"); // } public virtual ClassMetadata ClassMetadata() { return _classMetadata; } public virtual void ClassMetadata(ClassMetadata classMetadata) { _classMetadata = classMetadata; } public override bool Equals(object obj) { if (!(obj is StandardReferenceTypeHandler)) { return false; } StandardReferenceTypeHandler other = (StandardReferenceTypeHandler)obj; if (ClassMetadata() == null) { return other.ClassMetadata() == null; } return ClassMetadata().Equals(other.ClassMetadata()); } public override int GetHashCode() { if (ClassMetadata() != null) { return ClassMetadata().GetHashCode(); } return HashcodeForNull; } public virtual ITypeHandler4 UnversionedTemplate() { return new StandardReferenceTypeHandler(null); } public virtual object DeepClone(object context) { TypeHandlerCloneContext typeHandlerCloneContext = (TypeHandlerCloneContext)context; StandardReferenceTypeHandler cloned = (StandardReferenceTypeHandler)Reflection4.NewInstance (this); if (typeHandlerCloneContext.original is StandardReferenceTypeHandler) { StandardReferenceTypeHandler original = (StandardReferenceTypeHandler)typeHandlerCloneContext .original; cloned.ClassMetadata(original.ClassMetadata()); } else { // New logic: ClassMetadata takes the responsibility in // #correctHandlerVersion() to set the // ClassMetadata directly on cloned handler. // if(_classMetadata == null){ // throw new IllegalStateException(); // } cloned.ClassMetadata(_classMetadata); } return cloned; } public virtual void CollectIDs(CollectIdContext context, IPredicate4 predicate) { ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_311(predicate , context, EnsureFieldList(context)); TraverseAllAspects(context, command); } private sealed class _MarshallingInfoTraverseAspectCommand_311 : MarshallingInfoTraverseAspectCommand { public _MarshallingInfoTraverseAspectCommand_311(IPredicate4 predicate, CollectIdContext context, IMarshallingInfo baseArg1) : base(baseArg1) { this.predicate = predicate; this.context = context; } protected override void ProcessAspect(ClassAspect aspect, int currentSlot, bool isNull ) { if (isNull) { return; } if (predicate.Match(aspect)) { aspect.CollectIDs(context); } else { aspect.IncrementOffset(context); } } private readonly IPredicate4 predicate; private readonly CollectIdContext context; } public virtual void CascadeActivation(IActivationContext context) { AssertClassMetadata(context.ClassMetadata()); context.CascadeActivationToTarget(); } public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { if (ClassMetadata().IsArray()) { return this; } return null; } /// public virtual void CollectIDs(QueryingReadContext context) { if (CollectIDsByTypehandlerAspect(context)) { return; } CollectIDsByInstantiatingCollection(context); } /// private bool CollectIDsByTypehandlerAspect(QueryingReadContext context) { BooleanByRef aspectFound = new BooleanByRef(false); CollectIdContext subContext = CollectIdContext.ForID(context.Transaction(), context .Collector(), context.CollectionID()); ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_349(this , aspectFound, subContext, EnsureFieldList(subContext)); TraverseAllAspects(subContext, command); return aspectFound.value; } private sealed class _MarshallingInfoTraverseAspectCommand_349 : MarshallingInfoTraverseAspectCommand { public _MarshallingInfoTraverseAspectCommand_349(StandardReferenceTypeHandler _enclosing , BooleanByRef aspectFound, CollectIdContext subContext, IMarshallingInfo baseArg1 ) : base(baseArg1) { this._enclosing = _enclosing; this.aspectFound = aspectFound; this.subContext = subContext; } protected override void ProcessAspect(ClassAspect aspect, int currentSlot, bool isNull ) { if (isNull) { return; } if (this._enclosing.IsCollectIdTypehandlerAspect(aspect)) { aspectFound.value = true; aspect.CollectIDs(subContext); } else { aspect.IncrementOffset(subContext); } } private readonly StandardReferenceTypeHandler _enclosing; private readonly BooleanByRef aspectFound; private readonly CollectIdContext subContext; } private bool IsCollectIdTypehandlerAspect(ClassAspect aspect) { if (!(aspect is TypeHandlerAspect)) { return false; } ITypeHandler4 typehandler = ((TypeHandlerAspect)aspect)._typeHandler; return Handlers4.IsCascading(typehandler); } /// private void CollectIDsByInstantiatingCollection(QueryingReadContext context) { int id = context.CollectionID(); if (id == 0) { return; } Transaction transaction = context.Transaction(); ObjectContainerBase container = context.Container(); object obj = container.GetByID(transaction, id); if (obj == null) { return; } // FIXME: [TA] review activation depth int depth = DepthUtil.AdjustDepthToBorders(2); container.Activate(transaction, obj, container.ActivationDepthProvider().ActivationDepth (depth, ActivationMode.Activate)); Platform4.ForEachCollectionElement(obj, new _IVisitor4_390(context)); } private sealed class _IVisitor4_390 : IVisitor4 { public _IVisitor4_390(QueryingReadContext context) { this.context = context; } public void Visit(object elem) { context.Add(elem); } private readonly QueryingReadContext context; } public virtual void ReadVirtualAttributes(ObjectReferenceContext context) { ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_398(context , EnsureFieldList(context)); TraverseAllAspects(context, command); } private sealed class _MarshallingInfoTraverseAspectCommand_398 : MarshallingInfoTraverseAspectCommand { public _MarshallingInfoTraverseAspectCommand_398(ObjectReferenceContext context, IMarshallingInfo baseArg1) : base(baseArg1) { this.context = context; } protected override void ProcessAspect(ClassAspect aspect, int currentSlot, bool isNull ) { if (!isNull) { if (aspect is VirtualFieldMetadata) { ((VirtualFieldMetadata)aspect).ReadVirtualAttribute(context); } else { aspect.IncrementOffset(context); } } } private readonly ObjectReferenceContext context; } public virtual void AddFieldIndices(ObjectIdContextImpl context) { ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_414(context , EnsureFieldList(context)); TraverseAllAspects(context, command); } private sealed class _MarshallingInfoTraverseAspectCommand_414 : MarshallingInfoTraverseAspectCommand { public _MarshallingInfoTraverseAspectCommand_414(ObjectIdContextImpl context, IMarshallingInfo baseArg1) : base(baseArg1) { this.context = context; } protected override void ProcessAspect(ClassAspect aspect, int currentSlot, bool isNull ) { if (aspect is FieldMetadata) { FieldMetadata field = (FieldMetadata)aspect; if (isNull) { field.AddIndexEntry(context.Transaction(), context.ObjectId(), null); } else { field.AddFieldIndex(context); } } else { aspect.IncrementOffset(context.Buffer()); } } public override bool Accept(ClassAspect aspect) { return aspect.IsEnabledOn(context); } private readonly ObjectIdContextImpl context; } public virtual void DeleteMembers(DeleteContextImpl context, bool isUpdate) { ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_438(context , isUpdate, EnsureFieldList(context)); TraverseAllAspects(context, command); } private sealed class _MarshallingInfoTraverseAspectCommand_438 : MarshallingInfoTraverseAspectCommand { public _MarshallingInfoTraverseAspectCommand_438(DeleteContextImpl context, bool isUpdate, IMarshallingInfo baseArg1) : base(baseArg1) { this.context = context; this.isUpdate = isUpdate; } protected override void ProcessAspect(ClassAspect aspect, int currentSlot, bool isNull ) { if (isNull) { if (aspect is FieldMetadata) { FieldMetadata field = (FieldMetadata)aspect; field.RemoveIndexEntry(context.Transaction(), context.ObjectId(), null); } return; } aspect.Delete(context, isUpdate); } private readonly DeleteContextImpl context; private readonly bool isUpdate; } public virtual bool SeekToField(ObjectHeaderContext context, ClassAspect aspect) { BooleanByRef found = new BooleanByRef(false); ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_456(aspect , found, EnsureFieldList(context)); TraverseAllAspects(context, command); return found.value; } private sealed class _MarshallingInfoTraverseAspectCommand_456 : MarshallingInfoTraverseAspectCommand { public _MarshallingInfoTraverseAspectCommand_456(ClassAspect aspect, BooleanByRef found, IMarshallingInfo baseArg1) : base(baseArg1) { this.aspect = aspect; this.found = found; } public override bool Accept(ClassAspect aspect) { return aspect.IsEnabledOn(this._marshallingInfo); } protected override void ProcessAspect(ClassAspect curField, int currentSlot, bool isNull) { if (curField == aspect) { found.value = !isNull; this.Cancel(); return; } if (!isNull) { curField.IncrementOffset(this._marshallingInfo.Buffer()); } } private readonly ClassAspect aspect; private readonly BooleanByRef found; } public object IndexEntryToObject(IContext context, object indexEntry) { if (indexEntry == null) { return null; } int id = ((int)indexEntry); return ((ObjectContainerBase)context.ObjectContainer()).GetByID2(context.Transaction (), id); } public void DefragIndexEntry(DefragmentContextImpl context) { context.CopyID(); } public object ReadIndexEntry(IContext context, ByteArrayBuffer a_reader) { return a_reader.ReadInt(); } /// public object ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer statefulBuffer ) { return ReadIndexEntry(statefulBuffer.Transaction().Context(), statefulBuffer); } /// /// public virtual object ReadIndexEntry(IObjectIdContext context) { return context.ReadInt(); } public virtual int LinkLength() { return Const4.IdLength; } public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer a_writer, object a_object) { if (a_object == null) { a_writer.WriteInt(0); return; } a_writer.WriteInt(((int)a_object)); } public virtual ITypeHandler4 DelegateTypeHandler(IContext context) { return ClassMetadata().DelegateTypeHandler(context); } public virtual ObjectID ReadObjectID(IInternalReadContext context) { return ObjectID.Read(context); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/LongHandler0.cs0000644000175000017500000000066011700531646031231 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { public class LongHandler0 : LongHandler { public override object Read(IReadContext context) { long value = (long)base.Read(context); if (value == long.MaxValue) { return null; } return value; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/PrimitiveHandler.cs0000644000175000017500000001150711700531646032224 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers { /// public abstract class PrimitiveHandler : IValueTypeHandler, IIndexableTypeHandler , IBuiltinTypeHandler, IQueryableTypeHandler { protected IReflectClass _classReflector; private IReflectClass _primitiveClassReflector; private object _primitiveNull; public virtual object Coerce(IReflectClass claxx, object obj) { return IsAssignableFrom(claxx) ? obj : No4.Instance; } private bool IsAssignableFrom(IReflectClass claxx) { return ClassReflector().IsAssignableFrom(claxx) || PrimitiveClassReflector().IsAssignableFrom (claxx); } public abstract object DefaultValue(); public virtual void Delete(IDeleteContext context) { context.Seek(context.Offset() + LinkLength()); } public object IndexEntryToObject(IContext context, object indexEntry) { return indexEntry; } public abstract Type PrimitiveJavaClass(); protected virtual Type JavaClass() { return Platform4.NullableTypeFor(PrimitiveJavaClass()); } public virtual bool DescendsIntoMembers() { return false; } public virtual object PrimitiveNull() { if (_primitiveNull == null) { IReflectClass claxx = (_primitiveClassReflector == null ? _classReflector : _primitiveClassReflector ); _primitiveNull = claxx.NullValue(); } return _primitiveNull; } /// /// /// /// public virtual object Read(MarshallerFamily mf, StatefulBuffer buffer, bool redirect ) { return Read1(buffer); } /// internal abstract object Read1(ByteArrayBuffer reader); public virtual object ReadIndexEntry(IContext context, ByteArrayBuffer buffer) { try { return Read1(buffer); } catch (CorruptionException) { } return null; } /// public object ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer statefulBuffer ) { return Read(mf, statefulBuffer, true); } /// /// public virtual object ReadIndexEntry(IObjectIdContext context) { return Read(context); } public virtual IReflectClass ClassReflector() { return _classReflector; } public virtual IReflectClass PrimitiveClassReflector() { return _primitiveClassReflector; } public virtual void RegisterReflector(IReflector reflector) { _classReflector = reflector.ForClass(JavaClass()); Type clazz = PrimitiveJavaClass(); if (clazz != null) { _primitiveClassReflector = reflector.ForClass(clazz); } } public abstract void Write(object a_object, ByteArrayBuffer a_bytes); public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer a_writer, object a_object) { if (a_object == null) { a_object = PrimitiveNull(); } Write(a_object, a_writer); } // redundant, only added to make Sun JDK 1.2's java happy :( public abstract int LinkLength(); public void Defragment(IDefragmentContext context) { context.IncrementOffset(LinkLength()); } public virtual void DefragIndexEntry(DefragmentContextImpl context) { try { Read1(context.SourceBuffer()); Read1(context.TargetBuffer()); } catch (CorruptionException) { Exceptions4.VirtualException(); } } protected virtual Db4objects.Db4o.Internal.Marshall.PrimitiveMarshaller PrimitiveMarshaller () { return MarshallerFamily.Current()._primitive; } public virtual void Write(IWriteContext context, object obj) { throw new NotImplementedException(); } public virtual object Read(IReadContext context) { throw new NotImplementedException(); } public virtual object NullRepresentationInUntypedArrays() { return PrimitiveNull(); } public virtual IPreparedComparison PrepareComparison(IContext context, object obj ) { if (obj == null) { return Null.Instance; } return InternalPrepareComparison(obj); } public abstract IPreparedComparison InternalPrepareComparison(object obj); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/ShortHandler0.cs0000644000175000017500000000066511700531646031436 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { public class ShortHandler0 : ShortHandler { public override object Read(IReadContext context) { short value = (short)base.Read(context); if (value == short.MaxValue) { return null; } return value; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/IFieldAwareTypeHandler.cs0000644000175000017500000000165411700531646033234 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers { /// public interface IFieldAwareTypeHandler : IReferenceTypeHandler, IVersionedTypeHandler , ICascadingTypeHandler, IVirtualAttributeHandler { void AddFieldIndices(ObjectIdContextImpl context); void CollectIDs(CollectIdContext context, IPredicate4 predicate); void DeleteMembers(DeleteContextImpl deleteContext, bool isUpdate); void ReadVirtualAttributes(ObjectReferenceContext context); void ClassMetadata(Db4objects.Db4o.Internal.ClassMetadata classMetadata); bool SeekToField(ObjectHeaderContext context, ClassAspect aspect); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/CharHandler.cs0000644000175000017500000000436011700531646031130 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Handlers { public sealed class CharHandler : PrimitiveHandler { internal const int Length = Const4.CharBytes + Const4.AddedLength; private static readonly char Defaultvalue = (char)0; public override object DefaultValue() { return Defaultvalue; } public override int LinkLength() { return Length; } public override Type PrimitiveJavaClass() { return typeof(char); } internal override object Read1(ByteArrayBuffer a_bytes) { byte b1 = a_bytes.ReadByte(); byte b2 = a_bytes.ReadByte(); char ret = (char)((b1 & unchecked((int)(0xff))) | ((b2 & unchecked((int)(0xff))) << 8)); return ret; } public override void Write(object a_object, ByteArrayBuffer a_bytes) { char char_ = ((char)a_object); a_bytes.WriteByte((byte)(char_ & unchecked((int)(0xff)))); a_bytes.WriteByte((byte)(char_ >> 8)); } public override object Read(IReadContext context) { byte b1 = context.ReadByte(); byte b2 = context.ReadByte(); char charValue = (char)((b1 & unchecked((int)(0xff))) | ((b2 & unchecked((int)(0xff ))) << 8)); return charValue; } public override void Write(IWriteContext context, object obj) { char charValue = ((char)obj); context.WriteBytes(new byte[] { (byte)(charValue & unchecked((int)(0xff))), (byte )(charValue >> 8) }); } public override IPreparedComparison InternalPrepareComparison(object source) { char sourceChar = ((char)source); return new _IPreparedComparison_90(sourceChar); } private sealed class _IPreparedComparison_90 : IPreparedComparison { public _IPreparedComparison_90(char sourceChar) { this.sourceChar = sourceChar; } public int CompareTo(object target) { if (target == null) { return 1; } char targetChar = ((char)target); return sourceChar == targetChar ? 0 : (sourceChar < targetChar ? -1 : 1); } private readonly char sourceChar; } } } IVirtualAttributeHandler.cs0000644000175000017500000000046011700531646033614 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Handlers { /// public interface IVirtualAttributeHandler { void ReadVirtualAttributes(ObjectReferenceContext context); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/IntHandler.cs0000644000175000017500000000527511700531646031013 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers { /// public class IntHandler : PrimitiveHandler { private static readonly int Defaultvalue = 0; public override object Coerce(IReflectClass claxx, object obj) { return Coercion4.ToInt(obj); } public override object DefaultValue() { return Defaultvalue; } public override Type PrimitiveJavaClass() { return typeof(int); } public override int LinkLength() { return Const4.IntLength; } /// public override object Read(MarshallerFamily mf, StatefulBuffer writer, bool redirect ) { return mf._primitive.ReadInteger(writer); } internal override object Read1(ByteArrayBuffer a_bytes) { return a_bytes.ReadInt(); } public override void Write(object obj, ByteArrayBuffer writer) { Write(((int)obj), writer); } public virtual void Write(int intValue, ByteArrayBuffer writer) { WriteInt(intValue, writer); } public static void WriteInt(int a_int, ByteArrayBuffer a_bytes) { a_bytes.WriteInt(a_int); } public override void DefragIndexEntry(DefragmentContextImpl context) { context.IncrementIntSize(); } public override object Read(IReadContext context) { return context.ReadInt(); } public override void Write(IWriteContext context, object obj) { context.WriteInt(((int)obj)); } public override IPreparedComparison InternalPrepareComparison(object source) { return NewPrepareCompare(((int)source)); } public virtual IPreparedComparison NewPrepareCompare(int i) { return new IntHandler.PreparedIntComparison(this, i); } public static int Compare(int first, int second) { if (first == second) { return 0; } return first > second ? 1 : -1; } public sealed class PreparedIntComparison : IPreparedComparison { private readonly int _sourceInt; public PreparedIntComparison(IntHandler _enclosing, int sourceInt) { this._enclosing = _enclosing; this._sourceInt = sourceInt; } public int CompareTo(object target) { if (target == null) { return 1; } int targetInt = ((int)target); return IntHandler.Compare(this._sourceInt, targetInt); } private readonly IntHandler _enclosing; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/DoubleHandler.cs0000644000175000017500000000426411700531646031470 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Handlers { /// public class DoubleHandler : LongHandler { private static readonly double Defaultvalue = System.Convert.ToDouble(0); public override object Coerce(IReflectClass claxx, object obj) { return Coercion4.ToDouble(obj); } public override object DefaultValue() { return Defaultvalue; } public override Type PrimitiveJavaClass() { return typeof(double); } /// public override object Read(MarshallerFamily mf, StatefulBuffer buffer, bool redirect ) { return mf._primitive.ReadDouble(buffer); } internal override object Read1(ByteArrayBuffer buffer) { return PrimitiveMarshaller().ReadDouble(buffer); } public override void Write(object a_object, ByteArrayBuffer a_bytes) { a_bytes.WriteLong(Platform4.DoubleToLong(((double)a_object))); } public override object Read(IReadContext context) { long l = (long)base.Read(context); return Platform4.LongToDouble(l); } public override void Write(IWriteContext context, object obj) { context.WriteLong(Platform4.DoubleToLong(((double)obj))); } public override IPreparedComparison InternalPrepareComparison(object source) { double sourceDouble = ((double)source); return new _IPreparedComparison_55(sourceDouble); } private sealed class _IPreparedComparison_55 : IPreparedComparison { public _IPreparedComparison_55(double sourceDouble) { this.sourceDouble = sourceDouble; } public int CompareTo(object target) { if (target == null) { return 1; } double targetDouble = ((double)target); return sourceDouble == targetDouble ? 0 : (sourceDouble < targetDouble ? -1 : 1); } private readonly double sourceDouble; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/PlainObjectHandler.cs0000644000175000017500000000153311700531646032444 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers { /// Tyehandler for naked plain objects (java.lang.Object). /// Tyehandler for naked plain objects (java.lang.Object). public class PlainObjectHandler : IReferenceTypeHandler { public virtual void Defragment(IDefragmentContext context) { } /// public virtual void Delete(IDeleteContext context) { } public virtual void Activate(IReferenceActivationContext context) { } public virtual void Write(IWriteContext context, object obj) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/StringBufferHandler.cs0000644000175000017500000000105011700531646032644 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Text; using Db4objects.Db4o.Internal.Handlers; namespace Db4objects.Db4o.Internal.Handlers { public sealed class StringBufferHandler : StringBasedValueTypeHandlerBase { public StringBufferHandler() : base(typeof(StringBuilder)) { } protected override string ConvertObject(object obj) { return ((StringBuilder)obj).ToString(); } protected override object ConvertString(string str) { return new StringBuilder(str); } } } StringBasedValueTypeHandlerBase.cs0000644000175000017500000000432211700531646035031 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers { public abstract class StringBasedValueTypeHandlerBase : IValueTypeHandler, IBuiltinTypeHandler , IVariableLengthTypeHandler, IQueryableTypeHandler, IComparable4 { public readonly Type _clazz; private IReflectClass _classReflector; public StringBasedValueTypeHandlerBase(Type clazz) { _clazz = clazz; } public virtual void Defragment(IDefragmentContext context) { StringHandler(context).Defragment(context); } /// public virtual void Delete(IDeleteContext context) { StringHandler(context).Delete(context); } public virtual object Read(IReadContext context) { object read = StringHandler(context).Read(context); if (null == read) { return null; } return ConvertString((string)read); } public virtual void Write(IWriteContext context, object obj) { StringHandler(context).Write(context, ConvertObject((object)obj)); } private Db4objects.Db4o.Internal.Handlers.StringHandler StringHandler(IContext context ) { return Handlers(context)._stringHandler; } private HandlerRegistry Handlers(IContext context) { return ((IInternalObjectContainer)context.ObjectContainer()).Handlers; } public virtual IPreparedComparison PrepareComparison(IContext context, object obj ) { return StringHandler(context).PrepareComparison(context, obj); } public virtual IReflectClass ClassReflector() { return _classReflector; } public virtual void RegisterReflector(IReflector reflector) { _classReflector = reflector.ForClass(_clazz); } public virtual bool DescendsIntoMembers() { return false; } protected abstract string ConvertObject(object obj); protected abstract object ConvertString(string str); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/NetType.cs0000644000175000017500000000045511700531646030346 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Handlers { internal interface INetType { object DefaultValue(); int TypeID(); void Write(object obj, byte[] bytes, int offset); object Read(byte[] bytes, int offset); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers/StringHandler.cs0000644000175000017500000002010211700531646031511 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Handlers { /// public class StringHandler : IValueTypeHandler, IIndexableTypeHandler, IBuiltinTypeHandler , IVariableLengthTypeHandler, IQueryableTypeHandler { private IReflectClass _classReflector; public virtual IReflectClass ClassReflector() { return _classReflector; } public virtual void Delete(IDeleteContext context) { } // do nothing, we are in a slot indirection anyway, the // buffer position does not need to be changed. internal virtual byte GetIdentifier() { return Const4.Yapstring; } public virtual bool DescendsIntoMembers() { return false; } public object IndexEntryToObject(IContext context, object indexEntry) { if (indexEntry is Slot) { Slot slot = (Slot)indexEntry; indexEntry = context.Transaction().Container().DecryptedBufferByAddress(slot.Address (), slot.Length()); } return ReadStringNoDebug(context, (IReadBuffer)indexEntry); } /// This readIndexEntry method reads from the parent slot. /// This readIndexEntry method reads from the parent slot. /// /// public virtual object ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer buffer) { int payLoadOffSet = buffer.ReadInt(); int length = buffer.ReadInt(); if (payLoadOffSet == 0) { return null; } return buffer.ReadPayloadWriter(payLoadOffSet, length); } /// /// public virtual object ReadIndexEntry(IObjectIdContext context) { int payLoadOffSet = context.ReadInt(); int length = context.ReadInt(); if (payLoadOffSet == 0) { return null; } return ((StatefulBuffer)context.Buffer()).ReadPayloadWriter(payLoadOffSet, length ); } /// This readIndexEntry method reads from the actual index in the file. /// This readIndexEntry method reads from the actual index in the file. public virtual object ReadIndexEntry(IContext context, ByteArrayBuffer reader) { Slot s = new Slot(reader.ReadInt(), reader.ReadInt()); if (IsInvalidSlot(s)) { return null; } return s; } private bool IsInvalidSlot(Slot slot) { return slot.IsNull(); } public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object entry) { if (entry == null) { writer.WriteInt(0); writer.WriteInt(0); return; } if (entry is StatefulBuffer) { StatefulBuffer entryAsWriter = (StatefulBuffer)entry; writer.WriteInt(entryAsWriter.GetAddress()); writer.WriteInt(entryAsWriter.Length()); return; } if (entry is Slot) { Slot s = (Slot)entry; writer.WriteInt(s.Address()); writer.WriteInt(s.Length()); return; } throw new ArgumentException(); } public void WriteShort(Transaction trans, string str, ByteArrayBuffer buffer) { StringIo(trans.Container()).WriteLengthAndString(buffer, str); } internal virtual ByteArrayBuffer Val(object obj, IContext context) { if (obj is ByteArrayBuffer) { return (ByteArrayBuffer)obj; } ObjectContainerBase oc = context.Transaction().Container(); if (obj is string) { return WriteToBuffer((IInternalObjectContainer)oc, (string)obj); } if (obj is Slot) { Slot s = (Slot)obj; return oc.DecryptedBufferByAddress(s.Address(), s.Length()); } return null; } /// /// returns: -x for left is greater and +x for right is greater /// FIXME: The returned value is the wrong way around. /// /// /// returns: -x for left is greater and +x for right is greater /// FIXME: The returned value is the wrong way around. /// TODO: You will need collators here for different languages. /// internal int Compare(ByteArrayBuffer a_compare, ByteArrayBuffer a_with) { if (a_compare == null) { if (a_with == null) { return 0; } return -1; } if (a_with == null) { return 1; } return Compare(a_compare._buffer, a_with._buffer); } public static int Compare(byte[] compare, byte[] with) { int min = compare.Length < with.Length ? compare.Length : with.Length; int start = Const4.IntLength; for (int i = start; i < min; i++) { if (compare[i] != with[i]) { return compare[i] - with[i]; } } return compare.Length - with.Length; } public virtual void DefragIndexEntry(DefragmentContextImpl context) { context.CopyAddress(); // length context.IncrementIntSize(); } public virtual void Write(IWriteContext context, object obj) { InternalWrite((IInternalObjectContainer)context.ObjectContainer(), context, (string )obj); } protected static void InternalWrite(IInternalObjectContainer objectContainer, IWriteBuffer buffer, string str) { StringIo(objectContainer).WriteLengthAndString(buffer, str); } public static ByteArrayBuffer WriteToBuffer(IInternalObjectContainer container, string str) { ByteArrayBuffer buffer = new ByteArrayBuffer(StringIo(container).Length(str)); InternalWrite(container, buffer, str); return buffer; } protected static LatinStringIO StringIo(IContext context) { return StringIo((IInternalObjectContainer)context.ObjectContainer()); } protected static LatinStringIO StringIo(IInternalObjectContainer objectContainer) { return objectContainer.Container.StringIO(); } public static string ReadString(IContext context, IReadBuffer buffer) { string str = ReadStringNoDebug(context, buffer); return str; } public static string ReadStringNoDebug(IContext context, IReadBuffer buffer) { return Intern(context, StringIo(context).ReadLengthAndString(buffer)); } protected static string Intern(IContext context, string str) { if (context.ObjectContainer().Ext().Configure().InternStrings()) { return string.Intern(str); } return str; } public virtual object Read(IReadContext context) { return ReadString(context, context); } public virtual void Defragment(IDefragmentContext context) { context.IncrementOffset(LinkLength()); } public virtual IPreparedComparison PrepareComparison(IContext context, object obj ) { ByteArrayBuffer sourceBuffer = Val(obj, context); return new _IPreparedComparison_229(this, context, sourceBuffer); } private sealed class _IPreparedComparison_229 : IPreparedComparison { public _IPreparedComparison_229(StringHandler _enclosing, IContext context, ByteArrayBuffer sourceBuffer) { this._enclosing = _enclosing; this.context = context; this.sourceBuffer = sourceBuffer; } public int CompareTo(object target) { ByteArrayBuffer targetBuffer = this._enclosing.Val(target, context); return this._enclosing.Compare(sourceBuffer, targetBuffer); } private readonly StringHandler _enclosing; private readonly IContext context; private readonly ByteArrayBuffer sourceBuffer; } public virtual int LinkLength() { return Const4.IndirectionLength; } public virtual void RegisterReflector(IReflector reflector) { _classReflector = reflector.ForClass(typeof(string)); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ByteArrayBuffer.cs0000644000175000017500000001450411700531646030252 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Sharpen; using Sharpen.Lang; namespace Db4objects.Db4o.Internal { /// public class ByteArrayBuffer : IReadWriteBuffer { private static readonly ThreadLocal _checkXBytes = Debug4.xbytes ? new ThreadLocal () : null; public byte[] _buffer; public int _offset; internal ByteArrayBuffer() { } public ByteArrayBuffer(int length) : this() { // for coding convenience, we allow objects to grab into the buffer _buffer = new byte[length]; } public ByteArrayBuffer(byte[] buffer) : this() { _buffer = buffer; } public virtual void Seek(int offset) { _offset = offset; } public virtual void WriteBytes(byte[] bytes) { System.Array.Copy(bytes, 0, _buffer, _offset, bytes.Length); _offset += bytes.Length; } // TODO: Change all callers to call writeBytes directly. public virtual void Append(byte[] bytes) { WriteBytes(bytes); } public bool ContainsTheSame(Db4objects.Db4o.Internal.ByteArrayBuffer other) { if (other != null) { return Arrays4.Equals(_buffer, other._buffer); } return false; } public virtual void CopyTo(Db4objects.Db4o.Internal.ByteArrayBuffer to, int fromOffset , int toOffset, int length) { System.Array.Copy(_buffer, fromOffset, to._buffer, toOffset, length); } public virtual int Length() { return _buffer.Length; } public virtual void IncrementOffset(int a_by) { _offset += a_by; } /// non-encrypted read, used for indexes public virtual void Read(ObjectContainerBase stream, int address, int addressOffset ) { stream.ReadBytes(_buffer, address, addressOffset, Length()); } public void ReadBegin(byte identifier) { } public virtual BitMap4 ReadBitMap(int bitCount) { BitMap4 map = new BitMap4(_buffer, _offset, bitCount); _offset += map.MarshalledLength(); return map; } public virtual byte ReadByte() { return _buffer[_offset++]; } public virtual byte[] ReadBytes(int a_length) { byte[] bytes = new byte[a_length]; ReadBytes(bytes); return bytes; } public virtual void ReadBytes(byte[] bytes) { int length = bytes.Length; System.Array.Copy(_buffer, _offset, bytes, 0, length); _offset += length; } /// public Db4objects.Db4o.Internal.ByteArrayBuffer ReadEmbeddedObject(Transaction trans ) { int address = ReadInt(); int length = ReadInt(); if (address == 0) { return null; } return trans.Container().DecryptedBufferByAddress(address, length); } /// public virtual void ReadEncrypt(ObjectContainerBase stream, int address) { stream.ReadBytes(_buffer, address, Length()); stream._handlers.Decrypt(this); } public virtual void ReadEnd() { } public int ReadInt() { int o = (_offset += 4) - 1; return (_buffer[o] & 255) | (_buffer[--o] & 255) << 8 | (_buffer[--o] & 255) << 16 | _buffer[--o] << 24; } public virtual long ReadLong() { return LongHandler.ReadLong(this); } public virtual Db4objects.Db4o.Internal.ByteArrayBuffer ReadPayloadReader(int offset , int length) { Db4objects.Db4o.Internal.ByteArrayBuffer payLoad = new Db4objects.Db4o.Internal.ByteArrayBuffer (length); System.Array.Copy(_buffer, offset, payLoad._buffer, 0, length); return payLoad; } internal virtual void ReplaceWith(byte[] a_bytes) { System.Array.Copy(a_bytes, 0, _buffer, 0, Length()); } public override string ToString() { string str = string.Empty; for (int i = 0; i < _buffer.Length; i++) { if (i > 0) { str += " , "; } str += _buffer[i]; } return str; } public virtual void WriteBegin(byte a_identifier) { } public void WriteBitMap(BitMap4 nullBitMap) { nullBitMap.WriteTo(_buffer, _offset); _offset += nullBitMap.MarshalledLength(); } public void WriteByte(byte a_byte) { _buffer[_offset++] = a_byte; } public virtual void WriteEnd() { if (Deploy.debug && Deploy.brackets) { WriteByte(Const4.Yapend); } } public void WriteInt(int a_int) { int o = _offset + 4; _offset = o; byte[] b = _buffer; b[--o] = (byte)a_int; b[--o] = (byte)(a_int >>= 8); b[--o] = (byte)(a_int >>= 8); b[--o] = (byte)(a_int >> 8); } public virtual void WriteIDOf(Transaction trans, object obj) { if (obj == null) { WriteInt(0); return; } if (obj is PersistentBase) { WriteIDOf(trans, (PersistentBase)obj); return; } WriteInt(((int)obj)); } public virtual void WriteIDOf(Transaction trans, PersistentBase persistent) { if (persistent == null) { WriteInt(0); return; } if (CanWritePersistentBase()) { persistent.WriteOwnID(trans, this); } else { WriteInt(persistent.GetID()); } } protected virtual bool CanWritePersistentBase() { return true; } public virtual void WriteShortString(Transaction trans, string a_string) { trans.Container()._handlers._stringHandler.WriteShort(trans, a_string, this); } public virtual void WriteLong(long l) { LongHandler.WriteLong(this, l); } public virtual void IncrementIntSize() { IncrementOffset(Const4.IntLength); } public virtual int Offset() { return _offset; } public virtual void EnsureSize(int size) { if (size == _buffer.Length) { return; } _buffer = new byte[size]; } public virtual void Skip(int length) { Seek(_offset + length); } public virtual void CheckXBytes(bool flag) { } public virtual bool CheckXBytes() { throw new InvalidOperationException(); } public virtual bool Eof() { return _offset == _buffer.Length; } public virtual int RemainingByteCount() { return _buffer.Length - _offset; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Null.cs0000644000175000017500000000264511700531646026133 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal { /// public class Null : IIndexable4, IPreparedComparison { public static readonly Db4objects.Db4o.Internal.Null Instance = new Db4objects.Db4o.Internal.Null (); private Null() { } public virtual int CompareTo(object a_obj) { if (a_obj == null) { return 0; } return -1; } public virtual int LinkLength() { return 0; } public virtual object ReadIndexEntry(IContext context, ByteArrayBuffer a_reader) { return null; } public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer a_writer, object a_object) { } // do nothing public virtual void DefragIndexEntry(DefragmentContextImpl context) { } // do nothing public virtual IPreparedComparison PrepareComparison(IContext context, object obj_ ) { return new _IPreparedComparison_43(); } private sealed class _IPreparedComparison_43 : IPreparedComparison { public _IPreparedComparison_43() { } public int CompareTo(object obj) { if (obj == null) { return 0; } if (obj is Db4objects.Db4o.Internal.Null) { return 0; } return -1; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IReadWriteable.cs0000644000175000017500000000041011700531646030030 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public interface IReadWriteable : IReadable { void Write(ByteArrayBuffer buffer); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/PendingClassInits.cs0000644000175000017500000000442311700531646030576 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { internal class PendingClassInits { private readonly Transaction _systemTransaction; private Collection4 _pending = new Collection4(); private IQueue4 _members = new NonblockingQueue(); private IQueue4 _statics = new NonblockingQueue(); private IQueue4 _writes = new NonblockingQueue(); private IQueue4 _inits = new NonblockingQueue(); private bool _running = false; internal PendingClassInits(Transaction systemTransaction) { _systemTransaction = systemTransaction; } internal virtual void Process(ClassMetadata newClassMetadata) { if (_pending.Contains(newClassMetadata)) { return; } ClassMetadata ancestor = newClassMetadata.GetAncestor(); if (ancestor != null) { Process(ancestor); } _pending.Add(newClassMetadata); _members.Add(newClassMetadata); if (_running) { return; } _running = true; try { CheckInits(); _pending = new Collection4(); } finally { _running = false; } } private void InitializeAspects() { while (_members.HasNext()) { ClassMetadata classMetadata = ((ClassMetadata)_members.Next()); classMetadata.InitializeAspects(); _statics.Add(classMetadata); } } private void CheckStatics() { InitializeAspects(); while (_statics.HasNext()) { ClassMetadata classMetadata = ((ClassMetadata)_statics.Next()); classMetadata.StoreStaticFieldValues(_systemTransaction, true); _writes.Add(classMetadata); InitializeAspects(); } } private void CheckWrites() { CheckStatics(); while (_writes.HasNext()) { ClassMetadata classMetadata = ((ClassMetadata)_writes.Next()); classMetadata.SetStateDirty(); classMetadata.Write(_systemTransaction); _inits.Add(classMetadata); CheckStatics(); } } private void CheckInits() { CheckWrites(); while (_inits.HasNext()) { ClassMetadata classMetadata = ((ClassMetadata)_inits.Next()); classMetadata.InitConfigOnUp(_systemTransaction); CheckWrites(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ReflectException.cs0000644000175000017500000000211111700531646030450 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Internal { /// /// db4o-specific exception.
///
/// This exception is thrown when one of the db4o reflection methods fails. ///
/// /// db4o-specific exception.
///
/// This exception is thrown when one of the db4o reflection methods fails. ///
/// Db4objects.Db4o.Reflect [System.Serializable] public class ReflectException : Db4oRecoverableException { public ReflectException(string msg, Exception cause) : base(msg, cause) { } /// Constructor with the cause exception /// cause exception public ReflectException(Exception cause) : base(cause) { } /// Constructor with message /// detailed explanation public ReflectException(string message) : base(message) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/0000755000175000017500000000000011700531646025770 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/0000755000175000017500000000000011700531646027747 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QCon.cs0000644000175000017500000004770411700531646031152 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Query; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Types; namespace Db4objects.Db4o.Internal.Query.Processor { /// Base class for all constraints on queries. /// Base class for all constraints on queries. /// public abstract class QCon : IConstraint, IVisitor4, IUnversioned { internal static readonly IDGenerator idGenerator = new IDGenerator(); [System.NonSerialized] internal QCandidates i_candidates; private Collection4 i_childrenCandidates; protected List4 _children; protected QE i_evaluator = QE.Default; private int i_id; internal Collection4 i_joins; protected Db4objects.Db4o.Internal.Query.Processor.QCon i_parent; private bool i_removed = false; [System.NonSerialized] internal Db4objects.Db4o.Internal.Transaction i_trans; [System.NonSerialized] private bool _processedByIndex; public QCon() { } internal QCon(Db4objects.Db4o.Internal.Transaction a_trans) { //Used for query debug only. // our candidate object tree // collection of QCandidates to collect children elements and to // execute children. For convenience we hold them in the constraint, // so we can do collection and execution in two steps // all subconstraints // for evaluation // ID handling for fast find of QConstraint objects in // pending OR evaluations // ANDs and ORs on this constraint // the parent of this constraint or null, if this is a root // prevents circular calls on removal // our transaction to get a stream object anywhere // whether or not this constraint was used to get the initial set // in the FieldIndexProcessor // C/S only i_id = idGenerator.Next(); i_trans = a_trans; } internal virtual Db4objects.Db4o.Internal.Query.Processor.QCon AddConstraint(Db4objects.Db4o.Internal.Query.Processor.QCon a_child) { _children = new List4(_children, a_child); return a_child; } public virtual ObjectContainerBase Container() { return Transaction().Container(); } public virtual Db4objects.Db4o.Internal.Transaction Transaction() { return i_trans; } internal virtual void AddJoin(QConJoin a_join) { if (i_joins == null) { i_joins = new Collection4(); } i_joins.Add(a_join); } internal virtual Db4objects.Db4o.Internal.Query.Processor.QCon AddSharedConstraint (QField a_field, object a_object) { QConObject newConstraint = new QConObject(i_trans, this, a_field, a_object); AddConstraint(newConstraint); return newConstraint; } public virtual IConstraint And(IConstraint andWith) { lock (StreamLock()) { return Join(andWith, true); } } internal virtual bool Attach(QQuery query, string a_field) { Db4objects.Db4o.Internal.Query.Processor.QCon qcon = this; ClassMetadata yc = GetYapClass(); bool[] foundField = new bool[] { false }; ForEachChildField(a_field, new _IVisitor4_104(foundField, query)); if (foundField[0]) { return true; } QField qf = null; if (yc == null || yc.HoldsAnyClass()) { int[] count = new int[] { 0 }; FieldMetadata[] yfs = new FieldMetadata[] { null }; i_trans.Container().ClassCollection().AttachQueryNode(a_field, new _IVisitor4_122 (yfs, count)); if (count[0] == 0) { return false; } if (count[0] == 1) { qf = yfs[0].QField(i_trans); } else { qf = new QField(i_trans, a_field, null, 0, 0); } } else { if (yc.IsTranslated()) { i_trans.Container()._handlers.DiagnosticProcessor().DescendIntoTranslator(yc, a_field ); } FieldMetadata yf = yc.FieldMetadataForName(a_field); if (yf != null) { qf = yf.QField(i_trans); } if (qf == null) { qf = new QField(i_trans, a_field, null, 0, 0); } } QConPath qcp = new QConPath(i_trans, qcon, qf); query.AddConstraint(qcp); qcon.AddConstraint(qcp); return true; } private sealed class _IVisitor4_104 : IVisitor4 { public _IVisitor4_104(bool[] foundField, QQuery query) { this.foundField = foundField; this.query = query; } public void Visit(object obj) { foundField[0] = true; query.AddConstraint((Db4objects.Db4o.Internal.Query.Processor.QCon)obj); } private readonly bool[] foundField; private readonly QQuery query; } private sealed class _IVisitor4_122 : IVisitor4 { public _IVisitor4_122(FieldMetadata[] yfs, int[] count) { this.yfs = yfs; this.count = count; } public void Visit(object obj) { yfs[0] = (FieldMetadata)((object[])obj)[1]; count[0]++; } private readonly FieldMetadata[] yfs; private readonly int[] count; } public virtual bool CanBeIndexLeaf() { return false; } public virtual bool CanLoadByIndex() { // virtual return false; } internal virtual void CheckLastJoinRemoved() { if (i_joins.Size() == 0) { i_joins = null; } } /// internal virtual void Collect(QCandidates candidates) { } // virtual public virtual IConstraint Contains() { throw NotSupported(); } internal virtual void CreateCandidates(Collection4 a_candidateCollection) { IEnumerator j = a_candidateCollection.GetEnumerator(); while (j.MoveNext()) { QCandidates candidates = (QCandidates)j.Current; if (candidates.TryAddConstraint(this)) { i_candidates = candidates; return; } } i_candidates = new QCandidates((LocalTransaction)i_trans, GetYapClass(), GetField ()); i_candidates.AddConstraint(this); a_candidateCollection.Add(i_candidates); } internal virtual void DoNotInclude(QCandidate a_root) { if (DTrace.enabled) { DTrace.Donotinclude.Log(Id()); } if (i_parent != null) { i_parent.Visit1(a_root, this, false); } else { a_root.DoNotInclude(); } } public virtual IConstraint Equal() { throw NotSupported(); } /// internal virtual bool Evaluate(QCandidate candidate) { throw Exceptions4.VirtualException(); } internal virtual void EvaluateChildren() { IEnumerator i = i_childrenCandidates.GetEnumerator(); while (i.MoveNext()) { ((QCandidates)i.Current).Evaluate(); } } internal virtual void EvaluateCollectChildren() { if (DTrace.enabled) { DTrace.CollectChildren.Log(Id()); } IEnumerator i = i_childrenCandidates.GetEnumerator(); while (i.MoveNext()) { ((QCandidates)i.Current).Collect(i_candidates); } } internal virtual void EvaluateCreateChildrenCandidates() { i_childrenCandidates = new Collection4(); IEnumerator i = IterateChildren(); while (i.MoveNext()) { ((Db4objects.Db4o.Internal.Query.Processor.QCon)i.Current).CreateCandidates(i_childrenCandidates ); } } internal virtual void EvaluateEvaluations() { IEnumerator i = IterateChildren(); while (i.MoveNext()) { ((Db4objects.Db4o.Internal.Query.Processor.QCon)i.Current).EvaluateEvaluationsExec (i_candidates, true); } } /// /// internal virtual void EvaluateEvaluationsExec(QCandidates candidates, bool rereadObject ) { } // virtual internal virtual void EvaluateSelf() { i_candidates.Filter(this); } internal virtual void EvaluateSimpleChildren() { // TODO: sort the constraints for YapFields first, // so we stay with the same YapField if (_children == null) { return; } IEnumerator i = IterateChildren(); while (i.MoveNext()) { Db4objects.Db4o.Internal.Query.Processor.QCon qcon = (Db4objects.Db4o.Internal.Query.Processor.QCon )i.Current; i_candidates.SetCurrentConstraint(qcon); qcon.SetCandidates(i_candidates); qcon.EvaluateSimpleExec(i_candidates); } i_candidates.SetCurrentConstraint(null); } /// internal virtual void EvaluateSimpleExec(QCandidates candidates) { } // virtual internal virtual void ExchangeConstraint(Db4objects.Db4o.Internal.Query.Processor.QCon a_exchange, Db4objects.Db4o.Internal.Query.Processor.QCon a_with) { List4 previous = null; List4 current = _children; while (current != null) { if (current._element == a_exchange) { if (previous == null) { _children = ((List4)current._next); } else { previous._next = ((List4)current._next); } } previous = current; current = ((List4)current._next); } _children = new List4(_children, a_with); } internal virtual void ForEachChildField(string name, IVisitor4 visitor) { IEnumerator i = IterateChildren(); while (i.MoveNext()) { object obj = i.Current; if (obj is QConObject) { if (((QConObject)obj).GetField().Name().Equals(name)) { visitor.Visit(obj); } } } } public virtual QField GetField() { return null; } public virtual object GetObject() { throw NotSupported(); } internal virtual Db4objects.Db4o.Internal.Query.Processor.QCon GetRoot() { if (i_parent != null) { return i_parent.GetRoot(); } return this; } internal virtual Db4objects.Db4o.Internal.Query.Processor.QCon ProduceTopLevelJoin () { if (!HasJoins()) { return this; } IEnumerator i = IterateJoins(); if (i_joins.Size() == 1) { i.MoveNext(); return ((Db4objects.Db4o.Internal.Query.Processor.QCon)i.Current).ProduceTopLevelJoin (); } Collection4 col = new Collection4(); while (i.MoveNext()) { col.Ensure(((Db4objects.Db4o.Internal.Query.Processor.QCon)i.Current).ProduceTopLevelJoin ()); } i = col.GetEnumerator(); i.MoveNext(); Db4objects.Db4o.Internal.Query.Processor.QCon qcon = (Db4objects.Db4o.Internal.Query.Processor.QCon )i.Current; if (col.Size() == 1) { return qcon; } while (i.MoveNext()) { qcon = (Db4objects.Db4o.Internal.Query.Processor.QCon)qcon.And((IConstraint)i.Current ); } return qcon; } internal virtual ClassMetadata GetYapClass() { return null; } public virtual IConstraint Greater() { throw NotSupported(); } public virtual bool HasChildren() { return _children != null; } public virtual bool HasParent() { return i_parent != null; } public virtual Db4objects.Db4o.Internal.Query.Processor.QCon Parent() { return i_parent; } public virtual bool HasJoins() { if (i_joins == null) { return false; } return i_joins.Size() > 0; } public virtual bool HasObjectInParentPath(object obj) { if (i_parent != null) { return i_parent.HasObjectInParentPath(obj); } return false; } public virtual IConstraint Identity() { throw NotSupported(); } public virtual IConstraint ByExample() { throw NotSupported(); } public virtual int IdentityID() { return 0; } internal virtual bool IsNot() { return i_evaluator is QENot; } internal virtual bool IsNullConstraint() { return false; } public virtual IEnumerator IterateJoins() { if (i_joins == null) { return Iterators.EmptyIterator; } return i_joins.GetEnumerator(); } public virtual IEnumerator IterateChildren() { if (_children == null) { return Iterators.EmptyIterator; } return new Iterator4Impl(_children); } internal virtual IConstraint Join(IConstraint a_with, bool a_and) { if (!(a_with is Db4objects.Db4o.Internal.Query.Processor.QCon)) { // TODO: one of our STOr test cases somehow carries // the same constraint twice. This may be a result // of a funny AND. Check! return null; } if (a_with == this) { return this; } return Join1((Db4objects.Db4o.Internal.Query.Processor.QCon)a_with, a_and); } internal virtual IConstraint Join1(Db4objects.Db4o.Internal.Query.Processor.QCon a_with, bool a_and) { if (a_with is QConstraints) { int j = 0; Collection4 joinHooks = new Collection4(); IConstraint[] constraints = ((QConstraints)a_with).ToArray(); for (j = 0; j < constraints.Length; j++) { joinHooks.Ensure(((Db4objects.Db4o.Internal.Query.Processor.QCon)constraints[j]). JoinHook()); } IConstraint[] joins = new IConstraint[joinHooks.Size()]; j = 0; IEnumerator i = joinHooks.GetEnumerator(); while (i.MoveNext()) { joins[j++] = Join((IConstraint)i.Current, a_and); } return new QConstraints(i_trans, joins); } Db4objects.Db4o.Internal.Query.Processor.QCon myHook = JoinHook(); Db4objects.Db4o.Internal.Query.Processor.QCon otherHook = a_with.JoinHook(); if (myHook == otherHook) { // You might like to check out, what happens, if you // remove this line. It seems to open a bug in an // StOr testcase. return myHook; } QConJoin cj = new QConJoin(i_trans, myHook, otherHook, a_and); myHook.AddJoin(cj); otherHook.AddJoin(cj); return cj; } internal virtual Db4objects.Db4o.Internal.Query.Processor.QCon JoinHook() { return ProduceTopLevelJoin(); } public virtual IConstraint Like() { throw NotSupported(); } public virtual IConstraint StartsWith(bool caseSensitive) { throw NotSupported(); } public virtual IConstraint EndsWith(bool caseSensitive) { throw NotSupported(); } internal virtual void Log(string indent) { } // System.out.println(indent + "JOINS"); // joins += join.i_id + " "; // System.out.println(joins); // System.out.println(indent + getClass().getName() + " " + i_id + " " + i_debugField + " " + joins ); // System.out.println(indent + "CONSTRAINTS"); internal virtual string LogObject() { return string.Empty; } internal virtual void Marshall() { IEnumerator i = IterateChildren(); while (i.MoveNext()) { ((Db4objects.Db4o.Internal.Query.Processor.QCon)i.Current).Marshall(); } } public virtual IConstraint Not() { lock (StreamLock()) { if (!(i_evaluator is QENot)) { i_evaluator = new QENot(i_evaluator); } return this; } } private Exception NotSupported() { return new Exception("Not supported."); } /// public virtual bool OnSameFieldAs(Db4objects.Db4o.Internal.Query.Processor.QCon other ) { return false; } public virtual IConstraint Or(IConstraint orWith) { lock (StreamLock()) { return Join(orWith, false); } } internal virtual bool Remove() { if (!i_removed) { i_removed = true; RemoveChildrenJoins(); return true; } return false; } internal virtual void RemoveChildrenJoins() { if (!HasJoins()) { return; } Collection4 toBeRemoved = CollectJoinsToBeRemoved(); i_joins.RemoveAll(toBeRemoved); CheckLastJoinRemoved(); } private Collection4 CollectJoinsToBeRemoved() { Collection4 toBeRemoved = new Collection4(); IEnumerator joinIter = IterateJoins(); while (joinIter.MoveNext()) { QConJoin join = (QConJoin)joinIter.Current; if (join.RemoveForParent(this)) { toBeRemoved.Add(join); } } return toBeRemoved; } internal virtual void RemoveJoin(QConJoin a_join) { i_joins.Remove(a_join); CheckLastJoinRemoved(); } internal virtual void RemoveNot() { if (IsNot()) { i_evaluator = ((QENot)i_evaluator).Evaluator(); } } public virtual void SetCandidates(QCandidates a_candidates) { i_candidates = a_candidates; } internal virtual void SetParent(Db4objects.Db4o.Internal.Query.Processor.QCon a_newParent ) { i_parent = a_newParent; } /// /// internal virtual Db4objects.Db4o.Internal.Query.Processor.QCon ShareParent(object obj, BooleanByRef removeExisting) { // virtual return null; } /// /// internal virtual QConClass ShareParentForClass(IReflectClass claxx, BooleanByRef removeExisting) { // virtual return null; } public virtual IConstraint Smaller() { throw NotSupported(); } protected virtual object StreamLock() { return i_trans.Container().Lock(); } internal virtual void Unmarshall(Db4objects.Db4o.Internal.Transaction a_trans) { if (i_trans != null) { return; } i_trans = a_trans; UnmarshallParent(a_trans); UnmarshallJoins(a_trans); UnmarshallChildren(a_trans); } private void UnmarshallParent(Db4objects.Db4o.Internal.Transaction a_trans) { if (i_parent != null) { i_parent.Unmarshall(a_trans); } } private void UnmarshallChildren(Db4objects.Db4o.Internal.Transaction a_trans) { IEnumerator i = IterateChildren(); while (i.MoveNext()) { ((Db4objects.Db4o.Internal.Query.Processor.QCon)i.Current).Unmarshall(a_trans); } } private void UnmarshallJoins(Db4objects.Db4o.Internal.Transaction a_trans) { if (HasJoins()) { IEnumerator i = IterateJoins(); while (i.MoveNext()) { ((Db4objects.Db4o.Internal.Query.Processor.QCon)i.Current).Unmarshall(a_trans); } } } public virtual void Visit(object obj) { QCandidate qc = (QCandidate)obj; Visit1(qc.GetRoot(), this, Evaluate(qc)); } internal virtual void Visit(QCandidate a_root, bool res) { Visit1(a_root, this, i_evaluator.Not(res)); } internal virtual void Visit1(QCandidate root, Db4objects.Db4o.Internal.Query.Processor.QCon reason, bool res) { // The a_reason parameter makes it eays to distinguish // between calls from above (a_reason == this) and below. if (HasJoins()) { // this should probably be on the Join IEnumerator i = IterateJoins(); while (i.MoveNext()) { root.Evaluate(new QPending((QConJoin)i.Current, this, res)); } } else { if (!res) { DoNotInclude(root); } } } internal void VisitOnNull(QCandidate a_root) { // TODO: It may be more efficient to rule out // all possible keepOnNull issues when starting // evaluation. IEnumerator i = IterateChildren(); while (i.MoveNext()) { ((Db4objects.Db4o.Internal.Query.Processor.QCon)i.Current).VisitOnNull(a_root); } if (VisitSelfOnNull()) { Visit(a_root, IsNullConstraint()); } } internal virtual bool VisitSelfOnNull() { return true; } public virtual QE Evaluator() { return i_evaluator; } public virtual void SetProcessedByIndex() { InternalSetProcessedByIndex(); } protected virtual void InternalSetProcessedByIndex() { _processedByIndex = true; if (i_joins != null) { IEnumerator i = i_joins.GetEnumerator(); while (i.MoveNext()) { ((QConJoin)i.Current).SetProcessedByIndex(); } } } public virtual bool ProcessedByIndex() { return _processedByIndex; } public virtual int ChildrenCount() { return List4.Size(_children); } public virtual int Id() { return i_id; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QE.cs0000644000175000017500000000421011700531646030600 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Types; namespace Db4objects.Db4o.Internal.Query.Processor { /// Query Evaluator - Represents such things as >, >=, <, <=, EQUAL, LIKE, etc. /// /// Query Evaluator - Represents such things as >, >=, <, <=, EQUAL, LIKE, etc. /// /// public class QE : IUnversioned { internal static readonly QE Default = new QE(); public const int Nulls = 0; public const int Smaller = 1; public const int Equal = 2; public const int Greater = 3; internal virtual QE Add(QE evaluator) { return evaluator; } public virtual bool Identity() { return false; } internal virtual bool IsDefault() { return true; } internal virtual bool Evaluate(QConObject constraint, QCandidate candidate, object obj) { IPreparedComparison prepareComparison = constraint.PrepareComparison(candidate); if (obj == null) { return prepareComparison is Null; } if (prepareComparison is PreparedArrayContainsComparison) { return ((PreparedArrayContainsComparison)prepareComparison).IsEqual(obj); } return prepareComparison.CompareTo(obj) == 0; } public override bool Equals(object obj) { return obj != null && obj.GetType() == this.GetType(); } public override int GetHashCode() { return GetType().GetHashCode(); } // overridden in QENot internal virtual bool Not(bool res) { return res; } /// Specifies which part of the index to take. /// /// Specifies which part of the index to take. /// Array elements: /// [0] - smaller /// [1] - equal /// [2] - greater /// [3] - nulls /// /// public virtual void IndexBitMap(bool[] bits) { bits[QE.Equal] = true; } public virtual bool SupportsIndex() { return true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QEEqual.cs0000644000175000017500000000051511700531646031574 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public class QEEqual : QEAbstract { public override void IndexBitMap(bool[] bits) { bits[QE.Equal] = true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QConPath.cs0000644000175000017500000000771511700531646031765 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Query.Processor { /// /// Placeholder for a constraint, only necessary to attach children /// to the query graph. /// /// /// Placeholder for a constraint, only necessary to attach children /// to the query graph. /// Added upon a call to Query#descend(), if there is no /// other place to hook up a new constraint. /// /// public class QConPath : QConClass { public QConPath() { } internal QConPath(Transaction a_trans, QCon a_parent, QField a_field) : base(a_trans , a_parent, a_field, null) { if (a_field != null) { _classMetadata = a_field.GetFieldType(); } } public override bool CanLoadByIndex() { return false; } internal override bool Evaluate(QCandidate a_candidate) { if (!a_candidate.FieldIsAvailable()) { VisitOnNull(a_candidate.GetRoot()); } return true; } internal override void EvaluateSelf() { } // do nothing internal override bool IsNullConstraint() { return !HasChildren(); } internal override QConClass ShareParentForClass(IReflectClass a_class, BooleanByRef removeExisting) { if (i_parent == null) { return null; } QConClass newConstraint = new QConClass(i_trans, i_parent, GetField(), a_class); Morph(removeExisting, newConstraint, a_class); return newConstraint; } internal override QCon ShareParent(object a_object, BooleanByRef removeExisting) { if (i_parent == null) { return null; } object obj = GetField().Coerce(a_object); if (obj == No4.Instance) { QCon falseConstraint = new QConUnconditional(i_trans, false); Morph(removeExisting, falseConstraint, ReflectClassForObject(obj)); return falseConstraint; } QConObject newConstraint = new QConObject(i_trans, i_parent, GetField(), obj); Morph(removeExisting, newConstraint, ReflectClassForObject(obj)); return newConstraint; } private IReflectClass ReflectClassForObject(object obj) { return i_trans.Reflector().ForObject(obj); } // Our QConPath objects are just placeholders to fields, // so the parents are reachable. // If we find a "real" constraint, we throw the QPath // out and replace it with the other constraint. private void Morph(BooleanByRef removeExisting, QCon newConstraint, IReflectClass claxx) { bool mayMorph = true; if (claxx != null) { ClassMetadata yc = i_trans.Container().ProduceClassMetadata(claxx); if (yc != null) { IEnumerator i = IterateChildren(); while (i.MoveNext()) { QField qf = ((QCon)i.Current).GetField(); if (!yc.HasField(i_trans.Container(), qf.Name())) { mayMorph = false; break; } } } } // } if (mayMorph) { IEnumerator j = IterateChildren(); while (j.MoveNext()) { newConstraint.AddConstraint((QCon)j.Current); } if (HasJoins()) { IEnumerator k = IterateJoins(); while (k.MoveNext()) { QConJoin qcj = (QConJoin)k.Current; qcj.ExchangeConstraint(this, newConstraint); newConstraint.AddJoin(qcj); } } i_parent.ExchangeConstraint(this, newConstraint); removeExisting.value = true; } else { i_parent.AddConstraint(newConstraint); } } internal sealed override bool VisitSelfOnNull() { return false; } public override string ToString() { return "QConPath " + base.ToString(); } public override void SetProcessedByIndex() { if (ChildrenCount() <= 1) { InternalSetProcessedByIndex(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QENot.cs0000644000175000017500000000244311700531646031267 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public class QENot : QE { private QE i_evaluator; public QENot() { } internal QENot(QE a_evaluator) { // CS i_evaluator = a_evaluator; } internal override QE Add(QE evaluator) { if (!(evaluator is Db4objects.Db4o.Internal.Query.Processor.QENot)) { i_evaluator = i_evaluator.Add(evaluator); } return this; } public virtual QE Evaluator() { return i_evaluator; } public override bool Identity() { return i_evaluator.Identity(); } internal override bool IsDefault() { return false; } internal override bool Evaluate(QConObject a_constraint, QCandidate a_candidate, object a_value) { return !i_evaluator.Evaluate(a_constraint, a_candidate, a_value); } internal override bool Not(bool res) { return !res; } public override void IndexBitMap(bool[] bits) { i_evaluator.IndexBitMap(bits); for (int i = 0; i < 4; i++) { bits[i] = !bits[i]; } } public override bool SupportsIndex() { return i_evaluator.SupportsIndex(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QEAbstract.cs0000644000175000017500000000070611700531646032272 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public abstract class QEAbstract : QE { internal override QE Add(QE evaluator) { QE qe = new QEMulti(); qe.Add(this); qe.Add(evaluator); return qe; } internal override bool IsDefault() { return false; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QPending.cs0000644000175000017500000000312711700531646032006 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// internal class QPending : Tree { internal readonly QConJoin _join; internal QCon _constraint; internal int _result; internal const int False = -4; internal const int Both = 1; internal const int True = 2; internal QPending(QConJoin a_join, QCon a_constraint, bool a_firstResult) { // Constants, so QConJoin.evaluatePending is made easy: _join = a_join; _constraint = a_constraint; _result = a_firstResult ? True : False; } public override int Compare(Tree a_to) { return _constraint.Id() - ((Db4objects.Db4o.Internal.Query.Processor.QPending)a_to )._constraint.Id(); } internal virtual void ChangeConstraint() { _constraint = _join.GetOtherConstraint(_constraint); } public override object ShallowClone() { Db4objects.Db4o.Internal.Query.Processor.QPending pending = InternalClonePayload( ); base.ShallowCloneInternal(pending); return pending; } internal virtual Db4objects.Db4o.Internal.Query.Processor.QPending InternalClonePayload () { Db4objects.Db4o.Internal.Query.Processor.QPending pending = new Db4objects.Db4o.Internal.Query.Processor.QPending (_join, _constraint, false); pending._result = _result; return pending; } public override object Key() { throw new NotImplementedException(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QEIdentity.cs0000644000175000017500000000110511700531646032312 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public class QEIdentity : QEEqual { private int i_objectID; public override bool Identity() { return true; } internal override bool Evaluate(QConObject a_constraint, QCandidate a_candidate, object a_value) { if (i_objectID == 0) { i_objectID = a_constraint.GetObjectID(); } return a_candidate._key == i_objectID; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QEEndsWith.cs0000644000175000017500000000124211700531646032250 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public class QEEndsWith : QEStringCmp { /// for C/S messaging only public QEEndsWith() { } public QEEndsWith(bool caseSensitive_) : base(caseSensitive_) { } protected override bool CompareStrings(string candidate, string constraint) { int lastIndex = candidate.LastIndexOf(constraint); if (lastIndex == -1) { return false; } return lastIndex == candidate.Length - constraint.Length; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QConClass.cs0000644000175000017500000000707411700531646032134 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Query; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Query.Processor { /// Class constraint on queries /// public class QConClass : QConObject { [System.NonSerialized] private IReflectClass _claxx; private string _className; private bool i_equal; public QConClass() { } internal QConClass(Transaction a_trans, QCon a_parent, QField a_field, IReflectClass claxx) : base(a_trans, a_parent, a_field, null) { // C/S if (claxx != null) { _classMetadata = a_trans.Container().ProduceClassMetadata(claxx); if (claxx.Equals(a_trans.Container()._handlers.IclassObject)) { _classMetadata = (ClassMetadata)_classMetadata.TypeHandler(); } } _claxx = claxx; } internal QConClass(Transaction trans, IReflectClass claxx) : this(trans, null, null , claxx) { } public virtual string GetClassName() { return _claxx == null ? null : _claxx.GetName(); } public override bool CanBeIndexLeaf() { return false; } internal override bool Evaluate(QCandidate a_candidate) { bool res = true; IReflectClass claxx = a_candidate.ClassReflector(); if (claxx == null) { res = false; } else { res = i_equal ? _claxx.Equals(claxx) : _claxx.IsAssignableFrom(claxx); } return i_evaluator.Not(res); } internal override void EvaluateSelf() { // optimization for simple class queries: // No instantiation of objects, if not necessary. // Does not handle the special comparison of the // Compare interface. // if (i_candidates.WasLoadedFromClassIndex()) { if (i_evaluator.IsDefault()) { if (!HasJoins()) { if (_classMetadata != null && i_candidates.i_classMetadata != null) { if (_classMetadata.GetHigherHierarchy(i_candidates.i_classMetadata) == _classMetadata) { return; } } } } } i_candidates.Filter(this); } public override IConstraint Equal() { lock (StreamLock()) { i_equal = true; return this; } } internal override bool IsNullConstraint() { return false; } internal override string LogObject() { return string.Empty; } internal override void Marshall() { base.Marshall(); if (_claxx != null) { _className = Container().Config().ResolveAliasRuntimeName(_claxx.GetName()); } } public override string ToString() { string str = "QConClass "; if (_claxx != null) { str += _claxx.GetName() + " "; } return str + base.ToString(); } internal override void Unmarshall(Transaction a_trans) { if (i_trans == null) { base.Unmarshall(a_trans); if (_className != null) { _className = Container().Config().ResolveAliasStoredName(_className); _claxx = a_trans.Reflector().ForName(_className); } } } internal override void SetEvaluationMode() { IEnumerator children = IterateChildren(); while (children.MoveNext()) { object child = children.Current; if (child is QConObject) { ((QConObject)child).SetEvaluationMode(); } } } public override void SetProcessedByIndex() { } // do nothing, QConClass needs to stay in the evaluation graph. } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QQuery.cs0000644000175000017500000000131211700531646031521 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Query.Processor { /// QQuery is the users hook on our graph. /// /// QQuery is the users hook on our graph. /// A QQuery is defined by it's constraints. /// /// public class QQuery : QQueryBase, IQuery { public QQuery() { } public QQuery(Transaction a_trans, Db4objects.Db4o.Internal.Query.Processor.QQuery a_parent, string a_field) : base(a_trans, a_parent, a_field) { } // C/S only } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QEMulti.cs0000644000175000017500000000321311700531646031615 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public class QEMulti : QE { private Collection4 i_evaluators = new Collection4(); // used by .net LINQ tests public virtual IEnumerable Evaluators() { return i_evaluators; } internal override QE Add(QE evaluator) { i_evaluators.Ensure(evaluator); return this; } public override bool Identity() { bool ret = false; IEnumerator i = i_evaluators.GetEnumerator(); while (i.MoveNext()) { if (((QE)i.Current).Identity()) { ret = true; } else { return false; } } return ret; } internal override bool IsDefault() { return false; } internal override bool Evaluate(QConObject a_constraint, QCandidate a_candidate, object a_value) { IEnumerator i = i_evaluators.GetEnumerator(); while (i.MoveNext()) { if (((QE)i.Current).Evaluate(a_constraint, a_candidate, a_value)) { return true; } } return false; } public override void IndexBitMap(bool[] bits) { IEnumerator i = i_evaluators.GetEnumerator(); while (i.MoveNext()) { ((QE)i.Current).IndexBitMap(bits); } } public override bool SupportsIndex() { IEnumerator i = i_evaluators.GetEnumerator(); while (i.MoveNext()) { if (!((QE)i.Current).SupportsIndex()) { return false; } } return true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QConObject.cs0000644000175000017500000003000311700531646032261 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Query; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Query.Processor { /// Object constraint on queries /// public class QConObject : QCon { private object i_object; private int i_objectID; [System.NonSerialized] internal ClassMetadata _classMetadata; private int i_classMetadataID; private QField i_field; [System.NonSerialized] internal IPreparedComparison _preparedComparison; private IObjectAttribute i_attributeProvider; [System.NonSerialized] private bool _checkClassMetadataOnly = false; public QConObject() { } public QConObject(Transaction a_trans, QCon a_parent, QField a_field, object a_object ) : base(a_trans) { // the constraining object // cache for the db4o object ID // the YapClass // needed for marshalling the request // C/S only i_parent = a_parent; if (a_object is ICompare) { a_object = ((ICompare)a_object).Compare(); } i_object = a_object; i_field = a_field; } private void AssociateYapClass(Transaction a_trans, object a_object) { if (a_object == null) { } else { //It seems that we need not result the following field //i_object = null; //i_comparator = Null.INSTANCE; //i_classMetadata = null; // FIXME: Setting the YapClass to null will prevent index use // If the field is typed we can guess the right one with the // following line. However this does break some SODA test cases. // Revisit! // if(i_field != null){ // i_classMetadata = i_field.getYapClass(); // } _classMetadata = a_trans.Container().ProduceClassMetadata(a_trans.Reflector().ForObject (a_object)); if (_classMetadata != null) { i_object = _classMetadata.GetComparableObject(a_object); if (a_object != i_object) { i_attributeProvider = _classMetadata.Config().QueryAttributeProvider(); _classMetadata = a_trans.Container().ProduceClassMetadata(a_trans.Reflector().ForObject (i_object)); } if (_classMetadata != null) { _classMetadata.CollectConstraints(a_trans, this, i_object, new _IVisitor4_84(this )); } else { AssociateYapClass(a_trans, null); } } else { AssociateYapClass(a_trans, null); } } } private sealed class _IVisitor4_84 : IVisitor4 { public _IVisitor4_84(QConObject _enclosing) { this._enclosing = _enclosing; } public void Visit(object obj) { this._enclosing.AddConstraint((QCon)obj); } private readonly QConObject _enclosing; } public override bool CanBeIndexLeaf() { return i_object == null || ((_classMetadata != null && _classMetadata.IsValueType ()) || Evaluator().Identity()); } public override bool CanLoadByIndex() { if (i_field == null) { return false; } if (i_field._fieldMetadata == null) { return false; } if (!i_field._fieldMetadata.HasIndex()) { return false; } if (!i_evaluator.SupportsIndex()) { return false; } return i_field._fieldMetadata.CanLoadByIndex(); } internal override bool Evaluate(QCandidate a_candidate) { try { return a_candidate.Evaluate(this, i_evaluator); } catch (Exception e) { return false; } } internal override void EvaluateEvaluationsExec(QCandidates a_candidates, bool rereadObject ) { if (i_field.IsQueryLeaf()) { bool hasEvaluation = false; IEnumerator i = IterateChildren(); while (i.MoveNext()) { if (i.Current is QConEvaluation) { hasEvaluation = true; break; } } if (hasEvaluation) { a_candidates.Traverse(i_field); IEnumerator j = IterateChildren(); while (j.MoveNext()) { ((QCon)j.Current).EvaluateEvaluationsExec(a_candidates, false); } } } } internal override void EvaluateSelf() { if (DTrace.enabled) { DTrace.EvaluateSelf.Log(Id()); } if (_classMetadata != null) { if (!(_classMetadata is PrimitiveTypeMetadata)) { if (!i_evaluator.Identity() && (_classMetadata.TypeHandler() is StandardReferenceTypeHandler )) { _checkClassMetadataOnly = true; } object transactionalObject = _classMetadata.WrapWithTransactionContext(Transaction (), i_object); _preparedComparison = _classMetadata.PrepareComparison(Context(), transactionalObject ); } } base.EvaluateSelf(); _checkClassMetadataOnly = false; } private IContext Context() { return Transaction().Context(); } internal override void Collect(QCandidates a_candidates) { if (i_field.IsClass()) { a_candidates.Traverse(i_field); a_candidates.Filter(i_candidates); } } internal override void EvaluateSimpleExec(QCandidates a_candidates) { // TODO: The following can be skipped if we used the index on // this field to load the objects, if hasOrdering() is false if (i_field.IsQueryLeaf() || IsNullConstraint()) { a_candidates.Traverse(i_field); PrepareComparison(i_field); a_candidates.Filter(this); } } internal virtual IPreparedComparison PrepareComparison(QCandidate candidate) { if (_preparedComparison != null) { return _preparedComparison; } return candidate.PrepareComparison(Container(), i_object); } internal override ClassMetadata GetYapClass() { return _classMetadata; } public override QField GetField() { return i_field; } internal virtual int GetObjectID() { if (i_objectID == 0) { i_objectID = i_trans.Container().GetID(i_trans, i_object); if (i_objectID == 0) { i_objectID = -1; } } return i_objectID; } public override bool HasObjectInParentPath(object obj) { if (obj == i_object) { return true; } return base.HasObjectInParentPath(obj); } public override int IdentityID() { if (i_evaluator.Identity()) { int id = GetObjectID(); if (id != 0) { if (!(i_evaluator is QENot)) { return id; } } } return 0; } internal override bool IsNullConstraint() { return i_object == null; } internal override void Log(string indent) { } internal override string LogObject() { return string.Empty; } internal override void Marshall() { base.Marshall(); GetObjectID(); if (_classMetadata != null) { i_classMetadataID = _classMetadata.GetID(); } } public override bool OnSameFieldAs(QCon other) { if (!(other is Db4objects.Db4o.Internal.Query.Processor.QConObject)) { return false; } return i_field == ((Db4objects.Db4o.Internal.Query.Processor.QConObject)other).i_field; } internal virtual void PrepareComparison(QField a_field) { if (IsNullConstraint() & !a_field.IsArray()) { _preparedComparison = Null.Instance; } else { _preparedComparison = a_field.PrepareComparison(Context(), i_object); } } internal override void RemoveChildrenJoins() { base.RemoveChildrenJoins(); _children = null; } internal override QCon ShareParent(object a_object, BooleanByRef removeExisting) { if (i_parent == null) { return null; } object obj = i_field.Coerce(a_object); if (obj == No4.Instance) { return null; } return i_parent.AddSharedConstraint(i_field, obj); } internal override QConClass ShareParentForClass(IReflectClass a_class, BooleanByRef removeExisting) { if (i_parent == null) { return null; } QConClass newConstraint = new QConClass(i_trans, i_parent, i_field, a_class); i_parent.AddConstraint(newConstraint); return newConstraint; } internal object Translate(object candidate) { if (i_attributeProvider != null) { i_candidates.i_trans.Container().Activate(i_candidates.i_trans, candidate); return i_attributeProvider.Attribute(candidate); } return candidate; } internal override void Unmarshall(Transaction trans) { if (i_trans != null) { return; } base.Unmarshall(trans); if (i_object == null) { _preparedComparison = Null.Instance; } if (i_classMetadataID != 0) { _classMetadata = trans.Container().ClassMetadataForID(i_classMetadataID); } if (i_field != null) { i_field.Unmarshall(trans); } if (i_objectID > 0) { object obj = trans.Container().TryGetByID(trans, i_objectID); if (obj != null) { i_object = obj; } } } public override void Visit(object obj) { QCandidate qc = (QCandidate)obj; bool res = true; bool processed = false; if (_checkClassMetadataOnly) { ClassMetadata yc = qc.ReadClassMetadata(); if (yc != null) { res = i_evaluator.Not(_classMetadata.GetHigherHierarchy(yc) == _classMetadata); processed = true; } } if (!processed) { res = Evaluate(qc); } Visit1(qc.GetRoot(), this, res); } public override IConstraint Contains() { lock (StreamLock()) { i_evaluator = i_evaluator.Add(new QEContains(true)); return this; } } public override IConstraint Equal() { lock (StreamLock()) { i_evaluator = i_evaluator.Add(new QEEqual()); return this; } } public override object GetObject() { return i_object; } public override IConstraint Greater() { lock (StreamLock()) { i_evaluator = i_evaluator.Add(new QEGreater()); return this; } } public override IConstraint Identity() { lock (StreamLock()) { if (i_object == null) { return this; } GetObjectID(); // TODO: this may not be correct for NOT // It may be necessary to add an if(i_evaluator.identity()) RemoveChildrenJoins(); i_evaluator = i_evaluator.Add(new QEIdentity()); return this; } } public override IConstraint ByExample() { lock (StreamLock()) { AssociateYapClass(i_trans, i_object); return this; } } internal virtual void SetEvaluationMode() { if ((i_object == null) || EvaluationModeAlreadySet()) { return; } int id = GetObjectID(); if (id < 0) { ByExample(); } else { _classMetadata = i_trans.Container().ProduceClassMetadata(i_trans.Reflector().ForObject (i_object)); Identity(); } } internal virtual bool EvaluationModeAlreadySet() { return _classMetadata != null; } public override IConstraint Like() { lock (StreamLock()) { i_evaluator = i_evaluator.Add(new QEContains(false)); return this; } } public override IConstraint Smaller() { lock (StreamLock()) { i_evaluator = i_evaluator.Add(new QESmaller()); return this; } } public override IConstraint StartsWith(bool caseSensitive) { lock (StreamLock()) { i_evaluator = i_evaluator.Add(new QEStartsWith(caseSensitive)); return this; } } public override IConstraint EndsWith(bool caseSensitive) { lock (StreamLock()) { i_evaluator = i_evaluator.Add(new QEEndsWith(caseSensitive)); return this; } } public override string ToString() { string str = "QConObject "; if (i_object != null) { str += i_object.ToString(); } return str; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QEGreater.cs0000644000175000017500000000153711700531646032123 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public class QEGreater : QEAbstract { internal override bool Evaluate(QConObject constraint, QCandidate candidate, object obj) { if (obj == null) { return false; } IPreparedComparison preparedComparison = constraint.PrepareComparison(candidate); if (preparedComparison is PreparedArrayContainsComparison) { return ((PreparedArrayContainsComparison)preparedComparison).IsSmallerThan(obj); } return preparedComparison.CompareTo(obj) < 0; } public override void IndexBitMap(bool[] bits) { bits[QE.Greater] = true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QESmaller.cs0000644000175000017500000000153711700531646032131 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public class QESmaller : QEAbstract { internal override bool Evaluate(QConObject constraint, QCandidate candidate, object obj) { if (obj == null) { return false; } IPreparedComparison preparedComparison = constraint.PrepareComparison(candidate); if (preparedComparison is PreparedArrayContainsComparison) { return ((PreparedArrayContainsComparison)preparedComparison).IsGreaterThan(obj); } return preparedComparison.CompareTo(obj) > 0; } public override void IndexBitMap(bool[] bits) { bits[QE.Smaller] = true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/IInternalQuery.cs0000644000175000017500000000043611700531646033214 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Query.Processor { /// public interface IInternalQuery { IInternalObjectContainer Container { get; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QCandidates.cs0000644000175000017500000003662011700531646032465 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Text; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Classindex; using Db4objects.Db4o.Internal.Diagnostic; using Db4objects.Db4o.Internal.Fieldindex; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Query.Processor { /// /// Holds the tree of /// QCandidate /// objects and the list of /// QCon /// during query evaluation. /// The query work (adding and removing nodes) happens here. /// Candidates during query evaluation. /// QCandidate /// objects are stored in i_root /// /// public sealed class QCandidates : IVisitor4 { public readonly LocalTransaction i_trans; public Tree i_root; private List4 _constraints; internal ClassMetadata i_classMetadata; private QField _field; internal QCon i_currentConstraint; private IDGenerator _idGenerator; private bool _loadedFromClassIndex; internal QCandidates(LocalTransaction a_trans, ClassMetadata a_classMetadata, QField a_field) { // Transaction necessary as reference to stream // root of the QCandidate tree // collection of all constraints // possible class information // possible field information // current executing constraint, only set where needed i_trans = a_trans; i_classMetadata = a_classMetadata; _field = a_field; if (a_field == null || a_field._fieldMetadata == null || !(a_field._fieldMetadata .GetHandler() is StandardReferenceTypeHandler)) { return; } ClassMetadata yc = ((StandardReferenceTypeHandler)a_field._fieldMetadata.GetHandler ()).ClassMetadata(); if (i_classMetadata == null) { i_classMetadata = yc; } else { yc = i_classMetadata.GetHigherOrCommonHierarchy(yc); if (yc != null) { i_classMetadata = yc; } } } public QCandidate Add(QCandidate candidate) { i_root = Tree.Add(i_root, candidate); if (candidate._size == 0) { // This means that the candidate was already present // and QCandidate does not allow duplicates. // In this case QCandidate#isDuplicateOf will have // placed the existing QCandidate in the i_root // variable of the new candidate. We return it here: return candidate.GetRoot(); } return candidate; } internal void AddConstraint(QCon a_constraint) { _constraints = new List4(_constraints, a_constraint); } public QCandidate ReadSubCandidate(QueryingReadContext context, ITypeHandler4 handler ) { ObjectID objectID = ObjectID.NotPossible; try { int offset = context.Offset(); if (handler is IReadsObjectIds) { objectID = ((IReadsObjectIds)handler).ReadObjectID(context); } if (objectID.IsValid()) { return new QCandidate(this, null, objectID._id); } if (objectID == ObjectID.NotPossible) { context.Seek(offset); object obj = context.Read(handler); if (obj != null) { QCandidate candidate = new QCandidate(this, obj, context.Container().GetID(context .Transaction(), obj)); candidate.ClassMetadata(context.Container().ClassMetadataForObject(obj)); return candidate; } } } catch (Exception) { } // FIXME: Catchall return null; } internal void Collect(Db4objects.Db4o.Internal.Query.Processor.QCandidates a_candidates ) { IEnumerator i = IterateConstraints(); while (i.MoveNext()) { QCon qCon = (QCon)i.Current; SetCurrentConstraint(qCon); qCon.Collect(a_candidates); } SetCurrentConstraint(null); } internal void Execute() { if (DTrace.enabled) { DTrace.QueryProcess.Log(); } FieldIndexProcessorResult result = ProcessFieldIndexes(); if (result.FoundIndex()) { i_root = result.ToQCandidate(this); } else { LoadFromClassIndex(); } Evaluate(); } public IEnumerator ExecuteSnapshot(Collection4 executionPath) { IIntIterator4 indexIterator = new IntIterator4Adaptor(IterateIndex(ProcessFieldIndexes ())); Tree idRoot = TreeInt.AddAll(null, indexIterator); IEnumerator snapshotIterator = new TreeKeyIterator(idRoot); IEnumerator singleObjectQueryIterator = SingleObjectSodaProcessor(snapshotIterator ); return MapIdsToExecutionPath(singleObjectQueryIterator, executionPath); } private IEnumerator SingleObjectSodaProcessor(IEnumerator indexIterator) { return Iterators.Map(indexIterator, new _IFunction4_159(this)); } private sealed class _IFunction4_159 : IFunction4 { public _IFunction4_159(QCandidates _enclosing) { this._enclosing = _enclosing; } public object Apply(object current) { int id = ((int)current); QCandidate candidate = new QCandidate(this._enclosing, null, id); this._enclosing.i_root = candidate; this._enclosing.Evaluate(); if (!candidate.Include()) { return Iterators.Skip; } return current; } private readonly QCandidates _enclosing; } public IEnumerator ExecuteLazy(Collection4 executionPath) { IEnumerator indexIterator = IterateIndex(ProcessFieldIndexes()); IEnumerator singleObjectQueryIterator = SingleObjectSodaProcessor(indexIterator); return MapIdsToExecutionPath(singleObjectQueryIterator, executionPath); } private IEnumerator IterateIndex(FieldIndexProcessorResult result) { if (result.NoMatch()) { return Iterators.EmptyIterator; } if (result.FoundIndex()) { return result.IterateIDs(); } if (!i_classMetadata.HasClassIndex()) { return Iterators.EmptyIterator; } return BTreeClassIndexStrategy.Iterate(i_classMetadata, i_trans); } private IEnumerator MapIdsToExecutionPath(IEnumerator singleObjectQueryIterator, Collection4 executionPath) { if (executionPath == null) { return singleObjectQueryIterator; } IEnumerator res = singleObjectQueryIterator; IEnumerator executionPathIterator = executionPath.GetEnumerator(); while (executionPathIterator.MoveNext()) { string fieldName = (string)executionPathIterator.Current; res = Iterators.Concat(Iterators.Map(res, new _IFunction4_205(this, fieldName))); } return res; } private sealed class _IFunction4_205 : IFunction4 { public _IFunction4_205(QCandidates _enclosing, string fieldName) { this._enclosing = _enclosing; this.fieldName = fieldName; } public object Apply(object current) { int id = ((int)current); CollectIdContext context = CollectIdContext.ForID(this._enclosing.i_trans, id); if (context == null) { return Iterators.Skip; } context.ClassMetadata().CollectIDs(context, fieldName); return new TreeKeyIterator(context.Ids()); } private readonly QCandidates _enclosing; private readonly string fieldName; } public ObjectContainerBase Stream() { return i_trans.Container(); } public int ClassIndexEntryCount() { return i_classMetadata.IndexEntryCount(i_trans); } private FieldIndexProcessorResult ProcessFieldIndexes() { if (_constraints == null) { return FieldIndexProcessorResult.NoIndexFound; } return new FieldIndexProcessor(this).Run(); } internal void Evaluate() { if (_constraints == null) { return; } ForEachConstraint(new _IProcedure4_243(this)); ForEachConstraint(new _IProcedure4_251()); ForEachConstraint(new _IProcedure4_257()); ForEachConstraint(new _IProcedure4_263()); ForEachConstraint(new _IProcedure4_269()); ForEachConstraint(new _IProcedure4_275()); } private sealed class _IProcedure4_243 : IProcedure4 { public _IProcedure4_243(QCandidates _enclosing) { this._enclosing = _enclosing; } public void Apply(object arg) { QCon qCon = (QCon)arg; qCon.SetCandidates(this._enclosing); qCon.EvaluateSelf(); } private readonly QCandidates _enclosing; } private sealed class _IProcedure4_251 : IProcedure4 { public _IProcedure4_251() { } public void Apply(object arg) { ((QCon)arg).EvaluateSimpleChildren(); } } private sealed class _IProcedure4_257 : IProcedure4 { public _IProcedure4_257() { } public void Apply(object arg) { ((QCon)arg).EvaluateEvaluations(); } } private sealed class _IProcedure4_263 : IProcedure4 { public _IProcedure4_263() { } public void Apply(object arg) { ((QCon)arg).EvaluateCreateChildrenCandidates(); } } private sealed class _IProcedure4_269 : IProcedure4 { public _IProcedure4_269() { } public void Apply(object arg) { ((QCon)arg).EvaluateCollectChildren(); } } private sealed class _IProcedure4_275 : IProcedure4 { public _IProcedure4_275() { } public void Apply(object arg) { ((QCon)arg).EvaluateChildren(); } } private void ForEachConstraint(IProcedure4 proc) { IEnumerator i = IterateConstraints(); while (i.MoveNext()) { QCon constraint = (QCon)i.Current; if (!constraint.ProcessedByIndex()) { proc.Apply(constraint); } } } internal bool IsEmpty() { bool[] ret = new bool[] { true }; Traverse(new _IVisitor4_295(ret)); return ret[0]; } private sealed class _IVisitor4_295 : IVisitor4 { public _IVisitor4_295(bool[] ret) { this.ret = ret; } public void Visit(object obj) { if (((QCandidate)obj)._include) { ret[0] = false; } } private readonly bool[] ret; } internal bool Filter(IVisitor4 a_host) { if (i_root != null) { i_root.Traverse(a_host); i_root = i_root.Filter(new _IPredicate4_308()); } return i_root != null; } private sealed class _IPredicate4_308 : IPredicate4 { public _IPredicate4_308() { } public bool Match(object a_candidate) { return ((QCandidate)a_candidate)._include; } } internal int GenerateCandidateId() { if (_idGenerator == null) { _idGenerator = new IDGenerator(); } return -_idGenerator.Next(); } public IEnumerator IterateConstraints() { if (_constraints == null) { return Iterators.EmptyIterator; } return new Iterator4Impl(_constraints); } internal sealed class TreeIntBuilder { public TreeInt tree; public void Add(TreeInt node) { tree = (TreeInt)((TreeInt)Tree.Add(tree, node)); } } internal void LoadFromClassIndex() { if (!IsEmpty()) { return; } QCandidates.TreeIntBuilder result = new QCandidates.TreeIntBuilder(); IClassIndexStrategy index = i_classMetadata.Index(); index.TraverseAll(i_trans, new _IVisitor4_346(this, result)); i_root = result.tree; DiagnosticProcessor dp = i_trans.Container()._handlers.DiagnosticProcessor(); if (dp.Enabled() && !IsClassOnlyQuery()) { dp.LoadedFromClassIndex(i_classMetadata); } _loadedFromClassIndex = true; } private sealed class _IVisitor4_346 : IVisitor4 { public _IVisitor4_346(QCandidates _enclosing, QCandidates.TreeIntBuilder result) { this._enclosing = _enclosing; this.result = result; } public void Visit(object obj) { result.Add(new QCandidate(this._enclosing, null, ((int)obj))); } private readonly QCandidates _enclosing; private readonly QCandidates.TreeIntBuilder result; } internal void SetCurrentConstraint(QCon a_constraint) { i_currentConstraint = a_constraint; } internal void Traverse(IVisitor4 a_visitor) { if (i_root != null) { i_root.Traverse(a_visitor); } } // FIXME: This method should go completely. // We changed the code to create the QCandidates graph in two steps: // (1) call fitsIntoExistingConstraintHierarchy to determine whether // or not we need more QCandidates objects // (2) add all constraints // This method tries to do both in one, which results in missing // constraints. Not all are added to all QCandiates. // Right methodology is in // QQueryBase#createCandidateCollection // and // QQueryBase#createQCandidatesList internal bool TryAddConstraint(QCon a_constraint) { if (_field != null) { QField qf = a_constraint.GetField(); if (qf != null) { if (_field.Name() != null && !_field.Name().Equals(qf.Name())) { return false; } } } if (i_classMetadata == null || a_constraint.IsNullConstraint()) { AddConstraint(a_constraint); return true; } ClassMetadata yc = a_constraint.GetYapClass(); if (yc != null) { yc = i_classMetadata.GetHigherOrCommonHierarchy(yc); if (yc != null) { i_classMetadata = yc; AddConstraint(a_constraint); return true; } } AddConstraint(a_constraint); return false; } public void Visit(object a_tree) { QCandidate parent = (QCandidate)a_tree; if (parent.CreateChild(this)) { return; } // No object found. // All children constraints are necessarily false. // Check immediately. IEnumerator i = IterateConstraints(); while (i.MoveNext()) { ((QCon)i.Current).VisitOnNull(parent.GetRoot()); } } public override string ToString() { StringBuilder sb = new StringBuilder(); i_root.Traverse(new _IVisitor4_430(sb)); return sb.ToString(); } private sealed class _IVisitor4_430 : IVisitor4 { public _IVisitor4_430(StringBuilder sb) { this.sb = sb; } public void Visit(object obj) { QCandidate candidate = (QCandidate)obj; sb.Append(" "); sb.Append(candidate._key); } private readonly StringBuilder sb; } public Transaction Transaction() { return i_trans; } public bool WasLoadedFromClassIndex() { return _loadedFromClassIndex; } public bool FitsIntoExistingConstraintHierarchy(QCon constraint) { if (_field != null) { QField qf = constraint.GetField(); if (qf != null) { if (_field.Name() != null && !_field.Name().Equals(qf.Name())) { return false; } } } if (i_classMetadata == null || constraint.IsNullConstraint()) { return true; } ClassMetadata classMetadata = constraint.GetYapClass(); if (classMetadata == null) { return false; } classMetadata = i_classMetadata.GetHigherOrCommonHierarchy(classMetadata); if (classMetadata == null) { return false; } i_classMetadata = classMetadata; return true; } private bool IsClassOnlyQuery() { if (((List4)_constraints._next) != null) { return false; } if (!(_constraints._element is QConClass)) { return false; } return !((QCon)_constraints._element).HasChildren(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QConJoin.cs0000644000175000017500000000623711700531646031766 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// Join constraint on queries /// public class QConJoin : QCon { private bool i_and; private QCon i_constraint1; private QCon i_constraint2; public QConJoin() { } internal QConJoin(Transaction a_trans, QCon a_c1, QCon a_c2, bool a_and) : base(a_trans ) { // FIELDS MUST BE PUBLIC TO BE REFLECTED ON UNDER JDK <= 1.1 // C/S i_constraint1 = a_c1; i_constraint2 = a_c2; i_and = a_and; } public virtual QCon Constraint2() { return i_constraint2; } public virtual QCon Constraint1() { return i_constraint1; } internal override void DoNotInclude(QCandidate a_root) { Constraint1().DoNotInclude(a_root); Constraint2().DoNotInclude(a_root); } internal override void ExchangeConstraint(QCon a_exchange, QCon a_with) { base.ExchangeConstraint(a_exchange, a_with); if (a_exchange == Constraint1()) { i_constraint1 = a_with; } if (a_exchange == Constraint2()) { i_constraint2 = a_with; } } internal virtual void EvaluatePending(QCandidate a_root, QPending a_pending, int a_secondResult) { bool res = i_evaluator.Not(i_and ? ((a_pending._result + a_secondResult) > 0) : ( a_pending._result + a_secondResult) > QPending.False); if (HasJoins()) { IEnumerator i = IterateJoins(); while (i.MoveNext()) { Db4objects.Db4o.Internal.Query.Processor.QConJoin qcj = (Db4objects.Db4o.Internal.Query.Processor.QConJoin )i.Current; a_root.Evaluate(new QPending(qcj, this, res)); } } else { if (!res) { Constraint1().DoNotInclude(a_root); Constraint2().DoNotInclude(a_root); } } } public virtual QCon GetOtherConstraint(QCon a_constraint) { if (a_constraint == Constraint1()) { return Constraint2(); } else { if (a_constraint == Constraint2()) { return Constraint1(); } } throw new ArgumentException(); } internal override string LogObject() { return string.Empty; } internal virtual bool RemoveForParent(QCon a_constraint) { if (i_and) { QCon other = GetOtherConstraint(a_constraint); other.RemoveJoin(this); // prevents circular call other.Remove(); return true; } return false; } public override string ToString() { string str = "QConJoin " + (i_and ? "AND " : "OR"); if (Constraint1() != null) { str += "\n " + Constraint1(); } if (Constraint2() != null) { str += "\n " + Constraint2(); } return str; } public virtual bool IsOr() { return !i_and; } public override void SetProcessedByIndex() { if (ProcessedByIndex()) { return; } base.SetProcessedByIndex(); Constraint1().SetProcessedByIndex(); Constraint2().SetProcessedByIndex(); } } } QConUnconditional.cs0000644000175000017500000000132011700531646033602 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public class QConUnconditional : QCon { private bool _value; public QConUnconditional() { } public QConUnconditional(Transaction trans, bool value) : base(trans) { // cannot be final for C/S unmarshalling // C/S only _value = value; } internal override void EvaluateSimpleExec(QCandidates a_candidates) { a_candidates.Filter(this); } internal override bool Evaluate(QCandidate a_candidate) { return _value; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QEContains.cs0000644000175000017500000000104411700531646032301 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public class QEContains : QEStringCmp { /// for C/S messaging only public QEContains() { } public QEContains(bool caseSensitive_) : base(caseSensitive_) { } protected override bool CompareStrings(string candidate, string constraint) { return candidate.IndexOf(constraint) > -1; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QCandidate.cs0000644000175000017500000005314211700531646032300 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Query; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Query.Processor { /// Represents an actual object in the database. /// /// Represents an actual object in the database. Forms a tree structure, indexed /// by id. Can have dependents that are doNotInclude'd in the query result when /// this is doNotInclude'd. /// /// public class QCandidate : TreeInt, ICandidate { internal ByteArrayBuffer _bytes; internal readonly QCandidates _candidates; private List4 _dependants; internal bool _include = true; private object _member; private Tree _pendingJoins; private Db4objects.Db4o.Internal.Query.Processor.QCandidate _root; private Db4objects.Db4o.Internal.ClassMetadata _classMetadata; private FieldMetadata _fieldMetadata; private int _handlerVersion; private QCandidate(QCandidates qcandidates) : base(0) { // db4o ID is stored in _key; // db4o byte stream storing the object // Dependent candidates // whether to include in the result set // may use id for optimisation ??? // Possible pending joins on children // The evaluation root to compare all ORs // the ClassMetadata of this object // temporary field and member for one field during evaluation // null denotes null object _candidates = qcandidates; } public QCandidate(QCandidates candidates, object member, int id) : base(id) { if (DTrace.enabled) { DTrace.CreateCandidate.Log(id); } _candidates = candidates; _member = member; _include = true; if (id == 0) { _key = candidates.GenerateCandidateId(); } } public override object ShallowClone() { Db4objects.Db4o.Internal.Query.Processor.QCandidate qcan = new Db4objects.Db4o.Internal.Query.Processor.QCandidate (_candidates); qcan.SetBytes(_bytes); qcan._dependants = _dependants; qcan._include = _include; qcan._member = _member; qcan._pendingJoins = _pendingJoins; qcan._root = _root; qcan._classMetadata = _classMetadata; qcan._fieldMetadata = _fieldMetadata; return base.ShallowCloneInternal(qcan); } internal virtual void AddDependant(Db4objects.Db4o.Internal.Query.Processor.QCandidate a_candidate) { _dependants = new List4(_dependants, a_candidate); } private void CheckInstanceOfCompare() { if (_member is ICompare) { _member = ((ICompare)_member).Compare(); LocalObjectContainer stream = Container(); _classMetadata = stream.ClassMetadataForReflectClass(stream.Reflector().ForObject (_member)); _key = stream.GetID(Transaction(), _member); if (_key == 0) { SetBytes(null); } else { SetBytes(stream.ReadBufferById(Transaction(), _key)); } } } internal virtual bool CreateChild(QCandidates a_candidates) { if (!_include) { return false; } if (_fieldMetadata != null) { ITypeHandler4 handler = _fieldMetadata.GetHandler(); if (handler != null) { QueryingReadContext queryingReadContext = new QueryingReadContext(Transaction(), MarshallerFamily().HandlerVersion(), _bytes, _key); ITypeHandler4 arrayElementHandler = Handlers4.ArrayElementHandler(handler, queryingReadContext ); if (arrayElementHandler != null) { int offset = queryingReadContext.Offset(); bool outerRes = true; // The following construct is worse than not ideal. // For each constraint it completely reads the // underlying structure again. The structure could b // kept fairly easy. TODO: Optimize! IEnumerator i = a_candidates.IterateConstraints(); while (i.MoveNext()) { QCon qcon = (QCon)i.Current; QField qf = qcon.GetField(); if (qf == null || qf.Name().Equals(_fieldMetadata.GetName())) { QCon tempParent = qcon.Parent(); qcon.SetParent(null); QCandidates candidates = new QCandidates(a_candidates.i_trans, null, qf); candidates.AddConstraint(qcon); qcon.SetCandidates(candidates); ReadArrayCandidates(handler, queryingReadContext.Buffer(), arrayElementHandler, candidates ); queryingReadContext.Seek(offset); bool isNot = qcon.IsNot(); if (isNot) { qcon.RemoveNot(); } candidates.Evaluate(); ByRef pending = ByRef.NewInstance(); bool[] innerRes = new bool[] { isNot }; candidates.Traverse(new _IVisitor4_160(innerRes, isNot, pending)); // Collect all pending subresults. // We need to change // the // constraint here, so // our // pending collector // uses // the right // comparator. // We only keep one // pending result // for // all array // elements. // and memorize, // whether we had a // true or a false // result. // or both. if (isNot) { qcon.Not(); } // In case we had pending subresults, we // need to communicate // them up to our root. if (((Tree)pending.value) != null) { ((Tree)pending.value).Traverse(new _IVisitor4_229(this)); } if (!innerRes[0]) { // Again this could be double triggering. // // We want to clean up the "No route" // at some stage. qcon.Visit(GetRoot(), qcon.Evaluator().Not(false)); outerRes = false; } qcon.SetParent(tempParent); } } return outerRes; } // We may get simple types here too, if the YapField was null // in the higher level simple evaluation. Evaluate these // immediately. if (Handlers4.IsQueryLeaf(handler)) { a_candidates.i_currentConstraint.Visit(this); return true; } } } if (_fieldMetadata == null) { return false; } if (_fieldMetadata is NullFieldMetadata) { return false; } _classMetadata.SeekToField(Transaction(), _bytes, _fieldMetadata); Db4objects.Db4o.Internal.Query.Processor.QCandidate candidate = ReadSubCandidate( a_candidates); if (candidate == null) { return false; } // fast early check for ClassMetadata if (a_candidates.i_classMetadata != null && a_candidates.i_classMetadata.IsStronglyTyped ()) { ITypeHandler4 handler = _fieldMetadata.GetHandler(); if (Handlers4.IsUntyped(handler)) { handler = TypeHandlerFor(candidate); } if (handler == null) { return false; } } AddDependant(a_candidates.Add(candidate)); return true; } private sealed class _IVisitor4_160 : IVisitor4 { public _IVisitor4_160(bool[] innerRes, bool isNot, ByRef pending) { this.innerRes = innerRes; this.isNot = isNot; this.pending = pending; } public void Visit(object obj) { Db4objects.Db4o.Internal.Query.Processor.QCandidate cand = (Db4objects.Db4o.Internal.Query.Processor.QCandidate )obj; if (cand.Include()) { innerRes[0] = !isNot; } if (cand._pendingJoins != null) { cand._pendingJoins.Traverse(new _IVisitor4_173(pending)); } } private sealed class _IVisitor4_173 : IVisitor4 { public _IVisitor4_173(ByRef pending) { this.pending = pending; } public void Visit(object a_object) { QPending newPending = ((QPending)a_object).InternalClonePayload(); newPending.ChangeConstraint(); QPending oldPending = (QPending)Tree.Find(((Tree)pending.value), newPending); if (oldPending != null) { if (oldPending._result != newPending._result) { oldPending._result = QPending.Both; } } else { pending.value = Tree.Add(((Tree)pending.value), newPending); } } private readonly ByRef pending; } private readonly bool[] innerRes; private readonly bool isNot; private readonly ByRef pending; } private sealed class _IVisitor4_229 : IVisitor4 { public _IVisitor4_229(QCandidate _enclosing) { this._enclosing = _enclosing; } public void Visit(object a_object) { this._enclosing.GetRoot().Evaluate((QPending)a_object); } private readonly QCandidate _enclosing; } private ITypeHandler4 TypeHandlerFor(Db4objects.Db4o.Internal.Query.Processor.QCandidate candidate) { Db4objects.Db4o.Internal.ClassMetadata classMetadata = candidate.ReadClassMetadata (); if (classMetadata != null) { return classMetadata.TypeHandler(); } return null; } private void ReadArrayCandidates(ITypeHandler4 typeHandler, IReadBuffer buffer, ITypeHandler4 arrayElementHandler, QCandidates candidates) { if (!Handlers4.IsCascading(arrayElementHandler)) { return; } SlotFormat slotFormat = SlotFormat.ForHandlerVersion(_handlerVersion); slotFormat.DoWithSlotIndirection(buffer, typeHandler, new _IClosure4_318(this, arrayElementHandler , buffer, candidates)); } private sealed class _IClosure4_318 : IClosure4 { public _IClosure4_318(QCandidate _enclosing, ITypeHandler4 arrayElementHandler, IReadBuffer buffer, QCandidates candidates) { this._enclosing = _enclosing; this.arrayElementHandler = arrayElementHandler; this.buffer = buffer; this.candidates = candidates; } public object Run() { QueryingReadContext context = null; if (Handlers4.HandleAsObject(arrayElementHandler)) { // TODO: Code is similar to FieldMetadata.collectIDs. Try to refactor to one place. int collectionID = buffer.ReadInt(); ByteArrayBuffer arrayElementBuffer = this._enclosing.Container().ReadBufferById(this ._enclosing.Transaction(), collectionID); ObjectHeader objectHeader = ObjectHeader.ScrollBufferToContent(this._enclosing.Container (), arrayElementBuffer); context = new QueryingReadContext(this._enclosing.Transaction(), candidates, this ._enclosing._handlerVersion, arrayElementBuffer, collectionID); objectHeader.ClassMetadata().CollectIDs(context); } else { context = new QueryingReadContext(this._enclosing.Transaction(), candidates, this ._enclosing._handlerVersion, buffer, 0); ((ICascadingTypeHandler)arrayElementHandler).CollectIDs(context); } Tree.Traverse(context.Ids(), new _IVisitor4_336(candidates)); IEnumerator i = context.ObjectsWithoutId(); while (i.MoveNext()) { object obj = i.Current; candidates.Add(new Db4objects.Db4o.Internal.Query.Processor.QCandidate(candidates , obj, 0)); } return null; } private sealed class _IVisitor4_336 : IVisitor4 { public _IVisitor4_336(QCandidates candidates) { this.candidates = candidates; } public void Visit(object obj) { TreeInt idNode = (TreeInt)obj; candidates.Add(new Db4objects.Db4o.Internal.Query.Processor.QCandidate(candidates , null, idNode._key)); } private readonly QCandidates candidates; } private readonly QCandidate _enclosing; private readonly ITypeHandler4 arrayElementHandler; private readonly IReadBuffer buffer; private readonly QCandidates candidates; } internal virtual void DoNotInclude() { Include(false); if (_dependants != null) { IEnumerator i = new Iterator4Impl(_dependants); _dependants = null; while (i.MoveNext()) { ((Db4objects.Db4o.Internal.Query.Processor.QCandidate)i.Current).DoNotInclude(); } } } internal virtual bool Evaluate(QConObject a_constraint, QE a_evaluator) { if (a_evaluator.Identity()) { return a_evaluator.Evaluate(a_constraint, this, null); } if (_member == null) { _member = Value(); } return a_evaluator.Evaluate(a_constraint, this, a_constraint.Translate(_member)); } internal virtual bool Evaluate(QPending a_pending) { QPending oldPending = (QPending)Tree.Find(_pendingJoins, a_pending); if (oldPending == null) { a_pending.ChangeConstraint(); _pendingJoins = Tree.Add(_pendingJoins, a_pending.InternalClonePayload()); return true; } _pendingJoins = _pendingJoins.RemoveNode(oldPending); oldPending._join.EvaluatePending(this, oldPending, a_pending._result); return false; } internal virtual IReflectClass ClassReflector() { ReadClassMetadata(); if (_classMetadata == null) { return null; } return _classMetadata.ClassReflector(); } internal virtual bool FieldIsAvailable() { return ClassReflector() != null; } // / ****** public virtual IObjectContainer ObjectContainer() { return Container(); } public virtual object GetObject() { object obj = Value(true); if (obj is ByteArrayBuffer) { ByteArrayBuffer reader = (ByteArrayBuffer)obj; int offset = reader._offset; obj = ReadString(reader); reader._offset = offset; } return obj; } public virtual string ReadString(ByteArrayBuffer buffer) { return StringHandler.ReadString(Transaction().Context(), buffer); } internal virtual Db4objects.Db4o.Internal.Query.Processor.QCandidate GetRoot() { return _root == null ? this : _root; } internal LocalObjectContainer Container() { return Transaction().LocalContainer(); } internal LocalTransaction Transaction() { return _candidates.i_trans; } public virtual bool Include() { return _include; } /// For external interface use only. /// /// For external interface use only. Call doNotInclude() internally so /// dependancies can be checked. /// public virtual void Include(bool flag) { // TODO: // Internal and external flag may need to be handled seperately. _include = flag; } public override Tree OnAttemptToAddDuplicate(Tree oldNode) { _size = 0; _root = (Db4objects.Db4o.Internal.Query.Processor.QCandidate)oldNode; return oldNode; } private IReflectClass MemberClass() { return Transaction().Reflector().ForObject(_member); } internal virtual IPreparedComparison PrepareComparison(ObjectContainerBase container , object constraint) { IContext context = container.Transaction.Context(); if (_fieldMetadata != null) { return _fieldMetadata.PrepareComparison(context, constraint); } if (_classMetadata != null) { return _classMetadata.PrepareComparison(context, constraint); } IReflector reflector = container.Reflector(); Db4objects.Db4o.Internal.ClassMetadata classMetadata = null; if (_bytes != null) { classMetadata = container.ProduceClassMetadata(reflector.ForObject(constraint)); } else { if (_member != null) { classMetadata = container.ClassMetadataForReflectClass(reflector.ForObject(_member )); } } if (classMetadata != null) { if (_member != null && _member.GetType().IsArray) { ITypeHandler4 arrayElementTypehandler = classMetadata.TypeHandler(); if (reflector.Array().IsNDimensional(MemberClass())) { MultidimensionalArrayHandler mah = new MultidimensionalArrayHandler(arrayElementTypehandler , false); return mah.PrepareComparison(context, _member); } ArrayHandler ya = new ArrayHandler(arrayElementTypehandler, false); return ya.PrepareComparison(context, _member); } return classMetadata.PrepareComparison(context, constraint); } return null; } private void Read() { if (_include) { if (_bytes == null) { if (_key > 0) { if (DTrace.enabled) { DTrace.CandidateRead.Log(_key); } SetBytes(Container().ReadBufferById(Transaction(), _key)); if (_bytes == null) { Include(false); } } else { Include(false); } } } } private int CurrentOffSet() { return _bytes._offset; } private Db4objects.Db4o.Internal.Query.Processor.QCandidate ReadSubCandidate(QCandidates candidateCollection) { Read(); if (_bytes == null || _fieldMetadata == null) { return null; } int offset = CurrentOffSet(); QueryingReadContext context = NewQueryingReadContext(); ITypeHandler4 handler = HandlerRegistry.CorrectHandlerVersion(context, _fieldMetadata .GetHandler()); Db4objects.Db4o.Internal.Query.Processor.QCandidate subCandidate = candidateCollection .ReadSubCandidate(context, handler); Seek(offset); if (subCandidate != null) { subCandidate._root = GetRoot(); return subCandidate; } return null; } private void Seek(int offset) { _bytes._offset = offset; } private QueryingReadContext NewQueryingReadContext() { return new QueryingReadContext(Transaction(), _handlerVersion, _bytes, _key); } private void ReadThis(bool a_activate) { Read(); ObjectContainerBase container = Transaction().Container(); _member = container.TryGetByID(Transaction(), _key); if (_member != null && (a_activate || _member is ICompare)) { container.Activate(Transaction(), _member); CheckInstanceOfCompare(); } } internal virtual Db4objects.Db4o.Internal.ClassMetadata ReadClassMetadata() { if (_classMetadata == null) { Read(); if (_bytes != null) { Seek(0); ObjectContainerBase stream = Container(); ObjectHeader objectHeader = new ObjectHeader(stream, _bytes); _classMetadata = objectHeader.ClassMetadata(); if (_classMetadata != null) { if (stream._handlers.IclassCompare.IsAssignableFrom(_classMetadata.ClassReflector ())) { ReadThis(false); } } } } return _classMetadata; } public override string ToString() { string str = "QCandidate "; if (_classMetadata != null) { str += "\n YapClass " + _classMetadata.GetName(); } if (_fieldMetadata != null) { str += "\n YapField " + _fieldMetadata.GetName(); } if (_member != null) { str += "\n Member " + _member.ToString(); } if (_root != null) { str += "\n rooted by:\n"; str += _root.ToString(); } else { str += "\n ROOT"; } return str; } internal virtual void UseField(QField a_field) { Read(); if (_bytes == null) { _fieldMetadata = null; return; } ReadClassMetadata(); _member = null; if (a_field == null) { _fieldMetadata = null; return; } if (_classMetadata == null) { _fieldMetadata = null; return; } _fieldMetadata = FieldMetadataFrom(a_field, _classMetadata); if (_fieldMetadata == null) { FieldNotFound(); return; } HandlerVersion handlerVersion = _classMetadata.SeekToField(Transaction(), _bytes, _fieldMetadata); if (handlerVersion == HandlerVersion.Invalid) { FieldNotFound(); return; } _handlerVersion = handlerVersion._number; } private FieldMetadata FieldMetadataFrom(QField qField, Db4objects.Db4o.Internal.ClassMetadata type) { FieldMetadata existingField = qField.GetFieldMetadata(); if (existingField != null) { return existingField; } FieldMetadata field = type.FieldMetadataForName(qField.Name()); if (field != null) { field.Alive(); } return field; } private void FieldNotFound() { if (_classMetadata.HoldsAnyClass()) { // retry finding the field on reading the value _fieldMetadata = null; } else { // we can't get a value for the field, comparisons should definitely run against null _fieldMetadata = new NullFieldMetadata(); } _handlerVersion = HandlerRegistry.HandlerVersion; } internal virtual object Value() { return Value(false); } // TODO: This is only used for Evaluations. Handling may need // to be different for collections also. internal virtual object Value(bool a_activate) { if (_member == null) { if (_fieldMetadata == null) { ReadThis(a_activate); } else { int offset = CurrentOffSet(); _member = _fieldMetadata.Read(NewQueryingReadContext()); Seek(offset); CheckInstanceOfCompare(); } } return _member; } internal virtual void SetBytes(ByteArrayBuffer bytes) { _bytes = bytes; } private Db4objects.Db4o.Internal.Marshall.MarshallerFamily MarshallerFamily() { return Db4objects.Db4o.Internal.Marshall.MarshallerFamily.Version(_handlerVersion ); } public override bool Duplicates() { return _root != null; } public virtual void ClassMetadata(Db4objects.Db4o.Internal.ClassMetadata classMetadata ) { _classMetadata = classMetadata; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QConstraints.cs0000644000175000017500000000641111700531646032730 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Query.Processor { /// Array of constraints for queries. /// /// Array of constraints for queries. /// Necessary to be returned to Query#constraints() /// /// public class QConstraints : QCon, IConstraints { private IConstraint[] i_constraints; internal QConstraints(Transaction a_trans, IConstraint[] constraints) : base(a_trans ) { i_constraints = constraints; } internal override IConstraint Join(IConstraint a_with, bool a_and) { lock (StreamLock()) { if (!(a_with is QCon)) { return null; } // resolving multiple constraints happens in QCon for // a_with, so we simply turn things around return ((QCon)a_with).Join1(this, a_and); } } public virtual IConstraint[] ToArray() { lock (StreamLock()) { return i_constraints; } } public override IConstraint Contains() { lock (StreamLock()) { for (int i = 0; i < i_constraints.Length; i++) { i_constraints[i].Contains(); } return this; } } public override IConstraint Equal() { lock (StreamLock()) { for (int i = 0; i < i_constraints.Length; i++) { i_constraints[i].Equal(); } return this; } } public override IConstraint Greater() { lock (StreamLock()) { for (int i = 0; i < i_constraints.Length; i++) { i_constraints[i].Greater(); } return this; } } public override IConstraint Identity() { lock (StreamLock()) { for (int i = 0; i < i_constraints.Length; i++) { i_constraints[i].Identity(); } return this; } } public override IConstraint Not() { lock (StreamLock()) { for (int i = 0; i < i_constraints.Length; i++) { i_constraints[i].Not(); } return this; } } public override IConstraint Like() { lock (StreamLock()) { for (int i = 0; i < i_constraints.Length; i++) { i_constraints[i].Like(); } return this; } } public override IConstraint StartsWith(bool caseSensitive) { lock (StreamLock()) { for (int i = 0; i < i_constraints.Length; i++) { i_constraints[i].StartsWith(caseSensitive); } return this; } } public override IConstraint EndsWith(bool caseSensitive) { lock (StreamLock()) { for (int i = 0; i < i_constraints.Length; i++) { i_constraints[i].EndsWith(caseSensitive); } return this; } } public override IConstraint Smaller() { lock (StreamLock()) { for (int i = 0; i < i_constraints.Length; i++) { i_constraints[i].Smaller(); } return this; } } public override object GetObject() { lock (StreamLock()) { object[] objects = new object[i_constraints.Length]; for (int i = 0; i < i_constraints.Length; i++) { objects[i] = i_constraints[i].GetObject(); } return objects; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QField.cs0000644000175000017500000000652311700531646031450 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Types; namespace Db4objects.Db4o.Internal.Query.Processor { /// public class QField : IVisitor4, IUnversioned { [System.NonSerialized] internal Transaction i_trans; private string i_name; [System.NonSerialized] internal FieldMetadata _fieldMetadata; private int i_classMetadataID; private int _fieldHandle; public QField() { } public QField(Transaction a_trans, string name, FieldMetadata fieldMetadata, int classMetadataID, int a_index) { // C/S only i_trans = a_trans; i_name = name; _fieldMetadata = fieldMetadata; i_classMetadataID = classMetadataID; _fieldHandle = a_index; if (_fieldMetadata != null) { if (!_fieldMetadata.Alive()) { _fieldMetadata = null; } } } public virtual string Name() { return i_name; } internal virtual object Coerce(object a_object) { IReflectClass claxx = null; if (a_object != null) { if (a_object is IReflectClass) { claxx = (IReflectClass)a_object; } else { claxx = i_trans.Reflector().ForObject(a_object); } } else { // TODO: Review this line for NullableArrayHandling return a_object; } if (_fieldMetadata == null) { return a_object; } return _fieldMetadata.Coerce(claxx, a_object); } internal virtual ClassMetadata GetFieldType() { if (_fieldMetadata != null) { return _fieldMetadata.FieldType(); } return null; } public virtual FieldMetadata GetFieldMetadata() { return _fieldMetadata; } internal virtual bool IsArray() { return _fieldMetadata != null && Handlers4.HandlesArray(_fieldMetadata.GetHandler ()); } internal virtual bool IsClass() { return _fieldMetadata == null || Handlers4.HandlesClass(_fieldMetadata.GetHandler ()); } internal virtual bool IsQueryLeaf() { return _fieldMetadata != null && Handlers4.IsQueryLeaf(_fieldMetadata.GetHandler( )); } internal virtual IPreparedComparison PrepareComparison(IContext context, object obj ) { if (_fieldMetadata != null) { return _fieldMetadata.PrepareComparison(context, obj); } if (obj == null) { return Null.Instance; } ClassMetadata yc = i_trans.Container().ProduceClassMetadata(i_trans.Reflector().ForObject (obj)); FieldMetadata yf = yc.FieldMetadataForName(Name()); if (yf != null) { return yf.PrepareComparison(context, obj); } return null; } internal virtual void Unmarshall(Transaction a_trans) { if (i_classMetadataID != 0) { ClassMetadata yc = a_trans.Container().ClassMetadataForID(i_classMetadataID); _fieldMetadata = (FieldMetadata)yc._aspects[_fieldHandle]; } } public virtual void Visit(object obj) { ((QCandidate)obj).UseField(this); } public override string ToString() { if (_fieldMetadata != null) { return "QField " + _fieldMetadata.ToString(); } return base.ToString(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QConEvaluation.cs0000644000175000017500000000527511700531646033177 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public class QConEvaluation : QCon { [System.NonSerialized] private object i_evaluation; private byte[] i_marshalledEvaluation; private int i_marshalledID; public QConEvaluation() { } public QConEvaluation(Transaction a_trans, object a_evaluation) : base(a_trans) { // C/S only i_evaluation = a_evaluation; } internal override void EvaluateEvaluationsExec(QCandidates a_candidates, bool rereadObject ) { if (rereadObject) { a_candidates.Traverse(new _IVisitor4_31()); } a_candidates.Filter(this); } private sealed class _IVisitor4_31 : IVisitor4 { public _IVisitor4_31() { } public void Visit(object a_object) { ((QCandidate)a_object).UseField(null); } } internal override void Marshall() { base.Marshall(); if (!Platform4.UseNativeSerialization()) { MarshallUsingDb4oFormat(); } else { try { i_marshalledEvaluation = Platform4.Serialize(i_evaluation); } catch (Exception) { MarshallUsingDb4oFormat(); } } } private void MarshallUsingDb4oFormat() { SerializedGraph serialized = Serializer.Marshall(Container(), i_evaluation); i_marshalledEvaluation = serialized._bytes; i_marshalledID = serialized._id; } internal override void Unmarshall(Transaction a_trans) { if (i_trans == null) { base.Unmarshall(a_trans); if (i_marshalledID > 0 || !Platform4.UseNativeSerialization()) { i_evaluation = Serializer.Unmarshall(Container(), i_marshalledEvaluation, i_marshalledID ); } else { i_evaluation = Platform4.Deserialize(i_marshalledEvaluation); } } } public override void Visit(object obj) { QCandidate candidate = (QCandidate)obj; // force activation outside the try block // so any activation errors bubble up ForceActivation(candidate); try { Platform4.EvaluationEvaluate(i_evaluation, candidate); } catch (Exception) { candidate.Include(false); } // TODO: implement Exception callback for the user coder // at least for test cases if (!candidate._include) { DoNotInclude(candidate.GetRoot()); } } private void ForceActivation(QCandidate candidate) { candidate.GetObject(); } internal virtual bool SupportsIndex() { return false; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QEStringCmp.cs0000644000175000017500000000237611700531646032442 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public abstract class QEStringCmp : QEAbstract { private bool caseSensitive; /// for C/S messaging only public QEStringCmp() { } public QEStringCmp(bool caseSensitive_) { caseSensitive = caseSensitive_; } internal override bool Evaluate(QConObject constraint, QCandidate candidate, object obj) { if (obj != null) { if (obj is ByteArrayBuffer) { obj = candidate.ReadString((ByteArrayBuffer)obj); } string candidateStringValue = obj.ToString(); string stringConstraint = constraint.GetObject().ToString(); if (!caseSensitive) { candidateStringValue = candidateStringValue.ToLower(); stringConstraint = stringConstraint.ToLower(); } return CompareStrings(candidateStringValue, stringConstraint); } return constraint.GetObject() == null; } public override bool SupportsIndex() { return false; } protected abstract bool CompareStrings(string candidate, string constraint); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QQueryBase.cs0000644000175000017500000007253611700531646032334 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Text; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Query; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Query.Result; using Db4objects.Db4o.Query; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Types; using Sharpen.Util; namespace Db4objects.Db4o.Internal.Query.Processor { /// QQuery is the users hook on our graph. /// /// QQuery is the users hook on our graph. /// A QQuery is defined by it's constraints. /// NOTE: This is just a 'partial' base class to allow for variant implementations /// in db4oj and db4ojdk1.2. It assumes that itself is an instance of QQuery /// and should never be used explicitly. /// /// public abstract class QQueryBase : IInternalQuery, IUnversioned { [System.NonSerialized] internal Db4objects.Db4o.Internal.Transaction _trans; private Collection4 i_constraints = new Collection4(); private QQuery i_parent; private string i_field; [System.NonSerialized] private QueryEvaluationMode _evaluationMode; private int _prefetchDepth; private int _prefetchCount; private int _evaluationModeAsInt; private IQueryComparator _comparator; [System.NonSerialized] private readonly QQuery _this; private IList _orderings; protected QQueryBase() { // C/S only _this = Cast(this); } protected QQueryBase(Db4objects.Db4o.Internal.Transaction a_trans, QQuery a_parent , string a_field) { _this = Cast(this); _trans = a_trans; i_parent = a_parent; i_field = a_field; } public virtual void CaptureQueryResultConfig() { Config4Impl config = _trans.Container().Config(); _evaluationMode = config.EvaluationMode(); _prefetchDepth = config.PrefetchDepth(); _prefetchCount = config.PrefetchObjectCount(); } internal virtual void AddConstraint(QCon a_constraint) { i_constraints.Add(a_constraint); } private void AddConstraint(Collection4 col, object obj) { if (AttachToExistingConstraints(col, obj, true)) { return; } if (AttachToExistingConstraints(col, obj, false)) { return; } QConObject newConstraint = new QConObject(_trans, null, null, obj); AddConstraint(newConstraint); col.Add(newConstraint); } private bool AttachToExistingConstraints(Collection4 newConstraintsCollector, object obj, bool onlyForPaths) { bool found = false; IEnumerator j = IterateConstraints(); while (j.MoveNext()) { QCon existingConstraint = (QCon)j.Current; BooleanByRef removeExisting = new BooleanByRef(false); if (!onlyForPaths || (existingConstraint is QConPath)) { QCon newConstraint = existingConstraint.ShareParent(obj, removeExisting); if (newConstraint != null) { newConstraintsCollector.Add(newConstraint); AddConstraint(newConstraint); if (removeExisting.value) { RemoveConstraint(existingConstraint); } found = true; if (!onlyForPaths) { break; } } } } return found; } /// Search for slot that corresponds to class. /// /// Search for slot that corresponds to class.
If not found add it. ///
Constrain it.
///
public virtual IConstraint Constrain(object example) { lock (StreamLock()) { IReflectClass claxx = ReflectClassForClass(example); if (claxx != null) { return AddClassConstraint(claxx); } QConEvaluation eval = Platform4.EvaluationCreate(_trans, example); if (eval != null) { return AddEvaluationToAllConstraints(eval); } Collection4 constraints = new Collection4(); AddConstraint(constraints, example); return ToConstraint(constraints); } } private IConstraint AddEvaluationToAllConstraints(QConEvaluation eval) { if (i_constraints.Size() == 0) { _trans.Container().ClassCollection().IterateTopLevelClasses(new _IVisitor4_139(this )); } IEnumerator i = IterateConstraints(); while (i.MoveNext()) { ((QCon)i.Current).AddConstraint(eval); } // FIXME: should return valid Constraint object return null; } private sealed class _IVisitor4_139 : IVisitor4 { public _IVisitor4_139(QQueryBase _enclosing) { this._enclosing = _enclosing; } public void Visit(object obj) { ClassMetadata classMetadata = (ClassMetadata)obj; QConClass qcc = new QConClass(this._enclosing._trans, classMetadata.ClassReflector ()); this._enclosing.AddConstraint(qcc); this._enclosing.ToConstraint(this._enclosing.i_constraints).Or(qcc); } private readonly QQueryBase _enclosing; } private IConstraint AddClassConstraint(IReflectClass claxx) { if (IsTheObjectClass(claxx)) { return null; } if (claxx.IsInterface()) { return AddInterfaceConstraint(claxx); } Collection4 newConstraints = IntroduceClassConstrain(claxx); if (newConstraints.IsEmpty()) { QConClass qcc = new QConClass(_trans, claxx); AddConstraint(qcc); return qcc; } return ToConstraint(newConstraints); } private Collection4 IntroduceClassConstrain(IReflectClass claxx) { Collection4 newConstraints = new Collection4(); IEnumerator existingConstraints = IterateConstraints(); while (existingConstraints.MoveNext()) { QCon existingConstraint = (QConObject)existingConstraints.Current; BooleanByRef removeExisting = new BooleanByRef(false); QCon newConstraint = existingConstraint.ShareParentForClass(claxx, removeExisting ); if (newConstraint != null) { newConstraints.Add(newConstraint); AddConstraint(newConstraint); if (removeExisting.value) { RemoveConstraint(existingConstraint); } } } return newConstraints; } private bool IsTheObjectClass(IReflectClass claxx) { return claxx.Equals(Stream()._handlers.IclassObject); } private IConstraint AddInterfaceConstraint(IReflectClass claxx) { Collection4 classes = Stream().ClassCollection().ForInterface(claxx); if (classes.Size() == 0) { QConClass qcc = new QConClass(_trans, null, null, claxx); AddConstraint(qcc); return qcc; } IEnumerator i = classes.GetEnumerator(); IConstraint constr = null; while (i.MoveNext()) { ClassMetadata classMetadata = (ClassMetadata)i.Current; IReflectClass classMetadataClaxx = classMetadata.ClassReflector(); if (classMetadataClaxx != null) { if (!classMetadataClaxx.IsInterface()) { if (constr == null) { constr = Constrain(classMetadataClaxx); } else { constr = constr.Or(Constrain(classMetadata.ClassReflector())); } } } } return constr; } private IReflectClass ReflectClassForClass(object example) { if (example is IReflectClass) { return (IReflectClass)example; } if (example is Type) { return _trans.Reflector().ForClass((Type)example); } return null; } public virtual IConstraints Constraints() { lock (StreamLock()) { IConstraint[] constraints = new IConstraint[i_constraints.Size()]; i_constraints.ToArray(constraints); return new QConstraints(_trans, constraints); } } public virtual IQuery Descend(string a_field) { lock (StreamLock()) { QQuery query = new QQuery(_trans, _this, a_field); IntByRef run = new IntByRef(1); if (!Descend1(query, a_field, run)) { // try to add unparented nodes on the second run, // if not added in the first run and a descendant // was not found if (run.value == 1) { run.value = 2; if (!Descend1(query, a_field, run)) { new QConUnconditional(_trans, false).Attach(query, a_field); } } } return query; } } private bool Descend1(QQuery query, string fieldName, IntByRef run) { if (run.value == 2 || i_constraints.Size() == 0) { // On the second run we are really creating a second independant // query network that is not joined to other higher level // constraints. // Let's see how this works out. We may need to join networks. run.value = 0; // prevent a double run of this code Stream().ClassCollection().AttachQueryNode(fieldName, new _IVisitor4_275(this)); } CheckConstraintsEvaluationMode(); BooleanByRef foundClass = new BooleanByRef(false); IEnumerator i = IterateConstraints(); while (i.MoveNext()) { if (((QCon)i.Current).Attach(query, fieldName)) { foundClass.value = true; } } return foundClass.value; } private sealed class _IVisitor4_275 : IVisitor4 { public _IVisitor4_275(QQueryBase _enclosing) { this._enclosing = _enclosing; this.untypedFieldConstraintCollected = false; } internal bool untypedFieldConstraintCollected; public void Visit(object obj) { object[] pair = ((object[])obj); ClassMetadata containingClass = (ClassMetadata)pair[0]; FieldMetadata field = (FieldMetadata)pair[1]; if (this.IsTyped(field)) { this.AddFieldConstraint(containingClass, field); return; } if (this.untypedFieldConstraintCollected) { return; } this.AddFieldConstraint(containingClass, field); this.untypedFieldConstraintCollected = true; } private bool IsTyped(FieldMetadata field) { return !Handlers4.IsUntyped(field.GetHandler()); } private void AddFieldConstraint(ClassMetadata containingClass, FieldMetadata field ) { QConClass qcc = new QConClass(this._enclosing._trans, null, field.QField(this._enclosing ._trans), containingClass.ClassReflector()); this._enclosing.AddConstraint(qcc); this._enclosing.ToConstraint(this._enclosing.i_constraints).Or(qcc); } private readonly QQueryBase _enclosing; } public virtual IObjectSet Execute() { lock (StreamLock()) { return ((IObjectSet)TriggeringQueryEvents(new _IClosure4_331(this))); } } private sealed class _IClosure4_331 : IClosure4 { public _IClosure4_331(QQueryBase _enclosing) { this._enclosing = _enclosing; } public object Run() { return new ObjectSetFacade(this._enclosing.GetQueryResult()); } private readonly QQueryBase _enclosing; } public virtual void ExecuteLocal(IdListQueryResult result) { CheckConstraintsEvaluationMode(); QQueryBase.CreateCandidateCollectionResult r = CreateCandidateCollection(); bool checkDuplicates = r.checkDuplicates; bool topLevel = r.topLevel; List4 candidateCollection = r.candidateCollection; if (candidateCollection != null) { Collection4 executionPath = topLevel ? null : FieldPathFromTop(); IEnumerator i = new Iterator4Impl(candidateCollection); while (i.MoveNext()) { ((QCandidates)i.Current).Execute(); } if (((List4)candidateCollection._next) != null) { checkDuplicates = true; } if (checkDuplicates) { result.CheckDuplicates(); } ObjectContainerBase stream = Stream(); i = new Iterator4Impl(candidateCollection); while (i.MoveNext()) { QCandidates candidates = (QCandidates)i.Current; if (topLevel) { candidates.Traverse(result); } else { candidates.Traverse(new _IVisitor4_374(this, executionPath, stream, result)); } } } Sort(result); } private sealed class _IVisitor4_374 : IVisitor4 { public _IVisitor4_374(QQueryBase _enclosing, Collection4 executionPath, ObjectContainerBase stream, IdListQueryResult result) { this._enclosing = _enclosing; this.executionPath = executionPath; this.stream = stream; this.result = result; } public void Visit(object a_object) { QCandidate candidate = (QCandidate)a_object; if (candidate.Include()) { TreeInt ids = new TreeInt(candidate._key); ByRef idsNew = new ByRef(); IEnumerator itPath = executionPath.GetEnumerator(); while (itPath.MoveNext()) { idsNew.value = null; string fieldName = (string)(itPath.Current); if (ids != null) { ids.Traverse(new _IVisitor4_385(this, stream, fieldName, idsNew)); } ids = (TreeInt)((TreeInt)idsNew.value); } if (ids != null) { ids.Traverse(new _IVisitor4_406(result)); } } } private sealed class _IVisitor4_385 : IVisitor4 { public _IVisitor4_385(_IVisitor4_374 _enclosing, ObjectContainerBase stream, string fieldName, ByRef idsNew) { this._enclosing = _enclosing; this.stream = stream; this.fieldName = fieldName; this.idsNew = idsNew; } public void Visit(object treeInt) { int id = ((TreeInt)treeInt)._key; StatefulBuffer reader = stream.ReadStatefulBufferById(this._enclosing._enclosing. _trans, id); if (reader != null) { ObjectHeader oh = new ObjectHeader(stream, reader); CollectIdContext context = new CollectIdContext(this._enclosing._enclosing._trans , oh, reader); oh.ClassMetadata().CollectIDs(context, fieldName); Tree.Traverse(context.Ids(), new _IVisitor4_394(idsNew)); } } private sealed class _IVisitor4_394 : IVisitor4 { public _IVisitor4_394(ByRef idsNew) { this.idsNew = idsNew; } public void Visit(object node) { idsNew.value = TreeInt.Add(((TreeInt)idsNew.value), ((TreeInt)node)._key); } private readonly ByRef idsNew; } private readonly _IVisitor4_374 _enclosing; private readonly ObjectContainerBase stream; private readonly string fieldName; private readonly ByRef idsNew; } private sealed class _IVisitor4_406 : IVisitor4 { public _IVisitor4_406(IdListQueryResult result) { this.result = result; } public void Visit(object treeInt) { result.AddKeyCheckDuplicates(((TreeInt)treeInt)._key); } private readonly IdListQueryResult result; } private readonly QQueryBase _enclosing; private readonly Collection4 executionPath; private readonly ObjectContainerBase stream; private readonly IdListQueryResult result; } private void TriggerQueryOnFinished() { Stream().Callbacks().QueryOnFinished(_trans, Cast(this)); } private void TriggerQueryOnStarted() { Stream().Callbacks().QueryOnStarted(_trans, Cast(this)); } public virtual IEnumerator ExecuteLazy() { CheckConstraintsEvaluationMode(); QQueryBase.CreateCandidateCollectionResult r = CreateCandidateCollection(); Collection4 executionPath = ExecutionPath(r); IEnumerator candidateCollection = new Iterator4Impl(r.candidateCollection); MappingIterator executeCandidates = new _MappingIterator_438(executionPath, candidateCollection ); CompositeIterator4 resultingIDs = new CompositeIterator4(executeCandidates); if (!r.checkDuplicates) { return resultingIDs; } return CheckDuplicates(resultingIDs); } private sealed class _MappingIterator_438 : MappingIterator { public _MappingIterator_438(Collection4 executionPath, IEnumerator baseArg1) : base (baseArg1) { this.executionPath = executionPath; } protected override object Map(object current) { return ((QCandidates)current).ExecuteLazy(executionPath); } private readonly Collection4 executionPath; } public virtual IQueryResult GetQueryResult() { lock (StreamLock()) { if (i_constraints.Size() == 0) { return ExecuteAllObjectsQuery(); } IQueryResult result = ExecuteClassOnlyQuery(); if (result != null) { return result; } OptimizeJoins(); return ExecuteQuery(); } } protected IQueryResult ExecuteQuery() { return Stream().ExecuteQuery(_this); } private IQueryResult ExecuteAllObjectsQuery() { return Stream().QueryAllObjects(_trans); } protected virtual ObjectContainerBase Stream() { return _trans.Container(); } public virtual IInternalObjectContainer Container { get { return Stream(); } } private IQueryResult ExecuteClassOnlyQuery() { ClassMetadata clazz = SingleClassConstraint(); if (null == clazz) { return null; } IQueryResult queryResult = Stream().ClassOnlyQuery(this, clazz); Sort(queryResult); return queryResult; } private ClassMetadata SingleClassConstraint() { if (RequiresSort()) { return null; } QConClass clazzconstr = ClassConstraint(); if (clazzconstr == null) { return null; } ClassMetadata clazz = clazzconstr._classMetadata; if (clazz == null) { return null; } if (clazzconstr.HasChildren() || clazz.IsArray()) { return null; } return clazz; } private QConClass ClassConstraint() { if (i_constraints.Size() != 1) { return null; } IConstraint constr = SingleConstraint(); if (constr.GetType() != typeof(QConClass)) { return null; } return (QConClass)constr; } private IConstraint SingleConstraint() { return (IConstraint)i_constraints.SingleElement(); } public class CreateCandidateCollectionResult { public readonly bool checkDuplicates; public readonly bool topLevel; public readonly List4 candidateCollection; public CreateCandidateCollectionResult(List4 candidateCollection_, bool checkDuplicates_ , bool topLevel_) { candidateCollection = candidateCollection_; topLevel = topLevel_; checkDuplicates = checkDuplicates_; } } public virtual IEnumerator ExecuteSnapshot() { QQueryBase.CreateCandidateCollectionResult r = CreateCandidateCollection(); Collection4 executionPath = ExecutionPath(r); IEnumerator candidatesIterator = new Iterator4Impl(r.candidateCollection); Collection4 snapshots = new Collection4(); while (candidatesIterator.MoveNext()) { QCandidates candidates = (QCandidates)candidatesIterator.Current; snapshots.Add(candidates.ExecuteSnapshot(executionPath)); } IEnumerator snapshotsIterator = snapshots.GetEnumerator(); CompositeIterator4 resultingIDs = new CompositeIterator4(snapshotsIterator); if (!r.checkDuplicates) { return resultingIDs; } return CheckDuplicates(resultingIDs); } public virtual object TriggeringQueryEvents(IClosure4 closure) { TriggerQueryOnStarted(); try { return closure.Run(); } finally { TriggerQueryOnFinished(); } } private IEnumerator CheckDuplicates(CompositeIterator4 executeAllCandidates) { return Iterators.Filter(executeAllCandidates, new _IPredicate4_573()); } private sealed class _IPredicate4_573 : IPredicate4 { public _IPredicate4_573() { this.ids = new TreeInt(0); } private TreeInt ids; public bool Match(object current) { int id = ((int)current); if (this.ids.Find(id) != null) { return false; } this.ids = (TreeInt)((TreeInt)this.ids.Add(new TreeInt(id))); return true; } } private Collection4 ExecutionPath(QQueryBase.CreateCandidateCollectionResult r) { return r.topLevel ? null : FieldPathFromTop(); } public virtual void CheckConstraintsEvaluationMode() { IEnumerator constraints = IterateConstraints(); while (constraints.MoveNext()) { ((QConObject)constraints.Current).SetEvaluationMode(); } } private Collection4 FieldPathFromTop() { QQueryBase q = this; Collection4 fieldPath = new Collection4(); while (q.i_parent != null) { fieldPath.Prepend(q.i_field); q = q.i_parent; } return fieldPath; } private void LogConstraints() { } public virtual QQueryBase.CreateCandidateCollectionResult CreateCandidateCollection () { List4 candidatesList = CreateQCandidatesList(); bool checkDuplicates = false; bool topLevel = true; IEnumerator i = IterateConstraints(); while (i.MoveNext()) { QCon constraint = (QCon)i.Current; QCon old = constraint; constraint = constraint.GetRoot(); if (constraint != old) { checkDuplicates = true; topLevel = false; } ClassMetadata classMetadata = constraint.GetYapClass(); if (classMetadata == null) { break; } AddConstraintToCandidatesList(candidatesList, constraint); } return new QQueryBase.CreateCandidateCollectionResult(candidatesList, checkDuplicates , topLevel); } private void AddConstraintToCandidatesList(List4 candidatesList, QCon qcon) { if (candidatesList == null) { return; } IEnumerator j = new Iterator4Impl(candidatesList); while (j.MoveNext()) { QCandidates candidates = (QCandidates)j.Current; candidates.AddConstraint(qcon); } } private List4 CreateQCandidatesList() { List4 candidatesList = null; IEnumerator i = IterateConstraints(); while (i.MoveNext()) { QCon constraint = (QCon)i.Current; constraint = constraint.GetRoot(); ClassMetadata classMetadata = constraint.GetYapClass(); if (classMetadata == null) { continue; } if (ConstraintCanBeAddedToExisting(candidatesList, constraint)) { continue; } QCandidates candidates = new QCandidates((LocalTransaction)_trans, classMetadata, null); candidatesList = new List4(candidatesList, candidates); } return candidatesList; } private bool ConstraintCanBeAddedToExisting(List4 candidatesList, QCon constraint ) { IEnumerator j = new Iterator4Impl(candidatesList); while (j.MoveNext()) { QCandidates candidates = (QCandidates)j.Current; if (candidates.FitsIntoExistingConstraintHierarchy(constraint)) { return true; } } return false; } public Transaction Transaction() { return _trans; } public virtual IEnumerator IterateConstraints() { // clone the collection first to avoid // InvalidIteratorException as i_constraints might be // modified during the execution of callee return new Collection4(i_constraints).GetEnumerator(); } public virtual IQuery OrderAscending() { if (i_parent == null) { throw new InvalidOperationException("Cannot apply ordering at top level."); } lock (StreamLock()) { AddOrdering(SodaQueryComparator.Direction.Ascending); return _this; } } public virtual IQuery OrderDescending() { if (i_parent == null) { throw new InvalidOperationException("Cannot apply ordering at top level."); } lock (StreamLock()) { AddOrdering(SodaQueryComparator.Direction.Descending); return _this; } } private void AddOrdering(SodaQueryComparator.Direction direction) { AddOrdering(direction, new ArrayList()); } protected void AddOrdering(SodaQueryComparator.Direction direction, IList path) { if (i_field != null) { path.Add(i_field); } if (i_parent != null) { i_parent.AddOrdering(direction, path); return; } string[] fieldPath = ReverseFieldPath(path); RemoveExistingOrderingFor(fieldPath); Orderings().Add(new SodaQueryComparator.Ordering(direction, fieldPath)); } private void RemoveExistingOrderingFor(string[] fieldPath) { for (IEnumerator orderingIter = Orderings().GetEnumerator(); orderingIter.MoveNext (); ) { SodaQueryComparator.Ordering ordering = ((SodaQueryComparator.Ordering)orderingIter .Current); if (Arrays.Equals(ordering.FieldPath(), fieldPath)) { Orderings().Remove(ordering); break; } } } /// Public so it can be used by the LINQ test cases. /// Public so it can be used by the LINQ test cases. public IList Orderings() { if (null == _orderings) { _orderings = new ArrayList(); } return _orderings; } private string[] ReverseFieldPath(IList path) { string[] reversedPath = new string[path.Count]; for (int i = 0; i < reversedPath.Length; i++) { reversedPath[i] = ((string)path[path.Count - i - 1]); } return reversedPath; } public virtual void Marshall() { CheckConstraintsEvaluationMode(); _evaluationModeAsInt = _evaluationMode.AsInt(); IEnumerator i = IterateConstraints(); while (i.MoveNext()) { ((QCon)i.Current).GetRoot().Marshall(); } } public virtual void Unmarshall(Transaction a_trans) { _evaluationMode = QueryEvaluationMode.FromInt(_evaluationModeAsInt); _trans = a_trans; IEnumerator i = IterateConstraints(); while (i.MoveNext()) { ((QCon)i.Current).Unmarshall(a_trans); } } internal virtual void RemoveConstraint(QCon a_constraint) { i_constraints.Remove(a_constraint); } internal virtual IConstraint ToConstraint(Collection4 constraints) { if (constraints.Size() == 1) { return (IConstraint)constraints.SingleElement(); } else { if (constraints.Size() > 0) { IConstraint[] constraintArray = new IConstraint[constraints.Size()]; constraints.ToArray(constraintArray); return new QConstraints(_trans, constraintArray); } } return null; } protected virtual object StreamLock() { return Stream().Lock(); } public virtual IQuery SortBy(IQueryComparator comparator) { _comparator = comparator; return _this; } private void Sort(IQueryResult result) { if (_orderings != null) { result.SortIds(NewSodaQueryComparator()); } if (_comparator != null) { result.Sort(_comparator); } } private IIntComparator NewSodaQueryComparator() { return new SodaQueryComparator((LocalObjectContainer)this.Transaction().Container (), ExtentType(), ((SodaQueryComparator.Ordering[])Sharpen.Collections.ToArray(_orderings , new SodaQueryComparator.Ordering[_orderings.Count]))); } private ClassMetadata ExtentType() { return ClassConstraint().GetYapClass(); } // cheat emulating '(QQuery)this' private static QQuery Cast(QQueryBase obj) { return (QQuery)obj; } public virtual bool RequiresSort() { if (_comparator != null || _orderings != null) { return true; } return false; } public virtual IQueryComparator Comparator() { return _comparator; } public virtual QueryEvaluationMode EvaluationMode() { return _evaluationMode; } public virtual void EvaluationMode(QueryEvaluationMode mode) { _evaluationMode = mode; } private void OptimizeJoins() { if (!HasOrJoins()) { RemoveJoins(); } } private bool HasOrJoins() { return ForEachConstraintRecursively(new _IFunction4_855()); } private sealed class _IFunction4_855 : IFunction4 { public _IFunction4_855() { } public object Apply(object obj) { QCon constr = (QCon)obj; IEnumerator joinIter = constr.IterateJoins(); while (joinIter.MoveNext()) { QConJoin join = (QConJoin)joinIter.Current; if (join.IsOr()) { return true; } } return false; } } private void RemoveJoins() { ForEachConstraintRecursively(new _IFunction4_871()); } private sealed class _IFunction4_871 : IFunction4 { public _IFunction4_871() { } public object Apply(object obj) { QCon constr = (QCon)obj; constr.i_joins = null; return false; } } private bool ForEachConstraintRecursively(IFunction4 block) { IQueue4 queue = new NoDuplicatesQueue(new NonblockingQueue()); IEnumerator constrIter = IterateConstraints(); while (constrIter.MoveNext()) { queue.Add(constrIter.Current); } while (queue.HasNext()) { QCon constr = (QCon)queue.Next(); bool cancel = (bool)block.Apply(constr); if (cancel) { return true; } IEnumerator childIter = constr.IterateChildren(); while (childIter.MoveNext()) { queue.Add(childIter.Current); } IEnumerator joinIter = constr.IterateJoins(); while (joinIter.MoveNext()) { queue.Add(joinIter.Current); } } return false; } public virtual int PrefetchDepth() { return _prefetchDepth; } public virtual int PrefetchCount() { return _prefetchCount; } public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("QQueryBase\n"); IEnumerator i = IterateConstraints(); while (i.MoveNext()) { QCon constraint = (QCon)i.Current; sb.Append(constraint); sb.Append("\n"); } return sb.ToString(); } public virtual QQuery Parent() { return i_parent; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Processor/QEStartsWith.cs0000644000175000017500000000105211700531646032636 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Query.Processor { /// public class QEStartsWith : QEStringCmp { /// for C/S messaging only public QEStartsWith() { } public QEStartsWith(bool caseSensitive_) : base(caseSensitive_) { } protected override bool CompareStrings(string candidate, string constraint) { return candidate.IndexOf(constraint) == 0; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/SodaQueryComparator.cs0000644000175000017500000001470611700531646032273 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Query; namespace Db4objects.Db4o.Internal.Query { public class SodaQueryComparator : IComparer, IIntComparator { public class Ordering { private SodaQueryComparator.Direction _direction; private string[] _fieldPath; [System.NonSerialized] internal IList _resolvedPath; public Ordering(SodaQueryComparator.Direction direction, string[] fieldPath) { _direction = direction; _fieldPath = fieldPath; } public virtual SodaQueryComparator.Direction Direction() { return _direction; } public virtual string[] FieldPath() { return _fieldPath; } } public class Direction { public static readonly SodaQueryComparator.Direction Ascending = new SodaQueryComparator.Direction (0); public static readonly SodaQueryComparator.Direction Descending = new SodaQueryComparator.Direction (1); private int value; private Direction() { } private Direction(int value) { this.value = value; } public override bool Equals(object obj) { return ((SodaQueryComparator.Direction)obj).value == value; } public override string ToString() { return this.Equals(Ascending) ? "ASCENDING" : "DESCENDING"; } } private readonly LocalObjectContainer _container; private readonly LocalTransaction _transaction; private readonly ClassMetadata _extentType; private readonly SodaQueryComparator.Ordering[] _orderings; private readonly IDictionary _bufferCache = new Hashtable(); private readonly IDictionary _fieldValueCache = new Hashtable(); public SodaQueryComparator(LocalObjectContainer container, Type extentType, SodaQueryComparator.Ordering [] orderings) : this(container, container.ProduceClassMetadata(container.Reflector ().ForClass(extentType)), orderings) { } public SodaQueryComparator(LocalObjectContainer container, ClassMetadata extent, SodaQueryComparator.Ordering[] orderings) { _container = container; _transaction = ((LocalTransaction)_container.Transaction); _extentType = extent; _orderings = orderings; ResolveFieldPaths(orderings); } private void ResolveFieldPaths(SodaQueryComparator.Ordering[] orderings) { for (int fieldPathIndex = 0; fieldPathIndex < orderings.Length; ++fieldPathIndex) { SodaQueryComparator.Ordering fieldPath = orderings[fieldPathIndex]; fieldPath._resolvedPath = ResolveFieldPath(fieldPath.FieldPath()); } } public virtual IList Sort(long[] ids) { ArrayList idList = ListFrom(ids); idList.Sort(this); return idList; } private ArrayList ListFrom(long[] ids) { ArrayList idList = new ArrayList(ids.Length); for (int idIndex = 0; idIndex < ids.Length; ++idIndex) { long id = ids[idIndex]; idList.Add((int)id); } return idList; } private IList ResolveFieldPath(string[] fieldPath) { IList fields = new ArrayList(fieldPath.Length); ClassMetadata currentType = _extentType; for (int fieldNameIndex = 0; fieldNameIndex < fieldPath.Length; ++fieldNameIndex) { string fieldName = fieldPath[fieldNameIndex]; FieldMetadata field = currentType.FieldMetadataForName(fieldName); currentType = field.FieldType(); fields.Add(field); } return fields; } public virtual int Compare(object x, object y) { return Compare(((int)x), ((int)y)); } public virtual int Compare(int x, int y) { for (int orderingIndex = 0; orderingIndex < _orderings.Length; ++orderingIndex) { SodaQueryComparator.Ordering ordering = _orderings[orderingIndex]; int result = CompareByField(x, y, ordering._resolvedPath); if (result != 0) { return ordering.Direction().Equals(SodaQueryComparator.Direction.Ascending) ? result : -result; } } return 0; } private int CompareByField(int x, int y, IList path) { object xFieldValue = GetFieldValue(x, path); object yFieldValue = GetFieldValue(y, path); FieldMetadata field = ((FieldMetadata)path[path.Count - 1]); return field.PrepareComparison(_transaction.Context(), xFieldValue).CompareTo(yFieldValue ); } private object GetFieldValue(int id, IList path) { for (int i = 0; i < path.Count - 1; ++i) { object obj = GetFieldValue(id, ((FieldMetadata)path[i])); if (null == obj) { return null; } id = _container.GetID(_transaction, obj); } return GetFieldValue(id, ((FieldMetadata)path[path.Count - 1])); } internal class FieldValueKey { private int _id; private FieldMetadata _field; public FieldValueKey(int id, FieldMetadata field) { _id = id; _field = field; } public override int GetHashCode() { return _field.GetHashCode() ^ _id; } public override bool Equals(object obj) { SodaQueryComparator.FieldValueKey other = (SodaQueryComparator.FieldValueKey)obj; return _field == other._field && _id == other._id; } } private object GetFieldValue(int id, FieldMetadata field) { SodaQueryComparator.FieldValueKey key = new SodaQueryComparator.FieldValueKey(id, field); object cachedValue = _fieldValueCache[key]; if (null != cachedValue) { return cachedValue; } object fieldValue = ReadFieldValue(id, field); _fieldValueCache[key] = fieldValue; return fieldValue; } private object ReadFieldValue(int id, FieldMetadata field) { ByteArrayBuffer buffer = BufferFor(id); HandlerVersion handlerVersion = field.ContainingClass().SeekToField(_transaction, buffer, field); if (handlerVersion == HandlerVersion.Invalid) { return null; } QueryingReadContext context = new QueryingReadContext(_transaction, handlerVersion ._number, buffer, id); return field.Read(context); } private ByteArrayBuffer BufferFor(int id) { ByteArrayBuffer cachedBuffer = ((ByteArrayBuffer)_bufferCache[id]); if (null != cachedBuffer) { return cachedBuffer; } ByteArrayBuffer buffer = _container.ReadBufferById(_transaction, id); _bufferCache[id] = buffer; return buffer; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/IDb4oEnhancedFilter.cs0000644000175000017500000000045011700531646032013 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Query { /// FIXME: Rename to Db4oEnhancedPredicate public interface IDb4oEnhancedFilter { void OptimizeQuery(IQuery query); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Result/0000755000175000017500000000000011700531646027246 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Result/AbstractQueryResult.cs0000644000175000017500000001060211700531646033564 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Query.Result; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Query.Result { /// public abstract class AbstractQueryResult : IQueryResult { protected readonly Db4objects.Db4o.Internal.Transaction _transaction; public AbstractQueryResult(Db4objects.Db4o.Internal.Transaction transaction) { _transaction = transaction; } public object Activate(object obj) { Stream().Activate(_transaction, obj); return obj; } public object ActivatedObject(int id) { ObjectContainerBase stream = Stream(); object ret = stream.GetActivatedObjectFromCache(_transaction, id); if (ret != null) { return ret; } return stream.ReadActivatedObjectNotInCache(_transaction, id); } public virtual object Lock() { ObjectContainerBase stream = Stream(); stream.CheckClosed(); return stream.Lock(); } public virtual ObjectContainerBase Stream() { return _transaction.Container(); } public virtual Db4objects.Db4o.Internal.Transaction Transaction() { return _transaction; } public virtual IExtObjectContainer ObjectContainer() { return Transaction().ObjectContainer().Ext(); } public virtual IEnumerator GetEnumerator() { return new _MappingIterator_56(this, IterateIDs()); } private sealed class _MappingIterator_56 : MappingIterator { public _MappingIterator_56(AbstractQueryResult _enclosing, IEnumerator baseArg1) : base(baseArg1) { this._enclosing = _enclosing; } protected override object Map(object current) { if (current == null) { return Iterators.Skip; } lock (this._enclosing.Lock()) { object obj = this._enclosing.ActivatedObject(((int)current)); if (obj == null) { return Iterators.Skip; } return obj; } } private readonly AbstractQueryResult _enclosing; } public virtual Db4objects.Db4o.Internal.Query.Result.AbstractQueryResult SupportSize () { return this; } public virtual Db4objects.Db4o.Internal.Query.Result.AbstractQueryResult SupportSort () { return this; } public virtual Db4objects.Db4o.Internal.Query.Result.AbstractQueryResult SupportElementAccess () { return this; } protected virtual int KnownSize() { return Size(); } public virtual Db4objects.Db4o.Internal.Query.Result.AbstractQueryResult ToIdList () { IdListQueryResult res = new IdListQueryResult(Transaction(), KnownSize()); IIntIterator4 i = IterateIDs(); while (i.MoveNext()) { res.Add(i.CurrentInt()); } return res; } protected virtual Db4objects.Db4o.Internal.Query.Result.AbstractQueryResult ToIdTree () { return new IdTreeQueryResult(Transaction(), IterateIDs()); } public virtual Config4Impl Config() { return Stream().Config(); } public virtual int Size() { throw new NotImplementedException(); } public virtual void Sort(IQueryComparator cmp) { throw new NotImplementedException(); } public virtual void SortIds(IIntComparator cmp) { throw new NotImplementedException(); } public virtual object Get(int index) { throw new NotImplementedException(); } /// public virtual int GetId(int i) { throw new NotImplementedException(); } public virtual int IndexOf(int id) { throw new NotImplementedException(); } /// public virtual void LoadFromClassIndex(ClassMetadata c) { throw new NotImplementedException(); } /// public virtual void LoadFromClassIndexes(ClassMetadataIterator i) { throw new NotImplementedException(); } /// public virtual void LoadFromIdReader(IEnumerator ids) { throw new NotImplementedException(); } /// public virtual void LoadFromQuery(QQuery q) { throw new NotImplementedException(); } public abstract IIntIterator4 IterateIDs(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Result/StatefulQueryResult.cs0000644000175000017500000000423411700531646033614 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Query.Result; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Query.Result { /// public class StatefulQueryResult : IEnumerable { private readonly IQueryResult _delegate; private readonly Iterable4Adaptor _iterable; public StatefulQueryResult(IQueryResult queryResult) { _delegate = queryResult; _iterable = new Iterable4Adaptor(queryResult); } public virtual object Get(int index) { lock (Lock()) { return _delegate.Get(index); } } public virtual long[] GetIDs() { lock (Lock()) { long[] ids = new long[Size()]; int i = 0; IIntIterator4 iterator = _delegate.IterateIDs(); while (iterator.MoveNext()) { ids[i++] = iterator.CurrentInt(); } return ids; } } public virtual bool HasNext() { lock (Lock()) { return _iterable.HasNext(); } } public virtual object Next() { lock (Lock()) { return _iterable.Next(); } } public virtual void Reset() { lock (Lock()) { _iterable.Reset(); } } public virtual int Size() { lock (Lock()) { return _delegate.Size(); } } public virtual void Sort(IQueryComparator cmp) { lock (Lock()) { _delegate.Sort(cmp); } } public virtual object Lock() { return _delegate.Lock(); } internal virtual IExtObjectContainer ObjectContainer() { return _delegate.ObjectContainer(); } public virtual int IndexOf(object a_object) { lock (Lock()) { int id = (int)ObjectContainer().GetID(a_object); if (id <= 0) { return -1; } return _delegate.IndexOf(id); } } public virtual IEnumerator IterateIDs() { lock (Lock()) { return _delegate.IterateIDs(); } } public virtual IEnumerator GetEnumerator() { lock (Lock()) { return _delegate.GetEnumerator(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Result/LazyQueryResult.cs0000644000175000017500000000212211700531646032736 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Query.Result; namespace Db4objects.Db4o.Internal.Query.Result { /// public class LazyQueryResult : AbstractLateQueryResult { public LazyQueryResult(Transaction trans) : base(trans) { } public override void LoadFromClassIndex(ClassMetadata clazz) { _iterable = ClassIndexIterable(clazz); } public override void LoadFromClassIndexes(ClassMetadataIterator classCollectionIterator ) { _iterable = ClassIndexesIterable(classCollectionIterator); } public override void LoadFromQuery(QQuery query) { _iterable = new _IEnumerable_28(query); } private sealed class _IEnumerable_28 : IEnumerable { public _IEnumerable_28(QQuery query) { this.query = query; } public IEnumerator GetEnumerator() { return query.ExecuteLazy(); } private readonly QQuery query; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Result/IdListQueryResult.cs0000644000175000017500000001316211700531646033215 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Classindex; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Query.Result; using Db4objects.Db4o.Query; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Query.Result { /// public class IdListQueryResult : AbstractQueryResult, IVisitor4 { private Tree _candidates; private bool _checkDuplicates; public IntArrayList _ids; public IdListQueryResult(Transaction trans, int initialSize) : base(trans) { _ids = new IntArrayList(initialSize); } public IdListQueryResult(Transaction trans) : this(trans, 0) { } public override IIntIterator4 IterateIDs() { return _ids.IntIterator(); } public override object Get(int index) { lock (Lock()) { return ActivatedObject(GetId(index)); } } public override int GetId(int index) { if (index < 0 || index >= Size()) { throw new Db4oRecoverableException(new IndexOutOfRangeException()); } return _ids.Get(index); } public void CheckDuplicates() { _checkDuplicates = true; } public virtual void Visit(object a_tree) { QCandidate candidate = (QCandidate)a_tree; if (candidate.Include()) { AddKeyCheckDuplicates(candidate._key); } } public virtual void AddKeyCheckDuplicates(int a_key) { if (_checkDuplicates) { TreeInt newNode = new TreeInt(a_key); _candidates = Tree.Add(_candidates, newNode); if (newNode._size == 0) { return; } } Add(a_key); } public override void Sort(IQueryComparator cmp) { Algorithms4.Sort(new _ISortable4_74(this, cmp)); } private sealed class _ISortable4_74 : ISortable4 { public _ISortable4_74(IdListQueryResult _enclosing, IQueryComparator cmp) { this._enclosing = _enclosing; this.cmp = cmp; } public void Swap(int leftIndex, int rightIndex) { this._enclosing._ids.Swap(leftIndex, rightIndex); } public int Size() { return this._enclosing.Size(); } public int Compare(int leftIndex, int rightIndex) { return cmp.Compare(this._enclosing.Get(leftIndex), this._enclosing.Get(rightIndex )); } private readonly IdListQueryResult _enclosing; private readonly IQueryComparator cmp; } public override void SortIds(IIntComparator cmp) { Algorithms4.Sort(new _ISortable4_88(this, cmp)); } private sealed class _ISortable4_88 : ISortable4 { public _ISortable4_88(IdListQueryResult _enclosing, IIntComparator cmp) { this._enclosing = _enclosing; this.cmp = cmp; } public void Swap(int leftIndex, int rightIndex) { this._enclosing._ids.Swap(leftIndex, rightIndex); } public int Size() { return this._enclosing.Size(); } public int Compare(int leftIndex, int rightIndex) { return cmp.Compare(this._enclosing._ids.Get(leftIndex), this._enclosing._ids.Get( rightIndex)); } private readonly IdListQueryResult _enclosing; private readonly IIntComparator cmp; } public override void LoadFromClassIndex(ClassMetadata clazz) { IClassIndexStrategy index = clazz.Index(); if (index is BTreeClassIndexStrategy) { BTree btree = ((BTreeClassIndexStrategy)index).Btree(); _ids = new IntArrayList(btree.Size(Transaction())); } index.TraverseAll(_transaction, new _IVisitor4_107(this)); } private sealed class _IVisitor4_107 : IVisitor4 { public _IVisitor4_107(IdListQueryResult _enclosing) { this._enclosing = _enclosing; } public void Visit(object a_object) { this._enclosing.Add(((int)a_object)); } private readonly IdListQueryResult _enclosing; } public override void LoadFromQuery(QQuery query) { query.ExecuteLocal(this); } public override void LoadFromClassIndexes(ClassMetadataIterator iter) { // duplicates because of inheritance hierarchies ByRef duplicates = new ByRef(); while (iter.MoveNext()) { ClassMetadata classMetadata = iter.CurrentClass(); if (classMetadata.GetName() != null) { IReflectClass claxx = classMetadata.ClassReflector(); if (claxx == null || !(Stream()._handlers.IclassInternal.IsAssignableFrom(claxx))) { IClassIndexStrategy index = classMetadata.Index(); index.TraverseAll(_transaction, new _IVisitor4_130(this, duplicates)); } } } } private sealed class _IVisitor4_130 : IVisitor4 { public _IVisitor4_130(IdListQueryResult _enclosing, ByRef duplicates) { this._enclosing = _enclosing; this.duplicates = duplicates; } public void Visit(object obj) { int id = ((int)obj); TreeInt newNode = new TreeInt(id); duplicates.value = Tree.Add(((Tree)duplicates.value), newNode); if (newNode.Size() != 0) { this._enclosing.Add(id); } } private readonly IdListQueryResult _enclosing; private readonly ByRef duplicates; } public override void LoadFromIdReader(IEnumerator ids) { while (ids.MoveNext()) { Add(((int)ids.Current)); } } public virtual void Add(int id) { _ids.Add(id); } public override int IndexOf(int id) { return _ids.IndexOf(id); } public override int Size() { return _ids.Size(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Result/IdTreeQueryResult.cs0000644000175000017500000000162611700531646033203 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Result; namespace Db4objects.Db4o.Internal.Query.Result { /// public class IdTreeQueryResult : AbstractQueryResult { private Tree _ids; public IdTreeQueryResult(Transaction transaction, IIntIterator4 ids) : base(transaction ) { _ids = TreeInt.AddAll(null, ids); } public override IIntIterator4 IterateIDs() { return new IntIterator4Adaptor(new TreeKeyIterator(_ids)); } public override int Size() { if (_ids == null) { return 0; } return _ids.Size(); } public override AbstractQueryResult SupportSort() { return ToIdList(); } public override AbstractQueryResult SupportElementAccess() { return ToIdList(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Result/IQueryResult.cs0000644000175000017500000000107011700531646032210 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Query.Result { /// public interface IQueryResult : IEnumerable { object Get(int index); IIntIterator4 IterateIDs(); object Lock(); IExtObjectContainer ObjectContainer(); int IndexOf(int id); int Size(); void Sort(IQueryComparator cmp); void SortIds(IIntComparator cmp); } } AbstractLateQueryResult.cs0000644000175000017500000000562711700531646034326 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Result/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Classindex; using Db4objects.Db4o.Internal.Query.Result; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Query.Result { /// public abstract class AbstractLateQueryResult : AbstractQueryResult { protected IEnumerable _iterable; public AbstractLateQueryResult(Transaction transaction) : base(transaction) { } public override AbstractQueryResult SupportSize() { return ToIdTree(); } public override AbstractQueryResult SupportSort() { return ToIdList(); } public override AbstractQueryResult SupportElementAccess() { return ToIdList(); } protected override int KnownSize() { return 0; } public override IIntIterator4 IterateIDs() { if (_iterable == null) { throw new InvalidOperationException(); } return new IntIterator4Adaptor(_iterable); } public override AbstractQueryResult ToIdList() { return ToIdTree().ToIdList(); } public virtual bool SkipClass(ClassMetadata classMetadata) { if (classMetadata.GetName() == null) { return true; } IReflectClass claxx = classMetadata.ClassReflector(); if (Stream()._handlers.IclassInternal.IsAssignableFrom(claxx)) { return true; } return false; } protected virtual IEnumerable ClassIndexesIterable(ClassMetadataIterator classCollectionIterator ) { return Iterators.ConcatMap(Iterators.Iterable(classCollectionIterator), new _IFunction4_61 (this)); } private sealed class _IFunction4_61 : IFunction4 { public _IFunction4_61(AbstractLateQueryResult _enclosing) { this._enclosing = _enclosing; } public object Apply(object current) { ClassMetadata classMetadata = (ClassMetadata)current; if (this._enclosing.SkipClass(classMetadata)) { return Iterators.Skip; } return this._enclosing.ClassIndexIterable(classMetadata); } private readonly AbstractLateQueryResult _enclosing; } protected virtual IEnumerable ClassIndexIterable(ClassMetadata clazz) { return new _IEnumerable_73(this, clazz); } private sealed class _IEnumerable_73 : IEnumerable { public _IEnumerable_73(AbstractLateQueryResult _enclosing, ClassMetadata clazz) { this._enclosing = _enclosing; this.clazz = clazz; } public IEnumerator GetEnumerator() { return this._enclosing.ClassIndexIterator(clazz); } private readonly AbstractLateQueryResult _enclosing; private readonly ClassMetadata clazz; } public virtual IEnumerator ClassIndexIterator(ClassMetadata clazz) { return BTreeClassIndexStrategy.Iterate(clazz, Transaction()); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Result/HybridQueryResult.cs0000644000175000017500000000501211700531646033241 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Config; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Query.Result; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Query.Result { /// public class HybridQueryResult : AbstractQueryResult { private AbstractQueryResult _delegate; public HybridQueryResult(Transaction transaction, QueryEvaluationMode mode) : base (transaction) { _delegate = ForMode(transaction, mode); } private static AbstractQueryResult ForMode(Transaction transaction, QueryEvaluationMode mode) { if (mode == QueryEvaluationMode.Lazy) { return new LazyQueryResult(transaction); } if (mode == QueryEvaluationMode.Snapshot) { return new SnapShotQueryResult(transaction); } return new IdListQueryResult(transaction); } public override object Get(int index) { _delegate = _delegate.SupportElementAccess(); return _delegate.Get(index); } public override int GetId(int index) { _delegate = _delegate.SupportElementAccess(); return _delegate.GetId(index); } public override int IndexOf(int id) { _delegate = _delegate.SupportElementAccess(); return _delegate.IndexOf(id); } public override IIntIterator4 IterateIDs() { return _delegate.IterateIDs(); } public override IEnumerator GetEnumerator() { return _delegate.GetEnumerator(); } public override void LoadFromClassIndex(ClassMetadata clazz) { _delegate.LoadFromClassIndex(clazz); } public override void LoadFromClassIndexes(ClassMetadataIterator iterator) { _delegate.LoadFromClassIndexes(iterator); } public override void LoadFromIdReader(IEnumerator reader) { _delegate.LoadFromIdReader(reader); } public override void LoadFromQuery(QQuery query) { if (query.RequiresSort()) { _delegate = new IdListQueryResult(Transaction()); } _delegate.LoadFromQuery(query); } public override int Size() { _delegate = _delegate.SupportSize(); return _delegate.Size(); } public override void Sort(IQueryComparator cmp) { _delegate = _delegate.SupportSort(); _delegate.Sort(cmp); } public override void SortIds(IIntComparator cmp) { _delegate = _delegate.SupportSort(); _delegate.SortIds(cmp); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/Result/SnapShotQueryResult.cs0000644000175000017500000000325111700531646033562 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Query.Result; namespace Db4objects.Db4o.Internal.Query.Result { /// public class SnapShotQueryResult : AbstractLateQueryResult { public SnapShotQueryResult(Transaction transaction) : base(transaction) { } public override void LoadFromClassIndex(ClassMetadata clazz) { CreateSnapshot(ClassIndexIterable(clazz)); } public override void LoadFromClassIndexes(ClassMetadataIterator classCollectionIterator ) { CreateSnapshot(ClassIndexesIterable(classCollectionIterator)); } public override void LoadFromQuery(QQuery query) { IEnumerator _iterator = query.ExecuteSnapshot(); _iterable = new _IEnumerable_29(_iterator); } private sealed class _IEnumerable_29 : IEnumerable { public _IEnumerable_29(IEnumerator _iterator) { this._iterator = _iterator; } public IEnumerator GetEnumerator() { _iterator.Reset(); return _iterator; } private readonly IEnumerator _iterator; } private void CreateSnapshot(IEnumerable iterable) { Tree ids = TreeInt.AddAll(null, new IntIterator4Adaptor(iterable)); _iterable = new _IEnumerable_39(ids); } private sealed class _IEnumerable_39 : IEnumerable { public _IEnumerable_39(Tree ids) { this.ids = ids; } public IEnumerator GetEnumerator() { return new TreeKeyIterator(ids); } private readonly Tree ids; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/PredicateEvaluation.cs0000644000175000017500000000106611700531646032252 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Query { /// [System.Serializable] public class PredicateEvaluation : IEvaluation { public Predicate _predicate; public PredicateEvaluation() { } public PredicateEvaluation(Predicate predicate) { // CS _predicate = predicate; } public virtual void Evaluate(ICandidate candidate) { candidate.Include(_predicate.AppliesTo(candidate.GetObject())); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/IDb4oNQOptimizer.cs0000644000175000017500000000036411700531646031365 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Query { public interface IDb4oNQOptimizer { object Optimize(IQuery query, Predicate filter); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/NQOptimizationInfo.cs0000644000175000017500000000146511700531646032066 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Query { public class NQOptimizationInfo { private Db4objects.Db4o.Query.Predicate _predicate; private string _message; private object _optimized; public NQOptimizationInfo(Db4objects.Db4o.Query.Predicate predicate, string message , object optimized) { this._predicate = predicate; this._message = message; this._optimized = optimized; } public virtual string Message() { return _message; } public virtual object Optimized() { return _optimized; } public virtual Db4objects.Db4o.Query.Predicate Predicate() { return _predicate; } public override string ToString() { return Message() + "/" + Optimized(); } } } IDb4oQueryExecutionListener.cs0000644000175000017500000000041211700531646033556 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Query/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Query; namespace Db4objects.Db4o.Internal.Query { public interface IDb4oQueryExecutionListener { void NotifyQueryExecuted(NQOptimizationInfo info); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/FieldIndexException.cs0000644000175000017500000000262311700531646031107 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { [System.Serializable] public class FieldIndexException : Exception { private string _className; private string _fieldName; public FieldIndexException(FieldMetadata field) : this(null, null, field) { } public FieldIndexException(string msg, FieldMetadata field) : this(msg, null, field ) { } public FieldIndexException(Exception cause, FieldMetadata field) : this(null, cause , field) { } public FieldIndexException(string msg, Exception cause, FieldMetadata field) : this (msg, cause, field.ContainingClass().GetName(), field.GetName()) { } public FieldIndexException(string msg, Exception cause, string className, string fieldName) : base(EnhancedMessage(msg, className, fieldName), cause) { _className = className; _fieldName = fieldName; } public virtual string ClassName() { return _className; } public virtual string FieldName() { return _fieldName; } private static string EnhancedMessage(string msg, string className, string fieldName ) { string enhancedMessage = "Field index for " + className + "#" + fieldName; if (msg != null) { enhancedMessage += ": " + msg; } return enhancedMessage; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Const4.cs0000644000175000017500000001443411700531646026372 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Types; namespace Db4objects.Db4o.Internal { /// TODO: Split into separate enums with defined range and values. public sealed partial class Const4 { public const byte Yapfileversion = 4; public const byte Yapbegin = (byte)'{'; public const byte Yapfile = (byte)'Y'; public const byte Yapid = (byte)'#'; public const byte Yappointer = (byte)'>'; public const byte Yapclasscollection = (byte)'A'; public const byte Yapclass = (byte)'C'; public const byte Yapfield = (byte)'F'; public const byte Yapobject = (byte)'O'; public const byte Yaparray = (byte)'N'; public const byte Yaparrayn = (byte)'Z'; public const byte Yapindex = (byte)'X'; public const byte Yapstring = (byte)'S'; public const byte Yaplong = (byte)'l'; public const byte Yapinteger = (byte)'i'; public const byte Yapboolean = (byte)'='; public const byte Yapdouble = (byte)'d'; public const byte Yapbyte = (byte)'b'; public const byte Yapshort = (byte)'s'; public const byte Yapchar = (byte)'c'; public const byte Yapfloat = (byte)'f'; public const byte Yapend = (byte)'}'; public const byte Yapnull = (byte)'0'; public const byte Btree = (byte)'T'; public const byte BtreeNode = (byte)'B'; public const byte Header = (byte)'H'; public const byte IntegerArray = (byte)'I'; public const byte BtreeList = (byte)'L'; public const int IdentifierLength = (Deploy.debug && Deploy.identifiers) ? 1 : 0; public const int BracketsBytes = (Deploy.debug && Deploy.brackets) ? 1 : 0; public const int BracketsLength = BracketsBytes * 2; public const int LeadingLength = IdentifierLength + BracketsBytes; public const int AddedLength = IdentifierLength + BracketsLength; public const int ShortBytes = 2; public const int IntegerBytes = (Deploy.debug && Deploy.debugLong) ? 11 : 4; public const int LongBytes = (Deploy.debug && Deploy.debugLong) ? 20 : 8; public const int CharBytes = 2; public const int Unspecified = int.MinValue + 100; public const int IntLength = IntegerBytes + AddedLength; public const int IdLength = IntLength; public const int LongLength = LongBytes + AddedLength; public const int IndirectionLength = IntLength + IdLength; public const int WriteLoop = (IntegerBytes - 1) * 8; public const int ObjectLength = AddedLength; public const int PointerLength = (IntLength * 2) + AddedLength; public const int MessageLength = IntLength * 2 + 1; public const byte SystemTrans = (byte)'s'; public const byte UserTrans = (byte)'u'; public const byte Xbyte = (byte)'X'; public const int IgnoreId = -99999; public const int Primitive = -2000000000; public const int TypeArray = 3; public const int TypeNarray = 4; public const int None = 0; public const int State = 1; public const int Activation = 2; public const int Transient = -1; public const int AddMembersToIdTreeOnly = 0; public const int AddToIdTree = 1; public const int LockTimeInterval = 1000; public const int ServerSocketTimeout = Debug4.longTimeOuts ? 1000000 : 600000; public const int ClientSocketTimeout = ServerSocketTimeout; public const int MaximumBlockSize = 70000000; public const int MaximumArrayEntries = 7000000; public const int MaximumArrayEntriesPrimitive = MaximumArrayEntries * 100; public static readonly Type ClassCompare = typeof(ICompare); public static readonly Type ClassDb4otype = typeof(IDb4oType); public static readonly Type ClassDb4otypeimpl = typeof(IDb4oTypeImpl); public static readonly Type ClassInternal = typeof(IInternal4); public static readonly Type ClassUnversioned = typeof(IUnversioned); public static readonly Type ClassObject = new object().GetType(); public static readonly Type ClassObjectcontainer = typeof(IObjectContainer); public static readonly Type ClassStaticfield = new StaticField().GetType(); public static readonly Type ClassStaticclass = new StaticClass().GetType(); public static readonly Type ClassTransientclass = typeof(ITransientClass); public static readonly string EmbeddedClientUser = "embedded client"; public const int Clean = 0; public const int Active = 1; public const int Processing = 2; public const int CachedDirty = 3; public const int Continue = 4; public const int StaticFieldsStored = 5; public const int CheckedChanges = 6; public const int Dead = 7; public const int Reading = 8; public const int Activating = 9; public const int Old = -1; public const int New = 1; public static readonly UnicodeStringIO stringIO = new UnicodeStringIO(); public static readonly Type[] EssentialClasses = new Type[] { ClassStaticfield, ClassStaticclass }; public static readonly string VirtualFieldPrefix = "v4o"; public const int InvalidObjectId = 1; public const int DefaultMaxStackDepth = 20; // make sure we don't fall over the -1 cliff // TODO: Is this the right place for the knowledge, that an indirection // within a slot is an address and a length? // debug constants // TODO: This one is a terrible low-frequency blunder in YapArray.writeClass!!! // If YapClass-ID == 99999 (not very likely) then we will get IGNORE_ID. Change // to -Integer.MAX_VALUE or protect 99999 in YapFile.getPointerSlot() // This is a hard coded 2 Gig-Limit for YapClass-IDs. // TODO: get rid of magic numbers like this one // array type information // message levels // Use if > NONE: normal messages // if > STATE: state messages // if > ACTIVATION: activation messages // Timings // 10 minutes until clients are disconnected, (5 minutes until they get pinged) // TODO: Consider to make configurable // 70 MB // 7 Million // 70 MB for byte arrays // bits in PersistentBase.i_state // and reuse in other classes // system classes that need to get loaded first // StaticClass should load Staticfield // TODO: remove unnecessary } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Delete/0000755000175000017500000000000011700531646026065 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Delete/IDeleteContext.cs0000644000175000017500000000115711700531646031300 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Delete { /// public interface IDeleteContext : IContext, IReadBuffer, IHandlerVersionContext { bool CascadeDelete(); int CascadeDeleteDepth(); void Delete(ITypeHandler4 handler); void DeleteObject(); bool IsLegacyHandlerVersion(); void DefragmentRecommended(); Slot ReadSlot(); int ObjectId(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Delete/DeleteContextImpl.cs0000644000175000017500000000607411700531646032014 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Diagnostic; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Diagnostic; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Delete { /// public class DeleteContextImpl : ObjectHeaderContext, IDeleteContext, IObjectIdContext { private readonly IReflectClass _fieldClass; private readonly Config4Field _fieldConfig; public DeleteContextImpl(Db4objects.Db4o.Internal.StatefulBuffer buffer, ObjectHeader objectHeader, IReflectClass fieldClass, Config4Field fieldConfig) : base(buffer .Transaction(), buffer, objectHeader) { _fieldClass = fieldClass; _fieldConfig = fieldConfig; } public DeleteContextImpl(Db4objects.Db4o.Internal.Delete.DeleteContextImpl parentContext , IReflectClass fieldClass, Config4Field fieldConfig) : this(parentContext.StatefulBuffer (), parentContext._objectHeader, fieldClass, fieldConfig) { } public virtual void CascadeDeleteDepth(int depth) { StatefulBuffer().SetCascadeDeletes(depth); } private Db4objects.Db4o.Internal.StatefulBuffer StatefulBuffer() { return ((Db4objects.Db4o.Internal.StatefulBuffer)Buffer()); } public virtual int CascadeDeleteDepth() { return StatefulBuffer().CascadeDeletes(); } public virtual bool CascadeDelete() { return CascadeDeleteDepth() > 0; } public virtual void DefragmentRecommended() { DiagnosticProcessor dp = Container()._handlers.DiagnosticProcessor(); if (dp.Enabled()) { dp.DefragmentRecommended(DefragmentRecommendation.DefragmentRecommendationReason. DeleteEmbeded); } } public virtual Slot ReadSlot() { return new Slot(Buffer().ReadInt(), Buffer().ReadInt()); } public virtual void Delete(ITypeHandler4 handler) { ITypeHandler4 correctHandlerVersion = HandlerRegistry.CorrectHandlerVersion(this, handler); int preservedCascadeDepth = CascadeDeleteDepth(); CascadeDeleteDepth(AdjustedDepth()); if (Handlers4.HandleAsObject(correctHandlerVersion)) { DeleteObject(); } else { correctHandlerVersion.Delete(this); } CascadeDeleteDepth(preservedCascadeDepth); } public virtual void DeleteObject() { int id = Buffer().ReadInt(); if (CascadeDelete()) { Container().DeleteByID(Transaction(), id, CascadeDeleteDepth()); } } private int AdjustedDepth() { if (Platform4.IsStruct(_fieldClass)) { return 1; } if (_fieldConfig == null) { return CascadeDeleteDepth(); } if (_fieldConfig.CascadeOnDelete().DefiniteYes()) { return 1; } if (_fieldConfig.CascadeOnDelete().DefiniteNo()) { return 0; } return CascadeDeleteDepth(); } public virtual int ObjectId() { return StatefulBuffer().GetID(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IDHandler.cs0000644000175000017500000000067311700531646027012 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; namespace Db4objects.Db4o.Internal { /// public class IDHandler : IntHandler { public override void DefragIndexEntry(DefragmentContextImpl context) { int sourceId = context.CopyIDReturnOriginalID(true); context.CurrentParentSourceID(sourceId); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fileheader/0000755000175000017500000000000011700531646026713 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fileheader/TimerFileLockDisabled.cs0000644000175000017500000000207411700531646033366 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Fileheader; namespace Db4objects.Db4o.Internal.Fileheader { /// public class TimerFileLockDisabled : TimerFileLock { public override void CheckHeaderLock() { } public override void CheckOpenTime() { } public override void Close() { } public override bool LockFile() { return false; } public override long OpenTime() { return 0; } public override void Run() { } public override void SetAddresses(int baseAddress, int openTimeOffset, int accessTimeOffset ) { } public override void Start() { } public override void WriteHeaderLock() { } public override void WriteOpenTime() { } /// public override void CheckIfOtherSessionAlive(LocalObjectContainer container, int address, int offset, long lastAccessTime) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fileheader/FileHeader2.cs0000644000175000017500000000751511700531646031324 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Fileheader; using Sharpen; namespace Db4objects.Db4o.Internal.Fileheader { /// public class FileHeader2 : NewFileHeaderBase { private static readonly int BlocksizeOffset = AccessTimeOffset + Const4.LongLength; public static readonly int HeaderLength = BlocksizeOffset + (Const4.IntLength * 5 ) + 1; private int _transactionPointerAddress = 0; // The header format is: // (byte) 'd' // (byte) 'b' // (byte) '4' // (byte) 'o' // (byte) headerVersion // (int) headerLock // (long) openTime // (long) accessTime // (int) blockSize // (int) classCollectionID // (byte) idSystemType // (int) variable part address // (int) variable part length // (int) transaction pointer address public override int Length() { return HeaderLength; } protected override void Read(LocalObjectContainer container, ByteArrayBuffer reader ) { NewTimerFileLock(container); OldEncryptionOff(container); CheckThreadFileLock(container, reader); reader.Seek(BlocksizeOffset); container.BlockSizeReadFromFile(reader.ReadInt()); SystemData systemData = container.SystemData(); systemData.ClassCollectionID(reader.ReadInt()); container.SystemData().IdSystemType(reader.ReadByte()); _variablePart = CreateVariablePart(container); int variablePartAddress = reader.ReadInt(); int variablePartLength = reader.ReadInt(); _variablePart.Read(variablePartAddress, variablePartLength); _transactionPointerAddress = reader.ReadInt(); if (_transactionPointerAddress != 0) { ByteArrayBuffer buffer = new ByteArrayBuffer(TransactionPointerLength); buffer.Read(container, _transactionPointerAddress, 0); systemData.TransactionPointer1(buffer.ReadInt()); systemData.TransactionPointer2(buffer.ReadInt()); } } public override void WriteFixedPart(LocalObjectContainer file, bool startFileLockingThread , bool shuttingDown, StatefulBuffer writer, int blockSize) { SystemData systemData = file.SystemData(); writer.Append(Signature); writer.WriteByte(Version()); writer.WriteInt((int)TimeToWrite(_timerFileLock.OpenTime(), shuttingDown)); writer.WriteLong(TimeToWrite(_timerFileLock.OpenTime(), shuttingDown)); writer.WriteLong(TimeToWrite(Runtime.CurrentTimeMillis(), shuttingDown)); writer.WriteInt(blockSize); writer.WriteInt(systemData.ClassCollectionID()); writer.WriteByte(systemData.IdSystemType()); writer.WriteInt(((FileHeaderVariablePart2)_variablePart).Address()); writer.WriteInt(((FileHeaderVariablePart2)_variablePart).Length()); writer.WriteInt(_transactionPointerAddress); writer.Write(); if (shuttingDown) { WriteVariablePart(file, true); } else { file.SyncFiles(); } if (startFileLockingThread) { file.ThreadPool().Start("db4o lock thread", _timerFileLock); } } public override void WriteTransactionPointer(Transaction systemTransaction, int transactionPointer ) { if (_transactionPointerAddress == 0) { LocalObjectContainer file = ((LocalTransaction)systemTransaction).LocalContainer( ); _transactionPointerAddress = file.AllocateSafeSlot(TransactionPointerLength).Address (); file.WriteHeader(false, false); } WriteTransactionPointer(systemTransaction, transactionPointer, _transactionPointerAddress , 0); } protected override byte Version() { return (byte)2; } protected override NewFileHeaderBase CreateNew() { return new FileHeader2(); } public override FileHeaderVariablePart CreateVariablePart(LocalObjectContainer file ) { return new FileHeaderVariablePart2(file); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fileheader/FileHeader3.cs0000644000175000017500000000125111700531646031314 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Fileheader; namespace Db4objects.Db4o.Internal.Fileheader { /// public class FileHeader3 : FileHeader2 { public override FileHeaderVariablePart CreateVariablePart(LocalObjectContainer file ) { return new FileHeaderVariablePart3(file); } protected override byte Version() { return (byte)3; } protected override NewFileHeaderBase CreateNew() { return new FileHeader3(); } public override FileHeader Convert(LocalObjectContainer file) { return this; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fileheader/TimerFileLock.cs0000644000175000017500000000232511700531646031735 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Fileheader; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Fileheader { /// public abstract class TimerFileLock : IRunnable { public static TimerFileLock ForFile(LocalObjectContainer file) { return new TimerFileLockDisabled(); } public abstract void CheckHeaderLock(); public abstract void CheckOpenTime(); public abstract bool LockFile(); public abstract long OpenTime(); public abstract void SetAddresses(int baseAddress, int openTimeOffset, int accessTimeOffset ); /// public abstract void Start(); public abstract void WriteHeaderLock(); public abstract void WriteOpenTime(); /// public abstract void Close(); /// public abstract void CheckIfOtherSessionAlive(LocalObjectContainer container, int address, int offset, long lastAccessTime); public abstract void Run(); } } FileHeaderVariablePart3.cs0000644000175000017500000000210711700531646033533 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fileheader/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Fileheader; namespace Db4objects.Db4o.Internal.Fileheader { /// public class FileHeaderVariablePart3 : FileHeaderVariablePart2 { public FileHeaderVariablePart3(LocalObjectContainer container) : base(container) { } public override int OwnLength() { return base.OwnLength() + Const4.IntLength * 2; } protected override void ReadBuffer(ByteArrayBuffer buffer, bool versionsAreConsistent ) { base.ReadBuffer(buffer, versionsAreConsistent); SystemData systemData = SystemData(); systemData.IdToTimestampIndexId(buffer.ReadInt()); systemData.TimestampToIdIndexId(buffer.ReadInt()); } protected override void WriteBuffer(ByteArrayBuffer buffer, bool shuttingDown) { base.WriteBuffer(buffer, shuttingDown); SystemData systemData = SystemData(); buffer.WriteInt(systemData.IdToTimestampIndexId()); buffer.WriteInt(systemData.TimestampToIdIndexId()); } } } FileHeaderVariablePart2.cs0000644000175000017500000001761211700531646033541 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fileheader/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Fileheader; using Db4objects.Db4o.Internal.Slots; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Fileheader { /// public class FileHeaderVariablePart2 : FileHeaderVariablePart { private const int ChecksumLength = Const4.LongLength; private const int SingleLength = ChecksumLength + (Const4.IntLength * 8) + Const4 .LongLength + 1 + Const4.AddedLength; private int _address; private int _length; public FileHeaderVariablePart2(LocalObjectContainer container, int address, int length ) : base(container) { // The variable part format is: // (long) checksum // (int) address of InMemoryIdSystem slot // (int) length of InMemoryIdSystem slot // (int) address of InMemoryFreespace // (int) length of InMemoryFreespace // (int) BTreeFreespace id // (int) converter version // (int) uuid index ID // (int) identity ID // (long) versionGenerator // (byte) freespace system used _address = address; _length = length; } public FileHeaderVariablePart2(LocalObjectContainer container) : this(container, 0, 0) { } public override IRunnable Commit(bool shuttingDown) { int length = OwnLength(); if (_address == 0 || _length < length) { Slot slot = AllocateSlot(MarshalledLength(length)); _address = slot.Address(); _length = length; } ByteArrayBuffer buffer = new ByteArrayBuffer(length); Marshall(buffer, shuttingDown); WriteToFile(0, buffer); return new _IRunnable_65(this, length, buffer); } private sealed class _IRunnable_65 : IRunnable { public _IRunnable_65(FileHeaderVariablePart2 _enclosing, int length, ByteArrayBuffer buffer) { this._enclosing = _enclosing; this.length = length; this.buffer = buffer; } public void Run() { this._enclosing.WriteToFile(length * 2, buffer); } private readonly FileHeaderVariablePart2 _enclosing; private readonly int length; private readonly ByteArrayBuffer buffer; } private int MarshalledLength(int length) { return length * 4; } private void WriteToFile(int startAdress, ByteArrayBuffer buffer) { _container.WriteEncrypt(buffer, _address, startAdress); _container.WriteEncrypt(buffer, _address, startAdress + _length); } public virtual int OwnLength() { return SingleLength; } public virtual int Address() { return _address; } public virtual int Length() { return _length; } public override void Read(int address, int length) { _address = address; _length = length; ByteArrayBuffer buffer = _container.ReadBufferBySlot(new Slot(address, MarshalledLength (length))); bool versionsAreConsistent = VersionsAreConsistentAndSeek(buffer); // TODO: Diagnostic message if versions aren't consistent. ReadBuffer(buffer, versionsAreConsistent); } protected virtual void ReadBuffer(ByteArrayBuffer buffer, bool versionsAreConsistent ) { buffer.IncrementOffset(ChecksumLength); SystemData systemData = SystemData(); systemData.IdSystemSlot(ReadSlot(buffer, false)); systemData.InMemoryFreespaceSlot(ReadSlot(buffer, !versionsAreConsistent)); systemData.BTreeFreespaceId(buffer.ReadInt()); systemData.ConverterVersion(buffer.ReadInt()); systemData.UuidIndexId(buffer.ReadInt()); systemData.IdentityId(buffer.ReadInt()); systemData.LastTimeStampID(buffer.ReadLong()); systemData.FreespaceSystem(buffer.ReadByte()); } private Slot ReadSlot(ByteArrayBuffer buffer, bool readZero) { Slot slot = new Slot(buffer.ReadInt(), buffer.ReadInt()); if (readZero) { return Slot.Zero; } return slot; } private void Marshall(ByteArrayBuffer buffer, bool shuttingDown) { int checkSumOffset = buffer.Offset(); buffer.IncrementOffset(ChecksumLength); int checkSumBeginOffset = buffer.Offset(); WriteBuffer(buffer, shuttingDown); int checkSumEndOffSet = buffer.Offset(); byte[] bytes = buffer._buffer; int length = checkSumEndOffSet - checkSumBeginOffset; long checkSum = CRC32.CheckSum(bytes, checkSumBeginOffset, length); buffer.Seek(checkSumOffset); buffer.WriteLong(checkSum); buffer.Seek(checkSumEndOffSet); } protected virtual void WriteBuffer(ByteArrayBuffer buffer, bool shuttingDown) { SystemData systemData = SystemData(); WriteSlot(buffer, systemData.IdSystemSlot(), false); WriteSlot(buffer, systemData.InMemoryFreespaceSlot(), !shuttingDown); buffer.WriteInt(systemData.BTreeFreespaceId()); buffer.WriteInt(systemData.ConverterVersion()); buffer.WriteInt(systemData.UuidIndexId()); Db4oDatabase identity = systemData.Identity(); buffer.WriteInt(identity == null ? 0 : identity.GetID(_container.SystemTransaction ())); buffer.WriteLong(systemData.LastTimeStampID()); buffer.WriteByte(systemData.FreespaceSystem()); } private void WriteSlot(ByteArrayBuffer buffer, Slot slot, bool writeZero) { if (writeZero || slot == null) { buffer.WriteInt(0); buffer.WriteInt(0); return; } buffer.WriteInt(slot.Address()); buffer.WriteInt(slot.Length()); } private bool CheckSumOK(ByteArrayBuffer buffer, int offset) { int initialOffSet = buffer.Offset(); int length = OwnLength(); length -= ChecksumLength; buffer.Seek(offset); long readCheckSum = buffer.ReadLong(); int checkSumBeginOffset = buffer.Offset(); byte[] bytes = buffer._buffer; long calculatedCheckSum = CRC32.CheckSum(bytes, checkSumBeginOffset, length); buffer.Seek(initialOffSet); return calculatedCheckSum == readCheckSum; } private bool VersionsAreConsistentAndSeek(ByteArrayBuffer buffer) { byte[] bytes = buffer._buffer; int length = OwnLength(); int[] offsets = Offsets(); bool different = false; for (int i = 0; i < length; i++) { byte b = bytes[offsets[0] + i]; for (int j = 1; j < 4; j++) { if (b != bytes[offsets[j] + i]) { different = true; break; } } } if (!different) { // The following line cements our checksum algorithm in stone. // Things should be safe enough if we remove the throw. // If all four versions of the header are the same, // it's bound to be OK. (unless all bytes are zero or // greyed out by some kind of overwriting algorithm.) int firstOffset = 0; if (!CheckSumOK(buffer, firstOffset)) { throw new Db4oFileHeaderCorruptionException(); } return true; } bool firstPairDiffers = false; bool secondPairDiffers = false; for (int i = 0; i < length; i++) { if (bytes[offsets[0] + i] != bytes[offsets[1] + i]) { firstPairDiffers = true; } if (bytes[offsets[2] + i] != bytes[offsets[3] + i]) { secondPairDiffers = true; } } if (!secondPairDiffers) { if (CheckSumOK(buffer, offsets[2])) { buffer.Seek(offsets[2]); return false; } } if (firstPairDiffers) { // Should never ever happen, we are toast. // We could still try to use any random version of // the header but which one? // Maybe the first of the second pair could be an // option for a recovery tool, or it could try all // versions. throw new Db4oFileHeaderCorruptionException(); } if (!CheckSumOK(buffer, 0)) { throw new Db4oFileHeaderCorruptionException(); } return false; } private int[] Offsets() { return new int[] { 0, OwnLength(), OwnLength() * 2, OwnLength() * 3 }; } public override int MarshalledLength() { return MarshalledLength(OwnLength()); } } } FileHeaderVariablePart1.cs0000644000175000017500000000373411700531646033540 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fileheader/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Fileheader; using Db4objects.Db4o.Internal.Slots; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Fileheader { /// public class FileHeaderVariablePart1 : FileHeaderVariablePart { private const int Length = 1 + (Const4.IntLength * 4) + Const4.LongLength + Const4 .AddedLength; private int _id; public FileHeaderVariablePart1(LocalObjectContainer container, int id) : base(container ) { // The variable part format is: // (int) converter version // (byte) freespace system used // (int) freespace address // (int) identity ID // (long) versionGenerator // (int) uuid index ID _id = id; } public FileHeaderVariablePart1(LocalObjectContainer container) : this(container, 0) { } public virtual int OwnLength() { return Length; } public virtual void ReadThis(ByteArrayBuffer buffer) { SystemData().ConverterVersion(buffer.ReadInt()); SystemData().FreespaceSystem(buffer.ReadByte()); buffer.ReadInt(); // was BTreeFreespaceId, converted to slot, can no longer be used SystemData().IdentityId(buffer.ReadInt()); SystemData().LastTimeStampID(buffer.ReadLong()); SystemData().UuidIndexId(buffer.ReadInt()); } public virtual void WriteThis(ByteArrayBuffer buffer) { throw new InvalidOperationException(); } public override IRunnable Commit(bool shuttingDown) { throw new InvalidOperationException(); } public virtual int Id() { return _id; } public override void Read(int variablePartID, int unused) { _id = variablePartID; Slot slot = _container.ReadPointerSlot(_id); ByteArrayBuffer buffer = _container.ReadBufferBySlot(slot); ReadThis(buffer); } public override int MarshalledLength() { return OwnLength(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fileheader/FileHeader.cs0000644000175000017500000001060311700531646031232 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Fileheader; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Fileheader { /// public abstract class FileHeader { public const int TransactionPointerLength = Const4.IntLength * 2; private static readonly FileHeader[] AvailableFileHeaders = new FileHeader[] { new FileHeader1(), new FileHeader2(), new FileHeader3() }; public static NewFileHeaderBase NewCurrentFileHeader() { return new FileHeader3(); } private static int ReaderLength() { int length = AvailableFileHeaders[0].Length(); for (int i = 1; i < AvailableFileHeaders.Length; i++) { length = Math.Max(length, AvailableFileHeaders[i].Length()); } return length; } /// public static FileHeader Read(LocalObjectContainer file) { ByteArrayBuffer reader = PrepareFileHeaderReader(file); FileHeader header = DetectFileHeader(file, reader); if (header == null) { Exceptions4.ThrowRuntimeException(Db4objects.Db4o.Internal.Messages.IncompatibleFormat , file.ToString()); } else { header.Read(file, reader); } return header; } public virtual FileHeader Convert(LocalObjectContainer file) { FileHeader3 fileHeader = new FileHeader3(); fileHeader.InitNew(file); return fileHeader; } private static ByteArrayBuffer PrepareFileHeaderReader(LocalObjectContainer file) { ByteArrayBuffer reader = new ByteArrayBuffer(ReaderLength()); reader.Read(file, 0, 0); return reader; } private static FileHeader DetectFileHeader(LocalObjectContainer file, ByteArrayBuffer reader) { for (int i = 0; i < AvailableFileHeaders.Length; i++) { reader.Seek(0); FileHeader result = AvailableFileHeaders[i].NewOnSignatureMatch(file, reader); if (result != null) { return result; } } return null; } /// public abstract void Close(); /// public abstract void InitNew(LocalObjectContainer file); public abstract void CompleteInterruptedTransaction(LocalObjectContainer container ); public abstract int Length(); protected abstract FileHeader NewOnSignatureMatch(LocalObjectContainer file, ByteArrayBuffer reader); protected virtual long TimeToWrite(long time, bool shuttingDown) { return shuttingDown ? 0 : time; } protected abstract void Read(LocalObjectContainer file, ByteArrayBuffer reader); protected virtual bool SignatureMatches(ByteArrayBuffer reader, byte[] signature, byte version) { for (int i = 0; i < signature.Length; i++) { if (reader.ReadByte() != signature[i]) { return false; } } return reader.ReadByte() == version; } // TODO: freespaceID should not be passed here, it should be taken from SystemData public abstract void WriteFixedPart(LocalObjectContainer file, bool startFileLockingThread , bool shuttingDown, StatefulBuffer writer, int blockSize); public abstract void WriteTransactionPointer(Transaction systemTransaction, int transactionPointer ); protected virtual void WriteTransactionPointer(Transaction systemTransaction, int transactionPointer, int address, int offset) { StatefulBuffer bytes = new StatefulBuffer(systemTransaction, address, TransactionPointerLength ); bytes.MoveForward(offset); bytes.WriteInt(transactionPointer); bytes.WriteInt(transactionPointer); // Dangerous write. // On corruption transaction pointers will not be the same and nothing will happen. bytes.Write(); } public virtual void WriteVariablePart(LocalObjectContainer file) { WriteVariablePart(file, false); } public abstract void WriteVariablePart(LocalObjectContainer file, bool shuttingDown ); public static bool LockedByOtherSession(LocalObjectContainer container, long lastAccessTime ) { return container.NeedsLockFileThread() && (lastAccessTime != 0); } public abstract void ReadIdentity(LocalObjectContainer container); public abstract IRunnable Commit(bool shuttingDown); } } FileHeaderVariablePart.cs0000644000175000017500000000341011700531646033446 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fileheader/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Slots; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Fileheader { /// public abstract class FileHeaderVariablePart { protected readonly LocalObjectContainer _container; public abstract IRunnable Commit(bool shuttingDown); public abstract void Read(int variablePartAddress, int variablePartLength); protected FileHeaderVariablePart(LocalObjectContainer container) { _container = container; } public byte GetIdentifier() { return Const4.Header; } protected Db4objects.Db4o.Internal.SystemData SystemData() { return _container.SystemData(); } protected Slot AllocateSlot(int length) { Slot reusedSlot = _container.FreespaceManager().AllocateSafeSlot(length); if (reusedSlot != null) { return reusedSlot; } return _container.AppendBytes(length); } public virtual void ReadIdentity(LocalTransaction trans) { LocalObjectContainer file = trans.LocalContainer(); Db4oDatabase identity = Debug4.staticIdentity ? Db4oDatabase.StaticIdentity : (Db4oDatabase )file.GetByID(trans, SystemData().IdentityId()); if (null != identity) { file.Activate(trans, identity, new FixedActivationDepth(2)); SystemData().Identity(identity); } } // TODO: What now? // Apparently we get this state after defragment // and defragment then sets the identity. // If we blindly generate a new identity here, // ObjectUpdateFileSizeTestCase reports trouble. public abstract int MarshalledLength(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fileheader/FileHeader1.cs0000644000175000017500000000464311700531646031322 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Fileheader; namespace Db4objects.Db4o.Internal.Fileheader { /// public class FileHeader1 : NewFileHeaderBase { private static readonly int TransactionPointerOffset = AccessTimeOffset + Const4. LongLength; private static readonly int BlocksizeOffset = TransactionPointerOffset + (Const4. IntLength * 2); public static readonly int HeaderLength = TransactionPointerOffset + (Const4.IntLength * 6); // The header format is: // (byte) 'd' // (byte) 'b' // (byte) '4' // (byte) 'o' // (byte) headerVersion // (int) headerLock // (long) openTime // (long) accessTime // (int) Transaction pointer 1 // (int) Transaction pointer 2 // (int) blockSize // (int) classCollectionID // (int) freespaceID // (int) variablePartID public override int Length() { return HeaderLength; } protected override void Read(LocalObjectContainer file, ByteArrayBuffer reader) { NewTimerFileLock(file); OldEncryptionOff(file); CheckThreadFileLock(file, reader); reader.Seek(TransactionPointerOffset); file.SystemData().TransactionPointer1(reader.ReadInt()); file.SystemData().TransactionPointer2(reader.ReadInt()); reader.Seek(BlocksizeOffset); file.BlockSizeReadFromFile(reader.ReadInt()); SystemData systemData = file.SystemData(); systemData.ClassCollectionID(reader.ReadInt()); reader.ReadInt(); // was freespace ID, can no longer be read _variablePart = CreateVariablePart(file); int variablePartId = reader.ReadInt(); _variablePart.Read(variablePartId, 0); } public override void WriteFixedPart(LocalObjectContainer file, bool startFileLockingThread , bool shuttingDown, StatefulBuffer writer, int blockSize) { throw new InvalidOperationException(); } public override void WriteTransactionPointer(Transaction systemTransaction, int transactionPointer ) { throw new InvalidOperationException(); } protected override NewFileHeaderBase CreateNew() { return new FileHeader1(); } protected override byte Version() { return (byte)1; } public override FileHeaderVariablePart CreateVariablePart(LocalObjectContainer file ) { return new FileHeaderVariablePart1(file); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fileheader/NewFileHeaderBase.cs0000644000175000017500000000634711700531646032511 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Fileheader; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Fileheader { /// public abstract class NewFileHeaderBase : FileHeader { protected static readonly byte[] Signature = new byte[] { (byte)'d', (byte)'b', ( byte)'4', (byte)'o' }; protected static readonly int HeaderLockOffset = Signature.Length + 1; protected static readonly int OpenTimeOffset = HeaderLockOffset + Const4.IntLength; protected static readonly int AccessTimeOffset = OpenTimeOffset + Const4.LongLength; protected TimerFileLock _timerFileLock; protected FileHeaderVariablePart _variablePart; /// public override void Close() { if (_timerFileLock == null) { return; } _timerFileLock.Close(); } protected virtual void NewTimerFileLock(LocalObjectContainer file) { _timerFileLock = TimerFileLock.ForFile(file); _timerFileLock.SetAddresses(0, OpenTimeOffset, AccessTimeOffset); } protected abstract NewFileHeaderBase CreateNew(); protected abstract byte Version(); /// public sealed override void InitNew(LocalObjectContainer file) { NewTimerFileLock(file); OldEncryptionOff(file); _variablePart = CreateVariablePart(file); WriteVariablePart(file); } public abstract FileHeaderVariablePart CreateVariablePart(LocalObjectContainer file ); protected virtual void OldEncryptionOff(LocalObjectContainer file) { file._handlers.OldEncryptionOff(); } public sealed override void WriteVariablePart(LocalObjectContainer file, bool shuttingDown ) { if (!IsInitalized()) { return; } IRunnable commitHook = Commit(shuttingDown); file.SyncFiles(); commitHook.Run(); file.SyncFiles(); } private bool IsInitalized() { return _variablePart != null; } protected override FileHeader NewOnSignatureMatch(LocalObjectContainer file, ByteArrayBuffer reader) { if (SignatureMatches(reader, Signature, Version())) { return CreateNew(); } return null; } public override void CompleteInterruptedTransaction(LocalObjectContainer container ) { SystemData systemData = container.SystemData(); container.IdSystem().CompleteInterruptedTransaction(systemData.TransactionPointer1 (), systemData.TransactionPointer2()); } protected virtual void CheckThreadFileLock(LocalObjectContainer container, ByteArrayBuffer reader) { reader.Seek(AccessTimeOffset); long lastAccessTime = reader.ReadLong(); if (FileHeader.LockedByOtherSession(container, lastAccessTime)) { _timerFileLock.CheckIfOtherSessionAlive(container, 0, AccessTimeOffset, lastAccessTime ); } } public override void ReadIdentity(LocalObjectContainer container) { _variablePart.ReadIdentity((LocalTransaction)container.SystemTransaction()); } public override IRunnable Commit(bool shuttingDown) { return _variablePart.Commit(shuttingDown); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IDefragmentContext.cs0000644000175000017500000000266211700531646030752 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { public interface IDefragmentContext : IBufferContext, IMarshallingInfo, IHandlerVersionContext { ITypeHandler4 TypeHandlerForId(int id); int CopyID(); int CopyIDReturnOriginalID(); int CopySlotlessID(); int CopyUnindexedID(); void Defragment(ITypeHandler4 handler); int HandlerVersion(); void IncrementOffset(int length); bool IsLegacyHandlerVersion(); int MappedID(int origID); ByteArrayBuffer SourceBuffer(); ByteArrayBuffer TargetBuffer(); Slot AllocateTargetSlot(int length); Slot AllocateMappedTargetSlot(int sourceAddress, int length); /// int CopySlotToNewMapped(int sourceAddress, int length); /// ByteArrayBuffer SourceBufferByAddress(int sourceAddress, int length); /// ByteArrayBuffer SourceBufferById(int sourceId); void TargetWriteBytes(int address, ByteArrayBuffer buffer); IDefragmentServices Services(); ObjectContainerBase Container(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ReflectorConfigurationImpl.cs0000644000175000017500000000252311700531646032513 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal { public class ReflectorConfigurationImpl : IReflectorConfiguration { private Config4Impl _config; public ReflectorConfigurationImpl(Config4Impl config) { _config = config; } public virtual bool TestConstructors() { return _config.TestConstructors(); } public virtual bool CallConstructor(IReflectClass clazz) { TernaryBool specialized = CallConstructorSpecialized(clazz); if (!specialized.IsUnspecified()) { return specialized.DefiniteYes(); } return _config.CallConstructors().DefiniteYes(); } private TernaryBool CallConstructorSpecialized(IReflectClass clazz) { Config4Class clazzConfig = _config.ConfigClass(clazz.GetName()); if (clazzConfig != null) { TernaryBool res = clazzConfig.CallConstructor(); if (!res.IsUnspecified()) { return res; } } if (Platform4.IsEnum(_config.Reflector(), clazz)) { return TernaryBool.No; } IReflectClass ancestor = clazz.GetSuperclass(); if (ancestor != null) { return CallConstructorSpecialized(ancestor); } return TernaryBool.Unspecified; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/0000755000175000017500000000000011700531646026303 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/Conversions/0000755000175000017500000000000011700531646030613 5ustar00meebeymeebey00000000000000DropGuidClassIndexes_7_12.cs0000644000175000017500000000036711700531646035644 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Convert.Conversions { /// public partial class DropGuidClassIndexes_7_12 { public const int Version = 10; } } ReindexNetDateTime_7_8.cs0000644000175000017500000000036311700531646035224 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Convert.Conversions { /// public partial class ReindexNetDateTime_7_8 { public const int Version = 8; } } DropEnumClassIndexes_7_10.cs0000644000175000017500000000036711700531646035656 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Convert.Conversions { /// * public partial class DropEnumClassIndexes_7_10 { public const int Version = 9; } } VersionNumberToCommitTimestamp_8_0.cs0000644000175000017500000000545411700531646037677 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Convert; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal.Convert.Conversions { /// public class VersionNumberToCommitTimestamp_8_0 : Conversion { public const int Version = 12; private VersionFieldMetadata versionFieldMetadata; public override void Convert(ConversionStage.SystemUpStage stage) { LocalObjectContainer container = stage.File(); if (!container.Config().GenerateCommitTimestamps().DefiniteYes()) { return; } container.ClassCollection().WriteAllClasses(); BuildCommitTimestampIndex(container); container.SystemTransaction().Commit(); } private void BuildCommitTimestampIndex(LocalObjectContainer container) { versionFieldMetadata = container.Handlers.Indexes()._version; ClassMetadataIterator i = container.ClassCollection().Iterator(); while (i.MoveNext()) { ClassMetadata clazz = i.CurrentClass(); if (clazz.HasVersionField() && !clazz.IsStruct()) { RebuildIndexForClass(container, clazz); } } } public virtual bool RebuildIndexForClass(LocalObjectContainer container, ClassMetadata classMetadata) { long[] ids = classMetadata.GetIDs(); for (int i = 0; i < ids.Length; i++) { RebuildIndexForObject(container, (int)ids[i]); } return ids.Length > 0; } /// protected virtual void RebuildIndexForObject(LocalObjectContainer container, int objectId) { StatefulBuffer writer = container.ReadStatefulBufferById(container.SystemTransaction (), objectId); if (writer != null) { RebuildIndexForWriter(container, writer, objectId); } } protected virtual void RebuildIndexForWriter(LocalObjectContainer container, StatefulBuffer buffer, int objectId) { ObjectHeader objectHeader = new ObjectHeader(container, buffer); ObjectIdContextImpl context = new ObjectIdContextImpl(container.SystemTransaction (), buffer, objectHeader, objectId); ClassMetadata classMetadata = context.ClassMetadata(); if (classMetadata.IsStruct()) { // We don't keep version information for structs. return; } if (classMetadata.SeekToField(container.SystemTransaction(), buffer, versionFieldMetadata ) != HandlerVersion.Invalid) { long version = ((long)versionFieldMetadata.Read(context)); if (version != 0) { LocalTransaction t = (LocalTransaction)container.SystemTransaction(); t.CommitTimestampSupport().Put(container.SystemTransaction(), objectId, version); } } } } } FieldIndexesToBTrees_5_7.cs0000644000175000017500000000205411700531646035511 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Convert; namespace Db4objects.Db4o.Internal.Convert.Conversions { /// public class FieldIndexesToBTrees_5_7 : Conversion { public const int Version = 6; public override void Convert(ConversionStage.SystemUpStage stage) { stage.File().ClassCollection().WriteAllClasses(); RebuildUUIDIndex(stage.File()); FreeOldUUIDMetaIndex(stage.File()); } private void RebuildUUIDIndex(LocalObjectContainer file) { UUIDFieldMetadata uuid = file.UUIDIndex(); ClassMetadataIterator i = file.ClassCollection().Iterator(); while (i.MoveNext()) { ClassMetadata clazz = i.CurrentClass(); if (clazz.GenerateUUIDs()) { uuid.RebuildIndexForClass(file, clazz); } } } /// private void FreeOldUUIDMetaIndex(LocalObjectContainer file) { } // updating removed here to allow removing MetaIndex class } } CommonConversions.cs0000644000175000017500000000216111700531646034544 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Convert; using Db4objects.Db4o.Internal.Convert.Conversions; namespace Db4objects.Db4o.Internal.Convert.Conversions { /// public class CommonConversions { public static void Register(Converter converter) { converter.Register(ClassIndexesToBTrees_5_5.Version, new ClassIndexesToBTrees_5_5 ()); converter.Register(FieldIndexesToBTrees_5_7.Version, new FieldIndexesToBTrees_5_7 ()); converter.Register(ClassAspects_7_4.Version, new ClassAspects_7_4()); converter.Register(ReindexNetDateTime_7_8.Version, new ReindexNetDateTime_7_8()); converter.Register(DropEnumClassIndexes_7_10.Version, new DropEnumClassIndexes_7_10 ()); converter.Register(DropGuidClassIndexes_7_12.Version, new DropGuidClassIndexes_7_12 ()); converter.Register(DropDateTimeOffsetClassIndexes_7_12.Version, new DropDateTimeOffsetClassIndexes_7_12 ()); converter.Register(VersionNumberToCommitTimestamp_8_0.Version, new VersionNumberToCommitTimestamp_8_0 ()); } } } DropDateTimeOffsetClassIndexes_7_12.cs0000644000175000017500000000040111700531646037604 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Convert.Conversions { /// public partial class DropDateTimeOffsetClassIndexes_7_12 { public const int Version = 11; } } ClassIndexesToBTrees_5_5.cs0000644000175000017500000000202311700531646035525 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Convert; namespace Db4objects.Db4o.Internal.Convert.Conversions { /// public class ClassIndexesToBTrees_5_5 : Conversion { public const int Version = 5; public virtual void Convert(LocalObjectContainer container, int classIndexId, BTree bTree) { Transaction trans = container.SystemTransaction(); ByteArrayBuffer reader = container.ReadBufferById(trans, classIndexId); if (reader == null) { return; } int entries = reader.ReadInt(); for (int i = 0; i < entries; i++) { bTree.Add(trans, reader.ReadInt()); } } public override void Convert(ConversionStage.SystemUpStage stage) { // calling #storedClasses forces reading all classes // That's good enough to load them all and to call the // above convert method. stage.File().StoredClasses(); } } } ClassAspects_7_4.cs0000644000175000017500000000064411700531646034130 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/Conversions/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Convert; namespace Db4objects.Db4o.Internal.Convert.Conversions { /// public class ClassAspects_7_4 : Conversion { public const int Version = 7; public override void Convert(ConversionStage.SystemUpStage stage) { stage.File().ClassCollection().WriteAllClasses(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/Converter.cs0000644000175000017500000000436311700531646030607 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Internal.Convert; using Db4objects.Db4o.Internal.Convert.Conversions; namespace Db4objects.Db4o.Internal.Convert { /// public class Converter { public const int Version = VersionNumberToCommitTimestamp_8_0.Version; public static bool Convert(ConversionStage stage) { if (!NeedsConversion(stage.ConverterVersion())) { return false; } return Instance().RunConversions(stage); } private static Db4objects.Db4o.Internal.Convert.Converter _instance; private IDictionary _conversions; private int _minimumVersion = int.MaxValue; private Converter() { _conversions = new Hashtable(); // TODO: There probably will be Java and .NET conversions // Create Platform4.registerConversions() method ann // call from here when needed. CommonConversions.Register(this); } public static Db4objects.Db4o.Internal.Convert.Converter Instance() { if (_instance == null) { _instance = new Db4objects.Db4o.Internal.Convert.Converter(); } return _instance; } public virtual Conversion ConversionFor(int version) { return ((Conversion)_conversions[version]); } private static bool NeedsConversion(int converterVersion) { return converterVersion < Version; } public virtual void Register(int introducedVersion, Conversion conversion) { if (_conversions.Contains(introducedVersion)) { throw new InvalidOperationException(); } if (introducedVersion < _minimumVersion) { _minimumVersion = introducedVersion; } _conversions[introducedVersion] = conversion; } public virtual bool RunConversions(ConversionStage stage) { int startingVersion = Math.Max(stage.ConverterVersion() + 1, _minimumVersion); for (int version = startingVersion; version <= Version; version++) { Conversion conversion = ConversionFor(version); if (conversion == null) { throw new InvalidOperationException("Could not find a conversion for version " + version); } stage.Accept(conversion); } return true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/Conversion.cs0000644000175000017500000000073411700531646030763 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Convert; namespace Db4objects.Db4o.Internal.Convert { /// public abstract class Conversion { /// public virtual void Convert(ConversionStage.ClassCollectionAvailableStage stage) { } /// public virtual void Convert(ConversionStage.SystemUpStage stage) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Convert/ConversionStage.cs0000644000175000017500000000217511700531646031750 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Convert; namespace Db4objects.Db4o.Internal.Convert { /// public abstract class ConversionStage { public sealed class ClassCollectionAvailableStage : ConversionStage { public ClassCollectionAvailableStage(LocalObjectContainer file) : base(file) { } public override void Accept(Conversion conversion) { conversion.Convert(this); } } public sealed class SystemUpStage : ConversionStage { public SystemUpStage(LocalObjectContainer file) : base(file) { } public override void Accept(Conversion conversion) { conversion.Convert(this); } } private LocalObjectContainer _file; protected ConversionStage(LocalObjectContainer file) { _file = file; } public virtual LocalObjectContainer File() { return _file; } public virtual int ConverterVersion() { return _file.SystemData().ConverterVersion(); } public abstract void Accept(Conversion conversion); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Encoding/0000755000175000017500000000000011700531646026411 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Encoding/LatinStringEncoding.cs0000644000175000017500000000135111700531646032645 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Config.Encoding; using Db4objects.Db4o.Internal.Encoding; namespace Db4objects.Db4o.Internal.Encoding { /// public class LatinStringEncoding : BuiltInStringEncoding { public override string Decode(byte[] bytes, int start, int length) { throw new NotImplementedException(); } // special StringIO, should never be called public override byte[] Encode(string str) { throw new NotImplementedException(); } // special StringIO, should never be called protected override LatinStringIO CreateStringIo(IStringEncoding encoding) { return new LatinStringIO(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Encoding/BuiltInStringEncoding.cs0000644000175000017500000000350511700531646033147 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Config.Encoding; using Db4objects.Db4o.Internal.Encoding; namespace Db4objects.Db4o.Internal.Encoding { /// public abstract class BuiltInStringEncoding : IStringEncoding { /// keep the position in the array. /// /// keep the position in the array. /// Information is used to look up encodings. /// private static readonly BuiltInStringEncoding[] AllEncodings = new BuiltInStringEncoding [] { null, new LatinStringEncoding(), new UnicodeStringEncoding(), new UTF8StringEncoding () }; public static byte EncodingByteForEncoding(IStringEncoding encoding) { for (int i = 1; i < AllEncodings.Length; i++) { if (encoding.GetType() == AllEncodings[i].GetType()) { return (byte)i; } } return 0; } public static LatinStringIO StringIoForEncoding(byte encodingByte, IStringEncoding encoding) { if (encodingByte < 0 || encodingByte > AllEncodings.Length) { throw new ArgumentException(); } if (encodingByte == 0) { if (encoding is BuiltInStringEncoding) { Sharpen.Runtime.Out.WriteLine("Warning! Database was created with a custom string encoding but no custom string encoding is configured for this session." ); } return new DelegatingStringIO(encoding); } BuiltInStringEncoding builtInEncoding = AllEncodings[encodingByte]; return builtInEncoding.CreateStringIo(encoding); } protected virtual LatinStringIO CreateStringIo(IStringEncoding encoding) { return new DelegatingStringIO(encoding); } public abstract string Decode(byte[] arg1, int arg2, int arg3); public abstract byte[] Encode(string arg1); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Encoding/DelegatingStringIO.cs0000644000175000017500000000443611700531646032431 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config.Encoding; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Encoding { /// public class DelegatingStringIO : LatinStringIO { private readonly IStringEncoding _encoding; public DelegatingStringIO(IStringEncoding encoding) { _encoding = encoding; } private string Decode(byte[] bytes, int start, int length) { return _encoding.Decode(bytes, start, length); } private byte[] Encode(string str) { return _encoding.Encode(str); } public override byte EncodingByte() { if (_encoding is BuiltInStringEncoding) { return BuiltInStringEncoding.EncodingByteForEncoding(_encoding); } return 0; } public override int Length(string str) { return Encode(str).Length + Const4.ObjectLength + Const4.IntLength; } public override string Read(IReadBuffer buffer, int length) { byte[] bytes = new byte[length]; buffer.ReadBytes(bytes); return Decode(bytes, 0, bytes.Length); } public override string Read(byte[] bytes) { return Decode(bytes, 0, bytes.Length); } public override int ShortLength(string str) { return Encode(str).Length + Const4.IntLength; } public override void Write(IWriteBuffer buffer, string str) { buffer.WriteBytes(Encode(str)); } public override byte[] Write(string str) { return Encode(str); } /// /// Note the different implementation when compared to LatinStringIO and UnicodeStringIO: /// Instead of writing the length of the string, UTF8StringIO writes the length of the /// byte array. /// /// /// Note the different implementation when compared to LatinStringIO and UnicodeStringIO: /// Instead of writing the length of the string, UTF8StringIO writes the length of the /// byte array. /// public override void WriteLengthAndString(IWriteBuffer buffer, string str) { if (str == null) { buffer.WriteInt(0); return; } byte[] bytes = Encode(str); buffer.WriteInt(bytes.Length); buffer.WriteBytes(bytes); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Encoding/UnicodeStringEncoding.cs0000644000175000017500000000064111700531646033165 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config.Encoding; using Db4objects.Db4o.Internal.Encoding; namespace Db4objects.Db4o.Internal.Encoding { /// public class UnicodeStringEncoding : LatinStringEncoding { protected override LatinStringIO CreateStringIo(IStringEncoding encoding) { return new UnicodeStringIO(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Encoding/UnicodeStringIO.cs0000644000175000017500000000425611700531646031754 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Encoding { /// public sealed class UnicodeStringIO : LatinStringIO { protected override int BytesPerChar() { return 2; } public override byte EncodingByte() { return BuiltInStringEncoding.EncodingByteForEncoding(new UnicodeStringEncoding()); } public override int Length(string str) { return (str.Length * 2) + Const4.ObjectLength + Const4.IntLength; } public override string Read(IReadBuffer buffer, int length) { char[] chars = new char[length]; for (int ii = 0; ii < length; ii++) { chars[ii] = (char)((buffer.ReadByte() & unchecked((int)(0xff))) | ((buffer.ReadByte () & unchecked((int)(0xff))) << 8)); } return new string(chars, 0, length); } public override string Read(byte[] bytes) { int length = bytes.Length / 2; char[] chars = new char[length]; int j = 0; for (int ii = 0; ii < length; ii++) { chars[ii] = (char)((bytes[j++] & unchecked((int)(0xff))) | ((bytes[j++] & unchecked( (int)(0xff))) << 8)); } return new string(chars, 0, length); } public override int ShortLength(string str) { return (str.Length * 2) + Const4.IntLength; } public override void Write(IWriteBuffer buffer, string str) { int length = str.Length; char[] chars = new char[length]; Sharpen.Runtime.GetCharsForString(str, 0, length, chars, 0); for (int i = 0; i < length; i++) { buffer.WriteByte((byte)(chars[i] & unchecked((int)(0xff)))); buffer.WriteByte((byte)(chars[i] >> 8)); } } public override byte[] Write(string str) { int length = str.Length; char[] chars = new char[length]; Sharpen.Runtime.GetCharsForString(str, 0, length, chars, 0); byte[] bytes = new byte[length * 2]; int j = 0; for (int i = 0; i < length; i++) { bytes[j++] = (byte)(chars[i] & unchecked((int)(0xff))); bytes[j++] = (byte)(chars[i] >> 8); } return bytes; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Encoding/LatinStringIO.cs0000644000175000017500000000504211700531646031427 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Marshall; using Sharpen; namespace Db4objects.Db4o.Internal.Encoding { /// public class LatinStringIO { public virtual byte[] Bytes(ByteArrayBuffer buffer) { int len = buffer.ReadInt(); len = BytesPerChar() * len; byte[] res = new byte[len]; System.Array.Copy(buffer._buffer, buffer._offset, res, 0, len); return res; } protected virtual int BytesPerChar() { return 1; } public virtual byte EncodingByte() { return BuiltInStringEncoding.EncodingByteForEncoding(new LatinStringEncoding()); } public virtual int Length(string str) { return str.Length + Const4.ObjectLength + Const4.IntLength; } public virtual string Read(IReadBuffer buffer, int length) { char[] chars = new char[length]; for (int ii = 0; ii < length; ii++) { chars[ii] = (char)(buffer.ReadByte() & unchecked((int)(0xff))); } return new string(chars, 0, length); } public virtual string Read(byte[] bytes) { char[] chars = new char[bytes.Length]; for (int i = 0; i < bytes.Length; i++) { chars[i] = (char)(bytes[i] & unchecked((int)(0xff))); } return new string(chars, 0, bytes.Length); } public virtual string ReadLengthAndString(IReadBuffer buffer) { int length = buffer.ReadInt(); if (length == 0) { return string.Empty; } return Read(buffer, length); } public virtual int ShortLength(string str) { return str.Length + Const4.IntLength; } public virtual void Write(IWriteBuffer buffer, string str) { int length = str.Length; char[] chars = new char[length]; Sharpen.Runtime.GetCharsForString(str, 0, length, chars, 0); for (int i = 0; i < length; i++) { buffer.WriteByte((byte)(chars[i] & unchecked((int)(0xff)))); } } public virtual byte[] Write(string str) { int length = str.Length; char[] chars = new char[length]; Sharpen.Runtime.GetCharsForString(str, 0, length, chars, 0); byte[] bytes = new byte[length]; for (int i = 0; i < length; i++) { bytes[i] = (byte)(chars[i] & unchecked((int)(0xff))); } return bytes; } public virtual void WriteLengthAndString(IWriteBuffer buffer, string str) { if (str == null) { buffer.WriteInt(0); return; } buffer.WriteInt(str.Length); Write(buffer, str); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/TranslatedAspect.cs0000644000175000017500000001115211700531646030453 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Config; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { public sealed class TranslatedAspect : FieldMetadata { private IObjectTranslator _translator; public TranslatedAspect(ClassMetadata containingClass, string name) : this(containingClass ) { Init(name); } public TranslatedAspect(ClassMetadata containingClass, IObjectTranslator translator ) : this(containingClass) { InitializeTranslator(translator); } private TranslatedAspect(ClassMetadata containingClass) : base(containingClass) { SetAvailable(); } public void InitializeTranslator(IObjectTranslator translator) { _translator = translator; InitializeFieldName(); InitializeFieldType(); } public override bool Alive() { return true; } private void InitializeFieldName() { Init(FieldNameFor(_translator)); } private void InitializeFieldType() { ObjectContainerBase stream = ContainingClass().Container(); IReflectClass storedClass = stream.Reflector().ForClass(TranslatorStoredClass(_translator )); Configure(storedClass, false); IReflectClass baseType = Handlers4.BaseType(storedClass); stream.ShowInternalClasses(true); try { _fieldType = stream.ProduceClassMetadata(baseType); } finally { stream.ShowInternalClasses(false); } if (null == _fieldType) { throw new InvalidOperationException("Cannot produce class metadata for " + baseType + "!"); } } public static string FieldNameFor(IObjectTranslator translator) { return translator.GetType().FullName; } public override bool CanUseNullBitmap() { return false; } public override void Deactivate(IActivationContext context) { if (context.Depth().RequiresActivation()) { CascadeActivation(context); } SetOn(context.Transaction(), context.TargetObject(), null); } public override object GetOn(Transaction a_trans, object a_OnObject) { try { return _translator.OnStore(a_trans.ObjectContainer(), a_OnObject); } catch (ReflectException e) { throw; } catch (Exception e) { throw new ReflectException(e); } } public override object GetOrCreate(Transaction a_trans, object a_OnObject) { return GetOn(a_trans, a_OnObject); } public override void Activate(UnmarshallingContext context) { object obj = Read(context); // Activation of members is necessary on purpose here. // Classes like Hashtable need fully activated members // to be able to calculate hashCode() if (obj != null) { context.Container().Activate(context.Transaction(), obj, context.ActivationDepth( )); } SetOn(context.Transaction(), context.PersistentObject(), obj); } internal override void Refresh() { } // do nothing private void SetOn(Transaction trans, object a_onObject, object toSet) { try { _translator.OnActivate(trans.ObjectContainer(), a_onObject, toSet); } catch (Exception e) { throw new ReflectException(e); } } protected override object IndexEntryFor(object indexEntry) { return indexEntry; } protected override IIndexable4 IndexHandler(ObjectContainerBase stream) { return (IIndexable4)GetHandler(); } public override bool Equals(object obj) { if (obj == this) { return true; } if (obj == null || obj.GetType() != GetType()) { return false; } Db4objects.Db4o.Internal.TranslatedAspect other = (Db4objects.Db4o.Internal.TranslatedAspect )obj; return _translator.Equals(other._translator); } public override int GetHashCode() { return _translator.GetHashCode(); } public override Db4objects.Db4o.Internal.Marshall.AspectType AspectType() { return Db4objects.Db4o.Internal.Marshall.AspectType.Translator; } public bool IsObjectConstructor() { return _translator is IObjectConstructor; } public object Construct(ObjectReferenceContext context) { ContextState contextState = context.SaveState(); bool fieldHasValue = ContainingClass().SeekToField(context, this); try { return ((IObjectConstructor)_translator).OnInstantiate(context.Container(), fieldHasValue ? Read(context) : null); } finally { context.RestoreState(contextState); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/DisabledBlockConverter.cs0000644000175000017500000000124411700531646031565 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal { /// public class DisabledBlockConverter : IBlockConverter { public virtual int BlockAlignedBytes(int bytes) { return bytes; } public virtual int BlocksToBytes(int blocks) { return blocks; } public virtual int BytesToBlocks(long bytes) { return (int)bytes; } public virtual Slot ToBlockedLength(Slot slot) { return slot; } public virtual Slot ToNonBlockedLength(Slot slot) { return slot; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/HardObjectReference.cs0000644000175000017500000000231111700531646031033 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal { /// public class HardObjectReference { public static readonly Db4objects.Db4o.Internal.HardObjectReference Invalid = new Db4objects.Db4o.Internal.HardObjectReference(null, null); public readonly ObjectReference _reference; public readonly object _object; public HardObjectReference(ObjectReference @ref, object obj) { _reference = @ref; _object = obj; } public static Db4objects.Db4o.Internal.HardObjectReference PeekPersisted(Transaction trans, int id, int depth) { object obj = trans.Container().PeekPersisted(trans, id, ActivationDepthProvider(trans ).ActivationDepth(depth, ActivationMode.Peek), true); if (obj == null) { return null; } ObjectReference @ref = trans.ReferenceForId(id); return new Db4objects.Db4o.Internal.HardObjectReference(@ref, obj); } private static IActivationDepthProvider ActivationDepthProvider(Transaction trans ) { return trans.Container().ActivationDepthProvider(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IntMatcher.cs0000644000175000017500000000173611700531646027257 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public abstract class IntMatcher { public abstract bool Match(int i); private sealed class _IntMatcher_13 : IntMatcher { public _IntMatcher_13() { } public override bool Match(int i) { return i == 0; } } public static readonly IntMatcher Zero = new _IntMatcher_13(); private sealed class _IntMatcher_19 : IntMatcher { public _IntMatcher_19() { } public override bool Match(int i) { return i > 0; } } public static readonly IntMatcher Positive = new _IntMatcher_19(); private sealed class _IntMatcher_25 : IntMatcher { public _IntMatcher_25() { } public override bool Match(int i) { return i < 0; } } public static readonly IntMatcher Negative = new _IntMatcher_25(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Qlin/0000755000175000017500000000000011700531646025566 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Qlin/QLinRoot.cs0000644000175000017500000000331011700531646027621 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Qlin; using Db4objects.Db4o.Internal.Query; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Query.Result; using Db4objects.Db4o.Qlin; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Qlin { /// public class QLinRoot : QLinSodaNode { private readonly QQuery _query; private int _limit = -1; public QLinRoot(IQuery query, Type clazz) { _query = (QQuery)query; query.Constrain(clazz); QLinSupport.Context(clazz); } public virtual IQuery Query() { return _query; } public override IObjectSet Select() { if (_limit == -1) { return _query.Execute(); } IQueryResult queryResult = _query.GetQueryResult(); IdListQueryResult limitedResult = new IdListQueryResult(_query.Transaction(), _limit ); int counter = 0; IIntIterator4 i = queryResult.IterateIDs(); while (i.MoveNext()) { if (counter++ >= _limit) { break; } limitedResult.Add(i.CurrentInt()); } return new ObjectSetFacade(limitedResult); } public override IQLin Limit(int size) { if (size < 1) { throw new QLinException("Limit must be greater that 0"); } _limit = size; return this; } protected override Db4objects.Db4o.Internal.Qlin.QLinRoot Root() { return this; } internal virtual IQuery Descend(object expression) { // TODO: Implement deep descend return Query().Descend(QLinSupport.Field(expression).GetName()); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Qlin/QLinSodaNode.cs0000644000175000017500000000107011700531646030373 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Qlin; using Db4objects.Db4o.Qlin; namespace Db4objects.Db4o.Internal.Qlin { /// public abstract class QLinSodaNode : QLinNode { protected abstract QLinRoot Root(); public override IQLin Where(object expression) { return new QLinField(Root(), expression); } public override IQLin OrderBy(object expression, QLinOrderByDirection direction) { return new QLinOrderBy(Root(), expression, direction); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Qlin/QLinSubNode.cs0000644000175000017500000000135011700531646030237 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Internal.Qlin; using Db4objects.Db4o.Qlin; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Qlin { /// public abstract class QLinSubNode : QLinSodaNode { protected readonly QLinRoot _root; public QLinSubNode(QLinRoot root) { _root = root; } protected override QLinRoot Root() { return _root; } protected virtual IQuery Query() { return Root().Query(); } public override IQLin Limit(int size) { Root().Limit(size); return this; } public override IObjectSet Select() { return Root().Select(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Qlin/QLinConstraint.cs0000644000175000017500000000065311700531646031031 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Qlin; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Qlin { /// public class QLinConstraint : QLinSubNode { private readonly IConstraint _constraint; public QLinConstraint(QLinRoot root, IConstraint constraint) : base(root) { _constraint = constraint; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Qlin/QLinField.cs0000644000175000017500000000232411700531646027725 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Qlin; using Db4objects.Db4o.Qlin; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Qlin { /// public class QLinField : QLinSubNode { private readonly IQuery _node; public QLinField(QLinRoot root, object expression) : base(root) { _node = root.Descend(expression); } public override IQLin Equal(object obj) { IConstraint constraint = _node.Constrain(obj); constraint.Equal(); return new QLinConstraint(((QLinRoot)_root), constraint); } public override IQLin StartsWith(string @string) { IConstraint constraint = _node.Constrain(@string); constraint.StartsWith(true); return new QLinConstraint(((QLinRoot)_root), constraint); } public override IQLin Smaller(object obj) { IConstraint constraint = _node.Constrain(obj); constraint.Smaller(); return new QLinConstraint(((QLinRoot)_root), constraint); } public override IQLin Greater(object obj) { IConstraint constraint = _node.Constrain(obj); constraint.Greater(); return new QLinConstraint(((QLinRoot)_root), constraint); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Qlin/QLinNode.cs0000644000175000017500000000411511700531646027567 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Qlin; namespace Db4objects.Db4o.Internal.Qlin { /// public abstract class QLinNode : IQLin { public virtual IQLin Equal(object obj) { throw new QLinException("#equal() is not supported on this node"); } public virtual IQLin StartsWith(string @string) { throw new QLinException("#startsWith() is not supported on this node"); } public virtual IQLin Smaller(object obj) { throw new QLinException("#smaller() is not supported on this node"); } public virtual IQLin Greater(object obj) { throw new QLinException("#greater() is not supported on this node"); } public virtual object SingleOrDefault(object defaultValue) { IObjectSet collection = Select(); // TODO: Change to #isEmpty here after decafs, so the size doesn#t need to be calculated if (collection.Count == 0) { return defaultValue; } if (collection.Count > 1) { // Consider: Use a more specific exception if a query does not return // the expected result throw new QLinException("Expected one or none. Found: " + collection.Count); } // The following would be the right way to work against // a collection but for now it won't decaf. // return collection.iterator().next(); // This is the ugly old db4o interface, where a Collection is // an iterator directly. For now it's convenient but we don't // really want to use this in the future. // Update #single() in the same way. return collection.Next(); } public virtual object Single() { IObjectSet collection = Select(); if (collection.Count != 1) { throw new QLinException("Expected exactly one. Found: " + collection.Count); } return collection.Next(); } public abstract IQLin Limit(int arg1); public abstract IQLin OrderBy(object arg1, QLinOrderByDirection arg2); public abstract IObjectSet Select(); public abstract IQLin Where(object arg1); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Qlin/QLinOrderBy.cs0000644000175000017500000000115111700531646030245 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Qlin; using Db4objects.Db4o.Qlin; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Qlin { /// public class QLinOrderBy : QLinSubNode { private readonly IQuery _node; public QLinOrderBy(QLinRoot root, object expression, QLinOrderByDirection direction ) : base(root) { _node = root.Descend(expression); if (direction == QLinSupport.Ascending()) { _node.OrderAscending(); } else { _node.OrderDescending(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/LockedTree.cs0000644000175000017500000000330011700531646027227 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public class LockedTree { private Tree _tree; private int _version; public virtual void Add(Tree tree) { Changed(); _tree = _tree == null ? tree : _tree.Add(tree); } private void Changed() { _version++; } public virtual void Clear() { Changed(); _tree = null; } public virtual Tree Find(int key) { return TreeInt.Find(_tree, key); } public virtual void Read(ByteArrayBuffer buffer, IReadable template) { Clear(); _tree = new TreeReader(buffer, template).Read(); Changed(); } public virtual void TraverseLocked(IVisitor4 visitor) { int currentVersion = _version; Tree.Traverse(_tree, visitor); if (_version != currentVersion) { throw new InvalidOperationException(); } } public virtual void TraverseMutable(IVisitor4 visitor) { Collection4 currentContent = new Collection4(); TraverseLocked(new _IVisitor4_51(currentContent)); IEnumerator i = currentContent.GetEnumerator(); while (i.MoveNext()) { visitor.Visit(i.Current); } } private sealed class _IVisitor4_51 : IVisitor4 { public _IVisitor4_51(Collection4 currentContent) { this.currentContent = currentContent; } public void Visit(object obj) { currentContent.Add(obj); } private readonly Collection4 currentContent; } public virtual bool IsEmpty() { return _tree == null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/CallBackMode.cs0000644000175000017500000000130611700531646027453 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal { public sealed class CallBackMode { public static readonly Db4objects.Db4o.Internal.CallBackMode All = new Db4objects.Db4o.Internal.CallBackMode ("ALL"); public static readonly Db4objects.Db4o.Internal.CallBackMode DeleteOnly = new Db4objects.Db4o.Internal.CallBackMode ("DELETE_ONLY"); public static readonly Db4objects.Db4o.Internal.CallBackMode None = new Db4objects.Db4o.Internal.CallBackMode ("NONE"); private string _desc; private CallBackMode(string desc) { _desc = desc; } public override string ToString() { return _desc; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/SystemData.cs0000644000175000017500000000777011700531646027303 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal { /// public class SystemData { private int _classCollectionID; private int _converterVersion; private Slot _inMemoryFreespaceSlot; private int _bTreeFreespaceId; private byte _freespaceSystem; private Db4oDatabase _identity; private int _identityId; private long _lastTimeStampID; private byte _stringEncoding; private int _uuidIndexId; private byte _idSystemType; private int _transactionPointer1; private int _transactionPointer2; private Slot _idSystemSlot; private int _idToTimestampIndexId; private int _timestampToIdIndexId; public virtual Slot IdSystemSlot() { return _idSystemSlot; } public virtual void IdSystemSlot(Slot slot) { _idSystemSlot = slot; } private ITransactionalIdSystem _freespaceIdSystem; public virtual void IdSystemType(byte idSystem) { _idSystemType = idSystem; } public virtual byte IdSystemType() { return _idSystemType; } public virtual int ClassCollectionID() { return _classCollectionID; } public virtual void ClassCollectionID(int id) { _classCollectionID = id; } public virtual int ConverterVersion() { return _converterVersion; } public virtual void ConverterVersion(int version) { _converterVersion = version; } public virtual int BTreeFreespaceId() { return _bTreeFreespaceId; } public virtual void BTreeFreespaceId(int id) { _bTreeFreespaceId = id; } public virtual Slot InMemoryFreespaceSlot() { return _inMemoryFreespaceSlot; } public virtual void InMemoryFreespaceSlot(Slot slot) { _inMemoryFreespaceSlot = slot; } public virtual byte FreespaceSystem() { return _freespaceSystem; } public virtual void FreespaceSystem(byte freespaceSystemtype) { _freespaceSystem = freespaceSystemtype; } public virtual Db4oDatabase Identity() { return _identity; } public virtual void Identity(Db4oDatabase identityObject) { _identity = identityObject; } public virtual long LastTimeStampID() { return _lastTimeStampID; } public virtual void LastTimeStampID(long id) { _lastTimeStampID = id; } public virtual byte StringEncoding() { return _stringEncoding; } public virtual void StringEncoding(byte encodingByte) { _stringEncoding = encodingByte; } public virtual int UuidIndexId() { return _uuidIndexId; } public virtual void UuidIndexId(int id) { _uuidIndexId = id; } public virtual void IdentityId(int id) { _identityId = id; } public virtual int IdentityId() { return _identityId; } public virtual void TransactionPointer1(int pointer) { _transactionPointer1 = pointer; } public virtual void TransactionPointer2(int pointer) { _transactionPointer2 = pointer; } public virtual int TransactionPointer1() { return _transactionPointer1; } public virtual int TransactionPointer2() { return _transactionPointer2; } public virtual void FreespaceIdSystem(ITransactionalIdSystem transactionalIdSystem ) { _freespaceIdSystem = transactionalIdSystem; } public virtual ITransactionalIdSystem FreespaceIdSystem() { return _freespaceIdSystem; } public virtual void IdToTimestampIndexId(int idToTimestampIndexId) { _idToTimestampIndexId = idToTimestampIndexId; } public virtual int IdToTimestampIndexId() { return _idToTimestampIndexId; } public virtual void TimestampToIdIndexId(int timestampToIdIndexId) { _timestampToIdIndexId = timestampToIdIndexId; } public virtual int TimestampToIdIndexId() { return _timestampToIdIndexId; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IInternalObjectContainer.cs0000644000175000017500000000257211700531646032077 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Callbacks; using Db4objects.Db4o.Internal.Events; using Db4objects.Db4o.Internal.Query; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal { /// public partial interface IInternalObjectContainer : IExtObjectContainer { void Callbacks(ICallbacks cb); ICallbacks Callbacks(); ObjectContainerBase Container { get; } Db4objects.Db4o.Internal.Transaction Transaction { get; } NativeQueryHandler GetNativeQueryHandler(); ClassMetadata ClassMetadataForReflectClass(IReflectClass reflectClass); ClassMetadata ClassMetadataForName(string name); ClassMetadata ClassMetadataForID(int id); HandlerRegistry Handlers { get; } Config4Impl ConfigImpl { get; } object SyncExec(IClosure4 block); int InstanceCount(ClassMetadata clazz, Db4objects.Db4o.Internal.Transaction trans ); bool IsClient { get; } void StoreAll(Db4objects.Db4o.Internal.Transaction trans, IEnumerator objects); IUpdateDepthProvider UpdateDepthProvider(); EventRegistryImpl NewEventRegistry(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/InterfaceTypeHandler.cs0000644000175000017500000000065011700531646031253 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { public sealed class InterfaceTypeHandler : OpenTypeHandler { public InterfaceTypeHandler(ObjectContainerBase container) : base(container) { } public override bool Equals(object obj) { return obj is Db4objects.Db4o.Internal.InterfaceTypeHandler; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ITransactionParticipant.cs0000644000175000017500000000054011700531646032006 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public interface ITransactionParticipant { void Commit(Transaction transaction); void Rollback(Transaction transaction); void Dispose(Transaction transaction); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ShutDownRunnable.cs0000644000175000017500000000163211700531646030456 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Sharpen.Lang; namespace Db4objects.Db4o.Internal { internal class ShutDownRunnable : IRunnable { private Collection4 _containers = new Collection4(); public volatile bool dontRemove = false; public virtual void Ensure(ObjectContainerBase container) { _containers.Ensure(container); } public virtual void Remove(ObjectContainerBase container) { _containers.Remove(container); } public virtual void Run() { dontRemove = true; Collection4 copy = new Collection4(_containers); IEnumerator i = copy.GetEnumerator(); while (i.MoveNext()) { ((ObjectContainerBase)i.Current).ShutdownHook(); } } public virtual int Size() { return _containers.Size(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Collections/0000755000175000017500000000000011700531646027141 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Collections/BigSetTypeHandler.cs0000644000175000017500000000550411700531646033011 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Collections; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Collections { /// public class BigSetTypeHandler : IReferenceTypeHandler, ICascadingTypeHandler { public virtual void Defragment(IDefragmentContext context) { int pos = context.Offset(); int id = context.ReadInt(); BTree bTree = NewBTree(context, id); DefragmentServicesImpl services = (DefragmentServicesImpl)context.Services(); IDMappingCollector collector = new IDMappingCollector(); services.RegisterBTreeIDs(bTree, collector); collector.Flush(services); context.Seek(pos); context.CopyID(); bTree.DefragBTree(services); } /// public virtual void Delete(IDeleteContext context) { InvalidBigSet(context); int id = context.ReadInt(); FreeBTree(context, id); } private void InvalidBigSet(IDeleteContext context) { IBigSetPersistence bigSet = (IBigSetPersistence)context.Transaction().ObjectForIdFromCache (context.ObjectId()); if (bigSet != null) { bigSet.Invalidate(); } } private void FreeBTree(IDeleteContext context, int id) { BTree bTree = NewBTree(context, id); bTree.Free(SystemTransaction(context)); bTree = null; } private static LocalTransaction SystemTransaction(IContext context) { return (LocalTransaction)context.Transaction().SystemTransaction(); } private BTree NewBTree(IContext context, int id) { return new BTree(SystemTransaction(context), id, new IDHandler()); } public virtual void Write(IWriteContext context, object obj) { IBigSetPersistence bigSet = (IBigSetPersistence)obj; bigSet.Write(context); } public virtual IPreparedComparison PrepareComparison(IContext context, object obj ) { // TODO Auto-generated method stub return null; } public virtual void Activate(IReferenceActivationContext context) { IBigSetPersistence bigSet = (IBigSetPersistence)context.PersistentObject(); bigSet.Read(context); } public virtual void CascadeActivation(IActivationContext context) { } // TODO Auto-generated method stub public virtual void CollectIDs(QueryingReadContext context) { } // TODO Auto-generated method stub public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { // TODO Auto-generated method stub return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Collections/BigSet.cs0000644000175000017500000001072211700531646030647 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Collections.Generic; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Collections; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Collections { /// public partial class BigSet : Db4objects.Db4o.Collections.ISet, IBigSetPersistence { private Db4objects.Db4o.Internal.Btree.BTree _bTree; private Db4objects.Db4o.Internal.Transaction _transaction; public BigSet(LocalObjectContainer db) { if (db == null) { return; } _transaction = db.Transaction; _bTree = BTreeManager().NewBTree(); } private ObjectContainerBase Container() { return Transaction().Container(); } public virtual bool Add(E obj) { lock (Lock()) { int id = GetID(obj); if (id == 0) { Add(Store(obj)); return true; } if (Contains(id)) { return false; } Add(id); return true; } } private int Store(E obj) { return Container().Store(_transaction, obj, Container().UpdateDepthProvider().Unspecified (NullModifiedObjectQuery.Instance)); } private void Add(int id) { BTreeForUpdate().Add(_transaction, id); } private int GetID(object obj) { return (int)Container().GetID(obj); } public virtual bool AddAll(IEnumerable iterable) { bool result = false; foreach (E element in iterable) { if (Add(element)) { result = true; } } return result; } public virtual void Clear() { lock (Lock()) { BTreeForUpdate().Clear(Transaction()); } } public virtual bool Contains(object obj) { int id = GetID(obj); if (id == 0) { return false; } return Contains(id); } private bool Contains(int id) { lock (Lock()) { IBTreeRange range = BTree().SearchRange(Transaction(), id); return !range.IsEmpty(); } } public virtual bool IsEmpty { get { return Count == 0; } } private IEnumerator BTreeIterator() { return new SynchronizedIterator4(BTree().Iterator(Transaction()), Lock()); } public virtual bool Remove(object obj) { lock (Lock()) { if (!Contains(obj)) { return false; } int id = GetID(obj); BTreeForUpdate().Remove(Transaction(), id); return true; } } public virtual int Count { get { lock (Lock()) { return BTree().Size(Transaction()); } } } public virtual object[] ToArray() { throw new NotSupportedException(); } public virtual T[] ToArray(T[] a) { throw new NotSupportedException(); } public virtual void Write(IWriteContext context) { int id = BTree().GetID(); if (id == 0) { BTree().Write(SystemTransaction()); } context.WriteInt(BTree().GetID()); } public virtual void Read(IReadContext context) { int id = context.ReadInt(); if (_bTree != null) { AssertCurrentBTreeId(id); return; } _transaction = context.Transaction(); _bTree = BTreeManager().ProduceBTree(id); } private BigSetBTreeManager BTreeManager() { return new BigSetBTreeManager(_transaction); } private void AssertCurrentBTreeId(int id) { if (id != _bTree.GetID()) { throw new InvalidOperationException(); } } private Db4objects.Db4o.Internal.Transaction Transaction() { return _transaction; } private Db4objects.Db4o.Internal.Transaction SystemTransaction() { return Container().SystemTransaction(); } public virtual void Invalidate() { _bTree = null; } private Db4objects.Db4o.Internal.Btree.BTree BTree() { if (_bTree == null) { throw new InvalidOperationException(); } return _bTree; } private Db4objects.Db4o.Internal.Btree.BTree BTreeForUpdate() { Db4objects.Db4o.Internal.Btree.BTree bTree = BTree(); BTreeManager().EnsureIsManaged(bTree); return bTree; } private object Element(int id) { object obj = Container().GetByID(Transaction(), id); Container().Activate(obj); return obj; } private object Lock() { return Container().Lock(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Collections/BigSetBTreeManager.cs0000644000175000017500000000435111700531646033065 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Handlers; namespace Db4objects.Db4o.Internal.Collections { /// public class BigSetBTreeManager { private sealed class _TransactionLocal_14 : TransactionLocal { public _TransactionLocal_14() { } public override object InitialValueFor(Transaction transaction) { return new Hashtable(); } } private static readonly TransactionLocal _bTreesInTransaction = new _TransactionLocal_14 (); private readonly Transaction _transaction; internal BigSetBTreeManager(Transaction transaction) { _transaction = transaction; } internal virtual BTree ProduceBTree(int id) { AssertValidBTreeId(id); BTree bTree = ExistingBTreeInTransactionWith(id); if (null == bTree) { bTree = NewBTreeWithId(id); RegisterBTreeInTransaction(bTree); } return bTree; } internal virtual BTree NewBTree() { BTree bTree = NewBTreeWithId(0); bTree.Write(SystemTransaction()); RegisterBTreeInTransaction(bTree); return bTree; } internal virtual void EnsureIsManaged(BTree tree) { RegisterBTreeInTransaction(tree); } private BTree NewBTreeWithId(int id) { return NewBTreeWithId(id, SystemTransaction()); } private Transaction SystemTransaction() { return _transaction.SystemTransaction(); } private static BTree NewBTreeWithId(int id, Transaction systemTransaction) { return new BTree(systemTransaction, id, new IntHandler()); } private static void AssertValidBTreeId(int id) { if (id <= 0) { throw new ArgumentException(); } } private void RegisterBTreeInTransaction(BTree tree) { AssertValidBTreeId(tree.GetID()); BTreesIn(_transaction)[tree.GetID()] = tree; } private BTree ExistingBTreeInTransactionWith(int id) { return ((BTree)BTreesIn(_transaction)[id]); } private static IDictionary BTreesIn(Transaction transaction) { return ((IDictionary)transaction.Get(_bTreesInTransaction).value); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Collections/IBigSetPersistence.cs0000644000175000017500000000045711700531646033171 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Collections { public interface IBigSetPersistence { void Write(IWriteContext context); void Read(IReadContext context); void Invalidate(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IReadWriteBuffer.cs0000644000175000017500000000060611700531646030345 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal { /// public interface IReadWriteBuffer : IReadBuffer, IWriteBuffer { void IncrementOffset(int numBytes); void IncrementIntSize(); int Length(); void ReadBegin(byte identifier); void ReadEnd(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/TreeReader.cs0000644000175000017500000000376311700531646027245 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public sealed class TreeReader { private readonly IReadable i_template; private readonly ByteArrayBuffer i_bytes; private int i_current = 0; private int i_levels = 0; private int i_size; private bool i_orderOnRead; public TreeReader(ByteArrayBuffer a_bytes, IReadable a_template) : this(a_bytes, a_template, false) { } public TreeReader(ByteArrayBuffer a_bytes, IReadable a_template, bool a_orderOnRead ) { i_template = a_template; i_bytes = a_bytes; i_orderOnRead = a_orderOnRead; } public Tree Read() { return Read(i_bytes.ReadInt()); } public Tree Read(int a_size) { i_size = a_size; if (i_size > 0) { if (i_orderOnRead) { Tree tree = null; for (int i = 0; i < i_size; i++) { tree = Tree.Add(tree, (Tree)i_template.Read(i_bytes)); } return tree; } while ((1 << i_levels) < (i_size + 1)) { i_levels++; } return LinkUp(null, i_levels); } return null; } private Tree LinkUp(Tree a_preceding, int a_level) { Tree node = (Tree)i_template.Read(i_bytes); i_current++; node._preceding = a_preceding; node._subsequent = LinkDown(a_level + 1); node.CalculateSize(); if (i_current < i_size) { return LinkUp(node, a_level - 1); } return node; } private Tree LinkDown(int a_level) { if (i_current < i_size) { i_current++; if (a_level < i_levels) { Tree preceding = LinkDown(a_level + 1); Tree node = (Tree)i_template.Read(i_bytes); node._preceding = preceding; node._subsequent = LinkDown(a_level + 1); node.CalculateSize(); return node; } return (Tree)i_template.Read(i_bytes); } return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Transactionlog/0000755000175000017500000000000011700531646027652 5ustar00meebeymeebey00000000000000FileBasedTransactionLogHandler.cs0000644000175000017500000001132011700531646036103 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Transactionlog/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Foundation.IO; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Internal.Transactionlog; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Transactionlog { /// public class FileBasedTransactionLogHandler : TransactionLogHandler { internal const int LockInt = int.MaxValue - 1; private IBin _lockFile; private IBin _logFile; private readonly string _fileName; public FileBasedTransactionLogHandler(LocalObjectContainer container, string fileName ) : base(container) { _fileName = fileName; } public static string LogFileName(string fileName) { return fileName + ".log"; } public static string LockFileName(string fileName) { return fileName + ".lock"; } private IBin OpenBin(string fileName) { return new FileStorage().Open(new BinConfiguration(fileName, _container.Config(). LockFile(), 0, false)); } public override void CompleteInterruptedTransaction(int transactionId1, int transactionId2 ) { if (!System.IO.File.Exists(LockFileName(_fileName))) { return; } if (!LockFileSignalsInterruptedTransaction()) { return; } ByteArrayBuffer buffer = new ByteArrayBuffer(Const4.IntLength); OpenLogFile(); Read(_logFile, buffer); int length = buffer.ReadInt(); if (length > 0) { buffer = new ByteArrayBuffer(length); Read(_logFile, buffer); buffer.IncrementOffset(Const4.IntLength); ReadWriteSlotChanges(buffer); } DeleteLockFile(); CloseLogFile(); DeleteLogFile(); } private bool LockFileSignalsInterruptedTransaction() { OpenLockFile(); ByteArrayBuffer buffer = NewLockFileBuffer(); Read(_lockFile, buffer); for (int i = 0; i < 2; i++) { int checkInt = buffer.ReadInt(); if (checkInt != LockInt) { CloseLockFile(); return false; } } CloseLockFile(); return true; } public override void Close() { if (!LogsOpened()) { return; } CloseLockFile(); CloseLogFile(); DeleteLockFile(); DeleteLogFile(); } private void CloseLockFile() { SyncAndClose(_lockFile); _lockFile = null; } private void SyncAndClose(IBin bin) { try { bin.Sync(); } finally { bin.Close(); } } private void CloseLogFile() { SyncAndClose(_logFile); _logFile = null; } private void DeleteLockFile() { File4.Delete(LockFileName(_fileName)); } private void DeleteLogFile() { File4.Delete(LogFileName(_fileName)); } public override Slot AllocateSlot(bool append, int slotChangeCount) { // do nothing return null; } public override void ApplySlotChanges(IVisitable slotChangeTree, int slotChangeCount , Slot reservedSlot) { if (slotChangeCount < 1) { return; } IRunnable commitHook = _container.CommitHook(); FlushDatabaseFile(); EnsureLogAndLock(); int length = TransactionLogSlotLength(slotChangeCount); ByteArrayBuffer logBuffer = new ByteArrayBuffer(length); logBuffer.WriteInt(length); logBuffer.WriteInt(slotChangeCount); AppendSlotChanges(logBuffer, slotChangeTree); Write(_logFile, logBuffer); _logFile.Sync(); WriteToLockFile(LockInt); WriteSlots(slotChangeTree); commitHook.Run(); FlushDatabaseFile(); WriteToLockFile(0); } private void WriteToLockFile(int lockSignal) { ByteArrayBuffer lockBuffer = NewLockFileBuffer(); lockBuffer.WriteInt(lockSignal); lockBuffer.WriteInt(lockSignal); Write(_lockFile, lockBuffer); _lockFile.Sync(); } private ByteArrayBuffer NewLockFileBuffer() { return new ByteArrayBuffer(LockFileBufferLength()); } private int LockFileBufferLength() { return Const4.LongLength * 2; } private void EnsureLogAndLock() { if (_container.Config().IsReadOnly()) { return; } if (LogsOpened()) { return; } OpenLockFile(); OpenLogFile(); } private void OpenLogFile() { _logFile = OpenBin(LogFileName(_fileName)); } private void OpenLockFile() { _lockFile = OpenBin(LockFileName(_fileName)); } private bool LogsOpened() { return _lockFile != null; } private void Read(IBin storage, ByteArrayBuffer buffer) { storage.Read(0, buffer._buffer, buffer.Length()); } private void Write(IBin storage, ByteArrayBuffer buffer) { storage.Write(0, buffer._buffer, buffer.Length()); } } } EmbeddedTransactionLogHandler.cs0000644000175000017500000000622711700531646035770 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Transactionlog/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Internal.Transactionlog; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Transactionlog { /// public class EmbeddedTransactionLogHandler : TransactionLogHandler { public EmbeddedTransactionLogHandler(LocalObjectContainer container) : base(container ) { } public override void CompleteInterruptedTransaction(int transactionId1, int transactionId2 ) { if (transactionId1 <= 0 || transactionId1 != transactionId2) { return; } StatefulBuffer bytes = new StatefulBuffer(_container.SystemTransaction(), transactionId1 , Const4.IntLength); bytes.Read(); int length = bytes.ReadInt(); if (length > 0) { bytes = new StatefulBuffer(_container.SystemTransaction(), transactionId1, length ); bytes.Read(); bytes.IncrementOffset(Const4.IntLength); ReadWriteSlotChanges(bytes); } _container.WriteTransactionPointer(0); FlushDatabaseFile(); } public override Slot AllocateSlot(bool appendToFile, int slotChangeCount) { int transactionLogByteCount = TransactionLogSlotLength(slotChangeCount); IFreespaceManager freespaceManager = _container.FreespaceManager(); if (!appendToFile && freespaceManager != null) { Slot slot = freespaceManager.AllocateTransactionLogSlot(transactionLogByteCount); if (slot != null) { return slot; } } return _container.AppendBytes(transactionLogByteCount); } private void FreeSlot(Slot slot) { if (slot == null) { return; } if (_container.FreespaceManager() == null) { return; } _container.FreespaceManager().FreeSafeSlot(slot); } public override void ApplySlotChanges(IVisitable slotChangeTree, int slotChangeCount , Slot reservedSlot) { if (slotChangeCount > 0) { Slot transactionLogSlot = SlotLongEnoughForLog(slotChangeCount, reservedSlot) ? reservedSlot : AllocateSlot(true, slotChangeCount); StatefulBuffer buffer = new StatefulBuffer(_container.SystemTransaction(), transactionLogSlot ); buffer.WriteInt(transactionLogSlot.Length()); buffer.WriteInt(slotChangeCount); AppendSlotChanges(buffer, slotChangeTree); buffer.Write(); IRunnable commitHook = _container.CommitHook(); FlushDatabaseFile(); _container.WriteTransactionPointer(transactionLogSlot.Address()); FlushDatabaseFile(); if (WriteSlots(slotChangeTree)) { FlushDatabaseFile(); } _container.WriteTransactionPointer(0); commitHook.Run(); FlushDatabaseFile(); if (transactionLogSlot != reservedSlot) { FreeSlot(transactionLogSlot); } } FreeSlot(reservedSlot); } private bool SlotLongEnoughForLog(int slotChangeCount, Slot slot) { return slot != null && slot.Length() >= TransactionLogSlotLength(slotChangeCount); } public override void Close() { } // do nothing } } TransactionLogHandler.cs0000644000175000017500000000546111700531646034355 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Transactionlog/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Transactionlog { /// public abstract class TransactionLogHandler { protected readonly LocalObjectContainer _container; protected TransactionLogHandler(LocalObjectContainer container) { _container = container; } protected virtual LocalObjectContainer LocalContainer() { return _container; } protected void FlushDatabaseFile() { _container.SyncFiles(); } protected void AppendSlotChanges(ByteArrayBuffer writer, IVisitable slotChangeVisitable ) { slotChangeVisitable.Accept(new _IVisitor4_30(writer)); } private sealed class _IVisitor4_30 : IVisitor4 { public _IVisitor4_30(ByteArrayBuffer writer) { this.writer = writer; } public void Visit(object obj) { ((SlotChange)obj).Write(writer); } private readonly ByteArrayBuffer writer; } protected virtual bool WriteSlots(IVisitable slotChangeTree) { BooleanByRef ret = new BooleanByRef(); slotChangeTree.Accept(new _IVisitor4_39(this, ret)); return ret.value; } private sealed class _IVisitor4_39 : IVisitor4 { public _IVisitor4_39(TransactionLogHandler _enclosing, BooleanByRef ret) { this._enclosing = _enclosing; this.ret = ret; } public void Visit(object obj) { ((SlotChange)obj).WritePointer(this._enclosing._container); ret.value = true; } private readonly TransactionLogHandler _enclosing; private readonly BooleanByRef ret; } protected int TransactionLogSlotLength(int slotChangeCount) { // slotchanges * 3 for ID, address, length // 2 ints for slotlength and count return ((slotChangeCount * 3) + 2) * Const4.IntLength; } public abstract Slot AllocateSlot(bool append, int slotChangeCount); public abstract void ApplySlotChanges(IVisitable slotChangeTree, int slotChangeCount , Slot reservedSlot); public abstract void CompleteInterruptedTransaction(int transactionId1, int transactionId2 ); public abstract void Close(); protected virtual void ReadWriteSlotChanges(ByteArrayBuffer buffer) { LockedTree slotChanges = new LockedTree(); slotChanges.Read(buffer, new SlotChange(0)); if (WriteSlots(new _IVisitable_65(slotChanges))) { FlushDatabaseFile(); } } private sealed class _IVisitable_65 : IVisitable { public _IVisitable_65(LockedTree slotChanges) { this.slotChanges = slotChanges; } public void Accept(IVisitor4 visitor) { slotChanges.TraverseMutable(visitor); } private readonly LockedTree slotChanges; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/HandlerRegistry.cs0000644000175000017500000004575411700531646030337 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Internal.Handlers.Versions; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Replication; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// /// TODO: This class was written to make ObjectContainerBase /// leaner, so TransportObjectContainer has less members. /// All functionality of this class should become part of /// ObjectContainerBase and the functionality in /// ObjectContainerBase should delegate to independent /// modules without circular references. /// public sealed class HandlerRegistry { public const byte HandlerVersion = (byte)10; private readonly ObjectContainerBase _container; private static readonly IDb4oTypeImpl[] _db4oTypes = new IDb4oTypeImpl[] { new BlobImpl () }; private ITypeHandler4 _openArrayHandler; private ITypeHandler4 _openMultiDimensionalArrayHandler; private ITypeHandler4 _openTypeHandler; public StringHandler _stringHandler; private Hashtable4 _mapIdToTypeInfo = NewHashtable(); private Hashtable4 _mapReflectorToClassMetadata = NewHashtable(); private int _highestBuiltinTypeID = Handlers4.AnyArrayNId + 1; private readonly VirtualFieldMetadata[] _virtualFields = new VirtualFieldMetadata [3]; private readonly Hashtable4 _mapReflectorToTypeHandler = NewHashtable(); private SharedIndexedFields _indexes; internal IDb4oReplicationReferenceProvider _replicationReferenceProvider; private readonly Db4objects.Db4o.Internal.Diagnostic.DiagnosticProcessor _diagnosticProcessor; public bool i_encrypt; internal byte[] i_encryptor; internal int i_lastEncryptorByte; internal readonly GenericReflector _reflector; private readonly HandlerVersionRegistry _handlerVersions; private LatinStringIO _stringIO; public IReflectClass IclassCompare; internal IReflectClass IclassDb4otype; internal IReflectClass IclassDb4otypeimpl; public IReflectClass IclassInternal; internal IReflectClass IclassUnversioned; public IReflectClass IclassObject; internal IReflectClass IclassObjectcontainer; public IReflectClass IclassStaticclass; public IReflectClass IclassString; internal IReflectClass IclassTransientclass; private PrimitiveTypeMetadata _untypedArrayMetadata; private PrimitiveTypeMetadata _untypedMultiDimensionalMetadata; internal HandlerRegistry(ObjectContainerBase container, byte stringEncoding, GenericReflector reflector) { // this is the master container and not valid // for TransportObjectContainer _handlerVersions = new HandlerVersionRegistry(this); _stringIO = BuiltInStringEncoding.StringIoForEncoding(stringEncoding, container.ConfigImpl .StringEncoding()); _container = container; container._handlers = this; _reflector = reflector; _diagnosticProcessor = container.ConfigImpl.DiagnosticProcessor(); InitClassReflectors(reflector); _indexes = new SharedIndexedFields(); _virtualFields[0] = _indexes._version; _virtualFields[1] = _indexes._uUID; _virtualFields[2] = _indexes._commitTimestamp; RegisterBuiltinHandlers(); RegisterPlatformTypes(); InitArrayHandlers(); Platform4.RegisterPlatformHandlers(container); } private void InitArrayHandlers() { ITypeHandler4 elementHandler = OpenTypeHandler(); _untypedArrayMetadata = new PrimitiveTypeMetadata(Container(), new ArrayHandler(elementHandler , false), Handlers4.AnyArrayId, IclassObject); _openArrayHandler = _untypedArrayMetadata.TypeHandler(); MapTypeInfo(Handlers4.AnyArrayId, _untypedArrayMetadata, null); _untypedMultiDimensionalMetadata = new PrimitiveTypeMetadata(Container(), new MultidimensionalArrayHandler (elementHandler, false), Handlers4.AnyArrayNId, IclassObject); _openMultiDimensionalArrayHandler = _untypedMultiDimensionalMetadata.TypeHandler( ); MapTypeInfo(Handlers4.AnyArrayNId, _untypedMultiDimensionalMetadata, null); } private void RegisterPlatformTypes() { NetTypeHandler[] handlers = Platform4.Types(_container.Reflector()); for (int i = 0; i < handlers.Length; i++) { RegisterNetTypeHandler(handlers[i]); } } public void RegisterNetTypeHandler(NetTypeHandler handler) { handler.RegisterReflector(_reflector); IGenericConverter converter = (handler is IGenericConverter) ? (IGenericConverter )handler : null; RegisterBuiltinHandler(handler.GetID(), handler, true, handler.GetName(), converter ); } private void RegisterBuiltinHandlers() { IntHandler intHandler = new IntHandler(); RegisterBuiltinHandler(Handlers4.IntId, intHandler); RegisterHandlerVersion(intHandler, 0, new IntHandler0()); LongHandler longHandler = new LongHandler(); RegisterBuiltinHandler(Handlers4.LongId, longHandler); RegisterHandlerVersion(longHandler, 0, new LongHandler0()); FloatHandler floatHandler = new FloatHandler(); RegisterBuiltinHandler(Handlers4.FloatId, floatHandler); RegisterHandlerVersion(floatHandler, 0, new FloatHandler0()); BooleanHandler booleanHandler = new BooleanHandler(); RegisterBuiltinHandler(Handlers4.BooleanId, booleanHandler); // TODO: Are we missing a boolean handler version? DoubleHandler doubleHandler = new DoubleHandler(); RegisterBuiltinHandler(Handlers4.DoubleId, doubleHandler); RegisterHandlerVersion(doubleHandler, 0, new DoubleHandler0()); ByteHandler byteHandler = new ByteHandler(); RegisterBuiltinHandler(Handlers4.ByteId, byteHandler); // TODO: Are we missing a byte handler version? CharHandler charHandler = new CharHandler(); RegisterBuiltinHandler(Handlers4.CharId, charHandler); // TODO: Are we missing a char handler version? ShortHandler shortHandler = new ShortHandler(); RegisterBuiltinHandler(Handlers4.ShortId, shortHandler); RegisterHandlerVersion(shortHandler, 0, new ShortHandler0()); _stringHandler = new StringHandler(); RegisterBuiltinHandler(Handlers4.StringId, _stringHandler); RegisterHandlerVersion(_stringHandler, 0, new StringHandler0()); DateHandler dateHandler = new DateHandler(); RegisterBuiltinHandler(Handlers4.DateId, dateHandler); RegisterHandlerVersion(dateHandler, 0, new DateHandler0()); RegisterUntypedHandlers(); RegisterCompositeHandlerVersions(); } private void RegisterUntypedHandlers() { _openTypeHandler = new Db4objects.Db4o.Internal.OpenTypeHandler(Container()); PrimitiveTypeMetadata classMetadata = new ObjectTypeMetadata(Container(), _openTypeHandler , Handlers4.UntypedId, IclassObject); Map(Handlers4.UntypedId, classMetadata, IclassObject); RegisterHandlerVersion(_openTypeHandler, 0, new OpenTypeHandler0(Container())); RegisterHandlerVersion(_openTypeHandler, 2, new OpenTypeHandler2(Container())); RegisterHandlerVersion(_openTypeHandler, 7, new OpenTypeHandler7(Container())); } private void RegisterCompositeHandlerVersions() { RegisterHandlerVersion(new StandardReferenceTypeHandler(), 0, new StandardReferenceTypeHandler0 ()); ArrayHandler arrayHandler = new ArrayHandler(); RegisterHandlerVersion(arrayHandler, 0, new ArrayHandler0()); RegisterHandlerVersion(arrayHandler, 1, new ArrayHandler1()); RegisterHandlerVersion(arrayHandler, 3, new ArrayHandler3()); RegisterHandlerVersion(arrayHandler, 5, new ArrayHandler5()); MultidimensionalArrayHandler multidimensionalArrayHandler = new MultidimensionalArrayHandler (); RegisterHandlerVersion(multidimensionalArrayHandler, 0, new MultidimensionalArrayHandler0 ()); RegisterHandlerVersion(multidimensionalArrayHandler, 3, new MultidimensionalArrayHandler3 ()); } private void RegisterBuiltinHandler(int id, IBuiltinTypeHandler handler) { RegisterBuiltinHandler(id, handler, true, null, null); } private void RegisterBuiltinHandler(int id, IBuiltinTypeHandler typeHandler, bool registerPrimitiveClass, string primitiveName, IGenericConverter converter) { typeHandler.RegisterReflector(_reflector); if (primitiveName == null) { primitiveName = typeHandler.ClassReflector().GetName(); } if (registerPrimitiveClass) { _reflector.RegisterPrimitiveClass(id, primitiveName, converter); } IReflectClass classReflector = typeHandler.ClassReflector(); PrimitiveTypeMetadata classMetadata = new PrimitiveTypeMetadata(Container(), typeHandler , id, classReflector); Map(id, classMetadata, classReflector); if (typeHandler is PrimitiveHandler) { IReflectClass primitiveClassReflector = ((PrimitiveHandler)typeHandler).PrimitiveClassReflector (); if (primitiveClassReflector != null) { MapPrimitive(0, classMetadata, primitiveClassReflector); } } } private void Map(int id, PrimitiveTypeMetadata classMetadata, IReflectClass classReflector ) { // TODO: remove when _mapIdToClassMetadata is gone MapTypeInfo(id, classMetadata, classReflector); MapPrimitive(id, classMetadata, classReflector); if (id > _highestBuiltinTypeID) { _highestBuiltinTypeID = id; } } private void MapTypeInfo(int id, ClassMetadata classMetadata, IReflectClass classReflector ) { _mapIdToTypeInfo.Put(id, new HandlerRegistry.TypeInfo(classMetadata, classReflector )); } private void MapPrimitive(int id, ClassMetadata classMetadata, IReflectClass classReflector ) { MapClassToTypeHandler(classReflector, classMetadata.TypeHandler()); if (classReflector != null) { _mapReflectorToClassMetadata.Put(classReflector, classMetadata); } } private void MapClassToTypeHandler(IReflectClass classReflector, ITypeHandler4 typeHandler ) { _mapReflectorToTypeHandler.Put(classReflector, typeHandler); } public void RegisterHandlerVersion(ITypeHandler4 handler, int version, ITypeHandler4 replacement) { if (replacement is IBuiltinTypeHandler) { ((IBuiltinTypeHandler)replacement).RegisterReflector(_reflector); } _handlerVersions.Put(handler, version, replacement); } public ITypeHandler4 CorrectHandlerVersion(ITypeHandler4 handler, int version) { return _handlerVersions.CorrectHandlerVersion(handler, version); } public static ITypeHandler4 CorrectHandlerVersion(IHandlerVersionContext context, ITypeHandler4 typeHandler, ClassMetadata classMetadata) { ITypeHandler4 correctHandlerVersion = CorrectHandlerVersion(context, typeHandler); if (typeHandler != correctHandlerVersion) { CorrectClassMetadataOn(correctHandlerVersion, classMetadata); if (correctHandlerVersion is ArrayHandler) { ArrayHandler arrayHandler = (ArrayHandler)correctHandlerVersion; CorrectClassMetadataOn(arrayHandler.DelegateTypeHandler(), classMetadata); } } return correctHandlerVersion; } private static void CorrectClassMetadataOn(ITypeHandler4 typeHandler, ClassMetadata classMetadata) { if (typeHandler is StandardReferenceTypeHandler) { StandardReferenceTypeHandler handler = (StandardReferenceTypeHandler)typeHandler; handler.ClassMetadata(classMetadata); } } internal Db4objects.Db4o.Internal.ArrayType ArrayType(object obj) { IReflectClass claxx = Reflector().ForObject(obj); if (!claxx.IsArray()) { return Db4objects.Db4o.Internal.ArrayType.None; } if (IsNDimensional(claxx)) { return Db4objects.Db4o.Internal.ArrayType.MultidimensionalArray; } return Db4objects.Db4o.Internal.ArrayType.PlainArray; } public void Decrypt(ByteArrayBuffer reader) { if (i_encrypt) { int encryptorOffSet = i_lastEncryptorByte; byte[] bytes = reader._buffer; for (int i = reader.Length() - 1; i >= 0; i--) { bytes[i] += i_encryptor[encryptorOffSet]; if (encryptorOffSet == 0) { encryptorOffSet = i_lastEncryptorByte; } else { encryptorOffSet--; } } } } public void Encrypt(ByteArrayBuffer reader) { if (i_encrypt) { byte[] bytes = reader._buffer; int encryptorOffSet = i_lastEncryptorByte; for (int i = reader.Length() - 1; i >= 0; i--) { bytes[i] -= i_encryptor[encryptorOffSet]; if (encryptorOffSet == 0) { encryptorOffSet = i_lastEncryptorByte; } else { encryptorOffSet--; } } } } public void OldEncryptionOff() { i_encrypt = false; i_encryptor = null; i_lastEncryptorByte = 0; Container().ConfigImpl.OldEncryptionOff(); } public IReflectClass ClassForID(int id) { HandlerRegistry.TypeInfo typeInfo = TypeInfoForID(id); if (typeInfo == null) { return null; } return typeInfo.classReflector; } private HandlerRegistry.TypeInfo TypeInfoForID(int id) { return (HandlerRegistry.TypeInfo)_mapIdToTypeInfo.Get(id); } private void InitClassReflectors(GenericReflector reflector) { IclassCompare = reflector.ForClass(Const4.ClassCompare); IclassDb4otype = reflector.ForClass(Const4.ClassDb4otype); IclassDb4otypeimpl = reflector.ForClass(Const4.ClassDb4otypeimpl); IclassInternal = reflector.ForClass(Const4.ClassInternal); IclassUnversioned = reflector.ForClass(Const4.ClassUnversioned); IclassObject = reflector.ForClass(Const4.ClassObject); IclassObjectcontainer = reflector.ForClass(Const4.ClassObjectcontainer); IclassStaticclass = reflector.ForClass(Const4.ClassStaticclass); IclassString = reflector.ForClass(typeof(string)); IclassTransientclass = reflector.ForClass(Const4.ClassTransientclass); Platform4.RegisterCollections(reflector); } internal void InitEncryption(Config4Impl a_config) { if (a_config.Encrypt() && a_config.Password() != null && a_config.Password().Length > 0) { i_encrypt = true; i_encryptor = new byte[a_config.Password().Length]; for (int i = 0; i < i_encryptor.Length; i++) { i_encryptor[i] = (byte)(a_config.Password()[i] & unchecked((int)(0xff))); } i_lastEncryptorByte = a_config.Password().Length - 1; return; } OldEncryptionOff(); } internal static IDb4oTypeImpl GetDb4oType(IReflectClass clazz) { for (int i = 0; i < _db4oTypes.Length; i++) { if (clazz.IsInstance(_db4oTypes[i])) { return _db4oTypes[i]; } } return null; } public ClassMetadata ClassMetadataForId(int id) { HandlerRegistry.TypeInfo typeInfo = TypeInfoForID(id); if (typeInfo == null) { return null; } return typeInfo.classMetadata; } internal ClassMetadata ClassMetadataForClass(IReflectClass clazz) { if (clazz == null) { return null; } if (clazz.IsArray()) { return IsNDimensional(clazz) ? _untypedMultiDimensionalMetadata : _untypedArrayMetadata; } return (ClassMetadata)_mapReflectorToClassMetadata.Get(clazz); } public ITypeHandler4 OpenTypeHandler() { return _openTypeHandler; } public ITypeHandler4 OpenArrayHandler(IReflectClass clazz) { if (clazz.IsArray()) { if (IsNDimensional(clazz)) { return _openMultiDimensionalArrayHandler; } return _openArrayHandler; } return null; } private bool IsNDimensional(IReflectClass clazz) { return Reflector().Array().IsNDimensional(clazz); } public ITypeHandler4 TypeHandlerForClass(IReflectClass clazz) { if (clazz == null) { return null; } if (clazz.IsArray()) { if (IsNDimensional(clazz)) { return _openMultiDimensionalArrayHandler; } return _openArrayHandler; } ITypeHandler4 cachedTypeHandler = (ITypeHandler4)_mapReflectorToTypeHandler.Get(clazz ); if (cachedTypeHandler != null) { return cachedTypeHandler; } ITypeHandler4 configuredTypeHandler = ConfiguredTypeHandler(clazz); if (Handlers4.IsValueType(configuredTypeHandler)) { return configuredTypeHandler; } return null; } public bool IsSystemHandler(int id) { return id > 0 && id <= _highestBuiltinTypeID; } public int LowestValidId() { return _highestBuiltinTypeID + 1; } public VirtualFieldMetadata VirtualFieldByName(string name) { for (int i = 0; i < _virtualFields.Length; i++) { if (name.Equals(_virtualFields[i].GetName())) { return _virtualFields[i]; } } return null; } public SharedIndexedFields Indexes() { return _indexes; } public LatinStringIO StringIO() { return _stringIO; } public void StringIO(LatinStringIO io) { _stringIO = io; } private GenericReflector Reflector() { return Container().Reflector(); } private ObjectContainerBase Container() { return _container; } private static Hashtable4 NewHashtable() { return new Hashtable4(32); } public ITypeHandler4 ConfiguredTypeHandler(IReflectClass claxx) { object cachedHandler = _mapReflectorToTypeHandler.Get(claxx); if (null != cachedHandler) { return (ITypeHandler4)cachedHandler; } ITypeHandler4 typeHandler = Container().ConfigImpl.TypeHandlerForClass(claxx, HandlerVersion ); if (typeHandler is IBuiltinTypeHandler) { ((IBuiltinTypeHandler)typeHandler).RegisterReflector(Reflector()); } if (Handlers4.IsValueType(typeHandler)) { MapClassToTypeHandler(claxx, typeHandler); } return typeHandler; } public static ITypeHandler4 CorrectHandlerVersion(IHandlerVersionContext context, ITypeHandler4 handler) { int version = context.HandlerVersion(); if (version >= HandlerVersion) { return handler; } return context.Transaction().Container().Handlers.CorrectHandlerVersion(handler, version); } public bool IsTransient(IReflectClass claxx) { return IclassTransientclass.IsAssignableFrom(claxx) || Platform4.IsTransient(claxx ); } public void TreatAsOpenType(Type clazz) { MapClassToTypeHandler(ReflectClassFor(clazz), OpenTypeHandler()); } private IReflectClass ReflectClassFor(Type clazz) { return Container().Reflector().ForClass(clazz); } public Db4objects.Db4o.Internal.Diagnostic.DiagnosticProcessor DiagnosticProcessor () { return _diagnosticProcessor; } private class TypeInfo { public ClassMetadata classMetadata; public IReflectClass classReflector; public TypeInfo(ClassMetadata classMetadata_, IReflectClass classReflector_) { // TODO: remove when no longer needed in HandlerRegistry classMetadata = classMetadata_; classReflector = classReflector_; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Caching/0000755000175000017500000000000011700531646026217 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Caching/LRUCache.cs0000644000175000017500000000274711700531646030146 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Caching; namespace Db4objects.Db4o.Internal.Caching { /// internal class LRUCache : IPurgeableCache4 { private readonly IDictionary _slots; private readonly CircularBuffer4 _lru; private readonly int _maxSize; internal LRUCache(int size) { _maxSize = size; _slots = new Hashtable(size); _lru = new CircularBuffer4(size); } public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer ) { object value = _slots[key]; if (value == null) { object newValue = producer.Apply(key); if (newValue == null) { return null; } if (_slots.Count >= _maxSize) { object discarded = Sharpen.Collections.Remove(_slots, _lru.RemoveLast()); if (null != finalizer) { finalizer.Apply(discarded); } } _slots[key] = newValue; _lru.AddFirst(key); return newValue; } _lru.Remove(key); // O(N) _lru.AddFirst(key); return value; } public virtual IEnumerator GetEnumerator() { return _slots.Values.GetEnumerator(); } public virtual object Purge(object key) { object removed = Sharpen.Collections.Remove(_slots, key); if (removed == null) { return null; } _lru.Remove(key); return removed; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Caching/LRUIntCache.cs0000644000175000017500000000775311700531646030623 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Caching; namespace Db4objects.Db4o.Internal.Caching { /// internal class LRUIntCache : IPurgeableCache4 { private class Entry { internal readonly int _key; internal readonly object _value; internal LRUIntCache.Entry _previous; internal LRUIntCache.Entry _next; public Entry(int key, object value) { _key = key; _value = value; } public override string ToString() { return string.Empty + _key; } } private readonly Hashtable4 _slots; private readonly int _maxSize; private int _size; private LRUIntCache.Entry _first; private LRUIntCache.Entry _last; internal LRUIntCache(int size) { _maxSize = size; _slots = new Hashtable4(size); } public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer ) { int intKey = (((int)key)); if (_last == null) { object lastValue = producer.Apply(((int)key)); if (lastValue == null) { return null; } _size = 1; LRUIntCache.Entry lastEntry = new LRUIntCache.Entry(intKey, lastValue); _slots.Put(intKey, lastEntry); _first = lastEntry; _last = lastEntry; return lastValue; } LRUIntCache.Entry entry = (LRUIntCache.Entry)_slots.Get(intKey); if (entry == null) { if (_size >= _maxSize) { LRUIntCache.Entry oldEntry = (LRUIntCache.Entry)_slots.Remove(_last._key); _last = oldEntry._previous; _last._next = null; if (null != finalizer) { finalizer.Apply((object)oldEntry._value); } _size--; } object newValue = producer.Apply(((int)key)); if (newValue == null) { return null; } _size++; LRUIntCache.Entry newEntry = new LRUIntCache.Entry(intKey, newValue); _slots.Put(intKey, newEntry); _first._previous = newEntry; newEntry._next = _first; _first = newEntry; return newValue; } if (_first == entry) { return ((object)entry._value); } LRUIntCache.Entry previous = entry._previous; entry._previous = null; if (_last == entry) { _last = previous; } previous._next = entry._next; if (previous._next != null) { previous._next._previous = previous; } _first._previous = entry; entry._next = _first; _first = entry; return ((object)entry._value); } public virtual IEnumerator GetEnumerator() { IEnumerator i = new _IEnumerator_108(this); return i; } private sealed class _IEnumerator_108 : IEnumerator { public _IEnumerator_108(LRUIntCache _enclosing) { this._enclosing = _enclosing; this._cursor = this._enclosing._first; } private LRUIntCache.Entry _cursor; private LRUIntCache.Entry _current; public object Current { get { return this._current._value; } } public bool MoveNext() { if (this._cursor == null) { this._current = null; return false; } this._current = this._cursor; this._cursor = this._cursor._next; return true; } public void Reset() { this._cursor = this._enclosing._first; this._current = null; } private readonly LRUIntCache _enclosing; } public virtual object Purge(object key) { int intKey = (((int)key)); LRUIntCache.Entry entry = (LRUIntCache.Entry)_slots.Remove(intKey); if (entry == null) { return null; } _size--; if (_first == entry) { _first = entry._next; } if (_last == entry) { _last = entry._previous; } if (entry._previous != null) { entry._previous._next = entry._next; } if (entry._next != null) { entry._next._previous = entry._previous; } return ((object)entry._value); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Caching/CacheStatistics.cs0000644000175000017500000000272511700531646031632 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Caching; namespace Db4objects.Db4o.Internal.Caching { /// public class CacheStatistics : ICache4 { private readonly ICache4 _delegate; private int _calls; private int _misses; public CacheStatistics(ICache4 delegate_) { _delegate = delegate_; } public virtual object Produce(object key, IFunction4 producer, IProcedure4 onDiscard ) { _calls++; IFunction4 delegateProducer = new _IFunction4_26(this, producer); return _delegate.Produce(key, delegateProducer, onDiscard); } private sealed class _IFunction4_26 : IFunction4 { public _IFunction4_26(CacheStatistics _enclosing, IFunction4 producer) { this._enclosing = _enclosing; this.producer = producer; } public object Apply(object arg) { this._enclosing._misses++; return producer.Apply(arg); } private readonly CacheStatistics _enclosing; private readonly IFunction4 producer; } public virtual IEnumerator GetEnumerator() { return _delegate.GetEnumerator(); } public virtual int Calls() { return _calls; } public virtual int Misses() { return _misses; } public override string ToString() { return "Cache statistics Calls:" + _calls + " Misses:" + _misses; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Caching/ICache4.cs0000644000175000017500000000212211700531646027743 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Internal.Caching { /// public interface ICache4 : IEnumerable { /// /// Retrieves the value associated to the /// key /// from the cache. If the value is not yet /// cached /// producer /// will be called to produce it. If the cache needs to discard a value /// finalizer /// will be given a chance to process it. /// /// the key for the value - must never change - cannot be null /// will be called if value not yet in the cache - can only be null when the value is found in the cache /// /// will be called if a page needs to be discarded - can be null /// /// the cached value object Produce(object key, IFunction4 producer, IProcedure4 finalizer); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Caching/LRU2QCache.cs0000644000175000017500000000432511700531646030343 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Caching; namespace Db4objects.Db4o.Internal.Caching { /// /// Simplified version of the algorithm taken from here: /// http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.2641 /// internal class LRU2QCache : ICache4 { private readonly CircularBuffer4 _am; private readonly CircularBuffer4 _a1; private readonly IDictionary _slots; private readonly int _maxSize; private readonly int _a1_threshold; internal LRU2QCache(int maxSize) { _maxSize = maxSize; _a1_threshold = _maxSize / 4; _am = new CircularBuffer4(_maxSize); _a1 = new CircularBuffer4(_maxSize); _slots = new Hashtable(maxSize); } public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer ) { if (key == null) { throw new ArgumentNullException(); } if (_am.Remove(key)) { _am.AddFirst(key); return _slots[key]; } if (_a1.Remove(key)) { _am.AddFirst(key); return _slots[key]; } if (_slots.Count >= _maxSize) { DiscardPage(finalizer); } object value = producer.Apply(key); _slots[key] = value; _a1.AddFirst(key); return value; } private void DiscardPage(IProcedure4 finalizer) { if (_a1.Size() >= _a1_threshold) { DiscardPageFrom(_a1, finalizer); } else { DiscardPageFrom(_am, finalizer); } } private void DiscardPageFrom(CircularBuffer4 list, IProcedure4 finalizer) { Discard(list.RemoveLast(), finalizer); } private void Discard(object key, IProcedure4 finalizer) { if (null != finalizer) { finalizer.Apply(_slots[key]); } Sharpen.Collections.Remove(_slots, key); } public override string ToString() { return "LRU2QCache(am=" + ToString(_am) + ", a1=" + ToString(_a1) + ")"; } private string ToString(IEnumerable buffer) { return Iterators.ToString(buffer); } public virtual IEnumerator GetEnumerator() { return _slots.Values.GetEnumerator(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Caching/NullCache4.cs0000644000175000017500000000101311700531646030463 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Caching; namespace Db4objects.Db4o.Internal.Caching { /// public class NullCache4 : ICache4 { public virtual object Produce(object key, IFunction4 producer, IProcedure4 onDiscard ) { return producer.Apply(key); } public virtual IEnumerator GetEnumerator() { return Iterators.EmptyIterator; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Caching/LRU2QXCache.cs0000644000175000017500000000552711700531646030500 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Caching; namespace Db4objects.Db4o.Internal.Caching { /// /// Full version of the algorithm taken from here: /// http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.2641 /// internal class LRU2QXCache : ICache4 { private readonly IDictionary _slots; private readonly CircularBuffer4 _am; private readonly CircularBuffer4 _a1in; private readonly CircularBuffer4 _a1out; private readonly int _maxSize; private readonly int _inSize; public LRU2QXCache(int maxSize) { // 'eden': long-term lru queue // 'nursery': short-term fifo queue, entry point for all new items // 'backlog': fifo queue, elements may not be backed in _slots or may overlap with _am // invariant: |_slots| = |_am| + |_a1in| <= _maxSize _maxSize = maxSize; _inSize = _maxSize / 4; _slots = new Hashtable(_maxSize); _am = new CircularBuffer4(_maxSize); _a1in = new CircularBuffer4(_maxSize); _a1out = new CircularBuffer4(_maxSize / 2); } public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer ) { if (key == null) { throw new ArgumentNullException(); } if (_am.Remove(key)) { _am.AddFirst(key); return _slots[key]; } if (_a1out.Contains(key)) { ReclaimFor(key, producer, finalizer); _am.AddFirst(key); return _slots[key]; } if (_a1in.Contains(key)) { return _slots[key]; } ReclaimFor(key, producer, finalizer); _a1in.AddFirst(key); return _slots[key]; } private void ReclaimFor(object key, IFunction4 producer, IProcedure4 finalizer) { if (_slots.Count < _maxSize) { _slots[key] = producer.Apply(key); return; } if (_a1in.Size() > _inSize) { object lastKey = _a1in.RemoveLast(); Discard(lastKey, finalizer); if (_a1out.IsFull()) { _a1out.RemoveLast(); } _a1out.AddFirst(lastKey); } else { object lastKey = _am.RemoveLast(); Discard(lastKey, finalizer); } _slots[key] = producer.Apply(key); } public virtual IEnumerator GetEnumerator() { return _slots.Values.GetEnumerator(); } public override string ToString() { return "LRU2QXCache(am=" + ToString(_am) + ", a1in=" + ToString(_a1in) + ", a1out=" + ToString(_a1out) + ")" + " - " + _slots.Count; } private void Discard(object key, IProcedure4 finalizer) { object removed = Sharpen.Collections.Remove(_slots, key); if (finalizer != null) { finalizer.Apply(removed); } } private string ToString(IEnumerable buffer) { return Iterators.ToString(buffer); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Caching/LRU2QLongCache.cs0000644000175000017500000000435111700531646031162 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Caching; namespace Db4objects.Db4o.Internal.Caching { /// /// Simplified version of the algorithm taken from here: /// http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.2641 /// internal class LRU2QLongCache : ICache4 { private readonly CircularLongBuffer4 _am; private readonly CircularLongBuffer4 _a1; private readonly IDictionary _slots; private readonly int _maxSize; private readonly int _a1_threshold; internal LRU2QLongCache(int maxSize) { _maxSize = maxSize; _a1_threshold = _maxSize / 4; _am = new CircularLongBuffer4(_maxSize); _a1 = new CircularLongBuffer4(_maxSize); _slots = new Hashtable(maxSize); } public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer ) { if (_am.Remove((((long)key)))) { _am.AddFirst((((long)key))); return _slots[((long)key)]; } if (_a1.Remove((((long)key)))) { _am.AddFirst((((long)key))); return _slots[((long)key)]; } if (_slots.Count >= _maxSize) { DiscardPage(finalizer); } object value = producer.Apply(((long)key)); _slots[((long)key)] = value; _a1.AddFirst((((long)key))); return value; } private void DiscardPage(IProcedure4 finalizer) { if (_a1.Size() >= _a1_threshold) { DiscardPageFrom(_a1, finalizer); } else { DiscardPageFrom(_am, finalizer); } } private void DiscardPageFrom(CircularLongBuffer4 list, IProcedure4 finalizer) { Discard(list.RemoveLast(), finalizer); } private void Discard(long key, IProcedure4 finalizer) { if (null != finalizer) { finalizer.Apply(_slots[key]); } Sharpen.Collections.Remove(_slots, key); } public override string ToString() { return "LRU2QCache(am=" + ToString(_am) + ", a1=" + ToString(_a1) + ")"; } private string ToString(IEnumerable buffer) { return Iterators.ToString(buffer); } public virtual IEnumerator GetEnumerator() { return _slots.Values.GetEnumerator(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Caching/LRULongCache.cs0000644000175000017500000001002011700531646030745 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Caching; namespace Db4objects.Db4o.Internal.Caching { /// internal class LRULongCache : IPurgeableCache4 { private class Entry { internal readonly long _key; internal readonly object _value; internal LRULongCache.Entry _previous; internal LRULongCache.Entry _next; public Entry(long key, object value) { _key = key; _value = value; } public override string ToString() { return string.Empty + _key; } } private readonly Hashtable4 _slots; private readonly int _maxSize; private int _size; private LRULongCache.Entry _first; private LRULongCache.Entry _last; internal LRULongCache(int size) { _maxSize = size; _slots = new Hashtable4(size); } public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer ) { long longKey = (((long)key)); if (_last == null) { object lastValue = producer.Apply(((long)key)); if (lastValue == null) { return null; } _size = 1; LRULongCache.Entry lastEntry = new LRULongCache.Entry(longKey, lastValue); _slots.Put(longKey, lastEntry); _first = lastEntry; _last = lastEntry; return lastValue; } LRULongCache.Entry entry = (LRULongCache.Entry)_slots.Get(longKey); if (entry == null) { if (_size >= _maxSize) { LRULongCache.Entry oldEntry = (LRULongCache.Entry)_slots.Remove(_last._key); _last = oldEntry._previous; _last._next = null; if (null != finalizer) { finalizer.Apply((object)oldEntry._value); } _size--; } object newValue = producer.Apply(((long)key)); if (newValue == null) { return null; } _size++; LRULongCache.Entry newEntry = new LRULongCache.Entry(longKey, newValue); _slots.Put(longKey, newEntry); _first._previous = newEntry; newEntry._next = _first; _first = newEntry; return newValue; } if (_first == entry) { return ((object)entry._value); } LRULongCache.Entry previous = entry._previous; entry._previous = null; if (_last == entry) { _last = previous; } previous._next = entry._next; if (previous._next != null) { previous._next._previous = previous; } _first._previous = entry; entry._next = _first; _first = entry; return ((object)entry._value); } public virtual IEnumerator GetEnumerator() { IEnumerator i = new _IEnumerator_108(this); return i; } private sealed class _IEnumerator_108 : IEnumerator { public _IEnumerator_108(LRULongCache _enclosing) { this._enclosing = _enclosing; this._cursor = this._enclosing._first; } private LRULongCache.Entry _cursor; private LRULongCache.Entry _current; public object Current { get { return this._current._value; } } public bool MoveNext() { if (this._cursor == null) { this._current = null; return false; } this._current = this._cursor; this._cursor = this._cursor._next; return true; } public void Reset() { this._cursor = this._enclosing._first; this._current = null; } private readonly LRULongCache _enclosing; } public virtual object Purge(object key) { long longKey = (((long)key)); LRULongCache.Entry entry = (LRULongCache.Entry)_slots.Remove(longKey); if (entry == null) { return null; } _size--; if (_first == entry) { _first = entry._next; } if (_last == entry) { _last = entry._previous; } if (entry._previous != null) { entry._previous._next = entry._next; } if (entry._next != null) { entry._next._previous = entry._previous; } return ((object)entry._value); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Caching/CacheFactory.cs0000644000175000017500000000145711700531646031110 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Caching; namespace Db4objects.Db4o.Internal.Caching { /// public class CacheFactory { public static ICache4 New2QCache(int size) { return new LRU2QCache(size); } public static ICache4 New2QLongCache(int size) { return new LRU2QLongCache(size); } public static ICache4 New2QXCache(int size) { return new LRU2QXCache(size); } public static IPurgeableCache4 NewLRUCache(int size) { return new LRUCache(size); } public static IPurgeableCache4 NewLRUIntCache(int size) { return new LRUIntCache(size); } public static IPurgeableCache4 NewLRULongCache(int size) { return new LRULongCache(size); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Caching/IPurgeableCache4.cs0000644000175000017500000000103111700531646031570 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Caching; namespace Db4objects.Db4o.Internal.Caching { /// public interface IPurgeableCache4 : ICache4 { /// Removes the cached value with the specified key from this cache. /// Removes the cached value with the specified key from this cache. /// /// the purged value or null object Purge(object key); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Transaction.cs0000644000175000017500000002235411700531646027505 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.References; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal { /// public abstract class Transaction { private IContext _context; internal Tree _delete; protected readonly Db4objects.Db4o.Internal.Transaction _systemTransaction; /// /// This is the inside representation to operate against, the actual /// file-based ObjectContainerBase or the client. /// /// /// This is the inside representation to operate against, the actual /// file-based ObjectContainerBase or the client. For all calls /// against this ObjectContainerBase the method signatures that take /// a transaction have to be used. /// private readonly ObjectContainerBase _container; /// This is the outside representation to the user. /// /// This is the outside representation to the user. This ObjectContainer /// should use this transaction as it's main user transation, so it also /// allows using the method signatures on ObjectContainer without a /// transaction. /// private IObjectContainer _objectContainer; private List4 _transactionListeners; private readonly IReferenceSystem _referenceSystem; private readonly IDictionary _locals = new Hashtable(); public Transaction(ObjectContainerBase container, Db4objects.Db4o.Internal.Transaction systemTransaction, IReferenceSystem referenceSystem) { // contains DeleteInfo nodes _container = container; _systemTransaction = systemTransaction; _referenceSystem = referenceSystem; } /// Retrieves the value of a transaction local variables. /// /// Retrieves the value of a transaction local variables. /// If this is the first time the variable is accessed /// TransactionLocal.InitialValueFor(Transaction) /// /// will provide the initial value. /// public virtual ByRef Get(TransactionLocal local) { ByRef existing = (ByRef)_locals[local]; if (null != existing) { return existing; } ByRef initialValue = ByRef.NewInstance(local.InitialValueFor(this)); _locals[local] = initialValue; return initialValue; } public void CheckSynchronization() { } public virtual void AddTransactionListener(ITransactionListener listener) { _transactionListeners = new List4(_transactionListeners, listener); } protected void ClearAll() { Clear(); _transactionListeners = null; _locals.Clear(); } protected abstract void Clear(); public virtual void Close(bool rollbackOnClose) { if (Container() != null) { CheckSynchronization(); Container().ReleaseSemaphores(this); DiscardReferenceSystem(); } if (rollbackOnClose) { Rollback(); } ITransactionalIdSystem idSystem = IdSystem(); if (idSystem != null) { idSystem.Close(); } } protected virtual void DiscardReferenceSystem() { if (_referenceSystem != null) { Container().ReferenceSystemRegistry().RemoveReferenceSystem(_referenceSystem); } } public abstract void Commit(); protected virtual void CommitTransactionListeners() { CheckSynchronization(); if (_transactionListeners != null) { IEnumerator i = new Iterator4Impl(_transactionListeners); while (i.MoveNext()) { ((ITransactionListener)i.Current).PreCommit(); } _transactionListeners = null; } } protected virtual bool IsSystemTransaction() { return _systemTransaction == null; } public virtual bool Delete(ObjectReference @ref, int id, int cascade) { CheckSynchronization(); if (@ref != null) { if (!_container.FlagForDelete(@ref)) { return false; } } if (DTrace.enabled) { DTrace.TransDelete.Log(id); } DeleteInfo info = (DeleteInfo)TreeInt.Find(_delete, id); if (info == null) { info = new DeleteInfo(id, @ref, cascade); _delete = Tree.Add(_delete, info); return true; } info._reference = @ref; if (cascade > info._cascade) { info._cascade = cascade; } return true; } public virtual void DontDelete(int a_id) { if (DTrace.enabled) { DTrace.TransDontDelete.Log(a_id); } if (_delete == null) { return; } _delete = TreeInt.RemoveLike((TreeInt)_delete, a_id); } public abstract void ProcessDeletes(); public virtual IReferenceSystem ReferenceSystem() { if (_referenceSystem != null) { return _referenceSystem; } return ParentTransaction().ReferenceSystem(); } public IReflector Reflector() { return Container().Reflector(); } public abstract void Rollback(); protected virtual void RollBackTransactionListeners() { CheckSynchronization(); if (_transactionListeners != null) { IEnumerator i = new Iterator4Impl(_transactionListeners); while (i.MoveNext()) { ((ITransactionListener)i.Current).PostRollback(); } _transactionListeners = null; } } internal virtual bool SupportsVirtualFields() { return true; } public virtual Db4objects.Db4o.Internal.Transaction SystemTransaction() { if (_systemTransaction != null) { return _systemTransaction; } return this; } public override string ToString() { return Container().ToString(); } public abstract void WriteUpdateAdjustIndexes(int id, ClassMetadata clazz, ArrayType typeInfo); public ObjectContainerBase Container() { return _container; } public virtual Db4objects.Db4o.Internal.Transaction ParentTransaction() { return _systemTransaction; } public virtual void RollbackReferenceSystem() { ReferenceSystem().Rollback(); } public virtual void CommitReferenceSystem() { ReferenceSystem().Commit(); } public virtual void AddNewReference(ObjectReference @ref) { ReferenceSystem().AddNewReference(@ref); } public object ObjectForIdFromCache(int id) { ObjectReference @ref = ReferenceForId(id); if (@ref == null) { return null; } object candidate = @ref.GetObject(); if (candidate == null) { RemoveReference(@ref); } return candidate; } public ObjectReference ReferenceForId(int id) { ObjectReference @ref = ReferenceSystem().ReferenceForId(id); if (@ref != null) { if (@ref.GetObject() == null) { RemoveReference(@ref); return null; } return @ref; } if (ParentTransaction() != null) { return ParentTransaction().ReferenceForId(id); } return null; } public ObjectReference ReferenceForObject(object obj) { ObjectReference @ref = ReferenceSystem().ReferenceForObject(obj); if (@ref != null) { return @ref; } if (ParentTransaction() != null) { return ParentTransaction().ReferenceForObject(obj); } return null; } public void RemoveReference(ObjectReference @ref) { ReferenceSystem().RemoveReference(@ref); // setting the ID to minus 1 ensures that the // gc mechanism does not kill the new YapObject @ref.SetID(-1); Platform4.KillYapRef(@ref.GetObjectReference()); } public void RemoveObjectFromReferenceSystem(object obj) { ObjectReference @ref = ReferenceForObject(obj); if (@ref != null) { RemoveReference(@ref); } } public virtual void SetOutSideRepresentation(IObjectContainer objectContainer) { _objectContainer = objectContainer; } public virtual IObjectContainer ObjectContainer() { if (_objectContainer != null) { return _objectContainer; } return _container; } public virtual IContext Context() { if (_context == null) { _context = new _IContext_295(this); } return _context; } private sealed class _IContext_295 : IContext { public _IContext_295(Transaction _enclosing) { this._enclosing = _enclosing; } public IObjectContainer ObjectContainer() { return this._enclosing.ObjectContainer(); } public Db4objects.Db4o.Internal.Transaction Transaction() { return this._enclosing; } private readonly Transaction _enclosing; } protected virtual void TraverseDelete(IVisitor4 deleteVisitor) { if (_delete == null) { return; } _delete.Traverse(deleteVisitor); _delete = null; } public virtual object Wrap(object value) { if (value is int) { return value; } return new TransactionContext(this, value); } public abstract ITransactionalIdSystem IdSystem(); public abstract long VersionForId(int id); public abstract long GenerateTransactionTimestamp(long forcedTimeStamp); public abstract void UseDefaultTransactionTimestamp(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/OpenTypeHandler.cs0000644000175000017500000002434511700531646030263 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Handlers.Versions; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { public class OpenTypeHandler : IReferenceTypeHandler, IValueTypeHandler, IBuiltinTypeHandler , ICascadingTypeHandler, ILinkLengthAware { private const int Hashcode = 1003303143; private ObjectContainerBase _container; public OpenTypeHandler(ObjectContainerBase container) { _container = container; } internal virtual ObjectContainerBase Container() { return _container; } public virtual IReflectClass ClassReflector() { return Container().Handlers.IclassObject; } public virtual void CascadeActivation(IActivationContext context) { object targetObject = context.TargetObject(); if (IsPlainObject(targetObject)) { return; } ITypeHandler4 typeHandler = TypeHandlerForObject(targetObject); Handlers4.CascadeActivation(context, typeHandler); } /// public virtual void Delete(IDeleteContext context) { int payLoadOffset = context.ReadInt(); if (context.IsLegacyHandlerVersion()) { context.DefragmentRecommended(); return; } if (payLoadOffset <= 0) { return; } int linkOffset = context.Offset(); context.Seek(payLoadOffset); int classMetadataID = context.ReadInt(); ITypeHandler4 typeHandler = Container().ClassMetadataForID(classMetadataID).TypeHandler (); if (typeHandler != null) { context.Delete(typeHandler); } context.Seek(linkOffset); } public virtual int GetID() { return Handlers4.UntypedId; } public virtual bool HasField(ObjectContainerBase a_stream, string a_path) { return a_stream.ClassCollection().FieldExists(a_path); } public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { int payLoadOffSet = context.ReadInt(); if (payLoadOffSet == 0) { return null; } context.Seek(payLoadOffSet); int classMetadataID = context.ReadInt(); ClassMetadata classMetadata = context.Container().ClassMetadataForID(classMetadataID ); if (classMetadata == null) { return null; } return classMetadata.ReadCandidateHandler(context); } public virtual ObjectID ReadObjectID(IInternalReadContext context) { int payloadOffset = context.ReadInt(); if (payloadOffset == 0) { return ObjectID.IsNull; } int savedOffset = context.Offset(); ITypeHandler4 typeHandler = ReadTypeHandler(context, payloadOffset); if (typeHandler == null) { context.Seek(savedOffset); return ObjectID.IsNull; } SeekSecondaryOffset(context, typeHandler); if (typeHandler is IReadsObjectIds) { ObjectID readObjectID = ((IReadsObjectIds)typeHandler).ReadObjectID(context); context.Seek(savedOffset); return readObjectID; } context.Seek(savedOffset); return ObjectID.NotPossible; } public virtual void Defragment(IDefragmentContext context) { int payLoadOffSet = context.ReadInt(); if (payLoadOffSet == 0) { return; } int savedOffSet = context.Offset(); context.Seek(payLoadOffSet); try { int classMetadataId = context.CopyIDReturnOriginalID(); ITypeHandler4 typeHandler = CorrectTypeHandlerVersionFor(context, classMetadataId ); if (typeHandler == null) { return; } SeekSecondaryOffset(context, typeHandler); if (IsPlainObject(typeHandler)) { context.Defragment(new PlainObjectHandler()); } else { context.Defragment(typeHandler); } } finally { context.Seek(savedOffSet); } } protected virtual ITypeHandler4 CorrectTypeHandlerVersionFor(IDefragmentContext context , int classMetadataId) { ITypeHandler4 typeHandler = context.TypeHandlerForId(classMetadataId); if (null == typeHandler) { return null; } ClassMetadata classMetadata = Container(context).ClassMetadataForID(classMetadataId ); return HandlerRegistry.CorrectHandlerVersion(context, typeHandler, classMetadata); } protected virtual ObjectContainerBase Container(IDefragmentContext context) { return context.Transaction().Container(); } protected virtual ITypeHandler4 ReadTypeHandler(IInternalReadContext context, int payloadOffset) { context.Seek(payloadOffset); ITypeHandler4 typeHandler = Container().TypeHandlerForClassMetadataID(context.ReadInt ()); return HandlerRegistry.CorrectHandlerVersion(context, typeHandler); } /// /// protected virtual void SeekSecondaryOffset(IReadBuffer buffer, ITypeHandler4 typeHandler ) { } // do nothing, no longer needed in current implementation. public virtual object Read(IReadContext readContext) { IInternalReadContext context = (IInternalReadContext)readContext; int payloadOffset = context.ReadInt(); if (payloadOffset == 0) { context.NotifyNullReferenceSkipped(); return null; } int savedOffSet = context.Offset(); try { ITypeHandler4 typeHandler = ReadTypeHandler(context, payloadOffset); if (typeHandler == null) { return null; } SeekSecondaryOffset(context, typeHandler); if (IsPlainObject(typeHandler)) { return context.ReadAtCurrentSeekPosition(new PlainObjectHandler()); } return context.ReadAtCurrentSeekPosition(typeHandler); } finally { context.Seek(savedOffSet); } } public virtual void Activate(IReferenceActivationContext context) { } // throw new IllegalStateException(); public virtual void CollectIDs(QueryingReadContext readContext) { IInternalReadContext context = (IInternalReadContext)readContext; int payloadOffset = context.ReadInt(); if (payloadOffset == 0) { return; } int savedOffSet = context.Offset(); try { ITypeHandler4 typeHandler = ReadTypeHandler(context, payloadOffset); if (typeHandler == null) { return; } SeekSecondaryOffset(context, typeHandler); if (IsPlainObject(typeHandler)) { readContext.Collector().AddId(readContext.ReadInt()); return; } CollectIdContext collectIdContext = new _CollectIdContext_201(readContext, readContext .Transaction(), readContext.Collector(), null, readContext.Buffer()); Handlers4.CollectIdsInternal(collectIdContext, context.Container().Handlers.CorrectHandlerVersion (typeHandler, context.HandlerVersion()), 0, false); } finally { context.Seek(savedOffSet); } } private sealed class _CollectIdContext_201 : CollectIdContext { public _CollectIdContext_201(QueryingReadContext readContext, Transaction baseArg1 , IdObjectCollector baseArg2, ObjectHeader baseArg3, IReadBuffer baseArg4) : base (baseArg1, baseArg2, baseArg3, baseArg4) { this.readContext = readContext; } public override int HandlerVersion() { return readContext.HandlerVersion(); } public override SlotFormat SlotFormat() { return new _SlotFormatCurrent_207(); } private sealed class _SlotFormatCurrent_207 : SlotFormatCurrent { public _SlotFormatCurrent_207() { } public override bool IsIndirectedWithinSlot(ITypeHandler4 handler) { return false; } } private readonly QueryingReadContext readContext; } public virtual ITypeHandler4 ReadTypeHandlerRestoreOffset(IInternalReadContext context ) { int savedOffset = context.Offset(); int payloadOffset = context.ReadInt(); ITypeHandler4 typeHandler = payloadOffset == 0 ? null : ReadTypeHandler(context, payloadOffset); context.Seek(savedOffset); return typeHandler; } public virtual void Write(IWriteContext context, object obj) { if (obj == null) { context.WriteInt(0); return; } MarshallingContext marshallingContext = (MarshallingContext)context; ClassMetadata classMetadata = ClassMetadataFor(obj); if (classMetadata == null) { context.WriteInt(0); return; } MarshallingContextState state = marshallingContext.CurrentState(); marshallingContext.CreateChildBuffer(false); context.WriteInt(classMetadata.GetID()); WriteObject(context, classMetadata.TypeHandler(), obj); marshallingContext.RestoreState(state); } private ClassMetadata ClassMetadataFor(object obj) { return Container().ClassMetadataForObject(obj); } private void WriteObject(IWriteContext context, ITypeHandler4 typeHandler, object obj) { if (IsPlainObject(obj)) { context.WriteObject(new PlainObjectHandler(), obj); return; } if (Handlers4.UseDedicatedSlot(context, typeHandler)) { context.WriteObject(obj); } else { typeHandler.Write(context, obj); } } private bool IsPlainObject(object obj) { if (obj == null) { return false; } return obj.GetType() == Const4.ClassObject; } public static bool IsPlainObject(ITypeHandler4 typeHandler) { return typeHandler.GetType() == typeof(Db4objects.Db4o.Internal.OpenTypeHandler) || typeHandler.GetType() == typeof(OpenTypeHandler0) || typeHandler.GetType() == typeof(OpenTypeHandler2) || typeHandler.GetType() == typeof(OpenTypeHandler7); } public virtual ITypeHandler4 TypeHandlerForObject(object obj) { return ClassMetadataFor(obj).TypeHandler(); } public override bool Equals(object obj) { return obj is Db4objects.Db4o.Internal.OpenTypeHandler && !(obj is InterfaceTypeHandler ); } public override int GetHashCode() { return Hashcode; } public virtual void RegisterReflector(IReflector reflector) { } // nothing to do public virtual int LinkLength() { return Const4.IdLength; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IO/0000755000175000017500000000000011700531646025172 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IO/BlockSizeImpl.cs0000644000175000017500000000117511700531646030234 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.IO; namespace Db4objects.Db4o.Internal.IO { public class BlockSizeImpl : IBlockSize { private readonly ListenerRegistry _listenerRegistry = ListenerRegistry.NewInstance (); private int _value; public virtual void Register(IListener4 listener) { _listenerRegistry.Register(listener); } public virtual void Set(int newValue) { _value = newValue; _listenerRegistry.NotifyListeners(_value); } public virtual int Value() { return _value; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/NullFieldMetadata.cs0000644000175000017500000000111711700531646030531 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal { /// public class NullFieldMetadata : FieldMetadata { public NullFieldMetadata() : base(null) { } /// public virtual IPreparedComparison PrepareComparison(object obj) { return Null.Instance; } public sealed override object Read(IObjectIdContext context) { return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ObjectInfoCollectionImpl.cs0000644000175000017500000000124411700531646032073 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Internal { /// public sealed class ObjectInfoCollectionImpl : IObjectInfoCollection { public static readonly IObjectInfoCollection Empty = new Db4objects.Db4o.Internal.ObjectInfoCollectionImpl (Iterators.EmptyIterable); public IEnumerable _collection; public ObjectInfoCollectionImpl(IEnumerable collection) { _collection = collection; } public IEnumerator GetEnumerator() { return _collection.GetEnumerator(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/EventDispatchers.cs0000644000175000017500000001065211700531646030471 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal { /// public sealed class EventDispatchers { private sealed class _IEventDispatcher_11 : IEventDispatcher { public _IEventDispatcher_11() { } public bool Dispatch(Transaction trans, object obj, int eventID) { return true; } public bool HasEventRegistered(int eventID) { return false; } } public static readonly IEventDispatcher NullDispatcher = new _IEventDispatcher_11 (); private static readonly string[] events = new string[] { "objectCanDelete", "objectOnDelete" , "objectOnActivate", "objectOnDeactivate", "objectOnNew", "objectOnUpdate", "objectCanActivate" , "objectCanDeactivate", "objectCanNew", "objectCanUpdate" }; internal const int CanDelete = 0; internal const int Delete = 1; internal const int Activate = 2; internal const int Deactivate = 3; internal const int New = 4; public const int Update = 5; internal const int CanActivate = 6; internal const int CanDeactivate = 7; internal const int CanNew = 8; internal const int CanUpdate = 9; internal const int DeleteCount = 2; internal const int Count = 10; private class EventDispatcherImpl : IEventDispatcher { private readonly IReflectMethod[] methods; public EventDispatcherImpl(IReflectMethod[] methods_) { methods = methods_; } public virtual bool HasEventRegistered(int eventID) { return methods[eventID] != null; } public virtual bool Dispatch(Transaction trans, object obj, int eventID) { if (methods[eventID] == null) { return true; } object[] parameters = new object[] { trans.ObjectContainer() }; ObjectContainerBase container = trans.Container(); int stackDepth = container.StackDepth(); int topLevelCallId = container.TopLevelCallId(); container.StackDepth(0); try { object res = methods[eventID].Invoke(obj, parameters); if (res is bool) { return ((bool)res); } } finally { container.StackDepth(stackDepth); container.TopLevelCallId(topLevelCallId); } return true; } } public static IEventDispatcher ForClass(ObjectContainerBase container, IReflectClass classReflector) { if (container == null || classReflector == null) { throw new ArgumentNullException(); } if (!container.DispatchsEvents()) { return NullDispatcher; } int count = EventCountFor(container); if (count == 0) { return NullDispatcher; } IReflectMethod[] handlers = EventHandlerTableFor(container, classReflector); return HasEventHandler(handlers) ? new EventDispatchers.EventDispatcherImpl(handlers ) : NullDispatcher; } private static IReflectMethod[] EventHandlerTableFor(ObjectContainerBase container , IReflectClass classReflector) { IReflectClass[] parameterClasses = new IReflectClass[] { container._handlers.IclassObjectcontainer }; IReflectMethod[] methods = new IReflectMethod[Count]; for (int i = Count - 1; i >= 0; i--) { IReflectMethod method = classReflector.GetMethod(events[i], parameterClasses); if (null == method) { method = classReflector.GetMethod(ToPascalCase(events[i]), parameterClasses); } if (method != null) { methods[i] = method; } } return methods; } private static bool HasEventHandler(IReflectMethod[] methods) { return Iterators.Any(Iterators.Iterate(methods), new _IPredicate4_118()); } private sealed class _IPredicate4_118 : IPredicate4 { public _IPredicate4_118() { } public bool Match(object candidate) { return candidate != null; } } private static int EventCountFor(ObjectContainerBase container) { CallBackMode callbackMode = container.ConfigImpl.CallbackMode(); if (callbackMode == CallBackMode.All) { return Count; } if (callbackMode == CallBackMode.DeleteOnly) { return DeleteCount; } return 0; } private static string ToPascalCase(string name) { return Sharpen.Runtime.Substring(name, 0, 1).ToUpper() + Sharpen.Runtime.Substring (name, 1); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Config4Field.cs0000644000175000017500000000426111700531646027452 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { public class Config4Field : Config4Abstract, IObjectField, IDeepClone { private readonly Config4Class _configClass; private bool _used; private static readonly KeySpec IndexedKey = new KeySpec(TernaryBool.Unspecified); protected Config4Field(Config4Class a_class, KeySpecHashtable4 config) : base(config ) { _configClass = a_class; } internal Config4Field(Config4Class a_class, string a_name) { _configClass = a_class; SetName(a_name); } private Config4Class ClassConfig() { return _configClass; } internal override string ClassName() { return ClassConfig().GetName(); } public virtual object DeepClone(object param) { return new Db4objects.Db4o.Internal.Config4Field((Config4Class)param, _config); } public virtual void Rename(string newName) { ClassConfig().Config().Rename(Renames.ForField(ClassName(), GetName(), newName)); SetName(newName); } public virtual void Indexed(bool flag) { PutThreeValued(IndexedKey, flag); } public virtual void InitOnUp(Transaction systemTrans, FieldMetadata fieldMetadata ) { ObjectContainerBase anyStream = systemTrans.Container(); if (!anyStream.MaintainsIndices()) { return; } if (!fieldMetadata.SupportsIndex()) { Indexed(false); } TernaryBool indexedFlag = _config.GetAsTernaryBool(IndexedKey); if (indexedFlag.DefiniteNo()) { fieldMetadata.DropIndex((LocalTransaction)systemTrans); return; } if (UseExistingIndex(systemTrans, fieldMetadata)) { return; } if (!indexedFlag.DefiniteYes()) { return; } fieldMetadata.CreateIndex(); } private bool UseExistingIndex(Transaction systemTrans, FieldMetadata fieldMetadata ) { return fieldMetadata.GetIndex(systemTrans) != null; } public virtual void Used(bool flag) { _used = flag; } public virtual bool Used() { return _used; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Renames.cs0000644000175000017500000000104211700531646026601 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o.Internal { public class Renames { public static Rename ForField(string className, string name, string newName) { return new Rename(className, name, newName); } public static Rename ForClass(string name, string newName) { return new Rename(string.Empty, name, newName); } public static Rename ForInverseQBE(Rename ren) { return new Rename(ren.rClass, null, ren.rFrom); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IllegalComparisonException.cs0000644000175000017500000000041311700531646032473 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Internal { /// [System.Serializable] public class IllegalComparisonException : Db4oRecoverableException { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/TransactionObjectCarrier.cs0000644000175000017500000000202611700531646032136 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.References; namespace Db4objects.Db4o.Internal { /// TODO: Check if all time-consuming stuff is overridden! internal class TransactionObjectCarrier : LocalTransaction { private readonly ITransactionalIdSystem _idSystem; internal TransactionObjectCarrier(ObjectContainerBase container, Transaction parentTransaction , ITransactionalIdSystem idSystem, IReferenceSystem referenceSystem) : base(container , parentTransaction, idSystem, referenceSystem) { _idSystem = idSystem; } public override void Commit() { } // do nothing internal override bool SupportsVirtualFields() { return false; } public override long VersionForId(int id) { return 0; } public override Db4objects.Db4o.Internal.CommitTimestampSupport CommitTimestampSupport () { return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IObjectContainerSpec.cs0000644000175000017500000000107711700531646031214 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal { /// Workaround to provide the Java 5 version with a hook to add ExtObjectContainer. /// /// /// Workaround to provide the Java 5 version with a hook to add ExtObjectContainer. /// (Generic method declarations won't match ungenerified YapStreamBase implementations /// otherwise and implementing it directly kills .NET conversion.) /// /// public interface IObjectContainerSpec { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ISlotCopyHandler.cs0000644000175000017500000000041311700531646030373 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public interface ISlotCopyHandler { void ProcessCopy(DefragmentContextImpl context); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/TransactionContext.cs0000644000175000017500000000065011700531646031045 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public class TransactionContext { public readonly Transaction _transaction; public readonly object _object; public TransactionContext(Transaction transaction, object obj) { _transaction = transaction; _object = obj; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/LocalPersistentBase.cs0000644000175000017500000000200311700531646031113 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal { /// public abstract class LocalPersistentBase : PersistentBase { private readonly ITransactionalIdSystem _idSystem; public LocalPersistentBase(ITransactionalIdSystem idSystem) { _idSystem = idSystem; } public LocalPersistentBase() : this(null) { } public override ITransactionalIdSystem IdSystem(Transaction trans) { if (_idSystem != null) { return _idSystem; } return base.IdSystem(trans); } protected override ByteArrayBuffer ReadBufferById(Transaction trans) { Slot slot = IdSystem(trans).CurrentSlot(GetID()); if (DTrace.enabled) { DTrace.SlotRead.LogLength(GetID(), slot); } return ((LocalObjectContainer)trans.Container()).ReadBufferBySlot(slot); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/CommitTimestampFieldMetadata.cs0000644000175000017500000000435111700531646032736 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal { /// public class CommitTimestampFieldMetadata : VirtualFieldMetadata { internal CommitTimestampFieldMetadata() : base(Handlers4.LongId, new LongHandler( )) { SetName(VirtualField.CommitTimestamp); } /// public override void AddFieldIndex(ObjectIdContextImpl context) { } public override void AddIndexEntry(Transaction trans, int parentID, object indexEntry ) { } public override void RemoveIndexEntry(Transaction trans, int parentID, object indexEntry ) { } public override void Delete(DeleteContextImpl context, bool isUpdate) { } internal override void Instantiate1(ObjectReferenceContext context) { } internal override void Marshall(Transaction trans, ObjectReference @ref, IWriteBuffer buffer, bool isMigrating, bool isNew) { } public override int LinkLength() { return 0; } public override void DefragAspect(IDefragmentContext context) { } internal override void MarshallIgnore(IWriteBuffer buffer) { } public override void Activate(UnmarshallingContext context) { } // do nothing. public override BTree GetIndex(Transaction trans) { return ((LocalTransaction)trans.SystemTransaction()).CommitTimestampSupport().TimestampToId (); } public override bool HasIndex() { return true; } protected override IFieldIndexKey CreateFieldIndexKey(int parentID, object indexEntry ) { return new CommitTimestampSupport.TimestampEntry(parentID, ((long)indexEntry)); } internal int counter = 0; public override object Read(IObjectIdContext context) { int objectId = context.ObjectId(); long version = context.Transaction().SystemTransaction().VersionForId(objectId); return version; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/BlockSizeBlockConverter.cs0000644000175000017500000000166211700531646031747 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal { /// public sealed class BlockSizeBlockConverter : IBlockConverter { private readonly int _blockSize; public BlockSizeBlockConverter(int blockSize) { _blockSize = blockSize; } public int BytesToBlocks(long bytes) { return (int)((bytes + _blockSize - 1) / _blockSize); } public int BlockAlignedBytes(int bytes) { return BytesToBlocks(bytes) * _blockSize; } public int BlocksToBytes(int blocks) { return blocks * _blockSize; } public Slot ToBlockedLength(Slot slot) { return new Slot(slot.Address(), BytesToBlocks(slot.Length())); } public Slot ToNonBlockedLength(Slot slot) { return new Slot(slot.Address(), BlocksToBytes(slot.Length())); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/0000755000175000017500000000000011700531646026736 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/IIndexedNode.cs0000644000175000017500000000076511700531646031574 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Fieldindex; namespace Db4objects.Db4o.Internal.Fieldindex { public interface IIndexedNode : IEnumerable { bool IsResolved(); IIndexedNode Resolve(); BTree GetIndex(); int ResultSize(); //FIXME: do we need this? TreeInt ToTreeInt(); void MarkAsBestIndex(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/OrIndexedLeaf.cs0000644000175000017500000000070011700531646031733 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Fieldindex; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Fieldindex { public class OrIndexedLeaf : JoinedLeaf { public OrIndexedLeaf(QCon constraint, IIndexedNodeWithRange leaf1, IIndexedNodeWithRange leaf2) : base(constraint, leaf1, leaf1.GetRange().Union(leaf2.GetRange())) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/IIndexedNodeWithRange.cs0000644000175000017500000000045111700531646033375 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Fieldindex; namespace Db4objects.Db4o.Internal.Fieldindex { public interface IIndexedNodeWithRange : IIndexedNode { IBTreeRange GetRange(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/IndexedNodeBase.cs0000644000175000017500000000377311700531646032260 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Fieldindex; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Fieldindex { public abstract class IndexedNodeBase : IIndexedNode { protected readonly QConObject _constraint; public IndexedNodeBase(QConObject qcon) { if (null == qcon) { throw new ArgumentNullException(); } if (null == qcon.GetField()) { throw new ArgumentException(); } _constraint = qcon; } public virtual TreeInt ToTreeInt() { return AddToTree(null, this); } public BTree GetIndex() { return GetYapField().GetIndex(Transaction()); } private FieldMetadata GetYapField() { return _constraint.GetField().GetFieldMetadata(); } public virtual QCon Constraint() { return _constraint; } public virtual bool IsResolved() { QCon parent = Constraint().Parent(); return null == parent || !parent.HasParent(); } public virtual IBTreeRange Search(object value) { return GetYapField().Search(Transaction(), value); } public static TreeInt AddToTree(TreeInt tree, IIndexedNode node) { IEnumerator i = node.GetEnumerator(); while (i.MoveNext()) { IFieldIndexKey composite = (IFieldIndexKey)i.Current; tree = (TreeInt)((TreeInt)Tree.Add(tree, new TreeInt(composite.ParentID()))); } return tree; } public virtual IIndexedNode Resolve() { if (IsResolved()) { return null; } return IndexedPath.NewParentPath(this, Constraint()); } private Db4objects.Db4o.Internal.Transaction Transaction() { return Constraint().Transaction(); } public abstract IEnumerator GetEnumerator(); public abstract void MarkAsBestIndex(); public abstract int ResultSize(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/QEBitmap.cs0000644000175000017500000000136611700531646030735 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Fieldindex { internal class QEBitmap { public static Db4objects.Db4o.Internal.Fieldindex.QEBitmap ForQE(QE qe) { bool[] bitmap = new bool[4]; qe.IndexBitMap(bitmap); return new Db4objects.Db4o.Internal.Fieldindex.QEBitmap(bitmap); } private QEBitmap(bool[] bitmap) { _bitmap = bitmap; } private bool[] _bitmap; public virtual bool TakeGreater() { return _bitmap[QE.Greater]; } public virtual bool TakeEqual() { return _bitmap[QE.Equal]; } public virtual bool TakeSmaller() { return _bitmap[QE.Smaller]; } } } FieldIndexProcessorResult.cs0000644000175000017500000000354311700531646034325 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Fieldindex; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Fieldindex { public class FieldIndexProcessorResult { public static readonly Db4objects.Db4o.Internal.Fieldindex.FieldIndexProcessorResult NoIndexFound = new Db4objects.Db4o.Internal.Fieldindex.FieldIndexProcessorResult (null); public static readonly Db4objects.Db4o.Internal.Fieldindex.FieldIndexProcessorResult FoundIndexButNoMatch = new Db4objects.Db4o.Internal.Fieldindex.FieldIndexProcessorResult (null); private readonly IIndexedNode _indexedNode; public FieldIndexProcessorResult(IIndexedNode indexedNode) { _indexedNode = indexedNode; } public virtual Tree ToQCandidate(QCandidates candidates) { return TreeInt.ToQCandidate(ToTreeInt(), candidates); } public virtual TreeInt ToTreeInt() { if (FoundMatch()) { return _indexedNode.ToTreeInt(); } return null; } public virtual bool FoundMatch() { return FoundIndex() && !NoMatch(); } public virtual bool FoundIndex() { return this != NoIndexFound; } public virtual bool NoMatch() { return this == FoundIndexButNoMatch; } public virtual IEnumerator IterateIDs() { return new _MappingIterator_46(_indexedNode.GetEnumerator()); } private sealed class _MappingIterator_46 : MappingIterator { public _MappingIterator_46(IEnumerator baseArg1) : base(baseArg1) { } protected override object Map(object current) { IFieldIndexKey composite = (IFieldIndexKey)current; return composite.ParentID(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/IndexedPath.cs0000644000175000017500000000324011700531646031461 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Fieldindex; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Fieldindex { public class IndexedPath : IndexedNodeBase { public static IIndexedNode NewParentPath(IIndexedNode next, QCon constraint) { if (!CanFollowParent(constraint)) { return null; } return new Db4objects.Db4o.Internal.Fieldindex.IndexedPath((QConObject)constraint .Parent(), next); } private static bool CanFollowParent(QCon con) { QCon parent = con.Parent(); FieldMetadata parentField = GetYapField(parent); if (null == parentField) { return false; } FieldMetadata conField = GetYapField(con); if (null == conField) { return false; } return parentField.HasIndex() && parentField.FieldType().IsAssignableFrom(conField .ContainingClass()); } private static FieldMetadata GetYapField(QCon con) { QField field = con.GetField(); if (null == field) { return null; } return field.GetFieldMetadata(); } private IIndexedNode _next; public IndexedPath(QConObject parent, IIndexedNode next) : base(parent) { _next = next; } public override IEnumerator GetEnumerator() { return new IndexedPathIterator(this, _next.GetEnumerator()); } public override int ResultSize() { throw new NotSupportedException(); } public override void MarkAsBestIndex() { _constraint.SetProcessedByIndex(); _next.MarkAsBestIndex(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/IndexedLeaf.cs0000644000175000017500000000264411700531646031443 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Fieldindex; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Fieldindex { /// public class IndexedLeaf : IndexedNodeBase, IIndexedNodeWithRange { private readonly IBTreeRange _range; public IndexedLeaf(QConObject qcon) : base(qcon) { _range = Search(); } private IBTreeRange Search() { IBTreeRange range = Search(Constraint().GetObject()); QEBitmap bitmap = QEBitmap.ForQE(Constraint().Evaluator()); if (bitmap.TakeGreater()) { if (bitmap.TakeEqual()) { return range.ExtendToLast(); } IBTreeRange greater = range.Greater(); if (bitmap.TakeSmaller()) { return greater.Union(range.Smaller()); } return greater; } if (bitmap.TakeSmaller()) { if (bitmap.TakeEqual()) { return range.ExtendToFirst(); } return range.Smaller(); } return range; } public override int ResultSize() { return _range.Size(); } public override IEnumerator GetEnumerator() { return _range.Keys(); } public virtual IBTreeRange GetRange() { return _range; } public override void MarkAsBestIndex() { _constraint.SetProcessedByIndex(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/FieldIndexProcessor.cs0000644000175000017500000000330011700531646033174 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Internal.Fieldindex; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Fieldindex { public class FieldIndexProcessor { private readonly QCandidates _candidates; public FieldIndexProcessor(QCandidates candidates) { _candidates = candidates; } public virtual FieldIndexProcessorResult Run() { IIndexedNode bestIndex = SelectBestIndex(); if (null == bestIndex) { return FieldIndexProcessorResult.NoIndexFound; } if (bestIndex.ResultSize() > 0) { IIndexedNode resolved = ResolveFully(bestIndex); if (null == resolved) { return FieldIndexProcessorResult.NoIndexFound; } resolved.MarkAsBestIndex(); return new FieldIndexProcessorResult(resolved); } return FieldIndexProcessorResult.FoundIndexButNoMatch; } private IIndexedNode ResolveFully(IIndexedNode bestIndex) { if (null == bestIndex) { return null; } if (bestIndex.IsResolved()) { return bestIndex; } return ResolveFully(bestIndex.Resolve()); } public virtual IIndexedNode SelectBestIndex() { IEnumerator i = CollectIndexedNodes(); if (!i.MoveNext()) { return null; } IIndexedNode best = (IIndexedNode)i.Current; while (i.MoveNext()) { IIndexedNode leaf = (IIndexedNode)i.Current; if (leaf.ResultSize() < best.ResultSize()) { best = leaf; } } return best; } public virtual IEnumerator CollectIndexedNodes() { return new IndexedNodeCollector(_candidates).GetNodes(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/JoinedLeaf.cs0000644000175000017500000000311111700531646031261 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Fieldindex; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Fieldindex { public abstract class JoinedLeaf : IIndexedNodeWithRange { private readonly QCon _constraint; private readonly IIndexedNodeWithRange _leaf1; private readonly IBTreeRange _range; public JoinedLeaf(QCon constraint, IIndexedNodeWithRange leaf1, IBTreeRange range ) { if (null == constraint || null == leaf1 || null == range) { throw new ArgumentNullException(); } _constraint = constraint; _leaf1 = leaf1; _range = range; } public virtual QCon GetConstraint() { return _constraint; } public virtual IBTreeRange GetRange() { return _range; } public virtual IEnumerator GetEnumerator() { return _range.Keys(); } public virtual TreeInt ToTreeInt() { return IndexedNodeBase.AddToTree(null, this); } public virtual BTree GetIndex() { return _leaf1.GetIndex(); } public virtual bool IsResolved() { return _leaf1.IsResolved(); } public virtual IIndexedNode Resolve() { return IndexedPath.NewParentPath(this, _constraint); } public virtual int ResultSize() { return _range.Size(); } public virtual void MarkAsBestIndex() { _leaf1.MarkAsBestIndex(); _constraint.SetProcessedByIndex(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/IndexedNodeCollector.cs0000644000175000017500000002011211700531646033316 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Fieldindex; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Fieldindex { public class IndexedNodeCollector { private readonly Collection4 _nodes; private readonly Hashtable4 _nodeCache; public IndexedNodeCollector(QCandidates candidates) { _nodes = new Collection4(); _nodeCache = new Hashtable4(); CollectIndexedNodes(candidates); } public virtual IEnumerator GetNodes() { return _nodes.GetEnumerator(); } private void CollectIndexedNodes(QCandidates candidates) { CollectIndexedNodes(candidates.IterateConstraints()); ImplicitlyAndJoinsOnSameField(); } private void ImplicitlyAndJoinsOnSameField() { object[] nodes = _nodes.ToArray(); for (int i = 0; i < nodes.Length; i++) { object node = nodes[i]; if (node is OrIndexedLeaf) { OrIndexedLeaf current = (OrIndexedLeaf)node; OrIndexedLeaf other = FindJoinOnSameFieldAtSameLevel(current); if (null != other) { nodes[Arrays4.IndexOfIdentity(nodes, other)] = null; CollectImplicitAnd(current.GetConstraint(), current, other); } } } } private OrIndexedLeaf FindJoinOnSameFieldAtSameLevel(OrIndexedLeaf join) { IEnumerator i = _nodes.GetEnumerator(); while (i.MoveNext()) { if (i.Current == join) { continue; } if (i.Current is OrIndexedLeaf) { OrIndexedLeaf current = (OrIndexedLeaf)i.Current; if (current.GetIndex() == join.GetIndex() && ParentConstraint(current) == ParentConstraint (join)) { return current; } } } return null; } private object ParentConstraint(OrIndexedLeaf node) { return node.GetConstraint().Parent(); } private void CollectIndexedNodes(IEnumerator qcons) { while (qcons.MoveNext()) { QCon qcon = (QCon)qcons.Current; if (IsCached(qcon)) { continue; } if (IsLeaf(qcon)) { if (qcon.CanLoadByIndex() && qcon.CanBeIndexLeaf()) { QConObject conObject = (QConObject)qcon; if (conObject.HasJoins()) { CollectJoinedNode(conObject); } else { CollectStandaloneNode(conObject); } } } else { if (!qcon.HasJoins()) { CollectIndexedNodes(qcon.IterateChildren()); } } } } private bool IsCached(QCon qcon) { return null != _nodeCache.Get(qcon); } private void CollectStandaloneNode(QConObject conObject) { IndexedLeaf existing = FindLeafOnSameField(conObject); if (existing != null) { CollectImplicitAnd(conObject, existing, new IndexedLeaf(conObject)); } else { _nodes.Add(new IndexedLeaf(conObject)); } } private void CollectJoinedNode(QConObject constraintWithJoins) { Collection4 joins = CollectTopLevelJoins(constraintWithJoins); if (!CanJoinsBeSearchedByIndex(joins)) { return; } if (1 == joins.Size()) { _nodes.Add(NodeForConstraint((QCon)joins.SingleElement())); return; } CollectImplicitlyAndingJoins(joins, constraintWithJoins); } private bool AllHaveSamePath(Collection4 leaves) { IEnumerator i = leaves.GetEnumerator(); i.MoveNext(); QCon first = (QCon)i.Current; while (i.MoveNext()) { if (!HaveSamePath(first, (QCon)i.Current)) { return false; } } return true; } private bool HaveSamePath(QCon x, QCon y) { if (x == y) { return true; } if (!x.OnSameFieldAs(y)) { return false; } if (!x.HasParent()) { return !y.HasParent(); } return HaveSamePath(x.Parent(), y.Parent()); } private Collection4 CollectLeaves(Collection4 joins) { Collection4 leaves = new Collection4(); CollectLeaves(leaves, joins); return leaves; } private void CollectLeaves(Collection4 leaves, Collection4 joins) { IEnumerator i = joins.GetEnumerator(); while (i.MoveNext()) { QConJoin join = ((QConJoin)i.Current); CollectLeavesFromJoin(leaves, join); } } private void CollectLeavesFromJoin(Collection4 leaves, QConJoin join) { CollectLeavesFromJoinConstraint(leaves, join.Constraint1()); CollectLeavesFromJoinConstraint(leaves, join.Constraint2()); } private void CollectLeavesFromJoinConstraint(Collection4 leaves, QCon constraint) { if (constraint is QConJoin) { CollectLeavesFromJoin(leaves, (QConJoin)constraint); } else { if (!leaves.ContainsByIdentity(constraint)) { leaves.Add(constraint); } } } private bool CanJoinsBeSearchedByIndex(Collection4 joins) { Collection4 leaves = CollectLeaves(joins); return AllHaveSamePath(leaves) && AllCanBeSearchedByIndex(leaves); } private bool AllCanBeSearchedByIndex(Collection4 leaves) { IEnumerator i = leaves.GetEnumerator(); while (i.MoveNext()) { QCon leaf = ((QCon)i.Current); if (!leaf.CanLoadByIndex()) { return false; } } return true; } private void CollectImplicitlyAndingJoins(Collection4 joins, QConObject constraintWithJoins ) { IEnumerator i = joins.GetEnumerator(); i.MoveNext(); IIndexedNodeWithRange last = NodeForConstraint((QCon)i.Current); while (i.MoveNext()) { IIndexedNodeWithRange node = NodeForConstraint((QCon)i.Current); last = new AndIndexedLeaf(constraintWithJoins, node, last); _nodes.Add(last); } } private Collection4 CollectTopLevelJoins(QConObject constraintWithJoins) { Collection4 joins = new Collection4(); CollectTopLevelJoins(joins, constraintWithJoins); return joins; } private void CollectTopLevelJoins(Collection4 joins, QCon constraintWithJoins) { IEnumerator i = constraintWithJoins.IterateJoins(); while (i.MoveNext()) { QConJoin join = (QConJoin)i.Current; if (!join.HasJoins()) { if (!joins.ContainsByIdentity(join)) { joins.Add(join); } } else { CollectTopLevelJoins(joins, join); } } } private IIndexedNodeWithRange NewNodeForConstraint(QConJoin join) { IIndexedNodeWithRange c1 = NodeForConstraint(join.Constraint1()); IIndexedNodeWithRange c2 = NodeForConstraint(join.Constraint2()); if (join.IsOr()) { return new OrIndexedLeaf(FindLeafForJoin(join), c1, c2); } return new AndIndexedLeaf(join.Constraint1(), c1, c2); } private QCon FindLeafForJoin(QConJoin join) { if (join.Constraint1() is QConObject) { return join.Constraint1(); } QCon con = join.Constraint2(); if (con is QConObject) { return con; } return FindLeafForJoin((QConJoin)con); } private IIndexedNodeWithRange NodeForConstraint(QCon con) { IIndexedNodeWithRange node = (IIndexedNodeWithRange)_nodeCache.Get(con); if (null != node || _nodeCache.ContainsKey(con)) { return node; } node = NewNodeForConstraint(con); _nodeCache.Put(con, node); return node; } private IIndexedNodeWithRange NewNodeForConstraint(QCon con) { if (con is QConJoin) { return NewNodeForConstraint((QConJoin)con); } return new IndexedLeaf((QConObject)con); } private void CollectImplicitAnd(QCon constraint, IIndexedNodeWithRange x, IIndexedNodeWithRange y) { _nodes.Remove(x); _nodes.Remove(y); _nodes.Add(new AndIndexedLeaf(constraint, x, y)); } private IndexedLeaf FindLeafOnSameField(QConObject conObject) { IEnumerator i = _nodes.GetEnumerator(); while (i.MoveNext()) { if (i.Current is IndexedLeaf) { IndexedLeaf leaf = (IndexedLeaf)i.Current; if (conObject.OnSameFieldAs(leaf.Constraint())) { return leaf; } } } return null; } private bool IsLeaf(QCon qcon) { return !qcon.HasChildren(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/IndexedPathIterator.cs0000644000175000017500000000123211700531646033172 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Fieldindex; namespace Db4objects.Db4o.Internal.Fieldindex { internal sealed class IndexedPathIterator : CompositeIterator4 { private IndexedPath _path; public IndexedPathIterator(IndexedPath path, IEnumerator iterator) : base(iterator ) { _path = path; } protected override IEnumerator NextIterator(object current) { IFieldIndexKey key = (IFieldIndexKey)current; return _path.Search(key.ParentID()).Keys(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Fieldindex/AndIndexedLeaf.cs0000644000175000017500000000070611700531646032063 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Fieldindex; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal.Fieldindex { public class AndIndexedLeaf : JoinedLeaf { public AndIndexedLeaf(QCon constraint, IIndexedNodeWithRange leaf1, IIndexedNodeWithRange leaf2) : base(constraint, leaf1, leaf1.GetRange().Intersect(leaf2.GetRange())) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Serializer.cs0000644000175000017500000000446711700531646027336 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal { /// public class Serializer { public static StatefulBuffer Marshall(Transaction ta, object obj) { SerializedGraph serialized = Marshall(ta.Container(), obj); StatefulBuffer buffer = new StatefulBuffer(ta, serialized.Length()); buffer.Append(serialized._bytes); buffer.UseSlot(serialized._id, 0, serialized.Length()); return buffer; } public static SerializedGraph Marshall(ObjectContainerBase serviceProvider, object obj) { MemoryBin memoryBin = new MemoryBin(223, GrowthStrategy()); TransportObjectContainer carrier = NewTransportObjectContainer(serviceProvider, memoryBin ); carrier.ProduceClassMetadata(carrier.Reflector().ForObject(obj)); carrier.Store(obj); int id = (int)carrier.GetID(obj); carrier.Close(); return new SerializedGraph(id, memoryBin.Data()); } private static ConstantGrowthStrategy GrowthStrategy() { return new ConstantGrowthStrategy(300); } private static TransportObjectContainer NewTransportObjectContainer(ObjectContainerBase serviceProvider, MemoryBin memoryBin) { TransportObjectContainer container = new TransportObjectContainer(serviceProvider , memoryBin); container.DeferredOpen(); return container; } public static object Unmarshall(ObjectContainerBase serviceProvider, StatefulBuffer buffer) { return Unmarshall(serviceProvider, buffer._buffer, buffer.GetID()); } public static object Unmarshall(ObjectContainerBase serviceProvider, SerializedGraph serialized) { return Unmarshall(serviceProvider, serialized._bytes, serialized._id); } public static object Unmarshall(ObjectContainerBase serviceProvider, byte[] bytes , int id) { if (id <= 0) { return null; } MemoryBin memoryBin = new MemoryBin(bytes, GrowthStrategy()); TransportObjectContainer carrier = NewTransportObjectContainer(serviceProvider, memoryBin ); object obj = carrier.GetByID(id); carrier.Activate(carrier.Transaction, obj, new FullActivationDepth()); carrier.Close(); return obj; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ICallbackInfoCollector.cs0000644000175000017500000000035511700531646031505 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal { public interface ICallbackInfoCollector { void Added(int id); void Updated(int id); void Deleted(int id); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/TreeIntObject.cs0000644000175000017500000000424111700531646027714 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public class TreeIntObject : TreeInt { public object _object; public TreeIntObject(int a_key) : base(a_key) { } public TreeIntObject(int a_key, object a_object) : base(a_key) { _object = a_object; } public override object ShallowClone() { return ShallowCloneInternal(new Db4objects.Db4o.Internal.TreeIntObject(_key)); } protected override Tree ShallowCloneInternal(Tree tree) { Db4objects.Db4o.Internal.TreeIntObject tio = (Db4objects.Db4o.Internal.TreeIntObject )base.ShallowCloneInternal(tree); tio._object = _object; return tio; } public virtual object GetObject() { return _object; } public virtual void SetObject(object obj) { _object = obj; } public override object Read(ByteArrayBuffer a_bytes) { int key = a_bytes.ReadInt(); object obj = null; if (_object is TreeInt) { obj = new TreeReader(a_bytes, (IReadable)_object).Read(); } else { obj = ((IReadable)_object).Read(a_bytes); } return new Db4objects.Db4o.Internal.TreeIntObject(key, obj); } public override void Write(ByteArrayBuffer a_writer) { a_writer.WriteInt(_key); if (_object == null) { a_writer.WriteInt(0); } else { if (_object is TreeInt) { TreeInt.Write(a_writer, (TreeInt)_object); } else { ((IReadWriteable)_object).Write(a_writer); } } } public override int OwnLength() { if (_object == null) { return Const4.IntLength * 2; } return Const4.IntLength + ((IReadable)_object).MarshalledLength(); } internal override bool VariableLength() { return true; } public static Db4objects.Db4o.Internal.TreeIntObject Add(Db4objects.Db4o.Internal.TreeIntObject tree, int key, object value) { return ((Db4objects.Db4o.Internal.TreeIntObject)Tree.Add(tree, new Db4objects.Db4o.Internal.TreeIntObject (key, value))); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IBlockConverter.cs0000644000175000017500000000063011700531646030244 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal { /// public interface IBlockConverter { int BytesToBlocks(long bytes); int BlockAlignedBytes(int bytes); int BlocksToBytes(int blocks); Slot ToBlockedLength(Slot slot); Slot ToNonBlockedLength(Slot slot); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/VirtualFieldMetadata.cs0000644000175000017500000001160311700531646031246 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Replication; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// /// TODO: refactor for symmetric inheritance - don't inherit from YapField and override, /// instead extract an abstract superclass from YapField and let both YapField and this class implement /// /// public abstract class VirtualFieldMetadata : FieldMetadata { private static readonly object AnyObject = new object(); private IReflectClass _classReflector; private IBuiltinTypeHandler _handler; internal VirtualFieldMetadata(int fieldTypeID, IBuiltinTypeHandler handler) : base (fieldTypeID) { _handler = handler; } public override ITypeHandler4 GetHandler() { return _handler; } /// public abstract override void AddFieldIndex(ObjectIdContextImpl context); public override bool Alive() { return true; } internal override bool CanAddToQuery(string fieldName) { return fieldName.Equals(GetName()); } public override bool CanBeDisabled() { return false; } public override bool CanUseNullBitmap() { return false; } public virtual IReflectClass ClassReflector(IReflector reflector) { if (_classReflector == null) { _classReflector = ((IBuiltinTypeHandler)GetHandler()).ClassReflector(); } return _classReflector; } internal override void CollectConstraints(Transaction a_trans, QConObject a_parent , object a_template, IVisitor4 a_visitor) { } // QBE constraint collection call // There isn't anything useful to do here, since virtual fields // are not on the actual object. public override void Deactivate(IActivationContext context) { } // do nothing public abstract override void Delete(DeleteContextImpl context, bool isUpdate); public override object GetOrCreate(Transaction a_trans, object a_OnObject) { // This is the first part of marshalling // Virtual fields do it all in #marshall(), the object is never used. // Returning any object here prevents triggering null handling. return AnyObject; } public override bool NeedsArrayAndPrimitiveInfo() { return false; } public override void Activate(UnmarshallingContext context) { context.ObjectReference().ProduceVirtualAttributes(); Instantiate1(context); } internal abstract void Instantiate1(ObjectReferenceContext context); public override void LoadFieldTypeById() { } // do nothing public override void Marshall(MarshallingContext context, object obj) { Marshall(context.Transaction(), context.Reference(), context, context.IsNew()); } private void Marshall(Transaction trans, ObjectReference @ref, IWriteBuffer buffer , bool isNew) { if (!trans.SupportsVirtualFields()) { MarshallIgnore(buffer); return; } ObjectContainerBase stream = trans.Container(); HandlerRegistry handlers = stream._handlers; bool migrating = false; if (stream._replicationCallState == Const4.New) { IDb4oReplicationReferenceProvider provider = handlers._replicationReferenceProvider; object parentObject = @ref.GetObject(); IDb4oReplicationReference replicationReference = provider.ReferenceFor(parentObject ); if (replicationReference != null) { migrating = true; VirtualAttributes va = @ref.ProduceVirtualAttributes(); va.i_version = replicationReference.Version(); va.i_uuid = replicationReference.LongPart(); va.i_database = replicationReference.SignaturePart(); } } if (@ref.VirtualAttributes() == null) { @ref.ProduceVirtualAttributes(); migrating = false; } Marshall(trans, @ref, buffer, migrating, isNew); } internal abstract void Marshall(Transaction trans, ObjectReference @ref, IWriteBuffer buffer, bool migrating, bool isNew); internal abstract void MarshallIgnore(IWriteBuffer writer); public virtual void ReadVirtualAttribute(ObjectReferenceContext context) { if (!context.Transaction().SupportsVirtualFields()) { IncrementOffset(context); return; } Instantiate1(context); } public override bool IsVirtual() { return true; } protected override object IndexEntryFor(object indexEntry) { return indexEntry; } protected override IIndexable4 IndexHandler(ObjectContainerBase stream) { return (IIndexable4)GetHandler(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ObjectID.cs0000644000175000017500000000324611700531646026642 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal { /// public class ObjectID { public readonly int _id; private sealed class _ObjectID_15 : Db4objects.Db4o.Internal.ObjectID { public _ObjectID_15(int baseArg1) : base(baseArg1) { } public override string ToString() { return "ObjectID.IS_NULL"; } } public static readonly Db4objects.Db4o.Internal.ObjectID IsNull = new _ObjectID_15 (-1); private sealed class _ObjectID_21 : Db4objects.Db4o.Internal.ObjectID { public _ObjectID_21(int baseArg1) : base(baseArg1) { } public override string ToString() { return "ObjectID.NOT_POSSIBLE"; } } public static readonly Db4objects.Db4o.Internal.ObjectID NotPossible = new _ObjectID_21 (-2); private sealed class _ObjectID_27 : Db4objects.Db4o.Internal.ObjectID { public _ObjectID_27(int baseArg1) : base(baseArg1) { } public override string ToString() { return "ObjectID.IGNORE"; } } public static readonly Db4objects.Db4o.Internal.ObjectID Ignore = new _ObjectID_27 (-3); public ObjectID(int id) { _id = id; } public virtual bool IsValid() { return _id > 0; } public static Db4objects.Db4o.Internal.ObjectID Read(IInternalReadContext context ) { int id = context.ReadInt(); return id == 0 ? Db4objects.Db4o.Internal.ObjectID.IsNull : new Db4objects.Db4o.Internal.ObjectID (id); } public override string ToString() { return "ObjectID(" + _id + ")"; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Diagnostic/0000755000175000017500000000000011700531646026747 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Diagnostic/DiagnosticProcessor.cs0000644000175000017500000000723511700531646033271 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Diagnostic; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Diagnostic { /// FIXME: remove me from the core and make me a facade over Events public class DiagnosticProcessor : IDiagnosticConfiguration, IDeepClone { private Collection4 _listeners; public DiagnosticProcessor() { } private DiagnosticProcessor(Collection4 listeners) { _listeners = listeners; } public virtual void AddListener(IDiagnosticListener listener) { if (_listeners == null) { _listeners = new Collection4(); } _listeners.Add(listener); } public virtual void CheckClassHasFields(ClassMetadata classMetadata) { if (classMetadata.AspectsAreNull() || classMetadata.DeclaredAspectCount() == 0) { string name = classMetadata.GetName(); string[] ignoredPackages = new string[] { "java.util." }; for (int i = 0; i < ignoredPackages.Length; i++) { if (name.IndexOf(ignoredPackages[i]) == 0) { return; } } if (IsDb4oClass(classMetadata)) { return; } OnDiagnostic(new ClassHasNoFields(name)); } } public virtual void CheckUpdateDepth(int depth) { if (depth > 1) { OnDiagnostic(new UpdateDepthGreaterOne(depth)); } } public virtual object DeepClone(object context) { return new Db4objects.Db4o.Internal.Diagnostic.DiagnosticProcessor(CloneListeners ()); } public virtual void DeletionFailed() { OnDiagnostic(new Db4objects.Db4o.Diagnostic.DeletionFailed()); } public virtual void DefragmentRecommended(DefragmentRecommendation.DefragmentRecommendationReason reason) { OnDiagnostic(new DefragmentRecommendation(reason)); } private Collection4 CloneListeners() { return _listeners != null ? new Collection4(_listeners) : null; } public virtual bool Enabled() { return _listeners != null; } private bool IsDb4oClass(ClassMetadata classMetadata) { return classMetadata.IsInternal(); } public virtual void LoadedFromClassIndex(ClassMetadata classMetadata) { if (IsDb4oClass(classMetadata)) { return; } OnDiagnostic(new Db4objects.Db4o.Diagnostic.LoadedFromClassIndex(classMetadata.GetName ())); } public virtual void DescendIntoTranslator(ClassMetadata parent, string fieldName) { OnDiagnostic(new Db4objects.Db4o.Diagnostic.DescendIntoTranslator(parent.GetName( ), fieldName)); } public virtual void NativeQueryUnoptimized(Predicate predicate, Exception exception ) { OnDiagnostic(new NativeQueryNotOptimized(predicate, exception)); } public virtual void NativeQueryOptimizerNotLoaded(int reason, Exception e) { OnDiagnostic(new Db4objects.Db4o.Diagnostic.NativeQueryOptimizerNotLoaded(reason, e)); } public virtual void ObjectFieldDoesNotExist(string className, string fieldName) { OnDiagnostic(new Db4objects.Db4o.Diagnostic.ObjectFieldDoesNotExist(className, fieldName )); } public virtual void ClassMissed(string className) { OnDiagnostic(new MissingClass(className)); } public virtual void OnDiagnostic(IDiagnostic d) { if (_listeners == null) { return; } IEnumerator i = _listeners.GetEnumerator(); while (i.MoveNext()) { ((IDiagnosticListener)i.Current).OnDiagnostic(d); } } public virtual void RemoveAllListeners() { _listeners = null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Events/0000755000175000017500000000000011700531646026127 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Events/EventRegistryImpl.cs0000644000175000017500000004770111700531646032123 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Events; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Callbacks; using Db4objects.Db4o.Internal.Events; using Db4objects.Db4o.Query; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Events { /// public class EventRegistryImpl : ICallbacks, IEventRegistry { protected System.EventHandler _queryStarted; protected System.EventHandler _queryFinished; protected System.EventHandler _creating; protected System.EventHandler _activating; protected System.EventHandler _updating; protected System.EventHandler _deleting; protected System.EventHandler _deactivating; protected System.EventHandler _created; protected System.EventHandler _activated; protected System.EventHandler _updated; protected System.EventHandler _deleted; protected System.EventHandler _deactivated; protected System.EventHandler _committing; protected System.EventHandler _committed; protected System.EventHandler _instantiated; protected System.EventHandler _classRegistered; protected System.EventHandler _closing; protected System.EventHandler _opened; // Callbacks implementation public virtual void QueryOnFinished(Transaction transaction, IQuery query) { if (!(_queryFinished != null)) { return; } WithExceptionHandling(new _IRunnable_50(this, transaction, query)); } private sealed class _IRunnable_50 : IRunnable { public _IRunnable_50(EventRegistryImpl _enclosing, Transaction transaction, IQuery query) { this._enclosing = _enclosing; this.transaction = transaction; this.query = query; } public void Run() { if (null != this._enclosing._queryFinished) this._enclosing._queryFinished(null, new QueryEventArgs(transaction, query)); } private readonly EventRegistryImpl _enclosing; private readonly Transaction transaction; private readonly IQuery query; } public virtual void QueryOnStarted(Transaction transaction, IQuery query) { if (!(_queryStarted != null)) { return; } WithExceptionHandling(new _IRunnable_59(this, transaction, query)); } private sealed class _IRunnable_59 : IRunnable { public _IRunnable_59(EventRegistryImpl _enclosing, Transaction transaction, IQuery query) { this._enclosing = _enclosing; this.transaction = transaction; this.query = query; } public void Run() { if (null != this._enclosing._queryStarted) this._enclosing._queryStarted(null, new QueryEventArgs(transaction, query)); } private readonly EventRegistryImpl _enclosing; private readonly Transaction transaction; private readonly IQuery query; } public virtual bool ObjectCanNew(Transaction transaction, object obj) { return TriggerCancellableObjectEventArgsInCallback(transaction, _creating, null, obj); } public virtual bool ObjectCanActivate(Transaction transaction, object obj) { return TriggerCancellableObjectEventArgsInCallback(transaction, _activating, null , obj); } public virtual bool ObjectCanUpdate(Transaction transaction, IObjectInfo objectInfo ) { return TriggerCancellableObjectEventArgsInCallback(transaction, _updating, objectInfo , objectInfo.GetObject()); } public virtual bool ObjectCanDelete(Transaction transaction, IObjectInfo objectInfo ) { return TriggerCancellableObjectEventArgsInCallback(transaction, _deleting, objectInfo , objectInfo.GetObject()); } public virtual bool ObjectCanDeactivate(Transaction transaction, IObjectInfo objectInfo ) { return TriggerCancellableObjectEventArgsInCallback(transaction, _deactivating, objectInfo , objectInfo.GetObject()); } public virtual void ObjectOnActivate(Transaction transaction, IObjectInfo obj) { TriggerObjectInfoEventInCallback(transaction, _activated, obj); } public virtual void ObjectOnNew(Transaction transaction, IObjectInfo obj) { TriggerObjectInfoEventInCallback(transaction, _created, obj); } public virtual void ObjectOnUpdate(Transaction transaction, IObjectInfo obj) { TriggerObjectInfoEventInCallback(transaction, _updated, obj); } public virtual void ObjectOnDelete(Transaction transaction, IObjectInfo obj) { TriggerObjectInfoEventInCallback(transaction, _deleted, obj); } public virtual void ClassOnRegistered(ClassMetadata clazz) { if (!(_classRegistered != null)) { return; } WithExceptionHandling(new _IRunnable_104(this, clazz)); } private sealed class _IRunnable_104 : IRunnable { public _IRunnable_104(EventRegistryImpl _enclosing, ClassMetadata clazz) { this._enclosing = _enclosing; this.clazz = clazz; } public void Run() { if (null != this._enclosing._classRegistered) this._enclosing._classRegistered(null, new ClassEventArgs(clazz)); } private readonly EventRegistryImpl _enclosing; private readonly ClassMetadata clazz; } public virtual void ObjectOnDeactivate(Transaction transaction, IObjectInfo obj) { TriggerObjectInfoEventInCallback(transaction, _deactivated, obj); } public virtual void ObjectOnInstantiate(Transaction transaction, IObjectInfo obj) { TriggerObjectInfoEventInCallback(transaction, _instantiated, obj); } public virtual void CommitOnStarted(Transaction transaction, CallbackObjectInfoCollections objectInfoCollections) { if (!(_committing != null)) { return; } WithExceptionHandlingInCallback(new _IRunnable_121(this, transaction, objectInfoCollections )); } private sealed class _IRunnable_121 : IRunnable { public _IRunnable_121(EventRegistryImpl _enclosing, Transaction transaction, CallbackObjectInfoCollections objectInfoCollections) { this._enclosing = _enclosing; this.transaction = transaction; this.objectInfoCollections = objectInfoCollections; } public void Run() { if (null != this._enclosing._committing) this._enclosing._committing(null, new CommitEventArgs (transaction, objectInfoCollections, false)); } private readonly EventRegistryImpl _enclosing; private readonly Transaction transaction; private readonly CallbackObjectInfoCollections objectInfoCollections; } public virtual void CommitOnCompleted(Transaction transaction, CallbackObjectInfoCollections objectInfoCollections, bool isOwnCommit) { if (!(_committed != null)) { return; } WithExceptionHandlingInCallback(new _IRunnable_132(this, transaction, objectInfoCollections , isOwnCommit)); } private sealed class _IRunnable_132 : IRunnable { public _IRunnable_132(EventRegistryImpl _enclosing, Transaction transaction, CallbackObjectInfoCollections objectInfoCollections, bool isOwnCommit) { this._enclosing = _enclosing; this.transaction = transaction; this.objectInfoCollections = objectInfoCollections; this.isOwnCommit = isOwnCommit; } public void Run() { if (null != this._enclosing._committed) this._enclosing._committed(null, new CommitEventArgs (transaction, objectInfoCollections, isOwnCommit)); } private readonly EventRegistryImpl _enclosing; private readonly Transaction transaction; private readonly CallbackObjectInfoCollections objectInfoCollections; private readonly bool isOwnCommit; } public virtual void CloseOnStarted(IObjectContainer container) { if (!(_closing != null)) { return; } WithExceptionHandlingInCallback(new _IRunnable_143(this, container)); } private sealed class _IRunnable_143 : IRunnable { public _IRunnable_143(EventRegistryImpl _enclosing, IObjectContainer container) { this._enclosing = _enclosing; this.container = container; } public void Run() { if (null != this._enclosing._closing) this._enclosing._closing(null, new ObjectContainerEventArgs (container)); } private readonly EventRegistryImpl _enclosing; private readonly IObjectContainer container; } public virtual void OpenOnFinished(IObjectContainer container) { if (!(_opened != null)) { return; } WithExceptionHandlingInCallback(new _IRunnable_154(this, container)); } private sealed class _IRunnable_154 : IRunnable { public _IRunnable_154(EventRegistryImpl _enclosing, IObjectContainer container) { this._enclosing = _enclosing; this.container = container; } public void Run() { if (null != this._enclosing._opened) this._enclosing._opened(null, new ObjectContainerEventArgs (container)); } private readonly EventRegistryImpl _enclosing; private readonly IObjectContainer container; } public virtual event System.EventHandler QueryFinished { add { _queryFinished = (System.EventHandler)System.Delegate.Combine (_queryFinished, value); } remove { _queryFinished = (System.EventHandler)System.Delegate.Remove (_queryFinished, value); } } public virtual event System.EventHandler QueryStarted { add { _queryStarted = (System.EventHandler)System.Delegate.Combine (_queryStarted, value); } remove { _queryStarted = (System.EventHandler)System.Delegate.Remove (_queryStarted, value); } } public virtual event System.EventHandler Creating { add { _creating = (System.EventHandler )System.Delegate.Combine(_creating, value); } remove { _creating = (System.EventHandler )System.Delegate.Remove(_creating, value); } } public virtual event System.EventHandler Activating { add { _activating = (System.EventHandler )System.Delegate.Combine(_activating, value); } remove { _activating = (System.EventHandler )System.Delegate.Remove(_activating, value); } } public virtual event System.EventHandler Updating { add { _updating = (System.EventHandler )System.Delegate.Combine(_updating, value); } remove { _updating = (System.EventHandler )System.Delegate.Remove(_updating, value); } } public virtual event System.EventHandler Deleting { add { _deleting = (System.EventHandler )System.Delegate.Combine(_deleting, value); } remove { _deleting = (System.EventHandler )System.Delegate.Remove(_deleting, value); } } public virtual event System.EventHandler Deactivating { add { _deactivating = (System.EventHandler )System.Delegate.Combine(_deactivating, value); } remove { _deactivating = (System.EventHandler )System.Delegate.Remove(_deactivating, value); } } public virtual event System.EventHandler Created { add { _created = (System.EventHandler)System.Delegate.Combine (_created, value); } remove { _created = (System.EventHandler)System.Delegate.Remove (_created, value); } } public virtual event System.EventHandler Activated { add { _activated = (System.EventHandler)System.Delegate.Combine (_activated, value); } remove { _activated = (System.EventHandler)System.Delegate.Remove (_activated, value); } } public virtual event System.EventHandler Updated { add { _updated = (System.EventHandler)System.Delegate.Combine (_updated, value); } remove { _updated = (System.EventHandler)System.Delegate.Remove (_updated, value); } } public virtual event System.EventHandler Deleted { add { _deleted = (System.EventHandler)System.Delegate.Combine (_deleted, value); } remove { _deleted = (System.EventHandler)System.Delegate.Remove (_deleted, value); } } public virtual event System.EventHandler Deactivated { add { _deactivated = (System.EventHandler)System.Delegate.Combine (_deactivated, value); } remove { _deactivated = (System.EventHandler)System.Delegate.Remove (_deactivated, value); } } public virtual event System.EventHandler Committing { add { _committing = (System.EventHandler)System.Delegate.Combine (_committing, value); } remove { _committing = (System.EventHandler)System.Delegate.Remove (_committing, value); } } public virtual event System.EventHandler Committed { add { _committed = (System.EventHandler)System.Delegate.Combine (_committed, value); OnCommittedListenerAdded(); } remove { _committed = (System.EventHandler)System.Delegate.Remove (_committed, value); } } public virtual event System.EventHandler ClassRegistered { add { _classRegistered = (System.EventHandler)System.Delegate.Combine (_classRegistered, value); } remove { _classRegistered = (System.EventHandler)System.Delegate.Remove (_classRegistered, value); } } public virtual event System.EventHandler Instantiated { add { _instantiated = (System.EventHandler) System.Delegate.Combine(_instantiated, value); } remove { _instantiated = (System.EventHandler) System.Delegate.Remove(_instantiated, value); } } public virtual event System.EventHandler Closing { add { _closing = (System.EventHandler) System.Delegate.Combine(_closing, value); } remove { _closing = (System.EventHandler) System.Delegate.Remove(_closing, value); } } protected virtual void OnCommittedListenerAdded() { } // do nothing public virtual bool CaresAboutCommitting() { return (_committing != null); } public virtual bool CaresAboutCommitted() { return (_committed != null); } public virtual bool CaresAboutDeleting() { return (_deleting != null); } public virtual bool CaresAboutDeleted() { return (_deleted != null); } internal virtual bool TriggerCancellableObjectEventArgsInCallback(Transaction transaction , System.EventHandler e, IObjectInfo objectInfo, object o) { if (!(e != null)) { return true; } CancellableObjectEventArgs args = new CancellableObjectEventArgs(transaction, objectInfo , o); WithExceptionHandlingInCallback(new _IRunnable_258(e, args)); return !args.IsCancelled; } private sealed class _IRunnable_258 : IRunnable { public _IRunnable_258(System.EventHandler e, CancellableObjectEventArgs args) { this.e = e; this.args = args; } public void Run() { if (null != e) e(null, args); } private readonly System.EventHandler e; private readonly CancellableObjectEventArgs args; } internal virtual void TriggerObjectInfoEventInCallback(Transaction transaction, System.EventHandler< ObjectInfoEventArgs> e, IObjectInfo o) { if (!(e != null)) { return; } WithExceptionHandlingInCallback(new _IRunnable_270(e, transaction, o)); } private sealed class _IRunnable_270 : IRunnable { public _IRunnable_270(System.EventHandler e, Transaction transaction , IObjectInfo o) { this.e = e; this.transaction = transaction; this.o = o; } public void Run() { if (null != e) e(null, new ObjectInfoEventArgs(transaction, o)); } private readonly System.EventHandler e; private readonly Transaction transaction; private readonly IObjectInfo o; } private void WithExceptionHandlingInCallback(IRunnable runnable) { try { InCallback.Run(runnable); } catch (Db4oException e) { throw; } catch (Exception x) { throw new EventException(x); } } private void WithExceptionHandling(IRunnable runnable) { try { runnable.Run(); } catch (Db4oException e) { throw; } catch (Exception x) { throw new EventException(x); } } public virtual event System.EventHandler Opened { add { _opened = (System.EventHandler)System.Delegate.Combine (_opened, value); } remove { _opened = (System.EventHandler)System.Delegate.Remove (_opened, value); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/0000755000175000017500000000000011700531646026560 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/NullFreespaceListener.cs0000644000175000017500000000110011700531646033335 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Freespace; namespace Db4objects.Db4o.Internal.Freespace { /// public class NullFreespaceListener : IFreespaceListener { public static readonly IFreespaceListener Instance = new Db4objects.Db4o.Internal.Freespace.NullFreespaceListener (); private NullFreespaceListener() { } public virtual void SlotAdded(int size) { } // do nothing; public virtual void SlotRemoved(int size) { } // do nothing } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/NullFreespaceManager.cs0000644000175000017500000000340011700531646033127 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Freespace { /// public class NullFreespaceManager : IFreespaceManager { public static readonly IFreespaceManager Instance = new Db4objects.Db4o.Internal.Freespace.NullFreespaceManager (); private NullFreespaceManager() { } public virtual Slot AllocateSlot(int length) { return null; } public virtual Slot AllocateSafeSlot(int length) { return null; } public virtual void BeginCommit() { } public virtual void Commit() { } public virtual void EndCommit() { } public virtual void Free(Slot slot) { } public virtual void FreeSelf() { } public virtual void FreeSafeSlot(Slot slot) { } public virtual void Listener(IFreespaceListener listener) { } public virtual void MigrateTo(IFreespaceManager fm) { } public virtual int SlotCount() { return 0; } public virtual void SlotFreed(Slot slot) { } public virtual void Start(int id) { } public virtual byte SystemType() { return 0; } public virtual int TotalFreespace() { return 0; } public virtual void Traverse(IVisitor4 visitor) { } public virtual void Write(LocalObjectContainer container) { } public virtual bool IsStarted() { return false; } public virtual Slot AllocateTransactionLogSlot(int length) { return null; } public virtual void Read(LocalObjectContainer container, Slot slot) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/LengthKeySlotHandler.cs0000644000175000017500000000217711700531646033150 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Freespace { /// public class LengthKeySlotHandler : SlotHandler { public virtual int CompareTo(object obj) { return _current.CompareByLength((Slot)obj); } public override IPreparedComparison PrepareComparison(IContext context, object slot ) { Slot sourceSlot = (Slot)slot; return new _IPreparedComparison_21(sourceSlot); } private sealed class _IPreparedComparison_21 : IPreparedComparison { public _IPreparedComparison_21(Slot sourceSlot) { this.sourceSlot = sourceSlot; } public int CompareTo(object obj) { Slot targetSlot = (Slot)obj; // FIXME: The comparison method in #compareByLength is the wrong way around. // Fix there and here after other references are fixed. return -sourceSlot.CompareByLength(targetSlot); } private readonly Slot sourceSlot; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/FreespaceManagerIx.cs0000644000175000017500000000421011700531646032575 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Freespace { /// Old freespacemanager, before version 7.0. /// /// Old freespacemanager, before version 7.0. /// If it is still in use freespace is dropped. /// BTreeFreespaceManager /// should be used instead. /// public class FreespaceManagerIx : AbstractFreespaceManager { public FreespaceManagerIx(int discardLimit) : base(null, discardLimit) { } public override Slot AllocateSafeSlot(int length) { return null; } public override void FreeSafeSlot(Slot slot) { } // do nothing public override void BeginCommit() { } public override void EndCommit() { } public override int SlotCount() { throw new InvalidOperationException(); } public override void Free(Slot slot) { } // Should no longer be used: Should not happen. public override void FreeSelf() { } // do nothing, freespace is dropped. public override Slot AllocateSlot(int length) { // implementation is no longer present, no freespace returned. return null; } public override void MigrateTo(IFreespaceManager fm) { } // do nothing, freespace is dropped. public override void Traverse(IVisitor4 visitor) { throw new InvalidOperationException(); } public override void Start(int id) { } public override byte SystemType() { return FmIx; } public override void Write(LocalObjectContainer container) { } public override void Commit() { } public override void Listener(IFreespaceListener listener) { } public override bool IsStarted() { return false; } public override Slot AllocateTransactionLogSlot(int length) { return null; } public override void Read(LocalObjectContainer container, Slot slot) { } } } InMemoryFreespaceManager.cs0000644000175000017500000002045311700531646033704 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Text; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Freespace { public class InMemoryFreespaceManager : AbstractFreespaceManager { private readonly TreeIntObject _finder = new TreeIntObject(0); private Tree _freeByAddress; private Tree _freeBySize; private IFreespaceListener _listener = NullFreespaceListener.Instance; public InMemoryFreespaceManager(IProcedure4 slotFreedCallback, int discardLimit) : base(slotFreedCallback, discardLimit) { } private void AddFreeSlotNodes(int address, int length) { FreeSlotNode addressNode = new FreeSlotNode(address); addressNode.CreatePeer(length); _freeByAddress = Tree.Add(_freeByAddress, addressNode); AddToFreeBySize(addressNode._peer); } private void AddToFreeBySize(FreeSlotNode node) { _freeBySize = Tree.Add(_freeBySize, node); _listener.SlotAdded(node._key); } public override Slot AllocateTransactionLogSlot(int length) { FreeSlotNode sizeNode = (FreeSlotNode)Tree.Last(_freeBySize); if (sizeNode == null || sizeNode._key < length) { return null; } // We can just be appending to the end of the file, using one // really big contigous slot that keeps growing. Let's limit. int limit = length + 100; if (sizeNode._key > limit) { return AllocateSlot(limit); } RemoveFromBothTrees(sizeNode); return new Slot(sizeNode._peer._key, sizeNode._key); } public override Slot AllocateSafeSlot(int length) { return AllocateSlot(length); } public override void FreeSafeSlot(Slot slot) { Free(slot); } public override void BeginCommit() { } // do nothing public override void Commit() { } // do nothing public override void EndCommit() { } // do nothing public override void Free(Slot slot) { int address = slot.Address(); if (address <= 0) { throw new ArgumentException(); } int length = slot.Length(); if (DTrace.enabled) { DTrace.FreespacemanagerRamFree.LogLength(address, length); } _finder._key = address; FreeSlotNode sizeNode; FreeSlotNode addressnode = (FreeSlotNode)Tree.FindSmaller(_freeByAddress, _finder ); if ((addressnode != null) && ((addressnode._key + addressnode._peer._key) == address )) { sizeNode = addressnode._peer; RemoveFromFreeBySize(sizeNode); sizeNode._key += length; FreeSlotNode secondAddressNode = (FreeSlotNode)Tree.FindGreaterOrEqual(_freeByAddress , _finder); if ((secondAddressNode != null) && (address + length == secondAddressNode._key)) { sizeNode._key += secondAddressNode._peer._key; RemoveFromBothTrees(secondAddressNode._peer); } sizeNode.RemoveChildren(); AddToFreeBySize(sizeNode); } else { addressnode = (FreeSlotNode)Tree.FindGreaterOrEqual(_freeByAddress, _finder); if ((addressnode != null) && (address + length == addressnode._key)) { sizeNode = addressnode._peer; RemoveFromBothTrees(sizeNode); sizeNode._key += length; addressnode._key = address; addressnode.RemoveChildren(); sizeNode.RemoveChildren(); _freeByAddress = Tree.Add(_freeByAddress, addressnode); AddToFreeBySize(sizeNode); } else { if (CanDiscard(length)) { return; } AddFreeSlotNodes(address, length); } } SlotFreed(slot); } public override void FreeSelf() { } // Do nothing. // The RAM manager frees itself on reading. public override Slot AllocateSlot(int length) { _finder._key = length; _finder._object = null; _freeBySize = FreeSlotNode.RemoveGreaterOrEqual((FreeSlotNode)_freeBySize, _finder ); if (_finder._object == null) { return null; } FreeSlotNode node = (FreeSlotNode)_finder._object; _listener.SlotRemoved(node._key); int blocksFound = node._key; int address = node._peer._key; _freeByAddress = _freeByAddress.RemoveNode(node._peer); int remainingBlocks = blocksFound - length; if (SplitRemainder(remainingBlocks)) { AddFreeSlotNodes(address + length, remainingBlocks); } else { length = blocksFound; } if (DTrace.enabled) { DTrace.FreespacemanagerGetSlot.LogLength(address, length); } return new Slot(address, length); } internal virtual int MarshalledLength() { return TreeInt.MarshalledLength((TreeInt)_freeBySize); } private void Read(ByteArrayBuffer reader) { FreeSlotNode.sizeLimit = DiscardLimit(); _freeBySize = new TreeReader(reader, new FreeSlotNode(0), true).Read(); ByRef addressTree = ByRef.NewInstance(); if (_freeBySize != null) { _freeBySize.Traverse(new _IVisitor4_176(addressTree)); } _freeByAddress = ((Tree)addressTree.value); } private sealed class _IVisitor4_176 : IVisitor4 { public _IVisitor4_176(ByRef addressTree) { this.addressTree = addressTree; } public void Visit(object a_object) { FreeSlotNode node = ((FreeSlotNode)a_object)._peer; addressTree.value = Tree.Add(((Tree)addressTree.value), node); } private readonly ByRef addressTree; } public override void Read(LocalObjectContainer container, Slot slot) { if (Slot.IsNull(slot)) { return; } ByteArrayBuffer buffer = container.ReadBufferBySlot(slot); if (buffer == null) { return; } Read(buffer); container.Free(slot); } private void RemoveFromBothTrees(FreeSlotNode sizeNode) { RemoveFromFreeBySize(sizeNode); _freeByAddress = _freeByAddress.RemoveNode(sizeNode._peer); } private void RemoveFromFreeBySize(FreeSlotNode node) { _freeBySize = _freeBySize.RemoveNode(node); _listener.SlotRemoved(node._key); } public override int SlotCount() { return Tree.Size(_freeByAddress); } public override void Start(int id) { } // this is done in read(), nothing to do here public override byte SystemType() { return FmRam; } public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("RAM FreespaceManager\n"); sb.Append("Address Index\n"); _freeByAddress.Traverse(new InMemoryFreespaceManager.ToStringVisitor(sb)); sb.Append("Length Index\n"); _freeBySize.Traverse(new InMemoryFreespaceManager.ToStringVisitor(sb)); return sb.ToString(); } public override void Traverse(IVisitor4 visitor) { if (_freeByAddress == null) { return; } _freeByAddress.Traverse(new _IVisitor4_236(visitor)); } private sealed class _IVisitor4_236 : IVisitor4 { public _IVisitor4_236(IVisitor4 visitor) { this.visitor = visitor; } public void Visit(object a_object) { FreeSlotNode fsn = (FreeSlotNode)a_object; int address = fsn._key; int length = fsn._peer._key; visitor.Visit(new Slot(address, length)); } private readonly IVisitor4 visitor; } public override void Write(LocalObjectContainer container) { Slot slot = container.AllocateSlot(MarshalledLength()); while (slot.Length() < MarshalledLength()) { // This can happen if DatabaseGrowthSize is configured. // Allocating a slot may produce an additional entry // in this FreespaceManager. container.Free(slot); slot = container.AllocateSlot(MarshalledLength()); } ByteArrayBuffer buffer = new ByteArrayBuffer(slot.Length()); TreeInt.Write(buffer, (TreeInt)_freeBySize); container.WriteEncrypt(buffer, slot.Address(), 0); container.SystemData().InMemoryFreespaceSlot(slot); } internal sealed class ToStringVisitor : IVisitor4 { private readonly StringBuilder _sb; internal ToStringVisitor(StringBuilder sb) { _sb = sb; } public void Visit(object obj) { _sb.Append(obj); _sb.Append("\n"); } } public override void Listener(IFreespaceListener listener) { _listener = listener; } public override bool IsStarted() { return true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/BTreeFreespaceManager.cs0000644000175000017500000001734511700531646033233 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Freespace { /// public class BTreeFreespaceManager : AbstractFreespaceManager { private readonly LocalObjectContainer _file; private InMemoryFreespaceManager _delegate; private BTree _slotsByAddress; private BTree _slotsByLength; private PersistentIntegerArray _idArray; private int _delegationRequests; private IFreespaceListener _listener = NullFreespaceListener.Instance; private ITransactionalIdSystem _idSystem; public BTreeFreespaceManager(LocalObjectContainer file, IProcedure4 slotFreedCallback , int discardLimit) : base(slotFreedCallback, discardLimit) { _file = file; _delegate = new InMemoryFreespaceManager(slotFreedCallback, discardLimit); _idSystem = file.SystemData().FreespaceIdSystem(); } private void AddSlot(Slot slot) { _slotsByLength.Add(Transaction(), slot); _slotsByAddress.Add(Transaction(), slot); _listener.SlotAdded(slot.Length()); } public override Slot AllocateSafeSlot(int length) { return _delegate.AllocateSafeSlot(length); } public override void BeginCommit() { BeginDelegation(); } private void BeginDelegation() { _delegationRequests++; } public override void Commit() { _slotsByAddress.Commit(Transaction()); _slotsByLength.Commit(Transaction()); } private void CreateBTrees(int addressID, int lengthID) { BTreeConfiguration config = new BTreeConfiguration(_idSystem, SlotChangeFactory.FreeSpace , 64, false); _slotsByAddress = new BTree(Transaction(), config, addressID, new AddressKeySlotHandler ()); _slotsByLength = new BTree(Transaction(), config, lengthID, new LengthKeySlotHandler ()); } public override void EndCommit() { EndDelegation(); } private void EndDelegation() { _delegationRequests--; } public override void Free(Slot slot) { if (!IsStarted()) { return; } if (IsDelegating()) { _delegate.Free(slot); return; } try { BeginDelegation(); if (DTrace.enabled) { DTrace.FreespacemanagerBtreeFree.LogLength(slot.Address(), slot.Length()); } Slot[] remove = new Slot[2]; Slot newFreeSlot = slot; BTreePointer pointer = SearchBTree(_slotsByAddress, slot, SearchTarget.Lowest); BTreePointer previousPointer = pointer != null ? pointer.Previous() : _slotsByAddress .LastPointer(Transaction()); if (previousPointer != null) { Slot previousSlot = (Slot)previousPointer.Key(); if (previousSlot.IsDirectlyPreceding(newFreeSlot)) { remove[0] = previousSlot; newFreeSlot = previousSlot.Append(newFreeSlot); } } if (pointer != null) { Slot nextSlot = (Slot)pointer.Key(); if (newFreeSlot.IsDirectlyPreceding(nextSlot)) { remove[1] = nextSlot; newFreeSlot = newFreeSlot.Append(nextSlot); } } for (int i = 0; i < remove.Length; i++) { if (remove[i] != null) { RemoveSlot(remove[i]); } } if (!CanDiscard(newFreeSlot.Length())) { AddSlot(newFreeSlot); } SlotFreed(slot); } finally { EndDelegation(); } } public override void FreeSelf() { _slotsByAddress.Free(Transaction()); _slotsByLength.Free(Transaction()); } public override void FreeSafeSlot(Slot slot) { _delegate.FreeSafeSlot(slot); } public override Slot AllocateSlot(int length) { if (!IsStarted()) { return null; } if (IsDelegating()) { return _delegate.AllocateSlot(length); } try { BeginDelegation(); BTreePointer pointer = SearchBTree(_slotsByLength, new Slot(0, length), SearchTarget .Highest); if (pointer == null) { return null; } Slot slot = (Slot)pointer.Key(); RemoveSlot(slot); int remainingLength = slot.Length() - length; if (SplitRemainder(remainingLength)) { AddSlot(slot.SubSlot(length)); slot = slot.Truncate(length); } if (DTrace.enabled) { DTrace.FreespacemanagerGetSlot.LogLength(slot.Address(), slot.Length()); } return slot; } finally { EndDelegation(); } } private void InitializeExisting(int id) { _idArray = new PersistentIntegerArray(SlotChangeFactory.FreeSpace, _idSystem, id); _idArray.Read(Transaction()); int[] ids = _idArray.Array(); int addressId = ids[0]; int lengthID = ids[1]; CreateBTrees(addressId, lengthID); _slotsByAddress.Read(Transaction()); _slotsByLength.Read(Transaction()); _delegate.Read(_file, _file.SystemData().InMemoryFreespaceSlot()); } private void InitializeNew() { CreateBTrees(0, 0); _slotsByAddress.Write(Transaction()); _slotsByLength.Write(Transaction()); int[] ids = new int[] { _slotsByAddress.GetID(), _slotsByLength.GetID() }; _idArray = new PersistentIntegerArray(SlotChangeFactory.FreeSpace, _idSystem, ids ); _idArray.Write(Transaction()); _file.SystemData().BTreeFreespaceId(_idArray.GetID()); } private bool IsDelegating() { return _delegationRequests > 0; } public virtual void Read(LocalObjectContainer container, int freeSpaceID) { } // do nothing // reading happens in start( ) private void RemoveSlot(Slot slot) { _slotsByLength.Remove(Transaction(), slot); _slotsByAddress.Remove(Transaction(), slot); _listener.SlotRemoved(slot.Length()); } private BTreePointer SearchBTree(BTree bTree, Slot slot, SearchTarget target) { BTreeNodeSearchResult searchResult = bTree.SearchLeaf(Transaction(), slot, target ); return searchResult.FirstValidPointer(); } public override int SlotCount() { return _slotsByAddress.Size(Transaction()) + _delegate.SlotCount(); } public override void Start(int id) { try { BeginDelegation(); if (id == 0) { InitializeNew(); } else { InitializeExisting(id); } } finally { EndDelegation(); } } public override bool IsStarted() { return _idArray != null; } public override byte SystemType() { return FmBtree; } public override string ToString() { return _slotsByLength.ToString(); } public override int TotalFreespace() { return base.TotalFreespace() + _delegate.TotalFreespace(); } public override void Traverse(IVisitor4 visitor) { _slotsByAddress.TraverseKeys(Transaction(), visitor); } public override void MigrateTo(IFreespaceManager fm) { base.MigrateTo(fm); _delegate.MigrateTo(fm); } public override void Write(LocalObjectContainer container) { try { BeginDelegation(); _delegate.Write(container); container.SystemData().BTreeFreespaceId(_idArray.GetID()); } finally { EndDelegation(); } } public override void Listener(IFreespaceListener listener) { _listener = listener; } private LocalTransaction Transaction() { return (LocalTransaction)_file.SystemTransaction(); } public override Slot AllocateTransactionLogSlot(int length) { return _delegate.AllocateTransactionLogSlot(length); } public override void Read(LocalObjectContainer container, Slot slot) { } // do nothing // everything happens in start } } AbstractFreespaceManager.cs0000644000175000017500000001376411700531646033717 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Freespace { public abstract class AbstractFreespaceManager : IFreespaceManager { public const byte FmDebug = 127; public const byte FmDefault = 0; public const byte FmLegacyRam = 1; public const byte FmRam = 2; public const byte FmIx = 3; public const byte FmBtree = 4; private const int IntsInSlot = 12; public const int RemainderSizeLimit = 20; public static byte CheckType(byte systemType) { if (systemType == FmDefault) { return FmRam; } return systemType; } protected IProcedure4 _slotFreedCallback; private readonly int _discardLimit; public AbstractFreespaceManager(IProcedure4 slotFreedCallback, int discardLimit) { _slotFreedCallback = slotFreedCallback; _discardLimit = discardLimit; } public static Db4objects.Db4o.Internal.Freespace.AbstractFreespaceManager CreateNew (LocalObjectContainer file) { return CreateNew(file, file.SystemData().FreespaceSystem()); } public static Db4objects.Db4o.Internal.Freespace.AbstractFreespaceManager CreateNew (LocalObjectContainer file, byte systemType) { systemType = CheckType(systemType); int unblockedDiscardLimit = file.ConfigImpl.DiscardFreeSpace(); int blockedDiscardLimit = unblockedDiscardLimit == int.MaxValue ? unblockedDiscardLimit : file.BlockConverter().BytesToBlocks(unblockedDiscardLimit); IProcedure4 slotFreedCallback = new _IProcedure4_50(file); switch (systemType) { case FmIx: { return new FreespaceManagerIx(blockedDiscardLimit); } case FmBtree: { return new BTreeFreespaceManager(file, slotFreedCallback, blockedDiscardLimit); } default: { return new InMemoryFreespaceManager(slotFreedCallback, blockedDiscardLimit); break; } } } private sealed class _IProcedure4_50 : IProcedure4 { public _IProcedure4_50(LocalObjectContainer file) { this.file = file; } public void Apply(object slot) { file.OverwriteDeletedBlockedSlot(((Slot)slot)); } private readonly LocalObjectContainer file; } public static int InitSlot(LocalObjectContainer file) { int address = file.AllocateSlot(SlotLength()).Address(); SlotEntryToZeroes(file, address); return address; } public virtual void MigrateTo(IFreespaceManager fm) { Traverse(new _IVisitor4_72(fm)); } private sealed class _IVisitor4_72 : IVisitor4 { public _IVisitor4_72(IFreespaceManager fm) { this.fm = fm; } public void Visit(object obj) { fm.Free((Slot)obj); } private readonly IFreespaceManager fm; } internal static void SlotEntryToZeroes(LocalObjectContainer file, int address) { StatefulBuffer writer = new StatefulBuffer(file.SystemTransaction(), address, SlotLength ()); for (int i = 0; i < IntsInSlot; i++) { writer.WriteInt(0); } writer.WriteEncrypt(); } internal static int SlotLength() { return Const4.IntLength * IntsInSlot; } public virtual int TotalFreespace() { IntByRef mint = new IntByRef(); Traverse(new _IVisitor4_97(mint)); return mint.value; } private sealed class _IVisitor4_97 : IVisitor4 { public _IVisitor4_97(IntByRef mint) { this.mint = mint; } public void Visit(object obj) { Slot slot = (Slot)obj; mint.value += slot.Length(); } private readonly IntByRef mint; } protected virtual int DiscardLimit() { return _discardLimit; } protected bool SplitRemainder(int length) { if (CanDiscard(length)) { return false; } return length > RemainderSizeLimit; } internal bool CanDiscard(int length) { return length == 0 || length < DiscardLimit(); } public static void Migrate(IFreespaceManager oldFM, IFreespaceManager newFM) { oldFM.MigrateTo(newFM); oldFM.FreeSelf(); } public virtual void DebugCheckIntegrity() { IntByRef lastStart = new IntByRef(); IntByRef lastEnd = new IntByRef(); Traverse(new _IVisitor4_129(lastEnd, lastStart)); } private sealed class _IVisitor4_129 : IVisitor4 { public _IVisitor4_129(IntByRef lastEnd, IntByRef lastStart) { this.lastEnd = lastEnd; this.lastStart = lastStart; } public void Visit(object obj) { Slot slot = (Slot)obj; if (slot.Address() <= lastEnd.value) { throw new InvalidOperationException(); } lastStart.value = slot.Address(); lastEnd.value = slot.Address() + slot.Length(); } private readonly IntByRef lastEnd; private readonly IntByRef lastStart; } public static bool MigrationRequired(byte systemType) { return systemType == FmLegacyRam || systemType == FmIx; } public virtual void SlotFreed(Slot slot) { if (_slotFreedCallback == null) { return; } _slotFreedCallback.Apply(slot); } public abstract Slot AllocateSafeSlot(int arg1); public abstract Slot AllocateSlot(int arg1); public abstract Slot AllocateTransactionLogSlot(int arg1); public abstract void BeginCommit(); public abstract void Commit(); public abstract void EndCommit(); public abstract void Free(Slot arg1); public abstract void FreeSafeSlot(Slot arg1); public abstract void FreeSelf(); public abstract bool IsStarted(); public abstract void Listener(IFreespaceListener arg1); public abstract void Read(LocalObjectContainer arg1, Slot arg2); public abstract int SlotCount(); public abstract void Start(int arg1); public abstract byte SystemType(); public abstract void Traverse(IVisitor4 arg1); public abstract void Write(LocalObjectContainer arg1); } } BlockAwareFreespaceManager.cs0000644000175000017500000000672611700531646034166 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Freespace { /// public class BlockAwareFreespaceManager : IFreespaceManager { private readonly IFreespaceManager _delegate; private readonly IBlockConverter _blockConverter; public BlockAwareFreespaceManager(IFreespaceManager delegate_, IBlockConverter blockConverter ) { _delegate = delegate_; _blockConverter = blockConverter; } public virtual Slot AllocateSlot(int length) { Slot slot = _delegate.AllocateSlot(_blockConverter.BytesToBlocks(length)); if (slot == null) { return null; } return _blockConverter.ToNonBlockedLength(slot); } public virtual Slot AllocateSafeSlot(int length) { Slot slot = _delegate.AllocateSafeSlot(_blockConverter.BytesToBlocks(length)); if (slot == null) { return null; } return _blockConverter.ToNonBlockedLength(slot); } public virtual void BeginCommit() { _delegate.BeginCommit(); } public virtual void Commit() { _delegate.Commit(); } public virtual void EndCommit() { _delegate.EndCommit(); } public virtual void Free(Slot slot) { _delegate.Free(_blockConverter.ToBlockedLength(slot)); } public virtual void FreeSelf() { _delegate.FreeSelf(); } public virtual void FreeSafeSlot(Slot slot) { _delegate.FreeSafeSlot(_blockConverter.ToBlockedLength(slot)); } public virtual void Listener(IFreespaceListener listener) { _delegate.Listener(listener); } public virtual void MigrateTo(IFreespaceManager fm) { throw new InvalidOperationException(); } public virtual int SlotCount() { return _delegate.SlotCount(); } public virtual void Start(int id) { throw new InvalidOperationException(); } public virtual byte SystemType() { return _delegate.SystemType(); } public virtual int TotalFreespace() { return _blockConverter.BlocksToBytes(_delegate.TotalFreespace()); } public virtual void Traverse(IVisitor4 visitor) { _delegate.Traverse(new _IVisitor4_89(this, visitor)); } private sealed class _IVisitor4_89 : IVisitor4 { public _IVisitor4_89(BlockAwareFreespaceManager _enclosing, IVisitor4 visitor) { this._enclosing = _enclosing; this.visitor = visitor; } public void Visit(object slot) { visitor.Visit(this._enclosing._blockConverter.ToNonBlockedLength(((Slot)slot))); } private readonly BlockAwareFreespaceManager _enclosing; private readonly IVisitor4 visitor; } public virtual void Write(LocalObjectContainer container) { _delegate.Write(container); } public virtual void SlotFreed(Slot slot) { _delegate.SlotFreed(slot); } public virtual bool IsStarted() { return _delegate.IsStarted(); } public virtual Slot AllocateTransactionLogSlot(int length) { Slot slot = _delegate.AllocateTransactionLogSlot(_blockConverter.BytesToBlocks(length )); if (slot == null) { return null; } return _blockConverter.ToNonBlockedLength(slot); } public virtual void Read(LocalObjectContainer container, Slot slot) { throw new InvalidOperationException(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/SlotHandler.cs0000644000175000017500000000202311700531646031323 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Freespace { /// public abstract class SlotHandler : IIndexable4 { protected Slot _current; public virtual void DefragIndexEntry(DefragmentContextImpl context) { throw new NotImplementedException(); } public virtual int LinkLength() { return Slot.MarshalledLength; } public virtual object ReadIndexEntry(IContext context, ByteArrayBuffer reader) { return new Slot(reader.ReadInt(), reader.ReadInt()); } public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object obj) { Slot slot = (Slot)obj; writer.WriteInt(slot.Address()); writer.WriteInt(slot.Length()); } public abstract IPreparedComparison PrepareComparison(IContext arg1, object arg2); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/IFreespaceManager.cs0000644000175000017500000000176311700531646032417 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Freespace { /// public interface IFreespaceManager { void BeginCommit(); void EndCommit(); int SlotCount(); void Free(Slot slot); void FreeSelf(); int TotalFreespace(); Slot AllocateTransactionLogSlot(int length); Slot AllocateSlot(int length); void MigrateTo(IFreespaceManager fm); void Read(LocalObjectContainer container, Slot slot); void Start(int id); byte SystemType(); void Traverse(IVisitor4 visitor); void Write(LocalObjectContainer container); void Commit(); Slot AllocateSafeSlot(int length); void FreeSafeSlot(Slot slot); void Listener(IFreespaceListener listener); void SlotFreed(Slot slot); bool IsStarted(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/AddressKeySlotHandler.cs0000644000175000017500000000220311700531646033302 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Freespace { /// public class AddressKeySlotHandler : SlotHandler { public virtual int CompareTo(object obj) { return _current.CompareByAddress((Slot)obj); } public override IPreparedComparison PrepareComparison(IContext context, object slot ) { Slot sourceSlot = (Slot)slot; return new _IPreparedComparison_21(sourceSlot); } private sealed class _IPreparedComparison_21 : IPreparedComparison { public _IPreparedComparison_21(Slot sourceSlot) { this.sourceSlot = sourceSlot; } public int CompareTo(object obj) { Slot targetSlot = (Slot)obj; // FIXME: The comparison method in #compareByAddress is the wrong way around. // Fix there and here after other references are fixed. return -sourceSlot.CompareByAddress(targetSlot); } private readonly Slot sourceSlot; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/FreeSlotNode.cs0000644000175000017500000000723011700531646031442 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Freespace { /// public sealed class FreeSlotNode : TreeInt { internal static int sizeLimit; internal Db4objects.Db4o.Internal.Freespace.FreeSlotNode _peer; internal FreeSlotNode(int a_key) : base(a_key) { } public override object ShallowClone() { Db4objects.Db4o.Internal.Freespace.FreeSlotNode frslot = new Db4objects.Db4o.Internal.Freespace.FreeSlotNode (_key); frslot._peer = _peer; return base.ShallowCloneInternal(frslot); } internal void CreatePeer(int a_key) { _peer = new Db4objects.Db4o.Internal.Freespace.FreeSlotNode(a_key); _peer._peer = this; } public override bool Duplicates() { return true; } public sealed override int OwnLength() { return Const4.IntLength * 2; } internal static Tree RemoveGreaterOrEqual(Db4objects.Db4o.Internal.Freespace.FreeSlotNode a_in, TreeIntObject a_finder) { if (a_in == null) { return null; } int cmp = a_in._key - a_finder._key; if (cmp == 0) { a_finder._object = a_in; // the highest node in the hierarchy !!! return a_in.Remove(); } if (cmp > 0) { a_in._preceding = RemoveGreaterOrEqual((Db4objects.Db4o.Internal.Freespace.FreeSlotNode )((Tree)a_in._preceding), a_finder); if (a_finder._object != null) { a_in._size--; return a_in; } a_finder._object = a_in; return a_in.Remove(); } a_in._subsequent = RemoveGreaterOrEqual((Db4objects.Db4o.Internal.Freespace.FreeSlotNode )((Tree)a_in._subsequent), a_finder); if (a_finder._object != null) { a_in._size--; } return a_in; } public override object Read(ByteArrayBuffer buffer) { int size = buffer.ReadInt(); int address = buffer.ReadInt(); if (size > sizeLimit) { Db4objects.Db4o.Internal.Freespace.FreeSlotNode node = new Db4objects.Db4o.Internal.Freespace.FreeSlotNode (size); node.CreatePeer(address); if (Deploy.debug && Debug4.xbytes) { DebugCheckBuffer(buffer, node); } return node; } return null; } private void DebugCheckBuffer(ByteArrayBuffer buffer, Db4objects.Db4o.Internal.Freespace.FreeSlotNode node) { if (!(buffer is StatefulBuffer)) { return; } Transaction trans = ((StatefulBuffer)buffer).Transaction(); if (!(trans.Container() is IoAdaptedObjectContainer)) { return; } StatefulBuffer checker = trans.Container().CreateStatefulBuffer(trans, node._peer ._key, node._key); checker.Read(); for (int i = 0; i < node._key; i++) { if (checker.ReadByte() != (byte)'X') { Sharpen.Runtime.Out.WriteLine("!!! Free space corruption at:" + node._peer._key); break; } } } public sealed override void Write(ByteArrayBuffer a_writer) { // byte order: size, address a_writer.WriteInt(_key); a_writer.WriteInt(_peer._key); } // public static final void debug(FreeSlotNode a_node){ // if(a_node == null){ // return; // } // System.out.println("Address:" + a_node.i_key); // System.out.println("Length:" + a_node.i_peer.i_key); // debug((FreeSlotNode)a_node.i_preceding); // debug((FreeSlotNode)a_node.i_subsequent); // } public override string ToString() { return base.ToString(); string str = "FreeSlotNode " + _key; if (_peer != null) { str += " peer: " + _peer._key; } return str; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Freespace/IFreespaceListener.cs0000644000175000017500000000037611700531646032631 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Freespace { /// public interface IFreespaceListener { void SlotAdded(int size); void SlotRemoved(int size); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/FieldMetadata.cs0000644000175000017500000010223411700531646027700 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Text; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Reflect; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public class FieldMetadata : ClassAspect, IStoredField { private ClassMetadata _containingClass; private string _name; protected bool _isArray; private bool _isNArray; private bool _isPrimitive; private IReflectField _reflectField; private FieldMetadataState _state = FieldMetadataState.NotLoaded; private Config4Field _config; private IDb4oTypeImpl _db4oType; private int _linkLength; private BTree _index; protected ClassMetadata _fieldType; protected int _fieldTypeID; internal static readonly Db4objects.Db4o.Internal.FieldMetadata[] EmptyArray = new Db4objects.Db4o.Internal.FieldMetadata[0]; public FieldMetadata(ClassMetadata classMetadata) { _containingClass = classMetadata; } protected Type TranslatorStoredClass(IObjectTranslator translator) { try { return translator.StoredClass(); } catch (Exception e) { throw new ReflectException(e); } } internal FieldMetadata(ClassMetadata containingClass, IReflectField field, ClassMetadata fieldType) : this(containingClass) { Init(field.GetName()); _reflectField = field; _fieldType = fieldType; _fieldTypeID = fieldType.GetID(); // TODO: beautify !!! possibly pull up isPrimitive to ReflectField bool isPrimitive = field is GenericField ? ((GenericField)field).IsPrimitive() : false; Configure(field.GetFieldType(), isPrimitive); CheckDb4oType(); SetAvailable(); } protected virtual void SetAvailable() { _state = FieldMetadataState.Available; } protected FieldMetadata(int fieldTypeID) { _fieldTypeID = fieldTypeID; } public FieldMetadata(ClassMetadata containingClass, string name, int fieldTypeID, bool primitive, bool isArray, bool isNArray) : this(containingClass) { Init(name, fieldTypeID, primitive, isArray, isNArray); } protected FieldMetadata(ClassMetadata containingClass, string name) : this(containingClass ) { Init(name); } /// public virtual void AddFieldIndex(ObjectIdContextImpl context) { if (!HasIndex()) { IncrementOffset(context); return; } try { AddIndexEntry(context.Transaction(), context.ObjectId(), ReadIndexEntry(context)); } catch (CorruptionException exc) { throw new FieldIndexException(exc, this); } } protected void AddIndexEntry(StatefulBuffer a_bytes, object indexEntry) { AddIndexEntry(a_bytes.Transaction(), a_bytes.GetID(), indexEntry); } public virtual void AddIndexEntry(Transaction trans, int parentID, object indexEntry ) { if (!HasIndex()) { return; } BTree index = GetIndex(trans); index.Add(trans, CreateFieldIndexKey(parentID, indexEntry)); } protected virtual IFieldIndexKey CreateFieldIndexKey(int parentID, object indexEntry ) { object convertedIndexEntry = IndexEntryFor(indexEntry); return new FieldIndexKeyImpl(parentID, convertedIndexEntry); } protected virtual object IndexEntryFor(object indexEntry) { return _reflectField.IndexEntry(indexEntry); } public virtual bool CanUseNullBitmap() { return true; } /// /// public object ReadIndexEntry(IObjectIdContext context) { IIndexableTypeHandler indexableTypeHandler = (IIndexableTypeHandler)HandlerRegistry .CorrectHandlerVersion(context, GetHandler()); return indexableTypeHandler.ReadIndexEntry(context); } public virtual void RemoveIndexEntry(Transaction trans, int parentID, object indexEntry ) { if (!HasIndex()) { return; } BTree index = GetIndex(trans); if (index == null) { return; } index.Remove(trans, CreateFieldIndexKey(parentID, indexEntry)); } //TODO: Split into command query separation. public virtual bool Alive() { if (_state == FieldMetadataState.Available) { return true; } if (_state == FieldMetadataState.NotLoaded) { return Load(); } return _state == FieldMetadataState.Available; } private bool Load() { if (_fieldType == null) { // this may happen if the local ClassMetadataRepository // has not been updated from the server and presumably // in some refactoring cases. // We try to heal the problem by re-reading the class. // This could be dangerous, if the class type of a field // has been modified. // TODO: add class refactoring features _fieldType = DetectFieldType(); CheckFieldTypeID(); } CheckCorrectTypeForField(); if (_fieldType == null || _reflectField == null) { _state = FieldMetadataState.Unavailable; _reflectField = null; return false; } if (Updating()) { return false; } SetAvailable(); CheckDb4oType(); return true; } private bool ShouldStoreField() { return !_reflectField.IsTransient() || (_containingClass != null && _containingClass .ShouldStoreTransientFields()); } public virtual bool Updating() { return _state == FieldMetadataState.Updating; } private void CheckFieldTypeID() { int id = _fieldType != null ? _fieldType.GetID() : 0; if (_fieldTypeID == 0) { _fieldTypeID = id; return; } if (id > 0 && id != _fieldTypeID) { // wrong type, refactoring, field should be turned off // TODO: it would be cool to log something here _fieldType = null; } } internal virtual bool CanAddToQuery(string fieldName) { if (!Alive()) { return false; } return fieldName.Equals(GetName()) && ContainingClass() != null && !ContainingClass ().IsInternal(); } private bool CanHold(IReflectClass type) { if (type == null) { throw new ArgumentNullException(); } ITypeHandler4 typeHandler = GetHandler(); if (typeHandler is IQueryableTypeHandler) { if (((IQueryableTypeHandler)typeHandler).DescendsIntoMembers()) { return true; } } IReflectClass classReflector = FieldType().ClassReflector(); if (classReflector.IsCollection()) { return true; } return classReflector.IsAssignableFrom(type); } public virtual GenericReflector Reflector() { ObjectContainerBase container = Container(); if (container == null) { return null; } return container.Reflector(); } public virtual object Coerce(IReflectClass valueClass, object value) { if (value == null) { return _isPrimitive ? No4.Instance : value; } if (valueClass == null) { throw new ArgumentNullException(); } if (GetHandler() is PrimitiveHandler) { return ((PrimitiveHandler)GetHandler()).Coerce(valueClass, value); } if (!CanHold(valueClass)) { return No4.Instance; } return value; } public bool CanLoadByIndex() { return Handlers4.CanLoadFieldByIndex(GetHandler()); } public sealed override void CascadeActivation(IActivationContext context) { if (!Alive()) { return; } object cascadeTo = CascadingTarget(context); if (cascadeTo == null) { return; } IActivationContext cascadeContext = context.ForObject(cascadeTo); ClassMetadata classMetadata = cascadeContext.ClassMetadata(); if (classMetadata == null) { return; } EnsureObjectIsActive(cascadeContext); Handlers4.CascadeActivation(cascadeContext, classMetadata.TypeHandler()); } private void EnsureObjectIsActive(IActivationContext context) { if (!context.Depth().Mode().IsActivate()) { return; } if (Handlers4.IsValueType(GetHandler())) { return; } ObjectContainerBase container = context.Container(); ClassMetadata classMetadata = container.ClassMetadataForObject(context.TargetObject ()); if (classMetadata == null || !classMetadata.HasIdentity()) { return; } if (container.IsActive(context.TargetObject())) { return; } container.StillToActivate(context.Descend()); } protected object CascadingTarget(IActivationContext context) { if (context.Depth().Mode().IsDeactivate()) { if (null == _reflectField) { return null; } return FieldAccessor().Get(_reflectField, context.TargetObject()); } return GetOrCreate(context.Transaction(), context.TargetObject()); } private void CheckDb4oType() { if (_reflectField != null) { if (Container()._handlers.IclassDb4otype.IsAssignableFrom(_reflectField.GetFieldType ())) { _db4oType = HandlerRegistry.GetDb4oType(_reflectField.GetFieldType()); } } } internal virtual void CollectConstraints(Transaction trans, QConObject a_parent, object a_template, IVisitor4 a_visitor) { object obj = GetOn(trans, a_template); if (obj != null) { Collection4 objs = Platform4.FlattenCollection(trans.Container(), obj); IEnumerator j = objs.GetEnumerator(); while (j.MoveNext()) { obj = j.Current; if (obj != null) { if (_isPrimitive && !_isArray) { object nullValue = _reflectField.GetFieldType().NullValue(); if (obj.Equals(nullValue)) { return; } } if (Platform4.IgnoreAsConstraint(obj)) { return; } if (!a_parent.HasObjectInParentPath(obj)) { QConObject constraint = new QConObject(trans, a_parent, QField(trans), obj); constraint.ByExample(); a_visitor.Visit(constraint); } } } } } /// public sealed override void CollectIDs(CollectIdContext context) { if (!Alive()) { IncrementOffset(context.Buffer()); return; } ITypeHandler4 handler = HandlerRegistry.CorrectHandlerVersion(context, GetHandler ()); Handlers4.CollectIdsInternal(context, handler, LinkLength(), true); } internal virtual void Configure(IReflectClass clazz, bool isPrimitive) { _isArray = clazz.IsArray(); if (_isArray) { IReflectArray reflectArray = Reflector().Array(); _isNArray = reflectArray.IsNDimensional(clazz); _isPrimitive = reflectArray.GetComponentType(clazz).IsPrimitive(); } else { _isPrimitive = isPrimitive | clazz.IsPrimitive(); } } protected ITypeHandler4 WrapHandlerToArrays(ITypeHandler4 handler) { if (handler == null) { return null; } if (_isNArray) { return new MultidimensionalArrayHandler(handler, ArraysUsePrimitiveClassReflector ()); } if (_isArray) { return new ArrayHandler(handler, ArraysUsePrimitiveClassReflector()); } return handler; } private bool ArraysUsePrimitiveClassReflector() { return _isPrimitive; } public override void Deactivate(IActivationContext context) { if (!Alive() || !ShouldStoreField()) { return; } bool isEnumClass = _containingClass.IsEnum(); if (_isPrimitive && !_isArray) { if (!isEnumClass) { object nullValue = _reflectField.GetFieldType().NullValue(); FieldAccessor().Set(_reflectField, context.TargetObject(), nullValue); } return; } if (context.Depth().RequiresActivation()) { CascadeActivation(context); } if (!isEnumClass) { FieldAccessor().Set(_reflectField, context.TargetObject(), null); } } private IFieldAccessor FieldAccessor() { return _containingClass.FieldAccessor(); } /// public override void Delete(DeleteContextImpl context, bool isUpdate) { if (!CheckAlive(context)) { return; } try { RemoveIndexEntry(context); if (isUpdate) { IncrementOffset(context); return; } StatefulBuffer buffer = (StatefulBuffer)context.Buffer(); DeleteContextImpl childContext = new DeleteContextImpl(context, GetStoredType(), _config); context.SlotFormat().DoWithSlotIndirection(buffer, GetHandler(), new _IClosure4_445 (this, childContext)); } catch (CorruptionException exc) { throw new FieldIndexException(exc, this); } } private sealed class _IClosure4_445 : IClosure4 { public _IClosure4_445(FieldMetadata _enclosing, DeleteContextImpl childContext) { this._enclosing = _enclosing; this.childContext = childContext; } public object Run() { childContext.Delete(this._enclosing.GetHandler()); return null; } private readonly FieldMetadata _enclosing; private readonly DeleteContextImpl childContext; } /// /// private void RemoveIndexEntry(DeleteContextImpl context) { if (!HasIndex()) { return; } int offset = context.Offset(); object obj = ReadIndexEntry(context); RemoveIndexEntry(context.Transaction(), context.ObjectId(), obj); context.Seek(offset); } public override bool Equals(object obj) { if (!(obj is Db4objects.Db4o.Internal.FieldMetadata)) { return false; } Db4objects.Db4o.Internal.FieldMetadata other = (Db4objects.Db4o.Internal.FieldMetadata )obj; other.Alive(); Alive(); return other._isPrimitive == _isPrimitive && other._fieldType == _fieldType && other ._name.Equals(_name); } public override int GetHashCode() { return _name.GetHashCode(); } public object Get(object onObject) { return Get(null, onObject); } public object Get(Transaction trans, object onObject) { if (_containingClass == null) { return null; } ObjectContainerBase container = Container(); if (container == null) { return null; } lock (container.Lock()) { // FIXME: The following is not really transactional. // This will work OK for normal C/S and for // single local mode but the transaction will // be wrong for MTOC. if (trans == null) { trans = container.Transaction; } container.CheckClosed(); ObjectReference @ref = trans.ReferenceForObject(onObject); if (@ref == null) { return null; } int id = @ref.GetID(); if (id <= 0) { return null; } UnmarshallingContext context = new UnmarshallingContext(trans, @ref, Const4.AddToIdTree , false); context.ActivationDepth(new LegacyActivationDepth(1)); return context.ReadFieldValue(this); } } public override string GetName() { return _name; } public ClassMetadata FieldType() { // alive needs to be checked by all callers: Done return _fieldType; } public virtual ITypeHandler4 GetHandler() { if (_fieldType == null) { return null; } // alive needs to be checked by all callers: Done return WrapHandlerToArrays(_fieldType.TypeHandler()); } public virtual int FieldTypeID() { // alive needs to be checked by all callers: Done return _fieldTypeID; } public virtual object GetOn(Transaction trans, object onObject) { if (Alive()) { return FieldAccessor().Get(_reflectField, onObject); } return null; } /// /// dirty hack for com.db4o.types some of them (BlobImpl) need to be set automatically /// TODO: Derive from FieldMetadata for Db4oTypes /// public virtual object GetOrCreate(Transaction trans, object onObject) { if (!Alive()) { return null; } object obj = FieldAccessor().Get(_reflectField, onObject); if (_db4oType != null && obj == null) { obj = _db4oType.CreateDefault(trans); FieldAccessor().Set(_reflectField, onObject, obj); } return obj; } public ClassMetadata ContainingClass() { // alive needs to be checked by all callers: Done return _containingClass; } public virtual IReflectClass GetStoredType() { if (_reflectField == null) { return null; } return Handlers4.BaseType(_reflectField.GetFieldType()); } public virtual ObjectContainerBase Container() { if (_containingClass == null) { return null; } return _containingClass.Container(); } public virtual bool HasConfig() { return _config != null; } public virtual bool HasIndex() { return _index != null; } public void Init(string name) { _name = name; InitConfiguration(name); } internal void InitConfiguration(string name) { Config4Class containingClassConfig = _containingClass.Config(); if (containingClassConfig == null) { return; } _config = containingClassConfig.ConfigField(name); } public virtual void Init(string name, int fieldTypeID, bool isPrimitive, bool isArray , bool isNArray) { _fieldTypeID = fieldTypeID; _isPrimitive = isPrimitive; _isArray = isArray; _isNArray = isNArray; Init(name); LoadFieldTypeById(); Alive(); } private bool _initialized = false; internal void InitConfigOnUp(Transaction trans) { if (_initialized) { return; } _initialized = true; if (_config != null) { _config.InitOnUp(trans, this); } } public override void Activate(UnmarshallingContext context) { if (!CheckAlive(context)) { return; } if (!ShouldStoreField()) { IncrementOffset(context); return; } object toSet = Read(context); InformAboutTransaction(toSet, context.Transaction()); Set(context.PersistentObject(), toSet); } public virtual void AttemptUpdate(UnmarshallingContext context) { if (!Updating()) { IncrementOffset(context); return; } int savedOffset = context.Offset(); try { object toSet = context.Read(GetHandler()); if (toSet != null) { Set(context.PersistentObject(), toSet); } } catch (Exception) { // FIXME: COR-547 Diagnostics here please. context.Buffer().Seek(savedOffset); IncrementOffset(context); } } private bool CheckAlive(IAspectVersionContext context) { if (!CheckEnabled(context)) { return false; } bool alive = Alive(); if (!alive) { IncrementOffset((IReadBuffer)context); } return alive; } private void InformAboutTransaction(object obj, Transaction trans) { if (_db4oType != null && obj != null) { ((IDb4oTypeImpl)obj).SetTrans(trans); } } public virtual bool IsArray() { return _isArray; } public override int LinkLength() { Alive(); if (_linkLength == 0) { _linkLength = CalculateLinkLength(); } return _linkLength; } private int CalculateLinkLength() { return Handlers4.CalculateLinkLength(GetHandler()); } public virtual void LoadFieldTypeById() { _fieldType = Container().ClassMetadataForID(_fieldTypeID); } private ClassMetadata DetectFieldType() { IReflectClass claxx = _containingClass.ClassReflector(); if (claxx == null) { return null; } _reflectField = claxx.GetDeclaredField(_name); if (_reflectField == null) { return null; } IReflectClass fieldType = _reflectField.GetFieldType(); if (fieldType == null) { return null; } return Handlers4.ErasedFieldType(Container(), fieldType); } protected virtual ITypeHandler4 TypeHandlerForClass(ObjectContainerBase container , IReflectClass fieldType) { container.ShowInternalClasses(true); try { return container.TypeHandlerForClass(Handlers4.BaseType(fieldType)); } finally { container.ShowInternalClasses(false); } } private void CheckCorrectTypeForField() { ClassMetadata currentFieldType = DetectFieldType(); if (currentFieldType == null) { _reflectField = null; _state = FieldMetadataState.Unavailable; return; } if (currentFieldType == _fieldType && Handlers4.BaseType(_reflectField.GetFieldType ()).IsPrimitive() == _isPrimitive) { return; } // special case when migrating from type handler ids // to class metadata ids which caused // any interface metadata id to be mapped to UNTYPED_ID if (Handlers4.IsUntyped(currentFieldType.TypeHandler()) && Handlers4.IsUntyped(_fieldType .TypeHandler())) { return; } // FIXME: COR-547 Diagnostics here please. _state = FieldMetadataState.Updating; } private IUpdateDepth AdjustUpdateDepthForCascade(object obj, IUpdateDepth updateDepth ) { return updateDepth.AdjustUpdateDepthForCascade(_containingClass.IsCollection(obj) ); } private bool CascadeOnUpdate(Config4Class parentClassConfiguration) { return ((parentClassConfiguration != null && (parentClassConfiguration.CascadeOnUpdate ().DefiniteYes())) || (_config != null && (_config.CascadeOnUpdate().DefiniteYes ()))); } public override void Marshall(MarshallingContext context, object obj) { // alive needs to be checked by all callers: Done IUpdateDepth updateDepth = context.UpdateDepth(); if (obj != null && CascadeOnUpdate(context.ClassConfiguration())) { context.UpdateDepth(AdjustUpdateDepthForCascade(obj, updateDepth)); } context.WriteObjectWithCurrentState(GetHandler(), obj); context.UpdateDepth(updateDepth); if (HasIndex()) { context.AddIndexEntry(this, obj); } } public virtual bool NeedsArrayAndPrimitiveInfo() { return true; } public virtual IPreparedComparison PrepareComparison(IContext context, object obj ) { if (!Alive()) { return null; } return Handlers4.PrepareComparisonFor(GetHandler(), context, obj); } public virtual Db4objects.Db4o.Internal.Query.Processor.QField QField(Transaction a_trans) { int classMetadataID = 0; if (_containingClass != null) { classMetadataID = _containingClass.GetID(); } return new Db4objects.Db4o.Internal.Query.Processor.QField(a_trans, _name, this, classMetadataID, _handle); } public virtual object Read(IObjectIdContext context) { if (!CanReadFromSlot((IAspectVersionContext)context)) { IncrementOffset(context); return null; } return context.Read(GetHandler()); } private bool CanReadFromSlot(IAspectVersionContext context) { if (!IsEnabledOn(context)) { return false; } if (Alive()) { return true; } return _state != FieldMetadataState.NotLoaded; } internal virtual void Refresh() { ClassMetadata newFieldType = DetectFieldType(); if (newFieldType != null && newFieldType.Equals(_fieldType)) { return; } _reflectField = null; _state = FieldMetadataState.Unavailable; } // FIXME: needs test case public virtual void Rename(string newName) { ObjectContainerBase container = Container(); if (!container.IsClient) { _name = newName; _containingClass.SetStateDirty(); _containingClass.Write(container.SystemTransaction()); } else { Exceptions4.ThrowRuntimeException(58); } } public virtual void Set(object onObject, object obj) { // TODO: remove the following if and check callers if (null == _reflectField) { return; } FieldAccessor().Set(_reflectField, onObject, obj); } internal virtual void SetName(string a_name) { _name = a_name; } internal virtual bool SupportsIndex() { return Alive() && (GetHandler() is IIndexable4) && (!Handlers4.IsUntyped(GetHandler ())); } public void TraverseValues(IVisitor4 userVisitor) { if (!Alive()) { return; } TraverseValues(Container().Transaction, userVisitor); } public void TraverseValues(Transaction transaction, IVisitor4 userVisitor) { if (!Alive()) { return; } AssertHasIndex(); ObjectContainerBase stream = transaction.Container(); if (stream.IsClient) { Exceptions4.ThrowRuntimeException(Db4objects.Db4o.Internal.Messages.ClientServerUnsupported ); } lock (stream.Lock()) { IContext context = transaction.Context(); _index.TraverseKeys(transaction, new _IVisitor4_866(this, userVisitor, context)); } } private sealed class _IVisitor4_866 : IVisitor4 { public _IVisitor4_866(FieldMetadata _enclosing, IVisitor4 userVisitor, IContext context ) { this._enclosing = _enclosing; this.userVisitor = userVisitor; this.context = context; } public void Visit(object obj) { IFieldIndexKey key = (IFieldIndexKey)obj; userVisitor.Visit(((IIndexableTypeHandler)this._enclosing.GetHandler()).IndexEntryToObject (context, key.Value())); } private readonly FieldMetadata _enclosing; private readonly IVisitor4 userVisitor; private readonly IContext context; } private void AssertHasIndex() { if (!HasIndex()) { Exceptions4.ThrowRuntimeException(Db4objects.Db4o.Internal.Messages.OnlyForIndexedFields ); } } public override string ToString() { StringBuilder sb = new StringBuilder(); if (_containingClass != null) { sb.Append(_containingClass.GetName()); sb.Append("."); } sb.Append(GetName()); return sb.ToString(); } private void InitIndex(Transaction systemTrans) { InitIndex(systemTrans, 0); } public virtual void InitIndex(Transaction systemTrans, int id) { if (_index != null) { throw new InvalidOperationException(); } if (systemTrans.Container().IsClient) { return; } _index = NewBTree(systemTrans, id); } protected BTree NewBTree(Transaction systemTrans, int id) { ObjectContainerBase stream = systemTrans.Container(); IIndexable4 indexHandler = IndexHandler(stream); if (indexHandler == null) { return null; } return new BTree(systemTrans, id, new FieldIndexKeyHandler(indexHandler)); } protected virtual IIndexable4 IndexHandler(ObjectContainerBase stream) { if (_reflectField == null) { return null; } IReflectClass indexType = _reflectField.IndexType(); ITypeHandler4 classHandler = TypeHandlerForClass(stream, indexType); if (!(classHandler is IIndexable4)) { return null; } return (IIndexable4)classHandler; } /// public virtual BTree GetIndex(Transaction trans) { return _index; } public virtual bool IsVirtual() { return false; } public virtual bool IsPrimitive() { return _isPrimitive; } public virtual IBTreeRange Search(Transaction transaction, object value) { AssertHasIndex(); object transActionalValue = Handlers4.WrapWithTransactionContext(transaction, value , GetHandler()); BTreeNodeSearchResult lowerBound = SearchLowerBound(transaction, transActionalValue ); BTreeNodeSearchResult upperBound = SearchUpperBound(transaction, transActionalValue ); return lowerBound.CreateIncludingRange(upperBound); } private BTreeNodeSearchResult SearchUpperBound(Transaction transaction, object value ) { return SearchBound(transaction, int.MaxValue, value); } private BTreeNodeSearchResult SearchLowerBound(Transaction transaction, object value ) { return SearchBound(transaction, 0, value); } private BTreeNodeSearchResult SearchBound(Transaction transaction, int parentID, object keyPart) { return GetIndex(transaction).SearchLeaf(transaction, CreateFieldIndexKey(parentID , keyPart), SearchTarget.Lowest); } public virtual bool RebuildIndexForClass(LocalObjectContainer stream, ClassMetadata classMetadata) { // FIXME: BTree traversal over index here. long[] ids = classMetadata.GetIDs(); for (int i = 0; i < ids.Length; i++) { RebuildIndexForObject(stream, classMetadata, (int)ids[i]); } return ids.Length > 0; } /// protected virtual void RebuildIndexForObject(LocalObjectContainer stream, ClassMetadata classMetadata, int objectId) { StatefulBuffer writer = stream.ReadStatefulBufferById(stream.SystemTransaction(), objectId); if (writer != null) { RebuildIndexForWriter(stream, writer, objectId); } } protected virtual void RebuildIndexForWriter(LocalObjectContainer stream, StatefulBuffer writer, int objectId) { ObjectHeader oh = new ObjectHeader(stream, writer); object obj = ReadIndexEntryForRebuild(writer, oh); AddIndexEntry(stream.SystemTransaction(), objectId, obj); } private object ReadIndexEntryForRebuild(StatefulBuffer writer, ObjectHeader oh) { ClassMetadata classMetadata = oh.ClassMetadata(); if (classMetadata == null) { return DefaultValueForFieldType(); } ObjectIdContextImpl context = new ObjectIdContextImpl(writer.Transaction(), writer , oh, writer.GetID()); if (!classMetadata.SeekToField(context, this)) { return DefaultValueForFieldType(); } try { return ReadIndexEntry(context); } catch (CorruptionException exc) { throw new FieldIndexException(exc, this); } } private object DefaultValueForFieldType() { ITypeHandler4 handler = _fieldType.TypeHandler(); return (handler is PrimitiveHandler) ? ((PrimitiveHandler)handler).PrimitiveNull( ) : null; } public void DropIndex(LocalTransaction systemTrans) { if (_index == null) { return; } ObjectContainerBase stream = systemTrans.Container(); if (stream.ConfigImpl.MessageLevel() > Const4.None) { stream.Message("dropping index " + ToString()); } _index.Free(systemTrans); stream.SetDirtyInSystemTransaction(ContainingClass()); _index = null; } public override void DefragAspect(IDefragmentContext context) { if (!CanDefragment()) { throw new InvalidOperationException("Field '" + ToString() + "' cannot be defragmented at this time." ); } ITypeHandler4 correctTypeHandlerVersion = HandlerRegistry.CorrectHandlerVersion(context , GetHandler(), _fieldType); context.SlotFormat().DoWithSlotIndirection(context, correctTypeHandlerVersion, new _IClosure4_1029(context, correctTypeHandlerVersion)); } private sealed class _IClosure4_1029 : IClosure4 { public _IClosure4_1029(IDefragmentContext context, ITypeHandler4 correctTypeHandlerVersion ) { this.context = context; this.correctTypeHandlerVersion = correctTypeHandlerVersion; } public object Run() { context.Defragment(correctTypeHandlerVersion); return null; } private readonly IDefragmentContext context; private readonly ITypeHandler4 correctTypeHandlerVersion; } private bool CanDefragment() { if (Alive() || Updating()) { return true; } if (_fieldType == null || GetHandler() == null) { return false; } return !_fieldType.StateDead(); } public virtual void CreateIndex() { if (HasIndex()) { return; } LocalObjectContainer container = (LocalObjectContainer)Container(); if (container.ConfigImpl.MessageLevel() > Const4.None) { container.Message("creating index " + ToString()); } InitIndex(container.SystemTransaction()); container.SetDirtyInSystemTransaction(ContainingClass()); Reindex(container); } private void Reindex(LocalObjectContainer container) { ClassMetadata clazz = ContainingClass(); if (RebuildIndexForClass(container, clazz)) { container.SystemTransaction().Commit(); } } public override Db4objects.Db4o.Internal.Marshall.AspectType AspectType() { return Db4objects.Db4o.Internal.Marshall.AspectType.Field; } // overriden in VirtualFieldMetadata public override bool CanBeDisabled() { return true; } public virtual void DropIndex() { DropIndex((LocalTransaction)Container().SystemTransaction()); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ClassMetadataIterator.cs0000644000175000017500000000145411700531646031436 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// TODO: remove this class or make it private to ClassMetadataRepository public class ClassMetadataIterator : MappingIterator { private readonly ClassMetadataRepository i_collection; internal ClassMetadataIterator(ClassMetadataRepository a_collection, IEnumerator iterator) : base(iterator) { i_collection = a_collection; } public virtual ClassMetadata CurrentClass() { return (ClassMetadata)Current; } protected override object Map(object current) { return i_collection.ReadClassMetadata((ClassMetadata)current, null); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/StoredFieldImpl.cs0000644000175000017500000000412211700531646030237 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal { /// public class StoredFieldImpl : IStoredField { private readonly Transaction _transaction; private readonly Db4objects.Db4o.Internal.FieldMetadata _fieldMetadata; public StoredFieldImpl(Transaction transaction, Db4objects.Db4o.Internal.FieldMetadata fieldMetadata) { _transaction = transaction; _fieldMetadata = fieldMetadata; } public virtual void CreateIndex() { lock (Lock()) { _fieldMetadata.CreateIndex(); } } public virtual void DropIndex() { lock (Lock()) { _fieldMetadata.DropIndex(); } } private object Lock() { return _transaction.Container().Lock(); } public virtual Db4objects.Db4o.Internal.FieldMetadata FieldMetadata() { return _fieldMetadata; } public virtual object Get(object onObject) { return _fieldMetadata.Get(_transaction, onObject); } public virtual string GetName() { return _fieldMetadata.GetName(); } public virtual IReflectClass GetStoredType() { return _fieldMetadata.GetStoredType(); } public virtual bool HasIndex() { return _fieldMetadata.HasIndex(); } public virtual bool IsArray() { return _fieldMetadata.IsArray(); } public virtual void Rename(string name) { lock (Lock()) { _fieldMetadata.Rename(name); } } public virtual void TraverseValues(IVisitor4 visitor) { _fieldMetadata.TraverseValues(_transaction, visitor); } public override int GetHashCode() { return _fieldMetadata.GetHashCode(); } public override bool Equals(object obj) { if (obj == null) { return false; } if (GetType() != obj.GetType()) { return false; } return _fieldMetadata.Equals(((Db4objects.Db4o.Internal.StoredFieldImpl)obj)._fieldMetadata ); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/VirtualAttributes.cs0000644000175000017500000000136511700531646030714 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public class VirtualAttributes : IShallowClone { public Db4oDatabase i_database; public long i_version; public long i_uuid; // FIXME: should be named "uuidLongPart" or even better "creationTime" public virtual object ShallowClone() { VirtualAttributes va = new VirtualAttributes(); va.i_database = i_database; va.i_version = i_version; va.i_uuid = i_uuid; return va; } internal virtual bool SuppliesUUID() { return i_database != null && i_uuid != 0; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/AbstractBufferContext.cs0000644000175000017500000000403611700531646031457 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal { /// public abstract class AbstractBufferContext : IBufferContext, IHandlerVersionContext { private IReadBuffer _buffer; private readonly Db4objects.Db4o.Internal.Transaction _transaction; public AbstractBufferContext(Db4objects.Db4o.Internal.Transaction transaction, IReadBuffer buffer) { _transaction = transaction; _buffer = buffer; } public virtual IReadBuffer Buffer(IReadBuffer buffer) { IReadBuffer temp = _buffer; _buffer = buffer; return temp; } public virtual IReadBuffer Buffer() { return _buffer; } public virtual byte ReadByte() { return _buffer.ReadByte(); } public virtual void ReadBytes(byte[] bytes) { _buffer.ReadBytes(bytes); } public virtual int ReadInt() { return _buffer.ReadInt(); } public virtual long ReadLong() { return _buffer.ReadLong(); } public virtual int Offset() { return _buffer.Offset(); } public virtual void Seek(int offset) { _buffer.Seek(offset); } public virtual ObjectContainerBase Container() { return _transaction.Container(); } public virtual IObjectContainer ObjectContainer() { return Container(); } public virtual Db4objects.Db4o.Internal.Transaction Transaction() { return _transaction; } public abstract int HandlerVersion(); public virtual bool IsLegacyHandlerVersion() { return HandlerVersion() == 0; } public virtual BitMap4 ReadBitMap(int bitCount) { return _buffer.ReadBitMap(bitCount); } public virtual Db4objects.Db4o.Internal.Marshall.SlotFormat SlotFormat() { return Db4objects.Db4o.Internal.Marshall.SlotFormat.ForHandlerVersion(HandlerVersion ()); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IIndexable4.cs0000644000175000017500000000074411700531646027307 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal { /// public interface IIndexable4 : IComparable4, ILinkLengthAware { object ReadIndexEntry(IContext context, ByteArrayBuffer reader); void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object obj); void DefragIndexEntry(DefragmentContextImpl context); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/HandlerVersionRegistry.cs0000644000175000017500000000473211700531646031674 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public class HandlerVersionRegistry { private readonly HandlerRegistry _registry; private readonly Hashtable4 _versions = new Hashtable4(); public HandlerVersionRegistry(HandlerRegistry registry) { _registry = registry; } public virtual void Put(ITypeHandler4 handler, int version, ITypeHandler4 replacement ) { _versions.Put(new HandlerVersionRegistry.HandlerVersionKey(this, handler, version ), replacement); } public virtual ITypeHandler4 CorrectHandlerVersion(ITypeHandler4 originalHandler, int version) { if (version >= HandlerRegistry.HandlerVersion) { return originalHandler; } if (originalHandler == null) { return null; } // HandlerVersionKey with null key will throw NPE. ITypeHandler4 replacement = (ITypeHandler4)_versions.Get(new HandlerVersionRegistry.HandlerVersionKey (this, GenericTemplate(originalHandler), version)); if (replacement == null) { return CorrectHandlerVersion(originalHandler, version + 1); } if (replacement is IVersionedTypeHandler) { return (ITypeHandler4)((IVersionedTypeHandler)replacement).DeepClone(new TypeHandlerCloneContext (_registry, originalHandler, version)); } return replacement; } private ITypeHandler4 GenericTemplate(ITypeHandler4 handler) { if (handler is IVersionedTypeHandler) { return ((IVersionedTypeHandler)handler).UnversionedTemplate(); } return handler; } private class HandlerVersionKey { private readonly ITypeHandler4 _handler; private readonly int _version; public HandlerVersionKey(HandlerVersionRegistry _enclosing, ITypeHandler4 handler , int version) { this._enclosing = _enclosing; this._handler = handler; this._version = version; } public override int GetHashCode() { return this._handler.GetHashCode() + this._version * 4271; } public override bool Equals(object obj) { HandlerVersionRegistry.HandlerVersionKey other = (HandlerVersionRegistry.HandlerVersionKey )obj; return this._handler.Equals(other._handler) && this._version == other._version; } private readonly HandlerVersionRegistry _enclosing; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Identifiable.cs0000644000175000017500000000341311700531646027572 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public abstract class Identifiable { protected int _id; protected int _state = 2; // DIRTY and ACTIVE public bool BeginProcessing() { if (BitIsTrue(Const4.Processing)) { return false; } BitTrue(Const4.Processing); return true; } internal void BitFalse(int bitPos) { _state &= ~(1 << bitPos); } internal bool BitIsFalse(int bitPos) { return (_state | (1 << bitPos)) != _state; } internal bool BitIsTrue(int bitPos) { return (_state | (1 << bitPos)) == _state; } internal void BitTrue(int bitPos) { _state |= (1 << bitPos); } public virtual void EndProcessing() { BitFalse(Const4.Processing); } public virtual int GetID() { return _id; } public bool IsActive() { return BitIsTrue(Const4.Active); } public virtual bool IsDirty() { return BitIsTrue(Const4.Active) && (!BitIsTrue(Const4.Clean)); } public bool IsNew() { return GetID() == 0; } public virtual void SetID(int id) { if (DTrace.enabled) { DTrace.PersistentbaseSetId.Log(id); } _id = id; } public void SetStateClean() { BitTrue(Const4.Active); BitTrue(Const4.Clean); } public void SetStateDeactivated() { BitFalse(Const4.Active); } public virtual void SetStateDirty() { BitTrue(Const4.Active); BitFalse(Const4.Clean); } public override int GetHashCode() { if (IsNew()) { throw new InvalidOperationException(); } return GetID(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Config4Class.cs0000644000175000017500000002150311700531646027472 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Config; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal { /// public class Config4Class : Config4Abstract, IObjectClass, IDeepClone { private readonly Config4Impl _configImpl; private static readonly KeySpec CallConstructorKey = new KeySpec(TernaryBool.Unspecified ); private static readonly KeySpec ClassIndexedKey = new KeySpec(true); private static readonly KeySpec ExceptionalFieldsKey = new KeySpec(null); private static readonly KeySpec GenerateUuidsKey = new KeySpec(TernaryBool.Unspecified ); /// /// We are running into cyclic dependancies on reading the PBootRecord /// object, if we maintain MetaClass information there /// private static readonly KeySpec MaintainMetaclassKey = new KeySpec(true); private static readonly KeySpec MaximumActivationDepthKey = new KeySpec(0); private static readonly KeySpec MinimumActivationDepthKey = new KeySpec(0); private static readonly KeySpec PersistStaticFieldValuesKey = new KeySpec(false); private static readonly KeySpec QueryAttributeProviderKey = new KeySpec(null); private static readonly KeySpec StoreTransientFieldsKey = new KeySpec(false); private static readonly KeySpec TranslatorKey = new KeySpec(null); private static readonly KeySpec TranslatorNameKey = new KeySpec((string)null); private static readonly KeySpec UpdateDepthKey = new KeySpec(Const4.Unspecified); private static readonly KeySpec WriteAsKey = new KeySpec((string)null); protected Config4Class(Config4Impl configuration, KeySpecHashtable4 config) : base (config) { _configImpl = configuration; } internal Config4Class(Config4Impl a_configuration, string a_name) { _configImpl = a_configuration; SetName(a_name); } public virtual int AdjustActivationDepth(int depth) { TernaryBool cascadeOnActivate = CascadeOnActivate(); if (cascadeOnActivate.DefiniteYes() && depth < 2) { depth = 2; } if (cascadeOnActivate.DefiniteNo() && depth > 1) { depth = 1; } if (Config().ClassActivationDepthConfigurable()) { int minimumActivationDepth = MinimumActivationDepth(); if (minimumActivationDepth != 0 && depth < minimumActivationDepth) { depth = minimumActivationDepth; } int maximumActivationDepth = MaximumActivationDepth(); if (maximumActivationDepth != 0 && depth > maximumActivationDepth) { depth = maximumActivationDepth; } } return depth; } public virtual void CallConstructor(bool flag) { PutThreeValued(CallConstructorKey, flag); } internal override string ClassName() { return GetName(); } internal virtual IReflectClass ClassReflector() { return Config().Reflector().ForName(GetName()); } [System.ObsoleteAttribute] public virtual void Compare(IObjectAttribute comparator) { _config.Put(QueryAttributeProviderKey, comparator); } internal virtual Config4Field ConfigField(string fieldName) { Hashtable4 exceptionalFields = ExceptionalFieldsOrNull(); if (exceptionalFields == null) { return null; } Config4Field config4Field = (Config4Field)exceptionalFields.Get(fieldName); if (config4Field == null) { return null; } config4Field.Used(true); return config4Field; } public virtual object DeepClone(object param) { Config4Impl parentConfig = ((Config4Impl.ConfigDeepCloneContext)param)._cloned; return new Db4objects.Db4o.Internal.Config4Class(parentConfig, _config); } public virtual void EnableReplication(bool setting) { throw new NotSupportedException("See documentation"); } public virtual void GenerateUUIDs(bool setting) { _config.Put(GenerateUuidsKey, TernaryBool.ForBoolean(setting)); } public virtual void GenerateVersionNumbers(bool setting) { throw new NotSupportedException("See documentation"); } public virtual IObjectTranslator GetTranslator() { IObjectTranslator translator = (IObjectTranslator)_config.Get(TranslatorKey); if (translator != null) { return translator; } string translatorName = _config.GetAsString(TranslatorNameKey); if (translatorName == null) { return null; } try { translator = NewTranslatorFromReflector(translatorName); } catch (Exception) { try { translator = NewTranslatorFromPlatform(translatorName); } catch (Exception e) { throw new Db4oException(e); } } Translate(translator); return translator; } /// /// private IObjectTranslator NewTranslatorFromPlatform(string translatorName) { return (IObjectTranslator)System.Activator.CreateInstance(ReflectPlatform.ForName (translatorName)); } private IObjectTranslator NewTranslatorFromReflector(string translatorName) { return (IObjectTranslator)Config().Reflector().ForName(translatorName).NewInstance (); } public virtual void Indexed(bool flag) { _config.Put(ClassIndexedKey, flag); } public virtual bool Indexed() { return _config.GetAsBoolean(ClassIndexedKey); } public virtual void MaximumActivationDepth(int depth) { _config.Put(MaximumActivationDepthKey, depth); } internal virtual int MaximumActivationDepth() { return _config.GetAsInt(MaximumActivationDepthKey); } public virtual void MinimumActivationDepth(int depth) { _config.Put(MinimumActivationDepthKey, depth); } public virtual int MinimumActivationDepth() { return _config.GetAsInt(MinimumActivationDepthKey); } public virtual TernaryBool CallConstructor() { if (_config.Get(TranslatorKey) != null) { return TernaryBool.Yes; } return _config.GetAsTernaryBool(CallConstructorKey); } internal virtual Hashtable4 ExceptionalFieldsOrNull() { return (Hashtable4)_config.Get(ExceptionalFieldsKey); } private Hashtable4 ExceptionalFields() { Hashtable4 exceptionalFieldsCollection = ExceptionalFieldsOrNull(); if (exceptionalFieldsCollection == null) { exceptionalFieldsCollection = new Hashtable4(16); _config.Put(ExceptionalFieldsKey, exceptionalFieldsCollection); } return exceptionalFieldsCollection; } public virtual IObjectField ObjectField(string fieldName) { Hashtable4 exceptionalFieldsCollection = ExceptionalFields(); Config4Field c4f = (Config4Field)exceptionalFieldsCollection.Get(fieldName); if (c4f == null) { c4f = new Config4Field(this, fieldName); exceptionalFieldsCollection.Put(fieldName, c4f); } return c4f; } public virtual void PersistStaticFieldValues() { _config.Put(PersistStaticFieldValuesKey, true); } public virtual void Rename(string newName) { Config().Rename(Renames.ForClass(GetName(), newName)); SetName(newName); } public virtual void StoreTransientFields(bool flag) { _config.Put(StoreTransientFieldsKey, flag); } public virtual void Translate(IObjectTranslator translator) { if (translator == null) { _config.Put(TranslatorNameKey, null); } _config.Put(TranslatorKey, translator); } internal virtual void TranslateOnDemand(string a_translatorName) { _config.Put(TranslatorNameKey, a_translatorName); } public virtual void UpdateDepth(int depth) { if (depth < 0) { throw new ArgumentException("update depth must not be negative"); } _config.Put(UpdateDepthKey, depth); } internal virtual Config4Impl Config() { return _configImpl; } internal virtual TernaryBool GenerateUUIDs() { return (TernaryBool)_config.Get(GenerateUuidsKey); } internal virtual TernaryBool GenerateVersionNumbers() { return TernaryBool.No; } internal virtual void MaintainMetaClass(bool flag) { _config.Put(MaintainMetaclassKey, flag); } internal virtual bool StaticFieldValuesArePersisted() { return _config.GetAsBoolean(PersistStaticFieldValuesKey); } public virtual IObjectAttribute QueryAttributeProvider() { return (IObjectAttribute)_config.Get(QueryAttributeProviderKey); } public virtual bool StoreTransientFields() { return _config.GetAsBoolean(StoreTransientFieldsKey); } internal virtual int UpdateDepth() { return _config.GetAsInt(UpdateDepthKey); } internal virtual string WriteAs() { return _config.GetAsString(WriteAsKey); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IReadable.cs0000644000175000017500000000042511700531646027023 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public interface IReadable { object Read(ByteArrayBuffer buffer); int MarshalledLength(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Classindex/0000755000175000017500000000000011700531646026760 5ustar00meebeymeebey00000000000000AbstractClassIndexStrategy.cs0000644000175000017500000000362411700531646034501 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Classindex/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Classindex; namespace Db4objects.Db4o.Internal.Classindex { /// public abstract class AbstractClassIndexStrategy : IClassIndexStrategy { protected readonly ClassMetadata _classMetadata; public AbstractClassIndexStrategy(ClassMetadata classMetadata) { _classMetadata = classMetadata; } protected virtual int ClassMetadataID() { return _classMetadata.GetID(); } public virtual int OwnLength() { return Const4.IdLength; } protected abstract void InternalAdd(Transaction trans, int id); public void Add(Transaction trans, int id) { if (DTrace.enabled) { DTrace.AddToClassIndex.Log(id); } CheckId(id); InternalAdd(trans, id); } protected abstract void InternalRemove(Transaction ta, int id); public void Remove(Transaction ta, int id) { if (DTrace.enabled) { DTrace.RemoveFromClassIndex.Log(id); } CheckId(id); InternalRemove(ta, id); } private void CheckId(int id) { } public abstract IEnumerator AllSlotIDs(Transaction arg1); public abstract void DefragIndex(DefragmentContextImpl arg1); public abstract void DefragReference(ClassMetadata arg1, DefragmentContextImpl arg2 , int arg3); public abstract void DontDelete(Transaction arg1, int arg2); public abstract int EntryCount(Transaction arg1); public abstract int Id(); public abstract void Initialize(ObjectContainerBase arg1); public abstract void Purge(); public abstract void Read(ObjectContainerBase arg1, int arg2); public abstract void TraverseAll(Transaction arg1, IVisitor4 arg2); public abstract int Write(Transaction arg1); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Classindex/IClassIndexStrategy.cs0000644000175000017500000000230611700531646033201 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Classindex { /// public interface IClassIndexStrategy { void Initialize(ObjectContainerBase stream); void Read(ObjectContainerBase stream, int indexID); int Write(Transaction transaction); void Add(Transaction transaction, int id); void Remove(Transaction transaction, int id); int EntryCount(Transaction transaction); int OwnLength(); void Purge(); /// Traverses all index entries (java.lang.Integer references). /// Traverses all index entries (java.lang.Integer references). void TraverseAll(Transaction transaction, IVisitor4 command); void DontDelete(Transaction transaction, int id); IEnumerator AllSlotIDs(Transaction trans); // FIXME: Why is this never called? void DefragReference(ClassMetadata classMetadata, DefragmentContextImpl context, int classIndexID); int Id(); // FIXME: Why is this never called? void DefragIndex(DefragmentContextImpl context); } } BTreeClassIndexStrategy.cs0000644000175000017500000000732011700531646033734 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Classindex/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Classindex; using Db4objects.Db4o.Internal.References; namespace Db4objects.Db4o.Internal.Classindex { /// public class BTreeClassIndexStrategy : AbstractClassIndexStrategy { private BTree _btreeIndex; public BTreeClassIndexStrategy(ClassMetadata classMetadata) : base(classMetadata) { } public virtual BTree Btree() { return _btreeIndex; } public override int EntryCount(Transaction ta) { return _btreeIndex != null ? _btreeIndex.Size(ta) : 0; } public override void Initialize(ObjectContainerBase stream) { CreateBTreeIndex(stream, 0); } public override void Purge() { } public override void Read(ObjectContainerBase stream, int indexID) { ReadBTreeIndex(stream, indexID); } public override int Write(Transaction trans) { if (_btreeIndex == null) { return 0; } _btreeIndex.Write(trans); return _btreeIndex.GetID(); } public override void TraverseAll(Transaction ta, IVisitor4 command) { if (_btreeIndex != null) { _btreeIndex.TraverseKeys(ta, command); } } private void CreateBTreeIndex(ObjectContainerBase stream, int btreeID) { if (stream.IsClient) { return; } _btreeIndex = ((LocalObjectContainer)stream).CreateBTreeClassIndex(btreeID); _btreeIndex.SetRemoveListener(new _IVisitor4_61(this)); } private sealed class _IVisitor4_61 : IVisitor4 { public _IVisitor4_61(BTreeClassIndexStrategy _enclosing) { this._enclosing = _enclosing; } public void Visit(object obj) { this._enclosing.RemoveId((TransactionContext)obj); } private readonly BTreeClassIndexStrategy _enclosing; } private void RemoveId(TransactionContext context) { IReferenceSystem referenceSystem = context._transaction.ReferenceSystem(); ObjectReference reference = referenceSystem.ReferenceForId(((int)context._object) ); if (reference != null) { referenceSystem.RemoveReference(reference); } } private void ReadBTreeIndex(ObjectContainerBase stream, int indexId) { if (!stream.IsClient && _btreeIndex == null) { CreateBTreeIndex(stream, indexId); } } protected override void InternalAdd(Transaction trans, int id) { _btreeIndex.Add(trans, id); } protected override void InternalRemove(Transaction ta, int id) { _btreeIndex.Remove(ta, id); } public override void DontDelete(Transaction transaction, int id) { } public override void DefragReference(ClassMetadata classMetadata, DefragmentContextImpl context, int classIndexID) { int newID = -classIndexID; context.WriteInt(newID); } public override int Id() { return _btreeIndex.GetID(); } public override IEnumerator AllSlotIDs(Transaction trans) { return _btreeIndex.AllNodeIds(trans); } public override void DefragIndex(DefragmentContextImpl context) { _btreeIndex.DefragIndex(context); } public static BTree Btree(ClassMetadata clazz) { IClassIndexStrategy index = clazz.Index(); if (!(index is Db4objects.Db4o.Internal.Classindex.BTreeClassIndexStrategy)) { throw new InvalidOperationException(); } return ((Db4objects.Db4o.Internal.Classindex.BTreeClassIndexStrategy)index).Btree (); } public static IEnumerator Iterate(ClassMetadata clazz, Transaction trans) { return Btree(clazz).AsRange(trans).Keys(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/StatefulBuffer.cs0000644000175000017500000001246011700531646030136 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Slots; using Sharpen; namespace Db4objects.Db4o.Internal { /// /// public for .NET conversion reasons /// TODO: Split this class for individual usecases. /// /// /// public for .NET conversion reasons /// TODO: Split this class for individual usecases. Only use the member /// variables needed for the respective usecase. /// /// public sealed class StatefulBuffer : ByteArrayBuffer { internal Db4objects.Db4o.Internal.Transaction _trans; private int _address; private int _addressOffset; private int _cascadeDelete; private int _id; private int _length; public StatefulBuffer(Db4objects.Db4o.Internal.Transaction trans, int initialBufferSize ) { _trans = trans; _length = initialBufferSize; _buffer = new byte[_length]; } public StatefulBuffer(Db4objects.Db4o.Internal.Transaction trans, int address, int length) : this(trans, length) { _address = address; } public StatefulBuffer(Db4objects.Db4o.Internal.Transaction trans, Db4objects.Db4o.Internal.Slots.Slot slot) : this(trans, slot.Address(), slot.Length()) { } public StatefulBuffer(Db4objects.Db4o.Internal.Transaction trans, Pointer4 pointer ) : this(trans, pointer._slot) { _id = pointer._id; } public void DebugCheckBytes() { } // Db4o.log("!!! YapBytes.debugCheckBytes not all bytes used"); // This is normal for writing The FreeSlotArray, becauce one // slot is possibly reserved by it's own pointer. public int GetAddress() { return _address; } public int GetID() { return _id; } public override int Length() { return _length; } public ObjectContainerBase Container() { return _trans.Container(); } public LocalObjectContainer File() { return ((LocalTransaction)_trans).LocalContainer(); } public Db4objects.Db4o.Internal.Transaction Transaction() { return _trans; } public byte[] GetWrittenBytes() { byte[] bytes = new byte[_offset]; System.Array.Copy(_buffer, 0, bytes, 0, _offset); return bytes; } /// public void Read() { Container().ReadBytes(_buffer, _address, _addressOffset, _length); } public Db4objects.Db4o.Internal.StatefulBuffer ReadStatefulBuffer() { int length = ReadInt(); if (length == 0) { return null; } Db4objects.Db4o.Internal.StatefulBuffer yb = new Db4objects.Db4o.Internal.StatefulBuffer (_trans, length); System.Array.Copy(_buffer, _offset, yb._buffer, 0, length); _offset += length; return yb; } public void RemoveFirstBytes(int aLength) { _length -= aLength; byte[] temp = new byte[_length]; System.Array.Copy(_buffer, aLength, temp, 0, _length); _buffer = temp; _offset -= aLength; if (_offset < 0) { _offset = 0; } } public void Address(int address) { _address = address; } public void SetID(int id) { _id = id; } public void SetTransaction(Db4objects.Db4o.Internal.Transaction aTrans) { _trans = aTrans; } public void UseSlot(int adress) { _address = adress; _offset = 0; } // FIXME: FB remove public void UseSlot(int address, int length) { UseSlot(new Db4objects.Db4o.Internal.Slots.Slot(address, length)); } public void UseSlot(Db4objects.Db4o.Internal.Slots.Slot slot) { _address = slot.Address(); _offset = 0; if (slot.Length() > _buffer.Length) { _buffer = new byte[slot.Length()]; } _length = slot.Length(); } // FIXME: FB remove public void UseSlot(int id, int adress, int length) { _id = id; UseSlot(adress, length); } public void Write() { File().WriteBytes(this, _address, _addressOffset); } public void WriteEncrypt() { File().WriteEncrypt(this, _address, _addressOffset); } public ByteArrayBuffer ReadPayloadWriter(int offset, int length) { Db4objects.Db4o.Internal.StatefulBuffer payLoad = new Db4objects.Db4o.Internal.StatefulBuffer (_trans, 0, length); System.Array.Copy(_buffer, offset, payLoad._buffer, 0, length); TransferPayLoadAddress(payLoad, offset); return payLoad; } private void TransferPayLoadAddress(Db4objects.Db4o.Internal.StatefulBuffer toWriter , int offset) { int blockedOffset = offset / Container().BlockSize(); toWriter._address = _address + blockedOffset; toWriter._id = toWriter._address; toWriter._addressOffset = _addressOffset; } public void MoveForward(int length) { _addressOffset += length; } public override string ToString() { return "id " + _id + " adr " + _address + " len " + _length; } public Db4objects.Db4o.Internal.Slots.Slot Slot() { return new Db4objects.Db4o.Internal.Slots.Slot(_address, _length); } public Pointer4 Pointer() { return new Pointer4(_id, Slot()); } public int CascadeDeletes() { return _cascadeDelete; } public void SetCascadeDeletes(int depth) { _cascadeDelete = depth; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IDGenerator.cs0000644000175000017500000000044111700531646027354 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal { public class IDGenerator { private int id = 0; public virtual int Next() { id++; if (id > 0) { return id; } id = 1; return 1; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/PersistentIntegerArray.cs0000644000175000017500000000346611700531646031700 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Ids; using Sharpen; namespace Db4objects.Db4o.Internal { /// public class PersistentIntegerArray : LocalPersistentBase { private readonly Db4objects.Db4o.Internal.Slots.SlotChangeFactory _slotChangeFactory; private int[] _ints; public PersistentIntegerArray(Db4objects.Db4o.Internal.Slots.SlotChangeFactory slotChangeFactory , ITransactionalIdSystem idSystem, int[] arr) : base(idSystem) { _slotChangeFactory = slotChangeFactory; _ints = new int[arr.Length]; System.Array.Copy(arr, 0, _ints, 0, arr.Length); } public PersistentIntegerArray(Db4objects.Db4o.Internal.Slots.SlotChangeFactory slotChangeFactory , ITransactionalIdSystem idSystem, int id) : base(idSystem) { _slotChangeFactory = slotChangeFactory; SetID(id); } public override byte GetIdentifier() { return Const4.IntegerArray; } public override int OwnLength() { return (Const4.IntLength * (Size() + 1)) + Const4.AddedLength; } public override void ReadThis(Transaction trans, ByteArrayBuffer reader) { int length = reader.ReadInt(); _ints = new int[length]; for (int i = 0; i < length; i++) { _ints[i] = reader.ReadInt(); } } public override void WriteThis(Transaction trans, ByteArrayBuffer writer) { writer.WriteInt(Size()); for (int i = 0; i < _ints.Length; i++) { writer.WriteInt(_ints[i]); } } private int Size() { return _ints.Length; } public virtual int[] Array() { return _ints; } public override Db4objects.Db4o.Internal.Slots.SlotChangeFactory SlotChangeFactory () { return _slotChangeFactory; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IModificationAware.cs0000644000175000017500000000032611700531646030711 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal { /// public interface IModificationAware { bool IsModified(object obj); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/DefragmentContextImpl.cs0000644000175000017500000002626511700531646031470 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Mapping; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public sealed class DefragmentContextImpl : IReadWriteBuffer, IDefragmentContext { private ByteArrayBuffer _source; private ByteArrayBuffer _target; private IDefragmentServices _services; private readonly ObjectHeader _objectHeader; private int _declaredAspectCount; private int _currentParentSourceID; public DefragmentContextImpl(ByteArrayBuffer source, Db4objects.Db4o.Internal.DefragmentContextImpl context) : this(source, context._services, context._objectHeader) { } public DefragmentContextImpl(ByteArrayBuffer source, IDefragmentServices services ) : this(source, services, null) { } public DefragmentContextImpl(ByteArrayBuffer source, IDefragmentServices services , ObjectHeader header) { _source = source; _services = services; _target = new ByteArrayBuffer(Length()); _source.CopyTo(_target, 0, 0, Length()); _objectHeader = header; } public DefragmentContextImpl(Db4objects.Db4o.Internal.DefragmentContextImpl parentContext , ObjectHeader header) { _source = parentContext._source; _target = parentContext._target; _services = parentContext._services; _objectHeader = header; } public int Offset() { return _source.Offset(); } public void Seek(int offset) { _source.Seek(offset); _target.Seek(offset); } public void IncrementOffset(int numBytes) { _source.IncrementOffset(numBytes); _target.IncrementOffset(numBytes); } public void IncrementIntSize() { IncrementOffset(Const4.IntLength); } public int CopySlotlessID() { return CopyUnindexedId(false); } public int CopyUnindexedID() { return CopyUnindexedId(true); } private int CopyUnindexedId(bool doRegister) { int orig = _source.ReadInt(); // TODO: There is no test case for the zero case if (orig == 0) { _target.WriteInt(0); return 0; } int mapped = -1; try { mapped = _services.StrictMappedID(orig); } catch (MappingNotFoundException) { mapped = _services.TargetNewId(); _services.MapIDs(orig, mapped, false); if (doRegister) { _services.RegisterUnindexed(orig); } } _target.WriteInt(mapped); return mapped; } public int CopyID() { // This code is slightly redundant. // The profiler shows it's a hotspot. // The following would be non-redudant. // return copy(false, false); int id = _source.ReadInt(); return WriteMappedID(id); } public int CopyID(bool flipNegative) { int id = _source.ReadInt(); return InternalCopyID(flipNegative, id); } public int CopyIDReturnOriginalID() { return CopyIDReturnOriginalID(false); } public int CopyIDReturnOriginalID(bool flipNegative) { int id = _source.ReadInt(); InternalCopyID(flipNegative, id); bool flipped = flipNegative && (id < 0); if (flipped) { return -id; } return id; } private int InternalCopyID(bool flipNegative, int id) { bool flipped = flipNegative && (id < 0); if (flipped) { id = -id; } int mapped = _services.MappedID(id); if (flipped) { mapped = -mapped; } _target.WriteInt(mapped); return mapped; } public void ReadBegin(byte identifier) { _source.ReadBegin(identifier); _target.ReadBegin(identifier); } public byte ReadByte() { byte value = _source.ReadByte(); _target.IncrementOffset(1); return value; } public void ReadBytes(byte[] bytes) { _source.ReadBytes(bytes); _target.IncrementOffset(bytes.Length); } public int ReadInt() { int value = _source.ReadInt(); _target.IncrementOffset(Const4.IntLength); return value; } public void WriteInt(int value) { _source.IncrementOffset(Const4.IntLength); _target.WriteInt(value); } public void Write(LocalObjectContainer file, int address) { file.WriteBytes(_target, address, 0); } public void IncrementStringOffset(LatinStringIO sio) { IncrementStringOffset(sio, _source); IncrementStringOffset(sio, _target); } private void IncrementStringOffset(LatinStringIO sio, ByteArrayBuffer buffer) { sio.ReadLengthAndString(buffer); } public ByteArrayBuffer SourceBuffer() { return _source; } public ByteArrayBuffer TargetBuffer() { return _target; } public IIDMapping Mapping() { return _services; } public Db4objects.Db4o.Internal.Transaction SystemTrans() { return Transaction(); } public IDefragmentServices Services() { return _services; } public static void ProcessCopy(IDefragmentServices context, int sourceID, ISlotCopyHandler command) { ByteArrayBuffer sourceReader = context.SourceBufferByID(sourceID); ProcessCopy(context, sourceID, command, sourceReader); } public static void ProcessCopy(IDefragmentServices services, int sourceID, ISlotCopyHandler command, ByteArrayBuffer sourceReader) { int targetID = services.StrictMappedID(sourceID); Slot targetSlot = services.AllocateTargetSlot(sourceReader.Length()); services.Mapping().MapId(targetID, targetSlot); Db4objects.Db4o.Internal.DefragmentContextImpl context = new Db4objects.Db4o.Internal.DefragmentContextImpl (sourceReader, services); command.ProcessCopy(context); services.TargetWriteBytes(context, targetSlot.Address()); } public void WriteByte(byte value) { _source.IncrementOffset(1); _target.WriteByte(value); } public long ReadLong() { long value = _source.ReadLong(); _target.IncrementOffset(Const4.LongLength); return value; } public void WriteLong(long value) { _source.IncrementOffset(Const4.LongLength); _target.WriteLong(value); } public BitMap4 ReadBitMap(int bitCount) { BitMap4 value = _source.ReadBitMap(bitCount); _target.IncrementOffset(value.MarshalledLength()); return value; } public void ReadEnd() { _source.ReadEnd(); _target.ReadEnd(); } public int WriteMappedID(int originalID) { int mapped = _services.MappedID(originalID); _target.WriteInt(mapped); return mapped; } public int Length() { return _source.Length(); } public Db4objects.Db4o.Internal.Transaction Transaction() { return Services().SystemTrans(); } public ObjectContainerBase Container() { return Transaction().Container(); } public ITypeHandler4 TypeHandlerForId(int id) { return Container().TypeHandlerForClassMetadataID(id); } public int HandlerVersion() { return _objectHeader.HandlerVersion(); } public bool IsLegacyHandlerVersion() { return HandlerVersion() == 0; } public int MappedID(int origID) { return Mapping().StrictMappedID(origID); } public IObjectContainer ObjectContainer() { return Container(); } /// only used by old handlers: OpenTypeHandler0, StringHandler0, ArrayHandler0. /// /// /// only used by old handlers: OpenTypeHandler0, StringHandler0, ArrayHandler0. /// Doesn't need to work with modern IdSystems. /// public Slot AllocateTargetSlot(int length) { return _services.AllocateTargetSlot(length); } /// only used by old handlers: OpenTypeHandler0, StringHandler0, ArrayHandler0. /// /// /// only used by old handlers: OpenTypeHandler0, StringHandler0, ArrayHandler0. /// Doesn't need to work with modern IdSystems. /// public Slot AllocateMappedTargetSlot(int sourceAddress, int length) { Slot slot = AllocateTargetSlot(length); _services.MapIDs(sourceAddress, slot.Address(), false); return slot; } /// public int CopySlotToNewMapped(int sourceAddress, int length) { Slot slot = AllocateMappedTargetSlot(sourceAddress, length); ByteArrayBuffer sourceBuffer = SourceBufferByAddress(sourceAddress, length); TargetWriteBytes(slot.Address(), sourceBuffer); return slot.Address(); } public void TargetWriteBytes(int address, ByteArrayBuffer buffer) { _services.TargetWriteBytes(buffer, address); } /// public ByteArrayBuffer SourceBufferByAddress(int sourceAddress, int length) { ByteArrayBuffer sourceBuffer = _services.SourceBufferByAddress(sourceAddress, length ); return sourceBuffer; } /// public ByteArrayBuffer SourceBufferById(int sourceId) { ByteArrayBuffer sourceBuffer = _services.SourceBufferByID(sourceId); return sourceBuffer; } public void WriteToTarget(int address) { _services.TargetWriteBytes(this, address); } public void WriteBytes(byte[] bytes) { _target.WriteBytes(bytes); _source.IncrementOffset(bytes.Length); } public IReadBuffer Buffer() { return _source; } public void Defragment(ITypeHandler4 handler) { ITypeHandler4 typeHandler = HandlerRegistry.CorrectHandlerVersion(this, handler); if (Handlers4.UseDedicatedSlot(this, typeHandler)) { if (Handlers4.HasClassIndex(typeHandler)) { CopyID(); } else { CopyUnindexedID(); } return; } typeHandler.Defragment(this); } public void BeginSlot() { } // do nothing public Db4objects.Db4o.Internal.ClassMetadata ClassMetadata() { return _objectHeader.ClassMetadata(); } public bool IsNull(int fieldIndex) { return _objectHeader._headerAttributes.IsNull(fieldIndex); } public int DeclaredAspectCount() { return _declaredAspectCount; } public void DeclaredAspectCount(int count) { _declaredAspectCount = count; } public Db4objects.Db4o.Internal.Marshall.SlotFormat SlotFormat() { return Db4objects.Db4o.Internal.Marshall.SlotFormat.ForHandlerVersion(HandlerVersion ()); } public void CurrentParentSourceID(int id) { _currentParentSourceID = id; } public int ConsumeCurrentParentSourceID() { int id = _currentParentSourceID; _currentParentSourceID = 0; return id; } public void CopyAddress() { int sourceEntryAddress = _source.ReadInt(); int sourceId = ConsumeCurrentParentSourceID(); int sourceObjectAddress = _services.SourceAddressByID(sourceId); int entryOffset = sourceEntryAddress - sourceObjectAddress; int targetObjectAddress = _services.TargetAddressByID(_services.StrictMappedID(sourceId )); _target.WriteInt(targetObjectAddress + entryOffset); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IEventDispatcher.cs0000644000175000017500000000044611700531646030417 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { public interface IEventDispatcher { bool Dispatch(Transaction trans, object obj, int eventID); bool HasEventRegistered(int eventID); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ArrayType.cs0000644000175000017500000000205311700531646027132 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Internal { /// public class ArrayType { public static readonly Db4objects.Db4o.Internal.ArrayType None = new Db4objects.Db4o.Internal.ArrayType (0); public static readonly Db4objects.Db4o.Internal.ArrayType PlainArray = new Db4objects.Db4o.Internal.ArrayType (3); public static readonly Db4objects.Db4o.Internal.ArrayType MultidimensionalArray = new Db4objects.Db4o.Internal.ArrayType(4); private ArrayType(int value) { _value = value; } private readonly int _value; public virtual int Value() { return _value; } public static Db4objects.Db4o.Internal.ArrayType ForValue(int value) { switch (value) { case 0: { return None; } case 3: { return PlainArray; } case 4: { return MultidimensionalArray; } default: { throw new ArgumentException(); } } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ExternalObjectContainer.cs0000644000175000017500000001217411700531646031773 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Ext; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal { /// public abstract class ExternalObjectContainer : ObjectContainerBase { public ExternalObjectContainer(IConfiguration config) : base(config) { } public sealed override void Activate(object obj) { Activate(null, obj); } /// public sealed override void Activate(object obj, int depth) { Activate(null, obj, ActivationDepthProvider().ActivationDepth(depth, ActivationMode .Activate)); } public sealed override void Deactivate(object obj) { Deactivate(null, obj); } /// /// public sealed override void Bind(object obj, long id) { Bind(null, obj, id); } /// /// public sealed override void Commit() { Commit(null); } /// public sealed override void Deactivate(object obj, int depth) { Deactivate(null, obj, depth); } public sealed override void Delete(object a_object) { Delete(null, a_object); } public override object Descend(object obj, string[] path) { return Descend(null, obj, path); } public override IExtObjectContainer Ext() { return this; } /// public sealed override IObjectSet QueryByExample(object template) { return QueryByExample(null, template); } /// /// public sealed override object GetByID(long id) { return GetByID(null, id); } public sealed override object GetByUUID(Db4oUUID uuid) { return GetByUUID(null, uuid); } public sealed override long GetID(object obj) { return GetID(null, obj); } public sealed override IObjectInfo GetObjectInfo(object obj) { return GetObjectInfo(null, obj); } public override bool IsActive(object obj) { return IsActive(null, obj); } public override bool IsCached(long id) { return IsCached(null, id); } public override bool IsStored(object obj) { return IsStored(null, obj); } /// public sealed override object PeekPersisted(object obj, int depth, bool committed ) { return PeekPersisted(null, obj, ActivationDepthProvider().ActivationDepth(depth, ActivationMode.Peek), committed); } public sealed override void Purge(object obj) { Purge(null, obj); } public override IQuery Query() { return Query((Transaction)null); } public sealed override IObjectSet Query(Type clazz) { return QueryByExample(clazz); } public sealed override IObjectSet Query(Predicate predicate) { return Query(predicate, (IQueryComparator)null); } public sealed override IObjectSet Query(Predicate predicate, IQueryComparator comparator ) { return Query(null, predicate, comparator); } public sealed override void Refresh(object obj, int depth) { Refresh(null, obj, depth); } public sealed override void Rollback() { Rollback(null); } /// /// public sealed override void Store(object obj) { Store(obj, Const4.Unspecified); } /// /// public sealed override void Store(object obj, int depth) { Store(null, obj, depth == Const4.Unspecified ? (IUpdateDepth)UpdateDepthProvider( ).Unspecified(NullModifiedObjectQuery.Instance) : (IUpdateDepth)UpdateDepthProvider ().ForDepth(depth)); } public sealed override IStoredClass StoredClass(object clazz) { return StoredClass(null, clazz); } public override IStoredClass[] StoredClasses() { return StoredClasses(null); } /// /// /// public abstract override void Backup(IStorage targetStorage, string path); public abstract override Db4oDatabase Identity(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/TreeInt.cs0000644000175000017500000001317411700531646026572 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Query.Processor; namespace Db4objects.Db4o.Internal { /// Base class for balanced trees. /// Base class for balanced trees. /// public class TreeInt : Tree, IReadWriteable { public static Db4objects.Db4o.Internal.TreeInt Add(Db4objects.Db4o.Internal.TreeInt tree, int value) { return (Db4objects.Db4o.Internal.TreeInt)((Db4objects.Db4o.Internal.TreeInt)Tree. Add(tree, new Db4objects.Db4o.Internal.TreeInt(value))); } public static Db4objects.Db4o.Internal.TreeInt RemoveLike(Db4objects.Db4o.Internal.TreeInt tree, int value) { return (Db4objects.Db4o.Internal.TreeInt)Tree.RemoveLike(tree, new Db4objects.Db4o.Internal.TreeInt (value)); } public static Tree AddAll(Tree tree, IIntIterator4 iter) { if (!iter.MoveNext()) { return tree; } Db4objects.Db4o.Internal.TreeInt firstAdded = new Db4objects.Db4o.Internal.TreeInt (iter.CurrentInt()); tree = Tree.Add(tree, firstAdded); while (iter.MoveNext()) { tree = tree.Add(new Db4objects.Db4o.Internal.TreeInt(iter.CurrentInt())); } return tree; } public int _key; public TreeInt(int a_key) { this._key = a_key; } public override int Compare(Tree a_to) { return _key - ((Db4objects.Db4o.Internal.TreeInt)a_to)._key; } internal virtual Tree DeepClone() { return new Db4objects.Db4o.Internal.TreeInt(_key); } public override bool Duplicates() { return false; } public static Db4objects.Db4o.Internal.TreeInt Find(Tree a_in, int a_key) { if (a_in == null) { return null; } return ((Db4objects.Db4o.Internal.TreeInt)a_in).Find(a_key); } public Db4objects.Db4o.Internal.TreeInt Find(int a_key) { int cmp = _key - a_key; if (cmp < 0) { if (((Tree)_subsequent) != null) { return ((Db4objects.Db4o.Internal.TreeInt)((Tree)_subsequent)).Find(a_key); } } else { if (cmp > 0) { if (((Tree)_preceding) != null) { return ((Db4objects.Db4o.Internal.TreeInt)((Tree)_preceding)).Find(a_key); } } else { return this; } } return null; } public virtual object Read(ByteArrayBuffer buffer) { return new Db4objects.Db4o.Internal.TreeInt(buffer.ReadInt()); } public virtual void Write(ByteArrayBuffer buffer) { buffer.WriteInt(_key); } public static void Write(ByteArrayBuffer buffer, Db4objects.Db4o.Internal.TreeInt tree) { Write(buffer, tree, tree == null ? 0 : tree.Size()); } public static void Write(ByteArrayBuffer buffer, Db4objects.Db4o.Internal.TreeInt tree, int size) { if (tree == null) { buffer.WriteInt(0); return; } buffer.WriteInt(size); tree.Traverse(new _IVisitor4_97(buffer)); } private sealed class _IVisitor4_97 : IVisitor4 { public _IVisitor4_97(ByteArrayBuffer buffer) { this.buffer = buffer; } public void Visit(object a_object) { ((Db4objects.Db4o.Internal.TreeInt)a_object).Write(buffer); } private readonly ByteArrayBuffer buffer; } public virtual int OwnLength() { return Const4.IntLength; } internal virtual bool VariableLength() { return false; } internal virtual QCandidate ToQCandidate(QCandidates candidates) { QCandidate qc = new QCandidate(candidates, null, _key); qc._preceding = ToQCandidate((Db4objects.Db4o.Internal.TreeInt)((Tree)_preceding) , candidates); qc._subsequent = ToQCandidate((Db4objects.Db4o.Internal.TreeInt)((Tree)_subsequent ), candidates); qc._size = _size; return qc; } public static QCandidate ToQCandidate(Db4objects.Db4o.Internal.TreeInt tree, QCandidates candidates) { if (tree == null) { return null; } return tree.ToQCandidate(candidates); } public override string ToString() { return string.Empty + _key; } protected override Tree ShallowCloneInternal(Tree tree) { Db4objects.Db4o.Internal.TreeInt treeint = (Db4objects.Db4o.Internal.TreeInt)base .ShallowCloneInternal(tree); treeint._key = _key; return treeint; } public override object ShallowClone() { Db4objects.Db4o.Internal.TreeInt treeint = new Db4objects.Db4o.Internal.TreeInt(_key ); return ShallowCloneInternal(treeint); } public static int MarshalledLength(Db4objects.Db4o.Internal.TreeInt a_tree) { if (a_tree == null) { return Const4.IntLength; } return a_tree.MarshalledLength(); } public int MarshalledLength() { if (VariableLength()) { IntByRef length = new IntByRef(Const4.IntLength); Traverse(new _IVisitor4_152(length)); return length.value; } return MarshalledLength(Size()); } private sealed class _IVisitor4_152 : IVisitor4 { public _IVisitor4_152(IntByRef length) { this.length = length; } public void Visit(object obj) { length.value += ((Db4objects.Db4o.Internal.TreeInt)obj).OwnLength(); } private readonly IntByRef length; } public int MarshalledLength(int size) { return Const4.IntLength + (size * OwnLength()); } public override object Key() { return _key; } public override bool Equals(object obj) { Db4objects.Db4o.Internal.TreeInt other = (Db4objects.Db4o.Internal.TreeInt)obj; return other._key == _key; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ClassMetadata.cs0000644000175000017500000020352111700531646027723 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Classindex; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Diagnostic; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Metadata; using Db4objects.Db4o.Internal.Query.Processor; using Db4objects.Db4o.Internal.Reflect; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Query; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Core; using Db4objects.Db4o.Reflect.Generic; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public class ClassMetadata : PersistentBase, IStoredClass { /// /// For reference types, _typeHandler always holds a StandardReferenceTypeHandler /// that will use the _aspects of this class to take care of its business. /// /// /// For reference types, _typeHandler always holds a StandardReferenceTypeHandler /// that will use the _aspects of this class to take care of its business. A custom /// type handler would appear as a TypeHandlerAspect in that case. /// For value types, _typeHandler always holds the actual value type handler be it /// a custom type handler or a builtin one. /// protected ITypeHandler4 _typeHandler; public Db4objects.Db4o.Internal.ClassMetadata _ancestor; private Config4Class _config; public ClassAspect[] _aspects; private IClassIndexStrategy _index; private string i_name; private readonly ObjectContainerBase _container; internal byte[] i_nameBytes; private ByteArrayBuffer i_reader; private bool _classIndexed; private IReflectClass _classReflector; private IEventDispatcher _eventDispatcher; private bool _internal; private bool _unversioned; private TernaryBool _canUpdateFast = TernaryBool.Unspecified; private TranslatedAspect _translator; private IModificationAware _modificationChecker = ClassMetadata.AlwaysModified.Instance; private IFieldAccessor _fieldAccessor; private IFunction4 _constructor; private TypeHandlerAspect _customTypeHandlerAspect; private IAspectTraversalStrategy _aspectTraversalStrategy; internal bool CanUpdateFast() { if (_canUpdateFast == TernaryBool.Unspecified) { _canUpdateFast = TernaryBool.ForBoolean(CheckCanUpdateFast()); } return _canUpdateFast.BooleanValue(false); } private bool CheckCanUpdateFast() { if (_ancestor != null && !_ancestor.CanUpdateFast()) { return false; } if (_config != null && _config.CascadeOnDelete() == TernaryBool.Yes) { return false; } BooleanByRef hasIndex = new BooleanByRef(false); TraverseDeclaredFields(new _IProcedure4_101(hasIndex)); return !hasIndex.value; } private sealed class _IProcedure4_101 : IProcedure4 { public _IProcedure4_101(BooleanByRef hasIndex) { this.hasIndex = hasIndex; } public void Apply(object arg) { if (((FieldMetadata)arg).HasIndex()) { hasIndex.value = true; } } private readonly BooleanByRef hasIndex; } public virtual bool IsInternal() { return _internal; } private IClassIndexStrategy CreateIndexStrategy() { return new BTreeClassIndexStrategy(this); } protected ClassMetadata(ObjectContainerBase container) { if (null == container) { throw new ArgumentNullException(); } _container = container; _index = CreateIndexStrategy(); _classIndexed = true; _fieldAccessor = new StrictFieldAccessor(); } public ClassMetadata(ObjectContainerBase container, IReflectClass classReflector) { if (null == container) { throw new ArgumentNullException(); } _container = container; ClassReflector(classReflector); _index = CreateIndexStrategy(); _classIndexed = true; if (_container.Config().ExceptionsOnNotStorable()) { _fieldAccessor = new StrictFieldAccessor(); } else { _fieldAccessor = new LenientFieldAccessor(); } } internal virtual IFieldAccessor FieldAccessor() { return _fieldAccessor; } private ITypeHandler4 CreateDefaultTypeHandler() { // TODO: make sure initializeAspects has been executed // before the actual type handler is required // and remove this method return new StandardReferenceTypeHandler(this); } public virtual void CascadeActivation(IActivationContext context) { if (!ObjectCanActivate(context.Transaction(), context.TargetObject())) { return; } TraverseAllAspects(new _ITraverseAspectCommand_160(context)); } private sealed class _ITraverseAspectCommand_160 : ITraverseAspectCommand { public _ITraverseAspectCommand_160(IActivationContext context) { this.context = context; } public void ProcessAspectOnMissingClass(ClassAspect aspect, int currentSlot) { } // do nothing public void ProcessAspect(ClassAspect aspect, int currentSlot) { aspect.CascadeActivation(context); } public int DeclaredAspectCount(Db4objects.Db4o.Internal.ClassMetadata classMetadata ) { return classMetadata.DeclaredAspectCount(); } public bool Cancelled() { return false; } private readonly IActivationContext context; } public void AddFieldIndices(StatefulBuffer buffer) { if (!StandardReferenceTypeHandlerIsUsed()) { return; } if (HasClassIndex() || HasVirtualAttributes()) { ObjectHeader oh = new ObjectHeader(this, buffer); ObjectIdContextImpl context = new ObjectIdContextImpl(buffer.Transaction(), buffer , oh, buffer.GetID()); Handlers4.FieldAwareTypeHandler(CorrectHandlerVersion(context)).AddFieldIndices(context ); } } // FIXME: This method wants to be removed. private bool StandardReferenceTypeHandlerIsUsed() { return _typeHandler is StandardReferenceTypeHandler; } internal virtual void InitializeAspects() { BitTrue(Const4.CheckedChanges); Collection4 aspects = new Collection4(); if (null != _aspects) { aspects.AddAll(_aspects); } ITypeHandler4 customTypeHandler = Container().Handlers.ConfiguredTypeHandler(ClassReflector ()); bool dirty = IsDirty(); if (InstallTranslator(aspects, customTypeHandler)) { dirty = true; } if (Container().DetectSchemaChanges()) { if (GenerateCommitTimestamps()) { if (!HasCommitTimestampField()) { aspects.Add(Container().CommitTimestampIndex()); dirty = true; } } if (GenerateUUIDs()) { if (!HasUUIDField()) { aspects.Add(Container().UUIDIndex()); dirty = true; } } } if (InstallCustomTypehandler(aspects, customTypeHandler)) { dirty = true; } bool defaultFieldBehaviour = _translator == null && customTypeHandler == null; if (Container().DetectSchemaChanges()) { if (defaultFieldBehaviour) { if (CollectReflectFields(aspects)) { dirty = true; } } if (dirty) { _container.SetDirtyInSystemTransaction(this); } } if (dirty || !defaultFieldBehaviour) { _aspects = ToClassAspectArray(aspects); } DiagnosticProcessor dp = _container._handlers.DiagnosticProcessor(); if (dp.Enabled()) { dp.CheckClassHasFields(this); } if (_aspects == null) { _aspects = new FieldMetadata[0]; } InitializeConstructor(customTypeHandler); if (StateDead()) { return; } _container.Callbacks().ClassOnRegistered(this); SetStateOK(); } private ClassAspect[] ToClassAspectArray(Collection4 aspects) { ClassAspect[] array = new ClassAspect[aspects.Size()]; aspects.ToArray(array); for (int i = 0; i < array.Length; i++) { array[i].SetHandle(i); } return array; } private bool InstallCustomTypehandler(Collection4 aspects, ITypeHandler4 customTypeHandler ) { if (customTypeHandler == null) { return false; } if (customTypeHandler is IModificationAware) { _modificationChecker = (IModificationAware)customTypeHandler; } if (Handlers4.IsStandaloneTypeHandler(customTypeHandler)) { _typeHandler = customTypeHandler; return false; } bool dirty = false; TypeHandlerAspect typeHandlerAspect = new TypeHandlerAspect(this, customTypeHandler ); if (!ReplaceAspectByName(aspects, typeHandlerAspect)) { aspects.Add(typeHandlerAspect); dirty = true; } DisableAspectsBefore(aspects, typeHandlerAspect); _customTypeHandlerAspect = typeHandlerAspect; return dirty; } private void DisableAspectsBefore(Collection4 aspects, TypeHandlerAspect typeHandlerAspect ) { int disableFromVersion = aspects.IndexOf(typeHandlerAspect) + 1; IEnumerator i = aspects.GetEnumerator(); while (i.MoveNext()) { ClassAspect aspect = (ClassAspect)i.Current; if (aspect == typeHandlerAspect) { break; } aspect.DisableFromAspectCountVersion(disableFromVersion); } } private bool InstallTranslator(Collection4 aspects, ITypeHandler4 customTypeHandler ) { if (_config == null) { return false; } IObjectTranslator translator = _config.GetTranslator(); if (translator == null) { return false; } ClassAspect existingAspect = AspectByName(aspects, TranslatedAspect.FieldNameFor( translator)); if (null != existingAspect) { return InstallTranslatorOnExistingAspect(translator, existingAspect, aspects); } if (customTypeHandler == null) { return InstallTranslatorOnNewAspect(translator, aspects); } return false; } private bool InstallTranslatorOnNewAspect(IObjectTranslator translator, Collection4 aspects) { TranslatedAspect translatedAspect = new TranslatedAspect(this, translator); aspects.Add(translatedAspect); _translator = translatedAspect; return true; } private bool InstallTranslatorOnExistingAspect(IObjectTranslator translator, ClassAspect existingAspect, Collection4 aspects) { if (existingAspect is TranslatedAspect) { TranslatedAspect translatedAspect = (TranslatedAspect)existingAspect; translatedAspect.InitializeTranslator(translator); _translator = translatedAspect; return false; } // older versions didn't store the aspect type properly _translator = new TranslatedAspect(this, translator); aspects.ReplaceByIdentity(existingAspect, _translator); return true; } private bool ReplaceAspectByName(Collection4 aspects, ClassAspect aspect) { ClassAspect existing = AspectByName(aspects, aspect.GetName()); if (existing == null) { return false; } aspects.ReplaceByIdentity(existing, aspect); return true; } private ClassAspect AspectByName(Collection4 aspects, string aspectName) { IEnumerator i = aspects.GetEnumerator(); while (i.MoveNext()) { ClassAspect current = (ClassAspect)i.Current; if (current.GetName().Equals(aspectName)) { return current; } } return null; } public virtual bool AspectsAreInitialized() { if (_aspects == null) { return false; } if (_ancestor != null) { return _ancestor.AspectsAreInitialized(); } return true; } private bool CollectReflectFields(Collection4 collectedAspects) { bool dirty = false; IReflectField[] reflectFieldArray = ReflectFields(); for (int reflectFieldIndex = 0; reflectFieldIndex < reflectFieldArray.Length; ++reflectFieldIndex) { IReflectField reflectField = reflectFieldArray[reflectFieldIndex]; if (!StoreField(reflectField)) { continue; } Db4objects.Db4o.Internal.ClassMetadata classMetadata = Handlers4.ErasedFieldType( Container(), reflectField.GetFieldType()); if (classMetadata == null) { continue; } FieldMetadata field = new FieldMetadata(this, reflectField, classMetadata); if (Contains(collectedAspects, field)) { continue; } dirty = true; collectedAspects.Add(field); } return dirty; } private bool Contains(Collection4 collectedAspects, FieldMetadata field) { IEnumerator aspectIterator = collectedAspects.GetEnumerator(); while (aspectIterator.MoveNext()) { if (((ClassAspect)aspectIterator.Current).Equals(field)) { return true; } } return false; } internal virtual void AddToIndex(Transaction trans, int id) { if (!trans.Container().MaintainsIndices()) { return; } AddToIndex1(trans, id); } internal void AddToIndex1(Transaction a_trans, int a_id) { if (_ancestor != null) { _ancestor.AddToIndex1(a_trans, a_id); } if (HasClassIndex()) { _index.Add(a_trans, a_id); } } internal virtual bool AllowsQueries() { return HasClassIndex(); } public virtual bool DescendOnCascadingActivation() { return true; } internal virtual void CheckChanges() { if (StateOK()) { if (!BitIsTrue(Const4.CheckedChanges)) { BitTrue(Const4.CheckedChanges); if (_ancestor != null) { _ancestor.CheckChanges(); } // Ancestor first, so the object length calculates // correctly if (_classReflector != null) { InitializeAspects(); if (!_container.IsClient && !IsReadOnlyContainer()) { Write(_container.SystemTransaction()); } } } } } public virtual void CheckType() { IReflectClass claxx = ClassReflector(); if (claxx == null) { return; } if (_container._handlers.IclassInternal.IsAssignableFrom(claxx)) { _internal = true; } if (_container._handlers.IclassUnversioned.IsAssignableFrom(claxx)) { _unversioned = true; } if (IsDb4oTypeImpl()) { IDb4oTypeImpl db4oTypeImpl = (IDb4oTypeImpl)claxx.NewInstance(); _classIndexed = (db4oTypeImpl == null || db4oTypeImpl.HasClassIndex()); } else { if (_config != null) { _classIndexed = _config.Indexed(); } } } public virtual bool IsDb4oTypeImpl() { return _container._handlers.IclassDb4otypeimpl.IsAssignableFrom(ClassReflector()); } public IUpdateDepth AdjustUpdateDepth(Transaction trans, IUpdateDepth depth) { return depth.Adjust(this); } public virtual bool CascadesOnDeleteOrUpdate() { Config4Class config = ConfigOrAncestorConfig(); if (config == null) { return false; } bool cascadeOnDelete = config.CascadeOnDelete() == TernaryBool.Yes; bool cascadeOnUpdate = config.CascadeOnUpdate() == TernaryBool.Yes; return cascadeOnDelete || cascadeOnUpdate; } public virtual FixedActivationDepth AdjustCollectionDepthToBorders(FixedActivationDepth depth) { if (!ClassReflector().IsCollection()) { return depth; } return depth.AdjustDepthToBorders(); } public int UpdateDepthFromConfig() { if (_config != null && _config.UpdateDepth() != Const4.Unspecified) { return _config.UpdateDepth(); } Config4Impl config = ConfigImpl(); int depth = config.UpdateDepth(); if (_ancestor != null) { int ancestordepth = _ancestor.UpdateDepthFromConfig(); if (ancestordepth > depth) { return ancestordepth; } } return depth; } public virtual void CollectConstraints(Transaction trans, QConObject parentConstraint , object obj, IVisitor4 visitor) { TraverseAllAspects(new _TraverseFieldCommand_534(trans, parentConstraint, obj, visitor )); } private sealed class _TraverseFieldCommand_534 : TraverseFieldCommand { public _TraverseFieldCommand_534(Transaction trans, QConObject parentConstraint, object obj, IVisitor4 visitor) { this.trans = trans; this.parentConstraint = parentConstraint; this.obj = obj; this.visitor = visitor; } protected override void Process(FieldMetadata field) { if (field.IsEnabledOn(AspectVersionContextImpl.CheckAlwaysEnabled)) { field.CollectConstraints(trans, parentConstraint, obj, visitor); } } private readonly Transaction trans; private readonly QConObject parentConstraint; private readonly object obj; private readonly IVisitor4 visitor; } public void CollectIDs(CollectIdContext context, string fieldName) { CollectIDs(context, new _IPredicate4_544(fieldName)); } private sealed class _IPredicate4_544 : IPredicate4 { public _IPredicate4_544(string fieldName) { this.fieldName = fieldName; } public bool Match(object candidate) { return fieldName.Equals(((ClassAspect)candidate).GetName()); } private readonly string fieldName; } public void CollectIDs(CollectIdContext context) { CollectIDs(context, new _IPredicate4_553()); } private sealed class _IPredicate4_553 : IPredicate4 { public _IPredicate4_553() { } public bool Match(object candidate) { return true; } } private void CollectIDs(CollectIdContext context, IPredicate4 predicate) { if (!StandardReferenceTypeHandlerIsUsed()) { throw new InvalidOperationException(); } ((StandardReferenceTypeHandler)CorrectHandlerVersion(context)).CollectIDs(context , predicate); } public virtual void CollectIDs(QueryingReadContext context) { if (!StandardReferenceTypeHandlerIsUsed()) { throw new InvalidOperationException(); } Handlers4.CollectIDs(context, CorrectHandlerVersion(context)); } public virtual Config4Class Config() { return _config; } public virtual Config4Class ConfigOrAncestorConfig() { if (_config != null) { return _config; } if (_ancestor != null) { return _ancestor.ConfigOrAncestorConfig(); } return null; } private void ResolveClassReflector(string className) { IReflectClass reflectClass = _container.Reflector().ForName(className); if (null == reflectClass) { throw new InvalidOperationException("Cannot initialize ClassMetadata for '" + className + "'."); } ClassReflector(reflectClass); } private void InitializeConstructor(ITypeHandler4 customTypeHandler) { if (IsTransient()) { _container.LogMsg(23, GetName()); SetStateDead(); return; } if (IsInterface() || IsAbstract()) { return; } IFunction4 constructor = CreateConstructor(customTypeHandler); if (constructor != null) { _constructor = constructor; return; } NotStorable(); } private bool IsAbstract() { return ClassReflector().IsAbstract(); } private bool IsInterface() { return ClassReflector().IsInterface(); } private IFunction4 CreateConstructor(ITypeHandler4 customTypeHandler) { if (customTypeHandler is IInstantiatingTypeHandler) { return new _IFunction4_632(this); } if (HasObjectConstructor()) { return new _IFunction4_640(this); } if (ClassReflector().EnsureCanBeInstantiated()) { return new _IFunction4_648(this); } return null; } private sealed class _IFunction4_632 : IFunction4 { public _IFunction4_632(ClassMetadata _enclosing) { this._enclosing = _enclosing; } public object Apply(object context) { return this._enclosing.InstantiateWithCustomTypeHandlerIfEnabled(((UnmarshallingContext )context)); } private readonly ClassMetadata _enclosing; } private sealed class _IFunction4_640 : IFunction4 { public _IFunction4_640(ClassMetadata _enclosing) { this._enclosing = _enclosing; } public object Apply(object context) { return this._enclosing._translator.Construct(((UnmarshallingContext)context)); } private readonly ClassMetadata _enclosing; } private sealed class _IFunction4_648 : IFunction4 { public _IFunction4_648(ClassMetadata _enclosing) { this._enclosing = _enclosing; } public object Apply(object context) { return this._enclosing.InstantiateFromReflector(((UnmarshallingContext)context).Container ()); } private readonly ClassMetadata _enclosing; } private void NotStorable() { _container.LogMsg(7, GetName()); SetStateDead(); } private bool IsTransient() { return _container._handlers.IsTransient(ClassReflector()); } private void ClassReflector(IReflectClass claxx) { _classReflector = claxx; if (claxx == null) { _typeHandler = null; return; } _typeHandler = CreateDefaultTypeHandler(); } public virtual void Deactivate(Transaction trans, IObjectInfo reference, IActivationDepth depth) { object obj = reference.GetObject(); if (ObjectCanDeactivate(trans, reference)) { ForceDeactivation(trans, depth, obj); ObjectOnDeactivate(trans, reference); } } public virtual void ForceDeactivation(Transaction trans, IActivationDepth depth, object obj) { DeactivateFields(trans.Container().ActivationContextFor(trans, obj, depth)); } private void ObjectOnDeactivate(Transaction transaction, IObjectInfo obj) { ObjectContainerBase container = transaction.Container(); container.Callbacks().ObjectOnDeactivate(transaction, obj); DispatchEvent(transaction, obj.GetObject(), EventDispatchers.Deactivate); } private bool ObjectCanDeactivate(Transaction transaction, IObjectInfo objectInfo) { ObjectContainerBase container = transaction.Container(); return container.Callbacks().ObjectCanDeactivate(transaction, objectInfo) && DispatchEvent (transaction, objectInfo.GetObject(), EventDispatchers.CanDeactivate); } internal void DeactivateFields(IActivationContext context) { TraverseAllAspects(new _ITraverseAspectCommand_701(context)); } private sealed class _ITraverseAspectCommand_701 : ITraverseAspectCommand { public _ITraverseAspectCommand_701(IActivationContext context) { this.context = context; } public void ProcessAspectOnMissingClass(ClassAspect aspect, int currentSlot) { } // do nothing public void ProcessAspect(ClassAspect aspect, int currentSlot) { if (aspect.IsEnabledOn(AspectVersionContextImpl.CheckAlwaysEnabled)) { aspect.Deactivate(context); } } public int DeclaredAspectCount(Db4objects.Db4o.Internal.ClassMetadata classMetadata ) { return classMetadata.DeclaredAspectCount(); } public bool Cancelled() { return false; } private readonly IActivationContext context; } internal void Delete(StatefulBuffer buffer, object obj) { RemoveFromIndex(buffer.Transaction(), buffer.GetID()); CascadeDeletion(buffer, obj); } private void CascadeDeletion(StatefulBuffer buffer, object obj) { ObjectHeader oh = new ObjectHeader(this, buffer); DeleteContextImpl context = new DeleteContextImpl(buffer, oh, ClassReflector(), null ); DeleteMembers(context, ArrayTypeFor(buffer, obj), false); } private ArrayType ArrayTypeFor(StatefulBuffer buffer, object obj) { return buffer.Transaction().Container()._handlers.ArrayType(obj); } /// public virtual void Delete(IDeleteContext context) { CorrectHandlerVersion(context).Delete(context); } internal virtual void DeleteMembers(DeleteContextImpl context, ArrayType arrayType , bool isUpdate) { StatefulBuffer buffer = (StatefulBuffer)context.Buffer(); int preserveCascade = context.CascadeDeleteDepth(); try { if (CascadeOnDelete()) { if (ClassReflector().IsCollection()) { buffer.SetCascadeDeletes(CollectionDeleteDepth(context)); } else { buffer.SetCascadeDeletes(1); } } Handlers4.FieldAwareTypeHandler(CorrectHandlerVersion(context)).DeleteMembers(context , isUpdate); } catch (Exception e) { // This a catch for changed class hierarchies. // It's very ugly to catch all here but it does // help to heal migration from earlier db4o // versions. DiagnosticProcessor dp = Container()._handlers.DiagnosticProcessor(); if (dp.Enabled()) { dp.DeletionFailed(); } } buffer.SetCascadeDeletes(preserveCascade); } private int CollectionDeleteDepth(DeleteContextImpl context) { return 1; } public virtual TernaryBool CascadeOnDeleteTernary() { Config4Class config = Config(); TernaryBool cascadeOnDelete = TernaryBool.Unspecified; if (config != null && (cascadeOnDelete = config.CascadeOnDelete()) != TernaryBool .Unspecified) { return cascadeOnDelete; } if (_ancestor == null) { return cascadeOnDelete; } return _ancestor.CascadeOnDeleteTernary(); } public virtual bool CascadeOnDelete() { return CascadeOnDeleteTernary() == TernaryBool.Yes; } public bool DispatchEvent(Transaction trans, object obj, int message) { return EventDispatcher().Dispatch(trans, obj, message); } public bool HasEventRegistered(Transaction trans, int eventID) { return EventDispatcher().HasEventRegistered(eventID); } private IEventDispatcher EventDispatcher() { if (null != _eventDispatcher) { return _eventDispatcher; } _eventDispatcher = EventDispatchers.ForClass(_container, ClassReflector()); return _eventDispatcher; } public int DeclaredAspectCount() { if (_aspects == null) { return 0; } return _aspects.Length; } public int AspectCount() { int count = DeclaredAspectCount(); if (_ancestor != null) { count += _ancestor.AspectCount(); } return count; } // Scrolls offset in passed reader to the offset the passed field should // be read at. public HandlerVersion SeekToField(Transaction trans, ByteArrayBuffer buffer, FieldMetadata field) { if (buffer == null) { return HandlerVersion.Invalid; } if (!StandardReferenceTypeHandlerIsUsed()) { return HandlerVersion.Invalid; } buffer.Seek(0); ObjectHeader oh = new ObjectHeader(_container, buffer); bool res = oh.ClassMetadata().SeekToField(new ObjectHeaderContext(trans, buffer, oh), field); if (!res) { return HandlerVersion.Invalid; } return new HandlerVersion(oh.HandlerVersion()); } public bool SeekToField(ObjectHeaderContext context, ClassAspect field) { if (!StandardReferenceTypeHandlerIsUsed()) { return false; } return Handlers4.FieldAwareTypeHandler(CorrectHandlerVersion(context)).SeekToField (context, field); } public virtual bool GenerateUUIDs() { if (!GenerateVirtual()) { return false; } TernaryBool configValue = (_config == null) ? TernaryBool.Unspecified : _config.GenerateUUIDs (); return Generate1(_container.Config().GenerateUUIDs(), configValue); } public virtual bool GenerateCommitTimestamps() { return _container.Config().GenerateCommitTimestamps().DefiniteYes(); } private bool GenerateVirtual() { if (_unversioned) { return false; } if (_internal) { return false; } return true; } private bool Generate1(ConfigScope globalConfig, TernaryBool individualConfig) { return globalConfig.ApplyConfig(individualConfig); } public virtual Db4objects.Db4o.Internal.ClassMetadata GetAncestor() { return _ancestor; } public virtual object GetComparableObject(object forObject) { if (_config != null) { if (_config.QueryAttributeProvider() != null) { return _config.QueryAttributeProvider().Attribute(forObject); } } return forObject; } public virtual Db4objects.Db4o.Internal.ClassMetadata GetHigherHierarchy(Db4objects.Db4o.Internal.ClassMetadata a_classMetadata) { Db4objects.Db4o.Internal.ClassMetadata yc = GetHigherHierarchy1(a_classMetadata); if (yc != null) { return yc; } return a_classMetadata.GetHigherHierarchy1(this); } private Db4objects.Db4o.Internal.ClassMetadata GetHigherHierarchy1(Db4objects.Db4o.Internal.ClassMetadata a_classMetadata) { if (a_classMetadata == this) { return this; } if (_ancestor != null) { return _ancestor.GetHigherHierarchy1(a_classMetadata); } return null; } public virtual Db4objects.Db4o.Internal.ClassMetadata GetHigherOrCommonHierarchy( Db4objects.Db4o.Internal.ClassMetadata a_classMetadata) { Db4objects.Db4o.Internal.ClassMetadata yc = GetHigherHierarchy1(a_classMetadata); if (yc != null) { return yc; } if (_ancestor != null) { yc = _ancestor.GetHigherOrCommonHierarchy(a_classMetadata); if (yc != null) { return yc; } } return a_classMetadata.GetHigherHierarchy1(this); } public override byte GetIdentifier() { return Const4.Yapclass; } public virtual long[] GetIDs() { lock (Lock()) { if (!StateOK()) { return new long[0]; } return GetIDs(_container.Transaction); } } public virtual long[] GetIDs(Transaction trans) { lock (Lock()) { if (!StateOK()) { return new long[0]; } if (!HasClassIndex()) { return new long[0]; } return trans.Container().GetIDsForClass(trans, this); } } public virtual bool HasClassIndex() { if (!_classIndexed) { return false; } return StandardReferenceTypeHandlerIsUsed() || !(Handlers4.IsValueType(_typeHandler )); } private bool AncestorHasUUIDField() { if (_ancestor == null) { return false; } return _ancestor.HasUUIDField(); } private bool HasUUIDField() { if (AncestorHasUUIDField()) { return true; } return Arrays4.ContainsInstanceOf(_aspects, typeof(UUIDFieldMetadata)); } private bool AncestorHasVersionField() { if (_ancestor == null) { return false; } return _ancestor.HasVersionField(); } private bool AncestorHasCommitTimestampField() { if (_ancestor == null) { return false; } return _ancestor.HasCommitTimestampField(); } public virtual bool HasVersionField() { if (AncestorHasVersionField()) { return true; } return Arrays4.ContainsInstanceOf(_aspects, typeof(VersionFieldMetadata)); } private bool HasCommitTimestampField() { if (AncestorHasCommitTimestampField()) { return true; } return Arrays4.ContainsInstanceOf(_aspects, typeof(CommitTimestampFieldMetadata)); } public virtual IClassIndexStrategy Index() { return _index; } public virtual int IndexEntryCount(Transaction ta) { if (!StateOK()) { return 0; } return _index.EntryCount(ta); } public virtual IReflectClass ClassReflector() { return _classReflector; } public virtual string GetName() { if (i_name == null) { if (_classReflector != null) { SetName(_classReflector.GetName()); } } return i_name; } public virtual IStoredClass GetParentStoredClass() { return GetAncestor(); } public virtual IStoredField[] GetStoredFields() { lock (Lock()) { if (_aspects == null) { return new IStoredField[0]; } Collection4 storedFields = new Collection4(); TraverseDeclaredFields(new _IProcedure4_1037(storedFields)); IStoredField[] fields = new IStoredField[storedFields.Size()]; storedFields.ToArray(fields); return fields; } } private sealed class _IProcedure4_1037 : IProcedure4 { public _IProcedure4_1037(Collection4 storedFields) { this.storedFields = storedFields; } public void Apply(object field) { storedFields.Add(field); } private readonly Collection4 storedFields; } public ObjectContainerBase Container() { return _container; } public virtual FieldMetadata FieldMetadataForName(string name) { ByRef byReference = new ByRef(); TraverseAllAspects(new _TraverseFieldCommand_1054(name, byReference)); return (FieldMetadata)byReference.value; } private sealed class _TraverseFieldCommand_1054 : TraverseFieldCommand { public _TraverseFieldCommand_1054(string name, ByRef byReference) { this.name = name; this.byReference = byReference; } protected override void Process(FieldMetadata field) { if (name.Equals(field.GetName())) { byReference.value = field; } } private readonly string name; private readonly ByRef byReference; } /// public virtual bool HasField(ObjectContainerBase container, string fieldName) { if (ClassReflector().IsCollection()) { return true; } return FieldMetadataForName(fieldName) != null; } internal virtual bool HasVirtualAttributes() { if (_internal) { return false; } return HasVersionField() || HasUUIDField(); } public virtual bool HoldsAnyClass() { return ClassReflector().IsCollection(); } internal virtual void IncrementFieldsOffset1(ByteArrayBuffer a_bytes) { int length = ReadAspectCount(a_bytes); for (int i = 0; i < length; i++) { _aspects[i].IncrementOffset(a_bytes); } } internal bool Init(Db4objects.Db4o.Internal.ClassMetadata ancestor) { if (DTrace.enabled) { DTrace.ClassmetadataInit.Log(GetID()); } SetConfig(ConfigImpl().ConfigClass(GetName())); SetAncestor(ancestor); CheckType(); if (AllowsQueries()) { _index.Initialize(_container); } BitTrue(Const4.CheckedChanges); return true; } internal void InitConfigOnUp(Transaction systemTrans) { Config4Class extendedConfig = Platform4.ExtendConfiguration(_classReflector, _container .Configure(), _config); if (extendedConfig != null) { _config = extendedConfig; } if (_config == null) { return; } if (!StateOK()) { return; } InitializeFieldsConfiguration(systemTrans, extendedConfig); CheckAllConfiguredFieldsExist(extendedConfig); } private void InitializeFieldsConfiguration(Transaction systemTrans, Config4Class extendedConfig) { if (_aspects == null) { return; } for (int i = 0; i < _aspects.Length; i++) { if (_aspects[i] is FieldMetadata) { FieldMetadata field = (FieldMetadata)_aspects[i]; string fieldName = field.GetName(); if (!field.HasConfig() && extendedConfig != null && extendedConfig.ConfigField(fieldName ) != null) { field.InitConfiguration(fieldName); } field.InitConfigOnUp(systemTrans); } } } private void CheckAllConfiguredFieldsExist(Config4Class config) { Hashtable4 exceptionalFields = config.ExceptionalFieldsOrNull(); if (exceptionalFields == null) { return; } IEnumerator i = exceptionalFields.ValuesIterator(); while (i.MoveNext()) { Config4Field fieldConfig = (Config4Field)i.Current; if (!fieldConfig.Used()) { ConfigImpl().DiagnosticProcessor().ObjectFieldDoesNotExist(GetName(), fieldConfig .GetName()); } } } internal virtual void InitOnUp(Transaction systemTrans) { if (!StateOK()) { return; } InitConfigOnUp(systemTrans); StoreStaticFieldValues(systemTrans, false); } public virtual object Instantiate(UnmarshallingContext context) { // overridden in PrimitiveTypeMetadata // never called for primitive YapAny // FIXME: [TA] no longer necessary? // context.adjustInstantiationDepth(); object obj = context.PersistentObject(); bool instantiating = (obj == null); if (instantiating) { obj = InstantiateObject(context); if (obj == null) { return null; } ShareTransaction(obj, context.Transaction()); ShareObjectReference(obj, context.ObjectReference()); OnInstantiate(context, obj); if (context.ActivationDepth().Mode().IsPrefetch()) { context.ObjectReference().SetStateDeactivated(); return obj; } if (!context.ActivationDepth().RequiresActivation()) { context.ObjectReference().SetStateDeactivated(); return obj; } return Activate(context); } if (ActivatingActiveObject(context.ActivationDepth().Mode(), context.ObjectReference ())) { IActivationDepth child = context.ActivationDepth().Descend(this); if (child.RequiresActivation()) { CascadeActivation(new ActivationContext4(context.Transaction(), obj, child)); } return obj; } return Activate(context); } protected void OnInstantiate(UnmarshallingContext context, object obj) { context.SetObjectWeak(obj); context.Transaction().ReferenceSystem().AddExistingReference(context.ObjectReference ()); ObjectOnInstantiate(context.Transaction(), context.ObjectReference()); } public virtual object InstantiateTransient(UnmarshallingContext context) { // overridden in YapClassPrimitive // never called for primitive YapAny object obj = InstantiateObject(context); if (obj == null) { return null; } context.Container().Peeked(context.ObjectId(), obj); if (context.ActivationDepth().RequiresActivation()) { InstantiateFields(context); } return obj; } private bool ActivatingActiveObject(ActivationMode mode, ObjectReference @ref) { return !mode.IsRefresh() && @ref.IsActive(); } private object Activate(UnmarshallingContext context) { object obj = context.PersistentObject(); ObjectReference objectReference = context.ObjectReference(); if (!ObjectCanActivate(context.Transaction(), obj)) { objectReference.SetStateDeactivated(); return obj; } objectReference.SetStateClean(); if (context.ActivationDepth().RequiresActivation()) { InstantiateFields(context); } ObjectOnActivate(context.Transaction(), objectReference); return obj; } public virtual bool HasObjectConstructor() { return _translator != null && _translator.IsObjectConstructor(); } public virtual bool IsTranslated() { return _translator != null; } private object InstantiateObject(UnmarshallingContext context) { object obj = _constructor.Apply(context); context.PersistentObject(obj); return obj; } private void ObjectOnInstantiate(Transaction transaction, IObjectInfo reference) { transaction.Container().Callbacks().ObjectOnInstantiate(transaction, reference); } private object InstantiateFromReflector(ObjectContainerBase stream) { if (_classReflector == null) { throw new InvalidOperationException(); } try { return _classReflector.NewInstance(); } catch (MissingMethodException) { Container().LogMsg(7, ClassReflector().GetName()); return null; } catch (Exception) { // TODO: be more helpful here return null; } } private void ShareObjectReference(object obj, ObjectReference @ref) { if (obj is IDb4oTypeImpl) { ((IDb4oTypeImpl)obj).SetObjectReference(@ref); } } private void ShareTransaction(object obj, Transaction transaction) { if (obj is ITransactionAware) { ((ITransactionAware)obj).SetTrans(transaction); } } private void ObjectOnActivate(Transaction transaction, IObjectInfo obj) { ObjectContainerBase container = transaction.Container(); container.Callbacks().ObjectOnActivate(transaction, obj); DispatchEvent(transaction, obj.GetObject(), EventDispatchers.Activate); } private bool ObjectCanActivate(Transaction transaction, object obj) { ObjectContainerBase container = transaction.Container(); return container.Callbacks().ObjectCanActivate(transaction, obj) && DispatchEvent (transaction, obj, EventDispatchers.CanActivate); } internal virtual void InstantiateFields(UnmarshallingContext context) { ITypeHandler4 handler = CorrectHandlerVersion((IHandlerVersionContext)context); Handlers4.Activate(context, handler); } public virtual bool IsArray() { return ClassReflector().IsCollection(); } internal virtual bool IsCollection(object obj) { return Reflector().ForObject(obj).IsCollection(); } public override bool IsDirty() { if (!StateOK()) { return false; } return base.IsDirty(); } internal virtual bool IsEnum() { return Platform4.IsJavaEnum(Reflector(), ClassReflector()); } public virtual bool HasIdentity() { return true; } /// no any, primitive, array or other tricks. /// /// no any, primitive, array or other tricks. overridden in YapClassAny and /// YapClassPrimitive /// public virtual bool IsStronglyTyped() { return true; } public virtual bool IsValueType() { return Handlers4.HoldsValueType(_typeHandler); } private object Lock() { return _container.Lock(); } public virtual string NameToWrite() { if (_config != null && _config.WriteAs() != null) { return _config.WriteAs(); } if (i_name == null) { return string.Empty; } return ConfigImpl().ResolveAliasRuntimeName(i_name); } public bool CallConstructor() { TernaryBool specialized = CallConstructorSpecialized(); // FIXME: If specified, return yes?!? if (!specialized.IsUnspecified()) { return specialized.DefiniteYes(); } return ConfigImpl().CallConstructors().DefiniteYes(); } private Config4Impl ConfigImpl() { return _container.ConfigImpl; } private TernaryBool CallConstructorSpecialized() { if (_config != null) { TernaryBool res = _config.CallConstructor(); if (!res.IsUnspecified()) { return res; } } if (IsEnum()) { return TernaryBool.No; } if (_ancestor != null) { return _ancestor.CallConstructorSpecialized(); } return TernaryBool.Unspecified; } public override int OwnLength() { return MarshallerFamily.Current()._class.MarshalledLength(_container, this); } internal virtual void Purge() { _index.Purge(); } // TODO: may want to add manual purge to Btree // indexes here public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context) { ITypeHandler4 typeHandler = CorrectHandlerVersion(context); if (typeHandler is ICascadingTypeHandler) { return ((ICascadingTypeHandler)typeHandler).ReadCandidateHandler(context); } return null; } public virtual ITypeHandler4 SeekCandidateHandler(QueryingReadContext context) { if (IsArray()) { if (Platform4.IsCollectionTranslator(this._config)) { context.Seek(context.Offset() + Const4.IntLength); return new ArrayHandler(null, false); } IncrementFieldsOffset1((ByteArrayBuffer)context.Buffer()); if (_ancestor != null) { return _ancestor.SeekCandidateHandler(context); } } return null; } public int ReadAspectCount(IReadBuffer buffer) { int count = buffer.ReadInt(); if (count > _aspects.Length) { return _aspects.Length; } return count; } internal virtual byte[] ReadName(Transaction a_trans) { i_reader = a_trans.Container().ReadBufferById(a_trans, GetID()); return ReadName1(a_trans, i_reader); } public byte[] ReadName1(Transaction trans, ByteArrayBuffer reader) { if (reader == null) { return null; } i_reader = reader; bool ok = false; try { ClassMarshaller marshaller = MarshallerFamily.Current()._class; i_nameBytes = marshaller.ReadName(trans, reader); marshaller.ReadMetaClassID(reader); // never used ??? SetStateUnread(); BitFalse(Const4.CheckedChanges); BitFalse(Const4.StaticFieldsStored); ok = true; return i_nameBytes; } finally { if (!ok) { SetStateDead(); } } } public virtual void ReadVirtualAttributes(Transaction trans, ObjectReference @ref , bool lastCommitted) { int id = @ref.GetID(); ObjectContainerBase container = trans.Container(); ByteArrayBuffer buffer = container.ReadBufferById(trans, id, lastCommitted); ObjectHeader oh = new ObjectHeader(this, buffer); ObjectReferenceContext context = new ObjectReferenceContext(trans, buffer, oh, @ref ); Handlers4.FieldAwareTypeHandler(CorrectHandlerVersion(context)).ReadVirtualAttributes (context); } public virtual GenericReflector Reflector() { return _container.Reflector(); } public virtual void Rename(string newName) { if (_container.IsClient) { Exceptions4.ThrowRuntimeException(58); } int tempState = _state; SetStateOK(); SetName(newName); i_nameBytes = AsBytes(i_name); SetStateDirty(); Write(_container.SystemTransaction()); IReflectClass oldReflector = _classReflector; ClassReflector(Container().Reflector().ForName(newName)); Container().ClassCollection().RefreshClassCache(this, oldReflector); Refresh(); _state = tempState; } //TODO: duplicates ClassMetadataRepository#asBytes private byte[] AsBytes(string str) { return Container().StringIO().Write(str); } internal void CreateConfigAndConstructor(Hashtable4 a_byteHashTable, IReflectClass claxx) { SetName(ResolveName(claxx)); SetConfig(ConfigImpl().ConfigClass(GetName())); if (claxx == null) { ResolveClassReflector(GetName()); } else { ClassReflector(claxx); } // createConstructor(true); if (i_nameBytes != null) { a_byteHashTable.Remove(i_nameBytes); i_nameBytes = null; } } internal virtual string ResolveName(IReflectClass claxx) { if (claxx != null) { return claxx.GetName(); } if (i_nameBytes != null) { string name = _container.StringIO().Read(i_nameBytes); return ConfigImpl().ResolveAliasStoredName(name); } throw new InvalidOperationException(); } internal virtual bool ReadThis() { bool stateUnread = StateUnread(); if (stateUnread) { SetStateOK(); SetStateClean(); } if (stateUnread || StateDead()) { ForceRead(); return true; } return false; } internal void ForceRead() { if (i_reader == null || BitIsTrue(Const4.Reading)) { return; } BitTrue(Const4.Reading); try { MarshallerFamily.ForConverterVersion(_container.ConverterVersion())._class.Read(_container , this, i_reader); i_nameBytes = null; i_reader = null; } finally { BitFalse(Const4.Reading); } } public override void ReadThis(Transaction a_trans, ByteArrayBuffer a_reader) { throw Exceptions4.VirtualException(); } public virtual void Refresh() { if (!StateUnread()) { ResolveClassReflector(i_name); BitFalse(Const4.CheckedChanges); CheckChanges(); TraverseDeclaredFields(new _IProcedure4_1582()); } } private sealed class _IProcedure4_1582 : IProcedure4 { public _IProcedure4_1582() { } public void Apply(object arg) { ((FieldMetadata)arg).Refresh(); } } internal virtual void RemoveFromIndex(Transaction ta, int id) { if (HasClassIndex()) { _index.Remove(ta, id); } if (_ancestor != null) { _ancestor.RemoveFromIndex(ta, id); } } internal virtual bool RenameField(string oldName, string newName) { BooleanByRef renamed = new BooleanByRef(false); for (int i = 0; i < _aspects.Length; i++) { if (_aspects[i].GetName().Equals(newName)) { _container.LogMsg(9, "class:" + GetName() + " field:" + newName); return false; } } TraverseDeclaredFields(new _IProcedure4_1607(oldName, newName, renamed)); return renamed.value; } private sealed class _IProcedure4_1607 : IProcedure4 { public _IProcedure4_1607(string oldName, string newName, BooleanByRef renamed) { this.oldName = oldName; this.newName = newName; this.renamed = renamed; } public void Apply(object arg) { FieldMetadata field = (FieldMetadata)arg; if (field.GetName().Equals(oldName)) { field.SetName(newName); renamed.value = true; } } private readonly string oldName; private readonly string newName; private readonly BooleanByRef renamed; } internal virtual void SetConfig(Config4Class config) { if (config == null) { return; } // The configuration can be set by a ObjectClass#readAs setting // from YapClassCollection, right after reading the meta information // for the first time. In that case we never change the setting if (_config == null) { _config = config; } } internal virtual void SetName(string a_name) { i_name = a_name; } internal void SetStateDead() { BitTrue(Const4.Dead); BitFalse(Const4.Continue); } private void SetStateUnread() { BitFalse(Const4.Dead); BitTrue(Const4.Continue); } internal void SetStateOK() { BitFalse(Const4.Dead); BitFalse(Const4.Continue); } internal virtual bool StateDead() { return BitIsTrue(Const4.Dead); } internal bool StateOK() { return BitIsFalse(Const4.Continue) && BitIsFalse(Const4.Dead) && BitIsFalse(Const4 .Reading); } internal virtual bool StateUnread() { return BitIsTrue(Const4.Continue) && BitIsFalse(Const4.Dead) && BitIsFalse(Const4 .Reading); } internal virtual bool StoreField(IReflectField field) { if (field.IsStatic()) { return false; } if (IsTransient(field)) { if (!ShouldStoreTransientFields()) { return false; } } return Platform4.CanSetAccessible() || field.IsPublic(); } internal virtual bool ShouldStoreTransientFields() { Config4Class config = ConfigOrAncestorConfig(); if (config == null) { return false; } return config.StoreTransientFields(); } private bool IsTransient(IReflectField field) { return field.IsTransient() || Platform4.IsTransient(field.GetFieldType()); } public virtual IStoredField StoredField(string fieldName, object fieldType) { lock (Lock()) { Db4objects.Db4o.Internal.ClassMetadata fieldTypeFilter = fieldType == null ? null : _container.ClassMetadataForReflectClass(ReflectorUtils.ReflectClassFor(Reflector (), fieldType)); ByRef foundField = new ByRef(); TraverseAllAspects(new _TraverseFieldCommand_1701(foundField, fieldName, fieldTypeFilter )); // TODO: implement field creation return (IStoredField)foundField.value; } } private sealed class _TraverseFieldCommand_1701 : TraverseFieldCommand { public _TraverseFieldCommand_1701(ByRef foundField, string fieldName, Db4objects.Db4o.Internal.ClassMetadata fieldTypeFilter) { this.foundField = foundField; this.fieldName = fieldName; this.fieldTypeFilter = fieldTypeFilter; } protected override void Process(FieldMetadata field) { if (foundField.value != null) { return; } if (field.GetName().Equals(fieldName)) { if (fieldTypeFilter == null || fieldTypeFilter == field.FieldType()) { foundField.value = field; } } } private readonly ByRef foundField; private readonly string fieldName; private readonly Db4objects.Db4o.Internal.ClassMetadata fieldTypeFilter; } internal virtual void StoreStaticFieldValues(Transaction trans, bool force) { if (BitIsTrue(Const4.StaticFieldsStored) && !force) { return; } BitTrue(Const4.StaticFieldsStored); if (!ShouldStoreStaticFields(trans)) { return; } ObjectContainerBase stream = trans.Container(); stream.ShowInternalClasses(true); try { StaticClass sc = QueryStaticClass(trans); if (sc == null) { CreateStaticClass(trans); } else { UpdateStaticClass(trans, sc); } } finally { stream.ShowInternalClasses(false); } } private bool ShouldStoreStaticFields(Transaction trans) { return !IsReadOnlyContainer() && (StaticFieldValuesArePersisted() || Platform4.StoreStaticFieldValues (trans.Reflector(), ClassReflector())); } private bool IsReadOnlyContainer() { return Container().Config().IsReadOnly(); } private void UpdateStaticClass(Transaction trans, StaticClass sc) { ObjectContainerBase stream = trans.Container(); stream.Activate(trans, sc, new FixedActivationDepth(4)); StaticField[] existingFields = sc.fields; IEnumerator staticFields = Iterators.Map(StaticReflectFields(), new _IFunction4_1761 (this, existingFields, trans)); sc.fields = ToStaticFieldArray(staticFields); if (!stream.IsClient) { SetStaticClass(trans, sc); } } private sealed class _IFunction4_1761 : IFunction4 { public _IFunction4_1761(ClassMetadata _enclosing, StaticField[] existingFields, Transaction trans) { this._enclosing = _enclosing; this.existingFields = existingFields; this.trans = trans; } public object Apply(object arg) { IReflectField reflectField = (IReflectField)arg; StaticField existingField = this._enclosing.FieldByName(existingFields, reflectField .GetName()); if (existingField != null) { this._enclosing.UpdateExistingStaticField(trans, existingField, reflectField); return existingField; } return this._enclosing.ToStaticField(reflectField); } private readonly ClassMetadata _enclosing; private readonly StaticField[] existingFields; private readonly Transaction trans; } private void CreateStaticClass(Transaction trans) { if (trans.Container().IsClient) { return; } StaticClass sc = new StaticClass(GetName(), ToStaticFieldArray(StaticReflectFieldsToStaticFields ())); SetStaticClass(trans, sc); } private IEnumerator StaticReflectFieldsToStaticFields() { return Iterators.Map(StaticReflectFields(), new _IFunction4_1789(this)); } private sealed class _IFunction4_1789 : IFunction4 { public _IFunction4_1789(ClassMetadata _enclosing) { this._enclosing = _enclosing; } public object Apply(object arg) { return this._enclosing.ToStaticField((IReflectField)arg); } private readonly ClassMetadata _enclosing; } protected virtual StaticField ToStaticField(IReflectField reflectField) { return new StaticField(reflectField.GetName(), StaticReflectFieldValue(reflectField )); } private object StaticReflectFieldValue(IReflectField reflectField) { return _fieldAccessor.Get(reflectField, null); } private void SetStaticClass(Transaction trans, StaticClass sc) { // TODO: we should probably use a specific update depth here, 4? trans.Container().StoreInternal(trans, sc, true); } private StaticField[] ToStaticFieldArray(IEnumerator iterator4) { return ToStaticFieldArray(new Collection4(iterator4)); } private StaticField[] ToStaticFieldArray(Collection4 fields) { return (StaticField[])fields.ToArray(new StaticField[fields.Size()]); } private IEnumerator StaticReflectFields() { return Iterators.Filter(ReflectFields(), new _IPredicate4_1818()); } private sealed class _IPredicate4_1818 : IPredicate4 { public _IPredicate4_1818() { } public bool Match(object candidate) { return ((IReflectField)candidate).IsStatic() && !((IReflectField)candidate).IsTransient (); } } private IReflectField[] ReflectFields() { return ClassReflector().GetDeclaredFields(); } protected virtual void UpdateExistingStaticField(Transaction trans, StaticField existingField , IReflectField reflectField) { ObjectContainerBase stream = trans.Container(); object newValue = StaticReflectFieldValue(reflectField); if (existingField.value != null && newValue != null && existingField.value.GetType () == newValue.GetType()) { int id = stream.GetID(trans, existingField.value); if (id > 0) { if (existingField.value != newValue) { // This is the clue: // Bind the current static member to it's old database identity, // so constants and enums will work with '==' stream.Bind(trans, newValue, id); // This may produce unwanted side effects if the static field object // was modified in the current session. TODO:Add documentation case. stream.Refresh(trans, newValue, int.MaxValue); existingField.value = newValue; } return; } } if (newValue == null) { try { _fieldAccessor.Set(reflectField, null, existingField.value); } catch (Exception) { } // fail silently // TODO: why? return; } existingField.value = newValue; } private bool StaticFieldValuesArePersisted() { return (_config != null && _config.StaticFieldValuesArePersisted()); } protected virtual StaticField FieldByName(StaticField[] fields, string fieldName) { for (int i = 0; i < fields.Length; i++) { StaticField field = fields[i]; if (fieldName.Equals(field.name)) { return field; } } return null; } private StaticClass QueryStaticClass(Transaction trans) { IQuery q = trans.Container().Query(trans); q.Constrain(Const4.ClassStaticclass); q.Descend("name").Constrain(GetName()); IObjectSet os = q.Execute(); return os.Count > 0 ? (StaticClass)os.Next() : null; } public override string ToString() { if (i_name != null) { return i_name; } if (i_nameBytes == null) { return "*CLASS NAME UNKNOWN*"; } LatinStringIO stringIO = _container == null ? Const4.stringIO : _container.StringIO (); return stringIO.Read(i_nameBytes); } public override bool WriteObjectBegin() { if (!StateOK()) { return false; } return base.WriteObjectBegin(); } public sealed override void WriteThis(Transaction trans, ByteArrayBuffer writer) { MarshallerFamily.Current()._class.Write(trans, this, writer); } public virtual IPreparedComparison PrepareComparison(IContext context, object source ) { return Handlers4.PrepareComparisonFor(_typeHandler, context, source); } public static void DefragObject(DefragmentContextImpl context) { ObjectHeader header = ObjectHeader.Defrag(context); DefragmentContextImpl childContext = new DefragmentContextImpl(context, header); header.ClassMetadata().Defragment(childContext); } public virtual void Defragment(IDefragmentContext context) { CorrectHandlerVersion(context).Defragment(context); } public virtual void DefragClass(DefragmentContextImpl context, int classIndexID) { MarshallerFamily mf = MarshallerFamily.ForConverterVersion(Container().ConverterVersion ()); mf._class.Defrag(this, _container.StringIO(), context, classIndexID); } public static Db4objects.Db4o.Internal.ClassMetadata ReadClass(ObjectContainerBase stream, ByteArrayBuffer reader) { ObjectHeader oh = new ObjectHeader(stream, reader); return oh.ClassMetadata(); } public virtual bool IsAssignableFrom(Db4objects.Db4o.Internal.ClassMetadata other ) { return ClassReflector().IsAssignableFrom(other.ClassReflector()); } public virtual void SetAncestor(Db4objects.Db4o.Internal.ClassMetadata ancestor) { if (ancestor == this) { throw new InvalidOperationException(); } _ancestor = ancestor; } public virtual object WrapWithTransactionContext(Transaction transaction, object value) { if (value is int) { return value; } return new TransactionContext(transaction, value); } public virtual ITypeHandler4 TypeHandler() { return _typeHandler; } public virtual ITypeHandler4 DelegateTypeHandler(IContext context) { if (context is IHandlerVersionContext) { return CorrectHandlerVersion((IHandlerVersionContext)context); } return _typeHandler; } protected virtual ITypeHandler4 CorrectHandlerVersion(IHandlerVersionContext context ) { ITypeHandler4 typeHandler = HandlerRegistry.CorrectHandlerVersion(context, _typeHandler ); if (typeHandler != _typeHandler) { if (typeHandler is StandardReferenceTypeHandler) { ((StandardReferenceTypeHandler)typeHandler).ClassMetadata(this); } } return typeHandler; } public virtual void TraverseDeclaredFields(IProcedure4 procedure) { if (_aspects == null) { return; } for (int i = 0; i < _aspects.Length; i++) { if (_aspects[i] is FieldMetadata) { procedure.Apply(_aspects[i]); } } } public virtual void TraverseDeclaredAspects(IProcedure4 procedure) { if (_aspects == null) { return; } for (int i = 0; i < _aspects.Length; i++) { procedure.Apply(_aspects[i]); } } public virtual bool AspectsAreNull() { return _aspects == null; } private sealed class AlwaysModified : IModificationAware { internal static readonly ClassMetadata.AlwaysModified Instance = new ClassMetadata.AlwaysModified (); public bool IsModified(object obj) { return true; } } public virtual bool IsModified(object obj) { return _modificationChecker.IsModified(obj); } public virtual int InstanceCount() { return InstanceCount(_container.Transaction); } public virtual int InstanceCount(Transaction trans) { return _container.InstanceCount(this, trans); } public virtual bool IsStorable() { return !StateDead() && !IsTransient(); } private object InstantiateWithCustomTypeHandlerIfEnabled(UnmarshallingContext context ) { if (!_customTypeHandlerAspect.IsEnabledOn(context)) { return InstantiateForVersionWithoutCustomTypeHandler(context); } return InstantiateWithCustomTypeHandler(context); } private object InstantiateForVersionWithoutCustomTypeHandler(UnmarshallingContext context) { IFunction4 oldVersionConstructor = CreateConstructor(null); if (null == oldVersionConstructor) { throw new InvalidOperationException(); } return oldVersionConstructor.Apply(context); } private object InstantiateWithCustomTypeHandler(UnmarshallingContext context) { ContextState contextState = context.SaveState(); try { bool fieldHasValue = SeekToField(context, _customTypeHandlerAspect); if (!fieldHasValue) { context.RestoreState(contextState); return InstantiateForVersionWithoutCustomTypeHandler(context); } IInstantiatingTypeHandler customTypeHandler = (IInstantiatingTypeHandler)_customTypeHandlerAspect ._typeHandler; return context.SlotFormat().DoWithSlotIndirection(context, new _IClosure4_2056(customTypeHandler , context)); } finally { context.RestoreState(contextState); } } private sealed class _IClosure4_2056 : IClosure4 { public _IClosure4_2056(IInstantiatingTypeHandler customTypeHandler, UnmarshallingContext context) { this.customTypeHandler = customTypeHandler; this.context = context; } public object Run() { return customTypeHandler.Instantiate(context); } private readonly IInstantiatingTypeHandler customTypeHandler; private readonly UnmarshallingContext context; } public virtual bool IsStruct() { return Platform4.IsStruct(ClassReflector()); } public virtual void DropClassIndex() { if (Container().IsClient) { throw new InvalidOperationException(); } _index = CreateIndexStrategy(); _index.Initialize(Container()); Container().SetDirtyInSystemTransaction(this); } public virtual void TraverseAllAspects(ITraverseAspectCommand command) { AspectTraversalStrategy().TraverseAllAspects(command); } private IAspectTraversalStrategy AspectTraversalStrategy() { if (_aspectTraversalStrategy == null) { _aspectTraversalStrategy = DetectAspectTraversalStrategy(); } return _aspectTraversalStrategy; } protected virtual IAspectTraversalStrategy DetectAspectTraversalStrategy() { IList ancestors = CompareAncestorHierarchy(); for (IEnumerator diffIter = ancestors.GetEnumerator(); diffIter.MoveNext(); ) { HierarchyAnalyzer.Diff diff = ((HierarchyAnalyzer.Diff)diffIter.Current); if (diff.IsRemoved()) { return CreateRemovedAspectTraversalStrategy(ancestors); } } return new StandardAspectTraversalStrategy(this); } private IAspectTraversalStrategy CreateRemovedAspectTraversalStrategy(IList ancestors ) { return new ModifiedAspectTraversalStrategy(this, ancestors); } private IList CompareAncestorHierarchy() { return new HierarchyAnalyzer(this, ClassReflector()).Analyze(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IBuiltinTypeHandler.cs0000644000175000017500000000054411700531646031074 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public interface IBuiltinTypeHandler : ITypeHandler4 { void RegisterReflector(IReflector reflector); IReflectClass ClassReflector(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/FrozenObjectInfo.cs0000644000175000017500000000420011700531646030414 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { public class FrozenObjectInfo : IObjectInfo { private readonly Db4oDatabase _sourceDatabase; private readonly long _uuidLongPart; private readonly long _id; private readonly long _commitTimestamp; private readonly object _object; public FrozenObjectInfo(object @object, long id, Db4oDatabase sourceDatabase, long uuidLongPart, long commitTimestamp) { _sourceDatabase = sourceDatabase; _uuidLongPart = uuidLongPart; _id = id; _commitTimestamp = commitTimestamp; _object = @object; } private FrozenObjectInfo(ObjectReference @ref, VirtualAttributes virtualAttributes ) : this(@ref == null ? null : @ref.GetObject(), @ref == null ? -1 : @ref.GetID( ), virtualAttributes == null ? null : virtualAttributes.i_database, virtualAttributes == null ? -1 : virtualAttributes.i_uuid, virtualAttributes == null ? 0 : virtualAttributes .i_version) { } public FrozenObjectInfo(Transaction trans, ObjectReference @ref, bool committed) : this(@ref, IsInstantiatedReference(@ref) ? @ref.VirtualAttributes(trans, committed ) : null) { } private static bool IsInstantiatedReference(ObjectReference @ref) { return @ref != null && @ref.GetObject() != null; } public virtual long GetInternalID() { return _id; } public virtual object GetObject() { return _object; } public virtual Db4oUUID GetUUID() { if (_sourceDatabase == null) { return null; } return new Db4oUUID(_uuidLongPart, _sourceDatabase.GetSignature()); } public virtual long GetVersion() { return GetCommitTimestamp(); } public virtual long GetCommitTimestamp() { return _commitTimestamp; } public virtual long SourceDatabaseId(Transaction trans) { if (_sourceDatabase == null) { return -1; } return _sourceDatabase.GetID(trans); } public virtual long UuidLongPart() { return _uuidLongPart; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IIndexableTypeHandler.cs0000644000175000017500000000154011700531646031356 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public interface IIndexableTypeHandler : IIndexable4, ITypeHandler4 { object IndexEntryToObject(IContext context, object indexEntry); /// /// object ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer writer); /// /// object ReadIndexEntry(IObjectIdContext context); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/MarshallingBuffer.cs0000644000175000017500000002273211700531646030613 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Sharpen; namespace Db4objects.Db4o.Internal { /// public class MarshallingBuffer : IWriteBuffer { private const int SizeNeeded = Const4.LongLength; private const int NoParent = -int.MaxValue; private ByteArrayBuffer _delegate; private int _lastOffSet; private int _addressInParent = NoParent; private List4 _children; private FieldMetadata _indexedField; public virtual int Length() { return Offset(); } public virtual int Offset() { if (_delegate == null) { return 0; } return _delegate.Offset(); } public virtual void WriteByte(byte b) { PrepareWrite(); _delegate.WriteByte(b); } public virtual void WriteBytes(byte[] bytes) { PrepareWrite(bytes.Length); _delegate.WriteBytes(bytes); } public virtual void WriteInt(int i) { PrepareWrite(); _delegate.WriteInt(i); } public virtual void WriteLong(long l) { PrepareWrite(); _delegate.WriteLong(l); } private void PrepareWrite() { PrepareWrite(SizeNeeded); } public virtual void PrepareWrite(int sizeNeeded) { if (_delegate == null) { _delegate = new ByteArrayBuffer(sizeNeeded); } _lastOffSet = _delegate.Offset(); if (RemainingSize() < sizeNeeded) { Resize(sizeNeeded); } } private int RemainingSize() { return _delegate.Length() - _delegate.Offset(); } private void Resize(int sizeNeeded) { int newSize = _delegate.Length() * 2; if (newSize - _lastOffSet < sizeNeeded) { newSize += sizeNeeded; } ByteArrayBuffer temp = new ByteArrayBuffer(newSize); temp.Seek(_lastOffSet); _delegate.CopyTo(temp, 0, 0, _delegate.Length()); _delegate = temp; } public virtual void TransferLastWriteTo(MarshallingBuffer other, bool storeLengthInLink ) { other.AddressInParent(_lastOffSet, storeLengthInLink); int length = _delegate.Offset() - _lastOffSet; other.PrepareWrite(length); int otherOffset = other._delegate.Offset(); System.Array.Copy(_delegate._buffer, _lastOffSet, other._delegate._buffer, otherOffset , length); _delegate.Seek(_lastOffSet); other._delegate.Seek(otherOffset + length); other._lastOffSet = otherOffset; } private void AddressInParent(int offset, bool storeLengthInLink) { _addressInParent = storeLengthInLink ? offset : -offset; } public virtual void TransferContentTo(ByteArrayBuffer buffer) { TransferContentTo(buffer, Length()); } public virtual void TransferContentTo(ByteArrayBuffer buffer, int length) { if (_delegate == null) { return; } System.Array.Copy(_delegate._buffer, 0, buffer._buffer, buffer._offset, length); buffer._offset += length; } public virtual ByteArrayBuffer TestDelegate() { return _delegate; } public virtual MarshallingBuffer AddChild() { return AddChild(true, false); } public virtual MarshallingBuffer AddChild(bool reserveLinkSpace, bool storeLengthInLink ) { MarshallingBuffer child = new MarshallingBuffer(); child.AddressInParent(Offset(), storeLengthInLink); _children = new List4(_children, child); if (reserveLinkSpace) { ReserveChildLinkSpace(storeLengthInLink); } return child; } public virtual void ReserveChildLinkSpace(bool storeLengthInLink) { int length = storeLengthInLink ? Const4.IntLength * 2 : Const4.IntLength; PrepareWrite(length); _delegate.IncrementOffset(length); } public virtual void MergeChildren(MarshallingContext context, int masterAddress, int linkOffset) { MergeChildren(context, masterAddress, this, this, linkOffset); } private static void MergeChildren(MarshallingContext context, int masterAddress, MarshallingBuffer writeBuffer, MarshallingBuffer parentBuffer, int linkOffset) { if (parentBuffer._children == null) { return; } IEnumerator i = new Iterator4Impl(parentBuffer._children); while (i.MoveNext()) { Merge(context, masterAddress, writeBuffer, parentBuffer, (MarshallingBuffer)i.Current , linkOffset); } } private static void Merge(MarshallingContext context, int masterAddress, MarshallingBuffer writeBuffer, MarshallingBuffer parentBuffer, MarshallingBuffer childBuffer, int linkOffset) { int childPosition = writeBuffer.Offset(); writeBuffer.Reserve(childBuffer.BlockedLength()); MergeChildren(context, masterAddress, writeBuffer, childBuffer, linkOffset); int savedWriteBufferOffset = writeBuffer.Offset(); writeBuffer.Seek(childPosition); childBuffer.TransferContentTo(writeBuffer._delegate); writeBuffer.Seek(savedWriteBufferOffset); parentBuffer.WriteLink(childBuffer, childPosition + linkOffset, childBuffer.UnblockedLength ()); childBuffer.WriteIndex(context, masterAddress, childPosition + linkOffset); } public virtual void Seek(int offset) { _delegate.Seek(offset); } public virtual IReservedBuffer Reserve(int length) { PrepareWrite(length); IReservedBuffer reservedBuffer = new _IReservedBuffer_178(this); _delegate.Seek(_delegate.Offset() + length); return reservedBuffer; } private sealed class _IReservedBuffer_178 : IReservedBuffer { public _IReservedBuffer_178(MarshallingBuffer _enclosing) { this._enclosing = _enclosing; this.reservedOffset = this._enclosing._delegate.Offset(); } private readonly int reservedOffset; public void WriteBytes(byte[] bytes) { int currentOffset = this._enclosing._delegate.Offset(); this._enclosing._delegate.Seek(this.reservedOffset); this._enclosing._delegate.WriteBytes(bytes); this._enclosing._delegate.Seek(currentOffset); } private readonly MarshallingBuffer _enclosing; } private void WriteLink(MarshallingBuffer child, int position, int length) { int offset = Offset(); _delegate.Seek(child.AddressInParent()); _delegate.WriteInt(position); if (child.StoreLengthInLink()) { _delegate.WriteInt(length); } _delegate.Seek(offset); } private void WriteIndex(MarshallingContext context, int masterAddress, int position ) { if (_indexedField != null) { // for now this is a String index only, it takes the entire slot. StatefulBuffer buffer = new StatefulBuffer(context.Transaction(), UnblockedLength ()); int blockedPosition = context.Container().BlockConverter().BytesToBlocks(position ); int indexID = masterAddress + blockedPosition; buffer.SetID(indexID); buffer.Address(indexID); TransferContentTo(buffer, UnblockedLength()); _indexedField.AddIndexEntry(context.Transaction(), context.ObjectID(), buffer); } } private int AddressInParent() { if (!HasParent()) { throw new InvalidOperationException(); } if (_addressInParent < 0) { return -_addressInParent; } return _addressInParent; } public virtual void DebugDecrementLastOffset(int count) { _lastOffSet -= count; } public virtual bool HasParent() { return _addressInParent != NoParent; } private bool StoreLengthInLink() { return _addressInParent > 0; } public virtual void RequestIndexEntry(FieldMetadata fieldMetadata) { _indexedField = fieldMetadata; } public virtual MarshallingBuffer CheckBlockAlignment(MarshallingContext context, MarshallingBuffer precedingBuffer, IntByRef precedingLength) { _lastOffSet = Offset(); if (DoBlockAlign()) { precedingBuffer.BlockAlign(context, precedingLength.value); } if (precedingBuffer != null) { precedingLength.value += precedingBuffer.Length(); } precedingBuffer = this; if (_children != null) { IEnumerator i = new Iterator4Impl(_children); while (i.MoveNext()) { precedingBuffer = ((MarshallingBuffer)i.Current).CheckBlockAlignment(context, precedingBuffer , precedingLength); } } return precedingBuffer; } private void BlockAlign(MarshallingContext context, int precedingLength) { int totalLength = context.Container().BlockConverter().BlockAlignedBytes(precedingLength + Length()); int newLength = totalLength - precedingLength; BlockAlign(newLength); } public virtual int MarshalledLength() { int length = Length(); if (_children != null) { IEnumerator i = new Iterator4Impl(_children); while (i.MoveNext()) { length += ((MarshallingBuffer)i.Current).MarshalledLength(); } } return length; } private void BlockAlign(int length) { if (_delegate == null) { return; } if (length > _delegate.Length()) { int sizeNeeded = length - _delegate.Offset(); PrepareWrite(sizeNeeded); } _delegate.Seek(length); } private bool DoBlockAlign() { return HasParent(); } // For now we block align every linked entry. Indexes could be created late. private int BlockedLength() { return Length(); } private int UnblockedLength() { // This is only valid after checkBlockAlignMent has been called. return _lastOffSet; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IReadsObjectIds.cs0000644000175000017500000000047011700531646030151 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; namespace Db4objects.Db4o.Internal { /// public interface IReadsObjectIds { ObjectID ReadObjectID(IInternalReadContext context); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/StoredClassImpl.cs0000644000175000017500000000603611700531646030267 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public class StoredClassImpl : IStoredClass { private readonly Transaction _transaction; private readonly ClassMetadata _classMetadata; public StoredClassImpl(Transaction transaction, ClassMetadata classMetadata) { if (classMetadata == null) { throw new ArgumentException(); } _transaction = transaction; _classMetadata = classMetadata; } public virtual long[] GetIDs() { return _classMetadata.GetIDs(_transaction); } public virtual string GetName() { return _classMetadata.GetName(); } public virtual IStoredClass GetParentStoredClass() { ClassMetadata parentClassMetadata = _classMetadata.GetAncestor(); if (parentClassMetadata == null) { return null; } return new Db4objects.Db4o.Internal.StoredClassImpl(_transaction, parentClassMetadata ); } public virtual IStoredField[] GetStoredFields() { IStoredField[] fieldMetadata = _classMetadata.GetStoredFields(); IStoredField[] storedFields = new IStoredField[fieldMetadata.Length]; for (int i = 0; i < fieldMetadata.Length; i++) { storedFields[i] = new StoredFieldImpl(_transaction, (FieldMetadata)fieldMetadata[ i]); } return storedFields; } public virtual bool HasClassIndex() { return _classMetadata.HasClassIndex(); } public virtual void Rename(string newName) { IInternalObjectContainer container = (IInternalObjectContainer)_transaction.ObjectContainer (); container.SyncExec(new _IClosure4_56(this, newName)); } private sealed class _IClosure4_56 : IClosure4 { public _IClosure4_56(StoredClassImpl _enclosing, string newName) { this._enclosing = _enclosing; this.newName = newName; } public object Run() { this._enclosing._classMetadata.Rename(newName); return null; } private readonly StoredClassImpl _enclosing; private readonly string newName; } public virtual IStoredField StoredField(string name, object type) { FieldMetadata fieldMetadata = (FieldMetadata)_classMetadata.StoredField(name, type ); if (fieldMetadata == null) { return null; } return new StoredFieldImpl(_transaction, fieldMetadata); } public override int GetHashCode() { return _classMetadata.GetHashCode(); } public override bool Equals(object obj) { if (obj == null) { return false; } if (GetType() != obj.GetType()) { return false; } return _classMetadata.Equals(((Db4objects.Db4o.Internal.StoredClassImpl)obj)._classMetadata ); } public override string ToString() { return "StoredClass(" + _classMetadata + ")"; } public virtual int InstanceCount() { return _classMetadata.InstanceCount(_transaction); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/LazyObjectReference.cs0000644000175000017500000000245611700531646031106 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public class LazyObjectReference : IObjectInfo { private readonly Transaction _transaction; private readonly int _id; public LazyObjectReference(Transaction transaction, int id) { _transaction = transaction; _id = id; } public virtual long GetInternalID() { return _id; } public virtual object GetObject() { lock (ContainerLock()) { return Reference().GetObject(); } } public virtual Db4oUUID GetUUID() { lock (ContainerLock()) { return Reference().GetUUID(); } } public virtual long GetVersion() { return GetCommitTimestamp(); } public virtual long GetCommitTimestamp() { lock (ContainerLock()) { return Reference().GetCommitTimestamp(); } } public virtual ObjectReference Reference() { HardObjectReference hardRef = _transaction.Container().GetHardObjectReferenceById (_transaction, _id); return hardRef._reference; } private object ContainerLock() { _transaction.Container().CheckClosed(); return _transaction.Container().Lock(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/BlobImpl.cs0000644000175000017500000001636411700531646026724 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ #if !SILVERLIGHT using System.IO; using Db4objects.Db4o; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation.IO; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Types; using Sharpen; using Sharpen.IO; namespace Db4objects.Db4o.Internal { /// /// Transfer of blobs to and from the db4o system, /// if users use the Blob Db4oType. /// /// /// Transfer of blobs to and from the db4o system, /// if users use the Blob Db4oType. /// /// com.db4o.internal.blobs /// public class BlobImpl : IBlob, System.ICloneable, IDb4oTypeImpl { public const int CopybufferLength = 4096; public string fileName; public string i_ext; [System.NonSerialized] private Sharpen.IO.File i_file; [System.NonSerialized] private IBlobStatus i_getStatusFrom; public int i_length; [System.NonSerialized] private double i_status = Status.Unused; [System.NonSerialized] private ObjectContainerBase i_stream; [System.NonSerialized] private Transaction i_trans; /// public virtual int AdjustReadDepth(int depth) { return 1; } private string CheckExt(Sharpen.IO.File file) { string name = file.GetName(); int pos = name.LastIndexOf("."); if (pos > 0) { i_ext = Sharpen.Runtime.Substring(name, pos); return Sharpen.Runtime.Substring(name, 0, pos); } i_ext = string.Empty; return name; } /// private static void Copy(Sharpen.IO.File from, Sharpen.IO.File to) { System.IO.File.Copy(from, to); } public virtual object CreateDefault(Transaction a_trans) { BlobImpl bi = null; bi = (BlobImpl)this.MemberwiseClone(); bi.SetTrans(a_trans); return bi; } /// public virtual FileInputStream GetClientInputStream() { return new FileInputStream(i_file); } /// public virtual FileOutputStream GetClientOutputStream() { return new FileOutputStream(i_file); } public virtual string GetFileName() { return fileName; } public virtual int GetLength() { return i_length; } public virtual double GetStatus() { if (i_status == Status.Processing && i_getStatusFrom != null) { return i_getStatusFrom.GetStatus(); } if (i_status == Status.Unused) { if (i_length > 0) { i_status = Status.Available; } } return i_status; } public virtual void GetStatusFrom(IBlobStatus from) { i_getStatusFrom = from; } public virtual bool HasClassIndex() { return false; } /// public virtual void ReadFrom(Sharpen.IO.File file) { if (!file.Exists()) { throw new IOException(Db4objects.Db4o.Internal.Messages.Get(41, file.GetAbsolutePath ())); } i_length = (int)file.Length(); CheckExt(file); if (i_stream.IsClient) { i_file = file; ((IBlobTransport)i_stream).ReadBlobFrom(i_trans, this); } else { ReadLocal(file); } } /// public virtual void ReadLocal(Sharpen.IO.File file) { bool copied = false; if (fileName == null) { Sharpen.IO.File newFile = new Sharpen.IO.File(ServerPath(), file.GetName()); if (!newFile.Exists()) { Copy(file, newFile); copied = true; fileName = newFile.GetName(); } } if (!copied) { Copy(file, ServerFile(CheckExt(file), true)); } lock (i_stream.Lock()) { i_stream.StoreInternal(i_trans, this, false); } i_status = Status.Completed; } /// public virtual Sharpen.IO.File ServerFile(string promptName, bool writeToServer) { lock (i_stream.Lock()) { i_stream.Activate(i_trans, this, new FixedActivationDepth(2)); } string path = ServerPath(); i_stream.ConfigImpl.EnsureDirExists(path); if (writeToServer) { if (fileName == null) { if (promptName != null) { fileName = promptName; } else { fileName = "b_" + Runtime.CurrentTimeMillis(); } string tryPath = fileName + i_ext; int i = 0; while (new Sharpen.IO.File(path, tryPath).Exists()) { tryPath = fileName + "_" + i++ + i_ext; if (i == 99) { // should never happen i_status = Status.Error; throw new IOException(Db4objects.Db4o.Internal.Messages.Get(40)); } } fileName = tryPath; lock (i_stream.Lock()) { i_stream.StoreInternal(i_trans, this, false); } } } else { if (fileName == null) { throw new IOException(Db4objects.Db4o.Internal.Messages.Get(38)); } } string lastTryPath = path + Sharpen.IO.File.separator + fileName; if (!writeToServer) { if (!(new Sharpen.IO.File(lastTryPath).Exists())) { throw new IOException(Db4objects.Db4o.Internal.Messages.Get(39)); } } return new Sharpen.IO.File(lastTryPath); } /// private string ServerPath() { string path = i_stream.ConfigImpl.BlobPath(); if (path == null) { path = "blobs"; } i_stream.ConfigImpl.EnsureDirExists(path); return path; } public virtual void SetStatus(double status) { i_status = status; } public virtual void SetTrans(Transaction a_trans) { i_trans = a_trans; i_stream = a_trans.Container(); } /// public virtual void WriteLocal(Sharpen.IO.File file) { Copy(ServerFile(null, false), file); i_status = Status.Completed; } /// public virtual void WriteTo(Sharpen.IO.File file) { if (GetStatus() == Status.Unused) { throw new IOException(Db4objects.Db4o.Internal.Messages.Get(43)); } if (i_stream.IsClient) { i_file = file; i_status = Status.Queued; ((IBlobTransport)i_stream).WriteBlobTo(i_trans, this); } else { WriteLocal(file); } } public virtual void SetObjectReference(ObjectReference objectReference) { } // not necessary /// public virtual void DeleteFile() { if (GetStatus() == Status.Unused) { throw new IOException(Db4objects.Db4o.Internal.Messages.Get(43)); } if (i_stream.IsClient) { ((IBlobTransport)i_stream).DeleteBlobFile(i_trans, this); } else { ServerFile(null, false).Delete(); } fileName = null; i_ext = null; i_length = 0; SetStatus(Status.Unused); lock (i_stream.Lock()) { i_stream.StoreInternal(i_trans, this, false); } } object System.ICloneable.Clone() { return MemberwiseClone(); } } } #endif // !SILVERLIGHT smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Slots/0000755000175000017500000000000011700531646025767 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Slots/FreespaceSlotChange.cs0000644000175000017500000000057111700531646032166 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Slots { /// public class FreespaceSlotChange : IdSystemSlotChange { public FreespaceSlotChange(int id) : base(id) { } protected override bool ForFreespace() { return true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Slots/ReferencedSlot.cs0000644000175000017500000000262111700531646031223 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Slots { /// public class ReferencedSlot : TreeInt { private Db4objects.Db4o.Internal.Slots.Slot _slot; private int _references; public ReferencedSlot(int a_key) : base(a_key) { } public override object ShallowClone() { Db4objects.Db4o.Internal.Slots.ReferencedSlot rs = new Db4objects.Db4o.Internal.Slots.ReferencedSlot (_key); rs._slot = _slot; rs._references = _references; return base.ShallowCloneInternal(rs); } public virtual void PointTo(Db4objects.Db4o.Internal.Slots.Slot slot) { _slot = slot; } public virtual Tree Free(LocalObjectContainer file, Tree treeRoot, Db4objects.Db4o.Internal.Slots.Slot slot) { file.Free(_slot.Address(), _slot.Length()); if (RemoveReferenceIsLast()) { if (treeRoot != null) { return treeRoot.RemoveNode(this); } } PointTo(slot); return treeRoot; } public virtual bool AddReferenceIsFirst() { _references++; return (_references == 1); } public virtual bool RemoveReferenceIsLast() { _references--; return _references < 1; } public virtual Db4objects.Db4o.Internal.Slots.Slot Slot() { return _slot; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Slots/Pointer4.cs0000644000175000017500000000105311700531646030021 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Slots { /// public class Pointer4 { public readonly int _id; public readonly Slot _slot; public Pointer4(int id, Slot slot) { _id = id; _slot = slot; } public virtual int Address() { return _slot.Address(); } public virtual int Id() { return _id; } public virtual int Length() { return _slot.Length(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Slots/SystemSlotChange.cs0000644000175000017500000000151011700531646031547 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Slots { /// public class SystemSlotChange : SlotChange { public SystemSlotChange(int id) : base(id) { } public override void AccumulateFreeSlot(TransactionalIdSystemImpl idSystem, FreespaceCommitter freespaceCommitter, bool forFreespace) { base.AccumulateFreeSlot(idSystem, freespaceCommitter, forFreespace); } // FIXME: If we are doing a delete, we should also free our pointer here. protected override Slot ModifiedSlotInParentIdSystem(TransactionalIdSystemImpl idSystem ) { return null; } public override bool RemoveId() { return _newSlot == Slot.Zero; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Slots/Slot.cs0000644000175000017500000000564711700531646027253 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Slots { /// public class Slot { private readonly int _address; private readonly int _length; public static readonly Db4objects.Db4o.Internal.Slots.Slot Zero = new Db4objects.Db4o.Internal.Slots.Slot (0, 0); public const int New = -1; public const int Update = -2; public Slot(int address, int length) { _address = address; _length = length; } public virtual int Address() { return _address; } public virtual int Length() { return _length; } public override bool Equals(object obj) { if (obj == this) { return true; } if (!(obj is Db4objects.Db4o.Internal.Slots.Slot)) { return false; } Db4objects.Db4o.Internal.Slots.Slot other = (Db4objects.Db4o.Internal.Slots.Slot) obj; return (_address == other._address) && (Length() == other.Length()); } public override int GetHashCode() { return _address ^ Length(); } public virtual Db4objects.Db4o.Internal.Slots.Slot SubSlot(int offset) { return new Db4objects.Db4o.Internal.Slots.Slot(_address + offset, Length() - offset ); } public override string ToString() { return "[A:" + _address + ",L:" + Length() + "]"; } public virtual Db4objects.Db4o.Internal.Slots.Slot Truncate(int requiredLength) { return new Db4objects.Db4o.Internal.Slots.Slot(_address, requiredLength); } public static int MarshalledLength = Const4.IntLength * 2; public virtual int CompareByAddress(Db4objects.Db4o.Internal.Slots.Slot slot) { // FIXME: This is the wrong way around !!! // Fix here and in all referers. int res = slot._address - _address; if (res != 0) { return res; } return slot.Length() - Length(); } public virtual int CompareByLength(Db4objects.Db4o.Internal.Slots.Slot slot) { // FIXME: This is the wrong way around !!! // Fix here and in all referers. int res = slot.Length() - Length(); if (res != 0) { return res; } return slot._address - _address; } public virtual bool IsDirectlyPreceding(Db4objects.Db4o.Internal.Slots.Slot other ) { return _address + Length() == other._address; } public virtual Db4objects.Db4o.Internal.Slots.Slot Append(Db4objects.Db4o.Internal.Slots.Slot slot) { return new Db4objects.Db4o.Internal.Slots.Slot(Address(), _length + slot.Length() ); } public virtual bool IsNull() { return Address() == 0 || Length() == 0; } public virtual bool IsNew() { return _address == New; } public virtual bool IsUpdate() { return _address == Update; } public static bool IsNull(Db4objects.Db4o.Internal.Slots.Slot slot) { return slot == null || slot.IsNull(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Slots/SlotChange.cs0000644000175000017500000001332611700531646030352 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Slots { /// public class SlotChange : TreeInt { private class SlotChangeOperation { private readonly string _type; public SlotChangeOperation(string type) { _type = type; } internal static readonly SlotChange.SlotChangeOperation create = new SlotChange.SlotChangeOperation ("create"); internal static readonly SlotChange.SlotChangeOperation update = new SlotChange.SlotChangeOperation ("update"); internal static readonly SlotChange.SlotChangeOperation delete = new SlotChange.SlotChangeOperation ("delete"); public override string ToString() { return _type; } } private SlotChange.SlotChangeOperation _firstOperation; private SlotChange.SlotChangeOperation _currentOperation; protected Slot _newSlot; public SlotChange(int id) : base(id) { } public override object ShallowClone() { SlotChange sc = new SlotChange(0); sc.NewSlot(_newSlot); return base.ShallowCloneInternal(sc); } public virtual void AccumulateFreeSlot(TransactionalIdSystemImpl idSystem, FreespaceCommitter freespaceCommitter, bool forFreespace) { if (ForFreespace() != forFreespace) { return; } if (_firstOperation == SlotChange.SlotChangeOperation.create) { return; } if (_currentOperation == SlotChange.SlotChangeOperation.update || _currentOperation == SlotChange.SlotChangeOperation.delete) { Slot slot = ModifiedSlotInParentIdSystem(idSystem); if (Slot.IsNull(slot)) { slot = idSystem.CommittedSlot(_key); } // No old slot at all can be the case if the object // has been deleted by another transaction and we add it again. if (!Slot.IsNull(slot)) { freespaceCommitter.DelayedFree(slot, FreeToSystemFreespaceSystem()); } } } protected virtual bool ForFreespace() { return false; } protected virtual Slot ModifiedSlotInParentIdSystem(TransactionalIdSystemImpl idSystem ) { return idSystem.ModifiedSlotInParentIdSystem(_key); } public virtual bool IsDeleted() { return SlotModified() && _newSlot.IsNull(); } public virtual bool IsNew() { return _firstOperation == SlotChange.SlotChangeOperation.create; } private bool IsFreeOnRollback() { return !Slot.IsNull(_newSlot); } public bool SlotModified() { return _newSlot != null; } /// FIXME: Check where pointers should be freed on commit. /// /// FIXME: Check where pointers should be freed on commit. /// This should be triggered in this class. /// public virtual Slot NewSlot() { // private final boolean isFreePointerOnCommit() { // return isBitSet(FREE_POINTER_ON_COMMIT_BIT); // } return _newSlot; } public override object Read(ByteArrayBuffer reader) { SlotChange change = new SlotChange(reader.ReadInt()); Slot newSlot = new Slot(reader.ReadInt(), reader.ReadInt()); change.NewSlot(newSlot); return change; } public virtual void Rollback(IFreespaceManager freespaceManager) { if (IsFreeOnRollback()) { freespaceManager.Free(_newSlot); } } public override void Write(ByteArrayBuffer writer) { if (SlotModified()) { writer.WriteInt(_key); writer.WriteInt(_newSlot.Address()); writer.WriteInt(_newSlot.Length()); } } public void WritePointer(LocalObjectContainer container) { if (SlotModified()) { container.WritePointer(_key, _newSlot); } } private void NewSlot(Slot slot) { _newSlot = slot; } public virtual void NotifySlotUpdated(IFreespaceManager freespaceManager, Slot slot ) { if (DTrace.enabled) { DTrace.NotifySlotUpdated.LogLength(_key, slot); } FreePreviouslyModifiedSlot(freespaceManager); _newSlot = slot; Operation(SlotChange.SlotChangeOperation.update); } protected virtual void FreePreviouslyModifiedSlot(IFreespaceManager freespaceManager ) { if (Slot.IsNull(_newSlot)) { return; } Free(freespaceManager, _newSlot); _newSlot = null; } protected virtual void Free(IFreespaceManager freespaceManager, Slot slot) { if (slot.IsNull()) { return; } if (freespaceManager == null) { return; } freespaceManager.Free(slot); } private void Operation(SlotChange.SlotChangeOperation operation) { if (_firstOperation == null) { _firstOperation = operation; } _currentOperation = operation; } public virtual void NotifySlotCreated(Slot slot) { if (DTrace.enabled) { DTrace.NotifySlotCreated.Log(_key); DTrace.NotifySlotCreated.LogLength(slot); } Operation(SlotChange.SlotChangeOperation.create); _newSlot = slot; } public virtual void NotifyDeleted(IFreespaceManager freespaceManager) { if (DTrace.enabled) { DTrace.NotifySlotDeleted.Log(_key); } Operation(SlotChange.SlotChangeOperation.delete); FreePreviouslyModifiedSlot(freespaceManager); _newSlot = Slot.Zero; } public virtual bool RemoveId() { return false; } public override string ToString() { string str = "id: " + _key; if (_newSlot != null) { str += " newSlot: " + _newSlot; } return str; } protected virtual bool FreeToSystemFreespaceSystem() { return false; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Slots/SlotChangeFactory.cs0000644000175000017500000000317711700531646031705 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Slots { /// public class SlotChangeFactory { private SlotChangeFactory() { } public virtual SlotChange NewInstance(int id) { return new SlotChange(id); } public static readonly Db4objects.Db4o.Internal.Slots.SlotChangeFactory UserObjects = new Db4objects.Db4o.Internal.Slots.SlotChangeFactory(); private sealed class _SlotChangeFactory_20 : Db4objects.Db4o.Internal.Slots.SlotChangeFactory { public _SlotChangeFactory_20() { } public override SlotChange NewInstance(int id) { return new SystemSlotChange(id); } } public static readonly Db4objects.Db4o.Internal.Slots.SlotChangeFactory SystemObjects = new _SlotChangeFactory_20(); private sealed class _SlotChangeFactory_26 : Db4objects.Db4o.Internal.Slots.SlotChangeFactory { public _SlotChangeFactory_26() { } public override SlotChange NewInstance(int id) { return new IdSystemSlotChange(id); } } public static readonly Db4objects.Db4o.Internal.Slots.SlotChangeFactory IdSystem = new _SlotChangeFactory_26(); private sealed class _SlotChangeFactory_32 : Db4objects.Db4o.Internal.Slots.SlotChangeFactory { public _SlotChangeFactory_32() { } public override SlotChange NewInstance(int id) { return new FreespaceSlotChange(id); } } public static readonly Db4objects.Db4o.Internal.Slots.SlotChangeFactory FreeSpace = new _SlotChangeFactory_32(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Slots/IdSystemSlotChange.cs0000644000175000017500000000246011700531646032031 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Slots { /// public class IdSystemSlotChange : SystemSlotChange { private Collection4 _freed; public IdSystemSlotChange(int id) : base(id) { } protected override void Free(IFreespaceManager freespaceManager, Slot slot) { if (slot.IsNull()) { return; } if (_freed == null) { _freed = new Collection4(); } _freed.Add(slot); } public override void AccumulateFreeSlot(TransactionalIdSystemImpl idSystem, FreespaceCommitter freespaceCommitter, bool forFreespace) { if (ForFreespace() != forFreespace) { return; } base.AccumulateFreeSlot(idSystem, freespaceCommitter, forFreespace); if (_freed == null) { return; } IEnumerator iterator = _freed.GetEnumerator(); while (iterator.MoveNext()) { freespaceCommitter.DelayedFree((Slot)iterator.Current, FreeToSystemFreespaceSystem ()); } } protected override bool FreeToSystemFreespaceSystem() { return true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/0000755000175000017500000000000011700531646026764 5ustar00meebeymeebey00000000000000UnspecifiedUpdateDepth.cs0000644000175000017500000000207711700531646033630 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public abstract class UnspecifiedUpdateDepth : IUpdateDepth { protected UnspecifiedUpdateDepth() { } public virtual bool SufficientDepth() { return true; } public virtual bool Negative() { return true; } public override string ToString() { return GetType().FullName; } public virtual IUpdateDepth Adjust(ClassMetadata clazz) { FixedUpdateDepth depth = (FixedUpdateDepth)ForDepth(clazz.UpdateDepthFromConfig() ).Descend(); return depth; } public virtual IUpdateDepth AdjustUpdateDepthForCascade(bool isCollection) { throw new InvalidOperationException(); } public virtual IUpdateDepth Descend() { throw new InvalidOperationException(); } protected abstract FixedUpdateDepth ForDepth(int depth); public abstract bool CanSkip(ObjectReference arg1); } } LegacyFixedUpdateDepth.cs0000644000175000017500000000107211700531646033550 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public class LegacyFixedUpdateDepth : FixedUpdateDepth { public LegacyFixedUpdateDepth(int depth) : base(depth) { } public override bool CanSkip(ObjectReference @ref) { return false; } protected override FixedUpdateDepth ForDepth(int depth) { return new Db4objects.Db4o.Internal.Activation.LegacyFixedUpdateDepth(depth); } } } LegacyActivationDepthProvider.cs0000644000175000017500000000226411700531646035166 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public class LegacyActivationDepthProvider : IActivationDepthProvider { public static readonly IActivationDepthProvider Instance = new LegacyActivationDepthProvider (); public virtual IActivationDepth ActivationDepthFor(ClassMetadata classMetadata, ActivationMode mode) { if (mode.IsPrefetch()) { return new LegacyActivationDepth(1, mode); } int globalLegacyActivationDepth = ConfigImpl(classMetadata).ActivationDepth(); Config4Class config = classMetadata.ConfigOrAncestorConfig(); int defaultDepth = null == config ? globalLegacyActivationDepth : config.AdjustActivationDepth (globalLegacyActivationDepth); return new LegacyActivationDepth(defaultDepth, mode); } public virtual IActivationDepth ActivationDepth(int depth, ActivationMode mode) { return new LegacyActivationDepth(depth, mode); } private Config4Impl ConfigImpl(ClassMetadata classMetadata) { return classMetadata.Container().ConfigImpl; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/IUpdateDepthProvider.cs0000644000175000017500000000050511700531646033346 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public interface IUpdateDepthProvider { UnspecifiedUpdateDepth Unspecified(IModifiedObjectQuery query); FixedUpdateDepth ForDepth(int depth); } } ITransparentActivationDepthProvider.cs0000644000175000017500000000113711700531646036372 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.TA; namespace Db4objects.Db4o.Internal.Activation { /// public interface ITransparentActivationDepthProvider : IActivationDepthProvider { void EnableTransparentPersistenceSupportFor(IInternalObjectContainer container, IRollbackStrategy withRollbackStrategy); void AddModified(object @object, Transaction inTransaction); void RemoveModified(object @object, Transaction inTransaction); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/ActivationMode.cs0000644000175000017500000000310711700531646032222 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Activation { public sealed class ActivationMode { public static readonly Db4objects.Db4o.Internal.Activation.ActivationMode Activate = new Db4objects.Db4o.Internal.Activation.ActivationMode(); public static readonly Db4objects.Db4o.Internal.Activation.ActivationMode Deactivate = new Db4objects.Db4o.Internal.Activation.ActivationMode(); public static readonly Db4objects.Db4o.Internal.Activation.ActivationMode Peek = new Db4objects.Db4o.Internal.Activation.ActivationMode(); public static readonly Db4objects.Db4o.Internal.Activation.ActivationMode Prefetch = new Db4objects.Db4o.Internal.Activation.ActivationMode(); public static readonly Db4objects.Db4o.Internal.Activation.ActivationMode Refresh = new Db4objects.Db4o.Internal.Activation.ActivationMode(); private ActivationMode() { } public override string ToString() { if (IsActivate()) { return "ACTIVATE"; } if (IsDeactivate()) { return "DEACTIVATE"; } if (IsPrefetch()) { return "PREFETCH"; } if (IsRefresh()) { return "REFRESH"; } return "PEEK"; } public bool IsDeactivate() { return this == Deactivate; } public bool IsActivate() { return this == Activate; } public bool IsPeek() { return this == Peek; } public bool IsPrefetch() { return this == Prefetch; } public bool IsRefresh() { return this == Refresh; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/TPFixedUpdateDepth.cs0000644000175000017500000000153511700531646032752 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.TA; namespace Db4objects.Db4o.Internal.Activation { public class TPFixedUpdateDepth : FixedUpdateDepth { private IModifiedObjectQuery _query; public TPFixedUpdateDepth(int depth, IModifiedObjectQuery query) : base(depth) { _query = query; } public override bool CanSkip(ObjectReference @ref) { ClassMetadata clazz = @ref.ClassMetadata(); return clazz.Reflector().ForClass(typeof(IActivatable)).IsAssignableFrom(clazz.ClassReflector ()) && !_query.IsModified(@ref.GetObject()); } protected override FixedUpdateDepth ForDepth(int depth) { return new Db4objects.Db4o.Internal.Activation.TPFixedUpdateDepth(depth, _query); } } } LegacyUnspecifiedUpdateDepth.cs0000644000175000017500000000131411700531646034746 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public class LegacyUnspecifiedUpdateDepth : UnspecifiedUpdateDepth { public static readonly Db4objects.Db4o.Internal.Activation.LegacyUnspecifiedUpdateDepth Instance = new Db4objects.Db4o.Internal.Activation.LegacyUnspecifiedUpdateDepth (); private LegacyUnspecifiedUpdateDepth() { } public override bool CanSkip(ObjectReference @ref) { return false; } protected override FixedUpdateDepth ForDepth(int depth) { return new LegacyFixedUpdateDepth(depth); } } } TPUnspecifiedUpdateDepth.cs0000644000175000017500000000147511700531646034075 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.TA; namespace Db4objects.Db4o.Internal.Activation { public class TPUnspecifiedUpdateDepth : UnspecifiedUpdateDepth { private readonly IModifiedObjectQuery _query; internal TPUnspecifiedUpdateDepth(IModifiedObjectQuery query) { _query = query; } public override bool CanSkip(ObjectReference @ref) { ClassMetadata clazz = @ref.ClassMetadata(); return clazz.Reflector().ForClass(typeof(IActivatable)).IsAssignableFrom(clazz.ClassReflector ()) && !_query.IsModified(@ref.GetObject()); } protected override FixedUpdateDepth ForDepth(int depth) { return new TPFixedUpdateDepth(depth, _query); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/FullActivationDepth.cs0000644000175000017500000000127611700531646033232 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { /// Activates the full object graph. /// Activates the full object graph. public class FullActivationDepth : ActivationDepthImpl { public FullActivationDepth(ActivationMode mode) : base(mode) { } public FullActivationDepth() : this(ActivationMode.Activate) { } public override IActivationDepth Descend(ClassMetadata metadata) { return this; } public override bool RequiresActivation() { return true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/ActivatableBase.cs0000644000175000017500000000163411700531646032331 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Activation; using Db4objects.Db4o.TA; namespace Db4objects.Db4o.Internal.Activation { public abstract class ActivatableBase : IActivatable { [System.NonSerialized] private IActivator _activator; public virtual void Bind(IActivator activator) { if (_activator == activator) { return; } if (activator != null && _activator != null) { throw new InvalidOperationException(); } _activator = activator; } public virtual void Activate(ActivationPurpose purpose) { if (_activator == null) { return; } _activator.Activate(purpose); } protected virtual void ActivateForRead() { Activate(ActivationPurpose.Read); } protected virtual void ActivateForWrite() { Activate(ActivationPurpose.Write); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/DepthUtil.cs0000644000175000017500000000066711700531646031226 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Activation { public sealed class DepthUtil { public static int AdjustDepthToBorders(int depth) { int depthBorder = 2; // TODO when can min value actually occur? if (depth > int.MinValue && depth < depthBorder) { return depthBorder; } return depth; } private DepthUtil() { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/FixedUpdateDepth.cs0000644000175000017500000000426211700531646032506 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public abstract class FixedUpdateDepth : IUpdateDepth { private int _depth; private bool _tpMode = false; public FixedUpdateDepth(int depth) { _depth = depth; } public virtual void TpMode(bool tpMode) { _tpMode = tpMode; } public virtual bool TpMode() { return _tpMode; } public virtual bool SufficientDepth() { return _depth > 0; } public virtual bool Negative() { // should never happen? return _depth < 0; } public override string ToString() { return GetType().FullName + ": " + _depth; } public virtual IUpdateDepth Adjust(ClassMetadata clazz) { if (clazz.CascadesOnDeleteOrUpdate()) { return AdjustDepthToBorders().Descend(); } return Descend(); } public virtual bool IsBroaderThan(Db4objects.Db4o.Internal.Activation.FixedUpdateDepth other) { return _depth > other._depth; } // TODO code duplication in fixed activation/update depth public virtual Db4objects.Db4o.Internal.Activation.FixedUpdateDepth AdjustDepthToBorders () { return ForDepth(DepthUtil.AdjustDepthToBorders(_depth)); } public virtual IUpdateDepth AdjustUpdateDepthForCascade(bool isCollection) { int minimumUpdateDepth = isCollection ? 2 : 1; if (_depth < minimumUpdateDepth) { return ForDepth(minimumUpdateDepth); } return this; } public virtual IUpdateDepth Descend() { return ForDepth(_depth - 1); } public override bool Equals(object other) { if (this == other) { return true; } if (other == null || GetType() != other.GetType()) { return false; } return _depth == ((Db4objects.Db4o.Internal.Activation.FixedUpdateDepth)other)._depth; } public override int GetHashCode() { return _depth; } protected abstract Db4objects.Db4o.Internal.Activation.FixedUpdateDepth ForDepth( int depth); public abstract bool CanSkip(ObjectReference arg1); } } LegacyUpdateDepthProvider.cs0000644000175000017500000000075511700531646034312 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public class LegacyUpdateDepthProvider : IUpdateDepthProvider { public virtual FixedUpdateDepth ForDepth(int depth) { return new LegacyFixedUpdateDepth(depth); } public virtual UnspecifiedUpdateDepth Unspecified(IModifiedObjectQuery query) { return LegacyUnspecifiedUpdateDepth.Instance; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/TPUpdateDepthProvider.cs0000644000175000017500000000100511700531646033475 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public class TPUpdateDepthProvider : IUpdateDepthProvider { public virtual FixedUpdateDepth ForDepth(int depth) { return new TPFixedUpdateDepth(depth, NullModifiedObjectQuery.Instance); } public virtual UnspecifiedUpdateDepth Unspecified(IModifiedObjectQuery query) { return new TPUnspecifiedUpdateDepth(query); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/FixedActivationDepth.cs0000644000175000017500000000261011700531646033360 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { /// /// Activates a fixed depth of the object graph regardless of /// any existing activation depth configuration settings. /// /// /// Activates a fixed depth of the object graph regardless of /// any existing activation depth configuration settings. /// public class FixedActivationDepth : ActivationDepthImpl { private readonly int _depth; public FixedActivationDepth(int depth, ActivationMode mode) : base(mode) { _depth = depth; } public FixedActivationDepth(int depth) : this(depth, ActivationMode.Activate) { } public override bool RequiresActivation() { return _depth > 0; } public override IActivationDepth Descend(ClassMetadata metadata) { if (_depth < 1) { return this; } return new Db4objects.Db4o.Internal.Activation.FixedActivationDepth(_depth - 1, _mode ); } // TODO code duplication in fixed activation/update depth public virtual Db4objects.Db4o.Internal.Activation.FixedActivationDepth AdjustDepthToBorders () { return new Db4objects.Db4o.Internal.Activation.FixedActivationDepth(DepthUtil.AdjustDepthToBorders (_depth)); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/IActivationDepth.cs0000644000175000017500000000076711700531646032524 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { /// Controls how deep an object graph is activated. /// Controls how deep an object graph is activated. public interface IActivationDepth { ActivationMode Mode(); bool RequiresActivation(); IActivationDepth Descend(ClassMetadata metadata); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/IUpdateDepth.cs0000644000175000017500000000073011700531646031633 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public interface IUpdateDepth { bool SufficientDepth(); bool Negative(); IUpdateDepth Adjust(ClassMetadata clazz); IUpdateDepth AdjustUpdateDepthForCascade(bool isCollection); IUpdateDepth Descend(); bool CanSkip(ObjectReference @ref); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/IModifiedObjectQuery.cs0000644000175000017500000000031111700531646033314 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Activation { public interface IModifiedObjectQuery { bool IsModified(object obj); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/ActivationContext4.cs0000644000175000017500000000600611700531646033047 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Activation { /// public class ActivationContext4 : IActivationContext { private readonly Db4objects.Db4o.Internal.Transaction _transaction; private readonly object _targetObject; private readonly IActivationDepth _depth; public ActivationContext4(Db4objects.Db4o.Internal.Transaction transaction, object obj, IActivationDepth depth) { if (null == obj) { throw new ArgumentNullException(); } _transaction = transaction; _targetObject = obj; _depth = depth; } public virtual void CascadeActivationToTarget() { IActivationContext context = ClassMetadata().DescendOnCascadingActivation() ? Descend () : this; CascadeActivation(context); } public virtual void CascadeActivationToChild(object obj) { if (obj == null) { return; } IActivationContext cascadingContext = ForObject(obj); Db4objects.Db4o.Internal.ClassMetadata classMetadata = cascadingContext.ClassMetadata (); if (classMetadata == null || !classMetadata.HasIdentity()) { return; } CascadeActivation(cascadingContext.Descend()); } private void CascadeActivation(IActivationContext context) { IActivationDepth depth = context.Depth(); if (!depth.RequiresActivation()) { return; } if (depth.Mode().IsDeactivate()) { Container().StillToDeactivate(_transaction, context.TargetObject(), depth, false); } else { // FIXME: [TA] do we really need to check for isValueType here? Db4objects.Db4o.Internal.ClassMetadata classMetadata = context.ClassMetadata(); if (classMetadata.IsStruct()) { classMetadata.CascadeActivation(context); } else { Container().StillToActivate(context); } } } public virtual ObjectContainerBase Container() { return _transaction.Container(); } public virtual object TargetObject() { return _targetObject; } public virtual Db4objects.Db4o.Internal.ClassMetadata ClassMetadata() { return Container().ClassMetadataForObject(_targetObject); } public virtual IActivationDepth Depth() { return _depth; } public virtual IObjectContainer ObjectContainer() { return Container(); } public virtual Db4objects.Db4o.Internal.Transaction Transaction() { return _transaction; } public virtual IActivationContext ForObject(object newTargetObject) { return new Db4objects.Db4o.Internal.Activation.ActivationContext4(Transaction(), newTargetObject, Depth()); } public virtual IActivationContext Descend() { return new Db4objects.Db4o.Internal.Activation.ActivationContext4(Transaction(), TargetObject(), Depth().Descend(ClassMetadata())); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/ActivationDepthImpl.cs0000644000175000017500000000111011700531646033214 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public abstract class ActivationDepthImpl : IActivationDepth { protected readonly ActivationMode _mode; protected ActivationDepthImpl(ActivationMode mode) { _mode = mode; } public virtual ActivationMode Mode() { return _mode; } public abstract IActivationDepth Descend(ClassMetadata arg1); public abstract bool RequiresActivation(); } } IActivationDepthProvider.cs0000644000175000017500000000263311700531646034152 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { /// Factory for ActivationDepth strategies. /// Factory for ActivationDepth strategies. public interface IActivationDepthProvider { /// Returns an ActivationDepth suitable for the specified class and activation mode. /// /// Returns an ActivationDepth suitable for the specified class and activation mode. /// /// root class that's being activated /// activation mode /// an appropriate ActivationDepth for the class and activation mode IActivationDepth ActivationDepthFor(ClassMetadata classMetadata, ActivationMode mode ); /// Returns an ActivationDepth that will activate at most *depth* levels. /// /// Returns an ActivationDepth that will activate at most *depth* levels. /// A special case is Integer.MAX_VALUE (int.MaxValue for .net) for which a /// FullActivationDepth object must be returned. /// /// /// /// IActivationDepth ActivationDepth(int depth, ActivationMode mode); } } DescendingActivationDepth.cs0000644000175000017500000000125711700531646034313 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public class DescendingActivationDepth : ActivationDepthImpl { private readonly IActivationDepthProvider _provider; public DescendingActivationDepth(IActivationDepthProvider provider, ActivationMode mode) : base(mode) { _provider = provider; } public override IActivationDepth Descend(ClassMetadata metadata) { return _provider.ActivationDepthFor(metadata, _mode); } public override bool RequiresActivation() { return true; } } } TransparentActivationDepthProviderImpl.cs0000644000175000017500000001630711700531646037110 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Events; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Reflect.Generic; using Db4objects.Db4o.TA; namespace Db4objects.Db4o.Internal.Activation { public class TransparentActivationDepthProviderImpl : IActivationDepthProvider, ITransparentActivationDepthProvider { public virtual IActivationDepth ActivationDepth(int depth, ActivationMode mode) { if (int.MaxValue == depth) { return new FullActivationDepth(mode); } return new FixedActivationDepth(depth, mode); } public virtual IActivationDepth ActivationDepthFor(ClassMetadata classMetadata, ActivationMode mode) { if (IsTAAware(classMetadata)) { return new NonDescendingActivationDepth(mode); } if (mode.IsPrefetch()) { return new FixedActivationDepth(1, mode); } return new DescendingActivationDepth(this, mode); } private bool IsTAAware(ClassMetadata classMetadata) { GenericReflector reflector = classMetadata.Reflector(); return reflector.ForClass(typeof(IActivatable)).IsAssignableFrom(classMetadata.ClassReflector ()); } private IRollbackStrategy _rollbackStrategy; public bool _transparentPersistenceIsEnabled; public virtual void EnableTransparentPersistenceSupportFor(IInternalObjectContainer container, IRollbackStrategy rollbackStrategy) { FlushOnQueryStarted(container); _rollbackStrategy = rollbackStrategy; _transparentPersistenceIsEnabled = true; } private void FlushOnQueryStarted(IInternalObjectContainer container) { IEventRegistry registry = EventRegistryFactory.ForObjectContainer(container); registry.QueryStarted += new System.EventHandler (new _IEventListener4_46(this).OnEvent); } private sealed class _IEventListener4_46 { public _IEventListener4_46(TransparentActivationDepthProviderImpl _enclosing) { this._enclosing = _enclosing; } public void OnEvent(object sender, Db4objects.Db4o.Events.QueryEventArgs args) { this._enclosing.ObjectsModifiedIn(this._enclosing.TransactionFrom(args)).Flush(); } private readonly TransparentActivationDepthProviderImpl _enclosing; } protected virtual Transaction TransactionFrom(EventArgs args) { return (Transaction)((TransactionalEventArgs)args).Transaction(); } public virtual void AddModified(object @object, Transaction transaction) { if (!_transparentPersistenceIsEnabled) { return; } ObjectsModifiedIn(transaction).Add(@object); } public virtual void RemoveModified(object @object, Transaction transaction) { if (!_transparentPersistenceIsEnabled) { return; } ObjectsModifiedIn(transaction).Remove(@object); } private sealed class _TransactionLocal_73 : TransactionLocal { public _TransactionLocal_73(TransparentActivationDepthProviderImpl _enclosing) { this._enclosing = _enclosing; } public override object InitialValueFor(Transaction transaction) { TransparentActivationDepthProviderImpl.ObjectsModifiedInTransaction objectsModifiedInTransaction = new TransparentActivationDepthProviderImpl.ObjectsModifiedInTransaction(transaction ); transaction.AddTransactionListener(new _ITransactionListener_77(this, objectsModifiedInTransaction )); return objectsModifiedInTransaction; } private sealed class _ITransactionListener_77 : ITransactionListener { public _ITransactionListener_77(_TransactionLocal_73 _enclosing, TransparentActivationDepthProviderImpl.ObjectsModifiedInTransaction objectsModifiedInTransaction) { this._enclosing = _enclosing; this.objectsModifiedInTransaction = objectsModifiedInTransaction; } public void PostRollback() { objectsModifiedInTransaction.Rollback(this._enclosing._enclosing._rollbackStrategy ); } public void PreCommit() { objectsModifiedInTransaction.Flush(); } private readonly _TransactionLocal_73 _enclosing; private readonly TransparentActivationDepthProviderImpl.ObjectsModifiedInTransaction objectsModifiedInTransaction; } private readonly TransparentActivationDepthProviderImpl _enclosing; } private readonly TransactionLocal _objectsModifiedInTransaction; private TransparentActivationDepthProviderImpl.ObjectsModifiedInTransaction ObjectsModifiedIn (Transaction transaction) { return ((TransparentActivationDepthProviderImpl.ObjectsModifiedInTransaction)transaction .Get(_objectsModifiedInTransaction).value); } private sealed class ObjectsModifiedInTransaction { private readonly IdentitySet4 _removedAfterModified = new IdentitySet4(); private readonly IdentitySet4 _modified = new IdentitySet4(); private readonly Transaction _transaction; public ObjectsModifiedInTransaction(Transaction transaction) { _transaction = transaction; } public void Add(object @object) { if (Contains(@object)) { return; } _modified.Add(@object); } public void Remove(object @object) { if (!Contains(@object)) { return; } _modified.Remove(@object); _removedAfterModified.Add(@object); } private bool Contains(object @object) { return _modified.Contains(@object); } public void Flush() { StoreModifiedObjects(); _modified.Clear(); } private void StoreModifiedObjects() { ObjectContainerBase container = _transaction.Container(); container.StoreAll(_transaction, _modified.ValuesIterator(), container.UpdateDepthProvider ().Unspecified(new _IModifiedObjectQuery_132(this))); _transaction.ProcessDeletes(); } private sealed class _IModifiedObjectQuery_132 : IModifiedObjectQuery { public _IModifiedObjectQuery_132(ObjectsModifiedInTransaction _enclosing) { this._enclosing = _enclosing; } public bool IsModified(object obj) { return this._enclosing.Contains(obj); } private readonly ObjectsModifiedInTransaction _enclosing; } public void Rollback(IRollbackStrategy rollbackStrategy) { ApplyRollbackStrategy(rollbackStrategy); _modified.Clear(); } private void ApplyRollbackStrategy(IRollbackStrategy rollbackStrategy) { if (null == rollbackStrategy) { return; } ApplyRollbackStrategy(rollbackStrategy, _modified.ValuesIterator()); ApplyRollbackStrategy(rollbackStrategy, _removedAfterModified.ValuesIterator()); } private void ApplyRollbackStrategy(IRollbackStrategy rollbackStrategy, IEnumerator values) { IObjectContainer objectContainer = _transaction.ObjectContainer(); while (values.MoveNext()) { rollbackStrategy.Rollback(objectContainer, values.Current); } } } public TransparentActivationDepthProviderImpl() { _objectsModifiedInTransaction = new _TransactionLocal_73(this); } } } NullModifiedObjectQuery.cs0000644000175000017500000000075511700531646033773 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public class NullModifiedObjectQuery : IModifiedObjectQuery { public static readonly IModifiedObjectQuery Instance = new Db4objects.Db4o.Internal.Activation.NullModifiedObjectQuery (); private NullModifiedObjectQuery() { } public virtual bool IsModified(object @ref) { return false; } } } NonDescendingActivationDepth.cs0000644000175000017500000000120511700531646034757 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { /// Transparent Activation strategy. /// Transparent Activation strategy. public class NonDescendingActivationDepth : ActivationDepthImpl { public NonDescendingActivationDepth(ActivationMode mode) : base(mode) { } public override IActivationDepth Descend(ClassMetadata metadata) { return this; } public override bool RequiresActivation() { return false; } } } UnknownActivationDepth.cs0000644000175000017500000000140111700531646033676 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public class UnknownActivationDepth : IActivationDepth { public static readonly IActivationDepth Instance = new Db4objects.Db4o.Internal.Activation.UnknownActivationDepth (); private UnknownActivationDepth() { } public virtual ActivationMode Mode() { throw new InvalidOperationException(); } public virtual IActivationDepth Descend(ClassMetadata metadata) { throw new InvalidOperationException(); } public virtual bool RequiresActivation() { throw new InvalidOperationException(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/IFixedDepth.cs0000644000175000017500000000036511700531646031454 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { public interface IFixedDepth { IFixedDepth AdjustDepthToBorders(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Activation/LegacyActivationDepth.cs0000644000175000017500000000341211700531646033526 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; namespace Db4objects.Db4o.Internal.Activation { /// /// Activates an object graph to a specific depth respecting any /// activation configuration settings that might be in effect. /// /// /// Activates an object graph to a specific depth respecting any /// activation configuration settings that might be in effect. /// public class LegacyActivationDepth : ActivationDepthImpl { private readonly int _depth; public LegacyActivationDepth(int depth) : this(depth, ActivationMode.Activate) { } public LegacyActivationDepth(int depth, ActivationMode mode) : base(mode) { _depth = depth; } public override IActivationDepth Descend(ClassMetadata metadata) { if (null == metadata) { return new Db4objects.Db4o.Internal.Activation.LegacyActivationDepth(_depth - 1, _mode); } return new Db4objects.Db4o.Internal.Activation.LegacyActivationDepth(DescendDepth (metadata), _mode); } private int DescendDepth(ClassMetadata metadata) { int depth = ConfiguredActivationDepth(metadata) - 1; if (metadata.IsStruct()) { // We also have to instantiate structs completely every time. return Math.Max(1, depth); } return depth; } private int ConfiguredActivationDepth(ClassMetadata metadata) { Config4Class config = metadata.ConfigOrAncestorConfig(); if (config != null && _mode.IsActivate()) { return config.AdjustActivationDepth(_depth); } return _depth; } public override bool RequiresActivation() { return _depth > 0; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/FieldMetadataState.cs0000644000175000017500000000171111700531646030677 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal { /// internal class FieldMetadataState { private readonly string _info; private FieldMetadataState(string info) { _info = info; } internal static readonly Db4objects.Db4o.Internal.FieldMetadataState NotLoaded = new Db4objects.Db4o.Internal.FieldMetadataState("not loaded"); internal static readonly Db4objects.Db4o.Internal.FieldMetadataState Unavailable = new Db4objects.Db4o.Internal.FieldMetadataState("unavailable"); internal static readonly Db4objects.Db4o.Internal.FieldMetadataState Available = new Db4objects.Db4o.Internal.FieldMetadataState("available"); internal static readonly Db4objects.Db4o.Internal.FieldMetadataState Updating = new Db4objects.Db4o.Internal.FieldMetadataState("updating"); public override string ToString() { return _info; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Config4Abstract.cs0000644000175000017500000000536411700531646030177 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public abstract class Config4Abstract { protected KeySpecHashtable4 _config; private static readonly KeySpec CascadeOnActivateKey = new KeySpec(TernaryBool.Unspecified ); private static readonly KeySpec CascadeOnDeleteKey = new KeySpec(TernaryBool.Unspecified ); private static readonly KeySpec CascadeOnUpdateKey = new KeySpec(TernaryBool.Unspecified ); private static readonly KeySpec NameKey = new KeySpec(null); public Config4Abstract() : this(new KeySpecHashtable4(10)) { } protected Config4Abstract(KeySpecHashtable4 config) { _config = (KeySpecHashtable4)config.DeepClone(this); } public virtual void CascadeOnActivate(bool flag) { PutThreeValued(CascadeOnActivateKey, flag); } public virtual void CascadeOnDelete(bool flag) { PutThreeValued(CascadeOnDeleteKey, flag); } public virtual void CascadeOnUpdate(bool flag) { PutThreeValued(CascadeOnUpdateKey, flag); } protected virtual void PutThreeValued(KeySpec spec, bool flag) { _config.Put(spec, TernaryBool.ForBoolean(flag)); } protected virtual void PutThreeValuedInt(KeySpec spec, bool flag) { _config.Put(spec, flag ? 1 : -1); } public virtual TernaryBool CascadeOnActivate() { return Cascade(CascadeOnActivateKey); } public virtual TernaryBool CascadeOnDelete() { return Cascade(CascadeOnDeleteKey); } public virtual TernaryBool CascadeOnUpdate() { return Cascade(CascadeOnUpdateKey); } private TernaryBool Cascade(KeySpec spec) { return _config.GetAsTernaryBool(spec); } internal abstract string ClassName(); /// Will raise an exception if argument class doesn't match this class - violates equals() contract in favor of failing fast. /// /// Will raise an exception if argument class doesn't match this class - violates equals() contract in favor of failing fast. /// public override bool Equals(object obj) { if (this == obj) { return true; } if (null == obj) { return false; } if (GetType() != obj.GetType()) { Exceptions4.ShouldNeverHappen(); } return GetName().Equals(((Db4objects.Db4o.Internal.Config4Abstract)obj).GetName() ); } public override int GetHashCode() { return GetName().GetHashCode(); } public virtual string GetName() { return _config.GetAsString(NameKey); } protected virtual void SetName(string name) { _config.Put(NameKey, name); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/TypeHandlerAspect.cs0000644000175000017500000001245011700531646030573 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public class TypeHandlerAspect : ClassAspect { public readonly ITypeHandler4 _typeHandler; private readonly ClassMetadata _ownerMetadata; public TypeHandlerAspect(ClassMetadata classMetadata, ITypeHandler4 typeHandler) { if (Handlers4.IsValueType(typeHandler)) { throw new InvalidOperationException(); } _ownerMetadata = classMetadata; _typeHandler = typeHandler; } public override bool Equals(object obj) { if (obj == this) { return true; } if (obj == null || obj.GetType() != GetType()) { return false; } Db4objects.Db4o.Internal.TypeHandlerAspect other = (Db4objects.Db4o.Internal.TypeHandlerAspect )obj; return _typeHandler.Equals(other._typeHandler); } public override int GetHashCode() { return _typeHandler.GetHashCode(); } public override string GetName() { return _typeHandler.GetType().FullName; } public override void CascadeActivation(IActivationContext context) { if (!Handlers4.IsCascading(_typeHandler)) { return; } Handlers4.CascadeActivation(context, _typeHandler); } public override void CollectIDs(CollectIdContext context) { if (!Handlers4.IsCascading(_typeHandler)) { IncrementOffset(context); return; } context.SlotFormat().DoWithSlotIndirection(context, new _IClosure4_58(this, context )); } private sealed class _IClosure4_58 : IClosure4 { public _IClosure4_58(TypeHandlerAspect _enclosing, CollectIdContext context) { this._enclosing = _enclosing; this.context = context; } public object Run() { QueryingReadContext queryingReadContext = new QueryingReadContext(context.Transaction (), context.HandlerVersion(), context.Buffer(), 0, context.Collector()); ((ICascadingTypeHandler)this._enclosing._typeHandler).CollectIDs(queryingReadContext ); return null; } private readonly TypeHandlerAspect _enclosing; private readonly CollectIdContext context; } public override void DefragAspect(IDefragmentContext context) { context.SlotFormat().DoWithSlotIndirection(context, new _IClosure4_68(this, context )); } private sealed class _IClosure4_68 : IClosure4 { public _IClosure4_68(TypeHandlerAspect _enclosing, IDefragmentContext context) { this._enclosing = _enclosing; this.context = context; } public object Run() { this._enclosing._typeHandler.Defragment(context); return null; } private readonly TypeHandlerAspect _enclosing; private readonly IDefragmentContext context; } public override int LinkLength() { return Const4.IndirectionLength; } public override void Marshall(MarshallingContext context, object obj) { context.CreateIndirectionWithinSlot(); if (IsNotHandlingConcreteType(context)) { _typeHandler.Write(context, obj); return; } if (_typeHandler is IInstantiatingTypeHandler) { IInstantiatingTypeHandler instantiating = (IInstantiatingTypeHandler)_typeHandler; instantiating.WriteInstantiation(context, obj); instantiating.Write(context, obj); } else { _typeHandler.Write(context, obj); } } private bool IsNotHandlingConcreteType(MarshallingContext context) { return context.ClassMetadata() != _ownerMetadata; } public override Db4objects.Db4o.Internal.Marshall.AspectType AspectType() { return Db4objects.Db4o.Internal.Marshall.AspectType.Typehandler; } public override void Activate(UnmarshallingContext context) { if (!CheckEnabled(context)) { return; } context.SlotFormat().DoWithSlotIndirection(context, new _IClosure4_110(this, context )); } private sealed class _IClosure4_110 : IClosure4 { public _IClosure4_110(TypeHandlerAspect _enclosing, UnmarshallingContext context) { this._enclosing = _enclosing; this.context = context; } public object Run() { Handlers4.Activate(context, this._enclosing._typeHandler); return null; } private readonly TypeHandlerAspect _enclosing; private readonly UnmarshallingContext context; } public override void Delete(DeleteContextImpl context, bool isUpdate) { context.SlotFormat().DoWithSlotIndirection(context, new _IClosure4_119(this, context )); } private sealed class _IClosure4_119 : IClosure4 { public _IClosure4_119(TypeHandlerAspect _enclosing, DeleteContextImpl context) { this._enclosing = _enclosing; this.context = context; } public object Run() { this._enclosing._typeHandler.Delete(context); return null; } private readonly TypeHandlerAspect _enclosing; private readonly DeleteContextImpl context; } public override void Deactivate(IActivationContext context) { CascadeActivation(context); } public override bool CanBeDisabled() { return true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ObjectAnalyzer.cs0000644000175000017500000000464111700531646030133 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal { /// internal class ObjectAnalyzer { private readonly ObjectContainerBase _container; private readonly object _obj; private Db4objects.Db4o.Internal.ClassMetadata _classMetadata; private Db4objects.Db4o.Internal.ObjectReference _ref; private bool _notStorable; internal ObjectAnalyzer(ObjectContainerBase container, object obj) { _container = container; _obj = obj; } internal virtual void Analyze(Transaction trans) { _ref = trans.ReferenceForObject(_obj); if (_ref != null) { _classMetadata = _ref.ClassMetadata(); return; } IReflectClass claxx = _container.Reflector().ForObject(_obj); if (claxx == null) { NotStorable(_obj, claxx); return; } if (!DetectClassMetadata(trans, claxx)) { return; } if (IsValueType(_classMetadata)) { NotStorable(_obj, _classMetadata.ClassReflector()); } } private bool DetectClassMetadata(Transaction trans, IReflectClass claxx) { _classMetadata = _container.GetActiveClassMetadata(claxx); if (_classMetadata != null) { if (!_classMetadata.IsStorable()) { NotStorable(_obj, claxx); return false; } return true; } _classMetadata = _container.ProduceClassMetadata(claxx); if (_classMetadata == null || !_classMetadata.IsStorable()) { NotStorable(_obj, claxx); return false; } // The following may return a reference if the object is held // in a static variable somewhere ( often: Enums) that gets // stored or associated on initialization of the ClassMetadata. _ref = trans.ReferenceForObject(_obj); return true; } private void NotStorable(object obj, IReflectClass claxx) { _container.NotStorable(claxx, obj); _notStorable = true; } internal virtual bool NotStorable() { return _notStorable; } private bool IsValueType(Db4objects.Db4o.Internal.ClassMetadata classMetadata) { return classMetadata.IsValueType(); } internal virtual Db4objects.Db4o.Internal.ObjectReference ObjectReference() { return _ref; } public virtual Db4objects.Db4o.Internal.ClassMetadata ClassMetadata() { return _classMetadata; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IDb4oTypeImpl.cs0000644000175000017500000000070011700531646027574 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// marker interface for special db4o datatypes /// public interface IDb4oTypeImpl : ITransactionAware { object CreateDefault(Transaction trans); bool HasClassIndex(); void SetObjectReference(ObjectReference @ref); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Config/0000755000175000017500000000000011700531646026070 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Config/EmbeddedConfigurationImpl.cs0000644000175000017500000000355211700531646033467 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Config; namespace Db4objects.Db4o.Internal.Config { public class EmbeddedConfigurationImpl : IEmbeddedConfiguration, ILegacyConfigurationProvider { private readonly Config4Impl _legacy; private IList _configItems; public EmbeddedConfigurationImpl(IConfiguration legacy) { _legacy = (Config4Impl)legacy; } public virtual ICacheConfiguration Cache { get { return new CacheConfigurationImpl(_legacy); } } public virtual IFileConfiguration File { get { return new FileConfigurationImpl(_legacy); } } public virtual ICommonConfiguration Common { get { return Db4oLegacyConfigurationBridge.AsCommonConfiguration(Legacy()); } } public virtual Config4Impl Legacy() { return _legacy; } public virtual void AddConfigurationItem(IEmbeddedConfigurationItem configItem) { if (_configItems != null && _configItems.Contains(configItem)) { return; } configItem.Prepare(this); if (_configItems == null) { _configItems = new ArrayList(); } _configItems.Add(configItem); } public virtual void ApplyConfigurationItems(IEmbeddedObjectContainer container) { if (_configItems == null) { return; } for (IEnumerator configItemIter = _configItems.GetEnumerator(); configItemIter.MoveNext (); ) { IEmbeddedConfigurationItem configItem = ((IEmbeddedConfigurationItem)configItemIter .Current); configItem.Apply(container); } } public virtual IIdSystemConfiguration IdSystem { get { return new IdSystemConfigurationImpl(_legacy); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Config/CacheConfigurationImpl.cs0000644000175000017500000000110211700531646032766 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Config { /// public class CacheConfigurationImpl : ICacheConfiguration { private readonly Config4Impl _config; public CacheConfigurationImpl(Config4Impl config) { _config = config; } [System.ObsoleteAttribute(@"since 7.14 BTrees have their own LRU cache now.")] public virtual int SlotCacheSize { set { int size = value; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Config/FileConfigurationImpl.cs0000644000175000017500000000504711700531646032656 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Config { internal class FileConfigurationImpl : IFileConfiguration { private readonly Config4Impl _config; public FileConfigurationImpl(Config4Impl config) { _config = config; } public virtual int BlockSize { set { int bytes = value; _config.BlockSize(bytes); } } public virtual int DatabaseGrowthSize { set { int bytes = value; _config.DatabaseGrowthSize(bytes); } } public virtual void DisableCommitRecovery() { _config.DisableCommitRecovery(); } public virtual IFreespaceConfiguration Freespace { get { return _config.Freespace(); } } public virtual ConfigScope GenerateUUIDs { set { ConfigScope setting = value; _config.GenerateUUIDs(setting); } } public virtual ConfigScope GenerateVersionNumbers { set { ConfigScope setting = value; _config.GenerateVersionNumbers(setting); } } public virtual bool GenerateCommitTimestamps { set { bool setting = value; _config.GenerateCommitTimestamps(setting); } } /// public virtual IStorage Storage { get { return _config.Storage; } set { IStorage factory = value; _config.Storage = factory; } } public virtual bool LockDatabaseFile { set { bool flag = value; _config.LockDatabaseFile(flag); } } /// /// public virtual long ReserveStorageSpace { set { long byteCount = value; _config.ReserveStorageSpace(byteCount); } } /// public virtual string BlobPath { set { string path = value; _config.SetBlobPath(path); } } public virtual bool ReadOnly { set { bool flag = value; _config.ReadOnly(flag); } } public virtual bool RecoveryMode { set { bool flag = value; _config.RecoveryMode(flag); } } public virtual bool AsynchronousSync { set { bool flag = value; _config.AsynchronousSync(flag); } } } } ILegacyConfigurationProvider.cs0000644000175000017500000000035111700531646034117 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Config/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Config { public interface ILegacyConfigurationProvider { Config4Impl Legacy(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Config/CommonConfigurationImpl.cs0000644000175000017500000001155711700531646033232 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.IO; using Db4objects.Db4o.Config; using Db4objects.Db4o.Config.Encoding; using Db4objects.Db4o.Diagnostic; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal.Config { public class CommonConfigurationImpl : ICommonConfiguration { private readonly Config4Impl _config; public CommonConfigurationImpl(Config4Impl config) { _config = config; } public virtual int ActivationDepth { get { return _config.ActivationDepth(); } set { int depth = value; _config.ActivationDepth(depth); } } public virtual void Add(IConfigurationItem configurationItem) { _config.Add(configurationItem); } public virtual void AddAlias(IAlias alias) { _config.AddAlias(alias); } public virtual void RemoveAlias(IAlias alias) { _config.RemoveAlias(alias); } public virtual bool AllowVersionUpdates { set { bool flag = value; _config.AllowVersionUpdates(flag); } } public virtual bool AutomaticShutDown { set { bool flag = value; _config.AutomaticShutDown(flag); } } public virtual int BTreeNodeSize { set { int size = value; _config.BTreeNodeSize(size); } } public virtual bool Callbacks { set { bool flag = value; _config.Callbacks(flag); } } public virtual void CallbackMode(CallBackMode mode) { _config.CallbackMode(mode); } public virtual bool CallConstructors { set { bool flag = value; _config.CallConstructors(flag); } } public virtual bool DetectSchemaChanges { set { bool flag = value; _config.DetectSchemaChanges(flag); } } public virtual IDiagnosticConfiguration Diagnostic { get { return _config.Diagnostic(); } } public virtual bool ExceptionsOnNotStorable { set { bool flag = value; _config.ExceptionsOnNotStorable(flag); } } public virtual bool InternStrings { set { bool flag = value; _config.InternStrings(flag); } } public virtual void MarkTransient(string attributeName) { _config.MarkTransient(attributeName); } public virtual int MessageLevel { set { int level = value; _config.MessageLevel(level); } } public virtual IObjectClass ObjectClass(object clazz) { return _config.ObjectClass(clazz); } public virtual bool OptimizeNativeQueries { get { return _config.OptimizeNativeQueries(); } set { bool optimizeNQ = value; _config.OptimizeNativeQueries(optimizeNQ); } } public virtual IQueryConfiguration Queries { get { return _config.Queries(); } } public virtual void ReflectWith(IReflector reflector) { _config.ReflectWith(reflector); } public virtual TextWriter OutStream { set { TextWriter outStream = value; _config.SetOut(outStream); } } public virtual IStringEncoding StringEncoding { set { IStringEncoding encoding = value; _config.StringEncoding(encoding); } } public virtual bool TestConstructors { set { bool flag = value; _config.TestConstructors(flag); } } public virtual int UpdateDepth { set { int depth = value; _config.UpdateDepth(depth); } } public virtual bool WeakReferences { set { bool flag = value; _config.WeakReferences(flag); } } public virtual int WeakReferenceCollectionInterval { set { int milliseconds = value; _config.WeakReferenceCollectionInterval(milliseconds); } } public virtual void RegisterTypeHandler(ITypeHandlerPredicate predicate, ITypeHandler4 typeHandler) { _config.RegisterTypeHandler(predicate, typeHandler); } public virtual IEnvironmentConfiguration Environment { get { return new _IEnvironmentConfiguration_139(this); } } private sealed class _IEnvironmentConfiguration_139 : IEnvironmentConfiguration { public _IEnvironmentConfiguration_139(CommonConfigurationImpl _enclosing) { this._enclosing = _enclosing; } public void Add(object service) { this._enclosing._config.EnvironmentContributions().Add(service); } private readonly CommonConfigurationImpl _enclosing; } public virtual void NameProvider(INameProvider provider) { _config.NameProvider(provider); } public virtual int MaxStackDepth { get { return _config.MaxStackDepth(); } set { int maxStackDepth = value; _config.MaxStackDepth(maxStackDepth); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Config/IdSystemConfigurationImpl.cs0000644000175000017500000000162111700531646033532 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Config { /// public class IdSystemConfigurationImpl : IIdSystemConfiguration { private readonly Config4Impl _config; public IdSystemConfigurationImpl(Config4Impl config) { _config = config; } public virtual void UsePointerBasedSystem() { _config.UsePointerBasedIdSystem(); } public virtual void UseStackedBTreeSystem() { _config.UseStackedBTreeIdSystem(); } public virtual void UseInMemorySystem() { _config.UseInMemoryIdSystem(); } public virtual void UseCustomSystem(IIdSystemFactory factory) { _config.UseCustomIdSystem(factory); } public virtual void UseSingleBTreeSystem() { _config.UseSingleBTreeIdSystem(); } } } Db4oLegacyConfigurationBridge.cs0000644000175000017500000000200211700531646034114 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Config/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Config; namespace Db4objects.Db4o.Internal.Config { public class Db4oLegacyConfigurationBridge { public static IEmbeddedConfiguration AsEmbeddedConfiguration(IConfiguration legacy ) { return new EmbeddedConfigurationImpl(legacy); } public static ICommonConfiguration AsCommonConfiguration(IConfiguration config) { return new CommonConfigurationImpl((Config4Impl)config); } public static Config4Impl AsLegacy(object config) { return ((ILegacyConfigurationProvider)config).Legacy(); } public static IFileConfiguration AsFileConfiguration(IConfiguration config) { return new FileConfigurationImpl((Config4Impl)config); } public static IIdSystemConfiguration AsIdSystemConfiguration(IConfiguration config ) { return new IdSystemConfigurationImpl((Config4Impl)config); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Weakref/0000755000175000017500000000000011700531646026247 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Weakref/IWeakReferenceSupport.cs0000644000175000017500000000050411700531646033011 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.Weakref { public interface IWeakReferenceSupport { object NewWeakReference(ObjectReference referent, object obj); void Purge(); void Start(); void Stop(); } } WeakReferenceSupportFactory.cs0000644000175000017500000000207411700531646034155 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Weakref/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Weakref; namespace Db4objects.Db4o.Internal.Weakref { public class WeakReferenceSupportFactory { public static IWeakReferenceSupport ForObjectContainer(ObjectContainerBase container ) { if (!Platform4.HasWeakReferences()) { return DisabledWeakReferenceSupport(); } if (!container.ConfigImpl.WeakReferences()) { return DisabledWeakReferenceSupport(); } return new EnabledWeakReferenceSupport(container); } public static IWeakReferenceSupport DisabledWeakReferenceSupport() { return new _IWeakReferenceSupport_22(); } private sealed class _IWeakReferenceSupport_22 : IWeakReferenceSupport { public _IWeakReferenceSupport_22() { } public void Stop() { } public void Start() { } public void Purge() { } public object NewWeakReference(ObjectReference referent, object obj) { return obj; } } } } EnabledWeakReferenceSupport.cs0000644000175000017500000000377511700531646034111 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Weakref/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Weakref; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Weakref { internal class EnabledWeakReferenceSupport : IWeakReferenceSupport { private readonly object _queue; private readonly ObjectContainerBase _container; private SimpleTimer _timer; internal EnabledWeakReferenceSupport(ObjectContainerBase container) { _container = container; _queue = Platform4.CreateReferenceQueue(); } public virtual object NewWeakReference(ObjectReference referent, object obj) { return Platform4.CreateActiveObjectReference(_queue, referent, obj); } public virtual void Purge() { Platform4.PollReferenceQueue(_container, _queue); } public virtual void Start() { if (_timer != null) { return; } if (!_container.ConfigImpl.WeakReferences()) { return; } if (_container.ConfigImpl.WeakReferenceCollectionInterval() <= 0) { return; } _timer = new SimpleTimer(new EnabledWeakReferenceSupport.Collector(this), _container .ConfigImpl.WeakReferenceCollectionInterval()); _container.ThreadPool().Start("db4o WeakReference collector", _timer); } public virtual void Stop() { if (_timer == null) { return; } _timer.Stop(); _timer = null; } private sealed class Collector : IRunnable { public void Run() { try { this._enclosing.Purge(); } catch (DatabaseClosedException) { } catch (Exception e) { // can happen, no stack trace // don't bring down the thread Sharpen.Runtime.PrintStackTrace(e); } } internal Collector(EnabledWeakReferenceSupport _enclosing) { this._enclosing = _enclosing; } private readonly EnabledWeakReferenceSupport _enclosing; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/InCallback.cs0000644000175000017500000000125711700531646027202 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Sharpen.Lang; namespace Db4objects.Db4o.Internal { /// public class InCallback { private sealed class _DynamicVariable_12 : DynamicVariable { public _DynamicVariable_12() { } protected override object DefaultValue() { return false; } } private static readonly DynamicVariable _inCallback = new _DynamicVariable_12(); public static bool Value() { return (((bool)_inCallback.Value)); } public static void Run(IRunnable runnable) { _inCallback.With(true, runnable); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Handlers4.cs0000644000175000017500000002515611700531646027047 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public class Handlers4 { public const int IntId = 1; public const int LongId = 2; public const int FloatId = 3; public const int BooleanId = 4; public const int DoubleId = 5; public const int ByteId = 6; public const int CharId = 7; public const int ShortId = 8; public const int StringId = 9; public const int DateId = 10; public const int UntypedId = 11; public const int AnyArrayId = 12; public const int AnyArrayNId = 13; public static bool IsQueryLeaf(ITypeHandler4 handler) { ITypeHandler4 baseTypeHandler = BaseTypeHandler(handler); if (!(baseTypeHandler is IQueryableTypeHandler)) { return false; } if (baseTypeHandler is ArrayHandler) { return false; } return baseTypeHandler is IValueTypeHandler; } public static bool HandlesArray(ITypeHandler4 handler) { return handler is ArrayHandler; } public static bool HandlesMultidimensionalArray(ITypeHandler4 handler) { return handler is MultidimensionalArrayHandler; } public static bool HandlesClass(ITypeHandler4 handler) { return BaseTypeHandler(handler) is ICascadingTypeHandler; } public static IReflectClass PrimitiveClassReflector(ITypeHandler4 handler, IReflector reflector) { ITypeHandler4 baseTypeHandler = BaseTypeHandler(handler); if (baseTypeHandler is PrimitiveHandler) { return ((PrimitiveHandler)baseTypeHandler).PrimitiveClassReflector(); } return null; } public static ITypeHandler4 BaseTypeHandler(ITypeHandler4 handler) { if (handler is ArrayHandler) { return ((ArrayHandler)handler).DelegateTypeHandler(); } if (handler is PrimitiveTypeMetadata) { return ((PrimitiveTypeMetadata)handler).TypeHandler(); } return handler; } public static IReflectClass BaseType(IReflectClass clazz) { if (clazz == null) { return null; } if (clazz.IsArray()) { return BaseType(clazz.GetComponentType()); } return clazz; } public static bool IsClassAware(ITypeHandler4 typeHandler) { return typeHandler is IBuiltinTypeHandler || typeHandler is StandardReferenceTypeHandler; } public static int CalculateLinkLength(ITypeHandler4 handler) { if (handler == null) { throw new ArgumentNullException(); } if (handler is ILinkLengthAware) { return ((ILinkLengthAware)handler).LinkLength(); } if (handler is IReferenceTypeHandler) { return Const4.IdLength; } if (handler is IVariableLengthTypeHandler) { return Const4.IndirectionLength; } // TODO: For custom handlers there will have to be a way // to calculate the length in the slot. // Options: // (1) Remember when the first object is marshalled. // (2) Add a #defaultValue() method to TypeHandler4, // marshall the default value and check. // (3) Add a way to test the custom handler when it // is installed and remember the length there. throw new NotImplementedException("Unexpected typehandler: " + handler); } public static bool HoldsValueType(ITypeHandler4 handler) { return IsValueType(BaseTypeHandler(handler)); } public static bool IsValueType(ITypeHandler4 handler) { return !(handler is IReferenceTypeHandler); } public static bool IsCascading(ITypeHandler4 handler) { return handler is ICascadingTypeHandler; } public static bool IsUntyped(ITypeHandler4 handler) { return handler is OpenTypeHandler; } public static bool IsVariableLength(ITypeHandler4 handler) { return handler is IVariableLengthTypeHandler; } public static IFieldAwareTypeHandler FieldAwareTypeHandler(ITypeHandler4 typeHandler ) { if (typeHandler is IFieldAwareTypeHandler) { return (IFieldAwareTypeHandler)typeHandler; } return NullFieldAwareTypeHandler.Instance; } public static void CollectIDs(QueryingReadContext context, ITypeHandler4 typeHandler ) { if (typeHandler is ICascadingTypeHandler) { ((ICascadingTypeHandler)typeHandler).CollectIDs(context); } } public static bool UseDedicatedSlot(IContext context, ITypeHandler4 handler) { if (IsValueType(handler)) { return false; } if (IsUntyped(handler)) { return false; } return true; } public static ITypeHandler4 ArrayElementHandler(ITypeHandler4 handler, QueryingReadContext queryingReadContext) { if (!(handler is ICascadingTypeHandler)) { return null; } ICascadingTypeHandler cascadingHandler = (ICascadingTypeHandler)HandlerRegistry.CorrectHandlerVersion (queryingReadContext, handler); return HandlerRegistry.CorrectHandlerVersion(queryingReadContext, cascadingHandler .ReadCandidateHandler(queryingReadContext)); } public static object NullRepresentationInUntypedArrays(ITypeHandler4 handler) { if (handler is PrimitiveHandler) { return ((PrimitiveHandler)handler).NullRepresentationInUntypedArrays(); } return null; } public static bool HandleAsObject(ITypeHandler4 typeHandler) { if (IsValueType(typeHandler)) { return false; } if (IsUntyped(typeHandler)) { return false; } return true; } public static void CascadeActivation(IActivationContext context, ITypeHandler4 handler ) { if (!(handler is ICascadingTypeHandler)) { return; } ((ICascadingTypeHandler)handler).CascadeActivation(context); } public static bool HandlesPrimitiveArray(ITypeHandler4 typeHandler) { return typeHandler is ArrayHandler; } // && isPrimitive(((ArrayHandler)typeHandler).delegateTypeHandler()); public static bool HasClassIndex(ITypeHandler4 typeHandler) { if (typeHandler is StandardReferenceTypeHandler) { return ((StandardReferenceTypeHandler)typeHandler).ClassMetadata().HasClassIndex( ); } return false; } public static bool CanLoadFieldByIndex(ITypeHandler4 handler) { if (handler is IQueryableTypeHandler) { return !((IQueryableTypeHandler)handler).DescendsIntoMembers(); } return true; } public static object WrapWithTransactionContext(Transaction transaction, object value , ITypeHandler4 handler) { if (IsValueType(handler)) { return value; } return transaction.Wrap(value); } public static void CollectIdsInternal(CollectIdContext context, ITypeHandler4 handler , int linkLength, bool doWithSlotIndirection) { if (!(IsCascading(handler))) { IReadBuffer buffer = context.Buffer(); buffer.Seek(buffer.Offset() + linkLength); return; } if (handler is StandardReferenceTypeHandler) { context.AddId(); return; } LocalObjectContainer container = (LocalObjectContainer)context.Container(); SlotFormat slotFormat = context.SlotFormat(); if (HandleAsObject(handler)) { // TODO: Code is similar to QCandidate.readArrayCandidates. Try to refactor to one place. int collectionID = context.ReadInt(); ByteArrayBuffer collectionBuffer = container.ReadBufferById(context.Transaction() , collectionID); ObjectHeader objectHeader = new ObjectHeader(container, collectionBuffer); QueryingReadContext subContext = new QueryingReadContext(context.Transaction(), context .HandlerVersion(), collectionBuffer, collectionID, context.Collector()); objectHeader.ClassMetadata().CollectIDs(subContext); return; } QueryingReadContext queryingReadContext = new QueryingReadContext(context.Transaction (), context.HandlerVersion(), context.Buffer(), 0, context.Collector()); IClosure4 collectIDsFromQueryingContext = new _IClosure4_263(handler, queryingReadContext ); if (doWithSlotIndirection) { slotFormat.DoWithSlotIndirection(queryingReadContext, handler, collectIDsFromQueryingContext ); } else { collectIDsFromQueryingContext.Run(); } } private sealed class _IClosure4_263 : IClosure4 { public _IClosure4_263(ITypeHandler4 handler, QueryingReadContext queryingReadContext ) { this.handler = handler; this.queryingReadContext = queryingReadContext; } public object Run() { ((ICascadingTypeHandler)handler).CollectIDs(queryingReadContext); return null; } private readonly ITypeHandler4 handler; private readonly QueryingReadContext queryingReadContext; } public static bool IsIndirectedIndexed(ITypeHandler4 handler) { return IsValueType(handler) && (handler is IVariableLengthTypeHandler) && (handler is IIndexableTypeHandler); } public static IPreparedComparison PrepareComparisonFor(ITypeHandler4 handler, IContext context, object obj) { if (!(handler is IComparable4)) { return null; } return ((IComparable4)handler).PrepareComparison(context, obj); } public static IReflectClass PrimitiveClassReflector(ClassMetadata classMetadata, IReflector reflector) { if (classMetadata is PrimitiveTypeMetadata) { return PrimitiveClassReflector(((PrimitiveTypeMetadata)classMetadata).TypeHandler (), reflector); } return null; } public static void Activate(UnmarshallingContext context, ITypeHandler4 handler) { if (handler is IReferenceTypeHandler) { ((IReferenceTypeHandler)handler).Activate(context); } } public static void Write(ITypeHandler4 handler, IWriteContext context, object obj ) { handler.Write(context, obj); } public static object ReadValueType(IReadContext context, ITypeHandler4 handler) { return ((IValueTypeHandler)handler).Read(context); } public static bool IsStandaloneTypeHandler(ITypeHandler4 customTypeHandler) { return IsValueType(customTypeHandler) || customTypeHandler is OpenTypeHandler; } public static ClassMetadata ErasedFieldType(ObjectContainerBase container, IReflectClass fieldType) { return fieldType.IsInterface() ? container.ClassMetadataForID(UntypedId) : container .ProduceClassMetadata(BaseType(fieldType)); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/LocalTransaction.cs0000644000175000017500000003247111700531646030461 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Callbacks; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.References; namespace Db4objects.Db4o.Internal { /// public class LocalTransaction : Transaction { private readonly IdentitySet4 _participants = new IdentitySet4(); internal Tree _writtenUpdateAdjustedIndexes; protected readonly LocalObjectContainer _file; private readonly ICommittedCallbackDispatcher _committedCallbackDispatcher; private readonly ITransactionalIdSystem _idSystem; private Db4objects.Db4o.Internal.CommitTimestampSupport _commitTimestampSupport = null; private long _timestamp; public LocalTransaction(ObjectContainerBase container, Transaction parentTransaction , ITransactionalIdSystem idSystem, IReferenceSystem referenceSystem) : base(container , parentTransaction, referenceSystem) { _file = (LocalObjectContainer)container; _committedCallbackDispatcher = new _ICommittedCallbackDispatcher_35(this); _idSystem = idSystem; } private sealed class _ICommittedCallbackDispatcher_35 : ICommittedCallbackDispatcher { public _ICommittedCallbackDispatcher_35(LocalTransaction _enclosing) { this._enclosing = _enclosing; } public bool WillDispatchCommitted() { return this._enclosing.Callbacks().CaresAboutCommitted(); } public void DispatchCommitted(CallbackObjectInfoCollections committedInfo) { this._enclosing.Callbacks().CommitOnCompleted(this._enclosing, committedInfo, false ); } private readonly LocalTransaction _enclosing; } public virtual Config4Impl Config() { return Container().Config(); } public virtual LocalObjectContainer LocalContainer() { return _file; } public override void Commit() { if (IsSystemTransaction()) { CommitTimestampSupport().EnsureInitialized(); } Commit(_committedCallbackDispatcher); } public virtual void Commit(ICommittedCallbackDispatcher dispatcher) { lock (Container().Lock()) { DispatchCommittingCallback(); if (!DoCommittedCallbacks(dispatcher)) { CommitListeners(); CommitImpl(); CommitClearAll(); } else { CommitListeners(); Collection4 deleted = CollectCommittedCallbackDeletedInfo(); CommitImpl(); CallbackObjectInfoCollections committedInfo = CollectCommittedCallbackInfo(deleted ); CommitClearAll(); dispatcher.DispatchCommitted(CallbackObjectInfoCollections.Emtpy == committedInfo ? committedInfo : new CallbackObjectInfoCollections(committedInfo.added, committedInfo .updated, new ObjectInfoCollectionImpl(deleted))); } } } private void DispatchCommittingCallback() { if (DoCommittingCallbacks()) { Callbacks().CommitOnStarted(this, CollectCommittingCallbackInfo()); } } private bool DoCommittedCallbacks(ICommittedCallbackDispatcher dispatcher) { if (IsSystemTransaction()) { return false; } return dispatcher.WillDispatchCommitted(); } private bool DoCommittingCallbacks() { if (IsSystemTransaction()) { return false; } return Callbacks().CaresAboutCommitting(); } public virtual void Enlist(ITransactionParticipant participant) { if (null == participant) { throw new ArgumentNullException(); } CheckSynchronization(); if (!_participants.Contains(participant)) { _participants.Add(participant); } } private void CommitImpl() { if (DTrace.enabled) { DTrace.TransCommit.LogInfo("server == " + Container().IsServer() + ", systemtrans == " + IsSystemTransaction()); } CommitClassMetadata(); CommitParticipants(); Container().WriteDirtyClassMetadata(); IdSystem().Commit(new FreespaceCommitter(LocalContainer().FreespaceManager())); } private void CommitListeners() { CommitParentListeners(); CommitTransactionListeners(); } private void CommitParentListeners() { if (_systemTransaction != null) { ParentLocalTransaction().CommitListeners(); } } private void CommitParticipants() { if (ParentLocalTransaction() != null) { ParentLocalTransaction().CommitParticipants(); } IEnumerator iterator = _participants.GetEnumerator(); while (iterator.MoveNext()) { ((ITransactionParticipant)iterator.Current).Commit(this); } } private void CommitClassMetadata() { Container().ProcessPendingClassUpdates(); Container().WriteDirtyClassMetadata(); Container().ClassCollection().Write(Container().SystemTransaction()); } private Db4objects.Db4o.Internal.LocalTransaction ParentLocalTransaction() { return (Db4objects.Db4o.Internal.LocalTransaction)_systemTransaction; } private void CommitClearAll() { if (_systemTransaction != null) { ParentLocalTransaction().CommitClearAll(); } ClearAll(); } protected override void Clear() { IdSystem().Clear(); DisposeParticipants(); _participants.Clear(); } private void DisposeParticipants() { IEnumerator iterator = _participants.ValuesIterator(); while (iterator.MoveNext()) { ((ITransactionParticipant)iterator.Current).Dispose(this); } } public override void Rollback() { lock (Container().Lock()) { RollbackParticipants(); IdSystem().Rollback(); RollBackTransactionListeners(); ClearAll(); } } private void RollbackParticipants() { IEnumerator iterator = _participants.ValuesIterator(); while (iterator.MoveNext()) { ((ITransactionParticipant)iterator.Current).Rollback(this); } } public virtual void FlushFile() { if (DTrace.enabled) { DTrace.TransFlush.Log(); } _file.SyncFiles(); } public override void ProcessDeletes() { if (_delete == null) { _writtenUpdateAdjustedIndexes = null; return; } while (_delete != null) { Tree delete = _delete; _delete = null; delete.Traverse(new _IVisitor4_225(this)); } // if the object has been deleted // We need to hold a hard reference here, otherwise we can get // intermediate garbage collection kicking in. // This means the object was gc'd. // Let's try to read it again, but this may fail in // CS mode if another transaction has deleted it. _writtenUpdateAdjustedIndexes = null; } private sealed class _IVisitor4_225 : IVisitor4 { public _IVisitor4_225(LocalTransaction _enclosing) { this._enclosing = _enclosing; } public void Visit(object a_object) { DeleteInfo info = (DeleteInfo)a_object; if (this._enclosing.LocalContainer().IsDeleted(this._enclosing, info._key)) { return; } object obj = null; if (info._reference != null) { obj = info._reference.GetObject(); } if (obj == null || info._reference.GetID() < 0) { HardObjectReference hardRef = this._enclosing.Container().GetHardObjectReferenceById (this._enclosing, info._key); if (hardRef == HardObjectReference.Invalid) { return; } info._reference = hardRef._reference; info._reference.FlagForDelete(this._enclosing.Container().TopLevelCallId()); obj = info._reference.GetObject(); } this._enclosing.Container().Delete3(this._enclosing, info._reference, obj, info._cascade , false); } private readonly LocalTransaction _enclosing; } public override void WriteUpdateAdjustIndexes(int id, ClassMetadata clazz, ArrayType typeInfo) { new WriteUpdateProcessor(this, id, clazz, typeInfo).Run(); } private ICallbacks Callbacks() { return Container().Callbacks(); } private Collection4 CollectCommittedCallbackDeletedInfo() { Collection4 deleted = new Collection4(); CollectCallBackInfo(new _ICallbackInfoCollector_275(this, deleted)); return deleted; } private sealed class _ICallbackInfoCollector_275 : ICallbackInfoCollector { public _ICallbackInfoCollector_275(LocalTransaction _enclosing, Collection4 deleted ) { this._enclosing = _enclosing; this.deleted = deleted; } public void Deleted(int id) { IObjectInfo @ref = this._enclosing.FrozenReferenceFor(id); if (@ref != null) { deleted.Add(@ref); } } public void Updated(int id) { } public void Added(int id) { } private readonly LocalTransaction _enclosing; private readonly Collection4 deleted; } private CallbackObjectInfoCollections CollectCommittedCallbackInfo(Collection4 deleted ) { if (!IdSystem().IsDirty()) { return CallbackObjectInfoCollections.Emtpy; } Collection4 added = new Collection4(); Collection4 updated = new Collection4(); CollectCallBackInfo(new _ICallbackInfoCollector_298(this, added, updated)); return NewCallbackObjectInfoCollections(added, updated, deleted); } private sealed class _ICallbackInfoCollector_298 : ICallbackInfoCollector { public _ICallbackInfoCollector_298(LocalTransaction _enclosing, Collection4 added , Collection4 updated) { this._enclosing = _enclosing; this.added = added; this.updated = updated; } public void Added(int id) { added.Add(this._enclosing.LazyReferenceFor(id)); } public void Updated(int id) { updated.Add(this._enclosing.LazyReferenceFor(id)); } public void Deleted(int id) { } private readonly LocalTransaction _enclosing; private readonly Collection4 added; private readonly Collection4 updated; } private CallbackObjectInfoCollections CollectCommittingCallbackInfo() { if (!IdSystem().IsDirty()) { return CallbackObjectInfoCollections.Emtpy; } Collection4 added = new Collection4(); Collection4 deleted = new Collection4(); Collection4 updated = new Collection4(); CollectCallBackInfo(new _ICallbackInfoCollector_321(this, added, updated, deleted )); return NewCallbackObjectInfoCollections(added, updated, deleted); } private sealed class _ICallbackInfoCollector_321 : ICallbackInfoCollector { public _ICallbackInfoCollector_321(LocalTransaction _enclosing, Collection4 added , Collection4 updated, Collection4 deleted) { this._enclosing = _enclosing; this.added = added; this.updated = updated; this.deleted = deleted; } public void Added(int id) { added.Add(this._enclosing.LazyReferenceFor(id)); } public void Updated(int id) { updated.Add(this._enclosing.LazyReferenceFor(id)); } public void Deleted(int id) { IObjectInfo @ref = this._enclosing.FrozenReferenceFor(id); if (@ref != null) { deleted.Add(@ref); } } private readonly LocalTransaction _enclosing; private readonly Collection4 added; private readonly Collection4 updated; private readonly Collection4 deleted; } private CallbackObjectInfoCollections NewCallbackObjectInfoCollections(Collection4 added, Collection4 updated, Collection4 deleted) { return new CallbackObjectInfoCollections(new ObjectInfoCollectionImpl(added), new ObjectInfoCollectionImpl(updated), new ObjectInfoCollectionImpl(deleted)); } private void CollectCallBackInfo(ICallbackInfoCollector collector) { IdSystem().CollectCallBackInfo(collector); } public override ITransactionalIdSystem IdSystem() { return _idSystem; } public virtual IObjectInfo FrozenReferenceFor(int id) { ObjectReference @ref = ReferenceForId(id); if (@ref != null) { return new FrozenObjectInfo(this, @ref, true); } @ref = Container().PeekReference(SystemTransaction(), id, new FixedActivationDepth (0), true); if (@ref == null || @ref.GetObject() == null) { return null; } return new FrozenObjectInfo(SystemTransaction(), @ref, true); } public virtual LazyObjectReference LazyReferenceFor(int id) { return new LazyObjectReference(this, id); } public override long VersionForId(int id) { return CommitTimestampSupport().VersionForId(id); } public virtual Db4objects.Db4o.Internal.CommitTimestampSupport CommitTimestampSupport () { if (!IsSystemTransaction()) { throw new InvalidOperationException(); } if (_commitTimestampSupport == null) { _commitTimestampSupport = new Db4objects.Db4o.Internal.CommitTimestampSupport(LocalContainer ()); } return _commitTimestampSupport; } public override long GenerateTransactionTimestamp(long forcedTimeStamp) { if (forcedTimeStamp > 0) { _timestamp = forcedTimeStamp; } else { _timestamp = LocalContainer().GenerateTimeStampId(); } return _timestamp; } public override void UseDefaultTransactionTimestamp() { _timestamp = 0; } public virtual long Timestamp() { return _timestamp; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ObjectReference.cs0000644000175000017500000006146411700531646030252 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Activation; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; using Sharpen; namespace Db4objects.Db4o.Internal { /// A weak reference to an known object. /// /// A weak reference to an known object. /// "Known" ~ has been stored and/or retrieved within a transaction. /// References the corresponding ClassMetaData along with further metadata: /// internal id, UUID/version information, ... /// /// public class ObjectReference : Identifiable, IObjectInfo, IActivator { private Db4objects.Db4o.Internal.ClassMetadata _class; private object _object; private Db4objects.Db4o.Internal.VirtualAttributes _virtualAttributes; private Db4objects.Db4o.Internal.ObjectReference _idPreceding; private Db4objects.Db4o.Internal.ObjectReference _idSubsequent; private int _idSize; private Db4objects.Db4o.Internal.ObjectReference _hcPreceding; private Db4objects.Db4o.Internal.ObjectReference _hcSubsequent; private int _hcSize; public int _hcHashcode; private int _lastTopLevelCallId; public ObjectReference() { } public ObjectReference(int id) { // redundant hashCode _id = id; if (DTrace.enabled) { DTrace.ObjectReferenceCreated.Log(id); } } public ObjectReference(Db4objects.Db4o.Internal.ClassMetadata classMetadata, int id) : this(id) { _class = classMetadata; } public virtual void Activate(ActivationPurpose purpose) { ActivateOn(Container().Transaction, purpose); } public virtual void ActivateOn(Db4objects.Db4o.Internal.Transaction transaction, ActivationPurpose purpose) { if (Activating()) { return; } try { Activating(true); ObjectContainerBase container = transaction.Container(); if (!(container.ActivationDepthProvider() is ITransparentActivationDepthProvider)) { return; } ITransparentActivationDepthProvider provider = (ITransparentActivationDepthProvider )container.ActivationDepthProvider(); if (ActivationPurpose.Write == purpose) { lock (container.Lock()) { provider.AddModified(GetObject(), transaction); } } if (IsActive()) { return; } lock (container.Lock()) { Activate(transaction, GetObject(), new DescendingActivationDepth(provider, ActivationMode .Activate)); } } finally { Activating(false); } } private bool Activating() { return BitIsTrue(Const4.Activating); } private void Activating(bool isActivating) { if (isActivating) { BitTrue(Const4.Activating); } else { BitFalse(Const4.Activating); } } public virtual void Activate(Db4objects.Db4o.Internal.Transaction ta, object obj, IActivationDepth depth) { ObjectContainerBase container = ta.Container(); ActivateInternal(container.ActivationContextFor(ta, obj, depth)); container.ActivatePending(ta); } internal virtual void ActivateInternal(IActivationContext context) { if (null == context) { throw new ArgumentNullException(); } if (!context.Depth().RequiresActivation()) { return; } ObjectContainerBase container = context.Container(); if (context.Depth().Mode().IsRefresh()) { LogActivation(container, "refresh"); } else { if (IsActive()) { _class.CascadeActivation(context); return; } LogActivation(container, "activate"); } ReadForActivation(context); } private void ReadForActivation(IActivationContext context) { Read(context.Transaction(), null, context.TargetObject(), context.Depth(), Const4 .AddMembersToIdTreeOnly, false); } private void LogActivation(ObjectContainerBase container, string @event) { LogEvent(container, @event, Const4.Activation); } private void LogEvent(ObjectContainerBase container, string @event, int level) { if (container.ConfigImpl.MessageLevel() > level) { container.Message(string.Empty + GetID() + " " + @event + " " + _class.GetName()); } } /// return false if class not completely initialized, otherwise true internal virtual bool ContinueSet(Db4objects.Db4o.Internal.Transaction trans, IUpdateDepth updateDepth) { if (!BitIsTrue(Const4.Continue)) { return true; } if (!_class.StateOK()) { return false; } if (!_class.AspectsAreInitialized()) { return false; } if (DTrace.enabled) { DTrace.Continueset.Log(GetID()); } BitFalse(Const4.Continue); MarshallingContext context = new MarshallingContext(trans, this, updateDepth, true ); Handlers4.Write(ClassMetadata().TypeHandler(), context, GetObject()); Pointer4 pointer = context.AllocateSlot(); ByteArrayBuffer buffer = context.ToWriteBuffer(pointer); ObjectContainerBase container = trans.Container(); container.WriteNew(trans, pointer, _class, buffer); object obj = _object; ObjectOnNew(trans, obj); if (_class.HasIdentity()) { _object = container.NewWeakReference(this, obj); } SetStateClean(); EndProcessing(); return true; } private void ObjectOnNew(Db4objects.Db4o.Internal.Transaction transaction, object obj) { ObjectContainerBase container = transaction.Container(); container.Callbacks().ObjectOnNew(transaction, this); _class.DispatchEvent(transaction, obj, EventDispatchers.New); } public virtual void Deactivate(Db4objects.Db4o.Internal.Transaction trans, IActivationDepth depth) { if (!depth.RequiresActivation()) { return; } object obj = GetObject(); if (obj == null) { return; } ObjectContainerBase container = trans.Container(); LogActivation(container, "deactivate"); SetStateDeactivated(); _class.Deactivate(trans, this, depth); } public virtual byte GetIdentifier() { return Const4.Yapobject; } public virtual long GetInternalID() { return GetID(); } public virtual object GetObject() { if (Platform4.HasWeakReferences()) { return Platform4.GetYapRefObject(_object); } return _object; } public virtual object GetObjectReference() { return _object; } public virtual ObjectContainerBase Container() { if (_class == null) { throw new InvalidOperationException(); } return _class.Container(); } public virtual Db4objects.Db4o.Internal.Transaction Transaction() { return Container().Transaction; } public virtual Db4oUUID GetUUID() { Db4objects.Db4o.Internal.VirtualAttributes va = VirtualAttributes(Transaction()); if (va != null && va.i_database != null) { return new Db4oUUID(va.i_uuid, va.i_database.i_signature); } return null; } public virtual long GetVersion() { return GetCommitTimestamp(); } public virtual long GetCommitTimestamp() { lock (Container().Lock()) { return Container().SystemTransaction().VersionForId(GetID()); } } public Db4objects.Db4o.Internal.ClassMetadata ClassMetadata() { return _class; } public virtual void ClassMetadata(Db4objects.Db4o.Internal.ClassMetadata classMetadata ) { if (_class == classMetadata) { return; } if (_class != null) { throw new InvalidOperationException("Object types aren't supposed to change!"); } _class = classMetadata; } public virtual int OwnLength() { throw Exceptions4.ShouldNeverBeCalled(); } public virtual Db4objects.Db4o.Internal.VirtualAttributes ProduceVirtualAttributes () { if (_virtualAttributes == null) { _virtualAttributes = new Db4objects.Db4o.Internal.VirtualAttributes(); } return _virtualAttributes; } internal void PeekPersisted(Db4objects.Db4o.Internal.Transaction trans, IActivationDepth depth) { SetObject(Read(trans, depth, Const4.Transient, false)); } internal object Read(Db4objects.Db4o.Internal.Transaction trans, IActivationDepth instantiationDepth, int addToIDTree, bool checkIDTree) { return Read(trans, null, null, instantiationDepth, addToIDTree, checkIDTree); } public object Read(Db4objects.Db4o.Internal.Transaction trans, ByteArrayBuffer buffer , object obj, IActivationDepth instantiationDepth, int addToIDTree, bool checkIDTree ) { UnmarshallingContext context = new UnmarshallingContext(trans, buffer, this, addToIDTree , checkIDTree); context.PersistentObject(obj); context.ActivationDepth(instantiationDepth); return context.Read(); } public virtual object ReadPrefetch(Db4objects.Db4o.Internal.Transaction trans, ByteArrayBuffer buffer, int addToIDTree) { UnmarshallingContext context = new UnmarshallingContext(trans, buffer, this, addToIDTree , false); context.ActivationDepth(new FixedActivationDepth(1, ActivationMode.Prefetch)); return context.Read(); } public void ReadThis(Db4objects.Db4o.Internal.Transaction trans, ByteArrayBuffer buffer) { } public virtual void SetObjectWeak(ObjectContainerBase container, object obj) { if (_object != null) { Platform4.KillYapRef(_object); } _object = container.NewWeakReference(this, obj); } public virtual void SetObject(object obj) { _object = obj; } internal void Store(Db4objects.Db4o.Internal.Transaction trans, Db4objects.Db4o.Internal.ClassMetadata classMetadata, object obj) { _object = obj; _class = classMetadata; int id = trans.Container().IdForNewUserObject(trans); SetID(id); // will be ended in continueset() BeginProcessing(); BitTrue(Const4.Continue); } public virtual void FlagForDelete(int callId) { _lastTopLevelCallId = -callId; } public virtual bool IsFlaggedForDelete() { return _lastTopLevelCallId < 0; } public virtual void FlagAsHandled(int callId) { _lastTopLevelCallId = callId; } public bool IsFlaggedAsHandled(int callID) { return _lastTopLevelCallId == callID; } public bool IsValid() { return IsValidId(GetID()) && GetObject() != null; } public static bool IsValidId(int id) { return id > 0; } public virtual Db4objects.Db4o.Internal.VirtualAttributes VirtualAttributes() { return _virtualAttributes; } public virtual Db4objects.Db4o.Internal.VirtualAttributes VirtualAttributes(Db4objects.Db4o.Internal.Transaction trans, bool lastCommitted) { if (trans == null) { return _virtualAttributes; } lock (trans.Container().Lock()) { if (_virtualAttributes == null) { if (_class.HasVirtualAttributes()) { _virtualAttributes = new Db4objects.Db4o.Internal.VirtualAttributes(); _class.ReadVirtualAttributes(trans, this, lastCommitted); } } else { if (!_virtualAttributes.SuppliesUUID()) { if (_class.HasVirtualAttributes()) { _class.ReadVirtualAttributes(trans, this, lastCommitted); } } } return _virtualAttributes; } } public virtual Db4objects.Db4o.Internal.VirtualAttributes VirtualAttributes(Db4objects.Db4o.Internal.Transaction trans) { return VirtualAttributes(trans, false); } public virtual void SetVirtualAttributes(Db4objects.Db4o.Internal.VirtualAttributes at) { _virtualAttributes = at; } public virtual void WriteThis(Db4objects.Db4o.Internal.Transaction trans, ByteArrayBuffer buffer) { } public virtual void WriteUpdate(Db4objects.Db4o.Internal.Transaction transaction, IUpdateDepth updatedepth) { ContinueSet(transaction, updatedepth); // make sure, a concurrent new, possibly triggered by objectOnNew // is written to the file // preventing recursive if (!BeginProcessing()) { return; } object obj = GetObject(); if (!ObjectCanUpdate(transaction, obj) || !IsActive() || obj == null || !ClassMetadata ().IsModified(obj)) { EndProcessing(); return; } MarshallingContext context = new MarshallingContext(transaction, this, updatedepth , false); if (context.UpdateDepth().Negative()) { EndProcessing(); return; } ObjectContainerBase container = transaction.Container(); LogEvent(container, "update", Const4.State); SetStateClean(); context.PurgeFieldIndexEntriesOnUpdate(transaction, container._handlers.ArrayType (obj)); Handlers4.Write(_class.TypeHandler(), context, obj); if (context.UpdateDepth().CanSkip(this)) { EndProcessing(); return; } Pointer4 pointer = context.AllocateSlot(); ByteArrayBuffer buffer = context.ToWriteBuffer(pointer); container.WriteUpdate(transaction, pointer, _class, container._handlers.ArrayType (obj), buffer); if (IsActive()) { SetStateClean(); } EndProcessing(); container.Callbacks().ObjectOnUpdate(transaction, this); ClassMetadata().DispatchEvent(transaction, obj, EventDispatchers.Update); } protected virtual bool ObjectCanUpdate(Db4objects.Db4o.Internal.Transaction transaction , object obj) { ObjectContainerBase container = transaction.Container(); return container.Callbacks().ObjectCanUpdate(transaction, this) && _class.DispatchEvent (transaction, obj, EventDispatchers.CanUpdate); } public virtual void Ref_init() { Hc_init(); Id_init(); } /// HCTREE public virtual Db4objects.Db4o.Internal.ObjectReference Hc_add(Db4objects.Db4o.Internal.ObjectReference newRef) { if (newRef.GetObject() == null) { return this; } newRef.Hc_init(); return Hc_add1(newRef); } private void Hc_init() { _hcPreceding = null; _hcSubsequent = null; _hcSize = 1; _hcHashcode = Hc_getCode(GetObject()); } private Db4objects.Db4o.Internal.ObjectReference Hc_add1(Db4objects.Db4o.Internal.ObjectReference newRef) { int cmp = Hc_compare(newRef); if (cmp < 0) { if (_hcPreceding == null) { _hcPreceding = newRef; _hcSize++; } else { _hcPreceding = _hcPreceding.Hc_add1(newRef); if (_hcSubsequent == null) { return Hc_rotateRight(); } return Hc_balance(); } } else { if (_hcSubsequent == null) { _hcSubsequent = newRef; _hcSize++; } else { _hcSubsequent = _hcSubsequent.Hc_add1(newRef); if (_hcPreceding == null) { return Hc_rotateLeft(); } return Hc_balance(); } } return this; } private Db4objects.Db4o.Internal.ObjectReference Hc_balance() { int cmp = _hcSubsequent._hcSize - _hcPreceding._hcSize; if (cmp < -2) { return Hc_rotateRight(); } else { if (cmp > 2) { return Hc_rotateLeft(); } else { _hcSize = _hcPreceding._hcSize + _hcSubsequent._hcSize + 1; return this; } } } private void Hc_calculateSize() { if (_hcPreceding == null) { if (_hcSubsequent == null) { _hcSize = 1; } else { _hcSize = _hcSubsequent._hcSize + 1; } } else { if (_hcSubsequent == null) { _hcSize = _hcPreceding._hcSize + 1; } else { _hcSize = _hcPreceding._hcSize + _hcSubsequent._hcSize + 1; } } } private int Hc_compare(Db4objects.Db4o.Internal.ObjectReference toRef) { int cmp = toRef._hcHashcode - _hcHashcode; if (cmp == 0) { cmp = toRef._id - _id; } return cmp; } public virtual Db4objects.Db4o.Internal.ObjectReference Hc_find(object obj) { return Hc_find(Hc_getCode(obj), obj); } private Db4objects.Db4o.Internal.ObjectReference Hc_find(int id, object obj) { int cmp = id - _hcHashcode; if (cmp < 0) { if (_hcPreceding != null) { return _hcPreceding.Hc_find(id, obj); } } else { if (cmp > 0) { if (_hcSubsequent != null) { return _hcSubsequent.Hc_find(id, obj); } } else { if (obj == GetObject()) { return this; } if (_hcPreceding != null) { Db4objects.Db4o.Internal.ObjectReference inPreceding = _hcPreceding.Hc_find(id, obj ); if (inPreceding != null) { return inPreceding; } } if (_hcSubsequent != null) { return _hcSubsequent.Hc_find(id, obj); } } } return null; } public static int Hc_getCode(object obj) { int hcode = Runtime.IdentityHashCode(obj); if (hcode < 0) { hcode = ~hcode; } return hcode; } private Db4objects.Db4o.Internal.ObjectReference Hc_rotateLeft() { Db4objects.Db4o.Internal.ObjectReference tree = _hcSubsequent; _hcSubsequent = tree._hcPreceding; Hc_calculateSize(); tree._hcPreceding = this; if (tree._hcSubsequent == null) { tree._hcSize = 1 + _hcSize; } else { tree._hcSize = 1 + _hcSize + tree._hcSubsequent._hcSize; } return tree; } private Db4objects.Db4o.Internal.ObjectReference Hc_rotateRight() { Db4objects.Db4o.Internal.ObjectReference tree = _hcPreceding; _hcPreceding = tree._hcSubsequent; Hc_calculateSize(); tree._hcSubsequent = this; if (tree._hcPreceding == null) { tree._hcSize = 1 + _hcSize; } else { tree._hcSize = 1 + _hcSize + tree._hcPreceding._hcSize; } return tree; } private Db4objects.Db4o.Internal.ObjectReference Hc_rotateSmallestUp() { if (_hcPreceding != null) { _hcPreceding = _hcPreceding.Hc_rotateSmallestUp(); return Hc_rotateRight(); } return this; } public virtual Db4objects.Db4o.Internal.ObjectReference Hc_remove(Db4objects.Db4o.Internal.ObjectReference findRef) { if (this == findRef) { return Hc_remove(); } int cmp = Hc_compare(findRef); if (cmp <= 0) { if (_hcPreceding != null) { _hcPreceding = _hcPreceding.Hc_remove(findRef); } } if (cmp >= 0) { if (_hcSubsequent != null) { _hcSubsequent = _hcSubsequent.Hc_remove(findRef); } } Hc_calculateSize(); return this; } public virtual void Hc_traverse(IVisitor4 visitor) { if (_hcPreceding != null) { _hcPreceding.Hc_traverse(visitor); } if (_hcSubsequent != null) { _hcSubsequent.Hc_traverse(visitor); } // Traversing the leaves first allows to add ObjectReference // nodes to different ReferenceSystem trees during commit visitor.Visit(this); } private Db4objects.Db4o.Internal.ObjectReference Hc_remove() { if (_hcSubsequent != null && _hcPreceding != null) { _hcSubsequent = _hcSubsequent.Hc_rotateSmallestUp(); _hcSubsequent._hcPreceding = _hcPreceding; _hcSubsequent.Hc_calculateSize(); return _hcSubsequent; } if (_hcSubsequent != null) { return _hcSubsequent; } return _hcPreceding; } /// IDTREE public virtual Db4objects.Db4o.Internal.ObjectReference Id_add(Db4objects.Db4o.Internal.ObjectReference newRef) { newRef.Id_init(); return Id_add1(newRef); } private void Id_init() { _idPreceding = null; _idSubsequent = null; _idSize = 1; } private Db4objects.Db4o.Internal.ObjectReference Id_add1(Db4objects.Db4o.Internal.ObjectReference newRef) { int cmp = newRef._id - _id; if (cmp < 0) { if (_idPreceding == null) { _idPreceding = newRef; _idSize++; } else { _idPreceding = _idPreceding.Id_add1(newRef); if (_idSubsequent == null) { return Id_rotateRight(); } return Id_balance(); } } else { if (cmp > 0) { if (_idSubsequent == null) { _idSubsequent = newRef; _idSize++; } else { _idSubsequent = _idSubsequent.Id_add1(newRef); if (_idPreceding == null) { return Id_rotateLeft(); } return Id_balance(); } } } return this; } private Db4objects.Db4o.Internal.ObjectReference Id_balance() { int cmp = _idSubsequent._idSize - _idPreceding._idSize; if (cmp < -2) { return Id_rotateRight(); } else { if (cmp > 2) { return Id_rotateLeft(); } else { _idSize = _idPreceding._idSize + _idSubsequent._idSize + 1; return this; } } } private void Id_calculateSize() { if (_idPreceding == null) { if (_idSubsequent == null) { _idSize = 1; } else { _idSize = _idSubsequent._idSize + 1; } } else { if (_idSubsequent == null) { _idSize = _idPreceding._idSize + 1; } else { _idSize = _idPreceding._idSize + _idSubsequent._idSize + 1; } } } public virtual Db4objects.Db4o.Internal.ObjectReference Id_find(int id) { int cmp = id - _id; if (cmp > 0) { if (_idSubsequent != null) { return _idSubsequent.Id_find(id); } } else { if (cmp < 0) { if (_idPreceding != null) { return _idPreceding.Id_find(id); } } else { return this; } } return null; } private Db4objects.Db4o.Internal.ObjectReference Id_rotateLeft() { Db4objects.Db4o.Internal.ObjectReference tree = _idSubsequent; _idSubsequent = tree._idPreceding; Id_calculateSize(); tree._idPreceding = this; if (tree._idSubsequent == null) { tree._idSize = _idSize + 1; } else { tree._idSize = _idSize + 1 + tree._idSubsequent._idSize; } return tree; } private Db4objects.Db4o.Internal.ObjectReference Id_rotateRight() { Db4objects.Db4o.Internal.ObjectReference tree = _idPreceding; _idPreceding = tree._idSubsequent; Id_calculateSize(); tree._idSubsequent = this; if (tree._idPreceding == null) { tree._idSize = _idSize + 1; } else { tree._idSize = _idSize + 1 + tree._idPreceding._idSize; } return tree; } private Db4objects.Db4o.Internal.ObjectReference Id_rotateSmallestUp() { if (_idPreceding != null) { _idPreceding = _idPreceding.Id_rotateSmallestUp(); return Id_rotateRight(); } return this; } public virtual Db4objects.Db4o.Internal.ObjectReference Id_remove(Db4objects.Db4o.Internal.ObjectReference @ref) { int cmp = @ref._id - _id; if (cmp < 0) { if (_idPreceding != null) { _idPreceding = _idPreceding.Id_remove(@ref); } } else { if (cmp > 0) { if (_idSubsequent != null) { _idSubsequent = _idSubsequent.Id_remove(@ref); } } else { if (this == @ref) { return Id_remove(); } return this; } } Id_calculateSize(); return this; } private Db4objects.Db4o.Internal.ObjectReference Id_remove() { if (_idSubsequent != null && _idPreceding != null) { _idSubsequent = _idSubsequent.Id_rotateSmallestUp(); _idSubsequent._idPreceding = _idPreceding; _idSubsequent.Id_calculateSize(); return _idSubsequent; } if (_idSubsequent != null) { return _idSubsequent; } return _idPreceding; } public override string ToString() { try { int id = GetID(); string str = "ObjectReference\nID=" + id; object obj = GetObject(); if (obj == null && _class != null) { ObjectContainerBase container = _class.Container(); if (container != null && id > 0) { obj = container.PeekPersisted(container.Transaction, id, container.DefaultActivationDepth (ClassMetadata()), true).ToString(); } } if (obj == null) { str += "\nfor [null]"; } else { string objToString = string.Empty; try { objToString = obj.ToString(); } catch (Exception) { } if (ClassMetadata() != null) { IReflectClass claxx = ClassMetadata().Reflector().ForObject(obj); str += "\n" + claxx.GetName(); } str += "\n" + objToString; } return str; } catch (Exception) { } return "ObjectReference " + GetID(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ILinkLengthAware.cs0000644000175000017500000000025711700531646030346 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal { public interface ILinkLengthAware { int LinkLength(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IPersistent.cs0000644000175000017500000000060011700531646027457 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public interface IPersistent { byte GetIdentifier(); int OwnLength(); void ReadThis(Transaction trans, ByteArrayBuffer reader); void WriteThis(Transaction trans, ByteArrayBuffer writer); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/SerializedGraph.cs0000644000175000017500000000165611700531646030277 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public class SerializedGraph { public readonly int _id; public readonly byte[] _bytes; public SerializedGraph(int id, byte[] bytes) { _id = id; _bytes = bytes; } public virtual int Length() { return _bytes.Length; } public virtual int MarshalledLength() { return (Const4.IntLength * 2) + Length(); } public virtual void Write(ByteArrayBuffer buffer) { buffer.WriteInt(_id); buffer.WriteInt(Length()); buffer.Append(_bytes); } public static Db4objects.Db4o.Internal.SerializedGraph Read(ByteArrayBuffer buffer ) { int id = buffer.ReadInt(); int length = buffer.ReadInt(); return new Db4objects.Db4o.Internal.SerializedGraph(id, buffer.ReadBytes(length)); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ObjectContainerFactory.cs0000644000175000017500000000170711700531646031620 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Config; namespace Db4objects.Db4o.Internal { public class ObjectContainerFactory { /// public static IEmbeddedObjectContainer OpenObjectContainer(IEmbeddedConfiguration config, string databaseFileName) { IConfiguration legacyConfig = Db4oLegacyConfigurationBridge.AsLegacy(config); Config4Impl.AssertIsNotTainted(legacyConfig); EmitDebugInfo(); IEmbeddedObjectContainer oc = new IoAdaptedObjectContainer(legacyConfig, databaseFileName ); ((EmbeddedConfigurationImpl)config).ApplyConfigurationItems(oc); Db4objects.Db4o.Internal.Messages.LogMsg(legacyConfig, 5, databaseFileName); return oc; } private static void EmitDebugInfo() { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/WriteUpdateProcessor.cs0000644000175000017500000000507311700531646031354 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal { /// internal class WriteUpdateProcessor { private readonly LocalTransaction _transaction; private readonly int _id; private readonly ClassMetadata _clazz; private readonly ArrayType _typeInfo; private int _cascade = 0; public WriteUpdateProcessor(LocalTransaction transaction, int id, ClassMetadata clazz , ArrayType typeInfo) { _transaction = transaction; _id = id; _clazz = clazz; _typeInfo = typeInfo; } public virtual void Run() { _transaction.CheckSynchronization(); if (DTrace.enabled) { DTrace.WriteUpdateAdjustIndexes.Log(_id); } if (AlreadyHandled()) { return; } // TODO: Try to get rid of getting the slot here because it // will invoke reading a pointer from the file system. // It may be possible to figure out the readd case // by asking the IdSystem in a smarter way. Slot slot = _transaction.IdSystem().CurrentSlot(_id); if (HandledAsReAdd(slot)) { return; } if (_clazz.CanUpdateFast()) { return; } StatefulBuffer objectBytes = Container().ReadStatefulBufferBySlot(_transaction, _id , slot); DeleteMembers(objectBytes); } private LocalObjectContainer Container() { return _transaction.LocalContainer(); } private void DeleteMembers(StatefulBuffer objectBytes) { ObjectHeader oh = new ObjectHeader(_clazz, objectBytes); DeleteInfo info = (DeleteInfo)TreeInt.Find(_transaction._delete, _id); if (info != null) { if (info._cascade > _cascade) { _cascade = info._cascade; } } objectBytes.SetCascadeDeletes(_cascade); DeleteContextImpl context = new DeleteContextImpl(objectBytes, oh, _clazz.ClassReflector (), null); _clazz.DeleteMembers(context, _typeInfo, true); } private bool HandledAsReAdd(Slot slot) { if (!Slot.IsNull(slot)) { return false; } _clazz.AddToIndex(_transaction, _id); return true; } private bool AlreadyHandled() { TreeInt newNode = new TreeInt(_id); _transaction._writtenUpdateAdjustedIndexes = Tree.Add(_transaction._writtenUpdateAdjustedIndexes , newNode); return !newNode.WasAddedToTree(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ObjectContainerSession.cs0000644000175000017500000003372711700531646031643 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Callbacks; using Db4objects.Db4o.Internal.Events; using Db4objects.Db4o.Internal.Qlin; using Db4objects.Db4o.Internal.Query; using Db4objects.Db4o.Qlin; using Db4objects.Db4o.Query; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; using Db4objects.Db4o.Types; namespace Db4objects.Db4o.Internal { /// public partial class ObjectContainerSession : IInternalObjectContainer, ITransientClass , IObjectContainerSpec { protected readonly ObjectContainerBase _server; protected readonly Db4objects.Db4o.Internal.Transaction _transaction; private bool _closed = false; public ObjectContainerSession(ObjectContainerBase server, Db4objects.Db4o.Internal.Transaction trans) { _server = server; _transaction = trans; } public ObjectContainerSession(ObjectContainerBase server) : this(server, server.NewUserTransaction ()) { _transaction.SetOutSideRepresentation(this); } /// /// /// /// public virtual void Backup(string path) { throw new NotSupportedException(); } /// /// /// public virtual void Backup(IStorage storage, string path) { throw new NotSupportedException(); } /// /// public virtual void Bind(object obj, long id) { _server.Bind(_transaction, obj, id); } public virtual Config4Impl ConfigImpl { get { // internal interface method doesn't need to lock return _server.ConfigImpl; } } public virtual IConfiguration Configure() { // FIXME: Consider throwing NotSupportedException here. // throw new NotSupportedException(); lock (Lock()) { CheckClosed(); return _server.Configure(); } } public virtual object Descend(object obj, string[] path) { lock (Lock()) { CheckClosed(); return _server.Descend(_transaction, obj, path); } } private void CheckClosed() { if (IsClosed()) { throw new DatabaseClosedException(); } } /// /// public virtual object GetByID(long id) { lock (Lock()) { CheckClosed(); return _server.GetByID(_transaction, id); } } /// /// public virtual object GetByUUID(Db4oUUID uuid) { lock (Lock()) { CheckClosed(); return _server.GetByUUID(_transaction, uuid); } } public virtual long GetID(object obj) { lock (Lock()) { CheckClosed(); return _server.GetID(_transaction, obj); } } public virtual IObjectInfo GetObjectInfo(object obj) { lock (Lock()) { CheckClosed(); return _server.GetObjectInfo(_transaction, obj); } } // TODO: Db4oDatabase is shared between embedded clients. // This should work, since there is an automatic bind // replacement. Replication test cases will tell. public virtual Db4oDatabase Identity() { lock (Lock()) { CheckClosed(); return _server.Identity(); } } public virtual bool IsActive(object obj) { lock (Lock()) { CheckClosed(); return _server.IsActive(_transaction, obj); } } public virtual bool IsCached(long id) { lock (Lock()) { CheckClosed(); return _server.IsCached(_transaction, id); } } public virtual bool IsClosed() { lock (Lock()) { return _closed == true; } } /// public virtual bool IsStored(object obj) { lock (Lock()) { CheckClosed(); return _server.IsStored(_transaction, obj); } } public virtual IReflectClass[] KnownClasses() { lock (Lock()) { CheckClosed(); return _server.KnownClasses(); } } public virtual object Lock() { return _server.Lock(); } public virtual object PeekPersisted(object @object, int depth, bool committed) { lock (Lock()) { CheckClosed(); return _server.PeekPersisted(_transaction, @object, ActivationDepthProvider().ActivationDepth (depth, ActivationMode.Peek), committed); } } public virtual void Purge() { lock (Lock()) { CheckClosed(); _server.Purge(); } } public virtual void Purge(object obj) { lock (Lock()) { CheckClosed(); _server.Purge(_transaction, obj); } } public virtual GenericReflector Reflector() { lock (Lock()) { CheckClosed(); return _server.Reflector(); } } public virtual void Refresh(object obj, int depth) { lock (Lock()) { CheckClosed(); _server.Refresh(_transaction, obj, depth); } } public virtual void ReleaseSemaphore(string name) { CheckClosed(); _server.ReleaseSemaphore(_transaction, name); } public virtual void Store(object obj, int depth) { lock (Lock()) { CheckClosed(); _server.Store(_transaction, obj, (depth == Const4.Unspecified ? (IUpdateDepth)UpdateDepthProvider ().Unspecified(NullModifiedObjectQuery.Instance) : (IUpdateDepth)UpdateDepthProvider ().ForDepth(depth))); } } public virtual bool SetSemaphore(string name, int waitForAvailability) { CheckClosed(); return _server.SetSemaphore(_transaction, name, waitForAvailability); } public virtual IStoredClass StoredClass(object clazz) { lock (Lock()) { CheckClosed(); return _server.StoredClass(_transaction, clazz); } } public virtual IStoredClass[] StoredClasses() { lock (Lock()) { CheckClosed(); return _server.StoredClasses(_transaction); } } public virtual ISystemInfo SystemInfo() { lock (Lock()) { CheckClosed(); return _server.SystemInfo(); } } public virtual long Version() { lock (Lock()) { CheckClosed(); return _server.Version(); } } /// /// public virtual void Activate(object obj) { lock (Lock()) { CheckClosed(); _server.Activate(_transaction, obj); } } /// /// public virtual void Activate(object obj, int depth) { lock (Lock()) { CheckClosed(); _server.Activate(_transaction, obj, ActivationDepthProvider().ActivationDepth(depth , ActivationMode.Activate)); } } private IActivationDepthProvider ActivationDepthProvider() { return _server.ActivationDepthProvider(); } /// public virtual bool Close() { lock (Lock()) { if (IsClosed()) { return false; } if (!_server.IsClosed()) { if (!_server.ConfigImpl.IsReadOnly()) { Commit(); } } _server.Callbacks().CloseOnStarted(this); _server.CloseTransaction(_transaction, false, false); _closed = true; return true; } } /// /// /// /// public virtual void Commit() { lock (Lock()) { CheckClosed(); _server.Commit(_transaction); } } /// public virtual void Deactivate(object obj, int depth) { lock (Lock()) { CheckClosed(); _server.Deactivate(_transaction, obj, depth); } } /// public virtual void Deactivate(object obj) { Deactivate(obj, 1); } /// /// /// public virtual void Delete(object obj) { lock (Lock()) { CheckClosed(); _server.Delete(_transaction, obj); } } public virtual IExtObjectContainer Ext() { return (IExtObjectContainer)this; } /// /// public virtual IObjectSet QueryByExample(object template) { lock (Lock()) { CheckClosed(); return _server.QueryByExample(_transaction, template); } } /// public virtual IQuery Query() { lock (Lock()) { CheckClosed(); return _server.Query(_transaction); } } /// /// public virtual IObjectSet Query(Type clazz) { lock (Lock()) { CheckClosed(); return _server.Query(_transaction, clazz); } } /// /// public virtual IObjectSet Query(Predicate predicate) { lock (Lock()) { CheckClosed(); return _server.Query(_transaction, predicate); } } /// /// public virtual IObjectSet Query(Predicate predicate, IQueryComparator comparator) { lock (Lock()) { CheckClosed(); return _server.Query(_transaction, predicate, comparator); } } /// /// /// public virtual void Rollback() { lock (Lock()) { CheckClosed(); _server.Rollback(_transaction); } } /// /// public virtual void Store(object obj) { lock (Lock()) { CheckClosed(); _server.Store(_transaction, obj); } } public virtual ObjectContainerBase Container { get { return _server; } } public virtual Db4objects.Db4o.Internal.Transaction Transaction { get { return _transaction; } } public virtual void Callbacks(ICallbacks cb) { lock (Lock()) { CheckClosed(); _server.Callbacks(cb); } } public virtual ICallbacks Callbacks() { lock (Lock()) { CheckClosed(); return _server.Callbacks(); } } public NativeQueryHandler GetNativeQueryHandler() { lock (Lock()) { CheckClosed(); return _server.GetNativeQueryHandler(); } } public virtual ClassMetadata ClassMetadataForReflectClass(IReflectClass reflectClass ) { return _server.ClassMetadataForReflectClass(reflectClass); } public virtual ClassMetadata ClassMetadataForName(string name) { return _server.ClassMetadataForName(name); } public virtual ClassMetadata ClassMetadataForID(int id) { return _server.ClassMetadataForID(id); } public virtual HandlerRegistry Handlers { get { return _server.Handlers; } } public virtual object SyncExec(IClosure4 block) { return _server.SyncExec(block); } public virtual int InstanceCount(ClassMetadata clazz, Db4objects.Db4o.Internal.Transaction trans) { return _server.InstanceCount(clazz, trans); } public virtual bool IsClient { get { return true; } } public virtual void StoreAll(Db4objects.Db4o.Internal.Transaction transaction, IEnumerator objects) { _server.StoreAll(transaction, objects); } public virtual IUpdateDepthProvider UpdateDepthProvider() { return ConfigImpl.UpdateDepthProvider(); } public virtual IObjectContainer OpenSession() { lock (Lock()) { return new Db4objects.Db4o.Internal.ObjectContainerSession(_server); } } public virtual EventRegistryImpl NewEventRegistry() { return new EventRegistryImpl(); } public virtual IQLin From(Type clazz) { return new QLinRoot(Query(), clazz); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/ClassAspect.cs0000644000175000017500000000400511700531646027416 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public abstract class ClassAspect { protected int _handle; private int _disabledFromAspectCountVersion = AspectVersionContextImpl.AlwaysEnabled .DeclaredAspectCount(); // used for identification when sending in C/S mode public abstract Db4objects.Db4o.Internal.Marshall.AspectType AspectType(); public abstract string GetName(); public abstract void CascadeActivation(IActivationContext context); public abstract int LinkLength(); public void IncrementOffset(IReadBuffer buffer) { buffer.Seek(buffer.Offset() + LinkLength()); } public abstract void DefragAspect(IDefragmentContext context); public abstract void Marshall(MarshallingContext context, object child); public abstract void CollectIDs(CollectIdContext context); public virtual void SetHandle(int handle) { _handle = handle; } public abstract void Activate(UnmarshallingContext context); public abstract void Delete(DeleteContextImpl context, bool isUpdate); public abstract bool CanBeDisabled(); protected virtual bool CheckEnabled(IAspectVersionContext context) { if (!IsEnabledOn(context)) { IncrementOffset((IReadBuffer)context); return false; } return true; } public virtual void DisableFromAspectCountVersion(int aspectCount) { if (!CanBeDisabled()) { return; } if (aspectCount < _disabledFromAspectCountVersion) { _disabledFromAspectCountVersion = aspectCount; } } public bool IsEnabledOn(IAspectVersionContext context) { return _disabledFromAspectCountVersion > context.DeclaredAspectCount(); } public abstract void Deactivate(IActivationContext context); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Callbacks/0000755000175000017500000000000011700531646026542 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Callbacks/ICallbacks.cs0000644000175000017500000000325311700531646031064 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Callbacks { public interface ICallbacks { bool ObjectCanNew(Transaction transaction, object obj); bool ObjectCanActivate(Transaction transaction, object obj); bool ObjectCanUpdate(Transaction transaction, IObjectInfo objectInfo); bool ObjectCanDelete(Transaction transaction, IObjectInfo objectInfo); bool ObjectCanDeactivate(Transaction transaction, IObjectInfo objectInfo); void ObjectOnActivate(Transaction transaction, IObjectInfo obj); void ObjectOnNew(Transaction transaction, IObjectInfo obj); void ObjectOnUpdate(Transaction transaction, IObjectInfo obj); void ObjectOnDelete(Transaction transaction, IObjectInfo obj); void ObjectOnDeactivate(Transaction transaction, IObjectInfo obj); void ObjectOnInstantiate(Transaction transaction, IObjectInfo obj); void QueryOnStarted(Transaction transaction, IQuery query); void QueryOnFinished(Transaction transaction, IQuery query); bool CaresAboutCommitting(); bool CaresAboutCommitted(); void ClassOnRegistered(ClassMetadata clazz); void CommitOnStarted(Transaction transaction, CallbackObjectInfoCollections objectInfoCollections ); void CommitOnCompleted(Transaction transaction, CallbackObjectInfoCollections objectInfoCollections , bool isOwnCommit); bool CaresAboutDeleting(); bool CaresAboutDeleted(); void OpenOnFinished(IObjectContainer container); void CloseOnStarted(IObjectContainer container); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Callbacks/NullCallbacks.cs0000644000175000017500000000463611700531646031614 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Callbacks; using Db4objects.Db4o.Query; namespace Db4objects.Db4o.Internal.Callbacks { public class NullCallbacks : ICallbacks { public virtual void QueryOnFinished(Transaction transaction, IQuery query) { } public virtual void QueryOnStarted(Transaction transaction, IQuery query) { } public virtual bool ObjectCanNew(Transaction transaction, object obj) { return true; } public virtual bool ObjectCanActivate(Transaction transaction, object obj) { return true; } public virtual bool ObjectCanUpdate(Transaction transaction, IObjectInfo objectInfo ) { return true; } public virtual bool ObjectCanDelete(Transaction transaction, IObjectInfo objectInfo ) { return true; } public virtual bool ObjectCanDeactivate(Transaction transaction, IObjectInfo objectInfo ) { return true; } public virtual void ObjectOnNew(Transaction transaction, IObjectInfo obj) { } public virtual void ObjectOnActivate(Transaction transaction, IObjectInfo obj) { } public virtual void ObjectOnUpdate(Transaction transaction, IObjectInfo obj) { } public virtual void ObjectOnDelete(Transaction transaction, IObjectInfo obj) { } public virtual void ObjectOnDeactivate(Transaction transaction, IObjectInfo obj) { } public virtual void ObjectOnInstantiate(Transaction transaction, IObjectInfo obj) { } public virtual void CommitOnStarted(Transaction transaction, CallbackObjectInfoCollections objectInfoCollections) { } public virtual void CommitOnCompleted(Transaction transaction, CallbackObjectInfoCollections objectInfoCollections, bool isOwnCommit) { } public virtual bool CaresAboutCommitting() { return false; } public virtual bool CaresAboutCommitted() { return false; } public virtual void ClassOnRegistered(ClassMetadata clazz) { } public virtual bool CaresAboutDeleting() { return false; } public virtual bool CaresAboutDeleted() { return false; } public virtual void CloseOnStarted(IObjectContainer container) { } public virtual void OpenOnFinished(IObjectContainer container) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Threading/0000755000175000017500000000000011700531646026570 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Threading/ThreadPool4Impl.cs0000644000175000017500000000545711700531646032101 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections.Generic; using Db4objects.Db4o.Internal.Threading; using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Threading { public class ThreadPool4Impl : IThreadPool4 { private System.EventHandler _uncaughtException; private readonly IList _activeThreads = new List(); /// public virtual void Join(int timeoutMilliseconds) { foreach (Thread thread in ActiveThreads()) { thread.Join(timeoutMilliseconds); } } public virtual void StartLowPriority(string taskName, IRunnable task) { Thread thread = ThreadFor(taskName, task); ActivateThread(thread); } public virtual void Start(string taskName, IRunnable task) { Thread thread = ThreadFor(taskName, task); ActivateThread(thread); } private Thread ThreadFor(string threadName, IRunnable task) { Thread thread = new Thread(new _IRunnable_41(this, task), threadName); thread.SetDaemon(true); return thread; } private sealed class _IRunnable_41 : IRunnable { public _IRunnable_41(ThreadPool4Impl _enclosing, IRunnable task) { this._enclosing = _enclosing; this.task = task; } public void Run() { try { task.Run(); } catch (Exception e) { this._enclosing.TriggerUncaughtExceptionEvent(e); } finally { this._enclosing.Dispose(Thread.CurrentThread()); } } private readonly ThreadPool4Impl _enclosing; private readonly IRunnable task; } private void ActivateThread(Thread thread) { AddActiveThread(thread); thread.Start(); } private Thread[] ActiveThreads() { lock (_activeThreads) { return Sharpen.Collections.ToArray(_activeThreads, new Thread[_activeThreads.Count ]); } } private void AddActiveThread(Thread thread) { lock (_activeThreads) { _activeThreads.Add(thread); } } protected virtual void Dispose(Thread thread) { lock (_activeThreads) { _activeThreads.Remove(thread); } } protected virtual void TriggerUncaughtExceptionEvent(Exception e) { if (null != _uncaughtException) _uncaughtException(null, new UncaughtExceptionEventArgs (e)); } public virtual event System.EventHandler UncaughtException { add { _uncaughtException = (System.EventHandler)System.Delegate.Combine (_uncaughtException, value); } remove { _uncaughtException = (System.EventHandler)System.Delegate.Remove (_uncaughtException, value); } } } } UncaughtExceptionEventArgs.cs0000644000175000017500000000065511700531646034322 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Threading/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Internal.Threading { public class UncaughtExceptionEventArgs : EventArgs { private System.Exception _exception; public UncaughtExceptionEventArgs(System.Exception e) { _exception = e; } public virtual System.Exception Exception { get { return _exception; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Threading/IThreadPool4.cs0000644000175000017500000000072211700531646031356 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Sharpen.Lang; namespace Db4objects.Db4o.Internal.Threading { public interface IThreadPool4 { void Start(string taskName, IRunnable task); void StartLowPriority(string taskName, IRunnable task); event System.EventHandler UncaughtException; /// void Join(int timeoutMilliseconds); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/PreparedArrayContainsComparison.cs0000644000175000017500000000346411700531646033514 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers.Array; using Db4objects.Db4o.Marshall; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public class PreparedArrayContainsComparison : IPreparedComparison { private readonly ArrayHandler _arrayHandler; private readonly IPreparedComparison _preparedComparison; private ObjectContainerBase _container; public PreparedArrayContainsComparison(IContext context, ArrayHandler arrayHandler , ITypeHandler4 typeHandler, object obj) { _arrayHandler = arrayHandler; _preparedComparison = Handlers4.PrepareComparisonFor(typeHandler, context, obj); _container = context.Transaction().Container(); } public virtual int CompareTo(object obj) { // We never expect this call // TODO: The callers of this class should be refactored to pass a matcher and // to expect a PreparedArrayComparison. throw new InvalidOperationException(); } public virtual bool IsEqual(object array) { return IsMatch(array, IntMatcher.Zero); } public virtual bool IsGreaterThan(object array) { return IsMatch(array, IntMatcher.Positive); } public virtual bool IsSmallerThan(object array) { return IsMatch(array, IntMatcher.Negative); } private bool IsMatch(object array, IntMatcher matcher) { if (array == null) { return false; } IEnumerator i = _arrayHandler.AllElements(_container, array); while (i.MoveNext()) { if (matcher.Match(_preparedComparison.CompareTo(i.Current))) { return true; } } return false; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IQueryResultIteratorFactory.cs0000644000175000017500000000045011700531646032670 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Internal.Query.Result; namespace Db4objects.Db4o.Internal { public interface IQueryResultIteratorFactory { IEnumerator NewInstance(AbstractQueryResult result); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/0000755000175000017500000000000011700531646025724 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeNode.cs0000644000175000017500000010100611700531646030060 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Marshall; using Sharpen; namespace Db4objects.Db4o.Internal.Btree { /// /// We work with BTreeNode in two states: /// - deactivated: never read, no valid members, ID correct or 0 if new /// - write: real representation of keys, values and children in arrays /// The write state can be detected with canWrite(). /// /// /// We work with BTreeNode in two states: /// - deactivated: never read, no valid members, ID correct or 0 if new /// - write: real representation of keys, values and children in arrays /// The write state can be detected with canWrite(). States can be changed /// as needed with prepareRead() and prepareWrite(). /// /// public sealed class BTreeNode : LocalPersistentBase { private const int CountLeafAnd3LinkLength = (Const4.IntLength * 4) + 1; private const int SlotLeadingLength = Const4.LeadingLength + CountLeafAnd3LinkLength; internal readonly BTree _btree; private int _count; private bool _isLeaf; private object[] _keys; /// Can contain BTreeNode or Integer for ID of BTreeNode private object[] _children; private int _parentID; private int _previousID; private int _nextID; private bool _dead; public BTreeNode(BTree btree, int count, bool isLeaf, int parentID, int previousID , int nextID) { _btree = btree; _parentID = parentID; _previousID = previousID; _nextID = nextID; _count = count; _isLeaf = isLeaf; PrepareArrays(); } public BTreeNode(int id, BTree btree) { _btree = btree; SetID(id); SetStateDeactivated(); } public BTreeNode(Transaction trans, Db4objects.Db4o.Internal.Btree.BTreeNode firstChild , Db4objects.Db4o.Internal.Btree.BTreeNode secondChild) : this(firstChild._btree , 2, false, 0, 0, 0) { _keys[0] = firstChild._keys[0]; _children[0] = firstChild; _keys[1] = secondChild._keys[0]; _children[1] = secondChild; Write(trans.SystemTransaction()); firstChild.SetParentID(trans, GetID()); secondChild.SetParentID(trans, GetID()); } public BTree Btree() { return _btree; } /// /// the split node if this node is split /// or this if the first key has changed /// public Db4objects.Db4o.Internal.Btree.BTreeNode Add(Transaction trans, IPreparedComparison preparedComparison, object obj) { ByteArrayBuffer reader = PrepareRead(trans); Searcher s = Search(trans, preparedComparison, reader); if (_isLeaf) { PrepareWrite(trans); SetStateDirty(); if (WasRemoved(trans, s)) { CancelRemoval(trans, obj, s.Cursor()); return null; } if (s.Count() > 0 && !s.BeforeFirst()) { s.MoveForward(); } PrepareInsert(s.Cursor()); _keys[s.Cursor()] = ApplyNewAddPatch(trans, obj); } else { Db4objects.Db4o.Internal.Btree.BTreeNode childNode = Child(reader, s.Cursor()); Db4objects.Db4o.Internal.Btree.BTreeNode childNodeOrSplit = childNode.Add(trans, preparedComparison, obj); if (childNodeOrSplit == null) { return null; } PrepareWrite(trans); SetStateDirty(); _keys[s.Cursor()] = childNode._keys[0]; if (childNode != childNodeOrSplit) { int splitCursor = s.Cursor() + 1; PrepareInsert(splitCursor); _keys[splitCursor] = childNodeOrSplit._keys[0]; _children[splitCursor] = childNodeOrSplit; } } if (MustSplit()) { return Split(trans); } if (s.Cursor() == 0) { return this; } return null; } private bool MustSplit() { return _count >= _btree.NodeSize(); } private BTreeAdd ApplyNewAddPatch(Transaction trans, object obj) { SizeIncrement(trans); return new BTreeAdd(trans, obj); } private void CancelRemoval(Transaction trans, object obj, int index) { BTreeUpdate patch = (BTreeUpdate)KeyPatch(index); BTreeUpdate nextPatch = patch.RemoveFor(trans); _keys[index] = NewCancelledRemoval(trans, patch.GetObject(), obj, nextPatch); SizeIncrement(trans); } private BTreePatch NewCancelledRemoval(Transaction trans, object originalObject, object currentObject, BTreeUpdate existingPatches) { return new BTreeCancelledRemoval(trans, originalObject, currentObject, existingPatches ); } private void SizeIncrement(Transaction trans) { _btree.SizeChanged(trans, this, 1); } private bool WasRemoved(Transaction trans, Searcher s) { if (!s.FoundMatch()) { return false; } BTreePatch patch = KeyPatch(trans, s.Cursor()); return patch != null && patch.IsRemove(); } internal BTreeNodeSearchResult SearchLeaf(Transaction trans, IPreparedComparison preparedComparison, SearchTarget target) { ByteArrayBuffer reader = PrepareRead(trans); Searcher s = Search(trans, preparedComparison, reader, target); if (!_isLeaf) { return Child(reader, s.Cursor()).SearchLeaf(trans, preparedComparison, target); } if (!s.FoundMatch() || target == SearchTarget.Any || target == SearchTarget.Highest) { return new BTreeNodeSearchResult(trans, reader, Btree(), s, this); } if (target == SearchTarget.Lowest) { BTreeNodeSearchResult res = FindLowestLeafMatch(trans, preparedComparison, s.Cursor () - 1); if (res != null) { return res; } return CreateMatchingSearchResult(trans, reader, s.Cursor()); } throw new InvalidOperationException(); } private BTreeNodeSearchResult FindLowestLeafMatch(Transaction trans, IPreparedComparison preparedComparison, int index) { return FindLowestLeafMatch(trans, preparedComparison, PrepareRead(trans), index); } private BTreeNodeSearchResult FindLowestLeafMatch(Transaction trans, IPreparedComparison preparedComparison, ByteArrayBuffer reader, int index) { if (index >= 0) { if (!CompareEquals(preparedComparison, trans, reader, index)) { return null; } if (index > 0) { BTreeNodeSearchResult res = FindLowestLeafMatch(trans, preparedComparison, reader , index - 1); if (res != null) { return res; } return CreateMatchingSearchResult(trans, reader, index); } } Db4objects.Db4o.Internal.Btree.BTreeNode node = PreviousNode(); if (node != null) { ByteArrayBuffer nodeReader = node.PrepareRead(trans); BTreeNodeSearchResult res = node.FindLowestLeafMatch(trans, preparedComparison, nodeReader , node.LastIndex()); if (res != null) { return res; } } if (index < 0) { return null; } return CreateMatchingSearchResult(trans, reader, index); } private bool CompareEquals(IPreparedComparison preparedComparison, Transaction trans , ByteArrayBuffer reader, int index) { if (CanWrite()) { return CompareInWriteMode(preparedComparison, index) == 0; } return CompareInReadMode(trans, preparedComparison, reader, index) == 0; } private BTreeNodeSearchResult CreateMatchingSearchResult(Transaction trans, ByteArrayBuffer reader, int index) { return new BTreeNodeSearchResult(trans, reader, Btree(), this, index, true); } public bool CanWrite() { return _keys != null; } internal Db4objects.Db4o.Internal.Btree.BTreeNode Child(int index) { if (_children[index] is Db4objects.Db4o.Internal.Btree.BTreeNode) { return (Db4objects.Db4o.Internal.Btree.BTreeNode)_children[index]; } return ProduceChild(index, ((int)_children[index])); } internal Db4objects.Db4o.Internal.Btree.BTreeNode Child(ByteArrayBuffer reader, int index) { if (ChildLoaded(index)) { return (Db4objects.Db4o.Internal.Btree.BTreeNode)_children[index]; } return ProduceChild(index, ChildID(reader, index)); } private Db4objects.Db4o.Internal.Btree.BTreeNode ProduceChild(int index, int childID ) { Db4objects.Db4o.Internal.Btree.BTreeNode child = _btree.ProduceNode(childID); if (_children != null) { _children[index] = child; } return child; } private int ChildID(ByteArrayBuffer reader, int index) { if (_children == null) { SeekChild(reader, index); return reader.ReadInt(); } return ChildID(index); } private int ChildID(int index) { if (ChildLoaded(index)) { return ((Db4objects.Db4o.Internal.Btree.BTreeNode)_children[index]).GetID(); } return ((int)_children[index]); } private bool ChildLoaded(int index) { if (_children == null) { return false; } return _children[index] is Db4objects.Db4o.Internal.Btree.BTreeNode; } private bool ChildCanSupplyFirstKey(int index) { if (!ChildLoaded(index)) { return false; } return ((Db4objects.Db4o.Internal.Btree.BTreeNode)_children[index]).CanWrite(); } public void Commit(Transaction trans) { CommitOrRollback(trans, true); } internal void CommitOrRollback(Transaction trans, bool isCommit) { if (DTrace.enabled) { DTrace.BtreeNodeCommitOrRollback.Log(GetID()); } if (_dead) { return; } if (!_isLeaf) { return; } if (!IsDirty(trans)) { return; } object keyZero = _keys[0]; object[] tempKeys = new object[_btree.NodeSize()]; int count = 0; for (int i = 0; i < _count; i++) { object key = _keys[i]; BTreePatch patch = KeyPatch(i); if (patch != null) { key = isCommit ? patch.Commit(trans, _btree, this) : patch.Rollback(trans, _btree ); } if (key != No4.Instance) { tempKeys[count] = key; count++; } } _keys = tempKeys; _count = count; if (FreeIfEmpty(trans)) { return; } SetStateDirty(); // TODO: Merge nodes here on low _count value. if (_keys[0] != keyZero) { TellParentAboutChangedKey(trans); } } private bool FreeIfEmpty(Transaction trans) { return FreeIfEmpty(trans, _count); } private bool FreeIfEmpty(Transaction trans, int count) { if (count > 0) { return false; } if (IsRoot()) { return false; } Free((LocalTransaction)trans); return true; } private bool IsRoot() { return _btree.Root() == this; } public override bool Equals(object obj) { if (this == obj) { return true; } if (!(obj is Db4objects.Db4o.Internal.Btree.BTreeNode)) { return false; } Db4objects.Db4o.Internal.Btree.BTreeNode other = (Db4objects.Db4o.Internal.Btree.BTreeNode )obj; return GetID() == other.GetID(); } public override int GetHashCode() { return GetID(); } public override void Free(LocalTransaction trans) { _dead = true; if (!IsRoot()) { Db4objects.Db4o.Internal.Btree.BTreeNode parent = _btree.ProduceNode(_parentID); parent.RemoveChild(trans, this); } PointPreviousTo(trans, _nextID); PointNextTo(trans, _previousID); base.Free((LocalTransaction)trans); _btree.RemoveNode(this); _btree.NotifyDeleted(trans, this); } internal void HoldChildrenAsIDs() { if (_children == null) { return; } for (int i = 0; i < _count; i++) { if (_children[i] is Db4objects.Db4o.Internal.Btree.BTreeNode) { _children[i] = ((Db4objects.Db4o.Internal.Btree.BTreeNode)_children[i]).GetID(); } } } private void RemoveChild(Transaction trans, Db4objects.Db4o.Internal.Btree.BTreeNode child) { PrepareWrite(trans); SetStateDirty(); int id = child.GetID(); for (int i = 0; i < _count; i++) { if (ChildID(i) == id) { if (FreeIfEmpty(trans, _count - 1)) { return; } Remove(i); if (i < 1) { TellParentAboutChangedKey(trans); } if (_count == 0) { // root node empty case only, have to turn it into a leaf _isLeaf = true; } return; } } throw new InvalidOperationException("child not found"); } private void KeyChanged(Transaction trans, Db4objects.Db4o.Internal.Btree.BTreeNode child) { PrepareWrite(trans); SetStateDirty(); int id = child.GetID(); for (int i = 0; i < _count; i++) { if (ChildID(i) == id) { _keys[i] = child._keys[0]; _children[i] = child; KeyChanged(trans, i); return; } } throw new InvalidOperationException("child not found"); } private void TellParentAboutChangedKey(Transaction trans) { if (!IsRoot()) { Db4objects.Db4o.Internal.Btree.BTreeNode parent = _btree.ProduceNode(_parentID); parent.KeyChanged(trans, this); } } private bool IsDirty(Transaction trans) { if (!CanWrite()) { return false; } for (int i = 0; i < _count; i++) { if (KeyPatch(trans, i) != null) { return true; } } return false; } private int CompareInWriteMode(IPreparedComparison preparedComparison, int index) { return -preparedComparison.CompareTo(Key(index)); } private int CompareInReadMode(Transaction trans, IPreparedComparison preparedComparison , ByteArrayBuffer reader, int index) { SeekKey(reader, index); return -preparedComparison.CompareTo(KeyHandler().ReadIndexEntry(trans.Context(), reader)); } public int Count() { return _count; } private int EntryLength() { int len = KeyHandler().LinkLength(); if (!_isLeaf) { len += Const4.IdLength; } return len; } public int FirstKeyIndex(Transaction trans) { for (int ix = 0; ix < _count; ix++) { if (IndexIsValid(trans, ix)) { return ix; } } return -1; } public int LastKeyIndex(Transaction trans) { for (int ix = _count - 1; ix >= 0; ix--) { if (IndexIsValid(trans, ix)) { return ix; } } return -1; } public bool IndexIsValid(Transaction trans, int index) { if (!CanWrite()) { return true; } BTreePatch patch = KeyPatch(index); if (patch == null) { return true; } return patch.Key(trans) != No4.Instance; } private object FirstKey(Transaction trans) { int index = FirstKeyIndex(trans); if (-1 == index) { return No4.Instance; } return InternalKey(trans, index); } public override byte GetIdentifier() { return Const4.BtreeNode; } private void PrepareInsert(int pos) { if (pos > LastIndex()) { _count++; return; } int len = _count - pos; System.Array.Copy(_keys, pos, _keys, pos + 1, len); if (_children != null) { System.Array.Copy(_children, pos, _children, pos + 1, len); } _count++; } private void Remove(int pos) { if (DTrace.enabled) { DTrace.BtreeNodeRemove.Log(GetID()); } int len = _count - pos; _count--; System.Array.Copy(_keys, pos + 1, _keys, pos, len); _keys[_count] = null; if (_children != null) { System.Array.Copy(_children, pos + 1, _children, pos, len); _children[_count] = null; } } internal object Key(int index) { object obj = _keys[index]; if (obj is BTreePatch) { return ((BTreePatch)obj).GetObject(); } return obj; } public object Key(Transaction trans, int index) { return Key(trans, PrepareRead(trans), index); } internal object Key(Transaction trans, ByteArrayBuffer reader, int index) { if (CanWrite()) { return InternalKey(trans, index); } if (reader == null) { reader = PrepareRead(trans); } if (CanWrite()) { return InternalKey(trans, index); } SeekKey(reader, index); return KeyHandler().ReadIndexEntry(trans.Context(), reader); } private object InternalKey(Transaction trans, int index) { BTreePatch patch = KeyPatch(index); if (patch == null) { return _keys[index]; } return patch.Key(trans); } private BTreePatch KeyPatch(int index) { object obj = _keys[index]; if (obj is BTreePatch) { return (BTreePatch)obj; } return null; } internal BTreePatch KeyPatch(Transaction trans, int index) { object obj = _keys[index]; if (obj is BTreePatch) { return ((BTreePatch)obj).ForTransaction(trans); } return null; } private IIndexable4 KeyHandler() { return _btree.KeyHandler(); } public override int OwnLength() { return SlotLeadingLength + (_count * EntryLength()) + Const4.BracketsBytes; } internal ByteArrayBuffer PrepareRead(Transaction trans) { BTreeNodeCacheEntry cacheEntry = Btree().CacheEntry(this); if (CanWrite()) { return null; } if (IsNew()) { return null; } Transaction systemTransaction = trans.SystemTransaction(); ByteArrayBuffer buffer = cacheEntry.Buffer(); if (buffer != null) { // Cache hit, still unread buffer.Seek(0); Read(systemTransaction, buffer); cacheEntry.Buffer(null); _btree.AddToProcessing(this); return null; } buffer = ProduceReadBuffer(systemTransaction); ReadNodeHeader(buffer); cacheEntry.Buffer(buffer); return buffer; } internal void PrepareWrite(Transaction trans) { if (_dead) { return; } BTreeNodeCacheEntry cacheEntry = Btree().CacheEntry(this); if (CanWrite()) { return; } ByteArrayBuffer buffer = cacheEntry.Buffer(); if (buffer != null) { buffer.Seek(0); Read(trans.SystemTransaction(), buffer); cacheEntry.Buffer(null); } else { Read(trans.SystemTransaction()); } _btree.AddToProcessing(this); } private void PrepareArrays() { if (CanWrite()) { return; } _keys = new object[_btree.NodeSize()]; if (!_isLeaf) { _children = new object[_btree.NodeSize()]; } } private void ReadNodeHeader(ByteArrayBuffer reader) { _count = reader.ReadInt(); byte leafByte = reader.ReadByte(); _isLeaf = (leafByte == 1); _parentID = reader.ReadInt(); _previousID = reader.ReadInt(); _nextID = reader.ReadInt(); } public override void ReadThis(Transaction trans, ByteArrayBuffer reader) { ReadNodeHeader(reader); PrepareArrays(); bool isInner = !_isLeaf; for (int i = 0; i < _count; i++) { _keys[i] = KeyHandler().ReadIndexEntry(trans.Context(), reader); if (isInner) { _children[i] = reader.ReadInt(); } } } public void Remove(Transaction trans, int index) { if (!_isLeaf) { throw new InvalidOperationException(); } PrepareWrite(trans); SetStateDirty(); object obj = null; BTreePatch patch = KeyPatch(index); if (patch == null) { obj = _keys[index]; } else { BTreePatch transPatch = patch.ForTransaction(trans); if (transPatch != null) { obj = transPatch.GetObject(); } else { // There could be more than one patch with different object // identities. We have no means to determine a "best" object // so we just take any one. Could be problematic. obj = patch.GetObject(); } } Remove(trans, obj, index); } public bool Remove(Transaction trans, object obj, int index) { if (!_isLeaf) { throw new InvalidOperationException(); } PrepareWrite(trans); SetStateDirty(); BTreePatch patch = KeyPatch(index); // no patch, no problem, can remove if (patch == null) { _keys[index] = ApplyNewRemovePatch(trans, obj); KeyChanged(trans, index); return true; } BTreePatch transPatch = patch.ForTransaction(trans); if (transPatch != null) { if (transPatch.IsAdd()) { CancelAdding(trans, index); return true; } if (transPatch.IsCancelledRemoval()) { BTreeRemove removePatch = ApplyNewRemovePatch(trans, transPatch.GetObject()); _keys[index] = ((BTreeUpdate)patch).ReplacePatch(transPatch, removePatch); KeyChanged(trans, index); return true; } } else { // If the patch is a removal of a cancelled removal for another // transaction, we need one for this transaction also. if (!patch.IsAdd()) { ((BTreeUpdate)patch).Append(ApplyNewRemovePatch(trans, obj)); return true; } } return false; } public void Remove(Transaction trans, IPreparedComparison preparedComparison, object obj, int index) { if (Remove(trans, obj, index)) { return; } // now we try if removal is OK for the next element in this node if (index != LastIndex()) { if (CompareInWriteMode(preparedComparison, index + 1) != 0) { return; } Remove(trans, preparedComparison, obj, index + 1); return; } // nothing else worked so far, move on to the next node, try there Db4objects.Db4o.Internal.Btree.BTreeNode node = NextNode(); if (node == null) { return; } node.PrepareWrite(trans); if (node.CompareInWriteMode(preparedComparison, 0) != 0) { return; } node.Remove(trans, preparedComparison, obj, 0); } private void CancelAdding(Transaction trans, int index) { _btree.NotifyRemoveListener(new TransactionContext(trans, KeyPatch(index).GetObject ())); if (FreeIfEmpty(trans, _count - 1)) { SizeDecrement(trans); return; } Remove(index); KeyChanged(trans, index); SizeDecrement(trans); } private void SizeDecrement(Transaction trans) { _btree.SizeChanged(trans, this, -1); } private int LastIndex() { return _count - 1; } private BTreeRemove ApplyNewRemovePatch(Transaction trans, object key) { SizeDecrement(trans); return new BTreeRemove(trans, key); } private void KeyChanged(Transaction trans, int index) { if (index == 0) { TellParentAboutChangedKey(trans); } } internal void Rollback(Transaction trans) { CommitOrRollback(trans, false); } private Searcher Search(Transaction trans, IPreparedComparison preparedComparison , ByteArrayBuffer reader) { return Search(trans, preparedComparison, reader, SearchTarget.Any); } private Searcher Search(Transaction trans, IPreparedComparison preparedComparison , ByteArrayBuffer reader, SearchTarget target) { Searcher s = new Searcher(target, _count); if (CanWrite()) { while (s.Incomplete()) { s.ResultIs(CompareInWriteMode(preparedComparison, s.Cursor())); } } else { while (s.Incomplete()) { s.ResultIs(CompareInReadMode(trans, preparedComparison, reader, s.Cursor())); } } return s; } private void SeekAfterKey(ByteArrayBuffer reader, int ix) { SeekKey(reader, ix); reader._offset += KeyHandler().LinkLength(); } private void SeekChild(ByteArrayBuffer reader, int ix) { SeekAfterKey(reader, ix); } private void SeekKey(ByteArrayBuffer reader, int ix) { reader._offset = SlotLeadingLength + (EntryLength() * ix); } private Db4objects.Db4o.Internal.Btree.BTreeNode Split(Transaction trans) { Db4objects.Db4o.Internal.Btree.BTreeNode res = new Db4objects.Db4o.Internal.Btree.BTreeNode (_btree, _btree._halfNodeSize, _isLeaf, _parentID, GetID(), _nextID); System.Array.Copy(_keys, _btree._halfNodeSize, res._keys, 0, _btree._halfNodeSize ); for (int i = _btree._halfNodeSize; i < _keys.Length; i++) { _keys[i] = null; } if (_children != null) { res._children = new object[_btree.NodeSize()]; System.Array.Copy(_children, _btree._halfNodeSize, res._children, 0, _btree._halfNodeSize ); for (int i = _btree._halfNodeSize; i < _children.Length; i++) { _children[i] = null; } } _count = _btree._halfNodeSize; res.Write(trans.SystemTransaction()); _btree.AddNode(res); int splitID = res.GetID(); PointNextTo(trans, splitID); SetNextID(trans, splitID); if (_children != null) { for (int i = 0; i < _btree._halfNodeSize; i++) { if (res._children[i] == null) { break; } res.Child(i).SetParentID(trans, splitID); } } _btree.NotifySplit(trans, this, res); return res; } private void PointNextTo(Transaction trans, int id) { if (_nextID != 0) { NextNode().SetPreviousID(trans, id); } } private void PointPreviousTo(Transaction trans, int id) { if (_previousID != 0) { PreviousNode().SetNextID(trans, id); } } public Db4objects.Db4o.Internal.Btree.BTreeNode PreviousNode() { if (_previousID == 0) { return null; } return _btree.ProduceNode(_previousID); } public Db4objects.Db4o.Internal.Btree.BTreeNode NextNode() { if (_nextID == 0) { return null; } return _btree.ProduceNode(_nextID); } internal BTreePointer FirstPointer(Transaction trans) { ByteArrayBuffer reader = PrepareRead(trans); if (_isLeaf) { return LeafFirstPointer(trans, reader); } return BranchFirstPointer(trans, reader); } private BTreePointer BranchFirstPointer(Transaction trans, ByteArrayBuffer reader ) { for (int i = 0; i < _count; i++) { BTreePointer childFirstPointer = Child(reader, i).FirstPointer(trans); if (childFirstPointer != null) { return childFirstPointer; } } return null; } private BTreePointer LeafFirstPointer(Transaction trans, ByteArrayBuffer reader) { int index = FirstKeyIndex(trans); if (index == -1) { return null; } return new BTreePointer(trans, reader, this, index); } public BTreePointer LastPointer(Transaction trans) { ByteArrayBuffer reader = PrepareRead(trans); if (_isLeaf) { return LeafLastPointer(trans, reader); } return BranchLastPointer(trans, reader); } private BTreePointer BranchLastPointer(Transaction trans, ByteArrayBuffer reader) { for (int i = _count - 1; i >= 0; i--) { BTreePointer childLastPointer = Child(reader, i).LastPointer(trans); if (childLastPointer != null) { return childLastPointer; } } return null; } private BTreePointer LeafLastPointer(Transaction trans, ByteArrayBuffer reader) { int index = LastKeyIndex(trans); if (index == -1) { return null; } return new BTreePointer(trans, reader, this, index); } public void Purge() { if (_dead) { _keys = null; _children = null; return; } if (!IsPatched()) { return; } HoldChildrenAsIDs(); _btree.AddNode(this); } private bool IsPatched() { if (_dead) { return false; } if (!CanWrite()) { return false; } for (int i = 0; i < _count; i++) { if (_keys[i] is BTreePatch) { return true; } } return false; } private void SetParentID(Transaction trans, int id) { PrepareWrite(trans); SetStateDirty(); _parentID = id; } private void SetPreviousID(Transaction trans, int id) { PrepareWrite(trans); SetStateDirty(); _previousID = id; } private void SetNextID(Transaction trans, int id) { PrepareWrite(trans); SetStateDirty(); _nextID = id; } public void TraverseKeys(Transaction trans, IVisitor4 visitor) { ByteArrayBuffer reader = PrepareRead(trans); if (_isLeaf) { for (int i = 0; i < _count; i++) { object obj = Key(trans, reader, i); if (obj != No4.Instance) { visitor.Visit(obj); } } } else { for (int i = 0; i < _count; i++) { Child(reader, i).TraverseKeys(trans, visitor); } } } public override bool WriteObjectBegin() { if (_dead) { return false; } if (!CanWrite()) { return false; } return base.WriteObjectBegin(); } public override void WriteThis(Transaction trans, ByteArrayBuffer buffer) { int count = 0; int startOffset = buffer._offset; IContext context = trans.Context(); buffer.IncrementOffset(CountLeafAnd3LinkLength); if (_isLeaf) { for (int i = 0; i < _count; i++) { object obj = InternalKey(trans, i); if (obj != No4.Instance) { count++; KeyHandler().WriteIndexEntry(context, buffer, obj); } } } else { for (int i = 0; i < _count; i++) { if (ChildCanSupplyFirstKey(i)) { Db4objects.Db4o.Internal.Btree.BTreeNode child = (Db4objects.Db4o.Internal.Btree.BTreeNode )_children[i]; object childKey = child.FirstKey(trans); if (childKey != No4.Instance) { count++; KeyHandler().WriteIndexEntry(context, buffer, childKey); buffer.WriteIDOf(trans, child); } } else { count++; KeyHandler().WriteIndexEntry(context, buffer, Key(i)); buffer.WriteIDOf(trans, _children[i]); } } } int endOffset = buffer._offset; buffer._offset = startOffset; buffer.WriteInt(count); buffer.WriteByte(_isLeaf ? (byte)1 : (byte)0); buffer.WriteInt(_parentID); buffer.WriteInt(_previousID); buffer.WriteInt(_nextID); buffer._offset = endOffset; } public override string ToString() { if (_count == 0) { return "Node " + GetID() + " not loaded"; } string str = "\nBTreeNode"; str += "\nid: " + GetID(); str += "\nparent: " + _parentID; str += "\nprevious: " + _previousID; str += "\nnext: " + _nextID; str += "\ncount:" + _count; str += "\nleaf:" + _isLeaf + "\n"; if (CanWrite()) { str += " { "; bool first = true; for (int i = 0; i < _count; i++) { if (_keys[i] != null) { if (!first) { str += ", "; } str += _keys[i].ToString(); first = false; } } str += " }"; } return str; } public void DebugLoadFully(Transaction trans) { PrepareWrite(trans); if (_isLeaf) { return; } for (int i = 0; i < _count; ++i) { if (_children[i] is int) { _children[i] = Btree().ProduceNode(((int)_children[i])); } ((Db4objects.Db4o.Internal.Btree.BTreeNode)_children[i]).DebugLoadFully(trans); } } public static void DefragIndex(DefragmentContextImpl context, IIndexable4 keyHandler ) { // count int count = context.ReadInt(); // leafByte byte leafByte = context.ReadByte(); bool isLeaf = (leafByte == 1); context.CopyID(); // parent ID context.CopyID(); // previous ID context.CopyID(); // next ID for (int i = 0; i < count; i++) { keyHandler.DefragIndexEntry(context); if (!isLeaf) { context.CopyID(); } } } public bool IsLeaf() { return _isLeaf; } /// This traversal goes over all nodes, not just leafs internal void TraverseAllNodes(Transaction trans, IVisitor4 command) { ByteArrayBuffer reader = PrepareRead(trans); command.Visit(this); if (_isLeaf) { return; } for (int childIdx = 0; childIdx < _count; childIdx++) { Child(reader, childIdx).TraverseAllNodes(trans, command); } } public int Size(Transaction trans) { PrepareRead(trans); if (!CanWrite()) { return _count; } int size = 0; for (int i = 0; i < _count; i++) { BTreePatch keyPatch = KeyPatch(i); if (keyPatch != null) { size += keyPatch.SizeDiff(trans); } else { size++; } } return size; } public override Db4objects.Db4o.Internal.Slots.SlotChangeFactory SlotChangeFactory () { return _btree.SlotChangeFactory(); } public override ITransactionalIdSystem IdSystem(Transaction trans) { return _btree.IdSystem(trans); } public void ToReadMode() { if (IsNew()) { return; } if (!CanWrite()) { return; } if (IsDirty()) { return; } if (IsPatched()) { return; } _keys = null; _children = null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeNodeSearchResult.cs0000644000175000017500000000443511700531646032415 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { /// public class BTreeNodeSearchResult { private readonly Transaction _transaction; private readonly BTree _btree; private readonly BTreePointer _pointer; private readonly bool _foundMatch; internal BTreeNodeSearchResult(Transaction transaction, BTree btree, BTreePointer pointer, bool foundMatch) { if (null == transaction || null == btree) { throw new ArgumentNullException(); } _transaction = transaction; _btree = btree; _pointer = pointer; _foundMatch = foundMatch; } internal BTreeNodeSearchResult(Transaction trans, ByteArrayBuffer nodeReader, BTree btree, BTreeNode node, int cursor, bool foundMatch) : this(trans, btree, PointerOrNull (trans, nodeReader, node, cursor), foundMatch) { } internal BTreeNodeSearchResult(Transaction trans, ByteArrayBuffer nodeReader, BTree btree, Searcher searcher, BTreeNode node) : this(trans, btree, NextPointerIf(PointerOrNull (trans, nodeReader, node, searcher.Cursor()), searcher.IsGreater()), searcher.FoundMatch ()) { } private static BTreePointer NextPointerIf(BTreePointer pointer, bool condition) { if (null == pointer) { return null; } if (condition) { return pointer.Next(); } return pointer; } private static BTreePointer PointerOrNull(Transaction trans, ByteArrayBuffer nodeReader , BTreeNode node, int cursor) { return node == null ? null : new BTreePointer(trans, nodeReader, node, cursor); } public virtual IBTreeRange CreateIncludingRange(Db4objects.Db4o.Internal.Btree.BTreeNodeSearchResult end) { BTreePointer firstPointer = FirstValidPointer(); BTreePointer endPointer = end._foundMatch ? end._pointer.Next() : end.FirstValidPointer (); return new BTreeRangeSingle(_transaction, _btree, firstPointer, endPointer); } public virtual BTreePointer FirstValidPointer() { if (null == _pointer) { return null; } if (_pointer.IsValid()) { return _pointer; } return _pointer.Next(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeRangeUnion.cs0000644000175000017500000000664111700531646031251 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Btree.Algebra; namespace Db4objects.Db4o.Internal.Btree { public class BTreeRangeUnion : IBTreeRange { private readonly BTreeRangeSingle[] _ranges; public BTreeRangeUnion(BTreeRangeSingle[] ranges) : this(ToSortedCollection(ranges )) { } public BTreeRangeUnion(SortedCollection4 sorted) { if (null == sorted) { throw new ArgumentNullException(); } _ranges = ToArray(sorted); } public virtual void Accept(IBTreeRangeVisitor visitor) { visitor.Visit(this); } public virtual bool IsEmpty() { for (int i = 0; i < _ranges.Length; i++) { if (!_ranges[i].IsEmpty()) { return false; } } return true; } private static SortedCollection4 ToSortedCollection(BTreeRangeSingle[] ranges) { if (null == ranges) { throw new ArgumentNullException(); } SortedCollection4 collection = new SortedCollection4(BTreeRangeSingle.Comparison); for (int i = 0; i < ranges.Length; i++) { BTreeRangeSingle range = ranges[i]; if (!range.IsEmpty()) { collection.Add(range); } } return collection; } private static BTreeRangeSingle[] ToArray(SortedCollection4 collection) { return (BTreeRangeSingle[])collection.ToArray(new BTreeRangeSingle[collection.Size ()]); } public virtual IBTreeRange ExtendToFirst() { throw new NotImplementedException(); } public virtual IBTreeRange ExtendToLast() { throw new NotImplementedException(); } public virtual IBTreeRange ExtendToLastOf(IBTreeRange upperRange) { throw new NotImplementedException(); } public virtual IBTreeRange Greater() { throw new NotImplementedException(); } public virtual IBTreeRange Intersect(IBTreeRange range) { if (null == range) { throw new ArgumentNullException(); } return new BTreeRangeUnionIntersect(this).Dispatch(range); } public virtual IEnumerator Pointers() { return Iterators.Concat(Iterators.Map(_ranges, new _IFunction4_77())); } private sealed class _IFunction4_77 : IFunction4 { public _IFunction4_77() { } public object Apply(object range) { return ((IBTreeRange)range).Pointers(); } } public virtual IEnumerator Keys() { return Iterators.Concat(Iterators.Map(_ranges, new _IFunction4_85())); } private sealed class _IFunction4_85 : IFunction4 { public _IFunction4_85() { } public object Apply(object range) { return ((IBTreeRange)range).Keys(); } } public virtual int Size() { int size = 0; for (int i = 0; i < _ranges.Length; i++) { size += _ranges[i].Size(); } return size; } public virtual IBTreeRange Smaller() { throw new NotImplementedException(); } public virtual IBTreeRange Union(IBTreeRange other) { if (null == other) { throw new ArgumentNullException(); } return new BTreeRangeUnionUnion(this).Dispatch(other); } public virtual IEnumerator Ranges() { return new ArrayIterator4(_ranges); } public virtual BTreePointer LastPointer() { throw new NotImplementedException(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeRangeKeyIterator.cs0000644000175000017500000000063711700531646032422 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { internal class BTreeRangeKeyIterator : AbstractBTreeRangeIterator { public BTreeRangeKeyIterator(BTreeRangeSingle range) : base(range) { } public override object Current { get { return CurrentPointer().Key(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeRemove.cs0000644000175000017500000000204411700531646030432 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { /// public class BTreeRemove : BTreeUpdate { public BTreeRemove(Transaction transaction, object obj) : base(transaction, obj) { } protected override void Committed(BTree btree) { btree.NotifyRemoveListener(new TransactionContext(_transaction, GetObject())); } public override string ToString() { return "(-) " + base.ToString(); } public override bool IsRemove() { return true; } protected override object GetCommittedObject() { return No4.Instance; } protected override void AdjustSizeOnRemovalByOtherTransaction(BTree btree, BTreeNode node) { // The size was reduced for this entry, let's change back. btree.SizeChanged(_transaction, node, +1); } protected override int SizeDiff() { return 0; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeRangePointerIterator.cs0000644000175000017500000000063711700531646033312 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { public class BTreeRangePointerIterator : AbstractBTreeRangeIterator { public BTreeRangePointerIterator(BTreeRangeSingle range) : base(range) { } public override object Current { get { return CurrentPointer(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/IBTreeRange.cs0000644000175000017500000000164511700531646030350 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { public interface IBTreeRange { /// /// Iterates through all the valid pointers in /// this range. /// /// /// Iterates through all the valid pointers in /// this range. /// /// an Iterator4 over BTreePointer value IEnumerator Pointers(); IEnumerator Keys(); int Size(); IBTreeRange Greater(); IBTreeRange Union(IBTreeRange other); IBTreeRange ExtendToLast(); IBTreeRange Smaller(); IBTreeRange ExtendToFirst(); IBTreeRange Intersect(IBTreeRange range); IBTreeRange ExtendToLastOf(IBTreeRange upperRange); bool IsEmpty(); void Accept(IBTreeRangeVisitor visitor); BTreePointer LastPointer(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTree.cs0000644000175000017500000005350511700531646027264 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Text; using Db4objects.Db4o; using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Caching; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Btree { /// public class BTree : LocalPersistentBase, ITransactionParticipant, IBTreeStructureListener { private readonly BTreeConfiguration _config; private const byte BtreeVersion = (byte)1; private const int DefragmentIncrementOffset = 1 + Const4.IntLength * 2; private readonly IIndexable4 _keyHandler; private BTreeNode _root; /// All instantiated nodes are held in this tree. /// All instantiated nodes are held in this tree. private TreeIntObject _nodes; private int _size; private IVisitor4 _removeListener; private sealed class _TransactionLocal_40 : TransactionLocal { public _TransactionLocal_40() { } // version byte // size, node size public override object InitialValueFor(Transaction transaction) { return 0; } } private readonly TransactionLocal _sizeDeltaInTransaction = new _TransactionLocal_40 (); protected IQueue4 _processing; private int _nodeSize; internal int _halfNodeSize; private IBTreeStructureListener _structureListener; private readonly ICache4 _nodeCache; private TreeIntObject _evictedFromCache; private bool _disposed; public BTree(Transaction trans, BTreeConfiguration config, int id, IIndexable4 keyHandler , int treeNodeSize) : base(config._idSystem) { _config = config; if (null == keyHandler) { throw new ArgumentNullException(); } _nodeSize = treeNodeSize; _nodeCache = CacheFactory.NewLRUIntCache(config._cacheSize); _halfNodeSize = _nodeSize / 2; _nodeSize = _halfNodeSize * 2; _keyHandler = keyHandler; SetID(id); if (IsNew()) { SetStateDirty(); _root = new BTreeNode(this, 0, true, 0, 0, 0); _root.Write(trans.SystemTransaction()); AddNode(_root); Write(trans.SystemTransaction()); } else { SetStateDeactivated(); } } public BTree(Transaction trans, BTreeConfiguration config, IIndexable4 keyHandler ) : this(trans, config, 0, keyHandler) { } public BTree(Transaction trans, BTreeConfiguration config, int id, IIndexable4 keyHandler ) : this(trans, config, id, keyHandler, Config(trans).BTreeNodeSize()) { } public BTree(Transaction trans, int id, IIndexable4 keyHandler) : this(trans, BTreeConfiguration .Default, id, keyHandler) { } public BTree(Transaction trans, int id, IIndexable4 keyHandler, int nodeSize) : this (trans, BTreeConfiguration.Default, id, keyHandler, nodeSize) { } public virtual BTreeNode Root() { return _root; } public virtual int NodeSize() { return _nodeSize; } public virtual void Add(Transaction trans, object key) { KeyCantBeNull(key); IPreparedComparison preparedComparison = _keyHandler.PrepareComparison(trans.Context (), key); Add(trans, preparedComparison, key); } public virtual void Add(Transaction trans, IPreparedComparison preparedComparison , object key) { EnsureActive(trans); Enlist(trans); BTreeNode rootOrSplit = _root.Add(trans, preparedComparison, key); if (rootOrSplit != null && rootOrSplit != _root) { EnsureDirty(trans); _root = new BTreeNode(trans, _root, rootOrSplit); _root.Write(trans.SystemTransaction()); AddNode(_root); } ConvertCacheEvictedNodesToReadMode(); } public virtual object Remove(Transaction trans, object key) { BTreePointer bTreePointer = SearchPointer(trans, key); if (bTreePointer == null) { return null; } object result = bTreePointer.Key(); Enlist(trans); IPreparedComparison preparedComparison = KeyHandler().PrepareComparison(trans.Context (), key); BTreeNode node = bTreePointer.Node(); node.Remove(trans, preparedComparison, key, bTreePointer.Index()); ConvertCacheEvictedNodesToReadMode(); return result; } public virtual IBTreeRange SearchRange(Transaction trans, object key) { KeyCantBeNull(key); return SearchRange(trans, KeyHandler().PrepareComparison(trans.Context(), key)); } public virtual BTreePointer SearchPointer(Transaction trans, object key) { EnsureActive(trans); KeyCantBeNull(key); IPreparedComparison preparedComparison = KeyHandler().PrepareComparison(trans.Context (), key); BTreeNodeSearchResult start = SearchLeaf(trans, preparedComparison, SearchTarget. Lowest); BTreePointer bTreePointer = start.FirstValidPointer(); if (bTreePointer == null) { ConvertCacheEvictedNodesToReadMode(); return null; } object found = bTreePointer.Key(); ConvertCacheEvictedNodesToReadMode(); if (preparedComparison.CompareTo(found) == 0) { return bTreePointer; } return null; } public virtual object Search(Transaction trans, object key) { BTreePointer bTreePointer = SearchPointer(trans, key); if (bTreePointer != null) { return bTreePointer.Key(); } return null; } private IBTreeRange SearchRange(Transaction trans, IPreparedComparison preparedComparison ) { EnsureActive(trans); // TODO: Optimize the following. // Part of the search operates against the same nodes. // As long as the bounds are on one node, the search // should walk the nodes in one go. BTreeNodeSearchResult start = SearchLeaf(trans, preparedComparison, SearchTarget. Lowest); BTreeNodeSearchResult end = SearchLeaf(trans, preparedComparison, SearchTarget.Highest ); IBTreeRange range = start.CreateIncludingRange(end); ConvertCacheEvictedNodesToReadMode(); return range; } private void KeyCantBeNull(object key) { if (null == key) { throw new ArgumentNullException(); } } public virtual IIndexable4 KeyHandler() { return _keyHandler; } public virtual BTreeNodeSearchResult SearchLeaf(Transaction trans, object key, SearchTarget target) { return SearchLeaf(trans, _keyHandler.PrepareComparison(trans.Context(), key), target ); } public virtual BTreeNodeSearchResult SearchLeaf(Transaction trans, IPreparedComparison preparedComparison, SearchTarget target) { EnsureActive(trans); BTreeNodeSearchResult result = _root.SearchLeaf(trans, preparedComparison, target ); ConvertCacheEvictedNodesToReadMode(); return result; } public virtual void Commit(Transaction transaction) { if (_disposed) { return; } UpdateSize(transaction); CommitNodes(transaction); FinishTransaction(transaction); ConvertCacheEvictedNodesToReadMode(); } private void UpdateSize(Transaction transaction) { ByRef sizeInTransaction = SizeIn(transaction); int sizeModification = (((int)sizeInTransaction.value)); if (sizeModification == 0) { return; } EnsureDirty(transaction); _size += sizeModification; sizeInTransaction.value = 0; } private ByRef SizeIn(Transaction trans) { return trans.Get(_sizeDeltaInTransaction); } private void CommitNodes(Transaction trans) { ProcessEachNode(new _IProcedure4_237(trans)); } private sealed class _IProcedure4_237 : IProcedure4 { public _IProcedure4_237(Transaction trans) { this.trans = trans; } public void Apply(object node) { ((BTreeNode)node).Commit(trans); } private readonly Transaction trans; } private void ProcessEachNode(IProcedure4 action) { if (_nodes == null) { return; } ProcessAllNodes(); while (_processing.HasNext()) { action.Apply((BTreeNode)_processing.Next()); } _processing = null; } public virtual void Rollback(Transaction trans) { RollbackNodes(trans); FinishTransaction(trans); ConvertCacheEvictedNodesToReadMode(); } private void FinishTransaction(Transaction trans) { Transaction systemTransaction = trans.SystemTransaction(); WriteAllNodes(systemTransaction); Write(systemTransaction); Purge(); } private void RollbackNodes(Transaction trans) { ProcessEachNode(new _IProcedure4_266(trans)); } private sealed class _IProcedure4_266 : IProcedure4 { public _IProcedure4_266(Transaction trans) { this.trans = trans; } public void Apply(object node) { ((BTreeNode)node).Rollback(trans); } private readonly Transaction trans; } private void WriteAllNodes(Transaction systemTransaction) { if (_nodes == null) { return; } _nodes.Traverse(new _IVisitor4_275(systemTransaction)); } private sealed class _IVisitor4_275 : IVisitor4 { public _IVisitor4_275(Transaction systemTransaction) { this.systemTransaction = systemTransaction; } public void Visit(object obj) { ((BTreeNode)((TreeIntObject)obj).GetObject()).Write(systemTransaction); } private readonly Transaction systemTransaction; } private void Purge() { if (_nodes == null) { return; } Tree temp = _nodes; _nodes = null; _root.HoldChildrenAsIDs(); AddNode(_root); temp.Traverse(new _IVisitor4_294()); for (IEnumerator entryIter = _nodeCache.GetEnumerator(); entryIter.MoveNext(); ) { BTreeNodeCacheEntry entry = ((BTreeNodeCacheEntry)entryIter.Current); entry._node.HoldChildrenAsIDs(); } } private sealed class _IVisitor4_294 : IVisitor4 { public _IVisitor4_294() { } public void Visit(object obj) { BTreeNode node = (BTreeNode)((TreeIntObject)obj).GetObject(); node.Purge(); } } private void ProcessAllNodes() { _processing = new NonblockingQueue(); _nodes.Traverse(new _IVisitor4_311(this)); } private sealed class _IVisitor4_311 : IVisitor4 { public _IVisitor4_311(BTree _enclosing) { this._enclosing = _enclosing; } public void Visit(object node) { this._enclosing._processing.Add(((TreeIntObject)node).GetObject()); } private readonly BTree _enclosing; } private void EnsureActive(Transaction trans) { if (!IsActive()) { Read(trans.SystemTransaction()); } } private void EnsureDirty(Transaction trans) { EnsureActive(trans); Enlist(trans); SetStateDirty(); } private void Enlist(Transaction trans) { if (CanEnlistWithTransaction()) { ((LocalTransaction)trans).Enlist(this); } } protected virtual bool CanEnlistWithTransaction() { return _config._canEnlistWithTransaction; } public override byte GetIdentifier() { return Const4.Btree; } public virtual void SetRemoveListener(IVisitor4 vis) { _removeListener = vis; } public override int OwnLength() { return 1 + Const4.ObjectLength + (Const4.IntLength * 2) + Const4.IdLength; } public virtual BTreeNode ProduceNode(int id) { if (DTrace.enabled) { DTrace.BtreeProduceNode.Log(id); } TreeIntObject addtio = new TreeIntObject(id); _nodes = (TreeIntObject)((TreeIntObject)Tree.Add(_nodes, addtio)); TreeIntObject tio = (TreeIntObject)addtio.AddedOrExisting(); BTreeNode node = (BTreeNode)tio.GetObject(); if (node == null) { node = CacheEntry(new BTreeNode(id, this))._node; tio.SetObject(node); AddToProcessing(node); } return node; } internal virtual void AddNode(BTreeNode node) { _nodes = (TreeIntObject)((TreeIntObject)Tree.Add(_nodes, new TreeIntObject(node.GetID (), node))); AddToProcessing(node); } internal virtual void AddToProcessing(BTreeNode node) { if (_processing != null) { _processing.Add(node); } } internal virtual void RemoveNode(BTreeNode node) { _nodes = (TreeIntObject)((TreeInt)_nodes.RemoveLike(new TreeInt(node.GetID()))); } internal virtual void NotifyRemoveListener(object obj) { if (_removeListener != null) { _removeListener.Visit(obj); } } public override void ReadThis(Transaction a_trans, ByteArrayBuffer a_reader) { a_reader.IncrementOffset(1); // first byte is version, for possible future format changes _size = a_reader.ReadInt(); _nodeSize = a_reader.ReadInt(); _halfNodeSize = NodeSize() / 2; _root = ProduceNode(a_reader.ReadInt()); } public override void WriteThis(Transaction trans, ByteArrayBuffer a_writer) { a_writer.WriteByte(BtreeVersion); a_writer.WriteInt(_size); a_writer.WriteInt(NodeSize()); a_writer.WriteIDOf(trans, _root); } public virtual int Size(Transaction trans) { // This implementation of size will not work accurately for multiple // transactions. If two transactions call clear and both commit, _size // can end up negative. // For multiple transactions the size patches only are an estimate. EnsureActive(trans); return _size + (((int)SizeIn(trans).value)); } public virtual void TraverseKeys(Transaction trans, IVisitor4 visitor) { EnsureActive(trans); if (_root == null) { return; } _root.TraverseKeys(trans, visitor); ConvertCacheEvictedNodesToReadMode(); } public virtual void SizeChanged(Transaction transaction, BTreeNode node, int changeBy ) { NotifyCountChanged(transaction, node, changeBy); ByRef sizeInTransaction = SizeIn(transaction); sizeInTransaction.value = (((int)sizeInTransaction.value)) + changeBy; } public virtual void Dispose(Transaction transaction) { } public virtual BTreePointer FirstPointer(Transaction trans) { EnsureActive(trans); if (null == _root) { return null; } BTreePointer pointer = _root.FirstPointer(trans); ConvertCacheEvictedNodesToReadMode(); return pointer; } public virtual BTreePointer LastPointer(Transaction trans) { EnsureActive(trans); if (null == _root) { return null; } BTreePointer pointer = _root.LastPointer(trans); ConvertCacheEvictedNodesToReadMode(); return pointer; } public virtual Db4objects.Db4o.Internal.Btree.BTree DebugLoadFully(Transaction trans ) { EnsureActive(trans); _root.DebugLoadFully(trans); return this; } private void TraverseAllNodes(Transaction trans, IVisitor4 command) { EnsureActive(trans); _root.TraverseAllNodes(trans, command); } public virtual void DefragIndex(DefragmentContextImpl context) { context.IncrementOffset(DefragmentIncrementOffset); context.CopyID(); } public virtual void DefragIndexNode(DefragmentContextImpl context) { BTreeNode.DefragIndex(context, _keyHandler); } public virtual void DefragBTree(IDefragmentServices services) { DefragmentContextImpl.ProcessCopy(services, GetID(), new _ISlotCopyHandler_481(this )); services.TraverseAllIndexSlots(this, new _IVisitor4_486(this, services)); ConvertCacheEvictedNodesToReadMode(); } private sealed class _ISlotCopyHandler_481 : ISlotCopyHandler { public _ISlotCopyHandler_481(BTree _enclosing) { this._enclosing = _enclosing; } public void ProcessCopy(DefragmentContextImpl context) { this._enclosing.DefragIndex(context); } private readonly BTree _enclosing; } private sealed class _IVisitor4_486 : IVisitor4 { public _IVisitor4_486(BTree _enclosing, IDefragmentServices services) { this._enclosing = _enclosing; this.services = services; } public void Visit(object obj) { int id = ((int)obj); DefragmentContextImpl.ProcessCopy(services, id, new _ISlotCopyHandler_489(this)); } private sealed class _ISlotCopyHandler_489 : ISlotCopyHandler { public _ISlotCopyHandler_489(_IVisitor4_486 _enclosing) { this._enclosing = _enclosing; } public void ProcessCopy(DefragmentContextImpl context) { this._enclosing._enclosing.DefragIndexNode(context); } private readonly _IVisitor4_486 _enclosing; } private readonly BTree _enclosing; private readonly IDefragmentServices services; } internal virtual int CompareKeys(IContext context, object key1, object key2) { IPreparedComparison preparedComparison = _keyHandler.PrepareComparison(context, key1 ); return preparedComparison.CompareTo(key2); } private static Config4Impl Config(Transaction trans) { if (null == trans) { throw new ArgumentNullException(); } return trans.Container().ConfigImpl; } public override void Free(LocalTransaction systemTrans) { _disposed = true; FreeAllNodeIds(systemTrans, AllNodeIds(systemTrans)); base.Free((LocalTransaction)systemTrans); } private void FreeAllNodeIds(LocalTransaction systemTrans, IEnumerator allNodeIDs) { ITransactionalIdSystem idSystem = IdSystem(systemTrans); while (allNodeIDs.MoveNext()) { int id = ((int)allNodeIDs.Current); idSystem.NotifySlotDeleted(id, SlotChangeFactory()); } } public virtual IEnumerator AllNodeIds(Transaction systemTrans) { Collection4 allNodeIDs = new Collection4(); TraverseAllNodes(systemTrans, new _IVisitor4_527(allNodeIDs)); return allNodeIDs.GetEnumerator(); } private sealed class _IVisitor4_527 : IVisitor4 { public _IVisitor4_527(Collection4 allNodeIDs) { this.allNodeIDs = allNodeIDs; } public void Visit(object node) { allNodeIDs.Add(((BTreeNode)node).GetID()); } private readonly Collection4 allNodeIDs; } public virtual IBTreeRange AsRange(Transaction trans) { return new BTreeRangeSingle(trans, this, FirstPointer(trans), null); } private void TraverseAllNodes(IVisitor4 visitor) { if (_nodes == null) { return; } _nodes.Traverse(new _IVisitor4_543(visitor)); } private sealed class _IVisitor4_543 : IVisitor4 { public _IVisitor4_543(IVisitor4 visitor) { this.visitor = visitor; } public void Visit(object obj) { visitor.Visit(((TreeIntObject)obj).GetObject()); } private readonly IVisitor4 visitor; } public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("BTree "); sb.Append(GetID()); sb.Append(" Active Nodes: \n"); TraverseAllNodes(new _IVisitor4_555(sb)); return sb.ToString(); } private sealed class _IVisitor4_555 : IVisitor4 { public _IVisitor4_555(StringBuilder sb) { this.sb = sb; } public void Visit(object obj) { sb.Append(obj); sb.Append("\n"); } private readonly StringBuilder sb; } public virtual void StructureListener(IBTreeStructureListener listener) { _structureListener = listener; } public virtual void NotifySplit(Transaction trans, BTreeNode originalNode, BTreeNode newRightNode) { if (_structureListener != null) { _structureListener.NotifySplit(trans, originalNode, newRightNode); } } public virtual void NotifyDeleted(Transaction trans, BTreeNode node) { if (_structureListener != null) { _structureListener.NotifyDeleted(trans, node); } } public virtual void NotifyCountChanged(Transaction trans, BTreeNode node, int diff ) { if (_structureListener != null) { _structureListener.NotifyCountChanged(trans, node, diff); } } public virtual IEnumerator Iterator(Transaction trans) { return new BTreeIterator(trans, this); } public virtual void Clear(Transaction transaction) { BTreePointer currentPointer = FirstPointer(transaction); while (currentPointer != null && currentPointer.IsValid()) { BTreeNode node = currentPointer.Node(); int index = currentPointer.Index(); node.Remove(transaction, index); currentPointer = currentPointer.Next(); } } public virtual ICache4 NodeCache() { return _nodeCache; } internal virtual BTreeNodeCacheEntry CacheEntry(BTreeNode node) { return ((BTreeNodeCacheEntry)_nodeCache.Produce(node.GetID(), new _IFunction4_605 (node), new _IProcedure4_609(this))); } private sealed class _IFunction4_605 : IFunction4 { public _IFunction4_605(BTreeNode node) { this.node = node; } public object Apply(object id) { return new BTreeNodeCacheEntry(node); } private readonly BTreeNode node; } private sealed class _IProcedure4_609 : IProcedure4 { public _IProcedure4_609(BTree _enclosing) { this._enclosing = _enclosing; } public void Apply(object entry) { this._enclosing.EvictedFromCache(((BTreeNodeCacheEntry)entry)._node); } private readonly BTree _enclosing; } public override Db4objects.Db4o.Internal.Slots.SlotChangeFactory SlotChangeFactory () { return _config._slotChangeFactory; } public virtual void EvictedFromCache(BTreeNode node) { _evictedFromCache = ((TreeIntObject)Tree.Add(_evictedFromCache, new TreeIntObject (node.GetID(), node))); } public virtual void ConvertCacheEvictedNodesToReadMode() { if (_evictedFromCache == null) { return; } Tree.Traverse(_evictedFromCache, new _IVisitor4_628()); _evictedFromCache = null; } private sealed class _IVisitor4_628 : IVisitor4 { public _IVisitor4_628() { } public void Visit(object treeIntObject) { ((BTreeNode)((TreeIntObject)treeIntObject)._object).ToReadMode(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/Algebra/0000755000175000017500000000000011700531646027261 5ustar00meebeymeebey00000000000000BTreeRangeOperation.cs0000644000175000017500000000145011700531646033370 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/Algebra/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree.Algebra { /// public abstract class BTreeRangeOperation : IBTreeRangeVisitor { private IBTreeRange _resultingRange; public BTreeRangeOperation() : base() { } public virtual IBTreeRange Dispatch(IBTreeRange range) { range.Accept(this); return _resultingRange; } public void Visit(BTreeRangeSingle single) { _resultingRange = Execute(single); } public void Visit(BTreeRangeUnion union) { _resultingRange = Execute(union); } protected abstract IBTreeRange Execute(BTreeRangeUnion union); protected abstract IBTreeRange Execute(BTreeRangeSingle single); } } BTreeRangeSingleUnion.cs0000644000175000017500000000120411700531646033657 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/Algebra/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Btree.Algebra; namespace Db4objects.Db4o.Internal.Btree.Algebra { /// public class BTreeRangeSingleUnion : BTreeRangeSingleOperation { public BTreeRangeSingleUnion(BTreeRangeSingle single) : base(single) { } protected override IBTreeRange Execute(BTreeRangeSingle single) { return BTreeAlgebra.Union(_single, single); } protected override IBTreeRange Execute(BTreeRangeUnion union) { return BTreeAlgebra.Union(union, _single); } } } BTreeRangeSingleOperation.cs0000644000175000017500000000071511700531646034535 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/Algebra/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Btree.Algebra; namespace Db4objects.Db4o.Internal.Btree.Algebra { /// public abstract class BTreeRangeSingleOperation : BTreeRangeOperation { protected readonly BTreeRangeSingle _single; public BTreeRangeSingleOperation(BTreeRangeSingle single) { _single = single; } } } BTreeRangeSingleIntersect.cs0000644000175000017500000000122411700531646034531 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/Algebra/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Btree.Algebra; namespace Db4objects.Db4o.Internal.Btree.Algebra { /// public class BTreeRangeSingleIntersect : BTreeRangeSingleOperation { public BTreeRangeSingleIntersect(BTreeRangeSingle single) : base(single) { } protected override IBTreeRange Execute(BTreeRangeSingle single) { return BTreeAlgebra.Intersect(_single, single); } protected override IBTreeRange Execute(BTreeRangeUnion union) { return BTreeAlgebra.Intersect(union, _single); } } } BTreeRangeUnionIntersect.cs0000644000175000017500000000121211700531646034375 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/Algebra/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Btree.Algebra; namespace Db4objects.Db4o.Internal.Btree.Algebra { /// public class BTreeRangeUnionIntersect : BTreeRangeUnionOperation { public BTreeRangeUnionIntersect(BTreeRangeUnion union) : base(union) { } protected override IBTreeRange Execute(BTreeRangeSingle range) { return BTreeAlgebra.Intersect(_union, range); } protected override IBTreeRange Execute(BTreeRangeUnion union) { return BTreeAlgebra.Intersect(_union, union); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/Algebra/BTreeAlgebra.cs0000644000175000017500000000722311700531646032073 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree.Algebra { /// internal class BTreeAlgebra { public static IBTreeRange Intersect(BTreeRangeUnion union, BTreeRangeSingle single ) { SortedCollection4 collection = NewBTreeRangeSingleCollection(); CollectIntersections(collection, union, single); return ToRange(collection); } public static IBTreeRange Intersect(BTreeRangeUnion union1, BTreeRangeUnion union2 ) { SortedCollection4 collection = NewBTreeRangeSingleCollection(); IEnumerator ranges = union1.Ranges(); while (ranges.MoveNext()) { BTreeRangeSingle current = (BTreeRangeSingle)ranges.Current; CollectIntersections(collection, union2, current); } return ToRange(collection); } private static void CollectIntersections(SortedCollection4 collection, BTreeRangeUnion union, BTreeRangeSingle single) { IEnumerator ranges = union.Ranges(); while (ranges.MoveNext()) { BTreeRangeSingle current = (BTreeRangeSingle)ranges.Current; if (single.Overlaps(current)) { collection.Add(single.Intersect(current)); } } } public static IBTreeRange Intersect(BTreeRangeSingle single1, BTreeRangeSingle single2 ) { BTreePointer first = BTreePointer.Max(single1.First(), single2.First()); BTreePointer end = BTreePointer.Min(single1.End(), single2.End()); return single1.NewBTreeRangeSingle(first, end); } public static IBTreeRange Union(BTreeRangeUnion union1, BTreeRangeUnion union2) { IEnumerator ranges = union1.Ranges(); IBTreeRange merged = union2; while (ranges.MoveNext()) { merged = merged.Union((IBTreeRange)ranges.Current); } return merged; } public static IBTreeRange Union(BTreeRangeUnion union, BTreeRangeSingle single) { if (single.IsEmpty()) { return union; } SortedCollection4 sorted = NewBTreeRangeSingleCollection(); sorted.Add(single); BTreeRangeSingle range = single; IEnumerator ranges = union.Ranges(); while (ranges.MoveNext()) { BTreeRangeSingle current = (BTreeRangeSingle)ranges.Current; if (CanBeMerged(current, range)) { sorted.Remove(range); range = Merge(current, range); sorted.Add(range); } else { sorted.Add(current); } } return ToRange(sorted); } private static IBTreeRange ToRange(SortedCollection4 sorted) { if (1 == sorted.Size()) { return (IBTreeRange)sorted.SingleElement(); } return new BTreeRangeUnion(sorted); } private static SortedCollection4 NewBTreeRangeSingleCollection() { return new SortedCollection4(BTreeRangeSingle.Comparison); } public static IBTreeRange Union(BTreeRangeSingle single1, BTreeRangeSingle single2 ) { if (single1.IsEmpty()) { return single2; } if (single2.IsEmpty()) { return single1; } if (CanBeMerged(single1, single2)) { return Merge(single1, single2); } return new BTreeRangeUnion(new BTreeRangeSingle[] { single1, single2 }); } private static BTreeRangeSingle Merge(BTreeRangeSingle range1, BTreeRangeSingle range2 ) { return range1.NewBTreeRangeSingle(BTreePointer.Min(range1.First(), range2.First() ), BTreePointer.Max(range1.End(), range2.End())); } private static bool CanBeMerged(BTreeRangeSingle range1, BTreeRangeSingle range2) { return range1.Overlaps(range2) || range1.Adjacent(range2); } } } BTreeRangeUnionUnion.cs0000644000175000017500000000117411700531646033534 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/Algebra/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Btree.Algebra; namespace Db4objects.Db4o.Internal.Btree.Algebra { /// public class BTreeRangeUnionUnion : BTreeRangeUnionOperation { public BTreeRangeUnionUnion(BTreeRangeUnion union) : base(union) { } protected override IBTreeRange Execute(BTreeRangeUnion union) { return BTreeAlgebra.Union(_union, union); } protected override IBTreeRange Execute(BTreeRangeSingle single) { return BTreeAlgebra.Union(_union, single); } } } BTreeRangeUnionOperation.cs0000644000175000017500000000070511700531646034403 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/Algebra/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Btree.Algebra; namespace Db4objects.Db4o.Internal.Btree.Algebra { /// public abstract class BTreeRangeUnionOperation : BTreeRangeOperation { protected readonly BTreeRangeUnion _union; public BTreeRangeUnionOperation(BTreeRangeUnion union) { _union = union; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/IFieldIndexKey.cs0000644000175000017500000000030611700531646031047 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Btree { public interface IFieldIndexKey { int ParentID(); object Value(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/FieldIndexKeyHandler.cs0000644000175000017500000000644111700531646032242 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal.Btree { /// public class FieldIndexKeyHandler : IIndexable4 { private readonly IIndexable4 _valueHandler; private readonly IDHandler _parentIdHandler; public FieldIndexKeyHandler(IIndexable4 delegate_) { _parentIdHandler = new IDHandler(); _valueHandler = delegate_; } public virtual int LinkLength() { return _valueHandler.LinkLength() + Const4.IntLength; } public virtual object ReadIndexEntry(IContext context, ByteArrayBuffer a_reader) { // TODO: could read int directly here with a_reader.readInt() int parentID = ReadParentID(context, a_reader); object objPart = _valueHandler.ReadIndexEntry(context, a_reader); if (parentID < 0) { objPart = null; parentID = -parentID; } return new FieldIndexKeyImpl(parentID, objPart); } private int ReadParentID(IContext context, ByteArrayBuffer a_reader) { return ((int)_parentIdHandler.ReadIndexEntry(context, a_reader)); } public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object obj) { IFieldIndexKey composite = (IFieldIndexKey)obj; int parentID = composite.ParentID(); object value = composite.Value(); if (value == null) { parentID = -parentID; } _parentIdHandler.Write(parentID, writer); _valueHandler.WriteIndexEntry(context, writer, composite.Value()); } public virtual IIndexable4 ValueHandler() { return _valueHandler; } public virtual void DefragIndexEntry(DefragmentContextImpl context) { _parentIdHandler.DefragIndexEntry(context); _valueHandler.DefragIndexEntry(context); } public virtual IPreparedComparison PrepareComparison(IContext context, object fieldIndexKey ) { IFieldIndexKey source = (IFieldIndexKey)fieldIndexKey; IPreparedComparison preparedValueComparison = _valueHandler.PrepareComparison(context , source.Value()); IPreparedComparison preparedParentIdComparison = _parentIdHandler.NewPrepareCompare (source.ParentID()); return new _IPreparedComparison_67(preparedValueComparison, preparedParentIdComparison ); } private sealed class _IPreparedComparison_67 : IPreparedComparison { public _IPreparedComparison_67(IPreparedComparison preparedValueComparison, IPreparedComparison preparedParentIdComparison) { this.preparedValueComparison = preparedValueComparison; this.preparedParentIdComparison = preparedParentIdComparison; } public int CompareTo(object obj) { IFieldIndexKey target = (IFieldIndexKey)obj; try { int delegateResult = preparedValueComparison.CompareTo(target.Value()); if (delegateResult != 0) { return delegateResult; } } catch (IllegalComparisonException) { } // can happen, is expected return preparedParentIdComparison.CompareTo(target.ParentID()); } private readonly IPreparedComparison preparedValueComparison; private readonly IPreparedComparison preparedParentIdComparison; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreePatch.cs0000644000175000017500000000226311700531646030237 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { public abstract class BTreePatch { protected readonly Transaction _transaction; protected object _object; public BTreePatch(Transaction transaction, object obj) { _transaction = transaction; _object = obj; } public abstract object Commit(Transaction trans, BTree btree, BTreeNode node); public abstract Db4objects.Db4o.Internal.Btree.BTreePatch ForTransaction(Transaction trans); public virtual object GetObject() { return _object; } public virtual bool IsAdd() { return false; } public virtual bool IsCancelledRemoval() { return false; } public virtual bool IsRemove() { return false; } public abstract object Key(Transaction trans); public abstract object Rollback(Transaction trans, BTree btree); public override string ToString() { if (_object == null) { return "[NULL]"; } return _object.ToString(); } public abstract int SizeDiff(Transaction trans); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeCancelledRemoval.cs0000644000175000017500000000216411700531646032400 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { /// public class BTreeCancelledRemoval : BTreeUpdate { private readonly object _newKey; public BTreeCancelledRemoval(Transaction transaction, object originalKey, object newKey, BTreeUpdate existingPatches) : base(transaction, originalKey) { _newKey = newKey; if (null != existingPatches) { Append(existingPatches); } } protected override void Committed(BTree btree) { } // do nothing public override bool IsCancelledRemoval() { return true; } public override string ToString() { return "(u) " + base.ToString(); } protected override object GetCommittedObject() { return _newKey; } protected override void AdjustSizeOnRemovalByOtherTransaction(BTree btree, BTreeNode node) { } // The other transaction reduces the size, this entry ignores. protected override int SizeDiff() { return 1; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeConfiguration.cs0000644000175000017500000000221311700531646032002 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.Slots; namespace Db4objects.Db4o.Internal.Btree { /// public class BTreeConfiguration { public static readonly Db4objects.Db4o.Internal.Btree.BTreeConfiguration Default = new Db4objects.Db4o.Internal.Btree.BTreeConfiguration(null, 20, true); public readonly ITransactionalIdSystem _idSystem; public readonly SlotChangeFactory _slotChangeFactory; public readonly bool _canEnlistWithTransaction; public readonly int _cacheSize; public BTreeConfiguration(ITransactionalIdSystem idSystem, SlotChangeFactory slotChangeFactory , int cacheSize, bool canEnlistWithTransaction) { _idSystem = idSystem; _slotChangeFactory = slotChangeFactory; _canEnlistWithTransaction = canEnlistWithTransaction; _cacheSize = cacheSize; } public BTreeConfiguration(ITransactionalIdSystem idSystem, int cacheSize, bool canEnlistWithTransaction ) : this(idSystem, SlotChangeFactory.SystemObjects, cacheSize, canEnlistWithTransaction ) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreePointer.cs0000644000175000017500000001144211700531646030617 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { /// public sealed class BTreePointer { public static Db4objects.Db4o.Internal.Btree.BTreePointer Max(Db4objects.Db4o.Internal.Btree.BTreePointer x, Db4objects.Db4o.Internal.Btree.BTreePointer y) { if (x == null) { return x; } if (y == null) { return y; } if (x.CompareTo(y) > 0) { return x; } return y; } public static Db4objects.Db4o.Internal.Btree.BTreePointer Min(Db4objects.Db4o.Internal.Btree.BTreePointer x, Db4objects.Db4o.Internal.Btree.BTreePointer y) { if (x == null) { return y; } if (y == null) { return x; } if (x.CompareTo(y) < 0) { return x; } return y; } private readonly BTreeNode _node; private readonly int _index; private readonly Transaction _transaction; private readonly ByteArrayBuffer _nodeReader; public BTreePointer(Transaction transaction, ByteArrayBuffer nodeReader, BTreeNode node, int index) { if (transaction == null || node == null) { throw new ArgumentNullException(); } _transaction = transaction; _nodeReader = nodeReader; _node = node; _index = index; } public int Index() { return _index; } public BTreeNode Node() { return _node; } public object Key() { return _node.Key(_transaction, _nodeReader, _index); } public Db4objects.Db4o.Internal.Btree.BTreePointer Next() { int indexInMyNode = _index + 1; while (indexInMyNode < _node.Count()) { if (_node.IndexIsValid(_transaction, indexInMyNode)) { return new Db4objects.Db4o.Internal.Btree.BTreePointer(_transaction, _nodeReader, _node, indexInMyNode); } indexInMyNode++; } int newIndex = -1; BTreeNode nextNode = _node; ByteArrayBuffer nextReader = null; while (newIndex == -1) { nextNode = nextNode.NextNode(); if (nextNode == null) { return null; } nextReader = nextNode.PrepareRead(_transaction); newIndex = nextNode.FirstKeyIndex(_transaction); } Btree().ConvertCacheEvictedNodesToReadMode(); return new Db4objects.Db4o.Internal.Btree.BTreePointer(_transaction, nextReader, nextNode, newIndex); } public Db4objects.Db4o.Internal.Btree.BTreePointer Previous() { int indexInMyNode = _index - 1; while (indexInMyNode >= 0) { if (_node.IndexIsValid(_transaction, indexInMyNode)) { return new Db4objects.Db4o.Internal.Btree.BTreePointer(_transaction, _nodeReader, _node, indexInMyNode); } indexInMyNode--; } int newIndex = -1; BTreeNode previousNode = _node; ByteArrayBuffer previousReader = null; while (newIndex == -1) { previousNode = previousNode.PreviousNode(); if (previousNode == null) { return null; } previousReader = previousNode.PrepareRead(_transaction); newIndex = previousNode.LastKeyIndex(_transaction); } return new Db4objects.Db4o.Internal.Btree.BTreePointer(_transaction, previousReader , previousNode, newIndex); } public override bool Equals(object obj) { if (this == obj) { return true; } if (!(obj is Db4objects.Db4o.Internal.Btree.BTreePointer)) { return false; } Db4objects.Db4o.Internal.Btree.BTreePointer other = (Db4objects.Db4o.Internal.Btree.BTreePointer )obj; if (_index != other._index) { return false; } return _node.Equals(other._node); } public override int GetHashCode() { return _node.GetHashCode(); } public override string ToString() { return "BTreePointer(index=" + _index + ", node=" + _node + ")"; } public int CompareTo(Db4objects.Db4o.Internal.Btree.BTreePointer y) { if (null == y) { throw new ArgumentNullException(); } if (Btree() != y.Btree()) { throw new ArgumentException(); } return Btree().CompareKeys(_transaction.Context(), Key(), y.Key()); } private BTree Btree() { return _node.Btree(); } public static bool LessThan(Db4objects.Db4o.Internal.Btree.BTreePointer x, Db4objects.Db4o.Internal.Btree.BTreePointer y) { return Db4objects.Db4o.Internal.Btree.BTreePointer.Min(x, y) == x && !Equals(x, y ); } public static bool Equals(Db4objects.Db4o.Internal.Btree.BTreePointer x, Db4objects.Db4o.Internal.Btree.BTreePointer y) { if (x == null) { return y == null; } return x.Equals(y); } public bool IsValid() { return _node.IndexIsValid(_transaction, _index); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeAdd.cs0000644000175000017500000000267311700531646027675 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { /// public class BTreeAdd : BTreePatch { public BTreeAdd(Transaction transaction, object obj) : base(transaction, obj) { } protected virtual object RolledBack(BTree btree) { btree.NotifyRemoveListener(new TransactionContext(_transaction, GetObject())); return No4.Instance; } public override string ToString() { return "(+) " + base.ToString(); } public override object Commit(Transaction trans, BTree btree, BTreeNode node) { if (_transaction == trans) { return GetObject(); } return this; } public override BTreePatch ForTransaction(Transaction trans) { if (_transaction == trans) { return this; } return null; } public override object Key(Transaction trans) { if (_transaction != trans) { return No4.Instance; } return GetObject(); } public override object Rollback(Transaction trans, BTree btree) { if (_transaction == trans) { return RolledBack(btree); } return this; } public override bool IsAdd() { return true; } public override int SizeDiff(Transaction trans) { return _transaction == trans ? 1 : 0; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/Searcher.cs0000644000175000017500000000506711700531646030017 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { /// public sealed class Searcher { private int _lower; private int _upper; private int _cursor; private int _cmp; private readonly SearchTarget _target; private readonly int _count; public Searcher(SearchTarget target, int count) { if (count < 0) { throw new ArgumentException(); } _target = target; _count = count; _cmp = -1; if (count == 0) { Complete(); return; } _cursor = -1; _upper = count - 1; AdjustCursor(); } private void AdjustBounds() { if (_cmp > 0) { _upper = _cursor - 1; if (_upper < _lower) { _upper = _lower; } return; } if (_cmp < 0) { if (_lower == _cursor && _lower < _upper) { _lower++; } else { _lower = _cursor; } return; } if (_target == SearchTarget.Any) { _lower = _cursor; _upper = _cursor; } else { if (_target == SearchTarget.Highest) { _lower = _cursor; } else { if (_target == SearchTarget.Lowest) { _upper = _cursor; } else { throw new InvalidOperationException("Unknown target"); } } } } private void AdjustCursor() { int oldCursor = _cursor; if (_upper - _lower <= 1) { if ((_target == SearchTarget.Lowest) && (_cmp == 0)) { _cursor = _lower; } else { _cursor = _upper; } } else { _cursor = _lower + ((_upper - _lower) / 2); } if (_cursor == oldCursor) { Complete(); } } public bool AfterLast() { if (_count == 0) { return false; } // _cursor is 0: not after last return (_cursor == _count - 1) && _cmp < 0; } public bool BeforeFirst() { return (_cursor == 0) && (_cmp > 0); } private void Complete() { _upper = -2; } public int Count() { return _count; } public int Cursor() { return _cursor; } public bool FoundMatch() { return _cmp == 0; } public bool Incomplete() { return _upper >= _lower; } public void MoveForward() { _cursor++; } public void ResultIs(int cmp) { _cmp = cmp; AdjustBounds(); AdjustCursor(); } public bool IsGreater() { return _cmp < 0; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/IBTreeStructureListener.cs0000644000175000017500000000075711700531646033025 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { /// public interface IBTreeStructureListener { void NotifySplit(Transaction trans, BTreeNode originalNode, BTreeNode newRightNode ); void NotifyDeleted(Transaction trans, BTreeNode node); void NotifyCountChanged(Transaction trans, BTreeNode node, int diff); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/IBTreeRangeVisitor.cs0000644000175000017500000000046411700531646031726 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { /// public interface IBTreeRangeVisitor { void Visit(BTreeRangeSingle range); void Visit(BTreeRangeUnion union); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeNodeCacheEntry.cs0000644000175000017500000000107411700531646032032 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { /// public class BTreeNodeCacheEntry { public readonly BTreeNode _node; private ByteArrayBuffer _buffer; public BTreeNodeCacheEntry(BTreeNode node) { _node = node; } public virtual ByteArrayBuffer Buffer() { return _buffer; } public virtual void Buffer(ByteArrayBuffer buffer) { _buffer = buffer; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/SearchTarget.cs0000644000175000017500000000143111700531646030626 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Internal.Btree { /// public sealed class SearchTarget { public static readonly Db4objects.Db4o.Internal.Btree.SearchTarget Lowest = new Db4objects.Db4o.Internal.Btree.SearchTarget ("Lowest"); public static readonly Db4objects.Db4o.Internal.Btree.SearchTarget Any = new Db4objects.Db4o.Internal.Btree.SearchTarget ("Any"); public static readonly Db4objects.Db4o.Internal.Btree.SearchTarget Highest = new Db4objects.Db4o.Internal.Btree.SearchTarget("Highest"); private readonly string _target; public SearchTarget(string target) { _target = target; } public override string ToString() { return _target; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeIterator.cs0000644000175000017500000000235111700531646030767 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { /// public class BTreeIterator : IEnumerator { private readonly Transaction _transaction; private readonly BTree _bTree; private BTreePointer _currentPointer; private bool _beyondEnd; public BTreeIterator(Transaction trans, BTree bTree) { _transaction = trans; _bTree = bTree; } public virtual object Current { get { if (_currentPointer == null) { throw new InvalidOperationException(); } return _currentPointer.Key(); } } public virtual bool MoveNext() { if (_beyondEnd) { return false; } if (BeforeFirst()) { _currentPointer = _bTree.FirstPointer(_transaction); } else { _currentPointer = _currentPointer.Next(); } _beyondEnd = (_currentPointer == null); return !_beyondEnd; } private bool BeforeFirst() { return _currentPointer == null; } public virtual void Reset() { throw new NotSupportedException(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/AbstractBTreeRangeIterator.cs0000644000175000017500000000230211700531646033424 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { public abstract class AbstractBTreeRangeIterator : IEnumerator { private readonly BTreeRangeSingle _range; private BTreePointer _cursor; private BTreePointer _current; public AbstractBTreeRangeIterator(BTreeRangeSingle range) { _range = range; _cursor = range.First(); } public virtual bool MoveNext() { if (ReachedEnd(_cursor)) { _current = null; return false; } _current = _cursor; _cursor = _cursor.Next(); return true; } public virtual void Reset() { _cursor = _range.First(); } protected virtual BTreePointer CurrentPointer() { if (null == _current) { throw new InvalidOperationException(); } return _current; } private bool ReachedEnd(BTreePointer cursor) { if (cursor == null) { return true; } if (_range.End() == null) { return false; } return _range.End().Equals(cursor); } public abstract object Current { get; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/FieldIndexKeyImpl.cs0000644000175000017500000000232711700531646031565 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { /// /// Composite key for field indexes, first compares on the actual /// indexed field _value and then on the _parentID (which is a /// reference to the containing object). /// /// /// Composite key for field indexes, first compares on the actual /// indexed field _value and then on the _parentID (which is a /// reference to the containing object). /// /// public class FieldIndexKeyImpl : IFieldIndexKey { private readonly object _value; private readonly int _parentID; public FieldIndexKeyImpl(int parentID, object value) { _parentID = parentID; _value = value; } public virtual int ParentID() { return _parentID; } public virtual object Value() { return _value; } public override string ToString() { return "FieldIndexKey(" + _parentID + ", " + SafeString(_value) + ")"; } private string SafeString(object value) { if (null == value) { return "null"; } return value.ToString(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeRangeSingle.cs0000644000175000017500000001360511700531646031400 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Btree.Algebra; namespace Db4objects.Db4o.Internal.Btree { /// public class BTreeRangeSingle : IBTreeRange { private sealed class _IComparison4_14 : IComparison4 { public _IComparison4_14() { } public int Compare(object x, object y) { Db4objects.Db4o.Internal.Btree.BTreeRangeSingle xRange = (Db4objects.Db4o.Internal.Btree.BTreeRangeSingle )x; Db4objects.Db4o.Internal.Btree.BTreeRangeSingle yRange = (Db4objects.Db4o.Internal.Btree.BTreeRangeSingle )y; return xRange.First().CompareTo(yRange.First()); } } public static readonly IComparison4 Comparison = new _IComparison4_14(); private readonly Db4objects.Db4o.Internal.Transaction _transaction; private readonly BTree _btree; private readonly BTreePointer _first; private readonly BTreePointer _end; public BTreeRangeSingle(Db4objects.Db4o.Internal.Transaction transaction, BTree btree , BTreePointer first, BTreePointer end) { if (transaction == null || btree == null) { throw new ArgumentNullException(); } _transaction = transaction; _btree = btree; _first = first; _end = end; } public virtual void Accept(IBTreeRangeVisitor visitor) { visitor.Visit(this); } public virtual bool IsEmpty() { return BTreePointer.Equals(_first, _end); } public virtual int Size() { if (IsEmpty()) { return 0; } // TODO: This was an attempt to improve size calculation. // Since all nodes are read, there is no improvement. // BTreeNode currentNode = _first.node(); // int sizeOnFirst = currentNode.count() - _first.index(); // // BTreeNode endNode = _end == null ? null : _end.node(); // int substractForEnd = // (endNode == null) ? 0 : (endNode.count() - _end.index()); // // int size = sizeOnFirst - substractForEnd; // while(! currentNode.equals(endNode)){ // currentNode = currentNode.nextNode(); // if(currentNode == null){ // break; // } // currentNode.prepareRead(transaction()); // size += currentNode.count(); // } // return size; int size = 0; IEnumerator i = Keys(); while (i.MoveNext()) { ++size; } return size; } public virtual IEnumerator Pointers() { return new BTreeRangePointerIterator(this); } public virtual IEnumerator Keys() { return new BTreeRangeKeyIterator(this); } public BTreePointer End() { return _end; } public virtual Db4objects.Db4o.Internal.Transaction Transaction() { return _transaction; } public virtual BTreePointer First() { return _first; } public virtual IBTreeRange Greater() { return NewBTreeRangeSingle(_end, null); } public virtual IBTreeRange Union(IBTreeRange other) { if (null == other) { throw new ArgumentNullException(); } return new BTreeRangeSingleUnion(this).Dispatch(other); } public virtual bool Adjacent(Db4objects.Db4o.Internal.Btree.BTreeRangeSingle range ) { return BTreePointer.Equals(_end, range._first) || BTreePointer.Equals(range._end, _first); } public virtual bool Overlaps(Db4objects.Db4o.Internal.Btree.BTreeRangeSingle range ) { return FirstOverlaps(this, range) || FirstOverlaps(range, this); } private bool FirstOverlaps(Db4objects.Db4o.Internal.Btree.BTreeRangeSingle x, Db4objects.Db4o.Internal.Btree.BTreeRangeSingle y) { return BTreePointer.LessThan(y._first, x._end) && BTreePointer.LessThan(x._first, y._end); } public virtual IBTreeRange ExtendToFirst() { return NewBTreeRangeSingle(FirstBTreePointer(), _end); } public virtual IBTreeRange ExtendToLast() { return NewBTreeRangeSingle(_first, null); } public virtual IBTreeRange Smaller() { return NewBTreeRangeSingle(FirstBTreePointer(), _first); } public virtual Db4objects.Db4o.Internal.Btree.BTreeRangeSingle NewBTreeRangeSingle (BTreePointer first, BTreePointer end) { return new Db4objects.Db4o.Internal.Btree.BTreeRangeSingle(Transaction(), _btree, first, end); } public virtual IBTreeRange NewEmptyRange() { return NewBTreeRangeSingle(null, null); } private BTreePointer FirstBTreePointer() { return Btree().FirstPointer(Transaction()); } private BTree Btree() { return _btree; } public virtual IBTreeRange Intersect(IBTreeRange range) { if (null == range) { throw new ArgumentNullException(); } return new BTreeRangeSingleIntersect(this).Dispatch(range); } public virtual IBTreeRange ExtendToLastOf(IBTreeRange range) { Db4objects.Db4o.Internal.Btree.BTreeRangeSingle rangeImpl = CheckRangeArgument(range ); return NewBTreeRangeSingle(_first, rangeImpl._end); } public override string ToString() { return "BTreeRangeSingle(first=" + _first + ", end=" + _end + ")"; } private Db4objects.Db4o.Internal.Btree.BTreeRangeSingle CheckRangeArgument(IBTreeRange range) { if (null == range) { throw new ArgumentNullException(); } Db4objects.Db4o.Internal.Btree.BTreeRangeSingle rangeImpl = (Db4objects.Db4o.Internal.Btree.BTreeRangeSingle )range; if (Btree() != rangeImpl.Btree()) { throw new ArgumentException(); } return rangeImpl; } public virtual BTreePointer LastPointer() { if (_end == null) { return Btree().LastPointer(Transaction()); } return _end.Previous(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Btree/BTreeUpdate.cs0000644000175000017500000001046011700531646030420 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; namespace Db4objects.Db4o.Internal.Btree { public abstract class BTreeUpdate : BTreePatch { protected Db4objects.Db4o.Internal.Btree.BTreeUpdate _next; public BTreeUpdate(Transaction transaction, object obj) : base(transaction, obj) { } protected virtual bool HasNext() { return _next != null; } public override BTreePatch ForTransaction(Transaction trans) { if (_transaction == trans) { return this; } if (_next == null) { return null; } return _next.ForTransaction(trans); } public virtual Db4objects.Db4o.Internal.Btree.BTreeUpdate RemoveFor(Transaction trans ) { if (_transaction == trans) { return _next; } if (_next == null) { return this; } return _next.RemoveFor(trans); } public virtual void Append(Db4objects.Db4o.Internal.Btree.BTreeUpdate patch) { if (_transaction == patch._transaction) { // don't allow two patches for the same transaction throw new ArgumentException(); } if (!HasNext()) { _next = patch; } else { _next.Append(patch); } } protected virtual void ApplyKeyChange(object obj) { _object = obj; if (HasNext()) { _next.ApplyKeyChange(obj); } } protected abstract void Committed(BTree btree); public override object Commit(Transaction trans, BTree btree, BTreeNode node) { Db4objects.Db4o.Internal.Btree.BTreeUpdate patch = (Db4objects.Db4o.Internal.Btree.BTreeUpdate )ForTransaction(trans); if (patch is BTreeCancelledRemoval) { object obj = patch.GetCommittedObject(); ApplyKeyChange(obj); } else { if (patch is BTreeRemove) { RemovedBy(trans, btree, node); patch.Committed(btree); return No4.Instance; } } return InternalCommit(trans, btree); } protected object InternalCommit(Transaction trans, BTree btree) { if (_transaction == trans) { Committed(btree); if (HasNext()) { return _next; } return GetCommittedObject(); } if (HasNext()) { SetNextIfPatch(_next.InternalCommit(trans, btree)); } return this; } private void SetNextIfPatch(object newNext) { if (newNext is Db4objects.Db4o.Internal.Btree.BTreeUpdate) { _next = (Db4objects.Db4o.Internal.Btree.BTreeUpdate)newNext; } else { _next = null; } } protected abstract object GetCommittedObject(); public override object Rollback(Transaction trans, BTree btree) { if (_transaction == trans) { if (HasNext()) { return _next; } return GetObject(); } if (HasNext()) { SetNextIfPatch(_next.Rollback(trans, btree)); } return this; } public override object Key(Transaction trans) { BTreePatch patch = ForTransaction(trans); if (patch == null) { return GetObject(); } if (patch.IsRemove()) { return No4.Instance; } return patch.GetObject(); } public virtual Db4objects.Db4o.Internal.Btree.BTreeUpdate ReplacePatch(BTreePatch patch, Db4objects.Db4o.Internal.Btree.BTreeUpdate update) { if (patch == this) { update._next = _next; return update; } if (_next == null) { throw new InvalidOperationException(); } _next = _next.ReplacePatch(patch, update); return this; } public virtual void RemovedBy(Transaction trans, BTree btree, BTreeNode node) { if (trans != _transaction) { AdjustSizeOnRemovalByOtherTransaction(btree, node); } if (HasNext()) { _next.RemovedBy(trans, btree, node); } } protected abstract void AdjustSizeOnRemovalByOtherTransaction(BTree btree, BTreeNode node); public override int SizeDiff(Transaction trans) { Db4objects.Db4o.Internal.Btree.BTreeUpdate patchForTransaction = (Db4objects.Db4o.Internal.Btree.BTreeUpdate )ForTransaction(trans); if (patchForTransaction == null) { return 1; } return patchForTransaction.SizeDiff(); } protected abstract int SizeDiff(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IComparable4.cs0000644000175000017500000000165211700531646027460 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal { /// Interface for comparison support in queries. /// Interface for comparison support in queries. public interface IComparable4 { /// /// creates a prepared comparison to compare multiple objects /// against one single object. /// /// /// creates a prepared comparison to compare multiple objects /// against one single object. /// /// the context of the comparison /// /// the object that is to be compared /// against multiple other objects /// /// the prepared comparison IPreparedComparison PrepareComparison(IContext context, object obj); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IoAdaptedObjectContainer.cs0000644000175000017500000002350311700531646032041 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.IO; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Slots; using Sharpen.Lang; namespace Db4objects.Db4o.Internal { /// public class IoAdaptedObjectContainer : LocalObjectContainer, IEmbeddedObjectContainer { private readonly string _fileName; private BlockAwareBin _file; private volatile BlockAwareBin _backupFile; private object _fileLock; private readonly IFreespaceFiller _freespaceFiller; /// internal IoAdaptedObjectContainer(IConfiguration config, string fileName) : base( config) { _fileLock = new object(); _fileName = fileName; _freespaceFiller = CreateFreespaceFiller(); Open(); } /// /// protected sealed override void OpenImpl() { Config4Impl configImpl = ConfigImpl; IStorage storage = configImpl.Storage; bool isNew = !storage.Exists(FileName()); if (isNew) { LogMsg(14, FileName()); CheckReadOnly(); _handlers.OldEncryptionOff(); } bool readOnly = configImpl.IsReadOnly(); bool lockFile = Debug4.lockFile && configImpl.LockFile() && (!readOnly); if (NeedsLockFileThread()) { IBin fileBin = storage.Open(new BinConfiguration(FileName(), false, 0, false, configImpl .BlockSize())); IBin synchronizedBin = new SynchronizedBin(fileBin); _file = new BlockAwareBin(synchronizedBin); } else { IBin bin = storage.Open(new BinConfiguration(FileName(), lockFile, 0, readOnly, configImpl .BlockSize())); if (configImpl.AsynchronousSync()) { bin = new ThreadedSyncBin(bin); } _file = new BlockAwareBin(bin); } if (isNew) { ConfigureNewFile(); if (configImpl.ReservedStorageSpace() > 0) { Reserve(configImpl.ReservedStorageSpace()); } CommitTransaction(); WriteHeader(true, false); } else { ReadThis(); } } /// /// public override void Backup(IStorage targetStorage, string path) { WithEnvironment(new _IRunnable_76(this, targetStorage, path)); } private sealed class _IRunnable_76 : IRunnable { public _IRunnable_76(IoAdaptedObjectContainer _enclosing, IStorage targetStorage, string path) { this._enclosing = _enclosing; this.targetStorage = targetStorage; this.path = path; } public void Run() { lock (this._enclosing._lock) { this._enclosing.CheckClosed(); if (this._enclosing._backupFile != null) { throw new BackupInProgressException(); } this._enclosing._backupFile = new BlockAwareBin(targetStorage.Open(new BinConfiguration (path, true, this._enclosing._file.Length(), false, this._enclosing._blockConverter .BlocksToBytes(1)))); } long pos = 0; byte[] buffer = new byte[8192]; while (true) { lock (this._enclosing._lock) { int read = this._enclosing._file.Read(pos, buffer); if (read <= 0) { break; } this._enclosing._backupFile.Write(pos, buffer, read); pos += read; } // Let the database engine continue to do // some work if it likes to. Runtime4.Sleep(1); } lock (this._enclosing._lock) { try { Db4objects.Db4o.Internal.IoAdaptedObjectContainer.SyncAndClose(this._enclosing._backupFile ); } finally { this._enclosing._backupFile = null; } } } private readonly IoAdaptedObjectContainer _enclosing; private readonly IStorage targetStorage; private readonly string path; } public override void BlockSize(int size) { CreateBlockConverter(size); _file.BlockSize(size); } public override byte BlockSize() { return (byte)_file.BlockSize(); } protected override void ShutdownDataStorage() { lock (_fileLock) { try { CloseFileHeader(); } finally { CloseDatabaseFile(); } } } private void CloseDatabaseFile() { try { SyncAndClose(_file); } finally { _file = null; } } private static void SyncAndClose(IBin bin) { if (bin != null) { try { bin.Sync(); } finally { bin.Close(); } } } private void CloseFileHeader() { try { if (_fileHeader != null) { _fileHeader.Close(); } } finally { _fileHeader = null; } } public override void CloseTransaction(Transaction transaction, bool isSystemTransaction , bool rollbackOnClose) { transaction.Close(rollbackOnClose); } public override void Commit1(Transaction trans) { EnsureLastSlotWritten(); base.Commit1(trans); } private void CheckXBytes(int newAddress, int newAddressOffset, int length) { if (Debug4.xbytes && Deploy.overwrite) { try { byte[] checkXBytes = new byte[length]; _file.BlockRead(newAddress, newAddressOffset, checkXBytes); for (int i = 0; i < checkXBytes.Length; i++) { if (checkXBytes[i] != Const4.Xbyte) { string msg = "XByte corruption adress:" + newAddress + " length:" + length + " starting:" + i; throw new Db4oException(msg); } } } catch (Exception e) { Sharpen.Runtime.PrintStackTrace(e); } } } public override long FileLength() { return _file.Length(); } public override string FileName() { return _fileName; } /// public override void ReadBytes(byte[] bytes, int address, int length) { ReadBytes(bytes, address, 0, length); } /// public override void ReadBytes(byte[] bytes, int address, int addressOffset, int length) { if (DTrace.enabled) { DTrace.ReadBytes.LogLength(address + addressOffset, length); } int bytesRead = _file.BlockRead(address, addressOffset, bytes, length); CheckReadCount(bytesRead, length); } private void CheckReadCount(int bytesRead, int expected) { if (bytesRead != expected) { throw new IncompatibleFileFormatException(); } } /// public override void Reserve(int byteCount) { CheckReadOnly(); lock (_lock) { Slot slot = AllocateSlot(byteCount); ZeroReservedSlot(slot); Free(slot); } } private void ZeroReservedSlot(Slot slot) { ZeroFile(_file, slot); ZeroFile(_backupFile, slot); } private void ZeroFile(BlockAwareBin io, Slot slot) { if (io == null) { return; } byte[] zeroBytes = new byte[1024]; int left = slot.Length(); int offset = 0; while (left > zeroBytes.Length) { io.BlockWrite(slot.Address(), offset, zeroBytes, zeroBytes.Length); offset += zeroBytes.Length; left -= zeroBytes.Length; } if (left > 0) { io.BlockWrite(slot.Address(), offset, zeroBytes, left); } } public override void SyncFiles() { _file.Sync(); } public override void SyncFiles(IRunnable runnable) { _file.Sync(runnable); } public override void WriteBytes(ByteArrayBuffer buffer, int blockedAddress, int addressOffset ) { if (Deploy.debug && !Deploy.flush) { return; } if (Debug4.xbytes && Deploy.overwrite) { if (buffer.CheckXBytes()) { CheckXBytes(blockedAddress, addressOffset, buffer.Length()); } else { buffer.CheckXBytes(true); } } if (DTrace.enabled) { DTrace.WriteBytes.LogLength(blockedAddress + addressOffset, buffer.Length()); } _file.BlockWrite(blockedAddress, addressOffset, buffer._buffer, buffer.Length()); if (_backupFile != null) { _backupFile.BlockWrite(blockedAddress, addressOffset, buffer._buffer, buffer.Length ()); } } public override void OverwriteDeletedBytes(int address, int length) { if (_freespaceFiller == null) { return; } if (address > 0 && length > 0) { if (DTrace.enabled) { DTrace.WriteXbytes.LogLength(address, length); } BlockAwareBinWindow window = new BlockAwareBinWindow(_file, address, length); try { CreateFreespaceFiller().Fill(window); } catch (IOException e) { Sharpen.Runtime.PrintStackTrace(e); } finally { window.Disable(); } } } public virtual BlockAwareBin TimerFile() { return _file; } private IFreespaceFiller CreateFreespaceFiller() { return Config().FreespaceFiller(); } private class XByteFreespaceFiller : IFreespaceFiller { /// public virtual void Fill(BlockAwareBinWindow io) { io.Write(0, XBytes(io.Length())); } private byte[] XBytes(int len) { byte[] bytes = new byte[len]; for (int i = 0; i < len; i++) { bytes[i] = Const4.Xbyte; } return bytes; } } protected override void FatalStorageShutdown() { if (_file != null) { _file.Close(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/References/0000755000175000017500000000000011700531646026744 5ustar00meebeymeebey00000000000000TransactionalReferenceSystem.cs0000644000175000017500000000273011700531646035044 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/References/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.References; namespace Db4objects.Db4o.Internal.References { /// public class TransactionalReferenceSystem : TransactionalReferenceSystemBase, IReferenceSystem { public override void Commit() { TraverseNewReferences(new _IVisitor4_16(this)); CreateNewReferences(); } private sealed class _IVisitor4_16 : IVisitor4 { public _IVisitor4_16(TransactionalReferenceSystem _enclosing) { this._enclosing = _enclosing; } public void Visit(object obj) { ObjectReference oref = (ObjectReference)obj; if (oref.GetObject() != null) { this._enclosing._committedReferences.AddExistingReference(oref); } } private readonly TransactionalReferenceSystem _enclosing; } public override void AddExistingReference(ObjectReference @ref) { _committedReferences.AddExistingReference(@ref); } public override void AddNewReference(ObjectReference @ref) { _newReferences.AddNewReference(@ref); } public override void RemoveReference(ObjectReference @ref) { _newReferences.RemoveReference(@ref); _committedReferences.RemoveReference(@ref); } public override void Rollback() { CreateNewReferences(); } public virtual void Discarded() { } // do nothing; } } ReferenceSystemRegistry.cs0000644000175000017500000000522211700531646034051 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/References/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.References; namespace Db4objects.Db4o.Internal.References { /// public class ReferenceSystemRegistry { private readonly Collection4 _referenceSystems = new Collection4(); public virtual void RemoveId(int id) { RemoveReference(new _IReferenceSource_17(id)); } private sealed class _IReferenceSource_17 : ReferenceSystemRegistry.IReferenceSource { public _IReferenceSource_17(int id) { this.id = id; } public ObjectReference ReferenceFrom(IReferenceSystem referenceSystem) { return referenceSystem.ReferenceForId(id); } private readonly int id; } public virtual void RemoveObject(object obj) { RemoveReference(new _IReferenceSource_25(obj)); } private sealed class _IReferenceSource_25 : ReferenceSystemRegistry.IReferenceSource { public _IReferenceSource_25(object obj) { this.obj = obj; } public ObjectReference ReferenceFrom(IReferenceSystem referenceSystem) { return referenceSystem.ReferenceForObject(obj); } private readonly object obj; } public virtual void RemoveReference(ObjectReference reference) { RemoveReference(new _IReferenceSource_33(reference)); } private sealed class _IReferenceSource_33 : ReferenceSystemRegistry.IReferenceSource { public _IReferenceSource_33(ObjectReference reference) { this.reference = reference; } public ObjectReference ReferenceFrom(IReferenceSystem referenceSystem) { return reference; } private readonly ObjectReference reference; } private void RemoveReference(ReferenceSystemRegistry.IReferenceSource referenceSource ) { IEnumerator i = _referenceSystems.GetEnumerator(); while (i.MoveNext()) { IReferenceSystem referenceSystem = (IReferenceSystem)i.Current; ObjectReference reference = referenceSource.ReferenceFrom(referenceSystem); if (reference != null) { referenceSystem.RemoveReference(reference); } } } public virtual void AddReferenceSystem(IReferenceSystem referenceSystem) { _referenceSystems.Add(referenceSystem); } public virtual bool RemoveReferenceSystem(IReferenceSystem referenceSystem) { bool res = _referenceSystems.Remove(referenceSystem); referenceSystem.Discarded(); return res; } private interface IReferenceSource { ObjectReference ReferenceFrom(IReferenceSystem referenceSystem); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/References/IReferenceSystem.cs0000644000175000017500000000115711700531646032513 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal.References { /// public interface IReferenceSystem { void AddNewReference(ObjectReference @ref); void AddExistingReference(ObjectReference @ref); void Commit(); ObjectReference ReferenceForId(int id); ObjectReference ReferenceForObject(object obj); void RemoveReference(ObjectReference @ref); void Rollback(); void TraverseReferences(IVisitor4 visitor); void Discarded(); } } TransactionalReferenceSystemBase.cs0000644000175000017500000000344211700531646035640 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/References/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.References; namespace Db4objects.Db4o.Internal.References { /// public abstract class TransactionalReferenceSystemBase { protected readonly IReferenceSystem _committedReferences; protected IReferenceSystem _newReferences; public TransactionalReferenceSystemBase() { CreateNewReferences(); _committedReferences = NewReferenceSystem(); } private IReferenceSystem NewReferenceSystem() { return new HashcodeReferenceSystem(); } public abstract void AddExistingReference(ObjectReference @ref); public abstract void AddNewReference(ObjectReference @ref); public abstract void Commit(); protected virtual void TraverseNewReferences(IVisitor4 visitor) { _newReferences.TraverseReferences(visitor); } protected virtual void CreateNewReferences() { _newReferences = NewReferenceSystem(); } public virtual ObjectReference ReferenceForId(int id) { ObjectReference @ref = _newReferences.ReferenceForId(id); if (@ref != null) { return @ref; } return _committedReferences.ReferenceForId(id); } public virtual ObjectReference ReferenceForObject(object obj) { ObjectReference @ref = _newReferences.ReferenceForObject(obj); if (@ref != null) { return @ref; } return _committedReferences.ReferenceForObject(obj); } public abstract void RemoveReference(ObjectReference @ref); public abstract void Rollback(); public virtual void TraverseReferences(IVisitor4 visitor) { TraverseNewReferences(visitor); _committedReferences.TraverseReferences(visitor); } } } IReferenceSystemFactory.cs0000644000175000017500000000054111700531646033760 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/References/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.References; namespace Db4objects.Db4o.Internal.References { /// public interface IReferenceSystemFactory { IReferenceSystem NewReferenceSystem(IInternalObjectContainer container); } } HashcodeReferenceSystem.cs0000644000175000017500000000606111700531646033761 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/References/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Text; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.References; namespace Db4objects.Db4o.Internal.References { /// public class HashcodeReferenceSystem : IReferenceSystem { private ObjectReference _hashCodeTree; private ObjectReference _idTree; public virtual void AddNewReference(ObjectReference @ref) { AddReference(@ref); } public virtual void AddExistingReference(ObjectReference @ref) { AddReference(@ref); } private void AddReference(ObjectReference @ref) { @ref.Ref_init(); IdAdd(@ref); HashCodeAdd(@ref); } public virtual void Commit() { } // do nothing private void HashCodeAdd(ObjectReference @ref) { if (_hashCodeTree == null) { _hashCodeTree = @ref; return; } _hashCodeTree = _hashCodeTree.Hc_add(@ref); } private void IdAdd(ObjectReference @ref) { if (DTrace.enabled) { DTrace.IdTreeAdd.Log(@ref.GetID()); } if (_idTree == null) { _idTree = @ref; return; } _idTree = _idTree.Id_add(@ref); } public virtual ObjectReference ReferenceForId(int id) { if (DTrace.enabled) { DTrace.GetYapobject.Log(id); } if (_idTree == null) { return null; } if (!ObjectReference.IsValidId(id)) { return null; } return _idTree.Id_find(id); } public virtual ObjectReference ReferenceForObject(object obj) { if (_hashCodeTree == null) { return null; } return _hashCodeTree.Hc_find(obj); } public virtual void RemoveReference(ObjectReference @ref) { if (DTrace.enabled) { DTrace.ReferenceRemoved.Log(@ref.GetID()); } if (_hashCodeTree != null) { _hashCodeTree = _hashCodeTree.Hc_remove(@ref); } if (_idTree != null) { _idTree = _idTree.Id_remove(@ref); } } public virtual void Rollback() { } // do nothing public virtual void TraverseReferences(IVisitor4 visitor) { if (_hashCodeTree == null) { return; } _hashCodeTree.Hc_traverse(visitor); } public override string ToString() { BooleanByRef found = new BooleanByRef(); StringBuilder str = new StringBuilder("HashcodeReferenceSystem {"); TraverseReferences(new _IVisitor4_117(found, str)); str.Append("}"); return str.ToString(); } private sealed class _IVisitor4_117 : IVisitor4 { public _IVisitor4_117(BooleanByRef found, StringBuilder str) { this.found = found; this.str = str; } public void Visit(object obj) { if (found.value) { str.Append(", "); } ObjectReference @ref = (ObjectReference)obj; str.Append(@ref.GetID()); found.value = true; } private readonly BooleanByRef found; private readonly StringBuilder str; } public virtual void Discarded() { } // do nothing } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/IVersionedTypeHandler.cs0000644000175000017500000000050711700531646031423 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public interface IVersionedTypeHandler : ITypeHandler4, IDeepClone { ITypeHandler4 UnversionedTemplate(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/TypeHandlerConfiguration.cs0000644000175000017500000000311311700531646032157 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Internal { /// public abstract class TypeHandlerConfiguration { protected readonly Config4Impl _config; private ITypeHandler4 _listTypeHandler; private ITypeHandler4 _mapTypeHandler; public abstract void Apply(); public TypeHandlerConfiguration(Config4Impl config) { _config = config; } protected virtual void ListTypeHandler(ITypeHandler4 listTypeHandler) { _listTypeHandler = listTypeHandler; } protected virtual void MapTypeHandler(ITypeHandler4 mapTypehandler) { _mapTypeHandler = mapTypehandler; } protected virtual void RegisterCollection(Type clazz) { RegisterListTypeHandlerFor(clazz); } protected virtual void RegisterMap(Type clazz) { RegisterMapTypeHandlerFor(clazz); } protected virtual void IgnoreFieldsOn(Type clazz) { _config.RegisterTypeHandler(new SingleClassTypeHandlerPredicate(clazz), IgnoreFieldsTypeHandler .Instance); } private void RegisterListTypeHandlerFor(Type clazz) { RegisterTypeHandlerFor(clazz, _listTypeHandler); } private void RegisterMapTypeHandlerFor(Type clazz) { RegisterTypeHandlerFor(clazz, _mapTypeHandler); } protected virtual void RegisterTypeHandlerFor(Type clazz, ITypeHandler4 typeHandler ) { _config.RegisterTypeHandler(new SingleClassTypeHandlerPredicate(clazz), typeHandler ); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Config4Impl.cs0000644000175000017500000010567411700531646027342 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.IO; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Config.Encoding; using Db4objects.Db4o.Diagnostic; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.IO; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Config; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Freespace; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Ids; using Db4objects.Db4o.Internal.References; using Db4objects.Db4o.Messaging; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Core; using Db4objects.Db4o.Reflect.Generic; using Db4objects.Db4o.Typehandlers; using Sharpen; namespace Db4objects.Db4o.Internal { /// Configuration template for creating new db4o files /// public sealed partial class Config4Impl : IConfiguration, IDeepClone, IMessageSender , IFreespaceConfiguration, IQueryConfiguration, IClientServerConfiguration { private KeySpecHashtable4 _config = new KeySpecHashtable4(50); private static readonly KeySpec ActivationDepthKey = new KeySpec(5); private static readonly KeySpec ActivationDepthProviderKey = new KeySpec(LegacyActivationDepthProvider .Instance); private static readonly KeySpec UpdateDepthProviderKey = new KeySpec(new LegacyUpdateDepthProvider ()); private static readonly KeySpec AllowVersionUpdatesKey = new KeySpec(false); private static readonly KeySpec AsynchronousSyncKey = new KeySpec(false); private static readonly KeySpec AutomaticShutdownKey = new KeySpec(true); private static readonly KeySpec BlocksizeKey = new KeySpec((byte)1); private static readonly KeySpec BlobPathKey = new KeySpec(null); private static readonly KeySpec BtreeNodeSizeKey = new KeySpec(201); private static readonly KeySpec CallbacksKey = new KeySpec(CallBackMode.All); private static readonly KeySpec CallConstructorsKey = new KeySpec(TernaryBool.Unspecified ); private static readonly KeySpec ConfigurationItemsKey = new KeySpec(null); private static readonly KeySpec ConfiguredReflectorKey = new KeySpec(null); private static readonly KeySpec ClassActivationDepthConfigurableKey = new KeySpec (true); private static readonly KeySpec ClassloaderKey = new KeySpec(null); private sealed class _IDeferred_75 : KeySpec.IDeferred { public _IDeferred_75() { } // TODO: consider setting default to 8, it's more efficient with freespace. public object Evaluate() { return Config4Impl.DefaultClientServerFactory(); } } private static readonly KeySpec ClientServerFactoryKey = new KeySpec(new _IDeferred_75 ()); private static readonly KeySpec DatabaseGrowthSizeKey = new KeySpec(0); private static readonly KeySpec DetectSchemaChangesKey = new KeySpec(true); private sealed class _IDeferred_85 : KeySpec.IDeferred { public _IDeferred_85() { } public object Evaluate() { return new Db4objects.Db4o.Internal.Diagnostic.DiagnosticProcessor(); } } private static readonly KeySpec DiagnosticKey = new KeySpec(new _IDeferred_85()); private static readonly KeySpec DisableCommitRecoveryKey = new KeySpec(false); private static readonly KeySpec DiscardFreespaceKey = new KeySpec(0); private static readonly IStringEncoding DefaultStringEncoding = StringEncodings.Unicode (); private static readonly KeySpec StringEncodingKey = new KeySpec(DefaultStringEncoding ); private static readonly KeySpec EncodingKey = new KeySpec(BuiltInStringEncoding.EncodingByteForEncoding (DefaultStringEncoding)); private static readonly KeySpec EncryptKey = new KeySpec(false); private sealed class _IDeferred_103 : KeySpec.IDeferred { public _IDeferred_103() { } public object Evaluate() { return new ArrayList(); } } private static readonly KeySpec EnvironmentContributionsKey = new KeySpec(new _IDeferred_103 ()); private static readonly KeySpec ExceptionalClassesKey = new KeySpec(null); private static readonly KeySpec ExceptionsOnNotStorableKey = new KeySpec(true); private static readonly KeySpec FileBasedTransactionLogKey = new KeySpec(false); private static readonly KeySpec FreespaceFillerKey = new KeySpec(null); private static readonly KeySpec FreespaceSystemKey = new KeySpec(AbstractFreespaceManager .FmDefault); private static readonly KeySpec GenerateUuidsKey = new KeySpec(ConfigScope.Individually ); private static readonly KeySpec GenerateCommitTimestampsKey = new KeySpec(TernaryBool .Unspecified); private static readonly KeySpec IdSystemKey = new KeySpec(StandardIdSystemFactory .Default); private static readonly KeySpec IdSystemCustomFactoryKey = new KeySpec(null); private static readonly KeySpec QueryEvaluationModeKey = new KeySpec(QueryEvaluationMode .Immediate); private static readonly KeySpec LockFileKey = new KeySpec(true); private static readonly KeySpec MessageRecipientKey = new KeySpec(null); private static readonly KeySpec OptimizeNqKey = new KeySpec(true); private static readonly KeySpec OutstreamKey = new KeySpec(null); private static readonly KeySpec PasswordKey = new KeySpec((string)null); private static readonly KeySpec ClientQueryResultIteratorFactoryKey = new KeySpec (null); private static readonly KeySpec PrefetchIdCountKey = new KeySpec(10); private static readonly KeySpec PrefetchObjectCountKey = new KeySpec(10); private static readonly KeySpec PrefetchDepthKey = new KeySpec(0); public const int PrefetchSlotCacheSizeFactor = 10; private const int MaximumPrefetchSlotCacheSize = 10000; private static readonly KeySpec PrefetchSlotCacheSizeKey = new KeySpec(0); private sealed class _IDeferred_155 : KeySpec.IDeferred { public _IDeferred_155() { } // for playing with different strategies of prefetching // object public object Evaluate() { return new Hashtable4(16); } } private static readonly KeySpec ReadAsKey = new KeySpec(new _IDeferred_155()); private static readonly KeySpec RecoveryModeKey = new KeySpec(false); private static readonly KeySpec ReflectorKey = new KeySpec(null); private static readonly KeySpec RenameKey = new KeySpec(null); private static readonly KeySpec ReservedStorageSpaceKey = new KeySpec(0); private static readonly KeySpec SingleThreadedClientKey = new KeySpec(false); private static readonly KeySpec TestConstructorsKey = new KeySpec(true); private static readonly KeySpec TimeoutClientSocketKey = new KeySpec(Const4.ClientSocketTimeout ); private static readonly KeySpec TimeoutServerSocketKey = new KeySpec(Const4.ServerSocketTimeout ); private static readonly KeySpec UpdateDepthKey = new KeySpec(1); private static readonly KeySpec WeakReferenceCollectionIntervalKey = new KeySpec( 1000); private static readonly KeySpec WeakReferencesKey = new KeySpec(true); private static readonly KeySpec StorageFactoryKey = new KeySpec(new CachingStorage (new FileStorage())); private static readonly KeySpec AliasesKey = new KeySpec(null); private static readonly KeySpec BatchMessagesKey = new KeySpec(true); private static readonly KeySpec MaxBatchQueueSizeKey = new KeySpec(int.MaxValue); private static readonly KeySpec TaintedKey = new KeySpec(false); private sealed class _IReferenceSystemFactory_193 : IReferenceSystemFactory { public _IReferenceSystemFactory_193() { } public IReferenceSystem NewReferenceSystem(IInternalObjectContainer container) { return new TransactionalReferenceSystem(); } } private static readonly KeySpec ReferenceSystemFactoryKey = new KeySpec(new _IReferenceSystemFactory_193 ()); private sealed class _INameProvider_199 : INameProvider { public _INameProvider_199() { } public string Name(IObjectContainer db) { return null; } } private static readonly KeySpec NameProviderKey = new KeySpec(new _INameProvider_199 ()); private static readonly KeySpec MaxStackDepthKey = new KeySpec("Dalvik".Equals(Runtime .GetProperty("java.vm.name")) ? 2 : Const4.DefaultMaxStackDepth); private ObjectContainerBase _container; private bool _internStrings; private int _messageLevel; private bool _readOnly; private Collection4 _registeredTypeHandlers; private System.EventHandler _prefetchSettingsChanged; private bool _prefetchSlotCacheSizeModifiedExternally; // TODO find a better place to do this, and use AndroidConfiguration instead. // is null in the global configuration until deepClone is called // The following are very frequently being asked for, so they show up in the profiler. // Let's keep them out of the Hashtable. public int ActivationDepth() { return _config.GetAsInt(ActivationDepthKey); } // FIXME: circular cs dependancy. Improve. public void ActivationDepth(int depth) { _config.Put(ActivationDepthKey, depth); } public void Add(IConfigurationItem item) { item.Prepare(this); SafeConfigurationItems().Put(item, item); } /// /// Returns an iterator for all /// Db4objects.Db4o.Config.IConfigurationItem /// /// instances /// added. /// /// Add(Db4objects.Db4o.Config.IConfigurationItem) /// /// the iterator public IEnumerator ConfigurationItemsIterator() { Hashtable4 items = ConfigurationItems(); if (items == null) { return Iterators.EmptyIterator; } return items.Keys(); } private Hashtable4 SafeConfigurationItems() { Hashtable4 items = ConfigurationItems(); if (items == null) { items = new Hashtable4(16); _config.Put(ConfigurationItemsKey, items); } return items; } public void AllowVersionUpdates(bool flag) { _config.Put(AllowVersionUpdatesKey, flag); } private Hashtable4 ConfigurationItems() { return (Hashtable4)_config.Get(ConfigurationItemsKey); } public void ApplyConfigurationItems(IInternalObjectContainer container) { Hashtable4 items = ConfigurationItems(); if (items == null) { return; } IEnumerator i = items.Iterator(); while (i.MoveNext()) { IEntry4 entry = (IEntry4)i.Current; IConfigurationItem item = (IConfigurationItem)entry.Value(); item.Apply(container); } } public void AutomaticShutDown(bool flag) { _config.Put(AutomaticShutdownKey, flag); } public void BlockSize(int bytes) { if (bytes < 1 || bytes > 127) { throw new ArgumentException(); } GlobalSettingOnly(); _config.Put(BlocksizeKey, (byte)bytes); } public void BTreeNodeSize(int size) { _config.Put(BtreeNodeSizeKey, size); } public void BTreeCacheHeight(int height) { } public void Callbacks(bool turnOn) { CallbackMode(turnOn ? CallBackMode.All : CallBackMode.None); } public void CallbackMode(CallBackMode mode) { _config.Put(CallbacksKey, mode); } public void CallConstructors(bool flag) { _config.Put(CallConstructorsKey, TernaryBool.ForBoolean(flag)); } public void ClassActivationDepthConfigurable(bool turnOn) { _config.Put(ClassActivationDepthConfigurableKey, turnOn); } public Config4Class ConfigClass(string className) { Config4Class config = (Config4Class)ExceptionalClasses().Get(className); return config; } private bool IsIgnoredClass(string className) { Type[] ignore = IgnoredClasses(); for (int i = 0; i < ignore.Length; i++) { if (ignore[i].FullName.Equals(className)) { return true; } } return false; } private Type[] IgnoredClasses() { return new Type[] { typeof(StaticClass), typeof(StaticField) }; } public object DeepClone(object param) { Config4Impl ret = new Config4Impl(); Config4Impl.ConfigDeepCloneContext context = new Config4Impl.ConfigDeepCloneContext (this, ret); ret._config = (KeySpecHashtable4)_config.DeepClone(context); ret._internStrings = _internStrings; ret._messageLevel = _messageLevel; ret._readOnly = _readOnly; if (_registeredTypeHandlers != null) { ret._registeredTypeHandlers = (Collection4)_registeredTypeHandlers.DeepClone(context ); } return ret; } public void Container(ObjectContainerBase container) { _container = container; } public void DatabaseGrowthSize(int bytes) { _config.Put(DatabaseGrowthSizeKey, bytes); } public int DatabaseGrowthSize() { return _config.GetAsInt(DatabaseGrowthSizeKey); } public void DetectSchemaChanges(bool flag) { _config.Put(DetectSchemaChangesKey, flag); } public void DisableCommitRecovery() { _config.Put(DisableCommitRecoveryKey, true); } public void DiscardSmallerThan(int byteCount) { if (byteCount < 0) { throw new ArgumentException(); } _config.Put(DiscardFreespaceKey, byteCount); } [System.ObsoleteAttribute] public void Encrypt(bool flag) { GlobalSettingOnly(); _config.Put(EncryptKey, flag); } internal void OldEncryptionOff() { _config.Put(EncryptKey, false); } /// internal void EnsureDirExists(string path) { Sharpen.IO.File file = new Sharpen.IO.File(path); if (!file.Exists()) { file.Mkdirs(); } if (file.Exists() && file.IsDirectory()) { } else { throw new IOException(Db4objects.Db4o.Internal.Messages.Get(37, path)); } } internal TextWriter ErrStream() { TextWriter outStream = OutStreamOrNull(); return outStream == null ? Sharpen.Runtime.Err : outStream; } public void ExceptionsOnNotStorable(bool flag) { _config.Put(ExceptionsOnNotStorableKey, flag); } public IFreespaceConfiguration Freespace() { return this; } public void FreespaceFiller(IFreespaceFiller freespaceFiller) { _config.Put(FreespaceFillerKey, freespaceFiller); } public IFreespaceFiller FreespaceFiller() { return (IFreespaceFiller)_config.Get(FreespaceFillerKey); } public void GenerateUUIDs(ConfigScope scope) { _config.Put(GenerateUuidsKey, scope); } public void GenerateVersionNumbers(ConfigScope scope) { if (scope == ConfigScope.Individually) { throw new NotSupportedException(); } GenerateCommitTimestamps(scope == ConfigScope.Globally); } public void GenerateCommitTimestamps(bool flag) { _config.Put(GenerateCommitTimestampsKey, TernaryBool.ForBoolean(flag)); } public IMessageSender GetMessageSender() { return this; } private void GlobalSettingOnly() { if (_container != null) { throw new GlobalOnlyConfigException(); } } public void InternStrings(bool doIntern) { _internStrings = doIntern; } public void Io(IoAdapter adapter) { GlobalSettingOnly(); Storage = new IoAdapterStorage(adapter); } public void LockDatabaseFile(bool flag) { _config.Put(LockFileKey, flag); } public void MarkTransient(string marker) { Platform4.MarkTransient(marker); } public void MessageLevel(int level) { _messageLevel = level; if (OutStream() == null) { SetOut(Sharpen.Runtime.Out); } } public void OptimizeNativeQueries(bool optimizeNQ) { _config.Put(OptimizeNqKey, optimizeNQ); } public bool OptimizeNativeQueries() { return _config.GetAsBoolean(OptimizeNqKey); } public IObjectClass ObjectClass(object clazz) { string className = null; if (clazz is string) { className = (string)clazz; } else { IReflectClass claxx = ReflectorFor(clazz); if (claxx == null) { return null; } className = claxx.GetName(); } if (ReflectPlatform.FullyQualifiedName(typeof(object)).Equals(className)) { throw new ArgumentException("Configuration of the Object class is not supported." ); } Hashtable4 xClasses = ExceptionalClasses(); Config4Class c4c = (Config4Class)xClasses.Get(className); if (c4c == null) { c4c = new Config4Class(this, className); xClasses.Put(className, c4c); } return c4c; } private TextWriter OutStreamOrNull() { return (TextWriter)_config.Get(OutstreamKey); } public TextWriter OutStream() { TextWriter outStream = OutStreamOrNull(); return outStream == null ? Sharpen.Runtime.Out : outStream; } [System.ObsoleteAttribute] public void Password(string pw) { GlobalSettingOnly(); _config.Put(PasswordKey, pw); } public void ReadOnly(bool flag) { _readOnly = flag; } public GenericReflector Reflector() { GenericReflector reflector = (GenericReflector)_config.Get(ReflectorKey); if (reflector == null) { IReflector configuredReflector = (IReflector)_config.Get(ConfiguredReflectorKey); if (configuredReflector == null) { configuredReflector = Platform4.CreateReflector(ClassLoader()); _config.Put(ConfiguredReflectorKey, configuredReflector); } reflector = new GenericReflector(configuredReflector); _config.Put(ReflectorKey, reflector); } // TODO: transaction assignment has been moved to YapStreamBase#initialize1(). // implement better, more generic solution as described in COR-288 // if(! reflector.hasTransaction() && i_stream != null){ // reflector.setTransaction(i_stream.getSystemTransaction()); // } return reflector; } public void ReflectWith(IReflector reflect) { if (_container != null) { Exceptions4.ThrowRuntimeException(46); } // see readable message for code in Messages.java if (reflect == null) { throw new ArgumentNullException(); } _config.Put(ConfiguredReflectorKey, reflect); _config.Put(ReflectorKey, null); } public void RefreshClasses() { throw new NotImplementedException(); } internal void Rename(Db4objects.Db4o.Rename a_rename) { Collection4 renameCollection = Rename(); if (renameCollection == null) { renameCollection = new Collection4(); _config.Put(RenameKey, renameCollection); } renameCollection.Add(a_rename); } /// public void ReserveStorageSpace(long byteCount) { int reservedStorageSpace = (int)byteCount; if (reservedStorageSpace < 0) { reservedStorageSpace = 0; } _config.Put(ReservedStorageSpaceKey, reservedStorageSpace); if (_container != null) { _container.Reserve(reservedStorageSpace); } } /// The ConfigImpl also is our messageSender public void Send(object obj) { if (_container != null) { _container.Send(obj); } } /// public void SetBlobPath(string path) { EnsureDirExists(path); _config.Put(BlobPathKey, path); } public void SetMessageRecipient(IMessageRecipient messageRecipient) { _config.Put(MessageRecipientKey, messageRecipient); } [System.ObsoleteAttribute] public void SetOut(TextWriter outStream) { _config.Put(OutstreamKey, outStream); if (_container != null) { _container.LogMsg(19, Db4oFactory.Version()); } else { Db4objects.Db4o.Internal.Messages.LogMsg(this, 19, Db4oFactory.Version()); } } public void SingleThreadedClient(bool flag) { _config.Put(SingleThreadedClientKey, flag); } public IStringEncoding StringEncoding() { return (IStringEncoding)_config.Get(StringEncodingKey); } public void StringEncoding(IStringEncoding encoding) { _config.Put(StringEncodingKey, encoding); _config.Put(EncodingKey, BuiltInStringEncoding.EncodingByteForEncoding(encoding)); } public void TestConstructors(bool flag) { _config.Put(TestConstructorsKey, flag); } public void TimeoutClientSocket(int milliseconds) { _config.Put(TimeoutClientSocketKey, milliseconds); } public void TimeoutServerSocket(int milliseconds) { _config.Put(TimeoutServerSocketKey, milliseconds); } public void UpdateDepth(int depth) { if (depth < 0) { throw new ArgumentException("update depth must not be negative"); } Db4objects.Db4o.Internal.Diagnostic.DiagnosticProcessor dp = DiagnosticProcessor( ); if (dp.Enabled()) { dp.CheckUpdateDepth(depth); } _config.Put(UpdateDepthKey, depth); } public void UseBTreeSystem() { _config.Put(FreespaceSystemKey, AbstractFreespaceManager.FmBtree); } public void UseRamSystem() { _config.Put(FreespaceSystemKey, AbstractFreespaceManager.FmRam); } [System.ObsoleteAttribute] public void UseIndexSystem() { throw new NotSupportedException(); } public void WeakReferenceCollectionInterval(int milliseconds) { _config.Put(WeakReferenceCollectionIntervalKey, milliseconds); } public void WeakReferences(bool flag) { _config.Put(WeakReferencesKey, flag); } private Collection4 Aliases() { Collection4 aliasesCollection = (Collection4)_config.Get(AliasesKey); if (null == aliasesCollection) { aliasesCollection = new Collection4(); _config.Put(AliasesKey, aliasesCollection); } return aliasesCollection; } public void AddAlias(IAlias alias) { if (null == alias) { throw new ArgumentNullException("alias"); } Aliases().Add(alias); } public void RemoveAlias(IAlias alias) { if (null == alias) { throw new ArgumentNullException("alias"); } Aliases().Remove(alias); } public string ResolveAliasRuntimeName(string runtimeType) { Collection4 configuredAliases = Aliases(); if (null == configuredAliases) { return runtimeType; } IEnumerator i = configuredAliases.GetEnumerator(); while (i.MoveNext()) { string resolved = ((IAlias)i.Current).ResolveRuntimeName(runtimeType); if (null != resolved) { return resolved; } } return runtimeType; } public string ResolveAliasStoredName(string storedType) { Collection4 configuredAliases = Aliases(); if (null == configuredAliases) { return storedType; } IEnumerator i = configuredAliases.GetEnumerator(); while (i.MoveNext()) { string resolved = ((IAlias)i.Current).ResolveStoredName(storedType); if (null != resolved) { return resolved; } } return storedType; } internal IReflectClass ReflectorFor(object clazz) { return ReflectorUtils.ReflectClassFor(Reflector(), clazz); } public bool AllowVersionUpdates() { return _config.GetAsBoolean(AllowVersionUpdatesKey); } public bool AutomaticShutDown() { return _config.GetAsBoolean(AutomaticShutdownKey); } public byte BlockSize() { return _config.GetAsByte(BlocksizeKey); } public int BTreeNodeSize() { return _config.GetAsInt(BtreeNodeSizeKey); } public string BlobPath() { return _config.GetAsString(BlobPathKey); } public CallBackMode CallbackMode() { return (CallBackMode)_config.Get(CallbacksKey); } public TernaryBool CallConstructors() { return _config.GetAsTernaryBool(CallConstructorsKey); } internal bool ClassActivationDepthConfigurable() { return _config.GetAsBoolean(ClassActivationDepthConfigurableKey); } internal object ClassLoader() { return _config.Get(ClassloaderKey); } public bool DetectSchemaChanges() { return _config.GetAsBoolean(DetectSchemaChangesKey); } public bool CommitRecoveryDisabled() { return _config.GetAsBoolean(DisableCommitRecoveryKey); } public IDiagnosticConfiguration Diagnostic() { return (IDiagnosticConfiguration)_config.Get(DiagnosticKey); } public Db4objects.Db4o.Internal.Diagnostic.DiagnosticProcessor DiagnosticProcessor () { return (Db4objects.Db4o.Internal.Diagnostic.DiagnosticProcessor)_config.Get(DiagnosticKey ); } public int DiscardFreeSpace() { return _config.GetAsInt(DiscardFreespaceKey); } internal byte Encoding() { return _config.GetAsByte(EncodingKey); } internal bool Encrypt() { return _config.GetAsBoolean(EncryptKey); } public Hashtable4 ExceptionalClasses() { Hashtable4 exceptionalClasses = (Hashtable4)_config.Get(ExceptionalClassesKey); if (exceptionalClasses == null) { exceptionalClasses = new Hashtable4(16); _config.Put(ExceptionalClassesKey, exceptionalClasses); } return exceptionalClasses; } public bool ExceptionsOnNotStorable() { return _config.GetAsBoolean(ExceptionsOnNotStorableKey); } internal byte FreespaceSystem() { return _config.GetAsByte(FreespaceSystemKey); } public ConfigScope GenerateUUIDs() { return (ConfigScope)_config.Get(GenerateUuidsKey); } public TernaryBool GenerateCommitTimestamps() { return (TernaryBool)_config.Get(GenerateCommitTimestampsKey); } public bool InternStrings() { return _internStrings; } public bool LockFile() { return _config.GetAsBoolean(LockFileKey); } public int MessageLevel() { return _messageLevel; } public IMessageRecipient MessageRecipient() { return (IMessageRecipient)_config.Get(MessageRecipientKey); } internal bool OptimizeNQ() { return _config.GetAsBoolean(OptimizeNqKey); } internal string Password() { return _config.GetAsString(PasswordKey); } public void PrefetchIDCount(int prefetchIDCount) { _config.Put(PrefetchIdCountKey, prefetchIDCount); } public int PrefetchIDCount() { return _config.GetAsInt(PrefetchIdCountKey); } public void PrefetchObjectCount(int prefetchObjectCount) { _config.Put(PrefetchObjectCountKey, prefetchObjectCount); EnsurePrefetchSlotCacheSize(); } public int PrefetchObjectCount() { return _config.GetAsInt(PrefetchObjectCountKey); } public Hashtable4 ReadAs() { return (Hashtable4)_config.Get(ReadAsKey); } public bool IsReadOnly() { return _readOnly; } public void RecoveryMode(bool flag) { _config.Put(RecoveryModeKey, flag); } public bool RecoveryMode() { return _config.GetAsBoolean(RecoveryModeKey); } internal Collection4 Rename() { return (Collection4)_config.Get(RenameKey); } public int ReservedStorageSpace() { return _config.GetAsInt(ReservedStorageSpaceKey); } public bool SingleThreadedClient() { return _config.GetAsBoolean(SingleThreadedClientKey); } public bool TestConstructors() { return _config.GetAsBoolean(TestConstructorsKey); } public int TimeoutClientSocket() { return _config.GetAsInt(TimeoutClientSocketKey); } public int TimeoutServerSocket() { return _config.GetAsInt(TimeoutServerSocketKey); } public int UpdateDepth() { return _config.GetAsInt(UpdateDepthKey); } public int WeakReferenceCollectionInterval() { return _config.GetAsInt(WeakReferenceCollectionIntervalKey); } public bool WeakReferences() { return _config.GetAsBoolean(WeakReferencesKey); } public IoAdapter Io() { throw new NotImplementedException(); } public IStorage Storage { get { return (IStorage)_config.Get(StorageFactoryKey); } set { IStorage factory = value; _config.Put(StorageFactoryKey, factory); } } public IQueryConfiguration Queries() { return this; } public void EvaluationMode(QueryEvaluationMode mode) { _config.Put(QueryEvaluationModeKey, mode); } public QueryEvaluationMode EvaluationMode() { return (QueryEvaluationMode)_config.Get(QueryEvaluationModeKey); } public void QueryResultIteratorFactory(IQueryResultIteratorFactory factory) { _config.Put(ClientQueryResultIteratorFactoryKey, factory); } public IQueryResultIteratorFactory QueryResultIteratorFactory() { return (IQueryResultIteratorFactory)_config.Get(ClientQueryResultIteratorFactoryKey ); } public IClientServerConfiguration ClientServer() { return this; } public void BatchMessages(bool flag) { _config.Put(BatchMessagesKey, flag); } public bool BatchMessages() { return _config.GetAsBoolean(BatchMessagesKey); } public void MaxBatchQueueSize(int maxSize) { _config.Put(MaxBatchQueueSizeKey, maxSize); } public int MaxBatchQueueSize() { return _config.GetAsInt(MaxBatchQueueSizeKey); } public void ActivationDepthProvider(IActivationDepthProvider provider) { _config.Put(ActivationDepthProviderKey, provider); } public void UpdateDepthProvider(IUpdateDepthProvider provider) { _config.Put(UpdateDepthProviderKey, provider); } public IActivationDepthProvider ActivationDepthProvider() { return (IActivationDepthProvider)_config.Get(ActivationDepthProviderKey); } public IUpdateDepthProvider UpdateDepthProvider() { return (IUpdateDepthProvider)_config.Get(UpdateDepthProviderKey); } public void RegisterTypeHandler(ITypeHandlerPredicate predicate, ITypeHandler4 typeHandler ) { if (_registeredTypeHandlers == null) { _registeredTypeHandlers = new Collection4(); } _registeredTypeHandlers.Add(new TypeHandlerPredicatePair(predicate, typeHandler)); } public ITypeHandler4 TypeHandlerForClass(IReflectClass classReflector, byte handlerVersion ) { if (_registeredTypeHandlers == null) { return null; } IEnumerator i = _registeredTypeHandlers.GetEnumerator(); while (i.MoveNext()) { TypeHandlerPredicatePair pair = (TypeHandlerPredicatePair)i.Current; if (pair._predicate.Match(classReflector)) { return pair._typeHandler; } } return null; } public class ConfigDeepCloneContext { public readonly Config4Impl _orig; public readonly Config4Impl _cloned; public ConfigDeepCloneContext(Config4Impl orig, Config4Impl cloned) { _orig = orig; _cloned = cloned; } } public void Factory(ILegacyClientServerFactory factory) { _config.Put(ClientServerFactoryKey, factory); } public ILegacyClientServerFactory ClientServerFactory() { return (ILegacyClientServerFactory)_config.Get(ClientServerFactoryKey); } public ICacheConfiguration Cache() { return new CacheConfigurationImpl(this); } public bool FileBasedTransactionLog() { return _config.GetAsBoolean(FileBasedTransactionLogKey); } public void FileBasedTransactionLog(bool flag) { _config.Put(FileBasedTransactionLogKey, flag); } private bool IsTainted() { return _config.GetAsBoolean(TaintedKey); } public void Taint() { _config.Put(TaintedKey, true); } public static void AssertIsNotTainted(IConfiguration config) { if (((Config4Impl)config).IsTainted()) { throw new ArgumentException("Configuration already used."); } } public void PrefetchDepth(int prefetchDepth) { _config.Put(PrefetchDepthKey, prefetchDepth); EnsurePrefetchSlotCacheSize(); } private void EnsurePrefetchSlotCacheSize() { if (!_prefetchSlotCacheSizeModifiedExternally) { PrefetchSlotCacheSize(CalculatedPrefetchSlotcacheSize()); _prefetchSlotCacheSizeModifiedExternally = false; } } public int PrefetchDepth() { return _config.GetAsInt(PrefetchDepthKey); } public IList EnvironmentContributions() { return (IList)_config.Get(EnvironmentContributionsKey); } public void PrefetchSlotCacheSize(int slotCacheSize) { _prefetchSlotCacheSizeModifiedExternally = true; _config.Put(PrefetchSlotCacheSizeKey, slotCacheSize); if (null != _prefetchSettingsChanged) _prefetchSettingsChanged(null, EventArgs.Empty ); } public int PrefetchSlotCacheSize() { return _config.GetAsInt(PrefetchSlotCacheSizeKey); } private int CalculatedPrefetchSlotcacheSize() { long calculated = (long)PrefetchDepth() * PrefetchObjectCount() * PrefetchSlotCacheSizeFactor; if (calculated > MaximumPrefetchSlotCacheSize) { calculated = MaximumPrefetchSlotCacheSize; } return (int)calculated; } public event System.EventHandler PrefetchSettingsChanged { add { _prefetchSettingsChanged = (System.EventHandler)System.Delegate.Combine (_prefetchSettingsChanged, value); } remove { _prefetchSettingsChanged = (System.EventHandler)System.Delegate.Remove (_prefetchSettingsChanged, value); } } public void ReferenceSystemFactory(IReferenceSystemFactory referenceSystemFactory ) { _config.Put(ReferenceSystemFactoryKey, referenceSystemFactory); } public IReferenceSystemFactory ReferenceSystemFactory() { return (IReferenceSystemFactory)_config.Get(ReferenceSystemFactoryKey); } public void NameProvider(INameProvider provider) { _config.Put(NameProviderKey, provider); } public INameProvider NameProvider() { return (INameProvider)_config.Get(NameProviderKey); } public void UsePointerBasedIdSystem() { _config.Put(IdSystemKey, StandardIdSystemFactory.PointerBased); } public void UseStackedBTreeIdSystem() { _config.Put(IdSystemKey, StandardIdSystemFactory.StackedBtree); } public void UseSingleBTreeIdSystem() { _config.Put(IdSystemKey, StandardIdSystemFactory.SingleBtree); } public byte IdSystemType() { return _config.GetAsByte(IdSystemKey); } public void UseInMemoryIdSystem() { _config.Put(IdSystemKey, StandardIdSystemFactory.InMemory); } public void UseCustomIdSystem(IIdSystemFactory factory) { _config.Put(IdSystemKey, StandardIdSystemFactory.Custom); _config.Put(IdSystemCustomFactoryKey, factory); } public IIdSystemFactory CustomIdSystemFactory() { return (IIdSystemFactory)_config.Get(IdSystemCustomFactoryKey); } public void AsynchronousSync(bool flag) { _config.Put(AsynchronousSyncKey, flag); } public bool AsynchronousSync() { return _config.GetAsBoolean(AsynchronousSyncKey); } public int MaxStackDepth() { return _config.GetAsInt(MaxStackDepthKey); } public void MaxStackDepth(int maxStackDepth) { _config.Put(MaxStackDepthKey, maxStackDepth); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/CommitTimestampSupport.cs0000644000175000017500000001720711700531646031732 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Events; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal { public class CommitTimestampSupport { private BTree _idToTimestamp; private BTree _timestampToId; private readonly LocalObjectContainer _container; public CommitTimestampSupport(LocalObjectContainer container) { _container = container; } public virtual void EnsureInitialized() { IdToTimestamp(); } public virtual BTree IdToTimestamp() { if (_idToTimestamp != null) { return _idToTimestamp; } if (!_container.Config().GenerateCommitTimestamps().DefiniteYes()) { return null; } Initialize(); return _idToTimestamp; } public virtual BTree TimestampToId() { if (_timestampToId != null) { return _timestampToId; } if (!_container.Config().GenerateCommitTimestamps().DefiniteYes()) { return null; } Initialize(); return _timestampToId; } private void Initialize() { int idToTimestampIndexId = _container.SystemData().IdToTimestampIndexId(); int timestampToIdIndexId = _container.SystemData().TimestampToIdIndexId(); _idToTimestamp = new BTree(_container.SystemTransaction(), idToTimestampIndexId, new CommitTimestampSupport.TimestampEntryById()); _timestampToId = new BTree(_container.SystemTransaction(), timestampToIdIndexId, new CommitTimestampSupport.IdEntryByTimestamp()); if (idToTimestampIndexId != _idToTimestamp.GetID()) { StoreBtreesIds(); } EventRegistryFactory.ForObjectContainer(_container).Committing += new System.EventHandler (new _IEventListener4_69(this).OnEvent); } private sealed class _IEventListener4_69 { public _IEventListener4_69(CommitTimestampSupport _enclosing) { this._enclosing = _enclosing; } public void OnEvent(object sender, Db4objects.Db4o.Events.CommitEventArgs args) { LocalTransaction trans = (LocalTransaction)((CommitEventArgs)args).Transaction(); long transactionTimestamp = trans.Timestamp(); long commitTimestamp = (transactionTimestamp > 0) ? transactionTimestamp : this._enclosing ._container.GenerateTimeStampId(); Transaction sysTrans = trans.SystemTransaction(); this.AddTimestamp(sysTrans, ((CommitEventArgs)args).Added.GetEnumerator(), commitTimestamp ); this.AddTimestamp(sysTrans, ((CommitEventArgs)args).Updated.GetEnumerator(), commitTimestamp ); this.AddTimestamp(sysTrans, ((CommitEventArgs)args).Deleted.GetEnumerator(), 0); } private void AddTimestamp(Transaction trans, IEnumerator it, long commitTimestamp ) { while (it.MoveNext()) { IObjectInfo objInfo = (IObjectInfo)it.Current; CommitTimestampSupport.TimestampEntry te = new CommitTimestampSupport.TimestampEntry ((int)objInfo.GetInternalID(), commitTimestamp); CommitTimestampSupport.TimestampEntry oldEntry = (CommitTimestampSupport.TimestampEntry )this._enclosing._idToTimestamp.Remove(trans, te); if (oldEntry != null) { this._enclosing._timestampToId.Remove(trans, oldEntry); } if (commitTimestamp != 0) { this._enclosing._idToTimestamp.Add(trans, te); this._enclosing._timestampToId.Add(trans, te); } } } private readonly CommitTimestampSupport _enclosing; } private void StoreBtreesIds() { _container.SystemData().IdToTimestampIndexId(_idToTimestamp.GetID()); _container.SystemData().TimestampToIdIndexId(_timestampToId.GetID()); _container.GetFileHeader().WriteVariablePart(_container); } public class TimestampEntry : IFieldIndexKey { public readonly int objectId; public readonly long commitTimestamp; public override string ToString() { return "TimestampEntry [objectId=" + objectId + ", commitTimestamp=" + commitTimestamp + "]"; } public TimestampEntry(int objectId, long commitTimestamp) { this.objectId = objectId; this.commitTimestamp = commitTimestamp; } public virtual int ParentID() { return objectId; } public virtual long GetCommitTimestamp() { return commitTimestamp; } public virtual object Value() { return commitTimestamp; } } private class TimestampEntryById : IIndexable4 { public virtual IPreparedComparison PrepareComparison(IContext context, object first ) { return new _IPreparedComparison_139(first); } private sealed class _IPreparedComparison_139 : IPreparedComparison { public _IPreparedComparison_139(object first) { this.first = first; } public int CompareTo(object second) { return IntHandler.Compare(((CommitTimestampSupport.TimestampEntry)first).objectId , ((CommitTimestampSupport.TimestampEntry)second).objectId); } private readonly object first; } public virtual int LinkLength() { return Const4.IntLength + Const4.LongLength; } public virtual object ReadIndexEntry(IContext context, ByteArrayBuffer reader) { return new CommitTimestampSupport.TimestampEntry(reader.ReadInt(), reader.ReadLong ()); } public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object obj) { writer.WriteInt(((CommitTimestampSupport.TimestampEntry)obj).ParentID()); writer.WriteLong(((CommitTimestampSupport.TimestampEntry)obj).GetCommitTimestamp( )); } public virtual void DefragIndexEntry(DefragmentContextImpl context) { // we are storing ids in the btree, so the order will change when the ids change // to properly defrag the btree we need to readd all the entries throw new NotSupportedException(); } } private sealed class IdEntryByTimestamp : CommitTimestampSupport.TimestampEntryById { public override IPreparedComparison PrepareComparison(IContext context, object first ) { return new _IPreparedComparison_168(first); } private sealed class _IPreparedComparison_168 : IPreparedComparison { public _IPreparedComparison_168(object first) { this.first = first; } public int CompareTo(object second) { int result = LongHandler.Compare(((CommitTimestampSupport.TimestampEntry)first).commitTimestamp , ((CommitTimestampSupport.TimestampEntry)second).commitTimestamp); if (result != 0) { return result; } return IntHandler.Compare(((CommitTimestampSupport.TimestampEntry)first).objectId , ((CommitTimestampSupport.TimestampEntry)second).objectId); } private readonly object first; } } public virtual long VersionForId(int id) { if (IdToTimestamp() == null || id == 0) { return 0; } CommitTimestampSupport.TimestampEntry te = (CommitTimestampSupport.TimestampEntry )IdToTimestamp().Search(_container.SystemTransaction(), new CommitTimestampSupport.TimestampEntry (id, 0)); if (te == null) { return 0; } return te.GetCommitTimestamp(); } public virtual void Put(Transaction trans, int objectId, long version) { CommitTimestampSupport.TimestampEntry te = new CommitTimestampSupport.TimestampEntry (objectId, version); IdToTimestamp().Add(trans, te); TimestampToId().Add(trans, te); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/MessageOutput.cs0000644000175000017500000000211211700531646030013 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.IO; using Db4objects.Db4o; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Handlers; namespace Db4objects.Db4o.Internal { internal sealed class MessageOutput { internal readonly TextWriter stream; internal MessageOutput(ObjectContainerBase a_stream, string msg) { stream = a_stream.ConfigImpl.OutStream(); Print(msg, true); } internal MessageOutput(string a_StringParam, int a_intParam, TextWriter a_stream, bool header) { stream = a_stream; Print(Db4objects.Db4o.Internal.Messages.Get(a_intParam, a_StringParam), header); } internal MessageOutput(string a_StringParam, int a_intParam, TextWriter a_stream) : this(a_StringParam, a_intParam, a_stream, true) { } private void Print(string msg, bool header) { if (stream != null) { if (header) { stream.WriteLine("[" + Db4oFactory.Version() + " " + DateHandlerBase.Now() + "] " ); } stream.WriteLine(" " + msg); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Reflect/0000755000175000017500000000000011700531646026247 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Reflect/LenientFieldAccessor.cs0000644000175000017500000000124311700531646032623 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; using Db4objects.Db4o.Internal.Reflect; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Reflect { /// 7.7 public class LenientFieldAccessor : IFieldAccessor { public virtual object Get(IReflectField field, object onObject) { try { return field.Get(onObject); } catch (Db4oException) { return null; } } public virtual void Set(IReflectField field, object onObject, object value) { try { field.Set(onObject, value); } catch (Db4oException) { } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Reflect/Generic/0000755000175000017500000000000011700531646027623 5ustar00meebeymeebey00000000000000KnownClassesCollector.cs0000644000175000017500000000512211700531646034354 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Reflect/Generic/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Internal.Reflect.Generic { public class KnownClassesCollector { private readonly ObjectContainerBase _container; private readonly KnownClassesRepository _repository; public KnownClassesCollector(ObjectContainerBase container, KnownClassesRepository repository) { _container = container; _repository = repository; } public virtual IReflectClass[] Collect() { Collection4 classes = new Collection4(); CollectKnownClasses(classes); return (IReflectClass[])classes.ToArray(new IReflectClass[classes.Size()]); } private void CollectKnownClasses(Collection4 classes) { IListener4 collectingListener = NewCollectingClassListener(classes); _repository.AddListener(collectingListener); try { CollectKnownClasses(classes, Iterators.Copy(_repository.Classes())); } finally { _repository.RemoveListener(collectingListener); } } private IListener4 NewCollectingClassListener(Collection4 classes) { return new _IListener4_37(this, classes); } private sealed class _IListener4_37 : IListener4 { public _IListener4_37(KnownClassesCollector _enclosing, Collection4 classes) { this._enclosing = _enclosing; this.classes = classes; } public void OnEvent(object addedClass) { this._enclosing.CollectKnownClass(classes, ((IReflectClass)addedClass)); } private readonly KnownClassesCollector _enclosing; private readonly Collection4 classes; } private void CollectKnownClasses(Collection4 collector, IEnumerator knownClasses) { while (knownClasses.MoveNext()) { IReflectClass clazz = (IReflectClass)knownClasses.Current; CollectKnownClass(collector, clazz); } } private void CollectKnownClass(Collection4 classes, IReflectClass clazz) { if (IsInternalClass(clazz)) { return; } if (!HasIdentity(clazz)) { return; } if (clazz.IsArray()) { return; } classes.Add(clazz); } private bool IsInternalClass(IReflectClass clazz) { return _container._handlers.IclassInternal.IsAssignableFrom(clazz); } private bool HasIdentity(IReflectClass clazz) { ClassMetadata clazzMeta = _container.ClassMetadataForReflectClass(clazz); return clazzMeta == null || clazzMeta.HasIdentity(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Reflect/ReflectClasses.cs0000644000175000017500000000052711700531646031504 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Reflect { public class ReflectClasses { public static bool AreEqual(Type expected, IReflectClass actual) { return actual.Reflector().ForClass(expected) == actual; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Reflect/IFieldAccessor.cs0000644000175000017500000000052311700531646031415 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Reflect { /// 7.7 public interface IFieldAccessor { void Set(IReflectField field, object onObject, object value); object Get(IReflectField field, object onObject); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/Reflect/StrictFieldAccessor.cs0000644000175000017500000000077611700531646032507 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal.Reflect; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Internal.Reflect { /// 7.7 public class StrictFieldAccessor : IFieldAccessor { public virtual object Get(IReflectField field, object onObject) { return field.Get(onObject); } public virtual void Set(IReflectField field, object onObject, object value) { field.Set(onObject, value); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/SharedIndexedFields.cs0000644000175000017500000000073311700531646031053 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Internal { /// public class SharedIndexedFields { public readonly VersionFieldMetadata _version = new VersionFieldMetadata(); public readonly UUIDFieldMetadata _uUID = new UUIDFieldMetadata(); public readonly CommitTimestampFieldMetadata _commitTimestamp = new CommitTimestampFieldMetadata (); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Internal/UUIDFieldMetadata.cs0000644000175000017500000002077111700531646030374 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Ext; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Activation; using Db4objects.Db4o.Internal.Btree; using Db4objects.Db4o.Internal.Delete; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Internal.Slots; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o.Internal { /// public class UUIDFieldMetadata : VirtualFieldMetadata { internal UUIDFieldMetadata() : base(Handlers4.LongId, new LongHandler()) { SetName(Const4.VirtualFieldPrefix + "uuid"); } /// public override void AddFieldIndex(ObjectIdContextImpl context) { LocalTransaction transaction = (LocalTransaction)context.Transaction(); LocalObjectContainer localContainer = (LocalObjectContainer)transaction.Container (); Slot oldSlot = transaction.IdSystem().CommittedSlot(context.ObjectId()); int savedOffset = context.Offset(); int db4oDatabaseIdentityID = context.ReadInt(); long uuid = context.ReadLong(); context.Seek(savedOffset); bool isnew = (oldSlot.IsNull()); if ((uuid == 0 || db4oDatabaseIdentityID == 0) && context.ObjectId() > 0 && !isnew) { UUIDFieldMetadata.DatabaseIdentityIDAndUUID identityAndUUID = ReadDatabaseIdentityIDAndUUID (localContainer, context.ClassMetadata(), oldSlot, false); db4oDatabaseIdentityID = identityAndUUID.databaseIdentityID; uuid = identityAndUUID.uuid; } if (db4oDatabaseIdentityID == 0) { db4oDatabaseIdentityID = localContainer.Identity().GetID(transaction); } if (uuid == 0) { uuid = localContainer.GenerateTimeStampId(); } StatefulBuffer writer = (StatefulBuffer)context.Buffer(); writer.WriteInt(db4oDatabaseIdentityID); writer.WriteLong(uuid); if (isnew) { AddIndexEntry(writer, uuid); } } internal class DatabaseIdentityIDAndUUID { public int databaseIdentityID; public long uuid; public DatabaseIdentityIDAndUUID(int databaseIdentityID_, long uuid_) { databaseIdentityID = databaseIdentityID_; uuid = uuid_; } } /// private UUIDFieldMetadata.DatabaseIdentityIDAndUUID ReadDatabaseIdentityIDAndUUID (ObjectContainerBase container, ClassMetadata classMetadata, Slot oldSlot, bool checkClass) { if (DTrace.enabled) { DTrace.RereadOldUuid.LogLength(oldSlot.Address(), oldSlot.Length()); } ByteArrayBuffer reader = container.DecryptedBufferByAddress(oldSlot.Address(), oldSlot .Length()); if (checkClass) { ClassMetadata realClass = ClassMetadata.ReadClass(container, reader); if (realClass != classMetadata) { return null; } } if (classMetadata.SeekToField(container.Transaction, reader, this) == HandlerVersion .Invalid) { return null; } return new UUIDFieldMetadata.DatabaseIdentityIDAndUUID(reader.ReadInt(), reader.ReadLong ()); } public override void Delete(DeleteContextImpl context, bool isUpdate) { if (isUpdate) { context.Seek(context.Offset() + LinkLength()); return; } context.Seek(context.Offset() + Const4.IntLength); long longPart = context.ReadLong(); if (longPart > 0) { if (context.Container().MaintainsIndices()) { RemoveIndexEntry(context.Transaction(), context.ObjectId(), longPart); } } } public override bool HasIndex() { return true; } public override BTree GetIndex(Transaction transaction) { EnsureIndex(transaction); return base.GetIndex(transaction); } /// protected override void RebuildIndexForObject(LocalObjectContainer container, ClassMetadata classMetadata, int objectId) { Slot slot = container.SystemTransaction().IdSystem().CurrentSlot(objectId); UUIDFieldMetadata.DatabaseIdentityIDAndUUID data = ReadDatabaseIdentityIDAndUUID( container, classMetadata, slot, true); if (null == data) { return; } AddIndexEntry(container.LocalSystemTransaction(), objectId, data.uuid); } private void EnsureIndex(Transaction transaction) { if (null == transaction) { throw new ArgumentNullException(); } if (null != base.GetIndex(transaction)) { return; } LocalObjectContainer file = ((LocalObjectContainer)transaction.Container()); SystemData sd = file.SystemData(); if (sd == null) { // too early, in new file, try again later. return; } InitIndex(transaction, sd.UuidIndexId()); if (sd.UuidIndexId() == 0) { sd.UuidIndexId(base.GetIndex(transaction).GetID()); file.GetFileHeader().WriteVariablePart(file); } } internal override void Instantiate1(ObjectReferenceContext context) { int dbID = context.ReadInt(); Transaction trans = context.Transaction(); ObjectContainerBase container = trans.Container(); container.ShowInternalClasses(true); try { Db4oDatabase db = (Db4oDatabase)container.GetByID2(trans, dbID); if (db != null && db.i_signature == null) { container.Activate(trans, db, new FixedActivationDepth(2)); } VirtualAttributes va = context.ObjectReference().VirtualAttributes(); va.i_database = db; va.i_uuid = context.ReadLong(); } finally { container.ShowInternalClasses(false); } } public override int LinkLength() { return Const4.LongLength + Const4.IdLength; } internal override void Marshall(Transaction trans, ObjectReference @ref, IWriteBuffer buffer, bool isMigrating, bool isNew) { VirtualAttributes attr = @ref.VirtualAttributes(); ObjectContainerBase container = trans.Container(); bool doAddIndexEntry = isNew && container.MaintainsIndices(); int dbID = 0; bool linkToDatabase = (attr != null && attr.i_database == null) ? true : !isMigrating; if (linkToDatabase) { Db4oDatabase db = ((IInternalObjectContainer)container).Identity(); if (db == null) { // can happen on early classes like Metaxxx, no problem attr = null; } else { if (attr.i_database == null) { attr.i_database = db; // TODO: Should be check for ! client instead of instanceof if (container is LocalObjectContainer) { attr.i_uuid = container.GenerateTimeStampId(); doAddIndexEntry = true; } } db = attr.i_database; if (db != null) { dbID = db.GetID(trans); } } } else { if (attr != null) { dbID = attr.i_database.GetID(trans); } } buffer.WriteInt(dbID); if (attr == null) { buffer.WriteLong(0); return; } buffer.WriteLong(attr.i_uuid); if (doAddIndexEntry) { AddIndexEntry(trans, @ref.GetID(), attr.i_uuid); } } internal override void MarshallIgnore(IWriteBuffer buffer) { buffer.WriteInt(0); buffer.WriteLong(0); } public HardObjectReference GetHardObjectReferenceBySignature(Transaction transaction , long longPart, byte[] signature) { IBTreeRange range = Search(transaction, longPart); IEnumerator keys = range.Keys(); while (keys.MoveNext()) { IFieldIndexKey current = (IFieldIndexKey)keys.Current; HardObjectReference hardRef = GetHardObjectReferenceById(transaction, current.ParentID (), signature); if (null != hardRef) { return hardRef; } } return HardObjectReference.Invalid; } protected HardObjectReference GetHardObjectReferenceById(Transaction transaction, int parentId, byte[] signature) { HardObjectReference hardRef = transaction.Container().GetHardObjectReferenceById( transaction, parentId); if (hardRef._reference == null) { return null; } VirtualAttributes vad = hardRef._reference.VirtualAttributes(transaction, false); if (!Arrays4.Equals(signature, vad.i_database.i_signature)) { return null; } return hardRef; } public override void DefragAspect(IDefragmentContext context) { // database id context.CopyID(); // uuid context.IncrementOffset(Const4.LongLength); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Deploy.cs0000644000175000017500000000101011700531646024662 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o { /// public sealed class Deploy { /// turning debug on makes the file format human readable public const bool debug = false; public const bool overwrite = true; public const bool brackets = true; public const bool identifiers = true; public const bool flush = true; public const bool debugLong = true; public const bool csharp = true; } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/DTrace.cs0000644000175000017500000005117311700531646024607 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.IO; using System.Text; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal.Encoding; using Db4objects.Db4o.Internal.Handlers; using Db4objects.Db4o.Internal.Slots; using Sharpen.IO; namespace Db4objects.Db4o { /// public class DTrace { public static bool enabled = false; public static bool writeToLogFile = false; public static bool writeToConsole = true; private static readonly string logFilePath = "C://"; private static string logFileName; private static readonly object Lock = new object(); private static readonly LatinStringIO stringIO = new LatinStringIO(); public static RandomAccessFile _logFile; private static int Unused = -1; private static void BreakPoint() { if (enabled) { int xxx = 1; } } private static void Configure() { if (enabled) { } } // addRange(15); // breakOnEvent(540); // // addRangeWithEnd(448, 460); // addRangeWithLength(770,53); // breakOnEvent(125); // trackEventsWithoutRange(); // turnAllOffExceptFor(new DTrace[] {WRITE_BYTES}); // turnAllOffExceptFor(new DTrace[] { // PERSISTENT_OWN_LENGTH, // }); // turnAllOffExceptFor(new DTrace[] { // GET_SLOT, // FILE_FREE, // TRANS_COMMIT, // }); // turnAllOffExceptFor(new DTrace[] {WRITE_BYTES}); // turnAllOffExceptFor(new DTrace[] {BTREE_NODE_REMOVE, BTREE_NODE_COMMIT_OR_ROLLBACK YAPMETA_SET_ID}); private static void Init() { if (enabled) { AddToClassIndex = new Db4objects.Db4o.DTrace(true, true, "add to class index tree" , true); BeginTopLevelCall = new Db4objects.Db4o.DTrace(true, true, "begin top level call" , true); Bind = new Db4objects.Db4o.DTrace(true, true, "bind", true); BlockingQueueStoppedException = new Db4objects.Db4o.DTrace(true, true, "blocking queue stopped exception" , true); BtreeNodeRemove = new Db4objects.Db4o.DTrace(true, true, "btreenode remove", true ); BtreeNodeCommitOrRollback = new Db4objects.Db4o.DTrace(true, true, "btreenode commit or rollback" , true); BtreeProduceNode = new Db4objects.Db4o.DTrace(true, true, "btree produce node", true ); CandidateRead = new Db4objects.Db4o.DTrace(true, true, "candidate read", true); ClassmetadataById = new Db4objects.Db4o.DTrace(true, true, "classmetadata by id", true); ClassmetadataInit = new Db4objects.Db4o.DTrace(true, true, "classmetadata init", true); ClientMessageLoopException = new Db4objects.Db4o.DTrace(true, true, "client message loop exception" , true); Close = new Db4objects.Db4o.DTrace(true, true, "close", true); CloseCalled = new Db4objects.Db4o.DTrace(true, true, "close called", true); CollectChildren = new Db4objects.Db4o.DTrace(true, true, "collect children", true ); Commit = new Db4objects.Db4o.DTrace(false, false, "commit", true); Continueset = new Db4objects.Db4o.DTrace(true, true, "continueset", true); CreateCandidate = new Db4objects.Db4o.DTrace(true, true, "create candidate", true ); Delete = new Db4objects.Db4o.DTrace(true, true, "delete", true); Donotinclude = new Db4objects.Db4o.DTrace(true, true, "donotinclude", true); EndTopLevelCall = new Db4objects.Db4o.DTrace(true, true, "end top level call", true ); EvaluateSelf = new Db4objects.Db4o.DTrace(true, true, "evaluate self", true); FatalException = new Db4objects.Db4o.DTrace(true, true, "fatal exception", true); Free = new Db4objects.Db4o.DTrace(true, true, "free", true); FileFree = new Db4objects.Db4o.DTrace(true, true, "fileFree", true); FileRead = new Db4objects.Db4o.DTrace(true, true, "fileRead", true); FileWrite = new Db4objects.Db4o.DTrace(true, true, "fileWrite", true); FreespacemanagerGetSlot = new Db4objects.Db4o.DTrace(true, true, "FreespaceManager getSlot" , true); FreespacemanagerRamFree = new Db4objects.Db4o.DTrace(true, true, "InMemoryfreespaceManager free" , true); FreespacemanagerBtreeFree = new Db4objects.Db4o.DTrace(true, true, "BTreeFreeSpaceManager free" , true); FreeOnCommit = new Db4objects.Db4o.DTrace(true, true, "trans freeOnCommit", true); FreeOnRollback = new Db4objects.Db4o.DTrace(true, true, "trans freeOnRollback", true ); FreePointerOnRollback = new Db4objects.Db4o.DTrace(true, true, "freePointerOnRollback" , true); GetPointerSlot = new Db4objects.Db4o.DTrace(true, true, "getPointerSlot", true); GetSlot = new Db4objects.Db4o.DTrace(true, true, "getSlot", true); GetFreespaceRam = new Db4objects.Db4o.DTrace(true, true, "getFreespaceRam", true); GetYapobject = new Db4objects.Db4o.DTrace(true, true, "get ObjectReference", true ); IdTreeAdd = new Db4objects.Db4o.DTrace(true, true, "id tree add", true); IdTreeRemove = new Db4objects.Db4o.DTrace(true, true, "id tree remove", true); IoCopy = new Db4objects.Db4o.DTrace(true, true, "io copy", true); JustSet = new Db4objects.Db4o.DTrace(true, true, "just set", true); NewInstance = new Db4objects.Db4o.DTrace(true, true, "newInstance", true); NotifySlotCreated = new Db4objects.Db4o.DTrace(true, true, "notifySlotCreated", true ); NotifySlotUpdated = new Db4objects.Db4o.DTrace(true, true, "notify Slot updated", true); NotifySlotDeleted = new Db4objects.Db4o.DTrace(true, true, "notifySlotDeleted", true ); ObjectReferenceCreated = new Db4objects.Db4o.DTrace(true, true, "new ObjectReference" , true); PersistentBaseNewSlot = new Db4objects.Db4o.DTrace(true, true, "PersistentBase new slot" , true); PersistentOwnLength = new Db4objects.Db4o.DTrace(true, true, "Persistent own length" , true); PersistentbaseWrite = new Db4objects.Db4o.DTrace(true, true, "persistentbase write" , true); PersistentbaseSetId = new Db4objects.Db4o.DTrace(true, true, "persistentbase setid" , true); ProduceSlotChange = new Db4objects.Db4o.DTrace(true, true, "produce slot change", true); QueryProcess = new Db4objects.Db4o.DTrace(true, true, "query process", true); ReadArrayWrapper = new Db4objects.Db4o.DTrace(true, true, "read array wrapper", true ); ReadBytes = new Db4objects.Db4o.DTrace(true, true, "readBytes", true); ReadSlot = new Db4objects.Db4o.DTrace(true, true, "read slot", true); ReferenceRemoved = new Db4objects.Db4o.DTrace(true, true, "reference removed", true ); RegularSeek = new Db4objects.Db4o.DTrace(true, true, "regular seek", true); RemoveFromClassIndex = new Db4objects.Db4o.DTrace(true, true, "trans removeFromClassIndexTree" , true); RereadOldUuid = new Db4objects.Db4o.DTrace(true, true, "reread old uuid", true); ServerMessageLoopException = new Db4objects.Db4o.DTrace(true, true, "server message loop exception" , true); SlotMapped = new Db4objects.Db4o.DTrace(true, true, "slot mapped", true); SlotCommitted = new Db4objects.Db4o.DTrace(true, true, "slot committed", true); SlotFreeOnCommit = new Db4objects.Db4o.DTrace(true, true, "slot free on commit", true); SlotFreeOnRollbackId = new Db4objects.Db4o.DTrace(true, true, "slot free on rollback id" , true); SlotFreeOnRollbackAddress = new Db4objects.Db4o.DTrace(true, true, "slot free on rollback address" , true); SlotRead = new Db4objects.Db4o.DTrace(true, true, "slot read", true); TransCommit = new Db4objects.Db4o.DTrace(true, true, "trans commit", true); TransDelete = new Db4objects.Db4o.DTrace(true, true, "trans delete", true); TransDontDelete = new Db4objects.Db4o.DTrace(true, true, "trans dontDelete", true ); TransFlush = new Db4objects.Db4o.DTrace(true, true, "trans flush", true); WriteBytes = new Db4objects.Db4o.DTrace(true, true, "writeBytes", true); WritePointer = new Db4objects.Db4o.DTrace(true, true, "write pointer", true); WriteUpdateAdjustIndexes = new Db4objects.Db4o.DTrace(true, true, "trans writeUpdateDeleteMembers" , true); WriteXbytes = new Db4objects.Db4o.DTrace(true, true, "writeXBytes", true); Configure(); } } private static void TrackEventsWithoutRange() { _trackEventsWithoutRange = true; } private DTrace(bool enabled_, bool break_, string tag_, bool log_) { if (enabled) { _enabled = enabled_; _break = break_; _tag = tag_; _log = log_; if (all == null) { all = new Db4objects.Db4o.DTrace[100]; } all[current++] = this; } } private bool _enabled; private bool _break; private bool _log; private string _tag; private static long[] _rangeStart; private static long[] _rangeEnd; private static int _rangeCount; public static long _eventNr; private static long[] _breakEventNrs; private static int _breakEventCount; private static bool _breakAfterEvent; private static bool _trackEventsWithoutRange; public static Db4objects.Db4o.DTrace AddToClassIndex; public static Db4objects.Db4o.DTrace BeginTopLevelCall; public static Db4objects.Db4o.DTrace Bind; public static Db4objects.Db4o.DTrace BlockingQueueStoppedException; public static Db4objects.Db4o.DTrace BtreeNodeCommitOrRollback; public static Db4objects.Db4o.DTrace BtreeNodeRemove; public static Db4objects.Db4o.DTrace BtreeProduceNode; public static Db4objects.Db4o.DTrace CandidateRead; public static Db4objects.Db4o.DTrace ClassmetadataById; public static Db4objects.Db4o.DTrace ClassmetadataInit; public static Db4objects.Db4o.DTrace ClientMessageLoopException; public static Db4objects.Db4o.DTrace Close; public static Db4objects.Db4o.DTrace CloseCalled; public static Db4objects.Db4o.DTrace CollectChildren; public static Db4objects.Db4o.DTrace Commit; public static Db4objects.Db4o.DTrace Continueset; public static Db4objects.Db4o.DTrace CreateCandidate; public static Db4objects.Db4o.DTrace Delete; public static Db4objects.Db4o.DTrace Donotinclude; public static Db4objects.Db4o.DTrace EndTopLevelCall; public static Db4objects.Db4o.DTrace EvaluateSelf; public static Db4objects.Db4o.DTrace FatalException; public static Db4objects.Db4o.DTrace FileFree; public static Db4objects.Db4o.DTrace FileRead; public static Db4objects.Db4o.DTrace FileWrite; public static Db4objects.Db4o.DTrace Free; public static Db4objects.Db4o.DTrace FreespacemanagerGetSlot; public static Db4objects.Db4o.DTrace FreespacemanagerRamFree; public static Db4objects.Db4o.DTrace FreespacemanagerBtreeFree; public static Db4objects.Db4o.DTrace FreeOnCommit; public static Db4objects.Db4o.DTrace FreeOnRollback; public static Db4objects.Db4o.DTrace FreePointerOnRollback; public static Db4objects.Db4o.DTrace GetSlot; public static Db4objects.Db4o.DTrace GetPointerSlot; public static Db4objects.Db4o.DTrace GetFreespaceRam; public static Db4objects.Db4o.DTrace GetYapobject; public static Db4objects.Db4o.DTrace IdTreeAdd; public static Db4objects.Db4o.DTrace IdTreeRemove; public static Db4objects.Db4o.DTrace IoCopy; public static Db4objects.Db4o.DTrace JustSet; public static Db4objects.Db4o.DTrace NewInstance; public static Db4objects.Db4o.DTrace NotifySlotCreated; public static Db4objects.Db4o.DTrace NotifySlotUpdated; public static Db4objects.Db4o.DTrace NotifySlotDeleted; public static Db4objects.Db4o.DTrace ObjectReferenceCreated; public static Db4objects.Db4o.DTrace PersistentBaseNewSlot; public static Db4objects.Db4o.DTrace PersistentOwnLength; public static Db4objects.Db4o.DTrace PersistentbaseSetId; public static Db4objects.Db4o.DTrace PersistentbaseWrite; public static Db4objects.Db4o.DTrace ProduceSlotChange; public static Db4objects.Db4o.DTrace QueryProcess; public static Db4objects.Db4o.DTrace ReadArrayWrapper; public static Db4objects.Db4o.DTrace ReadBytes; public static Db4objects.Db4o.DTrace ReadSlot; public static Db4objects.Db4o.DTrace ReferenceRemoved; public static Db4objects.Db4o.DTrace RegularSeek; public static Db4objects.Db4o.DTrace RemoveFromClassIndex; public static Db4objects.Db4o.DTrace RereadOldUuid; public static Db4objects.Db4o.DTrace ServerMessageLoopException; public static Db4objects.Db4o.DTrace SlotMapped; public static Db4objects.Db4o.DTrace SlotCommitted; public static Db4objects.Db4o.DTrace SlotFreeOnCommit; public static Db4objects.Db4o.DTrace SlotFreeOnRollbackId; public static Db4objects.Db4o.DTrace SlotFreeOnRollbackAddress; public static Db4objects.Db4o.DTrace SlotRead; public static Db4objects.Db4o.DTrace TransCommit; public static Db4objects.Db4o.DTrace TransDontDelete; public static Db4objects.Db4o.DTrace TransDelete; public static Db4objects.Db4o.DTrace TransFlush; public static Db4objects.Db4o.DTrace WriteBytes; public static Db4objects.Db4o.DTrace WritePointer; public static Db4objects.Db4o.DTrace WriteXbytes; public static Db4objects.Db4o.DTrace WriteUpdateAdjustIndexes; static DTrace() { Init(); } private static Db4objects.Db4o.DTrace[] all; private static int current; public virtual void Log() { if (enabled) { Log(Unused); } } public virtual void Log(string msg) { if (enabled) { Log(Unused, msg); } } public virtual void Log(long p) { if (enabled) { LogLength(p, 1); } } public virtual void LogInfo(string info) { if (enabled) { LogEnd(Unused, Unused, 0, info); } } public virtual void Log(long p, string info) { if (enabled) { LogEnd(Unused, p, 0, info); } } public virtual void LogLength(long start, long length) { if (enabled) { LogLength(Unused, start, length); } } public virtual void LogLength(long id, long start, long length) { if (enabled) { LogEnd(id, start, start + length - 1); } } public virtual void LogLength(Slot slot) { if (enabled) { LogLength(Unused, slot); } } public virtual void LogLength(long id, Slot slot) { if (enabled) { if (slot == null) { return; } LogLength(id, slot.Address(), slot.Length()); } } public virtual void LogEnd(long start, long end) { if (enabled) { LogEnd(Unused, start, end); } } public virtual void LogEnd(long id, long start, long end) { if (enabled) { LogEnd(id, start, end, null); } } public virtual void LogEnd(long id, long start, long end, string info) { // if(! Deploy.log){ // return; // } if (enabled) { if (!_enabled) { return; } bool inRange = false; if (_rangeCount == 0) { inRange = true; } for (int i = 0; i < _rangeCount; i++) { // Case 0 ID in range if (id >= _rangeStart[i] && id <= _rangeEnd[i]) { inRange = true; break; } // Case 1 start in range if (start >= _rangeStart[i] && start <= _rangeEnd[i]) { inRange = true; break; } if (end != 0) { // Case 2 end in range if (end >= _rangeStart[i] && end <= _rangeEnd[i]) { inRange = true; break; } // Case 3 start before range, end after range if (start <= _rangeStart[i] && end >= _rangeEnd[i]) { inRange = true; break; } } } if (inRange || (_trackEventsWithoutRange && (start == Unused))) { if (_log) { _eventNr++; StringBuilder sb = new StringBuilder(":"); sb.Append(FormatInt(_eventNr, 6)); sb.Append(":"); sb.Append(FormatInt(id)); sb.Append(":"); sb.Append(FormatInt(start)); sb.Append(":"); if (end != 0 && start != end) { sb.Append(FormatInt(end)); sb.Append(":"); sb.Append(FormatInt(end - start + 1)); } else { sb.Append(FormatUnused()); sb.Append(":"); sb.Append(FormatUnused()); } sb.Append(":"); if (info != null) { sb.Append(" " + info + " "); sb.Append(":"); } sb.Append(" "); sb.Append(_tag); LogToOutput(sb.ToString()); } if (_break) { if (_breakEventCount > 0) { for (int i = 0; i < _breakEventCount; i++) { if (_breakEventNrs[i] == _eventNr) { BreakPoint(); break; } } if (_breakAfterEvent) { for (int i = 0; i < _breakEventCount; i++) { if (_breakEventNrs[i] <= _eventNr) { BreakPoint(); break; } } } } else { BreakPoint(); } } } } } private string FormatUnused() { return FormatInt(Unused); } private static void LogToOutput(string msg) { if (enabled) { LogToFile(msg); LogToConsole(msg); } } private static void LogToConsole(string msg) { if (enabled) { if (writeToConsole) { Sharpen.Runtime.Out.WriteLine(msg); } } } private static void LogToFile(string msg) { if (enabled) { if (!writeToLogFile) { return; } lock (Lock) { if (_logFile == null) { try { _logFile = new RandomAccessFile(LogFile(), "rw"); LogToFile("\r\n\r\n ********** BEGIN LOG ********** \r\n\r\n "); } catch (IOException e) { Sharpen.Runtime.PrintStackTrace(e); } } msg = DateHandlerBase.Now() + "\r\n" + msg + "\r\n"; byte[] bytes = stringIO.Write(msg); try { _logFile.Write(bytes); } catch (IOException e) { Sharpen.Runtime.PrintStackTrace(e); } } } } private static string LogFile() { if (enabled) { if (logFileName != null) { return logFileName; } logFileName = "db4oDTrace_" + DateHandlerBase.Now() + "_" + SignatureGenerator.GenerateSignature () + ".log"; logFileName = logFileName.Replace(' ', '_'); logFileName = logFileName.Replace(':', '_'); logFileName = logFileName.Replace('-', '_'); return logFilePath + logFileName; } return null; } public static void AddRange(long pos) { if (enabled) { AddRangeWithEnd(pos, pos); } } public static void AddRangeWithLength(long start, long length) { if (enabled) { AddRangeWithEnd(start, start + length - 1); } } public static void AddRangeWithEnd(long start, long end) { if (enabled) { if (_rangeStart == null) { _rangeStart = new long[1000]; _rangeEnd = new long[1000]; } _rangeStart[_rangeCount] = start; _rangeEnd[_rangeCount] = end; _rangeCount++; } } // private static void breakFromEvent(long eventNr){ // breakOnEvent(eventNr); // _breakAfterEvent = true; // } private static void BreakOnEvent(long eventNr) { if (enabled) { if (_breakEventNrs == null) { _breakEventNrs = new long[100]; } _breakEventNrs[_breakEventCount] = eventNr; _breakEventCount++; } } private string FormatInt(long i, int len) { if (enabled) { string str = " "; if (i != Unused) { str += i + " "; } return Sharpen.Runtime.Substring(str, str.Length - len); } return null; } private string FormatInt(long i) { if (enabled) { return FormatInt(i, 10); } return null; } private static void TurnAllOffExceptFor(Db4objects.Db4o.DTrace[] these) { if (enabled) { for (int i = 0; i < all.Length; i++) { if (all[i] == null) { break; } bool turnOff = true; for (int j = 0; j < these.Length; j++) { if (all[i] == these[j]) { turnOff = false; break; } } if (turnOff) { all[i]._break = false; all[i]._enabled = false; all[i]._log = false; } } } } public static void NoWarnings() { BreakOnEvent(0); TrackEventsWithoutRange(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IInternal4.cs0000644000175000017500000000053711700531646025414 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o { /// Marker interface to denote that a class is used for db4o internals. /// Marker interface to denote that a class is used for db4o internals. /// public interface IInternal4 { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Activation/0000755000175000017500000000000011700531646025210 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Activation/ActivationPurpose.cs0000644000175000017500000000025211700531646031215 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Activation { public enum ActivationPurpose { Read, Write } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Activation/IActivator.cs0000644000175000017500000000244011700531646027604 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Activation; namespace Db4objects.Db4o.Activation { /// /// Activator interface.
///

/// Db4objects.Db4o.TA.IActivatable /// objects need to have a reference to /// an Activator implementation, which is called /// by Transparent Activation, when a request is received to /// activate the host object. ///
/// Transparent Activation framework. /// public interface IActivator { /// Method to be called to activate the host object. /// Method to be called to activate the host object. /// /// for which purpose is the object being activated? /// ActivationPurpose.Write /// will cause the object /// to be saved on the next /// Db4objects.Db4o.IObjectContainer.Commit() /// /// operation. /// void Activate(ActivationPurpose purpose); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/0000755000175000017500000000000011700531646024314 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IObjectConstructor.cs0000644000175000017500000000331711700531646030434 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// /// interface to allow instantiating objects by calling specific constructors. /// /// /// /// interface to allow instantiating objects by calling specific constructors. ///

/// By writing classes that implement this interface, it is possible to /// define which constructor is to be used during the instantiation of a stored object. ///

/// Before starting a db4o session, translator classes that implement the /// ObjectConstructor or /// IObjectTranslator /// need to be registered.

/// Example:
/// /// IConfiguration config = Db4oFactory.Configure();
/// IObjectClass oc = config.ObjectClass("Namespace.ClassName");
/// oc.Translate(new FooTranslator()); ///


///
public interface IObjectConstructor : IObjectTranslator { /// db4o calls this method when a stored object needs to be instantiated. /// /// db4o calls this method when a stored object needs to be instantiated. ///

///
/// the ObjectContainer used /// /// the object stored with /// ObjectTranslator.onStore /// /// . /// /// the instantiated object. object OnInstantiate(IObjectContainer container, object storedObject); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/ICacheConfigurationProvider.cs0000644000175000017500000000123411700531646032222 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// /// A configuration provider that provides access /// to the cache-related configuration methods. /// /// /// A configuration provider that provides access /// to the cache-related configuration methods. /// public interface ICacheConfigurationProvider { /// Access to the cache-related configuration methods. /// Access to the cache-related configuration methods. ICacheConfiguration Cache { get; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/TNull.cs0000644000175000017500000000102611700531646025700 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// public class TNull : IObjectTranslator { public virtual object OnStore(IObjectContainer con, object @object) { return null; } public virtual void OnActivate(IObjectContainer con, object @object, object members ) { } public virtual Type StoredClass() { return typeof(object); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IFileConfigurationProvider.cs0000644000175000017500000000122511700531646032076 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// /// A configuration provider that provides access /// to the file-related configuration methods. /// /// /// A configuration provider that provides access /// to the file-related configuration methods. /// public interface IFileConfigurationProvider { /// Access to the file-related configuration methods. /// Access to the file-related configuration methods. IFileConfiguration File { get; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IEmbeddedConfigurationItem.cs0000644000175000017500000000250611700531646032017 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// /// Implement this interface for configuration items that encapsulate /// a batch of configuration settings or that need to be applied /// to EmbeddedObjectContainers after they are opened. /// /// /// Implement this interface for configuration items that encapsulate /// a batch of configuration settings or that need to be applied /// to EmbeddedObjectContainers after they are opened. /// /// 7.12 public interface IEmbeddedConfigurationItem { /// Gives a chance for the item to augment the configuration. /// Gives a chance for the item to augment the configuration. /// the configuration that the item was added to void Prepare(IEmbeddedConfiguration configuration); /// Gives a chance for the item to configure the just opened ObjectContainer. /// /// Gives a chance for the item to configure the just opened ObjectContainer. /// /// the ObjectContainer to configure void Apply(IEmbeddedObjectContainer db); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/ICacheConfiguration.cs0000644000175000017500000000132111700531646030504 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Config { /// Interface to configure the cache configurations. /// Interface to configure the cache configurations. public interface ICacheConfiguration { /// /// configures the size of the slot cache to hold a number of /// slots in the cache. /// /// /// configures the size of the slot cache to hold a number of /// slots in the cache. /// /// the number of slots [System.ObsoleteAttribute(@"since 7.14 BTrees have their own LRU cache now.")] int SlotCacheSize { set; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/QueryEvaluationMode.cs0000644000175000017500000001027411700531646030611 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Config { /// /// This class provides static constants for the query evaluation /// modes that db4o supports. /// /// /// This class provides static constants for the query evaluation /// modes that db4o supports. ///

For detailed documentation please see /// IQueryConfiguration.EvaluationMode(QueryEvaluationMode) /// /// ///
public class QueryEvaluationMode { private readonly string _id; private QueryEvaluationMode(string id) { _id = id; } /// Constant for immediate query evaluation. /// /// Constant for immediate query evaluation. The query is executed fully /// when /// Db4objects.Db4o.Query.IQuery.Execute() /// /// is called. ///

For detailed documentation please see /// IQueryConfiguration.EvaluationMode(QueryEvaluationMode) /// /// ///
public static readonly Db4objects.Db4o.Config.QueryEvaluationMode Immediate = new Db4objects.Db4o.Config.QueryEvaluationMode("IMMEDIATE"); /// Constant for snapshot query evaluation. /// /// Constant for snapshot query evaluation. When /// Db4objects.Db4o.Query.IQuery.Execute() /// /// is called, /// the query processor chooses the best indexes, does all index processing /// and creates a snapshot of the index at this point in time. Non-indexed /// constraints are evaluated lazily when the application iterates through /// the /// Db4objects.Db4o.IObjectSet /// resultset of the query. ///

For detailed documentation please see /// IQueryConfiguration.EvaluationMode(QueryEvaluationMode) /// /// ///
public static readonly Db4objects.Db4o.Config.QueryEvaluationMode Snapshot = new Db4objects.Db4o.Config.QueryEvaluationMode("SNAPSHOT"); /// Constant for lazy query evaluation. /// /// Constant for lazy query evaluation. When /// Db4objects.Db4o.Query.IQuery.Execute() /// /// is called, the /// query processor only chooses the best index and creates an iterator on /// this index. Indexes and constraints are evaluated lazily when the /// application iterates through the /// Db4objects.Db4o.IObjectSet /// resultset of the query. ///

For detailed documentation please see /// IQueryConfiguration.EvaluationMode(QueryEvaluationMode) /// /// ///
public static readonly Db4objects.Db4o.Config.QueryEvaluationMode Lazy = new Db4objects.Db4o.Config.QueryEvaluationMode ("LAZY"); private static readonly Db4objects.Db4o.Config.QueryEvaluationMode[] Modes = new Db4objects.Db4o.Config.QueryEvaluationMode[] { Db4objects.Db4o.Config.QueryEvaluationMode .Immediate, Db4objects.Db4o.Config.QueryEvaluationMode.Snapshot, Db4objects.Db4o.Config.QueryEvaluationMode .Lazy }; /// internal method, ignore please. /// internal method, ignore please. public virtual int AsInt() { for (int i = 0; i < Modes.Length; i++) { if (Modes[i] == this) { return i; } } throw new InvalidOperationException(); } /// internal method, ignore please. /// internal method, ignore please. public static Db4objects.Db4o.Config.QueryEvaluationMode FromInt(int i) { return Modes[i]; } public override string ToString() { return _id; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IEmbeddedConfiguration.cs0000644000175000017500000000163111700531646031176 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// Configuration interface for db4o in embedded use. /// Configuration interface for db4o in embedded use. /// 7.5 public interface IEmbeddedConfiguration : IFileConfigurationProvider, ICommonConfigurationProvider , ICacheConfigurationProvider, IIdSystemConfigurationProvider { /// /// adds ConfigurationItems to be applied when /// a networking /// EmbeddedObjectContainer /// is opened. /// /// /// the /// IEmbeddedConfigurationItem /// /// 7.12 void AddConfigurationItem(IEmbeddedConfigurationItem configItem); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IEnvironmentConfiguration.cs0000644000175000017500000000147211700531646032014 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Config { /// Configures the environment (set of services) used by db4o. /// Configures the environment (set of services) used by db4o. /// Db4objects.Db4o.Foundation.IEnvironment /// /// Db4objects.Db4o.Foundation.Environments.My(System.Type<T>) /// public interface IEnvironmentConfiguration { /// Contributes a service to the db4o environment. /// Contributes a service to the db4o environment. /// void Add(object service); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IFreespaceFiller.cs0000644000175000017500000000124311700531646030007 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.IO; namespace Db4objects.Db4o.Config { /// Callback hook for overwriting freed space in the database file. /// Callback hook for overwriting freed space in the database file. public interface IFreespaceFiller { /// Called to overwrite freed space in the database file. /// Called to overwrite freed space in the database file. /// Handle for the freed slot /// void Fill(BlockAwareBinWindow io); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/Entry.cs0000644000175000017500000000054211700531646025745 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// public class Entry : ICompare, IInternal4 { public object key; public object value; public virtual object Compare() { return key; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IIdSystemConfigurationProvider.cs0000644000175000017500000000126111700531646032760 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// /// A configuration provider that provides access /// to the IdSystem-related configuration methods. /// /// /// A configuration provider that provides access /// to the IdSystem-related configuration methods. /// public interface IIdSystemConfigurationProvider { /// Access to the IdSystem-related configuration methods. /// Access to the IdSystem-related configuration methods. IIdSystemConfiguration IdSystem { get; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IAlias.cs0000644000175000017500000000537111700531646026013 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Config { /// /// Implement this interface when implementing special custom Aliases /// for classes, packages or namespaces. /// /// /// /// Implement this interface when implementing special custom Aliases /// for classes, packages or namespaces. ///

Aliases can be used to persist classes in the running /// application to different persistent classes in a database file /// or on a db4o server. ///

Two simple Alias implementations are supplied along with /// db4o:
/// - /// TypeAlias /// provides an #equals() resolver to match /// names directly.
/// - /// WildcardAlias /// allows simple pattern matching /// with one single '*' wildcard character.
///
/// It is possible to create /// own complex /// IAlias /// constructs by creating own resolvers /// that implement the /// IAlias /// interface. ///

/// Examples of concrete usecases: ///

/// /// // Creating an Alias for a single class
/// ICommonConfiguration.AddAlias(
///   new TypeAlias("Tutorial.Pilot", "Tutorial.Driver"));
///

/// // Accessing a Java package from a .NET assembly
/// ICommonConfiguration.AddAlias(
///   new WildcardAlias(
///     "com.f1.*",
///     "Tutorial.F1.*, Tutorial"));
///

/// // Using a different local .NET assembly
/// ICommonConfiguration.AddAlias(
///   new WildcardAlias(
///     "Tutorial.F1.*, F1Race",
///     "Tutorial.F1.*, Tutorial"));
///

///
///

Aliases that translate the persistent name of a class to /// a name that already exists as a persistent name in the database /// (or on the server) are not permitted and will throw an exception /// when the database file is opened. ///

Aliases should be configured before opening a database file /// or connecting to a server. /// ///
public interface IAlias { /// return the stored name for a runtime name or null if not handled. /// return the stored name for a runtime name or null if not handled. string ResolveRuntimeName(string runtimeTypeName); /// return the runtime name for a stored name or null if not handled. /// return the runtime name for a stored name or null if not handled. string ResolveStoredName(string storedTypeName); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IObjectAttribute.cs0000644000175000017500000000117511700531646030052 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Config { /// generic interface to allow returning an attribute of an object. /// generic interface to allow returning an attribute of an object. public interface IObjectAttribute { /// generic method to return an attribute of a parent object. /// generic method to return an attribute of a parent object. /// the parent object /// Object - the attribute object Attribute(object parent); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IConfigurationItem.cs0000644000175000017500000000243411700531646030405 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Config { /// /// Implement this interface for configuration items that encapsulate /// a batch of configuration settings or that need to be applied /// to ObjectContainers after they are opened. /// /// /// Implement this interface for configuration items that encapsulate /// a batch of configuration settings or that need to be applied /// to ObjectContainers after they are opened. /// public interface IConfigurationItem { /// Gives a chance for the item to augment the configuration. /// Gives a chance for the item to augment the configuration. /// the configuration that the item was added to void Prepare(IConfiguration configuration); /// Gives a chance for the item to configure the just opened ObjectContainer. /// /// Gives a chance for the item to configure the just opened ObjectContainer. /// /// the ObjectContainer to configure void Apply(IInternalObjectContainer container); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/Encoding/0000755000175000017500000000000011700531646026042 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/Encoding/StringEncodings.cs0000644000175000017500000000135411700531646031474 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config.Encoding; using Db4objects.Db4o.Internal.Encoding; namespace Db4objects.Db4o.Config.Encoding { /// All built in String encodings /// Db4objects.Db4o.Config.IConfiguration.StringEncoding(IStringEncoding) public class StringEncodings { public static IStringEncoding Utf8() { return new UTF8StringEncoding(); } public static IStringEncoding Unicode() { return new UnicodeStringEncoding(); } public static IStringEncoding Latin() { return new LatinStringEncoding(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/Encoding/IStringEncoding.cs0000644000175000017500000000202511700531646031416 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Config.Encoding { /// /// encodes a String to a byte array and decodes a String /// from a part of a byte array /// public interface IStringEncoding { /// called when a string is to be encoded to a byte array. /// called when a string is to be encoded to a byte array. /// the string to encode /// the encoded byte array byte[] Encode(string str); /// called when a byte array is to be decoded to a string. /// called when a byte array is to be decoded to a string. /// the byte array /// the start offset in the byte array /// the length of the encoded string in the byte array /// the string string Decode(byte[] bytes, int start, int length); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IIdSystemFactory.cs0000644000175000017500000000115111700531646030043 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Ids; namespace Db4objects.Db4o.Config { /// Factory interface to create a custom IdSystem. /// Factory interface to create a custom IdSystem. /// public interface IIdSystemFactory { /// creates /// /// IIdSystem NewInstance(LocalObjectContainer container); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/ConfigScope.cs0000644000175000017500000000707511700531646027053 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Config { /// /// Defines a scope of applicability of a config setting.

/// Some of the configuration settings can be either:

/// - enabled globally;
/// - enabled individually for a specified class;
/// - disabled.

///
/// IConfiguration.GenerateUUIDs(ConfigScope) /// /// IConfiguration.GenerateVersionNumbers(ConfigScope) /// [System.Serializable] public sealed class ConfigScope { public const int DisabledId = -1; public const int IndividuallyId = 1; public const int GloballyId = int.MaxValue; private static readonly string DisabledName = "disabled"; private static readonly string IndividuallyName = "individually"; private static readonly string GloballyName = "globally"; /// Marks a configuration feature as globally disabled. /// Marks a configuration feature as globally disabled. public static readonly Db4objects.Db4o.Config.ConfigScope Disabled = new Db4objects.Db4o.Config.ConfigScope (DisabledId, DisabledName); /// Marks a configuration feature as individually configurable. /// Marks a configuration feature as individually configurable. public static readonly Db4objects.Db4o.Config.ConfigScope Individually = new Db4objects.Db4o.Config.ConfigScope (IndividuallyId, IndividuallyName); /// Marks a configuration feature as globally enabled. /// Marks a configuration feature as globally enabled. public static readonly Db4objects.Db4o.Config.ConfigScope Globally = new Db4objects.Db4o.Config.ConfigScope (GloballyId, GloballyName); private readonly int _value; private readonly string _name; private ConfigScope(int value, string name) { _value = value; _name = name; } /// /// Checks if the current configuration scope is globally /// enabled or disabled. /// /// /// Checks if the current configuration scope is globally /// enabled or disabled. /// /// - default result /// /// false if disabled, true if globally enabled, default /// value otherwise /// public bool ApplyConfig(TernaryBool defaultValue) { switch (_value) { case DisabledId: { return false; } case GloballyId: { return !defaultValue.DefiniteNo(); } default: { return defaultValue.DefiniteYes(); break; } } } public override bool Equals(object obj) { if (this == obj) { return true; } if (obj == null || GetType() != obj.GetType()) { return false; } Db4objects.Db4o.Config.ConfigScope tb = (Db4objects.Db4o.Config.ConfigScope)obj; return _value == tb._value; } public override int GetHashCode() { return _value; } private object ReadResolve() { switch (_value) { case DisabledId: { return Disabled; } case IndividuallyId: { return Individually; } default: { return Globally; break; } } } public override string ToString() { return _name; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IQueryConfiguration.cs0000644000175000017500000001576511700531646030627 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// interface to configure the querying settings to be used by the query processor. /// /// /// interface to configure the querying settings to be used by the query processor. ///

All settings can be configured after opening an ObjectContainer. /// In a Client/Server setup the client-side configuration will be used. ///
public interface IQueryConfiguration { /// configures the query processor evaluation mode. /// /// configures the query processor evaluation mode. ///

The db4o query processor can run in three modes:
/// - Immediate mode
/// - Snapshot mode
/// - Lazy mode

/// In Immediate mode, a query will be fully evaluated when /// Db4objects.Db4o.Query.IQuery.Execute() /// /// /// is called. The complete /// Db4objects.Db4o.IObjectSet /// of all matching IDs is /// generated immediately.

/// In Snapshot mode, the /// Db4objects.Db4o.Query.IQuery.Execute() /// /// call will trigger all index /// processing immediately. A snapshot of the current state of all relevant indexes /// is taken for further processing by the SODA query processor. All non-indexed /// constraints and all evaluations will be run when the user application iterates /// through the resulting /// Db4objects.Db4o.IObjectSet /// .

/// In Lazy mode, the /// Db4objects.Db4o.Query.IQuery.Execute() /// /// call will only create an Iterator /// against the best index found. Further query processing (including all index /// processing) will happen when the user application iterates through the resulting /// Db4objects.Db4o.IObjectSet /// .

/// Advantages and disadvantages of the individual modes:

/// Immediate mode
/// + If the query is intended to iterate through the entire resulting /// Db4objects.Db4o.IObjectSet /// , /// this mode will be slightly faster than the others.
/// + The query will process without intermediate side effects from changed /// objects (by the caller or by other transactions).
/// - Query processing can block the server for a long time.
/// - In comparison to the other modes it will take longest until the first results /// are returned.
/// - The ObjectSet will require a considerate amount of memory to hold the IDs of /// all found objects.

/// Snapshot mode
/// + Index processing will happen without possible side effects from changes made /// by the caller or by other transaction.
/// + Since index processing is fast, a server will not be blocked for a long time.
/// - The entire candidate index will be loaded into memory. It will stay there /// until the query ObjectSet is garbage collected. In a C/S setup, the memory will /// be used on the server side.

/// Lazy mode
/// + The call to /// Db4objects.Db4o.Query.IQuery.Execute() /// /// will return very fast. First results can be /// made available to the application before the query is fully processed.
/// + A query will consume hardly any memory at all because no intermediate ID /// representation is ever created.
/// - Lazy queries check candidates when iterating through the resulting /// Db4objects.Db4o.IObjectSet /// . /// In doing so the query processor takes changes into account that may have happened /// since the Query#execute()call: committed changes from other transactions, and /// uncommitted changes from the calling transaction. There is a wide range /// of possible side effects. The underlying index may have changed. Objects themselves /// may have changed in the meanwhile. There even is the chance of creating an endless /// loop, if the caller of the iterates through the /// Db4objects.Db4o.IObjectSet /// and changes each /// object in a way that it is placed at the end of the index: The same objects can be /// revisited over and over. In lazy mode it can make sense to work in a way one would /// work with collections to avoid concurrent modification exceptions. For instance one /// could iterate through the /// Db4objects.Db4o.IObjectSet /// first and store all objects to a temporary /// other collection representation before changing objects and storing them back to db4o.

/// Note: Some method calls against a lazy /// Db4objects.Db4o.IObjectSet /// will require the query /// processor to create a snapshot or to evaluate the query fully. An example of such /// a call is /// Db4objects.Db4o.IObjectSet.Count() /// /// . ///

/// The default query evaluation mode is Immediate mode. ///

/// Recommendations:
/// - Lazy mode can be an excellent choice for single transaction read use, /// to keep memory consumption as low as possible.
/// - Client/Server applications with the risk of concurrent modifications should prefer /// Snapshot mode to avoid side effects from other transactions. ///

/// To change the evaluationMode, pass any of the three static /// QueryEvaluationMode /// constants from the /// QueryEvaluationMode /// class to this method:
/// - /// QueryEvaluationMode.Immediate ///
/// - /// QueryEvaluationMode.Snapshot ///
/// - /// QueryEvaluationMode.Lazy ///

/// This setting must be issued from the client side. ///
void EvaluationMode(QueryEvaluationMode mode); /// EvaluationMode(QueryEvaluationMode) /// /// the currently configured query evaluation mode QueryEvaluationMode EvaluationMode(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/WildcardAlias.cs0000644000175000017500000000631111700531646027347 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// /// Wildcard Alias functionality to create aliases for packages, /// namespaces or multiple similar named classes. /// /// /// Wildcard Alias functionality to create aliases for packages, /// namespaces or multiple similar named classes. One single '*' /// wildcard character is supported in the names. ///

See /// IAlias /// for concrete examples. ///
public class WildcardAlias : IAlias { private readonly WildcardAlias.WildcardPattern _storedPattern; private readonly WildcardAlias.WildcardPattern _runtimePattern; /// /// Create a WildcardAlias with two patterns, the /// stored pattern and the pattern that is to be used /// at runtime. /// /// /// Create a WildcardAlias with two patterns, the /// stored pattern and the pattern that is to be used /// at runtime. One single '*' is allowed as a wildcard /// character. /// public WildcardAlias(string storedPattern, string runtimePattern) { if (null == storedPattern) { throw new ArgumentNullException("storedPattern"); } if (null == runtimePattern) { throw new ArgumentNullException("runtimePattern"); } _storedPattern = new WildcardAlias.WildcardPattern(storedPattern); _runtimePattern = new WildcardAlias.WildcardPattern(runtimePattern); } /// resolving is done through simple pattern matching public virtual string ResolveRuntimeName(string runtimeTypeName) { return Resolve(_runtimePattern, _storedPattern, runtimeTypeName); } /// resolving is done through simple pattern matching public virtual string ResolveStoredName(string storedTypeName) { return Resolve(_storedPattern, _runtimePattern, storedTypeName); } private string Resolve(WildcardAlias.WildcardPattern from, WildcardAlias.WildcardPattern to, string typeName) { string match = from.Matches(typeName); return match != null ? to.Inject(match) : null; } internal class WildcardPattern { private string _head; private string _tail; public WildcardPattern(string pattern) { string[] parts = Split(pattern); _head = parts[0]; _tail = parts[1]; } public virtual string Inject(string s) { return _head + s + _tail; } public virtual string Matches(string s) { if (!s.StartsWith(_head) || !s.EndsWith(_tail)) { return null; } return Sharpen.Runtime.Substring(s, _head.Length, s.Length - _tail.Length); } private void InvalidPattern() { throw new ArgumentException("only one '*' character"); } internal virtual string[] Split(string pattern) { int index = pattern.IndexOf('*'); if (-1 == index || index != pattern.LastIndexOf('*')) { InvalidPattern(); } return new string[] { Sharpen.Runtime.Substring(pattern, 0, index), Sharpen.Runtime.Substring (pattern, index + 1) }; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IFreespaceConfiguration.cs0000644000175000017500000000750011700531646031403 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// interface to configure the freespace system to be used. /// /// interface to configure the freespace system to be used. ///

All methods should be called before opening database files. /// If db4o is instructed to exchange the system /// ( /// UseBTreeSystem() /// , /// UseRamSystem() /// ) /// this will happen on opening the database file.

/// By default the ram based system will be used. ///
public interface IFreespaceConfiguration { /// /// tuning feature: configures the minimum size of free space slots in the database file /// that are to be reused. /// /// /// tuning feature: configures the minimum size of free space slots in the database file /// that are to be reused. ///

When objects are updated or deleted, the space previously occupied in the /// database file is marked as "free", so it can be reused. db4o maintains two lists /// in RAM, sorted by address and by size. Adjacent entries are merged. After a large /// number of updates or deletes have been executed, the lists can become large, causing /// RAM consumption and performance loss for maintenance. With this method you can /// specify an upper bound for the byte slot size to discard. ///

Pass Integer.MAX_VALUE to this method to discard all free slots for /// the best possible startup time.

/// The downside of setting this value: Database files will necessarily grow faster. ///

Default value:
/// 0 all space is reused ///
/// Slots with this size or smaller will be lost. void DiscardSmallerThan(int byteCount); /// /// Configure a way to overwrite freed space in the database file with custom /// (for example: random) bytes. /// /// /// Configure a way to overwrite freed space in the database file with custom /// (for example: random) bytes. Will slow down I/O operation. /// The value of this setting may be cached internally and can thus not be /// reliably set after an object container has been opened. /// /// The freespace overwriting callback to use void FreespaceFiller(IFreespaceFiller freespaceFiller); /// configures db4o to use a BTree-based freespace system. /// /// configures db4o to use a BTree-based freespace system. ///

Advantages
/// - ACID, no freespace is lost on abnormal system termination
/// - low memory consumption
///
Disadvantages
/// - slower than the RAM-based system, since freespace information /// is written during every commit
///
void UseBTreeSystem(); /// discontinued freespace system, only available before db4o 7.0. /// discontinued freespace system, only available before db4o 7.0. [System.ObsoleteAttribute(@"Please use the BTree freespace system instead by calling UseBTreeSystem() ." )] void UseIndexSystem(); /// configures db4o to use a RAM-based freespace system. /// /// configures db4o to use a RAM-based freespace system. ///

Advantages
/// - best performance
///
Disadvantages
/// - upon abnormal system termination all freespace is lost
/// - memory consumption
///
void UseRamSystem(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IConfiguration.cs0000644000175000017500000012065211700531646027571 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.IO; using Db4objects.Db4o.Config; using Db4objects.Db4o.Config.Encoding; using Db4objects.Db4o.Diagnostic; using Db4objects.Db4o.IO; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Config { /// configuration interface. /// /// configuration interface. ///

This interface contains methods to configure db4o.

/// The global Configuration context is available with /// Db4objects.Db4o.Db4oFactory.Configure() /// /// . /// When an ObjectContainer or ObjectServer is opened, the global Configuration /// context is cloned and copied into the ObjectContainer/ObjectServer. /// That means every ObjectContainer/ObjectServer gets it's own copy of /// configuration settings.

/// Most configuration settings should be set before opening an /// ObjectContainer/ObjectServer. ///

Some configuration settings can be modified on an open /// ObjectContainer/ObjectServer. The local Configuration context is /// available with /// Db4objects.Db4o.Ext.IExtObjectContainer.Configure() /// /// and /// Db4objects.Db4o.Ext.IExtObjectServer.Configure() /// /// . ///
public interface IConfiguration { /// sets the activation depth to the specified value. /// /// sets the activation depth to the specified value. ///

Why activation?
/// When objects are instantiated from the database, the instantiation of member /// objects needs to be limited to a certain depth. Otherwise a single object /// could lead to loading the complete database into memory, if all objects where /// reachable from a single root object.

/// db4o uses the concept "depth", the number of field-to-field hops an object /// is away from another object. The preconfigured "activation depth" db4o uses /// in the default setting is 5. ///

Whenever an application iterates through the /// IObjectSet /// of a query result, the result objects /// will be activated to the configured activation depth.

/// A concrete example with the preconfigured activation depth of 5:
///
		/// // Object foo is the result of a query, it is delivered by the ObjectSet
		/// object foo = objectSet.Next();
/// foo.member1.member2.member3.member4.member5 will be a valid object
/// foo, member1, member2, member3 and member4 will be activated
/// member5 will be deactivated, all of it's members will be null
/// member5 can be activated at any time by calling /// IObjectContainer.Activate(member5, depth) /// /// . ///

/// Note that raising the global activation depth will consume more memory and /// have negative effects on the performance of first-time retrievals. Lowering /// the global activation depth needs more individual activation work but can /// increase performance of queries.

/// IObjectContainer.Deactivate(object, depth) /// /// can be used to manually free memory by deactivating objects.

/// In client/server environment the same setting should be used on both /// client and server

. ///
/// the desired global activation depth. /// /// configuring classes individually /// /// /// gets the configured activation depth. void ActivationDepth(int depth); /// gets the configured activation depth. /// gets the configured activation depth. /// the configured activation depth. int ActivationDepth(); /// /// adds ConfigurationItems to be applied when /// an ObjectContainer or ObjectServer is opened. /// /// /// adds ConfigurationItems to be applied when /// an ObjectContainer or ObjectServer is opened. /// /// the ConfigurationItem void Add(IConfigurationItem configurationItem); /// adds a new Alias for a class, namespace or package. /// /// /// adds a new Alias for a class, namespace or package. ///
///
/// Aliases can be used to persist classes in the running application /// to different persistent classes in a database file or on a db4o /// server. ///
///
/// Two simple Alias implementations are supplied along with db4o: ///
/// - /// TypeAlias /// provides an #equals() resolver to match names directly. ///
/// - /// WildcardAlias /// allows simple pattern matching with one single '*' wildcard /// character. ///
///
/// It is possible to create own complex /// IAlias /// constructs by creating own resolvers that implement the /// IAlias /// interface. ///
///
/// Four examples of concrete usecases: ///
///
/// /// // Creating an Alias for a single class ///
/// Db4oFactory.Configure().AddAlias( ///
  new TypeAlias("Tutorial.F1.Pilot", "Tutorial.F1.Driver"));
///

/// // Accessing a Java package from a .NET assembly
/// Db4o.configure().addAlias(
///   new WildcardAlias(
///     "com.f1.*",
///     "Tutorial.F1.*, Tutorial"));
///

/// // Using a different local .NET assembly
/// Db4o.configure().addAlias(
///   new WildcardAlias(
///     "Tutorial.F1.*, Tutorial",
///     "Tutorial.F1.*, RaceClient"));
///
///

Aliases that translate the persistent name of a class to /// a name that already exists as a persistent name in the database /// (or on the server) are not permitted and will throw an exception /// when the database file is opened. ///

Aliases should be configured before opening a database file /// or connecting to a server. ///
void AddAlias(IAlias alias); /// /// Removes an alias previously added with /// AddAlias(IAlias) /// . /// /// the alias to remove void RemoveAlias(IAlias alias); /// turns automatic database file format version updates on. /// /// turns automatic database file format version updates on. ///

Upon db4o database file format version changes, /// db4o can automatically update database files to the /// current version. db4objects does not provide functionality /// to reverse this process. It is not ensured that updated /// database files can be read with older db4o versions. /// In some cases (Example: using ObjectManager) it may not be /// desirable to update database files automatically therefore /// automatic updating is turned off by default for /// security reasons. ///

Call this method to turn automatic database file /// version updating on. ///

If automatic updating is turned off, db4o will refuse /// to open database files that use an older database file format.

/// In client-server environment this setting should be used on both client /// and server. ///
void AllowVersionUpdates(bool flag); /// turns automatic shutdown of the engine on and off. /// /// turns automatic shutdown of the engine on and off. /// /// whether db4o should shut down automatically. void AutomaticShutDown(bool flag); /// sets the storage data blocksize for new ObjectContainers. /// /// sets the storage data blocksize for new ObjectContainers. ///

The standard setting is 1 allowing for a maximum /// database file size of 2GB. This value can be increased /// to allow larger database files, although some space will /// be lost to padding because the size of some stored objects /// will not be an exact multiple of the block size. A /// recommended setting for large database files is 8, since /// internal pointers have this length.

/// This setting is only effective when the database is first created, in /// client-server environment in most cases it means that the setting /// should be used on the server side. ///
/// the size in bytes from 1 to 127 /// void BlockSize(int bytes); /// configures the size of BTree nodes in indexes. /// /// configures the size of BTree nodes in indexes. ///

Default setting: 100 ///
Lower values will allow a lower memory footprint /// and more efficient reading and writing of small slots. ///
Higher values will reduce the overall number of /// read and write operations and allow better performance /// at the cost of more RAM use.

/// This setting should be used on both client and server in /// client-server environment. ///
/// the number of elements held in one BTree node. void BTreeNodeSize(int size); /// configures caching of BTree nodes. /// /// configures caching of BTree nodes. ///

Clean BTree nodes will be unloaded on #commit and /// #rollback unless they are configured as cached here. ///

Default setting: 0 ///
Possible settings: 1, 2 or 3 ///

The potential number of cached BTree nodes can be /// calculated with the following formula:
/// maxCachedNodes = bTreeNodeSize ^ bTreeCacheHeight

/// This setting should be used on both client and server in /// client-server environment. ///
/// the height of the cache from the root void BTreeCacheHeight(int height); /// returns the Cache configuration interface. /// returns the Cache configuration interface. ICacheConfiguration Cache(); /// turns callback methods on and off. /// /// turns callback methods on and off. ///

Callbacks are turned on by default.

/// A tuning hint: If callbacks are not used, you can turn this feature off, to /// prevent db4o from looking for callback methods in persistent classes. This will /// increase the performance on system startup.

/// In client/server environment this setting should be used on both /// client and server. ///
/// false to turn callback methods off /// Using callbacks void Callbacks(bool flag); /// /// advises db4o to try instantiating objects with/without calling /// constructors. /// /// /// advises db4o to try instantiating objects with/without calling /// constructors. ///

/// Not all .NET-environments support this feature. db4o will /// attempt, to follow the setting as good as the enviroment supports. /// This setting may also be overridden for individual classes in /// Db4objects.Db4o.Config.IObjectClass.CallConstructor /// /// . ///

The default setting depends on the features supported by your current environment.

/// In client/server environment this setting should be used on both /// client and server. ///

///
/// /// - specify true, to request calling constructors, specify /// false to request not calling constructors. /// /// Db4objects.Db4o.Config.IObjectClass.CallConstructor /// void CallConstructors(bool flag); /// /// turns /// individual class activation depth configuration /// /// on /// and off. ///

This feature is turned on by default.

/// In client/server environment this setting should be used on both /// client and server.

///
/// /// false to turn the possibility to individually configure class /// activation depths off /// /// Why activation? void ClassActivationDepthConfigurable(bool flag); /// returns client/server configuration interface. /// returns client/server configuration interface. IClientServerConfiguration ClientServer(); /// /// configures the size database files should grow in bytes, when no /// free slot is found within. /// /// /// configures the size database files should grow in bytes, when no /// free slot is found within. ///

Tuning setting. ///

Whenever no free slot of sufficient length can be found /// within the current database file, the database file's length /// is extended. This configuration setting configures by how much /// it should be extended, in bytes.

/// This configuration setting is intended to reduce fragmentation. /// Higher values will produce bigger database files and less /// fragmentation.

/// To extend the database file, a single byte array is created /// and written to the end of the file in one write operation. Be /// aware that a high setting will require allocating memory for /// this byte array. ///
/// amount of bytes void DatabaseGrowthSize(int bytes); /// /// tuning feature: configures whether db4o checks all persistent classes upon system /// startup, for added or removed fields. /// /// /// tuning feature: configures whether db4o checks all persistent classes upon system /// startup, for added or removed fields. ///

If this configuration setting is set to false while a database is /// being created, members of classes will not be detected and stored. ///

This setting can be set to false in a production environment after /// all persistent classes have been stored at least once and classes will not /// be modified any further in the future.

/// In a client/server environment this setting should be configured both on the /// client and and on the server. ///

Default value:
/// true ///
/// the desired setting void DetectSchemaChanges(bool flag); /// returns the configuration interface for diagnostics. /// returns the configuration interface for diagnostics. /// the configuration interface for diagnostics. IDiagnosticConfiguration Diagnostic(); /// turns commit recovery off. /// /// turns commit recovery off. ///

db4o uses a two-phase commit algorithm. In a first step all intended /// changes are written to a free place in the database file, the "transaction commit /// record". In a second step the /// actual changes are performed. If the system breaks down during commit, the /// commit process is restarted when the database file is opened the next time. /// On very rare occasions (possibilities: hardware failure or editing the database /// file with an external tool) the transaction commit record may be broken. In this /// case, this method can be used to try to open the database file without commit /// recovery. The method should only be used in emergency situations after consulting /// db4o support. ///
void DisableCommitRecovery(); /// configures the use of encryption. /// /// configures the use of encryption. ///

This method needs to be called before a database file /// is created with the first /// Db4objects.Db4o.Db4oFactory.OpenFile(string) /// /// . ///

If encryption is set to true, /// you need to supply a password to seed the encryption mechanism.

/// db4o database files keep their encryption format after creation.

///
/// /// true for turning encryption on, false for turning encryption /// off. /// /// Password(string) /// [System.ObsoleteAttribute(@"use a custom encrypting instead")] void Encrypt(bool flag); /// configures whether Exceptions are to be thrown, if objects can not be stored. /// /// /// configures whether Exceptions are to be thrown, if objects can not be stored. ///

db4o requires the presence of a constructor that can be used to /// instantiate objects. If no default public constructor is present, all /// available constructors are tested, whether an instance of the class can /// be instantiated. Null is passed to all constructor parameters. /// The first constructor that is successfully tested will /// be used throughout the running db4o session. If an instance of the class /// can not be instantiated, the object will not be stored. By default, /// execution will continue without any message or error. This method can /// be used to configure db4o to throw an /// ObjectNotStorableException /// /// if an object can not be stored. ///

/// The default for this setting is true.

/// In client/server environment this setting should be used on both /// client and server.

///
/// false to not throw Exceptions if objects can not be stored (fail silently). /// void ExceptionsOnNotStorable(bool flag); /// returns the freespace configuration interface. /// returns the freespace configuration interface. IFreespaceConfiguration Freespace(); /// configures db4o to generate UUIDs for stored objects. /// /// configures db4o to generate UUIDs for stored objects. /// This setting should be used when the database is first created.

///
/// the scope for UUID generation: disabled, generate for all classes, or configure individually /// void GenerateUUIDs(ConfigScope setting); /// configures db4o to generate version numbers for stored objects. /// /// configures db4o to generate version numbers for stored objects. /// This setting should be used when the database is first created. /// /// the scope for version number generation: disabled, generate for all classes, or configure individually /// [System.ObsoleteAttribute(@"As of version 8.0 please use GenerateCommitTimestamps(bool) instead." )] void GenerateVersionNumbers(ConfigScope setting); /// /// Configures db4o to generate commit timestamps for all stored objects.
///
/// All the objects commited within a transaction will share the same commit timestamp. ///
/// /// Configures db4o to generate commit timestamps for all stored objects.
///
/// All the objects commited within a transaction will share the same commit timestamp. ///
/// This setting should be used when the database is first created.
///
/// Afterwards you can access the object's commit timestamp like this:
///
///
		/// ObjectContainer container = ...;
		/// ObjectInfo objectInfo = container.ext().getObjectInfo(obj);
		/// long commitTimestamp = objectInfo.getVersion();
		/// 
///
/// /// if true, commit timetamps will be generated for all stored /// objects. If you already have commit timestamps for stored /// objects and later set this flag to false, although you wont be /// able to access them, the commit timestamps will still be taking /// space in your file container. The only way to free that space /// is defragmenting the container. /// /// 8.0 void GenerateCommitTimestamps(bool flag); /// configures db4o to call #intern() on strings upon retrieval. /// /// configures db4o to call #intern() on strings upon retrieval. /// In client/server environment the setting should be used on both /// client and server. /// /// true to intern strings void InternStrings(bool flag); /// returns true if strings will be interned. /// returns true if strings will be interned. bool InternStrings(); /// allows to configure db4o to use a customized byte IO adapter. /// /// allows to configure db4o to use a customized byte IO adapter. ///

Derive from the abstract class /// Db4objects.Db4o.IO.IoAdapter /// to /// write your own. Possible usecases could be improved performance /// with a native library, mirrored write to two files, encryption or /// read-on-write fail-safety control.

An example of a custom /// io adapter can be found in xtea_db4o community project:
/// http://developer.db4o.com/ProjectSpaces/view.aspx/XTEA

/// In client-server environment this setting should be used on the server /// (adapter class must be available)

///
/// - the IoAdapter /// [System.ObsoleteAttribute(@"Use Storage(Db4objects.Db4o.IO.IStorage) instead.")] void Io(IoAdapter adapter); /// allows to configure db4o to use a customized byte IO storage mechanism. /// /// allows to configure db4o to use a customized byte IO storage mechanism. ///

Implement the interface /// Db4objects.Db4o.IO.IStorage /// to /// write your own. Possible usecases could be improved performance /// with a native library, mirrored write to two files, encryption or /// read-on-write fail-safety control.

///
/// - the factory /// Db4objects.Db4o.IO.CachingStorage /// /// Db4objects.Db4o.IO.MemoryStorage /// /// Db4objects.Db4o.IO.FileStorage /// Db4objects.Db4o.IO.StorageDecorator /// /// /// /// returns the configured /// Db4objects.Db4o.IO.IStorage /// IStorage Storage { get; set; } /// /// returns the configured /// Db4objects.Db4o.IO.IoAdapter /// . /// /// [System.ObsoleteAttribute(@"Use Storage() instead.")] IoAdapter Io(); /// allows to mark fields as transient with custom attributes. /// /// allows to mark fields as transient with custom attributes. ///

.NET only: Call this method with the attribute name that you /// wish to use to mark fields as transient. Multiple transient attributes /// are possible by calling this method multiple times with different /// attribute names.

/// In client/server environment the setting should be used on both /// client and server.

///
/// /// - the fully qualified name of the attribute, including /// it's namespace /// void MarkTransient(string attributeName); /// sets the detail level of db4o messages. /// /// sets the detail level of db4o messages. Messages will be output to the /// configured output /// TextWriter /// . ///

/// Level 0 - no messages
/// Level 1 - open and close messages
/// Level 2 - messages for new, update and delete
/// Level 3 - messages for activate and deactivate

/// When using client-server and the level is set to 0, the server will override this and set it to 1. To get around this you can set the level to -1. This has the effect of not returning any messages.

/// In client-server environment this setting can be used on client or on server /// depending on which information do you want to track (server side provides more /// detailed information).

///
/// integer from 0 to 3 /// SetOut(System.IO.TextWriter) void MessageLevel(int level); /// can be used to turn the database file locking thread off. /// /// false to turn database file locking off. /// void LockDatabaseFile(bool flag); /// /// returns an /// IObjectClass /// object /// to configure the specified class. ///

/// The clazz parameter can be any of the following:
/// - a fully qualified classname as a String.
/// - a Class object.
/// - any other object to be used as a template.

///
/// class name, Class object, or example object.

/// /// an instance of an /// IObjectClass /// object for configuration. /// IObjectClass ObjectClass(object clazz); /// /// If set to true, db4o will try to optimize native queries /// dynamically at query execution time, otherwise it will /// run native queries in unoptimized mode as SODA evaluations. /// /// /// If set to true, db4o will try to optimize native queries /// dynamically at query execution time, otherwise it will /// run native queries in unoptimized mode as SODA evaluations. /// The following assemblies should be available for native query switch to take effect: /// Db4objects.Db4o.NativeQueries.dll, Db4objects.Db4o.Instrumentation.dll. ///

The default setting is true.

/// In client-server environment this setting should be used on both client and server.

///
/// /// true, if db4o should try to optimize /// native queries at query execution time, false otherwise /// /// /// Db4objects.Db4o.Config.ICommonConfiguration.OptimizeNativeQueries void OptimizeNativeQueries(bool optimizeNQ); /// indicates whether Native Queries will be optimized dynamically. /// indicates whether Native Queries will be optimized dynamically. /// /// boolean true if Native Queries will be optimized /// dynamically. /// /// OptimizeNativeQueries() bool OptimizeNativeQueries(); /// protects the database file with a password. /// /// protects the database file with a password. ///

To set a password for a database file, this method needs to be /// called before a database file is created with the first /// Db4objects.Db4o.Db4oFactory.OpenFile(string) /// /// . ///

All further attempts to open /// the file, are required to set the same password.

The password /// is used to seed the encryption mechanism, which makes it impossible /// to read the database file without knowing the password.

///
/// the password to be used. /// [System.ObsoleteAttribute(@"use a custom encrypting instead")] void Password(string pass); /// returns the Query configuration interface. /// returns the Query configuration interface. IQueryConfiguration Queries(); /// turns readOnly mode on and off. /// /// turns readOnly mode on and off. ///

This method configures the mode in which subsequent calls to /// Db4o.openFile() /// will open files. ///

Readonly mode allows to open an unlimited number of reading /// processes on one database file. It is also convenient /// for deploying db4o database files on CD-ROM.

/// In client-server environment this setting should be used on the server side /// in embedded mode and ONLY on client side in networked mode.

///
/// /// true for configuring readOnly mode for subsequent /// calls to /// Db4o.openFile() /// . /// void ReadOnly(bool flag); /// /// turns recovery mode on and off.

/// Recovery mode can be used to try to retrieve as much as possible /// out of an already corrupted database. ///
/// /// turns recovery mode on and off.

/// Recovery mode can be used to try to retrieve as much as possible /// out of an already corrupted database. In recovery mode internal /// checks are more relaxed. Null or invalid objects may be returned /// instead of throwing exceptions.

/// Use this method with care as a last resort to get data out of a /// corrupted database. ///
/// true to turn recover mode on. void RecoveryMode(bool flag); /// configures the use of a specially designed reflection implementation. /// /// configures the use of a specially designed reflection implementation. ///

/// db4o internally uses System.Reflection by default. On platforms that /// do not support this package, customized implementations may be written /// to supply all the functionality of the interfaces in System.Reflection /// namespace. This method can be used to install a custom reflection /// implementation. /// ///
void ReflectWith(IReflector reflector); /// tuning feature only: reserves a number of bytes in database files. /// /// tuning feature only: reserves a number of bytes in database files. ///

The global setting is used for the creation of new database /// files. Continous calls on an ObjectContainer Configuration context /// (see /// Db4objects.Db4o.Ext.IExtObjectContainer.Configure() /// /// ) will /// continually allocate space. ///

The allocation of a fixed number of bytes at one time /// makes it more likely that the database will be stored in one /// chunk on the mass storage. Less read/write head movement can result /// in improved performance.

/// Note:
Allocated space will be lost on abnormal termination /// of the database engine (hardware crash, VM crash). A Defragment run /// will recover the lost space. For the best possible performance, this /// method should be called before the Defragment run to configure the /// allocation of storage space to be slightly greater than the anticipated /// database file size. ///

/// In client-server environment this setting should be used on the server side.

/// Default configuration: 0

///
/// the number of bytes to reserve /// /// void ReserveStorageSpace(long byteCount); /// /// configures the path to be used to store and read /// Blob data. /// /// /// configures the path to be used to store and read /// Blob data. ///

/// In client-server environment this setting should be used on the /// server side.

///
/// the path to be used /// void SetBlobPath(string path); /// /// Assigns a /// TextWriter /// where db4o is to print its event messages. ///

Messages are useful for debugging purposes and for learning /// to understand, how db4o works. The message level can be raised with /// MessageLevel(int) /// to produce more detailed messages. ///

Use setOut(System.out) to print messages to the /// console.

/// In client-server environment this setting should be used on the same side /// where /// MessageLevel(int) /// is used.

///
/// the new PrintStream for messages. /// MessageLevel(int) void SetOut(TextWriter outStream); /// configures the string encoding to be used. /// /// configures the string encoding to be used. ///

The string encoding can not be changed in the lifetime of a /// database file. To set up the database with the correct string encoding, /// this configuration needs to be set correctly before a database /// file is created with the first call to /// Db4objects.Db4o.Db4oFactory.OpenFile /// /// or /// Db4objects.Db4o.Db4oFactory.OpenServer /// /// . ///

For subsequent open calls, db4o remembers built-in /// string encodings. If a custom encoding is used (an encoding that is /// not supplied from within the db4o library), the correct encoding /// needs to be configured correctly again for all subsequent calls /// that open database files. ///

Example:
/// config.StringEncoding(StringEncodings.Utf8()); ///
/// Db4objects.Db4o.Config.Encoding.StringEncodings /// void StringEncoding(IStringEncoding encoding); /// /// tuning feature: configures whether db4o should try to instantiate one instance /// of each persistent class on system startup. /// /// /// tuning feature: configures whether db4o should try to instantiate one instance /// of each persistent class on system startup. ///

In a production environment this setting can be set to false, /// if all persistent classes have public default constructors. ///

/// In client-server environment this setting should be used on both client and server /// side.

/// Default value:
/// true ///
/// the desired setting void TestConstructors(bool flag); /// specifies the global updateDepth. /// /// specifies the global updateDepth. ///

see the documentation of /// /// for further details.

/// The value be may be overridden for individual classes.

/// The default setting is 1: Only the object passed to /// com.db4o.ObjectContainer#set /// will be updated.

/// In client-server environment this setting should be used on both client and /// server sides.

///
/// the depth of the desired update. /// IObjectClass.UpdateDepth(int) /// IObjectClass.CascadeOnUpdate(bool) /// /// Using callbacks void UpdateDepth(int depth); /// turns weak reference management on or off. /// /// turns weak reference management on or off. ///

/// This method must be called before opening a database. ///

/// Performance may be improved by running db4o without using weak /// references durring memory management at the cost of higher /// memory consumption or by alternatively implementing a manual /// memory management scheme using /// IExtObjectContainer.Purge ///

Setting the value to false causes db4o to use hard /// references to objects, preventing the garbage collection process /// from disposing of unused objects. ///

The default setting is true. ///
void WeakReferences(bool flag); /// configures the timer for WeakReference collection. /// /// configures the timer for WeakReference collection. ///

The default setting is 1000 milliseconds. ///

Configure this setting to zero to turn WeakReference /// collection off. /// ///
/// the time in milliseconds void WeakReferenceCollectionInterval(int milliseconds); /// /// allows registering special TypeHandlers for customized marshalling /// and customized comparisons. /// /// /// allows registering special TypeHandlers for customized marshalling /// and customized comparisons. /// /// /// to specify for which classes and versions the /// TypeHandler is to be used. /// /// to be used for the classes that match the predicate. void RegisterTypeHandler(ITypeHandlerPredicate predicate, ITypeHandler4 typeHandler ); /// ICommonConfiguration.MaxStackDepth() /// int MaxStackDepth(); /// void MaxStackDepth(int maxStackDepth); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IObjectTranslator.cs0000644000175000017500000000426611700531646030244 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; namespace Db4objects.Db4o.Config { /// translator interface to translate objects on storage and activation. /// /// translator interface to translate objects on storage and activation. ///

/// By writing classes that implement this interface, it is possible to /// define how application classes are to be converted to be stored more efficiently. ///

/// Before starting a db4o session, translator classes need to be registered. An example:
/// /// IObjectClass oc = config.ObjectClass("Namespace.ClassName");
/// oc.Translate(new FooTranslator()); ///


///
public interface IObjectTranslator { /// db4o calls this method during storage and query evaluation. /// db4o calls this method during storage and query evaluation. /// the ObjectContainer used /// the Object to be translated /// /// return the object to store.
It needs to be of the class /// StoredClass() /// . ///
object OnStore(IObjectContainer container, object applicationObject); /// db4o calls this method during activation. /// db4o calls this method during activation. /// the ObjectContainer used /// the object to set the members on /// the object that was stored void OnActivate(IObjectContainer container, object applicationObject, object storedObject ); /// return the Class you are converting to. /// return the Class you are converting to. /// /// the Class of the object you are returning with the method /// OnStore(Db4objects.Db4o.IObjectContainer, object) /// /// Type StoredClass(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/GlobalOnlyConfigException.cs0000644000175000017500000000201211700531646031705 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Ext; namespace Db4objects.Db4o.Config { /// /// db4o-specific exception.

/// This exception is thrown when a global configuration /// setting is attempted on an open object container. ///
/// /// db4o-specific exception.

/// This exception is thrown when a global configuration /// setting is attempted on an open object container. ///
/// IConfiguration.BlockSize(int) /// IConfiguration.Encrypt(bool) /// IConfiguration.Io(Db4objects.Db4o.IO.IoAdapter) /// /// IConfiguration.Password(string) [System.Serializable] public class GlobalOnlyConfigException : Db4oRecoverableException { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/INameProvider.cs0000644000175000017500000000162511700531646027353 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o.Config { /// A provider for custom database names. /// A provider for custom database names. public interface INameProvider { /// /// Derives a name for the given /// Db4objects.Db4o.IObjectContainer /// . This method will be called when /// database startup has completed, i.e. the method will see a completely initialized /// Db4objects.Db4o.IObjectContainer /// . /// Any code invoked during the startup process (for example /// IConfigurationItem /// instances) will still /// see the default naming. /// string Name(IObjectContainer db); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/ICompare.cs0000644000175000017500000000122611700531646026343 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Config { /// allows special comparison behaviour during query evaluation. /// /// allows special comparison behaviour during query evaluation. ///

db4o will use the Object returned by the /// Compare() /// method for all query comparisons. ///
public interface ICompare { /// return the Object to be compared during query evaluation. /// return the Object to be compared during query evaluation. object Compare(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IClientServerConfiguration.cs0000644000175000017500000001435511700531646032121 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Messaging; namespace Db4objects.Db4o.Config { /// Client/Server configuration interface. /// Client/Server configuration interface. public interface IClientServerConfiguration { /// /// Sets the number of IDs to be pre-allocated in the database for new /// objects created on the client. /// /// /// Sets the number of IDs to be pre-allocated in the database for new /// objects created on the client. /// This setting should be used on the client side. In embedded mode this setting /// has no effect. /// /// The number of IDs to be prefetched void PrefetchIDCount(int prefetchIDCount); /// Sets the number of objects to be prefetched for an ObjectSet. /// /// Sets the number of objects to be prefetched for an ObjectSet. /// This setting should be used on the server side. /// /// The number of objects to be prefetched void PrefetchObjectCount(int prefetchObjectCount); /// Sets the depth to which prefetched objects are activated. /// /// Sets the depth to which prefetched objects are activated. /// This setting should be used on the client side. /// /// void PrefetchDepth(int prefetchDepth); /// Sets the slot cache size to the given value. /// Sets the slot cache size to the given value. /// void PrefetchSlotCacheSize(int slotCacheSize); /// sets the MessageRecipient to receive Client Server messages. /// /// sets the MessageRecipient to receive Client Server messages.
///
/// This setting should be used on the server side.

///
/// the MessageRecipient to be used void SetMessageRecipient(IMessageRecipient messageRecipient); /// returns the MessageSender for this Configuration context. /// /// returns the MessageSender for this Configuration context. /// This setting should be used on the client side. /// /// MessageSender IMessageSender GetMessageSender(); /// /// configures the time a client waits for a message response /// from the server. /// /// /// configures the time a client waits for a message response /// from the server.
///
/// Default value: 600000ms (10 minutes)
///
/// It is recommended to use the same values for /// TimeoutClientSocket(int) /// and /// TimeoutServerSocket(int) /// . ///
/// This setting can be used on both client and server.

///
/// time in milliseconds void TimeoutClientSocket(int milliseconds); /// configures the timeout of the serverside socket. /// /// configures the timeout of the serverside socket.
///
/// The serverside handler waits for messages to arrive from the client. /// If no more messages arrive for the duration configured in this /// setting, the client will be disconnected. ///
/// Clients send PING messages to the server at an interval of /// Math.min(timeoutClientSocket(), timeoutServerSocket()) / 2 /// and the server will respond to keep connections alive. ///
/// Decrease this setting if you want clients to disconnect faster. ///
/// Increase this setting if you have a large number of clients and long /// running queries and you are getting disconnected clients that you /// would like to wait even longer for a response from the server. ///
/// Default value: 600000ms (10 minutes)
///
/// It is recommended to use the same values for /// TimeoutClientSocket(int) /// and /// TimeoutServerSocket(int) /// . ///
/// This setting can be used on both client and server.

///
/// time in milliseconds void TimeoutServerSocket(int milliseconds); /// /// configures the client messaging system to be single threaded /// or multithreaded. /// /// /// configures the client messaging system to be single threaded /// or multithreaded. ///

Recommended settings:
/// - true for low resource systems.
/// - false for best asynchronous performance and fast /// GUI response. ///

Default value:
/// - .NET Compactframework: true
/// - all other platforms: false

/// This setting can be used on both client and server.

///
/// the desired setting void SingleThreadedClient(bool flag); /// Configures to batch messages between client and server. /// /// Configures to batch messages between client and server. By default, batch /// mode is enabled.

/// This setting can be used on both client and server.

///
/// false, to turn message batching off. void BatchMessages(bool flag); /// Configures the maximum memory buffer size for batched message. /// /// Configures the maximum memory buffer size for batched message. If the /// size of batched messages is greater than maxSize, batched /// messages will be sent to server.

/// This setting can be used on both client and server.

///
/// void MaxBatchQueueSize(int maxSize); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/ICommonConfigurationProvider.cs0000644000175000017500000000144611700531646032454 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// /// A configuration provider that provides access to /// the common configuration methods that can be called /// for embedded, server and client use of db4o. /// /// /// A configuration provider that provides access to /// the common configuration methods that can be called /// for embedded, server and client use of db4o. /// /// 7.5 public interface ICommonConfigurationProvider { /// Access to the common configuration methods. /// Access to the common configuration methods. ICommonConfiguration Common { get; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/ILegacyClientServerFactory.cs0000644000175000017500000000211511700531646032035 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// public interface ILegacyClientServerFactory { /// /// /// IObjectContainer OpenClient(IConfiguration config, string hostName, int port, string user, string password); /// /// /// /// /// IObjectServer OpenServer(IConfiguration config, string databaseFileName, int port ); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IObjectClass.cs0000644000175000017500000004011111700531646027145 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// configuration interface for classes. /// /// configuration interface for classes. ///

/// Use the global /// ICommonConfiguration.ObjectClass(object) /// /// to configure /// object class settings. ///
public interface IObjectClass { /// /// advises db4o to try instantiating objects of this class with/without /// calling constructors. /// /// /// advises db4o to try instantiating objects of this class with/without /// calling constructors. ///

/// Not all .NET-environments support this feature. db4o will /// attempt, to follow the setting as good as the enviroment supports. ///

/// This setting may also be set globally for all classes in /// Db4objects.Db4o.Config.IConfiguration.CallConstructors /// /// .

/// In client-server environment this setting should be used on both /// client and server.

/// This setting can be applied to an open object container.

///
/// /// - specify true, to request calling constructors, specify /// false to request not calling constructors. /// /// Db4objects.Db4o.Config.IConfiguration.CallConstructors /// void CallConstructor(bool flag); /// sets cascaded activation behaviour. /// /// sets cascaded activation behaviour. ///

/// Setting cascadeOnActivate to true will result in the activation /// of all member objects if an instance of this class is activated. ///

/// The default setting is false.

/// In client-server environment this setting should be used on both /// client and server.

/// Can be applied to an open ObjectContainer.

///
/// whether activation is to be cascaded to member objects. /// IObjectField.CascadeOnActivate(bool) /// /// Db4objects.Db4o.IObjectContainer.Activate(object, int) /// /// Using callbacks /// Why activation? void CascadeOnActivate(bool flag); /// sets cascaded delete behaviour. /// /// sets cascaded delete behaviour. ///

/// Setting CascadeOnDelete to true will result in the deletion of /// all member objects of instances of this class, if they are /// passed to /// Db4objects.Db4o.IObjectContainer.Delete /// /// . ///

/// Caution !
/// This setting will also trigger deletion of old member objects, on /// calls to /// Db4objects.Db4o.IObjectContainer.Store /// /// .

/// An example of the behaviour:
/// /// ObjectContainer con;
/// Bar bar1 = new Bar();
/// Bar bar2 = new Bar();
/// foo.bar = bar1;
/// con.Store(foo); // bar1 is stored as a member of foo
/// foo.bar = bar2;
/// con.Store(foo); // bar2 is stored as a member of foo ///

The last statement will also delete bar1 from the /// ObjectContainer, no matter how many other stored objects hold references /// to bar1. ///

/// The default setting is false.

/// In client-server environment this setting should be used on both /// client and server.

/// This setting can be applied to an open object container.

///
/// whether deletes are to be cascaded to member objects. /// Db4objects.Db4o.Config.IObjectField.CascadeOnDelete /// /// Db4objects.Db4o.IObjectContainer.Delete /// /// Using callbacks void CascadeOnDelete(bool flag); /// sets cascaded update behaviour. /// /// sets cascaded update behaviour. ///

/// Setting cascadeOnUpdate to true will result in the update /// of all member objects if a stored instance of this class is passed /// to /// Db4objects.Db4o.IObjectContainer.Store(object) /// /// .

/// The default setting is false. Setting it to true /// may result in serious performance degradation.

/// In client-server environment this setting should be used on both /// client and server.

/// This setting can be applied to an open object container.

///
/// whether updates are to be cascaded to member objects. /// IObjectField.CascadeOnUpdate(bool) /// /// com.db4o.ObjectContainer#set /// Using callbacks void CascadeOnUpdate(bool flag); /// registers an attribute provider for special query behavior. /// /// registers an attribute provider for special query behavior. ///

The query processor will compare the object returned by the /// attribute provider instead of the actual object, both for the constraint /// and the candidate persistent object.

/// In client-server environment this setting should be used on both /// client and server.

///
/// the attribute provider to be used [System.ObsoleteAttribute(@"since version 7.0")] void Compare(IObjectAttribute attributeProvider); /// /// Must be called before databases are created or opened /// so that db4o will control versions and generate UUIDs /// for objects of this class, which is required for using replication. /// /// /// Must be called before databases are created or opened /// so that db4o will control versions and generate UUIDs /// for objects of this class, which is required for using replication. /// /// [System.ObsoleteAttribute(@"As of version 8.0 please use GenerateUUIDs(bool) and IFileConfiguration.GenerateCommitTimestamps(bool) instead" )] void EnableReplication(bool setting); /// generate UUIDs for stored objects of this class. /// /// generate UUIDs for stored objects of this class. /// This setting should be used before the database is first created.

///
/// void GenerateUUIDs(bool setting); /// generate version numbers for stored objects of this class. /// /// generate version numbers for stored objects of this class. /// This setting should be used before the database is first created.

///
/// [System.ObsoleteAttribute(@"As of version 8.0 please use IFileConfiguration.GenerateCommitTimestamps(bool) instead" )] void GenerateVersionNumbers(bool setting); /// turns the class index on or off. /// /// turns the class index on or off. ///

db4o maintains an index for each class to be able to /// deliver all instances of a class in a query. If the class /// index is never needed, it can be turned off with this method /// to improve the performance to create and delete objects of /// a class. ///

Common cases where a class index is not needed:
/// - The application always works with sub classes or super classes.
/// - There are convenient field indexes that will always find instances /// of a class.
/// - The application always works with IDs.

/// In client-server environment this setting should be used on both /// client and server.

/// This setting can be applied to an open object container.

///
void Indexed(bool flag); /// sets the maximum activation depth to the desired value. /// /// sets the maximum activation depth to the desired value. ///

A class specific setting overrides the /// global setting ///

/// In client-server environment this setting should be used on both /// client and server.

/// This setting can be applied to an open object container.

///
/// the desired maximum activation depth /// Why activation? /// CascadeOnActivate(bool) void MaximumActivationDepth(int depth); /// sets the minimum activation depth to the desired value. /// /// sets the minimum activation depth to the desired value. ///

A class specific setting overrides the /// global setting ///

/// In client-server environment this setting should be used on both /// client and server.

/// This setting can be applied to an open object container.

///
/// the desired minimum activation depth /// Why activation? /// CascadeOnActivate(bool) void MinimumActivationDepth(int depth); /// gets the configured minimum activation depth. /// /// gets the configured minimum activation depth. /// In client-server environment this setting should be used on both /// client and server.

///
/// the configured minimum activation depth. int MinimumActivationDepth(); /// /// returns an /// IObjectField /// object /// to configure the specified field. ///

///
/// the name of the field to be configured.

/// /// an instance of an /// IObjectField /// object for configuration. /// IObjectField ObjectField(string fieldName); /// turns on storing static field values for this class. /// /// turns on storing static field values for this class. ///

By default, static field values of classes are not stored /// to the database file. By turning the setting on for a specific class /// with this switch, all non-simple-typed static field values of this /// class are stored the first time an object of the class is stored, and /// restored, every time a database file is opened afterwards, after /// class meta information is loaded for this class (which can happen /// by querying for a class or by loading an instance of a class).

/// To update a static field value, once it is stored, you have to the following /// in this order:
/// (1) open the database file you are working agains
/// (2) make sure the class metadata is loaded
/// objectContainer.Query().Constrain(typeof(Foo));
/// (3) change the static member
/// (4) store the static member explicitely
/// objectContainer.Store(Foo.staticMember); ///

The setting will be ignored for simple types. ///

Use this setting for constant static object members. ///

This option will slow down the process of opening database /// files and the stored objects will occupy space in the database file. ///

In client-server environment this setting should be used on both /// client and server.

/// This setting can NOT be applied to an open object container.

///
void PersistStaticFieldValues(); /// renames a stored class. /// /// renames a stored class. ///

Use this method to refactor classes. ///

In client-server environment this setting should be used on both /// client and server.

/// This setting can NOT be applied to an open object container.

///
/// the new fully qualified class name. void Rename(string newName); /// allows to specify if transient fields are to be stored. /// /// allows to specify if transient fields are to be stored. ///
The default for every class is false.

/// In client-server environment this setting should be used on both /// client and server.

/// This setting can be applied to an open object container.

///
/// whether or not transient fields are to be stored. void StoreTransientFields(bool flag); /// registers a translator for this class. /// /// registers a translator for this class. ///

///

The use of an /// IObjectTranslator /// is not /// compatible with the use of an /// internal class ObjectMarshaller.

/// In client-server environment this setting should be used on both /// client and server.

/// This setting can be applied to an open object container.

///
/// /// this may be an /// IObjectTranslator /// or an /// IObjectConstructor /// /// IObjectTranslator /// IObjectConstructor void Translate(IObjectTranslator translator); /// specifies the updateDepth for this class. /// /// specifies the updateDepth for this class. ///

see the documentation of /// Db4objects.Db4o.IObjectContainer.Store(object) /// /// for further details.

/// The default setting is 0: Only the object passed to /// Db4objects.Db4o.IObjectContainer.Store(object) /// /// will be updated.

/// In client-server environment this setting should be used on both /// client and server.

///
/// the depth of the desired update for this class. /// IConfiguration.UpdateDepth(int) /// CascadeOnUpdate(bool) /// IObjectField.CascadeOnUpdate(bool) /// /// Using callbacks void UpdateDepth(int depth); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/TypeAlias.cs0000644000175000017500000000360411700531646026541 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Config; using Db4objects.Db4o.Internal; namespace Db4objects.Db4o.Config { /// /// a simple Alias for a single Class or Type, using equals on /// the names in the resolve method. /// /// /// a simple Alias for a single Class or Type, using equals on /// the names in the resolve method. ///

See /// IAlias /// for concrete examples. ///
public class TypeAlias : IAlias { private readonly string _storedType; private readonly string _runtimeType; /// /// pass the stored name as the first /// parameter and the desired runtime name as the second parameter. /// /// /// pass the stored name as the first /// parameter and the desired runtime name as the second parameter. /// public TypeAlias(string storedType, string runtimeType) { if (null == storedType || null == runtimeType) { throw new ArgumentException(); } _storedType = storedType; _runtimeType = runtimeType; } public TypeAlias(Type storedClass, Type runtimeClass) : this(ReflectPlatform.FullyQualifiedName (storedClass), ReflectPlatform.FullyQualifiedName(runtimeClass)) { } /// returns the stored type name if the alias was written for the passed runtime type name /// public virtual string ResolveRuntimeName(string runtimeTypeName) { return _runtimeType.Equals(runtimeTypeName) ? _storedType : null; } /// returns the runtime type name if the alias was written for the passed stored type name /// public virtual string ResolveStoredName(string storedTypeName) { return _storedType.Equals(storedTypeName) ? _runtimeType : null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/ICommonConfiguration.cs0000644000175000017500000007077611700531646030755 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.IO; using Db4objects.Db4o.Config; using Db4objects.Db4o.Config.Encoding; using Db4objects.Db4o.Diagnostic; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Typehandlers; namespace Db4objects.Db4o.Config { /// /// Common configuration methods, applicable for /// embedded, client and server use of db4o.

/// In Client/Server use it is good practice to configure the /// client and the server in exactly the same way. ///
/// /// Common configuration methods, applicable for /// embedded, client and server use of db4o.

/// In Client/Server use it is good practice to configure the /// client and the server in exactly the same way. ///
/// 7.5 public interface ICommonConfiguration { /// adds a new Alias for a class, namespace or package. /// /// adds a new Alias for a class, namespace or package. ///

Aliases can be used to persist classes in the running /// application to different persistent classes in a database file /// or on a db4o server. ///

Two simple Alias implementations are supplied along with /// db4o:
/// - /// TypeAlias /// provides an #equals() resolver to match /// names directly.
/// - /// WildcardAlias /// allows simple pattern matching /// with one single '*' wildcard character.
///
/// It is possible to create /// own complex /// IAlias /// constructs by creating own resolvers /// that implement the /// IAlias /// interface. ///

/// Examples of concrete usecases: ///

/// /// // Creating an Alias for a single class
/// Db4o.configure().addAlias(
///   new TypeAlias("com.f1.Pilot", "com.f1.Driver"));
///

/// // Accessing a .NET assembly from a Java package
/// Db4o.configure().addAlias(
///   new WildcardAlias(
///     "Tutorial.F1.*, Tutorial",
///     "com.f1.*"));
///

/// // Mapping a Java package onto another
/// Db4o.configure().addAlias(
///   new WildcardAlias(
///     "com.f1.*",
///     "com.f1.client*"));
///

Aliases that translate the persistent name of a class to /// a name that already exists as a persistent name in the database /// (or on the server) are not permitted and will throw an exception /// when the database file is opened. ///

Aliases should be configured before opening a database file /// or connecting to a server.

/// In client/server environment it is good practice to configure the /// client and the server in exactly the same way. ///
void AddAlias(IAlias alias); /// /// Removes an alias previously added with /// IConfiguration.AddAlias(IAlias) /// . /// /// the alias to remove void RemoveAlias(IAlias alias); /// sets the activation depth to the specified value. /// /// sets the activation depth to the specified value. ///

Why activation?
/// When objects are instantiated from the database, the instantiation of member /// objects needs to be limited to a certain depth. Otherwise a single object /// could lead to loading the complete database into memory, if all objects where /// reachable from a single root object.

/// db4o uses the concept "depth", the number of field-to-field hops an object /// is away from another object. The preconfigured "activation depth" db4o uses /// in the default setting is 5. ///

Whenever an application iterates through the /// IObjectSet /// of a query result, the result objects /// will be activated to the configured activation depth.

/// A concrete example with the preconfigured activation depth of 5:
///
		/// // Object foo is the result of a query, it is delivered by the ObjectSet
		/// object foo = objectSet.Next();
/// foo.member1.member2.member3.member4.member5 will be a valid object
/// foo, member1, member2, member3 and member4 will be activated
/// member5 will be deactivated, all of it's members will be null
/// member5 can be activated at any time by calling /// IObjectContainer.Activate(member5, depth) /// /// . ///

/// Note that raising the global activation depth will consume more memory and /// have negative effects on the performance of first-time retrievals. Lowering /// the global activation depth needs more individual activation work but can /// increase performance of queries.

/// IObjectContainer.Deactivate(object, depth) /// /// can be used to manually free memory by deactivating objects.

/// In client/server environment it is good practice to configure the /// client and the server in exactly the same way.

. ///
/// configuring classes individually /// /// gets the configured activation depth. /// sets the activation depth to the specified value. /// /// sets the activation depth to the specified value. ///

Why activation?
/// When objects are instantiated from the database, the instantiation of member /// objects needs to be limited to a certain depth. Otherwise a single object /// could lead to loading the complete database into memory, if all objects where /// reachable from a single root object.

/// db4o uses the concept "depth", the number of field-to-field hops an object /// is away from another object. The preconfigured "activation depth" db4o uses /// in the default setting is 5. ///

Whenever an application iterates through the /// IObjectSet /// of a query result, the result objects /// will be activated to the configured activation depth.

/// A concrete example with the preconfigured activation depth of 5:
///
		/// // Object foo is the result of a query, it is delivered by the ObjectSet
		/// object foo = objectSet.Next();
/// foo.member1.member2.member3.member4.member5 will be a valid object
/// foo, member1, member2, member3 and member4 will be activated
/// member5 will be deactivated, all of it's members will be null
/// member5 can be activated at any time by calling /// IObjectContainer.Activate(member5, depth) /// /// . ///

/// Note that raising the global activation depth will consume more memory and /// have negative effects on the performance of first-time retrievals. Lowering /// the global activation depth needs more individual activation work but can /// increase performance of queries.

/// IObjectContainer.Deactivate(object, depth) /// /// can be used to manually free memory by deactivating objects.

/// In client/server environment it is good practice to configure the /// client and the server in exactly the same way.

. ///
/// configuring classes individually /// /// gets the configured activation depth. int ActivationDepth { get; set; } /// /// adds ConfigurationItems to be applied when /// an ObjectContainer or ObjectServer is opened. /// /// /// adds ConfigurationItems to be applied when /// an ObjectContainer or ObjectServer is opened. /// /// the ConfigurationItem void Add(IConfigurationItem configurationItem); /// turns automatic database file format version updates on. /// /// turns automatic database file format version updates on. ///

Upon db4o database file format version changes, /// db4o can automatically update database files to the /// current version. db4objects does not provide functionality /// to reverse this process. It is not ensured that updated /// database files can be read with older db4o versions. /// In some cases (Example: using ObjectManager) it may not be /// desirable to update database files automatically therefore /// automatic updating is turned off by default for /// security reasons. ///

Call this method to turn automatic database file /// version updating on. ///

If automatic updating is turned off, db4o will refuse /// to open database files that use an older database file format.

/// In client/server environment it is good practice to configure the /// client and the server in exactly the same way. ///
bool AllowVersionUpdates { set; } /// turns automatic shutdown of the engine on and off. /// /// turns automatic shutdown of the engine on and off. /// The default and recommended setting is true.

///
bool AutomaticShutDown { set; } /// configures the size of BTree nodes in indexes. /// /// configures the size of BTree nodes in indexes. ///

Default setting: 100 ///
Lower values will allow a lower memory footprint /// and more efficient reading and writing of small slots. ///
Higher values will reduce the overall number of /// read and write operations and allow better performance /// at the cost of more RAM use.

/// In client/server environment it is good practice to configure the /// client and the server in exactly the same way. ///
/// the number of elements held in one BTree node. int BTreeNodeSize { set; } /// turns callback methods on and off. /// /// turns callback methods on and off. ///

Callbacks are turned on by default.

/// A tuning hint: If callbacks are not used, you can turn this feature off, to /// prevent db4o from looking for callback methods in persistent classes. This will /// increase the performance on system startup.

/// In a client/server environment it is good practice to configure the /// client and the server in exactly the same way. ///
/// false to turn callback methods off /// Using callbacks bool Callbacks { set; } /// /// advises db4o to try instantiating objects with/without calling /// constructors. /// /// /// advises db4o to try instantiating objects with/without calling /// constructors. ///

/// Not all .NET-environments support this feature. db4o will /// attempt, to follow the setting as good as the enviroment supports. /// This setting may also be overridden for individual classes in /// Db4objects.Db4o.Config.IObjectClass.CallConstructor /// /// . ///

The default setting depends on the features supported by your current environment.

/// In a client/server environment it is good practice to configure the /// client and the server in exactly the same way. ///

///
/// Db4objects.Db4o.Config.IObjectClass.CallConstructor /// bool CallConstructors { set; } /// /// tuning feature: configures whether db4o checks all persistent classes upon system /// startup, for added or removed fields. /// /// /// tuning feature: configures whether db4o checks all persistent classes upon system /// startup, for added or removed fields. ///

If this configuration setting is set to false while a database is /// being created, members of classes will not be detected and stored. ///

This setting can be set to false in a production environment after /// all persistent classes have been stored at least once and classes will not /// be modified any further in the future.

/// In a client/server environment it is good practice to configure the /// client and the server in exactly the same way. ///

Default value:
/// true ///
/// the desired setting bool DetectSchemaChanges { set; } /// returns the configuration interface for diagnostics. /// returns the configuration interface for diagnostics. /// the configuration interface for diagnostics. IDiagnosticConfiguration Diagnostic { get; } /// configures whether Exceptions are to be thrown, if objects can not be stored. /// /// /// configures whether Exceptions are to be thrown, if objects can not be stored. ///

db4o requires the presence of a constructor that can be used to /// instantiate objects. If no default public constructor is present, all /// available constructors are tested, whether an instance of the class can /// be instantiated. Null is passed to all constructor parameters. /// The first constructor that is successfully tested will /// be used throughout the running db4o session. If an instance of the class /// can not be instantiated, the object will not be stored. By default, /// execution will be stopped with an Exception. This method can /// be used to configure db4o to not throw an /// ObjectNotStorableException /// /// if an object can not be stored. ///

/// The default for this setting is true.

/// In a client/server environment it is good practice to configure the /// client and the server in exactly the same way.

///
/// true to throw Exceptions if objects can not be stored. bool ExceptionsOnNotStorable { set; } /// configures db4o to call Intern() on strings upon retrieval. /// /// configures db4o to call Intern on strings upon retrieval if set to true. /// In client/server environment the setting should be used on both /// client and server. /// bool InternStrings { set; } // TODO: refactor to use provider? /// allows to mark fields as transient with custom attributes. /// /// allows to mark fields as transient with custom attributes. ///

.NET only: Call this method with the attribute name that you /// wish to use to mark fields as transient. Multiple transient attributes /// are possible by calling this method multiple times with different /// attribute names.

/// In a client/server environment it is good practice to configure the /// client and the server in exactly the same way.

///
/// /// - the fully qualified name of the attribute, including /// it's namespace /// TODO: can we provide meaningful java side semantics for this one? /// TODO: USE A CLASS!!!!!! /// void MarkTransient(string attributeName); /// sets the detail level of db4o messages. /// /// sets the detail level of db4o messages. Messages will be output to the /// configured output /// TextWriter /// . ///

/// Level 0 - no messages
/// Level 1 - open and close messages
/// Level 2 - messages for new, update and delete
/// Level 3 - messages for activate and deactivate

/// When using client-server and the level is set to 0, the server will override this and set it to 1. To get around this you can set the level to -1. This has the effect of not returning any messages.

/// In client-server environment this setting can be used on client or on server /// depending on which information do you want to track (server side provides more /// detailed information).

///
/// integer from 0 to 3 /// TODO: replace int with enumeration /// int MessageLevel { set; } /// /// returns an /// IObjectClass /// object /// to configure the specified class. ///

/// The clazz parameter can be any of the following:
/// - a fully qualified classname as a String.
/// - a Class object.
/// - any other object to be used as a template.

///
/// class name, Class object, or example object.

/// /// an instance of an /// IObjectClass /// object for configuration. /// IObjectClass ObjectClass(object clazz); /// /// If set to true, db4o will try to optimize native queries /// dynamically at query execution time, otherwise it will /// run native queries in unoptimized mode as SODA evaluations. /// /// /// If set to true, db4o will try to optimize native queries /// dynamically at query execution time, otherwise it will /// run native queries in unoptimized mode as SODA evaluations. /// The following assemblies should be available for native query switch to take effect: /// Db4objects.Db4o.NativeQueries.dll, Db4objects.Db4o.Instrumentation.dll. ///

The default setting is true.

/// In a client/server environment it is good practice to configure the /// client and the server in exactly the same way.

///
/// Db4objects.Db4o.Config.ICommonConfiguration.OptimizeNativeQueries /// /// If set to true, db4o will try to optimize native queries /// dynamically at query execution time, otherwise it will /// run native queries in unoptimized mode as SODA evaluations. /// /// /// If set to true, db4o will try to optimize native queries /// dynamically at query execution time, otherwise it will /// run native queries in unoptimized mode as SODA evaluations. /// The following assemblies should be available for native query switch to take effect: /// Db4objects.Db4o.NativeQueries.dll, Db4objects.Db4o.Instrumentation.dll. ///

The default setting is true.

/// In a client/server environment it is good practice to configure the /// client and the server in exactly the same way.

///
/// Db4objects.Db4o.Config.ICommonConfiguration.OptimizeNativeQueries bool OptimizeNativeQueries { get; set; } /// returns the Query configuration interface. /// returns the Query configuration interface. IQueryConfiguration Queries { get; } /// configures the use of a specially designed reflection implementation. /// /// configures the use of a specially designed reflection implementation. ///

/// db4o internally uses java.lang.reflect.* by default. On platforms that /// do not support this package, customized implementations may be written /// to supply all the functionality of the interfaces in the com.db4o.reflect /// package. This method can be used to install a custom reflection /// implementation.

/// In client-server environment this setting should be used on both the client and /// the server side (reflector class must be available)

///
void ReflectWith(IReflector reflector); /// /// Assigns a /// TextWriter /// where db4o is to print its event messages. ///

Messages are useful for debugging purposes and for learning /// to understand, how db4o works. The message level can be raised with /// IConfiguration.MessageLevel(int) /// to produce more detailed messages. ///

Use outStream(System.out) to print messages to the /// console.

/// In client-server environment this setting should be used on the same side /// where /// IConfiguration.MessageLevel(int) /// is used.

///
/// the new PrintStream for messages. /// MessageLevel(int) TextWriter OutStream { set; } /// configures the string encoding to be used. /// /// configures the string encoding to be used. ///

The string encoding can not be changed in the lifetime of a /// database file. To set up the database with the correct string encoding, /// this configuration needs to be set correctly before a database /// file is created with the first call to /// Db4objects.Db4o.Db4oFactory.OpenFile /// /// or /// Db4objects.Db4o.Db4oFactory.OpenServer /// /// . ///

For subsequent open calls, db4o remembers built-in /// string encodings. If a custom encoding is used (an encoding that is /// not supplied from within the db4o library), the correct encoding /// needs to be configured correctly again for all subsequent calls /// that open database files. ///

/// In client-server mode, the server and all clients need to have the same string encoding.

/// Example:
/// config.StringEncoding = StringEncodings.Utf8(); ///
/// Db4objects.Db4o.Config.Encoding.StringEncodings /// IStringEncoding StringEncoding { set; } /// /// tuning feature: configures whether db4o should try to instantiate one instance /// of each persistent class on system startup. /// /// /// tuning feature: configures whether db4o should try to instantiate one instance /// of each persistent class on system startup. ///

In a production environment this setting can be set to false, /// if all persistent classes have public default constructors. ///

/// In a client/server environment it is good practice to configure the /// client and the server in exactly the same way.

/// Default value:
/// true ///
/// the desired setting bool TestConstructors { set; } /// specifies the global updateDepth. /// /// specifies the global updateDepth. ///

see the documentation of /// /// for further details.

/// The value be may be overridden for individual classes.

/// The default setting is 1: Only the object passed to /// Db4objects.Db4o.IObjectContainer.Store(object) /// /// will be updated.

/// In a client/server environment it is good practice to configure the /// client and the server in exactly the same way.

///
/// the depth of the desired update. /// IObjectClass.UpdateDepth(int) /// IObjectClass.CascadeOnUpdate(bool) /// /// Using callbacks int UpdateDepth { set; } /// turns weak reference management on or off. /// /// turns weak reference management on or off. ///

/// This method must be called before opening a database. ///

/// Performance may be improved by running db4o without using weak /// references durring memory management at the cost of higher /// memory consumption or by alternatively implementing a manual /// memory management scheme using /// Db4objects.Db4o.Ext.IExtObjectContainer.Purge(object) /// ///

Setting the value to false causes db4o to use hard /// references to objects, preventing the garbage collection process /// from disposing of unused objects. ///

The default setting is true. ///

Ignored on JDKs before 1.2. ///
bool WeakReferences { set; } /// configures the timer for WeakReference collection. /// /// configures the timer for WeakReference collection. ///

The default setting is 1000 milliseconds. ///

Configure this setting to zero to turn WeakReference /// collection off. ///

Ignored on JDKs before 1.2.

///
/// the time in milliseconds int WeakReferenceCollectionInterval { set; } /// /// allows registering special TypeHandlers for customized marshalling /// and customized comparisons. /// /// /// allows registering special TypeHandlers for customized marshalling /// and customized comparisons. /// /// /// to specify for which classes and versions the /// TypeHandler is to be used. /// /// to be used for the classes that match the predicate. void RegisterTypeHandler(ITypeHandlerPredicate predicate, ITypeHandler4 typeHandler ); /// Db4objects.Db4o.Foundation.IEnvironment /// IEnvironmentConfiguration Environment { get; } /// /// Registers a /// INameProvider /// that assigns a custom name to the database to be used in /// object.ToString() /// . /// void NameProvider(INameProvider provider); ///

Sets the max stack depth that will be used for recursive storing and activating an object. ///

/// ///

Sets the max stack depth that will be used for recursive storing and activating an object. ///

The default value is set to /// Db4objects.Db4o.Internal.Const4.DefaultMaxStackDepth /// ///

On Android platform, we recomend setting this to 2. /// /// the desired max stack depth. ///

gets the configured max stack depth. /// gets the configured max stack depth. /// the configured max stack depth. int MaxStackDepth { get; set; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/SimpleNameProvider.cs0000644000175000017500000000112211700531646030404 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// /// Assigns a fixed, pre-defined name to the given /// Db4objects.Db4o.IObjectContainer /// . /// public class SimpleNameProvider : INameProvider { private readonly string _name; public SimpleNameProvider(string name) { _name = name; } public virtual string Name(IObjectContainer db) { return _name; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IFileConfiguration.cs0000644000175000017500000003115211700531646030365 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; using Db4objects.Db4o.IO; namespace Db4objects.Db4o.Config { /// /// File-related configuration methods, applicable /// for db4o embedded use and on the server in a /// Client/Server setup. /// /// /// File-related configuration methods, applicable /// for db4o embedded use and on the server in a /// Client/Server setup. /// /// 7.5 /// IFileConfigurationProvider.File() /// public interface IFileConfiguration { /// sets the storage data blocksize for new ObjectContainers. /// /// sets the storage data blocksize for new ObjectContainers. ///

The standard setting is 1 allowing for a maximum /// database file size of 2GB. This value can be increased /// to allow larger database files, although some space will /// be lost to padding because the size of some stored objects /// will not be an exact multiple of the block size. A /// recommended setting for large database files is 8, since /// internal pointers have this length.

/// This setting is only effective when the database is first created. ///
/// the size in bytes from 1 to 127 int BlockSize { set; } /// /// configures the size database files should grow in bytes, when no /// free slot is found within. /// /// /// configures the size database files should grow in bytes, when no /// free slot is found within. ///

Tuning setting. ///

Whenever no free slot of sufficient length can be found /// within the current database file, the database file's length /// is extended. This configuration setting configures by how much /// it should be extended, in bytes.

/// This configuration setting is intended to reduce fragmentation. /// Higher values will produce bigger database files and less /// fragmentation.

/// To extend the database file, a single byte array is created /// and written to the end of the file in one write operation. Be /// aware that a high setting will require allocating memory for /// this byte array. ///
/// amount of bytes int DatabaseGrowthSize { set; } /// turns commit recovery off. /// /// turns commit recovery off. ///

db4o uses a two-phase commit algorithm. In a first step all intended /// changes are written to a free place in the database file, the "transaction commit /// record". In a second step the /// actual changes are performed. If the system breaks down during commit, the /// commit process is restarted when the database file is opened the next time. /// On very rare occasions (possibilities: hardware failure or editing the database /// file with an external tool) the transaction commit record may be broken. In this /// case, this method can be used to try to open the database file without commit /// recovery. The method should only be used in emergency situations after consulting /// db4o support. ///
void DisableCommitRecovery(); /// returns the freespace configuration interface. /// returns the freespace configuration interface. IFreespaceConfiguration Freespace { get; } /// configures db4o to generate UUIDs for stored objects. /// /// configures db4o to generate UUIDs for stored objects. /// This setting should be used when the database is first created.

///
/// the scope for UUID generation: disabled, generate for all classes, or configure individually /// ConfigScope GenerateUUIDs { set; } /// configures db4o to generate version numbers for stored objects. /// /// configures db4o to generate version numbers for stored objects. /// This setting should be used when the database is first created. /// /// the scope for version number generation: disabled, generate for all classes, or configure individually /// [System.ObsoleteAttribute(@"As of version 8.0 please use GenerateCommitTimestamps(bool) instead." )] ConfigScope GenerateVersionNumbers { set; } /// /// Configures db4o to generate commit timestamps for all stored objects.
///
/// All the objects commited within a transaction will share the same commit timestamp. ///
/// /// Configures db4o to generate commit timestamps for all stored objects.
///
/// All the objects commited within a transaction will share the same commit timestamp. ///
/// This setting should be used when the database is first created.
///
/// Afterwards you can access the object's commit timestamp like this:
///
///
		/// ObjectContainer container = ...;
		/// ObjectInfo objectInfo = container.ext().getObjectInfo(obj);
		/// long commitTimestamp = objectInfo.getVersion();
		/// 
///
/// /// if true, commit timetamps will be generated for all stored /// objects. If you already have commit timestamps for stored /// objects and later set this flag to false, although you wont be /// able to access them, the commit timestamps will still be taking /// space in your file container. The only way to free that space /// is defragmenting the container. /// /// 8.0 bool GenerateCommitTimestamps { set; } /// allows to configure db4o to use a customized byte IO storage mechanism. /// /// allows to configure db4o to use a customized byte IO storage mechanism. ///

You can implement the interface /// Db4objects.Db4o.IO.IStorage /// to /// write your own. Possible usecases could be improved performance /// with a native library, mirrored write to two files, encryption or /// read-on-write fail-safety control.

///
/// - the storage /// Db4objects.Db4o.IO.FileStorage /// Db4objects.Db4o.IO.CachingStorage /// /// Db4objects.Db4o.IO.MemoryStorage /// /// /// /// returns the configured /// Db4objects.Db4o.IO.IStorage /// . /// /// IStorage Storage { get; set; } /// can be used to turn the database file locking thread off. /// /// can be used to turn the database file locking thread off. ///

Caution!
If database file /// locking is turned off, concurrent write access to the same /// database file from different sessions will corrupt the /// database file immediately.

This method /// has no effect on open ObjectContainers. It will only affect how /// ObjectContainers are opened.

/// The default setting is true.

/// ///
bool LockDatabaseFile { set; } /// tuning feature only: reserves a number of bytes in database files. /// /// tuning feature only: reserves a number of bytes in database files. ///

The global setting is used for the creation of new database /// files. ///

Without this setting, storage space will be allocated /// continuously as required. However, allocation of a fixed number /// of bytes at one time makes it more likely that the database will be /// stored in one chunk on the mass storage. Less read/write head movement /// can result in improved performance.

/// Note:
Allocated space will be lost on abnormal termination /// of the database engine (hardware crash, VM crash). A Defragment run /// will recover the lost space. For the best possible performance, this /// method should be called before the Defragment run to configure the /// allocation of storage space to be slightly greater than the anticipated /// database file size. ///

/// Default configuration: 0

///
/// the number of bytes to reserve /// /// long ReserveStorageSpace { set; } /// /// configures the path to be used to store and read /// Blob data. /// /// /// configures the path to be used to store and read /// Blob data. ///

///
/// the path to be used /// string BlobPath { set; } /// turns readOnly mode on and off. /// /// turns readOnly mode on and off. ///

This method configures the mode in which subsequent calls to /// Db4objects.Db4o.Db4oEmbedded.OpenFile(IEmbeddedConfiguration, string) /// /// will open files. ///

Readonly mode allows to open an unlimited number of reading /// processes on one database file. It is also convenient /// for deploying db4o database files on CD-ROM.

///
/// /// true for configuring readOnly mode for subsequent /// calls to /// Db4o.openFile() /// . /// TODO: this is rather embedded + client than base? /// bool ReadOnly { set; } /// /// turns recovery mode on and off.

/// Recovery mode can be used to try to retrieve as much as possible /// out of an already corrupted database. ///
/// /// turns recovery mode on and off.

/// Recovery mode can be used to try to retrieve as much as possible /// out of an already corrupted database. In recovery mode internal /// checks are more relaxed. Null or invalid objects may be returned /// instead of throwing exceptions.

/// Use this method with care as a last resort to get data out of a /// corrupted database. ///
/// true to turn recover mode on. bool RecoveryMode { set; } /// /// turns asynchronous sync on and off.

/// One of the most costly operations during commit is the call to /// flush the buffers of the database file. ///
/// /// turns asynchronous sync on and off.

/// One of the most costly operations during commit is the call to /// flush the buffers of the database file. In regular mode the /// commit call has to wait until this operation has completed. /// When asynchronous sync is turned on, the sync operation will /// run in a dedicated thread, blocking all other file access /// until it has completed. This way the commit call can return /// immediately. This will allow db4o and other processes to /// continue running side-by-side while the flush call executes. /// Use this setting with care: It means that you can not be sure /// when a commit call has actually made the changes of a /// transaction durable (flushed through OS and file system /// buffers). The latency time until flushing happens is extremely /// short. The dedicated sync thread does nothing else /// except for calling sync and writing the header of the database /// file when needed. A setup with this option still guarantees /// ACID transaction processing: A database file always will be /// either in the state before commit or in the state after /// commit. Corruption can not occur. You can just not rely /// on the transaction already having been applied when the /// commit() call returns. ///
bool AsynchronousSync { set; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IObjectField.cs0000644000175000017500000001377711700531646027145 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Config { /// configuration interface for fields of classes. /// /// configuration interface for fields of classes. ///

/// Use /// IObjectClass.ObjectField(string) /// to access this setting.

///
public interface IObjectField { /// sets cascaded activation behaviour. /// /// sets cascaded activation behaviour. ///

/// Setting cascadeOnActivate to true will result in the activation /// of the object attribute stored in this field if the parent object /// is activated. ///

/// The default setting is false.

/// In client-server environment this setting should be used on both /// client and server.

/// This setting can be applied to an open object container.

///
/// whether activation is to be cascaded to the member object. /// Why activation? /// IObjectClass.CascadeOnActivate(bool) /// /// Db4objects.Db4o.IObjectContainer.Activate(object, int) /// /// Using callbacks void CascadeOnActivate(bool flag); /// sets cascaded delete behaviour. /// /// sets cascaded delete behaviour. ///

/// Setting cascadeOnDelete to true will result in the deletion of /// the object attribute stored in this field on the parent object /// if the parent object is passed to /// Db4objects.Db4o.IObjectContainer.Delete(object) /// /// . ///

/// Caution !
/// This setting will also trigger deletion of the old member object, on /// calls to /// /// . /// An example of the behaviour can be found in /// IObjectClass.CascadeOnDelete(bool) /// ///

/// The default setting is false.

/// In client-server environment this setting should be used on both /// client and server.

/// This setting can be applied to an open object container.

///
/// whether deletes are to be cascaded to the member object. /// IObjectClass.CascadeOnDelete(bool) /// /// Db4objects.Db4o.IObjectContainer.Delete(object) /// /// Using callbacks void CascadeOnDelete(bool flag); /// sets cascaded update behaviour. /// /// sets cascaded update behaviour. ///

/// Setting cascadeOnUpdate to true will result in the update /// of the object attribute stored in this field if the parent object /// is passed to /// Db4objects.Db4o.IObjectContainer.Store(object) /// /// . ///

/// The default setting is false.

/// In client-server environment this setting should be used on both /// client and server.

/// This setting can be applied to an open object container.

///
/// whether updates are to be cascaded to the member object. /// com.db4o.ObjectContainer#set /// IObjectClass.CascadeOnUpdate(bool) /// /// IObjectClass.UpdateDepth(int) /// Using callbacks void CascadeOnUpdate(bool flag); /// turns indexing on or off. /// /// turns indexing on or off. ///

Field indices dramatically improve query performance but they may /// considerably reduce storage and update performance.
The best benchmark whether /// or not an index on a field achieves the desired result is the completed application /// - with a data load that is typical for it's use.

This configuration setting /// is only checked when the /// Db4objects.Db4o.IObjectContainer /// is opened. If the /// setting is set to true and an index does not exist, the index will be /// created. If the setting is set to false and an index does exist the /// index will be dropped.

/// In client-server environment this setting should be used on both /// client and server.

/// If this setting is applied to an open ObjectContainer it will take an effect on the next /// time ObjectContainer is opened.

///
/// /// specify true or false to turn indexing on for /// this field /// void Indexed(bool flag); /// renames a field of a stored class. /// /// renames a field of a stored class. ///

Use this method to refactor classes. ///

/// In client-server environment this setting should be used on both /// client and server.

/// This setting can NOT be applied to an open object container.

///
/// the new field name. void Rename(string newName); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Config/IIdSystemConfiguration.cs0000644000175000017500000000407211700531646031250 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Config; namespace Db4objects.Db4o.Config { /// Interface to configure the IdSystem. /// Interface to configure the IdSystem. public interface IIdSystemConfiguration { /// configures db4o to store IDs as pointers. /// configures db4o to store IDs as pointers. void UsePointerBasedSystem(); /// /// configures db4o to use a stack of two BTreeIdSystems on /// top of an InMemoryIdSystem. /// /// /// configures db4o to use a stack of two BTreeIdSystems on /// top of an InMemoryIdSystem. This setup is scalable for /// large numbers of IDs. It is the default configuration /// when new databases are created. /// void UseStackedBTreeSystem(); /// /// configures db4o to use a single BTreeIdSystem on /// top of an InMemoryIdSystem. /// /// /// configures db4o to use a single BTreeIdSystem on /// top of an InMemoryIdSystem. This setup is suitable for /// smaller databases with a small number of IDs. /// For larger numbers of IDs call /// UseStackedBTreeSystem() /// . /// void UseSingleBTreeSystem(); /// configures db4o to use an in-memory ID system. /// /// configures db4o to use an in-memory ID system. /// All IDs get written to the database file on every commit. /// void UseInMemorySystem(); /// configures db4o to use a custom ID system. /// /// configures db4o to use a custom ID system. /// Pass an /// IIdSystemFactory /// that creates the IdSystem. /// Note that this factory has to be configured every time you /// open a database that you configured to use a custom IdSystem. /// void UseCustomSystem(IIdSystemFactory factory); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Debug4.cs0000644000175000017500000000713311700531646024554 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Marshall; namespace Db4objects.Db4o { /// public sealed class Debug4 { /// indexes all fields public const bool indexAllFields = false; /// prints query graph information to the console public const bool queries = false; /// /// allows faking the Db4oDatabase identity object, so the first /// stored object in the debugger is the actually persisted object /// Changing this setting to true will fail some tests that expect /// database files to have identity /// public const bool staticIdentity = queries; /// prints more stack traces public const bool atHome = false; /// makes C/S timeouts longer, so C/S does not time out in the debugger public const bool longTimeOuts = false; /// turns freespace debuggin on public const bool freespace = Deploy.debug; /// /// fills deleted slots with 'X' and overrides any configured /// freespace filler /// public const bool xbytes = freespace; /// /// checks monitor conditions to make sure only the thread /// with the global monitor is allowed entry to the core /// public const bool checkSychronization = false; /// /// makes sure a configuration entry is generated for each persistent /// class /// public const bool configureAllClasses = indexAllFields; /// /// makes sure a configuration entry is generated for each persistent /// field /// public const bool configureAllFields = indexAllFields; /// allows turning weak references off public const bool weakReferences = true; /// prints all communicated messages to the console public const bool messages = false; /// allows turning NIO off on Java public const bool nio = true; /// allows overriding the file locking mechanism to turn it off public const bool lockFile = true; public static void Expect(bool cond) { if (!cond) { throw new Exception("Should never happen"); } } public static void EnsureLock(object obj) { } public static bool ExceedsMaximumBlockSize(int a_length) { if (a_length > Const4.MaximumBlockSize) { return true; } return false; } public static bool ExceedsMaximumArrayEntries(int a_entries, bool a_primitive) { if (a_entries > (a_primitive ? Const4.MaximumArrayEntriesPrimitive : Const4.MaximumArrayEntries )) { return true; } return false; } public static void ReadBegin(IReadBuffer buffer, byte identifier) { } public static void ReadEnd(IReadBuffer buffer) { if (Deploy.debug && Deploy.brackets) { if (buffer.ReadByte() != Const4.Yapend) { throw new Exception("Debug.readEnd() YAPEND expected"); } } } public static void WriteBegin(IWriteBuffer buffer, byte identifier) { } public static void WriteEnd(IWriteBuffer buffer) { if (Deploy.debug && Deploy.brackets) { if (buffer is MarshallingContext) { ((MarshallingContext)buffer).DebugWriteEnd(Const4.Yapend); return; } buffer.WriteByte(Const4.Yapend); } } private Debug4() { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IObjectSet.cs0000644000175000017500000000562411700531646025440 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o { /// /// An ObjectSet is a representation for a set of objects returned /// by a query. /// /// /// An ObjectSet is a representation for a set of objects returned /// by a query. ///

ObjectSet extends the system collection interfaces /// java.util.List/System.Collections.IList where they are available. It is /// recommended, never to reference ObjectSet directly in code but to use /// List / IList instead. ///

Note that the underlying /// IObjectContainer /// of an ObjectSet /// needs to remain open as long as an ObjectSet is used. This is necessary /// for lazy instantiation. The objects in an ObjectSet are only instantiated /// when they are actually being used by the application. ///
/// for extended functionality. public interface IObjectSet : IList, IEnumerable { /// returns an ObjectSet with extended functionality. /// /// returns an ObjectSet with extended functionality. ///

Every ObjectSet that db4o provides can be casted to /// an ExtObjectSet. This method is supplied for your convenience /// to work without a cast. ///

The ObjectSet functionality is split to two interfaces /// to allow newcomers to focus on the essential methods. ///
IExtObjectSet Ext(); /// returns true if the ObjectSet has more elements. /// /// returns true if the ObjectSet has more elements. /// /// /// boolean - true if the ObjectSet has more /// elements. /// bool HasNext(); /// returns the next object in the ObjectSet. /// /// returns the next object in the ObjectSet. ///

/// Before returning the Object, next() triggers automatic activation of the /// Object with the respective /// global /// or /// class specific /// /// setting.

///
/// the next object in the ObjectSet. object Next(); /// resets the ObjectSet cursor before the first element. /// /// resets the ObjectSet cursor before the first element. ///

A subsequent call to next() will return the first element. ///
void Reset(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/CorruptionException.cs0000644000175000017500000000042511700531646027462 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o { /// [System.Serializable] public class CorruptionException : Exception { // TODO implement exception basics (message, etc.) } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/StaticClass.cs0000644000175000017500000000066511700531646025662 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; namespace Db4objects.Db4o { /// /// public class StaticClass : IInternal4 { public string name; public StaticField[] fields; public StaticClass() { } public StaticClass(string name_, StaticField[] fields_) { name = name_; fields = fields_; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/IObjectServer.cs0000644000175000017500000000640211700531646026146 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Ext; namespace Db4objects.Db4o { /// the db4o server interface. /// /// the db4o server interface. ///

- db4o servers can be opened with /// Db4oFactory.OpenServer(string, int) /// /// .
/// - Direct in-memory connections to servers can be made with /// OpenClient() ///
/// - TCP connections are available through /// Db4oFactory.OpenClient(string, int, string, string) /// /// . ///

Before connecting clients over TCP, you have to /// GrantAccess(string, string) /// to the username and password combination /// that you want to use. ///
/// Db4o.openServer /// ExtObjectServer for extended functionality /// public interface IObjectServer : System.IDisposable { /// /// closes the /// /// and writes all cached data. ///

///
/// /// true - denotes that the last instance connected to the /// used database file was closed. /// bool Close(); /// /// returns an /// /// with extended functionality. ///

Use this method as a convenient accessor to extended methods. /// Every /// /// can be casted to an /// Db4objects.Db4o.Ext.IExtObjectServer /// /// . ///

The functionality is split to two interfaces to allow newcomers to /// focus on the essential methods. ///
IExtObjectServer Ext(); /// grants client access to the specified user with the specified password. /// /// grants client access to the specified user with the specified password. ///

If the user already exists, the password is changed to /// the specified password.

///
/// the name of the user /// the password to be used void GrantAccess(string userName, string password); /// opens a client against this server. /// /// opens a client against this server. ///

A client opened with this method operates within the same VM /// as the server. Since an embedded client can use direct communication, without /// an in-between socket connection, performance will be better than a client /// opened with /// Db4oFactory.OpenClient(string, int, string, string) /// ///

Every client has it's own transaction and uses it's own cache /// for it's own version of all peristent objects. ///
IObjectContainer OpenClient(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/ITransactionListener.cs0000644000175000017500000000053011700531646027540 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o { /// /// allows registration with a transaction to be notified of /// commit and rollback /// /// public interface ITransactionListener { void PreCommit(); void PostRollback(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/0000755000175000017500000000000011700531646025215 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/NoDuplicatesQueue.cs0000644000175000017500000000156711700531646031154 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class NoDuplicatesQueue : IQueue4 { private IQueue4 _queue; private Hashtable4 _seen; public NoDuplicatesQueue(IQueue4 queue) { _queue = queue; _seen = new Hashtable4(); } public virtual void Add(object obj) { if (_seen.ContainsKey(obj)) { return; } _queue.Add(obj); _seen.Put(obj, obj); } public virtual bool HasNext() { return _queue.HasNext(); } public virtual IEnumerator Iterator() { return _queue.Iterator(); } public virtual object Next() { return _queue.Next(); } public virtual object NextMatching(IPredicate4 condition) { return _queue.NextMatching(condition); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/CircularBuffer4.cs0000644000175000017500000001021311700531646030523 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// A fixed size double ended queue with O(1) complexity for addFirst, removeFirst and removeLast operations. /// /// A fixed size double ended queue with O(1) complexity for addFirst, removeFirst and removeLast operations. /// public class CircularBuffer4 : IEnumerable { private readonly object[] _buffer; private int _head; private int _tail; public CircularBuffer4(int size) { _buffer = (object[])new object[size + 1]; } public virtual int Size() { return Index(_tail - _head); } public virtual void AddFirst(object value) { int newHead = CircularIndex(_head - 1); if (newHead == _tail) { throw new InvalidOperationException(); } _head = newHead; _buffer[Index(_head)] = value; } private int CircularIndex(int index) { return index % _buffer.Length; } private int Index(int i) { return i < 0 ? _buffer.Length + i : i; } public virtual object RemoveLast() { AssertNotEmpty(); _tail = CircularIndex(_tail - 1); return Erase(_tail); } private void AssertNotEmpty() { if (IsEmpty()) { throw new InvalidOperationException(); } } public virtual bool IsEmpty() { return Index(_head) == Index(_tail); } public virtual bool IsFull() { return CircularIndex(_head - 1) == _tail; } public virtual object RemoveFirst() { AssertNotEmpty(); object erased = Erase(_head); _head = CircularIndex(_head + 1); return erased; } private object Erase(int index) { int bufferIndex = Index(index); object erasedValue = _buffer[bufferIndex]; _buffer[bufferIndex] = null; return erasedValue; } public virtual bool Remove(object value) { int idx = IndexOf(value); if (idx >= 0) { RemoveAt(idx); return true; } return false; } public virtual bool Contains(object value) { return IndexOf(value) >= 0; } private int IndexOf(object value) { int current = Index(_head); int tail = Index(_tail); while (current != tail) { if (((object)value).Equals(_buffer[current])) { break; } current = CircularIndex(current + 1); } return (current == tail ? -1 : current); } private void RemoveAt(int index) { if (Index(_tail - 1) == index) { RemoveLast(); return; } if (index == Index(_head)) { RemoveFirst(); return; } int current = index; int tail = Index(_tail); while (current != tail) { int next = CircularIndex(current + 1); _buffer[current] = _buffer[next]; current = next; } _tail = CircularIndex(_tail - 1); } public virtual IEnumerator GetEnumerator() { int tail = Index(_tail); int head = Index(_head); // TODO: detect concurrent modification and throw IllegalStateException return new _IEnumerator_121(this, head, tail); } private sealed class _IEnumerator_121 : IEnumerator { public _IEnumerator_121(CircularBuffer4 _enclosing, int head, int tail) { this._enclosing = _enclosing; this.head = head; this.tail = tail; this._index = head; this._current = Iterators.NoElement; } private int _index; private object _current; public object Current { get { if (this._current == Iterators.NoElement) { throw new InvalidOperationException(); } return this._current; } } public bool MoveNext() { if (this._index == tail) { return false; } this._current = this._enclosing._buffer[this._index]; this._index = this._enclosing.CircularIndex(this._index + 1); return true; } public void Reset() { throw new NotImplementedException(); } private readonly CircularBuffer4 _enclosing; private readonly int head; private readonly int tail; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/TreeNodeIterator.cs0000644000175000017500000000060411700531646030763 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class TreeNodeIterator : AbstractTreeIterator { public TreeNodeIterator(Tree tree) : base(tree) { } protected override object CurrentValue(Tree tree) { return tree.Root(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Iterator4Impl.cs0000644000175000017500000000175611700531646030254 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class Iterator4Impl : IEnumerator { private readonly List4 _first; private List4 _next; private object _current; public Iterator4Impl(List4 first) { _first = first; _next = first; _current = Iterators.NoElement; } public virtual bool MoveNext() { if (_next == null) { _current = Iterators.NoElement; return false; } _current = ((object)_next._element); _next = ((List4)_next._next); return true; } public virtual object Current { get { if (Iterators.NoElement == _current) { throw new InvalidOperationException(); } return (object)_current; } } public virtual void Reset() { _next = _first; _current = Iterators.NoElement; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Arrays4.cs0000644000175000017500000000506411700531646027076 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Sharpen; namespace Db4objects.Db4o.Foundation { /// public class Arrays4 { public static int[] CopyOf(int[] src, int newLength) { int[] copy = new int[newLength]; System.Array.Copy(src, 0, copy, 0, Math.Min(src.Length, newLength)); return copy; } public static int IndexOfIdentity(object[] array, object element) { for (int i = 0; i < array.Length; i++) { if (array[i] == element) { return i; } } return -1; } public static int IndexOfEquals(object[] array, object expected) { for (int i = 0; i < array.Length; ++i) { if (expected.Equals(array[i])) { return i; } } return -1; } public static int IndexOf(int[] array, int element) { for (int i = 0; i < array.Length; i++) { if (array[i] == element) { return i; } } return -1; } public static bool Equals(byte[] x, byte[] y) { if (x == y) { return true; } if (x == null) { return false; } if (x.Length != y.Length) { return false; } for (int i = 0; i < x.Length; i++) { if (y[i] != x[i]) { return false; } } return true; } public static bool Equals(object[] x, object[] y) { if (x == y) { return true; } if (x == null) { return false; } if (x.Length != y.Length) { return false; } for (int i = 0; i < x.Length; i++) { if (!ObjectsAreEqual(y[i], x[i])) { return false; } } return true; } private static bool ObjectsAreEqual(object x, object y) { if (x == y) { return true; } if (x == null || y == null) { return false; } return x.Equals(y); } public static bool ContainsInstanceOf(object[] array, Type klass) { if (array == null) { return false; } for (int i = 0; i < array.Length; ++i) { if (klass.IsInstanceOfType(array[i])) { return true; } } return false; } public static void Fill(object[] array, object value) { for (int i = 0; i < array.Length; ++i) { array[i] = value; } } public static Collection4 AsList(object[] arr) { Collection4 coll = new Collection4(); for (int arrIdx = 0; arrIdx < arr.Length; arrIdx++) { coll.Add(arr[arrIdx]); } return coll; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IIntObjectVisitor.cs0000644000175000017500000000034211700531646031115 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// public interface IIntObjectVisitor { void Visit(int anInt, object anObject); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IListener4.cs0000644000175000017500000000032011700531646027521 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// public interface IListener4 { void OnEvent(object @event); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/EnumerateIterator.cs0000644000175000017500000000145611700531646031211 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class EnumerateIterator : MappingIterator { public sealed class Tuple { public readonly int index; public readonly object value; public Tuple(int index_, object value_) { index = index_; value = value_; } } private int _index; public EnumerateIterator(IEnumerator iterator) : base(iterator) { _index = 0; } public override bool MoveNext() { if (base.MoveNext()) { ++_index; return true; } return false; } protected override object Map(object current) { return new EnumerateIterator.Tuple(_index, current); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/KeySpecHashtable4.cs0000644000175000017500000000340011700531646031004 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class KeySpecHashtable4 : IDeepClone { private SynchronizedHashtable4 _delegate; private KeySpecHashtable4(SynchronizedHashtable4 delegate_) { _delegate = delegate_; } public KeySpecHashtable4(int size) : this(new SynchronizedHashtable4(size)) { } public virtual void Put(KeySpec spec, byte value) { _delegate.Put(spec, value); } public virtual void Put(KeySpec spec, bool value) { _delegate.Put(spec, value); } public virtual void Put(KeySpec spec, int value) { _delegate.Put(spec, value); } public virtual void Put(KeySpec spec, object value) { _delegate.Put(spec, value); } public virtual byte GetAsByte(KeySpec spec) { return ((byte)Get(spec)); } public virtual bool GetAsBoolean(KeySpec spec) { return ((bool)Get(spec)); } public virtual int GetAsInt(KeySpec spec) { return ((int)Get(spec)); } public virtual TernaryBool GetAsTernaryBool(KeySpec spec) { return (TernaryBool)Get(spec); } public virtual string GetAsString(KeySpec spec) { return (string)Get(spec); } public virtual object Get(KeySpec spec) { lock (this) { object value = _delegate.Get(spec); if (value == null) { value = spec.DefaultValue(); if (value != null) { _delegate.Put(spec, value); } } return value; } } public virtual object DeepClone(object obj) { return new Db4objects.Db4o.Foundation.KeySpecHashtable4((SynchronizedHashtable4)_delegate .DeepClone(obj)); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IntArrayList.cs0000644000175000017500000000372311700531646030136 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Sharpen; namespace Db4objects.Db4o.Foundation { /// public class IntArrayList : IEnumerable { protected int[] i_content; private int i_count; public IntArrayList() : this(10) { } public IntArrayList(int initialSize) { i_content = new int[initialSize]; } public virtual void Add(int a_value) { EnsureCapacity(); i_content[i_count++] = a_value; } public virtual void Add(int index, int a_value) { EnsureCapacity(); System.Array.Copy(i_content, index, i_content, index + 1, i_count - index); i_content[index] = a_value; i_count++; } private void EnsureCapacity() { if (i_count >= i_content.Length) { int inc = i_content.Length / 2; if (inc < 10) { inc = 10; } int[] temp = new int[i_content.Length + inc]; System.Array.Copy(i_content, 0, temp, 0, i_content.Length); i_content = temp; } } public virtual int IndexOf(int a_value) { for (int i = 0; i < i_count; i++) { if (i_content[i] == a_value) { return i; } } return -1; } public virtual int Size() { return i_count; } public virtual long[] AsLong() { long[] longs = new long[i_count]; for (int i = 0; i < i_count; i++) { longs[i] = i_content[i]; } return longs; } public virtual IIntIterator4 IntIterator() { return IntIterators.ForInts(i_content, i_count); } public virtual IEnumerator GetEnumerator() { return IntIterator(); } public virtual int Get(int index) { return i_content[index]; } public virtual void Swap(int left, int right) { if (left != right) { int swap = i_content[left]; i_content[left] = i_content[right]; i_content[right] = swap; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IEntry4.cs0000644000175000017500000000032311700531646027040 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// public interface IEntry4 { object Key(); object Value(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/DynamicVariable.cs0000644000175000017500000000262111700531646030577 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Sharpen.Lang; namespace Db4objects.Db4o.Foundation { /// A dynamic variable is a value associated to a specific thread and scope. /// /// /// A dynamic variable is a value associated to a specific thread and scope. /// The value is brought into scope with the /// With(object, IClosure4) /// method. /// public class DynamicVariable { public static DynamicVariable NewInstance() { return new DynamicVariable(); } private readonly ThreadLocal _value = new ThreadLocal(); public virtual object Value { get { object value = _value.Get(); return value == null ? DefaultValue() : value; } set { _value.Set(value); } } protected virtual object DefaultValue() { return null; } public virtual object With(object value, IClosure4 block) { object previous = _value.Get(); _value.Set(value); try { return block.Run(); } finally { _value.Set(previous); } } public virtual void With(object value, IRunnable block) { object previous = _value.Get(); _value.Set(value); try { block.Run(); } finally { _value.Set(previous); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/FlatteningIterator.cs0000644000175000017500000000302311700531646031347 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class FlatteningIterator : CompositeIterator4 { private class IteratorStack { public readonly IEnumerator iterator; public readonly FlatteningIterator.IteratorStack next; public IteratorStack(IEnumerator iterator_, FlatteningIterator.IteratorStack next_ ) { iterator = iterator_; next = next_; } } private FlatteningIterator.IteratorStack _stack; public FlatteningIterator(IEnumerator iterators) : base(iterators) { } public override bool MoveNext() { if (null == _currentIterator) { if (null == _stack) { _currentIterator = _iterators; } else { _currentIterator = Pop(); } } if (!_currentIterator.MoveNext()) { if (_currentIterator == _iterators) { return false; } _currentIterator = null; return MoveNext(); } object current = _currentIterator.Current; if (current is IEnumerator) { Push(_currentIterator); _currentIterator = NextIterator(current); return MoveNext(); } return true; } private void Push(IEnumerator currentIterator) { _stack = new FlatteningIterator.IteratorStack(currentIterator, _stack); } private IEnumerator Pop() { IEnumerator iterator = _stack.iterator; _stack = _stack.next; return iterator; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/ObjectByRef.cs0000755000175000017500000000065511700531646027713 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// Useful as "out" or "by ref" function parameter. /// Useful as "out" or "by ref" function parameter. public sealed class ObjectByRef { public object value; public ObjectByRef() { } public ObjectByRef(object value_) { value = value_; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/AbstractTreeIterator.cs0000644000175000017500000000333311700531646031643 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public abstract class AbstractTreeIterator : IEnumerator { private readonly Tree _tree; private Stack4 _stack; public AbstractTreeIterator(Tree tree) { _tree = tree; } public virtual object Current { get { if (_stack == null) { throw new InvalidOperationException(); } Tree tree = Peek(); if (tree == null) { return null; } return CurrentValue(tree); } } private Tree Peek() { return (Tree)_stack.Peek(); } public virtual void Reset() { _stack = null; } public virtual bool MoveNext() { if (_stack == null) { InitStack(); return _stack != null; } Tree current = Peek(); if (current == null) { return false; } if (PushPreceding(((Tree)current._subsequent))) { return true; } while (true) { _stack.Pop(); Tree parent = Peek(); if (parent == null) { return false; } if (current == ((Tree)parent._preceding)) { return true; } current = parent; } } private void InitStack() { if (_tree == null) { return; } _stack = new Stack4(); PushPreceding(_tree); } private bool PushPreceding(Tree node) { if (node == null) { return false; } while (node != null) { _stack.Push(node); node = ((Tree)node._preceding); } return true; } protected abstract object CurrentValue(Tree tree); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IntIdGenerator.cs0000644000175000017500000000052011700531646030417 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// public class IntIdGenerator { private int _current = 1; public virtual int Next() { _current++; if (_current < 0) { _current = 1; } return _current; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Iterators.cs0000644000175000017500000003346111700531646027527 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using System.Text; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// Iterator primitives (concat, map, reduce, filter, etc...). /// Iterator primitives (concat, map, reduce, filter, etc...). /// public partial class Iterators { /// /// Constant indicating that the current element in a /// Map(IEnumerator, IFunction4) /// operation /// should be skipped. /// public static readonly object Skip = new object(); private sealed class _IEnumerator_20 : IEnumerator { public _IEnumerator_20() { } public object Current { get { throw new InvalidOperationException(); } } public bool MoveNext() { return false; } public void Reset() { } } public static readonly IEnumerator EmptyIterator = new _IEnumerator_20(); private sealed class _IEnumerable_34 : IEnumerable { public _IEnumerable_34() { } // do nothing public IEnumerator GetEnumerator() { return Iterators.EmptyIterator; } } public static readonly IEnumerable EmptyIterable = new _IEnumerable_34(); internal static readonly object NoElement = new object(); /// /// Generates /// Tuple /// items with indexes starting at 0. /// /// the iterable to be enumerated public static IEnumerable Enumerate(IEnumerable iterable) { return new _IEnumerable_48(iterable); } private sealed class _IEnumerable_48 : IEnumerable { public _IEnumerable_48(IEnumerable iterable) { this.iterable = iterable; } public IEnumerator GetEnumerator() { return new EnumerateIterator(iterable.GetEnumerator()); } private readonly IEnumerable iterable; } public static bool Any(IEnumerator iterator, IPredicate4 condition) { while (iterator.MoveNext()) { if (condition.Match(iterator.Current)) { return true; } } return false; } public static IEnumerator Concat(IEnumerator[] array) { return Concat(Iterate((object[])array)); } public static IEnumerator Concat(IEnumerator iterators) { return new CompositeIterator4(iterators); } public static IEnumerable Concat(IEnumerable[] iterables) { return Concat(Iterable(iterables)); } public static IEnumerable Concat(IEnumerable iterables) { return new CompositeIterable4(iterables); } public static IEnumerator Concat(IEnumerator first, IEnumerator second) { return Concat(new IEnumerator[] { first, second }); } public static IEnumerable ConcatMap(IEnumerable iterable, IFunction4 function) { return Concat(Map(iterable, function)); } /// /// Returns a new iterator which yields the result of applying the function /// to every element in the original iterator. /// /// /// Returns a new iterator which yields the result of applying the function /// to every element in the original iterator. /// Skip /// can be returned from function to indicate the current /// element should be skipped. /// /// /// /// public static IEnumerator Map(IEnumerator iterator, IFunction4 function) { return new FunctionApplicationIterator(iterator, function); } public static IEnumerator Map(object[] array, IFunction4 function) { return Map(new ArrayIterator4(array), function); } public static IEnumerator Filter(object[] array, IPredicate4 predicate) { return Filter(new ArrayIterator4(array), predicate); } public static IEnumerable Filter(IEnumerable source, IPredicate4 predicate) { return new _IEnumerable_112(source, predicate); } private sealed class _IEnumerable_112 : IEnumerable { public _IEnumerable_112(IEnumerable source, IPredicate4 predicate) { this.source = source; this.predicate = predicate; } public IEnumerator GetEnumerator() { return Iterators.Filter(source.GetEnumerator(), predicate); } private readonly IEnumerable source; private readonly IPredicate4 predicate; } public static IEnumerator Filter(IEnumerator iterator, IPredicate4 predicate) { return new FilteredIterator(iterator, predicate); } public static IEnumerable SingletonIterable(object element) { return new _IEnumerable_124(element); } private sealed class _IEnumerable_124 : IEnumerable { public _IEnumerable_124(object element) { this.element = element; } public IEnumerator GetEnumerator() { return Iterators.SingletonIterator(element); } private readonly object element; } public static IEnumerable Append(IEnumerable front, object last) { return Concat(Iterable(new object[] { front, SingletonIterable(last) })); } public static IEnumerator Iterator(IEnumerable iterable) { return iterable.GetEnumerator(); } public static IEnumerator Iterate(object[] array) { return new ArrayIterator4(array); } public static IEnumerator Revert(IEnumerator iterator) { iterator.Reset(); List4 tail = null; while (iterator.MoveNext()) { tail = new List4(tail, iterator.Current); } return Iterate(tail); } public static IEnumerator Iterate(List4 list) { if (list == null) { return EmptyIterator; } Collection4 collection = new Collection4(); while (list != null) { collection.Add(list._element); list = ((List4)list._next); } return collection.GetEnumerator(); } public static int Size(IEnumerable iterable) { return Size(iterable.GetEnumerator()); } public static object Next(IEnumerator iterator) { if (!iterator.MoveNext()) { throw new InvalidOperationException(); } return iterator.Current; } public static int Size(IEnumerator iterator) { int count = 0; while (iterator.MoveNext()) { ++count; } return count; } public static string ToString(IEnumerable i) { return ToString(i.GetEnumerator()); } public static string ToString(IEnumerator i) { return Join(i, "[", "]", ", "); } public static string Join(IEnumerable i, string separator) { return Join(i.GetEnumerator(), separator); } public static string Join(IEnumerator i, string separator) { return Join(i, string.Empty, string.Empty, separator); } public static string Join(IEnumerator i, string prefix, string suffix, string separator ) { StringBuilder sb = new StringBuilder(); sb.Append(prefix); if (i.MoveNext()) { sb.Append(i.Current); while (i.MoveNext()) { sb.Append(separator); sb.Append(i.Current); } } sb.Append(suffix); return sb.ToString(); } public static object[] ToArray(IEnumerator tests) { return ToArray(tests, new _IArrayFactory_230()); } private sealed class _IArrayFactory_230 : IArrayFactory { public _IArrayFactory_230() { } public object[] NewArray(int size) { return new object[size]; } } public static object[] ToArray(IEnumerator tests, IArrayFactory factory) { Collection4 elements = new Collection4(tests); return elements.ToArray(factory.NewArray(elements.Size())); } /// Yields a flat sequence of elements. /// /// Yields a flat sequence of elements. Any /// IEnumerable /// or /// IEnumerator /// found in the original sequence is recursively flattened. /// /// original sequence public static IEnumerator Flatten(IEnumerator iterator) { return new FlatteningIterator(iterator); } public static IEnumerable Map(IEnumerable iterable, IFunction4 function) { return new _IEnumerable_253(iterable, function); } private sealed class _IEnumerable_253 : IEnumerable { public _IEnumerable_253(IEnumerable iterable, IFunction4 function) { this.iterable = iterable; this.function = function; } public IEnumerator GetEnumerator() { return Iterators.Map(iterable.GetEnumerator(), function); } private readonly IEnumerable iterable; private readonly IFunction4 function; } public static IEnumerable CrossProduct(IEnumerable iterables) { return CrossProduct((IEnumerable[])ToArray(iterables.GetEnumerator(), new _IArrayFactory_261 ())); } private sealed class _IArrayFactory_261 : IArrayFactory { public _IArrayFactory_261() { } public object[] NewArray(int size) { return new IEnumerable[size]; } } public static IEnumerable CrossProduct(IEnumerable[] iterables) { return CrossProduct(iterables, 0, Iterators.EmptyIterable); } private static IEnumerable CrossProduct(IEnumerable[] iterables, int level, IEnumerable row) { if (level == iterables.Length - 1) { return Map(iterables[level], new _IFunction4_276(row)); } return ConcatMap(iterables[level], new _IFunction4_284(iterables, level, row)); } private sealed class _IFunction4_276 : IFunction4 { public _IFunction4_276(IEnumerable row) { this.row = row; } public object Apply(object arg) { return Iterators.Append(row, arg); } private readonly IEnumerable row; } private sealed class _IFunction4_284 : IFunction4 { public _IFunction4_284(IEnumerable[] iterables, int level, IEnumerable row) { this.iterables = iterables; this.level = level; this.row = row; } public object Apply(object arg) { return Iterators.CrossProduct(iterables, level + 1, Iterators.Append(row, arg)); } private readonly IEnumerable[] iterables; private readonly int level; private readonly IEnumerable row; } public static IEnumerable Iterable(object[] objects) { return new _IEnumerable_292(objects); } private sealed class _IEnumerable_292 : IEnumerable { public _IEnumerable_292(object[] objects) { this.objects = objects; } public IEnumerator GetEnumerator() { return Iterators.Iterate(objects); } private readonly object[] objects; } public static IEnumerator SingletonIterator(object element) { return new SingleValueIterator(element); } public static IEnumerable Iterable(IEnumerator iterator) { return new _IEnumerable_304(iterator); } private sealed class _IEnumerable_304 : IEnumerable { public _IEnumerable_304(IEnumerator iterator) { this.iterator = iterator; } public IEnumerator GetEnumerator() { return iterator; } private readonly IEnumerator iterator; } public static IEnumerator Copy(IEnumerator iterator) { return new Collection4(iterator).GetEnumerator(); } public static IEnumerator Take(int count, IEnumerator iterator) { return new _IEnumerator_316(count, iterator); } private sealed class _IEnumerator_316 : IEnumerator { public _IEnumerator_316(int count, IEnumerator iterator) { this.count = count; this.iterator = iterator; this._taken = 0; } private int _taken; public object Current { get { if (this._taken > count) { throw new InvalidOperationException(); } return iterator.Current; } } public bool MoveNext() { if (this._taken < count) { if (!iterator.MoveNext()) { this._taken = count; return false; } ++this._taken; return true; } return false; } public void Reset() { throw new NotImplementedException(); } private readonly int count; private readonly IEnumerator iterator; } public static IEnumerator Range(int fromInclusive, int toExclusive) { if (toExclusive < fromInclusive) { throw new ArgumentException(); } return Take(toExclusive - fromInclusive, Series(fromInclusive - 1, new _IFunction4_350 ()).GetEnumerator()); } private sealed class _IFunction4_350 : IFunction4 { public _IFunction4_350() { } public object Apply(object i) { return (((int)i)) + 1; } } public static IEnumerable Series(object seed, IFunction4 function) { return new _IEnumerable_356(seed, function); } private sealed class _IEnumerable_356 : IEnumerable { public _IEnumerable_356(object seed, IFunction4 function) { this.seed = seed; this.function = function; } public IEnumerator GetEnumerator() { return new _IEnumerator_358(seed, function); } private sealed class _IEnumerator_358 : IEnumerator { public _IEnumerator_358(object seed, IFunction4 function) { this.seed = seed; this.function = function; this._current = seed; } private object _current; public object Current { get { return this._current; } } public bool MoveNext() { this._current = function.Apply(this._current); return true; } public void Reset() { this._current = seed; } private readonly object seed; private readonly IFunction4 function; } private readonly object seed; private readonly IFunction4 function; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/TimeStampIdGenerator.cs0000644000175000017500000000350311700531646031574 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Sharpen; namespace Db4objects.Db4o.Foundation { /// public class TimeStampIdGenerator { public const int BitsReservedForCounter = 15; public const int CounterLimit = 64; private long _counter; private long _lastTime; public static long IdToMilliseconds(long id) { return id >> BitsReservedForCounter; } public static long MillisecondsToId(long milliseconds) { return milliseconds << BitsReservedForCounter; } public TimeStampIdGenerator(long minimumNext) { InternalSetMinimumNext(minimumNext); } public TimeStampIdGenerator() : this(0) { } public virtual long Generate() { long t = Now(); if (t > _lastTime) { _lastTime = t; _counter = 0; return MillisecondsToId(t); } UpdateTimeOnCounterLimitOverflow(); _counter++; UpdateTimeOnCounterLimitOverflow(); return Last(); } protected virtual long Now() { return Runtime.CurrentTimeMillis(); } private void UpdateTimeOnCounterLimitOverflow() { if (_counter < CounterLimit) { return; } long timeIncrement = _counter / CounterLimit; _lastTime += timeIncrement; _counter -= (timeIncrement * CounterLimit); } public virtual long Last() { return MillisecondsToId(_lastTime) + _counter; } public virtual bool SetMinimumNext(long newMinimum) { if (newMinimum <= Last()) { return false; } InternalSetMinimumNext(newMinimum); return true; } private void InternalSetMinimumNext(long newNext) { _lastTime = IdToMilliseconds(newNext); long timePart = MillisecondsToId(_lastTime); _counter = newNext - timePart; UpdateTimeOnCounterLimitOverflow(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/HashtableObjectEntry.cs0000644000175000017500000000304011700531646031605 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class HashtableObjectEntry : HashtableIntEntry { public object _objectKey; internal HashtableObjectEntry(int a_hash, object a_key, object a_object) : base(a_hash , a_object) { // FIELDS ARE PUBLIC SO THEY CAN BE REFLECTED ON IN JDKs <= 1.1 _objectKey = a_key; } internal HashtableObjectEntry(object a_key, object a_object) : base(a_key.GetHashCode (), a_object) { _objectKey = a_key; } public HashtableObjectEntry() : base() { } public override object Key() { return _objectKey; } public override object DeepClone(object obj) { return DeepCloneInternal(new Db4objects.Db4o.Foundation.HashtableObjectEntry(), obj ); } protected override HashtableIntEntry DeepCloneInternal(HashtableIntEntry entry, object obj) { ((Db4objects.Db4o.Foundation.HashtableObjectEntry)entry)._objectKey = _objectKey; return base.DeepCloneInternal(entry, obj); } public virtual bool HasKey(object key) { return _objectKey.Equals(key); } public override bool SameKeyAs(HashtableIntEntry other) { return other is Db4objects.Db4o.Foundation.HashtableObjectEntry ? HasKey(((Db4objects.Db4o.Foundation.HashtableObjectEntry )other)._objectKey) : false; } public override string ToString() { return string.Empty + _objectKey + ": " + _object; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/MappingIterator.cs0000644000175000017500000000221011700531646030644 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public abstract class MappingIterator : IEnumerator { private readonly IEnumerator _iterator; private object _current; public MappingIterator(IEnumerator iterator) { if (null == iterator) { throw new ArgumentNullException(); } _iterator = iterator; _current = Iterators.NoElement; } protected abstract object Map(object current); public virtual bool MoveNext() { do { if (!_iterator.MoveNext()) { _current = Iterators.NoElement; return false; } _current = Map(_iterator.Current); } while (_current == Iterators.Skip); return true; } public virtual void Reset() { _current = Iterators.NoElement; _iterator.Reset(); } public virtual object Current { get { if (Iterators.NoElement == _current) { throw new InvalidOperationException(); } return _current; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IShallowClone.cs0000644000175000017500000000031511700531646030246 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// public interface IShallowClone { object ShallowClone(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IPreparedComparison.cs0000644000175000017500000000126011700531646031451 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// /// a prepared comparison, to compare multiple objects /// with one single object. /// /// /// a prepared comparison, to compare multiple objects /// with one single object. /// public interface IPreparedComparison { /// /// return a negative int, zero or a positive int if /// the object being held in 'this' is smaller, equal /// or greater than the passed object.

/// Typical implementation: return this.object - obj; ///
int CompareTo(object obj); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/PausableBlockingQueue.cs0000644000175000017500000000350011700531646031754 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class PausableBlockingQueue : BlockingQueue, IPausableBlockingQueue4 { private volatile bool _paused = false; public virtual bool Pause() { if (_paused) { return false; } _paused = true; return true; } public virtual bool Resume() { return (((bool)_lock.Run(new _IClosure4_17(this)))); } private sealed class _IClosure4_17 : IClosure4 { public _IClosure4_17(PausableBlockingQueue _enclosing) { this._enclosing = _enclosing; } public object Run() { if (!this._enclosing._paused) { return false; } this._enclosing._paused = false; this._enclosing._lock.Awake(); return true; } private readonly PausableBlockingQueue _enclosing; } public virtual bool IsPaused() { return _paused; } /// protected override bool UnsafeWaitForNext(long timeout) { bool hasNext = base.UnsafeWaitForNext(timeout); while (_paused && !_stopped) { _lock.Snooze(timeout); } if (_stopped) { throw new BlockingQueueStoppedException(); } return hasNext; } public virtual object TryNext() { return _lock.Run(new _IClosure4_46(this)); } private sealed class _IClosure4_46 : IClosure4 { public _IClosure4_46(PausableBlockingQueue _enclosing) { this._enclosing = _enclosing; } public object Run() { return this._enclosing.IsPaused() ? null : this._enclosing.HasNext() ? this._enclosing .Next() : null; } private readonly PausableBlockingQueue _enclosing; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/StopWatch.cs0000644000175000017500000000152011700531646027456 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Sharpen; namespace Db4objects.Db4o.Foundation { public class StopWatch { private long _started; private long _elapsed; public StopWatch() { } public virtual void Start() { _started = Runtime.CurrentTimeMillis(); } public virtual void Stop() { _elapsed = Peek(); } public virtual long Peek() { return Runtime.CurrentTimeMillis() - _started; } public virtual long Elapsed() { return _elapsed; } public static long Time(IBlock4 block) { Db4objects.Db4o.Foundation.StopWatch stopWatch = new Db4objects.Db4o.Foundation.StopWatch (); stopWatch.Start(); block.Run(); stopWatch.Stop(); return stopWatch.Elapsed(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/ICancellableVisitor4.cs0000644000175000017500000000040111700531646031501 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { public interface ICancellableVisitor4 { /// true to continue traversal, false otherwise bool Visit(object obj); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/NativeCollections.cs0000644000175000017500000000104711700531646031173 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class NativeCollections { public static IList Filter(IList items, IPredicate4 predicate) { IList filtered = new ArrayList(); for (IEnumerator itemIter = items.GetEnumerator(); itemIter.MoveNext(); ) { object item = itemIter.Current; if (predicate.Match(item)) { filtered.Add(item); } } return filtered; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/TernaryBool.cs0000644000175000017500000000444011700531646030006 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// yes/no/dontknow data type /// [System.Serializable] public sealed class TernaryBool { private const int NoId = -1; private const int YesId = 1; private const int UnspecifiedId = 0; public static readonly Db4objects.Db4o.Foundation.TernaryBool No = new Db4objects.Db4o.Foundation.TernaryBool (NoId); public static readonly Db4objects.Db4o.Foundation.TernaryBool Yes = new Db4objects.Db4o.Foundation.TernaryBool (YesId); public static readonly Db4objects.Db4o.Foundation.TernaryBool Unspecified = new Db4objects.Db4o.Foundation.TernaryBool (UnspecifiedId); private readonly int _value; private TernaryBool(int value) { _value = value; } public bool BooleanValue(bool defaultValue) { switch (_value) { case NoId: { return false; } case YesId: { return true; } default: { return defaultValue; break; } } } public bool IsUnspecified() { return this == Unspecified; } public bool DefiniteYes() { return this == Yes; } public bool DefiniteNo() { return this == No; } public static Db4objects.Db4o.Foundation.TernaryBool ForBoolean(bool value) { return (value ? Yes : No); } public override bool Equals(object obj) { if (this == obj) { return true; } if (obj == null || GetType() != obj.GetType()) { return false; } Db4objects.Db4o.Foundation.TernaryBool tb = (Db4objects.Db4o.Foundation.TernaryBool )obj; return _value == tb._value; } public override int GetHashCode() { return _value; } private object ReadResolve() { switch (_value) { case NoId: { return No; } case YesId: { return Yes; } default: { return Unspecified; break; } } } public override string ToString() { switch (_value) { case NoId: { return "NO"; } case YesId: { return "YES"; } default: { return "UNSPECIFIED"; break; } } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IProcedure4.cs0000644000175000017500000000031611700531646027671 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// public interface IProcedure4 { void Apply(object value); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/TimeoutBlockingQueue.cs0000644000175000017500000000145111700531646031651 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Sharpen; namespace Db4objects.Db4o.Foundation { public class TimeoutBlockingQueue : PausableBlockingQueue, ITimeoutBlockingQueue4 { private long expirationDate; private readonly long maxTimeToRemainPaused; public TimeoutBlockingQueue(long maxTimeToRemainPaused) { this.maxTimeToRemainPaused = maxTimeToRemainPaused; } public override bool Pause() { Reset(); return base.Pause(); } public virtual void Check() { long now = Runtime.CurrentTimeMillis(); if (now > expirationDate) { Resume(); } } public virtual void Reset() { expirationDate = Runtime.CurrentTimeMillis() + maxTimeToRemainPaused; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IntByRef.cs0000644000175000017500000000065211700531646027231 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// Useful as "out" or "by ref" function parameter. /// Useful as "out" or "by ref" function parameter. public sealed class IntByRef { public int value; public IntByRef(int initialValue) { value = initialValue; } public IntByRef() { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/ISequence4.cs0000644000175000017500000000103411700531646027507 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; namespace Db4objects.Db4o.Foundation { /// public interface ISequence4 : IEnumerable { bool Add(object element); void AddAll(IEnumerable iterable); bool IsEmpty(); object Get(int index); int Size(); void Clear(); bool Remove(object obj); bool Contains(object obj); bool ContainsAll(IEnumerable iter); object[] ToArray(); object[] ToArray(object[] array); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/CircularLongBuffer4.cs0000644000175000017500000001022011700531646031341 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// A fixed size double ended queue with O(1) complexity for addFirst, removeFirst and removeLast operations. /// /// A fixed size double ended queue with O(1) complexity for addFirst, removeFirst and removeLast operations. /// public class CircularLongBuffer4 : IEnumerable { private const int Empty = -1; private readonly long[] _buffer; private int _head; private int _tail; public CircularLongBuffer4(int size) { _buffer = new long[size + 1]; } public virtual int Size() { return Index(_tail - _head); } public virtual void AddFirst(long value) { int newHead = CircularIndex(_head - 1); if (newHead == _tail) { throw new InvalidOperationException(); } _head = newHead; _buffer[Index(_head)] = value; } private int CircularIndex(int index) { return index % _buffer.Length; } private int Index(int i) { return i < 0 ? _buffer.Length + i : i; } public virtual long RemoveLast() { AssertNotEmpty(); _tail = CircularIndex(_tail - 1); return Erase(_tail); } private void AssertNotEmpty() { if (IsEmpty()) { throw new InvalidOperationException(); } } public virtual bool IsEmpty() { return Index(_head) == Index(_tail); } public virtual bool IsFull() { return CircularIndex(_head - 1) == _tail; } public virtual long RemoveFirst() { AssertNotEmpty(); long erased = Erase(_head); _head = CircularIndex(_head + 1); return erased; } private long Erase(int index) { int bufferIndex = Index(index); long erasedValue = _buffer[bufferIndex]; _buffer[bufferIndex] = Empty; return erasedValue; } public virtual bool Remove(long value) { int idx = IndexOf(value); if (idx >= 0) { RemoveAt(idx); return true; } return false; } public virtual bool Contains(long value) { return IndexOf(value) >= 0; } private int IndexOf(long value) { int current = Index(_head); int tail = Index(_tail); while (current != tail) { if (value == _buffer[current]) { break; } current = CircularIndex(current + 1); } return (current == tail ? -1 : current); } private void RemoveAt(int index) { if (Index(_tail - 1) == index) { RemoveLast(); return; } if (index == Index(_head)) { RemoveFirst(); return; } int current = index; int tail = Index(_tail); while (current != tail) { int next = CircularIndex(current + 1); _buffer[current] = _buffer[next]; current = next; } _tail = CircularIndex(_tail - 1); } public virtual IEnumerator GetEnumerator() { int tail = Index(_tail); int head = Index(_head); // TODO: detect concurrent modification and throw IllegalStateException return new _IEnumerator_122(this, head, tail); } private sealed class _IEnumerator_122 : IEnumerator { public _IEnumerator_122(CircularLongBuffer4 _enclosing, int head, int tail) { this._enclosing = _enclosing; this.head = head; this.tail = tail; this._index = head; this._current = Iterators.NoElement; } private int _index; private object _current; public object Current { get { if (this._current == Iterators.NoElement) { throw new InvalidOperationException(); } return this._current; } } public bool MoveNext() { if (this._index == tail) { return false; } this._current = this._enclosing._buffer[this._index]; this._index = this._enclosing.CircularIndex(this._index + 1); return true; } public void Reset() { throw new NotImplementedException(); } private readonly CircularLongBuffer4 _enclosing; private readonly int head; private readonly int tail; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Environments.cs0000644000175000017500000001014611700531646030235 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Sharpen.Lang; namespace Db4objects.Db4o.Foundation { public partial class Environments { private static readonly DynamicVariable _current = DynamicVariable.NewInstance(); public static object My(Type service) { IEnvironment environment = Current(); if (null == environment) { throw new InvalidOperationException(); } return environment.Provide(service); } private static IEnvironment Current() { return ((IEnvironment)_current.Value); } public static void RunWith(IEnvironment environment, IRunnable runnable) { _current.With(environment, runnable); } public static IEnvironment NewClosedEnvironment(object[] bindings) { return new _IEnvironment_32(bindings); } private sealed class _IEnvironment_32 : IEnvironment { public _IEnvironment_32(object[] bindings) { this.bindings = bindings; } public object Provide(Type service) { for (int bindingIndex = 0; bindingIndex < bindings.Length; ++bindingIndex) { object binding = bindings[bindingIndex]; if (service.IsInstanceOfType(binding)) { return (object)binding; } } return null; } private readonly object[] bindings; } public static IEnvironment NewCachingEnvironmentFor(IEnvironment environment) { return new _IEnvironment_48(environment); } private sealed class _IEnvironment_48 : IEnvironment { public _IEnvironment_48(IEnvironment environment) { this.environment = environment; this._bindings = new Hashtable(); } private readonly IDictionary _bindings; public object Provide(Type service) { object existing = this._bindings[service]; if (null != existing) { return (object)existing; } object binding = environment.Provide(service); if (null == binding) { return null; } this._bindings[service] = binding; return binding; } private readonly IEnvironment environment; } public static IEnvironment NewConventionBasedEnvironment(object[] bindings) { return NewCachingEnvironmentFor(Compose(new IEnvironment[] { NewClosedEnvironment (bindings), new Environments.ConventionBasedEnvironment() })); } public static IEnvironment NewConventionBasedEnvironment() { return NewCachingEnvironmentFor(new Environments.ConventionBasedEnvironment()); } public static IEnvironment Compose(IEnvironment[] environments) { return new _IEnvironment_75(environments); } private sealed class _IEnvironment_75 : IEnvironment { public _IEnvironment_75(IEnvironment[] environments) { this.environments = environments; } public object Provide(Type service) { for (int eIndex = 0; eIndex < environments.Length; ++eIndex) { IEnvironment e = environments[eIndex]; object binding = e.Provide(service); if (null != binding) { return binding; } } return null; } private readonly IEnvironment[] environments; } private sealed class ConventionBasedEnvironment : IEnvironment { public object Provide(Type service) { return Resolve(service); } /// /// Resolves a service interface to its default implementation using the /// db4o namespace convention: /// interface foo.bar.Baz /// default implementation foo.internal.bar.BazImpl /// /// the convention based type name for the requested service private object Resolve(Type service) { string className = DefaultImplementationFor(service); object binding = ReflectPlatform.CreateInstance(className); if (null == binding) { throw new ArgumentException("Cant find default implementation for " + service.ToString () + ": " + className); } return (object)binding; } } // ignore convention for internal types } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/PrimitiveCodec.cs0000644000175000017500000000376211700531646030462 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Sharpen.IO; namespace Db4objects.Db4o.Foundation { public sealed class PrimitiveCodec { public const int IntLength = 4; public const int LongLength = 8; public static int ReadInt(byte[] buffer, int offset) { offset += 3; return (buffer[offset] & 255) | (buffer[--offset] & 255) << 8 | (buffer[--offset] & 255) << 16 | buffer[--offset] << 24; } public static int ReadInt(ByteArrayInputStream @in) { return (@in.Read() << 24) | ((@in.Read() & 255) << 16) | ((@in.Read() & 255) << 8 ) | (@in.Read() & 255); } public static void WriteInt(byte[] buffer, int offset, int val) { offset += 3; buffer[offset] = (byte)val; buffer[--offset] = (byte)(val >>= 8); buffer[--offset] = (byte)(val >>= 8); buffer[--offset] = (byte)(val >> 8); } public static void WriteInt(ByteArrayOutputStream @out, int val) { @out.Write((byte)(val >> 24)); @out.Write((byte)(val >> 16)); @out.Write((byte)(val >> 8)); @out.Write((byte)val); } public static void WriteLong(byte[] buffer, long val) { WriteLong(buffer, 0, val); } public static void WriteLong(byte[] buffer, int offset, long val) { for (int i = 0; i < LongLength; i++) { buffer[offset++] = (byte)(val >> ((7 - i) * 8)); } } public static void WriteLong(ByteArrayOutputStream @out, long val) { for (int i = 0; i < LongLength; i++) { @out.Write((byte)(val >> ((7 - i) * 8))); } } public static long ReadLong(byte[] buffer, int offset) { long ret = 0; for (int i = 0; i < LongLength; i++) { ret = (ret << 8) + (buffer[offset++] & unchecked((int)(0xff))); } return ret; } public static long ReadLong(ByteArrayInputStream @in) { long ret = 0; for (int i = 0; i < LongLength; i++) { ret = (ret << 8) + ((byte)@in.Read() & unchecked((int)(0xff))); } return ret; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/CompositeIterator4.cs0000644000175000017500000000277711700531646031321 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class CompositeIterator4 : IEnumerator { protected readonly IEnumerator _iterators; protected IEnumerator _currentIterator; public CompositeIterator4(IEnumerator[] iterators) : this(new ArrayIterator4(iterators )) { } public CompositeIterator4(IEnumerator iterators) { if (null == iterators) { throw new ArgumentNullException(); } _iterators = iterators; } public virtual bool MoveNext() { if (null == _currentIterator) { if (!_iterators.MoveNext()) { return false; } _currentIterator = NextIterator(_iterators.Current); } if (!_currentIterator.MoveNext()) { _currentIterator = null; return MoveNext(); } return true; } public virtual void Reset() { ResetIterators(); _currentIterator = null; _iterators.Reset(); } private void ResetIterators() { _iterators.Reset(); while (_iterators.MoveNext()) { NextIterator(_iterators.Current).Reset(); } } public virtual IEnumerator CurrentIterator() { return _currentIterator; } public virtual object Current { get { return _currentIterator.Current; } } protected virtual IEnumerator NextIterator(object current) { return (IEnumerator)current; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/HashtableIterator.cs0000644000175000017500000000270511700531646031155 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class HashtableIterator : IEnumerator { private readonly HashtableIntEntry[] _table; private HashtableIntEntry _currentEntry; private int _currentIndex; public HashtableIterator(HashtableIntEntry[] table) { _table = table; Reset(); } private void CheckInvalidTable() { if (_table == null || _table.Length == 0) { PositionBeyondLast(); } } public virtual object Current { get { if (_currentEntry == null) { throw new InvalidOperationException(); } return _currentEntry; } } public virtual bool MoveNext() { if (IsBeyondLast()) { return false; } if (_currentEntry != null) { _currentEntry = _currentEntry._next; } while (_currentEntry == null) { if (_currentIndex >= _table.Length) { PositionBeyondLast(); return false; } _currentEntry = _table[_currentIndex++]; } return true; } public virtual void Reset() { _currentEntry = null; _currentIndex = 0; CheckInvalidTable(); } private bool IsBeyondLast() { return _currentIndex == -1; } private void PositionBeyondLast() { _currentIndex = -1; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/BooleanByRef.cs0000755000175000017500000000066311700531646030063 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// Useful as "out" or "by ref" function parameter. /// Useful as "out" or "by ref" function parameter. public class BooleanByRef { public bool value; public BooleanByRef() : this(false) { } public BooleanByRef(bool value_) { value = value_; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IBlockingQueue4.cs0000644000175000017500000000342411700531646030501 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public interface IBlockingQueue4 : IQueue4 { /// ///

/// Returns the next queued item or waits for it to be available for the /// maximum of timeout miliseconds. ///

/// ///

/// Returns the next queued item or waits for it to be available for the /// maximum of timeout miliseconds. /// /// maximum time to wait for the next avilable item in miliseconds /// /// /// the next item or null if timeout is /// reached /// /// /// if the /// Stop() /// is called. /// /// object Next(long timeout); void Stop(); ///

///

/// Removes all the available elements in the queue to the colletion passed /// as argument. ///

/// ///

/// Removes all the available elements in the queue to the colletion passed /// as argument. ///

/// It will block until at least one element is available. /// /// /// the number of elements added to the list. /// /// if the /// Stop() /// is called. /// /// int DrainTo(Collection4 list); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IQueue4.cs0000644000175000017500000000142411700531646027026 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public interface IQueue4 { void Add(object obj); object Next(); bool HasNext(); ///

Returns the next object in the queue that matches the specified condition. /// /// /// Returns the next object in the queue that matches the specified condition. /// The operation is always NON-BLOCKING. /// /// the object must satisfy to be returned /// the object satisfying the condition or null if none does object NextMatching(IPredicate4 condition); IEnumerator Iterator(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/ArrayIterator4.cs0000644000175000017500000000066411700531646030426 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class ArrayIterator4 : IndexedIterator { private readonly object[] _elements; public ArrayIterator4(object[] elements) : base(elements.Length) { _elements = elements; } protected override object Get(int index) { return _elements[index]; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/NonblockingQueue.cs0000644000175000017500000000475311700531646031025 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// Unbounded queue. /// Unbounded queue. /// public class NonblockingQueue : IQueue4 { private List4 _insertionPoint; private List4 _next; public void Add(object obj) { List4 newNode = new List4(null, obj); if (_insertionPoint == null) { _next = newNode; } else { _insertionPoint._next = newNode; } _insertionPoint = newNode; } public object Next() { if (_next == null) { return null; } object ret = ((object)_next._element); RemoveNext(); return ret; } private void RemoveNext() { _next = ((List4)_next._next); if (_next == null) { _insertionPoint = null; } } public virtual object NextMatching(IPredicate4 condition) { if (null == condition) { throw new ArgumentNullException(); } List4 current = _next; List4 previous = null; while (null != current) { object element = ((object)current._element); if (condition.Match(element)) { if (previous == null) { RemoveNext(); } else { previous._next = ((List4)current._next); } return element; } previous = current; current = ((List4)current._next); } return null; } public bool HasNext() { return _next != null; } public virtual IEnumerator Iterator() { List4 origInsertionPoint = _insertionPoint; List4 origNext = _next; return new _Iterator4Impl_82(this, origInsertionPoint, origNext, _next); } private sealed class _Iterator4Impl_82 : Iterator4Impl { public _Iterator4Impl_82(NonblockingQueue _enclosing, List4 origInsertionPoint, List4 origNext, List4 baseArg1) : base(baseArg1) { this._enclosing = _enclosing; this.origInsertionPoint = origInsertionPoint; this.origNext = origNext; } public override bool MoveNext() { if (origInsertionPoint != this._enclosing._insertionPoint || origNext != this._enclosing ._next) { throw new InvalidOperationException(); } return base.MoveNext(); } private readonly NonblockingQueue _enclosing; private readonly List4 origInsertionPoint; private readonly List4 origNext; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IntIterators.cs0000644000175000017500000000213611700531646030175 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class IntIterators { public static IFixedSizeIntIterator4 ForInts(int[] array, int count) { return new IntIterator4Impl(array, count); } public static IIntIterator4 ForLongs(long[] ids) { return new _IIntIterator4_10(ids); } private sealed class _IIntIterator4_10 : IIntIterator4 { public _IIntIterator4_10(long[] ids) { this.ids = ids; this._next = 0; } internal int _next; internal int _current; public int CurrentInt() { return this._current; } public object Current { get { return this._current; } } public bool MoveNext() { if (this._next < ids.Length) { this._current = (int)ids[this._next]; ++this._next; return true; } return false; } public void Reset() { throw new NotImplementedException(); } private readonly long[] ids; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/HashSet4.cs0000644000175000017500000000211711700531646027170 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class HashSet4 : ISet4 { private Hashtable4 _map; public HashSet4() : this(1) { } public HashSet4(int count) { _map = new Hashtable4(count); } public virtual bool Add(object obj) { if (_map.ContainsKey(obj)) { return false; } _map.Put(obj, obj); return true; } public virtual void Clear() { _map.Clear(); } public virtual bool Contains(object obj) { return _map.ContainsKey(obj); } public virtual bool IsEmpty() { return _map.Size() == 0; } public virtual IEnumerator GetEnumerator() { return _map.Values().GetEnumerator(); } public virtual bool Remove(object obj) { return _map.Remove(obj) != null; } public virtual int Size() { return _map.Size(); } public override string ToString() { return Iterators.Join(_map.Keys(), "{", "}", ", "); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IntIterator4Adaptor.cs0000644000175000017500000000144611700531646031414 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class IntIterator4Adaptor : IIntIterator4 { private readonly IEnumerator _iterator; public IntIterator4Adaptor(IEnumerator iterator) { _iterator = iterator; } public IntIterator4Adaptor(IEnumerable iterable) : this(iterable.GetEnumerator()) { } public virtual int CurrentInt() { return ((int)Current); } public virtual object Current { get { return _iterator.Current; } } public virtual bool MoveNext() { return _iterator.MoveNext(); } public virtual void Reset() { _iterator.Reset(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/List4.cs0000644000175000017500000000232711700531646026547 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Types; namespace Db4objects.Db4o.Foundation { /// simplest possible linked list /// public sealed class List4 : IUnversioned { /// next element in list public Db4objects.Db4o.Foundation.List4 _next; /// carried object public object _element; /// db4o constructor to be able to store objects of this class public List4() { } public List4(object element) { // TODO: encapsulate field access _element = element; } public List4(Db4objects.Db4o.Foundation.List4 next, object element) { _next = next; _element = element; } internal bool Holds(object obj) { if (obj == null) { return _element == null; } return ((object)obj).Equals(_element); } public static int Size(Db4objects.Db4o.Foundation.List4 list) { int counter = 0; Db4objects.Db4o.Foundation.List4 nextList = list; while (nextList != null) { counter++; nextList = ((Db4objects.Db4o.Foundation.List4)nextList._next); } return counter; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IBlock4.cs0000644000175000017500000000024211700531646026771 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { public interface IBlock4 { void Run(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/HashtableIntEntry.cs0000644000175000017500000000303111700531646031131 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class HashtableIntEntry : IEntry4, IDeepClone { public int _key; public object _object; public Db4objects.Db4o.Foundation.HashtableIntEntry _next; internal HashtableIntEntry(int key, object obj) { // FIELDS ARE PUBLIC SO THEY CAN BE REFLECTED ON IN JDKs <= 1.1 _key = key; _object = obj; } public HashtableIntEntry() { } public virtual object Key() { return _key; } public virtual object Value() { return _object; } public virtual object DeepClone(object obj) { return DeepCloneInternal(new Db4objects.Db4o.Foundation.HashtableIntEntry(), obj); } public virtual bool SameKeyAs(Db4objects.Db4o.Foundation.HashtableIntEntry other) { return _key == other._key; } protected virtual Db4objects.Db4o.Foundation.HashtableIntEntry DeepCloneInternal( Db4objects.Db4o.Foundation.HashtableIntEntry entry, object obj) { entry._key = _key; entry._next = _next; if (_object is IDeepClone) { entry._object = ((IDeepClone)_object).DeepClone(obj); } else { entry._object = _object; } if (_next != null) { entry._next = (Db4objects.Db4o.Foundation.HashtableIntEntry)_next.DeepClone(obj); } return entry; } public override string ToString() { return string.Empty + _key + ": " + _object; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/TreeObject.cs0000644000175000017500000000111411700531646027567 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class TreeObject : Tree { private readonly object _object; private readonly IComparison4 _function; public TreeObject(object @object, IComparison4 function) { _object = @object; _function = function; } public override int Compare(Tree tree) { return _function.Compare(_object, tree.Key()); } public override object Key() { return _object; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/SimpleObjectPool.cs0000644000175000017500000000157211700531646030763 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class SimpleObjectPool : IObjectPool { private readonly object[] _objects; private int _available; public SimpleObjectPool(object[] objects) { int length = objects.Length; _objects = new object[length]; for (int i = 0; i < length; ++i) { _objects[length - i - 1] = objects[i]; } _available = length; } public virtual object BorrowObject() { if (_available == 0) { throw new InvalidOperationException(); } return (object)_objects[--_available]; } public virtual void ReturnObject(object o) { if (_available == _objects.Length) { throw new InvalidOperationException(); } _objects[_available++] = o; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IMap4.cs0000644000175000017500000000061611700531646026461 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; namespace Db4objects.Db4o.Foundation { /// public interface IMap4 { int Size(); object Get(object key); void Put(object key, object value); bool ContainsKey(object key); object Remove(object key); IEnumerable Values(); void Clear(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IntIterator4Impl.cs0000644000175000017500000000177711700531646030732 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class IntIterator4Impl : IFixedSizeIntIterator4 { private readonly int _count; private int[] _content; private int _current; public IntIterator4Impl(int[] content, int count) { _content = content; _count = count; Reset(); } public virtual int CurrentInt() { if (_content == null || _current == _count) { throw new InvalidOperationException(); } return _content[_current]; } public virtual object Current { get { return CurrentInt(); } } public virtual bool MoveNext() { if (_current < _count - 1) { _current++; return true; } _content = null; return false; } public virtual void Reset() { _current = -1; } public virtual int Size() { return _count; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/ISet4.cs0000644000175000017500000000055611700531646026502 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; namespace Db4objects.Db4o.Foundation { public interface ISet4 : IEnumerable { bool Add(object obj); void Clear(); bool Contains(object obj); bool IsEmpty(); IEnumerator GetEnumerator(); bool Remove(object obj); int Size(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Tree.cs0000644000175000017500000003267211700531646026455 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public abstract class Tree : IShallowClone, IDeepClone, IVisitable { public Tree _preceding; public int _size = 1; public Tree _subsequent; public static Tree Add(Tree oldTree, Tree newTree) { if (oldTree == null) { return newTree; } return (Tree)((Tree)oldTree).Add(newTree); } public Tree Add(Tree newNode) { return Add(newNode, Compare(newNode)); } /// /// On adding a node to a tree, if it already exists, and if /// Tree#duplicates() returns false, #isDuplicateOf() will be /// called. /// /// /// On adding a node to a tree, if it already exists, and if /// Tree#duplicates() returns false, #isDuplicateOf() will be /// called. The added node can then be asked for the node that /// prevails in the tree using #duplicateOrThis(). This mechanism /// allows doing find() and add() in one run. /// public virtual Tree Add(Tree newNode, int cmp) { if (cmp < 0) { if (_subsequent == null) { _subsequent = newNode; _size++; } else { _subsequent = _subsequent.Add(newNode); if (_preceding == null) { return (Tree)RotateLeft(); } return (Tree)Balance(); } } else { if (cmp > 0 || ((Tree)newNode).Duplicates()) { if (_preceding == null) { _preceding = newNode; _size++; } else { _preceding = _preceding.Add(newNode); if (_subsequent == null) { return (Tree)RotateRight(); } return (Tree)Balance(); } } else { return (Tree)((Tree)newNode).OnAttemptToAddDuplicate(this); } } return (Tree)this; } /// /// On adding a node to a tree, if it already exists, and if /// Tree#duplicates() returns false, #onAttemptToAddDuplicate() /// will be called and the existing node will be stored in /// this._preceding. /// /// /// On adding a node to a tree, if it already exists, and if /// Tree#duplicates() returns false, #onAttemptToAddDuplicate() /// will be called and the existing node will be stored in /// this._preceding. /// This node node can then be asked for the node that prevails /// in the tree on adding, using the #addedOrExisting() method. /// This mechanism allows doing find() and add() in one run. /// public virtual Tree AddedOrExisting() { if (WasAddedToTree()) { return this; } return _preceding; } public virtual bool WasAddedToTree() { return _size != 0; } public Tree Balance() { int cmp = _subsequent.Nodes() - _preceding.Nodes(); if (cmp < -2) { return RotateRight(); } else { if (cmp > 2) { return RotateLeft(); } else { SetSizeOwnPrecedingSubsequent(); return this; } } } public virtual Tree BalanceCheckNulls() { if (_subsequent == null) { if (_preceding == null) { SetSizeOwn(); return this; } return RotateRight(); } else { if (_preceding == null) { return RotateLeft(); } } return Balance(); } public virtual void CalculateSize() { if (_preceding == null) { if (_subsequent == null) { SetSizeOwn(); } else { SetSizeOwnSubsequent(); } } else { if (_subsequent == null) { SetSizeOwnPreceding(); } else { SetSizeOwnPrecedingSubsequent(); } } } /// /// returns 0, if keys are equal /// uses this - other /// returns positive if this is greater than a_to /// returns negative if this is smaller than a_to /// public abstract int Compare(Tree a_to); public static Tree DeepClone(Tree a_tree, object a_param) { if (a_tree == null) { return null; } Tree newNode = (Tree)a_tree.DeepClone(a_param); newNode._size = a_tree._size; newNode._preceding = Tree.DeepClone(((Tree)a_tree._preceding), a_param); newNode._subsequent = Tree.DeepClone(((Tree)a_tree._subsequent), a_param); return newNode; } public virtual object DeepClone(object a_param) { return ShallowClone(); } public virtual bool Duplicates() { return true; } public Tree Filter(IPredicate4 a_filter) { if (_preceding != null) { _preceding = _preceding.Filter(a_filter); } if (_subsequent != null) { _subsequent = _subsequent.Filter(a_filter); } if (!a_filter.Match(this)) { return Remove(); } return this; } public static Tree Find(Tree inTree, Tree template) { if (inTree == null) { return null; } return inTree.Find(template); } public Tree Find(Tree template) { Tree current = this; while (true) { int comparisonResult = current.Compare(template); if (comparisonResult == 0) { return current; } if (comparisonResult < 0) { current = ((Tree)current._subsequent); } else { current = ((Tree)current._preceding); } if (current == null) { return null; } } } public static Tree FindGreaterOrEqual(Tree a_in, Tree a_finder) { if (a_in == null) { return null; } int cmp = a_in.Compare(a_finder); if (cmp == 0) { return a_in; } // the highest node in the hierarchy !!! if (cmp > 0) { Tree node = FindGreaterOrEqual(((Tree)a_in._preceding), a_finder); if (node != null) { return node; } return a_in; } return FindGreaterOrEqual(((Tree)a_in._subsequent), a_finder); } public static Tree FindSmaller(Tree a_in, Tree a_node) { if (a_in == null) { return null; } int cmp = a_in.Compare(a_node); if (cmp < 0) { Tree node = FindSmaller(((Tree)a_in._subsequent), a_node); if (node != null) { return node; } return a_in; } return FindSmaller(((Tree)a_in._preceding), a_node); } public Tree First() { if (_preceding == null) { return this; } return _preceding.First(); } public static Tree Last(Tree tree) { if (tree == null) { return null; } return tree.Last(); } public Tree Last() { if (_subsequent == null) { return this; } return _subsequent.Last(); } public virtual Tree OnAttemptToAddDuplicate(Tree oldNode) { _size = 0; _preceding = oldNode; return oldNode; } /// the number of nodes in this tree for balancing public virtual int Nodes() { return _size; } public virtual int OwnSize() { return 1; } public virtual Tree Remove() { if (_subsequent != null && _preceding != null) { _subsequent = _subsequent.RotateSmallestUp(); _subsequent._preceding = _preceding; _subsequent.CalculateSize(); return _subsequent; } if (_subsequent != null) { return _subsequent; } return _preceding; } public virtual void RemoveChildren() { _preceding = null; _subsequent = null; SetSizeOwn(); } public virtual Tree RemoveFirst() { if (_preceding == null) { return _subsequent; } _preceding = _preceding.RemoveFirst(); CalculateSize(); return this; } public static Tree RemoveLike(Tree from, Tree a_find) { if (from == null) { return null; } return from.RemoveLike(a_find); } public Tree RemoveLike(Tree a_find) { int cmp = Compare(a_find); if (cmp == 0) { return (Tree)Remove(); } if (cmp > 0) { if (_preceding != null) { _preceding = _preceding.RemoveLike(a_find); } } else { if (_subsequent != null) { _subsequent = _subsequent.RemoveLike(a_find); } } CalculateSize(); return (Tree)this; } public Tree RemoveNode(Tree a_tree) { if (this == a_tree) { return Remove(); } int cmp = Compare(a_tree); if (cmp >= 0) { if (_preceding != null) { _preceding = _preceding.RemoveNode(a_tree); } } if (cmp <= 0) { if (_subsequent != null) { _subsequent = _subsequent.RemoveNode(a_tree); } } CalculateSize(); return this; } public Tree RotateLeft() { Tree tree = _subsequent; _subsequent = ((Tree)tree._preceding); CalculateSize(); tree._preceding = this; if (((Tree)tree._subsequent) == null) { tree.SetSizeOwnPlus(this); } else { tree.SetSizeOwnPlus(this, ((Tree)tree._subsequent)); } return tree; } public Tree RotateRight() { Tree tree = _preceding; _preceding = ((Tree)tree._subsequent); CalculateSize(); tree._subsequent = this; if (((Tree)tree._preceding) == null) { tree.SetSizeOwnPlus(this); } else { tree.SetSizeOwnPlus(this, ((Tree)tree._preceding)); } return tree; } private Tree RotateSmallestUp() { if (_preceding != null) { _preceding = _preceding.RotateSmallestUp(); return RotateRight(); } return this; } public void SetSizeOwn() { _size = OwnSize(); } public void SetSizeOwnPrecedingSubsequent() { _size = OwnSize() + _preceding._size + _subsequent._size; } public void SetSizeOwnPreceding() { _size = OwnSize() + _preceding._size; } public void SetSizeOwnSubsequent() { _size = OwnSize() + _subsequent._size; } public void SetSizeOwnPlus(Tree tree) { _size = OwnSize() + tree._size; } public void SetSizeOwnPlus(Tree tree1, Tree tree2) { _size = OwnSize() + tree1._size + tree2._size; } public static int Size(Tree a_tree) { if (a_tree == null) { return 0; } return a_tree.Size(); } /// the number of objects represented. public virtual int Size() { return _size; } public static void Traverse(Tree tree, IVisitor4 visitor) { if (tree == null) { return; } tree.Traverse(visitor); } /// Traverses a tree with a starting point node. /// /// Traverses a tree with a starting point node. /// If there is no exact match for the starting node, the next higher will be taken. /// public static void Traverse(Tree tree, Tree startingNode, ICancellableVisitor4 visitor ) { if (tree == null) { return; } tree.Traverse(startingNode, visitor); } private bool Traverse(Tree startingNode, ICancellableVisitor4 visitor) { if (startingNode != null) { int cmp = Compare(startingNode); if (cmp < 0) { if (_subsequent != null) { return _subsequent.Traverse(startingNode, visitor); } return true; } else { if (cmp > 0) { if (_preceding != null) { if (!_preceding.Traverse(startingNode, visitor)) { return false; } } } } } else { if (_preceding != null) { if (!_preceding.Traverse(null, visitor)) { return false; } } } if (!visitor.Visit(this)) { return false; } if (_subsequent != null) { if (!_subsequent.Traverse(null, visitor)) { return false; } } return true; } public void Traverse(IVisitor4 visitor) { if (_preceding != null) { _preceding.Traverse(visitor); } visitor.Visit((Tree)this); if (_subsequent != null) { _subsequent.Traverse(visitor); } } public void TraverseFromLeaves(IVisitor4 a_visitor) { if (_preceding != null) { _preceding.TraverseFromLeaves(a_visitor); } if (_subsequent != null) { _subsequent.TraverseFromLeaves(a_visitor); } a_visitor.Visit(this); } // Keep the debug method to debug the depth // public final void debugLeafDepth(int currentDepth){ // currentDepth++; // if(_preceding == null && _subsequent == null){ // System.out.println("" + currentDepth + " tree leaf depth."); // return; // } // if (_preceding != null){ // _preceding.debugLeafDepth(currentDepth); // } // if(_subsequent != null){ // _subsequent.debugLeafDepth(currentDepth); // } // } protected virtual Tree ShallowCloneInternal(Tree tree) { tree._preceding = _preceding; tree._size = _size; tree._subsequent = _subsequent; return tree; } public virtual object ShallowClone() { throw new NotImplementedException(); } public abstract object Key(); public virtual object Root() { return this; } public virtual void Accept(IVisitor4 visitor) { Traverse(new _IVisitor4_513(visitor)); } private sealed class _IVisitor4_513 : IVisitor4 { public _IVisitor4_513(IVisitor4 visitor) { this.visitor = visitor; } public void Visit(object obj) { Tree tree = (Tree)obj; visitor.Visit(tree.Key()); } private readonly IVisitor4 visitor; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/ByRef.cs0000644000175000017500000000111711700531646026553 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// Useful as "out" or "by reference" function parameter. /// Useful as "out" or "by reference" function parameter. public class ByRef { public static ByRef NewInstance(object initialValue) { ByRef instance = new ByRef(); instance.value = initialValue; return instance; } public static ByRef NewInstance() { return new ByRef(); } public object value; } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Hashtable4.cs0000644000175000017500000001233411700531646027526 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class Hashtable4 : HashtableBase, IDeepClone, IMap4 { public Hashtable4(int size) : base(size) { } public Hashtable4() : this(1) { } /// protected Hashtable4(IDeepClone cloneOnlyCtor) : base(cloneOnlyCtor) { } public virtual object DeepClone(object obj) { return DeepCloneInternal(new Db4objects.Db4o.Foundation.Hashtable4((IDeepClone)null ), obj); } public virtual void ForEachKeyForIdentity(IVisitor4 visitor, object obj) { for (int i = 0; i < _table.Length; i++) { HashtableIntEntry entry = _table[i]; while (entry != null) { if (entry._object == obj) { visitor.Visit(entry.Key()); } entry = entry._next; } } } public virtual object Get(byte[] key) { int intKey = HashtableByteArrayEntry.Hash(key); return GetFromObjectEntry(intKey, key); } public virtual object Get(int key) { HashtableIntEntry entry = _table[key & _mask]; while (entry != null) { if (entry._key == key) { return entry._object; } entry = entry._next; } return null; } public virtual object Get(object key) { if (key == null) { return null; } return GetFromObjectEntry(key.GetHashCode(), key); } public virtual object Get(long key) { return GetFromLongEntry((int)key, key); } public virtual bool ContainsKey(object key) { if (null == key) { return false; } return null != GetObjectEntry(key.GetHashCode(), key); } public virtual bool ContainsAllKeys(IEnumerable collection) { return ContainsAllKeys(collection.GetEnumerator()); } public virtual bool ContainsAllKeys(IEnumerator iterator) { while (iterator.MoveNext()) { if (!ContainsKey(iterator.Current)) { return false; } } return true; } public virtual void Put(byte[] key, object value) { PutEntry(new HashtableByteArrayEntry(key, value)); } public virtual void Put(int key, object value) { PutEntry(new HashtableIntEntry(key, value)); } public virtual void Put(long key, object value) { PutEntry(new HashtableLongEntry(key, value)); } public virtual void Put(object key, object value) { if (null == key) { throw new ArgumentNullException(); } PutEntry(new HashtableObjectEntry(key, value)); } public virtual object Remove(object objectKey) { int intKey = objectKey.GetHashCode(); return RemoveObjectEntry(intKey, objectKey); } public virtual object Remove(long longKey) { return RemoveLongEntry((int)longKey, longKey); } public virtual object Remove(byte[] key) { int intKey = HashtableByteArrayEntry.Hash(key); return RemoveObjectEntry(intKey, key); } public virtual object Remove(int key) { return RemoveIntEntry(key); } /// /// Iterates through all the /// entries /// . /// /// /// /// IEntry4 /// iterator /// /// HashtableBase.Values() /// /// #see /// HashtableBase.ValuesIterator() /// public virtual IEnumerator Iterator() { return HashtableIterator(); } protected virtual Db4objects.Db4o.Foundation.Hashtable4 DeepCloneInternal(Db4objects.Db4o.Foundation.Hashtable4 ret, object obj) { ret._mask = _mask; ret._maximumSize = _maximumSize; ret._size = _size; ret._tableSize = _tableSize; ret._table = new HashtableIntEntry[_tableSize]; for (int i = 0; i < _tableSize; i++) { if (_table[i] != null) { ret._table[i] = (HashtableIntEntry)_table[i].DeepClone(obj); } } return ret; } private object GetFromObjectEntry(int intKey, object objectKey) { HashtableObjectEntry entry = GetObjectEntry(intKey, objectKey); return entry == null ? null : entry._object; } private HashtableObjectEntry GetObjectEntry(int intKey, object objectKey) { HashtableObjectEntry entry = (HashtableObjectEntry)_table[intKey & _mask]; while (entry != null) { if (entry._key == intKey && entry.HasKey(objectKey)) { return entry; } entry = (HashtableObjectEntry)entry._next; } return null; } private object GetFromLongEntry(int intKey, long longKey) { HashtableLongEntry entry = GetLongEntry(intKey, longKey); return entry == null ? null : entry._object; } private HashtableLongEntry GetLongEntry(int intKey, long longKey) { HashtableLongEntry entry = (HashtableLongEntry)_table[intKey & _mask]; while (entry != null) { if (entry._key == intKey && entry._longKey == longKey) { return entry; } entry = (HashtableLongEntry)entry._next; } return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/SortedCollection4.cs0000644000175000017500000000305711700531646031111 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class SortedCollection4 { private readonly IComparison4 _comparison; private Tree _tree; public SortedCollection4(IComparison4 comparison) { if (null == comparison) { throw new ArgumentNullException(); } _comparison = comparison; _tree = null; } public virtual object SingleElement() { if (1 != Size()) { throw new InvalidOperationException(); } return _tree.Key(); } public virtual void AddAll(IEnumerator iterator) { while (iterator.MoveNext()) { Add(iterator.Current); } } public virtual void Add(object element) { _tree = Tree.Add(_tree, new TreeObject(element, _comparison)); } public virtual void Remove(object element) { _tree = Tree.RemoveLike(_tree, new TreeObject(element, _comparison)); } public virtual object[] ToArray(object[] array) { Tree.Traverse(_tree, new _IVisitor4_43(array)); return array; } private sealed class _IVisitor4_43 : IVisitor4 { public _IVisitor4_43(object[] array) { this.array = array; this.i = 0; } internal int i; public void Visit(object obj) { array[this.i++] = ((TreeObject)obj).Key(); } private readonly object[] array; } public virtual int Size() { return Tree.Size(_tree); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/HashtableByteArrayEntry.cs0000644000175000017500000000217111700531646032305 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { internal class HashtableByteArrayEntry : HashtableObjectEntry { public HashtableByteArrayEntry(byte[] bytes, object value) : base(Hash(bytes), bytes , value) { } public HashtableByteArrayEntry() : base() { } public override object DeepClone(object obj) { return DeepCloneInternal(new Db4objects.Db4o.Foundation.HashtableByteArrayEntry() , obj); } public override bool HasKey(object key) { if (key is byte[]) { return AreEqual((byte[])Key(), (byte[])key); } return false; } internal static int Hash(byte[] bytes) { int ret = 0; for (int i = 0; i < bytes.Length; i++) { ret = ret * 31 + bytes[i]; } return ret; } internal static bool AreEqual(byte[] lhs, byte[] rhs) { if (rhs.Length != lhs.Length) { return false; } for (int i = 0; i < rhs.Length; i++) { if (rhs[i] != lhs[i]) { return false; } } return true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/ISortable4.cs0000644000175000017500000000043711700531646027520 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// public interface ISortable4 { int Size(); int Compare(int leftIndex, int rightIndex); void Swap(int leftIndex, int rightIndex); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IVisitor4.cs0000644000175000017500000000031211700531646027374 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// public interface IVisitor4 { void Visit(object obj); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/SingleValueIterator.cs0000644000175000017500000000146411700531646031501 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class SingleValueIterator : IEnumerator { private object _value; private bool _moved; public SingleValueIterator(object value) { _value = value; } public virtual object Current { get { if (!_moved || _value == Iterators.NoElement) { throw new InvalidOperationException(); } return _value; } } public virtual bool MoveNext() { if (!_moved) { _moved = true; return true; } _value = Iterators.NoElement; return false; } public virtual void Reset() { throw new NotImplementedException(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IdentitySet4.cs0000644000175000017500000000167011700531646030101 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Sharpen; namespace Db4objects.Db4o.Foundation { /// public class IdentitySet4 : HashtableBase, IEnumerable { public IdentitySet4() { } public IdentitySet4(int size) : base(size) { } public virtual bool Contains(object obj) { return FindWithSameKey(new HashtableIdentityEntry(obj)) != null; } public virtual void Add(object obj) { if (null == obj) { throw new ArgumentNullException(); } PutEntry(new HashtableIdentityEntry(obj)); } public virtual void Remove(object obj) { if (null == obj) { throw new ArgumentNullException(); } RemoveIntEntry(Runtime.IdentityHashCode(obj)); } public virtual IEnumerator GetEnumerator() { return ValuesIterator(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/HashtableBase.cs0000644000175000017500000001422111700531646030232 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class HashtableBase { private const float Fill = 0.5F; public int _tableSize; public int _mask; public int _maximumSize; public int _size; public HashtableIntEntry[] _table; public HashtableBase(int size) { // FIELDS ARE PUBLIC SO THEY CAN BE REFLECTED ON IN JDKs <= 1.1 size = NewSize(size); // legacy for .NET conversion _tableSize = 1; while (_tableSize < size) { _tableSize = _tableSize << 1; } _mask = _tableSize - 1; _maximumSize = (int)(_tableSize * Fill); _table = new HashtableIntEntry[_tableSize]; } public HashtableBase() : this(1) { } /// protected HashtableBase(IDeepClone cloneOnlyCtor) { } public virtual void Clear() { _size = 0; Arrays4.Fill(_table, null); } private int NewSize(int size) { return (int)(size / Fill); } public virtual int Size() { return _size; } protected virtual HashtableIntEntry FindWithSameKey(HashtableIntEntry newEntry) { HashtableIntEntry existing = _table[EntryIndex(newEntry)]; while (null != existing) { if (existing.SameKeyAs(newEntry)) { return existing; } existing = existing._next; } return null; } protected virtual int EntryIndex(HashtableIntEntry entry) { return entry._key & _mask; } protected virtual void PutEntry(HashtableIntEntry newEntry) { HashtableIntEntry existing = FindWithSameKey(newEntry); if (null != existing) { Replace(existing, newEntry); } else { Insert(newEntry); } } private void Insert(HashtableIntEntry newEntry) { _size++; if (_size > _maximumSize) { IncreaseSize(); } int index = EntryIndex(newEntry); newEntry._next = _table[index]; _table[index] = newEntry; } private void Replace(HashtableIntEntry existing, HashtableIntEntry newEntry) { newEntry._next = existing._next; HashtableIntEntry entry = _table[EntryIndex(existing)]; if (entry == existing) { _table[EntryIndex(existing)] = newEntry; } else { while (entry._next != existing) { entry = entry._next; } entry._next = newEntry; } } private void IncreaseSize() { _tableSize = _tableSize << 1; _maximumSize = _maximumSize << 1; _mask = _tableSize - 1; HashtableIntEntry[] temp = _table; _table = new HashtableIntEntry[_tableSize]; for (int i = 0; i < temp.Length; i++) { Reposition(temp[i]); } } protected virtual Db4objects.Db4o.Foundation.HashtableIterator HashtableIterator( ) { return new Db4objects.Db4o.Foundation.HashtableIterator(_table); } private void Reposition(HashtableIntEntry entry) { HashtableIntEntry currentEntry = entry; HashtableIntEntry nextEntry = null; while (currentEntry != null) { nextEntry = currentEntry._next; currentEntry._next = _table[EntryIndex(currentEntry)]; _table[EntryIndex(currentEntry)] = currentEntry; currentEntry = nextEntry; } } public virtual IEnumerator Keys() { return Iterators.Map(HashtableIterator(), new _IFunction4_133()); } private sealed class _IFunction4_133 : IFunction4 { public _IFunction4_133() { } public object Apply(object current) { return ((IEntry4)current).Key(); } } public virtual IEnumerable Values() { return new _IEnumerable_141(this); } private sealed class _IEnumerable_141 : IEnumerable { public _IEnumerable_141(HashtableBase _enclosing) { this._enclosing = _enclosing; } public IEnumerator GetEnumerator() { return this._enclosing.ValuesIterator(); } private readonly HashtableBase _enclosing; } /// Iterates through all the values. /// Iterates through all the values. /// value iterator public virtual IEnumerator ValuesIterator() { return Iterators.Map(HashtableIterator(), new _IFunction4_154()); } private sealed class _IFunction4_154 : IFunction4 { public _IFunction4_154() { } public object Apply(object current) { return ((IEntry4)current).Value(); } } public override string ToString() { return Iterators.Join(HashtableIterator(), "{", "}", ", "); } protected virtual void RemoveEntry(HashtableIntEntry predecessor, HashtableIntEntry entry) { if (predecessor != null) { predecessor._next = entry._next; } else { _table[EntryIndex(entry)] = entry._next; } _size--; } protected virtual object RemoveObjectEntry(int intKey, object objectKey) { HashtableObjectEntry entry = (HashtableObjectEntry)_table[intKey & _mask]; HashtableObjectEntry predecessor = null; while (entry != null) { if (entry._key == intKey && entry.HasKey(objectKey)) { RemoveEntry(predecessor, entry); return entry._object; } predecessor = entry; entry = (HashtableObjectEntry)entry._next; } return null; } protected virtual object RemoveLongEntry(int intKey, long longKey) { HashtableLongEntry entry = (HashtableLongEntry)_table[intKey & _mask]; HashtableLongEntry predecessor = null; while (entry != null) { if (entry._key == intKey && entry._longKey == longKey) { RemoveEntry(predecessor, entry); return entry._object; } predecessor = entry; entry = (HashtableLongEntry)entry._next; } return null; } protected virtual object RemoveIntEntry(int key) { HashtableIntEntry entry = _table[key & _mask]; HashtableIntEntry predecessor = null; while (entry != null) { if (entry._key == key) { RemoveEntry(predecessor, entry); return entry._object; } predecessor = entry; entry = entry._next; } return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/CircularIntBuffer4.cs0000644000175000017500000001020111700531646031173 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// A fixed size double ended queue with O(1) complexity for addFirst, removeFirst and removeLast operations. /// /// A fixed size double ended queue with O(1) complexity for addFirst, removeFirst and removeLast operations. /// public class CircularIntBuffer4 : IEnumerable { private const int Empty = -1; private readonly int[] _buffer; private int _head; private int _tail; public CircularIntBuffer4(int size) { _buffer = new int[size + 1]; } public virtual int Size() { return Index(_tail - _head); } public virtual void AddFirst(int value) { int newHead = CircularIndex(_head - 1); if (newHead == _tail) { throw new InvalidOperationException(); } _head = newHead; _buffer[Index(_head)] = value; } private int CircularIndex(int index) { return index % _buffer.Length; } private int Index(int i) { return i < 0 ? _buffer.Length + i : i; } public virtual int RemoveLast() { AssertNotEmpty(); _tail = CircularIndex(_tail - 1); return Erase(_tail); } private void AssertNotEmpty() { if (IsEmpty()) { throw new InvalidOperationException(); } } public virtual bool IsEmpty() { return Index(_head) == Index(_tail); } public virtual bool IsFull() { return CircularIndex(_head - 1) == _tail; } public virtual int RemoveFirst() { AssertNotEmpty(); int erased = Erase(_head); _head = CircularIndex(_head + 1); return erased; } private int Erase(int index) { int bufferIndex = Index(index); int erasedValue = _buffer[bufferIndex]; _buffer[bufferIndex] = Empty; return erasedValue; } public virtual bool Remove(int value) { int idx = IndexOf(value); if (idx >= 0) { RemoveAt(idx); return true; } return false; } public virtual bool Contains(int value) { return IndexOf(value) >= 0; } private int IndexOf(int value) { int current = Index(_head); int tail = Index(_tail); while (current != tail) { if (value == _buffer[current]) { break; } current = CircularIndex(current + 1); } return (current == tail ? -1 : current); } private void RemoveAt(int index) { if (Index(_tail - 1) == index) { RemoveLast(); return; } if (index == Index(_head)) { RemoveFirst(); return; } int current = index; int tail = Index(_tail); while (current != tail) { int next = CircularIndex(current + 1); _buffer[current] = _buffer[next]; current = next; } _tail = CircularIndex(_tail - 1); } public virtual IEnumerator GetEnumerator() { int tail = Index(_tail); int head = Index(_head); // TODO: detect concurrent modification and throw IllegalStateException return new _IEnumerator_123(this, head, tail); } private sealed class _IEnumerator_123 : IEnumerator { public _IEnumerator_123(CircularIntBuffer4 _enclosing, int head, int tail) { this._enclosing = _enclosing; this.head = head; this.tail = tail; this._index = head; this._current = Iterators.NoElement; } private int _index; private object _current; public object Current { get { if (this._current == Iterators.NoElement) { throw new InvalidOperationException(); } return this._current; } } public bool MoveNext() { if (this._index == tail) { return false; } this._current = this._enclosing._buffer[this._index]; this._index = this._enclosing.CircularIndex(this._index + 1); return true; } public void Reset() { throw new NotImplementedException(); } private readonly CircularIntBuffer4 _enclosing; private readonly int head; private readonly int tail; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Collection4Iterator.cs0000644000175000017500000000167711700531646031450 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class Collection4Iterator : Iterator4Impl { private readonly Collection4 _collection; private readonly int _initialVersion; public Collection4Iterator(Collection4 collection, List4 first) : base(first) { _collection = collection; _initialVersion = CurrentVersion(); } public override bool MoveNext() { Validate(); return base.MoveNext(); } public override object Current { get { Validate(); return base.Current; } } private void Validate() { if (_initialVersion != CurrentVersion()) { // FIXME: change to ConcurrentModificationException throw new InvalidIteratorException(); } } private int CurrentVersion() { return _collection.Version(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IObjectPool.cs0000644000175000017500000000032311700531646027713 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { public interface IObjectPool { object BorrowObject(); void ReturnObject(object o); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Runnable4.cs0000644000175000017500000000062011700531646027374 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Sharpen.Lang; namespace Db4objects.Db4o.Foundation { /// public class Runnable4 { private sealed class _IRunnable_10 : IRunnable { public _IRunnable_10() { } public void Run() { } } public static readonly IRunnable DoNothing = new _IRunnable_10(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/DelegatingBlockingQueue.cs0000644000175000017500000000213111700531646032262 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class DelegatingBlockingQueue : IBlockingQueue4 { private IBlockingQueue4 queue; /// public virtual object Next(long timeout) { return queue.Next(timeout); } public virtual object Next() { return queue.Next(); } public virtual void Add(object obj) { queue.Add(obj); } public virtual bool HasNext() { return queue.HasNext(); } public virtual object NextMatching(IPredicate4 condition) { return queue.NextMatching(condition); } public virtual IEnumerator Iterator() { return queue.Iterator(); } public DelegatingBlockingQueue(IBlockingQueue4 queue) { this.queue = queue; } public virtual void Stop() { queue.Stop(); } public virtual int DrainTo(Collection4 list) { return queue.DrainTo(list); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/ListenerRegistry.cs0000644000175000017500000000166111700531646031066 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class ListenerRegistry { public static ListenerRegistry NewInstance() { return new ListenerRegistry(); } private IdentitySet4 _listeners; public virtual void Register(IListener4 listener) { if (_listeners == null) { _listeners = new IdentitySet4(); } _listeners.Add(listener); } public virtual void NotifyListeners(object @event) { if (_listeners == null) { return; } IEnumerator i = _listeners.GetEnumerator(); while (i.MoveNext()) { ((IListener4)i.Current).OnEvent(@event); } } public virtual void Remove(IListener4 listener) { if (_listeners == null) { return; } _listeners.Remove(listener); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IVisitable.cs0000644000175000017500000000037011700531646027577 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public interface IVisitable { void Accept(IVisitor4 visitor); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/TreeKeyIterator.cs0000644000175000017500000000060111700531646030623 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class TreeKeyIterator : AbstractTreeIterator { public TreeKeyIterator(Tree tree) : base(tree) { } protected override object CurrentValue(Tree tree) { return tree.Key(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/FilteredIterator.cs0000644000175000017500000000101311700531646031007 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class FilteredIterator : MappingIterator { private readonly IPredicate4 _filter; public FilteredIterator(IEnumerator iterator, IPredicate4 filter) : base(iterator ) { _filter = filter; } protected override object Map(object current) { return _filter.Match(current) ? current : Iterators.Skip; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Stack4.cs0000644000175000017500000000133311700531646026675 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class Stack4 { private List4 _tail; public virtual void Push(object obj) { _tail = new List4(_tail, obj); } public virtual object Peek() { if (_tail == null) { return null; } return _tail._element; } public virtual object Pop() { if (_tail == null) { throw new InvalidOperationException(); } object res = _tail._element; _tail = ((List4)_tail._next); return res; } public virtual bool IsEmpty() { return _tail == null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/BitMap4.cs0000644000175000017500000000330611700531646027006 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Sharpen; namespace Db4objects.Db4o.Foundation { /// public sealed class BitMap4 { private readonly byte[] _bits; public BitMap4(int numBits) { _bits = new byte[ByteCount(numBits)]; } /// "readFrom buffer" constructor public BitMap4(byte[] buffer, int pos, int numBits) : this(numBits) { System.Array.Copy(buffer, pos, _bits, 0, _bits.Length); } public BitMap4(byte singleByte) { _bits = new byte[] { singleByte }; } public bool IsTrue(int bit) { return (((_bits[ArrayOffset(bit)]) >> (ByteOffset(bit) & 0x1f)) & 1) != 0; } public bool IsFalse(int bit) { return !IsTrue(bit); } public int MarshalledLength() { return _bits.Length; } public void SetFalse(int bit) { _bits[ArrayOffset(bit)] &= (byte)~BitMask(bit); } public void Set(int bit, bool val) { if (val) { SetTrue(bit); } else { SetFalse(bit); } } public void SetTrue(int bit) { _bits[ArrayOffset(bit)] |= BitMask(bit); } public void WriteTo(byte[] bytes, int pos) { System.Array.Copy(_bits, 0, bytes, pos, _bits.Length); } private byte ByteOffset(int bit) { return (byte)(bit % 8); } private int ArrayOffset(int bit) { return bit / 8; } private byte BitMask(int bit) { return (byte)(1 << ByteOffset(bit)); } private int ByteCount(int numBits) { return (numBits + 7) / 8; } public byte GetByte(int index) { return _bits[index]; } public byte[] Bytes() { return _bits; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IEnvironment.cs0000644000175000017500000000031211700531646030155 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Foundation { public interface IEnvironment { object Provide(Type service); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/SimpleTimer.cs0000644000175000017500000000261511700531646030002 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Sharpen.Lang; namespace Db4objects.Db4o.Foundation { /// public sealed class SimpleTimer : IRunnable { private readonly IRunnable _runnable; private readonly long _interval; private Lock4 _lock; public volatile bool stopped = false; public SimpleTimer(IRunnable runnable, long interval) { _runnable = runnable; _interval = interval; _lock = new Lock4(); } public void Stop() { stopped = true; _lock.Run(new _IClosure4_27(this)); } private sealed class _IClosure4_27 : IClosure4 { public _IClosure4_27(SimpleTimer _enclosing) { this._enclosing = _enclosing; } public object Run() { this._enclosing._lock.Awake(); return null; } private readonly SimpleTimer _enclosing; } public void Run() { while (!stopped) { _lock.Run(new _IClosure4_37(this)); if (!stopped) { _runnable.Run(); } } } private sealed class _IClosure4_37 : IClosure4 { public _IClosure4_37(SimpleTimer _enclosing) { this._enclosing = _enclosing; } public object Run() { this._enclosing._lock.Snooze(this._enclosing._interval); return null; } private readonly SimpleTimer _enclosing; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IndexedIterator.cs0000644000175000017500000000225311700531646030640 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; namespace Db4objects.Db4o.Foundation { /// /// Basic functionality for implementing iterators for /// fixed length structures whose elements can be efficiently /// accessed by a numeric index. /// /// /// Basic functionality for implementing iterators for /// fixed length structures whose elements can be efficiently /// accessed by a numeric index. /// public abstract class IndexedIterator : IEnumerator { private readonly int _length; private int _next; public IndexedIterator(int length) { _length = length; _next = -1; } public virtual bool MoveNext() { if (_next < LastIndex()) { ++_next; return true; } // force exception on unexpected call to current _next = _length; return false; } public virtual object Current { get { return Get(_next); } } public virtual void Reset() { _next = -1; } protected abstract object Get(int index); private int LastIndex() { return _length - 1; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/BlockingQueue.cs0000644000175000017500000001452411700531646030307 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Sharpen; namespace Db4objects.Db4o.Foundation { /// public class BlockingQueue : IBlockingQueue4 { protected NonblockingQueue _queue = new NonblockingQueue(); protected Lock4 _lock = new Lock4(); protected bool _stopped; public virtual void Add(object obj) { if (obj == null) { throw new ArgumentException(); } _lock.Run(new _IClosure4_20(this, obj)); } private sealed class _IClosure4_20 : IClosure4 { public _IClosure4_20(BlockingQueue _enclosing, object obj) { this._enclosing = _enclosing; this.obj = obj; } public object Run() { this._enclosing._queue.Add(obj); this._enclosing._lock.Awake(); return null; } private readonly BlockingQueue _enclosing; private readonly object obj; } public virtual bool HasNext() { return (((bool)_lock.Run(new _IClosure4_30(this)))); } private sealed class _IClosure4_30 : IClosure4 { public _IClosure4_30(BlockingQueue _enclosing) { this._enclosing = _enclosing; } public object Run() { return this._enclosing._queue.HasNext(); } private readonly BlockingQueue _enclosing; } public virtual IEnumerator Iterator() { return ((IEnumerator)_lock.Run(new _IClosure4_38(this))); } private sealed class _IClosure4_38 : IClosure4 { public _IClosure4_38(BlockingQueue _enclosing) { this._enclosing = _enclosing; } public object Run() { return this._enclosing._queue.Iterator(); } private readonly BlockingQueue _enclosing; } /// public virtual object Next(long timeout) { return (object)_lock.Run(new _IClosure4_46(this, timeout)); } private sealed class _IClosure4_46 : IClosure4 { public _IClosure4_46(BlockingQueue _enclosing, long timeout) { this._enclosing = _enclosing; this.timeout = timeout; } public object Run() { return this._enclosing.UnsafeWaitForNext(timeout) ? this._enclosing.UnsafeNext() : null; } private readonly BlockingQueue _enclosing; private readonly long timeout; } public virtual int DrainTo(Collection4 target) { return (((int)_lock.Run(new _IClosure4_54(this, target)))); } private sealed class _IClosure4_54 : IClosure4 { public _IClosure4_54(BlockingQueue _enclosing, Collection4 target) { this._enclosing = _enclosing; this.target = target; } public object Run() { this._enclosing.UnsafeWaitForNext(); int i = 0; while (this._enclosing.HasNext()) { i++; target.Add(this._enclosing.UnsafeNext()); } return i; } private readonly BlockingQueue _enclosing; private readonly Collection4 target; } /// public virtual bool WaitForNext(long timeout) { return (((bool)_lock.Run(new _IClosure4_68(this, timeout)))); } private sealed class _IClosure4_68 : IClosure4 { public _IClosure4_68(BlockingQueue _enclosing, long timeout) { this._enclosing = _enclosing; this.timeout = timeout; } public object Run() { return this._enclosing.UnsafeWaitForNext(timeout); } private readonly BlockingQueue _enclosing; private readonly long timeout; } /// public virtual object Next() { return (object)_lock.Run(new _IClosure4_76(this)); } private sealed class _IClosure4_76 : IClosure4 { public _IClosure4_76(BlockingQueue _enclosing) { this._enclosing = _enclosing; } public object Run() { this._enclosing.UnsafeWaitForNext(); return this._enclosing.UnsafeNext(); } private readonly BlockingQueue _enclosing; } public virtual void Stop() { _lock.Run(new _IClosure4_85(this)); } private sealed class _IClosure4_85 : IClosure4 { public _IClosure4_85(BlockingQueue _enclosing) { this._enclosing = _enclosing; } public object Run() { this._enclosing._stopped = true; this._enclosing._lock.Awake(); return null; } private readonly BlockingQueue _enclosing; } public virtual object NextMatching(IPredicate4 condition) { return _lock.Run(new _IClosure4_95(this, condition)); } private sealed class _IClosure4_95 : IClosure4 { public _IClosure4_95(BlockingQueue _enclosing, IPredicate4 condition) { this._enclosing = _enclosing; this.condition = condition; } public object Run() { return this._enclosing._queue.NextMatching(condition); } private readonly BlockingQueue _enclosing; private readonly IPredicate4 condition; } /// public virtual void WaitForNext() { _lock.Run(new _IClosure4_103(this)); } private sealed class _IClosure4_103 : IClosure4 { public _IClosure4_103(BlockingQueue _enclosing) { this._enclosing = _enclosing; } public object Run() { this._enclosing.UnsafeWaitForNext(); return null; } private readonly BlockingQueue _enclosing; } /// protected virtual void UnsafeWaitForNext() { UnsafeWaitForNext(long.MaxValue); } /// protected virtual bool UnsafeWaitForNext(long timeout) { long timeLeft = timeout; long now = Runtime.CurrentTimeMillis(); while (timeLeft > 0) { if (_queue.HasNext()) { return true; } if (_stopped) { throw new BlockingQueueStoppedException(); } _lock.Snooze(timeLeft); long l = now; now = Runtime.CurrentTimeMillis(); timeLeft -= now - l; } return false; } private object UnsafeNext() { return _queue.Next(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IDeepClone.cs0000644000175000017500000000103111700531646027506 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// Deep clone /// public interface IDeepClone { /// /// The parameter allows passing one new object so parent /// references can be corrected on children. /// /// /// The parameter allows passing one new object so parent /// references can be corrected on children. /// object DeepClone(object context); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Runtime4.cs0000644000175000017500000000342511700531646027257 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Sharpen.Lang; namespace Db4objects.Db4o.Foundation { /// A collection of static methods that should be part of the runtime environment but are not. /// /// A collection of static methods that should be part of the runtime environment but are not. /// /// public class Runtime4 { /// sleeps without checked exceptions public static void Sleep(long millis) { try { Thread.Sleep(millis); } catch (Exception) { } } /// sleeps with implicit exception /// public static void SleepThrowsOnInterrupt(long millis) { try { Thread.Sleep(millis); } catch (Exception e) { throw new RuntimeInterruptedException(e.ToString()); } } /// /// Keeps executing a block of code until it either returns true or millisecondsTimeout /// elapses. /// /// /// Keeps executing a block of code until it either returns true or millisecondsTimeout /// elapses. /// public static bool Retry(long millisecondsTimeout, IClosure4 block) { return Retry(millisecondsTimeout, 1, block); } public static bool Retry(long millisecondsTimeout, int millisecondsBetweenRetries , IClosure4 block) { StopWatch watch = new AutoStopWatch(); do { if ((((bool)block.Run()))) { return true; } Sleep(millisecondsBetweenRetries); } while (watch.Peek() < millisecondsTimeout); return false; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/BlockingQueueStoppedException.cs0000644000175000017500000000063611700531646033524 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o; namespace Db4objects.Db4o.Foundation { /// [System.Serializable] public class BlockingQueueStoppedException : Exception { public BlockingQueueStoppedException() : base() { if (DTrace.enabled) { DTrace.BlockingQueueStoppedException.Log(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IIntIterator4.cs0000644000175000017500000000036311700531646030207 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; namespace Db4objects.Db4o.Foundation { /// public interface IIntIterator4 : IEnumerator { int CurrentInt(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/ITimeoutBlockingQueue4.cs0000644000175000017500000000040511700531646032044 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public interface ITimeoutBlockingQueue4 : IPausableBlockingQueue4 { void Check(); void Reset(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/InvalidIteratorException.cs0000644000175000017500000000037711700531646032532 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Foundation { /// [System.Serializable] public class InvalidIteratorException : InvalidOperationException { } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/CompositeIterable4.cs0000644000175000017500000000142411700531646031243 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class CompositeIterable4 : IEnumerable { private readonly IEnumerable _iterables; public CompositeIterable4(IEnumerable iterables) { _iterables = iterables; } public virtual IEnumerator GetEnumerator() { return new _CompositeIterator4_15(_iterables.GetEnumerator()); } private sealed class _CompositeIterator4_15 : CompositeIterator4 { public _CompositeIterator4_15(IEnumerator baseArg1) : base(baseArg1) { } protected override IEnumerator NextIterator(object current) { return ((IEnumerable)current).GetEnumerator(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IArrayFactory.cs0000644000175000017500000000027111700531646030263 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { public interface IArrayFactory { object[] NewArray(int size); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Iterable4Adaptor.cs0000644000175000017500000000310411700531646030670 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; namespace Db4objects.Db4o.Foundation { /// /// Adapts Iterable4/Iterator4 iteration model (moveNext, current) to the old db4o /// and jdk model (hasNext, next). /// /// /// Adapts Iterable4/Iterator4 iteration model (moveNext, current) to the old db4o /// and jdk model (hasNext, next). /// /// public class Iterable4Adaptor { private static readonly object EofMarker = new object(); private static readonly object MoveNextMarker = new object(); private readonly IEnumerable _delegate; private IEnumerator _iterator; private object _current = MoveNextMarker; public Iterable4Adaptor(IEnumerable delegate_) { _delegate = delegate_; } public virtual bool HasNext() { if (_current == MoveNextMarker) { return MoveNext(); } return _current != EofMarker; } public virtual object Next() { if (!HasNext()) { throw new InvalidOperationException(); } object returnValue = _current; _current = MoveNextMarker; return returnValue; } protected virtual bool MoveNext() { if (null == _iterator) { _iterator = _delegate.GetEnumerator(); } if (_iterator.MoveNext()) { _current = _iterator.Current; return true; } _current = EofMarker; return false; } public virtual void Reset() { _iterator = null; _current = MoveNextMarker; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IComparison4.cs0000644000175000017500000000055511700531646030060 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// public interface IComparison4 { /// /// Returns negative number if x < y /// Returns zero if x == y /// Returns positive number if x > y /// int Compare(object x, object y); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/ThreadLocal4.cs0000644000175000017500000000253411700531646030016 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Sharpen.Lang; namespace Db4objects.Db4o.Foundation { /// /// ThreadLocal implementation for less capable platforms such as JRE 1.1 and /// Silverlight. /// /// /// ThreadLocal implementation for less capable platforms such as JRE 1.1 and /// Silverlight. /// This class is not intended to be used directly, use /// DynamicVariable /// . /// WARNING: This implementation might leak Thread references unless /// Set(object) /// is called with null on the right thread to clean it up. This /// behavior is currently guaranteed by /// DynamicVariable /// . /// public class ThreadLocal4 { private readonly IDictionary _values = new Hashtable(); public virtual void Set(object value) { lock (this) { if (value == null) { Sharpen.Collections.Remove(_values, Thread.CurrentThread()); } else { _values[Thread.CurrentThread()] = value; } } } public virtual object Get() { lock (this) { return _values[Thread.CurrentThread()]; } } protected object InitialValue() { return null; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IIntComparator.cs0000644000175000017500000000061311700531646030437 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// /// Non boxing/unboxing version of /// System.Collections.IComparer<T> /// /// for /// faster id comparisons. /// public interface IIntComparator { int Compare(int x, int y); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/KeySpec.cs0000644000175000017500000000147611700531646027117 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class KeySpec { public interface IDeferred { object Evaluate(); } private object _defaultValue; public KeySpec(byte defaultValue) { _defaultValue = defaultValue; } public KeySpec(int defaultValue) { _defaultValue = defaultValue; } public KeySpec(bool defaultValue) { _defaultValue = defaultValue; } public KeySpec(object defaultValue) { _defaultValue = defaultValue; } public virtual object DefaultValue() { if (_defaultValue is KeySpec.IDeferred) { return ((KeySpec.IDeferred)_defaultValue).Evaluate(); } return _defaultValue; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IFunction4.cs0000644000175000017500000000031511700531646027525 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// public interface IFunction4 { object Apply(object arg); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/FunctionApplicationIterator.cs0000644000175000017500000000120511700531646033225 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class FunctionApplicationIterator : MappingIterator { private readonly IFunction4 _function; public FunctionApplicationIterator(IEnumerator iterator, IFunction4 function) : base (iterator) { if (null == function) { throw new ArgumentNullException(); } _function = function; } protected override object Map(object current) { return _function.Apply(current); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IdentityHashtable4.cs0000644000175000017500000000301211700531646031231 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Sharpen; namespace Db4objects.Db4o.Foundation { public class IdentityHashtable4 : HashtableBase, IMap4 { public IdentityHashtable4() { } public IdentityHashtable4(int size) : base(size) { } public virtual bool Contains(object obj) { return GetEntry(obj) != null; } public virtual object Remove(object obj) { if (null == obj) { throw new ArgumentNullException(); } return RemoveIntEntry(Runtime.IdentityHashCode(obj)); } public virtual bool ContainsKey(object key) { return GetEntry(key) != null; } public virtual object Get(object key) { HashtableIntEntry entry = GetEntry(key); return (entry == null ? null : entry._object); } private HashtableIntEntry GetEntry(object key) { return FindWithSameKey(new IdentityHashtable4.IdentityEntry(key)); } public virtual void Put(object key, object value) { if (null == key) { throw new ArgumentNullException(); } PutEntry(new IdentityHashtable4.IdentityEntry(key, value)); } public class IdentityEntry : HashtableObjectEntry { public IdentityEntry(object obj) : this(obj, null) { } public IdentityEntry(object key, object value) : base(Runtime.IdentityHashCode(key ), key, value) { } public override bool HasKey(object key) { return _objectKey == key; } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Collection4.cs0000644000175000017500000002220211700531646027721 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Types; namespace Db4objects.Db4o.Foundation { /// Fast linked list for all usecases. /// Fast linked list for all usecases. /// public class Collection4 : ISequence4, IEnumerable, IDeepClone, IUnversioned { private List4 _first; private List4 _last; private int _size; private int _version; public Collection4() { } public Collection4(object[] elements) { AddAll(elements); } public Collection4(IEnumerable other) { AddAll(other); } public Collection4(IEnumerator iterator) { AddAll(iterator); } public virtual object SingleElement() { if (Size() != 1) { throw new InvalidOperationException(); } return ((object)_first._element); } /// Adds an element to the end of this collection. /// Adds an element to the end of this collection. /// public bool Add(object element) { DoAdd(element); Changed(); return true; } public void Prepend(object element) { DoPrepend(element); Changed(); } private void DoPrepend(object element) { if (_first == null) { DoAdd(element); } else { _first = new List4(_first, element); _size++; } } private void DoAdd(object element) { if (_last == null) { _first = new List4(element); _last = _first; } else { _last._next = new List4(element); _last = ((List4)_last._next); } _size++; } public void AddAll(object[] elements) { AssertNotNull(elements); for (int i = 0; i < elements.Length; i++) { Add(elements[i]); } } public void AddAll(IEnumerable other) { AssertNotNull(other); AddAll(other.GetEnumerator()); } public void AddAll(IEnumerator iterator) { AssertNotNull(iterator); while (iterator.MoveNext()) { Add(iterator.Current); } } public void Clear() { _first = null; _last = null; _size = 0; Changed(); } public bool Contains(object element) { return Find(element) != null; } public virtual bool ContainsAll(IEnumerable iter) { return ContainsAll(iter.GetEnumerator()); } public virtual bool ContainsAll(IEnumerator iter) { AssertNotNull(iter); while (iter.MoveNext()) { if (!Contains(iter.Current)) { return false; } } return true; } /// tests if the object is in the Collection. /// tests if the object is in the Collection. == comparison. public bool ContainsByIdentity(object element) { IEnumerator i = InternalIterator(); while (i.MoveNext()) { object current = i.Current; if (current == element) { return true; } } return false; } private List4 Find(object obj) { List4 current = _first; while (current != null) { if (current.Holds(obj)) { return current; } current = ((List4)current._next); } return null; } private List4 FindByIdentity(object obj) { List4 current = _first; while (current != null) { if (((object)current._element) == obj) { return current; } current = ((List4)current._next); } return null; } /// /// returns the first object found in the Collections that equals() the /// passed object /// public object Get(object element) { List4 holder = Find(element); return holder == null ? null : ((object)holder._element); } public virtual object DeepClone(object newParent) { Db4objects.Db4o.Foundation.Collection4 col = new Db4objects.Db4o.Foundation.Collection4 (); object element = null; IEnumerator i = InternalIterator(); while (i.MoveNext()) { element = i.Current; if (element is IDeepClone) { col.Add(((IDeepClone)element).DeepClone(newParent)); } else { col.Add(element); } } return col; } /// makes sure the passed object is in the Collection. /// makes sure the passed object is in the Collection. equals() comparison. public object Ensure(object element) { List4 list = Find(element); if (list == null) { Add(element); return element; } return ((object)list._element); } /// /// Iterates through the collection in reversed insertion order which happens /// to be the fastest. /// /// /// Iterates through the collection in reversed insertion order which happens /// to be the fastest. /// /// public IEnumerator GetEnumerator() { return _first == null ? Iterators.EmptyIterator : new Collection4Iterator(this, _first ); } public virtual object Get(int index) { if (index < 0) { throw new ArgumentException(); } List4 cur = _first; while (index > 0 && cur != null) { cur = ((List4)cur._next); index--; } if (cur == null) { throw new ArgumentException(); } return ((object)cur._element); } /// /// Removes all the elements from this collection that are returned by /// iterable. /// /// /// Removes all the elements from this collection that are returned by /// iterable. /// /// public virtual void RemoveAll(IEnumerable iterable) { RemoveAll(iterable.GetEnumerator()); } /// /// Removes all the elements from this collection that are returned by /// iterator. /// /// /// Removes all the elements from this collection that are returned by /// iterator. /// public virtual void RemoveAll(IEnumerator iterator) { while (iterator.MoveNext()) { Remove(iterator.Current); } } /// /// removes an object from the Collection equals() comparison returns the /// removed object or null, if none found /// public virtual bool Remove(object a_object) { List4 previous = null; List4 current = _first; while (current != null) { if (current.Holds(a_object)) { _size--; AdjustOnRemoval(previous, current); Changed(); return true; } previous = current; current = ((List4)current._next); } return false; } public virtual void Replace(object oldObject, object newObject) { List4 list = Find(oldObject); if (list != null) { list._element = newObject; } } public virtual void ReplaceByIdentity(object oldObject, object newObject) { List4 list = FindByIdentity(oldObject); if (list != null) { list._element = newObject; } } private void AdjustOnRemoval(List4 previous, List4 removed) { if (removed == _first) { _first = ((List4)removed._next); } else { previous._next = ((List4)removed._next); } if (removed == _last) { _last = previous; } } public int Size() { return _size; } public virtual int IndexOf(object obj) { int index = 0; List4 current = _first; while (current != null) { if (current.Holds(obj)) { return index; } index++; current = ((List4)current._next); } return -1; } public bool IsEmpty() { return _size == 0; } /// This is a non reflection implementation for more speed. /// /// This is a non reflection implementation for more speed. In contrast to /// the JDK behaviour, the passed array has to be initialized to the right /// length. /// public object[] ToArray(object[] array) { int j = 0; IEnumerator i = InternalIterator(); while (i.MoveNext()) { array[j++] = i.Current; } return array; } public object[] ToArray() { int j = 0; object[] array = new object[Size()]; IEnumerator i = InternalIterator(); while (i.MoveNext()) { array[j++] = i.Current; } return array; } public override string ToString() { return Iterators.ToString(InternalIterator()); } private void Changed() { ++_version; } internal virtual int Version() { return _version; } private void AssertNotNull(object element) { if (element == null) { throw new ArgumentNullException(); } } /// /// Leaner iterator for faster iteration (but unprotected against /// concurrent modifications). /// /// /// Leaner iterator for faster iteration (but unprotected against /// concurrent modifications). /// private IEnumerator InternalIterator() { return new Iterator4Impl(_first); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Pair.cs0000644000175000017500000000276511700531646026451 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { public class Pair { public static Db4objects.Db4o.Foundation.Pair Of(object first, object second) { return new Db4objects.Db4o.Foundation.Pair(first, second); } public object first; public object second; public Pair(object first, object second) { this.first = first; this.second = second; } public override string ToString() { return "Pair.of(" + first + ", " + second + ")"; } public override int GetHashCode() { int prime = 31; int result = 1; result = prime * result + ((first == null) ? 0 : first.GetHashCode()); result = prime * result + ((second == null) ? 0 : second.GetHashCode()); return result; } public override bool Equals(object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (GetType() != obj.GetType()) { return false; } Db4objects.Db4o.Foundation.Pair other = (Db4objects.Db4o.Foundation.Pair)obj; if (first == null) { if (other.first != null) { return false; } } else { if (!first.Equals(other.first)) { return false; } } if (second == null) { if (other.second != null) { return false; } } else { if (!second.Equals(other.second)) { return false; } } return true; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/AutoStopWatch.cs0000644000175000017500000000036711700531646030317 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class AutoStopWatch : StopWatch { public AutoStopWatch() { Start(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Collections4.cs0000644000175000017500000000321311700531646030105 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class Collections4 { public static ISequence4 UnmodifiableList(ISequence4 orig) { return new Collections4.UnmodifiableSequence4(orig); } private class UnmodifiableSequence4 : ISequence4 { private ISequence4 _sequence; public UnmodifiableSequence4(ISequence4 sequence) { _sequence = sequence; } public virtual bool Add(object element) { throw new NotSupportedException(); } public virtual void AddAll(IEnumerable iterable) { throw new NotSupportedException(); } public virtual bool IsEmpty() { return _sequence.IsEmpty(); } public virtual IEnumerator GetEnumerator() { return _sequence.GetEnumerator(); } public virtual object Get(int index) { return _sequence.Get(index); } public virtual int Size() { return _sequence.Size(); } public virtual void Clear() { throw new NotSupportedException(); } public virtual bool Remove(object obj) { throw new NotSupportedException(); } public virtual bool Contains(object obj) { return _sequence.Contains(obj); } public virtual bool ContainsAll(IEnumerable iter) { return _sequence.ContainsAll(iter); } public virtual object[] ToArray() { return _sequence.ToArray(); } public virtual object[] ToArray(object[] array) { return _sequence.ToArray(array); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/No4.cs0000644000175000017500000000041111700531646026200 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class No4 : IInternal4 { public static readonly No4 Instance = new No4(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IPausableBlockingQueue4.cs0000644000175000017500000000254611700531646032162 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public interface IPausableBlockingQueue4 : IBlockingQueue4 { /// ///

/// Pauses the queue, making calls to /// IQueue4.Next() /// block /// until /// Resume() /// is called. ///

/// whether or not this call changed the state of the queue. bool Pause(); /// ///

/// Resumes the queue, releasing blocked calls to /// IQueue4.Next() /// that can reach a next queue item.. ///

/// whether or not this call changed the state of the queue. bool Resume(); bool IsPaused(); /// ///

/// Returns the next element in queue if there is one available, returns null /// otherwise. ///

/// ///

/// Returns the next element in queue if there is one available, returns null /// otherwise. ///

/// This method will not never block, regardless of the queue being paused or /// no elements are available. /// /// next element, if available and queue not paused. object TryNext(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IPredicate4.cs0000644000175000017500000000032211700531646027636 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { /// public interface IPredicate4 { bool Match(object candidate); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/Algorithms4.cs0000644000175000017500000000725411700531646027751 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class Algorithms4 { private const int QsortLengthThreshold = 7; public static void Sort(ISortable4 sortable) { Sort(sortable, 0, sortable.Size()); } public static void Sort(ISortable4 sortable, int start, int end) { int length = end - start; if (length < QsortLengthThreshold) { InsertionSort(sortable, start, end); return; } Qsort(sortable, start, end); } public static void Qsort(ISortable4 sortable, int start, int end) { int length = end - start; int middle = start + length / 2; if (length > 7) { int bottom = start; int top = end - 1; if (length > 40) { length /= 8; bottom = MiddleValueIndex(sortable, bottom, bottom + length, bottom + (2 * length )); middle = MiddleValueIndex(sortable, middle - length, middle, middle + length); top = MiddleValueIndex(sortable, top - (2 * length), top - length, top); } middle = MiddleValueIndex(sortable, bottom, middle, top); } int a; int b; int c; int d; a = b = start; c = d = end - 1; while (true) { while (b <= c && sortable.Compare(b, middle) <= 0) { if (sortable.Compare(b, middle) == 0) { middle = NewPartionIndex(middle, a, b); Swap(sortable, a++, b); } b++; } while (c >= b && sortable.Compare(c, middle) >= 0) { if (sortable.Compare(c, middle) == 0) { middle = NewPartionIndex(middle, c, d); Swap(sortable, c, d--); } c--; } if (b > c) { break; } middle = NewPartionIndex(middle, b, c); Swap(sortable, b++, c--); } length = Math.Min(a - start, b - a); Swap(sortable, start, b - length, length); length = Math.Min(d - c, end - 1 - d); Swap(sortable, b, end - length, length); length = b - a; if (length > 0) { Sort(sortable, start, start + length); } length = d - c; if (length > 0) { Sort(sortable, end - length, end); } } public static void InsertionSort(ISortable4 sortable, int start, int end) { for (int i = start + 1; i < end; i++) { for (int j = i; j > start && sortable.Compare(j - 1, j) > 0; j--) { Swap(sortable, j - 1, j); } } } private static int NewPartionIndex(int oldPartionIndex, int leftSwapIndex, int rightSwapIndex ) { if (leftSwapIndex == oldPartionIndex) { return rightSwapIndex; } else { if (rightSwapIndex == oldPartionIndex) { return leftSwapIndex; } } return oldPartionIndex; } private static int MiddleValueIndex(ISortable4 sortable, int a, int b, int c) { if (sortable.Compare(a, b) < 0) { if (sortable.Compare(b, c) < 0) { return b; } else { if (sortable.Compare(a, c) < 0) { return c; } else { return a; } } } else { if (sortable.Compare(b, c) > 0) { return b; } else { if (sortable.Compare(a, c) > 0) { return c; } else { return a; } } } } private static void Swap(ISortable4 sortable, int left, int right) { if (left == right) { return; } sortable.Swap(left, right); } private static void Swap(ISortable4 sortable, int from, int to, int length) { while (length-- > 0) { Swap(sortable, from++, to++); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/HashtableIdentityEntry.cs0000644000175000017500000000102311700531646032167 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Sharpen; namespace Db4objects.Db4o.Foundation { /// public class HashtableIdentityEntry : HashtableIntEntry { public HashtableIdentityEntry(object obj) : base(Runtime.IdentityHashCode(obj), obj ) { } public override bool SameKeyAs(HashtableIntEntry other) { if (!base.SameKeyAs(other)) { return false; } return other._object == _object; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/HashtableLongEntry.cs0000644000175000017500000000237711700531646031312 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class HashtableLongEntry : HashtableIntEntry { public long _longKey; internal HashtableLongEntry(long key, object obj) : base((int)key, obj) { // FIELDS ARE PUBLIC SO THEY CAN BE REFLECTED ON IN JDKs <= 1.1 _longKey = key; } public HashtableLongEntry() : base() { } public override object Key() { return _longKey; } public override object DeepClone(object obj) { return DeepCloneInternal(new Db4objects.Db4o.Foundation.HashtableLongEntry(), obj ); } protected override HashtableIntEntry DeepCloneInternal(HashtableIntEntry entry, object obj) { ((Db4objects.Db4o.Foundation.HashtableLongEntry)entry)._longKey = _longKey; return base.DeepCloneInternal(entry, obj); } public override bool SameKeyAs(HashtableIntEntry other) { return other is Db4objects.Db4o.Foundation.HashtableLongEntry ? ((Db4objects.Db4o.Foundation.HashtableLongEntry )other)._longKey == _longKey : false; } public override string ToString() { return string.Empty + _longKey + ": " + _object; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IFixedSizeIntIterator4.cs0000644000175000017500000000034611700531646032023 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public interface IFixedSizeIntIterator4 : IIntIterator4 { int Size(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/SubTypePredicate.cs0000644000175000017500000000065411700531646030765 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { public class SubTypePredicate : IPredicate4 { private readonly Type _class; public SubTypePredicate(Type clazz) { _class = clazz; } public virtual bool Match(object candidate) { return _class.IsInstanceOfType(candidate); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/LongByRef.cs0000644000175000017500000000065711700531646027403 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { ///

Useful as "out" or "by ref" function parameter. /// Useful as "out" or "by ref" function parameter. public sealed class LongByRef { public long value; public LongByRef(long initialValue) { value = initialValue; } public LongByRef() { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/SynchronizedHashtable4.cs0000644000175000017500000000157411700531646032132 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; namespace Db4objects.Db4o.Foundation { /// public class SynchronizedHashtable4 : IDeepClone { private readonly Hashtable4 _delegate; private SynchronizedHashtable4(Hashtable4 delegate_) { _delegate = delegate_; } public SynchronizedHashtable4(int size) : this(new Hashtable4(size)) { } public virtual object DeepClone(object obj) { lock (this) { return new Db4objects.Db4o.Foundation.SynchronizedHashtable4((Hashtable4)_delegate .DeepClone(obj)); } } public virtual void Put(object key, object value) { lock (this) { _delegate.Put(key, value); } } public virtual object Get(object key) { lock (this) { return _delegate.Get(key); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IClosure4.cs0000644000175000017500000000024611700531646027357 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { public interface IClosure4 { object Run(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/IntArrayByRef.cs0000644000175000017500000000044411700531646030227 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ namespace Db4objects.Db4o.Foundation { public class IntArrayByRef { public int[] value; public IntArrayByRef(int[] initialValue) { value = initialValue; } public IntArrayByRef() { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/RuntimeInterruptedException.cs0000644000175000017500000000044011700531646033272 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; namespace Db4objects.Db4o.Foundation { [System.Serializable] public class RuntimeInterruptedException : Exception { public RuntimeInterruptedException(string msg) : base(msg) { } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Foundation/SynchronizedIterator4.cs0000644000175000017500000000134211700531646032021 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; namespace Db4objects.Db4o.Foundation { public class SynchronizedIterator4 : IEnumerator { private readonly IEnumerator _delegate; private readonly object _lock; public SynchronizedIterator4(IEnumerator delegate_, object Lock) { _delegate = delegate_; _lock = Lock; } public virtual object Current { get { lock (_lock) { return _delegate.Current; } } } public virtual bool MoveNext() { lock (_lock) { return _delegate.MoveNext(); } } public virtual void Reset() { lock (_lock) { _delegate.Reset(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/0000755000175000017500000000000011700531646024473 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/IReflectArray.cs0000644000175000017500000000225711700531646027524 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect { /// Reflection Array representation. /// /// Reflection Array representation ///

See documentation for System.Reflection API. ///
/// IReflector public interface IReflectArray { void Analyze(object obj, ArrayInfo info); int[] Dimensions(object arr); int Flatten(object a_shaped, int[] a_dimensions, int a_currentDimension, object[] a_flat, int a_flatElement); object Get(object onArray, int index); IReflectClass GetComponentType(IReflectClass a_class); int GetLength(object array); bool IsNDimensional(IReflectClass a_class); object NewInstance(IReflectClass componentType, ArrayInfo info); object NewInstance(IReflectClass componentType, int length); object NewInstance(IReflectClass componentType, int[] dimensions); void Set(object onArray, int index, object element); int Shape(object[] a_flat, int a_flatElement, object a_shaped, int[] a_dimensions , int a_currentDimension); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/IReflectClass.cs0000644000175000017500000000465611700531646027520 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect { /// Reflection Class representation. /// /// Reflection Class representation ///

See documentation for System.Reflection API. ///
/// IReflector public interface IReflectClass { IReflectClass GetComponentType(); IReflectField[] GetDeclaredFields(); IReflectField GetDeclaredField(string name); /// Returns the ReflectClass instance being delegated to. /// /// Returns the ReflectClass instance being delegated to. /// If there's no delegation it should return this. /// /// delegate or this IReflectClass GetDelegate(); IReflectMethod GetMethod(string methodName, IReflectClass[] paramClasses); string GetName(); IReflectClass GetSuperclass(); bool IsAbstract(); bool IsArray(); bool IsAssignableFrom(IReflectClass type); bool IsCollection(); bool IsInstance(object obj); bool IsInterface(); bool IsPrimitive(); object NewInstance(); IReflector Reflector(); object NullValue(); /// /// Calling this method may change the internal state of the class, even if a usable /// constructor has been found on earlier invocations. /// /// /// Calling this method may change the internal state of the class, even if a usable /// constructor has been found on earlier invocations. /// /// true, if instances of this class can be created, false otherwise bool EnsureCanBeInstantiated(); /// /// We need this for replication, to find out if a class needs to be traversed /// or if it simply can be copied across. /// /// /// We need this for replication, to find out if a class needs to be traversed /// or if it simply can be copied across. For now we will simply return /// the classes that are /// IsPrimitive() /// and /// Db4objects.Db4o.Internal.Platform4.IsSimple(System.Type<T>) /// /// We can think about letting users add an Immutable annotation. /// bool IsImmutable(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/IReflector.cs0000644000175000017500000000310511700531646027057 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect { /// root of the reflection implementation API. /// /// root of the reflection implementation API. ///

The open reflection interface is supplied to allow to implement /// custom reflection functionality.

/// Use /// /// Db4o.Configure().ReflectWith(IReflect reflector) /// /// to register the use of your implementation before opening database /// files. ///
public interface IReflector : IDeepClone { void Configuration(IReflectorConfiguration config); /// /// returns an ReflectArray object. /// /// /// returns an ReflectArray object. /// IReflectArray Array(); /// returns an ReflectClass for a Class IReflectClass ForClass(Type clazz); /// /// returns an ReflectClass class reflector for a class name or null /// if no such class is found /// IReflectClass ForName(string className); /// returns an ReflectClass for an object or null if the passed object is null. /// /// returns an ReflectClass for an object or null if the passed object is null. /// IReflectClass ForObject(object obj); bool IsCollection(IReflectClass clazz); void SetParent(IReflector reflector); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Core/0000755000175000017500000000000011700531646025363 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Core/ConstructorSupport.cs0000644000175000017500000000723211700531646031640 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Core; namespace Db4objects.Db4o.Reflect.Core { public class ConstructorSupport { public static ReflectConstructorSpec CreateConstructor(IConstructorAwareReflectClass claxx, Type clazz, IReflectorConfiguration config, IReflectConstructor[] constructors ) { if (claxx == null) { return ReflectConstructorSpec.InvalidConstructor; } if (claxx.IsAbstract() || claxx.IsInterface()) { return ReflectConstructorSpec.InvalidConstructor; } if (!Platform4.CallConstructor()) { bool skipConstructor = !config.CallConstructor(claxx); if (!claxx.IsCollection()) { IReflectConstructor serializableConstructor = SkipConstructor(claxx, skipConstructor , config.TestConstructors()); if (serializableConstructor != null) { return new ReflectConstructorSpec(serializableConstructor, null); } } } if (!config.TestConstructors()) { return new ReflectConstructorSpec(new PlatformReflectConstructor(clazz), null); } if (ReflectPlatform.CreateInstance(clazz) != null) { return new ReflectConstructorSpec(new PlatformReflectConstructor(clazz), null); } Tree sortedConstructors = SortConstructorsByParamsCount(constructors); return FindConstructor(claxx, sortedConstructors); } private static ReflectConstructorSpec FindConstructor(IReflectClass claxx, Tree sortedConstructors ) { if (sortedConstructors == null) { return ReflectConstructorSpec.InvalidConstructor; } IEnumerator iter = new TreeNodeIterator(sortedConstructors); while (iter.MoveNext()) { object current = iter.Current; IReflectConstructor constructor = (IReflectConstructor)((TreeIntObject)current)._object; object[] args = NullArgumentsFor(constructor); object res = constructor.NewInstance(args); if (res != null) { return new ReflectConstructorSpec(constructor, args); } } return ReflectConstructorSpec.InvalidConstructor; } private static object[] NullArgumentsFor(IReflectConstructor constructor) { IReflectClass[] paramTypes = constructor.GetParameterTypes(); object[] @params = new object[paramTypes.Length]; for (int j = 0; j < @params.Length; j++) { @params[j] = paramTypes[j].NullValue(); } return @params; } private static Tree SortConstructorsByParamsCount(IReflectConstructor[] constructors ) { Tree sortedConstructors = null; // sort constructors by parameter count for (int i = 0; i < constructors.Length; i++) { int parameterCount = constructors[i].GetParameterTypes().Length; sortedConstructors = Tree.Add(sortedConstructors, new TreeIntObject(i + constructors .Length * parameterCount, constructors[i])); } return sortedConstructors; } public static IReflectConstructor SkipConstructor(IConstructorAwareReflectClass claxx , bool skipConstructor, bool testConstructor) { if (!skipConstructor) { return null; } IReflectConstructor serializableConstructor = claxx.GetSerializableConstructor(); if (serializableConstructor == null) { return null; } if (!testConstructor || Deploy.csharp) { return serializableConstructor; } object obj = serializableConstructor.NewInstance((object[])null); if (obj != null) { return serializableConstructor; } return null; } } } IConstructorAwareReflectClass.cs0000644000175000017500000000046711700531646033553 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Core/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Core; namespace Db4objects.Db4o.Reflect.Core { public interface IConstructorAwareReflectClass : IReflectClass { IReflectConstructor GetSerializableConstructor(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Core/IReflectConstructor.cs0000644000175000017500000000103111700531646031650 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect.Core { /// Reflection Constructor representation. /// /// Reflection Constructor representation ///

See documentation for System.Reflection API. ///
/// IReflector public interface IReflectConstructor { IReflectClass[] GetParameterTypes(); object NewInstance(object[] parameters); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Core/AbstractReflectArray.cs0000644000175000017500000000700511700531646031763 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Reflect; using Sharpen.Lang.Reflect; namespace Db4objects.Db4o.Reflect.Core { /// public abstract class AbstractReflectArray : IReflectArray { protected readonly IReflector _reflector; public AbstractReflectArray(IReflector reflector) { _reflector = reflector; } public abstract object NewInstance(IReflectClass componentType, int[] dimensions); public abstract object NewInstance(IReflectClass componentType, int length); public virtual int[] Dimensions(object arr) { int count = 0; IReflectClass claxx = _reflector.ForObject(arr); while (claxx.IsArray()) { count++; claxx = claxx.GetComponentType(); } int[] dim = new int[count]; for (int i = 0; i < count; i++) { try { dim[i] = GetLength(arr); arr = Get(arr, 0); } catch (Exception) { return dim; } } return dim; } public virtual int Flatten(object a_shaped, int[] a_dimensions, int a_currentDimension , object[] a_flat, int a_flatElement) { if (a_currentDimension == (a_dimensions.Length - 1)) { for (int i = 0; i < a_dimensions[a_currentDimension]; i++) { a_flat[a_flatElement++] = GetNoExceptions(a_shaped, i); } } else { for (int i = 0; i < a_dimensions[a_currentDimension]; i++) { a_flatElement = Flatten(GetNoExceptions(a_shaped, i), a_dimensions, a_currentDimension + 1, a_flat, a_flatElement); } } return a_flatElement; } public virtual object Get(object onArray, int index) { return Sharpen.Runtime.GetArrayValue(onArray, index); } public virtual IReflectClass GetComponentType(IReflectClass a_class) { while (a_class.IsArray()) { a_class = a_class.GetComponentType(); } return a_class; } public virtual int GetLength(object array) { return Sharpen.Runtime.GetArrayLength(array); } private object GetNoExceptions(object onArray, int index) { try { return Get(onArray, index); } catch (Exception) { return null; } } public virtual bool IsNDimensional(IReflectClass a_class) { return a_class.GetComponentType().IsArray(); } public virtual void Set(object onArray, int index, object element) { if (element == null) { try { Sharpen.Runtime.SetArrayValue(onArray, index, element); } catch (Exception) { } } else { // This can happen on primitive arrays // and we are fine with ignoring it. // TODO: check if it's a primitive array first and don't ignore exceptions Sharpen.Runtime.SetArrayValue(onArray, index, element); } } public virtual int Shape(object[] a_flat, int a_flatElement, object a_shaped, int [] a_dimensions, int a_currentDimension) { if (a_currentDimension == (a_dimensions.Length - 1)) { for (int i = 0; i < a_dimensions[a_currentDimension]; i++) { Set(a_shaped, i, a_flat[a_flatElement++]); } } else { for (int i = 0; i < a_dimensions[a_currentDimension]; i++) { a_flatElement = Shape(a_flat, a_flatElement, Get(a_shaped, i), a_dimensions, a_currentDimension + 1); } } return a_flatElement; } public abstract void Analyze(object arg1, ArrayInfo arg2); public abstract object NewInstance(IReflectClass arg1, ArrayInfo arg2); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Core/ReflectorUtils.cs0000644000175000017500000000252411700531646030663 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect.Core { /// public class ReflectorUtils { public static IReflectClass ReflectClassFor(IReflector reflector, object clazz) { if (clazz is IReflectClass) { return (IReflectClass)clazz; } if (clazz is Type) { return reflector.ForClass((Type)clazz); } if (clazz is string) { return reflector.ForName((string)clazz); } return reflector.ForObject(clazz); } public static IReflectField Field(IReflectClass claxx, string name) { while (claxx != null) { try { return claxx.GetDeclaredField(name); } catch (Exception) { } claxx = claxx.GetSuperclass(); } return null; } public static void ForEachField(IReflectClass claxx, IProcedure4 procedure) { while (claxx != null) { IReflectField[] declaredFields = claxx.GetDeclaredFields(); for (int reflectFieldIndex = 0; reflectFieldIndex < declaredFields.Length; ++reflectFieldIndex) { IReflectField reflectField = declaredFields[reflectFieldIndex]; procedure.Apply(reflectField); } claxx = claxx.GetSuperclass(); } } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Core/ReflectConstructorSpec.cs0000644000175000017500000000400011700531646032351 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Reflect.Core; namespace Db4objects.Db4o.Reflect.Core { /// /// a spec holding a constructor, it's arguments /// and information, if the constructor can instantiate /// objects. /// /// /// a spec holding a constructor, it's arguments /// and information, if the constructor can instantiate /// objects. /// public class ReflectConstructorSpec { private IReflectConstructor _constructor; private object[] _args; private TernaryBool _canBeInstantiated; public static readonly Db4objects.Db4o.Reflect.Core.ReflectConstructorSpec UnspecifiedConstructor = new Db4objects.Db4o.Reflect.Core.ReflectConstructorSpec(TernaryBool.Unspecified ); public static readonly Db4objects.Db4o.Reflect.Core.ReflectConstructorSpec InvalidConstructor = new Db4objects.Db4o.Reflect.Core.ReflectConstructorSpec(TernaryBool.No); public ReflectConstructorSpec(IReflectConstructor constructor, object[] args) { _constructor = constructor; _args = args; _canBeInstantiated = TernaryBool.Yes; } private ReflectConstructorSpec(TernaryBool canBeInstantiated) { _canBeInstantiated = canBeInstantiated; _constructor = null; } /// creates a new instance. /// creates a new instance. /// the newly created instance. public virtual object NewInstance() { if (_constructor == null) { return null; } return _constructor.NewInstance(_args); } /// /// returns true if an instance can be instantiated /// with the constructor, otherwise false. /// /// /// returns true if an instance can be instantiated /// with the constructor, otherwise false. /// public virtual TernaryBool CanBeInstantiated() { return _canBeInstantiated; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Core/PlatformReflectConstructor.cs0000644000175000017500000000131011700531646033244 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Core; namespace Db4objects.Db4o.Reflect.Core { public class PlatformReflectConstructor : IReflectConstructor { private static readonly IReflectClass[] ParameterTypes = new IReflectClass[] { }; private Type _clazz; public PlatformReflectConstructor(Type clazz) { _clazz = clazz; } public virtual IReflectClass[] GetParameterTypes() { return ParameterTypes; } public virtual object NewInstance(object[] parameters) { return ReflectPlatform.CreateInstance(_clazz); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/IReflectMethod.cs0000644000175000017500000000113311700531646027656 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect { /// Reflection Method representation. /// /// Reflection Method representation ///

See documentation for System.Reflection API. ///
/// IReflector public interface IReflectMethod { /// object Invoke(object onObject, object[] parameters); IReflectClass GetReturnType(); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/0000755000175000017500000000000011700531646026047 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/GenericReflector.cs0000644000175000017500000003661311700531646031631 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Reflect.Generic; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Reflect.Generic { /// /// db4o provides GenericReflector as a wrapper around specific /// reflector (delegate). /// /// /// db4o provides GenericReflector as a wrapper around specific /// reflector (delegate). GenericReflector is set when an /// ObjectContainer is opened. All subsequent reflector /// calls are routed through this interface.

/// An instance of GenericReflector can be obtained through /// Db4objects.Db4o.Ext.IExtObjectContainer.Reflector() /// /// .

/// GenericReflector keeps list of known classes in memory. /// When the GenericReflector is called, it first checks its list of /// known classes. If the class cannot be found, the task is /// transferred to the delegate reflector. If the delegate fails as /// well, generic objects are created, which hold simulated /// "field values" in an array of objects.

/// Generic reflector makes possible the following usecases:
    ///
  • running a db4o server without deploying application classes;
  • ///
  • running db4o on Java dialects without reflection (J2ME CLDC, MIDP);
  • ///
  • easier access to stored objects where classes or fields are not available;
  • ///
  • running refactorings in the reflector;
  • ///
  • building interfaces to db4o from any programming language.
///

/// One of the live usecases is ObjectManager, which uses GenericReflector /// to read C# objects from Java. ///
public class GenericReflector : IReflector, IDeepClone { private KnownClassesRepository _repository; private IReflector _delegate; private GenericArrayReflector _array; private Collection4 _collectionPredicates = new Collection4(); private readonly Hashtable4 _classByClass = new Hashtable4(); private Transaction _trans; private ObjectContainerBase _stream; /// Creates an instance of GenericReflector /// transaction /// /// delegate reflector, /// providing specific reflector functionality. For example /// public GenericReflector(Transaction trans, IReflector delegateReflector) { // todo: Why have this when there is already the _repository by name? Redundant _repository = new KnownClassesRepository(new GenericClassBuilder(this, delegateReflector )); SetTransaction(trans); _delegate = delegateReflector; if (_delegate != null) { _delegate.SetParent(this); } } public GenericReflector(IReflector delegateReflector) : this(null, delegateReflector ) { } /// Creates a clone of provided object /// object to copy /// copy of the submitted object public virtual object DeepClone(object obj) { Db4objects.Db4o.Reflect.Generic.GenericReflector myClone = new Db4objects.Db4o.Reflect.Generic.GenericReflector (null, (IReflector)_delegate.DeepClone(this)); myClone._collectionPredicates = (Collection4)_collectionPredicates.DeepClone(myClone ); // Interesting, adding the following messes things up. // Keep the code, since it may make sense to carry the // global reflectors into a running db4o session. // Iterator4 i = _classes.iterator(); // while(i.hasNext()){ // GenericClass clazz = (GenericClass)i.next(); // clazz = (GenericClass)clazz.deepClone(myClone); // myClone._classByName.put(clazz.getName(), clazz); // myClone._classes.add(clazz); // } return myClone; } internal virtual ObjectContainerBase GetStream() { return _stream; } /// If there is a transaction assosiated with the current refector. /// If there is a transaction assosiated with the current refector. /// true if there is a transaction assosiated with the current refector. public virtual bool HasTransaction() { return _trans != null; } /// Associated a transaction with the current reflector. /// Associated a transaction with the current reflector. /// public virtual void SetTransaction(Transaction trans) { if (trans != null) { _trans = trans; _stream = trans.Container(); } _repository.SetTransaction(trans); } /// generic reflect array instance. public virtual IReflectArray Array() { if (_array == null) { _array = new GenericArrayReflector(this); } return _array; } internal virtual Db4objects.Db4o.Reflect.Generic.GenericClass EnsureDelegate(IReflectClass clazz) { if (clazz == null) { return null; } Db4objects.Db4o.Reflect.Generic.GenericClass claxx = (Db4objects.Db4o.Reflect.Generic.GenericClass )_repository.LookupByName(clazz.GetName()); if (claxx == null) { // We don't have to worry about the superclass, it can be null // because handling is delegated anyway claxx = GenericClass(clazz); _repository.Register(claxx); } return claxx; } private Db4objects.Db4o.Reflect.Generic.GenericClass GenericClass(IReflectClass clazz ) { Db4objects.Db4o.Reflect.Generic.GenericClass ret; string name = clazz.GetName(); if (name.Equals(ReflectPlatform.FullyQualifiedName(typeof(GenericArray)))) { // special case, comparing name because can't compare class == class directly with ReflectClass ret = new GenericArrayClass(this, clazz, name, null); } else { ret = new Db4objects.Db4o.Reflect.Generic.GenericClass(this, clazz, name, null); } return ret; } /// Returns a ReflectClass instance for the specified class /// class /// a ReflectClass instance for the specified class /// Db4objects.Db4o.Reflect.IReflectClass /// public virtual IReflectClass ForClass(Type clazz) { if (clazz == null) { return null; } IReflectClass claxx = (IReflectClass)_classByClass.Get(clazz); if (claxx != null) { return claxx; } if (!clazz.IsArray && ReflectPlatform.IsNamedClass(clazz)) { claxx = ForName(ReflectPlatform.FullyQualifiedName(clazz)); if (claxx != null) { _classByClass.Put(clazz, claxx); return claxx; } } claxx = _delegate.ForClass(clazz); if (claxx == null) { return null; } claxx = EnsureDelegate(claxx); _classByClass.Put(clazz, claxx); return claxx; } /// Returns a ReflectClass instance for the specified class name /// class name /// a ReflectClass instance for the specified class name /// Db4objects.Db4o.Reflect.IReflectClass /// public virtual IReflectClass ForName(string className) { return ((IReflectClass)WithLock(new _IClosure4_190(this, className))); } private sealed class _IClosure4_190 : IClosure4 { public _IClosure4_190(GenericReflector _enclosing, string className) { this._enclosing = _enclosing; this.className = className; } public object Run() { IReflectClass clazz = this._enclosing._repository.LookupByName(className); if (clazz != null) { return clazz; } clazz = this._enclosing._delegate.ForName(className); if (clazz != null) { return this._enclosing.EnsureDelegate(clazz); } return this._enclosing._repository.ForName(className); } private readonly GenericReflector _enclosing; private readonly string className; } /// Returns a ReflectClass instance for the specified class object /// class object /// a ReflectClass instance for the specified class object /// Db4objects.Db4o.Reflect.IReflectClass /// public virtual IReflectClass ForObject(object obj) { if (obj is GenericObject) { return ForGenericObject((GenericObject)obj); } if (obj is GenericArray) { return ((GenericArray)obj)._clazz; } return _delegate.ForObject(obj); } private IReflectClass ForGenericObject(GenericObject genericObject) { Db4objects.Db4o.Reflect.Generic.GenericClass claxx = genericObject._class; if (claxx == null) { throw new InvalidOperationException(); } string name = claxx.GetName(); if (name == null) { throw new InvalidOperationException(); } Db4objects.Db4o.Reflect.Generic.GenericClass existingClass = (Db4objects.Db4o.Reflect.Generic.GenericClass )ForName(name); if (existingClass == null) { _repository.Register(claxx); return claxx; } // TODO: Using .equals() here would be more consistent with // the equals() method in GenericClass. if (existingClass != claxx) { throw new InvalidOperationException(); } return claxx; } /// Returns delegate reflector /// delegate reflector public virtual IReflector GetDelegate() { return _delegate; } /// Determines if a candidate ReflectClass is a collection /// candidate ReflectClass /// true if a candidate ReflectClass is a collection. public virtual bool IsCollection(IReflectClass candidate) { //candidate = candidate.getDelegate(); IEnumerator i = _collectionPredicates.GetEnumerator(); while (i.MoveNext()) { if (((IReflectClassPredicate)i.Current).Match(candidate)) { return true; } } return _delegate.IsCollection(candidate.GetDelegate()); } //TODO: will need knowledge for .NET collections here // possibility: call registercollection with strings /// Register a class as a collection /// class to be registered public virtual void RegisterCollection(Type clazz) { RegisterCollection(ClassPredicate(clazz)); } /// Register a predicate as a collection /// predicate to be registered public virtual void RegisterCollection(IReflectClassPredicate predicate) { _collectionPredicates.Add(predicate); } private IReflectClassPredicate ClassPredicate(Type clazz) { IReflectClass collectionClass = ForClass(clazz); IReflectClassPredicate predicate = new _IReflectClassPredicate_290(collectionClass ); return predicate; } private sealed class _IReflectClassPredicate_290 : IReflectClassPredicate { public _IReflectClassPredicate_290(IReflectClass collectionClass) { this.collectionClass = collectionClass; } public bool Match(IReflectClass candidate) { return collectionClass.IsAssignableFrom(candidate); } private readonly IReflectClass collectionClass; } /// Register a class /// class public virtual void Register(Db4objects.Db4o.Reflect.Generic.GenericClass clazz) { WithLock(new _IClosure4_303(this, clazz)); } private sealed class _IClosure4_303 : IClosure4 { public _IClosure4_303(GenericReflector _enclosing, Db4objects.Db4o.Reflect.Generic.GenericClass clazz) { this._enclosing = _enclosing; this.clazz = clazz; } public object Run() { string name = clazz.GetName(); if (this._enclosing._repository.LookupByName(name) == null) { this._enclosing._repository.Register(clazz); } return null; } private readonly GenericReflector _enclosing; private readonly Db4objects.Db4o.Reflect.Generic.GenericClass clazz; } /// Returns an array of classes known to the reflector /// an array of classes known to the reflector public virtual IReflectClass[] KnownClasses() { return ((IReflectClass[])WithLock(new _IClosure4_319(this))); } private sealed class _IClosure4_319 : IClosure4 { public _IClosure4_319(GenericReflector _enclosing) { this._enclosing = _enclosing; } public object Run() { return new KnownClassesCollector(this._enclosing._stream, this._enclosing._repository ).Collect(); } private readonly GenericReflector _enclosing; } /// Registers primitive class /// class id /// class name /// class converter public virtual void RegisterPrimitiveClass(int id, string name, IGenericConverter converter) { WithLock(new _IClosure4_333(this, id, converter, name)); } private sealed class _IClosure4_333 : IClosure4 { public _IClosure4_333(GenericReflector _enclosing, int id, IGenericConverter converter , string name) { this._enclosing = _enclosing; this.id = id; this.converter = converter; this.name = name; } public object Run() { Db4objects.Db4o.Reflect.Generic.GenericClass existing = (Db4objects.Db4o.Reflect.Generic.GenericClass )this._enclosing._repository.LookupByID(id); if (existing != null) { if (null != converter) { } else { // existing.setSecondClass(); existing.SetConverter(null); } return null; } IReflectClass clazz = this._enclosing._delegate.ForName(name); Db4objects.Db4o.Reflect.Generic.GenericClass claxx = null; if (clazz != null) { claxx = this._enclosing.EnsureDelegate(clazz); } else { claxx = new Db4objects.Db4o.Reflect.Generic.GenericClass(this._enclosing, null, name , null); this._enclosing.Register(claxx); claxx.InitFields(new GenericField[] { new GenericField(null, null, true) }); claxx.SetConverter(converter); } // claxx.setSecondClass(); claxx.SetPrimitive(); this._enclosing._repository.Register(id, claxx); return null; } private readonly GenericReflector _enclosing; private readonly int id; private readonly IGenericConverter converter; private readonly string name; } /// method stub: generic reflector does not have a parent public virtual void SetParent(IReflector reflector) { } // do nothing, the generic reflector does not have a parant public virtual void Configuration(IReflectorConfiguration config) { if (_delegate != null) { _delegate.Configuration(config); } } private object WithLock(IClosure4 block) { if (_stream == null || _stream.IsClosed()) { return block.Run(); } return _stream.SyncExec(block); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/GenericArrayClass.cs0000644000175000017500000000175011700531646031742 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Reflect.Generic { /// public class GenericArrayClass : GenericClass { public GenericArrayClass(GenericReflector reflector, IReflectClass delegateClass, string name, GenericClass superclass) : base(reflector, delegateClass, name, superclass ) { } public override IReflectClass GetComponentType() { return GetDelegate(); } public override bool IsArray() { return true; } public override bool IsInstance(object candidate) { if (!(candidate is GenericArray)) { return false; } return IsAssignableFrom(((GenericArray)candidate)._clazz); } public override string ToString(object obj) { if (_converter == null) { return "(GA) " + GetName(); } return _converter.ToString((GenericArray)obj); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/GenericClassBuilder.cs0000644000175000017500000000266511700531646032260 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Reflect.Generic { /// public class GenericClassBuilder : IReflectClassBuilder { private GenericReflector _reflector; private IReflector _delegate; public GenericClassBuilder(GenericReflector reflector, IReflector delegate_) : base () { _reflector = reflector; _delegate = delegate_; } public virtual IReflectClass CreateClass(string name, IReflectClass superClass, int fieldCount) { IReflectClass nativeClass = _delegate.ForName(name); GenericClass clazz = new GenericClass(_reflector, nativeClass, name, (GenericClass )superClass); clazz.SetDeclaredFieldCount(fieldCount); return clazz; } public virtual IReflectField CreateField(IReflectClass parentType, string fieldName , IReflectClass fieldType, bool isVirtual, bool isPrimitive, bool isArray, bool isNArray) { if (isVirtual) { return new GenericVirtualField(fieldName); } return new GenericField(fieldName, fieldType, isPrimitive); } public virtual void InitFields(IReflectClass clazz, IReflectField[] fields) { ((GenericClass)clazz).InitFields((GenericField[])fields); } public virtual IReflectField[] FieldArray(int length) { return new GenericField[length]; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/IReflectClassBuilder.cs0000644000175000017500000000111711700531646032370 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect.Generic { /// public interface IReflectClassBuilder { IReflectClass CreateClass(string name, IReflectClass superClass, int fieldCount); IReflectField CreateField(IReflectClass parentType, string fieldName, IReflectClass fieldType, bool isVirtual, bool isPrimitive, bool isArray, bool isNArray); void InitFields(IReflectClass clazz, IReflectField[] fields); IReflectField[] FieldArray(int length); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/KnownClassesRepository.cs0000644000175000017500000002321411700531646033112 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Internal; using Db4objects.Db4o.Internal.Marshall; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Reflect.Generic { /// public class KnownClassesRepository { private static readonly Hashtable4 Primitives; static KnownClassesRepository() { Primitives = new Hashtable4(); Type[] primitiveArray = Platform4.PrimitiveTypes(); for (int primitiveIndex = 0; primitiveIndex < primitiveArray.Length; ++primitiveIndex) { Type primitive = primitiveArray[primitiveIndex]; RegisterPrimitive(primitive); } } private static void RegisterPrimitive(Type primitive) { Primitives.Put(ReflectPlatform.FullyQualifiedName(Platform4.NullableTypeFor(primitive )), primitive); } private ObjectContainerBase _stream; private Transaction _trans; private IReflectClassBuilder _builder; private readonly ListenerRegistry _listeners = ListenerRegistry.NewInstance(); private readonly Hashtable4 _classByName = new Hashtable4(); private readonly Hashtable4 _classByID = new Hashtable4(); private Collection4 _pendingClasses = new Collection4(); private readonly Collection4 _classes = new Collection4(); public KnownClassesRepository(IReflectClassBuilder builder) { _builder = builder; } public virtual void SetTransaction(Transaction trans) { if (trans != null) { _trans = trans; _stream = trans.Container(); } } public virtual void Register(IReflectClass clazz) { Register(clazz.GetName(), clazz); } public virtual IReflectClass ForID(int id) { lock (_stream.Lock()) { if (_stream.Handlers.IsSystemHandler(id)) { return _stream.Handlers.ClassForID(id); } return EnsureClassAvailability(id); } } public virtual IReflectClass ForName(string className) { IReflectClass clazz = LookupByName(className); if (clazz != null) { return clazz; } if (_stream == null) { return null; } lock (_stream.Lock()) { if (_stream.ClassCollection() == null) { return null; } int classID = _stream.ClassMetadataIdForName(className); if (classID <= 0) { return null; } return InitializeClass(classID, className); } } private IReflectClass InitializeClass(int classID, string className) { IReflectClass newClazz = EnsureClassInitialised(classID); _classByName.Put(className, newClazz); return newClazz; } private void ReadAll() { ForEachClassId(new _IProcedure4_102(this)); ForEachClassId(new _IProcedure4_105(this)); } private sealed class _IProcedure4_102 : IProcedure4 { public _IProcedure4_102(KnownClassesRepository _enclosing) { this._enclosing = _enclosing; } public void Apply(object id) { this._enclosing.EnsureClassAvailability((((int)id))); } private readonly KnownClassesRepository _enclosing; } private sealed class _IProcedure4_105 : IProcedure4 { public _IProcedure4_105(KnownClassesRepository _enclosing) { this._enclosing = _enclosing; } public void Apply(object id) { this._enclosing.EnsureClassRead((((int)id))); } private readonly KnownClassesRepository _enclosing; } private void ForEachClassId(IProcedure4 procedure) { for (IEnumerator ids = _stream.ClassCollection().Ids(); ids.MoveNext(); ) { procedure.Apply((int)ids.Current); } } private IReflectClass EnsureClassAvailability(int id) { if (id == 0) { return null; } IReflectClass ret = (IReflectClass)_classByID.Get(id); if (ret != null) { return ret; } ByteArrayBuffer classreader = _stream.ReadStatefulBufferById(_trans, id); ClassMarshaller marshaller = MarshallerFamily()._class; RawClassSpec spec = marshaller.ReadSpec(_trans, classreader); string className = spec.Name(); ret = LookupByName(className); if (ret != null) { _classByID.Put(id, ret); _pendingClasses.Add(id); return ret; } ReportMissingClass(className); ret = _builder.CreateClass(className, EnsureClassAvailability(spec.SuperClassID() ), spec.NumFields()); // step 1 only add to _classByID, keep the class out of _classByName and _classes _classByID.Put(id, ret); _pendingClasses.Add(id); return ret; } private void ReportMissingClass(string className) { _stream.Handlers.DiagnosticProcessor().ClassMissed(className); } private void EnsureClassRead(int id) { IReflectClass clazz = LookupByID(id); ByteArrayBuffer classreader = _stream.ReadStatefulBufferById(_trans, id); ClassMarshaller classMarshaller = MarshallerFamily()._class; RawClassSpec classInfo = classMarshaller.ReadSpec(_trans, classreader); string className = classInfo.Name(); // Having the class in the _classByName Map for now indicates // that the class is fully read. This is breakable if we start // returning GenericClass'es in other methods like forName // even if a native class has not been found if (LookupByName(className) != null) { return; } // step 2 add the class to _classByName and _classes to denote reading is completed Register(className, clazz); int numFields = classInfo.NumFields(); IReflectField[] fields = _builder.FieldArray(numFields); IFieldMarshaller fieldMarshaller = MarshallerFamily()._field; for (int i = 0; i < numFields; i++) { RawFieldSpec fieldInfo = fieldMarshaller.ReadSpec(_stream, classreader); string fieldName = fieldInfo.Name(); IReflectClass fieldClass = ReflectClassForFieldSpec(fieldInfo, _stream.Reflector( )); if (null == fieldClass && (fieldInfo.IsField() && !fieldInfo.IsVirtual())) { throw new InvalidOperationException("Could not read field type for '" + className + "." + fieldName + "'"); } fields[i] = _builder.CreateField(clazz, fieldName, fieldClass, fieldInfo.IsVirtual (), fieldInfo.IsPrimitive(), fieldInfo.IsArray(), fieldInfo.IsNArray()); } _builder.InitFields(clazz, fields); } private void Register(string className, IReflectClass clazz) { if (LookupByName(className) != null) { throw new ArgumentException(); } _classByName.Put(className, clazz); _classes.Add(clazz); _listeners.NotifyListeners(clazz); } private IReflectClass ReflectClassForFieldSpec(RawFieldSpec fieldInfo, IReflector reflector) { if (fieldInfo.IsVirtualField()) { return VirtualFieldByName(fieldInfo.Name()).ClassReflector(reflector); } int fieldTypeID = fieldInfo.FieldTypeID(); switch (fieldTypeID) { case Handlers4.UntypedId: { // need to take care of special handlers here return ObjectClass(); } case Handlers4.AnyArrayId: { return ArrayClass(ObjectClass()); } default: { IReflectClass fieldClass = ForID(fieldTypeID); if (null != fieldClass) { return NormalizeFieldClass(fieldInfo, fieldClass); } break; break; } } return null; } private IReflectClass NormalizeFieldClass(RawFieldSpec fieldInfo, IReflectClass fieldClass ) { // TODO: why the following line is necessary? IReflectClass theClass = _stream.Reflector().ForName(fieldClass.GetName()); if (fieldInfo.IsPrimitive()) { theClass = PrimitiveClass(theClass); } if (fieldInfo.IsArray()) { theClass = ArrayClass(theClass); } return theClass; } private IReflectClass ObjectClass() { return _stream.Reflector().ForClass(typeof(object)); } private VirtualFieldMetadata VirtualFieldByName(string fieldName) { return _stream.Handlers.VirtualFieldByName(fieldName); } private Db4objects.Db4o.Internal.Marshall.MarshallerFamily MarshallerFamily() { return Db4objects.Db4o.Internal.Marshall.MarshallerFamily.ForConverterVersion(_stream .ConverterVersion()); } private IReflectClass EnsureClassInitialised(int id) { IReflectClass ret = EnsureClassAvailability(id); while (_pendingClasses.Size() > 0) { Collection4 pending = _pendingClasses; _pendingClasses = new Collection4(); IEnumerator i = pending.GetEnumerator(); while (i.MoveNext()) { EnsureClassRead(((int)i.Current)); } } return ret; } public virtual IEnumerator Classes() { ReadAll(); return _classes.GetEnumerator(); } public virtual void Register(int id, IReflectClass clazz) { _classByID.Put(id, clazz); } public virtual IReflectClass LookupByID(int id) { return (IReflectClass)_classByID.Get(id); } public virtual IReflectClass LookupByName(string name) { return (IReflectClass)_classByName.Get(name); } private IReflectClass ArrayClass(IReflectClass clazz) { object proto = clazz.Reflector().Array().NewInstance(clazz, 0); return clazz.Reflector().ForObject(proto); } private IReflectClass PrimitiveClass(IReflectClass baseClass) { Type primitive = (Type)Primitives.Get(baseClass.GetName()); if (primitive != null) { return baseClass.Reflector().ForClass(primitive); } return baseClass; } public virtual void AddListener(IListener4 listener) { _listeners.Register(listener); } public virtual void RemoveListener(IListener4 listener) { _listeners.Remove(listener); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/GenericVirtualField.cs0000644000175000017500000000164211700531646032270 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Reflect.Generic { /// public class GenericVirtualField : GenericField { public GenericVirtualField(string name) : base(name, null, false) { } public override object DeepClone(object obj) { return new Db4objects.Db4o.Reflect.Generic.GenericVirtualField(GetName()); } public override object Get(object onObject) { return null; } public override IReflectClass GetFieldType() { return null; } public override bool IsPublic() { return false; } public override bool IsStatic() { return true; } public override bool IsTransient() { return true; } public override void Set(object onObject, object value) { } // do nothing } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/GenericField.cs0000644000175000017500000000423211700531646030717 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Reflect.Generic { /// public class GenericField : IReflectField, IDeepClone { private readonly string _name; private readonly GenericClass _type; private readonly bool _primitive; private int _index = -1; public GenericField(string name, IReflectClass clazz, bool primitive) { _name = name; _type = (GenericClass)clazz; _primitive = primitive; } public virtual object DeepClone(object obj) { IReflector reflector = (IReflector)obj; IReflectClass newReflectClass = null; if (_type != null) { newReflectClass = reflector.ForName(_type.GetName()); } return new Db4objects.Db4o.Reflect.Generic.GenericField(_name, newReflectClass, _primitive ); } public virtual object Get(object onObject) { //TODO Consider: Do we need to check that onObject is an instance of the DataClass this field is a member of? return ((GenericObject)onObject).Get(_index); } public virtual string GetName() { return _name; } public virtual IReflectClass GetFieldType() { return _type; } public virtual bool IsPublic() { return true; } public virtual bool IsPrimitive() { return _primitive; } public virtual bool IsStatic() { //FIXME Consider static fields. return false; } public virtual bool IsTransient() { return false; } public virtual void Set(object onObject, object value) { // FIXME: Consider enabling type checking. // The following will fail with arrays. // if (!_type.isInstance(value)) throw new RuntimeException(); //TODO Consider: is this checking really necessary? ((GenericObject)onObject).Set(_index, value); } internal virtual void SetIndex(int index) { _index = index; } public virtual object IndexEntry(object orig) { return orig; } public virtual IReflectClass IndexType() { return GetFieldType(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/GenericArrayReflector.cs0000644000175000017500000000576411700531646032633 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Reflect.Generic { /// public class GenericArrayReflector : IReflectArray { private readonly IReflectArray _delegate; public GenericArrayReflector(GenericReflector reflector) { _delegate = reflector.GetDelegate().Array(); } public virtual void Analyze(object obj, ArrayInfo info) { _delegate.Analyze(obj, info); } public virtual int[] Dimensions(object arr) { return _delegate.Dimensions(arr); } public virtual int Flatten(object a_shaped, int[] a_dimensions, int a_currentDimension , object[] a_flat, int a_flatElement) { return _delegate.Flatten(a_shaped, a_dimensions, a_currentDimension, a_flat, a_flatElement ); } public virtual object Get(object onArray, int index) { if (onArray is GenericArray) { return ((GenericArray)onArray)._data[index]; } return _delegate.Get(onArray, index); } public virtual IReflectClass GetComponentType(IReflectClass claxx) { claxx = claxx.GetDelegate(); if (claxx is GenericClass) { return claxx; } return _delegate.GetComponentType(claxx); } public virtual int GetLength(object array) { if (array is GenericArray) { return ((GenericArray)array).GetLength(); } return _delegate.GetLength(array); } public virtual bool IsNDimensional(IReflectClass a_class) { if (a_class is GenericArrayClass) { return false; } return _delegate.IsNDimensional(a_class.GetDelegate()); } public virtual object NewInstance(IReflectClass componentType, ArrayInfo info) { componentType = componentType.GetDelegate(); if (componentType is GenericClass) { int length = info.ElementCount(); return new GenericArray(((GenericClass)componentType).ArrayClass(), length); } return _delegate.NewInstance(componentType, info); } public virtual object NewInstance(IReflectClass componentType, int length) { componentType = componentType.GetDelegate(); if (componentType is GenericClass) { return new GenericArray(((GenericClass)componentType).ArrayClass(), length); } return _delegate.NewInstance(componentType, length); } public virtual object NewInstance(IReflectClass componentType, int[] dimensions) { return _delegate.NewInstance(componentType.GetDelegate(), dimensions); } public virtual void Set(object onArray, int index, object element) { if (onArray is GenericArray) { ((GenericArray)onArray)._data[index] = element; return; } _delegate.Set(onArray, index, element); } public virtual int Shape(object[] a_flat, int a_flatElement, object a_shaped, int [] a_dimensions, int a_currentDimension) { return _delegate.Shape(a_flat, a_flatElement, a_shaped, a_dimensions, a_currentDimension ); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/GenericObject.cs0000644000175000017500000000232311700531646031101 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Reflect.Generic { /// public class GenericObject : IComparable { internal readonly GenericClass _class; private object[] _values; public GenericObject(GenericClass clazz) { _class = clazz; } private void EnsureValuesInitialized() { if (_values == null) { _values = new object[_class.GetFieldCount()]; } } public virtual void Set(int index, object value) { EnsureValuesInitialized(); _values[index] = value; } /// /// the value of the field at index, based on the fields obtained GenericClass.getDeclaredFields /// public virtual object Get(int index) { EnsureValuesInitialized(); return _values[index]; } public override string ToString() { if (_class == null) { return base.ToString(); } return _class.ToString(this); } public virtual GenericClass GetGenericClass() { return _class; } public virtual int CompareTo(object o) { return 0; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/GenericArray.cs0000644000175000017500000000140411700531646030750 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using System.Collections; using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Reflect.Generic { /// public class GenericArray { internal GenericClass _clazz; internal object[] _data; public GenericArray(GenericClass clazz, int size) { _clazz = clazz; _data = new object[size]; } public virtual IEnumerator Iterator() { return Iterators.Iterate(_data); } internal virtual int GetLength() { return _data.Length; } public override string ToString() { if (_clazz == null) { return base.ToString(); } return _clazz.ToString(this); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/GenericClass.cs0000644000175000017500000002001711700531646030740 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Foundation; using Db4objects.Db4o.Reflect; using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Reflect.Generic { /// public class GenericClass : IReflectClass, IDeepClone { private static readonly GenericField[] NoFields = new GenericField[0]; private readonly GenericReflector _reflector; private readonly IReflectClass _delegate; private readonly string _name; private Db4objects.Db4o.Reflect.Generic.GenericClass _superclass; private Db4objects.Db4o.Reflect.Generic.GenericClass _array; private bool _isPrimitive; private int _isCollection; protected IGenericConverter _converter; private GenericField[] _fields = NoFields; private int _declaredFieldCount = -1; private int _fieldCount = -1; private readonly int _hashCode; public GenericClass(GenericReflector reflector, IReflectClass delegateClass, string name, Db4objects.Db4o.Reflect.Generic.GenericClass superclass) { _reflector = reflector; _delegate = delegateClass; _name = name; _superclass = superclass; _hashCode = _name.GetHashCode(); } public virtual Db4objects.Db4o.Reflect.Generic.GenericClass ArrayClass() { if (_array != null) { return _array; } _array = new GenericArrayClass(_reflector, this, _name, _superclass); return _array; } public virtual object DeepClone(object obj) { GenericReflector reflector = (GenericReflector)obj; Db4objects.Db4o.Reflect.Generic.GenericClass superClass = null; if (_superclass != null) { _superclass = (Db4objects.Db4o.Reflect.Generic.GenericClass)reflector.ForName(_superclass .GetName()); } Db4objects.Db4o.Reflect.Generic.GenericClass ret = new Db4objects.Db4o.Reflect.Generic.GenericClass (reflector, _delegate, _name, superClass); GenericField[] fields = new GenericField[_fields.Length]; for (int i = 0; i < fields.Length; i++) { fields[i] = (GenericField)_fields[i].DeepClone(reflector); } ret.InitFields(fields); return ret; } public override bool Equals(object obj) { if (this == obj) { return true; } if (obj == null || GetType() != obj.GetType()) { return false; } Db4objects.Db4o.Reflect.Generic.GenericClass otherGC = (Db4objects.Db4o.Reflect.Generic.GenericClass )obj; if (_hashCode != otherGC.GetHashCode()) { return false; } return _name.Equals(otherGC._name); } public virtual IReflectClass GetComponentType() { if (_delegate != null) { return _delegate.GetComponentType(); } return null; } // TODO: consider that classes may have two fields of // the same name after refactoring. public virtual IReflectField GetDeclaredField(string name) { if (_delegate != null) { return _delegate.GetDeclaredField(name); } for (int i = 0; i < _fields.Length; i++) { if (_fields[i].GetName().Equals(name)) { return _fields[i]; } } return null; } public virtual IReflectField[] GetDeclaredFields() { if (_delegate != null) { return _delegate.GetDeclaredFields(); } return _fields; } public virtual IReflectClass GetDelegate() { if (_delegate != null) { return _delegate; } return this; } internal virtual int GetFieldCount() { if (_fieldCount != -1) { return _fieldCount; } _fieldCount = 0; if (_superclass != null) { _fieldCount = _superclass.GetFieldCount(); } if (_declaredFieldCount == -1) { _declaredFieldCount = GetDeclaredFields().Length; } _fieldCount += _declaredFieldCount; return _fieldCount; } public virtual IReflectMethod GetMethod(string methodName, IReflectClass[] paramClasses ) { if (_delegate != null) { return _delegate.GetMethod(methodName, paramClasses); } return null; } public virtual string GetName() { return _name; } public virtual IReflectClass GetSuperclass() { if (_superclass != null) { return _superclass; } if (_delegate == null) { return _reflector.ForClass(typeof(object)); } IReflectClass delegateSuperclass = _delegate.GetSuperclass(); if (delegateSuperclass != null) { _superclass = _reflector.EnsureDelegate(delegateSuperclass); } return _superclass; } public override int GetHashCode() { return _hashCode; } public virtual void InitFields(GenericField[] fields) { int startIndex = 0; if (_superclass != null) { startIndex = _superclass.GetFieldCount(); } _fields = fields; for (int i = 0; i < _fields.Length; i++) { _fields[i].SetIndex(startIndex + i); } } // TODO: Consider: Will this method still be necessary // once constructor logic is pushed into the reflectors? public virtual bool IsAbstract() { if (_delegate != null) { return _delegate.IsAbstract(); } return false; } public virtual bool IsArray() { if (_delegate != null) { return _delegate.IsArray(); } return false; } public virtual bool IsAssignableFrom(IReflectClass subclassCandidate) { if (subclassCandidate == null) { return false; } if (Equals(subclassCandidate)) { return true; } if (_delegate != null) { if (subclassCandidate is Db4objects.Db4o.Reflect.Generic.GenericClass) { subclassCandidate = ((Db4objects.Db4o.Reflect.Generic.GenericClass)subclassCandidate ).GetDelegate(); } return _delegate.IsAssignableFrom(subclassCandidate); } if (!(subclassCandidate is Db4objects.Db4o.Reflect.Generic.GenericClass)) { return false; } return IsAssignableFrom(subclassCandidate.GetSuperclass()); } public virtual bool IsCollection() { if (_isCollection == 1) { return true; } if (_isCollection == -1) { return false; } _isCollection = _reflector.IsCollection(this) ? 1 : -1; return IsCollection(); } public virtual bool IsInstance(object candidate) { if (_delegate != null) { return _delegate.IsInstance(candidate); } if (!(candidate is GenericObject)) { return false; } return IsAssignableFrom(((GenericObject)candidate)._class); } public virtual bool IsInterface() { if (_delegate != null) { return _delegate.IsInterface(); } return false; } public virtual bool IsPrimitive() { if (_delegate != null) { return _delegate.IsPrimitive(); } return _isPrimitive; } public virtual object NewInstance() { if (_delegate != null) { return _delegate.NewInstance(); } return new GenericObject(this); } public virtual IReflector Reflector() { if (_delegate != null) { return _delegate.Reflector(); } return _reflector; } internal virtual void SetConverter(IGenericConverter converter) { _converter = converter; } internal virtual void SetDeclaredFieldCount(int count) { _declaredFieldCount = count; } internal virtual void SetPrimitive() { _isPrimitive = true; } public override string ToString() { return "GenericClass " + _name; } public virtual string ToString(object obj) { if (_converter == null) { return "(G) " + GetName(); } return _converter.ToString((GenericObject)obj); } public virtual bool EnsureCanBeInstantiated() { if (_delegate != null) { return _delegate.EnsureCanBeInstantiated(); } return true; } public virtual object NullValue() { if (_delegate == null) { return null; } return _delegate.NullValue(); } public virtual bool IsImmutable() { if (_delegate != null) { return _delegate.IsImmutable(); } return IsPrimitive(); } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/IGenericConverter.cs0000644000175000017500000000046711700531646031762 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect.Generic; namespace Db4objects.Db4o.Reflect.Generic { /// public interface IGenericConverter { string ToString(GenericObject obj); string ToString(GenericArray array); } } CollectionUpdateDepthEntry.cs0000644000175000017500000000066611700531646033574 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/Generic/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect.Generic { internal class CollectionUpdateDepthEntry { internal readonly IReflectClassPredicate _predicate; internal readonly int _depth; internal CollectionUpdateDepthEntry(IReflectClassPredicate predicate, int depth) { _predicate = predicate; _depth = depth; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/ArrayInfo.cs0000644000175000017500000000171111700531646026714 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect { /// public class ArrayInfo { private int _elementCount; private bool _primitive; private bool _nullable; private IReflectClass _reflectClass; public virtual int ElementCount() { return _elementCount; } public virtual void ElementCount(int count) { _elementCount = count; } public virtual bool Primitive() { return _primitive; } public virtual void Primitive(bool flag) { _primitive = flag; } public virtual bool Nullable() { return _nullable; } public virtual void Nullable(bool flag) { _nullable = flag; } public virtual IReflectClass ReflectClass() { return _reflectClass; } public virtual void ReflectClass(IReflectClass claxx) { _reflectClass = claxx; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/MultidimensionalArrayInfo.cs0000644000175000017500000000063511700531646032156 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect { /// public class MultidimensionalArrayInfo : ArrayInfo { private int[] _dimensions; public virtual void Dimensions(int[] dim) { _dimensions = dim; } public virtual int[] Dimensions() { return _dimensions; } } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/IReflectorConfiguration.cs0000644000175000017500000000041611700531646031611 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect { public interface IReflectorConfiguration { bool TestConstructors(); bool CallConstructor(IReflectClass clazz); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/IReflectField.cs0000644000175000017500000000273211700531646027467 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect { /// Reflection Field representation. /// /// Reflection Field representation ///

See documentation for System.Reflection API. ///
/// IReflector public interface IReflectField { object Get(object onObject); string GetName(); /// /// The ReflectClass returned by this method should have been /// provided by the parent reflector. /// /// /// The ReflectClass returned by this method should have been /// provided by the parent reflector. /// /// the ReflectClass representing the field type as provided by the parent reflector /// IReflectClass GetFieldType(); bool IsPublic(); bool IsStatic(); bool IsTransient(); void Set(object onObject, object value); /// /// The ReflectClass returned by this method should have been /// provided by the parent reflector. /// /// /// The ReflectClass returned by this method should have been /// provided by the parent reflector. /// /// the ReflectClass representing the index type as provided by the parent reflector /// IReflectClass IndexType(); object IndexEntry(object orig); } } smuxi-0.11/lib/db4o-net/Db4objects.Db4o/Db4objects.Db4o/Reflect/IReflectClassPredicate.cs0000644000175000017500000000142111700531646031324 0ustar00meebeymeebey00000000000000/* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ using Db4objects.Db4o.Reflect; namespace Db4objects.Db4o.Reflect { /// Predicate representation. /// Predicate representation. /// Db4objects.Db4o.Query.Predicate /// IReflector public interface IReflectClassPredicate { /// Match method definition. /// /// Match method definition. Used to select correct /// results from an object set. /// /// item to be matched to the criteria /// true, if the requirements are met bool Match(IReflectClass item); } } smuxi-0.11/lib/SmartIrc4net/0000755000175000017500000000000012311344240016455 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/examples/0000755000175000017500000000000011655552514020312 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/examples/stresstest/0000755000175000017500000000000012253423361022525 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/examples/stresstest/AssemblyInfo.cs0000644000175000017500000000217211655552514025461 0ustar00meebeymeebey00000000000000using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following // attributes. // // change them to the information which is associated with the assembly // you compile. [assembly: AssemblyTitle("SmartIrc4net examples/stresstest Bot")] [assembly: AssemblyDescription("IRC Bot for developing/testing SmartIrc4net")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has following format : // // Major.Minor.Build.Revision // // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): [assembly: AssemblyVersion("0.1.*")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. // This is not required, if you don't want signing let these attributes like they're. [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] smuxi-0.11/lib/SmartIrc4net/examples/stresstest/stresstest.cs0000644000175000017500000001302611655552514025311 0ustar00meebeymeebey00000000000000/** * $Id$ * $Revision$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * This is a simple test client for the library. * * Copyright (c) 2003-2004 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections; using System.Threading; using Meebey.SmartIrc4net; public class StressTest { // make an instance of the high-level API public static IrcClient irc = new IrcClient(); // this method we will use to analyse queries (also known as private messages) public static void OnQueryMessage(object sender, IrcEventArgs e) { switch (e.Data.MessageArray[0]) { // debug stuff case "dump_channel": string requested_channel = e.Data.MessageArray[1]; // getting the channel (via channel sync feature) Channel channel = irc.GetChannel(requested_channel); // here we send messages irc.SendMessage(SendType.Message, e.Data.Nick, ""); irc.SendMessage(SendType.Message, e.Data.Nick, "Name: '"+channel.Name+"'"); irc.SendMessage(SendType.Message, e.Data.Nick, "Topic: '"+channel.Topic+"'"); irc.SendMessage(SendType.Message, e.Data.Nick, "Mode: '"+channel.Mode+"'"); irc.SendMessage(SendType.Message, e.Data.Nick, "Key: '"+channel.Key+"'"); irc.SendMessage(SendType.Message, e.Data.Nick, "UserLimit: '"+channel.UserLimit+"'"); // here we go through all users of the channel and show their // hashtable key and nickname string nickname_list = ""; nickname_list += "Users: "; IDictionaryEnumerator it = channel.Users.GetEnumerator(); while(it.MoveNext()) { string key = (string)it.Key; ChannelUser channeluser = (ChannelUser)it.Value; nickname_list += "("; if (channeluser.IsOp) { nickname_list += "@"; } if (channeluser.IsVoice) { nickname_list += "+"; } nickname_list += ")"+key+" => "+channeluser.Nick+", "; } irc.SendMessage(SendType.Message, e.Data.Nick, nickname_list); irc.SendMessage(SendType.Message, e.Data.Nick, ""); break; case "gc": GC.Collect(); break; // typical commands case "join": irc.RfcJoin(e.Data.MessageArray[1]); break; case "part": irc.RfcPart(e.Data.MessageArray[1]); break; case "die": Exit(); break; } } public static void OnError(object sender, ErrorEventArgs e) { System.Console.WriteLine("Error: "+e.ErrorMessage); Exit(); } public static void OnRawMessage(object sender, IrcEventArgs e) { System.Console.WriteLine("Received: "+e.Data.RawMessage); } public static void Main(string[] args) { Thread.CurrentThread.Name = "Main"; irc.SendDelay = 400; irc.ActiveChannelSyncing = true; irc.OnQueryMessage += new IrcEventHandler(OnQueryMessage); irc.OnError += new ErrorEventHandler(OnError); irc.OnRawMessage += new IrcEventHandler(OnRawMessage); string[] serverlist; // the server we want to connect to, could be also a simple string serverlist = new string[] {"irc.freshirc.com"}; int port = 6667; string channel = "#OCS"; try { irc.Connect(serverlist, port); } catch (ConnectionException e) { System.Console.WriteLine("couldn't connect! Reason: "+e.Message); Exit(); } try { irc.Login("SmartIRC", "SmartIrc4net Test Bot"); irc.RfcJoin(channel); new Thread(new ThreadStart(ReadCommands)).Start(); irc.Listen(); irc.Disconnect(); } catch (ConnectionException) { Exit(); } catch (Exception e) { System.Console.WriteLine("Error occurred! Message: "+e.Message); System.Console.WriteLine("Exception: "+e.StackTrace); Exit(); } } public static void ReadCommands() { while (true) { irc.WriteLine(System.Console.ReadLine()); } } public static void Exit() { System.Console.WriteLine("Exiting..."); System.Environment.Exit(0); } } smuxi-0.11/lib/SmartIrc4net/examples/benchmark/0000755000175000017500000000000012253423361022234 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/examples/benchmark/AssemblyInfo.cs0000644000175000017500000000217111655552514025167 0ustar00meebeymeebey00000000000000using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following // attributes. // // change them to the information which is associated with the assembly // you compile. [assembly: AssemblyTitle("SmartIrc4net examples/benchmark Bot")] [assembly: AssemblyDescription("IRC Bot for developing/testing SmartIrc4net")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has following format : // // Major.Minor.Build.Revision // // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): [assembly: AssemblyVersion("0.1.*")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. // This is not required, if you don't want signing let these attributes like they're. [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] smuxi-0.11/lib/SmartIrc4net/examples/benchmark/benchmark.cs0000644000175000017500000001112611655552514024526 0ustar00meebeymeebey00000000000000/** * $Id$ * $Revision$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * This is a benchmark test client for the library. * * Copyright (c) 2003-2004 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Threading; using System.Net.Sockets; using Meebey.SmartIrc4net; public class Benchmark { const string SERVER = "irc.freenode.net"; //const string SERVER = "irc.freenet.de"; //const string SERVER = "10.1.0.101"; const int PORT = 6667; const string NICK = "SmartIrcB"; const string REALNAME = "SmartIrc4net Benchmark Bot"; const string CHANNEL = "#C#"; public static void Main(string[] args) { Thread.Sleep(5000); DateTime start, end; start = DateTime.UtcNow; TcpClientList(); end = DateTime.UtcNow; Console.WriteLine("TcpClientList() took "+end.Subtract(start).TotalSeconds+" sec"); Thread.Sleep(5000); start = DateTime.UtcNow; IrcConnectionList(); end = DateTime.UtcNow; Console.WriteLine("IrcConnectionList() took "+end.Subtract(start).TotalSeconds+" sec"); Thread.Sleep(5000); start = DateTime.UtcNow; IrcClientList(); end = DateTime.UtcNow; Console.WriteLine("IrcClientList() took "+end.Subtract(start).TotalSeconds+" sec"); } public static void TcpClientList() { TcpClient tc = new TcpClient(SERVER, PORT); StreamReader sr = new StreamReader(tc.GetStream()); StreamWriter sw = new StreamWriter(tc.GetStream()); sw.Write(Rfc2812.Nick(NICK)+"\r\n"); sw.Write(Rfc2812.User(NICK, 0, REALNAME)+"\r\n"); sw.Flush(); string line; string[] linear; while (true) { line = sr.ReadLine(); if (line != null) { linear = line.Split(new char[] {' '}); if (linear.Length >= 2 && linear[1] == "001") { sw.Write(Rfc2812.List(CHANNEL)+"\r\n"); sw.Flush(); } if (linear.Length >= 5 && linear[1] == "322") { Console.WriteLine("On the IRC channel "+CHANNEL+" are "+linear[4]+" users"); sr.Close(); sw.Close(); tc.Close(); break; } } } } public static void IrcClientList() { IrcClient irc = new IrcClient(); irc.OnRawMessage += new IrcEventHandler(IrcClientListCallback); irc.Connect(SERVER, PORT); irc.Login(NICK, REALNAME); irc.RfcList(CHANNEL); irc.Listen(); } public static void IrcClientListCallback(object sender, IrcEventArgs e) { if (e.Data.ReplyCode == ReplyCode.List) { Console.WriteLine("On the IRC channel "+CHANNEL+" are "+e.Data.RawMessageArray[4]+" users"); e.Data.Irc.Disconnect(); } } public static void IrcConnectionList() { IrcConnection irc = new IrcConnection(); irc.OnReadLine += new ReadLineEventHandler(IrcConnectionListCallback); irc.Connect(SERVER, PORT); irc.WriteLine(Rfc2812.Nick(NICK), Priority.Critical); irc.WriteLine(Rfc2812.User(NICK, 0, REALNAME), Priority.Critical); irc.WriteLine(Rfc2812.List(CHANNEL)); irc.Listen(); } public static void IrcConnectionListCallback(object sender, ReadLineEventArgs e) { string[] linear = e.Line.Split(new char[] {' '}); if (linear.Length >= 5 && linear[1] == "322") { Console.WriteLine("On the IRC channel "+CHANNEL+" are "+linear[4]+" users"); ((IrcConnection)sender).Disconnect(); } } } smuxi-0.11/lib/SmartIrc4net/examples/test/0000755000175000017500000000000012253423361021261 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/examples/test/AssemblyInfo.cs0000644000175000017500000000216411655552514024216 0ustar00meebeymeebey00000000000000using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following // attributes. // // change them to the information which is associated with the assembly // you compile. [assembly: AssemblyTitle("SmartIrc4net examples/test Bot")] [assembly: AssemblyDescription("IRC Bot for developing/testing SmartIrc4net")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has following format : // // Major.Minor.Build.Revision // // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): [assembly: AssemblyVersion("0.1.*")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. // This is not required, if you don't want signing let these attributes like they're. [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] smuxi-0.11/lib/SmartIrc4net/examples/test/Test.cs0000644000175000017500000002205411655552514022542 0ustar00meebeymeebey00000000000000/** * $Id$ * $Revision$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * This is a simple test client for the library. * * Copyright (c) 2003-2004 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Threading; using System.Collections; using System.Collections.Generic; using Meebey.SmartIrc4net; // This is an VERY basic example how your IRC application could be written // its mainly for showing how to use the API, this program just connects sends // a few message to a channel and waits for commands on the console // (raw RFC commands though! it's later explained). // There are also a few commands the IRC bot/client allows via private message. public class Test { // make an instance of the high-level API public static IrcClient irc = new IrcClient(); // this method we will use to analyse queries (also known as private messages) public static void OnQueryMessage(object sender, IrcEventArgs e) { switch (e.Data.MessageArray[0]) { // debug stuff case "dump_channel": string requested_channel = e.Data.MessageArray[1]; // getting the channel (via channel sync feature) Channel channel = irc.GetChannel(requested_channel); // here we send messages irc.SendMessage(SendType.Message, e.Data.Nick, ""); irc.SendMessage(SendType.Message, e.Data.Nick, "Name: '"+channel.Name+"'"); irc.SendMessage(SendType.Message, e.Data.Nick, "Topic: '"+channel.Topic+"'"); irc.SendMessage(SendType.Message, e.Data.Nick, "Mode: '"+channel.Mode+"'"); irc.SendMessage(SendType.Message, e.Data.Nick, "Key: '"+channel.Key+"'"); irc.SendMessage(SendType.Message, e.Data.Nick, "UserLimit: '"+channel.UserLimit+"'"); // here we go through all users of the channel and show their // hashtable key and nickname string nickname_list = ""; nickname_list += "Users: "; foreach (DictionaryEntry de in channel.Users) { string key = (string)de.Key; ChannelUser channeluser = (ChannelUser)de.Value; nickname_list += "("; if (channeluser.IsOp) { nickname_list += "@"; } if (channeluser.IsVoice) { nickname_list += "+"; } nickname_list += ")"+key+" => "+channeluser.Nick+", "; } irc.SendMessage(SendType.Message, e.Data.Nick, nickname_list); irc.SendMessage(SendType.Message, e.Data.Nick, ""); break; case "gc": GC.Collect(); break; // typical commands case "join": irc.RfcJoin(e.Data.MessageArray[1]); break; case "part": irc.RfcPart(e.Data.MessageArray[1]); break; case "die": Exit(); break; } } // this method handles when we receive "ERROR" from the IRC server public static void OnError(object sender, ErrorEventArgs e) { System.Console.WriteLine("Error: "+e.ErrorMessage); Exit(); } // this method will get all IRC messages public static void OnRawMessage(object sender, IrcEventArgs e) { System.Console.WriteLine("Received: "+e.Data.RawMessage); } public static void Main(string[] args) { Thread.CurrentThread.Name = "Main"; // UTF-8 test irc.Encoding = System.Text.Encoding.UTF8; // wait time between messages, we can set this lower on own irc servers irc.SendDelay = 200; // we use channel sync, means we can use irc.GetChannel() and so on irc.ActiveChannelSyncing = true; // here we connect the events of the API to our written methods // most have own event handler types, because they ship different data irc.OnQueryMessage += new IrcEventHandler(OnQueryMessage); irc.OnError += new ErrorEventHandler(OnError); irc.OnRawMessage += new IrcEventHandler(OnRawMessage); string[] serverlist; // the server we want to connect to, could be also a simple string serverlist = new string[] {"irc.freenode.org"}; int port = 6667; string channel = "#smartirc-test"; try { // here we try to connect to the server and exceptions get handled irc.Connect(serverlist, port); } catch (ConnectionException e) { // something went wrong, the reason will be shown System.Console.WriteLine("couldn't connect! Reason: "+e.Message); Exit(); } try { // here we logon and register our nickname and so on irc.Login("SmartIRC", "SmartIrc4net Test Bot"); // join the channel irc.RfcJoin(channel); for (int i = 0; i < 3; i++) { // here we send just 3 different types of messages, 3 times for // testing the delay and flood protection (messagebuffer work) irc.SendMessage(SendType.Message, channel, "test message ("+i.ToString()+")"); irc.SendMessage(SendType.Action, channel, "thinks this is cool ("+i.ToString()+")"); irc.SendMessage(SendType.Notice, channel, "SmartIrc4net rocks ("+i.ToString()+")"); } // spawn a new thread to read the stdin of the console, this we use // for reading IRC commands from the keyboard while the IRC connection // stays in its own thread new Thread(new ThreadStart(ReadCommands)).Start(); // here we tell the IRC API to go into a receive mode, all events // will be triggered by _this_ thread (main thread in this case) // Listen() blocks by default, you can also use ListenOnce() if you // need that does one IRC operation and then returns, so you need then // an own loop irc.Listen(); // when Listen() returns our IRC session is over, to be sure we call // disconnect manually irc.Disconnect(); } catch (ConnectionException) { // this exception is handled because Disconnect() can throw a not // connected exception Exit(); } catch (Exception e) { // this should not happen by just in case we handle it nicely System.Console.WriteLine("Error occurred! Message: "+e.Message); System.Console.WriteLine("Exception: "+e.StackTrace); Exit(); } } public static void ReadCommands() { // here we read the commands from the stdin and send it to the IRC API // WARNING, it uses WriteLine() means you need to enter RFC commands // like "JOIN #test" and then "PRIVMSG #test :hello to you" while (true) { string cmd = System.Console.ReadLine(); if (cmd.StartsWith("/list")) { int pos = cmd.IndexOf(" "); string channel = null; if (pos != -1) { channel = cmd.Substring(pos + 1); } IList channelInfos = irc.GetChannelList(channel); Console.WriteLine("channel count: {0}", channelInfos.Count); foreach (ChannelInfo channelInfo in channelInfos) { Console.WriteLine("channel: {0} user count: {1} topic: {2}", channelInfo.Channel, channelInfo.UserCount, channelInfo.Topic); } } else { irc.WriteLine(cmd); } } } public static void Exit() { // we are done, lets exit... System.Console.WriteLine("Exiting..."); System.Environment.Exit(0); } } smuxi-0.11/lib/SmartIrc4net/SmartIrc4net.csproj0000644000175000017500000001004512253423361022225 0ustar00meebeymeebey00000000000000 Debug AnyCPU 10.0.0 2.0 {91D3003B-7E65-4EAF-8EE1-DA43832E7A9C} Library SmartIrc4net Meebey.SmartIrc4net true full false bin\debug TRACE;DEBUG;LOG4NET;NET_2_0 prompt 4 true false false none true bin\release NET_2_0 prompt 4 false false log4net False {3F8CF2C1-EA37-444F-8693-A3A00B1131D2} StarkSoftProxy smuxi-0.11/lib/SmartIrc4net/src/0000755000175000017500000000000012253423361017253 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/src/IrcCommands/0000755000175000017500000000000012253423361021452 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/src/IrcCommands/Rfc2812.cs0000644000175000017500000004563211655552514023052 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Text; using System.Globalization; using System.Text.RegularExpressions; namespace Meebey.SmartIrc4net { /// /// /// /// public sealed class Rfc2812 { // nickname = ( letter / special ) *8( letter / digit / special / "-" ) // letter = %x41-5A / %x61-7A ; A-Z / a-z // digit = %x30-39 ; 0-9 // special = %x5B-60 / %x7B-7D // ; "[", "]", "\", "`", "_", "^", "{", "|", "}" private static Regex _NicknameRegex = new Regex(@"^[A-Za-z\[\]\\`_^{|}][A-Za-z0-9\[\]\\`_\-^{|}]+$", RegexOptions.Compiled); private Rfc2812() { } /// /// Checks if the passed nickname is valid according to the RFC /// /// Use with caution, many IRC servers are not conform with this! /// public static bool IsValidNickname(string nickname) { if ((nickname != null) && (nickname.Length > 0) && (_NicknameRegex.Match(nickname).Success)) { return true; } return false; } public static string Pass(string password) { return "PASS "+password; } public static string Nick(string nickname) { return "NICK "+nickname; } public static string User(string username, int usermode, string realname) { return "USER "+username+" "+usermode.ToString()+" * :"+realname; } public static string Oper(string name, string password) { return "OPER "+name+" "+password; } public static string Privmsg(string destination, string message) { return "PRIVMSG "+destination+" :"+message; } public static string Notice(string destination, string message) { return "NOTICE "+destination+" :"+message; } public static string Join(string channel) { return "JOIN "+channel; } public static string Join(string[] channels) { string channellist = String.Join(",", channels); return "JOIN "+channellist; } public static string Join(string channel, string key) { return "JOIN "+channel+" "+key; } public static string Join(string[] channels, string[] keys) { string channellist = String.Join(",", channels); string keylist = String.Join(",", keys); return "JOIN "+channellist+" "+keylist; } public static string Part(string channel) { return "PART "+channel; } public static string Part(string[] channels) { string channellist = String.Join(",", channels); return "PART "+channellist; } public static string Part(string channel, string partmessage) { return "PART "+channel+" :"+partmessage; } public static string Part(string[] channels, string partmessage) { string channellist = String.Join(",", channels); return "PART "+channellist+" :"+partmessage; } public static string Kick(string channel, string nickname) { return "KICK "+channel+" "+nickname; } public static string Kick(string channel, string nickname, string comment) { return "KICK "+channel+" "+nickname+" :"+comment; } public static string Kick(string[] channels, string nickname) { string channellist = String.Join(",", channels); return "KICK "+channellist+" "+nickname; } public static string Kick(string[] channels, string nickname, string comment) { string channellist = String.Join(",", channels); return "KICK "+channellist+" "+nickname+" :"+comment; } public static string Kick(string channel, string[] nicknames) { string nicknamelist = String.Join(",", nicknames); return "KICK "+channel+" "+nicknamelist; } public static string Kick(string channel, string[] nicknames, string comment) { string nicknamelist = String.Join(",", nicknames); return "KICK "+channel+" "+nicknamelist+" :"+comment; } public static string Kick(string[] channels, string[] nicknames) { string channellist = String.Join(",", channels); string nicknamelist = String.Join(",", nicknames); return "KICK "+channellist+" "+nicknamelist; } public static string Kick(string[] channels, string[] nicknames, string comment) { string channellist = String.Join(",", channels); string nicknamelist = String.Join(",", nicknames); return "KICK "+channellist+" "+nicknamelist+" :"+comment; } public static string Motd() { return "MOTD"; } public static string Motd(string target) { return "MOTD "+target; } [Obsolete("use Lusers() method instead")] public static string Luser() { return Lusers(); } public static string Lusers() { return "LUSERS"; } [Obsolete("use Lusers(string) method instead")] public static string Luser(string mask) { return Lusers(mask); } public static string Lusers(string mask) { return "LUSER "+mask; } [Obsolete("use Lusers(string, string) method instead")] public static string Luser(string mask, string target) { return Lusers(mask, target); } public static string Lusers(string mask, string target) { return "LUSER "+mask+" "+target; } public static string Version() { return "VERSION"; } public static string Version(string target) { return "VERSION "+target; } public static string Stats() { return "STATS"; } public static string Stats(string query) { return "STATS "+query; } public static string Stats(string query, string target) { return "STATS "+query+" "+target; } public static string Links() { return "LINKS"; } public static string Links(string servermask) { return "LINKS "+servermask; } public static string Links(string remoteserver, string servermask) { return "LINKS "+remoteserver+" "+servermask; } public static string Time() { return "TIME"; } public static string Time(string target) { return "TIME "+target; } public static string Connect(string targetserver, string port) { return "CONNECT "+targetserver+" "+port; } public static string Connect(string targetserver, string port, string remoteserver) { return "CONNECT "+targetserver+" "+port+" "+remoteserver; } public static string Trace() { return "TRACE"; } public static string Trace(string target) { return "TRACE "+target; } public static string Admin() { return "ADMIN"; } public static string Admin(string target) { return "ADMIN "+target; } public static string Info() { return "INFO"; } public static string Info(string target) { return "INFO "+target; } public static string Servlist() { return "SERVLIST"; } public static string Servlist(string mask) { return "SERVLIST "+mask; } public static string Servlist(string mask, string type) { return "SERVLIST "+mask+" "+type; } public static string Squery(string servicename, string servicetext) { return "SQUERY "+servicename+" :"+servicetext; } public static string List() { return "LIST"; } public static string List(string channel) { return "LIST "+channel; } public static string List(string[] channels) { string channellist = String.Join(",", channels); return "LIST "+channellist; } public static string List(string channel, string target) { return "LIST "+channel+" "+target; } public static string List(string[] channels, string target) { string channellist = String.Join(",", channels); return "LIST "+channellist+" "+target; } public static string Names() { return "NAMES"; } public static string Names(string channel) { return "NAMES "+channel; } public static string Names(string[] channels) { string channellist = String.Join(",", channels); return "NAMES "+channellist; } public static string Names(string channel, string target) { return "NAMES "+channel+" "+target; } public static string Names(string[] channels, string target) { string channellist = String.Join(",", channels); return "NAMES "+channellist+" "+target; } public static string Topic(string channel) { return "TOPIC "+channel; } public static string Topic(string channel, string newtopic) { return "TOPIC "+channel+" :"+newtopic; } public static string Mode(string target) { return "MODE "+target; } public static string Mode(string target, string newmode) { return "MODE "+target+" "+newmode; } public static string Mode(string target, string[] newModes, string[] newModeParameters) { if (newModes == null) { throw new ArgumentNullException("newModes"); } if (newModeParameters == null) { throw new ArgumentNullException("newModeParameters"); } if (newModes.Length != newModeParameters.Length) { throw new ArgumentException("newModes and newModeParameters must have the same size."); } StringBuilder newMode = new StringBuilder(newModes.Length); StringBuilder newModeParameter = new StringBuilder(); // as per RFC 3.2.3, maximum is 3 modes changes at once int maxModeChanges = 3; if (newModes.Length > maxModeChanges) { throw new ArgumentOutOfRangeException( "newModes.Length", newModes.Length, String.Format("Mode change list is too large (> {0}).", maxModeChanges) ); } for (int i = 0; i <= newModes.Length; i += maxModeChanges) { for (int j = 0; j < maxModeChanges; j++) { if (i + j >= newModes.Length) { break; } newMode.Append(newModes[i + j]); } for (int j = 0; j < maxModeChanges; j++) { if (i + j >= newModeParameters.Length) { break; } newModeParameter.Append(newModeParameters[i + j]); newModeParameter.Append(" "); } } if (newModeParameter.Length > 0) { // remove trailing space newModeParameter.Length--; newMode.Append(" "); newMode.Append(newModeParameter.ToString()); } return Mode(target, newMode.ToString()); } public static string Service(string nickname, string distribution, string info) { return "SERVICE "+nickname+" * "+distribution+" * * :"+info; } public static string Invite(string nickname, string channel) { return "INVITE "+nickname+" "+channel; } public static string Who() { return "WHO"; } public static string Who(string mask) { return "WHO "+mask; } public static string Who(string mask, bool ircop) { if (ircop) { return "WHO "+mask+" o"; } else { return "WHO "+mask; } } public static string Whois(string mask) { return "WHOIS "+mask; } public static string Whois(string[] masks) { string masklist = String.Join(",", masks); return "WHOIS "+masklist; } public static string Whois(string target, string mask) { return "WHOIS "+target+" "+mask; } public static string Whois(string target, string[] masks) { string masklist = String.Join(",", masks); return "WHOIS "+target+" "+masklist; } public static string Whowas(string nickname) { return "WHOWAS "+nickname; } public static string Whowas(string[] nicknames) { string nicknamelist = String.Join(",", nicknames); return "WHOWAS "+nicknamelist; } public static string Whowas(string nickname, string count) { return "WHOWAS "+nickname+" "+count+" "; } public static string Whowas(string[] nicknames, string count) { string nicknamelist = String.Join(",", nicknames); return "WHOWAS "+nicknamelist+" "+count+" "; } public static string Whowas(string nickname, string count, string target) { return "WHOWAS "+nickname+" "+count+" "+target; } public static string Whowas(string[] nicknames, string count, string target) { string nicknamelist = String.Join(",", nicknames); return "WHOWAS "+nicknamelist+" "+count+" "+target; } public static string Kill(string nickname, string comment) { return "KILL "+nickname+" :"+comment; } public static string Ping(string server) { return "PING "+server; } public static string Ping(string server, string server2) { return "PING "+server+" "+server2; } public static string Pong(string server) { return "PONG "+server; } public static string Pong(string server, string server2) { return "PONG "+server+" "+server2; } public static string Error(string errormessage) { return "ERROR :"+errormessage; } public static string Away() { return "AWAY"; } public static string Away(string awaytext) { return "AWAY :"+awaytext; } public static string Rehash() { return "REHASH"; } public static string Die() { return "DIE"; } public static string Restart() { return "RESTART"; } public static string Summon(string user) { return "SUMMON "+user; } public static string Summon(string user, string target) { return "SUMMON "+user+" "+target; } public static string Summon(string user, string target, string channel) { return "SUMMON "+user+" "+target+" "+channel; } public static string Users() { return "USERS"; } public static string Users(string target) { return "USERS "+target; } public static string Wallops(string wallopstext) { return "WALLOPS :"+wallopstext; } public static string Userhost(string nickname) { return "USERHOST "+nickname; } public static string Userhost(string[] nicknames) { string nicknamelist = String.Join(" ", nicknames); return "USERHOST "+nicknamelist; } public static string Ison(string nickname) { return "ISON "+nickname; } public static string Ison(string[] nicknames) { string nicknamelist = String.Join(" ", nicknames); return "ISON "+nicknamelist; } public static string Quit() { return "QUIT"; } public static string Quit(string quitmessage) { return "QUIT :"+quitmessage; } public static string Squit(string server, string comment) { return "SQUIT "+server+" :"+comment; } } } smuxi-0.11/lib/SmartIrc4net/src/IrcCommands/IrcCommands.cs0000644000175000017500000022144612253423361024211 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using System.Text; namespace Meebey.SmartIrc4net { /// /// /// /// public class IrcCommands : IrcConnection { private int _MaxModeChanges = 3; protected int MaxModeChanges { get { return _MaxModeChanges; } set { _MaxModeChanges = value; } } #if LOG4NET public IrcCommands() { Logger.Main.Debug("IrcCommands created"); } #endif #if LOG4NET ~IrcCommands() { Logger.Main.Debug("IrcCommands destroyed"); } #endif // API commands /// /// /// /// /// /// /// public void SendMessage(SendType type, string destination, string message, Priority priority) { switch(type) { case SendType.Message: RfcPrivmsg(destination, message, priority); break; case SendType.Action: RfcPrivmsg(destination, "\x1"+"ACTION "+message+"\x1", priority); break; case SendType.Notice: RfcNotice(destination, message, priority); break; case SendType.CtcpRequest: RfcPrivmsg(destination, "\x1"+message+"\x1", priority); break; case SendType.CtcpReply: RfcNotice(destination, "\x1"+message+"\x1", priority); break; } } /// /// /// /// /// /// public void SendMessage(SendType type, string destination, string message) { SendMessage(type, destination, message, Priority.Medium); } /// /// /// /// /// /// public void SendReply(IrcMessageData data, string message, Priority priority) { switch (data.Type) { case ReceiveType.ChannelMessage: SendMessage(SendType.Message, data.Channel, message, priority); break; case ReceiveType.QueryMessage: SendMessage(SendType.Message, data.Nick, message, priority); break; case ReceiveType.QueryNotice: SendMessage(SendType.Notice, data.Nick, message, priority); break; } } /// /// /// /// /// public void SendReply(IrcMessageData data, string message) { SendReply(data, message, Priority.Medium); } /// /// Give or take a user's privilege in a channel. /// /// The mode change (e.g. +o) to perform on the user. /// The channel in which to perform the privilege change. /// The nickname of the user whose privilege is being changed. /// The priority with which the mode-setting message should be sent. public void ChangeChannelPrivilege(string modechg, string channel, string nickname, Priority priority) { WriteLine(Rfc2812.Mode(channel, modechg + " " + nickname), priority); } /// /// Give or take a user's privilege in a channel. /// /// The mode change (e.g. +o) to perform on the user. /// The channel in which to perform the privilege change. /// The nickname of the user whose privilege is being changed. public void ChangeChannelPrivilege(string modechg, string channel, string nickname) { WriteLine(Rfc2812.Mode(channel, modechg + " " + nickname)); } /// /// Give or take a privilege to/from multiple users in a channel. /// /// The mode change (e.g. +o) to perform on the users. /// The channel in which to give the users a privilege. /// The nicknames of the users receiving the privilege. public void ChangeChannelPrivilege(string modechg, string channel, string[] nicknames) { if (nicknames == null) { throw new ArgumentNullException("nicknames"); } string[] modes = new string[nicknames.Length]; for (int i = 0; i < nicknames.Length; i++) { modes[i] = modechg; } Mode(channel, modes, nicknames); } public void Op(string channel, string nickname, Priority priority) { ChangeChannelPrivilege("+o", channel, nickname, priority); } public void Op(string channel, string[] nicknames) { ChangeChannelPrivilege("+o", channel, nicknames); } public void Op(string channel, string nickname) { ChangeChannelPrivilege("+o", channel, nickname); } public void Deop(string channel, string nickname, Priority priority) { ChangeChannelPrivilege("-o", channel, nickname, priority); } public void Deop(string channel, string[] nicknames) { ChangeChannelPrivilege("-o", channel, nicknames); } public void Deop(string channel, string nickname) { ChangeChannelPrivilege("-o", channel, nickname); } public void Voice(string channel, string nickname, Priority priority) { ChangeChannelPrivilege("+v", channel, nickname, priority); } public void Voice(string channel, string[] nicknames) { ChangeChannelPrivilege("+v", channel, nicknames); } public void Voice(string channel, string nickname) { ChangeChannelPrivilege("+v", channel, nickname); } public void Devoice(string channel, string nickname, Priority priority) { ChangeChannelPrivilege("-v", channel, nickname, priority); } public void Devoice(string channel, string[] nicknames) { ChangeChannelPrivilege("-v", channel, nicknames); } public void Devoice(string channel, string nickname) { ChangeChannelPrivilege("-v", channel, nickname); } /// /// Fetch a list of entries of a mask-format channel mode. /// /// The type of the mask-format mode (e.g. +b) to fetch. /// The channel whose mode to fetch. public void ListChannelMasks(string modetype, string channel) { WriteLine(Rfc2812.Mode(channel, modetype)); } /// /// Fetch a list of entries of a mask-format channel mode. /// /// The type of the mask-format mode (e.g. +b) to fetch. /// The channel whose mode to fetch. /// The priority with which the mode-setting message should be sent. public void ListChannelMasks(string modetype, string channel, Priority priority) { WriteLine(Rfc2812.Mode(channel, modetype), priority); } /// /// Add or remove an entry to/from a mask-format channel mode. /// /// The type of the mask-format mode (e.g. +b) whose entries to modify. /// The channel whose mode to edit. /// The hostmask of the entry to add/remove. /// The priority with which the mode-setting message should be sent. public void ModifyChannelMasks(string modetype, string channel, string hostmask, Priority priority) { WriteLine(Rfc2812.Mode(channel, modetype + " " + hostmask), priority); } /// /// Add or remove an entry to/from a mask-format channel mode. /// /// The type of the mask-format mode (e.g. +b) whose entries to modify. /// The channel whose mode to edit. /// The hostmask of the entry to add/remove. public void ModifyChannelMasks(string modetype, string channel, string hostmask) { WriteLine(Rfc2812.Mode(channel, modetype + " " + hostmask)); } /// /// Add or remove multiple entries to/from a mask-format channel mode. /// /// The type of the mask-format mode (e.g. +b) whose entries to modify. /// The channel whose mode to edit. /// The hostmasks of the entries to add/remove. public void ModifyChannelMasks(string modetype, string channel, string[] hostmasks) { if (hostmasks == null) { throw new ArgumentNullException("hostmasks"); } string[] modes = new string[hostmasks.Length]; for (int i = 0; i < hostmasks.Length; i++) { modes[i] = modetype; } Mode(channel, modes, hostmasks); } public void Ban(string channel) { ListChannelMasks("+b", channel); } public void Ban(string channel, string hostmask, Priority priority) { ModifyChannelMasks("+b", channel, hostmask, priority); } public void Ban(string channel, string hostmask) { ModifyChannelMasks("+b", channel, hostmask); } public void Ban(string channel, string[] hostmasks) { ModifyChannelMasks("+b", channel, hostmasks); } public void Unban(string channel, string hostmask, Priority priority) { ModifyChannelMasks("-b", channel, hostmask, priority); } public void Unban(string channel, string hostmask) { ModifyChannelMasks("-b", channel, hostmask); } public void Unban(string channel, string[] hostmasks) { ModifyChannelMasks("-b", channel, hostmasks); } public virtual void BanException(string channel) { ListChannelMasks("+e", channel); } public virtual void BanException(string channel, string hostmask, Priority priority) { ModifyChannelMasks("+e", channel, hostmask, priority); } public virtual void BanException(string channel, string hostmask) { ModifyChannelMasks("+e", channel, hostmask); } public virtual void BanException(string channel, string[] hostmasks) { ModifyChannelMasks("+e", channel, hostmasks); } public virtual void UnBanException(string channel, string hostmask, Priority priority) { ModifyChannelMasks("-e", channel, hostmask, priority); } public virtual void UnBanException(string channel, string hostmask) { ModifyChannelMasks("-e", channel, hostmask); } public virtual void UnBanException(string channel, string[] hostmasks) { ModifyChannelMasks("-e", channel, hostmasks); } public virtual void InviteException(string channel) { ListChannelMasks("+I", channel); } public virtual void InviteException(string channel, string hostmask, Priority priority) { ModifyChannelMasks("+I", channel, hostmask, priority); } public virtual void InviteException(string channel, string hostmask) { ModifyChannelMasks("+I", channel, hostmask); } public virtual void InviteException(string channel, string[] hostmasks) { ModifyChannelMasks("+I", channel, hostmasks); } public virtual void UnInviteException(string channel, string hostmask, Priority priority) { ModifyChannelMasks("-I", channel, hostmask, priority); } public virtual void UnInviteException(string channel, string hostmask) { ModifyChannelMasks("-I", channel, hostmask); } public virtual void UnInviteException(string channel, string[] hostmasks) { ModifyChannelMasks("-I", channel, hostmasks); } // non-RFC commands public void Owner(string channel, string nickname, Priority priority) { ChangeChannelPrivilege("+q", channel, nickname, priority); } public void Owner(string channel, string[] nicknames) { ChangeChannelPrivilege("+q", channel, nicknames); } public void Owner(string channel, string nickname) { ChangeChannelPrivilege("+q", channel, nickname); } public void Deowner(string channel, string nickname, Priority priority) { ChangeChannelPrivilege("-q", channel, nickname, priority); } public void Deowner(string channel, string[] nicknames) { ChangeChannelPrivilege("-q", channel, nicknames); } public void Deowner(string channel, string nickname) { ChangeChannelPrivilege("-q", channel, nickname); } public void ChanAdmin(string channel, string nickname, Priority priority) { ChangeChannelPrivilege("+a", channel, nickname, priority); } public void ChanAdmin(string channel, string[] nicknames) { ChangeChannelPrivilege("+a", channel, nicknames); } public void ChanAdmin(string channel, string nickname) { ChangeChannelPrivilege("+a", channel, nickname); } public void DeChanAdmin(string channel, string nickname, Priority priority) { ChangeChannelPrivilege("-a", channel, nickname, priority); } public void DeChanAdmin(string channel, string[] nicknames) { ChangeChannelPrivilege("-a", channel, nicknames); } public void DeChanAdmin(string channel, string nickname) { ChangeChannelPrivilege("-a", channel, nickname); } public void Halfop(string channel, string nickname, Priority priority) { ChangeChannelPrivilege("+h", channel, nickname, priority); } public void Halfop(string channel, string[] nicknames) { ChangeChannelPrivilege("+h", channel, nicknames); } public void Halfop(string channel, string nickname) { ChangeChannelPrivilege("+h", channel, nickname); } public void Dehalfop(string channel, string nickname, Priority priority) { ChangeChannelPrivilege("-h", channel, nickname, priority); } public void Dehalfop(string channel, string[] nicknames) { ChangeChannelPrivilege("-h", channel, nicknames); } public void Dehalfop(string channel, string nickname) { ChangeChannelPrivilege("-h", channel, nickname); } /// /// /// /// /// /// public void Mode(string target, string[] newModes, string[] newModeParameters) { if (target == null) { throw new ArgumentNullException("target"); } if (newModes == null) { throw new ArgumentNullException("newModes"); } if (newModeParameters == null) { throw new ArgumentNullException("newModeParameters"); } if (newModes.Length == 0) { throw new ArgumentException("newModes must not be empty." , "newModes"); } if (newModeParameters.Length == 0) { throw new ArgumentException("newModeParameters must not be empty." , "newModeParameters"); } if (newModes.Length != newModeParameters.Length) { throw new ArgumentException("newModes and newModeParameters must have the same size.", "newModes"); } int maxModeChanges = _MaxModeChanges; for (int i = 0; i < newModes.Length; i += maxModeChanges) { var newModeChunks = new List(maxModeChanges); var newModeParameterChunks = new List(maxModeChanges); for (int j = 0; j < maxModeChanges; j++) { if (i + j >= newModes.Length) { break; } newModeChunks.Add(newModes[i + j]); newModeParameterChunks.Add(newModeParameters[i + j]); } WriteLine(Rfc2812.Mode(target, newModeChunks.ToArray(), newModeParameterChunks.ToArray())); } } #region RFC commands /// /// /// /// /// public void RfcPass(string password, Priority priority) { WriteLine(Rfc2812.Pass(password), priority); } /// /// /// /// public void RfcPass(string password) { WriteLine(Rfc2812.Pass(password)); } /// /// /// /// /// /// /// public void RfcUser(string username, int usermode, string realname, Priority priority) { WriteLine(Rfc2812.User(username, usermode, realname), priority); } /// /// /// /// /// /// public void RfcUser(string username, int usermode, string realname) { WriteLine(Rfc2812.User(username, usermode, realname)); } /// /// /// /// /// /// public void RfcOper(string name, string password, Priority priority) { WriteLine(Rfc2812.Oper(name, password), priority); } /// /// /// /// /// public void RfcOper(string name, string password) { WriteLine(Rfc2812.Oper(name, password)); } /// /// /// /// /// /// public void RfcPrivmsg(string destination, string message, Priority priority) { WriteLine(Rfc2812.Privmsg(destination, message), priority); } /// /// /// /// /// public void RfcPrivmsg(string destination, string message) { WriteLine(Rfc2812.Privmsg(destination, message)); } /// /// /// /// /// /// public void RfcNotice(string destination, string message, Priority priority) { WriteLine(Rfc2812.Notice(destination, message), priority); } /// /// /// /// /// public void RfcNotice(string destination, string message) { WriteLine(Rfc2812.Notice(destination, message)); } /// /// /// /// /// public void RfcJoin(string channel, Priority priority) { WriteLine(Rfc2812.Join(channel), priority); } /// /// /// /// public void RfcJoin(string channel) { WriteLine(Rfc2812.Join(channel)); } /// /// /// /// /// public void RfcJoin(string[] channels, Priority priority) { WriteLine(Rfc2812.Join(channels), priority); } /// /// /// /// public void RfcJoin(string[] channels) { WriteLine(Rfc2812.Join(channels)); } /// /// /// /// /// /// public void RfcJoin(string channel, string key, Priority priority) { WriteLine(Rfc2812.Join(channel, key), priority); } /// /// /// /// /// public void RfcJoin(string channel, string key) { WriteLine(Rfc2812.Join(channel, key)); } /// /// /// /// /// /// public void RfcJoin(string[] channels, string[] keys, Priority priority) { WriteLine(Rfc2812.Join(channels, keys), priority); } /// /// /// /// /// public void RfcJoin(string[] channels, string[] keys) { WriteLine(Rfc2812.Join(channels, keys)); } /// /// /// /// /// public void RfcPart(string channel, Priority priority) { WriteLine(Rfc2812.Part(channel), priority); } /// /// /// /// public void RfcPart(string channel) { WriteLine(Rfc2812.Part(channel)); } /// /// /// /// /// public void RfcPart(string[] channels, Priority priority) { WriteLine(Rfc2812.Part(channels), priority); } /// /// /// /// public void RfcPart(string[] channels) { WriteLine(Rfc2812.Part(channels)); } /// /// /// /// /// /// public void RfcPart(string channel, string partmessage, Priority priority) { WriteLine(Rfc2812.Part(channel, partmessage), priority); } /// /// /// /// /// public void RfcPart(string channel, string partmessage) { WriteLine(Rfc2812.Part(channel, partmessage)); } /// /// /// /// /// /// public void RfcPart(string[] channels, string partmessage, Priority priority) { WriteLine(Rfc2812.Part(channels, partmessage), priority); } /// /// /// /// /// public void RfcPart(string[] channels, string partmessage) { WriteLine(Rfc2812.Part(channels, partmessage)); } /// /// /// /// /// /// public void RfcKick(string channel, string nickname, Priority priority) { WriteLine(Rfc2812.Kick(channel, nickname), priority); } /// /// /// /// /// public void RfcKick(string channel, string nickname) { WriteLine(Rfc2812.Kick(channel, nickname)); } /// /// /// /// /// /// public void RfcKick(string[] channels, string nickname, Priority priority) { WriteLine(Rfc2812.Kick(channels, nickname), priority); } /// /// /// /// /// public void RfcKick(string[] channels, string nickname) { WriteLine(Rfc2812.Kick(channels, nickname)); } /// /// /// /// /// /// public void RfcKick(string channel, string[] nicknames, Priority priority) { WriteLine(Rfc2812.Kick(channel, nicknames), priority); } /// /// /// /// /// public void RfcKick(string channel, string[] nicknames) { WriteLine(Rfc2812.Kick(channel, nicknames)); } /// /// /// /// /// /// public void RfcKick(string[] channels, string[] nicknames, Priority priority) { WriteLine(Rfc2812.Kick(channels, nicknames), priority); } /// /// /// /// /// public void RfcKick(string[] channels, string[] nicknames) { WriteLine(Rfc2812.Kick(channels, nicknames)); } /// /// /// /// /// /// /// public void RfcKick(string channel, string nickname, string comment, Priority priority) { WriteLine(Rfc2812.Kick(channel, nickname, comment), priority); } /// /// /// /// /// /// public void RfcKick(string channel, string nickname, string comment) { WriteLine(Rfc2812.Kick(channel, nickname, comment)); } /// /// /// /// /// /// /// public void RfcKick(string[] channels, string nickname, string comment, Priority priority) { WriteLine(Rfc2812.Kick(channels, nickname, comment), priority); } /// /// /// /// /// /// public void RfcKick(string[] channels, string nickname, string comment) { WriteLine(Rfc2812.Kick(channels, nickname, comment)); } /// /// /// /// /// /// /// public void RfcKick(string channel, string[] nicknames, string comment, Priority priority) { WriteLine(Rfc2812.Kick(channel, nicknames, comment), priority); } /// /// /// /// /// /// public void RfcKick(string channel, string[] nicknames, string comment) { WriteLine(Rfc2812.Kick(channel, nicknames, comment)); } /// /// /// /// /// /// /// public void RfcKick(string[] channels, string[] nicknames, string comment, Priority priority) { WriteLine(Rfc2812.Kick(channels, nicknames, comment), priority); } /// /// /// /// /// /// public void RfcKick(string[] channels, string[] nicknames, string comment) { WriteLine(Rfc2812.Kick(channels, nicknames, comment)); } /// /// /// /// public void RfcMotd(Priority priority) { WriteLine(Rfc2812.Motd(), priority); } /// /// /// public void RfcMotd() { WriteLine(Rfc2812.Motd()); } /// /// /// /// /// public void RfcMotd(string target, Priority priority) { WriteLine(Rfc2812.Motd(target), priority); } /// /// /// /// public void RfcMotd(string target) { WriteLine(Rfc2812.Motd(target)); } /// /// /// /// [Obsolete("use RfcLusers(Priority) instead")] public void RfcLuser(Priority priority) { RfcLusers(priority); } public void RfcLusers(Priority priority) { WriteLine(Rfc2812.Lusers(), priority); } /// /// /// [Obsolete("use RfcLusers() instead")] public void RfcLuser() { RfcLusers(); } public void RfcLusers() { WriteLine(Rfc2812.Lusers()); } /// /// /// /// /// [Obsolete("use RfcLusers(string, Priority) instead")] public void RfcLuser(string mask, Priority priority) { RfcLusers(mask, priority); } public void RfcLusers(string mask, Priority priority) { WriteLine(Rfc2812.Lusers(mask), priority); } /// /// /// /// [Obsolete("use RfcLusers(string) instead")] public void RfcLuser(string mask) { RfcLusers(mask); } public void RfcLusers(string mask) { WriteLine(Rfc2812.Lusers(mask)); } /// /// /// /// /// /// [Obsolete("use RfcLusers(string, string, Priority) instead")] public void RfcLuser(string mask, string target, Priority priority) { RfcLusers(mask, target, priority); } public void RfcLusers(string mask, string target, Priority priority) { WriteLine(Rfc2812.Lusers(mask, target), priority); } /// /// /// /// /// [Obsolete("use RfcLusers(string, string) instead")] public void RfcLuser(string mask, string target) { RfcLusers(mask, target); } public void RfcLusers(string mask, string target) { WriteLine(Rfc2812.Lusers(mask, target)); } /// /// /// /// public void RfcVersion(Priority priority) { WriteLine(Rfc2812.Version(), priority); } /// /// /// public void RfcVersion() { WriteLine(Rfc2812.Version()); } /// /// /// /// /// public void RfcVersion(string target, Priority priority) { WriteLine(Rfc2812.Version(target), priority); } /// /// /// /// public void RfcVersion(string target) { WriteLine(Rfc2812.Version(target)); } /// /// /// /// public void RfcStats(Priority priority) { WriteLine(Rfc2812.Stats(), priority); } /// /// /// public void RfcStats() { WriteLine(Rfc2812.Stats()); } /// /// /// /// /// public void RfcStats(string query, Priority priority) { WriteLine(Rfc2812.Stats(query), priority); } /// /// /// /// public void RfcStats(string query) { WriteLine(Rfc2812.Stats(query)); } /// /// /// /// /// /// public void RfcStats(string query, string target, Priority priority) { WriteLine(Rfc2812.Stats(query, target), priority); } /// /// /// /// /// public void RfcStats(string query, string target) { WriteLine(Rfc2812.Stats(query, target)); } /// /// /// public void RfcLinks() { WriteLine(Rfc2812.Links()); } /// /// /// /// /// public void RfcLinks(string servermask, Priority priority) { WriteLine(Rfc2812.Links(servermask), priority); } /// /// /// /// public void RfcLinks(string servermask) { WriteLine(Rfc2812.Links(servermask)); } /// /// /// /// /// /// public void RfcLinks(string remoteserver, string servermask, Priority priority) { WriteLine(Rfc2812.Links(remoteserver, servermask), priority); } /// /// /// /// /// public void RfcLinks(string remoteserver, string servermask) { WriteLine(Rfc2812.Links(remoteserver, servermask)); } /// /// /// /// public void RfcTime(Priority priority) { WriteLine(Rfc2812.Time(), priority); } /// /// /// public void RfcTime() { WriteLine(Rfc2812.Time()); } /// /// /// /// /// public void RfcTime(string target, Priority priority) { WriteLine(Rfc2812.Time(target), priority); } /// /// /// /// public void RfcTime(string target) { WriteLine(Rfc2812.Time(target)); } /// /// /// /// /// /// public void RfcConnect(string targetserver, string port, Priority priority) { WriteLine(Rfc2812.Connect(targetserver, port), priority); } /// /// /// /// /// public void RfcConnect(string targetserver, string port) { WriteLine(Rfc2812.Connect(targetserver, port)); } /// /// /// /// /// /// /// public void RfcConnect(string targetserver, string port, string remoteserver, Priority priority) { WriteLine(Rfc2812.Connect(targetserver, port, remoteserver), priority); } /// /// /// /// /// /// public void RfcConnect(string targetserver, string port, string remoteserver) { WriteLine(Rfc2812.Connect(targetserver, port, remoteserver)); } /// /// /// /// public void RfcTrace(Priority priority) { WriteLine(Rfc2812.Trace(), priority); } /// /// /// public void RfcTrace() { WriteLine(Rfc2812.Trace()); } /// /// /// /// /// public void RfcTrace(string target, Priority priority) { WriteLine(Rfc2812.Trace(target), priority); } /// /// /// /// public void RfcTrace(string target) { WriteLine(Rfc2812.Trace(target)); } /// /// /// /// public void RfcAdmin(Priority priority) { WriteLine(Rfc2812.Admin(), priority); } /// /// /// public void RfcAdmin() { WriteLine(Rfc2812.Admin()); } /// /// /// /// /// public void RfcAdmin(string target, Priority priority) { WriteLine(Rfc2812.Admin(target), priority); } /// /// /// /// public void RfcAdmin(string target) { WriteLine(Rfc2812.Admin(target)); } /// /// /// /// public void RfcInfo(Priority priority) { WriteLine(Rfc2812.Info(), priority); } /// /// /// public void RfcInfo() { WriteLine(Rfc2812.Info()); } /// /// /// /// /// public void RfcInfo(string target, Priority priority) { WriteLine(Rfc2812.Info(target), priority); } /// /// /// /// public void RfcInfo(string target) { WriteLine(Rfc2812.Info(target)); } /// /// /// /// public void RfcServlist(Priority priority) { WriteLine(Rfc2812.Servlist(), priority); } /// /// /// public void RfcServlist() { WriteLine(Rfc2812.Servlist()); } /// /// /// /// /// public void RfcServlist(string mask, Priority priority) { WriteLine(Rfc2812.Servlist(mask), priority); } /// /// /// /// public void RfcServlist(string mask) { WriteLine(Rfc2812.Servlist(mask)); } /// /// /// /// /// /// public void RfcServlist(string mask, string type, Priority priority) { WriteLine(Rfc2812.Servlist(mask, type), priority); } /// /// /// /// /// public void RfcServlist(string mask, string type) { WriteLine(Rfc2812.Servlist(mask, type)); } /// /// /// /// /// /// public void RfcSquery(string servicename, string servicetext, Priority priority) { WriteLine(Rfc2812.Squery(servicename, servicetext), priority); } /// /// /// /// /// public void RfcSquery(string servicename, string servicetext) { WriteLine(Rfc2812.Squery(servicename, servicetext)); } /// /// /// /// /// public void RfcList(string channel, Priority priority) { WriteLine(Rfc2812.List(channel), priority); } /// /// /// /// public void RfcList(string channel) { WriteLine(Rfc2812.List(channel)); } /// /// /// /// /// public void RfcList(string[] channels, Priority priority) { WriteLine(Rfc2812.List(channels), priority); } /// /// /// /// public void RfcList(string[] channels) { WriteLine(Rfc2812.List(channels)); } /// /// /// /// /// /// public void RfcList(string channel, string target, Priority priority) { WriteLine(Rfc2812.List(channel, target), priority); } /// /// /// /// /// public void RfcList(string channel, string target) { WriteLine(Rfc2812.List(channel, target)); } /// /// /// /// /// /// public void RfcList(string[] channels, string target, Priority priority) { WriteLine(Rfc2812.List(channels, target), priority); } /// /// /// /// /// public void RfcList(string[] channels, string target) { WriteLine(Rfc2812.List(channels, target)); } /// /// /// /// /// public void RfcNames(string channel, Priority priority) { WriteLine(Rfc2812.Names(channel), priority); } /// /// /// /// public void RfcNames(string channel) { WriteLine(Rfc2812.Names(channel)); } /// /// /// /// /// public void RfcNames(string[] channels, Priority priority) { WriteLine(Rfc2812.Names(channels), priority); } /// /// /// /// public void RfcNames(string[] channels) { WriteLine(Rfc2812.Names(channels)); } /// /// /// /// /// /// public void RfcNames(string channel, string target, Priority priority) { WriteLine(Rfc2812.Names(channel, target), priority); } /// /// /// /// /// public void RfcNames(string channel, string target) { WriteLine(Rfc2812.Names(channel, target)); } /// /// /// /// /// /// public void RfcNames(string[] channels, string target, Priority priority) { WriteLine(Rfc2812.Names(channels, target), priority); } /// /// /// /// /// public void RfcNames(string[] channels, string target) { WriteLine(Rfc2812.Names(channels, target)); } /// /// /// /// /// public void RfcTopic(string channel, Priority priority) { WriteLine(Rfc2812.Topic(channel), priority); } /// /// /// /// public void RfcTopic(string channel) { WriteLine(Rfc2812.Topic(channel)); } /// /// /// /// /// /// public void RfcTopic(string channel, string newtopic, Priority priority) { WriteLine(Rfc2812.Topic(channel, newtopic), priority); } /// /// /// /// /// public void RfcTopic(string channel, string newtopic) { WriteLine(Rfc2812.Topic(channel, newtopic)); } /// /// /// /// /// public void RfcMode(string target, Priority priority) { WriteLine(Rfc2812.Mode(target), priority); } /// /// /// /// public void RfcMode(string target) { WriteLine(Rfc2812.Mode(target)); } /// /// /// /// /// /// public void RfcMode(string target, string newmode, Priority priority) { WriteLine(Rfc2812.Mode(target, newmode), priority); } /// /// /// /// /// public void RfcMode(string target, string newmode) { WriteLine(Rfc2812.Mode(target, newmode)); } /// /// /// /// /// /// /// public void RfcService(string nickname, string distribution, string info, Priority priority) { WriteLine(Rfc2812.Service(nickname, distribution, info), priority); } /// /// /// /// /// /// public void RfcService(string nickname, string distribution, string info) { WriteLine(Rfc2812.Service(nickname, distribution, info)); } /// /// /// /// /// /// public void RfcInvite(string nickname, string channel, Priority priority) { WriteLine(Rfc2812.Invite(nickname, channel), priority); } /// /// /// /// /// public void RfcInvite(string nickname, string channel) { WriteLine(Rfc2812.Invite(nickname, channel)); } /// /// /// /// /// public void RfcNick(string newnickname, Priority priority) { WriteLine(Rfc2812.Nick(newnickname), priority); } /// /// /// /// public void RfcNick(string newnickname) { WriteLine(Rfc2812.Nick(newnickname)); } /// /// /// /// public void RfcWho(Priority priority) { WriteLine(Rfc2812.Who(), priority); } /// /// /// public void RfcWho() { WriteLine(Rfc2812.Who()); } /// /// /// /// /// public void RfcWho(string mask, Priority priority) { WriteLine(Rfc2812.Who(mask), priority); } /// /// /// /// public void RfcWho(string mask) { WriteLine(Rfc2812.Who(mask)); } /// /// /// /// /// /// public void RfcWho(string mask, bool ircop, Priority priority) { WriteLine(Rfc2812.Who(mask, ircop), priority); } /// /// /// /// /// public void RfcWho(string mask, bool ircop) { WriteLine(Rfc2812.Who(mask, ircop)); } /// /// /// /// /// public void RfcWhois(string mask, Priority priority) { WriteLine(Rfc2812.Whois(mask), priority); } /// /// /// /// public void RfcWhois(string mask) { WriteLine(Rfc2812.Whois(mask)); } /// /// /// /// /// public void RfcWhois(string[] masks, Priority priority) { WriteLine(Rfc2812.Whois(masks), priority); } /// /// /// /// public void RfcWhois(string[] masks) { WriteLine(Rfc2812.Whois(masks)); } /// /// /// /// /// /// public void RfcWhois(string target, string mask, Priority priority) { WriteLine(Rfc2812.Whois(target, mask), priority); } /// /// /// /// /// public void RfcWhois(string target, string mask) { WriteLine(Rfc2812.Whois(target, mask)); } /// /// /// /// /// /// public void RfcWhois(string target, string[] masks, Priority priority) { WriteLine(Rfc2812.Whois(target ,masks), priority); } /// /// /// /// /// public void RfcWhois(string target, string[] masks) { WriteLine(Rfc2812.Whois(target, masks)); } /// /// /// /// /// public void RfcWhowas(string nickname, Priority priority) { WriteLine(Rfc2812.Whowas(nickname), priority); } /// /// /// /// public void RfcWhowas(string nickname) { WriteLine(Rfc2812.Whowas(nickname)); } /// /// /// /// /// public void RfcWhowas(string[] nicknames, Priority priority) { WriteLine(Rfc2812.Whowas(nicknames), priority); } /// /// /// /// public void RfcWhowas(string[] nicknames) { WriteLine(Rfc2812.Whowas(nicknames)); } /// /// /// /// /// /// public void RfcWhowas(string nickname, string count, Priority priority) { WriteLine(Rfc2812.Whowas(nickname, count), priority); } /// /// /// /// /// public void RfcWhowas(string nickname, string count) { WriteLine(Rfc2812.Whowas(nickname, count)); } /// /// /// /// /// /// public void RfcWhowas(string[] nicknames, string count, Priority priority) { WriteLine(Rfc2812.Whowas(nicknames, count), priority); } /// /// /// /// /// public void RfcWhowas(string[] nicknames, string count) { WriteLine(Rfc2812.Whowas(nicknames, count)); } /// /// /// /// /// /// /// public void RfcWhowas(string nickname, string count, string target, Priority priority) { WriteLine(Rfc2812.Whowas(nickname, count, target), priority); } /// /// /// /// /// /// public void RfcWhowas(string nickname, string count, string target) { WriteLine(Rfc2812.Whowas(nickname, count, target)); } /// /// /// /// /// /// /// public void RfcWhowas(string[] nicknames, string count, string target, Priority priority) { WriteLine(Rfc2812.Whowas(nicknames, count, target), priority); } /// /// /// /// /// /// public void RfcWhowas(string[] nicknames, string count, string target) { WriteLine(Rfc2812.Whowas(nicknames, count, target)); } /// /// /// /// /// /// public void RfcKill(string nickname, string comment, Priority priority) { WriteLine(Rfc2812.Kill(nickname, comment), priority); } /// /// /// /// /// public void RfcKill(string nickname, string comment) { WriteLine(Rfc2812.Kill(nickname, comment)); } /// /// /// /// /// public void RfcPing(string server, Priority priority) { WriteLine(Rfc2812.Ping(server), priority); } /// /// /// /// public void RfcPing(string server) { WriteLine(Rfc2812.Ping(server)); } /// /// /// /// /// /// public void RfcPing(string server, string server2, Priority priority) { WriteLine(Rfc2812.Ping(server, server2), priority); } /// /// /// /// /// public void RfcPing(string server, string server2) { WriteLine(Rfc2812.Ping(server, server2)); } /// /// /// /// /// public void RfcPong(string server, Priority priority) { WriteLine(Rfc2812.Pong(server), priority); } /// /// /// /// public void RfcPong(string server) { WriteLine(Rfc2812.Pong(server)); } /// /// /// /// /// /// public void RfcPong(string server, string server2, Priority priority) { WriteLine(Rfc2812.Pong(server, server2), priority); } /// /// /// /// /// public void RfcPong(string server, string server2) { WriteLine(Rfc2812.Pong(server, server2)); } /// /// /// /// public void RfcAway(Priority priority) { WriteLine(Rfc2812.Away(), priority); } /// /// /// public void RfcAway() { WriteLine(Rfc2812.Away()); } /// /// /// /// /// public void RfcAway(string awaytext, Priority priority) { WriteLine(Rfc2812.Away(awaytext), priority); } /// /// /// /// public void RfcAway(string awaytext) { WriteLine(Rfc2812.Away(awaytext)); } /// /// /// public void RfcRehash() { WriteLine(Rfc2812.Rehash()); } /// /// /// public void RfcDie() { WriteLine(Rfc2812.Die()); } /// /// /// public void RfcRestart() { WriteLine(Rfc2812.Restart()); } /// /// /// /// /// public void RfcSummon(string user, Priority priority) { WriteLine(Rfc2812.Summon(user), priority); } /// /// /// /// public void RfcSummon(string user) { WriteLine(Rfc2812.Summon(user)); } /// /// /// /// /// /// public void RfcSummon(string user, string target, Priority priority) { WriteLine(Rfc2812.Summon(user, target), priority); } /// /// /// /// /// public void RfcSummon(string user, string target) { WriteLine(Rfc2812.Summon(user, target)); } /// /// /// /// /// /// /// public void RfcSummon(string user, string target, string channel, Priority priority) { WriteLine(Rfc2812.Summon(user, target, channel), priority); } /// /// /// /// /// /// public void RfcSummon(string user, string target, string channel) { WriteLine(Rfc2812.Summon(user, target, channel)); } /// /// /// /// public void RfcUsers(Priority priority) { WriteLine(Rfc2812.Users(), priority); } /// /// /// public void RfcUsers() { WriteLine(Rfc2812.Users()); } /// /// /// /// /// public void RfcUsers(string target, Priority priority) { WriteLine(Rfc2812.Users(target), priority); } /// /// /// /// public void RfcUsers(string target) { WriteLine(Rfc2812.Users(target)); } /// /// /// /// /// public void RfcWallops(string wallopstext, Priority priority) { WriteLine(Rfc2812.Wallops(wallopstext), priority); } /// /// /// /// public void RfcWallops(string wallopstext) { WriteLine(Rfc2812.Wallops(wallopstext)); } /// /// /// /// /// public void RfcUserhost(string nickname, Priority priority) { WriteLine(Rfc2812.Userhost(nickname), priority); } /// /// /// /// public void RfcUserhost(string nickname) { WriteLine(Rfc2812.Userhost(nickname)); } /// /// /// /// /// public void RfcUserhost(string[] nicknames, Priority priority) { WriteLine(Rfc2812.Userhost(nicknames), priority); } /// /// /// /// public void RfcUserhost(string[] nicknames) { WriteLine(Rfc2812.Userhost(nicknames)); } /// /// /// /// /// public void RfcIson(string nickname, Priority priority) { WriteLine(Rfc2812.Ison(nickname), priority); } /// /// /// /// public void RfcIson(string nickname) { WriteLine(Rfc2812.Ison(nickname)); } /// /// /// /// /// public void RfcIson(string[] nicknames, Priority priority) { WriteLine(Rfc2812.Ison(nicknames), priority); } /// /// /// /// public void RfcIson(string[] nicknames) { WriteLine(Rfc2812.Ison(nicknames)); } /// /// /// /// public void RfcQuit(Priority priority) { WriteLine(Rfc2812.Quit(), priority); } /// /// /// public void RfcQuit() { WriteLine(Rfc2812.Quit()); } public void RfcQuit(string quitmessage, Priority priority) { WriteLine(Rfc2812.Quit(quitmessage), priority); } /// /// /// /// public void RfcQuit(string quitmessage) { WriteLine(Rfc2812.Quit(quitmessage)); } /// /// /// /// /// /// public void RfcSquit(string server, string comment, Priority priority) { WriteLine(Rfc2812.Squit(server, comment), priority); } /// /// /// /// /// public void RfcSquit(string server, string comment) { WriteLine(Rfc2812.Squit(server, comment)); } #endregion } } smuxi-0.11/lib/SmartIrc4net/src/Consts.cs0000644000175000017500000002050111655552514021061 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ namespace Meebey.SmartIrc4net { /// /// /// public enum Priority { Low, BelowMedium, Medium, AboveMedium, High, Critical } /// /// /// public enum SendType { Message, Action, Notice, CtcpReply, CtcpRequest } /// /// /// public enum ReceiveType { Info, Login, Motd, List, Join, Kick, Part, Invite, Quit, Who, WhoIs, WhoWas, Name, Topic, BanList, NickChange, TopicChange, UserMode, UserModeChange, ChannelMode, ChannelModeChange, ChannelMessage, ChannelAction, ChannelNotice, QueryMessage, QueryAction, QueryNotice, CtcpReply, CtcpRequest, Error, ErrorMessage, Unknown } /// /// /// public enum ReplyCode: int { Null = 000, Welcome = 001, YourHost = 002, Created = 003, MyInfo = 004, Bounce = 005, TraceLink = 200, TraceConnecting = 201, TraceHandshake = 202, TraceUnknown = 203, TraceOperator = 204, TraceUser = 205, TraceServer = 206, TraceService = 207, TraceNewType = 208, TraceClass = 209, TraceReconnect = 210, StatsLinkInfo = 211, StatsCommands = 212, EndOfStats = 219, UserModeIs = 221, ServiceList = 234, ServiceListEnd = 235, StatsUptime = 242, StatsOLine = 243, LuserClient = 251, LuserOp = 252, LuserUnknown = 253, LuserChannels = 254, LuserMe = 255, AdminMe = 256, AdminLocation1 = 257, AdminLocation2 = 258, AdminEmail = 259, TraceLog = 261, TraceEnd = 262, TryAgain = 263, Away = 301, UserHost = 302, IsOn = 303, UnAway = 305, NowAway = 306, WhoIsUser = 311, WhoIsServer = 312, WhoIsOperator = 313, WhoWasUser = 314, EndOfWho = 315, WhoIsIdle = 317, EndOfWhoIs = 318, WhoIsChannels = 319, ListStart = 321, List = 322, ListEnd = 323, ChannelModeIs = 324, UniqueOpIs = 325, NoTopic = 331, Topic = 332, Inviting = 341, Summoning = 342, InviteList = 346, EndOfInviteList = 347, ExceptionList = 348, EndOfExceptionList = 349, Version = 351, WhoReply = 352, NamesReply = 353, Links = 364, EndOfLinks = 365, EndOfNames = 366, BanList = 367, EndOfBanList = 368, EndOfWhoWas = 369, Info = 371, Motd = 372, EndOfInfo = 374, MotdStart = 375, EndOfMotd = 376, YouAreOper = 381, Rehashing = 382, YouAreService = 383, Time = 391, UsersStart = 392, Users = 393, EndOfUsers = 394, NoUsers = 395, ErrorNoSuchNickname = 401, ErrorNoSuchServer = 402, ErrorNoSuchChannel = 403, ErrorCannotSendToChannel = 404, ErrorTooManyChannels = 405, ErrorWasNoSuchNickname = 406, ErrorTooManyTargets = 407, ErrorNoSuchService = 408, ErrorNoOrigin = 409, ErrorNoRecipient = 411, ErrorNoTextToSend = 412, ErrorNoTopLevel = 413, ErrorWildTopLevel = 414, ErrorBadMask = 415, ErrorUnknownCommand = 421, ErrorNoMotd = 422, ErrorNoAdminInfo = 423, ErrorFileError = 424, ErrorNoNicknameGiven = 431, ErrorErroneusNickname = 432, ErrorNicknameInUse = 433, ErrorNicknameCollision = 436, ErrorUnavailableResource = 437, ErrorUserNotInChannel = 441, ErrorNotOnChannel = 442, ErrorUserOnChannel = 443, ErrorNoLogin = 444, ErrorSummonDisabled = 445, ErrorUsersDisabled = 446, ErrorNotRegistered = 451, ErrorNeedMoreParams = 461, ErrorAlreadyRegistered = 462, ErrorNoPermissionForHost = 463, ErrorPasswordMismatch = 464, ErrorYouAreBannedCreep = 465, ErrorYouWillBeBanned = 466, ErrorKeySet = 467, ErrorChannelIsFull = 471, ErrorUnknownMode = 472, ErrorInviteOnlyChannel = 473, ErrorBannedFromChannel = 474, ErrorBadChannelKey = 475, ErrorBadChannelMask = 476, ErrorNoChannelModes = 477, ErrorBanListFull = 478, ErrorNoPrivileges = 481, ErrorChannelOpPrivilegesNeeded = 482, ErrorCannotKillServer = 483, ErrorRestricted = 484, ErrorUniqueOpPrivilegesNeeded = 485, ErrorNoOperHost = 491, ErrorUserModeUnknownFlag = 501, ErrorUsersDoNotMatch = 502 } } smuxi-0.11/lib/SmartIrc4net/src/IrcConnection/0000755000175000017500000000000012300201664022001 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/src/IrcConnection/IrcProperties.cs0000644000175000017500000000304711655552514025145 0ustar00meebeymeebey00000000000000/* * $Id: IrcConnection.cs 208 2006-01-28 17:11:59Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smartirc/SmartIrc4net/trunk/src/IrcConnection/IrcConnection.cs $ * $Rev: 208 $ * $Author: meebey $ * $Date: 2006-01-28 18:11:59 +0100 (Sat, 28 Jan 2006) $ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Text; using System.Collections; using System.Threading; using System.Reflection; using System.Net.Sockets; namespace Meebey.SmartIrc4net { /// /// /// /// /* public class IrcProperties { } */ } smuxi-0.11/lib/SmartIrc4net/src/IrcConnection/EventArgs.cs0000644000175000017500000000502511655552514024247 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Specialized; namespace Meebey.SmartIrc4net { /// /// /// public class ReadLineEventArgs : EventArgs { private string _Line; public string Line { get { return _Line; } } internal ReadLineEventArgs(string line) { _Line = line; } } /// /// /// public class WriteLineEventArgs : EventArgs { private string _Line; public string Line { get { return _Line; } } internal WriteLineEventArgs(string line) { _Line = line; } } /// /// /// public class AutoConnectErrorEventArgs : EventArgs { private Exception _Exception; private string _Address; private int _Port; public Exception Exception { get { return _Exception; } } public string Address { get { return _Address; } } public int Port { get { return _Port; } } internal AutoConnectErrorEventArgs(string address, int port, Exception ex) { _Address = address; _Port = port; _Exception = ex; } } } smuxi-0.11/lib/SmartIrc4net/src/IrcConnection/Delegates.cs0000644000175000017500000000245411655552514024251 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ namespace Meebey.SmartIrc4net { public delegate void ReadLineEventHandler(object sender, ReadLineEventArgs e); public delegate void WriteLineEventHandler(object sender, WriteLineEventArgs e); public delegate void AutoConnectErrorEventHandler(object sender, AutoConnectErrorEventArgs e); } smuxi-0.11/lib/SmartIrc4net/src/IrcConnection/PrimaryOrFallbackEncoding.cs0000644000175000017500000001065612253423361027362 0ustar00meebeymeebey00000000000000/* * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2013 Ondřej Hošek * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Text; namespace Meebey.SmartIrc4net { internal class PrimaryOrFallbackEncoding : Encoding { public Encoding PrimaryEncoding { get; private set; } public Encoding FallbackEncoding { get; private set; } public PrimaryOrFallbackEncoding(Encoding primary, Encoding fallback) { try { PrimaryEncoding = Encoding.GetEncoding(primary.WebName, new EncoderExceptionFallback(), new DecoderExceptionFallback()); } catch (ArgumentException) { // probably not a standard encoding; check if it's throw-exception if (!(primary.EncoderFallback is EncoderExceptionFallback)) { throw new System.ArgumentException("a custom primary encoding's encoder fallback must be an EncoderExceptionFallback"); } if (!(primary.DecoderFallback is DecoderExceptionFallback)) { throw new System.ArgumentException("a custom primary encoding's decoder fallback must be a DecoderExceptionFallback"); } } FallbackEncoding = fallback; } public override int GetByteCount(char[] chars, int index, int count) { try { return PrimaryEncoding.GetByteCount(chars, index, count); } catch (EncoderFallbackException) { return FallbackEncoding.GetByteCount(chars, index, count); } } public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { try { return PrimaryEncoding.GetBytes(chars, charIndex, charCount, bytes, byteIndex); } catch (EncoderFallbackException) { return FallbackEncoding.GetBytes(chars, charIndex, charCount, bytes, byteIndex); } } public override int GetCharCount(byte[] bytes, int index, int count) { try { return PrimaryEncoding.GetCharCount(bytes, index, count); } catch (DecoderFallbackException) { return FallbackEncoding.GetCharCount(bytes, index, count); } } public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { try { return PrimaryEncoding.GetChars(bytes, byteIndex, byteCount, chars, charIndex); } catch (DecoderFallbackException) { return FallbackEncoding.GetChars(bytes, byteIndex, byteCount, chars, charIndex); } } public override int GetMaxByteCount(int charCount) { try { int pri = PrimaryEncoding.GetMaxByteCount(charCount); int fab = FallbackEncoding.GetMaxByteCount(charCount); return Math.Max(pri, fab); } catch (EncoderFallbackException) { return FallbackEncoding.GetMaxByteCount(charCount); } } public override int GetMaxCharCount(int byteCount) { try { int pri = PrimaryEncoding.GetMaxCharCount(byteCount); int fab = FallbackEncoding.GetMaxCharCount(byteCount); return Math.Max(pri, fab); } catch (DecoderFallbackException) { return FallbackEncoding.GetMaxCharCount(byteCount); } } public override byte[] GetPreamble() { return PrimaryEncoding.GetPreamble(); } } } smuxi-0.11/lib/SmartIrc4net/src/IrcConnection/IrcConnection.cs0000644000175000017500000014656012300201664025101 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2009 Mirco Bauer * Copyright (c) 2008-2009 Thomas Bruderer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections; using System.IO; using System.Net; using System.Net.Security; using System.Net.Sockets; using System.Reflection; using System.Text; using System.Security.Cryptography.X509Certificates; using System.Security.Authentication; using System.Threading; using Starksoft.Net.Proxy; namespace Meebey.SmartIrc4net { /// /// /// /// public class IrcConnection { private string _VersionNumber; private string _VersionString; private string[] _AddressList = {"localhost"}; private int _CurrentAddress; private int _Port; private bool _UseSsl; private bool _ValidateServerCertificate; private X509Certificate _SslClientCertificate; private StreamReader _Reader; private StreamWriter _Writer; private ReadThread _ReadThread; private WriteThread _WriteThread; private IdleWorkerThread _IdleWorkerThread; private TcpClient _TcpClient; private Hashtable _SendBuffer = Hashtable.Synchronized(new Hashtable()); private int _SendDelay = 200; private bool _IsRegistered; private bool _IsConnected; private bool _IsConnectionError; private bool _IsDisconnecting; private int _AutoRetryAttempt; private bool _AutoRetry; private int _AutoRetryDelay = 30; private int _AutoRetryLimit = 3; private bool _AutoReconnect; private Encoding _Encoding = Encoding.Default; public bool EnableUTF8Recode { get; set; } private int _SocketReceiveTimeout = 600; private int _SocketSendTimeout = 600; private int _IdleWorkerInterval = 60; private int _PingInterval = 60; private int _PingTimeout = 300; private DateTime _LastPingSent; private DateTime _LastPongReceived; private TimeSpan _Lag; private string _ProxyHost; private int _ProxyPort; private ProxyType _ProxyType = ProxyType.None; private string _ProxyUsername; private string _ProxyPassword; /// /// Raised when a \r\n terminated line is read from the socket /// public event ReadLineEventHandler OnReadLine; /// /// Raised when a \r\n terminated line is written to the socket /// public event WriteLineEventHandler OnWriteLine; /// /// Raised before the connect attempt /// public event EventHandler OnConnecting; /// /// Raised on successful connect /// public event EventHandler OnConnected; /// /// Raised before the connection is closed /// public event EventHandler OnDisconnecting; /// /// Raised when the connection is closed /// public event EventHandler OnDisconnected; /// /// Raised when the connection got into an error state /// public event EventHandler OnConnectionError; /// /// Raised when the connection got into an error state during auto connect loop /// public event AutoConnectErrorEventHandler OnAutoConnectError; /// /// When a connection error is detected this property will return true /// protected bool IsConnectionError { get { lock (this) { return _IsConnectionError; } } set { lock (this) { _IsConnectionError = value; } if (value) { // signal ReadLine() to check IsConnectionError state _ReadThread.QueuedEvent.Set(); } } } protected bool IsDisconnecting { get { lock (this) { return _IsDisconnecting; } } set { lock (this) { _IsDisconnecting = value; } } } /// /// Gets the current address of the connection /// public string Address { get { return _AddressList[_CurrentAddress]; } } /// /// Gets the address list of the connection /// public string[] AddressList { get { return _AddressList; } } /// /// Gets the used port of the connection /// public int Port { get { return _Port; } } /// /// By default nothing is done when the library looses the connection /// to the server. /// Default: false /// /// /// true, if the library should reconnect on lost connections /// false, if the library should not take care of it /// public bool AutoReconnect { get { return _AutoReconnect; } set { #if LOG4NET if (value) { Logger.Connection.Info("AutoReconnect enabled"); } else { Logger.Connection.Info("AutoReconnect disabled"); } #endif _AutoReconnect = value; } } /// /// If the library should retry to connect when the connection fails. /// Default: false /// /// /// true, if the library should retry to connect /// false, if the library should not retry /// public bool AutoRetry { get { return _AutoRetry; } set { #if LOG4NET if (value) { Logger.Connection.Info("AutoRetry enabled"); } else { Logger.Connection.Info("AutoRetry disabled"); } #endif _AutoRetry = value; } } /// /// Delay between retry attempts in Connect() in seconds. /// Default: 30 /// public int AutoRetryDelay { get { return _AutoRetryDelay; } set { _AutoRetryDelay = value; } } /// /// Maximum number of retries to connect to the server /// Default: 3 /// public int AutoRetryLimit { get { return _AutoRetryLimit; } set { _AutoRetryLimit = value; } } /// /// Returns the current amount of reconnect attempts /// Default: 3 /// public int AutoRetryAttempt { get { return _AutoRetryAttempt; } } /// /// To prevent flooding the IRC server, it's required to delay each /// message, given in milliseconds. /// Default: 200 /// public int SendDelay { get { return _SendDelay; } set { _SendDelay = value; } } /// /// On successful registration on the IRC network, this is set to true. /// public bool IsRegistered { get { return _IsRegistered; } } /// /// On successful connect to the IRC server, this is set to true. /// public bool IsConnected { get { return _IsConnected; } } /// /// Gets the SmartIrc4net version number /// public string VersionNumber { get { return _VersionNumber; } } /// /// Gets the full SmartIrc4net version string /// public string VersionString { get { return _VersionString; } } /// /// The encoding to use to write to and read from the socket. /// /// If EnableUTF8Recode is true, reading and writing will always happen /// using UTF-8; this encoding is only used to decode incoming messages /// that cannot be successfully decoded using UTF-8. /// /// Default: encoding of the system /// public Encoding Encoding { get { return _Encoding; } set { _Encoding = value; } } /// /// Enables/disables using SSL for the connection /// Default: false /// public bool UseSsl { get { return _UseSsl; } set { _UseSsl = value; } } /// /// Specifies if the certificate of the server is validated /// Default: true /// public bool ValidateServerCertificate { get { return _ValidateServerCertificate; } set { _ValidateServerCertificate = value; } } /// /// Specifies the client certificate used for the SSL connection /// Default: null /// public X509Certificate SslClientCertificate { get { return _SslClientCertificate; } set { _SslClientCertificate = value; } } /// /// Timeout in seconds for receiving data from the socket /// Default: 600 /// public int SocketReceiveTimeout { get { return _SocketReceiveTimeout; } set { _SocketReceiveTimeout = value; } } /// /// Timeout in seconds for sending data to the socket /// Default: 600 /// public int SocketSendTimeout { get { return _SocketSendTimeout; } set { _SocketSendTimeout = value; } } /// /// Interval in seconds to run the idle worker /// Default: 60 /// public int IdleWorkerInterval { get { return _IdleWorkerInterval; } set { _IdleWorkerInterval = value; } } /// /// Interval in seconds to send a PING /// Default: 60 /// public int PingInterval { get { return _PingInterval; } set { _PingInterval = value; } } /// /// Timeout in seconds for server response to a PING /// Default: 600 /// public int PingTimeout { get { return _PingTimeout; } set { _PingTimeout = value; } } /// /// Latency between client and the server /// public TimeSpan Lag { get { if (_LastPingSent > _LastPongReceived) { // there is an outstanding ping, thus we don't have a current lag value return DateTime.Now - _LastPingSent; } return _Lag; } } /// /// If you want to use a Proxy, set the ProxyHost to Host of the Proxy you want to use. /// public string ProxyHost { get { return _ProxyHost; } set { _ProxyHost = value; } } /// /// If you want to use a Proxy, set the ProxyPort to Port of the Proxy you want to use. /// public int ProxyPort { get { return _ProxyPort; } set { _ProxyPort = value; } } /// /// Standard Setting is to use no Proxy Server, if you Set this to any other value, /// you have to set the ProxyHost and ProxyPort aswell (and give credentials if needed) /// Default: ProxyType.None /// public ProxyType ProxyType { get { return _ProxyType; } set { _ProxyType = value; } } /// /// Username to your Proxy Server /// public string ProxyUsername { get { return _ProxyUsername; } set { _ProxyUsername = value; } } /// /// Password to your Proxy Server /// public string ProxyPassword { get { return _ProxyPassword; } set { _ProxyPassword = value; } } /// /// Initializes the message queues, read and write thread /// public IrcConnection() { #if LOG4NET Logger.Main.Debug("IrcConnection created"); #endif _SendBuffer[Priority.High] = Queue.Synchronized(new Queue()); _SendBuffer[Priority.AboveMedium] = Queue.Synchronized(new Queue()); _SendBuffer[Priority.Medium] = Queue.Synchronized(new Queue()); _SendBuffer[Priority.BelowMedium] = Queue.Synchronized(new Queue()); _SendBuffer[Priority.Low] = Queue.Synchronized(new Queue()); // setup own callbacks OnReadLine += new ReadLineEventHandler(_SimpleParser); OnConnectionError += new EventHandler(_OnConnectionError); _ReadThread = new ReadThread(this); _WriteThread = new WriteThread(this); _IdleWorkerThread = new IdleWorkerThread(this); Assembly assm = Assembly.GetAssembly(this.GetType()); AssemblyName assm_name = assm.GetName(false); AssemblyProductAttribute pr = (AssemblyProductAttribute)assm.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]; _VersionNumber = assm_name.Version.ToString(); _VersionString = pr.Product+" "+_VersionNumber; } #if LOG4NET ~IrcConnection() { Logger.Main.Debug("IrcConnection destroyed"); } #endif /// this method has 2 overloads /// /// Connects to the specified server and port, when the connection fails /// the next server in the list will be used. /// /// List of servers to connect to /// Portnumber to connect to /// The connection failed /// If there is already an active connection public void Connect(string[] addresslist, int port) { if (_IsConnected) { throw new AlreadyConnectedException("Already connected to: " + Address + ":" + Port); } _AutoRetryAttempt++; #if LOG4NET Logger.Connection.Info(String.Format("connecting... (attempt: {0})", _AutoRetryAttempt)); #endif _AddressList = (string[])addresslist.Clone(); _Port = port; if (OnConnecting != null) { OnConnecting(this, EventArgs.Empty); } try { _TcpClient = new TcpClient(); _TcpClient.NoDelay = true; _TcpClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, 1); // set timeout, after this the connection will be aborted _TcpClient.ReceiveTimeout = _SocketReceiveTimeout * 1000; _TcpClient.SendTimeout = _SocketSendTimeout * 1000; if (_ProxyType != ProxyType.None) { IProxyClient proxyClient = null; ProxyClientFactory proxyFactory = new ProxyClientFactory(); // HACK: map our ProxyType to Starksoft's ProxyType Starksoft.Net.Proxy.ProxyType proxyType = (Starksoft.Net.Proxy.ProxyType) Enum.Parse( typeof(ProxyType), _ProxyType.ToString(), true ); if (_ProxyUsername == null && _ProxyPassword == null) { proxyClient = proxyFactory.CreateProxyClient( proxyType ); } else { proxyClient = proxyFactory.CreateProxyClient( proxyType, _ProxyHost, _ProxyPort, _ProxyUsername, _ProxyPassword ); } _TcpClient.Connect(_ProxyHost, _ProxyPort); proxyClient.TcpClient = _TcpClient; proxyClient.CreateConnection(Address, port); } else { _TcpClient.Connect(Address, port); } Stream stream = _TcpClient.GetStream(); if (_UseSsl) { RemoteCertificateValidationCallback certValidation; if (_ValidateServerCertificate) { certValidation = ServicePointManager.ServerCertificateValidationCallback; if (certValidation == null) { certValidation = delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { if (sslPolicyErrors == SslPolicyErrors.None) { return true; } #if LOG4NET Logger.Connection.Error( "Connect(): Certificate error: " + sslPolicyErrors ); #endif return false; }; } } else { certValidation = delegate { return true; }; } RemoteCertificateValidationCallback certValidationWithIrcAsSender = delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return certValidation(this, certificate, chain, sslPolicyErrors); }; SslStream sslStream = new SslStream(stream, false, certValidationWithIrcAsSender); try { if (_SslClientCertificate != null) { var certs = new X509Certificate2Collection(); certs.Add(_SslClientCertificate); sslStream.AuthenticateAsClient(Address, certs, SslProtocols.Default, false); } else { sslStream.AuthenticateAsClient(Address); } } catch (IOException ex) { #if LOG4NET Logger.Connection.Error( "Connect(): AuthenticateAsClient() failed!" ); #endif throw new CouldNotConnectException("Could not connect to: " + Address + ":" + Port + " " + ex.Message, ex); } stream = sslStream; } if (EnableUTF8Recode) { _Reader = new StreamReader(stream, new PrimaryOrFallbackEncoding(new UTF8Encoding(false, true), _Encoding)); _Writer = new StreamWriter(stream, new UTF8Encoding(false, false)); } else { _Reader = new StreamReader(stream, _Encoding); _Writer = new StreamWriter(stream, _Encoding); if (_Encoding.GetPreamble().Length > 0) { // HACK: we have an encoding that has some kind of preamble // like UTF-8 has a BOM, this will confuse the IRCd! // Thus we send a \r\n so the IRCd can safely ignore that // garbage. _Writer.WriteLine(); // make sure we flush the BOM+CRLF correctly _Writer.Flush(); } } // Connection was succeful, reseting the connect counter _AutoRetryAttempt = 0; // updating the connection error state, so connecting is possible again IsConnectionError = false; _IsConnected = true; // lets power up our threads _ReadThread.Start(); _WriteThread.Start(); _IdleWorkerThread.Start(); #if LOG4NET Logger.Connection.Info("connected"); #endif if (OnConnected != null) { OnConnected(this, EventArgs.Empty); } } catch (AuthenticationException ex) { #if LOG4NET Logger.Connection.Error("Connect(): Exception", ex); #endif throw new CouldNotConnectException("Could not connect to: " + Address + ":" + Port + " " + ex.Message, ex); } catch (Exception e) { if (_Reader != null) { try { _Reader.Close(); } catch (ObjectDisposedException) { } } if (_Writer != null) { try { _Writer.Close(); } catch (ObjectDisposedException) { } } if (_TcpClient != null) { _TcpClient.Close(); } _IsConnected = false; IsConnectionError = true; #if LOG4NET Logger.Connection.Info("connection failed: "+e.Message, e); #endif if (e is CouldNotConnectException) { // error was fatal, bail out throw; } if (_AutoRetry && (_AutoRetryLimit == -1 || _AutoRetryLimit == 0 || _AutoRetryLimit <= _AutoRetryAttempt)) { if (OnAutoConnectError != null) { OnAutoConnectError(this, new AutoConnectErrorEventArgs(Address, Port, e)); } #if LOG4NET Logger.Connection.Debug("delaying new connect attempt for "+_AutoRetryDelay+" sec"); #endif Thread.Sleep(_AutoRetryDelay * 1000); _NextAddress(); // FIXME: this is recursion Connect(_AddressList, _Port); } else { throw new CouldNotConnectException("Could not connect to: "+Address+":"+Port+" "+e.Message, e); } } } /// /// Connects to the specified server and port. /// /// Server address to connect to /// Port number to connect to public void Connect(string address, int port) { Connect(new string[] { address }, port); } /// /// Reconnects to the server /// /// /// If there was no active connection /// /// /// The connection failed /// /// /// If there is already an active connection /// public void Reconnect() { #if LOG4NET Logger.Connection.Info("reconnecting..."); #endif Disconnect(); Connect(_AddressList, _Port); } /// /// Disconnects from the server /// /// /// If there was no active connection /// public void Disconnect() { if (!IsConnected) { throw new NotConnectedException("The connection could not be disconnected because there is no active connection"); } #if LOG4NET Logger.Connection.Info("disconnecting..."); #endif if (OnDisconnecting != null) { OnDisconnecting(this, EventArgs.Empty); } IsDisconnecting = true; _IdleWorkerThread.Stop(); _ReadThread.Stop(); _WriteThread.Stop(); _TcpClient.Close(); _IsConnected = false; _IsRegistered = false; IsDisconnecting = false; if (OnDisconnected != null) { OnDisconnected(this, EventArgs.Empty); } #if LOG4NET Logger.Connection.Info("disconnected"); #endif } /// /// /// /// public void Listen(bool blocking) { if (blocking) { while (IsConnected) { ReadLine(true); } } else { while (ReadLine(false).Length > 0) { // loop as long as we receive messages } } } /// /// /// public void Listen() { Listen(true); } /// /// /// /// public void ListenOnce(bool blocking) { ReadLine(blocking); } /// /// /// public void ListenOnce() { ListenOnce(true); } /// /// /// /// /// public string ReadLine(bool blocking) { string data = ""; if (blocking) { // block till the queue has data, but bail out on connection error while (IsConnected && !IsConnectionError && _ReadThread.Queue.Count == 0) { _ReadThread.QueuedEvent.WaitOne(); } } if (IsConnected && _ReadThread.Queue.Count > 0) { data = (string)(_ReadThread.Queue.Dequeue()); } if (data != null && data.Length > 0) { #if LOG4NET Logger.Queue.Debug("read: \""+data+"\""); #endif if (OnReadLine != null) { OnReadLine(this, new ReadLineEventArgs(data)); } } if (IsConnectionError && !IsDisconnecting && OnConnectionError != null) { OnConnectionError(this, EventArgs.Empty); } return data; } /// /// /// /// /// public void WriteLine(string data, Priority priority) { if (priority == Priority.Critical) { if (!IsConnected) { throw new NotConnectedException(); } _WriteLine(data); } else { ((Queue)_SendBuffer[priority]).Enqueue(data); _WriteThread.QueuedEvent.Set(); } } /// /// /// /// public void WriteLine(string data) { WriteLine(data, Priority.Medium); } private bool _WriteLine(string data) { if (IsConnected) { try { lock (_Writer) { _Writer.Write(data + "\r\n"); _Writer.Flush(); } } catch (IOException) { #if LOG4NET Logger.Socket.Warn("sending data failed, connection lost"); #endif IsConnectionError = true; return false; } catch (ObjectDisposedException) { #if LOG4NET Logger.Socket.Warn("sending data failed (stream error), connection lost"); #endif IsConnectionError = true; return false; } #if LOG4NET Logger.Socket.Debug("sent: \""+data+"\""); #endif if (OnWriteLine != null) { OnWriteLine(this, new WriteLineEventArgs(data)); } return true; } return false; } private void _NextAddress() { _CurrentAddress++; if (_CurrentAddress >= _AddressList.Length) { _CurrentAddress = 0; } #if LOG4NET Logger.Connection.Info("set server to: "+Address); #endif } private void _SimpleParser(object sender, ReadLineEventArgs args) { string rawline = args.Line; string[] rawlineex = rawline.Split(new char[] {' '}); string line = null; string prefix = null; string command = null; if (rawline[0] == ':') { prefix = rawlineex[0].Substring(1); line = rawline.Substring(prefix.Length + 2); } else { line = rawline; } string[] lineex = line.Split(new char[] {' '}); command = lineex[0]; ReplyCode replycode = ReplyCode.Null; int intReplycode; if (Int32.TryParse(command, out intReplycode)) { replycode = (ReplyCode) intReplycode; } if (replycode != ReplyCode.Null) { switch (replycode) { case ReplyCode.Welcome: _IsRegistered = true; #if LOG4NET Logger.Connection.Info("logged in"); #endif break; } } else { switch (command) { case "ERROR": // FIXME: handle server errors differently than connection errors! //IsConnectionError = true; break; case "PONG": DateTime now = DateTime.Now; _LastPongReceived = now; _Lag = now - _LastPingSent; #if LOG4NET Logger.Connection.Debug("PONG received, took: " + _Lag.TotalMilliseconds + " ms"); #endif break; } } } private void _OnConnectionError(object sender, EventArgs e) { try { if (AutoReconnect) { // prevent connect -> exception -> connect flood loop Thread.Sleep(AutoRetryDelay * 1000); // lets try to recover the connection Reconnect(); } else { // make sure we clean up Disconnect(); } } catch (ConnectionException) { } } /// /// /// private class ReadThread { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private IrcConnection _Connection; private Thread _Thread; private Queue _Queue = Queue.Synchronized(new Queue()); public AutoResetEvent QueuedEvent; public Queue Queue { get { return _Queue; } } /// /// /// /// public ReadThread(IrcConnection connection) { _Connection = connection; QueuedEvent = new AutoResetEvent(false); } /// /// /// public void Start() { _Thread = new Thread(new ThreadStart(_Worker)); _Thread.Name = "ReadThread ("+_Connection.Address+":"+_Connection.Port+")"; _Thread.IsBackground = true; _Thread.Start(); } /// /// /// public void Stop() { #if LOG4NET _Logger.Debug("Stop()"); #endif #if LOG4NET _Logger.Debug("Stop(): aborting thread..."); #endif _Thread.Abort(); // make sure we close the stream after the thread is gone, else // the thread will think the connection is broken! #if LOG4NET _Logger.Debug("Stop(): joining thread..."); #endif _Thread.Join(); #if LOG4NET _Logger.Debug("Stop(): closing reader..."); #endif try { _Connection._Reader.Close(); } catch (ObjectDisposedException) { } // clean up our receive queue else we continue processing old // messages when the read thread is restarted! _Queue.Clear(); } private void _Worker() { #if LOG4NET Logger.Socket.Debug("ReadThread started"); #endif try { string data = ""; try { while (_Connection.IsConnected && ((data = _Connection._Reader.ReadLine()) != null)) { _Queue.Enqueue(data); QueuedEvent.Set(); #if LOG4NET Logger.Socket.Debug("received: \""+data+"\""); #endif } } catch (IOException e) { #if LOG4NET Logger.Socket.Warn("IOException: "+e.Message); #endif } finally { #if LOG4NET Logger.Socket.Warn("connection lost"); #endif // only flag this as connection error if we are not // cleanly disconnecting if (!_Connection.IsDisconnecting) { _Connection.IsConnectionError = true; } } } catch (ThreadAbortException) { Thread.ResetAbort(); #if LOG4NET Logger.Socket.Debug("ReadThread aborted"); #endif } catch (Exception ex) { #if LOG4NET Logger.Socket.Error(ex); #endif } } } /// /// /// private class WriteThread { private IrcConnection _Connection; private Thread _Thread; private int _HighCount; private int _AboveMediumCount; private int _MediumCount; private int _BelowMediumCount; private int _LowCount; private int _AboveMediumSentCount; private int _MediumSentCount; private int _BelowMediumSentCount; private int _AboveMediumThresholdCount = 4; private int _MediumThresholdCount = 2; private int _BelowMediumThresholdCount = 1; private int _BurstCount; public AutoResetEvent QueuedEvent; /// /// /// /// public WriteThread(IrcConnection connection) { _Connection = connection; QueuedEvent = new AutoResetEvent(false); } /// /// /// public void Start() { _Thread = new Thread(new ThreadStart(_Worker)); _Thread.Name = "WriteThread ("+_Connection.Address+":"+_Connection.Port+")"; _Thread.IsBackground = true; _Thread.Start(); } /// /// /// public void Stop() { #if LOG4NET Logger.Connection.Debug("Stopping WriteThread..."); #endif _Thread.Abort(); // make sure we close the stream after the thread is gone, else // the thread will think the connection is broken! _Thread.Join(); try { _Connection._Writer.Close(); } catch (ObjectDisposedException) { } } private void _Worker() { #if LOG4NET Logger.Socket.Debug("WriteThread started"); #endif try { try { while (_Connection.IsConnected) { QueuedEvent.WaitOne(); var isBufferEmpty = false; do { isBufferEmpty = _CheckBuffer() == 0; Thread.Sleep(_Connection._SendDelay); } while (!isBufferEmpty); } } catch (IOException e) { #if LOG4NET Logger.Socket.Warn("IOException: " + e.Message); #endif } finally { #if LOG4NET Logger.Socket.Warn("connection lost"); #endif // only flag this as connection error if we are not // cleanly disconnecting if (!_Connection.IsDisconnecting) { _Connection.IsConnectionError = true; } } } catch (ThreadAbortException) { Thread.ResetAbort(); #if LOG4NET Logger.Socket.Debug("WriteThread aborted"); #endif } catch (Exception ex) { #if LOG4NET Logger.Socket.Error(ex); #endif } } #region WARNING: complex scheduler, don't even think about changing it! // WARNING: complex scheduler, don't even think about changing it! private int _CheckBuffer() { _HighCount = ((Queue)_Connection._SendBuffer[Priority.High]).Count; _AboveMediumCount = ((Queue)_Connection._SendBuffer[Priority.AboveMedium]).Count; _MediumCount = ((Queue)_Connection._SendBuffer[Priority.Medium]).Count; _BelowMediumCount = ((Queue)_Connection._SendBuffer[Priority.BelowMedium]).Count; _LowCount = ((Queue)_Connection._SendBuffer[Priority.Low]).Count; var msgCount = _HighCount + _AboveMediumCount + _MediumCount + _BelowMediumCount + _LowCount; // only send data if we are succefully registered on the IRC network if (!_Connection._IsRegistered) { return msgCount; } if (_CheckHighBuffer() && _CheckAboveMediumBuffer() && _CheckMediumBuffer() && _CheckBelowMediumBuffer() && _CheckLowBuffer()) { // everything is sent, resetting all counters _AboveMediumSentCount = 0; _MediumSentCount = 0; _BelowMediumSentCount = 0; _BurstCount = 0; } if (_BurstCount < 3) { _BurstCount++; //_CheckBuffer(); } return msgCount; } private bool _CheckHighBuffer() { if (_HighCount > 0) { string data = (string)((Queue)_Connection._SendBuffer[Priority.High]).Dequeue(); if (_Connection._WriteLine(data) == false) { #if LOG4NET Logger.Queue.Warn("Sending data was not sucessful, data is requeued!"); #endif ((Queue)_Connection._SendBuffer[Priority.High]).Enqueue(data); return false; } if (_HighCount > 1) { // there is more data to send return false; } } return true; } private bool _CheckAboveMediumBuffer() { if ((_AboveMediumCount > 0) && (_AboveMediumSentCount < _AboveMediumThresholdCount)) { string data = (string)((Queue)_Connection._SendBuffer[Priority.AboveMedium]).Dequeue(); if (_Connection._WriteLine(data) == false) { #if LOG4NET Logger.Queue.Warn("Sending data was not sucessful, data is requeued!"); #endif ((Queue)_Connection._SendBuffer[Priority.AboveMedium]).Enqueue(data); return false; } _AboveMediumSentCount++; if (_AboveMediumSentCount < _AboveMediumThresholdCount) { return false; } } return true; } private bool _CheckMediumBuffer() { if ((_MediumCount > 0) && (_MediumSentCount < _MediumThresholdCount)) { string data = (string)((Queue)_Connection._SendBuffer[Priority.Medium]).Dequeue(); if (_Connection._WriteLine(data) == false) { #if LOG4NET Logger.Queue.Warn("Sending data was not sucessful, data is requeued!"); #endif ((Queue)_Connection._SendBuffer[Priority.Medium]).Enqueue(data); return false; } _MediumSentCount++; if (_MediumSentCount < _MediumThresholdCount) { return false; } } return true; } private bool _CheckBelowMediumBuffer() { if ((_BelowMediumCount > 0) && (_BelowMediumSentCount < _BelowMediumThresholdCount)) { string data = (string)((Queue)_Connection._SendBuffer[Priority.BelowMedium]).Dequeue(); if (_Connection._WriteLine(data) == false) { #if LOG4NET Logger.Queue.Warn("Sending data was not sucessful, data is requeued!"); #endif ((Queue)_Connection._SendBuffer[Priority.BelowMedium]).Enqueue(data); return false; } _BelowMediumSentCount++; if (_BelowMediumSentCount < _BelowMediumThresholdCount) { return false; } } return true; } private bool _CheckLowBuffer() { if (_LowCount > 0) { if ((_HighCount > 0) || (_AboveMediumCount > 0) || (_MediumCount > 0) || (_BelowMediumCount > 0)) { return true; } string data = (string)((Queue)_Connection._SendBuffer[Priority.Low]).Dequeue(); if (_Connection._WriteLine(data) == false) { #if LOG4NET Logger.Queue.Warn("Sending data was not sucessful, data is requeued!"); #endif ((Queue)_Connection._SendBuffer[Priority.Low]).Enqueue(data); return false; } if (_LowCount > 1) { return false; } } return true; } // END OF WARNING, below this you can read/change again ;) #endregion } /// /// /// private class IdleWorkerThread { private IrcConnection _Connection; private Thread _Thread; /// /// /// /// public IdleWorkerThread(IrcConnection connection) { _Connection = connection; } /// /// /// public void Start() { DateTime now = DateTime.Now; _Connection._LastPingSent = now; _Connection._LastPongReceived = now; _Thread = new Thread(new ThreadStart(_Worker)); _Thread.Name = "IdleWorkerThread ("+_Connection.Address+":"+_Connection.Port+")"; _Thread.IsBackground = true; _Thread.Start(); } /// /// /// public void Stop() { _Thread.Abort(); _Thread.Join(); } private void _Worker() { #if LOG4NET Logger.Socket.Debug("IdleWorkerThread started"); #endif try { while (_Connection.IsConnected ) { Thread.Sleep(_Connection._IdleWorkerInterval * 1000); // only send active pings if we are registered if (!_Connection.IsRegistered) { continue; } DateTime now = DateTime.Now; int last_ping_sent = (int)(now - _Connection._LastPingSent).TotalSeconds; int last_pong_rcvd = (int)(now - _Connection._LastPongReceived).TotalSeconds; // determins if the resoponse time is ok if (last_ping_sent < _Connection._PingTimeout) { if (_Connection._LastPingSent > _Connection._LastPongReceived) { // there is a pending ping request, we have to wait continue; } // determines if it need to send another ping yet if (last_pong_rcvd > _Connection._PingInterval) { _Connection.WriteLine(Rfc2812.Ping(_Connection.Address), Priority.Critical); _Connection._LastPingSent = now; //_Connection._LastPongReceived = now; } // else connection is fine, just continue } else { if (_Connection.IsDisconnecting) { break; } #if LOG4NET Logger.Socket.Warn("ping timeout, connection lost"); #endif // only flag this as connection error if we are not // cleanly disconnecting _Connection.IsConnectionError = true; break; } } } catch (ThreadAbortException) { Thread.ResetAbort(); #if LOG4NET Logger.Socket.Debug("IdleWorkerThread aborted"); #endif } catch (Exception ex) { #if LOG4NET Logger.Socket.Error(ex); #endif } } } } } smuxi-0.11/lib/SmartIrc4net/src/IrcConnection/ProxyType.cs0000644000175000017500000000216511655552514024336 0ustar00meebeymeebey00000000000000/* * $Id$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2009 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Meebey.SmartIrc4net { public enum ProxyType { None, Http, Socks4, Socks4a, Socks5 } } smuxi-0.11/lib/SmartIrc4net/src/EventArgs.cs0000644000175000017500000000307411655552514021514 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Specialized; namespace Meebey.SmartIrc4net { /// /// /// /// public class IrcEventArgs : EventArgs { private readonly IrcMessageData _Data; /// /// /// public IrcMessageData Data { get { return _Data; } } internal IrcEventArgs(IrcMessageData data) { _Data = data; } } } smuxi-0.11/lib/SmartIrc4net/src/Logger.cs0000644000175000017500000000605212253423361021024 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #if LOG4NET using System.IO; using System.Collections; using log4net; namespace Meebey.SmartIrc4net { /// /// /// /// internal static class Logger { static public ILog Main { get; private set; } static public ILog Connection { get; private set; } static public ILog Socket { get; private set; } static public ILog Queue { get; private set; } static public ILog IrcMessages { get; private set; } static public ILog MessageTypes { get; private set; } static public ILog MessageParser { get; private set; } static public ILog ActionHandler { get; private set; } static public ILog TimeHandler { get; private set; } static public ILog MessageHandler { get; private set; } static public ILog ChannelSyncing { get; private set; } static public ILog UserSyncing { get; private set; } static public ILog Modules { get; private set; } static public ILog Dcc { get; private set; } static Logger() { Main = log4net.LogManager.GetLogger("MAIN"); Socket = log4net.LogManager.GetLogger("SOCKET"); Queue = log4net.LogManager.GetLogger("QUEUE"); Connection = log4net.LogManager.GetLogger("CONNECTION"); IrcMessages = log4net.LogManager.GetLogger("IRCMESSAGE"); MessageParser = log4net.LogManager.GetLogger("MESSAGEPARSER"); MessageTypes = log4net.LogManager.GetLogger("MESSAGETYPES"); ActionHandler = log4net.LogManager.GetLogger("ACTIONHANDLER"); TimeHandler = log4net.LogManager.GetLogger("TIMEHANDLER"); MessageHandler = log4net.LogManager.GetLogger("MESSAGEHANDLER"); ChannelSyncing = log4net.LogManager.GetLogger("CHANNELSYNCING"); UserSyncing = log4net.LogManager.GetLogger("USERSYNCING"); Modules = log4net.LogManager.GetLogger("MODULES"); Dcc = log4net.LogManager.GetLogger("DCC"); } } } #endif smuxi-0.11/lib/SmartIrc4net/src/starksoftproxy/0000755000175000017500000000000012253423361022375 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/src/starksoftproxy/HttpProxyClient.cs0000644000175000017500000004343512253423361026055 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Text; using System.Net.Sockets; using System.Threading; using System.Globalization; using System.ComponentModel; namespace Starksoft.Net.Proxy { /// /// HTTP connection proxy class. This class implements the HTTP standard proxy protocol. /// /// You can use this class to set up a connection to an HTTP proxy server. Calling the /// CreateConnection() method initiates the proxy connection and returns a standard /// System.Net.Socks.TcpClient object that can be used as normal. The proxy plumbing /// is all handled for you. /// /// /// /// /// public class HttpProxyClient : IProxyClient { private string _proxyHost; private int _proxyPort; private HttpResponseCodes _respCode; private string _respText; private TcpClient _tcpClient; private const int HTTP_PROXY_DEFAULT_PORT = 8080; private const string HTTP_PROXY_CONNECT_CMD = "CONNECT {0}:{1} HTTP/1.0\r\nHost: {0}:{1}\r\n\r\n"; private const int WAIT_FOR_DATA_INTERVAL = 50; // 50 ms private const int WAIT_FOR_DATA_TIMEOUT = 15000; // 15 seconds private const string PROXY_NAME = "HTTP"; private enum HttpResponseCodes { None = 0, Continue = 100, SwitchingProtocols = 101, OK = 200, Created = 201, Accepted = 202, NonAuthoritiveInformation = 203, NoContent = 204, ResetContent = 205, PartialContent = 206, MultipleChoices = 300, MovedPermanetly = 301, Found = 302, SeeOther = 303, NotModified = 304, UserProxy = 305, TemporaryRedirect = 307, BadRequest = 400, Unauthorized = 401, PaymentRequired = 402, Forbidden = 403, NotFound = 404, MethodNotAllowed = 405, NotAcceptable = 406, ProxyAuthenticantionRequired = 407, RequestTimeout = 408, Conflict = 409, Gone = 410, PreconditionFailed = 411, RequestEntityTooLarge = 413, RequestURITooLong = 414, UnsupportedMediaType = 415, RequestedRangeNotSatisfied = 416, ExpectationFailed = 417, InternalServerError = 500, NotImplemented = 501, BadGateway = 502, ServiceUnavailable = 503, GatewayTimeout = 504, HTTPVersionNotSupported = 505 } /// /// Constructor. /// public HttpProxyClient() { } /// /// Creates a HTTP proxy client object using the supplied TcpClient object connection. /// /// A TcpClient connection object. public HttpProxyClient(TcpClient tcpClient) { if (tcpClient == null) throw new ArgumentNullException("tcpClient"); _tcpClient = tcpClient; } /// /// Constructor. The default HTTP proxy port 8080 is used. /// /// Host name or IP address of the proxy. public HttpProxyClient(string proxyHost) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); _proxyHost = proxyHost; _proxyPort = HTTP_PROXY_DEFAULT_PORT; } /// /// Constructor. /// /// Host name or IP address of the proxy server. /// Port number for the proxy server. public HttpProxyClient(string proxyHost, int proxyPort) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); _proxyHost = proxyHost; _proxyPort = proxyPort; } /// /// Gets or sets host name or IP address of the proxy server. /// public string ProxyHost { get { return _proxyHost; } set { _proxyHost = value; } } /// /// Gets or sets port number for the proxy server. /// public int ProxyPort { get { return _proxyPort; } set { _proxyPort = value; } } /// /// Gets String representing the name of the proxy. /// /// This property will always return the value 'HTTP' public string ProxyName { get { return PROXY_NAME; } } /// /// Gets or sets the TcpClient object. /// This property can be set prior to executing CreateConnection to use an existing TcpClient connection. /// public TcpClient TcpClient { get { return _tcpClient; } set { _tcpClient = value; } } /// /// Creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public TcpClient CreateConnection(string destinationHost, int destinationPort) { try { // if we have no connection, create one if (_tcpClient == null) { if (String.IsNullOrEmpty(_proxyHost)) throw new ProxyException("ProxyHost property must contain a value."); if (_proxyPort <= 0 || _proxyPort > 65535) throw new ProxyException("ProxyPort value must be greater than zero and less than 65535"); // create new tcp client object to the proxy server _tcpClient = new TcpClient(); // attempt to open the connection _tcpClient.Connect(_proxyHost, _proxyPort); } // send connection command to proxy host for the specified destination host and port SendConnectionCommand(destinationHost, destinationPort); // return the open proxied tcp client object to the caller for normal use return _tcpClient; } catch (SocketException ex) { throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "Connection to proxy host {0} on port {1} failed.", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient)), ex); } } private void SendConnectionCommand(string host, int port) { NetworkStream stream = _tcpClient.GetStream(); // PROXY SERVER REQUEST // ======================================================================= //CONNECT starksoft.com:443 HTTP/1.0 //HOST starksoft.com:443 //[... other HTTP header lines ending with if required]> // // Last Empty Line string connectCmd = String.Format(CultureInfo.InvariantCulture, HTTP_PROXY_CONNECT_CMD, host, port.ToString(CultureInfo.InvariantCulture)); byte[] request = ASCIIEncoding.ASCII.GetBytes(connectCmd); // send the connect request stream.Write(request, 0, request.Length); // wait for the proxy server to respond WaitForData(stream); // PROXY SERVER RESPONSE // ======================================================================= //HTTP/1.0 200 Connection Established //[.... other HTTP header lines ending with .. //ignore all of them] // // Last Empty Line // create an byte response array byte[] response = new byte[_tcpClient.ReceiveBufferSize]; StringBuilder sbuilder = new StringBuilder(); int bytes = 0; long total = 0; do { bytes = stream.Read(response, 0, _tcpClient.ReceiveBufferSize); total += bytes; sbuilder.Append(System.Text.ASCIIEncoding.UTF8.GetString(response, 0, bytes)); } while (stream.DataAvailable); ParseResponse(sbuilder.ToString()); // evaluate the reply code for an error condition if (_respCode != HttpResponseCodes.OK) HandleProxyCommandError(host, port); } private void HandleProxyCommandError(string host, int port) { string msg; switch (_respCode) { case HttpResponseCodes.None: msg = String.Format(CultureInfo.InvariantCulture, "Proxy destination {0} on port {1} failed to return a recognized HTTP response code. Server response: {2}", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient), _respText); break; case HttpResponseCodes.BadGateway: //HTTP/1.1 502 Proxy Error (The specified Secure Sockets Layer (SSL) port is not allowed. ISA Server is not configured to allow SSL requests from this port. Most Web browsers use port 443 for SSL requests.) msg = String.Format(CultureInfo.InvariantCulture, "Proxy destination {0} on port {1} responded with a 502 code - Bad Gateway. If you are connecting to a Microsoft ISA destination please refer to knowledge based article Q283284 for more information. Server response: {2}", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient), _respText); break; default: msg = String.Format(CultureInfo.InvariantCulture, "Proxy destination {0} on port {1} responded with a {2} code - {3}", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient), ((int)_respCode).ToString(CultureInfo.InvariantCulture), _respText); break; } // throw a new application exception throw new ProxyException(msg); } private void WaitForData(NetworkStream stream) { int sleepTime = 0; while (!stream.DataAvailable) { Thread.Sleep(WAIT_FOR_DATA_INTERVAL); sleepTime += WAIT_FOR_DATA_INTERVAL; if (sleepTime > WAIT_FOR_DATA_TIMEOUT) throw new ProxyException(String.Format("A timeout while waiting for the proxy server at {0} on port {1} to respond.", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient) )); } } private void ParseResponse(string response) { string[] data = null; // get rid of the LF character if it exists and then split the string on all CR data = response.Replace('\n', ' ').Split('\r'); ParseCodeAndText(data[0]); } private void ParseCodeAndText(string line) { int begin = 0; int end = 0; string val = null; if (line.IndexOf("HTTP") == -1) throw new ProxyException(String.Format("No HTTP response received from proxy destination. Server response: {0}.", line)); begin = line.IndexOf(" ") + 1; end = line.IndexOf(" ", begin); val = line.Substring(begin, end - begin); Int32 code = 0; if (!Int32.TryParse(val, out code)) throw new ProxyException(String.Format("An invalid response code was received from proxy destination. Server response: {0}.", line)); _respCode = (HttpResponseCodes)code; _respText = line.Substring(end + 1).Trim(); } #region "Async Methods" private BackgroundWorker _asyncWorker; private Exception _asyncException; bool _asyncCancelled; /// /// Gets a value indicating whether an asynchronous operation is running. /// /// Returns true if an asynchronous operation is running; otherwise, false. /// public bool IsBusy { get { return _asyncWorker == null ? false : _asyncWorker.IsBusy; } } /// /// Gets a value indicating whether an asynchronous operation is cancelled. /// /// Returns true if an asynchronous operation is cancelled; otherwise, false. /// public bool IsAsyncCancelled { get { return _asyncCancelled; } } /// /// Cancels any asychronous operation that is currently active. /// public void CancelAsync() { if (_asyncWorker != null && !_asyncWorker.CancellationPending && _asyncWorker.IsBusy) { _asyncCancelled = true; _asyncWorker.CancelAsync(); } } private void CreateAsyncWorker() { if (_asyncWorker != null) _asyncWorker.Dispose(); _asyncException = null; _asyncWorker = null; _asyncCancelled = false; _asyncWorker = new BackgroundWorker(); } /// /// Event handler for CreateConnectionAsync method completed. /// public event EventHandler CreateConnectionAsyncCompleted; /// /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public void CreateConnectionAsync(string destinationHost, int destinationPort) { if (_asyncWorker != null && _asyncWorker.IsBusy) throw new InvalidOperationException("The HttpProxy object is already busy executing another asynchronous operation. You can only execute one asychronous method at a time."); CreateAsyncWorker(); _asyncWorker.WorkerSupportsCancellation = true; _asyncWorker.DoWork += new DoWorkEventHandler(CreateConnectionAsync_DoWork); _asyncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CreateConnectionAsync_RunWorkerCompleted); Object[] args = new Object[2]; args[0] = destinationHost; args[1] = destinationPort; _asyncWorker.RunWorkerAsync(args); } private void CreateConnectionAsync_DoWork(object sender, DoWorkEventArgs e) { try { Object[] args = (Object[])e.Argument; e.Result = CreateConnection((string)args[0], (int)args[1]); } catch (Exception ex) { _asyncException = ex; } } private void CreateConnectionAsync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (CreateConnectionAsyncCompleted != null) CreateConnectionAsyncCompleted(this, new CreateConnectionAsyncCompletedEventArgs(_asyncException, _asyncCancelled, (TcpClient)e.Result)); } #endregion } } smuxi-0.11/lib/SmartIrc4net/src/starksoftproxy/Socks4ProxyClient.cs0000644000175000017500000006030612253423361026300 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Text; using System.Net; using System.Net.Sockets; using System.Globalization; using System.IO; using System.Threading; using System.ComponentModel; namespace Starksoft.Net.Proxy { /// /// Socks4 connection proxy class. This class implements the Socks4 standard proxy protocol. /// /// /// This class implements the Socks4 proxy protocol standard for TCP communciations. /// public class Socks4ProxyClient : IProxyClient { private const int WAIT_FOR_DATA_INTERVAL = 50; // 50 ms private const int WAIT_FOR_DATA_TIMEOUT = 15000; // 15 seconds private const string PROXY_NAME = "SOCKS4"; private TcpClient _tcpClient; private string _proxyHost; private int _proxyPort; private string _proxyUserId; /// /// Default Socks4 proxy port. /// internal const int SOCKS_PROXY_DEFAULT_PORT = 1080; /// /// Socks4 version number. /// internal const byte SOCKS4_VERSION_NUMBER = 4; /// /// Socks4 connection command value. /// internal const byte SOCKS4_CMD_CONNECT = 0x01; /// /// Socks4 bind command value. /// internal const byte SOCKS4_CMD_BIND = 0x02; /// /// Socks4 reply request grant response value. /// internal const byte SOCKS4_CMD_REPLY_REQUEST_GRANTED = 90; /// /// Socks4 reply request rejected or failed response value. /// internal const byte SOCKS4_CMD_REPLY_REQUEST_REJECTED_OR_FAILED = 91; /// /// Socks4 reply request rejected becauase the proxy server can not connect to the IDENTD server value. /// internal const byte SOCKS4_CMD_REPLY_REQUEST_REJECTED_CANNOT_CONNECT_TO_IDENTD = 92; /// /// Socks4 reply request rejected because of a different IDENTD server. /// internal const byte SOCKS4_CMD_REPLY_REQUEST_REJECTED_DIFFERENT_IDENTD = 93; /// /// Create a Socks4 proxy client object. The default proxy port 1080 is used. /// public Socks4ProxyClient() { } /// /// Creates a Socks4 proxy client object using the supplied TcpClient object connection. /// /// A TcpClient connection object. public Socks4ProxyClient(TcpClient tcpClient) { if (tcpClient == null) throw new ArgumentNullException("tcpClient"); _tcpClient = tcpClient; } /// /// Create a Socks4 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. /// Proxy user identification information. public Socks4ProxyClient(string proxyHost, string proxyUserId) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyUserId == null) throw new ArgumentNullException("proxyUserId"); _proxyHost = proxyHost; _proxyPort = SOCKS_PROXY_DEFAULT_PORT; _proxyUserId = proxyUserId; } /// /// Create a Socks4 proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. /// Proxy user identification information. public Socks4ProxyClient(string proxyHost, int proxyPort, string proxyUserId) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); if (proxyUserId == null) throw new ArgumentNullException("proxyUserId"); _proxyHost = proxyHost; _proxyPort = proxyPort; _proxyUserId = proxyUserId; } /// /// Create a Socks4 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. public Socks4ProxyClient(string proxyHost) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); _proxyHost = proxyHost; _proxyPort = SOCKS_PROXY_DEFAULT_PORT; } /// /// Create a Socks4 proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. public Socks4ProxyClient(string proxyHost, int proxyPort) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); _proxyHost = proxyHost; _proxyPort = proxyPort; } /// /// Gets or sets host name or IP address of the proxy server. /// public string ProxyHost { get { return _proxyHost; } set { _proxyHost = value; } } /// /// Gets or sets port used to connect to proxy server. /// public int ProxyPort { get { return _proxyPort; } set { _proxyPort = value; } } /// /// Gets String representing the name of the proxy. /// /// This property will always return the value 'SOCKS4' virtual public string ProxyName { get { return PROXY_NAME; } } /// /// Gets or sets proxy user identification information. /// public string ProxyUserId { get { return _proxyUserId; } set { _proxyUserId = value; } } /// /// Gets or sets the TcpClient object. /// This property can be set prior to executing CreateConnection to use an existing TcpClient connection. /// public TcpClient TcpClient { get { return _tcpClient; } set { _tcpClient = value; } } /// /// Creates a TCP connection to the destination host through the proxy server /// host. /// /// Destination host name or IP address of the destination server. /// Port number to connect to on the destination server. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public TcpClient CreateConnection(string destinationHost, int destinationPort) { if (String.IsNullOrEmpty(destinationHost)) throw new ArgumentNullException("destinationHost"); if (destinationPort <= 0 || destinationPort > 65535) throw new ArgumentOutOfRangeException("destinationPort", "port must be greater than zero and less than 65535"); try { // if we have no connection, create one if (_tcpClient == null) { if (String.IsNullOrEmpty(_proxyHost)) throw new ProxyException("ProxyHost property must contain a value."); if (_proxyPort <= 0 || _proxyPort > 65535) throw new ProxyException("ProxyPort value must be greater than zero and less than 65535"); // create new tcp client object to the proxy server _tcpClient = new TcpClient(); // attempt to open the connection _tcpClient.Connect(_proxyHost, _proxyPort); } // send connection command to proxy host for the specified destination host and port SendCommand(_tcpClient.GetStream(), SOCKS4_CMD_CONNECT, destinationHost, destinationPort, _proxyUserId); // return the open proxied tcp client object to the caller for normal use return _tcpClient; } catch (Exception ex) { throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "Connection to proxy host {0} on port {1} failed.", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient)), ex); } } /// /// Sends a command to the proxy server. /// /// Proxy server data stream. /// Proxy byte command to execute. /// Destination host name or IP address. /// Destination port number /// IDENTD user ID value. internal virtual void SendCommand(NetworkStream proxy, byte command, string destinationHost, int destinationPort, string userId) { // PROXY SERVER REQUEST // The client connects to the SOCKS server and sends a CONNECT request when // it wants to establish a connection to an application server. The client // includes in the request packet the IP address and the port number of the // destination host, and userid, in the following format. // // +----+----+----+----+----+----+----+----+----+----+....+----+ // | VN | CD | DSTPORT | DSTIP | USERID |NULL| // +----+----+----+----+----+----+----+----+----+----+....+----+ // # of bytes: 1 1 2 4 variable 1 // // VN is the SOCKS protocol version number and should be 4. CD is the // SOCKS command code and should be 1 for CONNECT request. NULL is a byte // of all zero bits. // userId needs to be a zero length string so that the GetBytes method // works properly if (userId == null) userId = ""; byte[] destIp = GetIPAddressBytes(destinationHost); byte[] destPort = GetDestinationPortBytes(destinationPort); byte[] userIdBytes = ASCIIEncoding.ASCII.GetBytes(userId); byte[] request = new byte[9 + userIdBytes.Length]; // set the bits on the request byte array request[0] = SOCKS4_VERSION_NUMBER; request[1] = command; destPort.CopyTo(request, 2); destIp.CopyTo(request, 4); userIdBytes.CopyTo(request, 8); request[8 + userIdBytes.Length] = 0x00; // null (byte with all zeros) terminator for userId // send the connect request proxy.Write(request, 0, request.Length); // wait for the proxy server to respond WaitForData(proxy); // PROXY SERVER RESPONSE // The SOCKS server checks to see whether such a request should be granted // based on any combination of source IP address, destination IP address, // destination port number, the userid, and information it may obtain by // consulting IDENT, cf. RFC 1413. If the request is granted, the SOCKS // server makes a connection to the specified port of the destination host. // A reply packet is sent to the client when this connection is established, // or when the request is rejected or the operation fails. // // +----+----+----+----+----+----+----+----+ // | VN | CD | DSTPORT | DSTIP | // +----+----+----+----+----+----+----+----+ // # of bytes: 1 1 2 4 // // VN is the version of the reply code and should be 0. CD is the result // code with one of the following values: // // 90: request granted // 91: request rejected or failed // 92: request rejected becuase SOCKS server cannot connect to // identd on the client // 93: request rejected because the client program and identd // report different user-ids // // The remaining fields are ignored. // // The SOCKS server closes its connection immediately after notifying // the client of a failed or rejected request. For a successful request, // the SOCKS server gets ready to relay traffic on both directions. This // enables the client to do I/O on its connection as if it were directly // connected to the application server. // create an 8 byte response array byte[] response = new byte[8]; // read the resonse from the network stream proxy.Read(response, 0, 8); // evaluate the reply code for an error condition if (response[1] != SOCKS4_CMD_REPLY_REQUEST_GRANTED) HandleProxyCommandError(response, destinationHost, destinationPort); } /// /// Translate the host name or IP address to a byte array. /// /// Host name or IP address. /// Byte array representing IP address in bytes. internal byte[] GetIPAddressBytes(string destinationHost) { IPAddress ipAddr = null; // if the address doesn't parse then try to resolve with dns if (!IPAddress.TryParse(destinationHost, out ipAddr)) { try { ipAddr = Dns.GetHostEntry(destinationHost).AddressList[0]; } catch (Exception ex) { throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "A error occurred while attempting to DNS resolve the host name {0}.", destinationHost), ex); } } // return address bytes return ipAddr.GetAddressBytes(); } /// /// Translate the destination port value to a byte array. /// /// Destination port. /// Byte array representing an 16 bit port number as two bytes. internal byte[] GetDestinationPortBytes(int value) { byte[] array = new byte[2]; array[0] = Convert.ToByte(value / 256); array[1] = Convert.ToByte(value % 256); return array; } /// /// Receive a byte array from the proxy server and determine and handle and errors that may have occurred. /// /// Proxy server command response as a byte array. /// Destination host. /// Destination port number. internal void HandleProxyCommandError(byte[] response, string destinationHost, int destinationPort) { if (response == null) throw new ArgumentNullException("response"); // extract the reply code byte replyCode = response[1]; // extract the ip v4 address (4 bytes) byte[] ipBytes = new byte[4]; for (int i = 0; i < 4; i++) ipBytes[i] = response[i + 4]; // convert the ip address to an IPAddress object IPAddress ipAddr = new IPAddress(ipBytes); // extract the port number big endian (2 bytes) byte[] portBytes = new byte[2]; portBytes[0] = response[3]; portBytes[1] = response[2]; Int16 port = BitConverter.ToInt16(portBytes, 0); // translate the reply code error number to human readable text string proxyErrorText; switch (replyCode) { case SOCKS4_CMD_REPLY_REQUEST_REJECTED_OR_FAILED: proxyErrorText = "connection request was rejected or failed"; break; case SOCKS4_CMD_REPLY_REQUEST_REJECTED_CANNOT_CONNECT_TO_IDENTD: proxyErrorText = "connection request was rejected because SOCKS destination cannot connect to identd on the client"; break; case SOCKS4_CMD_REPLY_REQUEST_REJECTED_DIFFERENT_IDENTD: proxyErrorText = "connection request rejected because the client program and identd report different user-ids"; break; default: proxyErrorText = String.Format(CultureInfo.InvariantCulture, "proxy client received an unknown reply with the code value '{0}' from the proxy destination", replyCode.ToString(CultureInfo.InvariantCulture)); break; } // build the exeception message string string exceptionMsg = String.Format(CultureInfo.InvariantCulture, "The {0} concerning destination host {1} port number {2}. The destination reported the host as {3} port {4}.", proxyErrorText, destinationHost, destinationPort, ipAddr.ToString(), port.ToString(CultureInfo.InvariantCulture)); // throw a new application exception throw new ProxyException(exceptionMsg); } internal void WaitForData(NetworkStream stream) { int sleepTime = 0; while (!stream.DataAvailable) { Thread.Sleep(WAIT_FOR_DATA_INTERVAL); sleepTime += WAIT_FOR_DATA_INTERVAL; if (sleepTime > WAIT_FOR_DATA_TIMEOUT) throw new ProxyException("A timeout while waiting for the proxy destination to respond."); } } #region "Async Methods" private BackgroundWorker _asyncWorker; private Exception _asyncException; bool _asyncCancelled; /// /// Gets a value indicating whether an asynchronous operation is running. /// /// Returns true if an asynchronous operation is running; otherwise, false. /// public bool IsBusy { get { return _asyncWorker == null ? false : _asyncWorker.IsBusy; } } /// /// Gets a value indicating whether an asynchronous operation is cancelled. /// /// Returns true if an asynchronous operation is cancelled; otherwise, false. /// public bool IsAsyncCancelled { get { return _asyncCancelled; } } /// /// Cancels any asychronous operation that is currently active. /// public void CancelAsync() { if (_asyncWorker != null && !_asyncWorker.CancellationPending && _asyncWorker.IsBusy) { _asyncCancelled = true; _asyncWorker.CancelAsync(); } } private void CreateAsyncWorker() { if (_asyncWorker != null) _asyncWorker.Dispose(); _asyncException = null; _asyncWorker = null; _asyncCancelled = false; _asyncWorker = new BackgroundWorker(); } /// /// Event handler for CreateConnectionAsync method completed. /// public event EventHandler CreateConnectionAsyncCompleted; /// /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port /// using the supplied open TcpClient object with an open connection to proxy server. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns TcpClient object that can be used normally to communicate /// with the destination server. /// /// /// This instructs the proxy server to make a pass through connection to the specified destination host on the specified /// port. /// public void CreateConnectionAsync(string destinationHost, int destinationPort) { if (_asyncWorker != null && _asyncWorker.IsBusy) throw new InvalidOperationException("The Socks4/4a object is already busy executing another asynchronous operation. You can only execute one asychronous method at a time."); CreateAsyncWorker(); _asyncWorker.WorkerSupportsCancellation = true; _asyncWorker.DoWork += new DoWorkEventHandler(CreateConnectionAsync_DoWork); _asyncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CreateConnectionAsync_RunWorkerCompleted); Object[] args = new Object[2]; args[0] = destinationHost; args[1] = destinationPort; _asyncWorker.RunWorkerAsync(args); } private void CreateConnectionAsync_DoWork(object sender, DoWorkEventArgs e) { try { Object[] args = (Object[])e.Argument; e.Result = CreateConnection((string)args[0], (int)args[1]); } catch (Exception ex) { _asyncException = ex; } } private void CreateConnectionAsync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (CreateConnectionAsyncCompleted != null) CreateConnectionAsyncCompleted(this, new CreateConnectionAsyncCompletedEventArgs(_asyncException, _asyncCancelled, (TcpClient)e.Result)); } #endregion } } smuxi-0.11/lib/SmartIrc4net/src/starksoftproxy/EventArgs/0000755000175000017500000000000012253423361024273 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/src/starksoftproxy/EventArgs/CreateConnectionAsyncCompletedEventArgs.cs0000644000175000017500000000446712253423361034532 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Net.Sockets; using System.ComponentModel; namespace Starksoft.Net.Proxy { /// /// Event arguments class for the EncryptAsyncCompleted event. /// public class CreateConnectionAsyncCompletedEventArgs : AsyncCompletedEventArgs { private TcpClient _proxyConnection; /// /// Constructor. /// /// Exception information generated by the event. /// Cancelled event flag. This flag is set to true if the event was cancelled. /// Proxy Connection. The initialized and open TcpClient proxy connection. public CreateConnectionAsyncCompletedEventArgs(Exception error, bool cancelled, TcpClient proxyConnection) : base(error, cancelled, null) { _proxyConnection = proxyConnection; } /// /// The proxy connection. /// public TcpClient ProxyConnection { get { return _proxyConnection; } } } } smuxi-0.11/lib/SmartIrc4net/src/starksoftproxy/Socks5ProxyClient.cs0000644000175000017500000007701512253423361026306 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Text; using System.Net; using System.Net.Sockets; using System.Globalization; using System.ComponentModel; namespace Starksoft.Net.Proxy { /// /// Socks5 connection proxy class. This class implements the Socks5 standard proxy protocol. /// /// /// This implementation supports TCP proxy connections with a Socks v5 server. /// public class Socks5ProxyClient : IProxyClient { private string _proxyHost; private int _proxyPort; private string _proxyUserName; private string _proxyPassword; private SocksAuthentication _proxyAuthMethod; private TcpClient _tcpClient; private const string PROXY_NAME = "SOCKS5"; private const int SOCKS5_DEFAULT_PORT = 1080; private const byte SOCKS5_VERSION_NUMBER = 5; private const byte SOCKS5_RESERVED = 0x00; private const byte SOCKS5_AUTH_NUMBER_OF_AUTH_METHODS_SUPPORTED = 2; private const byte SOCKS5_AUTH_METHOD_NO_AUTHENTICATION_REQUIRED = 0x00; private const byte SOCKS5_AUTH_METHOD_GSSAPI = 0x01; private const byte SOCKS5_AUTH_METHOD_USERNAME_PASSWORD = 0x02; private const byte SOCKS5_AUTH_METHOD_IANA_ASSIGNED_RANGE_BEGIN = 0x03; private const byte SOCKS5_AUTH_METHOD_IANA_ASSIGNED_RANGE_END = 0x7f; private const byte SOCKS5_AUTH_METHOD_RESERVED_RANGE_BEGIN = 0x80; private const byte SOCKS5_AUTH_METHOD_RESERVED_RANGE_END = 0xfe; private const byte SOCKS5_AUTH_METHOD_REPLY_NO_ACCEPTABLE_METHODS = 0xff; private const byte SOCKS5_CMD_CONNECT = 0x01; private const byte SOCKS5_CMD_BIND = 0x02; private const byte SOCKS5_CMD_UDP_ASSOCIATE = 0x03; private const byte SOCKS5_CMD_REPLY_SUCCEEDED = 0x00; private const byte SOCKS5_CMD_REPLY_GENERAL_SOCKS_SERVER_FAILURE = 0x01; private const byte SOCKS5_CMD_REPLY_CONNECTION_NOT_ALLOWED_BY_RULESET = 0x02; private const byte SOCKS5_CMD_REPLY_NETWORK_UNREACHABLE = 0x03; private const byte SOCKS5_CMD_REPLY_HOST_UNREACHABLE = 0x04; private const byte SOCKS5_CMD_REPLY_CONNECTION_REFUSED = 0x05; private const byte SOCKS5_CMD_REPLY_TTL_EXPIRED = 0x06; private const byte SOCKS5_CMD_REPLY_COMMAND_NOT_SUPPORTED = 0x07; private const byte SOCKS5_CMD_REPLY_ADDRESS_TYPE_NOT_SUPPORTED = 0x08; private const byte SOCKS5_ADDRTYPE_IPV4 = 0x01; private const byte SOCKS5_ADDRTYPE_DOMAIN_NAME = 0x03; private const byte SOCKS5_ADDRTYPE_IPV6 = 0x04; /// /// Authentication itemType. /// private enum SocksAuthentication { /// /// No authentication used. /// None, /// /// Username and password authentication. /// UsernamePassword } /// /// Create a Socks5 proxy client object. /// public Socks5ProxyClient() { } /// /// Creates a Socks5 proxy client object using the supplied TcpClient object connection. /// /// A TcpClient connection object. public Socks5ProxyClient(TcpClient tcpClient) { if (tcpClient == null) throw new ArgumentNullException("tcpClient"); _tcpClient = tcpClient; } /// /// Create a Socks5 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. public Socks5ProxyClient(string proxyHost) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); _proxyHost = proxyHost; _proxyPort = SOCKS5_DEFAULT_PORT; } /// /// Create a Socks5 proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. public Socks5ProxyClient(string proxyHost, int proxyPort) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); _proxyHost = proxyHost; _proxyPort = proxyPort; } /// /// Create a Socks5 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. /// Proxy authentication user name. /// Proxy authentication password. public Socks5ProxyClient(string proxyHost, string proxyUserName, string proxyPassword) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyUserName == null) throw new ArgumentNullException("proxyUserName"); if (proxyPassword == null) throw new ArgumentNullException("proxyPassword"); _proxyHost = proxyHost; _proxyPort = SOCKS5_DEFAULT_PORT; _proxyUserName = proxyUserName; _proxyPassword = proxyPassword; } /// /// Create a Socks5 proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. /// Proxy authentication user name. /// Proxy authentication password. public Socks5ProxyClient(string proxyHost, int proxyPort, string proxyUserName, string proxyPassword) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); if (proxyUserName == null) throw new ArgumentNullException("proxyUserName"); if (proxyPassword == null) throw new ArgumentNullException("proxyPassword"); _proxyHost = proxyHost; _proxyPort = proxyPort; _proxyUserName = proxyUserName; _proxyPassword = proxyPassword; } /// /// Gets or sets host name or IP address of the proxy server. /// public string ProxyHost { get { return _proxyHost; } set { _proxyHost = value; } } /// /// Gets or sets port used to connect to proxy server. /// public int ProxyPort { get { return _proxyPort; } set { _proxyPort = value; } } /// /// Gets String representing the name of the proxy. /// /// This property will always return the value 'SOCKS5' public string ProxyName { get { return PROXY_NAME; } } /// /// Gets or sets proxy authentication user name. /// public string ProxyUserName { get { return _proxyUserName; } set { _proxyUserName = value; } } /// /// Gets or sets proxy authentication password. /// public string ProxyPassword { get { return _proxyPassword; } set { _proxyPassword = value; } } /// /// Gets or sets the TcpClient object. /// This property can be set prior to executing CreateConnection to use an existing TcpClient connection. /// public TcpClient TcpClient { get { return _tcpClient; } set { _tcpClient = value; } } /// /// Creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address of the destination server. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public TcpClient CreateConnection(string destinationHost, int destinationPort) { if (String.IsNullOrEmpty(destinationHost)) throw new ArgumentNullException("destinationHost"); if (destinationPort <= 0 || destinationPort > 65535) throw new ArgumentOutOfRangeException("destinationPort", "port must be greater than zero and less than 65535"); try { // if we have no connection, create one if (_tcpClient == null) { if (String.IsNullOrEmpty(_proxyHost)) throw new ProxyException("ProxyHost property must contain a value."); if (_proxyPort <= 0 || _proxyPort > 65535) throw new ProxyException("ProxyPort value must be greater than zero and less than 65535"); // create new tcp client object to the proxy server _tcpClient = new TcpClient(); // attempt to open the connection _tcpClient.Connect(_proxyHost, _proxyPort); } // determine which authentication method the client would like to use DetermineClientAuthMethod(); // negotiate which authentication methods are supported / accepted by the server NegotiateServerAuthMethod(); // send a connect command to the proxy server for destination host and port SendCommand(SOCKS5_CMD_CONNECT, destinationHost, destinationPort); // return the open proxied tcp client object to the caller for normal use return _tcpClient; } catch (Exception ex) { throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "Connection to proxy host {0} on port {1} failed.", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient)), ex); } } private void DetermineClientAuthMethod() { // set the authentication itemType used based on values inputed by the user if (_proxyUserName != null && _proxyPassword != null) _proxyAuthMethod = SocksAuthentication.UsernamePassword; else _proxyAuthMethod = SocksAuthentication.None; } private void NegotiateServerAuthMethod() { // get a reference to the network stream NetworkStream stream = _tcpClient.GetStream(); // SERVER AUTHENTICATION REQUEST // The client connects to the server, and sends a version // identifier/method selection message: // // +----+----------+----------+ // |VER | NMETHODS | METHODS | // +----+----------+----------+ // | 1 | 1 | 1 to 255 | // +----+----------+----------+ byte[] authRequest = new byte[4]; authRequest[0] = SOCKS5_VERSION_NUMBER; authRequest[1] = SOCKS5_AUTH_NUMBER_OF_AUTH_METHODS_SUPPORTED; authRequest[2] = SOCKS5_AUTH_METHOD_NO_AUTHENTICATION_REQUIRED; authRequest[3] = SOCKS5_AUTH_METHOD_USERNAME_PASSWORD; // send the request to the server specifying authentication types supported by the client. stream.Write(authRequest, 0, authRequest.Length); // SERVER AUTHENTICATION RESPONSE // The server selects from one of the methods given in METHODS, and // sends a METHOD selection message: // // +----+--------+ // |VER | METHOD | // +----+--------+ // | 1 | 1 | // +----+--------+ // // If the selected METHOD is X'FF', none of the methods listed by the // client are acceptable, and the client MUST close the connection. // // The values currently defined for METHOD are: // * X'00' NO AUTHENTICATION REQUIRED // * X'01' GSSAPI // * X'02' USERNAME/PASSWORD // * X'03' to X'7F' IANA ASSIGNED // * X'80' to X'FE' RESERVED FOR PRIVATE METHODS // * X'FF' NO ACCEPTABLE METHODS // receive the server response byte[] response = new byte[2]; stream.Read(response, 0, response.Length); // the first byte contains the socks version number (e.g. 5) // the second byte contains the auth method acceptable to the proxy server byte acceptedAuthMethod = response[1]; // if the server does not accept any of our supported authenication methods then throw an error if (acceptedAuthMethod == SOCKS5_AUTH_METHOD_REPLY_NO_ACCEPTABLE_METHODS) { _tcpClient.Close(); throw new ProxyException("The proxy destination does not accept the supported proxy client authentication methods."); } // if the server accepts a username and password authentication and none is provided by the user then throw an error if (acceptedAuthMethod == SOCKS5_AUTH_METHOD_USERNAME_PASSWORD && _proxyAuthMethod == SocksAuthentication.None) { _tcpClient.Close(); throw new ProxyException("The proxy destination requires a username and password for authentication."); } if (acceptedAuthMethod == SOCKS5_AUTH_METHOD_USERNAME_PASSWORD) { // USERNAME / PASSWORD SERVER REQUEST // Once the SOCKS V5 server has started, and the client has selected the // Username/Password Authentication protocol, the Username/Password // subnegotiation begins. This begins with the client producing a // Username/Password request: // // +----+------+----------+------+----------+ // |VER | ULEN | UNAME | PLEN | PASSWD | // +----+------+----------+------+----------+ // | 1 | 1 | 1 to 255 | 1 | 1 to 255 | // +----+------+----------+------+----------+ byte[] credentials = new byte[_proxyUserName.Length + _proxyPassword.Length + 3]; credentials[0] = 1; credentials[1] = (byte)_proxyUserName.Length; Array.Copy(ASCIIEncoding.ASCII.GetBytes(_proxyUserName), 0, credentials, 2, _proxyUserName.Length); credentials[_proxyUserName.Length + 2] = (byte)_proxyPassword.Length; Array.Copy(ASCIIEncoding.ASCII.GetBytes(_proxyPassword), 0, credentials, _proxyUserName.Length + 3, _proxyPassword.Length); // USERNAME / PASSWORD SERVER RESPONSE // The server verifies the supplied UNAME and PASSWD, and sends the // following response: // // +----+--------+ // |VER | STATUS | // +----+--------+ // | 1 | 1 | // +----+--------+ // // A STATUS field of X'00' indicates success. If the server returns a // `failure' (STATUS value other than X'00') status, it MUST close the // connection. stream.Write(credentials, 0, credentials.Length); byte[] crResponse = new byte[2]; stream.Read(crResponse, 0, crResponse.Length); if (crResponse[1] != 0) { _tcpClient.Close(); throw new ProxyException("Proxy authentification failure!"); } } } private byte GetDestAddressType(string host) { IPAddress ipAddr = null; bool result = IPAddress.TryParse(host, out ipAddr); if (!result) return SOCKS5_ADDRTYPE_DOMAIN_NAME; switch (ipAddr.AddressFamily) { case AddressFamily.InterNetwork: return SOCKS5_ADDRTYPE_IPV4; case AddressFamily.InterNetworkV6: return SOCKS5_ADDRTYPE_IPV6; default: throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "The host addess {0} of type '{1}' is not a supported address type. The supported types are InterNetwork and InterNetworkV6.", host, Enum.GetName(typeof(AddressFamily), ipAddr.AddressFamily))); } } private byte[] GetDestAddressBytes(byte addressType, string host) { switch (addressType) { case SOCKS5_ADDRTYPE_IPV4: case SOCKS5_ADDRTYPE_IPV6: return IPAddress.Parse(host).GetAddressBytes(); case SOCKS5_ADDRTYPE_DOMAIN_NAME: // create a byte array to hold the host name bytes plus one byte to store the length byte[] bytes = new byte[host.Length + 1]; // if the address field contains a fully-qualified domain name. The first // octet of the address field contains the number of octets of name that // follow, there is no terminating NUL octet. bytes[0] = Convert.ToByte(host.Length); Encoding.ASCII.GetBytes(host).CopyTo(bytes, 1); return bytes; default: return null; } } private byte[] GetDestPortBytes(int value) { byte[] array = new byte[2]; array[0] = Convert.ToByte(value / 256); array[1] = Convert.ToByte(value % 256); return array; } private void SendCommand(byte command, string destinationHost, int destinationPort) { NetworkStream stream = _tcpClient.GetStream(); byte addressType = GetDestAddressType(destinationHost); byte[] destAddr = GetDestAddressBytes(addressType, destinationHost); byte[] destPort = GetDestPortBytes(destinationPort); // The connection request is made up of 6 bytes plus the // length of the variable address byte array // // +----+-----+-------+------+----------+----------+ // |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT | // +----+-----+-------+------+----------+----------+ // | 1 | 1 | X'00' | 1 | Variable | 2 | // +----+-----+-------+------+----------+----------+ // // * VER protocol version: X'05' // * CMD // * CONNECT X'01' // * BIND X'02' // * UDP ASSOCIATE X'03' // * RSV RESERVED // * ATYP address itemType of following address // * IP V4 address: X'01' // * DOMAINNAME: X'03' // * IP V6 address: X'04' // * DST.ADDR desired destination address // * DST.PORT desired destination port in network octet order byte[] request = new byte[4 + destAddr.Length + 2]; request[0] = SOCKS5_VERSION_NUMBER; request[1] = command; request[2] = SOCKS5_RESERVED; request[3] = addressType; destAddr.CopyTo(request, 4); destPort.CopyTo(request, 4 + destAddr.Length); // send connect request. stream.Write(request, 0, request.Length); // PROXY SERVER RESPONSE // +----+-----+-------+------+----------+----------+ // |VER | REP | RSV | ATYP | BND.ADDR | BND.PORT | // +----+-----+-------+------+----------+----------+ // | 1 | 1 | X'00' | 1 | Variable | 2 | // +----+-----+-------+------+----------+----------+ // // * VER protocol version: X'05' // * REP Reply field: // * X'00' succeeded // * X'01' general SOCKS server failure // * X'02' connection not allowed by ruleset // * X'03' Network unreachable // * X'04' Host unreachable // * X'05' Connection refused // * X'06' TTL expired // * X'07' Command not supported // * X'08' Address itemType not supported // * X'09' to X'FF' unassigned //* RSV RESERVED //* ATYP address itemType of following address byte[] response = new byte[255]; // read proxy server response var responseSize = stream.Read(response, 0, response.Length); byte replyCode = response[1]; // evaluate the reply code for an error condition if (responseSize < 2 || replyCode != SOCKS5_CMD_REPLY_SUCCEEDED) HandleProxyCommandError(response, destinationHost, destinationPort ); } private void HandleProxyCommandError(byte[] response, string destinationHost, int destinationPort) { string proxyErrorText; byte replyCode = response[1]; byte addrType = response[3]; string addr = ""; Int16 port = 0; switch (addrType) { case SOCKS5_ADDRTYPE_DOMAIN_NAME: int addrLen = Convert.ToInt32(response[4]); byte[] addrBytes = new byte[addrLen]; for (int i = 0; i < addrLen; i++) addrBytes[i] = response[i + 5]; addr = System.Text.ASCIIEncoding.ASCII.GetString(addrBytes); byte[] portBytesDomain = new byte[2]; portBytesDomain[0] = response[6 + addrLen]; portBytesDomain[1] = response[5 + addrLen]; port = BitConverter.ToInt16(portBytesDomain, 0); break; case SOCKS5_ADDRTYPE_IPV4: byte[] ipv4Bytes = new byte[4]; for (int i = 0; i < 4; i++) ipv4Bytes[i] = response[i + 4]; IPAddress ipv4 = new IPAddress(ipv4Bytes); addr = ipv4.ToString(); byte[] portBytesIpv4 = new byte[2]; portBytesIpv4[0] = response[9]; portBytesIpv4[1] = response[8]; port = BitConverter.ToInt16(portBytesIpv4, 0); break; case SOCKS5_ADDRTYPE_IPV6: byte[] ipv6Bytes = new byte[16]; for (int i = 0; i < 16; i++) ipv6Bytes[i] = response[i + 4]; IPAddress ipv6 = new IPAddress(ipv6Bytes); addr = ipv6.ToString(); byte[] portBytesIpv6 = new byte[2]; portBytesIpv6[0] = response[21]; portBytesIpv6[1] = response[20]; port = BitConverter.ToInt16(portBytesIpv6, 0); break; } switch (replyCode) { case SOCKS5_CMD_REPLY_GENERAL_SOCKS_SERVER_FAILURE: proxyErrorText = "a general socks destination failure occurred"; break; case SOCKS5_CMD_REPLY_CONNECTION_NOT_ALLOWED_BY_RULESET: proxyErrorText = "the connection is not allowed by proxy destination rule set"; break; case SOCKS5_CMD_REPLY_NETWORK_UNREACHABLE: proxyErrorText = "the network was unreachable"; break; case SOCKS5_CMD_REPLY_HOST_UNREACHABLE: proxyErrorText = "the host was unreachable"; break; case SOCKS5_CMD_REPLY_CONNECTION_REFUSED: proxyErrorText = "the connection was refused by the remote network"; break; case SOCKS5_CMD_REPLY_TTL_EXPIRED: proxyErrorText = "the time to live (TTL) has expired"; break; case SOCKS5_CMD_REPLY_COMMAND_NOT_SUPPORTED: proxyErrorText = "the command issued by the proxy client is not supported by the proxy destination"; break; case SOCKS5_CMD_REPLY_ADDRESS_TYPE_NOT_SUPPORTED: proxyErrorText = "the address type specified is not supported"; break; default: proxyErrorText = String.Format(CultureInfo.InvariantCulture, "that an unknown reply with the code value '{0}' was received by the destination", replyCode.ToString(CultureInfo.InvariantCulture)); break; } string exceptionMsg = String.Format(CultureInfo.InvariantCulture, "The {0} concerning destination host {1} port number {2}. The destination reported the host as {3} port {4}.", proxyErrorText, destinationHost, destinationPort, addr, port.ToString(CultureInfo.InvariantCulture)); throw new ProxyException(exceptionMsg); } #region "Async Methods" private BackgroundWorker _asyncWorker; private Exception _asyncException; bool _asyncCancelled; /// /// Gets a value indicating whether an asynchronous operation is running. /// /// Returns true if an asynchronous operation is running; otherwise, false. /// public bool IsBusy { get { return _asyncWorker == null ? false : _asyncWorker.IsBusy; } } /// /// Gets a value indicating whether an asynchronous operation is cancelled. /// /// Returns true if an asynchronous operation is cancelled; otherwise, false. /// public bool IsAsyncCancelled { get { return _asyncCancelled; } } /// /// Cancels any asychronous operation that is currently active. /// public void CancelAsync() { if (_asyncWorker != null && !_asyncWorker.CancellationPending && _asyncWorker.IsBusy) { _asyncCancelled = true; _asyncWorker.CancelAsync(); } } private void CreateAsyncWorker() { if (_asyncWorker != null) _asyncWorker.Dispose(); _asyncException = null; _asyncWorker = null; _asyncCancelled = false; _asyncWorker = new BackgroundWorker(); } /// /// Event handler for CreateConnectionAsync method completed. /// public event EventHandler CreateConnectionAsyncCompleted; /// /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns TcpClient object that can be used normally to communicate /// with the destination server. /// /// /// This method instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public void CreateConnectionAsync(string destinationHost, int destinationPort) { if (_asyncWorker != null && _asyncWorker.IsBusy) throw new InvalidOperationException("The Socks4 object is already busy executing another asynchronous operation. You can only execute one asychronous method at a time."); CreateAsyncWorker(); _asyncWorker.WorkerSupportsCancellation = true; _asyncWorker.DoWork += new DoWorkEventHandler(CreateConnectionAsync_DoWork); _asyncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CreateConnectionAsync_RunWorkerCompleted); Object[] args = new Object[2]; args[0] = destinationHost; args[1] = destinationPort; _asyncWorker.RunWorkerAsync(args); } private void CreateConnectionAsync_DoWork(object sender, DoWorkEventArgs e) { try { Object[] args = (Object[])e.Argument; e.Result = CreateConnection((string)args[0], (int)args[1]); } catch (Exception ex) { _asyncException = ex; } } private void CreateConnectionAsync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (CreateConnectionAsyncCompleted != null) CreateConnectionAsyncCompleted(this, new CreateConnectionAsyncCompletedEventArgs(_asyncException, _asyncCancelled, (TcpClient)e.Result)); } #endregion } } smuxi-0.11/lib/SmartIrc4net/src/starksoftproxy/Exceptions/0000755000175000017500000000000012253423361024516 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/src/starksoftproxy/Exceptions/ProxyException.cs0000644000175000017500000000475012253423361030053 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Runtime.Serialization; namespace Starksoft.Net.Proxy { /// /// This exception is thrown when a general, unexpected proxy error. /// [Serializable()] public class ProxyException : Exception { /// /// Constructor. /// public ProxyException() { } /// /// Constructor. /// /// Exception message text. public ProxyException(string message) : base(message) { } /// /// Constructor. /// /// Exception message text. /// The inner exception object. public ProxyException(string message, Exception innerException) : base(message, innerException) { } /// /// Constructor. /// /// Serialization information. /// Stream context information. protected ProxyException(SerializationInfo info, StreamingContext context) : base(info, context) { } } }smuxi-0.11/lib/SmartIrc4net/src/starksoftproxy/IProxyClient.cs0000644000175000017500000000771512253423361025327 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Collections.Generic; using System.Text; using System.Net.Sockets; namespace Starksoft.Net.Proxy { /// /// Proxy client interface. This is the interface that all proxy clients must implement. /// public interface IProxyClient { /// /// Event handler for CreateConnectionAsync method completed. /// event EventHandler CreateConnectionAsyncCompleted; /// /// Gets or sets proxy host name or IP address. /// string ProxyHost { get; set; } /// /// Gets or sets proxy port number. /// int ProxyPort { get; set; } /// /// Gets String representing the name of the proxy. /// string ProxyName { get; } /// /// Gets or set the TcpClient object if one was specified in the constructor. /// TcpClient TcpClient { get; set; } /// /// Creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// TcpClient CreateConnection(string destinationHost, int destinationPort); /// /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// void CreateConnectionAsync(string destinationHost, int destinationPort); } } smuxi-0.11/lib/SmartIrc4net/src/starksoftproxy/Utils.cs0000644000175000017500000000174512253423361024033 0ustar00meebeymeebey00000000000000using System; using System.Text; using System.Globalization; using System.Net.Sockets; namespace Starksoft.Net.Proxy { internal static class Utils { internal static string GetHost(TcpClient client) { if (client == null) throw new ArgumentNullException("client"); string host = ""; try { host = ((System.Net.IPEndPoint)client.Client.RemoteEndPoint).Address.ToString(); } catch { }; return host; } internal static string GetPort(TcpClient client) { if (client == null) throw new ArgumentNullException("client"); string port = ""; try { port = ((System.Net.IPEndPoint)client.Client.RemoteEndPoint).Port.ToString(CultureInfo.InvariantCulture); } catch { }; return port; } } } smuxi-0.11/lib/SmartIrc4net/src/starksoftproxy/Socks4aProxyClient.cs0000644000175000017500000002571212253423361026443 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Text; using System.Net; using System.Net.Sockets; using System.IO; namespace Starksoft.Net.Proxy { /// /// Socks4a connection proxy class. This class implements the Socks4a standard proxy protocol /// which is an extension of the Socks4 protocol /// /// /// In Socks version 4A if the client cannot resolve the destination host's domain name /// to find its IP address the server will attempt to resolve it. /// public class Socks4aProxyClient : Socks4ProxyClient { private const string PROXY_NAME = "SOCKS4a"; /// /// Default constructor. /// public Socks4aProxyClient() : base() { } /// /// Creates a Socks4 proxy client object using the supplied TcpClient object connection. /// /// An open TcpClient object with an established connection. public Socks4aProxyClient(TcpClient tcpClient) : base(tcpClient) { } /// /// Create a Socks4a proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. /// Proxy user identification information for an IDENTD server. public Socks4aProxyClient(string proxyHost, string proxyUserId) : base(proxyHost, proxyUserId) { } /// /// Create a Socks4a proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. /// Proxy user identification information. public Socks4aProxyClient(string proxyHost, int proxyPort, string proxyUserId) : base(proxyHost, proxyPort, proxyUserId) { } /// /// Create a Socks4 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. public Socks4aProxyClient(string proxyHost) : base(proxyHost) { } /// /// Create a Socks4a proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. public Socks4aProxyClient(string proxyHost, int proxyPort) : base(proxyHost, proxyPort) { } /// /// Gets String representing the name of the proxy. /// /// This property will always return the value 'SOCKS4a' public override string ProxyName { get { return PROXY_NAME; } } /// /// Sends a command to the proxy server. /// /// Proxy server data stream. /// Proxy byte command to execute. /// Destination host name or IP address. /// Destination port number /// IDENTD user ID value. /// /// This method override the SendCommand message in the Sock4ProxyClient object. The override adds support for the /// Socks4a extensions which allow the proxy client to optionally command the proxy server to resolve the /// destination host IP address. /// internal override void SendCommand(NetworkStream proxy, byte command, string destinationHost, int destinationPort, string userId) { // PROXY SERVER REQUEST //Please read SOCKS4.protocol first for an description of the version 4 //protocol. This extension is intended to allow the use of SOCKS on hosts //which are not capable of resolving all domain names. // //In version 4, the client sends the following packet to the SOCKS server //to request a CONNECT or a BIND operation: // // +----+----+----+----+----+----+----+----+----+----+....+----+ // | VN | CD | DSTPORT | DSTIP | USERID |NULL| // +----+----+----+----+----+----+----+----+----+----+....+----+ // # of bytes: 1 1 2 4 variable 1 // //VN is the SOCKS protocol version number and should be 4. CD is the //SOCKS command code and should be 1 for CONNECT or 2 for BIND. NULL //is a byte of all zero bits. // //For version 4A, if the client cannot resolve the destination host's //domain name to find its IP address, it should set the first three bytes //of DSTIP to NULL and the last byte to a non-zero value. (This corresponds //to IP address 0.0.0.x, with x nonzero. As decreed by IANA -- The //Internet Assigned Numbers Authority -- such an address is inadmissible //as a destination IP address and thus should never occur if the client //can resolve the domain name.) Following the NULL byte terminating //USERID, the client must sends the destination domain name and termiantes //it with another NULL byte. This is used for both CONNECT and BIND requests. // //A server using protocol 4A must check the DSTIP in the request packet. //If it represent address 0.0.0.x with nonzero x, the server must read //in the domain name that the client sends in the packet. The server //should resolve the domain name and make connection to the destination //host if it can. // //SOCKSified sockd may pass domain names that it cannot resolve to //the next-hop SOCKS server. // userId needs to be a zero length string so that the GetBytes method // works properly if (userId == null) userId = ""; byte[] destIp = {0,0,0,1}; // build the invalid ip address as specified in the 4a protocol byte[] destPort = GetDestinationPortBytes(destinationPort); byte[] userIdBytes = ASCIIEncoding.ASCII.GetBytes(userId); byte[] hostBytes = ASCIIEncoding.ASCII.GetBytes(destinationHost); byte[] request = new byte[10 + userIdBytes.Length + hostBytes.Length]; // set the bits on the request byte array request[0] = SOCKS4_VERSION_NUMBER; request[1] = command; destPort.CopyTo(request, 2); destIp.CopyTo(request, 4); userIdBytes.CopyTo(request, 8); // copy the userid to the request byte array request[8 + userIdBytes.Length] = 0x00; // null (byte with all zeros) terminator for userId hostBytes.CopyTo(request, 9 + userIdBytes.Length); // copy the host name to the request byte array request[9 + userIdBytes.Length + hostBytes.Length] = 0x00; // null (byte with all zeros) terminator for userId // send the connect request proxy.Write(request, 0, request.Length); // wait for the proxy server to send a response base.WaitForData(proxy); // PROXY SERVER RESPONSE // The SOCKS server checks to see whether such a request should be granted // based on any combination of source IP address, destination IP address, // destination port number, the userid, and information it may obtain by // consulting IDENT, cf. RFC 1413. If the request is granted, the SOCKS // server makes a connection to the specified port of the destination host. // A reply packet is sent to the client when this connection is established, // or when the request is rejected or the operation fails. // // +----+----+----+----+----+----+----+----+ // | VN | CD | DSTPORT | DSTIP | // +----+----+----+----+----+----+----+----+ // # of bytes: 1 1 2 4 // // VN is the version of the reply code and should be 0. CD is the result // code with one of the following values: // // 90: request granted // 91: request rejected or failed // 92: request rejected becuase SOCKS server cannot connect to // identd on the client // 93: request rejected because the client program and identd // report different user-ids // // The remaining fields are ignored. // // The SOCKS server closes its connection immediately after notifying // the client of a failed or rejected request. For a successful request, // the SOCKS server gets ready to relay traffic on both directions. This // enables the client to do I/O on its connection as if it were directly // connected to the application server. // create an 8 byte response array byte[] response = new byte[8]; // read the resonse from the network stream proxy.Read(response, 0, 8); // evaluate the reply code for an error condition if (response[1] != SOCKS4_CMD_REPLY_REQUEST_GRANTED) HandleProxyCommandError(response, destinationHost, destinationPort); } } } smuxi-0.11/lib/SmartIrc4net/src/starksoftproxy/ProxyClientFactory.cs0000644000175000017500000002113412253423361026535 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Collections.Generic; using System.Text; using System.Net.Sockets; namespace Starksoft.Net.Proxy { /// /// The type of proxy. /// public enum ProxyType { /// /// No Proxy specified. Note this option will cause an exception to be thrown if used to create a proxy object by the factory. /// None, /// /// HTTP Proxy /// Http, /// /// SOCKS v4 Proxy /// Socks4, /// /// SOCKS v4a Proxy /// Socks4a, /// /// SOCKS v5 Proxy /// Socks5 } /// /// Factory class for creating new proxy client objects. /// /// /// /// // create an instance of the client proxy factory /// ProxyClientFactory factory = new ProxyClientFactory(); /// /// // use the proxy client factory to generically specify the type of proxy to create /// // the proxy factory method CreateProxyClient returns an IProxyClient object /// IProxyClient proxy = factory.CreateProxyClient(ProxyType.Http, "localhost", 6588); /// /// // create a connection through the proxy to www.starksoft.com over port 80 /// System.Net.Sockets.TcpClient tcpClient = proxy.CreateConnection("www.starksoft.com", 80); /// /// public class ProxyClientFactory { /// /// Factory method for creating new proxy client objects. /// /// The type of proxy client to create. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type) { if (type == ProxyType.None) throw new ArgumentOutOfRangeException("type"); switch (type) { case ProxyType.Http: return new HttpProxyClient(); case ProxyType.Socks4: return new Socks4ProxyClient(); case ProxyType.Socks4a: return new Socks4aProxyClient(); case ProxyType.Socks5: return new Socks5ProxyClient(); default: throw new ProxyException(String.Format("Unknown proxy type {0}.", type.ToString())); } } /// /// Factory method for creating new proxy client objects using an existing TcpClient connection object. /// /// The type of proxy client to create. /// Open TcpClient object. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type, TcpClient tcpClient) { if (type == ProxyType.None) throw new ArgumentOutOfRangeException("type"); switch (type) { case ProxyType.Http: return new HttpProxyClient(tcpClient); case ProxyType.Socks4: return new Socks4ProxyClient(tcpClient); case ProxyType.Socks4a: return new Socks4aProxyClient(tcpClient); case ProxyType.Socks5: return new Socks5ProxyClient(tcpClient); default: throw new ProxyException(String.Format("Unknown proxy type {0}.", type.ToString())); } } /// /// Factory method for creating new proxy client objects. /// /// The type of proxy client to create. /// The proxy host or IP address. /// The proxy port number. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type, string proxyHost, int proxyPort) { if (type == ProxyType.None) throw new ArgumentOutOfRangeException("type"); switch (type) { case ProxyType.Http: return new HttpProxyClient(proxyHost, proxyPort); case ProxyType.Socks4: return new Socks4ProxyClient(proxyHost, proxyPort); case ProxyType.Socks4a: return new Socks4aProxyClient(proxyHost, proxyPort); case ProxyType.Socks5: return new Socks5ProxyClient(proxyHost, proxyPort); default: throw new ProxyException(String.Format("Unknown proxy type {0}.", type.ToString())); } } /// /// Factory method for creating new proxy client objects. /// /// The type of proxy client to create. /// The proxy host or IP address. /// The proxy port number. /// The proxy username. This parameter is only used by Socks4 and Socks5 proxy objects. /// The proxy user password. This parameter is only used Socks5 proxy objects. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword) { if (type == ProxyType.None) throw new ArgumentOutOfRangeException("type"); switch (type) { case ProxyType.Http: return new HttpProxyClient(proxyHost, proxyPort); case ProxyType.Socks4: return new Socks4ProxyClient(proxyHost, proxyPort, proxyUsername); case ProxyType.Socks4a: return new Socks4aProxyClient(proxyHost, proxyPort, proxyUsername); case ProxyType.Socks5: return new Socks5ProxyClient(proxyHost, proxyPort, proxyUsername, proxyPassword); default: throw new ProxyException(String.Format("Unknown proxy type {0}.", type.ToString())); } } /// /// Factory method for creating new proxy client objects. /// /// The type of proxy client to create. /// Open TcpClient object. /// The proxy host or IP address. /// The proxy port number. /// The proxy username. This parameter is only used by Socks4 and Socks5 proxy objects. /// The proxy user password. This parameter is only used Socks5 proxy objects. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type, TcpClient tcpClient, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword) { IProxyClient c = CreateProxyClient(type, proxyHost, proxyPort, proxyUsername, proxyPassword); c.TcpClient = tcpClient; return c; } } } smuxi-0.11/lib/SmartIrc4net/src/AssemblyInfo.cs0000644000175000017500000000456412253423361022206 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Information about this assembly is defined by the following // attributes. // // change them to the information which is associated with the assembly // you compile. [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] [assembly: AssemblyTitle("SmartIrc4net")] [assembly: AssemblyDescription("IRC library for CLI")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("qNETp")] [assembly: AssemblyProduct("SmartIrc4net")] [assembly: AssemblyCopyright("2003-2013 (C) Mirco Bauer ")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has following format : // // Major.Minor.Build.Revision // // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): [assembly: AssemblyVersion("0.5.0.0")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. // This is not required, if you don't want signing let these attributes like they're. #if DELAY_SIGN [assembly: AssemblyDelaySign(true)] [assembly: AssemblyKeyFile("../SmartIrc4net-pub.snk")] #else [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] #endif smuxi-0.11/lib/SmartIrc4net/src/IrcClient/0000755000175000017500000000000012253423361021127 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/src/IrcClient/IrcMessageData.cs0000644000175000017500000001366111655552514024311 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ namespace Meebey.SmartIrc4net { /// /// This class contains an IRC message in a parsed form /// /// public class IrcMessageData { private IrcClient _Irc; private string _From; private string _Nick; private string _Ident; private string _Host; private string _Channel; private string _Message; private string[] _MessageArray; private string _RawMessage; private string[] _RawMessageArray; private ReceiveType _Type; private ReplyCode _ReplyCode; /// /// Gets the IrcClient object the message originated from /// public IrcClient Irc { get { return _Irc; } } /// /// Gets the combined nickname, identity and hostname of the user that sent the message /// /// /// nick!ident@host /// public string From { get { return _From; } } /// /// Gets the nickname of the user that sent the message /// public string Nick { get { return _Nick; } } /// /// Gets the identity (username) of the user that sent the message /// public string Ident { get { return _Ident; } } /// /// Gets the hostname of the user that sent the message /// public string Host { get { return _Host; } } /// /// Gets the channel the message originated from /// public string Channel { get { return _Channel; } } /// /// Gets the message /// public string Message { get { return _Message; } } /// /// Gets the message as an array of strings (splitted by space) /// public string[] MessageArray { get { return _MessageArray; } } /// /// Gets the raw message sent by the server /// public string RawMessage { get { return _RawMessage; } } /// /// Gets the raw message sent by the server as array of strings (splitted by space) /// public string[] RawMessageArray { get { return _RawMessageArray; } } /// /// Gets the message type /// public ReceiveType Type { get { return _Type; } } /// /// Gets the message reply code /// public ReplyCode ReplyCode { get { return _ReplyCode; } } /// /// Constructor to create an instace of IrcMessageData /// /// IrcClient the message originated from /// combined nickname, identity and host of the user that sent the message (nick!ident@host) /// nickname of the user that sent the message /// identity (username) of the userthat sent the message /// hostname of the user that sent the message /// channel the message originated from /// message /// raw message sent by the server /// message type /// message reply code public IrcMessageData(IrcClient ircclient, string from, string nick, string ident, string host, string channel, string message, string rawmessage, ReceiveType type, ReplyCode replycode) { _Irc = ircclient; _RawMessage = rawmessage; _RawMessageArray = rawmessage.Split(new char[] {' '}); _Type = type; _ReplyCode = replycode; _From = from; _Nick = nick; _Ident = ident; _Host = host; _Channel = channel; if (message != null) { // message is optional _Message = message; _MessageArray = message.Split(new char[] {' '}); } } } } smuxi-0.11/lib/SmartIrc4net/src/IrcClient/NonRfcChannel.cs0000644000175000017500000000640612253423361024142 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Collections; using System.Collections.Specialized; namespace Meebey.SmartIrc4net { /// /// /// /// public class NonRfcChannel : Channel { private Hashtable _Owners = Hashtable.Synchronized(new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer())); private Hashtable _ChannelAdmins = Hashtable.Synchronized(new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer())); private Hashtable _Halfops = Hashtable.Synchronized(new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer())); /// /// /// /// internal NonRfcChannel(string name) : base(name) { } #if LOG4NET ~NonRfcChannel() { Logger.ChannelSyncing.Debug("NonRfcChannel ("+Name+") destroyed"); } #endif /// /// /// /// public Hashtable Owners { get { return (Hashtable) _Owners.Clone(); } } /// /// /// /// internal Hashtable UnsafeOwners { get { return _Owners; } } /// /// /// /// public Hashtable ChannelAdmins { get { return (Hashtable) _ChannelAdmins.Clone(); } } /// /// /// /// internal Hashtable UnsafeChannelAdmins { get { return _ChannelAdmins; } } /// /// /// /// public Hashtable Halfops { get { return (Hashtable) _Halfops.Clone(); } } /// /// /// /// internal Hashtable UnsafeHalfops { get { return _Halfops; } } } } smuxi-0.11/lib/SmartIrc4net/src/IrcClient/IrcClient.cs0000644000175000017500000040036112253423361023336 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2008 Mirco Bauer * Copyright (c) 2008-2009 Thomas Bruderer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Linq; using System.Text.RegularExpressions; using System.Threading; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; namespace Meebey.SmartIrc4net { /// /// This layer is an event driven high-level API with all features you could need for IRC programming. /// /// public class IrcClient : IrcCommands { private string _Nickname = string.Empty; private string[] _NicknameList; private int _CurrentNickname; private string _Realname = string.Empty; private string _Usermode = string.Empty; private int _IUsermode; private string _Username = string.Empty; private string _Password = string.Empty; private bool _IsAway; private string _CtcpVersion; private bool _ActiveChannelSyncing; private bool _PassiveChannelSyncing; private bool _AutoJoinOnInvite; private bool _AutoRejoin; private Dictionary _AutoRejoinChannels = new Dictionary(); private bool _AutoRejoinOnKick; private bool _AutoRelogin; private bool _AutoNickHandling = true; private bool _SupportNonRfc; private bool _SupportNonRfcLocked; private StringCollection _Motd = new StringCollection(); private bool _MotdReceived; private Array _ReplyCodes = Enum.GetValues(typeof(ReplyCode)); private StringCollection _JoinedChannels = new StringCollection(); private Hashtable _Channels = Hashtable.Synchronized(new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer())); private Hashtable _IrcUsers = Hashtable.Synchronized(new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer())); private List _ChannelList; private Object _ChannelListSyncRoot = new Object(); private AutoResetEvent _ChannelListReceivedEvent; private List _WhoList; private Object _WhoListSyncRoot = new Object(); private AutoResetEvent _WhoListReceivedEvent; private List _BanList; private Object _BanListSyncRoot = new Object(); private AutoResetEvent _BanListReceivedEvent; private List _BanExceptList; private Object _BanExceptListSyncRoot = new Object(); private AutoResetEvent _BanExceptListReceivedEvent; private List _InviteExceptList; private Object _InviteExceptListSyncRoot = new Object(); private AutoResetEvent _InviteExceptListReceivedEvent; private ServerProperties _ServerProperties = new ServerProperties(); private static Regex _ReplyCodeRegex = new Regex("^:[^ ]+? ([0-9]{3}) .+$", RegexOptions.Compiled); private static Regex _PingRegex = new Regex("^PING :.*", RegexOptions.Compiled); private static Regex _ErrorRegex = new Regex("^ERROR :.*", RegexOptions.Compiled); private static Regex _ActionRegex = new Regex("^:.*? PRIVMSG (.).* :"+"\x1"+"ACTION .*"+"\x1"+"$", RegexOptions.Compiled); private static Regex _CtcpRequestRegex = new Regex("^:.*? PRIVMSG .* :"+"\x1"+".*"+"\x1"+"$", RegexOptions.Compiled); private static Regex _MessageRegex = new Regex("^:.*? PRIVMSG (.).* :.*$", RegexOptions.Compiled); private static Regex _CtcpReplyRegex = new Regex("^:.*? NOTICE .* :"+"\x1"+".*"+"\x1"+"$", RegexOptions.Compiled); private static Regex _NoticeRegex = new Regex("^:.*? NOTICE (.).* :.*$", RegexOptions.Compiled); private static Regex _InviteRegex = new Regex("^:.*? INVITE .* .*$", RegexOptions.Compiled); private static Regex _JoinRegex = new Regex("^:.*? JOIN .*$", RegexOptions.Compiled); private static Regex _TopicRegex = new Regex("^:.*? TOPIC .* :.*$", RegexOptions.Compiled); private static Regex _NickRegex = new Regex("^:.*? NICK .*$", RegexOptions.Compiled); private static Regex _KickRegex = new Regex("^:.*? KICK .* .*$", RegexOptions.Compiled); private static Regex _PartRegex = new Regex("^:.*? PART .*$", RegexOptions.Compiled); private static Regex _ModeRegex = new Regex("^:.*? MODE (.*) .*$", RegexOptions.Compiled); private static Regex _QuitRegex = new Regex("^:.*? QUIT :.*$", RegexOptions.Compiled); private static Regex _BounceMessageRegex = new Regex("^Try server (.+), port ([0-9]+)$", RegexOptions.Compiled); public event EventHandler OnRegistered; public event PingEventHandler OnPing; public event PongEventHandler OnPong; public event IrcEventHandler OnRawMessage; public event ErrorEventHandler OnError; public event IrcEventHandler OnErrorMessage; public event JoinEventHandler OnJoin; public event NamesEventHandler OnNames; public event ListEventHandler OnList; public event PartEventHandler OnPart; public event QuitEventHandler OnQuit; public event KickEventHandler OnKick; public event AwayEventHandler OnAway; public event IrcEventHandler OnUnAway; public event IrcEventHandler OnNowAway; public event InviteEventHandler OnInvite; public event BanEventHandler OnBan; public event UnbanEventHandler OnUnban; public event BanEventHandler OnBanException; public event UnbanEventHandler OnUnBanException; public event BanEventHandler OnInviteException; public event UnbanEventHandler OnUnInviteException; public event OwnerEventHandler OnOwner; public event DeownerEventHandler OnDeowner; public event ChannelAdminEventHandler OnChannelAdmin; public event DeChannelAdminEventHandler OnDeChannelAdmin; public event OpEventHandler OnOp; public event DeopEventHandler OnDeop; public event HalfopEventHandler OnHalfop; public event DehalfopEventHandler OnDehalfop; public event VoiceEventHandler OnVoice; public event DevoiceEventHandler OnDevoice; public event WhoEventHandler OnWho; public event MotdEventHandler OnMotd; public event TopicEventHandler OnTopic; public event TopicChangeEventHandler OnTopicChange; public event NickChangeEventHandler OnNickChange; public event IrcEventHandler OnModeChange; public event IrcEventHandler OnUserModeChange; public event IrcEventHandler OnChannelModeChange; public event IrcEventHandler OnChannelMessage; public event ActionEventHandler OnChannelAction; public event IrcEventHandler OnChannelNotice; public event IrcEventHandler OnChannelActiveSynced; public event IrcEventHandler OnChannelPassiveSynced; public event IrcEventHandler OnQueryMessage; public event ActionEventHandler OnQueryAction; public event IrcEventHandler OnQueryNotice; public event CtcpEventHandler OnCtcpRequest; public event CtcpEventHandler OnCtcpReply; public event BounceEventHandler OnBounce; /// /// Enables/disables the active channel sync feature. /// Default: false /// public bool ActiveChannelSyncing { get { return _ActiveChannelSyncing; } set { #if LOG4NET if (value) { Logger.ChannelSyncing.Info("Active channel syncing enabled"); } else { Logger.ChannelSyncing.Info("Active channel syncing disabled"); } #endif _ActiveChannelSyncing = value; } } /// /// Enables/disables the passive channel sync feature. Not implemented yet! /// public bool PassiveChannelSyncing { get { return _PassiveChannelSyncing; } /* set { #if LOG4NET if (value) { Logger.ChannelSyncing.Info("Passive channel syncing enabled"); } else { Logger.ChannelSyncing.Info("Passive channel syncing disabled"); } #endif _PassiveChannelSyncing = value; } */ } /// /// Sets the ctcp version that should be replied on ctcp version request. /// public string CtcpVersion { get { return _CtcpVersion; } set { _CtcpVersion = value; } } /// /// Enables/disables auto joining of channels when invited. /// Default: false /// public bool AutoJoinOnInvite { get { return _AutoJoinOnInvite; } set { #if LOG4NET if (value) { Logger.ChannelSyncing.Info("AutoJoinOnInvite enabled"); } else { Logger.ChannelSyncing.Info("AutoJoinOnInvite disabled"); } #endif _AutoJoinOnInvite = value; } } /// /// Enables/disables automatic rejoining of channels when a connection to the server is lost. /// Default: false /// public bool AutoRejoin { get { return _AutoRejoin; } set { #if LOG4NET if (value) { Logger.ChannelSyncing.Info("AutoRejoin enabled"); } else { Logger.ChannelSyncing.Info("AutoRejoin disabled"); } #endif _AutoRejoin = value; } } /// /// Enables/disables auto rejoining of channels when kicked. /// Default: false /// public bool AutoRejoinOnKick { get { return _AutoRejoinOnKick; } set { #if LOG4NET if (value) { Logger.ChannelSyncing.Info("AutoRejoinOnKick enabled"); } else { Logger.ChannelSyncing.Info("AutoRejoinOnKick disabled"); } #endif _AutoRejoinOnKick = value; } } /// /// Enables/disables auto relogin to the server after a reconnect. /// Default: false /// public bool AutoRelogin { get { return _AutoRelogin; } set { #if LOG4NET if (value) { Logger.ChannelSyncing.Info("AutoRelogin enabled"); } else { Logger.ChannelSyncing.Info("AutoRelogin disabled"); } #endif _AutoRelogin = value; } } /// /// Enables/disables auto nick handling on nick collisions /// Default: true /// public bool AutoNickHandling { get { return _AutoNickHandling; } set { #if LOG4NET if (value) { Logger.ChannelSyncing.Info("AutoNickHandling enabled"); } else { Logger.ChannelSyncing.Info("AutoNickHandling disabled"); } #endif _AutoNickHandling = value; } } /// /// Enables/disables support for non rfc features. /// Default: false /// public bool SupportNonRfc { get { return _SupportNonRfc; } set { if (_SupportNonRfcLocked) { return; } #if LOG4NET if (value) { Logger.ChannelSyncing.Info("SupportNonRfc enabled"); } else { Logger.ChannelSyncing.Info("SupportNonRfc disabled"); } #endif _SupportNonRfc = value; } } /// /// Gets the nickname of us. /// public string Nickname { get { return _Nickname; } } /// /// Gets the list of nicknames of us. /// public string[] NicknameList { get { return _NicknameList; } } /// /// Gets the supposed real name of us. /// public string Realname { get { return _Realname; } } /// /// Gets the username for the server. /// /// /// System username is set by default /// public string Username { get { return _Username; } } /// /// Gets the alphanumeric mode mask of us. /// public string Usermode { get { return _Usermode; } } /// /// Gets the numeric mode mask of us. /// public int IUsermode { get { return _IUsermode; } } /// /// Returns if we are away on this connection /// public bool IsAway { get { return _IsAway; } } /// /// Gets the password for the server. /// public string Password { get { return _Password; } } /// /// Gets the list of channels we are joined. /// public StringCollection JoinedChannels { get { return _JoinedChannels; } } /// /// Gets the server message of the day. /// public StringCollection Motd { get { return _Motd; } } public object BanListSyncRoot { get { return _BanListSyncRoot; } } /// /// Gets the special functionality supported by this server. /// public ServerProperties ServerProperties { get { return _ServerProperties; } } /// /// This class manages the connection server and provides access to all the objects needed to send and receive messages. /// public IrcClient() { #if LOG4NET Logger.Main.Debug("IrcClient created"); #endif OnReadLine += new ReadLineEventHandler(_Worker); OnDisconnected += new EventHandler(_OnDisconnected); OnConnectionError += new EventHandler(_OnConnectionError); } #if LOG4NET ~IrcClient() { Logger.Main.Debug("IrcClient destroyed"); } #endif /// /// Connection parameters required to establish an server connection. /// /// The list of server hostnames. /// The TCP port the server listens on. public new void Connect(string[] addresslist, int port) { _SupportNonRfcLocked = true; base.Connect(addresslist, port); } /// /// Reconnects to the current server. /// /// If the login data should be sent, after successful connect. /// If the channels should be rejoined, after successful connect. public void Reconnect(bool login, bool channels) { if (channels) { _StoreChannelsToRejoin(); } base.Reconnect(); if (login) { //reset the nick to the original nicklist _CurrentNickname = 0; // FIXME: honor _Nickname (last used nickname) Login(_NicknameList, Realname, IUsermode, Username, Password); } if (channels) { _RejoinChannels(); } } /// If the login data should be sent, after successful connect. public void Reconnect(bool login) { Reconnect(login, true); } /// /// Login parameters required identify with server connection /// /// Login is used at the beginning of connection to specify the username, hostname and realname of a new user. /// The users list of 'nick' names which may NOT contain spaces /// The users 'real' name which may contain space characters /// A numeric mode parameter. /// /// Set to 0 to recieve wallops and be invisible. /// Set to 4 to be invisible and not receive wallops. /// /// /// The user's machine logon name /// The optional password can and MUST be set before any attempt to register /// the connection is made. public void Login(string[] nicklist, string realname, int usermode, string username, string password) { #if LOG4NET Logger.Connection.Info("logging in"); #endif _NicknameList = (string[])nicklist.Clone(); // here we set the nickname which we will try first _Nickname = _NicknameList[0].Replace(" ", ""); _Realname = realname; _IUsermode = usermode; if (username != null && username.Length > 0) { _Username = username.Replace(" ", ""); } else { _Username = Environment.UserName.Replace(" ", ""); } if (password != null && password.Length > 0) { _Password = password; RfcPass(Password, Priority.Critical); } RfcNick(Nickname, Priority.Critical); RfcUser(Username, IUsermode, Realname, Priority.Critical); } /// /// Login parameters required identify with server connection /// /// Login is used at the beginning of connection to specify the username, hostname and realname of a new user. /// The users list of 'nick' names which may NOT contain spaces /// The users 'real' name which may contain space characters /// A numeric mode parameter. /// Set to 0 to recieve wallops and be invisible. /// Set to 4 to be invisible and not receive wallops. /// The user's machine logon name public void Login(string[] nicklist, string realname, int usermode, string username) { Login(nicklist, realname, usermode, username, ""); } /// /// Login parameters required identify with server connection /// /// Login is used at the beginning of connection to specify the username, hostname and realname of a new user. /// The users list of 'nick' names which may NOT contain spaces /// The users 'real' name which may contain space characters /// A numeric mode parameter. /// Set to 0 to recieve wallops and be invisible. /// Set to 4 to be invisible and not receive wallops. public void Login(string[] nicklist, string realname, int usermode) { Login(nicklist, realname, usermode, "", ""); } /// /// Login parameters required identify with server connection /// /// Login is used at the beginning of connection to specify the username, hostname and realname of a new user. /// The users list of 'nick' names which may NOT contain spaces /// The users 'real' name which may contain space characters public void Login(string[] nicklist, string realname) { Login(nicklist, realname, 0, "", ""); } /// /// Login parameters required identify with server connection /// /// Login is used at the beginning of connection to specify the username, hostname and realname of a new user. /// The users 'nick' name which may NOT contain spaces /// The users 'real' name which may contain space characters /// A numeric mode parameter. /// Set to 0 to recieve wallops and be invisible. /// Set to 4 to be invisible and not receive wallops. /// The user's machine logon name /// The optional password can and MUST be set before any attempt to register /// the connection is made. public void Login(string nick, string realname, int usermode, string username, string password) { Login(new string[] {nick, nick+"_", nick+"__"}, realname, usermode, username, password); } /// /// Login parameters required identify with server connection /// /// Login is used at the beginning of connection to specify the username, hostname and realname of a new user. /// The users 'nick' name which may NOT contain spaces /// The users 'real' name which may contain space characters /// A numeric mode parameter. /// Set to 0 to recieve wallops and be invisible. /// Set to 4 to be invisible and not receive wallops. /// The user's machine logon name public void Login(string nick, string realname, int usermode, string username) { Login(new string[] {nick, nick+"_", nick+"__"}, realname, usermode, username, ""); } /// /// Login parameters required identify with server connection /// /// Login is used at the beginning of connection to specify the username, hostname and realname of a new user. /// The users 'nick' name which may NOT contain spaces /// The users 'real' name which may contain space characters /// A numeric mode parameter. /// Set to 0 to recieve wallops and be invisible. /// Set to 4 to be invisible and not receive wallops. public void Login(string nick, string realname, int usermode) { Login(new string[] {nick, nick+"_", nick+"__"}, realname, usermode, "", ""); } /// /// Login parameters required identify with server connection /// /// Login is used at the beginning of connection to specify the username, hostname and realname of a new user. /// The users 'nick' name which may NOT contain spaces /// The users 'real' name which may contain space characters public void Login(string nick, string realname) { Login(new string[] {nick, nick+"_", nick+"__"}, realname, 0, "", ""); } /// /// Determine if a specifier nickname is you /// /// The users 'nick' name which may NOT contain spaces /// True if nickname belongs to you public bool IsMe(string nickname) { return String.Compare(Nickname, nickname, StringComparison.OrdinalIgnoreCase) == 0; } /// /// Determines if your nickname can be found in a specified channel /// /// The name of the channel you wish to query /// True if you are found in channel public bool IsJoined(string channelname) { return IsJoined(channelname, Nickname); } /// /// Determine if a specified nickname can be found in a specified channel /// /// The name of the channel you wish to query /// The users 'nick' name which may NOT contain spaces /// True if nickname is found in channel public bool IsJoined(string channelname, string nickname) { if (channelname == null) { throw new System.ArgumentNullException("channelname"); } if (nickname == null) { throw new System.ArgumentNullException("nickname"); } Channel channel = GetChannel(channelname); if (channel != null && channel.UnsafeUsers != null && channel.UnsafeUsers.ContainsKey(nickname)) { return true; } return false; } /// /// Returns user information /// /// The users 'nick' name which may NOT contain spaces /// IrcUser object of requested nickname public IrcUser GetIrcUser(string nickname) { if (nickname == null) { throw new System.ArgumentNullException("nickname"); } return (IrcUser)_IrcUsers[nickname]; } /// /// Returns extended user information including channel information /// /// The name of the channel you wish to query /// The users 'nick' name which may NOT contain spaces /// ChannelUser object of requested channelname/nickname public ChannelUser GetChannelUser(string channelname, string nickname) { if (channelname == null) { throw new System.ArgumentNullException("channel"); } if (nickname == null) { throw new System.ArgumentNullException("nickname"); } Channel channel = GetChannel(channelname); if (channel != null) { return (ChannelUser)channel.UnsafeUsers[nickname]; } else { return null; } } /// /// /// /// The name of the channel you wish to query /// Channel object of requested channel public Channel GetChannel(string channelname) { if (channelname == null) { throw new System.ArgumentNullException("channelname"); } return (Channel)_Channels[channelname]; } /// /// Gets a list of all joined channels on server /// /// String array of all joined channel names public string[] GetChannels() { string[] channels = new string[_Channels.Values.Count]; int i = 0; foreach (Channel channel in _Channels.Values) { channels[i++] = channel.Name; } return channels; } /// /// Fetches a fresh list of all available channels that match the passed mask /// /// List of ListInfo public IList GetChannelList(string mask) { List list = new List(); lock (_ChannelListSyncRoot) { _ChannelList = list; _ChannelListReceivedEvent = new AutoResetEvent(false); // request list RfcList(mask); // wait till we have the complete list _ChannelListReceivedEvent.WaitOne(); _ChannelListReceivedEvent = null; _ChannelList = null; } return list; } /// /// Fetches a fresh list of users that matches the passed mask /// /// List of ListInfo public IList GetWhoList(string mask) { List list = new List(); lock (_WhoListSyncRoot) { _WhoList = list; _WhoListReceivedEvent = new AutoResetEvent(false); // request list RfcWho(mask); // wait till we have the complete list _WhoListReceivedEvent.WaitOne(); _WhoListReceivedEvent = null; _WhoList = null; } return list; } /// /// Fetches a fresh ban list of the specified channel /// /// List of ListInfo public IList GetBanList(string channel) { List list = new List(); lock (_BanListSyncRoot) { _BanList = list; _BanListReceivedEvent = new AutoResetEvent(false); // request list Ban(channel); // wait till we have the complete list _BanListReceivedEvent.WaitOne(); _BanListReceivedEvent = null; _BanList = null; } return list; } /// /// Fetches a fresh ban-exceptions list from the specified channel. /// public IList GetBanExceptionList(string channel) { List list = new List(); if (!_ServerProperties.BanExceptionCharacter.HasValue) { return list; } lock (_BanExceptListSyncRoot) { _BanExceptList = list; _BanExceptListReceivedEvent = new AutoResetEvent(false); BanException(channel); _BanExceptListReceivedEvent.WaitOne(); _BanExceptListReceivedEvent = null; _BanExceptList = null; } return list; } /// /// Fetches a fresh invite-exceptions list from the specified channel. /// public IList GetInviteExceptionList(string channel) { List list = new List(); if (!_ServerProperties.InviteExceptionCharacter.HasValue) { return list; } lock (_InviteExceptListSyncRoot) { _InviteExceptList = list; _InviteExceptListReceivedEvent = new AutoResetEvent(false); InviteException(channel); _InviteExceptListReceivedEvent.WaitOne(); _InviteExceptListReceivedEvent = null; _InviteExceptList = null; } return list; } public IrcMessageData MessageParser(string rawline) { if (rawline == null) { throw new ArgumentNullException("rawline"); } string line; string[] linear; string messagecode; string from; string nick = null; string ident = null; string host = null; string channel = null; string message = null; ReceiveType type; ReplyCode replycode; int exclamationpos; int atpos; int colonpos; if (rawline.Length == 0) { throw new ArgumentException("Value must not be empty.", "rawline"); } if (rawline[0] == ':') { line = rawline.Substring(1); } else { line = rawline; } linear = line.Split(new char[] {' '}); // conform to RFC 2812 from = linear[0]; messagecode = linear[1]; exclamationpos = from.IndexOf("!"); atpos = from.IndexOf("@"); colonpos = line.IndexOf(" :"); if (colonpos != -1) { // we want the exact position of ":" not beginning from the space colonpos += 1; } if (exclamationpos != -1) { nick = from.Substring(0, exclamationpos); } else { if (atpos == -1) { // no ident and no host, should be nick then if (!from.Contains(".")) { // HACK: from seems to be a nick instead of servername nick = from; } } else { nick = from.Substring(0, atpos); } } if ((atpos != -1) && (exclamationpos != -1)) { ident = from.Substring(exclamationpos+1, (atpos - exclamationpos)-1); } if (atpos != -1) { host = from.Substring(atpos+1); } try { replycode = (ReplyCode)int.Parse(messagecode); } catch (FormatException) { replycode = ReplyCode.Null; } type = _GetMessageType(rawline); if (colonpos != -1) { message = line.Substring(colonpos + 1); } switch (type) { case ReceiveType.Join: case ReceiveType.Kick: case ReceiveType.Part: case ReceiveType.TopicChange: case ReceiveType.ChannelModeChange: case ReceiveType.ChannelMessage: case ReceiveType.ChannelAction: case ReceiveType.ChannelNotice: channel = linear[2]; break; case ReceiveType.Who: case ReceiveType.Topic: case ReceiveType.Invite: case ReceiveType.BanList: case ReceiveType.ChannelMode: channel = linear[3]; break; case ReceiveType.Name: channel = linear[4]; break; } switch (replycode) { case ReplyCode.List: case ReplyCode.ListEnd: case ReplyCode.ErrorNoChannelModes: case ReplyCode.InviteList: channel = linear[3]; break; } if ((channel != null) && (channel[0] == ':')) { channel = channel.Substring(1); } IrcMessageData data; data = new IrcMessageData(this, from, nick, ident, host, channel, message, rawline, type, replycode); #if LOG4NET Logger.MessageParser.Debug("IrcMessageData "+ "nick: '"+data.Nick+"' "+ "ident: '"+data.Ident+"' "+ "host: '"+data.Host+"' "+ "type: '"+data.Type.ToString()+"' "+ "from: '"+data.From+"' "+ "channel: '"+data.Channel+"' "+ "message: '"+data.Message+"' " ); #endif return data; } // ISUPPORT-honoring versions of some IrcCommands methods public override void BanException(string channel) { var bexchar = _ServerProperties.BanExceptionCharacter; if (bexchar.HasValue) { ListChannelMasks("+" + bexchar.Value, channel); } else { base.BanException(channel); } } public override void BanException(string channel, string hostmask, Priority priority) { var bexchar = _ServerProperties.BanExceptionCharacter; if (bexchar.HasValue) { ModifyChannelMasks("+" + bexchar.Value, channel, hostmask, priority); } else { base.BanException(channel, hostmask, priority); } } public override void BanException(string channel, string hostmask) { var bexchar = _ServerProperties.BanExceptionCharacter; if (bexchar.HasValue) { ModifyChannelMasks("+" + bexchar.Value, channel, hostmask); } else { base.BanException(channel, hostmask); } } public override void BanException(string channel, string[] hostmasks) { var bexchar = _ServerProperties.BanExceptionCharacter; if (bexchar.HasValue) { ModifyChannelMasks("+" + bexchar.Value, channel, hostmasks); } else { base.BanException(channel, hostmasks); } } public override void UnBanException(string channel, string hostmask, Priority priority) { var bexchar = _ServerProperties.BanExceptionCharacter; if (bexchar.HasValue) { ModifyChannelMasks("-" + bexchar.Value, channel, hostmask, priority); } else { base.UnBanException(channel, hostmask, priority); } } public override void UnBanException(string channel, string hostmask) { var bexchar = _ServerProperties.BanExceptionCharacter; if (bexchar.HasValue) { ModifyChannelMasks("-" + bexchar.Value, channel, hostmask); } else { base.UnBanException(channel, hostmask); } } public override void UnBanException(string channel, string[] hostmasks) { var bexchar = _ServerProperties.BanExceptionCharacter; if (bexchar.HasValue) { ModifyChannelMasks("-" + bexchar.Value, channel, hostmasks); } else { base.UnBanException(channel, hostmasks); } } public override void InviteException(string channel) { var iexchar = _ServerProperties.InviteExceptionCharacter; if (iexchar.HasValue) { ListChannelMasks("+" + iexchar.Value, channel); } else { base.InviteException(channel); } } public override void InviteException(string channel, string hostmask, Priority priority) { var iexchar = _ServerProperties.InviteExceptionCharacter; if (iexchar.HasValue) { ModifyChannelMasks("+" + iexchar.Value, channel, hostmask, priority); } else { base.InviteException(channel, hostmask, priority); } } public override void InviteException(string channel, string hostmask) { var iexchar = _ServerProperties.InviteExceptionCharacter; if (iexchar.HasValue) { ModifyChannelMasks("+" + iexchar.Value, channel, hostmask); } else { base.InviteException(channel, hostmask); } } public override void InviteException(string channel, string[] hostmasks) { var iexchar = _ServerProperties.InviteExceptionCharacter; if (iexchar.HasValue) { ModifyChannelMasks("+" + iexchar.Value, channel, hostmasks); } else { base.InviteException(channel, hostmasks); } } public override void UnInviteException(string channel, string hostmask, Priority priority) { var iexchar = _ServerProperties.InviteExceptionCharacter; if (iexchar.HasValue) { ModifyChannelMasks("-" + iexchar.Value, channel, hostmask, priority); } else { base.UnInviteException(channel, hostmask, priority); } } public override void UnInviteException(string channel, string hostmask) { var iexchar = _ServerProperties.InviteExceptionCharacter; if (iexchar.HasValue) { ModifyChannelMasks("-" + iexchar.Value, channel, hostmask); } else { base.UnInviteException(channel, hostmask); } } public override void UnInviteException(string channel, string[] hostmasks) { var iexchar = _ServerProperties.InviteExceptionCharacter; if (iexchar.HasValue) { ModifyChannelMasks("-" + iexchar.Value, channel, hostmasks); } else { base.UnInviteException(channel, hostmasks); } } protected virtual IrcUser CreateIrcUser(string nickname) { return new IrcUser(nickname, this); } protected virtual Channel CreateChannel(string name) { if (_SupportNonRfc) { return new NonRfcChannel(name); } else { return new Channel(name); } } protected virtual ChannelUser CreateChannelUser(string channel, IrcUser ircUser) { if (_SupportNonRfc) { return new NonRfcChannelUser(channel, ircUser); } else { return new ChannelUser(channel, ircUser); } } private void _Worker(object sender, ReadLineEventArgs e) { // lets see if we have events or internal messagehandler for it _HandleEvents(MessageParser(e.Line)); } private void _OnDisconnected(object sender, EventArgs e) { if (AutoRejoin) { _StoreChannelsToRejoin(); } _SyncingCleanup(); } private void _OnConnectionError(object sender, EventArgs e) { try { // AutoReconnect is handled in IrcConnection._OnConnectionError if (AutoReconnect && AutoRelogin) { Login(_NicknameList, Realname, IUsermode, Username, Password); } if (AutoReconnect && AutoRejoin) { _RejoinChannels(); } } catch (NotConnectedException) { // HACK: this is hacky, we don't know if the Reconnect was actually successful // means sending IRC commands without a connection throws NotConnectedExceptions } } private void _StoreChannelsToRejoin() { #if LOG4NET Logger.Connection.Info("Storing channels for rejoin..."); #endif lock (_AutoRejoinChannels) { _AutoRejoinChannels.Clear(); if (ActiveChannelSyncing || PassiveChannelSyncing) { // store the key using channel sync foreach (Channel channel in _Channels.Values) { _AutoRejoinChannels.Add(channel.Name, channel.Key); } } else { foreach (string channel in _JoinedChannels) { _AutoRejoinChannels.Add(channel, null); } } } } private void _RejoinChannels() { #if LOG4NET Logger.Connection.Info("Rejoining channels..."); #endif lock (_AutoRejoinChannels) { RfcJoin(_AutoRejoinChannels.Keys.ToArray(), _AutoRejoinChannels.Values.ToArray(), Priority.High); _AutoRejoinChannels.Clear(); } } private void _SyncingCleanup() { // lets clean it baby, powered by Mr. Proper #if LOG4NET Logger.ChannelSyncing.Debug("Mr. Proper action, cleaning good..."); #endif _JoinedChannels.Clear(); if (ActiveChannelSyncing) { _Channels.Clear(); _IrcUsers.Clear(); } _IsAway = false; _MotdReceived = false; _Motd.Clear(); } /// /// /// private string _NextNickname() { _CurrentNickname++; //if we reach the end stay there if (_CurrentNickname >= _NicknameList.Length) { _CurrentNickname--; } return NicknameList[_CurrentNickname]; } private ReceiveType _GetMessageType(string rawline) { Match found = _ReplyCodeRegex.Match(rawline); if (found.Success) { string code = found.Groups[1].Value; ReplyCode replycode = (ReplyCode)int.Parse(code); // check if this replycode is known in the RFC if (Array.IndexOf(_ReplyCodes, replycode) == -1) { #if LOG4NET Logger.MessageTypes.Warn("This IRC server ("+Address+") doesn't conform to the RFC 2812! ignoring unrecognized replycode '"+replycode+"'"); #endif return ReceiveType.Unknown; } switch (replycode) { case ReplyCode.Welcome: case ReplyCode.YourHost: case ReplyCode.Created: case ReplyCode.MyInfo: case ReplyCode.Bounce: return ReceiveType.Login; case ReplyCode.LuserClient: case ReplyCode.LuserOp: case ReplyCode.LuserUnknown: case ReplyCode.LuserMe: case ReplyCode.LuserChannels: return ReceiveType.Info; case ReplyCode.MotdStart: case ReplyCode.Motd: case ReplyCode.EndOfMotd: return ReceiveType.Motd; case ReplyCode.NamesReply: case ReplyCode.EndOfNames: return ReceiveType.Name; case ReplyCode.WhoReply: case ReplyCode.EndOfWho: return ReceiveType.Who; case ReplyCode.ListStart: case ReplyCode.List: case ReplyCode.ListEnd: return ReceiveType.List; case ReplyCode.BanList: case ReplyCode.EndOfBanList: return ReceiveType.BanList; case ReplyCode.Topic: case ReplyCode.NoTopic: return ReceiveType.Topic; case ReplyCode.WhoIsUser: case ReplyCode.WhoIsServer: case ReplyCode.WhoIsOperator: case ReplyCode.WhoIsIdle: case ReplyCode.WhoIsChannels: case ReplyCode.EndOfWhoIs: return ReceiveType.WhoIs; case ReplyCode.WhoWasUser: case ReplyCode.EndOfWhoWas: return ReceiveType.WhoWas; case ReplyCode.UserModeIs: return ReceiveType.UserMode; case ReplyCode.ChannelModeIs: return ReceiveType.ChannelMode; default: if (((int)replycode >= 400) && ((int)replycode <= 599)) { return ReceiveType.ErrorMessage; } else { #if LOG4NET Logger.MessageTypes.Warn("replycode unknown ("+code+"): \""+rawline+"\""); #endif return ReceiveType.Unknown; } } } found = _PingRegex.Match(rawline); if (found.Success) { return ReceiveType.Unknown; } found = _ErrorRegex.Match(rawline); if (found.Success) { return ReceiveType.Error; } found = _ActionRegex.Match(rawline); if (found.Success) { switch (found.Groups[1].Value) { case "#": case "!": case "&": case "+": return ReceiveType.ChannelAction; default: return ReceiveType.QueryAction; } } found = _CtcpRequestRegex.Match(rawline); if (found.Success) { return ReceiveType.CtcpRequest; } found = _MessageRegex.Match(rawline); if (found.Success) { switch (found.Groups[1].Value) { case "#": case "!": case "&": case "+": return ReceiveType.ChannelMessage; default: return ReceiveType.QueryMessage; } } found = _CtcpReplyRegex.Match(rawline); if (found.Success) { return ReceiveType.CtcpReply; } found = _NoticeRegex.Match(rawline); if (found.Success) { switch (found.Groups[1].Value) { case "#": case "!": case "&": case "+": return ReceiveType.ChannelNotice; default: return ReceiveType.QueryNotice; } } found = _InviteRegex.Match(rawline); if (found.Success) { return ReceiveType.Invite; } found = _JoinRegex.Match(rawline); if (found.Success) { return ReceiveType.Join; } found = _TopicRegex.Match(rawline); if (found.Success) { return ReceiveType.TopicChange; } found = _NickRegex.Match(rawline); if (found.Success) { return ReceiveType.NickChange; } found = _KickRegex.Match(rawline); if (found.Success) { return ReceiveType.Kick; } found = _PartRegex.Match(rawline); if (found.Success) { return ReceiveType.Part; } found = _ModeRegex.Match(rawline); if (found.Success) { if (IsMe(found.Groups[1].Value)) { return ReceiveType.UserModeChange; } else { return ReceiveType.ChannelModeChange; } } found = _QuitRegex.Match(rawline); if (found.Success) { return ReceiveType.Quit; } #if LOG4NET Logger.MessageTypes.Warn("messagetype unknown: \""+rawline+"\""); #endif return ReceiveType.Unknown; } private void _HandleEvents(IrcMessageData ircdata) { if (OnRawMessage != null) { OnRawMessage(this, new IrcEventArgs(ircdata)); } string code; // special IRC messages code = ircdata.RawMessageArray[0]; switch (code) { case "PING": _Event_PING(ircdata); break; case "ERROR": _Event_ERROR(ircdata); break; } code = ircdata.RawMessageArray[1]; switch (code) { case "PRIVMSG": _Event_PRIVMSG(ircdata); break; case "NOTICE": _Event_NOTICE(ircdata); break; case "JOIN": _Event_JOIN(ircdata); break; case "PART": _Event_PART(ircdata); break; case "KICK": _Event_KICK(ircdata); break; case "QUIT": _Event_QUIT(ircdata); break; case "TOPIC": _Event_TOPIC(ircdata); break; case "NICK": _Event_NICK(ircdata); break; case "INVITE": _Event_INVITE(ircdata); break; case "MODE": _Event_MODE(ircdata); break; case "PONG": _Event_PONG(ircdata); break; } if (ircdata.ReplyCode != ReplyCode.Null) { switch (ircdata.ReplyCode) { case ReplyCode.Welcome: _Event_RPL_WELCOME(ircdata); break; case ReplyCode.Topic: _Event_RPL_TOPIC(ircdata); break; case ReplyCode.NoTopic: _Event_RPL_NOTOPIC(ircdata); break; case ReplyCode.NamesReply: _Event_RPL_NAMREPLY(ircdata); break; case ReplyCode.EndOfNames: _Event_RPL_ENDOFNAMES(ircdata); break; case ReplyCode.List: _Event_RPL_LIST(ircdata); break; case ReplyCode.ListEnd: _Event_RPL_LISTEND(ircdata); break; case ReplyCode.WhoReply: _Event_RPL_WHOREPLY(ircdata); break; case ReplyCode.EndOfWho: _Event_RPL_ENDOFWHO(ircdata); break; case ReplyCode.ChannelModeIs: _Event_RPL_CHANNELMODEIS(ircdata); break; case ReplyCode.BanList: _Event_RPL_BANLIST(ircdata); break; case ReplyCode.EndOfBanList: _Event_RPL_ENDOFBANLIST(ircdata); break; case ReplyCode.ErrorNoChannelModes: _Event_ERR_NOCHANMODES(ircdata); break; case ReplyCode.Motd: _Event_RPL_MOTD(ircdata); break; case ReplyCode.EndOfMotd: _Event_RPL_ENDOFMOTD(ircdata); break; case ReplyCode.Away: _Event_RPL_AWAY(ircdata); break; case ReplyCode.UnAway: _Event_RPL_UNAWAY(ircdata); break; case ReplyCode.NowAway: _Event_RPL_NOWAWAY(ircdata); break; case ReplyCode.TryAgain: _Event_RPL_TRYAGAIN(ircdata); break; case ReplyCode.ErrorNicknameInUse: _Event_ERR_NICKNAMEINUSE(ircdata); break; case ReplyCode.InviteList: _Event_RPL_INVITELIST(ircdata); break; case ReplyCode.EndOfInviteList: _Event_RPL_ENDOFINVITELIST(ircdata); break; case ReplyCode.ExceptionList: _Event_RPL_EXCEPTLIST(ircdata); break; case ReplyCode.EndOfExceptionList: _Event_RPL_ENDOFEXCEPTLIST(ircdata); break; case ReplyCode.Bounce: _Event_RPL_BOUNCE(ircdata); break; } } if (ircdata.Type == ReceiveType.ErrorMessage) { _Event_ERR(ircdata); } } /// /// Removes a specified user from all channel lists /// /// The users 'nick' name which may NOT contain spaces private bool _RemoveIrcUser(string nickname) { IrcUser user = GetIrcUser(nickname); if (user != null) { if (user.JoinedChannels.Length == 0) { // he is nowhere else, lets kill him _IrcUsers.Remove(nickname); return true; } } return false; } /// /// Removes a specified user from a specified channel list /// /// The name of the channel you wish to query /// The users 'nick' name which may NOT contain spaces private void _RemoveChannelUser(string channelname, string nickname) { Channel chan = GetChannel(channelname); chan.UnsafeUsers.Remove(nickname); chan.UnsafeOps.Remove(nickname); chan.UnsafeVoices.Remove(nickname); if (SupportNonRfc) { NonRfcChannel nchan = (NonRfcChannel)chan; nchan.UnsafeOwners.Remove(nickname); nchan.UnsafeChannelAdmins.Remove(nickname); nchan.UnsafeHalfops.Remove(nickname); } } /// /// /// /// Message data containing channel mode information /// Channel mode /// List of supplied paramaters private void _InterpretChannelMode(IrcMessageData ircdata, string mode, string parameter) { string[] parameters = parameter.Split(new char[] {' '}); bool add = false; bool remove = false; int modelength = mode.Length; string temp; Channel channel = null; if (ActiveChannelSyncing) { channel = GetChannel(ircdata.Channel); } IEnumerator parametersEnumerator = parameters.GetEnumerator(); // bring the enumerator to the 1. element parametersEnumerator.MoveNext(); for (int i = 0; i < modelength; i++) { switch(mode[i]) { case '-': add = false; remove = true; break; case '+': add = true; remove = false; break; case 'o': temp = (string)parametersEnumerator.Current; parametersEnumerator.MoveNext(); if (add) { if (ActiveChannelSyncing && channel != null) { // sanity check if (GetChannelUser(ircdata.Channel, temp) != null) { // update the op list try { channel.UnsafeOps.Add(temp, GetIrcUser(temp)); #if LOG4NET Logger.ChannelSyncing.Debug("added op: "+temp+" to: "+ircdata.Channel); #endif } catch (ArgumentException) { #if LOG4NET Logger.ChannelSyncing.Debug("duplicate op: "+temp+" in: "+ircdata.Channel+" not added"); #endif } // update the user op status ChannelUser cuser = GetChannelUser(ircdata.Channel, temp); cuser.IsOp = true; #if LOG4NET Logger.ChannelSyncing.Debug("set op status: " + temp + " for: "+ircdata.Channel); #endif } else { #if LOG4NET Logger.ChannelSyncing.Error("_InterpretChannelMode(): GetChannelUser(" + ircdata.Channel + "," + temp + ") returned null! Ignoring..."); #endif } } if (OnOp != null) { OnOp(this, new OpEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } if (remove) { if (ActiveChannelSyncing && channel != null) { // sanity check if (GetChannelUser(ircdata.Channel, temp) != null) { // update the op list channel.UnsafeOps.Remove(temp); #if LOG4NET Logger.ChannelSyncing.Debug("removed op: "+temp+" from: "+ircdata.Channel); #endif // update the user op status ChannelUser cuser = GetChannelUser(ircdata.Channel, temp); cuser.IsOp = false; #if LOG4NET Logger.ChannelSyncing.Debug("unset op status: " + temp + " for: "+ircdata.Channel); #endif } else { #if LOG4NET Logger.ChannelSyncing.Error("_InterpretChannelMode(): GetChannelUser(" + ircdata.Channel + "," + temp + ") returned null! Ignoring..."); #endif } } if (OnDeop != null) { OnDeop(this, new DeopEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } break; case 'q': if (SupportNonRfc) { temp = (string)parametersEnumerator.Current; parametersEnumerator.MoveNext(); if (add) { if (ActiveChannelSyncing && channel != null) { // sanity check if (GetChannelUser(ircdata.Channel, temp) != null) { // update the owner list try { ((NonRfcChannel)channel).UnsafeOwners.Add(temp, GetIrcUser(temp)); #if LOG4NET Logger.ChannelSyncing.Debug("added owner: "+temp+" to: "+ircdata.Channel); #endif } catch (ArgumentException) { #if LOG4NET Logger.ChannelSyncing.Debug("duplicate owner: "+temp+" in: "+ircdata.Channel+" not added"); #endif } // update the user owner status NonRfcChannelUser cuser = (NonRfcChannelUser)GetChannelUser(ircdata.Channel, temp); cuser.IsOwner = true; #if LOG4NET Logger.ChannelSyncing.Debug("set owner status: " + temp + " for: "+ircdata.Channel); #endif } else { #if LOG4NET Logger.ChannelSyncing.Error("_InterpretChannelMode(): GetChannelUser(" + ircdata.Channel + "," + temp + ") returned null! Ignoring..."); #endif } } if (OnOwner != null) { OnOwner(this, new OwnerEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } if (remove) { if (ActiveChannelSyncing && channel != null) { // sanity check if (GetChannelUser(ircdata.Channel, temp) != null) { // update the owner list ((NonRfcChannel)channel).UnsafeOwners.Remove(temp); #if LOG4NET Logger.ChannelSyncing.Debug("removed owner: "+temp+" from: "+ircdata.Channel); #endif // update the user owner status NonRfcChannelUser cuser = (NonRfcChannelUser)GetChannelUser(ircdata.Channel, temp); cuser.IsOwner = false; #if LOG4NET Logger.ChannelSyncing.Debug("unset owner status: " + temp + " for: "+ircdata.Channel); #endif } else { #if LOG4NET Logger.ChannelSyncing.Error("_InterpretChannelMode(): GetChannelUser(" + ircdata.Channel + "," + temp + ") returned null! Ignoring..."); #endif } } if (OnDeowner != null) { OnDeowner(this, new DeownerEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } } break; case 'a': if (SupportNonRfc) { temp = (string)parametersEnumerator.Current; parametersEnumerator.MoveNext(); if (add) { if (ActiveChannelSyncing && channel != null) { // sanity check if (GetChannelUser(ircdata.Channel, temp) != null) { // update the channel admin list try { ((NonRfcChannel)channel).UnsafeChannelAdmins.Add(temp, GetIrcUser(temp)); #if LOG4NET Logger.ChannelSyncing.Debug("added channel admin: "+temp+" to: "+ircdata.Channel); #endif } catch (ArgumentException) { #if LOG4NET Logger.ChannelSyncing.Debug("duplicate channel admin: "+temp+" in: "+ircdata.Channel+" not added"); #endif } // update the user channel admin status NonRfcChannelUser cuser = (NonRfcChannelUser)GetChannelUser(ircdata.Channel, temp); cuser.IsChannelAdmin = true; #if LOG4NET Logger.ChannelSyncing.Debug("set channel admin status: " + temp + " for: "+ircdata.Channel); #endif } else { #if LOG4NET Logger.ChannelSyncing.Error("_InterpretChannelMode(): GetChannelUser(" + ircdata.Channel + "," + temp + ") returned null! Ignoring..."); #endif } } if (OnChannelAdmin != null) { OnChannelAdmin(this, new ChannelAdminEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } if (remove) { if (ActiveChannelSyncing && channel != null) { // sanity check if (GetChannelUser(ircdata.Channel, temp) != null) { // update the channel admin list ((NonRfcChannel)channel).UnsafeChannelAdmins.Remove(temp); #if LOG4NET Logger.ChannelSyncing.Debug("removed channel admin: "+temp+" from: "+ircdata.Channel); #endif // update the user channel admin status NonRfcChannelUser cuser = (NonRfcChannelUser)GetChannelUser(ircdata.Channel, temp); cuser.IsChannelAdmin = false; #if LOG4NET Logger.ChannelSyncing.Debug("unset channel admin status: " + temp + " for: "+ircdata.Channel); #endif } else { #if LOG4NET Logger.ChannelSyncing.Error("_InterpretChannelMode(): GetChannelUser(" + ircdata.Channel + "," + temp + ") returned null! Ignoring..."); #endif } } if (OnDeChannelAdmin != null) { OnDeChannelAdmin(this, new DeChannelAdminEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } } break; case 'h': if (SupportNonRfc) { temp = (string)parametersEnumerator.Current; parametersEnumerator.MoveNext(); if (add) { if (ActiveChannelSyncing && channel != null) { // sanity check if (GetChannelUser(ircdata.Channel, temp) != null) { // update the halfop list try { ((NonRfcChannel)channel).UnsafeHalfops.Add(temp, GetIrcUser(temp)); #if LOG4NET Logger.ChannelSyncing.Debug("added halfop: "+temp+" to: "+ircdata.Channel); #endif } catch (ArgumentException) { #if LOG4NET Logger.ChannelSyncing.Debug("duplicate halfop: "+temp+" in: "+ircdata.Channel+" not added"); #endif } // update the user halfop status NonRfcChannelUser cuser = (NonRfcChannelUser)GetChannelUser(ircdata.Channel, temp); cuser.IsHalfop = true; #if LOG4NET Logger.ChannelSyncing.Debug("set halfop status: " + temp + " for: "+ircdata.Channel); #endif } else { #if LOG4NET Logger.ChannelSyncing.Error("_InterpretChannelMode(): GetChannelUser(" + ircdata.Channel + "," + temp + ") returned null! Ignoring..."); #endif } } if (OnHalfop != null) { OnHalfop(this, new HalfopEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } if (remove) { if (ActiveChannelSyncing && channel != null) { // sanity check if (GetChannelUser(ircdata.Channel, temp) != null) { // update the halfop list ((NonRfcChannel)channel).UnsafeHalfops.Remove(temp); #if LOG4NET Logger.ChannelSyncing.Debug("removed halfop: "+temp+" from: "+ircdata.Channel); #endif // update the user halfop status NonRfcChannelUser cuser = (NonRfcChannelUser)GetChannelUser(ircdata.Channel, temp); cuser.IsHalfop = false; #if LOG4NET Logger.ChannelSyncing.Debug("unset halfop status: " + temp + " for: "+ircdata.Channel); #endif } else { #if LOG4NET Logger.ChannelSyncing.Error("_InterpretChannelMode(): GetChannelUser(" + ircdata.Channel + "," + temp + ") returned null! Ignoring..."); #endif } } if (OnDehalfop != null) { OnDehalfop(this, new DehalfopEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } } break; case 'v': temp = (string)parametersEnumerator.Current; parametersEnumerator.MoveNext(); if (add) { if (ActiveChannelSyncing && channel != null) { // sanity check if (GetChannelUser(ircdata.Channel, temp) != null) { // update the voice list try { channel.UnsafeVoices.Add(temp, GetIrcUser(temp)); #if LOG4NET Logger.ChannelSyncing.Debug("added voice: "+temp+" to: "+ircdata.Channel); #endif } catch (ArgumentException) { #if LOG4NET Logger.ChannelSyncing.Debug("duplicate voice: "+temp+" in: "+ircdata.Channel+" not added"); #endif } // update the user voice status ChannelUser cuser = GetChannelUser(ircdata.Channel, temp); cuser.IsVoice = true; #if LOG4NET Logger.ChannelSyncing.Debug("set voice status: " + temp + " for: "+ircdata.Channel); #endif } else { #if LOG4NET Logger.ChannelSyncing.Error("_InterpretChannelMode(): GetChannelUser(" + ircdata.Channel + "," + temp + ") returned null! Ignoring..."); #endif } } if (OnVoice != null) { OnVoice(this, new VoiceEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } if (remove) { if (ActiveChannelSyncing && channel != null) { // sanity check if (GetChannelUser(ircdata.Channel, temp) != null) { // update the voice list channel.UnsafeVoices.Remove(temp); #if LOG4NET Logger.ChannelSyncing.Debug("removed voice: "+temp+" from: "+ircdata.Channel); #endif // update the user voice status ChannelUser cuser = GetChannelUser(ircdata.Channel, temp); cuser.IsVoice = false; #if LOG4NET Logger.ChannelSyncing.Debug("unset voice status: " + temp + " for: "+ircdata.Channel); #endif } else { #if LOG4NET Logger.ChannelSyncing.Error("_InterpretChannelMode(): GetChannelUser(" + ircdata.Channel + "," + temp + ") returned null! Ignoring..."); #endif } } if (OnDevoice != null) { OnDevoice(this, new DevoiceEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } break; case 'b': temp = (string)parametersEnumerator.Current; parametersEnumerator.MoveNext(); if (add) { if (ActiveChannelSyncing && channel != null) { try { channel.Bans.Add(temp); #if LOG4NET Logger.ChannelSyncing.Debug("added ban: "+temp+" to: "+ircdata.Channel); #endif } catch (ArgumentException) { #if LOG4NET Logger.ChannelSyncing.Debug("duplicate ban: "+temp+" in: "+ircdata.Channel+" not added"); #endif } } if (OnBan != null) { OnBan(this, new BanEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } if (remove) { if (ActiveChannelSyncing && channel != null) { channel.Bans.Remove(temp); #if LOG4NET Logger.ChannelSyncing.Debug("removed ban: "+temp+" from: "+ircdata.Channel); #endif } if (OnUnban != null) { OnUnban(this, new UnbanEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } break; case 'e': temp = (string)parametersEnumerator.Current; parametersEnumerator.MoveNext(); if (add) { if (ActiveChannelSyncing && channel != null) { try { channel.BanExceptions.Add(temp); #if LOG4NET Logger.ChannelSyncing.Debug("added ban exception: "+temp+" to: "+ircdata.Channel); #endif } catch (ArgumentException) { #if LOG4NET Logger.ChannelSyncing.Debug("duplicate ban exception: "+temp+" in: "+ircdata.Channel+" not added"); #endif } } if (OnBanException != null) { OnBanException(this, new BanEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } if (remove) { if (ActiveChannelSyncing && channel != null) { channel.BanExceptions.Remove(temp); #if LOG4NET Logger.ChannelSyncing.Debug("removed ban exception: "+temp+" from: "+ircdata.Channel); #endif } if (OnUnBanException != null) { OnUnBanException(this, new UnbanEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } break; case 'I': temp = (string)parametersEnumerator.Current; parametersEnumerator.MoveNext(); if (add) { if (ActiveChannelSyncing && channel != null) { try { channel.InviteExceptions.Add(temp); #if LOG4NET Logger.ChannelSyncing.Debug("added invite exception: "+temp+" to: "+ircdata.Channel); #endif } catch (ArgumentException) { #if LOG4NET Logger.ChannelSyncing.Debug("duplicate invite exception: "+temp+" in: "+ircdata.Channel+" not added"); #endif } } if (OnInviteException != null) { OnInviteException(this, new BanEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } if (remove) { if (ActiveChannelSyncing && channel != null) { channel.InviteExceptions.Remove(temp); #if LOG4NET Logger.ChannelSyncing.Debug("removed invite exception: "+temp+" from: "+ircdata.Channel); #endif } if (OnUnInviteException != null) { OnUnInviteException(this, new UnbanEventArgs(ircdata, ircdata.Channel, ircdata.Nick, temp)); } } break; case 'l': temp = (string)parametersEnumerator.Current; parametersEnumerator.MoveNext(); if (add) { if (ActiveChannelSyncing && channel != null) { try { channel.UserLimit = int.Parse(temp); #if LOG4NET Logger.ChannelSyncing.Debug("stored user limit for: "+ircdata.Channel); #endif } catch (FormatException) { #if LOG4NET Logger.ChannelSyncing.Error("could not parse user limit: "+temp+" channel: "+ircdata.Channel); #endif } } } if (remove) { if (ActiveChannelSyncing && channel != null) { channel.UserLimit = 0; #if LOG4NET Logger.ChannelSyncing.Debug("removed user limit for: "+ircdata.Channel); #endif } } break; case 'k': temp = (string)parametersEnumerator.Current; parametersEnumerator.MoveNext(); if (add) { if (ActiveChannelSyncing && channel != null) { channel.Key = temp; #if LOG4NET Logger.ChannelSyncing.Debug("stored channel key for: "+ircdata.Channel); #endif } } if (remove) { if (ActiveChannelSyncing && channel != null) { channel.Key = ""; #if LOG4NET Logger.ChannelSyncing.Debug("removed channel key for: "+ircdata.Channel); #endif } } break; default: if (add) { if (ActiveChannelSyncing && channel != null) { if (channel.Mode.IndexOf(mode[i]) == -1) { channel.Mode += mode[i]; #if LOG4NET Logger.ChannelSyncing.Debug("added channel mode ("+mode[i]+") for: "+ircdata.Channel); #endif } } } if (remove) { if (ActiveChannelSyncing && channel != null) { channel.Mode = channel.Mode.Replace(mode[i].ToString(), String.Empty); #if LOG4NET Logger.ChannelSyncing.Debug("removed channel mode ("+mode[i]+") for: "+ircdata.Channel); #endif } } break; } } } #region Internal Messagehandlers /// /// Event handler for ping messages /// /// Message data containing ping information private void _Event_PING(IrcMessageData ircdata) { string server = ircdata.RawMessageArray[1].Substring(1); #if LOG4NET Logger.Connection.Debug("Ping? Pong!"); #endif RfcPong(server, Priority.Critical); if (OnPing != null) { OnPing(this, new PingEventArgs(ircdata, server)); } } /// /// Event handler for PONG messages /// /// Message data containing pong information private void _Event_PONG(IrcMessageData ircdata) { if (OnPong != null) { OnPong(this, new PongEventArgs(ircdata, ircdata.Irc.Lag)); } } /// /// Event handler for error messages /// /// Message data containing error information private void _Event_ERROR(IrcMessageData ircdata) { string message = ircdata.Message; #if LOG4NET Logger.Connection.Info("received ERROR from IRC server"); #endif if (OnError != null) { OnError(this, new ErrorEventArgs(ircdata, message)); } } /// /// Event handler for join messages /// /// Message data containing join information private void _Event_JOIN(IrcMessageData ircdata) { string who = ircdata.Nick; string channelname = ircdata.Channel; if (IsMe(who)) { _JoinedChannels.Add(channelname); } if (ActiveChannelSyncing) { Channel channel; if (IsMe(who)) { // we joined the channel #if LOG4NET Logger.ChannelSyncing.Debug("joining channel: "+channelname); #endif channel = CreateChannel(channelname); _Channels.Add(channelname, channel); // request channel mode RfcMode(channelname); // request wholist RfcWho(channelname); // request ban exception list if (_ServerProperties.BanExceptionCharacter.HasValue) { BanException(channelname); } // request invite exception list if (_ServerProperties.InviteExceptionCharacter.HasValue) { InviteException(channelname); } // request banlist Ban(channelname); } else { // someone else joined the channel // request the who data RfcWho(who); } #if LOG4NET Logger.ChannelSyncing.Debug(who+" joins channel: "+channelname); #endif channel = GetChannel(channelname); IrcUser ircuser = GetIrcUser(who); if (ircuser == null) { ircuser = new IrcUser(who, this); ircuser.Ident = ircdata.Ident; ircuser.Host = ircdata.Host; _IrcUsers.Add(who, ircuser); } // HACK: IRCnet's anonymous channel mode feature breaks our // channnel sync here as they use the same nick for ALL channel // users! // Example: :anonymous!anonymous@anonymous. JOIN :$channel if (who == "anonymous" && ircdata.Ident == "anonymous" && ircdata.Host == "anonymous." && IsJoined(channelname, who)) { // ignore } else { ChannelUser channeluser = CreateChannelUser(channelname, ircuser); channel.UnsafeUsers[who] = channeluser; } } if (OnJoin != null) { OnJoin(this, new JoinEventArgs(ircdata, channelname, who)); } } /// /// Event handler for part messages /// /// Message data containing part information private void _Event_PART(IrcMessageData ircdata) { string who = ircdata.Nick; string channel = ircdata.Channel; string partmessage = ircdata.Message; if (IsMe(who)) { _JoinedChannels.Remove(channel); } if (ActiveChannelSyncing) { if (IsMe(who)) { #if LOG4NET Logger.ChannelSyncing.Debug("parting channel: "+channel); #endif _Channels.Remove(channel); } else { #if LOG4NET Logger.ChannelSyncing.Debug(who+" parts channel: "+channel); #endif // HACK: IRCnet's anonymous channel mode feature breaks our // channnel sync here as they use the same nick for ALL channel // users! // Example: :anonymous!anonymous@anonymous. PART $channel :$msg if (who == "anonymous" && ircdata.Ident == "anonymous" && ircdata.Host == "anonymous." && !IsJoined(channel, who)) { // ignore } else { _RemoveChannelUser(channel, who); _RemoveIrcUser(who); } } } if (OnPart != null) { OnPart(this, new PartEventArgs(ircdata, channel, who, partmessage)); } } /// /// Event handler for kick messages /// /// Message data containing kick information private void _Event_KICK(IrcMessageData ircdata) { string channelname = ircdata.Channel; string who = ircdata.Nick; if (String.IsNullOrEmpty(who)) { // the server itself kicked who = ircdata.From; } string whom = ircdata.RawMessageArray[3]; string reason = ircdata.Message; bool isme = IsMe(whom); if (isme) { _JoinedChannels.Remove(channelname); } if (ActiveChannelSyncing) { if (isme) { Channel channel = GetChannel(channelname); _Channels.Remove(channelname); if (_AutoRejoinOnKick) { RfcJoin(channel.Name, channel.Key); } } else { _RemoveChannelUser(channelname, whom); _RemoveIrcUser(whom); } } else { if (isme && AutoRejoinOnKick) { RfcJoin(channelname); } } if (OnKick != null) { OnKick(this, new KickEventArgs(ircdata, channelname, who, whom, reason)); } } /// /// Event handler for quit messages /// /// Message data containing quit information private void _Event_QUIT(IrcMessageData ircdata) { string who = ircdata.Nick; string reason = ircdata.Message; // no need to handle if we quit, disconnect event will take care if (ActiveChannelSyncing) { // sanity checks, freshirc is very broken about RFC IrcUser user = GetIrcUser(who); if (user != null) { string[] joined_channels = user.JoinedChannels; if (joined_channels != null) { foreach (string channel in joined_channels) { _RemoveChannelUser(channel, who); } _RemoveIrcUser(who); #if LOG4NET } else { Logger.ChannelSyncing.Error("user.JoinedChannels (for: '"+who+"') returned null in _Event_QUIT! Ignoring..."); #endif } #if LOG4NET } else { Logger.ChannelSyncing.Error("GetIrcUser("+who+") returned null in _Event_QUIT! Ignoring..."); #endif } } if (OnQuit != null) { OnQuit(this, new QuitEventArgs(ircdata, who, reason)); } } /// /// Event handler for private messages /// /// Message data containing private message information private void _Event_PRIVMSG(IrcMessageData ircdata) { switch (ircdata.Type) { case ReceiveType.ChannelMessage: if (OnChannelMessage != null) { OnChannelMessage(this, new IrcEventArgs(ircdata)); } break; case ReceiveType.ChannelAction: if (OnChannelAction != null) { string action = ircdata.Message.Substring(8, ircdata.Message.Length - 9); OnChannelAction(this, new ActionEventArgs(ircdata, action)); } break; case ReceiveType.QueryMessage: if (OnQueryMessage != null) { OnQueryMessage(this, new IrcEventArgs(ircdata)); } break; case ReceiveType.QueryAction: if (OnQueryAction != null) { string action = ircdata.Message.Substring(8, ircdata.Message.Length - 9); OnQueryAction(this, new ActionEventArgs(ircdata, action)); } break; case ReceiveType.CtcpRequest: if (OnCtcpRequest != null) { int space_pos = ircdata.Message.IndexOf(' '); string cmd = ""; string param = ""; if (space_pos != -1) { cmd = ircdata.Message.Substring(1, space_pos - 1); param = ircdata.Message.Substring(space_pos + 1, ircdata.Message.Length - space_pos - 2); } else { cmd = ircdata.Message.Substring(1, ircdata.Message.Length - 2); } OnCtcpRequest(this, new CtcpEventArgs(ircdata, cmd, param)); } break; } } /// /// Event handler for notice messages /// /// Message data containing notice information private void _Event_NOTICE(IrcMessageData ircdata) { switch (ircdata.Type) { case ReceiveType.ChannelNotice: if (OnChannelNotice != null) { OnChannelNotice(this, new IrcEventArgs(ircdata)); } break; case ReceiveType.QueryNotice: if (OnQueryNotice != null) { OnQueryNotice(this, new IrcEventArgs(ircdata)); } break; case ReceiveType.CtcpReply: if (OnCtcpReply != null) { int space_pos = ircdata.Message.IndexOf(' '); string cmd = ""; string param = ""; if (space_pos != -1) { cmd = ircdata.Message.Substring(1, space_pos - 1); param = ircdata.Message.Substring(space_pos + 1, ircdata.Message.Length - space_pos - 2); } else { cmd = ircdata.Message.Substring(1, ircdata.Message.Length - 2); } OnCtcpReply(this, new CtcpEventArgs(ircdata, cmd, param)); } break; } } /// /// Event handler for topic messages /// /// Message data containing topic information private void _Event_TOPIC(IrcMessageData ircdata) { string who = ircdata.Nick; string channel = ircdata.Channel; string newtopic = ircdata.Message; if (ActiveChannelSyncing && IsJoined(channel)) { GetChannel(channel).Topic = newtopic; #if LOG4NET Logger.ChannelSyncing.Debug("stored topic for channel: "+channel); #endif } if (OnTopicChange != null) { OnTopicChange(this, new TopicChangeEventArgs(ircdata, channel, who, newtopic)); } } /// /// Event handler for nickname messages /// /// Message data containing nickname information private void _Event_NICK(IrcMessageData ircdata) { string oldnickname = ircdata.Nick; //string newnickname = ircdata.Message; // the colon in the NICK message is optional, thus we can't rely on Message string newnickname = ircdata.RawMessageArray[2]; // so let's strip the colon if it's there if (newnickname.StartsWith(":")) { newnickname = newnickname.Substring(1); } if (IsMe(ircdata.Nick)) { // nickname change is your own _Nickname = newnickname; } if (ActiveChannelSyncing) { IrcUser ircuser = GetIrcUser(oldnickname); // if we don't have any info about him, don't update him! // (only queries or ourself in no channels) if (ircuser != null) { string[] joinedchannels = ircuser.JoinedChannels; // update his nickname ircuser.Nick = newnickname; // remove the old entry // remove first to avoid duplication, Foo -> foo _IrcUsers.Remove(oldnickname); // add him as new entry and new nickname as key _IrcUsers.Add(newnickname, ircuser); #if LOG4NET Logger.ChannelSyncing.Debug("updated nickname of: "+oldnickname+" to: "+newnickname); #endif // now the same for all channels he is joined Channel channel; ChannelUser channeluser; foreach (string channelname in joinedchannels) { channel = GetChannel(channelname); channeluser = GetChannelUser(channelname, oldnickname); // remove first to avoid duplication, Foo -> foo channel.UnsafeUsers.Remove(oldnickname); channel.UnsafeUsers.Add(newnickname, channeluser); if (SupportNonRfc && ((NonRfcChannelUser)channeluser).IsOwner) { NonRfcChannel nchannel = (NonRfcChannel)channel; nchannel.UnsafeOwners.Remove(oldnickname); nchannel.UnsafeOwners.Add(newnickname, channeluser); } if (SupportNonRfc && ((NonRfcChannelUser)channeluser).IsChannelAdmin) { NonRfcChannel nchannel = (NonRfcChannel)channel; nchannel.UnsafeChannelAdmins.Remove(oldnickname); nchannel.UnsafeChannelAdmins.Add(newnickname, channeluser); } if (channeluser.IsOp) { channel.UnsafeOps.Remove(oldnickname); channel.UnsafeOps.Add(newnickname, channeluser); } if (SupportNonRfc && ((NonRfcChannelUser)channeluser).IsHalfop) { NonRfcChannel nchannel = (NonRfcChannel)channel; nchannel.UnsafeHalfops.Remove(oldnickname); nchannel.UnsafeHalfops.Add(newnickname, channeluser); } if (channeluser.IsVoice) { channel.UnsafeVoices.Remove(oldnickname); channel.UnsafeVoices.Add(newnickname, channeluser); } } } } if (OnNickChange != null) { OnNickChange(this, new NickChangeEventArgs(ircdata, oldnickname, newnickname)); } } /// /// Event handler for invite messages /// /// Message data containing invite information private void _Event_INVITE(IrcMessageData ircdata) { string channel = ircdata.Channel; string inviter = ircdata.Nick; if (AutoJoinOnInvite) { if (channel.Trim() != "0") { RfcJoin(channel); } } if (OnInvite != null) { OnInvite(this, new InviteEventArgs(ircdata, channel, inviter)); } } /// /// Event handler for mode messages /// /// Message data containing mode information private void _Event_MODE(IrcMessageData ircdata) { if (IsMe(ircdata.RawMessageArray[2])) { // my user mode changed _Usermode = ircdata.RawMessageArray[3].Substring(1); } else { // channel mode changed string mode = ircdata.RawMessageArray[3]; string parameter = String.Join(" ", ircdata.RawMessageArray, 4, ircdata.RawMessageArray.Length-4); _InterpretChannelMode(ircdata, mode, parameter); } if ((ircdata.Type == ReceiveType.UserModeChange) && (OnUserModeChange != null)) { OnUserModeChange(this, new IrcEventArgs(ircdata)); } if ((ircdata.Type == ReceiveType.ChannelModeChange) && (OnChannelModeChange != null)) { OnChannelModeChange(this, new IrcEventArgs(ircdata)); } if (OnModeChange != null) { OnModeChange(this, new IrcEventArgs(ircdata)); } } /// /// Event handler for channel mode reply messages /// /// Message data containing reply information private void _Event_RPL_CHANNELMODEIS(IrcMessageData ircdata) { if (ActiveChannelSyncing && IsJoined(ircdata.Channel)) { // reset stored mode first, as this is the complete mode Channel chan = GetChannel(ircdata.Channel); chan.Mode = String.Empty; string mode = ircdata.RawMessageArray[4]; string parameter = String.Join(" ", ircdata.RawMessageArray, 5, ircdata.RawMessageArray.Length-5); _InterpretChannelMode(ircdata, mode, parameter); } } /// /// Event handler for welcome reply messages /// /// /// Upon success, the client will receive an RPL_WELCOME (for users) or /// RPL_YOURESERVICE (for services) message indicating that the /// connection is now registered and known the to the entire IRC network. /// The reply message MUST contain the full client identifier upon which /// it was registered. /// /// Message data containing reply information private void _Event_RPL_WELCOME(IrcMessageData ircdata) { // updating our nickname, that we got (maybe cutted...) _Nickname = ircdata.RawMessageArray[2]; if (OnRegistered != null) { OnRegistered(this, EventArgs.Empty); } } private void _Event_RPL_TOPIC(IrcMessageData ircdata) { string topic = ircdata.Message; string channel = ircdata.Channel; if (ActiveChannelSyncing && IsJoined(channel)) { GetChannel(channel).Topic = topic; #if LOG4NET Logger.ChannelSyncing.Debug("stored topic for channel: "+channel); #endif } if (OnTopic != null) { OnTopic(this, new TopicEventArgs(ircdata, channel, topic)); } } private void _Event_RPL_NOTOPIC(IrcMessageData ircdata) { string channel = ircdata.Channel; if (ActiveChannelSyncing && IsJoined(channel)) { GetChannel(channel).Topic = ""; #if LOG4NET Logger.ChannelSyncing.Debug("stored empty topic for channel: "+channel); #endif } if (OnTopic != null) { OnTopic(this, new TopicEventArgs(ircdata, channel, "")); } } private void _Event_RPL_NAMREPLY(IrcMessageData ircdata) { string channelname = ircdata.Channel; string[] userlist = ircdata.MessageArray; // HACK: BIP skips the colon after the channel name even though // RFC 1459 and 2812 says it's mandantory in RPL_NAMREPLY if (userlist == null) { if (ircdata.RawMessageArray.Length > 5) { userlist = new string[] { ircdata.RawMessageArray[5] }; } else { userlist = new string[] {}; } } if (ActiveChannelSyncing && IsJoined(channelname)) { string nickname; bool owner; bool chanadmin; bool op; bool halfop; bool voice; foreach (string user in userlist) { if (user.Length <= 0) { continue; } owner = false; chanadmin = false; op = false; halfop = false; voice = false; switch (user[0]) { case '~': owner = true; nickname = user.Substring(1); break; case '&': chanadmin = true; nickname = user.Substring(1); break; case '@': op = true; nickname = user.Substring(1); break; case '+': voice = true; nickname = user.Substring(1); break; case '%': halfop = true; nickname = user.Substring(1); break; default: nickname = user; break; } IrcUser ircuser = GetIrcUser(nickname); ChannelUser channeluser = GetChannelUser(channelname, nickname); if (ircuser == null) { #if LOG4NET Logger.ChannelSyncing.Debug("creating IrcUser: "+nickname+" because he doesn't exist yet"); #endif ircuser = new IrcUser(nickname, this); _IrcUsers.Add(nickname, ircuser); } if (channeluser == null) { #if LOG4NET Logger.ChannelSyncing.Debug("creating ChannelUser: "+nickname+" for Channel: "+channelname+" because he doesn't exist yet"); #endif channeluser = CreateChannelUser(channelname, ircuser); Channel channel = GetChannel(channelname); channel.UnsafeUsers.Add(nickname, channeluser); if (SupportNonRfc && owner) { ((NonRfcChannel)channel).UnsafeOwners.Add(nickname, channeluser); #if LOG4NET Logger.ChannelSyncing.Debug("added owner: "+nickname+" to: "+channelname); #endif } if (SupportNonRfc && chanadmin) { ((NonRfcChannel)channel).UnsafeChannelAdmins.Add(nickname, channeluser); #if LOG4NET Logger.ChannelSyncing.Debug("added channel admin: "+nickname+" to: "+channelname); #endif } if (op) { channel.UnsafeOps.Add(nickname, channeluser); #if LOG4NET Logger.ChannelSyncing.Debug("added op: "+nickname+" to: "+channelname); #endif } if (SupportNonRfc && halfop) { ((NonRfcChannel)channel).UnsafeHalfops.Add(nickname, channeluser); #if LOG4NET Logger.ChannelSyncing.Debug("added halfop: "+nickname+" to: "+channelname); #endif } if (voice) { channel.UnsafeVoices.Add(nickname, channeluser); #if LOG4NET Logger.ChannelSyncing.Debug("added voice: "+nickname+" to: "+channelname); #endif } } channeluser.IsOp = op; channeluser.IsVoice = voice; if (SupportNonRfc) { var nchanneluser = (NonRfcChannelUser)channeluser; nchanneluser.IsOwner = owner; nchanneluser.IsChannelAdmin = chanadmin; nchanneluser.IsHalfop = halfop; } } } var filteredUserlist = new List(userlist.Length); // filter user modes from nicknames foreach (string user in userlist) { if (String.IsNullOrEmpty(user)) { continue; } switch (user[0]) { case '@': case '+': case '&': case '%': case '~': case '!': case '.': filteredUserlist.Add(user.Substring(1)); break; default: filteredUserlist.Add(user); break; } } if (OnNames != null) { OnNames(this, new NamesEventArgs(ircdata, channelname, filteredUserlist.ToArray(), userlist)); } } private void _Event_RPL_LIST(IrcMessageData ircdata) { string channelName = ircdata.Channel; int userCount = Int32.Parse(ircdata.RawMessageArray[4]); string topic = ircdata.Message; ChannelInfo info = null; if (OnList != null || _ChannelList != null) { info = new ChannelInfo(channelName, userCount, topic); } if (_ChannelList != null) { _ChannelList.Add(info); } if (OnList != null) { OnList(this, new ListEventArgs(ircdata, info)); } } private void _Event_RPL_LISTEND(IrcMessageData ircdata) { if (_ChannelListReceivedEvent != null) { _ChannelListReceivedEvent.Set(); } } private void _Event_RPL_TRYAGAIN(IrcMessageData ircdata) { if (_ChannelListReceivedEvent != null) { _ChannelListReceivedEvent.Set(); } } /* // BUG: RFC2812 says LIST and WHO might return ERR_TOOMANYMATCHES which // is not defined :( private void _Event_ERR_TOOMANYMATCHES(IrcMessageData ircdata) { if (_ListInfosReceivedEvent != null) { _ListInfosReceivedEvent.Set(); } } */ private void _Event_RPL_ENDOFNAMES(IrcMessageData ircdata) { string channelname = ircdata.RawMessageArray[3]; if (ActiveChannelSyncing && IsJoined(channelname)) { #if LOG4NET Logger.ChannelSyncing.Debug("passive synced: "+channelname); #endif if (OnChannelPassiveSynced != null) { OnChannelPassiveSynced(this, new IrcEventArgs(ircdata)); } } } private void _Event_RPL_AWAY(IrcMessageData ircdata) { string who = ircdata.RawMessageArray[3]; string awaymessage = ircdata.Message; if (ActiveChannelSyncing) { IrcUser ircuser = GetIrcUser(who); if (ircuser != null) { #if LOG4NET Logger.ChannelSyncing.Debug("setting away flag for user: "+who); #endif ircuser.IsAway = true; } } if (OnAway != null) { OnAway(this, new AwayEventArgs(ircdata, who, awaymessage)); } } private void _Event_RPL_UNAWAY(IrcMessageData ircdata) { _IsAway = false; if (OnUnAway != null) { OnUnAway(this, new IrcEventArgs(ircdata)); } } private void _Event_RPL_NOWAWAY(IrcMessageData ircdata) { _IsAway = true; if (OnNowAway != null) { OnNowAway(this, new IrcEventArgs(ircdata)); } } private void _Event_RPL_WHOREPLY(IrcMessageData ircdata) { WhoInfo info = WhoInfo.Parse(ircdata); string channel = info.Channel; string nick = info.Nick; if (_WhoList != null) { _WhoList.Add(info); } if (ActiveChannelSyncing && IsJoined(channel)) { // checking the irc and channel user I only do for sanity! // according to RFC they must be known to us already via RPL_NAMREPLY // psyBNC is not very correct with this... maybe other bouncers too IrcUser ircuser = GetIrcUser(nick); ChannelUser channeluser = GetChannelUser(channel, nick); #if LOG4NET if (ircuser == null) { Logger.ChannelSyncing.Error("GetIrcUser("+nick+") returned null in _Event_WHOREPLY! Ignoring..."); } #endif #if LOG4NET if (channeluser == null) { Logger.ChannelSyncing.Error("GetChannelUser("+nick+") returned null in _Event_WHOREPLY! Ignoring..."); } #endif if (ircuser != null) { #if LOG4NET Logger.ChannelSyncing.Debug("updating userinfo (from whoreply) for user: "+nick+" channel: "+channel); #endif ircuser.Ident = info.Ident; ircuser.Host = info.Host; ircuser.Server = info.Server; ircuser.Nick = info.Nick; ircuser.HopCount = info.HopCount; ircuser.Realname = info.Realname; ircuser.IsAway = info.IsAway; ircuser.IsIrcOp = info.IsIrcOp; ircuser.IsRegistered = info.IsRegistered; switch (channel[0]) { case '#': case '!': case '&': case '+': // this channel may not be where we are joined! // see RFC 1459 and RFC 2812, it must return a channelname // we use this channel info when possible... if (channeluser != null) { channeluser.IsOp = info.IsOp; channeluser.IsVoice = info.IsVoice; } break; } } } if (OnWho != null) { OnWho(this, new WhoEventArgs(ircdata, info)); } } private void _Event_RPL_ENDOFWHO(IrcMessageData ircdata) { if (_WhoListReceivedEvent != null) { _WhoListReceivedEvent.Set(); } } private void _Event_RPL_MOTD(IrcMessageData ircdata) { if (!_MotdReceived) { _Motd.Add(ircdata.Message); } if (OnMotd != null) { OnMotd(this, new MotdEventArgs(ircdata, ircdata.Message)); } } private void _Event_RPL_ENDOFMOTD(IrcMessageData ircdata) { _MotdReceived = true; } private void _Event_RPL_BANLIST(IrcMessageData ircdata) { string channelname = ircdata.Channel; BanInfo info = BanInfo.Parse(ircdata); if (_BanList != null) { _BanList.Add(info); } if (ActiveChannelSyncing && IsJoined(channelname)) { Channel channel = GetChannel(channelname); if (channel.IsSycned) { return; } channel.Bans.Add(info.Mask); } } private void _Event_RPL_ENDOFBANLIST(IrcMessageData ircdata) { string channelname = ircdata.Channel; if (_BanListReceivedEvent != null) { _BanListReceivedEvent.Set(); } if (ActiveChannelSyncing && IsJoined(channelname)) { Channel channel = GetChannel(channelname); if (channel.IsSycned) { // only fire the event once return; } channel.ActiveSyncStop = DateTime.Now; channel.IsSycned = true; #if LOG4NET Logger.ChannelSyncing.Debug("active synced: "+channelname+ " (in "+channel.ActiveSyncTime.TotalSeconds+" sec)"); #endif if (OnChannelActiveSynced != null) { OnChannelActiveSynced(this, new IrcEventArgs(ircdata)); } } } private void _Event_RPL_EXCEPTLIST(IrcMessageData ircdata) { string channelname = ircdata.Channel; BanInfo info = BanInfo.Parse(ircdata); if (_BanExceptList != null) { _BanExceptList.Add(info); } if (ActiveChannelSyncing && IsJoined(channelname)) { Channel channel = GetChannel(channelname); if (channel.IsSycned) { return; } channel.BanExceptions.Add(info.Mask); } } private void _Event_RPL_ENDOFEXCEPTLIST(IrcMessageData ircdata) { string channelname = ircdata.Channel; if (_BanExceptListReceivedEvent != null) { _BanExceptListReceivedEvent.Set(); } } private void _Event_RPL_INVITELIST(IrcMessageData ircdata) { string channelname = ircdata.Channel; BanInfo info = BanInfo.Parse(ircdata); if (_InviteExceptList != null) { _InviteExceptList.Add(info); } if (ActiveChannelSyncing && IsJoined(channelname)) { Channel channel = GetChannel(channelname); if (channel.IsSycned) { return; } channel.InviteExceptions.Add(info.Mask); } } private void _Event_RPL_ENDOFINVITELIST(IrcMessageData ircdata) { string channelname = ircdata.Channel; if (_InviteExceptListReceivedEvent != null) { _InviteExceptListReceivedEvent.Set(); } } // MODE +b might return ERR_NOCHANMODES for mode-less channels (like +chan) private void _Event_ERR_NOCHANMODES(IrcMessageData ircdata) { string channelname = ircdata.RawMessageArray[3]; if (ActiveChannelSyncing && IsJoined(channelname)) { Channel channel = GetChannel(channelname); if (channel.IsSycned) { // only fire the event once return; } channel.ActiveSyncStop = DateTime.Now; channel.IsSycned = true; #if LOG4NET Logger.ChannelSyncing.Debug("active synced: "+channelname+ " (in "+channel.ActiveSyncTime.TotalSeconds+" sec)"); #endif if (OnChannelActiveSynced != null) { OnChannelActiveSynced(this, new IrcEventArgs(ircdata)); } } } private void _Event_ERR(IrcMessageData ircdata) { if (OnErrorMessage != null) { OnErrorMessage(this, new IrcEventArgs(ircdata)); } } private void _Event_ERR_NICKNAMEINUSE(IrcMessageData ircdata) { #if LOG4NET Logger.Connection.Warn("nickname collision detected, changing nickname"); #endif if (!AutoNickHandling) { return; } string nickname; // if a nicklist has been given loop through the nicknames // if the upper limit of this list has been reached and still no nickname has registered // then generate a random nick if (_CurrentNickname == NicknameList.Length-1) { Random rand = new Random(); int number = rand.Next(999); if (Nickname.Length > 5) { nickname = Nickname.Substring(0, 5)+number; } else { nickname = Nickname.Substring(0, Nickname.Length-1)+number; } } else { nickname = _NextNickname(); } // change the nickname RfcNick(nickname, Priority.Critical); } private void _Event_RPL_BOUNCE(IrcMessageData ircdata) { // HACK: might be BOUNCE or ISUPPORT; try to detect if (ircdata.Message.StartsWith("Try server ")) { // BOUNCE string host = null; int port = -1; // try to parse out host and port var match = _BounceMessageRegex.Match(ircdata.Message); if (match.Success) { host = match.Groups [1].Value; port = int.Parse(match.Groups [2].Value); } if (OnBounce != null) { OnBounce(this, new BounceEventArgs(ircdata, host, port)); } return; } // ISUPPORT // split the message (0 = server, 1 = code, 2 = my nick) for (int i = 3; i < ircdata.RawMessageArray.Length; ++i) { var msg = ircdata.RawMessageArray [i]; if (msg.StartsWith(":")) { // addendum; we're done break; } var keyval = msg.Split('='); if (keyval.Length == 1) { // keyword only _ServerProperties.RawProperties [keyval [0]] = null; } else if (keyval.Length == 2) { // key and value _ServerProperties.RawProperties [keyval [0]] = keyval [1]; } else { #if LOG4NET Logger.Connection.Warn("confusing ISUPPORT message, ignoring: " + msg); #endif } } } #endregion } } smuxi-0.11/lib/SmartIrc4net/src/IrcClient/EventArgs.cs0000644000175000017500000004562312253423361023366 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Specialized; namespace Meebey.SmartIrc4net { /// /// /// public class ActionEventArgs : CtcpEventArgs { private string _ActionMessage; public string ActionMessage { get { return _ActionMessage; } } internal ActionEventArgs(IrcMessageData data, string actionmsg) : base(data, "ACTION", actionmsg) { _ActionMessage = actionmsg; } } /// /// /// public class CtcpEventArgs : IrcEventArgs { private string _CtcpCommand; private string _CtcpParameter; public string CtcpCommand { get { return _CtcpCommand; } } public string CtcpParameter { get { return _CtcpParameter; } } internal CtcpEventArgs(IrcMessageData data, string ctcpcmd, string ctcpparam) : base(data) { _CtcpCommand = ctcpcmd; _CtcpParameter = ctcpparam; } } /// /// /// public class ErrorEventArgs : IrcEventArgs { private string _ErrorMessage; public string ErrorMessage { get { return _ErrorMessage; } } internal ErrorEventArgs(IrcMessageData data, string errormsg) : base(data) { _ErrorMessage = errormsg; } } /// /// /// public class MotdEventArgs : IrcEventArgs { private string _MotdMessage; public string MotdMessage { get { return _MotdMessage; } } internal MotdEventArgs(IrcMessageData data, string motdmsg) : base(data) { _MotdMessage = motdmsg; } } /// /// /// public class PingEventArgs : IrcEventArgs { private string _PingData; public string PingData { get { return _PingData; } } internal PingEventArgs(IrcMessageData data, string pingdata) : base(data) { _PingData = pingdata; } } /// /// /// public class PongEventArgs : IrcEventArgs { private TimeSpan _Lag; public TimeSpan Lag { get { return _Lag; } } internal PongEventArgs(IrcMessageData data, TimeSpan lag) : base(data) { _Lag = lag; } } /// /// /// public class KickEventArgs : IrcEventArgs { private string _Channel; private string _Who; private string _Whom; private string _KickReason; public string Channel { get { return _Channel; } } public string Who { get { return _Who; } } public string Whom { get { return _Whom; } } public string KickReason { get { return _KickReason; } } internal KickEventArgs(IrcMessageData data, string channel, string who, string whom, string kickreason) : base(data) { _Channel = channel; _Who = who; _Whom = whom; _KickReason = kickreason; } } /// /// /// public class JoinEventArgs : IrcEventArgs { private string _Channel; private string _Who; public string Channel { get { return _Channel; } } public string Who { get { return _Who; } } internal JoinEventArgs(IrcMessageData data, string channel, string who) : base(data) { _Channel = channel; _Who = who; } } /// /// /// public class NamesEventArgs : IrcEventArgs { private string _Channel; private string[] _UserList; public string[] RawUserList { get; private set; } public string Channel { get { return _Channel; } } public string[] UserList { get { return _UserList; } } internal NamesEventArgs(IrcMessageData data, string channel, string[] userlist, string[] rawUserList) : base(data) { _Channel = channel; _UserList = userlist; RawUserList = rawUserList; } } /// /// /// public class ListEventArgs : IrcEventArgs { private ChannelInfo f_ListInfo; public ChannelInfo ListInfo { get { return f_ListInfo; } } internal ListEventArgs(IrcMessageData data, ChannelInfo listInfo) : base(data) { f_ListInfo = listInfo; } } /// /// /// public class InviteEventArgs : IrcEventArgs { private string _Channel; private string _Who; public string Channel { get { return _Channel; } } public string Who { get { return _Who; } } internal InviteEventArgs(IrcMessageData data, string channel, string who) : base(data) { _Channel = channel; _Who = who; } } /// /// /// public class PartEventArgs : IrcEventArgs { private string _Channel; private string _Who; private string _PartMessage; public string Channel { get { return _Channel; } } public string Who { get { return _Who; } } public string PartMessage { get { return _PartMessage; } } internal PartEventArgs(IrcMessageData data, string channel, string who, string partmessage) : base(data) { _Channel = channel; _Who = who; _PartMessage = partmessage; } } /// /// /// public class WhoEventArgs : IrcEventArgs { private WhoInfo f_WhoInfo; [Obsolete("Use WhoEventArgs.WhoInfo instead.")] public string Channel { get { return f_WhoInfo.Channel; } } [Obsolete("Use WhoEventArgs.WhoInfo instead.")] public string Nick { get { return f_WhoInfo.Nick; } } [Obsolete("Use WhoEventArgs.WhoInfo instead.")] public string Ident { get { return f_WhoInfo.Ident; } } [Obsolete("Use WhoEventArgs.WhoInfo instead.")] public string Host { get { return f_WhoInfo.Host; } } [Obsolete("Use WhoEventArgs.WhoInfo instead.")] public string Realname { get { return f_WhoInfo.Realname; } } [Obsolete("Use WhoEventArgs.WhoInfo instead.")] public bool IsAway { get { return f_WhoInfo.IsAway; } } [Obsolete("Use WhoEventArgs.WhoInfo instead.")] public bool IsOp { get { return f_WhoInfo.IsOp; } } [Obsolete("Use WhoEventArgs.WhoInfo instead.")] public bool IsVoice { get { return f_WhoInfo.IsVoice; } } [Obsolete("Use WhoEventArgs.WhoInfo instead.")] public bool IsIrcOp { get { return f_WhoInfo.IsIrcOp; } } [Obsolete("Use WhoEventArgs.WhoInfo instead.")] public string Server { get { return f_WhoInfo.Server; } } [Obsolete("Use WhoEventArgs.WhoInfo instead.")] public int HopCount { get { return f_WhoInfo.HopCount; } } public WhoInfo WhoInfo { get { return f_WhoInfo; } } internal WhoEventArgs(IrcMessageData data, WhoInfo whoInfo) : base(data) { f_WhoInfo = whoInfo; } } /// /// /// public class QuitEventArgs : IrcEventArgs { private string _Who; private string _QuitMessage; public string Who { get { return _Who; } } public string QuitMessage { get { return _QuitMessage; } } internal QuitEventArgs(IrcMessageData data, string who, string quitmessage) : base(data) { _Who = who; _QuitMessage = quitmessage; } } /// /// /// public class AwayEventArgs : IrcEventArgs { private string _Who; private string _AwayMessage; public string Who { get { return _Who; } } public string AwayMessage{ get { return _AwayMessage; } } internal AwayEventArgs(IrcMessageData data, string who, string awaymessage) : base(data) { _Who = who; _AwayMessage = awaymessage; } } /// /// /// public class NickChangeEventArgs : IrcEventArgs { private string _OldNickname; private string _NewNickname; public string OldNickname { get { return _OldNickname; } } public string NewNickname { get { return _NewNickname; } } internal NickChangeEventArgs(IrcMessageData data, string oldnick, string newnick) : base(data) { _OldNickname = oldnick; _NewNickname = newnick; } } /// /// /// public class TopicEventArgs : IrcEventArgs { private string _Channel; private string _Topic; public string Channel { get { return _Channel; } } public string Topic { get { return _Topic; } } internal TopicEventArgs(IrcMessageData data, string channel, string topic) : base(data) { _Channel = channel; _Topic = topic; } } /// /// /// public class TopicChangeEventArgs : IrcEventArgs { private string _Channel; private string _Who; private string _NewTopic; public string Channel { get { return _Channel; } } public string Who { get { return _Who; } } public string NewTopic { get { return _NewTopic; } } internal TopicChangeEventArgs(IrcMessageData data, string channel, string who, string newtopic) : base(data) { _Channel = channel; _Who = who; _NewTopic = newtopic; } } /// /// /// public class BanEventArgs : IrcEventArgs { private string _Channel; private string _Who; private string _Hostmask; public string Channel { get { return _Channel; } } public string Who { get { return _Who; } } public string Hostmask { get { return _Hostmask; } } internal BanEventArgs(IrcMessageData data, string channel, string who, string hostmask) : base(data) { _Channel = channel; _Who = who; _Hostmask = hostmask; } } /// /// /// public class UnbanEventArgs : IrcEventArgs { private string _Channel; private string _Who; private string _Hostmask; public string Channel { get { return _Channel; } } public string Who { get { return _Who; } } public string Hostmask { get { return _Hostmask; } } internal UnbanEventArgs(IrcMessageData data, string channel, string who, string hostmask) : base(data) { _Channel = channel; _Who = who; _Hostmask = hostmask; } } /// /// Event arguments for any change in channel role. /// public class ChannelRoleChangeEventArgs : IrcEventArgs { public string Channel { get; private set; } public string Who { get; private set; } public string Whom { get; private set; } internal ChannelRoleChangeEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data) { Channel = channel; Who = who; Whom = whom; } } /// /// User gained owner status (non-RFC, channel mode +q, prefix ~). /// public class OwnerEventArgs : ChannelRoleChangeEventArgs { internal OwnerEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data, channel, who, whom) { } } /// /// User lost owner status (non-RFC, channel mode -q). /// public class DeownerEventArgs : ChannelRoleChangeEventArgs { internal DeownerEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data, channel, who, whom) { } } /// /// User gained channel admin status (non-RFC, channel mode +a, prefix &). /// public class ChannelAdminEventArgs : ChannelRoleChangeEventArgs { internal ChannelAdminEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data, channel, who, whom) { } } /// /// User lost channel admin status (non-RFC, channel mode -a). /// public class DeChannelAdminEventArgs : ChannelRoleChangeEventArgs { internal DeChannelAdminEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data, channel, who, whom) { } } /// /// User gained op status (channel mode +o, prefix @). /// public class OpEventArgs : ChannelRoleChangeEventArgs { internal OpEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data, channel, who, whom) { } } /// /// User lost op status (channel mode -o). /// public class DeopEventArgs : ChannelRoleChangeEventArgs { internal DeopEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data, channel, who, whom) { } } /// /// User gained halfop status (non-RFC, channel mode +h, prefix %). /// public class HalfopEventArgs : ChannelRoleChangeEventArgs { internal HalfopEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data, channel, who, whom) { } } /// /// User lost halfop status (non-RFC, channel mode -h). /// public class DehalfopEventArgs : ChannelRoleChangeEventArgs { internal DehalfopEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data, channel, who, whom) { } } /// /// User gained voice status (channel mode +v, prefix +). /// public class VoiceEventArgs : ChannelRoleChangeEventArgs { internal VoiceEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data, channel, who, whom) { } } /// /// User lost voice status (channel mode -v). /// public class DevoiceEventArgs : ChannelRoleChangeEventArgs { internal DevoiceEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data, channel, who, whom) { } } public class BounceEventArgs : IrcEventArgs { /// /// Hostname/address of the server to which the user is being redirected. /// May be null if not successfully parsed from the message. /// public string Server { get; private set; } /// /// Port of the server to which the user is being redirected. /// May be -1 if not successfully parsed from the message. /// public int Port { get; private set; } internal BounceEventArgs(IrcMessageData data, string server, int port) : base(data) { Server = server; Port = Port; } } } smuxi-0.11/lib/SmartIrc4net/src/IrcClient/Delegates.cs0000644000175000017500000000674512253423361023367 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ namespace Meebey.SmartIrc4net { public delegate void IrcEventHandler(object sender, IrcEventArgs e); public delegate void CtcpEventHandler(object sender, CtcpEventArgs e); public delegate void ActionEventHandler(object sender, ActionEventArgs e); public delegate void ErrorEventHandler(object sender, ErrorEventArgs e); public delegate void PingEventHandler(object sender, PingEventArgs e); public delegate void KickEventHandler(object sender, KickEventArgs e); public delegate void JoinEventHandler(object sender, JoinEventArgs e); public delegate void NamesEventHandler(object sender, NamesEventArgs e); public delegate void ListEventHandler(object sender, ListEventArgs e); public delegate void PartEventHandler(object sender, PartEventArgs e); public delegate void InviteEventHandler(object sender, InviteEventArgs e); public delegate void OwnerEventHandler(object sender, OwnerEventArgs e); public delegate void DeownerEventHandler(object sender, DeownerEventArgs e); public delegate void ChannelAdminEventHandler(object sender, ChannelAdminEventArgs e); public delegate void DeChannelAdminEventHandler(object sender, DeChannelAdminEventArgs e); public delegate void OpEventHandler(object sender, OpEventArgs e); public delegate void DeopEventHandler(object sender, DeopEventArgs e); public delegate void HalfopEventHandler(object sender, HalfopEventArgs e); public delegate void DehalfopEventHandler(object sender, DehalfopEventArgs e); public delegate void VoiceEventHandler(object sender, VoiceEventArgs e); public delegate void DevoiceEventHandler(object sender, DevoiceEventArgs e); public delegate void BanEventHandler(object sender, BanEventArgs e); public delegate void UnbanEventHandler(object sender, UnbanEventArgs e); public delegate void TopicEventHandler(object sender, TopicEventArgs e); public delegate void TopicChangeEventHandler(object sender, TopicChangeEventArgs e); public delegate void NickChangeEventHandler(object sender, NickChangeEventArgs e); public delegate void QuitEventHandler(object sender, QuitEventArgs e); public delegate void AwayEventHandler(object sender, AwayEventArgs e); public delegate void WhoEventHandler(object sender, WhoEventArgs e); public delegate void MotdEventHandler(object sender, MotdEventArgs e); public delegate void PongEventHandler(object sender, PongEventArgs e); public delegate void BounceEventHandler(object sender, BounceEventArgs e); } smuxi-0.11/lib/SmartIrc4net/src/IrcClient/ChannelInfo.cs0000644000175000017500000000363611655552514023662 0ustar00meebeymeebey00000000000000/* * $Id: IrcUser.cs 198 2005-06-08 16:50:11Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smartirc/SmartIrc4net/trunk/src/IrcClient/IrcUser.cs $ * $Rev: 198 $ * $Author: meebey $ * $Date: 2005-06-08 18:50:11 +0200 (Wed, 08 Jun 2005) $ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2008 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Meebey.SmartIrc4net { public class ChannelInfo { private string f_Channel; private int f_UserCount; private string f_Topic; public string Channel { get { return f_Channel; } } public int UserCount { get { return f_UserCount; } } public string Topic { get { return f_Topic; } } internal ChannelInfo(string channel, int userCount, string topic) { f_Channel = channel; f_UserCount = userCount; f_Topic = topic; } } } smuxi-0.11/lib/SmartIrc4net/src/IrcClient/NonRfcChannelUser.cs0000644000175000017500000000340212253423361024772 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ namespace Meebey.SmartIrc4net { /// /// /// /// public class NonRfcChannelUser : ChannelUser { public bool IsOwner { get; set; } public bool IsChannelAdmin { get; set; } public bool IsHalfop { get; set; } /// /// /// /// /// internal NonRfcChannelUser(string channel, IrcUser ircuser) : base(channel, ircuser) { } #if LOG4NET ~NonRfcChannelUser() { Logger.ChannelSyncing.Debug("NonRfcChannelUser ("+Channel+":"+IrcUser.Nick+") destroyed"); } #endif } } smuxi-0.11/lib/SmartIrc4net/src/IrcClient/BanInfo.cs0000644000175000017500000000374311655552514023011 0ustar00meebeymeebey00000000000000/* * $Id: IrcUser.cs 198 2005-06-08 16:50:11Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smartirc/SmartIrc4net/trunk/src/IrcClient/IrcUser.cs $ * $Rev: 198 $ * $Author: meebey $ * $Date: 2005-06-08 18:50:11 +0200 (Wed, 08 Jun 2005) $ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2008 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Meebey.SmartIrc4net { public class BanInfo { private string f_Channel; private string f_Mask; public string Channel { get { return f_Channel; } } public string Mask { get { return f_Mask; } } private BanInfo() { } public static BanInfo Parse(IrcMessageData data) { BanInfo info = new BanInfo(); // :magnet.oftc.net 367 meebey #smuxi test!test@test meebey!~meebey@e176002059.adsl.alicedsl.de 1216309801.. info.f_Channel = data.RawMessageArray[3]; info.f_Mask= data.RawMessageArray[4]; return info; } } } smuxi-0.11/lib/SmartIrc4net/src/IrcClient/WhoInfo.cs0000644000175000017500000001504212253423361023031 0ustar00meebeymeebey00000000000000/* * $Id: IrcUser.cs 198 2005-06-08 16:50:11Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smartirc/SmartIrc4net/trunk/src/IrcClient/IrcUser.cs $ * $Rev: 198 $ * $Author: meebey $ * $Date: 2005-06-08 18:50:11 +0200 (Wed, 08 Jun 2005) $ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2008 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Meebey.SmartIrc4net { public class WhoInfo { private string f_Channel; private string f_Ident; private string f_Host; private string f_Server; private string f_Nick; private int f_HopCount; private string f_Realname; private bool f_IsAway; private bool f_IsOwner; private bool f_IsChannelAdmin; private bool f_IsOp; private bool f_IsHalfop; private bool f_IsVoice; private bool f_IsIrcOp; private bool f_IsRegistered; public string Channel { get { return f_Channel; } } public string Ident { get { return f_Ident; } } public string Host { get { return f_Host; } } public string Server { get { return f_Server; } } public string Nick { get { return f_Nick; } } public int HopCount { get { return f_HopCount; } } public string Realname { get { return f_Realname; } } public bool IsAway { get { return f_IsAway; } } public bool IsOwner { get { return f_IsOwner; } } public bool IsChannelAdmin { get { return f_IsChannelAdmin; } } public bool IsOp { get { return f_IsOp; } } public bool IsHalfop { get { return f_IsHalfop; } } public bool IsVoice { get { return f_IsVoice; } } public bool IsIrcOp { get { return f_IsIrcOp; } } public bool IsRegistered { get { return f_IsRegistered; } } private WhoInfo() { } public static WhoInfo Parse(IrcMessageData data) { WhoInfo whoInfo = new WhoInfo(); // :fu-berlin.de 352 meebey_ * ~meebey e176002059.adsl.alicedsl.de fu-berlin.de meebey_ H :0 Mirco Bauer.. whoInfo.f_Channel = data.RawMessageArray[3]; whoInfo.f_Ident = data.RawMessageArray[4]; whoInfo.f_Host = data.RawMessageArray[5]; whoInfo.f_Server = data.RawMessageArray[6]; whoInfo.f_Nick = data.RawMessageArray[7]; // HACK: realname field can be empty on bugged IRCds like InspIRCd-2.0 // :topiary.voxanon.net 352 Mirco #anonplusradio CpGc igot.avhost Voxanon CpGc H if (data.MessageArray == null || data.MessageArray.Length < 2) { whoInfo.f_Realname = String.Empty; } else { int hopcount = 0; var hopcountStr = data.MessageArray[0]; if (Int32.TryParse(hopcountStr, out hopcount)) { whoInfo.f_HopCount = hopcount; } else { #if LOG4NET Logger.MessageParser.Warn("Parse(): couldn't parse hopcount (as int): '" + hopcountStr + "'"); #endif } // skip hop count whoInfo.f_Realname = String.Join(" ", data.MessageArray, 1, data.MessageArray.Length - 1); } string usermode = data.RawMessageArray[8]; bool owner = false; bool chanadmin = false; bool op = false; bool halfop = false; bool voice = false; bool ircop = false; bool away = false; bool registered = false; int usermodelength = usermode.Length; for (int i = 0; i < usermodelength; i++) { switch (usermode[i]) { case 'H': away = false; break; case 'G': away = true; break; case '~': owner = true; break; case '&': chanadmin = true; break; case '@': op = true; break; case '%': halfop = true; break; case '+': voice = true; break; case '*': ircop = true; break; case 'r': registered = true; break; } } whoInfo.f_IsAway = away; whoInfo.f_IsOwner = owner; whoInfo.f_IsChannelAdmin = chanadmin; whoInfo.f_IsOp = op; whoInfo.f_IsHalfop = halfop; whoInfo.f_IsVoice = voice; whoInfo.f_IsIrcOp = ircop; whoInfo.f_IsRegistered = registered; return whoInfo; } } } smuxi-0.11/lib/SmartIrc4net/src/IrcClient/ServerProperties.cs0000644000175000017500000006110612253423361025005 0ustar00meebeymeebey00000000000000/* * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2013 Ondřej Hošek * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; namespace Meebey.SmartIrc4net { /// /// This class stores information about the capabilities and idiosyncrasies /// of an IRC server. /// See http://tools.ietf.org/html/draft-hardy-irc-isupport-00 for more /// information. /// public class ServerProperties { /// /// Contains the properties as returned by the server. If a property has /// been specified without a value, it is mapped to null. /// public Dictionary RawProperties { get; internal set; } /// /// Stores how the server maps between uppercase and lowercase letters. /// (raw property CASEMAPPING) /// public CaseMappingType CaseMapping { get { if (!HaveNonNullKey("CASEMAPPING")) { // default is rfc1459 return CaseMappingType.Rfc1459; } switch (RawProperties ["CASEMAPPING"]) { case "ascii": return CaseMappingType.Ascii; case "rfc1459": return CaseMappingType.Rfc1459; case "strict-rfc1459": return CaseMappingType.StrictRfc1459; default: return CaseMappingType.Unknown; } } } /// /// Stores how many channels of a given type a user can join. /// A return value of null means none were supplied or the /// value was invalid. The key is a string of channel types /// which count towards the same total; a value of -1 means /// an infinite amount. /// (raw property CHANLIMIT) /// public IDictionary ChannelJoinLimits { get { return ParseStringNumberPairs("CHANLIMIT", null, null, -1); } } /// /// Stores the channel modes which store lists. When a /// change is sent by the server, it will always contain a /// parameter; when sent by a client without a parameter, /// the server will reply with the current list. A return /// value of null means none or invalid ones were supplied. /// (raw property CHANMODES, first value) /// public string ListChannelModes { get { var splitmodes = SplitChannelModes; if (splitmodes == null) { return null; } return splitmodes [0]; } } /// /// Stores the channel modes which store a parameter. This /// parameter must be provided both when adding and when /// removing the mode. /// (raw property CHANMODES, second value) /// public string ParametricChannelModes { get { var splitmodes = SplitChannelModes; if (splitmodes == null) { return null; } return splitmodes [1]; } } /// /// Stores the channel modes which store a parameter. This /// parameter must only be provided when adding the value. /// (raw property CHANMODES, third value) /// public string SetParametricChannelModes { get { var splitmodes = SplitChannelModes; if (splitmodes == null) { return null; } return splitmodes [2]; } } /// /// Stores the channel modes which don't store a parameter. /// (raw property CHANMODES, fourth value) /// public string ParameterlessChannelModes { get { var splitmodes = SplitChannelModes; if (splitmodes == null) { return null; } return splitmodes [3]; } } /// /// Stores the maximum length of a channel name. -1 means no limit. /// (raw property CHANNELLEN) /// public int ChannelNameLength { get { // defaults as specified by RFC1459 int? len = ParseNumber("CHANNELLEN", 200, 200); return len ?? -1; } } /// /// Stores the types of channels supported by the server. /// An empty string means no channels are supported (!). /// (raw property CHANTYPES) /// public char[] ChannelTypes { get { if (!HaveNonNullKey("CHANTYPES")) { // sane default return "#&".ToCharArray(); } return RawProperties ["CHANTYPES"].ToCharArray(); } } /// /// Stores whether the server supports the CNOTICE command, /// which allows users with a specific channel privilege to /// send a notice to another participant in that channel /// without some of the restrictions that the sever may have /// placed on NOTICE. /// (raw property CNOTICE) /// public bool SupportsChannelParticipantNotices { get { return RawProperties.ContainsKey("CNOTICE"); } } /// /// Stores whether the server supports the CPRIVMSG command, /// which allows users with a specific channel privilege to /// send a message to another participant in that channel /// without some of the restrictions that the sever may have /// placed on PRIVMSG. /// (raw property CPRIVMSG) /// public bool SupportsChannelParticipantPrivMsgs { get { return RawProperties.ContainsKey("CPRIVMSG"); } } /// /// Stores available extensions to the LIST command. /// (raw property ELIST) /// public ListExtensions ListExtensions { get { if (!HaveNonNullKey("ELIST")) { return ListExtensions.None; } var eliststr = RawProperties ["ELIST"]; var exts = ListExtensions.None; foreach (char e in eliststr.ToUpperInvariant()) { switch (e) { case 'C': exts |= ListExtensions.CreationTime; break; case 'M': exts |= ListExtensions.ContainsParticipantWithMask; break; case 'N': exts |= ListExtensions.DoesNotContainParticipantWithMask; break; case 'T': exts |= ListExtensions.TopicAge; break; case 'U': exts |= ListExtensions.ParticipantCount; break; } } return exts; } } /// /// Returns what channel mode character is used by the /// server to signify ban exceptions. null means the server /// does not support ban exceptions. /// (raw property EXCEPTS) /// public char? BanExceptionCharacter { get { if (!RawProperties.ContainsKey("EXCEPTS")) { return null; } var exstr = RawProperties ["EXCEPTS"]; if (exstr == null) { // default: +e return 'e'; } else if (exstr.Length != 1) { // invalid; assume lack of support return null; } return exstr [0]; } } /// /// Returns what channel mode character is used by the /// server to signify invite exceptions. null means the server /// does not support ban exceptions. /// (raw property INVEX) /// public char? InviteExceptionCharacter { get { if (!RawProperties.ContainsKey("INVEX")) { return null; } var exstr = RawProperties ["INVEX"]; if (exstr == null) { // default: +I return 'I'; } else if (exstr.Length != 1) { // invalid; assume lack of support return null; } return exstr [0]; } } /// /// Returns how long a kick message supplied by the client /// may be. /// (raw property KICKLEN) /// public int? KickMessageLength { get { return ParseNumber("KICKLEN", null, null); } } /// /// Stores how many list channel modes (see ListChannelModes) /// of a given type a user can set on a channel. (Note that /// the server may always return more.) A return value of null /// means none were supplied or the value was invalid. The key /// is a string of list mode characters which count towards the /// same total; a value of -1 means an infinite amount. /// (raw property MAXLIST) /// public IDictionary ListModeLimits { get { return ParseStringNumberPairs("MAXLIST", null, null, -1); } } /// /// Stores how many non-parameterless (list, parametric or /// set-parametric) modes can be set using a single MODE call. /// A return value of null means an invalid value has been /// supplied; a return value of -1 means a theoretically /// unlimited number of simultaneous mode sets. /// (raw property MODES) /// public int? MaxParametricModeSets { get { // 3 if not set, infinity if value-less return ParseNumber("MODES", 3, -1); } } /// /// Stores the display name of the network the IRC /// server is participating in. A return value of null /// means the server is not participating in an IRC network. /// (raw property NETWORK) /// public string NetworkName { get { if (!HaveNonNullKey("NETWORK")) { return null; } return RawProperties ["NETWORK"]; } } /// /// Stores the maximum length of the nickname the client /// may set. (This has no bearing on the nicknames of /// other clients.) A return value of null means no or an /// invalid value was specified. /// (raw property NICKLEN) /// public int? MaxNicknameLength { get { // RFC1459 default if unset return ParseNumber("NICKLEN", 9, null); } } /// /// Stores the channel privilege modes (e.g. o for op, v for /// voice) and their corresponding prefixes (e.g. @, +), /// ordered from most to least powerful. A return value of /// null means no or an invalid value was specified. /// (raw property PREFIX) /// public IList> ChannelPrivilegeModesPrefixes { get { var modesList = new List>(); if (!RawProperties.ContainsKey("PREFIX")) { // assume voice and ops modesList.Add(new KeyValuePair('o', '@')); modesList.Add(new KeyValuePair('v', '+')); return modesList; } var prefixstr = RawProperties ["PREFIX"]; if (prefixstr == null) { // supports no modes (!) return modesList; } // format: (modes)prefixes if (prefixstr [0] != '(') { return null; } var modesPrefixes = prefixstr.Substring(1).Split(')'); if (modesPrefixes.Length != 2) { // assuming the pathological case of a ')' mode // character is impossible, this is invalid return null; } var modes = modesPrefixes[0]; var prefixes = modesPrefixes[1]; if (modes.Length != prefixes.Length) { return null; } for (int i = 0; i < modes.Length; ++i) { modesList.Add(new KeyValuePair(modes [i], prefixes [i])); } return modesList; } } /// /// Stores whether using the LIST command is safe, i.e. whether /// the user won't be disconnected because of the large amount /// of traffic generated by LIST. /// (raw property SAFELIST) /// public bool ListIsSafe { get { return RawProperties.ContainsKey("SAFELIST"); } } /// /// Stores the maximum number of entries on a user's silence /// list. A value of 0 means silence lists are not supported /// on this server. /// (raw property SILENCE) /// public int MaxSilenceListEntries { get { // SILENCE requires a value, but assume 0 if unspecified return ParseNumber("SILENCE", 0, 0) ?? 0; } } /// /// If this property is not set to an empty string, users may /// send NOTICEs to channel participants of a given status; /// e.g. NOTICE @#help :I found a bug. would send the /// message to the operators of #help. The property stores the /// modes that may be the recipients of such messages, e.g. /// "~&@" for "owners, admins and operators only". /// (raw property STATUSMSG) /// public string StatusNoticeParticipants { get { if (!HaveNonNullKey("STATUSMSG")) { // STATUSMSG requires a value, but assume none // if unspecified return ""; } return RawProperties ["STATUSMSG"]; } } /// /// Maps the commands which support multiple targets to the /// maximum number of targets each of them supports. A return /// value of null means the server specified an invalid value. /// An entry value of -1 means infinity. /// (raw property TARGMAX) /// public IDictionary MaxCommandTargets { get { var emptydict = new Dictionary(); return ParseStringNumberPairs("TARGMAX", emptydict, null, -1); } } /// /// Stores the maximum topic length that the client may set /// on a channel on the server. A length of -1 means an /// infinite length. /// (raw property TOPICLEN) /// public int MaxTopicLength { get { // SILENCE requires a value, but assume infinity // if unspecified or invalid return ParseNumber("TOPICLEN", -1, -1) ?? -1; } } /// /// Stores the maximum number of entries on a user's watch /// list. A value of 0 means watch lists are not supported /// on this server. /// (raw property WATCH) /// public int MaxWatchListEntries { get { // SILENCE requires a value, but assume 0 if unspecified return ParseNumber("WATCH", 0, 0) ?? 0; } } /// /// Constructs an empty server properties object. /// internal ServerProperties() { RawProperties = new Dictionary(); } /// /// Returns whether the property dictionary contains the given key and /// it is not null. /// /// The key to check. /// Whether the given key maps to a non-null value in the /// dictionary. bool HaveNonNullKey(string key) { if (!RawProperties.ContainsKey(key)) { return false; } return RawProperties [key] != null; } /// /// Returns a dictionary from parsing a value in the format /// string:number[,string:number,...]. If the value is unset (i.e. not /// contained in the dictionary), returns unsetDefault. If the value is /// empty (i.e. maps to null), returns emptyDefault. /// defaultValue is used if no number is specified after a colon; if /// defaultValue is null, this method returns null. /// IDictionary ParseStringNumberPairs(string key, IDictionary unsetDefault, IDictionary emptyDefault, int? defaultValue) { if (!RawProperties.ContainsKey(key)) { return unsetDefault; } var valstr = RawProperties [key]; if (valstr == null) { return emptyDefault; } var valmap = new Dictionary(); // comma splits the specs foreach (string limit in valstr.Split(',')) { // colon splits keys and value var split = limit.Split(':'); if (split.Length != 2) { // invalid spec; don't trust the whole thing return null; } var chantypes = split [0]; var valuestr = split [1]; int value; if (valuestr == string.Empty) { if (defaultValue.HasValue) { value = defaultValue.Value; } return null; } else if (!int.TryParse(valuestr, out value)) { // invalid integer; don't trust the whole thing return null; } valmap [chantypes] = value; } return valmap; } /// /// Returns a numeric value. If the value is unset (i.e. not contained /// in the dictionary), returns unsetDefault. If the value is empty /// (i.e. maps to null), returns emptyDefault. On parse failure, returns /// null. Otherwise, returns the parsed value. /// int? ParseNumber(string key, int? unsetDefault, int? emptyDefault) { if (!RawProperties.ContainsKey(key)) { return unsetDefault; } var numstr = RawProperties [key]; if (numstr == null) { return emptyDefault; } int num; if (!int.TryParse(numstr, out num)) { return null; } return num; } /// /// Returns the array value of the CHANMODES property, or null if /// it was invalid. /// string[] SplitChannelModes { get { if (!HaveNonNullKey("CHANMODES")) { return null; } var splits = RawProperties ["CHANMODES"].Split(','); if (splits.Length != 4) { return null; } return splits; } } } /// /// Represents how lowercase and uppercase are mapped by the server. This /// information is mostly supplied in the CASEMAPPING server property. /// public enum CaseMappingType { /// /// The server provided no or an unknown value. /// Unknown, /// /// The ASCII characters 0x61 to 0x7a (a to z) are defined /// as the lowercase variants of 0x41 to 0x5a (A to Z). /// The server provided the string ascii. /// Ascii, /// /// The ASCII characters 0x61 to 0x7e (a to ~) are defined /// as the lowercase variants of 0x41 to 0x5e (A to ^). /// The server provided the string rfc1459. /// Rfc1459, /// /// The ASCII characters 0x61 to 0x7d (a to }) are defined /// as the lowercase variants of 0x41 to 0x5d (A to ]). /// The server provided the string strict-rfc1459. /// StrictRfc1459, } /// /// Represents additional functionality available in the LIST command. /// [Flags] public enum ListExtensions { /// /// No additional functionality is supported by LIST. /// None = 0, /// /// Channel lists may be requested by creation time, using the syntax /// C>time to search for channels created after the given time /// and C<time to search for channels created before the given /// time. /// (letter: C) /// CreationTime = (1 << 0), /// /// Channel lists may be requested by a mask, matching channels in which /// a user matching the given mask is participating. /// (letter: M) /// ContainsParticipantWithMask = (1 << 1), /// /// Channel lists may be requested by a mask, matching channels in which /// a user matching the given mask is not participating. /// (letter: N) /// DoesNotContainParticipantWithMask = (1 << 2), /// /// Channel lists may be requested by topic age, using the syntax /// T>time to search for channels with topics last changed after /// the given time and T<time to search for channels with topics /// last changed before the given time. /// (letter: T) /// TopicAge = (1 << 3), /// /// Channel lists may be requested by number of participants, using the /// syntax U>count to search for channels with more than the given /// number of participants and C<time to search for channels with /// fewer than the given number of participants. /// (letter: U) /// ParticipantCount = (1 << 4) } } smuxi-0.11/lib/SmartIrc4net/src/IrcClient/Channel.cs0000644000175000017500000001502112253423361023025 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; namespace Meebey.SmartIrc4net { /// /// /// /// public class Channel { private string _Name; private string _Key = String.Empty; private Hashtable _Users = Hashtable.Synchronized(new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer())); private Hashtable _Ops = Hashtable.Synchronized(new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer())); private Hashtable _Voices = Hashtable.Synchronized(new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer())); private StringCollection _Bans = new StringCollection(); private List _BanExcepts = new List(); private List _InviteExcepts = new List(); private string _Topic = String.Empty; private int _UserLimit; private string _Mode = String.Empty; private DateTime _ActiveSyncStart; private DateTime _ActiveSyncStop; private TimeSpan _ActiveSyncTime; private bool _IsSycned; /// /// /// /// internal Channel(string name) { _Name = name; _ActiveSyncStart = DateTime.Now; } #if LOG4NET ~Channel() { Logger.ChannelSyncing.Debug("Channel ("+Name+") destroyed"); } #endif /// /// /// /// public string Name { get { return _Name; } } /// /// /// /// public string Key { get { return _Key; } set { _Key = value; } } /// /// /// /// public Hashtable Users { get { return (Hashtable)_Users.Clone(); } } /// /// /// /// internal Hashtable UnsafeUsers { get { return _Users; } } /// /// /// /// public Hashtable Ops { get { return (Hashtable)_Ops.Clone(); } } /// /// /// /// internal Hashtable UnsafeOps { get { return _Ops; } } /// /// /// /// public Hashtable Voices { get { return (Hashtable)_Voices.Clone(); } } /// /// /// /// internal Hashtable UnsafeVoices { get { return _Voices; } } /// /// /// /// public StringCollection Bans { get { return _Bans; } } public List BanExceptions { get { return _BanExcepts; } } public List InviteExceptions { get { return _InviteExcepts; } } /// /// /// /// public string Topic { get { return _Topic; } set { _Topic = value; } } /// /// /// /// public int UserLimit { get { return _UserLimit; } set { _UserLimit = value; } } /// /// /// /// public string Mode { get { return _Mode; } set { _Mode = value; } } /// /// /// /// public DateTime ActiveSyncStart { get { return _ActiveSyncStart; } } /// /// /// /// public DateTime ActiveSyncStop { get { return _ActiveSyncStop; } set { _ActiveSyncStop = value; _ActiveSyncTime = _ActiveSyncStop.Subtract(_ActiveSyncStart); } } /// /// /// /// public TimeSpan ActiveSyncTime { get { return _ActiveSyncTime; } } public bool IsSycned { get { return _IsSycned; } set { _IsSycned = value; } } } } smuxi-0.11/lib/SmartIrc4net/src/IrcClient/IrcUser.cs0000644000175000017500000001456211655552514023052 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Collections.Specialized; namespace Meebey.SmartIrc4net { /// /// This class manages the user information. /// /// /// only used with channel sync /// /// IrcClient.ActiveChannelSyncing /// /// /// public class IrcUser { private IrcClient _IrcClient; private string _Nick = null; private string _Ident = null; private string _Host = null; private string _Realname = null; private bool _IsIrcOp = false; private bool _IsRegistered = false; private bool _IsAway = false; private string _Server = null; private int _HopCount = -1; internal IrcUser(string nickname, IrcClient ircclient) { _IrcClient = ircclient; _Nick = nickname; } #if LOG4NET ~IrcUser() { Logger.ChannelSyncing.Debug("IrcUser ("+Nick+") destroyed"); } #endif /// /// Gets or sets the nickname of the user. /// /// /// Do _not_ set this value, it will break channel sync! /// public string Nick { get { return _Nick; } set { _Nick = value; } } /// /// Gets or sets the identity (username) of the user which is used by some IRC networks for authentication. /// /// /// Do _not_ set this value, it will break channel sync! /// public string Ident { get { return _Ident; } set { _Ident = value; } } /// /// Gets or sets the hostname of the user. /// /// /// Do _not_ set this value, it will break channel sync! /// public string Host { get { return _Host; } set { _Host = value; } } /// /// Gets or sets the supposed real name of the user. /// /// /// Do _not_ set this value, it will break channel sync! /// public string Realname { get { return _Realname; } set { _Realname = value; } } /// /// Gets or sets the server operator status of the user /// /// /// Do _not_ set this value, it will break channel sync! /// public bool IsIrcOp { get { return _IsIrcOp; } set { _IsIrcOp = value; } } /// /// Gets or sets the registered status of the user /// public bool IsRegistered { get { return _IsRegistered; } internal set { _IsRegistered = value; } } /// /// Gets or sets away status of the user /// /// /// Do _not_ set this value, it will break channel sync! /// public bool IsAway { get { return _IsAway; } set { _IsAway = value; } } /// /// Gets or sets the server the user is connected to /// /// /// Do _not_ set this value, it will break channel sync! /// public string Server { get { return _Server; } set { _Server = value; } } /// /// Gets or sets the count of hops between you and the user's server /// /// /// Do _not_ set this value, it will break channel sync! /// public int HopCount { get { return _HopCount; } set { _HopCount = value; } } /// /// Gets the list of channels the user has joined /// public string[] JoinedChannels { get { Channel channel; string[] result; string[] channels = _IrcClient.GetChannels(); StringCollection joinedchannels = new StringCollection(); foreach (string channelname in channels) { channel = _IrcClient.GetChannel(channelname); if (channel.UnsafeUsers.ContainsKey(_Nick)) { joinedchannels.Add(channelname); } } result = new string[joinedchannels.Count]; joinedchannels.CopyTo(result, 0); return result; //return joinedchannels; } } } } smuxi-0.11/lib/SmartIrc4net/src/IrcClient/ChannelUser.cs0000644000175000017500000001165111655552514023701 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ namespace Meebey.SmartIrc4net { /// /// This class manages the information of a user within a channel. /// /// /// only used with channel sync /// /// public class ChannelUser { private string _Channel; private IrcUser _IrcUser; private bool _IsOp; private bool _IsVoice; /// /// /// /// /// internal ChannelUser(string channel, IrcUser ircuser) { _Channel = channel; _IrcUser = ircuser; } #if LOG4NET ~ChannelUser() { Logger.ChannelSyncing.Debug("ChannelUser ("+Channel+":"+IrcUser.Nick+") destroyed"); } #endif /// /// Gets the channel name /// public string Channel { get { return _Channel; } } /// /// Gets the server operator status of the user /// public bool IsIrcOp { get { return _IrcUser.IsIrcOp; } } /// /// Gets or sets the op flag of the user (+o) /// /// /// only used with channel sync /// public bool IsOp { get { return _IsOp; } set { _IsOp = value; } } /// /// Gets or sets the voice flag of the user (+v) /// /// /// only used with channel sync /// public bool IsVoice { get { return _IsVoice; } set { _IsVoice = value; } } /// /// Gets the away status of the user /// public bool IsAway { get { return _IrcUser.IsAway; } } /// /// Gets the underlaying IrcUser object /// public IrcUser IrcUser { get { return _IrcUser; } } /// /// Gets the nickname of the user /// public string Nick { get { return _IrcUser.Nick; } } /// /// Gets the identity (username) of the user, which is used by some IRC networks for authentication. /// public string Ident { get { return _IrcUser.Ident; } } /// /// Gets the hostname of the user, /// public string Host { get { return _IrcUser.Host; } } /// /// Gets the supposed real name of the user. /// public string Realname { get { return _IrcUser.Realname; } } /// /// Gets the server the user is connected to. /// /// public string Server { get { return _IrcUser.Server; } } /// /// Gets or sets the count of hops between you and the user's server /// public int HopCount { get { return _IrcUser.HopCount; } } /// /// Gets the list of channels the user has joined /// public string[] JoinedChannels { get { return _IrcUser.JoinedChannels; } } } } smuxi-0.11/lib/SmartIrc4net/src/IrcFeatures/0000755000175000017500000000000011655552514021477 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SmartIrc4net/src/IrcFeatures/DccSend.cs0000644000175000017500000002655311655552514023344 0ustar00meebeymeebey00000000000000/* * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2008-2009 Thomas Bruderer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Net; using System.Threading; using System.Net.Sockets; namespace Meebey.SmartIrc4net { /// /// Dcc Send Connection, Filetransfer /// public class DccSend : DccConnection { #region Private Variables private Stream _File; private long _Filesize; private string _Filename; private bool _DirectionUp; private long _SentBytes; private DccSpeed _Speed; private byte[] _Buffer = new byte[8192]; #endregion #region Public Properties public long SentBytes { get { return _SentBytes; } } #endregion internal DccSend(IrcFeatures irc, string user, IPAddress externalIpAdress, Stream file, string filename, long filesize, DccSpeed speed, bool passive, Priority priority) : base() { this.Irc = irc; _DirectionUp = true; _File = file; _Filesize = filesize; _Filename = filename; _Speed = speed; User = user; if(passive) { irc.SendMessage(SendType.CtcpRequest, user, "DCC SEND \"" + filename + "\" " + HostToDccInt(externalIpAdress).ToString() + " 0 " + filesize + " " + session, priority); } else { DccServer = new TcpListener(new IPEndPoint(IPAddress.Any, 0)); DccServer.Start(); LocalEndPoint = (IPEndPoint)DccServer.LocalEndpoint; irc.SendMessage(SendType.CtcpRequest, user, "DCC SEND \"" + filename + "\" " + HostToDccInt(externalIpAdress).ToString() + " " + LocalEndPoint.Port + " " + filesize, priority); } } internal DccSend(IrcFeatures irc, IPAddress externalIpAdress, CtcpEventArgs e) : base() { /* Remote Request */ this.Irc = irc; _DirectionUp = false; User = e.Data.Nick; if (e.Data.MessageArray.Length > 4) { long ip, filesize = 0; int port = 0; bool okIP = long.TryParse(e.Data.MessageArray[3], out ip); bool okPo = int.TryParse(e.Data.MessageArray[4], out port); // port 0 = passive if (e.Data.MessageArray.Length > 5) { bool okFs = long.TryParse(FilterMarker(e.Data.MessageArray[5]), out filesize); _Filesize = filesize; _Filename = e.Data.MessageArray[2].Trim(new char[] {'\"'}); } if (okIP && okPo) { RemoteEndPoint = new IPEndPoint(IPAddress.Parse(DccIntToHost(ip)), port); DccSendRequestEvent(new DccSendRequestEventArgs(this, e.Data.MessageArray[2], filesize)); return; } else { irc.SendMessage(SendType.CtcpReply, e.Data.Nick, "ERRMSG DCC Send Parameter Error"); } } else { irc.SendMessage(SendType.CtcpReply, e.Data.Nick, "ERRMSG DCC Send not enough parameters"); } } internal override void InitWork(Object stateInfo) { if (!Valid) return; if (DccServer != null) { Connection = DccServer.AcceptTcpClient(); RemoteEndPoint = (IPEndPoint)Connection.Client.RemoteEndPoint; DccServer.Stop(); isConnected = true; } else { while(!isConnected) { Thread.Sleep(500); // We wait till Request is Accepted (or jump out when rejected) if (reject) return; } } DccSendStartEvent(new DccEventArgs(this)); int bytes; if(_DirectionUp) { do{ while (Connection.Available > 0) { switch(_Speed) { case DccSpeed.Rfc: Connection.GetStream().Read(_Buffer, 0, _Buffer.Length); // TODO: only send x not ACKed Bytes ahead / (nobody wants this anyway) break; case DccSpeed.RfcSendAhead: Connection.GetStream().Read(_Buffer, 0, _Buffer.Length); break; case DccSpeed.Turbo: // Available > 0 should not happen break; } } bytes = _File.Read(_Buffer, 0, _Buffer.Length); try { Connection.GetStream().Write(_Buffer, 0, (int)bytes); } catch (IOException) { bytes = 0; // Connection Lost } _SentBytes += bytes; if (bytes > 0) { DccSendSentBlockEvent(new DccSendEventArgs(this, _Buffer, bytes)); Console.Write("."); } } while(bytes > 0); } else { while((bytes = Connection.GetStream().Read(_Buffer,0,_Buffer.Length))>0) { _File.Write(_Buffer, 0, bytes); _SentBytes += bytes; if (_Speed != DccSpeed.Turbo) Connection.GetStream().Write(getAck(_SentBytes),0,4); DccSendReceiveBlockEvent(new DccSendEventArgs(this, _Buffer, bytes)); } } isValid = false; isConnected = false; Console.WriteLine("--> Filetrangsfer Endet / Bytes sent: " + _SentBytes + " of " + _Filesize); DccSendStopEvent(new DccEventArgs(this)); } #region Public Methods for the DCC Send Object /// /// With this methode you can accept a DCC SEND Request you got from another User /// /// Any Stream you want use as a file, if you use offset it should be Seekable /// Offset to start a Resume Request for the rest of a file /// public bool AcceptRequest(Stream file, long offset) { if (isConnected) return false; try { if (file!=null) _File = file; if(RemoteEndPoint.Port==0) { DccServer = new TcpListener(new IPEndPoint(IPAddress.Any, 0)); DccServer.Start(); LocalEndPoint = (IPEndPoint)DccServer.LocalEndpoint; Irc.SendMessage(SendType.CtcpRequest, User, "DCC SEND \"" + _Filename + "\" " + HostToDccInt(ExternalIPAdress).ToString() + " " + LocalEndPoint.Port + " " + _Filesize); } else { if(offset==0) { Connection = new TcpClient(); Connection.Connect(RemoteEndPoint); isConnected = true; } else { if(_File.CanSeek) { _File.Seek(offset, SeekOrigin.Begin); _SentBytes = offset; Irc.SendMessage(SendType.CtcpRequest, User, "DCC RESUME \"" + _Filename + "\" " + RemoteEndPoint.Port + " " + offset); } else { /* Resume of a file which is not seekable : I dont care, its your filestream! */ _SentBytes = offset; Irc.SendMessage(SendType.CtcpRequest, User, "DCC RESUME \"" + _Filename + "\" " + RemoteEndPoint.Port + " " + offset); } } } return true; } catch(Exception) { isValid = false; isConnected = false; return false; } } #endregion #region Handler for Passive / Resume DCC internal bool TryResume(CtcpEventArgs e) { if (User == e.Data.Nick) { if ((e.Data.MessageArray.Length > 4) && (_Filename == e.Data.MessageArray[2].Trim(new char[] {'\"'}))) { long offset = 0; long.TryParse(FilterMarker(e.Data.MessageArray[4]), out offset); if (_File.CanSeek) { if (e.Data.MessageArray.Length > 5) { Irc.SendMessage(SendType.CtcpRequest, e.Data.Nick, "DCC ACCEPT " + e.Data.MessageArray[2] + " " + e.Data.MessageArray[3] + " " + e.Data.MessageArray[4] + " " + FilterMarker(e.Data.MessageArray[5])); } else { Irc.SendMessage(SendType.CtcpRequest, e.Data.Nick, "DCC ACCEPT " + e.Data.MessageArray[2] + " " + e.Data.MessageArray[3] + " " + FilterMarker(e.Data.MessageArray[4])); } _File.Seek(offset, SeekOrigin.Begin); _SentBytes = offset; return true; } else { Irc.SendMessage(SendType.CtcpRequest, e.Data.Nick, "ERRMSG DCC File not seekable"); } } } return false; } internal bool TryAccept(CtcpEventArgs e) { if (User == e.Data.Nick) { if ((e.Data.MessageArray.Length > 4) && (_Filename == e.Data.MessageArray[2].Trim(new char[] {'\"'}))) { return this.AcceptRequest(null, 0); } } return false; } internal bool SetRemote(CtcpEventArgs e) { long ip; int port = 0; bool okIP = long.TryParse(e.Data.MessageArray[3], out ip); bool okPo = int.TryParse(e.Data.MessageArray[4], out port); // port 0 = passive if (okIP && okPo) { RemoteEndPoint = new IPEndPoint(IPAddress.Parse(DccIntToHost(ip)), port); return true; } return false; } #endregion } } smuxi-0.11/lib/SmartIrc4net/src/IrcFeatures/DccConnection.cs0000644000175000017500000001771711655552514024554 0ustar00meebeymeebey00000000000000/* * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2008-2009 Thomas Bruderer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Net; using System.Threading; using System.Net.Sockets; namespace Meebey.SmartIrc4net { /// /// Baseclass for all DccConnections /// public class DccConnection { #region Private Variables protected IrcFeatures Irc; protected TcpListener DccServer; protected TcpClient Connection; protected IPEndPoint LocalEndPoint; protected IPEndPoint RemoteEndPoint; protected IPAddress ExternalIPAdress; protected DateTime Timeout; protected string User; protected bool isConnected = false; protected bool isValid = true; protected bool reject = false; protected long session; private class Session { private static long next; internal static long Next { get { return ++next; } } } #endregion #region Public Fields /// /// Returns false when the Connections is not Valid (before or after Connection) /// public bool Connected{ get { return isConnected; } } /// /// Returns false when the Connections is not Valid anymore (only at the end) /// public bool Valid{ get { return isValid && (isConnected || (DateTime.Now < Timeout)); } } /// /// Returns the Nick of the User we have a DCC with /// public string Nick { get { return User; } } #endregion #region Public DCC Events public event DccConnectionHandler OnDccChatRequestEvent; protected virtual void DccChatRequestEvent(DccEventArgs e) { if (OnDccChatRequestEvent!=null) {OnDccChatRequestEvent(this, e); } Irc.DccChatRequestEvent(e); } public event DccSendRequestHandler OnDccSendRequestEvent; protected virtual void DccSendRequestEvent(DccSendRequestEventArgs e) { if (OnDccSendRequestEvent!=null) {OnDccSendRequestEvent(this, e); } Irc.DccSendRequestEvent(e); } public event DccConnectionHandler OnDccChatStartEvent; protected virtual void DccChatStartEvent(DccEventArgs e) { if (OnDccChatStartEvent!=null) {OnDccChatStartEvent(this, e); } Irc.DccChatStartEvent(e); } public event DccConnectionHandler OnDccSendStartEvent; protected virtual void DccSendStartEvent(DccEventArgs e) { if (OnDccSendStartEvent!=null) {OnDccSendStartEvent(this, e); } Irc.DccSendStartEvent(e); } public event DccChatLineHandler OnDccChatReceiveLineEvent; protected virtual void DccChatReceiveLineEvent(DccChatEventArgs e) { if (OnDccChatReceiveLineEvent!=null) {OnDccChatReceiveLineEvent(this, e); } Irc.DccChatReceiveLineEvent(e); } public event DccSendPacketHandler OnDccSendReceiveBlockEvent; protected virtual void DccSendReceiveBlockEvent(DccSendEventArgs e) { if (OnDccSendReceiveBlockEvent!=null) {OnDccSendReceiveBlockEvent(this, e); } Irc.DccSendReceiveBlockEvent(e); } public event DccChatLineHandler OnDccChatSentLineEvent; protected virtual void DccChatSentLineEvent(DccChatEventArgs e) { if (OnDccChatSentLineEvent!=null) {OnDccChatSentLineEvent(this, e); } Irc.DccChatSentLineEvent(e); } public event DccSendPacketHandler OnDccSendSentBlockEvent; protected virtual void DccSendSentBlockEvent(DccSendEventArgs e) { if (OnDccSendSentBlockEvent!=null) {OnDccSendSentBlockEvent(this, e); } Irc.DccSendSentBlockEvent(e); } public event DccConnectionHandler OnDccChatStopEvent; protected virtual void DccChatStopEvent(DccEventArgs e) { if (OnDccChatStopEvent!=null) {OnDccChatStopEvent(this, e); } Irc.DccChatStopEvent(e); } public event DccConnectionHandler OnDccSendStopEvent; protected virtual void DccSendStopEvent(DccEventArgs e) { if (OnDccSendStopEvent!=null) {OnDccSendStopEvent(this, e); } Irc.DccSendStopEvent(e); } #endregion internal DccConnection() { //Each DccConnection gets a Unique Identifier (just used internally until we have a TcpClient connected) session = Session.Next; // If a Connection is not established within 120 Seconds we invalidate the DccConnection (see property Valid) Timeout = DateTime.Now.AddSeconds(120); } internal virtual void InitWork(Object stateInfo) { throw new NotSupportedException(); } internal bool isSession(long session) { return (session == this.session); } #region Public Methods public void RejectRequest() { Irc.SendMessage(SendType.CtcpReply, User, "ERRMSG DCC Rejected"); reject = true; isValid = false; } public void Disconnect() { isConnected = false; isValid = false; } public override string ToString() { return "DCC Session " + session + " of " + this.GetType().ToString() + " is " + ((isConnected)?"connected to "+RemoteEndPoint.Address.ToString():"not connected") + "[" + this.User + "]"; } #endregion #region protected Helper Functions protected long HostToDccInt(IPAddress ip) { long temp = (ip.Address & 0xff) << 24; temp |= (ip.Address & 0xff00) << 8; temp |= (ip.Address >> 8) & 0xff00; temp |= (ip.Address >> 24) & 0xff; return temp; } protected string DccIntToHost(long ip) { IPEndPoint ep = new IPEndPoint(ip, 80); char[] sep = { '.' }; string[] ipparts = ep.Address.ToString().Split(sep); return ipparts[3] + "." + ipparts[2] + "." + ipparts[1] + "." + ipparts[0]; } protected byte[] getAck(long SentBytes) { byte[] acks = new byte[4]; acks[0] = (byte)((SentBytes >>24 ) % 256); acks[1] = (byte)((SentBytes >>16 ) % 256); acks[2] = (byte)((SentBytes >>8 ) % 256); acks[3] = (byte)((SentBytes ) % 256); return acks; } protected string FilterMarker(string msg) { string result = ""; foreach(char c in msg) { if (c!=IrcConstants.CtcpChar) result += c; } return result; } #endregion } } smuxi-0.11/lib/SmartIrc4net/src/IrcFeatures/EventArgs.cs0000644000175000017500000000724211655552514023731 0ustar00meebeymeebey00000000000000/* * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2008-2009 Thomas Bruderer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; namespace Meebey.SmartIrc4net { /// /// Base DCC Event Arguments /// public class DccEventArgs : EventArgs { private DccConnection _dcc; public DccConnection dcc { get { return _dcc; } } /// /// /// /// /// If there are multiple streams on a DCC (a channel DCC) this identifies the stream internal DccEventArgs(DccConnection dcc) { this._dcc = dcc; } } /// /// Dcc Event Args Involving Lines of Text /// public class DccChatEventArgs : DccEventArgs { private string _Message; public string Message { get { return _Message; } } private string[] _MessageArray; public string[] MessageArray { get { return _MessageArray; } } internal DccChatEventArgs(DccConnection dcc, string messageLine) : base(dcc) { char[] whiteSpace = {' '}; this._Message = messageLine; this._MessageArray = messageLine.Split(new char[] {' '}); } } /// /// Dcc Event Args involving Packets of Bytes /// public class DccSendEventArgs : DccEventArgs { private byte[] _Package; public byte[] Package { get { return _Package; } } private int _PackageSize; public int PackageSize { get { return _PackageSize; } } internal DccSendEventArgs(DccConnection dcc, byte[] package, int packageSize) : base(dcc) { this._Package = package; this._PackageSize = packageSize; } } /// /// Special DCC Event Arg for Receiving File Requests /// public class DccSendRequestEventArgs : DccEventArgs { private string _Filename; public string Filename { get { return _Filename; } } private long _Filesize; public long Filesize { get { return _Filesize; } } internal DccSendRequestEventArgs(DccConnection dcc, string filename, long filesize) : base(dcc) { this._Filename = filename; this._Filesize = filesize; } } } smuxi-0.11/lib/SmartIrc4net/src/IrcFeatures/IrcConstants.cs0000644000175000017500000000456011655552514024445 0ustar00meebeymeebey00000000000000/* * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2008-2009 Thomas Bruderer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Meebey.SmartIrc4net { /// /// Special IRC Charakters /// public class IrcConstants { public const char CtcpChar = '\x1'; public const char IrcBold = '\x2'; public const char IrcColor = '\x3'; public const char IrcReverse = '\x16'; public const char IrcNormal = '\xf'; public const char IrcUnderline = '\x1f'; public const char CtcpQuoteChar = '\x20'; } public enum DccSpeed { /// /// slow, ack every packet /// Rfc, /// /// hack, ignore acks, just send at max speed /// RfcSendAhead, /// /// fast, Turbo extension, no acks (Virc) /// Turbo } /// /// Mirc Compatible Colors /// public enum IrcColors { White = 0, Black = 1, Blue = 2, Green = 3, LightRed = 4, Brown = 5, Purple = 6, Orange = 7, Yellow = 8, LightGreen = 9, Cyan = 10, LightCyan = 11, LightBlue = 12, Pink = 13, Grey = 14, LightGrey = 15, Transparent = 99 } } smuxi-0.11/lib/SmartIrc4net/src/IrcFeatures/Delegates.cs0000644000175000017500000000362411655552514023730 0ustar00meebeymeebey00000000000000/* * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2008-2009 Thomas Bruderer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ namespace Meebey.SmartIrc4net { /// /// Delegates to handle individual ctcp commands /// public delegate void CtcpDelegate(CtcpEventArgs eventArgs); /// /// Delegate for the Standard DCC EVent /// public delegate void DccConnectionHandler(object sender, DccEventArgs e); /// /// Delegate for DCC Events involving Sending or Receiving Lines of Text /// public delegate void DccChatLineHandler(object sender, DccChatEventArgs e); /// /// Delegate for DCC EVents involving Sending or Receiving Packets of Binary Data /// public delegate void DccSendPacketHandler(object sender, DccSendEventArgs e); /// /// Special Delegate for Incoming Requests to Receive a File /// public delegate void DccSendRequestHandler(object sender, DccSendRequestEventArgs e); } smuxi-0.11/lib/SmartIrc4net/src/IrcFeatures/DccChat.cs0000644000175000017500000001654311655552514023330 0ustar00meebeymeebey00000000000000/* * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2008-2009 Thomas Bruderer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Net; using System.Threading; using System.Net.Sockets; namespace Meebey.SmartIrc4net { /// /// Dcc Chat Connection, Line Based Text /// public class DccChat : DccConnection { #region Private Variables private StreamReader _sr; private StreamWriter _sw; private int _lines; #endregion #region Public Properties public int Lines { get { return _lines; } } #endregion /// /// Constructor of DCC CHat for local DCC Chat Request to a certain user. /// /// IrcFeature Class /// Chat Destination (channels are no valid targets) /// Our externally reachable IP Adress (can be anything if passive) /// if you have no reachable ports! /// Non DCC Message Priority internal DccChat(IrcFeatures irc, string user, IPAddress externalIpAdress, bool passive, Priority priority) : base() { this.Irc = irc; this.ExternalIPAdress = externalIpAdress; this.User = user; if(passive) { irc.SendMessage(SendType.CtcpRequest, user, "DCC CHAT chat " + HostToDccInt(externalIpAdress).ToString() + " 0 " + session, priority); this.Disconnect(); } else { DccServer = new TcpListener(new IPEndPoint(IPAddress.Any, 0)); DccServer.Start(); LocalEndPoint = (IPEndPoint)DccServer.LocalEndpoint; irc.SendMessage(SendType.CtcpRequest, user, "DCC CHAT chat " + HostToDccInt(externalIpAdress).ToString() + " " + LocalEndPoint.Port, priority); } } /// /// Constructor of a DCC Chat for a Incoming DCC Chat Request /// /// IrcFeature Class /// Our externally reachable IP Adress /// The Ctcp Event which initiated this constructor internal DccChat(IrcFeatures irc, IPAddress externalIpAdress, CtcpEventArgs e) : base () { this.Irc = irc; this.ExternalIPAdress = externalIpAdress; this.User = e.Data.Nick; long ip; int port; if (e.Data.MessageArray.Length > 4) { bool okIP = long.TryParse(e.Data.MessageArray[3], out ip); bool okPo = int.TryParse(FilterMarker(e.Data.MessageArray[4]), out port); // port 0 = passive if((e.Data.MessageArray[2]=="chat") && okIP && okPo) { RemoteEndPoint = new IPEndPoint(IPAddress.Parse(DccIntToHost(ip)), port); if (e.Data.MessageArray.Length > 5 && e.Data.MessageArray[5] != "T") { this.AcceptRequest(); // Since we initated the Request, we accept DCC return; // No OnDccChatRequestEvent Event! (we know that we want a connection) } DccChatRequestEvent(new DccEventArgs(this)); return; } else { irc.SendMessage(SendType.CtcpReply, e.Data.Nick, "ERRMSG DCC Chat Parameter Error"); } } else { irc.SendMessage(SendType.CtcpReply, e.Data.Nick, "ERRMSG DCC Chat not enough parameters"); } this.isValid = false; } internal override void InitWork(Object stateInfo) { if (!Valid) return; if (DccServer != null) { Connection = DccServer.AcceptTcpClient(); RemoteEndPoint = (IPEndPoint)Connection.Client.RemoteEndPoint; DccServer.Stop(); isConnected = true; } else { while(!isConnected) { Thread.Sleep(500); // We wait till Request is Accepted (or jump out when rejected) if (reject) { isValid = false; return; } } } DccChatStartEvent(new DccEventArgs(this)); _sr = new StreamReader(Connection.GetStream(), Irc.Encoding); _sw = new StreamWriter(Connection.GetStream(), Irc.Encoding); _sw.AutoFlush = true; string line; while(((line = _sr.ReadLine())!=null) && (isConnected)) { DccChatReceiveLineEvent(new DccChatEventArgs(this, line)); _lines++; } isValid = false; isConnected = false; DccChatStopEvent(new DccEventArgs(this)); } #region Public Methods for the DCC Chat Object /// /// Accept an incoming Chatrequest, returns false if anything but a Connect happens /// /// public bool AcceptRequest() { if (isConnected) return false; try { if(RemoteEndPoint.Port==0) { DccServer = new TcpListener(new IPEndPoint(IPAddress.Any, 0)); DccServer.Start(); LocalEndPoint = (IPEndPoint)DccServer.LocalEndpoint; Irc.SendMessage(SendType.CtcpRequest, User, "DCC CHAT chat " + HostToDccInt(ExternalIPAdress).ToString() + " " + LocalEndPoint.Port); } else { Connection = new TcpClient(); Connection.Connect(RemoteEndPoint); isConnected = true; } return true; } catch(Exception) { isValid = false; isConnected = false; return false; } } public void WriteLine(string message) { if(isConnected) { _sw.WriteLine(message); _lines++; DccChatSentLineEvent(new DccChatEventArgs(this, message)); } else { throw new NotConnectedException("DCC Chat is not Connected"); } } #endregion } } smuxi-0.11/lib/SmartIrc4net/src/IrcFeatures/IrcFeatures.cs0000644000175000017500000004511511655552514024250 0ustar00meebeymeebey00000000000000/* * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2008-2009 Thomas Bruderer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Net; using System.Threading; using System.Collections.Generic; using System.Collections.ObjectModel; namespace Meebey.SmartIrc4net { /// /// Description of IrcFeatures2. /// /// public class IrcFeatures : IrcClient { #region Public Field Access public IPAddress ExternalIpAdress { get { return _ExternalIpAdress; } set { _ExternalIpAdress = value; } } /// /// Access to all DccConnections, Its not possible to change the collection itself, /// but you can use the public Members of the DccCollections or its inherited Classes. /// public ReadOnlyCollection DccConnections { get { return new ReadOnlyCollection(_DccConnections); } } /// /// To handle more or less CTCP Events, modify this collection to your needs. /// You can also change the Delegates to your own implementations. /// public Dictionary CtcpDelegates { get { return _CtcpDelegates; } } /// /// This Info is shown with the CTCP UserInfo Request /// public string CtcpUserInfo { get { return _CtcpUserInfo; } set { _CtcpUserInfo = value; } } /// /// This Url will be mentioned with the CTCP Url Request /// public string CtcpUrl { get { return _CtcpUrl; } set { _CtcpUrl = value; } } /// /// The Source of the IRC Program is show in the CTCP Source Request /// public string CtcpSource { get { return _CtcpSource; } set { _CtcpSource = value; } } #endregion #region private variables private IPAddress _ExternalIpAdress; private List _DccConnections = new List(); private Dictionary _CtcpDelegates = new Dictionary(StringComparer.CurrentCultureIgnoreCase); private string _CtcpUserInfo; private string _CtcpUrl; private string _CtcpSource; internal DccSpeed Speed = DccSpeed.RfcSendAhead; #endregion #region Public DCC Events (Global: All Dcc Events) public event DccConnectionHandler OnDccChatRequestEvent; public void DccChatRequestEvent(DccEventArgs e) { if (OnDccChatRequestEvent!=null) {OnDccChatRequestEvent(this, e); } } public event DccSendRequestHandler OnDccSendRequestEvent; public void DccSendRequestEvent(DccSendRequestEventArgs e) { if (OnDccSendRequestEvent!=null) {OnDccSendRequestEvent(this, e); } } public event DccConnectionHandler OnDccChatStartEvent; public void DccChatStartEvent(DccEventArgs e) { if (OnDccChatStartEvent!=null) {OnDccChatStartEvent(this, e); } } public event DccConnectionHandler OnDccSendStartEvent; public void DccSendStartEvent(DccEventArgs e) { if (OnDccSendStartEvent!=null) {OnDccSendStartEvent(this, e); } } public event DccChatLineHandler OnDccChatReceiveLineEvent; public void DccChatReceiveLineEvent(DccChatEventArgs e) { if (OnDccChatReceiveLineEvent!=null) {OnDccChatReceiveLineEvent(this, e); } } public event DccSendPacketHandler OnDccSendReceiveBlockEvent; public void DccSendReceiveBlockEvent(DccSendEventArgs e) { if (OnDccSendReceiveBlockEvent!=null) {OnDccSendReceiveBlockEvent(this, e); } } public event DccChatLineHandler OnDccChatSentLineEvent; public void DccChatSentLineEvent(DccChatEventArgs e) { if (OnDccChatSentLineEvent!=null) {OnDccChatSentLineEvent(this, e); } } public event DccSendPacketHandler OnDccSendSentBlockEvent; internal void DccSendSentBlockEvent(DccSendEventArgs e) { if (OnDccSendSentBlockEvent!=null) {OnDccSendSentBlockEvent(this, e); } } public event DccConnectionHandler OnDccChatStopEvent; public void DccChatStopEvent(DccEventArgs e) { if (OnDccChatStopEvent!=null) {OnDccChatStopEvent(this, e); } } public event DccConnectionHandler OnDccSendStopEvent; public void DccSendStopEvent(DccEventArgs e) { if (OnDccSendStopEvent!=null) {OnDccSendStopEvent(this, e); } } #endregion #region Public Interface Methods public IrcFeatures() : base() { // This method calls all the ctcp handlers defined below (or added anywhere else) this.OnCtcpRequest += new CtcpEventHandler(this.CtcpRequestsHandler); // Adding ctcp handler, all commands are lower case (.ToLower() in handler) _CtcpDelegates.Add("version", this.CtcpVersionDelegate); _CtcpDelegates.Add("clientinfo", this.CtcpClientInfoDelegate); _CtcpDelegates.Add("time", this.CtcpTimeDelegate); _CtcpDelegates.Add("userinfo", this.CtcpUserInfoDelegate); _CtcpDelegates.Add("url", this.CtcpUrlDelegate); _CtcpDelegates.Add("source", this.CtcpSourceDelegate); _CtcpDelegates.Add("finger", this.CtcpFingerDelegate); // The DCC Handler _CtcpDelegates.Add("dcc", this.CtcpDccDelegate); // Don't remove the Ping handler without your own implementation _CtcpDelegates.Add("ping", this.CtcpPingDelegate); } /// /// Init a DCC Chat Session /// /// User to DCC public void InitDccChat(string user) { this.InitDccChat(user, false); } /// /// Init a DCC Chat Session /// /// User to DCC /// Passive DCC public void InitDccChat(string user, bool passive) { this.InitDccChat(user, passive, Priority.Medium); } /// /// Init a DCC Chat Session /// /// User to DCC /// Passive DCC /// Non Dcc Message Priority for Negotiation public void InitDccChat(string user, bool passive, Priority priority) { DccChat chat = new DccChat(this, user, _ExternalIpAdress, passive, priority); _DccConnections.Add(chat); ThreadPool.QueueUserWorkItem(new WaitCallback(chat.InitWork)); RemoveInvalidDccConnections(); } /// /// Send a local File /// /// Destination of the File (no channel) /// complete filepath, absolute or relative (carefull) public void SendFile(string user, string filepath) { FileInfo fi = new FileInfo(filepath); if (fi.Exists) { this.SendFile(user, new FileStream(filepath, FileMode.Open), fi.Name, fi.Length, DccSpeed.RfcSendAhead, false, Priority.Medium); } } /// /// Send a local File passivly /// /// Destination of the File (no channel) /// complete filepath, absolute or relative (carefull) /// Passive DCC public void SendFile(string user, string filepath, bool passive) { FileInfo fi = new FileInfo(filepath); if (fi.Exists) { this.SendFile(user, new FileStream(filepath, FileMode.Open), fi.Name, fi.Length, DccSpeed.RfcSendAhead, passive, Priority.Medium); } } /// /// Send any Stream, active initiator, fast RfC method /// /// Destination of the File (no channel) /// You can send any stream here /// give a filename for the remote User /// give the length of the stream public void SendFile(string user, Stream file, string filename, long filesize) { this.SendFile(user, file, filename, filesize, DccSpeed.RfcSendAhead, false); } /// /// Send any Stream, full flexibility in Dcc Connection Negotiation /// /// Destination of the File (no channel) /// You can send any stream here /// give a filename for the remote User /// give the length of the stream /// What ACK Managment should be used /// Passive DCC public void SendFile(string user, Stream file, string filename, long filesize, DccSpeed speed, bool passive) { this.SendFile(user, file, filename, filesize, speed, passive, Priority.Medium); } /// /// Send any Stream, full flexibility in Dcc Connection Negotiation /// /// Destination of the File (no channel) /// You can send any stream here /// give a filename for the remote User /// give the length of the stream /// What ACK Managment should be used /// Passive DCC /// Non Dcc Message Priority for Negotiation public void SendFile(string user, Stream file, string filename, long filesize, DccSpeed speed, bool passive, Priority priority) { DccSend send = new DccSend(this, user, _ExternalIpAdress, file, filename, filesize, speed, passive, priority); _DccConnections.Add(send); ThreadPool.QueueUserWorkItem(new WaitCallback(send.InitWork)); RemoveInvalidDccConnections(); } #endregion #region Private Methods private void CtcpRequestsHandler(object sender, CtcpEventArgs e) { if (_CtcpDelegates.ContainsKey(e.CtcpCommand)) { _CtcpDelegates[e.CtcpCommand].Invoke(e); } else { /* No CTCP Handler for this Command */ } RemoveInvalidDccConnections(); } #endregion #region implemented ctcp delegates, can be overwritten by changing the ctcpDelagtes Dictionary private void CtcpVersionDelegate(CtcpEventArgs e) { SendMessage(SendType.CtcpReply, e.Data.Nick, "VERSION " + ((CtcpVersion==null)?VersionString:CtcpVersion)); } private void CtcpClientInfoDelegate(CtcpEventArgs e) { string clientInfo = "CLIENTINFO"; foreach(KeyValuePair kvp in _CtcpDelegates) { clientInfo = clientInfo+" "+kvp.Key.ToUpper(); } SendMessage(SendType.CtcpReply, e.Data.Nick, clientInfo); } private void CtcpPingDelegate(CtcpEventArgs e) { if (e.Data.Message.Length > 7) { SendMessage(SendType.CtcpReply, e.Data.Nick, "PING "+e.Data.Message.Substring(6, (e.Data.Message.Length-7))); } else { SendMessage(SendType.CtcpReply, e.Data.Nick, "PING"); //according to RFC, it should be PONG! } } /// /// This is the correct Rfc Ping Delegate, which is not used because all other clients do not use the PING According to RfC /// /// private void CtcpRfcPingDelegate(CtcpEventArgs e) { if (e.Data.Message.Length > 7) { SendMessage(SendType.CtcpReply, e.Data.Nick, "PONG "+e.Data.Message.Substring(6, (e.Data.Message.Length-7))); } else { SendMessage(SendType.CtcpReply, e.Data.Nick, "PONG"); } } private void CtcpTimeDelegate(CtcpEventArgs e) { SendMessage(SendType.CtcpReply, e.Data.Nick, "TIME " + DateTime.Now.ToString("r")); } private void CtcpUserInfoDelegate(CtcpEventArgs e) { SendMessage(SendType.CtcpReply, e.Data.Nick, "USERINFO " + ((CtcpUserInfo==null)?"No user info given.":CtcpUserInfo)); } private void CtcpUrlDelegate(CtcpEventArgs e) { SendMessage(SendType.CtcpReply, e.Data.Nick, "URL " + ((CtcpUrl==null)?"http://www.google.com":CtcpUrl)); } private void CtcpSourceDelegate(CtcpEventArgs e) { SendMessage(SendType.CtcpReply, e.Data.Nick, "SOURCE " + ((CtcpSource==null)?"http://smartirc4net.meebey.net":CtcpSource)); } private void CtcpFingerDelegate(CtcpEventArgs e) { SendMessage(SendType.CtcpReply, e.Data.Nick, "FINGER Don't touch little Helga there! " ); //SendMessage(SendType.CtcpReply, e.Data.Nick, "FINGER " + this.Realname + " (" + this.Email + ") Idle " + this.Idle + " seconds (" + ((string.IsNullOrEmpty(this.Reason))?this.Reason:"-") + ") " ); } private void CtcpDccDelegate(CtcpEventArgs e) { if (e.Data.MessageArray.Length < 2) { SendMessage(SendType.CtcpReply, e.Data.Nick, "ERRMSG DCC missing parameters"); } else { switch(e.Data.MessageArray[1]) { case "CHAT": DccChat chat = new DccChat(this, _ExternalIpAdress, e); _DccConnections.Add(chat); ThreadPool.QueueUserWorkItem(new WaitCallback(chat.InitWork)); break; case "SEND": if (e.Data.MessageArray.Length > 6 && (FilterMarker(e.Data.MessageArray[6]) != "T")) { long session = -1; long.TryParse(FilterMarker(e.Data.MessageArray[6]), out session); foreach(DccConnection dc in _DccConnections) { if(dc.isSession(session)) { ((DccSend)dc).SetRemote(e); ((DccSend)dc).AcceptRequest(null, 0); return; } } SendMessage(SendType.CtcpReply, e.Data.Nick, "ERRMSG Invalid passive DCC"); } else { DccSend send = new DccSend(this, _ExternalIpAdress, e); _DccConnections.Add(send); ThreadPool.QueueUserWorkItem(new WaitCallback(send.InitWork)); } break; case "RESUME": foreach(DccConnection dc in _DccConnections) { if((dc is DccSend) && (((DccSend)dc).TryResume(e))) { return; } } SendMessage(SendType.CtcpReply, e.Data.Nick, "ERRMSG Invalid DCC RESUME"); break; case "ACCEPT": foreach(DccConnection dc in _DccConnections) { if((dc is DccSend) && (((DccSend)dc).TryAccept(e))) { return; } } SendMessage(SendType.CtcpReply, e.Data.Nick, "ERRMSG Invalid DCC ACCEPT"); break; case "XMIT": SendMessage(SendType.CtcpReply, e.Data.Nick, "ERRMSG DCC XMIT not implemented"); break; default: SendMessage(SendType.CtcpReply, e.Data.Nick, "ERRMSG DCC "+e.CtcpParameter+" unavailable"); break; } } } /// /// cleanup all old invalide DCCs (late cleaning) /// /// private void RemoveInvalidDccConnections() { // List invalidDc= new List(); foreach (DccConnection dc in _DccConnections) { if ((!dc.Valid) && (!dc.Connected)) { invalidDc.Add(dc); } } foreach (DccConnection dc in invalidDc) { _DccConnections.Remove(dc); } } private string FilterMarker(string msg) { string result = ""; foreach(char c in msg) { if (c!=IrcConstants.CtcpChar) result += c; } return result; } #endregion } } smuxi-0.11/lib/SmartIrc4net/src/Exceptions.cs0000644000175000017500000000763011655552514021741 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * SmartIrc4net - the IRC library for .NET/C# * * Copyright (c) 2003-2005 Mirco Bauer * * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Runtime.Serialization; namespace Meebey.SmartIrc4net { /// [Serializable()] public class SmartIrc4netException : ApplicationException { public SmartIrc4netException() : base() { } public SmartIrc4netException(string message) : base(message) { } public SmartIrc4netException(string message, Exception e) : base(message, e) { } protected SmartIrc4netException(SerializationInfo info, StreamingContext context) : base(info, context) { } } /// [Serializable()] public class ConnectionException : SmartIrc4netException { public ConnectionException() : base() { } public ConnectionException(string message) : base(message) { } public ConnectionException(string message, Exception e) : base(message, e) { } protected ConnectionException(SerializationInfo info, StreamingContext context) : base(info, context) { } } /// [Serializable()] public class CouldNotConnectException : ConnectionException { public CouldNotConnectException() : base() { } public CouldNotConnectException(string message) : base(message) { } public CouldNotConnectException(string message, Exception e) : base(message, e) { } protected CouldNotConnectException(SerializationInfo info, StreamingContext context) : base(info, context) { } } /// [Serializable()] public class NotConnectedException : ConnectionException { public NotConnectedException() : base() { } public NotConnectedException(string message) : base(message) { } public NotConnectedException(string message, Exception e) : base(message, e) { } protected NotConnectedException(SerializationInfo info, StreamingContext context) : base(info, context) { } } /// [Serializable()] public class AlreadyConnectedException : ConnectionException { public AlreadyConnectedException() : base() { } public AlreadyConnectedException(string message) : base(message) { } public AlreadyConnectedException(string message, Exception e) : base(message, e) { } protected AlreadyConnectedException(SerializationInfo info, StreamingContext context) : base(info, context) { } } } smuxi-0.11/lib/Twitterizer/0000755000175000017500000000000012311344240016472 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/CommonAssemblyInfo.cs0000644000175000017500000000623512253423361022602 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // //----------------------------------------------------------------------- using System; using System.Reflection; using System.Runtime.InteropServices; using System.Security; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Twitterizer")] [assembly: AssemblyDescription("Twitter integration library")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif [assembly: AssemblyCompany("Twitterizer Group (www.twitterizer.net)")] [assembly: AssemblyProduct("Twitterizer")] [assembly: AssemblyCopyright("2010 Patrick 'Ricky' Smith (www.ricky-dev.com)")] [assembly: AssemblyTrademark("")] [assembly: AssemblyVersion("2.4.2.*")] [assembly: AssemblyFileVersion("2.4.2.0")] [assembly: AssemblyInformationalVersion("2.4.2")] #if !SILVERLIGHT [assembly: AllowPartiallyTrustedCallers] #endif [assembly: CLSCompliant(true)] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)]smuxi-0.11/lib/Twitterizer/Twitterizer2/0000755000175000017500000000000012311344240021110 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Information.cs0000644000175000017500000000537212253423361023742 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The information class which gives general information about the assembly. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The information class which gives general information about the assembly. /// internal static class Information { /// /// Obtains the current assembly version. /// /// The assembly version string in the format (#.#.#.#) public static string AssemblyVersion() { #if !SILVERLIGHT return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); #else return System.Reflection.Assembly.GetExecutingAssembly().FullName.Split(',')[1].Split('=')[1]; #endif } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/0000755000175000017500000000000012274103753022012 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/ICommand.cs0000644000175000017500000000566312132510633024032 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The interface that all valid commands must implement. //----------------------------------------------------------------------- namespace Twitterizer.Core { using System.Collections.Generic; /// /// The ICommand interface. /// /// The Type of the BaseObject that the command returns /// public interface ICommand where T : ITwitterObject { /// /// Gets the request parameters. /// /// The request parameters. Dictionary RequestParameters { get; } /// /// Initializes the command. /// void Init(); /// /// Executes the command. /// /// The results of the command. /// TwitterResponse ExecuteCommand(); } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/TwitterDictionary.cs0000644000175000017500000000567412253423361026042 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The base class for object dictionaries. //----------------------------------------------------------------------- namespace Twitterizer.Core { using System; using System.Collections.ObjectModel; using System.Runtime.Serialization; using System.Collections.Generic; /// /// The base class for object dictionaries. /// /// The type of key object stored in the collection. /// The type of value object stored in the collection. #if !SILVERLIGHT [Serializable] #endif [DataContract] public abstract class TwitterDictionary : Dictionary //where T : class, ITwitterObject where T2: class, ITwitterObject { /// /// Gets or sets the annotations. /// /// The annotations. [DataMember] public Dictionary Annotations { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/TwitterCommand.cs0000644000175000017500000004306012253423361025302 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The base class for all command classes. //----------------------------------------------------------------------- namespace Twitterizer.Core { using System; using System.Collections.Generic; using System.Globalization; using System.Net; using System.Linq; using System.Text; #if !SILVERLIGHT using System.Web; #endif using Twitterizer; /// /// The base command class. /// /// The business object the command should return. #if !SILVERLIGHT [Serializable] #endif internal abstract class TwitterCommand : ICommand where T : ITwitterObject { /// /// Initializes a new instance of the class. /// /// The method. /// The end point. /// The tokens. /// The optional properties. protected TwitterCommand(HTTPVerb method, string endPoint, OAuthTokens tokens, OptionalProperties optionalProperties) { this.RequestParameters = new Dictionary(); this.Verb = method; this.Tokens = tokens; this.OptionalProperties = optionalProperties ?? new OptionalProperties(); this.SetCommandUri(endPoint); } /// /// Gets or sets the optional properties. /// /// The optional properties. protected OptionalProperties OptionalProperties { get; set; } /// /// Gets or sets the API method URI. /// /// The URI for the API method. private Uri Uri { get; set; } /// /// Gets or sets the method. /// /// The method. private HTTPVerb Verb { get; set; } /// /// Gets or sets the request parameters. /// /// The request parameters. public Dictionary RequestParameters { get; set; } /// /// Gets or sets the serialization delegate. /// /// The serialization delegate. protected SerializationHelper.DeserializationHandler DeserializationHandler { get; set; } /// /// Gets the request tokens. /// /// The request tokens. internal OAuthTokens Tokens { get; private set; } /// /// Initializes the command. /// public abstract void Init(); /// /// Gets or sets a value indicating whether this is multipart. /// /// true if multipart; otherwise, false. protected bool Multipart { get; set; } /// /// Executes the command. /// /// The results of the command. public TwitterResponse ExecuteCommand() { TwitterResponse twitterResponse = new TwitterResponse(); if (this.OptionalProperties.UseSSL) { this.Uri = new Uri(this.Uri.AbsoluteUri.Replace("http://", "https://")); } // Loop through all of the custom attributes assigned to the command class foreach (Attribute attribute in this.GetType().GetCustomAttributes(false)) { if (attribute is AuthorizedCommandAttribute) { if (this.Tokens == null) { throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Tokens are required for the \"{0}\" command.", this.GetType())); } if (string.IsNullOrEmpty(this.Tokens.ConsumerKey) || string.IsNullOrEmpty(this.Tokens.ConsumerSecret) || string.IsNullOrEmpty(this.Tokens.AccessToken) || string.IsNullOrEmpty(this.Tokens.AccessTokenSecret)) { throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Token values cannot be null when executing the \"{0}\" command.", this.GetType())); } } else if (attribute is RateLimitedAttribute) { // Get the rate limiting status if (TwitterRateLimitStatus.GetStatus(this.Tokens).ResponseObject.RemainingHits == 0) { throw new TwitterizerException("You are being rate limited."); } } } // Prepare the query parameters Dictionary queryParameters = new Dictionary(); foreach (KeyValuePair item in this.RequestParameters) { queryParameters.Add(item.Key, item.Value); } // Declare the variable to be returned twitterResponse.ResponseObject = default(T); twitterResponse.RequestUrl = this.Uri.AbsoluteUri; RateLimiting rateLimiting; AccessLevel accessLevel; byte[] responseData; try { WebRequestBuilder requestBuilder = new WebRequestBuilder(this.Uri, this.Verb, this.Tokens) { Multipart = this.Multipart }; #if !SILVERLIGHT if (this.OptionalProperties != null) requestBuilder.Proxy = this.OptionalProperties.Proxy; #endif foreach (var item in queryParameters) { requestBuilder.Parameters.Add(item.Key, item.Value); } HttpWebResponse response = requestBuilder.ExecuteRequest(); if (response == null) { twitterResponse.Result = RequestResult.Unknown; return twitterResponse; } responseData = ConversionUtility.ReadStream(response.GetResponseStream()); twitterResponse.Content = Encoding.UTF8.GetString(responseData, 0, responseData.Length); twitterResponse.RequestUrl = requestBuilder.RequestUri.AbsoluteUri; #if !SILVERLIGHT // Parse the rate limiting HTTP Headers rateLimiting = ParseRateLimitHeaders(response.Headers); // Parse Access Level accessLevel = ParseAccessLevel(response.Headers); #else rateLimiting = null; accessLevel = AccessLevel.Unknown; #endif // Lookup the status code and set the status accordingly SetStatusCode(twitterResponse, response.StatusCode, rateLimiting); twitterResponse.RateLimiting = rateLimiting; twitterResponse.AccessLevel = accessLevel; } catch (WebException wex) { if (new[] { #if !SILVERLIGHT WebExceptionStatus.Timeout, WebExceptionStatus.ConnectionClosed, #endif WebExceptionStatus.ConnectFailure }.Contains(wex.Status)) { twitterResponse.Result = RequestResult.ConnectionFailure; twitterResponse.ErrorMessage = wex.Message; return twitterResponse; } // The exception response should always be an HttpWebResponse, but we check for good measure. HttpWebResponse exceptionResponse = wex.Response as HttpWebResponse; if (exceptionResponse == null) { throw; } responseData = ConversionUtility.ReadStream(exceptionResponse.GetResponseStream()); twitterResponse.Content = Encoding.UTF8.GetString(responseData, 0, responseData.Length); #if !SILVERLIGHT rateLimiting = ParseRateLimitHeaders(exceptionResponse.Headers); // Parse Access Level accessLevel = ParseAccessLevel(exceptionResponse.Headers); #else rateLimiting = null; accessLevel = AccessLevel.Unknown; #endif // Try to read the error message, if there is one. try { TwitterErrorDetails errorDetails = SerializationHelper.Deserialize(responseData); twitterResponse.ErrorMessage = errorDetails.ErrorMessage; } catch (Exception) { // Occasionally, Twitter responds with XML error data even though we asked for json. // This is that scenario. We will deal with it by doing nothing. It's up to the developer to deal with it. } // Lookup the status code and set the status accordingly SetStatusCode(twitterResponse, exceptionResponse.StatusCode, rateLimiting); twitterResponse.RateLimiting = rateLimiting; twitterResponse.AccessLevel = accessLevel; if (wex.Status == WebExceptionStatus.UnknownError) throw; return twitterResponse; } try { twitterResponse.ResponseObject = SerializationHelper.Deserialize(responseData, this.DeserializationHandler); } catch (Newtonsoft.Json.JsonReaderException) { twitterResponse.ErrorMessage = "Unable to parse JSON"; twitterResponse.Result = RequestResult.Unknown; return twitterResponse; } catch (Newtonsoft.Json.JsonSerializationException) { twitterResponse.ErrorMessage = "Unable to parse JSON"; twitterResponse.Result = RequestResult.Unknown; return twitterResponse; } // Pass the current oauth tokens into the new object, so method calls from there will keep the authentication. twitterResponse.Tokens = this.Tokens; return twitterResponse; } /// /// Sets the status code. /// /// The twitter response. /// The status code. /// The rate limiting. private static void SetStatusCode(TwitterResponse twitterResponse, HttpStatusCode statusCode, RateLimiting rateLimiting) { switch (statusCode) { case HttpStatusCode.OK: twitterResponse.Result = RequestResult.Success; break; case HttpStatusCode.BadRequest: twitterResponse.Result = (rateLimiting != null && rateLimiting.Remaining == 0) ? RequestResult.RateLimited : RequestResult.BadRequest; break; case (HttpStatusCode)420: //Rate Limited from Search/Trends API twitterResponse.Result = RequestResult.RateLimited; break; case HttpStatusCode.Unauthorized: twitterResponse.Result = RequestResult.Unauthorized; break; case HttpStatusCode.NotFound: twitterResponse.Result = RequestResult.FileNotFound; break; case HttpStatusCode.ProxyAuthenticationRequired: twitterResponse.Result = RequestResult.ProxyAuthenticationRequired; break; case HttpStatusCode.RequestTimeout: twitterResponse.Result = RequestResult.TwitterIsOverloaded; break; case HttpStatusCode.Forbidden: twitterResponse.Result = RequestResult.Unauthorized; break; default: twitterResponse.Result = RequestResult.Unknown; break; } } /// /// Sets the command URI. /// /// The end point. protected void SetCommandUri(string endPoint) { if (endPoint.StartsWith("/")) throw new ArgumentException("The API endpoint cannot begin with a forward slash. This will result in 404 errors and headaches.", "endPoint"); this.Uri = new Uri(string.Concat(this.OptionalProperties.APIBaseAddress, endPoint)); } /// /// Parses the rate limit headers. /// /// The headers of the web response. /// An object that contains the rate-limiting info contained in the response headers private static RateLimiting ParseRateLimitHeaders(WebHeaderCollection responseHeaders) { RateLimiting rateLimiting = new RateLimiting(); if (responseHeaders.AllKeys.Contains("X-RateLimit-Limit")) { rateLimiting.Total = int.Parse(responseHeaders["X-RateLimit-Limit"], CultureInfo.InvariantCulture); } if (responseHeaders.AllKeys.Contains("X-RateLimit-Remaining")) { rateLimiting.Remaining = int.Parse(responseHeaders["X-RateLimit-Remaining"], CultureInfo.InvariantCulture); } if (!string.IsNullOrEmpty(responseHeaders["X-RateLimit-Reset"])) { rateLimiting.ResetDate = DateTime.SpecifyKind(new DateTime(1970, 1, 1, 0, 0, 0, 0) .AddSeconds(double.Parse(responseHeaders["X-RateLimit-Reset"], CultureInfo.InvariantCulture)), DateTimeKind.Utc); } else if(!string.IsNullOrEmpty(responseHeaders["Retry-After"])) { rateLimiting.ResetDate = DateTime.UtcNow.AddSeconds(Convert.ToInt32(responseHeaders["Retry-After"])); } return rateLimiting; } /// /// Parses the access level headers. /// /// The headers of the web response. /// An enum of the current access level of the OAuth Token being used. private AccessLevel ParseAccessLevel(WebHeaderCollection responseHeaders) { if (responseHeaders.AllKeys.Contains("X-Access-Level")) { switch (responseHeaders["X-Access-Level"].ToLower()) { case "read": return AccessLevel.Read; case "read-write": return AccessLevel.ReadWrite; case "read-write-privatemessages": case "read-write-directmessages": return AccessLevel.ReadWriteDirectMessage; } return AccessLevel.Unknown; } return AccessLevel.Unavailable; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/CommandPerformer.cs0000644000175000017500000000522212132510633025572 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The command performer. //----------------------------------------------------------------------- namespace Twitterizer.Core { internal static class CommandPerformer { /// /// Performs the action. /// /// The command. /// The parsed result of the action. /// /// public static TwitterResponse PerformAction(ICommand command) where T : ITwitterObject { command.Init(); return command.ExecuteCommand(); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/TwitterIdCollection.cs0000644000175000017500000001123412253423361026272 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter id collection class. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Core; /// /// Holds a collection of ID values /// #if !SILVERLIGHT [Serializable] #endif public class TwitterIdCollection : Collection, ITwitterObject { /// /// Initializes a new instance of the class. /// /// public TwitterIdCollection() { } /// /// Initializes a new instance of the class. /// /// The items. /// public TwitterIdCollection(List items) { items.ForEach(Add); } /// /// Annotations are additional pieces of data, supplied by Twitter clients, in a non-structured dictionary. /// /// The annotations. public Dictionary Annotations { get; set; } /// /// Performs an explicit conversion from to . /// /// The collection. /// The result of the conversion. /// public static explicit operator TwitterIdCollection (List collection) { TwitterIdCollection newCollection = new TwitterIdCollection(); foreach (var item in collection) { newCollection.Add(item); } return newCollection; } } /// /// Holds extension methods related to the class. /// /// public static class TwitterIdCollectionExtensions { /// /// Converts the collection to a class. /// /// The old. /// /// public static TwitterIdCollection ToIdCollection(this IEnumerable old) { TwitterIdCollection newCollection = new TwitterIdCollection(); foreach (var item in old) { newCollection.Add(item); } return newCollection; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/NamespaceDoc.cs0000644000175000017500000000453511655552527024703 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The dummy file for supplying xml documentation for the Twitterizer.Core namespace. //----------------------------------------------------------------------- namespace Twitterizer.Core { /// /// The namespace contains abstract classes and interfaces /// [System.Runtime.CompilerServices.CompilerGenerated] internal class NamespaceDoc { } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/TwitterImage.cs0000644000175000017500000000634112132510633024742 0ustar00meebeymeebey00000000000000namespace Twitterizer { using System; using System.IO; /// /// The image type that is being uploaded. /// #if !SILVERLIGHT [Serializable] #endif public enum TwitterImageImageType { /// /// JPEG /// Jpeg, /// /// GIF /// Gif, /// /// PNG /// PNG } /// /// Represents an image for uploading. Used to upload new profile and background images. /// #if !SILVERLIGHT [Serializable] #endif public class TwitterImage { /// /// Gets or sets the filename. /// /// The filename. public string Filename { get; set; } /// /// Gets or sets the data. /// /// The data. public byte[] Data { get; set; } /// /// Gets or sets the type of the image. /// /// The type of the image. public TwitterImageImageType ImageType { get; set; } /// /// Gets the image's MIME type. /// /// public string GetMimeType() { switch (this.ImageType) { case TwitterImageImageType.Jpeg: return "image/jpeg"; case TwitterImageImageType.Gif: return "image/gif"; case TwitterImageImageType.PNG: return "image/png"; default: throw new ArgumentOutOfRangeException(); } } /// /// Reads a file from the disk and returns a instance for uploading. /// /// The file path. /// public static TwitterImage ReadFromDisk(string filePath) { if (!File.Exists(filePath)) { throw new ArgumentException(string.Format("File does not be exist: {0}.", filePath)); } TwitterImage newImage = new TwitterImage(); newImage.Data = File.ReadAllBytes(filePath); FileInfo imageFileInfo = new FileInfo(filePath); newImage.Filename = imageFileInfo.Name; switch (imageFileInfo.Extension.ToLower()) { case ".jpg": case ".jpeg": newImage.ImageType = TwitterImageImageType.Jpeg; break; case ".gif": newImage.ImageType = TwitterImageImageType.Gif; break; case ".png": newImage.ImageType = TwitterImageImageType.PNG; break; default: throw new Exception("File is not a recognized type. Must be jpg, png, or gif."); } return newImage; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/RateLimit.cs0000644000175000017500000000576012132510633024233 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // Contains information about the state of the user's available service usage. //----------------------------------------------------------------------- namespace Twitterizer { using System; /// /// Provides data about the user's current rate limiting. /// #if !SILVERLIGHT [System.Serializable] #endif public class RateLimiting { /// /// Gets the remaining number of requests until requests are denied. /// /// The remaining requests. public int Remaining { get; internal set; } /// /// Gets the total number of requests allowed before requests are denied. /// /// The total number of requests. public int Total { get; internal set; } /// /// Gets the date the remaining number of requests will be reset. /// /// The reset date. public DateTime ResetDate { get; internal set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/TwitterCursorPagedIdCollection.cs0000644000175000017500000000761312253423361030437 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter cursor paged id collection class. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Core; /// /// Holds a collection of ID values that are broken into multiple pages. /// #if !SILVERLIGHT [Serializable] #endif public class TwitterCursorPagedIdCollection : Collection, ITwitterObject { /// /// Annotations are additional pieces of data, supplied by Twitter clients, in a non-structured dictionary. /// /// The annotations. public Dictionary Annotations { get; set; } /// /// Gets or sets the next cursor. /// /// The next cursor. public long NextCursor { get; set; } /// /// Gets or sets the previous cursor. /// /// The previous cursor. public long PreviousCursor { get; set; } /// /// Deserializes the specified value. /// /// The value. /// internal static TwitterCursorPagedIdCollection DeserializeWrapper(JObject value) { if (value == null || value.SelectToken("ids") == null) return null; TwitterCursorPagedIdCollection result = JsonConvert.DeserializeObject(value.SelectToken("ids").ToString()); result.NextCursor = value.SelectToken("next_cursor").Value(); result.PreviousCursor = value.SelectToken("previous_cursor").Value(); return result; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/RequestResult.cs0000644000175000017500000000746012132510633025167 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter status class. Provides information about the last request made. //----------------------------------------------------------------------- namespace Twitterizer { /// /// Describes the result status of a request /// public enum RequestResult { /// /// The request was completed successfully /// Success, /// /// The URI requested is invalid or the resource requested, such as a user, does not exists. /// FileNotFound, /// /// The request was invalid. An accompanying error message will explain why. /// BadRequest, /// /// Authentication credentials were missing or incorrect. /// Unauthorized, /// /// Returned by the Search API when an invalid format is specified in the request. /// NotAcceptable, /// /// The authorized user, or client IP address, is being rate limited. /// RateLimited, /// /// Twitter is currently down. /// TwitterIsDown, /// /// Twitter is online, but is overloaded. Try again later. /// TwitterIsOverloaded, /// /// The request failed due to a connection issue or timeout. /// ConnectionFailure, /// /// Something unexpected happened. See the error message for additional information. /// Unknown, /// /// Failed to authenticate with the proxy. /// ProxyAuthenticationRequired } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/TwitterCollection.cs0000644000175000017500000000542212132510633026012 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The base class for object collections. //----------------------------------------------------------------------- namespace Twitterizer.Core { using System; using System.Collections.ObjectModel; using System.Runtime.Serialization; /// /// The base class for object collections. /// /// The type of object stored in the collection. #if !SILVERLIGHT [Serializable] #endif [DataContract] public abstract class TwitterCollection : Collection where T : class, ITwitterObject { /// /// Gets or sets the annotations. /// /// The annotations. [DataMember] public System.Collections.Generic.Dictionary Annotations { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/AccessLevel.cs0000644000175000017500000000573312132510633024532 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The OAuth Token Access Level class. Provides information about the last request made. //----------------------------------------------------------------------- namespace Twitterizer { /// /// Describes the access level of the OAuth Token /// public enum AccessLevel { /// /// The request may not be authenticated or the Access Level header was missing from the response. /// Unknown, /// /// The OAuth token has read access levels only. /// Read, /// /// The OAuth token has read write access only. /// ReadWrite, /// /// The OAuth token has read write and direct messages access. /// ReadWriteDirectMessage, /// /// There was no OAuth token access level available for reading in the response headers. /// Unavailable } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/TwitterObject.cs0000644000175000017500000000652212132510633025127 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The base class for all data objects. //----------------------------------------------------------------------- namespace Twitterizer.Core { using System.Collections.Generic; using Newtonsoft.Json; /// /// Represents the callback signature for asynchronous methods. /// /// /// The result. /// public delegate void TwitterAsyncCallback(T result) where T : ITwitterObject; /// /// The base object class /// #if !SILVERLIGHT [System.Serializable] #endif public class TwitterObject : ITwitterObject { /// /// The format that all twitter dates are in. /// protected const string DateFormat = "ddd MMM dd HH:mm:ss zz00 yyyy"; /// /// The format that all twitter search api dates are in. /// protected const string SearchDateFormat = "ddd, dd MMM yyyy HH:mm:ss +zz00"; /// /// Annotations are additional pieces of data, supplied by Twitter clients, in a non-structured dictionary. /// /// The annotations. [JsonProperty(PropertyName = "annotations")] public Dictionary Annotations { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/ConversionUtility.cs0000644000175000017500000001012712132510633026043 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The color translation helper class. //----------------------------------------------------------------------- namespace Twitterizer { #if !SILVERLIGHT using System.Drawing; #endif using System.IO; using System.Text.RegularExpressions; /// /// Provides common color converstion methods /// /// internal static class ConversionUtility { #if !SILVERLIGHT /// /// Converts the color string to a /// /// The value. /// A representation of the color, or null. internal static Color FromTwitterString(string value) { if (string.IsNullOrEmpty(value)) { return new Color(); } if (Regex.IsMatch(value, @"^#?[a-f0-9]{6}$", RegexOptions.IgnoreCase)) { return ColorTranslator.FromHtml(Regex.Replace(value, "^#?([a-f0-9]{6})$", "#$1", RegexOptions.IgnoreCase)); } return Color.FromName(value); } #endif /// /// Reads the stream into a byte array. /// /// The response stream. /// A byte array. internal static byte[] ReadStream(Stream responseStream) { byte[] data = new byte[32768]; byte[] buffer = new byte[32768]; using (MemoryStream ms = new MemoryStream()) { bool exit = false; while (!exit) { int read = responseStream.Read(buffer, 0, buffer.Length); if (read <= 0) { data = ms.ToArray(); exit = true; } else { ms.Write(buffer, 0, read); } } } return data; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/TwitterizerDateConverter.cs0000644000175000017500000001030112253423361027353 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The date converter for Twitter API dates //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Globalization; /// /// Converts date strings returned by the Twitter API into /// public class TwitterizerDateConverter : Newtonsoft.Json.Converters.DateTimeConverterBase { /// /// The date pattern for most dates returned by the API /// protected const string DateFormat = "ddd MMM dd HH:mm:ss zz00 yyyy"; /// /// Reads the json. /// /// The reader. /// Type of the object. /// The existing value. /// The serializer. /// The parsed value as a DateTime, or null. public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) { if (reader.Value == null || reader.Value.GetType() != typeof(string)) return new DateTime(); DateTime parsedDate; return DateTime.TryParseExact( (string)reader.Value, DateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out parsedDate) ? parsedDate : new DateTime(); } /// /// Writes the json. /// /// The writer. /// The value. /// The serializer. public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) { if (value.GetType() != typeof(DateTime)) throw new ArgumentOutOfRangeException("value", "The value provided was not the expected data type."); writer.WriteValue(((DateTime)value).ToString(DateFormat, CultureInfo.InvariantCulture)); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/SerializationHelper.cs0000644000175000017500000001302612253423361026315 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The serialization helper class. //----------------------------------------------------------------------- namespace Twitterizer.Core { using System.Text; using Newtonsoft.Json; using Newtonsoft.Json.Linq; /// /// The Serialization Helper class. Provides a simple interface for common serialization tasks. /// /// The type of object to be deserialized public static class SerializationHelper where T : ITwitterObject { /// /// The JavascriptConversionDelegate. The delegate is invokes when using the JavaScriptSerializer to manually construct a result object. /// /// Contains nested dictionary objects containing deserialized values for manual parsing. /// A strongly typed object representing the deserialized data of type T. /// public delegate T DeserializationHandler(JObject value); /// /// Deserializes the specified web response. /// /// The web response data. /// The deserialization handler. /// /// A strongly typed object representing the deserialized data of type /// public static T Deserialize(byte[] webResponseData, DeserializationHandler deserializationHandler) { return Deserialize(Encoding.UTF8.GetString(webResponseData, 0, webResponseData.Length), deserializationHandler); } /// /// Deserializes the specified web response. /// /// The web response data. /// /// A strongly typed object representing the deserialized data of type /// public static T Deserialize(byte[] webResponseData) { return Deserialize(Encoding.UTF8.GetString(webResponseData, 0, webResponseData.Length), null); } /// /// Deserializes the specified web response. /// /// The web response data. /// The deserialization handler. /// /// A strongly typed object representing the deserialized data of type /// public static T Deserialize(string webResponseData, DeserializationHandler deserializationHandler) { T resultObject; // Deserialize the results. if (deserializationHandler == null) { resultObject = JsonConvert.DeserializeObject(webResponseData); } else { resultObject = deserializationHandler((JObject)JsonConvert.DeserializeObject(webResponseData)); } return resultObject; } /// /// Deserializes the specified web response. /// /// The web response data. /// /// A strongly typed object representing the deserialized data of type /// public static T Deserialize(string webResponseData) { return Deserialize(webResponseData, null); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/ITwitterObject.cs0000644000175000017500000000503012132510633025231 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The interface for all collections and business entities. //----------------------------------------------------------------------- namespace Twitterizer.Core { /// /// The ITwitterObject interface. /// /// public interface ITwitterObject { /// /// Annotations are additional pieces of data, supplied by Twitter clients, in a non-structured dictionary. /// /// The annotations. System.Collections.Generic.Dictionary Annotations { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Core/OptionalProperties.cs0000644000175000017500000000672512274103753026215 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The base class for optional property classes //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Configuration; using System.Net; /// #if !SILVERLIGHT [Serializable] #endif public class OptionalProperties { /// /// Initializes a new instance of the class. /// public OptionalProperties() { // Set the default values for the properties // as of 14 Janary 2014 HTTPS is required and enforced: // https://dev.twitter.com/discussions/24239 this.UseSSL = true; this.APIBaseAddress = "https://api.twitter.com/1.1/"; } /// /// /// Allows configuration of the base address for API method requests for support for 3rd party 'twitter-like' APIs. /// public bool UseSSL { get; set; } /// public string APIBaseAddress { get; set; } #if !SILVERLIGHT /// public WebProxy Proxy { get; set; } #endif } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Exceptions/0000755000175000017500000000000012132510633023233 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Exceptions/TwitterErrorDetails.cs0000644000175000017500000000642712132510633027555 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter error details class. Contains parsed details returned by twitter in an http response body. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Diagnostics; using System.Xml.Serialization; using Newtonsoft.Json; using Twitterizer.Core; /// /// Twitter Error Details class /// /// Often, twitter returns error details in the body of response. This class represents the data structure of the error for deserialization. [JsonObject(MemberSerialization = MemberSerialization.OptIn)] [XmlRoot("hash")] #if !SILVERLIGHT [Serializable] #endif [DebuggerDisplay("@{ErrorMessage}")] public class TwitterErrorDetails : TwitterObject { /// /// Gets or sets the request path. /// /// The request path. [JsonProperty(PropertyName = "request")] [XmlElement("request")] public string RequestPath { get; set; } /// /// Gets or sets the error message. /// /// The error message. [JsonProperty(PropertyName = "error")] [XmlElement("error")] public string ErrorMessage { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Exceptions/CommandValidationException.cs0000644000175000017500000001720612132510633031040 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // Provides a means of reporting command validation failures. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Collections.Generic; using System.Runtime.Serialization; using System.Security.Permissions; using System.Text; using Twitterizer.Core; /// /// An exception class indicating that required parameters were missing from a command. /// /// The command type, derived from ITwitterObject. #if !SILVERLIGHT [Serializable] #endif public class CommandValidationException : Exception where T : ITwitterObject { #region Constructors /// /// Initializes a new instance of the class. /// public CommandValidationException() { // Add any type-specific logic, and supply the default message. } /// /// Initializes a new instance of the class. /// /// The message. public CommandValidationException(string message) : base(message) { // Add any type-specific logic. } /// /// Initializes a new instance of the class. /// /// The message. /// The inner exception. public CommandValidationException(string message, Exception innerException) : base(message, innerException) { // Add any type-specific logic for inner exceptions. } /// /// Initializes a new instance of the class. /// /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. /// /// The parameter is null. /// /// /// The class name is null or is zero (0). /// protected CommandValidationException( SerializationInfo info, StreamingContext context) : base(info, context) { // Implement type-specific serialization constructor logic. } #endregion /// /// Gets or sets the name of the method. /// /// The name of the method. public string MethodName { get; set; } /// /// Gets the name of the command. /// /// The name of the command. public string CommandName { get { return this.Command.GetType().ToString(); } } /// /// Gets the parameters. /// /// The parameters. public string Parameters { get { StringBuilder sb = new StringBuilder(); foreach (KeyValuePair item in this.Command.RequestParameters) { sb.AppendFormat("{0} = \"{1}\"\n", item.Key, item.Value); } return sb.ToString(); } } /// /// Gets or sets the command. /// /// The command. internal ICommand Command { get; set; } #region ISerializable Members /// /// When overridden in a derived class, sets the with information about the exception. /// /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. /// /// The parameter is a null reference (Nothing in Visual Basic). /// /// /// /// /// public override void GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) throw new ArgumentNullException("info"); base.GetObjectData(info, context); } #endregion } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Exceptions/TwitterizerException.cs0000644000175000017500000002064712132510633030006 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Globalization; using System.IO; using System.Linq; using System.Net; using System.Text; using Core; /// /// The Twitterizer Exception /// /// #if !SILVERLIGHT [Serializable] #endif public class TwitterizerException : WebException { #region Constructors /// /// Initializes a new instance of the class. /// public TwitterizerException() { } /// /// Initializes a new instance of the class. /// /// The message. public TwitterizerException(string message) : base(message) { } /// /// Initializes a new instance of the class. /// /// The message. /// The inner exception. public TwitterizerException(string message, Exception innerException) : base(message, innerException) { if (innerException.GetType() == typeof(WebException)) { HttpWebResponse response = (HttpWebResponse)((WebException)innerException).Response; if (response == null) return; Stream responseStream = response.GetResponseStream(); if (responseStream == null) return; byte[] responseData = ConversionUtility.ReadStream(responseStream); this.ResponseBody = Encoding.UTF8.GetString(responseData, 0, responseData.Length); this.ParseRateLimitHeaders(response); if (response.ContentType.StartsWith("application/json", StringComparison.OrdinalIgnoreCase)) { this.ErrorDetails = SerializationHelper.Deserialize(responseData, null); } #if !SILVERLIGHT else if (response.ContentType.StartsWith("text/xml", StringComparison.OrdinalIgnoreCase)) { // Try to deserialize as XML (specifically OAuth requests) System.Xml.Serialization.XmlSerializer ds = new System.Xml.Serialization.XmlSerializer(typeof(TwitterErrorDetails)); this.ErrorDetails = ds.Deserialize(new MemoryStream(responseData)) as TwitterErrorDetails; } #endif } } #endregion /// /// Gets or sets the result. /// /// The result. public RequestResult Result { get; set; } /// /// Gets or sets the response body. /// /// The response body. public string ResponseBody { get; protected set; } /// /// Gets or sets the rate limits. /// /// The rate limits. public RateLimiting RateLimiting { get; protected set; } /// /// Gets or sets the error details. /// /// The error details. public TwitterErrorDetails ErrorDetails { get; protected set; } /// /// Gets the response that the remote host returned. /// /// /// If a response is available from the Internet resource, a instance that contains the error response from an Internet resource; otherwise, null. public new WebResponse Response { get { return InnerException == null ? null : ((WebException)this.InnerException).Response; } } /// /// Gets the bug report. /// /// The bug report. public string BugReport { get { StringBuilder reportBuilder = new StringBuilder(); reportBuilder.AppendFormat( @" --------------- ERROR MESSAGE --------------- {0} --------------- STACK TRACE ----------------- {1} --------------- RESPONSE BODY --------------- {2} ", this.Message, this.StackTrace, this.ResponseBody); reportBuilder.Append("--------------- HTTP HEADERS ----------------"); for (int i = 0; i < this.Response.Headers.Count; i++) { reportBuilder.AppendFormat( "{0} = \"{1}\"", this.Response.Headers.AllKeys[i], this.Response.Headers[this.Response.Headers.AllKeys[i]]); } return reportBuilder.ToString(); } } /// /// Parses the rate limit headers. /// /// The response. protected void ParseRateLimitHeaders(WebResponse response) { this.RateLimiting = new RateLimiting(); if (response.Headers.AllKeys.Contains("X-RateLimit-Limit") && !string.IsNullOrEmpty(response.Headers["X-RateLimit-Limit"])) { this.RateLimiting.Total = int.Parse(response.Headers["X-RateLimit-Limit"], CultureInfo.InvariantCulture); } if (response.Headers.AllKeys.Contains("X-RateLimit-Remaining") && !string.IsNullOrEmpty(response.Headers["X-RateLimit-Remaining"])) { this.RateLimiting.Remaining = int.Parse(response.Headers["X-RateLimit-Remaining"], CultureInfo.InvariantCulture); } if (!string.IsNullOrEmpty(response.Headers["X-RateLimit-Reset"]) && !string.IsNullOrEmpty(response.Headers["X-RateLimit-Reset"])) { this.RateLimiting.ResetDate = DateTime.SpecifyKind(new DateTime(1970, 1, 1, 0, 0, 0, 0) .AddSeconds(double.Parse(response.Headers["X-RateLimit-Reset"], CultureInfo.InvariantCulture)), DateTimeKind.Utc); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Twitterizer2.snk0000644000175000017500000000112411655552527024264 0ustar00meebeymeebey00000000000000$RSA2y JF! 逴U 1ph`mB=dWb2(HSgXw:8['}S0,* sH3R22~"g%V Rúu4a]Cl2Je/9d\zl A|uA1, \Vb$ȑ+@D ܣV3!$6$FĵxS" iИL Lti2aeekB:mS&ˤ'ex_㇕ԡE&.d-4ޥst:$P SgDŽ /// The twitter response class provides details of the response from an api call to the twitter api. /// /// #if !SILVERLIGHT [Serializable] #endif public class TwitterResponse where T : Core.ITwitterObject { /// /// Gets or sets the object that represents the data returned by the request to Twitter. /// /// The response object. public T ResponseObject { get; set; } /// /// Gets or sets the result of the request. /// /// The result. public RequestResult Result { get; set; } /// /// Gets or sets the request URL. /// /// The request URL. public string RequestUrl { get; set; } /// /// Gets the raw json or xml response provided by Twitter. /// /// The response body. public string Content { get; set; } /// /// Gets or sets the error message returned by the Twitter. /// /// The error message. public string ErrorMessage { get; set; } /// /// Gets or sets the oauth tokens provided for the request. /// /// The tokens. internal OAuthTokens Tokens { get; set; } /// /// Gets or sets the rate limiting details. /// /// The rate limiting object. public RateLimiting RateLimiting { get; set; } /// /// Gets or sets the OAuth Token Access Level details. /// /// The access level. public AccessLevel AccessLevel { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/OAuth/0000755000175000017500000000000012253423361022137 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/OAuth/OAuthTokens.cs0000644000175000017500000001064612132510633024674 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // Contains assembly information. //----------------------------------------------------------------------- namespace Twitterizer { /// #if !SILVERLIGHT [System.Serializable] #endif public class OAuthTokens { /// /// Gets or sets the access token. /// /// The access token. public string AccessToken { internal get; set; } /// /// Gets or sets the access token secret. /// /// The access token secret. public string AccessTokenSecret { internal get; set; } /// /// Gets or sets the consumer key. /// /// The consumer key. public string ConsumerKey { internal get; set; } /// /// Gets or sets the consumer secret. /// /// The consumer secret. public string ConsumerSecret { internal get; set; } /// /// Gets a value indicating whether this instance has consumer token values. /// /// /// true if this instance has consumer token; otherwise, false. /// public bool HasConsumerToken { get { return !string.IsNullOrEmpty(this.ConsumerKey) && !string.IsNullOrEmpty(this.ConsumerSecret); } } /// /// Gets a value indicating whether this instance has access token values. /// /// /// true if this instance has access token; otherwise, false. /// public bool HasAccessToken { get { return !string.IsNullOrEmpty(this.AccessToken) && !string.IsNullOrEmpty(this.AccessTokenSecret); } } /// /// Gets a value indicating whether this instance has values. This does not verify that the values are correct. /// /// /// true if this instance has values; otherwise, false. /// public bool HasBothTokens { get { return this.HasAccessToken && this.HasConsumerToken; } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/OAuth/OAuthTokenResponse.cs0000644000175000017500000000650012132510633026222 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The OAuth token response class. Represents tokens returned by the service. //----------------------------------------------------------------------- namespace Twitterizer { using System; /// /// Values returned by Twitter when getting a request token or an access token. /// #if !SILVERLIGHT [Serializable] #endif public class OAuthTokenResponse { /// /// Gets or sets the token. /// /// The token. public string Token { get; set; } /// /// Gets or sets the token secret. /// /// The token secret. public string TokenSecret { get; set; } /// /// Gets or sets the user ID. /// /// The user ID. public decimal UserId { get; set; } /// /// Gets or sets the screenname. /// /// The screenname. public string ScreenName { get; set; } /// /// Gets or sets the verification string. /// This is required when overriding the application's callback url. /// /// The verification string. public string VerificationString { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/OAuth/OAuthUtility.cs0000644000175000017500000003656012253423361025104 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // Provides simple methods to simplify OAuth interaction. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Text.RegularExpressions; #if !SILVERLIGHT using System.Web; #endif /// public static class OAuthUtility { #region Public Methods /// /// Gets the request token. /// /// The consumer key. /// The consumer secret. /// The callback address. For PIN-based authentication "oob" should be supplied. /// public static OAuthTokenResponse GetRequestToken(string consumerKey, string consumerSecret, string callbackAddress) { if (string.IsNullOrEmpty(consumerKey)) { throw new ArgumentNullException("consumerKey"); } if (string.IsNullOrEmpty(consumerSecret)) { throw new ArgumentNullException("consumerSecret"); } if (string.IsNullOrEmpty(callbackAddress)) { throw new ArgumentNullException("callbackAddress", @"You must always provide a callback url when obtaining a request token. For PIN-based authentication, use ""oob"" as the callback url."); } WebRequestBuilder builder = new WebRequestBuilder( new Uri("https://api.twitter.com/oauth/request_token"), HTTPVerb.POST, new OAuthTokens { ConsumerKey = consumerKey, ConsumerSecret = consumerSecret }); if (!string.IsNullOrEmpty(callbackAddress)) { builder.Parameters.Add("oauth_callback", callbackAddress); } string responseBody = null; try { HttpWebResponse webResponse = builder.ExecuteRequest(); Stream responseStream = webResponse.GetResponseStream(); if (responseStream != null) responseBody = new StreamReader(responseStream).ReadToEnd(); } catch (WebException wex) { throw new TwitterizerException(wex.Message, wex); } return new OAuthTokenResponse { Token = ParseQuerystringParameter("oauth_token", responseBody), TokenSecret = ParseQuerystringParameter("oauth_token_secret", responseBody), VerificationString = ParseQuerystringParameter("oauth_verifier", responseBody) }; } /// /// Tries to the parse querystring parameter. /// /// Name of the parameter. /// The text. /// The value of the parameter or an empty string. /// private static string ParseQuerystringParameter(string parameterName, string text) { Match expressionMatch = Regex.Match(text, string.Format(@"{0}=(?[^&]+)", parameterName)); if (!expressionMatch.Success) { return string.Empty; } return expressionMatch.Groups["value"].Value; } #if !SILVERLIGHT /// /// Gets a new OAuth request token from the twitter api. /// /// The consumer key. /// The consumer secret. /// The callback address. For PIN-based authentication "oob" should be supplied. /// The proxy. /// /// A new instance. /// public static OAuthTokenResponse GetRequestToken(string consumerKey, string consumerSecret, string callbackAddress, WebProxy proxy) { if (string.IsNullOrEmpty(consumerKey)) { throw new ArgumentNullException("consumerKey"); } if (string.IsNullOrEmpty(consumerSecret)) { throw new ArgumentNullException("consumerSecret"); } if (string.IsNullOrEmpty(callbackAddress)) { throw new ArgumentNullException("callbackAddress", @"You must always provide a callback url when obtaining a request token. For PIN-based authentication, use ""oob"" as the callback url."); } WebRequestBuilder builder = new WebRequestBuilder( new Uri("https://api.twitter.com/oauth/request_token"), HTTPVerb.POST, new OAuthTokens { ConsumerKey = consumerKey, ConsumerSecret = consumerSecret }) { Proxy = proxy }; if (!string.IsNullOrEmpty(callbackAddress)) { builder.Parameters.Add("oauth_callback", callbackAddress); } string responseBody = null; try { HttpWebResponse webResponse = builder.ExecuteRequest(); Stream responseStream = webResponse.GetResponseStream(); if (responseStream != null) responseBody = new StreamReader(responseStream).ReadToEnd(); } catch (WebException wex) { throw new TwitterizerException(wex.Message, wex); } Match matchedValues = Regex.Match(responseBody, @"oauth_token=(?[^&]+)|oauth_token_secret=(?[^&]+)|oauth_verifier=(?[^&]+)"); return new OAuthTokenResponse { Token = matchedValues.Groups["token"].Value, TokenSecret = matchedValues.Groups["secret"].Value, VerificationString = matchedValues.Groups["verifier"].Value }; } #endif /// /// Gets the access token. /// /// The consumer key. /// The consumer secret. /// The request token. /// The pin number or verifier string. /// /// An class containing access token information. /// public static OAuthTokenResponse GetAccessToken(string consumerKey, string consumerSecret, string requestToken, string verifier) { if (string.IsNullOrEmpty(consumerKey)) { throw new ArgumentNullException("consumerKey"); } if (string.IsNullOrEmpty(consumerSecret)) { throw new ArgumentNullException("consumerSecret"); } if (string.IsNullOrEmpty(requestToken)) { throw new ArgumentNullException("requestToken"); } WebRequestBuilder builder = new WebRequestBuilder( new Uri("https://api.twitter.com/oauth/access_token"), HTTPVerb.GET, new OAuthTokens { ConsumerKey = consumerKey, ConsumerSecret = consumerSecret }); if (!string.IsNullOrEmpty(verifier)) { builder.Parameters.Add("oauth_verifier", verifier); } builder.Parameters.Add("oauth_token", requestToken); string responseBody; try { HttpWebResponse webResponse = builder.ExecuteRequest(); responseBody = new StreamReader(webResponse.GetResponseStream()).ReadToEnd(); } catch (WebException wex) { throw new TwitterizerException(wex.Message, wex); } OAuthTokenResponse response = new OAuthTokenResponse(); response.Token = Regex.Match(responseBody, @"oauth_token=([^&]+)").Groups[1].Value; response.TokenSecret = Regex.Match(responseBody, @"oauth_token_secret=([^&]+)").Groups[1].Value; response.UserId = long.Parse(Regex.Match(responseBody, @"user_id=([^&]+)").Groups[1].Value, CultureInfo.CurrentCulture); response.ScreenName = Regex.Match(responseBody, @"screen_name=([^&]+)").Groups[1].Value; return response; } #if !SILVERLIGHT /// /// Gets the access token. /// /// The consumer key. /// The consumer secret. /// The request token. /// The pin number or verifier string. /// The proxy. /// /// An class containing access token information. /// public static OAuthTokenResponse GetAccessToken(string consumerKey, string consumerSecret, string requestToken, string verifier, WebProxy proxy) { if (string.IsNullOrEmpty(consumerKey)) { throw new ArgumentNullException("consumerKey"); } if (string.IsNullOrEmpty(consumerSecret)) { throw new ArgumentNullException("consumerSecret"); } if (string.IsNullOrEmpty(requestToken)) { throw new ArgumentNullException("requestToken"); } WebRequestBuilder builder = new WebRequestBuilder( new Uri("https://api.twitter.com/oauth/access_token"), HTTPVerb.GET, new OAuthTokens { ConsumerKey = consumerKey, ConsumerSecret = consumerSecret }); builder.Proxy = proxy; if (!string.IsNullOrEmpty(verifier)) { builder.Parameters.Add("oauth_verifier", verifier); } builder.Parameters.Add("oauth_token", requestToken); string responseBody; try { HttpWebResponse webResponse = builder.ExecuteRequest(); responseBody = new StreamReader(webResponse.GetResponseStream()).ReadToEnd(); } catch (WebException wex) { throw new TwitterizerException(wex.Message, wex); } OAuthTokenResponse response = new OAuthTokenResponse(); response.Token = Regex.Match(responseBody, @"oauth_token=([^&]+)").Groups[1].Value; response.TokenSecret = Regex.Match(responseBody, @"oauth_token_secret=([^&]+)").Groups[1].Value; response.UserId = long.Parse(Regex.Match(responseBody, @"user_id=([^&]+)").Groups[1].Value, CultureInfo.CurrentCulture); response.ScreenName = Regex.Match(responseBody, @"screen_name=([^&]+)").Groups[1].Value; return response; } #endif #endregion /// /// Builds the authorization URI. /// /// The request token. /// A new instance. public static Uri BuildAuthorizationUri(string requestToken) { return BuildAuthorizationUri(requestToken, false); } /// /// Builds the authorization URI. /// /// The request token. /// if set to true, the authenticate url will be used. (See: "Sign in with Twitter") /// A new instance. public static Uri BuildAuthorizationUri(string requestToken, bool authenticate) { StringBuilder parameters = new StringBuilder("https://twitter.com/oauth/"); if (authenticate) { parameters.Append("authenticate"); } else { parameters.Append("authorize"); } parameters.AppendFormat("?oauth_token={0}", requestToken); return new Uri(parameters.ToString()); } #if !LITE && !SILVERLIGHT /// /// Adds the OAuth Echo header to the supplied web request. /// /// The request. /// The tokens. public static void AddOAuthEchoHeader(WebRequest request, OAuthTokens tokens) { WebRequestBuilder builder = new WebRequestBuilder( new Uri("https://api.twitter.com/1.1/account/verify_credentials.json"), HTTPVerb.POST, tokens); builder.PrepareRequest(); request.Headers.Add("X-Verify-Credentials-Authorization", builder.GenerateAuthorizationHeader()); request.Headers.Add("X-Auth-Service-Provider", "https://api.twitter.com/1.1/account/verify_credentials.json"); } #endif } } smuxi-0.11/lib/Twitterizer/Twitterizer2/OAuth/WebRequestBuilder.cs0000644000175000017500000006324112253423361026071 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // Provides the means of preparing and executing Anonymous and OAuth signed web requests. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.IO; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Net; using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; #if SILVERLIGHT using System.Net.Browser; using System.Threading; using System.Windows.Threading; #endif /// /// Enumeration of the supported HTTP verbs supported by the /// public enum HTTPVerb { /// /// The HTTP GET method is used to retrieve data. /// GET, /// /// The HTTP POST method is used to transmit data. /// POST, /// /// The HTTP DELETE method is used to indicate that a resource should be deleted. /// DELETE } /// /// The Web Request Builder class. /// public sealed class WebRequestBuilder { /// /// Holds file data form performing multipart form posts. /// private byte[] formData; /// /// The HTTP Authorization realm. /// public const string Realm = "Twitter API"; /// /// Gets or sets the request URI. /// /// The request URI. public Uri RequestUri { get; set; } /// /// Gets or sets the parameters. /// /// The parameters. public Dictionary Parameters { get; private set; } /// /// Gets or sets the verb. /// /// The verb. public HTTPVerb Verb { get; set; } /// /// Gets or sets the oauth tokens. /// /// The tokens. public OAuthTokens Tokens { private get; set; } /// /// Gets or sets the UserAgent. /// /// The User Agent. private readonly string userAgent; /// /// Gets or sets the Basic Auth Credentials. /// /// The Basic Auth Credentials. private readonly NetworkCredential networkCredentials; /// /// Gets or sets the Multipart config /// /// Multipart public bool Multipart { get; set; } /// /// Gets or sets whether to use accept compression on this request /// /// UseCompression public bool UseCompression { get; set; } #if !SILVERLIGHT /// /// Gets or sets the proxy. /// /// The proxy. public WebProxy Proxy { get; set; } #endif /// /// Gets or sets a value indicating whether the request will be signed with an OAuth authorization header. /// /// true if [use O auth]; otherwise, false. public bool UseOAuth { get; private set; } /// /// OAuth Parameters key names to include in the Authorization header. /// private static readonly string[] OAuthParametersToIncludeInHeader = new[] { "oauth_version", "oauth_nonce", "oauth_timestamp", "oauth_signature_method", "oauth_consumer_key", "oauth_token", "oauth_verifier" // Leave signature omitted from the list, it is added manually // "oauth_signature", }; /// /// Parameters that may appear in the list, but should never be included in the header or the request. /// private static readonly string[] SecretParameters = new[] { "oauth_consumer_secret", "oauth_token_secret", "oauth_signature" }; /// /// Initializes a new instance of the class. /// /// The request URI. /// The http verb. /// The http user agent. /// The network credentials. /// public WebRequestBuilder(Uri requestUri, HTTPVerb verb, String userAgent, NetworkCredential networkCredentials) { if (requestUri == null) throw new ArgumentNullException("requestUri"); this.RequestUri = requestUri; this.Verb = verb; this.userAgent = userAgent; this.UseOAuth = false; if (networkCredentials != null) this.networkCredentials = networkCredentials; this.Parameters = new Dictionary(); if (string.IsNullOrEmpty(this.RequestUri.Query)) return; foreach (Match item in Regex.Matches(this.RequestUri.Query, @"(?[^&?=]+)=(?[^&?=]+)")) { this.Parameters.Add(item.Groups["key"].Value, item.Groups["value"].Value); } this.RequestUri = new Uri(this.RequestUri.AbsoluteUri.Replace(this.RequestUri.Query, "")); } /// /// Initializes a new instance of the class. /// /// The request URI. /// The verb. /// The tokens. /// The user agent. public WebRequestBuilder(Uri requestUri, HTTPVerb verb, OAuthTokens tokens, string userAgent = "") : this(requestUri, verb, userAgent, null) { this.Tokens = tokens; if (tokens != null) { if (string.IsNullOrEmpty(this.Tokens.ConsumerKey) || string.IsNullOrEmpty(this.Tokens.ConsumerSecret)) { throw new ArgumentException("Consumer key and secret are required for OAuth requests."); } if (string.IsNullOrEmpty(this.Tokens.AccessToken) ^ string.IsNullOrEmpty(this.Tokens.AccessTokenSecret)) { throw new ArgumentException("The access token is invalid. You must specify the key AND secret values."); } this.UseOAuth = true; } } /// /// Executes the request. /// /// public HttpWebResponse ExecuteRequest() { HttpWebRequest request = PrepareRequest(); #if !SILVERLIGHT return (HttpWebResponse)request.GetResponse(); #else request.AllowReadStreamBuffering = true; HttpWebResponse response = null; AutoResetEvent alldone = new AutoResetEvent(false); request.BeginGetResponse(param => { HttpWebRequest req = (HttpWebRequest)param.AsyncState; try { response = (HttpWebResponse)req.EndGetResponse(param); } catch (WebException we) { response = (HttpWebResponse)we.Response; } finally { alldone.Set(); } }, request); alldone.WaitOne(); return response; #endif } /// /// Prepares the request. It is not nessisary to call this method unless additional configuration is required. /// /// A object fully configured and ready for execution. public HttpWebRequest PrepareRequest() { SetupOAuth(); formData = null; string contentType = string.Empty; if (!Multipart) { //We don't add the parameters to the query if we are multipart-ing AddQueryStringParametersToUri(); } else { string dataBoundary = "--------------------r4nd0m"; contentType = "multipart/form-data; boundary=" + dataBoundary; formData = GetMultipartFormData(Parameters, dataBoundary); this.Verb = HTTPVerb.POST; } HttpWebRequest request; #if SILVERLIGHT request = (HttpWebRequest)WebRequestCreator.ClientHttp.Create(this.RequestUri); if (this.RequestUri.Host.Contains("search.twitter.com") || this.RequestUri.Host.Contains("api.twitter.com")) //-- DG HACK FOR TWITTER QUERIES TO FIX BAD COOKIE DOMAIN= DATA BEING RETURNED FROM TWITTER. { request.CookieContainer = new CookieContainer(); request.CookieContainer.Add(this.RequestUri, new Cookie("k", "Twitterizer hack for bad twitter cookie")); } #else request = (HttpWebRequest)WebRequest.Create(this.RequestUri); if (this.UseCompression == true) request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; else request.AutomaticDecompression = DecompressionMethods.None; if (this.Proxy != null) request.Proxy = Proxy; #endif if (!this.UseOAuth && this.networkCredentials != null) { request.Credentials = this.networkCredentials; request.UseDefaultCredentials = false; } else { request.UseDefaultCredentials = true; } request.Method = this.Verb.ToString(); request.ContentLength = Multipart ? ((formData != null) ? formData.Length: 0) : 0; #if !SILVERLIGHT // No silverlight user-agent as Assembly.GetName() isn't supported and setting the request.UserAgent is also not supported. request.UserAgent = (string.IsNullOrEmpty(userAgent)) ? string.Format(CultureInfo.InvariantCulture, "Twitterizer/{0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version) : userAgent; request.ServicePoint.Expect100Continue = false; #endif if (this.UseOAuth) { #if !SILVERLIGHT request.Headers.Add("Authorization", GenerateAuthorizationHeader()); #else request.Headers["Authorization"] = GenerateAuthorizationHeader(); #endif } if (Multipart) { //Parameters are not added to the query string, post them in the request body instead request.ContentType = contentType; #if !SILVERLIGHT using (Stream requestStream = request.GetRequestStream()) #else IAsyncResult getRequestStreamResult = request.BeginGetRequestStream( res => { }, null); using (Stream requestStream = request.EndGetRequestStream(getRequestStreamResult)) #endif { if (formData != null) { requestStream.Write(formData, 0, formData.Length); } } } return request; } /// /// Adds the parameters to request uri. /// private void AddQueryStringParametersToUri() { StringBuilder requestParametersBuilder = new StringBuilder(this.RequestUri.AbsoluteUri); requestParametersBuilder.Append(this.RequestUri.Query.Length == 0 ? "?" : "&"); Dictionary fieldsToInclude = new Dictionary(this.Parameters.Where(p => !OAuthParametersToIncludeInHeader.Contains(p.Key) && !SecretParameters.Contains(p.Key)).ToDictionary(p => p.Key, p => p.Value)); foreach (KeyValuePair item in fieldsToInclude) { if (item.Value is string) requestParametersBuilder.AppendFormat("{0}={1}&", item.Key, UrlEncode((string)item.Value)); } if (requestParametersBuilder.Length == 0) return; requestParametersBuilder.Remove(requestParametersBuilder.Length - 1, 1); this.RequestUri = new Uri(requestParametersBuilder.ToString()); } private byte[] GetMultipartFormData(Dictionary param, string boundary) { Stream formDataStream = new MemoryStream(); Encoding encoding = Encoding.UTF8; Dictionary fieldsToInclude = new Dictionary(param.Where(p => !OAuthParametersToIncludeInHeader.Contains(p.Key) && !SecretParameters.Contains(p.Key)).ToDictionary(p => p.Key, p => p.Value)); foreach (KeyValuePair kvp in fieldsToInclude) { if (kvp.Value.GetType() == typeof(byte[])) { //assume this to be a byte stream byte[] data = (byte[])kvp.Value; string header = string.Format("--{0}\r\nContent-Disposition: form-data; name=\"{1}\"; filename=\"{2}\";\r\nContent-Type: application/octet-stream\r\n\r\n", boundary, kvp.Key, kvp.Key); byte[] headerBytes = encoding.GetBytes(header); formDataStream.Write(headerBytes, 0, headerBytes.Length); formDataStream.Write(data, 0, data.Length); } else { //this is normal text data string header = string.Format("--{0}\r\nContent-Disposition: form-data; name=\"{1}\"\r\n\r\n{2}\r\n", boundary, kvp.Key, kvp.Value); byte[] headerBytes = encoding.GetBytes(header); formDataStream.Write(headerBytes, 0, headerBytes.Length); } } string footer = string.Format("\r\n--{0}--\r\n", boundary); formDataStream.Write(encoding.GetBytes(footer), 0, footer.Length); formDataStream.Position = 0; byte[] returndata = new byte[formDataStream.Length]; formDataStream.Read(returndata, 0, returndata.Length); formDataStream.Close(); return returndata; } #region OAuth Helper Methods /// /// Sets up the OAuth request details. /// private void SetupOAuth() { // We only sign oauth requests if (!this.UseOAuth) { return; } // Add the OAuth parameters this.Parameters.Add("oauth_version", "1.0"); this.Parameters.Add("oauth_nonce", GenerateNonce()); this.Parameters.Add("oauth_timestamp", GenerateTimeStamp()); this.Parameters.Add("oauth_signature_method", "HMAC-SHA1"); this.Parameters.Add("oauth_consumer_key", this.Tokens.ConsumerKey); this.Parameters.Add("oauth_consumer_secret", this.Tokens.ConsumerSecret); if (!string.IsNullOrEmpty(this.Tokens.AccessToken)) { this.Parameters.Add("oauth_token", this.Tokens.AccessToken); } if (!string.IsNullOrEmpty(this.Tokens.AccessTokenSecret)) { this.Parameters.Add("oauth_token_secret", this.Tokens.AccessTokenSecret); } string signature = GenerateSignature(); // Add the signature to the oauth parameters this.Parameters.Add("oauth_signature", signature); } /// /// Generates the signature. /// /// public string GenerateSignature() { IEnumerable> nonSecretParameters; if (Multipart) { nonSecretParameters = (from p in this.Parameters where (!SecretParameters.Contains(p.Key) && p.Key.StartsWith("oauth_")) select p); } else { nonSecretParameters = (from p in this.Parameters where (!SecretParameters.Contains(p.Key)) select p); } Uri urlForSigning = this.RequestUri; // Create the base string. This is the string that will be hashed for the signature. string signatureBaseString = string.Format( CultureInfo.InvariantCulture, "{0}&{1}&{2}", this.Verb.ToString().ToUpper(CultureInfo.InvariantCulture), UrlEncode(NormalizeUrl(urlForSigning)), UrlEncode(nonSecretParameters)); // Create our hash key (you might say this is a password) string key = string.Format( CultureInfo.InvariantCulture, "{0}&{1}", UrlEncode(this.Tokens.ConsumerSecret), UrlEncode(this.Tokens.AccessTokenSecret)); // Generate the hash HMACSHA1 hmacsha1 = new HMACSHA1(Encoding.UTF8.GetBytes(key)); byte[] signatureBytes = hmacsha1.ComputeHash(Encoding.UTF8.GetBytes(signatureBaseString)); return Convert.ToBase64String(signatureBytes); } /// /// Generate the timestamp for the signature /// /// A timestamp value in a string. public static string GenerateTimeStamp() { // Default implementation of UNIX time of the current UTC time TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0); return Convert.ToInt64(ts.TotalSeconds, CultureInfo.CurrentCulture).ToString(CultureInfo.CurrentCulture); } /// /// Generate a nonce /// /// A random number between 123400 and 9999999 in a string. public static string GenerateNonce() { // Just a simple implementation of a random number between 123400 and 9999999 return new Random() .Next(123400, int.MaxValue) .ToString("X", CultureInfo.InvariantCulture); } /// /// Normalizes the URL. /// /// The URL to normalize. /// The normalized url string. public static string NormalizeUrl(Uri url) { string normalizedUrl = string.Format(CultureInfo.InvariantCulture, "{0}://{1}", url.Scheme, url.Host); if (!((url.Scheme == "http" && url.Port == 80) || (url.Scheme == "https" && url.Port == 443))) { normalizedUrl += ":" + url.Port; } normalizedUrl += url.AbsolutePath; return normalizedUrl; } /// /// Encodes a value for inclusion in a URL querystring. /// /// The value to Url encode /// Returns a Url encoded string public static string UrlEncode(string value) { if (string.IsNullOrEmpty(value)) { return string.Empty; } value = Uri.EscapeDataString(value); // UrlEncode escapes with lowercase characters (e.g. %2f) but oAuth needs %2F value = Regex.Replace(value, "(%[0-9a-f][0-9a-f])", c => c.Value.ToUpper()); // these characters are not escaped by UrlEncode() but needed to be escaped value = value .Replace("(", "%28") .Replace(")", "%29") .Replace("$", "%24") .Replace("!", "%21") .Replace("*", "%2A") .Replace("'", "%27"); // these characters are escaped by UrlEncode() but will fail if unescaped! value = value.Replace("%7E", "~"); return value; } /// /// Encodes a series of key/value pairs for inclusion in a URL querystring. /// /// The parameters. /// A string of all the keys and value pairs with the values encoded. private static string UrlEncode(IEnumerable> parameters) { StringBuilder parameterString = new StringBuilder(); var paramsSorted = from p in parameters orderby p.Key, p.Value select p; foreach (var item in paramsSorted) { if (item.Value is string) { if (parameterString.Length > 0) { parameterString.Append("&"); } parameterString.Append( string.Format( CultureInfo.InvariantCulture, "{0}={1}", UrlEncode(item.Key), UrlEncode((string)item.Value))); } } return UrlEncode(parameterString.ToString()); } /// /// Generates the authorization header. /// /// The string value of the HTTP header to be included for OAuth requests. public string GenerateAuthorizationHeader() { StringBuilder authHeaderBuilder = new StringBuilder(); authHeaderBuilder.AppendFormat("OAuth realm=\"{0}\"", Realm); var sortedParameters = from p in this.Parameters where OAuthParametersToIncludeInHeader.Contains(p.Key) orderby p.Key, UrlEncode( (p.Value is string) ? (string)p.Value : string.Empty) select p; foreach (var item in sortedParameters) { authHeaderBuilder.AppendFormat( ",{0}=\"{1}\"", UrlEncode(item.Key), UrlEncode(item.Value as string)); } authHeaderBuilder.AppendFormat(",oauth_signature=\"{0}\"", UrlEncode(this.Parameters["oauth_signature"] as string)); return authHeaderBuilder.ToString(); } #endregion } } smuxi-0.11/lib/Twitterizer/Twitterizer2/OAuth/XAuthUtility.cs0000644000175000017500000001175112253423361025110 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The xAuth Utility Class //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text.RegularExpressions; using Twitterizer.Core; /// /// The XAuthUtility class. /// public static class XAuthUtility { /// /// Allows OAuth applications to directly exchange Twitter usernames and passwords for OAuth access tokens and secrets. /// /// The consumer key. /// The consumer secret. /// The username. /// The password. /// A instance. public static OAuthTokenResponse GetAccessTokens(string consumerKey, string consumerSecret, string username, string password) { if (string.IsNullOrEmpty(consumerKey)) { throw new ArgumentNullException("consumerKey"); } if (string.IsNullOrEmpty(consumerSecret)) { throw new ArgumentNullException("consumerSecret"); } if (string.IsNullOrEmpty(username)) { throw new ArgumentNullException("username"); } if (string.IsNullOrEmpty(password)) { throw new ArgumentNullException("password"); } OAuthTokenResponse response = new OAuthTokenResponse(); try { WebRequestBuilder builder = new WebRequestBuilder( new Uri("https://api.twitter.com/oauth/access_token"), HTTPVerb.POST, new OAuthTokens { ConsumerKey = consumerKey, ConsumerSecret = consumerSecret }); builder.Parameters.Add("x_auth_username", username); builder.Parameters.Add("x_auth_password", password); builder.Parameters.Add("x_auth_mode", "client_auth"); string responseBody = new StreamReader(builder.ExecuteRequest().GetResponseStream()).ReadToEnd(); response.Token = Regex.Match(responseBody, @"oauth_token=([^&]+)").Groups[1].Value; response.TokenSecret = Regex.Match(responseBody, @"oauth_token_secret=([^&]+)").Groups[1].Value; if (responseBody.Contains("user_id=")) response.UserId = long.Parse(Regex.Match(responseBody, @"user_id=([^&]+)").Groups[1].Value, CultureInfo.CurrentCulture); response.ScreenName = Regex.Match(responseBody, @"screen_name=([^&]+)").Groups[1].Value; } catch (WebException wex) { throw new TwitterizerException(wex.Message, wex); } return response; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Properties/0000755000175000017500000000000012253423361023253 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Properties/AssemblyInfo.cs0000644000175000017500000000435012253423361026177 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // //----------------------------------------------------------------------- using System.Runtime.InteropServices; // Uncomment this line for building a .NET 4.0 assembly // [assembly: SecurityRules(SecurityRuleSet.Level1)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e8e37171-9c87-46e0-9e2e-c16c3ff570a5")]smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/0000755000175000017500000000000012132510633022515 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Spam/0000755000175000017500000000000012253423361023422 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Spam/ReportSpamCommand.cs0000644000175000017500000000757112132510633027351 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The TwitterAccount class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System.Globalization; using Twitterizer.Core; using System; internal class ReportSpamCommand : TwitterCommand { /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; set; } /// /// Gets or sets the name of the screen. /// /// The name of the screen. public string ScreenName { get; set; } /// /// Initializes a new instance of the class. /// /// The tokens. /// The user id. /// Name of the screen. /// The options. public ReportSpamCommand(OAuthTokens tokens, decimal userId, string screenName, OptionalProperties options) : base(HTTPVerb.POST, "report_spam.json", tokens, options) { if (string.IsNullOrEmpty(screenName) && userId <= 0) { throw new ArgumentException("A screen name or user id is required."); } this.ScreenName = screenName; this.UserId = userId; } /// /// Inits this instance. /// public override void Init() { if (this.UserId > 0) { this.RequestParameters.Add("user_id", this.UserId.ToString(CultureInfo.InvariantCulture)); } else if (!string.IsNullOrEmpty(this.ScreenName)) { this.RequestParameters.Add("screen_name", this.ScreenName); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Spam/TwitterSpam.cs0000644000175000017500000001063012253423361026234 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The TwitterSpam class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// Provides methods for reporting users and tweets as inappropriate or spam. /// public class TwitterSpam { /// /// Blocks the user and reports them for spam/abuse. /// /// The tokens. /// The user id. /// The options. /// The user details. public static TwitterResponse ReportUser(OAuthTokens tokens, decimal userId, OptionalProperties options) { Commands.ReportSpamCommand command = new Commands.ReportSpamCommand(tokens, userId, string.Empty, options); return Core.CommandPerformer.PerformAction(command); } /// /// Blocks the user and reports them for spam/abuse. /// /// The tokens. /// The user id. /// The user details. public static TwitterResponse ReportUser(OAuthTokens tokens, decimal userId) { return ReportUser(tokens, userId, null); } /// /// Blocks the user and reports them for spam/abuse. /// /// The tokens. /// The user's screen name. /// The options. /// The user details. public static TwitterResponse ReportUser(OAuthTokens tokens, string screenName, OptionalProperties options) { Commands.ReportSpamCommand command = new Commands.ReportSpamCommand(tokens, 0, screenName, options); return Core.CommandPerformer.PerformAction(command); } /// /// Blocks the user and reports them for spam/abuse. /// /// The tokens. /// The user's screen name. /// The user details. public static TwitterResponse ReportUser(OAuthTokens tokens, string screenName) { return ReportUser(tokens, screenName, null); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Notification/0000755000175000017500000000000012132510633025143 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Notification/TwitterNotification.cs0000644000175000017500000001616712132510633031516 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter notification class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// Provides methods to update a user's preferences on notifications. For example, whether a user will be notified on mention via SMS. /// public static class TwitterNotification { /// /// Enables device notifications for updates from the specified user. Returns the specified user when successful. /// /// The tokens. /// The user id. /// The options. /// public static TwitterResponse Follow(OAuthTokens tokens, decimal userId, OptionalProperties options) { Commands.NotificationFollowCommand command = new Commands.NotificationFollowCommand(tokens, userId, string.Empty, options); return Core.CommandPerformer.PerformAction(command); } /// /// Enables device notifications for updates from the specified user. Returns the specified user when successful. /// /// The tokens. /// The user id. /// public static TwitterResponse Follow(OAuthTokens tokens, decimal userId) { return Follow(tokens, userId, null); } /// /// Enables device notifications for updates from the specified user. Returns the specified user when successful. /// /// The tokens. /// The user's screen name. /// The options. /// public static TwitterResponse Follow(OAuthTokens tokens, string screenName, OptionalProperties options) { Commands.NotificationFollowCommand command = new Commands.NotificationFollowCommand(tokens, 0, screenName, options); return Core.CommandPerformer.PerformAction(command); } /// /// Enables device notifications for updates from the specified user. Returns the specified user when successful. /// /// The tokens. /// The user's screen name. /// public static TwitterResponse Follow(OAuthTokens tokens, string screenName) { return Follow(tokens, screenName, null); } /// /// Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. /// /// The tokens. /// The user id. /// The options. /// public static TwitterResponse Leave(OAuthTokens tokens, decimal userId, OptionalProperties options) { Commands.NotificationLeaveCommand command = new Commands.NotificationLeaveCommand(tokens, userId, string.Empty, options); return Core.CommandPerformer.PerformAction(command); } /// /// Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. /// /// The tokens. /// The user id. /// public static TwitterResponse Leave(OAuthTokens tokens, decimal userId) { return Follow(tokens, userId, null); } /// /// Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. /// /// The tokens. /// The user's screen name. /// The options. /// public static TwitterResponse Leave(OAuthTokens tokens, string screenName, OptionalProperties options) { Commands.NotificationLeaveCommand command = new Commands.NotificationLeaveCommand(tokens, 0, screenName, options); return Core.CommandPerformer.PerformAction(command); } /// /// Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. /// /// The tokens. /// The user's screen name. /// public static TwitterResponse Leave(OAuthTokens tokens, string screenName) { return Follow(tokens, screenName, null); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Notification/NotificationLeaveCommand.cs0000644000175000017500000001012412132510633032372 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The notification leave command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The notification leave command class. /// sealed class NotificationLeaveCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The user id. /// Name of the screen. /// The options. public NotificationLeaveCommand(OAuthTokens tokens, decimal userId, string screenName, OptionalProperties options) : base(HTTPVerb.POST, "notifications/leave.json", tokens, options) { if (userId <= 0 && string.IsNullOrEmpty(screenName)) { throw new ArgumentNullException("userId", "User ID or Screen name must be supplied"); } this.UserId = userId; this.ScreenName = screenName; } /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; set; } /// /// Gets or sets the name of the screen. /// /// The name of the screen. public string ScreenName { get; set; } /// /// Inits this instance. /// public override void Init() { this.RequestParameters.Add("include_entities", "true"); if (this.UserId > 0) { this.RequestParameters.Add("user_id", this.UserId.ToString(CultureInfo.CurrentCulture)); } if (!string.IsNullOrEmpty(this.ScreenName)) { this.RequestParameters.Add("screen_name", this.ScreenName); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Notification/NotificationFollowCommand.cs0000644000175000017500000001013212132510633032577 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The notification follow command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The notification follow command class. /// sealed class NotificationFollowCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The user id. /// Name of the screen. /// The options. public NotificationFollowCommand(OAuthTokens tokens, decimal userId, string screenName, OptionalProperties options) : base(HTTPVerb.POST, "notifications/follow.json", tokens, options) { if (userId <= 0 && string.IsNullOrEmpty(screenName)) { throw new ArgumentNullException("userId", "User ID or Screen name must be supplied"); } this.UserId = userId; this.ScreenName = screenName; } /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; set; } /// /// Gets or sets the name of the screen. /// /// The name of the screen. public string ScreenName { get; set; } /// /// Inits this instance. /// public override void Init() { this.RequestParameters.Add("include_entities", "true"); if (this.UserId > 0) { this.RequestParameters.Add("user_id", this.UserId.ToString(CultureInfo.CurrentCulture)); } if (!string.IsNullOrEmpty(this.ScreenName)) { this.RequestParameters.Add("screen_name", this.ScreenName); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/0000755000175000017500000000000012253423361023435 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/GetListSubscriptionsOptions.cs0000644000175000017500000000473112132510633031503 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The get list subscriptions options class //----------------------------------------------------------------------- namespace Twitterizer { /// /// The optional parameters for the class. /// public class GetListSubscriptionsOptions : OptionalProperties { /// /// Gets or sets the cursor. /// /// The cursor. public long Cursor { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/TwitterList.cs0000644000175000017500000006543412253423361026276 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter list entity class //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Diagnostics; using System.Runtime.Serialization; using Newtonsoft.Json; using Twitterizer.Core; /// /// The twitter list entity class /// [JsonObject(MemberSerialization = MemberSerialization.OptIn)] [DebuggerDisplay("TwitterList = {FullName}")] #if !SILVERLIGHT [Serializable] #endif [DataContract] public class TwitterList : TwitterObject { #region API properties /// /// Gets or sets the id. /// /// The list id. [JsonProperty(PropertyName = "id")] [DataMember] public long Id { get; set; } /// /// Gets or sets the name. /// /// The list name. [JsonProperty(PropertyName = "name")] [DataMember] public string Name { get; set; } /// /// Gets or sets the full name. /// /// The full name. [JsonProperty(PropertyName = "full_name")] [DataMember] public string FullName { get; set; } /// /// Gets or sets the slug. /// /// The list slug. [JsonProperty(PropertyName = "slug")] [DataMember] public string Slug { get; set; } /// /// Gets or sets the description. /// /// The description. [JsonProperty(PropertyName = "description")] [DataMember] public string Description { get; set; } /// /// Gets or sets the number of subscribers. /// /// The number of subscribers. [JsonProperty(PropertyName = "subscriber_count")] [DataMember] public int NumberOfSubscribers { get; set; } /// /// Gets or sets the number of members. /// /// The number of members. [JsonProperty(PropertyName = "member_count")] [DataMember] public int NumberOfMembers { get; set; } /// /// Gets or sets the absolute path. /// /// The absolute path. [JsonProperty(PropertyName = "uri")] [DataMember] public string AbsolutePath { get; set; } /// /// Gets or sets the mode. /// /// The list mode. [JsonProperty(PropertyName = "mode")] [DataMember] public string Mode { get; set; } /// /// Gets or sets the user that owns the list. /// /// The owning user. [JsonProperty(PropertyName = "user")] [DataMember] public TwitterUser User { get; set; } #endregion #region Calculated Properties /// /// Gets a value indicating whether this instance is public. /// /// true if this instance is public; otherwise, false. [DataMember] public bool IsPublic { get { return this.Mode == "public"; } } #endregion /// /// Creates a new list for the authenticated user. Accounts are limited to 20 lists. /// /// The oauth tokens. /// The username. /// The list name. /// if set to true creates a public list. /// The description. /// The options. /// A instance. [Obsolete("The username parameter is no longer required.")] public static TwitterResponse New(OAuthTokens tokens, string username, string name, bool isPublic, string description, OptionalProperties options) { return New(tokens, name, isPublic, description, options); } /// /// Creates a new list for the authenticated user. Accounts are limited to 20 lists. /// /// The oauth tokens. /// The list name. /// if set to true creates a public list. /// The description. /// The options. /// A instance. public static TwitterResponse New(OAuthTokens tokens, string name, bool isPublic, string description, OptionalProperties options) { Commands.CreateListCommand command = new Twitterizer.Commands.CreateListCommand(tokens, name, options) { IsPublic = isPublic, Description = description }; return Core.CommandPerformer.PerformAction(command); } /// /// Creates a new list for the authenticated user. Accounts are limited to 20 lists. /// /// The oauth tokens. /// The username. /// The list name. /// if set to true creates a public list. /// The description. /// A instance. /// public static TwitterResponse New(OAuthTokens tokens, string username, string name, bool isPublic, string description) { return New(tokens, name, isPublic, description, null); } /// /// Updates the specified list. /// /// The oauth tokens. /// The username. /// The list id. /// The options. /// A instance. [Obsolete("The username parameter is no longer required.")] public static TwitterResponse Update(OAuthTokens tokens, string username, string listId, UpdateListOptions options) { return Update(tokens, listId, options); } /// /// Updates the specified list. /// /// The oauth tokens. /// The list id. /// The options. /// A instance. /// public static TwitterResponse Update(OAuthTokens tokens, string listId, UpdateListOptions options) { Commands.UpdateListCommand command = new Twitterizer.Commands.UpdateListCommand(tokens, listId, options); return Core.CommandPerformer.PerformAction(command); } /// /// List the lists of the specified user. Private lists will be included if the authenticated users is the same as the user who's lists are being returned. /// /// The tokens. /// The options. /// /// A instance. /// public static TwitterResponse GetLists(OAuthTokens tokens, GetListsOptions options = null) { Commands.GetListsCommand command = new Twitterizer.Commands.GetListsCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns the specified list. Private lists will only be shown if the authenticated user owns the specified list. /// /// The tokens. /// The slug. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, string slug) { return Show(tokens, slug, null); } /// /// Returns the specified list. Private lists will only be shown if the authenticated user owns the specified list. /// /// The tokens. /// The slug. /// The options. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, string slug, OptionalProperties options) { Commands.GetListCommand command = new Twitterizer.Commands.GetListCommand(tokens, slug, -1, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns the specified list. Private lists will only be shown if the authenticated user owns the specified list. /// /// The tokens. /// The list id. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, decimal listId) { return Show(tokens, listId, null); } /// /// Returns the specified list. Private lists will only be shown if the authenticated user owns the specified list. /// /// The tokens. /// The list id. /// The options. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, decimal listId, OptionalProperties options) { Commands.GetListCommand command = new Twitterizer.Commands.GetListCommand(tokens, string.Empty, listId, options); return Core.CommandPerformer.PerformAction(command); } /// /// Deletes the specified list. Must be owned by the authenticated user. /// /// The tokens. /// The username. /// The list id or slug. /// The options. /// A instance. public static TwitterResponse Delete(OAuthTokens tokens, string username, string listIdOrSlug, OptionalProperties options) { Commands.DeleteListCommand command = new Twitterizer.Commands.DeleteListCommand(tokens, username, listIdOrSlug, options); return Core.CommandPerformer.PerformAction(command); } /// /// Show tweet timeline for members of the specified list. /// /// The tokens. /// The username. /// The list id or slug. /// The options. /// /// A instance. /// public static TwitterResponse GetStatuses(OAuthTokens tokens, string username, string listIdOrSlug, ListStatusesOptions options) { Commands.ListStatusesCommand command = new Twitterizer.Commands.ListStatusesCommand(tokens, username, listIdOrSlug, options); return Core.CommandPerformer.PerformAction(command); } /// /// List the lists the specified user has been added to. /// /// The tokens. /// The screenname. /// The options. /// /// A instance. /// public static TwitterResponse GetMemberships(OAuthTokens tokens, string screenname, ListMembershipsOptions options) { Commands.ListMembershipsCommand command = new Twitterizer.Commands.ListMembershipsCommand(tokens, screenname, options); return Core.CommandPerformer.PerformAction(command); } /// /// List the lists the specified user has been added to. /// /// The tokens. /// The screenname. /// /// A instance. /// public static TwitterResponse GetMemberships(OAuthTokens tokens, string screenname) { return GetMemberships(tokens, screenname, null); } /// /// List the lists the specified user has been added to. /// /// The tokens. /// The userid. /// The options. /// /// A instance. /// public static TwitterResponse GetMemberships(OAuthTokens tokens, decimal userid, ListMembershipsOptions options) { Commands.ListMembershipsCommand command = new Twitterizer.Commands.ListMembershipsCommand(tokens, userid, options); return Core.CommandPerformer.PerformAction(command); } /// /// List the lists the specified user has been added to. /// /// The tokens. /// The userid. /// /// A instance. /// public static TwitterResponse GetMemberships(OAuthTokens tokens, decimal userid) { return GetMemberships(tokens, userid, null); } /// /// List the lists the specified user follows. /// /// The tokens. /// Name of the user. /// The options. /// /// A instance. /// public static TwitterResponse GetSubscriptions(OAuthTokens tokens, string userName, GetListSubscriptionsOptions options) { Commands.GetListSubscriptionsCommand command = new Twitterizer.Commands.GetListSubscriptionsCommand(tokens, userName, options); return Core.CommandPerformer.PerformAction(command); } /// /// List the lists the specified user follows. /// /// The tokens. /// Name of the user. /// /// A instance. /// public static TwitterResponse GetSubscriptions(OAuthTokens tokens, string userName) { return GetSubscriptions(tokens, userName, null); } /// /// Returns the members of the specified list. /// /// The tokens. /// The username. /// The list id or slug. /// The options. /// /// A collection of users as . /// public static TwitterResponse GetMembers(OAuthTokens tokens, string username, string listIdOrSlug, GetListMembersOptions options) { Commands.GetListMembersCommand command = new Twitterizer.Commands.GetListMembersCommand(tokens, username, listIdOrSlug, options); return CommandPerformer.PerformAction(command); } /// /// Returns the members of the specified list. /// /// The tokens. /// The username. /// The list id or slug. /// A collection of users as . /// public static TwitterResponse GetMembers(OAuthTokens tokens, string username, string listIdOrSlug) { return GetMembers(tokens, username, listIdOrSlug, null); } /// /// Add a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members. /// /// The tokens. /// The username of the list owner. /// The list id. /// The user id to add. /// The options. /// /// A representing the list the user was added to, or null. /// public static TwitterResponse AddMember(OAuthTokens tokens, string ownerUsername, string listId, decimal userIdToAdd, OptionalProperties options) { Commands.AddListMemberCommand command = new Twitterizer.Commands.AddListMemberCommand(tokens, ownerUsername, listId, userIdToAdd, options); return CommandPerformer.PerformAction(command); } /// /// Add a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members. /// /// The tokens. /// The username of the list owner. /// The list id. /// The user id to add. /// /// A representing the list the user was added to, or null. /// public static TwitterResponse AddMember(OAuthTokens tokens, string ownerUsername, string listId, decimal userIdToAdd) { return AddMember(tokens, ownerUsername, listId, userIdToAdd, null); } /// /// Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list. /// /// The tokens. /// The username of the list owner. /// The list id. /// The user id to add. /// The options. /// /// A representing the list the user was added to, or null. /// public static TwitterResponse RemoveMember(OAuthTokens tokens, string ownerUsername, string listId, decimal userIdToAdd, OptionalProperties options) { Commands.RemoveListMemberCommand command = new Twitterizer.Commands.RemoveListMemberCommand(tokens, ownerUsername, listId, userIdToAdd, options); return CommandPerformer.PerformAction(command); } /// /// Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list. /// /// The tokens. /// The username of the list owner. /// The list id. /// The user id to add. /// /// A representing the list the user was added to, or null. /// public static TwitterResponse RemoveMember(OAuthTokens tokens, string ownerUsername, string listId, decimal userIdToAdd) { return RemoveMember(tokens, ownerUsername, listId, userIdToAdd, null); } /// /// Check if a user is a member of the specified list. /// /// The tokens. /// The username of the list owner. /// The list id. /// The user id. /// The options. /// /// The user's details, if they are a member of the list, otherwise null. /// public static TwitterResponse CheckMembership(OAuthTokens tokens, string ownerUsername, string listId, decimal userId, OptionalProperties options) { Commands.CheckListMembershipCommand command = new Twitterizer.Commands.CheckListMembershipCommand( tokens, ownerUsername, listId, userId, options); return CommandPerformer.PerformAction(command); } /// /// Check if a user is a member of the specified list. /// /// The tokens. /// The username of the list owner. /// The list id. /// The user id. /// /// The user's details, if they are a member of the list, otherwise null. /// public static TwitterResponse CheckMembership(OAuthTokens tokens, string ownerUsername, string listId, decimal userId) { return CheckMembership(tokens, ownerUsername, listId, userId, null); } /// /// Subscribes the specified tokens. /// /// The tokens. /// The list id. /// public static TwitterResponse Subscribe(OAuthTokens tokens, decimal listId) { return Subscribe(tokens, listId, null); } /// /// Subscribes the specified tokens. /// /// The tokens. /// The list id. /// The optional properties. /// public static TwitterResponse Subscribe(OAuthTokens tokens, decimal listId, OptionalProperties optionalProperties) { Commands.CreateListMembershipCommand command = new Commands.CreateListMembershipCommand(tokens, listId, optionalProperties); return CommandPerformer.PerformAction(command); } /// /// Unsubscribes the authenticated user from the specified list. /// /// The tokens. /// The list id. /// The optional properties. /// /// public static TwitterResponse UnSubscribe(OAuthTokens tokens, decimal listId, OptionalProperties optionalProperties) { Commands.DestroyListSubscriber command = new Commands.DestroyListSubscriber(tokens, listId, optionalProperties); return CommandPerformer.PerformAction(command); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/RemoveListMemberCommand.cs0000644000175000017500000001033312132510633030477 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The add list member command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list. /// [AuthorizedCommand] #if !SILVERLIGHT [Serializable] #endif internal class RemoveListMemberCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The owner username. /// The list id. /// The user id. /// The options. public RemoveListMemberCommand(OAuthTokens requestTokens, string ownerUsername, string listId, decimal userId, OptionalProperties options) : base(HTTPVerb.DELETE, string.Format(CultureInfo.CurrentCulture, "{0}/{1}/members.json", ownerUsername, listId), requestTokens, options) { if (requestTokens == null) { throw new ArgumentNullException("requestTokens"); } if (string.IsNullOrEmpty(ownerUsername)) { throw new ArgumentNullException("ownerUsername"); } if (string.IsNullOrEmpty(listId)) { throw new ArgumentNullException("listId"); } if (userId <= 0) { throw new ArgumentNullException("userId"); } this.UserId = userId; } /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; set; } /// /// Initializes the command. /// public override void Init() { this.RequestParameters.Add("id", this.UserId.ToString(CultureInfo.InvariantCulture.NumberFormat)); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/DeleteListCommand.cs0000644000175000017500000000740312132510633027320 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The delete list command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The create list command class /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class DeleteListCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The username. /// The list id or slug. /// The options. public DeleteListCommand(OAuthTokens requestTokens, string username, string listIdOrSlug, OptionalProperties options) : base( HTTPVerb.DELETE, string.Format(CultureInfo.CurrentCulture, "{0}/lists/{1}.json", username, listIdOrSlug), requestTokens, options) { if (Tokens == null) { throw new ArgumentNullException("requestTokens"); } if (string.IsNullOrEmpty(username)) { throw new ArgumentNullException("username"); } if (string.IsNullOrEmpty(listIdOrSlug)) { throw new ArgumentNullException("listIdOrSlug"); } } #endregion /// /// Initializes the command. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/GetListCommand.cs0000644000175000017500000001046512132510633026637 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The get list command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The create list command class /// #if !SILVERLIGHT [Serializable] #endif internal sealed class GetListCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The slug. /// The list id. /// The options. /// /// public GetListCommand(OAuthTokens requestTokens, string slug, decimal listId, OptionalProperties options) : base( HTTPVerb.GET, "lists/show.json", requestTokens, options) { if (Tokens == null) { throw new ArgumentNullException("requestTokens"); } if (!string.IsNullOrEmpty(slug) ^ listId > 0) { throw new ArgumentException("You must supply a list id number or slug, but not both."); } this.ListId = listId; this.Slug = slug; } /// /// Gets or sets the list id. /// /// The list id. public decimal ListId { get; set; } /// /// Gets or sets the slug. /// /// The slug. public string Slug { get; set; } /// /// Initializes the command. /// public override void Init() { if (ListId > 0) { this.RequestParameters.Add("list_id", this.ListId.ToString(CultureInfo.InvariantCulture)); } if (!string.IsNullOrEmpty(this.Slug)) { this.RequestParameters.Add("slug", this.Slug); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/CreateListCommand.cs0000644000175000017500000001056612132510633027325 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The create list command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The create list command class /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class CreateListCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The name. /// The options. /// public CreateListCommand(OAuthTokens requestTokens, string name, OptionalProperties options) : base(HTTPVerb.POST, "lists/create.json", requestTokens, options) { if (Tokens == null) { throw new ArgumentNullException("requestTokens"); } if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException("name"); } this.Name = name; } #region API Properties /// /// Gets or sets the name of the list. /// /// The name of the list. public string Name { get; set; } /// /// Gets or sets a value indicating whether this instance is public. /// /// true if this instance is public; otherwise, false. public bool IsPublic { get; set; } /// /// Gets or sets the description. /// /// The description. public string Description { get; set; } #endregion /// /// Initializes the command. /// public override void Init() { this.RequestParameters.Add("name", this.Name); this.RequestParameters.Add("mode", this.IsPublic ? "public" : "private"); if (!string.IsNullOrEmpty(this.Description)) { this.RequestParameters.Add("description", this.Description); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/GetListsOptions.cs0000644000175000017500000000455212132510633027077 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The get lists options class //----------------------------------------------------------------------- namespace Twitterizer { /// /// The Get Lists Options class /// public class GetListsOptions : OptionalProperties { /// /// Gets or sets the cursor. /// /// The cursor. public long Cursor { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/GetListMembersOptions.cs0000644000175000017500000000502512132510633030223 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // Optional parameters for the GetListMembers methods. //----------------------------------------------------------------------- namespace Twitterizer { /// /// Provides optional parameters for the method. /// public class GetListMembersOptions : OptionalProperties { /// /// Gets or sets the cursor. /// /// The cursor. public long Cursor { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/UpdateListOptions.cs0000644000175000017500000000571312132510633027417 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The update list options class //----------------------------------------------------------------------- namespace Twitterizer { /// /// The UpdateListOptions class. Provides a payload for optional parameters for the UpdaetListCommand class. /// #if !SILVERLIGHT [System.Serializable] #endif public class UpdateListOptions : OptionalProperties { /// /// Gets or sets the name of the list. /// /// The name of the list. public string Name { get; set; } /// /// Gets or sets a value indicating whether this instance is public. /// /// true if this instance is public; otherwise, false. public bool? IsPublic { get; set; } /// /// Gets or sets the description. /// /// The description. public string Description { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/ListStatusesOptions.cs0000644000175000017500000000670012253423361030012 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The list statuses options class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The list statuses options class. Provides a payload for the ListStatusesCommand class. /// #if !SILVERLIGHT [System.Serializable] #endif public sealed class ListStatusesOptions : OptionalProperties { /// /// Gets or sets the since id. /// /// The since id. public long SinceId { get; set; } /// /// Gets or sets the max id. /// /// The max id. public long MaxId { get; set; } /// /// Gets or sets the number of items per page to request. /// /// The number of items per page. public int ItemsPerPage { get; set; } /// /// Gets or sets the page. /// /// The page number. public int Page { get; set; } /// /// Gets or sets whether to include entities in the request. /// /// Boolean. public bool IncludeEntites { get; set; } /// /// Gets or sets whether to include entities in the request. /// /// Boolean. public bool IncludeRetweets { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/GetListsCommand.cs0000644000175000017500000000720512132510633027020 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The get lists command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Twitterizer; using Twitterizer.Core; /// /// The get lists command class /// #if !SILVERLIGHT [Serializable] #endif internal sealed class GetListsCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. /// public GetListsCommand(OAuthTokens requestTokens, GetListsOptions options) : base(HTTPVerb.GET, "lists.json", requestTokens, options) { if (requestTokens == null) { throw new ArgumentNullException("requestTokens"); } this.DeserializationHandler = TwitterListCollection.Deserialize; } /// /// Initializes the command. /// public override void Init() { GetListsOptions options = this.OptionalProperties as GetListsOptions; if (options == null || options.Cursor == 0) { this.RequestParameters.Add("cursor", "-1"); } else { this.RequestParameters.Add("cursor", options.Cursor.ToString(CultureInfo.InvariantCulture)); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/DestroyListSubscriber.cs0000644000175000017500000000226012253423361030275 0ustar00meebeymeebey00000000000000namespace Twitterizer.Commands { [Core.AuthorizedCommand] internal class DestroyListSubscriber : Core.TwitterCommand { /// /// Gets or sets the list id. /// /// The list id. /// public decimal ListId { get; set; } /// /// Initializes a new instance of the class. /// /// The tokens. /// The list id. /// The options. /// public DestroyListSubscriber(OAuthTokens tokens, decimal listId, OptionalProperties options) : base(HTTPVerb.POST, "lists/subscribers/destroy.json", tokens, options) { this.ListId = listId; } /// /// Inits this instance. /// /// public override void Init() { this.RequestParameters.Add("list_id", this.ListId.ToString()); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/ListMembershipsOptions.cs0000644000175000017500000000523412253423361030456 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The list membership command class //----------------------------------------------------------------------- namespace Twitterizer { /// /// The optional parameters for the class /// public class ListMembershipsOptions : OptionalProperties { /// /// Gets or sets the cursor. /// /// The cursor. public long Cursor { get; set; } /// /// Gets or sets filtered to owned lists. /// /// Whether to filter to owned lists. public bool FilterToOwnedLists { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/ListMembershipsCommand.cs0000644000175000017500000001250712253423361030402 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The list membership command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The list membership command class /// [AuthorizedCommandAttribute] internal sealed class ListMembershipsCommand : TwitterCommand { private readonly string screenname; private readonly decimal userid; /// /// Initializes a new instance of the class. /// /// The request tokens. /// The screenname. /// The options. public ListMembershipsCommand(OAuthTokens requestTokens, string screenname, ListMembershipsOptions options) : base( HTTPVerb.GET, "lists/memberships.json", requestTokens, options) { if (string.IsNullOrEmpty(screenname)) { throw new ArgumentNullException("screenname"); } if (Tokens == null) { throw new ArgumentNullException("requestTokens"); } this.DeserializationHandler = TwitterListCollection.Deserialize; this.screenname = screenname; } /// /// Initializes a new instance of the class. /// /// The request tokens. /// The screenname. /// The options. public ListMembershipsCommand(OAuthTokens requestTokens, decimal userid, ListMembershipsOptions options) : base( HTTPVerb.GET, "lists/memberships.json", requestTokens, options) { if (userid <= 0) { throw new ArgumentNullException("userid"); } if (Tokens == null) { throw new ArgumentNullException("requestTokens"); } this.DeserializationHandler = TwitterListCollection.Deserialize; this.userid = userid; } /// /// Initializes the command. /// public override void Init() { if (!String.IsNullOrEmpty(screenname)) this.RequestParameters.Add("screen_name", screenname); if (userid > 0) this.RequestParameters.Add("user_id", userid.ToString()); ListMembershipsOptions options = this.OptionalProperties as ListMembershipsOptions; if (options != null) { if (options.Cursor <= 0) this.RequestParameters.Add("cursor", "-1"); else this.RequestParameters.Add("cursor", options.Cursor.ToString(CultureInfo.CurrentCulture)); if (options.FilterToOwnedLists) this.RequestParameters.Add("filter_to_owned_lists", "true"); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/AddListMemberCommand.cs0000644000175000017500000001034112132510633027731 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The add list member command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// Add a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members. /// [AuthorizedCommand] #if !SILVERLIGHT [Serializable] #endif internal class AddListMemberCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The owner username. /// The list id. /// The user id. /// The options. public AddListMemberCommand(OAuthTokens requestTokens, string ownerUsername, string listId, decimal userId, OptionalProperties options) : base(HTTPVerb.POST, string.Format(CultureInfo.CurrentCulture, "{0}/{1}/members.json", ownerUsername, listId), requestTokens, options) { if (requestTokens == null) { throw new ArgumentNullException("requestTokens"); } if (string.IsNullOrEmpty(ownerUsername)) { throw new ArgumentNullException("ownerUsername"); } if (string.IsNullOrEmpty(listId)) { throw new ArgumentNullException("listId"); } if (userId <= 0) { throw new ArgumentNullException("userId"); } this.UserId = userId; } /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; set; } /// /// Initializes the command. /// public override void Init() { this.RequestParameters.Add("id", this.UserId.ToString(CultureInfo.InvariantCulture.NumberFormat)); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/UpdateListCommand.cs0000644000175000017500000001033312253423361027341 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The update list command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The update list command class /// #if !SILVERLIGHT [Serializable] #endif internal sealed class UpdateListCommand : TwitterCommand { private readonly string id; #region Constructors /// /// Initializes a new instance of the class. /// /// The tokens. /// The id. /// The options. /// public UpdateListCommand(OAuthTokens tokens, string id, UpdateListOptions options) : base( HTTPVerb.POST, "lists/update.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (string.IsNullOrEmpty(id)) { throw new ArgumentNullException("id"); } this.id = id; } #endregion /// /// Initializes the command. /// public override void Init() { if (!string.IsNullOrEmpty(id)) this.RequestParameters.Add("list_id", id); UpdateListOptions options = this.OptionalProperties as UpdateListOptions; if (options == null) { return; } if (!string.IsNullOrEmpty(options.Name)) { this.RequestParameters.Add("name", options.Name); } if (options.IsPublic != null) { this.RequestParameters.Add("mode", options.IsPublic.Value ? "public" : "private"); } if (!string.IsNullOrEmpty(options.Description)) { this.RequestParameters.Add("description", options.Description); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/GetListSubscriptionsCommand.cs0000644000175000017500000000737112132510633031431 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The get list subscriptions command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The create list command class /// [AuthorizedCommandAttribute] internal sealed class GetListSubscriptionsCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// Name of the user. /// The options. /// public GetListSubscriptionsCommand(OAuthTokens requestTokens, string userName, GetListSubscriptionsOptions options) : base(HTTPVerb.GET, string.Format("{0}/lists/subscriptions.json", userName), requestTokens, options) { if (requestTokens == null) { throw new ArgumentNullException("requestTokens"); } this.DeserializationHandler = TwitterListCollection.Deserialize; } /// /// Initializes the command. /// public override void Init() { GetListSubscriptionsOptions options = this.OptionalProperties as GetListSubscriptionsOptions; if (options == null || options.Cursor <= 0) { this.RequestParameters.Add("cursor", "-1"); } else this.RequestParameters.Add("cursor", options.Cursor.ToString(CultureInfo.CurrentCulture)); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/ListStatusesCommand.cs0000644000175000017500000001124312253423361027733 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The get list statuses command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The get list statuses command class /// internal sealed class ListStatusesCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The username. /// The list id or slug. /// The options. /// public ListStatusesCommand(OAuthTokens requestTokens, string username, string listIdOrSlug, ListStatusesOptions options) : base(HTTPVerb.GET, string.Format("{0}/lists/{1}/statuses.json", username, listIdOrSlug), requestTokens, options) { if (string.IsNullOrEmpty(username)) { throw new ArgumentNullException("username"); } if (string.IsNullOrEmpty(listIdOrSlug)) { throw new ArgumentNullException("listIdOrSlug"); } } /// /// Initializes the command. /// public override void Init() { ListStatusesOptions options = this.OptionalProperties as ListStatusesOptions; if (options == null) { this.RequestParameters.Add("page", "1"); return; } if (options.SinceId > 0) { this.RequestParameters.Add("since_id", options.SinceId.ToString(CultureInfo.InvariantCulture)); } if (options.MaxId > 0) { this.RequestParameters.Add("max_id", options.MaxId.ToString(CultureInfo.InvariantCulture)); } if (options.ItemsPerPage > 0) { this.RequestParameters.Add("per_page", options.ItemsPerPage.ToString(CultureInfo.InvariantCulture)); } if (options.IncludeEntites) { this.RequestParameters.Add("include_entities", "true"); } if (options.IncludeRetweets) { this.RequestParameters.Add("include_rts", "true"); } this.RequestParameters.Add("page", options.Page > 0 ? options.Page.ToString(CultureInfo.InvariantCulture) : "1"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/CreateListMembershipCommand.cs0000644000175000017500000000236412253423361031343 0ustar00meebeymeebey00000000000000using System; using Twitterizer.Core; namespace Twitterizer.Commands { internal class CreateListMembershipCommand : TwitterCommand { private readonly decimal listId; /// /// Initializes a new instance of the class. /// /// The tokens. /// The list id. /// The options. public CreateListMembershipCommand(OAuthTokens tokens, decimal listId, OptionalProperties options) : base(HTTPVerb.POST, "/lists/subscribers/create.json", tokens, options) { if (tokens == null || !tokens.HasBothTokens) { throw new ArgumentNullException("tokens"); } if (listId <= 0) { throw new ArgumentNullException("listId"); } this.listId = listId; } /// /// Inits this instance. /// public override void Init() { this.RequestParameters.Add("list_id", this.listId.ToString()); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/TwitterListCollection.cs0000644000175000017500000000674612132510633030306 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter list collection class. //----------------------------------------------------------------------- namespace Twitterizer { using System; using Twitterizer.Core; using Newtonsoft.Json.Linq; using Newtonsoft.Json; /// /// The twitter list collection class. /// #if !SILVERLIGHT [Serializable] #endif public class TwitterListCollection : Core.TwitterCollection, ITwitterObject { /// /// Gets or sets the next cursor. /// /// The next cursor. public int NextCursor { get; set; } /// /// Gets or sets the previous cursor. /// /// The previous cursor. public int PreviousCursor { get; set; } /// /// Gets or sets information about the user's rate usage. /// /// The rate limiting object. public RateLimiting RateLimiting { get; set; } /// /// Deserializes the specified value. /// /// The value. /// internal static TwitterListCollection Deserialize(JObject value) { if (value == null || value.First == null || value.First.First == null) return null; return JsonConvert.DeserializeObject(value.First.First.ToString()); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/CheckListMembershipCommand.cs0000644000175000017500000000756012132510633031153 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The check list membership command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// Check if a user is a member of the specified list. /// [AuthorizedCommand] #if !SILVERLIGHT [Serializable] #endif internal class CheckListMembershipCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The owner username. /// The list id. /// The user id. /// The options. public CheckListMembershipCommand(OAuthTokens requestTokens, string ownerUsername, string listId, decimal userId, OptionalProperties options) : base(HTTPVerb.GET, string.Format(CultureInfo.CurrentCulture, "{0}/{1}/members/{2}.json", ownerUsername, listId, userId), requestTokens, options) { if (requestTokens == null) { throw new ArgumentNullException("requestTokens"); } if (string.IsNullOrEmpty(ownerUsername)) { throw new ArgumentNullException("ownerUsername"); } if (string.IsNullOrEmpty(listId)) { throw new ArgumentNullException("listId"); } if (userId <= 0) { throw new ArgumentNullException("userId"); } } /// /// Initializes the command. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/List/GetListMembersCommand.cs0000644000175000017500000001011412132510633030141 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The get list members command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// Returns the members of the specified list. /// [AuthorizedCommand] internal class GetListMembersCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The username. /// The list id or slug. /// The options. public GetListMembersCommand(OAuthTokens requestTokens, string username, string listIdOrSlug, GetListMembersOptions options) : base(HTTPVerb.GET, string.Format(CultureInfo.CurrentCulture, "{0}/{1}/members.json", username, listIdOrSlug), requestTokens, options) { if (requestTokens == null) { throw new ArgumentNullException("requestTokens"); } if (string.IsNullOrEmpty(username)) { throw new ArgumentNullException("username"); } if (string.IsNullOrEmpty(listIdOrSlug)) { throw new ArgumentNullException("listIdOrSlug"); } this.DeserializationHandler = TwitterUserCollection.DeserializeWrapper; } /// /// Initializes the command. /// public override void Init() { GetListMembersOptions options = this.OptionalProperties as GetListMembersOptions; if (options == null || options.Cursor == 0) { this.RequestParameters.Add("cursor", "-1"); } else { this.RequestParameters.Add("cursor", options.Cursor.ToString(CultureInfo.InvariantCulture)); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Block/0000755000175000017500000000000012132510633023547 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Block/DestroyBlockCommand.cs0000644000175000017500000001031112132510633027775 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The destroy block command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Collections.Generic; using System.Linq; using System.Text; using Twitterizer.Core; using System.Globalization; /// /// The destroy block command class. /// /// http://dev.twitter.com/doc/post/blocks/destroy internal class DestroyBlockCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// Name of the screen. /// The user id. /// The options. public DestroyBlockCommand(OAuthTokens tokens, string screenName, decimal userId, OptionalProperties options) : base(HTTPVerb.POST, "blocks/destroy.json", tokens, options) { if (string.IsNullOrEmpty(screenName) && userId <= 0) { throw new ArgumentException("A screen name or user id is required."); } this.ScreenName = screenName; this.UserId = userId; } /// /// Gets or sets the name of the screen. /// /// The name of the screen. public string ScreenName { get; set; } /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; set; } /// /// Inits this instance. /// public override void Init() { if (this.UserId > 0) { this.RequestParameters.Add("user_id", this.UserId.ToString(CultureInfo.InvariantCulture)); } else if (!string.IsNullOrEmpty(this.ScreenName)) { this.RequestParameters.Add("screen_name", this.ScreenName); } this.RequestParameters.Add("include_entities", "true"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Block/CreateBlockCommand.cs0000644000175000017500000001030012132510633027545 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The create block command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Collections.Generic; using System.Linq; using System.Text; using Twitterizer.Core; using System.Globalization; /// /// The create block command class. /// /// http://dev.twitter.com/doc/post/blocks/create internal class CreateBlockCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// Name of the screen. /// The user id. /// The options. public CreateBlockCommand(OAuthTokens tokens, string screenName, decimal userId, OptionalProperties options) : base(HTTPVerb.POST, "blocks/create.json", tokens, options) { if (string.IsNullOrEmpty(screenName) && userId <= 0) { throw new ArgumentException("A screen name or user id is required."); } this.ScreenName = screenName; this.UserId = userId; } /// /// Gets or sets the name of the screen. /// /// The name of the screen. public string ScreenName { get; set; } /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; set; } /// /// Inits this instance. /// public override void Init() { if (this.UserId > 0) { this.RequestParameters.Add("user_id", this.UserId.ToString(CultureInfo.InvariantCulture)); } else if (!string.IsNullOrEmpty(this.ScreenName)) { this.RequestParameters.Add("screen_name", this.ScreenName); } this.RequestParameters.Add("include_entities", "true"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Block/BlockingOptions.cs0000644000175000017500000000464112132510633027207 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The blocking options class //----------------------------------------------------------------------- namespace Twitterizer { /// /// The optional parameters for the class. /// public class BlockingOptions : OptionalProperties { /// /// Gets or sets the page. /// /// The page. public int Page { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Block/BlockingIdsCommand.cs0000644000175000017500000000552012132510633027567 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The blocking ids command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer.Core; /// /// The blocking ids command class /// class BlockingIdsCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The options. public BlockingIdsCommand(OAuthTokens tokens, OptionalProperties options) : base(HTTPVerb.GET, "blocks/blocking/ids.json", tokens, options) { } /// /// Inits this instance. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Block/BlockingCommand.cs0000644000175000017500000000644612132510633027137 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The blocking command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System.Globalization; using Twitterizer.Core; /// /// The blocking command class. /// [AuthorizedCommand] sealed class BlockingCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The options. public BlockingCommand(OAuthTokens tokens, BlockingOptions options) : base(HTTPVerb.GET, "blocks/blocking.json", tokens, options) { } /// /// Inits this instance. /// public override void Init() { this.RequestParameters.Add("include_entities", "true"); BlockingOptions options = this.OptionalProperties as BlockingOptions; if (options == null || options.Page <= 0) { this.RequestParameters.Add("page", "1"); } else { this.RequestParameters.Add("page", options.Page.ToString(CultureInfo.CurrentCulture)); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Block/TwitterBlock.cs0000644000175000017500000002762212132510633026524 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter block class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// Provides methods for interacting with user blocks. /// public static class TwitterBlock { /// /// Blocks the user specified as the authenticating user. Destroys a friendship to the blocked user if it exists. /// /// The tokens. /// The user id. /// The options. /// /// The blocked user in the requested format when successful. /// public static TwitterResponse Create(OAuthTokens tokens, decimal userId, OptionalProperties options) { Commands.CreateBlockCommand command = new Commands.CreateBlockCommand(tokens, string.Empty, userId, options); return Core.CommandPerformer.PerformAction(command); } /// /// Blocks the user specified as the authenticating user. Destroys a friendship to the blocked user if it exists. /// /// The tokens. /// The user id. /// /// The blocked user in the requested format when successful. /// public static TwitterResponse Create(OAuthTokens tokens, decimal userId) { return Create(tokens, userId, null); } /// /// Blocks the user specified as the authenticating user. Destroys a friendship to the blocked user if it exists. /// /// The tokens. /// The user's screen name. /// The options. /// /// The blocked user in the requested format when successful. /// public static TwitterResponse Create(OAuthTokens tokens, string screenName, OptionalProperties options) { Commands.CreateBlockCommand command = new Commands.CreateBlockCommand(tokens, screenName, -1, options); return Core.CommandPerformer.PerformAction(command); } /// /// Blocks the user specified as the authenticating user. Destroys a friendship to the blocked user if it exists. /// /// The tokens. /// The user's screen name. /// /// The blocked user in the requested format when successful. /// public static TwitterResponse Create(OAuthTokens tokens, string screenName) { return Create(tokens, screenName, null); } /// /// Unblocks the user specified as the authenticating user. /// /// The tokens. /// The user id. /// The options. /// /// The unblocked user in the requested format when successful. /// public static TwitterResponse Destroy(OAuthTokens tokens, decimal userId, OptionalProperties options) { Commands.DestroyBlockCommand command = new Commands.DestroyBlockCommand(tokens, string.Empty, userId, options); return Core.CommandPerformer.PerformAction(command); } /// /// Unblocks the user specified as the authenticating user. /// /// The tokens. /// The user id. /// /// The unblocked user in the requested format when successful. /// public static TwitterResponse Destroy(OAuthTokens tokens, decimal userId) { return Destroy(tokens, userId, null); } /// /// Unblocks the user specified as the authenticating user. /// /// The tokens. /// The user's screen name. /// The options. /// /// The unblocked user in the requested format when successful. /// public static TwitterResponse Destroy(OAuthTokens tokens, string screenName, OptionalProperties options) { Commands.DestroyBlockCommand command = new Commands.DestroyBlockCommand(tokens, screenName, -1, options); return Core.CommandPerformer.PerformAction(command); } /// /// Unblocks the user specified as the authenticating user. /// /// The tokens. /// The user's screen name. /// /// The unblocked user in the requested format when successful. /// public static TwitterResponse Destroy(OAuthTokens tokens, string screenName) { return Destroy(tokens, screenName, null); } /// /// Checks for a block against the the user specified as the authenticating user. /// /// The tokens. /// The user id. /// The options. /// /// The blocked user in the requested format when successful. /// public static TwitterResponse Exists(OAuthTokens tokens, decimal userId, OptionalProperties options) { Commands.ExistsBlockCommand command = new Commands.ExistsBlockCommand(tokens, string.Empty, userId, options); return Core.CommandPerformer.PerformAction(command); } /// /// Checks for a block against the the user specified as the authenticating user. /// /// The tokens. /// The user id. /// /// The blocked user in the requested format when successful. /// public static TwitterResponse Exists(OAuthTokens tokens, decimal userId) { return Exists(tokens, userId, null); } /// /// Checks for a block against the the user specified as the authenticating user. /// /// The tokens. /// The user's screen name. /// The options. /// /// The blocked user in the requested format when successful. /// public static TwitterResponse Exists(OAuthTokens tokens, string screenName, OptionalProperties options) { Commands.ExistsBlockCommand command = new Commands.ExistsBlockCommand(tokens, screenName, -1, options); return Core.CommandPerformer.PerformAction(command); } /// /// Checks for a block against the the user specified as the authenticating user. /// /// The tokens. /// The user's screen name. /// /// The blocked user in the requested format when successful. /// public static TwitterResponse Exists(OAuthTokens tokens, string screenName) { return Exists(tokens, screenName, null); } /// /// Returns a collection of user objects that the authenticating user is blocking. /// /// The tokens. /// The options. /// public static TwitterResponse Blocking(OAuthTokens tokens, BlockingOptions options) { Commands.BlockingCommand command = new Commands.BlockingCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns a collection of user objects that the authenticating user is blocking. /// /// The tokens. /// /// public static TwitterResponse Blocking(OAuthTokens tokens) { return Blocking(tokens, null); } /// /// Returns an collection of user ids the authenticating user is blocking. /// /// The tokens. /// The options. /// A collection of user ids. public static TwitterResponse BlockingIds(OAuthTokens tokens, OptionalProperties options) { Commands.BlockingIdsCommand command = new Commands.BlockingIdsCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns an collection of user ids the authenticating user is blocking. /// /// The tokens. /// A collection of user ids. public static TwitterResponse BlockingIds(OAuthTokens tokens) { return BlockingIds(tokens, null); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Block/ExistsBlockCommand.cs0000644000175000017500000001030012132510633027621 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The exists block command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Collections.Generic; using System.Linq; using System.Text; using Twitterizer.Core; using System.Globalization; /// /// The exists block command class. /// /// http://dev.twitter.com/doc/post/blocks/exists internal class ExistsBlockCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// Name of the screen. /// The user id. /// The options. public ExistsBlockCommand(OAuthTokens tokens, string screenName, decimal userId, OptionalProperties options) : base(HTTPVerb.GET, "blocks/exists.json", tokens, options) { if (string.IsNullOrEmpty(screenName) && userId <= 0) { throw new ArgumentException("A screen name or user id is required."); } this.ScreenName = screenName; this.UserId = userId; } /// /// Gets or sets the name of the screen. /// /// The name of the screen. public string ScreenName { get; set; } /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; set; } /// /// Inits this instance. /// public override void Init() { if (this.UserId > 0) { this.RequestParameters.Add("user_id", this.UserId.ToString(CultureInfo.InvariantCulture)); } else if (!string.IsNullOrEmpty(this.ScreenName)) { this.RequestParameters.Add("screen_name", this.ScreenName); } this.RequestParameters.Add("include_entities", "true"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/0000755000175000017500000000000012253423361024615 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/TwitterRelationshipUser.cs0000644000175000017500000001155012253423361032031 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The twitter relationship user class //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Diagnostics; using Newtonsoft.Json; using Twitterizer.Core; /// /// The Twitter Relationship entity class /// [JsonObject(MemberSerialization = MemberSerialization.OptIn)] #if !SILVERLIGHT [Serializable] #endif public class TwitterRelationshipUser : TwitterObject { /// /// Gets or sets the ID. /// /// The ID. [JsonProperty(PropertyName = "id")] public decimal Id { get; set; } /// /// Gets or sets if Following. /// /// Is the user following. [JsonProperty(PropertyName = "following")] public bool Following { get; set; } /// /// Gets or sets the ScreenName. /// /// The users ScreenName. [JsonProperty(PropertyName = "screen_name")] public string ScreenName { get; set; } /// /// Gets or sets if followed by. /// /// Is the user being followed by. [JsonProperty(PropertyName = "followed_by")] public bool FollowedBy { get; set; } /// /// Gets or sets if notifications are enabled. /// /// Notifications enabled for this user. [JsonProperty(PropertyName = "notifications_enabled")] public bool? NotificationsEnabled { get; set; } /// /// Gets or sets if Can DM. /// /// Can the user be DM. [JsonProperty(PropertyName = "can_dm")] public bool CanDM { get; set; } /// /// Gets or sets if wants retweets. /// /// The user wants to see retweets. [JsonProperty(PropertyName = "want_retweets")] public bool? WantRetweets { get; set; } /// /// Gets or sets if marked as spam. /// /// If the user is marked as spam. [JsonProperty(PropertyName = "marked_spam")] public bool? MarkedSpam { get; set; } /// /// Gets or sets if all replies. /// /// If the user wants All Replies. [JsonProperty(PropertyName = "all_replies")] public bool? AllReplies { get; set; } /// /// Gets or sets if blocking. /// /// If the user is blocked. [JsonProperty(PropertyName = "blocking")] public bool? Blocking { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/UpdateFriendshipOptions.cs0000644000175000017500000000621312253423361031760 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The update friendship options class. //----------------------------------------------------------------------- namespace Twitterizer { using System; /// /// The Update Friendship Options class /// #if !SILVERLIGHT [System.Serializable] #endif public sealed class UpdateFriendshipOptions : OptionalProperties { /// /// Initializes a new instance of the class. /// public UpdateFriendshipOptions() { DeviceNotifications = null; ShowRetweets = null; } /// /// Gets or sets a value indicating whether to enable delivery of statuses from this user to the authenticated user's device /// /// true if follow; otherwise, false. public bool? DeviceNotifications { get; set; } /// /// Gets or sets a value indicating whether to show retweets for this user /// /// true if follow; otherwise, false. public bool? ShowRetweets { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/IncomingFriendshipsCommand.cs0000644000175000017500000000647712132510633032416 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The incoming friendship command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System.Globalization; using Twitterizer.Core; class IncomingFriendshipsCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The options. public IncomingFriendshipsCommand(OAuthTokens tokens, IncomingFriendshipsOptions options) : base(HTTPVerb.GET, "friendships/incoming.json", tokens, options) { this.DeserializationHandler = TwitterCursorPagedIdCollection.DeserializeWrapper; } /// /// Inits this instance. /// public override void Init() { IncomingFriendshipsOptions options = this.OptionalProperties as IncomingFriendshipsOptions; if (options == null || options.Cursor == 0) { this.RequestParameters.Add("cursor", "-1"); } else { this.RequestParameters.Add("Cursor", options.Cursor.ToString(CultureInfo.CurrentCulture)); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/FollowersIdsCommand.cs0000644000175000017500000000760412132510633031061 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Edgardo Vega // The Friendship Resources members command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// Returns the members of the specified list. /// [AuthorizedCommand] internal class FollowersIdsCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public FollowersIdsCommand(OAuthTokens requestTokens, UsersIdsOptions options) : base(HTTPVerb.GET, string.Format(CultureInfo.CurrentCulture, "followers/ids.json"), requestTokens, options) { if (requestTokens == null) { throw new ArgumentNullException("requestTokens"); } this.DeserializationHandler = UserIdCollection.DeserializeWrapper; } /// /// Initializes the command. /// public override void Init() { UsersIdsOptions options = this.OptionalProperties as UsersIdsOptions; if (options == null) { this.RequestParameters.Add("cursor", "-1"); return; } if (options.UserId > 0) this.RequestParameters.Add("user_id", options.UserId.ToString(CultureInfo.InvariantCulture.NumberFormat)); if (!string.IsNullOrEmpty(options.ScreenName)) this.RequestParameters.Add("screen_name", options.ScreenName); this.RequestParameters.Add("cursor", options.Cursor > 0 ? options.Cursor.ToString(CultureInfo.InvariantCulture) : "-1"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/TwitterRelationship.cs0000644000175000017500000001026712253423361031176 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter relationship entity class //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Diagnostics; using Newtonsoft.Json; using Twitterizer.Core; /// /// The Twitter Relationship entity class /// [JsonObject(MemberSerialization = MemberSerialization.OptIn)] [DebuggerDisplay("TwitterRelationship = {Source} -> {Target}")] #if !SILVERLIGHT [Serializable] #endif public class TwitterRelationship : TwitterObject { /// /// Gets or sets the source. /// /// The source. [JsonProperty(PropertyName = "source")] public TwitterRelationshipUser Source { get; set; } /// /// Gets or sets the target. /// /// The target. [JsonProperty(PropertyName = "target")] public TwitterRelationshipUser Target { get; set; } /// /// Gets or sets the relationship. /// /// The relationship. [JsonProperty(PropertyName = "relationship")] public TwitterRelationship Relationship { get { return this; } set { if (value != null) { this.Target = value.Target; this.Source = value.Source; } } } /// /// Allows the authenticating users to unfollow the user specified. /// /// The tokens. /// /// Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. /// public TwitterResponse Delete(OAuthTokens tokens) { Commands.DeleteFriendshipCommand command = new Twitterizer.Commands.DeleteFriendshipCommand(tokens, this.Target.Id, string.Empty, null); return CommandPerformer.PerformAction(command); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/UpdateFriendshipCommand.cs0000644000175000017500000001314012253423361031700 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The Direct Messages Sent Command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// Creates a friendship between the authenticated user and another user /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class UpdateFriendshipCommand : Core.TwitterCommand { /// /// The base address to the API method. /// private const string Path = "friendships/update.json"; /// /// Initializes a new instance of the class. /// /// The request tokens. /// The userid. /// The optional properties. public UpdateFriendshipCommand(OAuthTokens tokens, decimal userId, UpdateFriendshipOptions optionalProperties) : base(HTTPVerb.POST, Path, tokens, optionalProperties) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (userId <= 0) { throw new ArgumentException("userId"); } this.UserId = userId; } /// /// Initializes a new instance of the class. /// /// The request tokens. /// Name of the user. /// The optional properties. public UpdateFriendshipCommand(OAuthTokens tokens, string userName, UpdateFriendshipOptions optionalProperties) : base(HTTPVerb.POST, Path, tokens, optionalProperties) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (string.IsNullOrEmpty(userName)) { throw new ArgumentNullException("userName"); } this.UserName = userName; } /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; set; } /// /// Gets or sets the username. /// /// The username. public string UserName { get; set; } /// /// Initializes the command. /// public override void Init() { if (this.UserId > 0) { this.RequestParameters.Add("user_id", this.UserId.ToString(CultureInfo.InvariantCulture)); } else if (!string.IsNullOrEmpty(this.UserName)) { this.RequestParameters.Add("screen_name", this.UserName); } UpdateFriendshipOptions options = this.OptionalProperties as UpdateFriendshipOptions; if (options != null) { if (options.DeviceNotifications != null) this.RequestParameters.Add("device", (bool)options.DeviceNotifications ? "true" : "false"); if (options.ShowRetweets != null) this.RequestParameters.Add("retweets", (bool)options.ShowRetweets ? "true" : "false"); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/OutgoingFriendshipsCommand.cs0000644000175000017500000000675412132510633032444 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The outgoing friendship command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System.Globalization; using Twitterizer.Core; /// /// Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user. /// internal sealed class OutgoingFriendshipsCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The options. public OutgoingFriendshipsCommand(OAuthTokens tokens, OutgoingFriendshipsOptions options) : base(HTTPVerb.GET, "friendships/outgoing.json", tokens, options) { this.DeserializationHandler = TwitterCursorPagedIdCollection.DeserializeWrapper; } /// /// Inits this instance. /// public override void Init() { OutgoingFriendshipsOptions options = this.OptionalProperties as OutgoingFriendshipsOptions; if (options == null || options.Cursor == 0) { this.RequestParameters.Add("cursor", "-1"); } else { this.RequestParameters.Add("Cursor", options.Cursor.ToString(CultureInfo.CurrentCulture)); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/CreateFriendshipCommand.cs0000644000175000017500000001256412132510633031665 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The Direct Messages Sent Command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// Creates a friendship between the authenticated user and another user /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class CreateFriendshipCommand : Core.TwitterCommand { /// /// The base address to the API method. /// private const string Path = "friendships/create.json"; /// /// Initializes a new instance of the class. /// /// The request tokens. /// The userid. /// The optional properties. public CreateFriendshipCommand(OAuthTokens tokens, decimal userId, CreateFriendshipOptions optionalProperties) : base(HTTPVerb.POST, Path, tokens, optionalProperties) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (userId <= 0) { throw new ArgumentException("userId"); } this.UserId = userId; } /// /// Initializes a new instance of the class. /// /// The request tokens. /// Name of the user. /// The optional properties. public CreateFriendshipCommand(OAuthTokens tokens, string userName, CreateFriendshipOptions optionalProperties) : base(HTTPVerb.POST, Path, tokens, optionalProperties) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (string.IsNullOrEmpty(userName)) { throw new ArgumentNullException("userName"); } this.UserName = userName; } /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; set; } /// /// Gets or sets the username. /// /// The username. public string UserName { get; set; } /// /// Initializes the command. /// public override void Init() { if (this.UserId > 0) { this.RequestParameters.Add("user_id", this.UserId.ToString(CultureInfo.InvariantCulture)); } else if (!string.IsNullOrEmpty(this.UserName)) { this.RequestParameters.Add("screen_name", this.UserName); } CreateFriendshipOptions options = this.OptionalProperties as CreateFriendshipOptions; if (options != null) { if (options.Follow) this.RequestParameters.Add("follow", "true"); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/NoRetweetIDsCommand.cs0000644000175000017500000000567612253423361030775 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The outgoing friendship command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System.Globalization; using Twitterizer.Core; /// /// Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user. /// internal sealed class NoRetweetIDsCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The options. public NoRetweetIDsCommand(OAuthTokens tokens, OptionalProperties options) : base(HTTPVerb.GET, "friendships/no_retweet_ids.json", tokens, options) { } /// /// Inits this instance. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/FriendsIdsCommand.cs0000644000175000017500000000756012132510633030500 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Edgardo Vega // The Friendship Resources members command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// Returns the members of the specified list. /// [AuthorizedCommand] internal class FriendsIdsCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public FriendsIdsCommand(OAuthTokens requestTokens, UsersIdsOptions options) : base(HTTPVerb.GET, string.Format(CultureInfo.CurrentCulture, "friends/ids.json"), requestTokens, options) { if (requestTokens == null) { throw new ArgumentNullException("requestTokens"); } this.DeserializationHandler = UserIdCollection.DeserializeWrapper; } /// /// Initializes the command. /// public override void Init() { UsersIdsOptions options = this.OptionalProperties as UsersIdsOptions; if (options == null) { this.RequestParameters.Add("cursor", "-1"); return; } if (options.UserId > 0) this.RequestParameters.Add("user_id", options.UserId.ToString(CultureInfo.InvariantCulture.NumberFormat)); if (!string.IsNullOrEmpty(options.ScreenName)) this.RequestParameters.Add("screen_name", options.ScreenName); this.RequestParameters.Add("cursor", options.Cursor > 0 ? options.Cursor.ToString(CultureInfo.InvariantCulture) : "-1"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/DeleteFriendshipCommand.cs0000644000175000017500000001060512132510633031656 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The delete friendship command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The delete friendship command class. /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class DeleteFriendshipCommand : Core.TwitterCommand { /// /// The base address to the API method. /// private const string Path = "friendships/destroy.json"; /// /// Initializes a new instance of the class. /// /// The request tokens. /// The user id. /// The user name. /// The optional properties. public DeleteFriendshipCommand(OAuthTokens tokens, decimal userId, string userName, OptionalProperties optionalProperties) : base(HTTPVerb.POST, Path, tokens, optionalProperties) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (userId <= 0 && string.IsNullOrEmpty(userName)) { throw new ArgumentException("User ID or screen name is required."); } this.UserName = userName; this.UserId = userId; } /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; internal set; } /// /// Gets or sets the username. /// /// The username. public string UserName { get; internal set; } /// /// Initializes the command. /// public override void Init() { if (this.UserId > 0) { this.RequestParameters.Add("user_id", this.UserId.ToString(CultureInfo.InvariantCulture)); } else if (!string.IsNullOrEmpty(this.UserName)) { this.RequestParameters.Add("screen_name", this.UserName); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/ShowFriendshipCommand.cs0000644000175000017500000001377112132510633031403 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The show friendship command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The show friendship command class. /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class ShowFriendshipCommand : Core.TwitterCommand { /// /// The base address to the API method. /// private const string Path = "friendships/show.json"; /// /// Initializes a new instance of the class. /// /// The tokens. /// The source user id. /// Name of the source user. /// The target user id. /// Name of the target screen. /// The optional properties. public ShowFriendshipCommand(OAuthTokens tokens, decimal sourceUserId, string sourceUserName, decimal targetUserId, string targetScreenName, OptionalProperties optionalProperties) : base(HTTPVerb.GET, Path, tokens, optionalProperties) { // If the request is unauthorized if (tokens == null) { // Source information is required if (sourceUserId <= 0 && string.IsNullOrEmpty(sourceUserName)) { throw new ArgumentException("For unauthorized show friendship requests, a source and target are required."); } } // Target information is always required (one of the variables) if (targetUserId <= 0 && string.IsNullOrEmpty(targetScreenName)) { throw new ArgumentException("A target user id or screen name is required."); } this.SourceId = sourceUserId; this.SourceScreenName = sourceUserName; this.TargetId = targetUserId; this.TargetScreenName = targetScreenName; } #region API Parameters /// /// Gets or sets the id of the source user. /// /// The source id. public decimal SourceId { get; set; } /// /// Gets or sets the screenname of the source user. /// /// The screenname of the source user. public string SourceScreenName { get; set; } /// /// Gets or sets the id of the target user. /// /// The target id. public decimal TargetId { get; set; } /// /// Gets or sets the screenname of the target user. /// /// The screenname of the target user. public string TargetScreenName { get; set; } #endregion /// /// Initializes the command. /// public override void Init() { if (this.SourceId > 0) { this.RequestParameters.Add("source_id", this.SourceId.ToString(CultureInfo.InvariantCulture)); } else if (!string.IsNullOrEmpty(this.SourceScreenName)) { this.RequestParameters.Add("source_screen_name", this.SourceScreenName); } if (this.TargetId > 0) { this.RequestParameters.Add("target_id", this.TargetId.ToString(CultureInfo.InvariantCulture)); } else if (!string.IsNullOrEmpty(this.TargetScreenName)) { this.RequestParameters.Add("target_screen_name", this.TargetScreenName); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/UsersIdsOptions.cs0000644000175000017500000000566312132510633030266 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Edgardo Vega // Optional parameters for the Friendship Resource methods. //----------------------------------------------------------------------- namespace Twitterizer { using System; /// /// The Create Friendship Options class /// #if !SILVERLIGHT [System.Serializable] #endif public sealed class UsersIdsOptions : OptionalProperties { /// /// Gets or sets the cursor. /// /// The cursor. public long Cursor { get; set; } /// /// Gets or sets the ID of the user for whom to request a list of followers. /// /// The user id. public decimal UserId { get; set; } /// /// Gets or sets the screen name of the user for whom to request a list of followers. /// /// The name of the screen. public string ScreenName { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/UserIdCollection.cs0000644000175000017500000001017612132510633030353 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Edgardo Vega // The twitter list collection class. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Twitterizer.Core; /// /// The twitter list collection class. /// #if !SILVERLIGHT [Serializable] #endif public class UserIdCollection : TwitterIdCollection { /// /// Gets or sets the next cursor. /// /// The next cursor. public long NextCursor { get; set; } /// /// Gets or sets the previous cursor. /// /// The previous cursor. public long PreviousCursor { get; set; } /// /// Gets or sets information about the user's rate usage. /// /// The rate limiting object. public RateLimiting RateLimiting { get; set; } /// /// Deserializes the specified value. /// /// The value. /// internal static UserIdCollection DeserializeWrapper(JObject value) { if (value == null || value.SelectToken("ids") == null) return null; decimal[] parsedIds = JsonConvert.DeserializeObject(value.SelectToken("ids").ToString()); UserIdCollection result = new UserIdCollection { NextCursor = value.SelectToken("next_cursor").Value(), PreviousCursor = value.SelectToken("previous_cursor").Value() }; foreach (decimal t in parsedIds) { result.Add(t); } return result; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/IncomingFriendshipsOptions.cs0000644000175000017500000000475212132510633032465 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The optional parameters for the incoming friendship command. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The optional properties for the class. /// public class IncomingFriendshipsOptions : OptionalProperties { /// /// Gets or sets the cursor. /// /// The cursor. public long Cursor { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/TwitterFriendship.cs0000644000175000017500000006417312253423361030635 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The TwitterFriendship class. //----------------------------------------------------------------------- namespace Twitterizer { using Core; /// /// Provides interaction with the Twitter API to obtain and manage relationships between users. /// public static class TwitterFriendship { #region Followers /// /// Returns the authenticating user's followers, each with current status inline. /// /// The tokens. /// The options. /// /// A instance. /// public static TwitterResponse Followers(OAuthTokens tokens, FollowersOptions options) { Commands.FollowersCommand command = new Commands.FollowersCommand(tokens, options); return CommandPerformer.PerformAction(command); } /// /// Returns the authenticating user's followers, each with current status inline. /// /// The tokens. /// /// A instance. /// public static TwitterResponse Followers(OAuthTokens tokens) { return Followers(tokens, null); } /// /// Returns the authenticating user's followers, each with current status inline. /// /// The options. /// /// A instance. /// public static TwitterResponse Followers(FollowersOptions options) { return Followers(null, options); } #endregion #region Friends /// /// Returns a user's friends, each with current status inline. They are ordered by the order in which the user followed them, most recently followed first, 100 at a time. /// /// The tokens. /// The options. /// /// A instance. /// /// Please note that the result set isn't guaranteed to be 100 every time as suspended users will be filtered out. [System.Obsolete("This method is deprecated as it will only return information about users who have Tweeted recently. It is not a functional way to retrieve all of a users friends. Instead of using this method use a combination of friends/ids and users/lookup.")] public static TwitterResponse Friends(OAuthTokens tokens, FriendsOptions options) { Commands.FriendsCommand command = new Commands.FriendsCommand(tokens, options); return CommandPerformer.PerformAction(command); } /// /// Returns a user's friends, each with current status inline. They are ordered by the order in which the user followed them, most recently followed first, 100 at a time. /// /// The tokens. /// /// A instance. /// /// Please note that the result set isn't guaranteed to be 100 every time as suspended users will be filtered out. [System.Obsolete("This method is deprecated as it will only return information about users who have Tweeted recently. It is not a functional way to retrieve all of a users friends. Instead of using this method use a combination of friends/ids and users/lookup.")] public static TwitterResponse Friends(OAuthTokens tokens) { return Friends(tokens, null); } /// /// Returns a user's friends, each with current status inline. They are ordered by the order in which the user followed them, most recently followed first, 100 at a time. /// /// The options. /// /// A instance. /// /// Please note that the result set isn't guaranteed to be 100 every time as suspended users will be filtered out. [System.Obsolete("This method is deprecated as it will only return information about users who have Tweeted recently. It is not a functional way to retrieve all of a users friends. Instead of using this method use a combination of friends/ids and users/lookup.")] public static TwitterResponse Friends(FriendsOptions options) { return Friends(null, options); } #endregion #region Create Friendship /// /// Allows the authenticating users to follow the user specified in the userID parameter. /// /// The tokens. /// The user id. /// /// Returns the followed user in the requested format when successful. /// public static TwitterResponse Create(OAuthTokens tokens, decimal userId) { return Create(tokens, userId, null); } /// /// Allows the authenticating users to follow the user specified in the userID parameter. /// /// The tokens. /// The user id. /// The options. /// /// Returns the followed user in the requested format when successful. /// public static TwitterResponse Create(OAuthTokens tokens, decimal userId, CreateFriendshipOptions options) { Commands.CreateFriendshipCommand command = new Commands.CreateFriendshipCommand(tokens, userId, options); return CommandPerformer.PerformAction(command); } /// /// Allows the authenticating users to follow the user specified in the userName parameter. /// /// The tokens. /// The user name. /// /// Returns the followed user in the requested format when successful. /// public static TwitterResponse Create(OAuthTokens tokens, string userName) { return Create(tokens, userName, null); } /// /// Allows the authenticating users to follow the user specified in the userName parameter. /// /// The tokens. /// The user name. /// The options. /// /// Returns the followed user in the requested format when successful. /// public static TwitterResponse Create(OAuthTokens tokens, string userName, CreateFriendshipOptions options) { Commands.CreateFriendshipCommand command = new Commands.CreateFriendshipCommand(tokens, userName, options); return CommandPerformer.PerformAction(command); } #endregion #region Delete Friendship /// /// Allows the authenticating users to unfollow the user specified in the ID parameter. /// /// The tokens. /// The user id. /// /// Returns the unfollowed user in the requested format when successful. /// public static TwitterResponse Delete(OAuthTokens tokens, decimal userId) { return Delete(tokens, userId, null); } /// /// Allows the authenticating users to unfollow the user specified in the ID parameter. /// /// The tokens. /// The user id. /// The options. /// /// Returns the unfollowed user in the requested format when successful. /// public static TwitterResponse Delete(OAuthTokens tokens, decimal userId, OptionalProperties options) { Commands.DeleteFriendshipCommand command = new Commands.DeleteFriendshipCommand(tokens, userId, string.Empty, options); return CommandPerformer.PerformAction(command); } /// /// Allows the authenticating users to unfollow the user specified in the ID parameter. /// /// The tokens. /// The username. /// /// Returns the unfollowed user in the requested format when successful. /// public static TwitterResponse Delete(OAuthTokens tokens, string userName) { return Delete(tokens, userName, null); } /// /// Allows the authenticating users to unfollow the user specified in the ID parameter. /// /// The tokens. /// The username. /// The options. /// /// Returns the unfollowed user in the requested format when successful. /// public static TwitterResponse Delete(OAuthTokens tokens, string userName, OptionalProperties options) { Commands.DeleteFriendshipCommand command = new Commands.DeleteFriendshipCommand(tokens, 0, userName, options); return Core.CommandPerformer.PerformAction(command); } #endregion #region Show Friendship /// /// Returns detailed information about the relationship between two users. /// /// The tokens. /// The target user id. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, decimal targetUserId) { return Show(tokens, targetUserId, null); } /// /// Returns detailed information about the relationship between two users. /// /// The tokens. /// The target user id. /// The options. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, decimal targetUserId, OptionalProperties options) { return Show(tokens, 0, targetUserId, options); } /// /// Returns detailed information about the relationship between two users. /// /// The tokens. /// The source user id. /// The target user id. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, decimal sourceUseId, decimal targetUserId) { return Show(tokens, sourceUseId, targetUserId, null); } /// /// Returns detailed information about the relationship between two users. /// /// The tokens. /// The source user id. /// The target user id. /// The options. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, decimal sourceUseId, decimal targetUserId, OptionalProperties options) { Commands.ShowFriendshipCommand command = new Twitterizer.Commands.ShowFriendshipCommand( tokens, sourceUseId, string.Empty, targetUserId, string.Empty, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns detailed information about the relationship between two users. /// /// The tokens. /// The target user name. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, string targetUserName) { return Show(tokens, string.Empty, targetUserName, null); } /// /// Returns detailed information about the relationship between two users. /// /// The tokens. /// The target user name. /// The options. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, string targetUserName, OptionalProperties options) { return Show(tokens, string.Empty, targetUserName, options); } /// /// Returns detailed information about the relationship between two users. /// /// The tokens. /// The source user name. /// The target user name. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, string sourceUserName, string targetUserName) { return Show(tokens, sourceUserName, targetUserName, null); } /// /// Returns detailed information about the relationship between two users. /// /// The tokens. /// The source user name. /// The target user name. /// The options. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, string sourceUserName, string targetUserName, OptionalProperties options) { Commands.ShowFriendshipCommand command = new Twitterizer.Commands.ShowFriendshipCommand(tokens, 0, sourceUserName, 0, targetUserName, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns detailed information about the relationship between two users. /// /// The first user id. /// The second user id. /// /// A instance. /// public static TwitterResponse Show(decimal sourceUseId, decimal targetUserId) { return Show(null, sourceUseId, targetUserId, null); } /// /// Returns detailed information about the relationship between two users. /// /// The first username. /// The second username. /// /// A instance. /// public static TwitterResponse Show(string sourceUserName, string targetUserName) { return Show(null, sourceUserName, targetUserName, null); } #endregion #region User IDs lists /// /// Returns the numeric IDs for every user the specified user is friends with. /// /// The tokens. /// The options. /// /// A instance. /// public static TwitterResponse FriendsIds(OAuthTokens tokens, UsersIdsOptions options) { Commands.FriendsIdsCommand command = new Commands.FriendsIdsCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns the numeric IDs for every user the specified user is friends with. /// /// The tokens. /// /// A instance. /// public static TwitterResponse FriendsIds(OAuthTokens tokens) { return FriendsIds(tokens, null); } /// /// Returns the numeric IDs for every user the specified user is following. /// /// The tokens. /// The options. /// /// A instance. /// public static TwitterResponse FollowersIds(OAuthTokens tokens, UsersIdsOptions options) { Commands.FollowersIdsCommand command = new Commands.FollowersIdsCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns the numeric IDs for every user the specified user is following. /// /// The tokens. /// /// A instance. /// public static TwitterResponse FollowersIds(OAuthTokens tokens) { return FollowersIds(tokens, null); } #endregion /// /// Returns a collection of IDs for every user who has a pending request to follow the authenticating user. /// /// The tokens. /// The options. /// public static TwitterResponse IncomingRequests(OAuthTokens tokens, IncomingFriendshipsOptions options) { Commands.IncomingFriendshipsCommand command = new Commands.IncomingFriendshipsCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns a collection of IDs for every user who has a pending request to follow the authenticating user. /// /// The tokens. /// public static TwitterResponse IncomingRequests(OAuthTokens tokens) { return IncomingRequests(tokens, null); } /// /// Returns a collection of IDs for every protected user for whom the authenticating user has a pending follow request. /// /// The tokens. /// The options. /// public static TwitterResponse OutgoingRequests(OAuthTokens tokens, OutgoingFriendshipsOptions options) { Commands.OutgoingFriendshipsCommand command = new Commands.OutgoingFriendshipsCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns a collection of IDs for every protected user for whom the authenticating user has a pending follow request. /// /// The tokens. /// public static TwitterResponse OutgoingRequests(OAuthTokens tokens) { return OutgoingRequests(tokens, null); } /// /// Returns a collection of IDs that the user does not want to see retweets from. /// /// The tokens. /// The options. /// public static TwitterResponse NoRetweetIDs(OAuthTokens tokens, OptionalProperties options) { Commands.NoRetweetIDsCommand command = new Commands.NoRetweetIDsCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns a collection of IDs that the user does not want to see retweets from. /// /// The tokens. /// public static TwitterResponse NoRetweetIDs(OAuthTokens tokens) { return NoRetweetIDs(tokens, null); } /// /// Updates a friendship for a user. /// /// The tokens. /// The userid. /// The options. /// public static TwitterResponse Update(OAuthTokens tokens, decimal userid, UpdateFriendshipOptions options) { Commands.UpdateFriendshipCommand command = new Commands.UpdateFriendshipCommand(tokens, userid, options); return Core.CommandPerformer.PerformAction(command); } /// /// Updates a friendship for a user. /// /// The tokens. /// The userid. /// public static TwitterResponse Update(OAuthTokens tokens, decimal userid) { return Update(tokens, userid, null); } /// /// Updates a friendship for a user. /// /// The tokens. /// The screenname. /// The options. /// public static TwitterResponse Update(OAuthTokens tokens, string screenname, UpdateFriendshipOptions options) { Commands.UpdateFriendshipCommand command = new Commands.UpdateFriendshipCommand(tokens, screenname, options); return Core.CommandPerformer.PerformAction(command); } /// /// Updates a friendship for a user. /// /// The tokens. /// The screenname. /// public static TwitterResponse Update(OAuthTokens tokens, string screenname) { return Update(tokens, screenname, null); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/CreateFriendshipOptions.cs0000644000175000017500000000514012253423361031737 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ronak Patel // The create friendship options class. //----------------------------------------------------------------------- namespace Twitterizer { using System; /// /// The Create Friendship Options class /// #if !SILVERLIGHT [System.Serializable] #endif public sealed class CreateFriendshipOptions : OptionalProperties { /// /// Gets or sets a value indicating whether to enable delivery of statuses from this user to the authenticated user's device /// /// true if follow; otherwise, false. public bool Follow { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Friendship/OutgoingFriendshipsOptions.cs0000644000175000017500000000475312132510633032516 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The optional parameters for the incoming friendship command. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The optional properties for the class. /// public class OutgoingFriendshipsOptions : OptionalProperties { /// /// Gets or sets the cursor. /// /// The cursor. public long Cursor { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/0000755000175000017500000000000012253423361023440 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/FriendsCommand.cs0000644000175000017500000000740712132510633026663 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The command to obtain followers of a user. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The command to obtain followers of a user. /// #if !SILVERLIGHT [Serializable] #endif internal sealed class FriendsCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public FriendsCommand(OAuthTokens tokens, FriendsOptions options) : base(HTTPVerb.GET, "statuses/friends.json", tokens, options) { this.DeserializationHandler = TwitterUserCollection.DeserializeWrapper; } /// /// Initializes the command. /// public override void Init() { // Default values this.RequestParameters.Add("cursor", "-1"); FriendsOptions options = this.OptionalProperties as FriendsOptions; if (options == null) { return; } if (options.UserId > 0) this.RequestParameters.Add("user_id", options.UserId.ToString(CultureInfo.CurrentCulture)); if (!string.IsNullOrEmpty(options.ScreenName)) this.RequestParameters.Add("screen_name", options.ScreenName); // Override the default if (options.Cursor != 0) this.RequestParameters["cursor"] = options.Cursor.ToString(CultureInfo.CurrentCulture); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/RetweetedByIdsCommand.cs0000644000175000017500000000760212132510633030151 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Fabien Warniez // The retweeted by ids command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer; using Twitterizer.Core; /// /// The retweeted by ids command class. /// /// http://dev.twitter.com/doc/get/statuses/:id/retweeted_by/ids [AuthorizedCommandAttribute] internal class RetweetedByIdsCommand : TwitterCommand { public RetweetedByIdsCommand(OAuthTokens tokens, decimal statusId, RetweetedByIdsOptions options) : base(HTTPVerb.GET, string.Format("statuses/{0}/retweeted_by/ids.json", statusId), tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (statusId <= 0) { throw new ArgumentNullException("statusId", "Status ID is required."); } } /// /// Inits this instance. /// public override void Init() { RetweetedByIdsOptions options = this.OptionalProperties as RetweetedByIdsOptions; if (options == null) { this.RequestParameters.Add("page", "1"); return; } if (options.Count > 1) { this.RequestParameters.Add("count", options.Count.ToString()); } if (options.IncludeEntities) { this.RequestParameters.Add("include_entities", "true"); } if (options.TrimUser) { this.RequestParameters.Add("trim_user", "true"); } if (options.Page > 0) { this.RequestParameters.Add("page", options.Page.ToString()); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/TwitterUserCollection.cs0000644000175000017500000000761212132510633030305 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The collection class containing zero or more TwitterUser objects. //----------------------------------------------------------------------- namespace Twitterizer { using Twitterizer.Core; using Newtonsoft.Json.Linq; using Newtonsoft.Json; using System.Runtime.Serialization; /// /// The TwitterUserCollection class. /// #if !SILVERLIGHT [System.Serializable] #endif [DataContract] public class TwitterUserCollection : TwitterCollection, ITwitterObject { /// /// Gets or sets the next cursor. /// /// The next cursor. [DataMember] public long NextCursor { get; internal set; } /// /// Gets or sets the previous cursor. /// /// The previous cursor. [DataMember] public long PreviousCursor { get; internal set; } /// /// Gets or sets information about the user's rate usage. /// /// The rate limiting object. [DataMember] public RateLimiting RateLimiting { get; internal set; } /// /// Deserializes the specified value. /// /// The value. /// internal static TwitterUserCollection DeserializeWrapper(JObject value) { if (value == null || value.SelectToken("users") == null) { return null; } TwitterUserCollection result = JsonConvert.DeserializeObject(value.SelectToken("users").ToString()); result.NextCursor = value.SelectToken("next_cursor").Value(); result.PreviousCursor = value.SelectToken("previous_cursor").Value(); return result; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/UserSearchCommand.cs0000644000175000017500000000774412132510633027341 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The user search command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The User Search Command class. /// internal sealed class UserSearchCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The query. /// The options. public UserSearchCommand(OAuthTokens tokens, string query, UserSearchOptions options) : base(HTTPVerb.GET, "users/search.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (string.IsNullOrEmpty(query)) { throw new ArgumentNullException("query"); } this.Query = query; } /// /// Gets or sets the query. /// /// The query. public string Query { get; set; } /// /// Initializes the command. /// public override void Init() { this.RequestParameters.Add("q", this.Query); UserSearchOptions options = this.OptionalProperties as UserSearchOptions; if (options == null) { this.RequestParameters.Add("page", "1"); return; } if (options.NumberPerPage > 0) this.RequestParameters.Add("per_page", options.NumberPerPage.ToString(CultureInfo.InvariantCulture)); this.RequestParameters.Add("page", options.Page > 0 ? options.Page.ToString(CultureInfo.InvariantCulture) : "1"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/SuggestedUsersCommand.cs0000644000175000017500000000676212132510633030250 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The suggested users command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer.Core; /// /// The suggested users command class /// /// http://dev.twitter.com/doc/get/users/suggestions/:slug internal class SuggestedUsersCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The category slug. /// The options. public SuggestedUsersCommand(OAuthTokens tokens, string categorySlug, OptionalProperties options) : base(HTTPVerb.GET, string.Format("users/suggestions/{0}.json", categorySlug), tokens, options) { if (string.IsNullOrEmpty(categorySlug)) { throw new ArgumentNullException("categorySlug", "A category slug is required"); } this.Slug = categorySlug; } /// /// Gets or sets the slug. /// /// The slug. public string Slug { get; set; } /// /// Inits this instance. /// public override void Init() { this.RequestParameters.Add("slug", this.Slug); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/LookupUsersOptions.cs0000644000175000017500000000226712253423361027645 0ustar00meebeymeebey00000000000000namespace Twitterizer { using System.Collections.ObjectModel; /// /// Provides optional parameters for user lookup methods. /// public class LookupUsersOptions : OptionalProperties { /// /// Initializes a new instance of the class. /// public LookupUsersOptions() { this.ScreenNames = new Collection(); this.UserIds = new TwitterIdCollection(); } /// /// Gets or sets the screen names. /// /// The screen names. public Collection ScreenNames { get; set; } /// /// Gets or sets the user ids. /// /// The user ids. public TwitterIdCollection UserIds { get; set; } /// /// Gets or sets a value indicating whether [include entities]. /// /// true if [include entities]; otherwise, false. public bool IncludeEntities { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/RetweetedByOptions.cs0000644000175000017500000000646712132510633027576 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The retweeted by options class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The optional parameters for the class. /// public class RetweetedByOptions : OptionalProperties { /// /// Specifies the number of records to retrieve. Must be less than or equal to 100. /// /// The count. public int Count { get; set; } /// /// Specifies the page of results to retrieve. /// /// The page. public int Page { get; set; } /// /// When set to true each tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object. /// /// true if [trim user]; otherwise, false. public bool TrimUser { get; set; } /// /// Gets or sets a value indicating whether entities should be included in the results. /// /// true if entities should be included; otherwise, false. public bool IncludeEntities { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/LookupUsersCommand.cs0000644000175000017500000001014712132510633027557 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The user lookup command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Linq; /// /// The Lookup Users command class. /// #if !SILVERLIGHT [Serializable] #endif internal sealed class LookupUsersCommand : Core.TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The options. public LookupUsersCommand(OAuthTokens tokens, LookupUsersOptions options) : base(HTTPVerb.GET, "users/lookup.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (options == null) { throw new ArgumentNullException("options"); } if (options.ScreenNames.Count == 0 && options.UserIds.Count == 0) { throw new ArgumentException("At least one screen name or user id must be specified."); } } /// /// Inits this instance. /// public override void Init() { LookupUsersOptions options = this.OptionalProperties as LookupUsersOptions; if (options == null) { throw new NullReferenceException("The optional parameters class is not valid for this command."); } if (options.UserIds.Count > 0) this.RequestParameters.Add("user_id", string.Join(",", options.UserIds.Where(id => id > 0).Select(id => id.ToString()).ToArray())); if (options.ScreenNames.Count > 0) this.RequestParameters.Add("screen_name", string.Join(",", options.ScreenNames.ToArray())); if (options.IncludeEntities) this.RequestParameters.Add("include_entities", "true"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/FollowersCommand.cs0000644000175000017500000001053112132510633027235 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The command to obtain followers of a user. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The command to obtain followers of a user. /// #if !SILVERLIGHT [Serializable] #endif internal sealed class FollowersCommand : Core.TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public FollowersCommand(OAuthTokens tokens, FollowersOptions options) : base(HTTPVerb.GET, "statuses/followers.json", tokens, options) { if (tokens == null && options == null) { throw new ArgumentException("You must provide an authorization token or specify a user."); } if (tokens == null && options != null && options.UserId <= 0 && string.IsNullOrEmpty(options.ScreenName)) { throw new ArgumentException("Either a user id or screen name (but not both) must be supplied (using the options parameter) when called unauthorized."); } this.DeserializationHandler = TwitterUserCollection.DeserializeWrapper; } /// /// Initializes the command. /// public override void Init() { // Default values this.RequestParameters.Add("cursor", "-1"); // Handle optional parameters FollowersOptions options = this.OptionalProperties as FollowersOptions; if (options == null) { return; } if (options.UserId > 0) this.RequestParameters.Add("user_id", options.UserId.ToString(CultureInfo.CurrentCulture)); if (!string.IsNullOrEmpty(options.ScreenName)) this.RequestParameters.Add("screen_name", options.ScreenName); // Override the default if (options.Cursor != 0) this.RequestParameters["cursor"] = options.Cursor.ToString(CultureInfo.CurrentCulture); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/TwitterUser.cs0000644000175000017500000005152512132510633026273 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The TwitterUser class. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Diagnostics; #if !SILVERLIGHT using System.Drawing; #endif using Newtonsoft.Json; using Core; using System.Runtime.Serialization; /// [JsonObject(MemberSerialization.OptIn)] [DebuggerDisplay("@{ScreenName}")] #if !SILVERLIGHT [Serializable] #endif [DataContract] public class TwitterUser : TwitterObject { #region Properties /// /// Gets or sets the User ID. /// /// The User ID. [DataMember, JsonProperty(PropertyName = "id")] public decimal Id { get; set; } /// /// Gets or sets the string id. /// /// The string id. [DataMember, JsonProperty(PropertyName = "str_id")] public string StringId { get; set; } /// /// Gets or sets the name of the user. /// /// The name of the user. [DataMember, JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets the location. /// /// The location. [DataMember, JsonProperty(PropertyName = "location")] public string Location { get; set; } /// /// Gets or sets the description. /// /// The description. [DataMember, JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Gets or sets the status. /// /// The status. [DataMember, JsonProperty(PropertyName = "status")] public TwitterStatus Status { get; set; } /// /// Gets or sets the created date. /// /// The created date. [JsonProperty(PropertyName = "created_at")] [JsonConverter(typeof(TwitterizerDateConverter))] [DataMember] public DateTime? CreatedDate { get; set; } /// /// Gets or sets the time zone. /// /// The time zone. [DataMember, JsonProperty(PropertyName = "time_zone")] public string TimeZone { get; set; } /// /// Gets or sets the number of followers. /// /// The number of followers. [DataMember, JsonProperty(PropertyName = "followers_count")] public long? NumberOfFollowers { get; set; } /// /// Gets or sets the number of statuses. /// /// The number of statuses. [DataMember, JsonProperty(PropertyName = "statuses_count")] public long NumberOfStatuses { get; set; } /// /// Gets or sets the number of friends. /// /// The number of friends. [DataMember, JsonProperty(PropertyName = "friends_count")] public long NumberOfFriends { get; set; } /// /// Gets or sets a value indicating whether the user has enabled contributors access to his or her account. /// /// The is contributors enabled value. [DataMember, JsonProperty(PropertyName = "contributors_enabled")] public bool IsContributorsEnabled { get; set; } /// /// Gets or sets the language. /// /// The language. [DataMember, JsonProperty(PropertyName = "lang")] public string Language { get; set; } /// /// Gets or sets a value indicating whether the user receives notifications. /// /// /// true if the user receives notifications; otherwise, false. /// [DataMember, JsonProperty(PropertyName = "notifications")] public bool? DoesReceiveNotifications { get; set; } /// /// Gets or sets the screenname. /// /// The screenname. [DataMember, JsonProperty(PropertyName = "screen_name")] public string ScreenName { get; set; } /// /// Gets or sets a value indicating whether the authenticated user is following this user. /// /// /// true if the authenticated user is following this user; otherwise, false. /// [DataMember, JsonProperty(PropertyName = "following")] public bool? IsFollowing { get; set; } /// /// Gets or sets the a value indicating whether the authenticated user is followed by this user. /// /// The is followed by. [DataMember, JsonProperty(PropertyName = "followed_by")] public bool? IsFollowedBy { get; set; } /// /// Gets or sets the number of favorites. /// /// The number of favorites. [DataMember, JsonProperty(PropertyName = "favourites_count")] public long NumberOfFavorites { get; set; } /// /// Gets or sets a value indicating whether this user is protected. /// /// /// true if this user is protected; otherwise, false. /// [DataMember, JsonProperty(PropertyName = "protected")] public bool IsProtected { get; set; } /// /// Gets or sets a value indicating whether this user is geo enabled. /// /// /// true if this user is geo enabled; otherwise, false. /// [DataMember, JsonProperty(PropertyName = "geo_enabled")] public bool? IsGeoEnabled { get; set; } /// /// Gets or sets the time zone offset. /// /// The time zone offset. /// Also called the Coordinated Universal Time (UTC) offset. [DataMember, JsonProperty(PropertyName = "utc_offset")] public double? TimeZoneOffset { get; set; } /// /// Gets or sets the user's website. /// /// The website address. [DataMember, JsonProperty(PropertyName = "url")] public string Website { get; set; } /// /// Gets or sets the listed count. /// /// The listed count. [DataMember, JsonProperty(PropertyName = "listed_count")] public int ListedCount { get; set; } /// /// Gets or sets a value indicating whether [follow request sent]. /// /// true if [follow request sent]; otherwise, false. [DataMember, JsonProperty(PropertyName = "follow_request_sent")] public bool? FollowRequestSent { get; set; } /// /// Gets or sets a value indicating whether the user is verified. /// /// true if the user is verified; otherwise, false. [DataMember, JsonProperty(PropertyName = "verified")] public bool? Verified { get; set; } #region Profile Layout Properties /// /// Gets or sets the color of the profile background. /// /// The color of the profile background. [DataMember, JsonProperty(PropertyName = "profile_background_color")] public string ProfileBackgroundColorString { get; set; } #if !SILVERLIGHT /// /// Gets the color of the profile background. /// /// The color of the profile background. [DataMember] public Color ProfileBackgroundColor { get { return ConversionUtility.FromTwitterString(this.ProfileBackgroundColorString); } } #endif /// /// Gets or sets a value indicating whether this user's profile background image is tiled. /// /// /// true if this user's profile background image is tiled; otherwise, false. /// [DataMember, JsonProperty(PropertyName = "profile_background_tile")] public bool? IsProfileBackgroundTiled { get; set; } /// /// Gets or sets the color of the profile link. /// /// The color of the profile link. [DataMember, JsonProperty(PropertyName = "profile_link_color")] public string ProfileLinkColorString { get; set; } #if !SILVERLIGHT /// /// Gets the color of the profile link. /// /// The color of the profile link. [DataMember] public Color ProfileLinkColor { get { return ConversionUtility.FromTwitterString(this.ProfileLinkColorString); } } #endif /// /// Gets or sets the profile background image location. /// /// The profile background image location. [DataMember, JsonProperty(PropertyName = "profile_background_image_url")] public string ProfileBackgroundImageLocation { get; set; } /// /// Gets or sets the color of the profile text. /// /// The color of the profile text. [DataMember, JsonProperty(PropertyName = "profile_text_color")] public string ProfileTextColorString { get; set; } #if !SILVERLIGHT /// /// Gets the color of the profile text. /// /// The color of the profile text. [DataMember] public Color ProfileTextColor { get { return ConversionUtility.FromTwitterString(this.ProfileTextColorString); } } #endif /// /// Gets or sets the profile image location. /// /// The profile image location. [DataMember, JsonProperty(PropertyName = "profile_image_url")] public string ProfileImageLocation { get; set; } /// /// Gets or sets the secure profile image location (https). /// /// The profile image location. [DataMember, JsonProperty(PropertyName = "profile_image_url_https")] public string ProfileImageSecureLocation { get; set; } /// /// Gets or sets the color of the profile sidebar border. /// /// The color of the profile sidebar border. [DataMember, JsonProperty(PropertyName = "profile_sidebar_border_color")] public string ProfileSidebarBorderColorString { get; set; } #if !SILVERLIGHT /// /// Gets the color of the profile sidebar border. /// /// The color of the profile sidebar border. [DataMember] public Color ProfileSidebarBorderColor { get { return ConversionUtility.FromTwitterString(this.ProfileSidebarBorderColorString); } } #endif #endregion #endregion /// /// public static TwitterResponse Show(OAuthTokens tokens, decimal id, OptionalProperties options) { Commands.ShowUserCommand command = new Commands.ShowUserCommand(tokens, id, string.Empty, options); return Core.CommandPerformer.PerformAction(command); } /// /// public static TwitterResponse Show(decimal id, OptionalProperties options) { return Show(null, id, options); } /// /// public static TwitterResponse Show(OAuthTokens tokens, decimal id) { return Show(tokens, id, null); } /// /// public static TwitterResponse Show(decimal id) { return Show(null, id, null); } /// /// public static TwitterResponse Show(OAuthTokens tokens, string username, OptionalProperties options) { Commands.ShowUserCommand command = new Commands.ShowUserCommand(tokens, 0, username, options); return Core.CommandPerformer.PerformAction(command); } /// /// public static TwitterResponse Show(string username, OptionalProperties options) { return Show(null, username, options); } /// /// public static TwitterResponse Show(OAuthTokens tokens, string username) { return Show(tokens, username, null); } /// /// public static TwitterResponse Show(string username) { return Show(null, username, null); } /// /// public static TwitterResponse Search(OAuthTokens tokens, string query, UserSearchOptions options) { Commands.UserSearchCommand command = new Commands.UserSearchCommand(tokens, query, options); return Core.CommandPerformer.PerformAction(command); } /// /// public static TwitterResponse Search(OAuthTokens tokens, string query) { return Search(tokens, query, null); } /// /// Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two. /// /// The tokens. /// The options. /// public static TwitterResponse Lookup(OAuthTokens tokens, LookupUsersOptions options) { Commands.LookupUsersCommand command = new Commands.LookupUsersCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } #region Retweeted By /// /// Show user objects of up to 100 members who retweeted the status. /// /// The tokens. /// The status id. /// The options. /// A collection of user objects. public static TwitterResponse RetweetedBy(OAuthTokens tokens, decimal statusId, RetweetedByOptions options) { Commands.RetweetedByCommand command = new Commands.RetweetedByCommand(tokens, statusId, options); return Core.CommandPerformer.PerformAction(command); } /// /// Show user objects of up to 100 members who retweeted the status. /// /// The tokens. /// The status id. /// A collection of user objects. public static TwitterResponse RetweetedBy(OAuthTokens tokens, decimal statusId) { return RetweetedBy(tokens, statusId, null); } /// /// Show user ids of up to 100 members who retweeted the status. /// /// The tokens. /// The status id. /// The options. /// A collection of user ids. public static TwitterResponse RetweetedByIds(OAuthTokens tokens, decimal statusId, RetweetedByIdsOptions options) { Commands.RetweetedByIdsCommand command = new Commands.RetweetedByIdsCommand(tokens, statusId, options); return Core.CommandPerformer.PerformAction(command); } /// /// Show user ids of up to 100 members who retweeted the status. /// /// The tokens. /// The status id. /// A collection of user ids. public static TwitterResponse RetweetedByIds(OAuthTokens tokens, decimal statusId) { return RetweetedByIds(tokens, statusId, null); } #endregion } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/SuggestedUserCategoriesCommand.cs0000644000175000017500000000607312132510633032066 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The suggested user categories command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer; using Twitterizer.Core; /// /// The suggested users categories command /// /// http://dev.twitter.com/doc/get/users/suggestions #if !SILVERLIGHT [Serializable] #endif internal class SuggestedUserCategoriesCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The options. public SuggestedUserCategoriesCommand(OAuthTokens tokens, OptionalProperties options) : base(HTTPVerb.GET, "users/suggestions.json", tokens, options) { } /// /// Inits this instance. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/FriendsOptions.cs0000644000175000017500000000560112132510633026732 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The friends options class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The friends options class. Provides a payload for optional parameters of the class. /// #if !SILVERLIGHT [System.Serializable] #endif public class FriendsOptions : OptionalProperties { /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; set; } /// /// Gets or sets the user's screen name. /// /// The screen name of the user. public string ScreenName { get; set; } /// /// Gets or sets the cursor. /// /// The cursor. public long Cursor { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/RetweetedByCommand.cs0000644000175000017500000000754512132510633027517 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The retweeted by command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer; using Twitterizer.Core; /// /// The retweeted by command class. /// /// http://dev.twitter.com/doc/get/statuses/:id/retweeted_by [AuthorizedCommandAttribute] internal class RetweetedByCommand : TwitterCommand { public RetweetedByCommand(OAuthTokens tokens, decimal statusId, RetweetedByOptions options) : base(HTTPVerb.GET, string.Format("statuses/{0}/retweeted_by.json", statusId), tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (statusId <= 0) { throw new ArgumentNullException("statusId", "Status ID is required."); } } /// /// Inits this instance. /// public override void Init() { RetweetedByOptions options = this.OptionalProperties as RetweetedByOptions; if (options == null) { this.RequestParameters.Add("page", "1"); return; } if (options.Count > 1) { this.RequestParameters.Add("count", options.Count.ToString()); } if (options.IncludeEntities) { this.RequestParameters.Add("include_entities", "true"); } if (options.TrimUser) { this.RequestParameters.Add("trim_user", "true"); } if (options.Page > 0) { this.RequestParameters.Add("page", options.Page.ToString()); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/FollowersOptions.cs0000644000175000017500000000567612132510633027330 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The follower options class //----------------------------------------------------------------------- namespace Twitterizer { /// /// The followers options class. Provides a payload for optional parameters of the FollowersCommand class. /// #if !SILVERLIGHT [System.Serializable] #endif public class FollowersOptions : OptionalProperties { /// /// Gets or sets the ID of the user for whom to request a list of followers. /// /// The user id. public decimal UserId { get; set; } /// /// Gets or sets the screen name of the user for whom to request a list of followers. /// /// The name of the screen. public string ScreenName { get; set; } /// /// Gets or sets the cursor. /// /// The cursor. public long Cursor { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/RetweetedByIdsOptions.cs0000644000175000017500000000660512132510633030230 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // The retweeted by ids options class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The optional properties class for the method. /// /// public class RetweetedByIdsOptions : OptionalProperties { /// /// Specifies the number of records to retrieve. Must be less than or equal to 100. /// /// The count. public int Count { get; set; } /// /// Specifies the page of results to retrieve. /// /// The page. public int Page { get; set; } /// /// When set to true each tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object. /// /// true if [trim user]; otherwise, false. public bool TrimUser { get; set; } /// /// Gets or sets a value indicating whether entities should be included in the results. /// /// true if entities should be included; otherwise, false. public bool IncludeEntities { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/UserSearchOptions.cs0000644000175000017500000000537012132510633027407 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The user search options class //----------------------------------------------------------------------- namespace Twitterizer { /// /// The user search options class. Provides a payload for optional parameters of the UserSearchCommand class. /// #if !SILVERLIGHT [System.Serializable] #endif public class UserSearchOptions : OptionalProperties { /// /// Gets or sets the number per page. Cannot be greater than 20. /// /// The number per page. public int NumberPerPage { get; set; } /// /// Gets or sets the page of results to retrieve. /// /// The page of results to retrieve. public int Page { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/ShowUserCommand.cs0000644000175000017500000001012612132510633027040 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The 'Show User' command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The Show User Command /// /// http://dev.twitter.com/doc/get/users/show #if !SILVERLIGHT [Serializable] #endif internal sealed class ShowUserCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The user id. /// The username. /// The options. public ShowUserCommand(OAuthTokens tokens, decimal userId, string username, OptionalProperties options) : base(HTTPVerb.GET, "users/show.json", tokens, options) { if ((userId <= 0 && string.IsNullOrEmpty(username)) || (userId > 0 && !string.IsNullOrEmpty(username))) { throw new ArgumentException("Either userId or username must be supplied, but not both."); } this.UserId = userId; this.Username = username; } /// /// Gets or sets the user ID. /// /// The user ID. public decimal UserId { get; set; } /// /// Gets or sets the name of the user. /// /// The name of the user. public string Username { get; set; } /// /// Inits this instance. /// public override void Init() { if (this.UserId > 0) this.RequestParameters.Add("user_id", this.UserId.ToString(CultureInfo.CurrentCulture)); if (!string.IsNullOrEmpty(this.Username)) this.RequestParameters.Add("screen_name", this.Username); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/User/TwitterUserCategory.cs0000644000175000017500000001467712132510633030000 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The TwitterUserCategory and TwitterUserCategoryCollection classes. //----------------------------------------------------------------------- namespace Twitterizer { using System; using Newtonsoft.Json; using Twitterizer.Core; /// /// Represents a suggested user category /// #if !SILVERLIGHT [Serializable] #endif public class TwitterUserCategory : Core.TwitterObject { /// /// Gets or sets the name. /// /// The name. [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets the slug. /// /// The slug. [JsonProperty(PropertyName = "slug")] public string Slug { get; set; } /// /// Gets or sets the number of users. /// Only available in list of categories. /// /// The number of users. [JsonProperty(PropertyName = "size")] public int NumberOfUsers { get; set; } /// /// Gets or sets the users. /// Users are only returned for a single category. /// /// The users. [JsonProperty(PropertyName = "users")] public TwitterUserCollection Users { get; set; } /// /// Access to Twitter's suggested user list. This returns the list of suggested user categories. The category can be used in the users/suggestions/category endpoint to get the users in that category. /// /// The tokens. /// The options. /// A collection of categories without user data. public static TwitterResponse SuggestedUserCategories(OAuthTokens tokens, OptionalProperties options) { Commands.SuggestedUserCategoriesCommand command = new Commands.SuggestedUserCategoriesCommand(tokens, options); return CommandPerformer.PerformAction(command); } /// /// Access to Twitter's suggested user list. This returns the list of suggested user categories. The category can be used in the users/suggestions/category endpoint to get the users in that category. /// /// The tokens. /// /// A collection of categories without user data. /// public static TwitterResponse SuggestedUserCategories(OAuthTokens tokens) { return SuggestedUserCategories(tokens, null); } /// /// Access the users in a given category of the Twitter suggested user list. /// /// The tokens. /// The category slug. /// The options. /// /// It is recommended that end clients cache this data for no more than one hour. public static TwitterResponse SuggestedUsers(OAuthTokens tokens, string categorySlug, OptionalProperties options) { Commands.SuggestedUsersCommand command = new Commands.SuggestedUsersCommand(tokens, categorySlug, options); return CommandPerformer.PerformAction(command); } /// /// Access the users in a given category of the Twitter suggested user list. /// /// The tokens. /// The category slug. /// /// It is recommended that end clients cache this data for no more than one hour. public static TwitterResponse SuggestedUsers(OAuthTokens tokens, string categorySlug) { return SuggestedUsers(tokens, categorySlug, null); } } /// /// Represents a suggested category /// #if !SILVERLIGHT [Serializable] #endif public class TwitterUserCategoryCollection : Core.TwitterCollection, ITwitterObject { // This intentionally left blank. // Check out Girl Talk. He's a great DJ. } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/SavedSearches/0000755000175000017500000000000012132510633025235 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/SavedSearches/TwitterSavedSearchCollection.cs0000644000175000017500000000460112132510633033354 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The collection of TwitterSavedSearch objects. //----------------------------------------------------------------------- namespace Twitterizer { using System; using Twitterizer.Core; /// /// The TwitterSavedSearchCollection class. /// #if !SILVERLIGHT [Serializable] #endif public class TwitterSavedSearchCollection : TwitterCollection, ITwitterObject { } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/SavedSearches/TwitterSavedSearch.cs0000644000175000017500000001641112132510633031342 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The twitter saved search class. //----------------------------------------------------------------------- namespace Twitterizer { using System; using Twitterizer.Core; /// /// The TwitterSavedSearch class. Provides static methods for manipulating saved searches tweets. /// #if !SILVERLIGHT [Serializable] #endif public sealed class TwitterSavedSearch : TwitterObject { ///// ///// Prevents a default instance of the TwitterSavedSearch class from being created. ///// //private TwitterSavedSearch() //{ //} /// /// Gets or sets the Id. /// /// The Id of the saved search. public decimal Id { get; set; } /// /// Gets or sets the name. /// /// The name of the saved search. public string Name { get; set; } /// /// Gets or sets the query. /// /// The query. public string Query { get; set; } /// /// Gets or sets the position. /// /// The position. public int? Position { get; set; } /// /// Gets or sets the created at date time. /// /// The created at. public DateTime CreatedAt { get; set; } /// /// Creates the saved search specified in the query parameter as the authenticating user. /// /// The tokens. /// The query. /// The options. /// The saved search when successful. public static TwitterResponse Create(OAuthTokens tokens, string query, OptionalProperties options) { return CommandPerformer.PerformAction( new Commands.CreateSavedSearchCommand(tokens, query, options)); } /// /// Creates the saved search specified in the query parameter as the authenticating user. /// /// The tokens. /// The query. /// The saved search when successful. public static TwitterResponse Create(OAuthTokens tokens, string query) { return Create(tokens, query, null); } /// /// Deletes the saved search specified in the ID parameter as the authenticating user. /// /// The tokens. /// The saved search id. /// The options. /// The deleted saved search in the requested format when successful. public static TwitterResponse Delete(OAuthTokens tokens, decimal savedsearchId, OptionalProperties options) { return CommandPerformer.PerformAction( new Commands.DeleteSavedSearchCommand(tokens, savedsearchId, options)); } /// /// Deletes the saved search specified in the ID parameter as the authenticating user. /// /// The tokens. /// The saved search id. /// /// The deleted saved search in the requested format when successful /// public static TwitterResponse Delete(OAuthTokens tokens, decimal savedsearchId) { return Delete(tokens, savedsearchId, null); } /// /// Returns the the authenticating user's saved search queries in the requested format. /// /// The tokens. /// The options. /// The saved searches public static TwitterResponse SavedSearches(OAuthTokens tokens, OptionalProperties options) { return CommandPerformer.PerformAction( new Commands.SavedSearchesCommand(tokens, options)); } /// /// Returns the the authenticating user's saved search queries in the requested format. /// /// The tokens. /// The saved searches public static TwitterResponse SavedSearches(OAuthTokens tokens) { return SavedSearches(tokens, null); } /// /// Returns the the authenticating user's saved search queries in the requested format. /// /// The options. /// The saved searches public static TwitterResponse SavedSearches(OptionalProperties options) { return SavedSearches(null, options); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/SavedSearches/DeleteSavedSearchCommand.cs0000644000175000017500000000721212132510633032400 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The delete saved search command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The delete saved search command class. /// Deletes the saved search specified in the ID parameter as the authenticating user. /// Returns the deleted saved search in the requested format when successful. /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class DeleteSavedSearchCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The savedsearch id. /// The options. /// public DeleteSavedSearchCommand(OAuthTokens tokens, decimal savedsearchId, OptionalProperties options) : base(HTTPVerb.POST, string.Format(CultureInfo.InvariantCulture.NumberFormat, "saved_searches/destroy/{0}.json", savedsearchId), tokens, options) { if (savedsearchId <= 0) { throw new ArgumentException("Saved Search Id is required."); } if (tokens == null) { throw new ArgumentNullException("tokens"); } } /// /// Initializes the command. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/SavedSearches/CreateSavedSearchCommand.cs0000644000175000017500000000752512132510633032410 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The create saved search command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The Create Saved Search Command class. Creates the Saved Search with the query provided as the authenticating user. Returns the saved search when successful. /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class CreateSavedSearchCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The query. /// The options. public CreateSavedSearchCommand(OAuthTokens tokens, string query, OptionalProperties options) : base(HTTPVerb.POST, "saved_searches/create.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (String.IsNullOrEmpty(query)) { throw new ArgumentException("Query is required."); } this.Query = query; } /// /// Gets or sets the query. /// /// The query. public string Query { get; internal set; } /// /// Initializes the command. /// public override void Init() { if (!String.IsNullOrEmpty(this.Query)) { this.RequestParameters.Add("query", this.Query.ToString(CultureInfo.InvariantCulture)); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/SavedSearches/SavedSearchesCommand.cs0000644000175000017500000000623212132510633031606 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The saved searches command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The Saved Searches Command class. Returns the saved searches collection when successful. /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class SavedSearchesCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The options. public SavedSearchesCommand(OAuthTokens tokens, OptionalProperties options) : base(HTTPVerb.GET, "saved_searches.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } } /// /// Initializes the command. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/DirectMessage/0000755000175000017500000000000012253423361025241 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/DirectMessage/TwitterDirectMessageCollection.cs0000644000175000017500000000457012132510633033707 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The Direct Message Collection class //----------------------------------------------------------------------- namespace Twitterizer { using Twitterizer.Core; using System; /// /// The Direct Message Collection class /// #if !SILVERLIGHT [Serializable] #endif public class TwitterDirectMessageCollection : TwitterCollection, ITwitterObject { } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/DirectMessage/TwitterDirectMessage.cs0000644000175000017500000003140412253423361031674 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The direct message entity class //----------------------------------------------------------------------- namespace Twitterizer { using System; using Newtonsoft.Json; using Twitterizer.Core; /// /// The Direct Message Entity Class /// [JsonObject(MemberSerialization = MemberSerialization.OptIn)] #if !SILVERLIGHT [Serializable] #endif public class TwitterDirectMessage : TwitterObject { #region Properties /// /// Gets or sets the direct message id. /// /// The direct message id. [JsonProperty(PropertyName = "id")] public decimal Id { get; set; } /// /// Gets or sets the sender id. /// /// The sender id. [JsonProperty(PropertyName = "sender_id")] public decimal SenderId { get; set; } /// /// Gets or sets the direct message text. /// /// The direct message text. [JsonProperty(PropertyName = "text")] public string Text { get; set; } /// /// Gets or sets the recipient id. /// /// The recipient id. [JsonProperty(PropertyName = "recipient_id")] public decimal RecipientId { get; set; } /// /// Gets or sets the created date. /// /// The created date. [JsonProperty(PropertyName = "created_at")] [JsonConverter(typeof(TwitterizerDateConverter))] public DateTime CreatedDate { get; set; } /// /// Gets or sets the name of the sender screen. /// /// The name of the sender screen. [JsonProperty(PropertyName = "sender_screen_name")] public string SenderScreenName { get; set; } /// /// Gets or sets the name of the recipient screen. /// /// The name of the recipient screen. [JsonProperty(PropertyName = "recipient_screen_name")] public string RecipientScreenName { get; set; } /// /// Gets or sets the sender. /// /// The sender. [JsonProperty(PropertyName = "sender")] public TwitterUser Sender { get; set; } /// /// Gets or sets the recipient. /// /// The recipient. [JsonProperty(PropertyName = "recipient")] public TwitterUser Recipient { get; set; } /// /// Gets or sets the entities. /// /// The entities. [JsonProperty(PropertyName = "entities")] [JsonConverter(typeof(Entities.TwitterEntityCollection.Converter))] public Entities.TwitterEntityCollection Entities { get; set; } #endregion /// /// Returns a list of the 20 most recent direct messages sent to the authenticating user. /// /// The tokens. /// A instance. public static TwitterResponse DirectMessages(OAuthTokens tokens) { return DirectMessages(tokens, null); } /// /// Returns a list of the 20 most recent direct messages sent to the authenticating user. /// /// The tokens. /// The options. /// /// A instance. /// public static TwitterResponse DirectMessages(OAuthTokens tokens, DirectMessagesOptions options) { return CommandPerformer.PerformAction(new Commands.DirectMessagesCommand(tokens, options)); } /// /// Returns a list of the 20 most recent direct messages sent by the authenticating user. /// /// The tokens. /// /// A instance. /// public static TwitterResponse DirectMessagesSent(OAuthTokens tokens) { return DirectMessagesSent(tokens, null); } /// /// Sends a new direct message to the specified user from the authenticating user. /// /// The OAuth tokens. /// The user id. /// The text of your direct message. /// The options. /// /// A instance. /// public static TwitterResponse Send(OAuthTokens tokens, decimal userId, string text, OptionalProperties options) { Commands.SendDirectMessageCommand command = new Commands.SendDirectMessageCommand(tokens, text, userId, options); TwitterResponse result = Core.CommandPerformer.PerformAction(command); return result; } /// /// Sends a new direct message to the specified user from the authenticating user. /// /// The OAuth tokens. /// The user id. /// The text of your direct message. /// /// A instance. /// public static TwitterResponse Send(OAuthTokens tokens, decimal userId, string text) { return Send(tokens, userId, text, null); } /// /// Sends a new direct message to the specified user from the authenticating user. /// /// The OAuth tokens. /// The user's screen name. /// The message text. /// The options. /// A object of the created direct message. public static TwitterResponse Send(OAuthTokens tokens, string screenName, string text, OptionalProperties options) { Commands.SendDirectMessageCommand command = new Commands.SendDirectMessageCommand(tokens, text, screenName, options); TwitterResponse result = Core.CommandPerformer.PerformAction(command); return result; } /// /// Sends a new direct message to the specified user from the authenticating user. /// /// The OAuth tokens. /// The user's screen name. /// The message text. /// A object of the created direct message. public static TwitterResponse Send(OAuthTokens tokens, string screenName, string text) { return Send(tokens, screenName, text, null); } /// /// Returns a list of the 20 most recent direct messages sent by the authenticating user. /// /// The tokens. /// The options. /// /// A instance. /// public static TwitterResponse DirectMessagesSent(OAuthTokens tokens, DirectMessagesSentOptions options) { return CommandPerformer.PerformAction(new Commands.DirectMessagesSentCommand(tokens, options)); } /// /// Deletes this direct message. /// /// The tokens. /// The options. /// /// A instance. /// public TwitterResponse Delete(OAuthTokens tokens, OptionalProperties options) { Commands.DeleteDirectMessageCommand command = new Commands.DeleteDirectMessageCommand(tokens, this.Id, options); TwitterResponse result = Core.CommandPerformer.PerformAction(command); return result; } /// /// Deletes this direct message. /// /// The tokens. /// The direct message id. /// The options. /// /// A instance. /// public static TwitterResponse Delete(OAuthTokens tokens, decimal id, OptionalProperties options) { Commands.DeleteDirectMessageCommand command = new Commands.DeleteDirectMessageCommand(tokens, id, options); TwitterResponse result = Core.CommandPerformer.PerformAction(command); return result; } /// /// Returns a single direct message, specified by an id parameter. Like the /1/direct_messages.format request, this method will include the user objects of the sender and recipient. /// /// The tokens. /// The id. /// The options. /// /// public static TwitterResponse Show(OAuthTokens tokens, decimal id, OptionalProperties options) { Commands.ShowDirectMessageCommand command = new Commands.ShowDirectMessageCommand(tokens, id, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns the status text with HTML links to users, urls, and hashtags. /// /// public string LinkifiedText() { return TwitterStatus.LinkifiedText(Entities, Text); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/DirectMessage/DeleteDirectMessageCommand.cs0000644000175000017500000000720512132510633032730 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The Delete Direct Message Command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The Delete Direct Message Command class. /// [AuthorizedCommand] #if !SILVERLIGHT [Serializable] #endif internal sealed class DeleteDirectMessageCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The status id. /// The options. public DeleteDirectMessageCommand(OAuthTokens tokens, decimal id, OptionalProperties options) : base(HTTPVerb.POST, string.Format(CultureInfo.InvariantCulture, "direct_messages/destroy/{0}.json", id), tokens, options) { if (id <= 0) { throw new ArgumentException("The message id is invalid", "id"); } if (tokens == null) { throw new ArgumentNullException("tokens"); } this.Id = id; } #endregion /// /// Gets or sets the status id. /// /// The status id. public decimal Id { get; set; } /// /// Initializes the command. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/DirectMessage/SendDirectMessageCommand.cs0000644000175000017500000001353212132510633032417 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The Send Direct Message Command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The Send Direct Message Command class /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class SendDirectMessageCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The message text. /// The user id. /// The options. public SendDirectMessageCommand(OAuthTokens tokens, string text, decimal userId, OptionalProperties options) : this(tokens, text, options) { if (userId <= 0) { throw new ArgumentException("User Id must be supplied", "userId"); } this.RecipientUserId = userId; } /// /// Initializes a new instance of the class. /// /// The tokens. /// The message text. /// Name of the user. /// The options. public SendDirectMessageCommand(OAuthTokens tokens, string text, string userName, OptionalProperties options) : this(tokens, text, options) { if (string.IsNullOrEmpty(userName)) { throw new ArgumentNullException("userName"); } this.RecipientUserName = userName; } /// /// Initializes a new instance of the class. /// /// The tokens. /// The message text. /// The options. private SendDirectMessageCommand(OAuthTokens tokens, string text, OptionalProperties options) : base(HTTPVerb.POST, "direct_messages/new.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (string.IsNullOrEmpty(text)) { throw new ArgumentNullException("text"); } this.Text = text; } #region Properties /// /// Gets or sets the status text. /// /// The status text. public string Text { get; set; } /// /// Gets or sets the recipient user id. /// /// The recipient user id. public decimal RecipientUserId { get; set; } /// /// Gets or sets the name of the recipient user. /// /// The name of the recipient user. public string RecipientUserName { get; set; } #endregion /// /// Initializes the command. /// public override void Init() { this.RequestParameters.Add("text", this.Text); if (this.RecipientUserId > 0) this.RequestParameters.Add("user_id", this.RecipientUserId.ToString(CultureInfo.InvariantCulture)); if (!string.IsNullOrEmpty(this.RecipientUserName) && this.RecipientUserId <= 0) this.RequestParameters.Add("screen_name", this.RecipientUserName); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/DirectMessage/DirectMessagesSentCommand.cs0000644000175000017500000001015612132510633032621 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The Direct Messages Sent Command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The Direct Messages Sent Command class /// [AuthorizedCommand] #if !SILVERLIGHT [Serializable] #endif internal sealed class DirectMessagesSentCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public DirectMessagesSentCommand(OAuthTokens tokens, DirectMessagesSentOptions options) : base(HTTPVerb.GET, "direct_messages/sent.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } } /// /// Initializes the command. /// public override void Init() { DirectMessagesSentOptions options = this.OptionalProperties as DirectMessagesSentOptions; if (options == null) { this.RequestParameters.Add("page", "1"); return; } if (options.SinceStatusId > 0) this.RequestParameters.Add("since_id", options.SinceStatusId.ToString(CultureInfo.InvariantCulture)); if (options.MaxStatusId > 0) this.RequestParameters.Add("max_id", options.MaxStatusId.ToString(CultureInfo.InvariantCulture)); if (options.Count > 0) this.RequestParameters.Add("count", options.Count.ToString(CultureInfo.InvariantCulture)); if (options.IncludeEntites) this.RequestParameters.Add("include_entities", "true"); this.RequestParameters.Add("page", options.Page > 0 ? options.Page.ToString(CultureInfo.InvariantCulture) : "1"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/DirectMessage/DirectMessagesCommand.cs0000644000175000017500000001011412132510633031761 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The Direct Messages Command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The Direct Messages Command /// [AuthorizedCommandAttribute] internal sealed class DirectMessagesCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public DirectMessagesCommand(OAuthTokens tokens, DirectMessagesOptions options) : base(HTTPVerb.GET, "direct_messages.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } } #endregion /// /// Initializes the command. /// public override void Init() { DirectMessagesOptions options = this.OptionalProperties as DirectMessagesOptions; if (options == null) { this.RequestParameters.Add("page", "1"); return; } if (options.SinceStatusId > 0) this.RequestParameters.Add("since_id", options.SinceStatusId.ToString(CultureInfo.InvariantCulture)); if (options.MaxStatusId > 0) this.RequestParameters.Add("max_id", options.MaxStatusId.ToString(CultureInfo.InvariantCulture)); if (options.Count > 0) this.RequestParameters.Add("count", options.Count.ToString(CultureInfo.InvariantCulture)); if (options.IncludeEntites) this.RequestParameters.Add("include_entities", "true"); this.RequestParameters.Add("page", options.Page > 0 ? options.Page.ToString(CultureInfo.InvariantCulture) : "1"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/DirectMessage/ShowDirectMessageCommand.cs0000644000175000017500000000645312253423361032457 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2011, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The Show Direct Message Command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; /// /// /// /// internal sealed class ShowDirectMessageCommand : Core.TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The id. /// The options. /// internal ShowDirectMessageCommand(OAuthTokens tokens, decimal id, OptionalProperties options) : base(HTTPVerb.GET, string.Format("direct_messages/{0}.json", id), tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens", "The tokens parameter is required."); } if (id <= 0) { throw new ArgumentOutOfRangeException("id", "The id parameter must be greater than zero."); } } /// /// Inits this instance. /// /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/DirectMessage/DirectMessagesOptions.cs0000644000175000017500000000715112253423361032052 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The direct messages options class. //----------------------------------------------------------------------- namespace Twitterizer { using System; /// /// The direct messages options class. Provides a payload for the command. /// #if !SILVERLIGHT [Serializable] #endif public sealed class DirectMessagesOptions : OptionalProperties { /// /// Initializes a new instance of the class. /// public DirectMessagesOptions() { this.Page = 1; } /// /// Gets or sets the minimum (earliest) status id to request. /// /// The since id. public decimal SinceStatusId { get; set; } /// /// Gets or sets the max (latest) status id to request. /// /// The max id. public decimal MaxStatusId { get; set; } /// /// Gets or sets the number of messages to request. /// /// The number of messages to request. public int Count { get; set; } /// /// Gets or sets the page number to request. /// /// The page number. public int Page { get; set; } /// /// Gets or sets whether to include entities in the request. /// /// Boolean. public bool IncludeEntites { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/DirectMessage/DirectMessagesSentOptions.cs0000644000175000017500000000721012253423361032700 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The direct messages sent options class. //----------------------------------------------------------------------- namespace Twitterizer { using System; /// /// The direct messages sent options class. Provides a payload for the command. /// #if !SILVERLIGHT [System.Serializable] #endif public sealed class DirectMessagesSentOptions : OptionalProperties { /// /// Initializes a new instance of the class. /// public DirectMessagesSentOptions() { this.Page = 1; } /// /// Gets or sets the minimum (earliest) status id to request. /// /// The since id. public decimal SinceStatusId { get; set; } /// /// Gets or sets the max (latest) status id to request. /// /// The max id. public decimal MaxStatusId { get; set; } /// /// Gets or sets the number of messages to request. /// /// The number of messages to request. public int Count { get; set; } /// /// Gets or sets the page number to request. /// /// The page number. public int Page { get; set; } /// /// Gets or sets whether to include entities in the request. /// /// Boolean. public bool IncludeEntites { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/0000755000175000017500000000000012253423361023761 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/DailyTrendsCommand.cs0000644000175000017500000000674612253423361030046 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The trends command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer; using Twitterizer.Core; using System.Globalization; /// /// The create list command class /// #if !SILVERLIGHT [Serializable] #endif internal sealed class DailyTrendsCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public DailyTrendsCommand(OAuthTokens tokens, TrendsOptions options) : base( HTTPVerb.GET, "trends/daily.json", tokens, options) { } #endregion /// /// Initializes the command. /// public override void Init() { TrendsOptions options = this.OptionalProperties as TrendsOptions; if (options == null) { return; } if (!String.IsNullOrEmpty(options.Date)) this.RequestParameters.Add("date", options.Date); if (options.ExcludeHashTags) { this.RequestParameters.Add("exclude", "hashtags"); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/TwitterTrendLocationPlaceType.cs0000644000175000017500000000537712253423361032263 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The Twitter Trend Location class //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Runtime.Serialization; using Twitterizer.Core; /// /// The TwitterTrendLocation class. /// #if !SILVERLIGHT [Serializable] #endif [DataContract] public class TwitterTrendLocationPlaceType { /// /// Gets or sets the name. /// /// The name of the place type. [DataMember] public string Name { get; set; } /// /// Gets or sets the code. /// /// The code of the place type. [DataMember] public int Code { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/TrendsCommand.cs0000644000175000017500000000673412253423361027060 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The trends command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer; using Twitterizer.Core; using System.Globalization; /// /// The create list command class /// #if !SILVERLIGHT [Serializable] #endif internal sealed class TrendsCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The WOEID. /// The options. public TrendsCommand(OAuthTokens tokens, int WOEID, LocalTrendsOptions options) : base( HTTPVerb.GET, string.Format(CultureInfo.InvariantCulture, "trends/{0}.json", WOEID), tokens, options) { } #endregion /// /// Initializes the command. /// public override void Init() { LocalTrendsOptions options = this.OptionalProperties as LocalTrendsOptions; if (options == null) { return; } if (options.ExcludeHashTags) { this.RequestParameters.Add("exclude", "hashtags"); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/TwitterTrendDictionary.cs0000644000175000017500000001644512253423361031007 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter trend collection class. //----------------------------------------------------------------------- using Twitterizer.Core; namespace Twitterizer { using System; using Newtonsoft.Json; using System.Globalization; /// /// The TwitterTrendCollection class. Represents multiple elements. /// [JsonConverter(typeof(TwitterTrendDictionary.Converter))] #if !SILVERLIGHT [Serializable] #endif public class TwitterTrendDictionary : Core.TwitterDictionary, ITwitterObject { /// /// Gets or sets as of date. /// [JsonProperty(PropertyName = "as_of")] [JsonConverter(typeof(TwitterizerDateConverter))] public DateTime AsOf { get; set; } /// /// The Json converter class for the TwitterTrendCollection object /// #if !SILVERLIGHT internal class Converter : JsonConverter #else public class Converter : JsonConverter #endif { /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { return objectType == typeof(TwitterTrendDictionary); } #if !SILVERLIGHT static readonly string[] dateformats = { "yyyy-MM-dd HH:mm", "yyyy-MM-dd" }; #endif /// /// Reads the json. /// /// The reader. /// Type of the object. /// The existing value. /// The serializer. /// A collection of items. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { TwitterTrendDictionary result = existingValue as TwitterTrendDictionary; if (result == null) result = new TwitterTrendDictionary(); int initialDepth = reader.Depth; if (reader.TokenType == JsonToken.StartArray) reader.Read(); while (reader.Read() && reader.Depth > initialDepth) { if (reader.TokenType == JsonToken.PropertyName && reader.Depth == 1) { #if !SILVERLIGHT switch ((string)reader.Value) { //TODO these two datetime converters don't seem to convert. case "as_of": reader.Read(); var c = new TwitterizerDateConverter(); result.AsOf = (DateTime)c.ReadJson(reader, typeof(DateTime), null, serializer); continue; case "trends": reader.Read(); while (reader.Read() && reader.Depth >= 3) { if (reader.TokenType == JsonToken.PropertyName && reader.Depth == 3) { try { var date = DateTime.ParseExact(reader.Value.ToString(), dateformats, CultureInfo.InvariantCulture, DateTimeStyles.None); result.Add(date, new TwitterTrendCollection()); var converter = new TwitterTrendCollection.Converter(); result[date] = (TwitterTrendCollection)converter.ReadJson(reader, typeof(TwitterTrendCollection), null, serializer); } catch { //bad date format return null; } } } continue; } #endif } } return result; } /// /// Writes the json. /// /// The writer. /// The value. /// The serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { // TODO: Implement this. // throw new System.NotImplementedException(); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/TwitterTrendCollection.cs0000644000175000017500000002064112253423361030766 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter trend collection class. //----------------------------------------------------------------------- using Twitterizer.Core; namespace Twitterizer { using System; using Newtonsoft.Json; /// /// The TwitterTrendCollection class. Represents multiple elements. /// [JsonConverter(typeof(TwitterTrendCollection.Converter))] #if !SILVERLIGHT [Serializable] #endif public class TwitterTrendCollection : Core.TwitterCollection, ITwitterObject { /// /// Gets or sets the as of date. /// [JsonProperty(PropertyName = "as_of")] [JsonConverter(typeof(TwitterizerDateConverter))] public DateTime AsOf { get; set; } /// /// Gets or sets the created at date. /// [JsonProperty(PropertyName = "created_at")] [JsonConverter(typeof(TwitterizerDateConverter))] public DateTime CreatedAt { get; set; } /// /// Gets or sets the location. /// public TwitterTrendLocationCollection Locations { get; set; } /// /// The Json converter class for the TwitterTrendCollection object /// #if !SILVERLIGHT internal class Converter : JsonConverter #else public class Converter : JsonConverter #endif { /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { return objectType == typeof(TwitterTrendCollection); } /// /// Reads the json. /// /// The reader. /// Type of the object. /// The existing value. /// The serializer. /// A collection of items. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { TwitterTrendCollection result = existingValue as TwitterTrendCollection; if (result == null) result = new TwitterTrendCollection(); int initialDepth = reader.Depth; while (reader.Read() && reader.Depth > initialDepth) { if (reader.TokenType == JsonToken.PropertyName && reader.Depth == initialDepth + 2) { switch ((string)reader.Value) { //TODO these two datetime converters don't seem to convert. case "as_of": reader.Read(); var c = new TwitterizerDateConverter(); result.AsOf = (DateTime)c.ReadJson(reader, typeof(DateTime), null, serializer); continue; case "created_at": reader.Read(); var d = new TwitterizerDateConverter(); result.CreatedAt = (DateTime)d.ReadJson(reader, typeof(DateTime), null, serializer); continue; case "locations": reader.Read(); var e = new TwitterTrendLocationCollection.Converter(); result.Locations = (TwitterTrendLocationCollection)e.ReadJson(reader, typeof(TwitterTrendLocationCollection), null, serializer); continue; } } #if !SILVERLIGHT if (reader.TokenType == JsonToken.StartObject && reader.Depth > initialDepth + 1) #else if (reader.TokenType == JsonToken.StartObject && reader.Depth > initialDepth + 2) #endif result.Add(new TwitterTrend()); if (reader.TokenType == JsonToken.PropertyName) { switch ((string)reader.Value) { case "query": reader.Read(); result[result.Count - 1].SearchQuery = (string)reader.Value; continue; case "name": reader.Read(); result[result.Count - 1].Name = (string)reader.Value; continue; case "url": reader.Read(); result[result.Count - 1].Address = (string)reader.Value; continue; case "promoted_content": reader.Read(); result[result.Count - 1].PromotedContent = (string)reader.Value; continue; case "events": reader.Read(); result[result.Count - 1].Events = (string)reader.Value; continue; } } } return result; } /// /// Writes the json. /// /// The writer. /// The value. /// The serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { // TODO: Implement this. // throw new System.NotImplementedException(); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/TwitterTrendLocationCollection.cs0000644000175000017500000001746512253423361032471 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The twitter trend location collection class. //----------------------------------------------------------------------- using Twitterizer.Core; namespace Twitterizer { using System; using Newtonsoft.Json; /// /// The TwitterTrendLocationCollection class. Represents multiple elements. /// [JsonConverter(typeof(TwitterTrendLocationCollection.Converter))] #if !SILVERLIGHT [Serializable] #endif public class TwitterTrendLocationCollection : Core.TwitterCollection, ITwitterObject { /// /// The Json converter class for the TwitterTrendLocationCollection object /// #if !SILVERLIGHT internal class Converter : JsonConverter #else public class Converter : JsonConverter #endif { /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { return objectType == typeof(TwitterTrendLocationCollection); } /// /// Reads the json. /// /// The reader. /// Type of the object. /// The existing value. /// The serializer. /// A collection of items. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { TwitterTrendLocationCollection result = existingValue as TwitterTrendLocationCollection; if (result == null) result = new TwitterTrendLocationCollection(); int initialDepth = reader.Depth; while (reader.Read() && reader.Depth > initialDepth) { if (reader.TokenType == JsonToken.StartObject && reader.Depth >= 1) result.Add(new TwitterTrendLocation()); if (reader.TokenType == JsonToken.PropertyName) { switch ((string)reader.Value) { case "name": reader.Read(); result[result.Count - 1].Name = (string)reader.Value; continue; case "woeid": reader.Read(); result[result.Count - 1].WOEID = int.Parse(reader.Value.ToString()); continue; case "placeType": int placetypeDepth = reader.Depth; while (reader.Read() && reader.Depth > placetypeDepth) { if (reader.TokenType == JsonToken.StartObject && reader.Depth >= 2) result[result.Count - 1].PlaceType = new TwitterTrendLocationPlaceType(); if (reader.TokenType == JsonToken.PropertyName) { switch ((string)reader.Value) { case "name": reader.Read(); result[result.Count - 1].PlaceType.Name = (string)reader.Value; continue; case "code": reader.Read(); result[result.Count - 1].PlaceType.Code = int.Parse(reader.Value.ToString()); continue; } } } continue; case "country": reader.Read(); result[result.Count - 1].Country = (string)reader.Value; continue; case "url": reader.Read(); result[result.Count - 1].URL = (string)reader.Value; continue; case "countryCode": reader.Read(); result[result.Count - 1].CountryCode = (string)reader.Value; continue; } } } return result; } /// /// Writes the json. /// /// The writer. /// The value. /// The serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { // TODO: Implement this. // throw new System.NotImplementedException(); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/TwitterTrend.cs0000644000175000017500000002205712253423361026755 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The Twitter Trend class //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Runtime.Serialization; using Twitterizer.Core; /// /// The TwitterTrend class. /// #if !SILVERLIGHT [Serializable] #endif [DataContract] public class TwitterTrend : TwitterObject { /// /// Gets or sets the name. /// /// The name of the trend. [DataMember] public string Name { get; set; } /// /// Gets or sets the address. /// /// The address. [DataMember] public string Address { get; set; } /// /// Gets or sets the search query. /// /// The search query. [DataMember] public string SearchQuery { get; set; } /// /// Gets or sets the promoted content value. /// /// Promoted Content. [DataMember] public string PromotedContent { get; set; } /// /// Gets or sets the events. /// /// The events. [DataMember] public string Events { get; set; } /// /// Gets the trends with the specified WOEID. /// /// The request tokens. /// The WOEID. /// The options. /// /// A collection of objects. /// public static TwitterResponse Trends(OAuthTokens tokens, int WoeID, LocalTrendsOptions options) { Commands.TrendsCommand command = new Twitterizer.Commands.TrendsCommand(tokens, WoeID, options); return Core.CommandPerformer.PerformAction(command); } /// /// Gets the current trends. /// /// The request tokens. /// The WOEID. /// /// A collection of objects. /// public static TwitterResponse Trends(OAuthTokens tokens, int WoeID) { return Trends(tokens, WoeID, null); } /// /// Gets the trends with the specified WOEID. /// /// The WOEID. /// The options. /// /// A collection of objects. /// public static TwitterResponse Trends(int WoeID, LocalTrendsOptions options) { return Trends(null, WoeID, options); } /// /// Gets the current trends. /// /// The WOEID. /// /// A collection of objects. /// public static TwitterResponse Trends(int WoeID) { return Trends(null, WoeID, null); } /// /// Gets the locations where trends are available. /// /// The request tokens. /// The options. /// /// A collection of objects. /// public static TwitterResponse Available(OAuthTokens tokens, AvailableTrendsOptions options) { Commands.AvailableTrendsCommand command = new Twitterizer.Commands.AvailableTrendsCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Gets the locations where trends are available. /// /// The options. /// /// A collection of objects. /// public static TwitterResponse Available(AvailableTrendsOptions options) { return Available(null, options); } /// /// Gets the locations where trends are available. /// /// /// A collection of objects. /// public static TwitterResponse Available() { return Available(null, null); } /// /// Gets the daily global trends /// /// The request tokens. /// The options. public static TwitterResponse Daily(OAuthTokens tokens, TrendsOptions options) { Commands.DailyTrendsCommand command = new Twitterizer.Commands.DailyTrendsCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Gets the daily global trends /// /// The options. public static TwitterResponse Daily(TrendsOptions options) { return Daily(null, options); } /// /// Gets the daily global trends /// public static TwitterResponse Daily() { return Daily(null, null); } /// /// Gets the weekly global trends /// /// The request tokens. /// The options. public static TwitterResponse Weekly(OAuthTokens tokens, TrendsOptions options) { Commands.WeeklyTrendsCommand command = new Twitterizer.Commands.WeeklyTrendsCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Gets the weekly global trends /// /// The options. public static TwitterResponse Weekly(TrendsOptions options) { return Weekly(null, options); } /// /// Gets the weekly global trends /// public static TwitterResponse Weekly() { return Weekly(null, null); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/TrendsOptions.cs0000644000175000017500000000502212253423361027122 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The daily trends options class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The trends options class. Provides a payload for optional parameters for the TrendsCommand class. /// #if !SILVERLIGHT [System.Serializable] #endif public class TrendsOptions : LocalTrendsOptions { /// /// Gets or sets a value indicating whether to set the start date of the returned trends (Format "yyyy-MM-dd") /// public string Date { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/TwitterTrendLocation.cs0000644000175000017500000000716612253423361030452 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The Twitter Trend Location class //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Runtime.Serialization; using Twitterizer.Core; /// /// The TwitterTrendLocation class. /// #if !SILVERLIGHT [Serializable] #endif [DataContract] public class TwitterTrendLocation : TwitterObject { /// /// Gets or sets the name. /// /// The name of the location. [DataMember] public string Name { get; set; } /// /// Gets or sets the place type. /// /// The Place Type of the location. [DataMember] public TwitterTrendLocationPlaceType PlaceType { get; set; } /// /// Gets or sets the WOEID. /// /// The WOEID of the location. [DataMember] public int WOEID { get; set; } /// /// Gets or sets the Country. /// /// The Country of the location. [DataMember] public string Country { get; set; } /// /// Gets or sets the URL. /// /// The URL of the location. [DataMember] public string URL { get; set; } /// /// Gets or sets the Country Code. /// /// The Country Code of the location. [DataMember] public string CountryCode { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/AvailableTrendsOptions.cs0000644000175000017500000000534112253423361030727 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The available trends options class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The available trends options class. Provides a payload for optional parameters for the AvailableTrendsCommand class. /// #if !SILVERLIGHT [System.Serializable] #endif public class AvailableTrendsOptions : OptionalProperties { /// /// Gets or sets a value indicating how to order the list nearest to furthest. /// public double? Lat { get; set; } /// /// Gets or sets a value indicating how to order the list nearest to furthest. /// public double? Long { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/LocalTrendsOptions.cs0000644000175000017500000000511212253423361030075 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The trends options class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The trends options class. Provides a payload for optional parameters for the TrendsCommand class. /// #if !SILVERLIGHT [System.Serializable] #endif public class LocalTrendsOptions : OptionalProperties { /// /// Gets or sets a value indicating whether [exclude hash tags]. /// /// true if [exclude hash tags]; otherwise, false. public bool ExcludeHashTags { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/WeeklyTrendsCommand.cs0000644000175000017500000000676012253423361030240 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The trends command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer; using Twitterizer.Core; using System.Globalization; /// /// The create list command class /// #if !SILVERLIGHT [Serializable] #endif internal sealed class WeeklyTrendsCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public WeeklyTrendsCommand(OAuthTokens tokens, TrendsOptions options) : base( HTTPVerb.GET, "trends/weekly.json", tokens, options) { } #endregion /// /// Initializes the command. /// public override void Init() { TrendsOptions options = this.OptionalProperties as TrendsOptions; if (options == null) { return; } if (!String.IsNullOrEmpty(options.Date)) this.RequestParameters.Add("date", options.Date); if (options.ExcludeHashTags) { this.RequestParameters.Add("exclude", "hashtags"); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Trends/AvailableTrendsCommand.cs0000644000175000017500000000671712253423361030662 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The available trends command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer; using Twitterizer.Core; using System.Globalization; /// /// The create list command class /// #if !SILVERLIGHT [Serializable] #endif internal sealed class AvailableTrendsCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public AvailableTrendsCommand(OAuthTokens tokens, AvailableTrendsOptions options) : base( HTTPVerb.GET, "trends/available.json", tokens, options) { } #endregion public override void Init() { AvailableTrendsOptions options = this.OptionalProperties as AvailableTrendsOptions; if (options == null) { return; } if (options.Lat != null) this.RequestParameters.Add("lat", options.Lat.ToString()); if (options.Long != null) this.RequestParameters.Add("long", options.Long.ToString()); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/TwitterResultTypeEnum.cs0000644000175000017500000000525411655552527027423 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter result type enumeration //----------------------------------------------------------------------- namespace Twitterizer { /// /// The Twitter Result Type Enumeration /// public enum TwitterResultType { /// /// In a future release this will become the default value. Include both popular and real time results in the response. /// Mixed, /// /// The current default value. Return only the most recent results in the response. /// Recent, /// /// Return only the most popular results in the response. /// Popular } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Timeline/0000755000175000017500000000000012253423361024270 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Timeline/UserTimelineOptions.cs0000644000175000017500000000542411655552527030621 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter timeline options class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The UserTimelineOptions class. Provides a payload for optional parameters of the class. /// public class UserTimelineOptions : TimelineOptions { /// /// Gets or sets the ID of the user for whom to request a list of followers. /// /// The user id. public decimal UserId { get; set; } /// /// Gets or sets the screen name of the user for whom to request a list of followers. /// /// The name of the screen. public string ScreenName { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Timeline/RetweetedByMeCommand.cs0000644000175000017500000000775412253423361030640 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The retweeted by me command. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The Retweeted By Me Command. /// [AuthorizedCommandAttribute] internal sealed class RetweetedByMeCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public RetweetedByMeCommand(OAuthTokens tokens, TimelineOptions options) : base(HTTPVerb.GET, "statuses/retweeted_by_me.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } } #endregion /// /// Initializes the command. /// public override void Init() { TimelineOptions options = this.OptionalProperties as TimelineOptions; if (options == null) { this.RequestParameters.Add("page", "1"); return; } if (options.SinceStatusId > 0) this.RequestParameters.Add("since_id", options.SinceStatusId.ToString(CultureInfo.InvariantCulture)); if (options.MaxStatusId > 0) this.RequestParameters.Add("max_id", options.MaxStatusId.ToString(CultureInfo.InvariantCulture)); if (options.Count > 0) this.RequestParameters.Add("count", options.Count.ToString(CultureInfo.InvariantCulture)); this.RequestParameters.Add("page", options.Page > 0 ? options.Page.ToString(CultureInfo.InvariantCulture) : "1"); this.RequestParameters.Add("include_entities", "true"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Timeline/HomeTimelineCommand.cs0000644000175000017500000000651312253423361030502 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The Home Timeline Command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The Home Timeline Command /// #if !SILVERLIGHT [Serializable] #endif [AuthorizedCommandAttribute] internal sealed class HomeTimelineCommand : PagedTimelineCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The optional properties. public HomeTimelineCommand(OAuthTokens tokens, TimelineOptions optionalProperties) : base(HTTPVerb.GET, "statuses/home_timeline.json", tokens, optionalProperties) { if (tokens == null) { throw new ArgumentNullException("tokens"); } } /// /// Inits this instance. /// public override void Init() { TimelineOptions options = this.OptionalProperties as TimelineOptions; if (options == null) options = new TimelineOptions(); TimelineOptions.Init(this, options); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Timeline/TimelineOptions.cs0000644000175000017500000001216612253423361027747 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The timeline options class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The timeline options class. Provides optional parameters for timeline methods. /// #if !SILVERLIGHT [System.Serializable] #endif public class TimelineOptions : OptionalProperties { /// /// Initializes a new instance of the class. /// public TimelineOptions() { this.Page = 1; } /// /// Gets or sets the minimum (earliest) status id to request. /// /// The since id. public decimal SinceStatusId { get; set; } /// /// Gets or sets the max (latest) status id to request. /// /// The max id. public decimal MaxStatusId { get; set; } /// /// Gets or sets the number of messages to request. /// /// The number of messages to request. public int Count { get; set; } /// /// Gets or sets the page number to request. /// /// The page number. public int Page { get; set; } /// /// Gets or sets a value indicating whether user objects should contain only Id values. /// /// true if user objects should contain only Id values; otherwise, false. public bool SkipUser { get; set; } /// /// Gets or sets a value indicating whether [include retweets]. /// /// true if [include retweets]; otherwise, false. public bool IncludeRetweets { get; set; } /// /// Initializes the specified command. /// /// /// The command. /// The options. internal static void Init(Core.TwitterCommand command, TimelineOptions options) where T : Core.ITwitterObject { command.RequestParameters.Add("include_entities", "true"); if (options == null) options = new TimelineOptions(); if (options.Count > 0) command.RequestParameters.Add("count", options.Count.ToString()); if (options.IncludeRetweets) command.RequestParameters.Add("include_rts", "true"); if (options.MaxStatusId > 0) command.RequestParameters.Add("max_id", options.MaxStatusId.ToString()); command.RequestParameters.Add("page", options.Page > 0 ? options.Page.ToString() : "1"); if (options.SinceStatusId > 0) command.RequestParameters.Add("since_id", options.SinceStatusId.ToString()); if (options.SkipUser) command.RequestParameters.Add("trim_user", "true"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Timeline/RetweetedToMeCommand.cs0000644000175000017500000000766112132510633030640 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The retweeted by me command. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The Retweeted By Me Command. /// [AuthorizedCommandAttribute] internal sealed class RetweetedToMeCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public RetweetedToMeCommand(OAuthTokens tokens, TimelineOptions options) : base(HTTPVerb.GET, "statuses/retweeted_to_me.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } } #endregion /// /// Initializes the command. /// public override void Init() { TimelineOptions options = this.OptionalProperties as TimelineOptions; if (options == null) { this.RequestParameters.Add("page", "1"); return; } if (options.SinceStatusId > 0) this.RequestParameters.Add("since_id", options.SinceStatusId.ToString(CultureInfo.InvariantCulture)); if (options.MaxStatusId > 0) this.RequestParameters.Add("max_id", options.MaxStatusId.ToString(CultureInfo.InvariantCulture)); if (options.Count > 0) this.RequestParameters.Add("count", options.Count.ToString(CultureInfo.InvariantCulture)); this.RequestParameters.Add("page", options.Page > 0 ? options.Page.ToString(CultureInfo.InvariantCulture) : "1"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Timeline/PublicTimelineCommand.cs0000644000175000017500000000615712132510633031027 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The command to obtain the public timeline //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer.Core; /// /// The Public Timeline Command class /// #if !SILVERLIGHT [Serializable] #endif internal sealed class PublicTimelineCommand : Core.TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public PublicTimelineCommand(OAuthTokens tokens, OptionalProperties options) : base(HTTPVerb.GET, "statuses/public_timeline.json", tokens, options) { } #endregion /// /// Initializes the command. /// public override void Init() { // Enable opt-in beta for entities this.RequestParameters.Add("include_entities", "true"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Timeline/MentionsCommand.cs0000644000175000017500000000634312253423361027720 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The mentions command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Core; /// /// The Mentions Command class /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class MentionsCommand : PagedTimelineCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public MentionsCommand(OAuthTokens tokens, TimelineOptions options) : base(HTTPVerb.GET, "statuses/mentions_timeline.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } } /// /// Inits this instance. /// public override void Init() { TimelineOptions options = this.OptionalProperties as TimelineOptions; if (options == null) options = new TimelineOptions(); TimelineOptions.Init(this, options); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Timeline/PagedTimelineCommand.cs0000644000175000017500000001033512253423361030627 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The paged timeline command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System.Globalization; using Core; /// /// The Paged Timeline Command class. Provides common functionality for all of the paged timeline command classes. /// #if !SILVERLIGHT [System.Serializable] #endif internal abstract class PagedTimelineCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The HTTP method. /// The end point. /// The tokens. /// The optional properties. protected PagedTimelineCommand(HTTPVerb httpMethod, string endPoint, OAuthTokens tokens, OptionalProperties optionalProperties) : base(httpMethod, endPoint, tokens, optionalProperties) { } /// /// Initializes the command. /// public override void Init() { // Enable opt-in beta for entities this.RequestParameters.Add("include_entities", "true"); TimelineOptions options = this.OptionalProperties as TimelineOptions; if (options == null) { this.RequestParameters.Add("page", "1"); return; } if (options.SinceStatusId > 0) this.RequestParameters.Add("since_id", options.SinceStatusId.ToString(CultureInfo.InvariantCulture)); if (options.MaxStatusId > 0) this.RequestParameters.Add("max_id", options.MaxStatusId.ToString(CultureInfo.InvariantCulture)); if (options.Count > 0) this.RequestParameters.Add("count", options.Count.ToString(CultureInfo.InvariantCulture)); if (options.IncludeRetweets) this.RequestParameters.Add("include_rts", "true"); this.RequestParameters.Add("page", options.Page > 0 ? options.Page.ToString(CultureInfo.InvariantCulture) : "1"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Timeline/UserTimelineCommand.cs0000644000175000017500000000763012253423361030531 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The user timeline command. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; /// /// The user timeline command. /// #if !SILVERLIGHT [Serializable] #endif internal sealed class UserTimelineCommand : PagedTimelineCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public UserTimelineCommand(OAuthTokens tokens, UserTimelineOptions options) : base(HTTPVerb.GET, "statuses/user_timeline.json", tokens, options) { if (tokens == null && options == null) { throw new ArgumentException("You must supply either OAuth tokens or identify a user in the TimelineOptions class."); } if (options != null && tokens == null && string.IsNullOrEmpty(options.ScreenName) && options.UserId <= 0) { throw new ArgumentException("You must specify a user's screen name or id for unauthorized requests."); } } /// /// Initializes the command. /// public override void Init() { UserTimelineOptions options = this.OptionalProperties as UserTimelineOptions; if (options == null) options = new UserTimelineOptions(); TimelineOptions.Init(this, options); if (options.UserId > 0) this.RequestParameters.Add("user_id", options.UserId.ToString(CultureInfo.InvariantCulture.NumberFormat)); if (!string.IsNullOrEmpty(options.ScreenName)) this.RequestParameters.Add("screen_name", options.ScreenName); } } }smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Timeline/FriendsTimelineCommand.cs0000644000175000017500000000613312253423361031202 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The friends timeline command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { /// /// The Friends Timeline Command class /// internal sealed class FriendsTimelineCommand : PagedTimelineCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public FriendsTimelineCommand(OAuthTokens tokens, TimelineOptions options) : base(HTTPVerb.GET, "statuses/friends_timeline.json", tokens, options) { } #endregion /// /// Inits this instance. /// public override void Init() { TimelineOptions options = this.OptionalProperties as TimelineOptions; if (options == null) options = new TimelineOptions(); TimelineOptions.Init(this, options); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Timeline/TwitterTimeline.cs0000644000175000017500000003217012253423361027753 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The TwitterTimeline class //----------------------------------------------------------------------- namespace Twitterizer { using Twitterizer.Core; /// /// Provides interaction with timelines /// public static class TwitterTimeline { /// /// Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web. /// /// The tokens. /// The options. /// A collection of items. public static TwitterResponse HomeTimeline(OAuthTokens tokens, TimelineOptions options) { Commands.HomeTimelineCommand command = new Commands.HomeTimelineCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// The tokens. /// A collection of items. public static TwitterResponse HomeTimeline(OAuthTokens tokens) { return HomeTimeline(tokens, null); } /// The options. /// A collection of items. public static TwitterResponse HomeTimeline(TimelineOptions options) { return HomeTimeline(null, options); } /// /// Returns the 20 most recent statuses posted by the authenticating user. It is also possible to request another user's timeline by using the screen_name or user_id parameter. /// /// The oauth tokens. /// The options. /// /// A instance. /// public static TwitterResponse UserTimeline( OAuthTokens tokens, UserTimelineOptions options) { Commands.UserTimelineCommand command = new Commands.UserTimelineCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Returns the 20 most recent statuses posted by the authenticating user. It is also possible to request another user's timeline by using the screen_name or user_id parameter. /// /// The oauth tokens. /// /// A instance. /// public static TwitterResponse UserTimeline( OAuthTokens tokens) { return UserTimeline(tokens, null); } /// /// Returns the 20 most recent statuses posted by the authenticating user. It is also possible to request another user's timeline by using the screen_name or user_id parameter. /// /// The options. /// /// A instance. /// public static TwitterResponse UserTimeline( UserTimelineOptions options) { return UserTimeline(null, options); } /// /// Gets the public timeline. /// /// A . public static TwitterResponse PublicTimeline() { return PublicTimeline((OAuthTokens)null); } /// /// Returns the 20 most recent statuses, including retweets if they exist, from non-protected users. The public timeline is cached for 60 seconds. /// /// The oauth tokens. /// /// A . /// public static TwitterResponse PublicTimeline(OAuthTokens tokens) { return PublicTimeline(tokens, null); } /// /// Returns the 20 most recent statuses, including retweets if they exist, from non-protected users. The public timeline is cached for 60 seconds. /// /// The properties. /// /// A . /// public static TwitterResponse PublicTimeline(OptionalProperties options) { return PublicTimeline(null, options); } /// /// Returns the 20 most recent statuses, including retweets if they exist, from non-protected users. The public timeline is cached for 60 seconds. /// /// The oauth tokens. /// The options. /// A . /// public static TwitterResponse PublicTimeline(OAuthTokens tokens, OptionalProperties options) { Commands.PublicTimelineCommand command = new Commands.PublicTimelineCommand(tokens, options); TwitterResponse result = CommandPerformer.PerformAction(command); return result; } /// /// Obtains the authorized user's friends timeline. /// /// The tokens. /// A . [System.Obsolete("This method is deprecated and has been replaced by the HomeTimeline method.")] public static TwitterResponse FriendTimeline(OAuthTokens tokens) { return FriendTimeline(tokens, null); } /// /// Obtains the authorized user's friends timeline. /// /// The tokens. /// The options. /// A . [System.Obsolete("This method is deprecated and has been replaced by the HomeTimeline method.")] public static TwitterResponse FriendTimeline(OAuthTokens tokens, TimelineOptions options) { Commands.FriendsTimelineCommand command = new Commands.FriendsTimelineCommand(tokens, options); return CommandPerformer.PerformAction(command); } /// /// Returns the 20 most recent tweets of the authenticated user that have been retweeted by others. /// /// The tokens. /// The options. /// A instance. public static TwitterResponse RetweetsOfMe(OAuthTokens tokens, RetweetsOfMeOptions options) { return CommandPerformer.PerformAction( new Commands.RetweetsOfMeCommand(tokens, options)); } /// /// Returns the 20 most recent tweets of the authenticated user that have been retweeted by others. /// /// The tokens. /// /// A instance. /// public static TwitterResponse RetweetsOfMe(OAuthTokens tokens) { return RetweetsOfMe(tokens, null); } /// /// Returns the 20 most recent retweets posted by the authenticating user. /// /// The tokens. /// The options. /// A instance. public static TwitterResponse RetweetedByMe(OAuthTokens tokens, TimelineOptions options) { return CommandPerformer.PerformAction( new Commands.RetweetedByMeCommand(tokens, options)); } /// /// Returns the 20 most recent retweets posted by the authenticating user. /// /// The tokens. /// /// A instance. /// public static TwitterResponse RetweetedByMe(OAuthTokens tokens) { return RetweetedByMe(tokens, null); } /// /// Returns the 20 most recent retweets posted by the authenticating user's friends. /// /// The tokens. /// The options. /// A instance. public static TwitterResponse RetweetedToMe(OAuthTokens tokens, TimelineOptions options) { return CommandPerformer.PerformAction( new Commands.RetweetedToMeCommand(tokens, options)); } /// /// Returns the 20 most recent retweets posted by the authenticating user's friends. /// /// The tokens. /// /// A instance. /// public static TwitterResponse RetweetedToMe(OAuthTokens tokens) { return RetweetedToMe(tokens, null); } /// /// Returns the 20 most recent mentions (status containing @username) for the authenticating user. /// /// The tokens. /// The options. /// A instance. public static TwitterResponse Mentions(OAuthTokens tokens, TimelineOptions options) { Commands.MentionsCommand command = new Commands.MentionsCommand(tokens, options); return CommandPerformer.PerformAction(command); } /// /// Returns the 20 most recent mentions (status containing @username) for the authenticating user. /// /// The tokens. /// /// A instance. /// public static TwitterResponse Mentions(OAuthTokens tokens) { return Mentions(tokens, null); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/0000755000175000017500000000000012253423361024116 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/VerifyCredentialsOptions.cs0000644000175000017500000000557312132510633031450 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The verify credentials command class. //----------------------------------------------------------------------- namespace Twitterizer { using System; /// /// The Verify Credentials Options class. Provides a payload for optional parameters for the Verify Credentials Command. /// #if !SILVERLIGHT [System.Serializable] #endif public class VerifyCredentialsOptions : OptionalProperties { /// /// Initializes a new instance of the class. /// public VerifyCredentialsOptions() { this.IncludeEntities = false; } /// /// Gets or sets a value indicating whether [include entities]. /// /// true if [include entities]; otherwise, false. public bool IncludeEntities { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/UpdateProfileCommand.cs0000644000175000017500000000655612132510633030516 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The update profile command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer.Core; /// /// The update profile command class. /// sealed class UpdateProfileCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The options. public UpdateProfileCommand(OAuthTokens tokens, UpdateProfileOptions options) : base(HTTPVerb.POST, "account/update_profile.json", tokens, options) { } /// /// Inits this instance. /// public override void Init() { this.RequestParameters.Add("include_entities", "true"); UpdateProfileOptions options = this.OptionalProperties as UpdateProfileOptions; if (options == null) { return; } this.RequestParameters.Add("name", options.Name); this.RequestParameters.Add("description", options.Description); this.RequestParameters.Add("location", options.Location); this.RequestParameters.Add("url", options.Url); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/RateLimitStatusCommand.cs0000644000175000017500000000574112132510633031044 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The rate limit status command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer.Core; /// /// The rate limit status command class. /// #if !SILVERLIGHT [System.Serializable] #endif internal sealed class RateLimitStatusCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public RateLimitStatusCommand(OAuthTokens requestTokens, OptionalProperties options) : base(HTTPVerb.GET, "account/rate_limit_status.json", requestTokens, options) { } /// /// Initializes the command. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/UpdateProfileColorsCommand.cs0000644000175000017500000001272312253423361031676 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The update profile colors command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; #if !SILVERLIGHT using System.Drawing; #endif using Twitterizer.Core; /// /// Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com /// [AuthorizedCommand] #if !SILVERLIGHT [Serializable] #endif internal class UpdateProfileColorsCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The options. public UpdateProfileColorsCommand(OAuthTokens tokens, UpdateProfileColorsOptions options) : base(HTTPVerb.POST, "account/update_profile_colors.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (options == null) { throw new ArgumentNullException("options"); } } /// /// Initializes the command. /// public override void Init() { UpdateProfileColorsOptions options = (UpdateProfileColorsOptions)this.OptionalProperties; #if !SILVERLIGHT if (options.BackgroundColor != Color.Empty) { this.RequestParameters.Add("profile_background_color", ColorTranslator.ToHtml(options.BackgroundColor)); } #else if (options.BackgroundColor != null) { this.RequestParameters.Add("profile_background_color", options.BackgroundColor); } #endif #if !SILVERLIGHT if (options.TextColor != Color.Empty) { this.RequestParameters.Add("profile_text_color", ColorTranslator.ToHtml(options.TextColor)); } #else if (options.TextColor != null) { this.RequestParameters.Add("profile_text_color", options.TextColor); } #endif #if !SILVERLIGHT if (options.LinkColor != Color.Empty) { this.RequestParameters.Add("profile_link_color", ColorTranslator.ToHtml(options.LinkColor)); } #else if (options.LinkColor != null) { this.RequestParameters.Add("profile_link_color", options.LinkColor); } #endif #if !SILVERLIGHT if (options.SidebarFillColor != Color.Empty) { this.RequestParameters.Add("profile_sidebar_fill_color", ColorTranslator.ToHtml(options.SidebarFillColor)); } #else if (options.SidebarFillColor != null) { this.RequestParameters.Add("profile_sidebar_fill_color", options.SidebarFillColor); } #endif #if !SILVERLIGHT if (options.SidebarBorderColor != Color.Empty) { this.RequestParameters.Add("profile_sidebar_border_color", ColorTranslator.ToHtml(options.SidebarBorderColor)); } #else if (options.SidebarBorderColor != null) { this.RequestParameters.Add("profile_sidebar_border_color", options.SidebarBorderColor); } #endif } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/UpdateProfileBackgroundImageCommand.cs0000644000175000017500000001023612253423361033454 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The update profile background image command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer.Core; /// /// /// #if !SILVERLIGHT [Serializable] #endif internal sealed class UpdateProfileBackgroundImageCommand : TwitterCommand { private readonly byte[] imageData; /// /// Initializes a new instance of the class. /// /// The tokens. /// The image. /// The options. public UpdateProfileBackgroundImageCommand(OAuthTokens tokens, byte[] image, UpdateProfileBackgroundImageOptions options) : base(HTTPVerb.POST, "", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if ((options == null && (image == null || image.Length == 0)) || (options != null && !options.UseImage)) { throw new ArgumentException("Image data cannot be null or zero length."); } if (image != null && image.Length > 102400) { throw new ArgumentException("Image cannot exceed 800Kb in size."); } this.imageData = image; this.Multipart = true; } /// /// Inits this instance. /// public override void Init() { this.RequestParameters.Add("image", this.imageData); this.RequestParameters.Add("include_entities", "true"); UpdateProfileBackgroundImageOptions options = this.OptionalProperties as UpdateProfileBackgroundImageOptions; if (options == null) return; this.RequestParameters.Add("use", options.UseImage ? "1" : "0"); if (options.Tiled.HasValue) this.RequestParameters.Add("tiled", options.Tiled.Value ? "1" : "0"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/TwitterRateLimitStatus.cs0000644000175000017500000001152612132510633031126 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter rate limit status class. //----------------------------------------------------------------------- namespace Twitterizer { using System; using Newtonsoft.Json; using Twitterizer.Core; /// /// The Twitter Rate Limit Status class /// #if !SILVERLIGHT [Serializable] #endif [JsonObject(MemberSerialization = MemberSerialization.OptIn)] public class TwitterRateLimitStatus : TwitterObject { #region API Properties /// /// Gets or sets the remaining hits. /// /// The remaining hits. [JsonProperty(PropertyName = "remaining_hits")] public int RemainingHits { get; set; } /// /// Gets or sets the hourly limit. /// /// The hourly limit. [JsonProperty(PropertyName = "hourly_limit")] public int HourlyLimit { get; set; } /// /// Gets or sets the UTC string value of the time rate limiting will reset. /// /// The reset time string. [JsonProperty(PropertyName = "reset_time")] [JsonConverter(typeof(TwitterizerDateConverter))] public DateTime ResetTime { get; set; } #endregion /// /// Gets the rate limiting status status for the authenticated user. /// /// The OAuth tokens. /// The options. /// /// A instance. /// public static TwitterResponse GetStatus(OAuthTokens tokens, OptionalProperties options) { Commands.RateLimitStatusCommand command = new Twitterizer.Commands.RateLimitStatusCommand(tokens, options); TwitterResponse result = Core.CommandPerformer.PerformAction(command); return result; } /// /// Gets the rate limiting status status based on the application's IP address. /// /// The OAuth tokens. /// /// A instance. /// public static TwitterResponse GetStatus(OAuthTokens tokens) { return GetStatus(tokens, null); } /// /// Gets the rate limiting status status based on the application's IP address. /// /// /// A instance. /// public static TwitterResponse GetStatus() { return GetStatus(null, null); } } }smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/TwitterAccount.cs0000644000175000017500000001734612132510633027432 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The TwitterAccount class. //----------------------------------------------------------------------- namespace Twitterizer { using Twitterizer.Core; /// /// Provides methods to request and modify details of an authorized user's account details. /// public static class TwitterAccount { /// /// Verifies the user's credentials. /// /// The tokens. /// The options. /// public static TwitterResponse VerifyCredentials(OAuthTokens tokens, VerifyCredentialsOptions options) { Commands.VerifyCredentialsCommand command = new Commands.VerifyCredentialsCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } /// /// Verifies the user's credentials. /// /// The tokens. /// public static TwitterResponse VerifyCredentials(OAuthTokens tokens) { return VerifyCredentials(tokens, null); } /// /// Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com /// /// The tokens. /// The options. /// /// The user, with updated data, as a /// public static TwitterResponse UpdateProfileColors(OAuthTokens tokens, UpdateProfileColorsOptions options) { Commands.UpdateProfileColorsCommand command = new Twitterizer.Commands.UpdateProfileColorsCommand(tokens, options); return CommandPerformer.PerformAction(command); } /// /// Updates the authenticating user's profile image. /// /// The tokens. /// The image data. /// The options. /// /// The user, with updated data, as a /// public static TwitterResponse UpdateProfileImage(OAuthTokens tokens, byte[] imageData, OptionalProperties options = null) { Commands.UpdateProfileImageCommand command = new Twitterizer.Commands.UpdateProfileImageCommand(tokens, imageData, options); return CommandPerformer.PerformAction(command); } /// /// Updates the authenticating user's profile image. /// /// The tokens. /// The image location. /// The options. /// /// The user, with updated data, as a /// public static TwitterResponse UpdateProfileImage(OAuthTokens tokens, string imageLocation, OptionalProperties options = null) { return UpdateProfileImage(tokens, System.IO.File.ReadAllBytes(imageLocation), options); } /// /// Updates the authenticating user's profile background image. This method can also be used to enable or disable the profile background image. /// /// The tokens. /// The image data. /// The options. /// public static TwitterResponse UpdateProfileBackgroundImage(OAuthTokens tokens, byte[] imageData = null, UpdateProfileBackgroundImageOptions options = null) { if (imageData == null && options == null) { throw new System.ArgumentNullException("imageData", "You must provide image data or indicate you wish to not use any image in the options argument."); } Commands.UpdateProfileBackgroundImageCommand command = new Twitterizer.Commands.UpdateProfileBackgroundImageCommand(tokens, imageData, options); return CommandPerformer.PerformAction(command); } /// /// Updates the authenticating user's profile background image. This method can also be used to enable or disable the profile background image. /// /// The tokens. /// The image location. /// The options. /// public static TwitterResponse UpdateProfileBackgroundImage(OAuthTokens tokens, string imageLocation, UpdateProfileBackgroundImageOptions options = null) { return UpdateProfileBackgroundImage(tokens, System.IO.File.ReadAllBytes(imageLocation), options); } /// /// Sets values that users are able to set under the "Account" tab of their settings page. Only the parameters specified will be updated. /// /// The tokens. /// The options. /// /// public static TwitterResponse UpdateProfile(OAuthTokens tokens, UpdateProfileOptions options) { Commands.UpdateProfileCommand command = new Commands.UpdateProfileCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/UpdateProfileImageCommand.cs0000644000175000017500000000715712253423361031464 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The update profile image command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Twitterizer.Core; #if !SILVERLIGHT [Serializable] #endif internal class UpdateProfileImageCommand : TwitterCommand { private readonly byte[] imageData; /// /// Initializes a new instance of the class. /// /// The tokens. /// The image. /// The options. public UpdateProfileImageCommand(OAuthTokens tokens, byte[] image, OptionalProperties options) : base(HTTPVerb.POST, "account/update_profile_image.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (image == null || image.Length == 0) { throw new ArithmeticException("Image data cannot be null or zero length."); } if (image.Length > 716800) { throw new ArithmeticException("Image cannot exceed 700Kb in size."); } this.imageData = image; this.Multipart = true; } /// /// Initializes the command. /// public override void Init() { this.RequestParameters.Add("image", this.imageData); this.RequestParameters.Add("include_entities", "true"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/UpdateProfileOptions.cs0000644000175000017500000000605512132510633030565 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The update profile options class. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Collections.Generic; using System.Linq; using System.Text; /// /// Optional properties for the class. /// public class UpdateProfileOptions : OptionalProperties { /// /// Gets or sets the name. /// /// The name. public string Name { get; set; } /// /// Gets or sets the URL. /// /// The URL. public string Url { get; set; } /// /// Gets or sets the location. /// /// The location. public string Location { get; set; } /// /// Gets or sets the description. /// /// The description. public string Description { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/UpdateProfileColorsOptions.cs0000644000175000017500000001151712253423361031753 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The update profile colors options class. //----------------------------------------------------------------------- namespace Twitterizer { #if !SILVERLIGHT using System.Drawing; #endif /// /// Optional properties for the .Profile*Colors methods. /// public class UpdateProfileColorsOptions : OptionalProperties { #if !SILVERLIGHT /// /// Initializes a new instance of the class. /// public UpdateProfileColorsOptions() { BackgroundColor = Color.Empty; TextColor = Color.Empty; LinkColor = Color.Empty; SidebarFillColor = Color.Empty; SidebarBorderColor = Color.Empty; } /// /// Gets or sets the color of the background. /// /// The color of the background. public Color BackgroundColor { get; set; } /// /// Gets or sets the color of the text. /// /// The color of the text. public Color TextColor { get; set; } /// /// Gets or sets the color of the link. /// /// The color of the link. public Color LinkColor { get; set; } /// /// Gets or sets the color of the sidebar fill. /// /// The color of the sidebar fill. public Color SidebarFillColor { get; set; } /// /// Gets or sets the color of the sidebar border. /// /// The color of the sidebar border. public Color SidebarBorderColor { get; set; } #else /// /// Gets or sets the color of the background. /// /// The color of the background. public string BackgroundColor { get; set; } /// /// Gets or sets the color of the text. /// /// The color of the text. public string TextColor { get; set; } /// /// Gets or sets the color of the link. /// /// The color of the link. public string LinkColor { get; set; } /// /// Gets or sets the color of the sidebar fill. /// /// The color of the sidebar fill. public string SidebarFillColor { get; set; } /// /// Gets or sets the color of the sidebar border. /// /// The color of the sidebar border. public string SidebarBorderColor { get; set; } #endif } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/UpdateProfileBackgroundImageOptions.cs0000644000175000017500000000621612253423361033534 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The update profile background image command class. //----------------------------------------------------------------------- namespace Twitterizer { using System; /// /// An options class for updating the user's profile background image. /// #if !SILVERLIGHT [Serializable] #endif public sealed class UpdateProfileBackgroundImageOptions : OptionalProperties { /// /// Gets or sets a value indicating whether or not to tile the background image. /// /// true if tiled; otherwise, false. public bool? Tiled { get; set; } /// /// Gets or sets a value indicating whether to display the profile background image or not. /// /// true to use an image; otherwise, false. public bool UseImage { get; set; } /// /// Initializes a new instance of the class. /// public UpdateProfileBackgroundImageOptions() { this.UseImage = true; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Account/VerifyCredentialsCommand.cs0000644000175000017500000000643412253423361031375 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // David Golden // The verify credentials optional parameters class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using Core; /// /// The verify credentials command class. /// [AuthorizedCommand] #if !SILVERLIGHT [System.Serializable] #endif internal class VerifyCredentialsCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public VerifyCredentialsCommand(OAuthTokens requestTokens, VerifyCredentialsOptions options) : base(HTTPVerb.GET, "account/verify_credentials.json", requestTokens, options) { } /// /// Initializes the command. /// public override void Init() { VerifyCredentialsOptions options = this.OptionalProperties as VerifyCredentialsOptions; if (options == null) return; if (options.IncludeEntities) { this.RequestParameters.Add("include_entities", "true"); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Search/0000755000175000017500000000000012253423361023727 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Search/SearchCommand.cs0000644000175000017500000001330512253423361026764 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The search command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Core; #if !SILVERLIGHT [Serializable] #endif [AuthorizedCommandAttribute] internal sealed class SearchCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The query. /// The options. public SearchCommand(OAuthTokens requestTokens, string query, SearchOptions options) : base(HTTPVerb.GET, "search/tweets.json", requestTokens, options) { if (string.IsNullOrEmpty(query)) { throw new ArgumentNullException("query"); } this.Query = query; this.DeserializationHandler = TwitterSearchResultCollection.Deserialize; } #endregion /// /// Gets or sets the query. /// /// The query. public string Query { get; set; } /// /// Initializes the command. /// public override void Init() { #if !SILVERLIGHT CultureInfo unitedStatesEnglishCulture = CultureInfo.GetCultureInfo("en-us"); #else CultureInfo unitedStatesEnglishCulture = CultureInfo.InvariantCulture; #endif this.RequestParameters.Add("q", this.Query); SearchOptions options = this.OptionalProperties as SearchOptions; if (options == null) { return; } if (!string.IsNullOrEmpty(options.Language)) { this.RequestParameters.Add("lang", options.Language); } if (!string.IsNullOrEmpty(options.Locale)) { this.RequestParameters.Add("locale", options.Locale); } if (options.MaxId > 0) { this.RequestParameters.Add("max_id", options.MaxId.ToString(unitedStatesEnglishCulture)); } if (options.Count > 0) { this.RequestParameters.Add("count", options.Count.ToString(unitedStatesEnglishCulture)); } if (options.SinceId > 0) { this.RequestParameters.Add("since_id", options.SinceId.ToString(unitedStatesEnglishCulture)); } if (!string.IsNullOrEmpty(options.GeoCode)) { this.RequestParameters.Add("geocode", options.GeoCode); } if (options.UntilDate > new DateTime()) { this.RequestParameters.Add("until", options.UntilDate.ToString("{0:yyyy-MM-dd}", unitedStatesEnglishCulture)); } switch (options.ResultType) { case SearchOptionsResultType.Mixed: this.RequestParameters.Add("result_type", "mixed"); break; case SearchOptionsResultType.Recent: this.RequestParameters.Add("result_type", "recent"); break; case SearchOptionsResultType.Popular: this.RequestParameters.Add("result_type", "popular"); break; } if (options.IncludeEntities) this.RequestParameters.Add("include_entities", "true"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Search/TwitterSearch.cs0000644000175000017500000000775412253423361027063 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter search class //----------------------------------------------------------------------- namespace Twitterizer { /// /// The Twitter Search Class /// public static class TwitterSearch { /// /// Searches Twitter with the the specified query. /// /// The query. /// /// A instance. /// public static TwitterResponse Search(string query) { return Search(query, null); } /// /// Searches Twitter with the the specified query. /// /// The query. /// The options. /// /// A instance. /// public static TwitterResponse Search(string query, SearchOptions options) { return Search(null, query, options); } /// /// Searches Twitter with the the specified query. /// /// The tokens. /// The query. /// The options. /// /// A instance. /// public static TwitterResponse Search(OAuthTokens tokens, string query, SearchOptions options) { if (options == null) options = new SearchOptions(); Commands.SearchCommand command = new Twitterizer.Commands.SearchCommand(tokens, query, options); TwitterResponse results = Core.CommandPerformer.PerformAction(command); return results; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Search/TwitterSearchResultCollection.cs0000644000175000017500000001371712253423361032272 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter search result collection class //----------------------------------------------------------------------- using Twitterizer.Core; namespace Twitterizer { using System; using Newtonsoft.Json; using Newtonsoft.Json.Linq; /// /// The Twitter Search Result Collection class /// #if !SILVERLIGHT [Serializable] #endif public class TwitterSearchResultCollection : Core.TwitterCollection, ITwitterObject { /// /// Gets or sets the completed_in. /// /// The value. /// public double CompletedIn { get; internal set; } /// /// Gets or sets the max_id. /// /// The value. /// public long MaxId { get; internal set; } /// /// Gets or sets the max_id as a string. /// /// The value. /// public string MaxIdStr { get; internal set; } /// /// Gets or sets the since_id. /// /// The value. /// public long SinceId { get; internal set; } /// /// Gets or sets the since_id_str. /// /// The value. /// public string SinceIdStr { get; internal set; } /// /// Gets or sets the query. /// /// The value. /// public string Query { get; internal set; } /// /// Gets or sets the refresh URL. /// /// The value. /// public string RefreshUrl { get; internal set; } /// /// Gets or sets the next results URL. /// /// The value. /// public string NextResults { get; internal set; } /// /// Gets or sets the number of tweets. /// /// The value. /// public int SearchCount { get; internal set; } /// /// Deserializes the specified value. /// /// The value. /// internal static TwitterSearchResultCollection Deserialize(JObject value) { if (value == null || value["statuses"] == null) return null; TwitterSearchResultCollection result = JsonConvert.DeserializeObject(value["statuses"].ToString()); result.CompletedIn = value.SelectToken("search_metadata.completed_in").Value(); result.MaxId = value.SelectToken("search_metadata.max_id").Value(); result.MaxIdStr = value.SelectToken("search_metadata.max_id_str").Value(); result.SinceId = value.SelectToken("search_metadata.since_id").Value(); result.SinceIdStr = value.SelectToken("search_metadata.since_id_str").Value(); result.Query = value.SelectToken("search_metadata.query").Value(); result.RefreshUrl = value.SelectToken("search_metadata.refresh_url").Value(); // bugged Twitter API docs: https://dev.twitter.com/docs/api/1.1/get/search/tweets //result.NextResults = value.SelectToken("search_metadata.next_results").Value(); result.SearchCount = value.SelectToken("search_metadata.count").Value(); return result; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Search/SearchOptions.cs0000644000175000017500000001223012253423361027035 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The search options class //----------------------------------------------------------------------- namespace Twitterizer { using System; /// /// The available search result type filter options. /// public enum SearchOptionsResultType { /// /// Use Twitter's default /// Default, /// /// Include both popular and real time results in the response. /// Mixed, /// /// Return only the most recent results in the response. /// Recent, /// /// Return only the most popular results in the response. /// Popular } /// /// The search options class. Provides a payload for optional parameters for the SearchCommand class. /// #if !SILVERLIGHT [Serializable] #endif public class SearchOptions : OptionalProperties { /// /// Initializes a new instance of the class. /// public SearchOptions() { UseSSL = true; } /// /// Gets or sets the language. /// /// The language. public string Language { get; set; } /// /// Gets or sets the locale. /// /// The locale. public string Locale { get; set; } /// /// Gets or sets the max id. /// /// The max id. public decimal MaxId { get; set; } /// /// Gets or sets the number per page. /// /// The number per page. public int Count { get; set; } /// /// Gets or sets the since id. /// /// The since id. public decimal SinceId { get; set; } /// /// Gets or sets the geo code string. /// The parameter value is specified by "latitude,longitude,radius", where radius units must be specified as either "mi" (miles) or "km" (kilometers). Note that you cannot use the near operator via the API to geocode arbitrary locations; however you can use this geocode parameter to search near geocodes directly. /// /// The geo code. public string GeoCode { get; set; } /// /// Gets or sets the until date. /// /// The until date. public DateTime UntilDate { get; set; } /// /// Gets or sets the type of the result. /// /// The type of the result. public SearchOptionsResultType ResultType { get; set; } /// /// Gets or sets whether to include some entities in the result. /// /// The type of the result. public bool IncludeEntities { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Geo/0000755000175000017500000000000012253423361023234 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Geo/TwitterPlaceCollection.cs0000644000175000017500000001250612132510633030205 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter place collection class. //----------------------------------------------------------------------- namespace Twitterizer { using System; using Newtonsoft.Json; using Twitterizer.Core; /// /// The Twitter Place Collection class. A collection of objects. /// #if !SILVERLIGHT [Serializable] #endif [JsonConverter(typeof(TwitterPlaceCollection.Converter))] [JsonObject] public class TwitterPlaceCollection : TwitterCollection, ITwitterObject { /// /// Converts json data to a . /// #if !SILVERLIGHT internal class Converter : JsonConverter #else public class Converter : JsonConverter #endif { /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { return objectType == typeof(TwitterPlaceCollection); } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { TwitterPlaceCollection result = new TwitterPlaceCollection(); reader.Read(); reader.Read(); bool hasReachedTheQuery = false; while (reader.Read()) { if (reader.TokenType == JsonToken.PropertyName && (string)reader.Value == "query") { hasReachedTheQuery = true; } if (hasReachedTheQuery) continue; if (reader.TokenType == JsonToken.StartObject) { result.Add(serializer.Deserialize(reader)); } } return result; } /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { // TODO: Implement this. // throw new NotImplementedException(); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Geo/ReverseGeocodeCommand.cs0000644000175000017500000001060412132510633027757 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The reverse geocode command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The reverse geocode command class. Performs a reverse geocode lookup. /// #if !SILVERLIGHT [Serializable] #endif internal class ReverseGeocodeCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The latitude. /// The longitude. /// The options. public ReverseGeocodeCommand(double latitude, double longitude, TwitterPlaceLookupOptions options) : base(HTTPVerb.GET, "geo/reverse_geocode.json", null, options) { this.Latitude = latitude; this.Longitude = longitude; } /// /// Gets or sets the latitude. /// /// The latitude. public double Latitude { get; set; } /// /// Gets or sets the longitude. /// /// The longitude. public double Longitude { get; set; } /// /// Initializes the command. /// public override void Init() { NumberFormatInfo nfi = CultureInfo.InvariantCulture.NumberFormat; this.RequestParameters.Add("lat", this.Latitude.ToString(nfi)); this.RequestParameters.Add("long", this.Longitude.ToString(nfi)); TwitterPlaceLookupOptions options = this.OptionalProperties as TwitterPlaceLookupOptions; if (options == null) return; if (!string.IsNullOrEmpty(options.Accuracy)) { this.RequestParameters.Add("accuracy", options.Accuracy); } if (!string.IsNullOrEmpty(options.Granularity)) { this.RequestParameters.Add("granularity", options.Granularity); } if (options.MaxResults != null) { this.RequestParameters.Add("max_results", options.MaxResults.Value.ToString(nfi)); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Geo/TwitterPlace.cs0000644000175000017500000001675212253423361026205 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter place class //----------------------------------------------------------------------- namespace Twitterizer { using System; using Newtonsoft.Json; using Twitterizer.Core; /// /// The twitter place class. Represents a place or area. /// [JsonObject(MemberSerialization = MemberSerialization.OptIn)] #if !SILVERLIGHT [Serializable] #endif [System.Diagnostics.DebuggerDisplay("{FullName} ({Id})")] public sealed class TwitterPlace : TwitterObject { /// /// Gets or sets the country code. /// /// The country code. [JsonProperty(PropertyName = "country_code")] public string CountryCode { get; set; } /// /// Gets or sets the type of the place. /// /// The type of the place. [JsonProperty(PropertyName = "place_type")] public string PlaceType { get; set; } /// /// Gets or sets the address of the data. /// /// The address of the data. [JsonProperty(PropertyName = "url")] public string DataAddress { get; set; } /// /// Gets or sets the country. /// /// The country. [JsonProperty(PropertyName = "country")] public string Country { get; set; } /// /// Gets or sets the address of the street. /// /// The address of the street. [JsonProperty(PropertyName = "street_address")] public string StreetAddress { get; set; } /// /// Gets or sets the postal code. /// /// The postal code. /// [JsonProperty(PropertyName = "postal_code")] public string PostalCode { get; set; } /// /// Gets or sets the phone number in the preferred local format for the place, include long distance code. /// /// The phone number. /// [JsonProperty(PropertyName = "phone")] public string Phone { get; set; } /// /// Gets or sets the locality. /// /// The locality. /// [JsonProperty(PropertyName = "locality")] public string Locality { get; set; } /// /// Gets or sets the region. /// /// The region. /// [JsonProperty(PropertyName = "region")] public string Region { get; set; } /// /// Gets or sets the iso3 country code. /// /// The iso3 country code. /// [JsonProperty(PropertyName = "iso3")] public string Iso3CountryCode { get; set; } /// /// Gets or sets the full name. /// /// The full name. [JsonProperty(PropertyName = "full_name")] public string FullName { get; set; } /// /// Gets or sets the name of the place. /// /// The name of the place. [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets the place id. /// /// The place id. [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Gets or sets an ID or comma separated list of IDs representing the place in the applications place database. /// /// The app ids. [JsonProperty(PropertyName = "app:id")] public string AppIds { get; set; } /// /// Gets or sets the bounding box. /// /// The bounding box. [JsonProperty(PropertyName = "bounding_box")] public TwitterBoundingBox BoundingBox { get; set; } /// /// Retrieves a place based on the specified coordinates. /// /// The latitude. /// The longitude. /// The options. /// A collection of matched items. public static TwitterResponse Lookup(double latitude, double longitude, TwitterPlaceLookupOptions options) { Commands.ReverseGeocodeCommand command = new Twitterizer.Commands.ReverseGeocodeCommand(latitude, longitude, options); return CommandPerformer.PerformAction(command); } /// /// Retrieves a place based on the specified coordinates. /// /// The latitude. /// The longitude. /// A collection of matched items. public static TwitterResponse Lookup(double latitude, double longitude) { return Lookup(latitude, longitude, null); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Geo/Coordinate.cs0000644000175000017500000001441212253423361025654 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The coordinate class //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Collections.ObjectModel; using System.Linq; using System.Runtime.Serialization; using Newtonsoft.Json; /// /// Represents a single point on planet earth. /// #if !SILVERLIGHT [Serializable] #endif [DataContract] public class Coordinate { /// /// Gets or sets the latitude. /// /// The latitude. public double Latitude { get; set; } /// /// Gets or sets the longitude. /// /// The longitude. public double Longitude { get; set; } /// /// Reads a json array of coordinates and converts it into a collection of coordinate objects. /// #if !SILVERLIGHT internal class Converter : JsonConverter #else public class Converter : JsonConverter #endif { /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { return objectType == typeof(Collection); } /// /// Reads the json. /// /// The reader. /// Type of the object. /// The existing value. /// The serializer. /// A deserialized public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { try { Collection result = existingValue as Collection; if (result == null) result = new Collection(); int startDepth = reader.Depth; if (reader.TokenType != JsonToken.StartArray) { return null; } if (reader.TokenType == JsonToken.StartArray) reader.Read(); //int depth = reader.Depth + 1; double count = 1; while (reader.Read() && reader.Depth > startDepth) { if (new[] { JsonToken.StartArray, JsonToken.EndArray }.Contains(reader.TokenType)) continue; int itemIndex = Convert.ToInt32(Math.Ceiling(count / 2) - 1); if (count % 2 > 0) { result.Add(new Coordinate()); result[itemIndex].Latitude = Convert.ToDouble(reader.Value); } else { result[itemIndex].Longitude = Convert.ToDouble(reader.Value); } count++; } return result; } catch { return null; } } /// /// Writes the json. /// /// The writer. /// The value. /// The serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { // TODO: Implement this. writer.WriteNull(); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Geo/TwitterGeo.cs0000644000175000017500000000676212132510633025666 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The geo location class. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Collections.ObjectModel; using Newtonsoft.Json; /// /// Lists the possible types of geographic boundaries. /// public enum TwitterGeoShapeType { /// /// A single point. Expect one coordinate. /// Point, /// /// A line, or multiple lines joined end-to-end. /// LineString, /// /// A polygon-shaped area. /// Polygon, /// /// A circle represented by a single point (the center) and the radius. /// CircleByCenterPoint } /// /// Represents a geological area /// #if !SILVERLIGHT [Serializable] #endif public class TwitterGeo { /// /// Gets or sets the type of the shape. /// /// The type of the shape. [JsonProperty(PropertyName = "type")] public TwitterGeoShapeType ShapeType { get; set; } /// /// Gets or sets the coordinates. /// /// The coordinates. [JsonProperty(PropertyName = "coordinates")] [JsonConverter(typeof(Coordinate.Converter))] public Collection Coordinates { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Geo/TwitterPlaceLookupOptions.cs0000644000175000017500000000665411655552527030767 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter place lookup options class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// Provides a payload for optional parameters for the method. /// public class TwitterPlaceLookupOptions : OptionalProperties { /// /// A hint on the "region" in which to search. If a number, then this is a radius in meters, but it can also take a string that is suffixed with ft to specify feet. If this is not passed in, then it is assumed to be 0m. If coming from a device, in practice, this value is whatever accuracy the device has measuring its location (whether it be coming from a GPS, WiFi triangulation, etc.). /// public string Accuracy { get; set; } /// /// The minimal granularity of data to return. If this is not passed in, then neighborhood is assumed. city can also be passed. /// public string Granularity { get; set; } /// /// A hint as to the number of results to return. This does not guarantee that the number of results returned will equal max_results, but instead informs how many "nearby" results to return. Ideally, only pass in the number of places you intend to display to the user here. /// public int? MaxResults { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Geo/TwitterBoundingBox.cs0000644000175000017500000000604212132510633027361 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter bounding box class. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Collections.ObjectModel; using Newtonsoft.Json; using Twitterizer.Core; /// /// The twitter bounding box class. Represents a series of latitude and longitude coordinates that represents an area. /// [JsonObject(MemberSerialization = MemberSerialization.OptIn)] #if !SILVERLIGHT [Serializable] #endif public class TwitterBoundingBox : TwitterObject { /// /// Gets or sets the type. /// /// The type of bounding box. [JsonProperty(PropertyName = "type")] public string Type { get; set; } /// /// Gets or sets the coordinates. /// /// The coordinates. [JsonProperty(PropertyName = "coordinates")] [JsonConverter(typeof(Coordinate.Converter))] public Collection Coordinates { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/0000755000175000017500000000000012274103753024000 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/RetweetsOfMeCommand.cs0000644000175000017500000000766712253423361030214 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The retweets of me command. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The Retweets Of Me Command. /// [AuthorizedCommandAttribute] internal sealed class RetweetsOfMeCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The options. public RetweetsOfMeCommand(OAuthTokens tokens, RetweetsOfMeOptions options) : base(HTTPVerb.GET, "statuses/retweets_of_me.json", tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } } #endregion /// /// Initializes the command. /// public override void Init() { this.RequestParameters.Add("include_entities", "true"); RetweetsOfMeOptions options = this.OptionalProperties as RetweetsOfMeOptions; if (options == null) { return; } if (options.SinceStatusId > 0) this.RequestParameters.Add("since_id", options.SinceStatusId.ToString(CultureInfo.InvariantCulture)); if (options.MaxStatusId > 0) this.RequestParameters.Add("max_id", options.MaxStatusId.ToString(CultureInfo.InvariantCulture)); if (options.Count > 0) this.RequestParameters.Add("count", options.Count.ToString(CultureInfo.InvariantCulture)); this.RequestParameters.Add("page", options.Page > 0 ? options.Page.ToString(CultureInfo.InvariantCulture) : "1"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/RetweetsCommand.cs0000644000175000017500000001010512132510633027415 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The retweets command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The retweets command class. /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class RetweetsCommand : TwitterCommand { /// /// Gets or sets the status id. /// /// The status id. public decimal StatusId { get; set; } #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The status id. /// The options. public RetweetsCommand(OAuthTokens tokens, decimal statusId, RetweetsOptions options) : base( HTTPVerb.GET, string.Format(CultureInfo.InvariantCulture, "statuses/retweets/{0}.json", statusId), tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (statusId <= 0) { throw new ArgumentNullException("statusId"); } this.StatusId = statusId; } #endregion /// /// Initializes the command. /// public override void Init() { this.RequestParameters.Add("id", this.StatusId.ToString(CultureInfo.InvariantCulture)); RetweetsOptions options = this.OptionalProperties as RetweetsOptions; if (options == null) { return; } if (options.Count > 0) this.RequestParameters.Add("count", options.Count.ToString(CultureInfo.InvariantCulture)); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/RetweetsOptions.cs0000644000175000017500000000501612132510633027477 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The retweets options class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The Retweets Options class. Provides a payload for optional parameters for the Retweets Command /// #if !SILVERLIGHT [System.Serializable] #endif public class RetweetsOptions : OptionalProperties { /// /// Gets or sets the count of statuses to return. /// /// The number of statuses to return. public int Count { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/TwitterStatus.cs0000644000175000017500000005463712274103753027214 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The TwitterStatus class //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Linq; using System.Diagnostics; using Newtonsoft.Json; using Twitterizer.Core; using Twitterizer.Entities; using System.Runtime.Serialization; /// [JsonObject(MemberSerialization.OptIn)] #if !SILVERLIGHT [Serializable] #endif [DebuggerDisplay("{User.ScreenName}/{Text}")] [DataContract] public class TwitterStatus : TwitterObject { #region Properties /// /// Gets or sets the status id. /// /// The status id. [DataMember, JsonProperty(PropertyName = "id")] public decimal Id { get; set; } /// /// Gets or sets the string id. /// /// The string id. [DataMember, JsonProperty(PropertyName = "id_str")] public string StringId { get; set; } /// /// Gets or sets a value indicating whether this status message is truncated. /// /// /// true if this status message is truncated; otherwise, false. /// [DataMember, JsonProperty(PropertyName = "truncated")] public bool? IsTruncated { get; set; } /// /// Gets or sets the created date. /// /// The created date. [DataMember] [JsonProperty(PropertyName = "created_at")] [JsonConverter(typeof(TwitterizerDateConverter))] public DateTime CreatedDate { get; set; } /// /// Gets or sets the source. /// /// The source. [DataMember, JsonProperty(PropertyName = "source")] public string Source { get; set; } /// /// Gets or sets the screenName the status is in reply to. /// /// The screenName. [DataMember, JsonProperty(PropertyName = "in_reply_to_screen_name")] public string InReplyToScreenName { get; set; } /// /// Gets or sets the user id the status is in reply to. /// /// The user id. [DataMember, JsonProperty(PropertyName = "in_reply_to_user_id")] public decimal? InReplyToUserId { get; set; } /// /// Gets or sets the status id the status is in reply to. /// /// The status id. [DataMember, JsonProperty(PropertyName = "in_reply_to_status_id")] public decimal? InReplyToStatusId { get; set; } /// /// Gets or sets a value indicating whether the authenticated user has favorited this status. /// /// /// true if this instance is favorited; otherwise, false. /// [DataMember, JsonProperty(PropertyName = "favorited")] public bool? IsFavorited { get; set; } /// /// Gets or sets the text of the status. /// /// The status text. [DataMember, JsonProperty(PropertyName = "text")] public string Text { get; set; } /// /// Gets or sets the user. /// /// The user that posted this status. [DataMember, JsonProperty(PropertyName = "user")] public TwitterUser User { get; set; } /// /// Gets or sets the retweeted status. /// /// The retweeted status. [DataMember, JsonProperty(PropertyName = "retweeted_status")] public TwitterStatus RetweetedStatus { get; set; } /// /// Gets or sets the place. /// /// The place. [DataMember, JsonProperty(PropertyName = "place")] public TwitterPlace Place { get; set; } /// /// Gets or sets the geo location data. /// /// The geo location data. [DataMember, JsonProperty(PropertyName = "geo")] public TwitterGeo Geo { get; set; } /// /// Gets or sets the entities. /// /// The entities. [DataMember] [JsonProperty(PropertyName = "entities")] [JsonConverter(typeof(Entities.TwitterEntityCollection.Converter))] public Entities.TwitterEntityCollection Entities { get; set; } /// /// Gets or sets the retweet count string. /// /// The retweet count. [DataMember, JsonProperty(PropertyName = "retweet_count")] public string RetweetCountString { get; set; } /// /// Gets the retweet count. /// /// The retweet count. [DataMember] public int? RetweetCount { get { if (string.IsNullOrEmpty(this.RetweetCountString)) return null; int parsedResult; if ( this.RetweetCountString.EndsWith("+") && !int.TryParse(this.RetweetCountString.Substring(0, this.RetweetCountString.Length - 1), out parsedResult) ) { return null; } if (!int.TryParse(this.RetweetCountString, out parsedResult)) { return null; } return parsedResult; } } /// /// Gets a value indicating that the number of retweets exceeds the reported value in RetweetCount. For example, "more than 100" /// /// The retweet count plus indicator. [DataMember] public bool? RetweetCountPlus { get { if (string.IsNullOrEmpty(this.RetweetCountString)) return null; return this.RetweetCountString.EndsWith("+"); } } /// /// Gets or sets a value indicating whether this is retweeted. /// /// true if retweeted; otherwise, false. [DataMember, JsonProperty(PropertyName = "retweeted")] public bool Retweeted { get; set; } #endregion /// /// Returns the status text with HTML links to users, urls, and hashtags. /// /// public string LinkifiedText() { return LinkifiedText(Entities, Text); } internal static string LinkifiedText(TwitterEntityCollection entities, string text) { if (entities == null || entities.Count == 0) { return text; } string linkedText = text; var entitiesSorted = entities.OrderBy(e => e.StartIndex).Reverse(); foreach (TwitterEntity entity in entitiesSorted) { if (entity is TwitterHashTagEntity) { TwitterHashTagEntity tagEntity = (TwitterHashTagEntity)entity; linkedText = string.Format( "{0}{1}{2}", linkedText.Substring(0, entity.StartIndex), tagEntity.Text, linkedText.Substring(entity.EndIndex)); } if (entity is TwitterUrlEntity) { TwitterUrlEntity urlEntity = (TwitterUrlEntity)entity; linkedText = string.Format( "{0}{1}{2}", linkedText.Substring(0, entity.StartIndex), urlEntity.Url, linkedText.Substring(entity.EndIndex)); } if (entity is TwitterMentionEntity) { TwitterMentionEntity mentionEntity = (TwitterMentionEntity)entity; linkedText = string.Format( "{0}@{1}{2}", linkedText.Substring(0, entity.StartIndex), mentionEntity.ScreenName, linkedText.Substring(entity.EndIndex)); } } return linkedText; } /// /// Updates the authenticating user's status. A status update with text identical to the authenticating user's text identical to the authenticating user's current status will be ignored to prevent duplicates. /// /// The tokens. /// The status text. /// A object of the newly created status. public static TwitterResponse Update(OAuthTokens tokens, string text) { return Update(tokens, text, null); } /// /// Updates the authenticating user's status. A status update with text identical to the authenticating user's text identical to the authenticating user's current status will be ignored to prevent duplicates. /// /// The tokens. /// The status text. /// The options. /// /// A object of the newly created status. /// public static TwitterResponse Update(OAuthTokens tokens, string text, StatusUpdateOptions options) { return CommandPerformer.PerformAction(new Commands.UpdateStatusCommand(tokens, text, options)); } /// /// Updates the authenticating user's status. A status update with text identical to the authenticating user's text identical to the authenticating user's current status will be ignored to prevent duplicates. /// /// The tokens. /// The status text. /// The file to upload, as a byte array. /// The options. /// /// A object of the newly created status. /// public static TwitterResponse UpdateWithMedia(OAuthTokens tokens, string text, byte[] fileData, StatusUpdateOptions options = null) { return CommandPerformer.PerformAction(new Commands.UpdateWithMediaCommand(tokens, text, fileData, options)); } /// /// Updates the authenticating user's status. A status update with text identical to the authenticating user's text identical to the authenticating user's current status will be ignored to prevent duplicates. /// /// The tokens. /// The status text. /// The file location. /// The options. /// /// A object of the newly created status. /// public static TwitterResponse UpdateWithMedia(OAuthTokens tokens, string text, string fileLocation, StatusUpdateOptions options = null) { return UpdateWithMedia(tokens, text, System.IO.File.ReadAllBytes(fileLocation), options); } /// /// Deletes the specified status. /// /// The oauth tokens. /// The status id. /// The options. /// /// A object of the deleted status. /// public static TwitterResponse Delete(OAuthTokens tokens, decimal id, OptionalProperties options) { Commands.DeleteStatusCommand command = new Twitterizer.Commands.DeleteStatusCommand(tokens, id, options); return CommandPerformer.PerformAction(command); } /// /// Deletes the specified status. /// /// The oauth tokens. /// The status id. /// A object of the deleted status. public static TwitterResponse Delete(OAuthTokens tokens, decimal id) { return Delete(tokens, id, null); } /// /// Returns a single status, with user information, specified by the id parameter. /// /// The tokens. /// The status id. /// The options. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, decimal statusId, OptionalProperties options) { return CommandPerformer.PerformAction(new Commands.ShowStatusCommand(tokens, statusId, options)); } /// /// Returns a single status, with user information, specified by the id parameter. /// /// The tokens. /// The status id. /// A instance. public static TwitterResponse Show(OAuthTokens tokens, decimal statusId) { return Show(tokens, statusId, null); } /// /// Returns a single status, with user information, specified by the id parameter. /// /// The status id. /// A instance. public static TwitterResponse Show(decimal statusId) { return Show(null, statusId); } /// /// Retweets a tweet. Requires the id parameter of the tweet you are retweeting. (say that 5 times fast) /// /// The tokens. /// The status id. /// The options. /// A representing the newly created tweet. public static TwitterResponse Retweet(OAuthTokens tokens, decimal statusId, OptionalProperties options) { return CommandPerformer.PerformAction( new Commands.RetweetCommand(tokens, statusId, options)); } /// /// Retweets a tweet. Requires the id parameter of the tweet you are retweeting. (say that 5 times fast) /// /// The tokens. /// The status id. /// A representing the newly created tweet. public static TwitterResponse Retweet(OAuthTokens tokens, decimal statusId) { return Retweet(tokens, statusId, null); } /// /// Returns up to 100 of the first retweets of a given tweet. /// /// The tokens. /// The status id. /// The options. /// /// A instance. /// public static TwitterResponse Retweets(OAuthTokens tokens, decimal statusId, RetweetsOptions options) { return CommandPerformer.PerformAction( new Commands.RetweetsCommand(tokens, statusId, options)); } /// /// Returns up to 100 of the first retweets of a given tweet. /// /// The tokens. /// The status id. /// A instance. public static TwitterResponse Retweets(OAuthTokens tokens, decimal statusId) { return Retweets(tokens, statusId, null); } /// /// Retweets a tweet. Requires the id parameter of the tweet you are retweeting. (say that 5 times fast) /// /// The tokens. /// The options. /// /// A representing the newly created tweet. /// public TwitterResponse Retweet(OAuthTokens tokens, OptionalProperties options) { return Retweet(tokens, this.Id, options); } /// /// Retweets a tweet. Requires the id parameter of the tweet you are retweeting. (say that 5 times fast) /// /// The tokens. /// /// A representing the newly created tweet. /// public TwitterResponse Retweet(OAuthTokens tokens) { return Retweet(tokens, this.Id, null); } /// /// Deletes the status. /// /// The oauth tokens. /// The options. /// /// A object of the deleted status. /// public TwitterResponse Delete(OAuthTokens tokens, OptionalProperties options) { return Delete(tokens, this.Id, options); } /// /// Deletes the status. /// /// The oauth tokens. /// /// A object of the deleted status. /// public TwitterResponse Delete(OAuthTokens tokens) { return Delete(tokens, this.Id, null); } /// /// Shows Related Results of a tweet. Requires the id parameter of the tweet you are getting results for. /// /// The tokens. /// The status id. /// A representing the newly created tweet. /// public static TwitterResponse RelatedResultsShow(OAuthTokens tokens, decimal statusId) { return CommandPerformer.PerformAction( new Commands.RelatedResultsCommand(tokens, statusId, null)); } /// /// Shows Related Results of a tweet. Requires the id parameter of the tweet you are getting results for. /// /// The tokens. /// The status id. /// The options. /// A representing the newly created tweet. public static TwitterResponse RelatedResultsShow(OAuthTokens tokens, decimal statusId, OptionalProperties options) { return CommandPerformer.PerformAction( new Commands.RelatedResultsCommand(tokens, statusId, options)); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/Entities/0000755000175000017500000000000012253423361025561 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/Entities/TwitterEntityCollection.cs0000644000175000017500000005445312253423361032776 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter entity collection class //----------------------------------------------------------------------- using System.Collections.Generic; namespace Twitterizer.Entities { using System; using System.Linq; using System.Collections.ObjectModel; using Newtonsoft.Json; using System.Linq.Expressions; using System.Reflection; using System.Globalization; /// /// Represents multiple objects. /// #if !SILVERLIGHT [Serializable] #endif public class TwitterEntityCollection : Collection { /// /// The Json converter for data. /// #if !SILVERLIGHT internal class Converter : JsonConverter #else public class Converter : JsonConverter #endif { /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { return objectType == typeof(TwitterEntityCollection); } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { TwitterEntityCollection result = existingValue as TwitterEntityCollection; if (result == null) result = new TwitterEntityCollection(); int startDepth = reader.Depth; string entityType = string.Empty; TwitterEntity entity = null; try { if (reader.TokenType == JsonToken.StartArray) reader.Read(); while (reader.Read() && reader.Depth > startDepth) { if (reader.TokenType == JsonToken.PropertyName && reader.Depth == startDepth + 1) { entityType = (string)reader.Value; continue; } switch (entityType) { case "urls": if (reader.TokenType == JsonToken.StartObject) entity = new TwitterUrlEntity(); TwitterUrlEntity tue = entity as TwitterUrlEntity; if (tue != null) { ReadFieldValue(reader, "url", entity, () => tue.Url); ReadFieldValue(reader, "display_url", entity, () => tue.DisplayUrl); ReadFieldValue(reader, "expanded_url", entity, () => tue.ExpandedUrl); } break; case "user_mentions": if (reader.TokenType == JsonToken.StartObject) entity = new TwitterMentionEntity(); TwitterMentionEntity tme = entity as TwitterMentionEntity; if (tme != null) { ReadFieldValue(reader, "screen_name", entity, () => tme.ScreenName); ReadFieldValue(reader, "name", entity, () => tme.Name); ReadFieldValue(reader, "id", entity, () => tme.UserId); } break; case "hashtags": if (reader.TokenType == JsonToken.StartObject) entity = new TwitterHashTagEntity(); TwitterHashTagEntity the = entity as TwitterHashTagEntity; if (the != null) { ReadFieldValue(reader, "text", entity, () => the.Text); } break; case "media": // Move to object start and parse the entity reader.Read(); entity = parseMediaEntity(reader); break; } // Read the indicies (for all entities except Media) if (reader.TokenType == JsonToken.PropertyName && (string)reader.Value == "indices" && entity != null) { reader.Read(); reader.Read(); entity.StartIndex = Convert.ToInt32((long)reader.Value); reader.Read(); entity.EndIndex = Convert.ToInt32((long)reader.Value); } if ((reader.TokenType == JsonToken.EndObject && entity != null) || entity is TwitterMediaEntity) { result.Add(entity); entity = null; } } } catch { } return result; } /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. /// This is a best attempt to recreate the structure created by the Twitter API. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { TwitterEntityCollection entities = (TwitterEntityCollection)value; writer.WriteStartObject(); { WriteEntity(writer, entities.OfType().ToList(), "hashtags", (w, e) => { w.WritePropertyName("text"); w.WriteValue(e.Text); }); WriteEntity(writer, entities.OfType().ToList(), "user_mentions", (w, e) => { w.WritePropertyName("screen_name"); w.WriteValue(e.ScreenName); w.WritePropertyName("name"); w.WriteValue(e.Name); w.WritePropertyName("id"); w.WriteValue(e.UserId); }); WriteEntity(writer, entities.OfType().ToList(), "urls", (w, e) => { w.WritePropertyName("url"); w.WriteValue(e.Url); w.WritePropertyName("display_url"); w.WriteValue(e.DisplayUrl); w.WritePropertyName("expanded_url"); w.WriteValue(e.ExpandedUrl); }); WriteEntity(writer, entities.OfType().ToList(), "media", WriteMediaEntity); writer.WriteEndObject(); } } /// /// Writes the media entity. /// /// The w. /// The e. private static void WriteMediaEntity(JsonWriter w, TwitterMediaEntity e) { w.WritePropertyName("type"); switch (e.MediaType) { case TwitterMediaEntity.MediaTypes.Unknown: w.WriteNull(); break; case TwitterMediaEntity.MediaTypes.Photo: w.WriteValue("photo"); break; default: break; } w.WritePropertyName("sizes"); w.WriteStartObject(); { foreach (var item in e.Sizes) { w.WritePropertyName(item.Size.ToString().ToLower()); w.WriteStartObject(); { w.WritePropertyName("h"); w.WriteValue(item.Height); w.WritePropertyName("w"); w.WriteValue(item.Width); w.WritePropertyName("resize"); w.WriteValue(item.Resize == TwitterMediaEntity.MediaSize.MediaSizeResizes.Fit ? "fit" : "crop"); w.WriteEndObject(); } } w.WriteEndObject(); } w.WritePropertyName("id"); w.WriteValue(e.Id); w.WritePropertyName("id_str"); w.WriteValue(e.IdString); w.WritePropertyName("media_url"); w.WriteValue(e.MediaUrl); w.WritePropertyName("media_url_https"); w.WriteValue(e.MediaUrlSecure); w.WritePropertyName("url"); w.WriteValue(e.Url); w.WritePropertyName("display_url"); w.WriteValue(e.DisplayUrl); w.WritePropertyName("expanded_url"); w.WriteValue(e.ExpandedUrl); } /// /// Writes an entity. /// /// /// The writer. /// The entities. /// Name of the entity. /// The details action. private static void WriteEntity(JsonWriter writer, IEnumerable entities, string entityName, Action detailsAction) where T : TwitterEntity { // Note to people reading this code: Extra brackets exist to group code by json hierarchy. You're welcome. writer.WritePropertyName(entityName); writer.WriteStartArray(); { foreach (var item in entities) { writer.WriteStartObject(); { writer.WritePropertyName("indices"); writer.WriteStartArray(); { writer.WriteValue(item.StartIndex); writer.WriteValue(item.EndIndex); writer.WriteEndArray(); } detailsAction(writer, item); writer.WriteEndObject(); } } writer.WriteEndArray(); } } /// /// Parses the media entity. /// /// The reader. /// public TwitterMediaEntity parseMediaEntity(JsonReader reader) { try { if (reader.TokenType != JsonToken.StartObject) return null; TwitterMediaEntity entity = new TwitterMediaEntity(); int startDepth = reader.Depth; // Start looping through all of the child nodes while (reader.Read() && reader.Depth >= startDepth) { // If the current node isn't a property, skip it if (reader.TokenType != JsonToken.PropertyName) { continue; } string fieldName = reader.Value as string; if (string.IsNullOrEmpty(fieldName)) { continue; } switch (fieldName) { case "type": entity.MediaType = string.IsNullOrEmpty((string)reader.Value) ? TwitterMediaEntity.MediaTypes.Unknown : TwitterMediaEntity.MediaTypes.Photo; break; case "sizes": entity.Sizes = new List(); break; case "large": case "medium": case "small": case "thumb": if (reader.TokenType != JsonToken.PropertyName) { break; } TwitterMediaEntity.MediaSize newSize = new TwitterMediaEntity.MediaSize(); switch ((string)reader.Value) { case "large": newSize.Size = TwitterMediaEntity.MediaSize.MediaSizes.Large; break; case "medium": newSize.Size = TwitterMediaEntity.MediaSize.MediaSizes.Medium; break; case "small": newSize.Size = TwitterMediaEntity.MediaSize.MediaSizes.Small; break; case "thumb": newSize.Size = TwitterMediaEntity.MediaSize.MediaSizes.Thumb; break; default: break; } int sizeDepth = reader.Depth; // Loop through all of the properties of the size and read their values while (reader.Read() && sizeDepth < reader.Depth) { if (reader.TokenType != JsonToken.PropertyName) { continue; } ReadFieldValue(reader, "h", newSize, () => newSize.Height); ReadFieldValue(reader, "w", newSize, () => newSize.Width); if (reader.TokenType == JsonToken.PropertyName && (string)reader.Value == "resize") { reader.Read(); newSize.Resize = string.IsNullOrEmpty((string)reader.Value) ? TwitterMediaEntity.MediaSize.MediaSizeResizes.Unknown : ((string)reader.Value == "fit" ? TwitterMediaEntity.MediaSize.MediaSizeResizes.Fit : TwitterMediaEntity.MediaSize.MediaSizeResizes.Crop); } } entity.Sizes.Add(newSize); break; case "indices": reader.Read(); reader.Read(); entity.StartIndex = Convert.ToInt32((long)reader.Value); reader.Read(); entity.EndIndex = Convert.ToInt32((long)reader.Value); break; default: break; } ReadFieldValue(reader, "id", entity, () => entity.Id); ReadFieldValue(reader, "id_str", entity, () => entity.IdString); ReadFieldValue(reader, "media_url", entity, () => entity.MediaUrl); ReadFieldValue(reader, "media_url_https", entity, () => entity.MediaUrlSecure); ReadFieldValue(reader, "url", entity, () => entity.Url); ReadFieldValue(reader, "display_url", entity, () => entity.DisplayUrl); ReadFieldValue(reader, "expanded_url", entity, () => entity.ExpandedUrl); } return entity; } catch { return null; } } private bool ReadFieldValue(JsonReader reader, string fieldName, ref T result) { try { if (reader.TokenType != JsonToken.PropertyName) return false; if ((string)reader.Value != fieldName) return false; reader.Read(); if (reader.ValueType == typeof(T)) { result = (T)reader.Value; } else { #if !SILVERLIGHT result = (T)Convert.ChangeType(reader.Value, typeof(T)); #endif #if SILVERLIGHT result = (T)Convert.ChangeType(reader.Value, typeof(T), CultureInfo.InvariantCulture); #endif } return true; } catch { return false; } } private void ReadFieldValue(JsonReader reader, string fieldName, TSource source, Expression> property) where TSource : class { try { if (reader == null || source == null) { return /*false*/; } var expr = (MemberExpression)property.Body; var prop = (PropertyInfo)expr.Member; TProperty value = (TProperty)prop.GetValue(source, null); if (ReadFieldValue(reader, fieldName, ref value)) { prop.SetValue(source, value, null); return /*true*/; } return /*false*/; } catch { return /*false*/; } } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/Entities/TwitterHashTagEntity.cs0000644000175000017500000000500012253423361032202 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter hash tag entity class //----------------------------------------------------------------------- namespace Twitterizer.Entities { /// /// Represents a pre-parsed hash tag in a value. /// #if !SILVERLIGHT [System.Serializable] #endif public class TwitterHashTagEntity : TwitterEntity { /// /// Gets or sets the hash tag text. /// /// The hash tag text. public string Text { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/Entities/TwitterEntity.cs0000644000175000017500000000546612132510633030755 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter entity class //----------------------------------------------------------------------- namespace Twitterizer.Entities { using System; /// /// The base class for twitter entities that describe tweet text. /// #if !SILVERLIGHT [Serializable] #endif public class TwitterEntity { /// /// Initializes a new instance of the class. /// internal TwitterEntity() { } /// /// Gets or sets the start index. /// /// The start index. public int StartIndex { get; set; } /// /// Gets or sets the end index. /// /// The end index. public int EndIndex { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/Entities/TwitterMentionEntity.cs0000644000175000017500000000554512253423361032312 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter metions entity class. //----------------------------------------------------------------------- namespace Twitterizer.Entities { /// /// Represents mention of a user within a value. /// #if !SILVERLIGHT [System.Serializable] #endif public class TwitterMentionEntity : TwitterEntity { /// /// Gets or sets the user's screen name. /// /// The user's screen name. public string ScreenName { get; set; } /// /// Gets or sets the user's name. /// /// The user's name. public string Name { get; set; } /// /// Gets or sets the user id. /// /// The user id. public decimal UserId { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/Entities/TwitterUrlEntity.cs0000644000175000017500000000570012253423361031434 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter url entity class //----------------------------------------------------------------------- namespace Twitterizer.Entities { /// /// Represents a pre-parsed url located within the body of a . /// #if !SILVERLIGHT [System.Serializable] #endif public class TwitterUrlEntity : TwitterEntity { /// /// Gets or sets the URL parsed from the tweet text. /// /// The parsed URL. public string Url { get; set; } /// /// Gets or sets the Display URL parsed from the tweet text. /// /// The parsed Display URL. public string DisplayUrl { get; set; } /// /// Gets or sets the Expanded URL parsed from the tweet text. /// /// The parsed Expanded URL. public string ExpandedUrl { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/Entities/TwitterMediaEntity.cs0000644000175000017500000001575412253423361031723 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter url entity class //----------------------------------------------------------------------- namespace Twitterizer.Entities { using System.Collections.Generic; using System; /// /// Represents a pre-parsed media entity located within the body of a . /// /// #if !SILVERLIGHT [Serializable] #endif public class TwitterMediaEntity : TwitterUrlEntity { /// /// The list of currently available and supported media types. /// /// public enum MediaTypes { /// /// (default) Indicates the media type returned is unsupported. /// Unknown, /// /// Indicates the media type returned is a photo. /// Photo } /// /// Gets or sets the type of the media. /// /// The type of the media. /// public MediaTypes MediaType { get; set; } /// /// Gets or sets the id. /// /// The id. /// public decimal Id { get; set; } /// /// Gets or sets the id string. /// /// The id string. /// public string IdString { get; set; } /// /// Gets or sets the media URL. /// /// The media URL. /// public string MediaUrl { get; set; } /// /// Gets or sets the media URL secure. /// /// The media URL secure. /// public string MediaUrlSecure { get; set; } /// /// Gets or sets the sizes. /// /// The sizes. /// public List Sizes { get; set; } /// /// Represents the display size of a media entity. /// /// public class MediaSize { /// /// The enumerated types of reszing that could be applied to the media entity. /// /// public enum MediaSizeResizes { /// /// Indicates that the resizing method was unrecognized. /// Unknown, /// /// Indicates that the media entity was cropped. /// Crop, /// /// Indicates that the media entity was resized to fit without cropping. /// Fit } /// /// The list of recognized media sizes. /// /// public enum MediaSizes { /// /// (default) Indicates that the size provided by the API was unrecognized. /// Unknown, /// /// Indicates that the media entity is a thumbnail size. /// Thumb, /// /// Indicates that the media entity is a small size. /// Small, /// /// Indicates that the media entity is a medium size. /// Medium, /// /// Indicates that the media entity is a large size. /// Large } /// /// Gets or sets the size. /// /// The size. /// public MediaSizes Size { get; set; } /// /// Gets or sets the width. /// /// The width. /// public int Width { get; set; } /// /// Gets or sets the height. /// /// The height. /// public int Height { get; set; } /// /// Gets or sets the resize. /// /// The resize. /// public MediaSizeResizes Resize { get; set; } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/UpdateWithmediaCommand.cs0000644000175000017500000001143112253423361030701 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Daan Timmer // The command to update the user's status. (a.k.a. post a new tweet) //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The command to update the user's status. (a.k.a. post a new tweet) /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class UpdateWithMediaCommand : TwitterCommand { /// /// Gets or sets the status text. /// /// The status text. public string Text { get; set; } /// /// Gets or sets the file location. /// /// The file location. public byte[] File { get; set; } /// /// Initializes a new instance of the class. /// /// The request tokens. /// The status text. /// The file to upload, as a byte array. /// The optional properties. public UpdateWithMediaCommand(OAuthTokens tokens, string text, byte[] fileData, StatusUpdateOptions optionalProperties) : base(HTTPVerb.POST, "Set below", tokens, optionalProperties) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (string.IsNullOrEmpty(text)) { throw new ArgumentNullException("text"); } if (fileData == null || fileData.Length == 0) { throw new ArgumentException("file"); } this.OptionalProperties.APIBaseAddress = "https://upload.twitter.com/1/"; this.SetCommandUri("statuses/update_with_media.json"); this.Text = text; this.File = fileData; this.Multipart = true; } /// /// Initializes the command. /// public override void Init() { this.RequestParameters.Add("status", this.Text); this.RequestParameters.Add("media[]", this.File); StatusUpdateOptions options = this.OptionalProperties as StatusUpdateOptions; if (options != null) { if (options.InReplyToStatusId > 0) this.RequestParameters.Add("in_reply_to_status_id", options.InReplyToStatusId.ToString(CultureInfo.CurrentCulture)); if (options.Latitude != 0) this.RequestParameters.Add("lat", options.Latitude.ToString()); if (options.Longitude != 0) this.RequestParameters.Add("long", options.Longitude.ToString()); if (!string.IsNullOrEmpty(options.PlaceId)) this.RequestParameters.Add("place_id", options.PlaceId); if (options.PlacePin) this.RequestParameters.Add("display_coordinates", "true"); } } } }smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/ShowStatusCommand.cs0000644000175000017500000000663112132510633027750 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The Show Status Command class //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer; using Twitterizer.Core; /// /// The Show Status Command /// #if !SILVERLIGHT [Serializable] #endif internal sealed class ShowStatusCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The status id. /// The options. public ShowStatusCommand(OAuthTokens requestTokens, decimal statusId, OptionalProperties options) : base( HTTPVerb.GET, string.Format(CultureInfo.InvariantCulture, "statuses/show/{0}.json", statusId), requestTokens, options) { if (statusId <= 0) { throw new ArgumentNullException("statusId"); } } #endregion /// /// Inits this instance. /// public override void Init() { this.RequestParameters.Add("include_entities", "true"); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/DeleteStatusCommand.cs0000644000175000017500000000664612132510633030240 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The command class to delete a status update. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The command class to delete a status update. /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class DeleteStatusCommand : TwitterCommand { #region Constructors /// /// Initializes a new instance of the class. /// /// The tokens. /// The status id. /// The options. public DeleteStatusCommand(OAuthTokens tokens, decimal id, OptionalProperties options) : base( HTTPVerb.POST, string.Format(CultureInfo.InvariantCulture, "statuses/destroy/{0}.json", id), tokens, options) { this.Id = id; } #endregion /// /// Gets or sets the status id. /// /// The status id. public decimal Id { get; set; } /// /// Initializes the command. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/TwitterStatusCollection.cs0000644000175000017500000000517012132510633031204 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The collection of TwitterStatus objects. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Runtime.Serialization; using Twitterizer.Core; /// /// The TwitterStatusCollection class. /// #if !SILVERLIGHT [Serializable] #endif [DataContract] public class TwitterStatusCollection : TwitterCollection, ITwitterObject { /// /// Gets or sets the current page number. /// /// The current page number. [DataMember] public int Page { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/UpdateStatusCommand.cs0000644000175000017500000001141612253423361030254 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The command to update the user's status. (a.k.a. post a new tweet) //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The command to update the user's status. (a.k.a. post a new tweet) /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class UpdateStatusCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The request tokens. /// The status text. /// The optional properties. public UpdateStatusCommand(OAuthTokens tokens, string text, StatusUpdateOptions optionalProperties) : base(HTTPVerb.POST, "statuses/update.json", tokens, optionalProperties) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (string.IsNullOrEmpty(text)) { throw new ArgumentNullException("text"); } this.Text = text; } #region Properties /// /// Gets or sets the status text. /// /// The status text. public string Text { get; set; } #endregion /// /// Initializes the command. /// public override void Init() { this.RequestParameters.Add("status", this.Text); StatusUpdateOptions options = this.OptionalProperties as StatusUpdateOptions; if (options != null) { NumberFormatInfo nfi = CultureInfo.InvariantCulture.NumberFormat; if (options.InReplyToStatusId > 0) this.RequestParameters.Add("in_reply_to_status_id", options.InReplyToStatusId.ToString(CultureInfo.CurrentCulture)); if (options.Latitude != 0) this.RequestParameters.Add("lat", options.Latitude.ToString(nfi)); if (options.Longitude != 0) this.RequestParameters.Add("long", options.Longitude.ToString(nfi)); if (!string.IsNullOrEmpty(options.PlaceId)) this.RequestParameters.Add("place_id", options.PlaceId); if (options.PlacePin) this.RequestParameters.Add("display_coordinates", "true"); if (options.WrapLinks) this.RequestParameters.Add("wrap_links", "true"); } } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/TwitterRelatedTweetsCollection.cs0000644000175000017500000000470412132510633032477 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The collection of TwitterRelatedTweets objects. //----------------------------------------------------------------------- namespace Twitterizer { using System; using Twitterizer.Core; #if !SILVERLIGHT /// /// Represents a collection of . /// /// [Serializable] #endif public class TwitterRelatedTweetsCollection : TwitterCollection, ITwitterObject { } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/RetweetsOfMeOptions.cs0000644000175000017500000000615412132510633030252 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The retweets of me options class. //----------------------------------------------------------------------- namespace Twitterizer { using Twitterizer.Core; /// /// The Retweets of Me options class. Provides optional parameters for the RetweetsOfMeCommand class. /// #if !SILVERLIGHT [System.Serializable] #endif public class RetweetsOfMeOptions : OptionalProperties { /// /// Gets or sets the since status id. /// /// The since status id. public decimal SinceStatusId { get; set; } /// /// Gets or sets the max status id. /// /// The max status id. public decimal MaxStatusId { get; set; } /// /// Gets or sets the count of tweets to return. /// /// The count of tweets. public int Count { get; set; } /// /// Gets or sets the page number to return. /// /// The page number. public int Page { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/RetweetCommand.cs0000644000175000017500000000712612132510633027243 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The retweet command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The retweet command class. /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class RetweetCommand : TwitterCommand { /// /// The base address to the API method. /// private const string Path = "statuses/retweet/{0}.json"; #region Constructors /// /// Initializes a new instance of the class. /// /// The request tokens. /// The status id. /// The options. public RetweetCommand(OAuthTokens tokens, decimal statusId, OptionalProperties options) : base( HTTPVerb.POST, string.Format(CultureInfo.InvariantCulture, Path, statusId), tokens, options) { if (statusId <= 0) { throw new ArgumentException("Status ID is invalid", "statusId"); } if (tokens == null) { throw new ArgumentNullException("tokens"); } } #endregion /// /// Initializes the command. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/RelatedResultsCommand.cs0000644000175000017500000000710212132510633030560 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCpH DAMAGE. // // Edgardo Vega and Ricky Smith // The related results command. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The Related Results Command. /// [AuthorizedCommandAttribute] internal sealed class RelatedResultsCommand : TwitterCommand { /// /// The base address to the API method. /// private const string Path = "related_results/show/{0}.json"; /// /// Initializes a new instance of the class. /// /// The request tokens. /// The status id. /// The options. public RelatedResultsCommand(OAuthTokens tokens, decimal statusId, OptionalProperties options) : base( HTTPVerb.GET, string.Format(CultureInfo.InvariantCulture, Path, statusId), tokens, options) { if (statusId <= 0) { throw new ArgumentException("Status ID is invalid", "statusId"); } if (tokens == null) { throw new ArgumentNullException("tokens"); } } /// /// Initializes the command. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/TwitterRelatedTweets.cs0000644000175000017500000000676212132510633030471 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The related tweets object. //----------------------------------------------------------------------- namespace Twitterizer { using System; using System.Diagnostics; using Newtonsoft.Json; /// /// The related tweets object. Represents the result from the related_results/show/:id.json endpoint. /// /// [JsonObject(MemberSerialization.OptIn)] #if !SILVERLIGHT [Serializable] #endif [DebuggerDisplay("{GroupName}/{ResultType}")] public class TwitterRelatedTweets : Core.TwitterObject { /// /// Gets or sets the results. /// /// The results. [JsonProperty(PropertyName = "results")] public TwitterStatusCollection Results { get; set; } /// /// Gets or sets the type of the result. /// /// The type of the result. [JsonProperty(PropertyName = "resultType")] public string ResultType { get; set; } /// /// Gets or sets the name of the group. /// /// The name of the group. [JsonProperty(PropertyName = "groupName")] public string GroupName { get; set; } /// /// Gets or sets the score. /// /// The score. [JsonProperty(PropertyName = "score")] public decimal Score { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Tweets/StatusUpdateOptions.cs0000644000175000017500000000741612253423361030336 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The status update options class //----------------------------------------------------------------------- namespace Twitterizer { /// /// The Status Update Options class /// #if !SILVERLIGHT [System.Serializable] #endif public sealed class StatusUpdateOptions : OptionalProperties { /// /// Gets or sets the in reply to status id. /// /// The in reply to status id. public decimal InReplyToStatusId { get; set; } /// /// Gets or sets the latitude. /// /// The latitude. public double Latitude { get; set; } /// /// Gets or sets the longitude. /// /// The longitude. public double Longitude { get; set; } /// /// Gets or sets a value indicating whether or not to put a pin on the exact coordinates a tweet has been sent from. /// /// true to put a pin on the exact coordinates; otherwise, false. public bool PlacePin { get; set; } /// /// Gets or sets a place in the world. These IDs can be retrieved from geo/reverse_geocode. /// /// The place id. public string PlaceId { get; set; } /// /// Gets or sets a value indicating whether links should be wrapped with Twitter's t.co link wrapper. /// /// true if [wrap links]; otherwise, false. /// More information is available here: https://dev.twitter.com/docs/tco-link-wrapper/faq public bool WrapLinks { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Favorites/0000755000175000017500000000000012253423361024464 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Favorites/DeleteFavoriteCommand.cs0000644000175000017500000000705212132510633031213 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The delete favorite command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The delete favoriate command class. /// Un-favorites the status specified in the ID parameter as the authenticating user. /// Returns the un-favorited status in the requested format when successful. /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class DeleteFavoriteCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The status id. /// The options. public DeleteFavoriteCommand(OAuthTokens tokens, decimal statusId, OptionalProperties options) : base(HTTPVerb.POST, string.Format(CultureInfo.InvariantCulture.NumberFormat, "favorites/destroy/{0}.json", statusId), tokens, options) { if (statusId <= 0) { throw new ArgumentException("Status Id is required."); } if (tokens == null) { throw new ArgumentNullException("tokens"); } } /// /// Initializes the command. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Favorites/CreateFavoriteCommand.cs0000644000175000017500000000676512132510633031226 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The create favorite command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The Create Favorite Command class. Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful. /// [AuthorizedCommandAttribute] #if !SILVERLIGHT [Serializable] #endif internal sealed class CreateFavoriteCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The status id. /// The options. public CreateFavoriteCommand(OAuthTokens tokens, decimal statusId, OptionalProperties options) : base(HTTPVerb.POST, string.Format(CultureInfo.InvariantCulture.NumberFormat, "favorites/create/{0}.json", statusId), tokens, options) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (statusId <= 0) { throw new ArgumentException("Status Id is required."); } } /// /// Initializes the command. /// public override void Init() { } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Favorites/ListFavoritesOptions.cs0000644000175000017500000000663112253423361031173 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The list favorites options class. //----------------------------------------------------------------------- namespace Twitterizer { /// /// The list favorites options class. Provides a payload for optional parameters of the ListFavoritesCommand class. /// #if !SILVERLIGHT [System.Serializable] #endif public class ListFavoritesOptions : OptionalProperties { /// /// Gets or sets the number of favorites to return. /// /// The number of favorites to return per page. public int Count { get;set; } /// /// Gets or sets the user name or id of the user for whom to return results for. /// /// The user name or id of the user for whom to return results for. public string UserNameOrId { get; set; } /// /// Gets or sets the page. /// /// The page number. public int Page { get; set; } /// /// Gets or sets the minimum (earliest) status id to request. /// /// The since id. public decimal SinceStatusId { get; set; } /// /// Gets or sets the max (latest) status id to request. /// /// The max id. public decimal MaxStatusId { get; set; } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Favorites/ListFavoritesCommand.cs0000644000175000017500000001050612253423361031112 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The list favorites command class. //----------------------------------------------------------------------- namespace Twitterizer.Commands { using System; using System.Globalization; using Twitterizer.Core; /// /// The ListFavoritesCommand class. Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. /// #if !SILVERLIGHT [Serializable] #endif internal sealed class ListFavoritesCommand : TwitterCommand { /// /// Initializes a new instance of the class. /// /// The tokens. /// The options. public ListFavoritesCommand(OAuthTokens tokens, ListFavoritesOptions options) : base(HTTPVerb.GET, "favorites.json", tokens, options) { if (tokens == null && (options == null || string.IsNullOrEmpty(options.UserNameOrId))) { throw new ArgumentException("Valid tokens or user must be supplied."); } } /// /// Initializes the command. /// public override void Init() { this.RequestParameters.Add("include_entities", "true"); ListFavoritesOptions options = this.OptionalProperties as ListFavoritesOptions; if (options == null) { this.RequestParameters.Add("page", "1"); return; } this.RequestParameters.Add("page", options.Page > 0 ? options.Page.ToString(CultureInfo.InvariantCulture) : "1"); if (!string.IsNullOrEmpty(options.UserNameOrId)) { this.RequestParameters.Add("id", options.UserNameOrId); } if (options.Count > 0) { this.RequestParameters.Add("count", options.Count.ToString(CultureInfo.InvariantCulture)); } if (options.SinceStatusId > 0) this.RequestParameters.Add("since_id", options.SinceStatusId.ToString()); if (options.MaxStatusId > 0) this.RequestParameters.Add("max_id", options.MaxStatusId.ToString()); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Methods/Favorites/TwitterFavorite.cs0000644000175000017500000001436312253423361030164 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The twitter favorite class. //----------------------------------------------------------------------- namespace Twitterizer { using System; using Core; /// /// The TwitterFavorite class. Provides static methods for manipulating favorite tweets. /// #if !SILVERLIGHT [Serializable] #endif public sealed class TwitterFavorite : TwitterObject { /// /// Favorites the status specified in the ID parameter as the authenticating user. /// /// The tokens. /// The status id. /// The options. /// The favorite status when successful. public static TwitterResponse Create(OAuthTokens tokens, decimal statusId, OptionalProperties options) { return CommandPerformer.PerformAction( new Commands.CreateFavoriteCommand(tokens, statusId, options)); } /// /// Favorites the status specified in the ID parameter as the authenticating user. /// /// The tokens. /// The status id. /// The favorite status when successful. public static TwitterResponse Create(OAuthTokens tokens, decimal statusId) { return Create(tokens, statusId, null); } /// /// Un-favorites the status specified in the ID parameter as the authenticating user. /// /// The tokens. /// The status id. /// The options. /// The un-favorited status in the requested format when successful. public static TwitterResponse Delete(OAuthTokens tokens, decimal statusId, OptionalProperties options) { return CommandPerformer.PerformAction( new Commands.DeleteFavoriteCommand(tokens, statusId, options)); } /// /// Un-favorites the status specified in the ID parameter as the authenticating user. /// /// The tokens. /// The status id. /// /// The un-favorited status in the requested format when successful. /// public static TwitterResponse Delete(OAuthTokens tokens, decimal statusId) { return Delete(tokens, statusId, null); } /// /// Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. /// /// The tokens. /// The options. /// The 20 most recent favorite statuses public static TwitterResponse List(OAuthTokens tokens, ListFavoritesOptions options) { return CommandPerformer.PerformAction( new Commands.ListFavoritesCommand(tokens, options)); } /// /// Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. /// /// The tokens. /// The 20 most recent favorite statuses public static TwitterResponse List(OAuthTokens tokens) { return List(tokens, null); } /// /// Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. /// /// The options. /// The 20 most recent favorite statuses public static TwitterResponse List(ListFavoritesOptions options) { return List(null, options); } } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Attributes/0000755000175000017500000000000012253423361023245 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Twitterizer/Twitterizer2/Attributes/AuthorizedCommandAttribute.cs0000644000175000017500000000460712253423361031104 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The authorized command attribute class //----------------------------------------------------------------------- namespace Twitterizer.Core { using System; /// /// Indicates that a command class requires authorization tokens. /// [AttributeUsage(System.AttributeTargets.Class, Inherited = false, AllowMultiple = false)] internal sealed class AuthorizedCommandAttribute : System.Attribute { } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Attributes/RateLimitedAttribute.cs0000644000175000017500000000464412253423361027673 0ustar00meebeymeebey00000000000000//----------------------------------------------------------------------- // // This file is part of the Twitterizer library (http://www.twitterizer.net/) // // Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // - Neither the name of the Twitterizer nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Ricky Smith // The rate limited attribute class. //----------------------------------------------------------------------- namespace Twitterizer { using System; /// /// Identifies command classes that must enforce rate limiting. This will cause rate status to be queried before each command call. /// [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] internal sealed class RateLimitedAttribute : Attribute { } } smuxi-0.11/lib/Twitterizer/Twitterizer2/Twitterizer2.csproj0000644000175000017500000004570712274103753024777 0ustar00meebeymeebey00000000000000 Debug AnyCPU 9.0.30729 2.0 {2FDC3492-6B9E-4771-9755-7892C9CB1E96} Library Properties Twitterizer Twitterizer2 512 false Twitterizer2.snk 3.5 false publish\ true Disk false Foreground 7 Days false false true 0 1.0.0.%2a false true ..\..\twitterizer\ true true full false ..\Debug\Twitterizer2\Full\ DEBUG;TRACE prompt 4 ..\Debug\Twitterizer2\Full\Twitterizer2.XML AllRules.ruleset pdbonly true ..\Release\net40\ TRACE prompt 4 ..\Release\net40\Twitterizer2.XML AllRules.ruleset true bin\Mono-Debug\ TRACE;DEBUG;MONO_2_4 bin\Debug\Twitterizer2.XML full AnyCPU prompt AllRules.ruleset bin\Mono-Release\ TRACE;MONO_2_4 true pdbonly AnyCPU prompt AllRules.ruleset true bin\CCNET\ DEBUG;TRACE bin\Debug\Twitterizer2.XML full AnyCPU prompt AllRules.ruleset OnBuildSuccess CommonAssemblyInfo.cs Code Designer False .NET Framework 3.5 SP1 Client Profile false False .NET Framework 3.5 SP1 true False Windows Installer 3.1 true GettingStarted.txt Twitterizer2.license.txt {A9AE40FF-1A21-414A-9FE7-3BE13644CC6D} Newtonsoft.Json smuxi-0.11/lib/Twitterizer/Twitterizer2.license.txt0000644000175000017500000000275211655552527023323 0ustar00meebeymeebey00000000000000Copyright (c) 2010, Patrick "Ricky" Smith All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name Twitterizer nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.smuxi-0.11/lib/Twitterizer/Json.NET.license.txt0000644000175000017500000000205211655552527022234 0ustar00meebeymeebey00000000000000Copyright (c) 2007 James Newton-King Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.smuxi-0.11/lib/Twitterizer/GettingStarted.txt0000644000175000017500000000434612132510633022174 0ustar00meebeymeebey00000000000000 ___ ___ ___ ___ __ __ ___ __ _ _ _ | | | | | | |__ |__) | / |__ |__) | | | |/\| | | | |___ | \ | /_ |___ | \ _|_|_ Q) Which files do I need? A) More than likely, you only need Twitterizer2.dll and Newtonsoft.Json.dll Q) What exactly are all these files? A) Twitterizer2.dll This is the main binary which contains the core class library. This file is required for all addon libraries. Twitterizer2.Data.dll This is an additional library that provides data conversion functionality. For example, with it you can quickly generate DataTables from any Twitterizer2 collection. This file is not necessary for most projects. Newtonsoft.Json.dll This is JSON.NET, developed by James Newton-King. You do not need to add a reference in your project to this library, but it must be placed in your project's bin folder along with Twitterizer2.dll. More information can be found here: http://james.newtonking.com/pages/json-net.aspx Twitterizer2.Async.dll This is an addon library that allows developers to call Twitterizer2 methods asynchronously. This file is not necessary for most projects. Twitterizer2.Streaming.dll This is an addon library that provides access to the Streaming API. This file is not necessary for most projects. Twitterizer.OAuth.dll This is a standalone library that provides access to our OAuth request signing functionality without using Twitterizer2. _DO_NOT_ include this file in your project if you are using Twitterizer2.dll. All of the functionality found in this library is available within Twitterizer2.dll. This file is not necessary for most projects. Twitterizer2lite.dll This is a slimmed down version of the Twitterizer2.dll file built with the client profile as the target framework. It will lack some extra pieces of functionality, such as the built-in data caching and support for application configuration settings. _DO_NOT_ include this file in your project if you are using Twitterizer2.dll. This file is not necessary for most projects. Q) What about the license files? A) The license files must accompany the dlls. That means that they must be distributed along with your application.smuxi-0.11/lib/Makefile.am0000644000175000017500000004413612274103742016212 0ustar00meebeymeebey00000000000000SUBDIRS = $(MESSAGINGMENU_SHARP_SUBDIR) if WITH_MESSAGINGMENU_SHARP_INCLUDED MESSAGINGMENU_SHARP_SUBDIR = messagingmenu-sharp else # HACK: override DIST_SUBDIRS so distcheck/distclean works on systems without # libmessaging-menu-dev installed DIST_SUBDIRS = $(SUBDIRS) endif OUTPUT_DIR = $(top_builddir)/bin/$(PROFILE) OBJECT_DIR = $(OUTPUT_DIR)/obj SOURCE_PATTERNS = *.cs */*.cs */*/*.cs */*/*/*.cs */*/*/*/*.cs */*/*/*/*/*.cs XBUILD_FLAGS += /p:Configuration=Debug /p:SignAssembly=false /p:WarningLevel=0 /p:Warn=0 /p:OutputPath=$(abspath $(OUTPUT_DIR)) /p:BaseIntermediateOutputPath=$(abspath $(OBJECT_DIR))/ /p:IntermediateOutputPath=$(abspath $(OBJECT_DIR))/ /p:DocumentationFile= SERVICESTACK_TEXT_SUBDIR = ServiceStack.Text SERVICESTACK_TEXT_SRCDIR = $(srcdir)/$(SERVICESTACK_TEXT_SUBDIR)/src/ServiceStack.Text SERVICESTACK_TEXT_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(SERVICESTACK_TEXT_SRCDIR)/$(pattern))) SERVICESTACK_TEXT_EXTRA_FILES = $(SERVICESTACK_TEXT_BUILD_FILE) SERVICESTACK_TEXT_ASSEMBLY_NAME = ServiceStack.Text.dll SERVICESTACK_TEXT_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(SERVICESTACK_TEXT_ASSEMBLY_NAME) SERVICESTACK_TEXT_BUILD_FILE = $(SERVICESTACK_TEXT_SRCDIR)/ServiceStack.Text.csproj SERVICESTACK_TEXT_XBUILD_FLAGS = $(XBUILD_FLAGS) SERVICESTACK_SUBDIR = ServiceStack SERVICESTACK_SRCDIR = $(srcdir)/$(SERVICESTACK_SUBDIR) SERVICESTACK_INTERFACES_SRCDIR = $(srcdir)/$(SERVICESTACK_SUBDIR)/src/ServiceStack.Interfaces SERVICESTACK_INTERFACES_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(SERVICESTACK_INTERFACES_SRCDIR)/$(pattern))) SERVICESTACK_INTERFACES_EXTRA_FILES = $(SERVICESTACK_INTERFACES_BUILD_FILE) SERVICESTACK_INTERFACES_ASSEMBLY_NAME = ServiceStack.Interfaces.dll SERVICESTACK_INTERFACES_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(SERVICESTACK_INTERFACES_ASSEMBLY_NAME) SERVICESTACK_INTERFACES_BUILD_FILE = $(SERVICESTACK_INTERFACES_SRCDIR)/ServiceStack.Interfaces.csproj SERVICESTACK_INTERFACES_XBUILD_FLAGS = $(XBUILD_FLAGS) SERVICESTACK_COMMON_SRCDIR = $(srcdir)/$(SERVICESTACK_SUBDIR)/src/ServiceStack.Common SERVICESTACK_COMMON_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(SERVICESTACK_COMMON_SRCDIR)/$(pattern))) SERVICESTACK_COMMON_EXTRA_FILES = $(SERVICESTACK_COMMON_BUILD_FILE) SERVICESTACK_COMMON_ASSEMBLY_NAME = ServiceStack.Common.dll SERVICESTACK_COMMON_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(SERVICESTACK_COMMON_ASSEMBLY_NAME) SERVICESTACK_COMMON_BUILD_FILE = $(SERVICESTACK_COMMON_SRCDIR)/ServiceStack.Common.csproj SERVICESTACK_COMMON_XBUILD_FLAGS = $(XBUILD_FLAGS) /property:DefineConstants="MONOTOUCH" EXTRA_SERVICESTACK_LIBS = \ $(SERVICESTACK_TEXT_ASSEMBLY_TARGET) $(SERVICESTACK_TEXT_ASSEMBLY_TARGET).mdb \ $(SERVICESTACK_INTERFACES_ASSEMBLY_TARGET) $(SERVICESTACK_INTERFACES_ASSEMBLY_TARGET).mdb \ $(SERVICESTACK_COMMON_ASSEMBLY_TARGET) $(SERVICESTACK_COMMON_ASSEMBLY_TARGET).mdb JSON_SUBDIR = Newtonsoft.Json JSON_SRCDIR = $(srcdir)/$(JSON_SUBDIR)/Src/Newtonsoft.Json JSON_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(JSON_SRCDIR)/$(pattern))) JSON_EXTRA_FILES = \ $(JSON_BUILD_FILE) \ $(JSON_SRCDIR)/Dynamic.snk JSON_CLEAN_FILES = $(OBJECT_DIR)/Newtonsoft.Json.Dynamic.snk JSON_ASSEMBLY_NAME = Newtonsoft.Json.dll JSON_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(JSON_ASSEMBLY_NAME) JSON_BUILD_FILE = $(JSON_SRCDIR)/Newtonsoft.Json.csproj JSON_XBUILD_FLAGS = $(XBUILD_FLAGS) TWITTERIZER_SUBDIR = Twitterizer TWITTERIZER_SRCDIR = $(srcdir)/$(TWITTERIZER_SUBDIR)/Twitterizer2 TWITTERIZER_SOURCE_FILES = $(foreach pattern, ../*.cs $(SOURCE_PATTERNS), $(wildcard $(TWITTERIZER_SRCDIR)/$(pattern))) TWITTERIZER_EXTRA_FILES = \ $(TWITTERIZER_BUILD_FILE) \ $(TWITTERIZER_SRCDIR)/Twitterizer2.snk \ $(TWITTERIZER_SRCDIR)/../CommonAssemblyInfo.cs \ $(TWITTERIZER_SRCDIR)/../GettingStarted.txt \ $(TWITTERIZER_SRCDIR)/../Json.NET.license.txt \ $(TWITTERIZER_SRCDIR)/../Twitterizer2.license.txt TWITTERIZER_CLEAN_FILES = \ $(OUTPUT_DIR)/.license.txt \ $(OUTPUT_DIR)/Twitterizer2.license.txt \ $(OUTPUT_DIR)/Json.NET.license.txt \ $(OUTPUT_DIR)/GettingStarted.txt TWITTERIZER_ASSEMBLY_NAME = Twitterizer2.dll TWITTERIZER_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(TWITTERIZER_ASSEMBLY_NAME) TWITTERIZER_BUILD_FILE = $(TWITTERIZER_SRCDIR)/Twitterizer2.csproj TWITTERIZER_XBUILD_FLAGS = $(XBUILD_FLAGS) /p:PostBuildEvent= JABBER_NET_SUBDIR = agsxmpp/agsxmpp JABBER_NET_SRCDIR = $(srcdir)/$(JABBER_NET_SUBDIR) JABBER_NET_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(JABBER_NET_SRCDIR)/$(pattern))) JABBER_NET_EXTRA_FILES = $(JABBER_NET_SRCDIR)/agsxmpp.csproj JABBER_NET_CLEAN_FILES = $(wildcard $(OBJECT_DIR)/*.bmp) JABBER_NET_ASSEMBLY_NAME = agsxmpp.dll JABBER_NET_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(JABBER_NET_ASSEMBLY_NAME) JABBER_NET_BUILD_FILE = $(JABBER_NET_SRCDIR)/agsxmpp.csproj JABBER_NET_XBUILD_FLAGS = $(XBUILD_FLAGS) /property:DefineConstants="TRACE,DEBUG,SSL,STRINGPREP,MONO" STARKSOFTPROXY_SUBDIR = StarkSoftProxy STARKSOFTPROXY_SRCDIR = $(srcdir)/$(STARKSOFTPROXY_SUBDIR) STARKSOFTPROXY_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(STARKSOFTPROXY_SRCDIR)/$(pattern))) STARKSOFTPROXY_EXTRA_FILES = $(STARKSOFTPROXY_SRCDIR)/StarkSoftProxy.csproj STARKSOFTPROXY_CLEAN_FILES = STARKSOFTPROXY_ASSEMBLY_NAME = StarkSoftProxy.dll STARKSOFTPROXY_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(STARKSOFTPROXY_ASSEMBLY_NAME) STARKSOFTPROXY_BUILD_FILE = $(STARKSOFTPROXY_SRCDIR)/StarkSoftProxy.csproj STARKSOFTPROXY_XBUILD_FLAGS = $(XBUILD_FLAGS) SMARTIRC4NET_SUBDIR = SmartIrc4net SMARTIRC4NET_SRCDIR = $(srcdir)/$(SMARTIRC4NET_SUBDIR) SMARTIRC4NET_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(SMARTIRC4NET_SRCDIR)/$(pattern))) SMARTIRC4NET_EXTRA_FILES = $(SMARTIRC4NET_SRCDIR)/SmartIrc4net.csproj SMARTIRC4NET_CLEAN_FILES = SMARTIRC4NET_ASSEMBLY_NAME = Meebey.SmartIrc4net.dll SMARTIRC4NET_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(SMARTIRC4NET_ASSEMBLY_NAME) SMARTIRC4NET_BUILD_FILE = $(SMARTIRC4NET_SRCDIR)/SmartIrc4net.csproj SMARTIRC4NET_XBUILD_FLAGS = $(XBUILD_FLAGS) DB4O_SUBDIR = db4o-net DB4O_SRCDIR = $(srcdir)/$(DB4O_SUBDIR)/Db4objects.Db4o DB4O_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(DB4O_SRCDIR)/$(pattern))) DB4O_EXTRA_FILES = $(DB4O_BUILD_FILE) DB4O_ASSEMBLY_NAME = Db4objects.Db4o.dll DB4O_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(DB4O_ASSEMBLY_NAME) DB4O_BUILD_FILE = $(DB4O_SRCDIR)/Db4objects.Db4o-2008.csproj DB4O_XBUILD_FLAGS = $(XBUILD_FLAGS) /property:DefineConstants="NET_3_5,MONO,EMBEDDED" #DB4O_INSTR_SRCDIR = $(srcdir)/$(DB4O_SUBDIR)/Db4objects.Db4o.Instrumentation #DB4O_INSTR_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(DB4O_INSTR_SRCDIR)/$(pattern))) #DB4O_INSTR_ASSEMBLY_NAME = Db4objects.Db4o.Instrumentation.dll #DB4O_INSTR_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(DB4O_INSTR_ASSEMBLY_NAME) #DB4O_INSTR_BUILD_FILE = $(DB4O_INSTR_SRCDIR)/Db4objects.Db4o.Instrumentation-2008.csproj #DB4O_INSTR_XBUILD_FLAGS = $(DB4O_XBUILD_FLAGS) #DB4O_NQ_SRCDIR = $(srcdir)/$(DB4O_SUBDIR)/Db4objects.Db4o.NativeQueries #DB4O_NQ_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(DB4O_NQ_SRCDIR)/$(pattern))) #DB4O_NQ_ASSEMBLY_NAME = Db4objects.Db4o.NativeQueries.dll #DB4O_NQ_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(DB4O_NQ_ASSEMBLY_NAME) #DB4O_NQ_BUILD_FILE = $(DB4O_NQ_SRCDIR)/Db4objects.Db4o.NativeQueries-2008.csproj #DB4O_NQ_XBUILD_FLAGS = $(DB4O_XBUILD_FLAGS) SIGNALR_CLIENT_SUBDIR = SignalR SIGNALR_CLIENT_SRCDIR = $(srcdir)/$(SIGNALR_CLIENT_SUBDIR)/src/Microsoft.AspNet.SignalR.Client SIGNALR_CLIENT_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(SIGNALR_CLIENT_SRCDIR)/$(pattern))) \ $(foreach file, ../Common/CommonAssemblyInfo.cs ../Common/CommonVersionInfo.cs ../Microsoft.AspNet.SignalR.Core/Infrastructure/CancellationTokenExtensions.cs ../Microsoft.AspNet.SignalR.Core/Infrastructure/DisposableAction.cs ../Microsoft.AspNet.SignalR.Core/Infrastructure/Disposer.cs ../Microsoft.AspNet.SignalR.Core/Infrastructure/ExceptionsExtensions.cs ../Microsoft.AspNet.SignalR.Core/TaskAsyncHelper.cs, $(SIGNALR_CLIENT_SRCDIR)/$(file)) SIGNALR_CLIENT_EXTRA_FILES = \ $(SIGNALR_CLIENT_BUILD_FILE) \ $(SIGNALR_CLIENT_SRCDIR)/Resources.resx \ $(SIGNALR_CLIENT_SRCDIR)/../Common/Microsoft.AspNet.SignalR.targets #SIGNALR_CLIENT_CLEAN_FILES = $(OBJECT_DIR)/Newtonsoft.Json.Dynamic.snk SIGNALR_CLIENT_ASSEMBLY_NAME = Microsoft.AspNet.SignalR.Client.dll SIGNALR_CLIENT_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(SIGNALR_CLIENT_ASSEMBLY_NAME) SIGNALR_CLIENT_BUILD_FILE = $(SIGNALR_CLIENT_SRCDIR)/Microsoft.AspNet.SignalR.Client.csproj SIGNALR_CLIENT_XBUILD_FLAGS = $(XBUILD_FLAGS) /property:DefineConstants="MONO" JABBR_CLIENT_SUBDIR = JabbR JABBR_CLIENT_SRCDIR = $(srcdir)/$(JABBR_CLIENT_SUBDIR)/JabbR.Client JABBR_CLIENT_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(JABBR_CLIENT_SRCDIR)/$(pattern))) JABBR_CLIENT_EXTRA_FILES = \ $(JABBR_CLIENT_BUILD_FILE) \ $(JABBR_CLIENT_SRCDIR)/../JabbR/Models/ClientMessage.cs \ $(JABBR_CLIENT_SRCDIR)/../JabbR/Models/ClientNotification.cs #JABBR_CLIENT_CLEAN_FILES = $(OBJECT_DIR)/Newtonsoft.Json.Dynamic.snk JABBR_CLIENT_ASSEMBLY_NAME = JabbR.Client.dll JABBR_CLIENT_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(JABBR_CLIENT_ASSEMBLY_NAME) JABBR_CLIENT_BUILD_FILE = $(JABBR_CLIENT_SRCDIR)/JabbR.Client.csproj JABBR_CLIENT_XBUILD_FLAGS = $(XBUILD_FLAGS) # magic automake variables if ENABLE_ENGINE_TWITTER EXTRA_JSON_LIBS = \ $(JSON_ASSEMBLY_TARGET) $(JSON_ASSEMBLY_TARGET).mdb EXTRA_TWITTER_LIBS = \ $(TWITTERIZER_ASSEMBLY_TARGET) $(TWITTERIZER_ASSEMBLY_TARGET).mdb endif if ENABLE_ENGINE_XMPP EXTRA_XMPP_LIBS = \ $(JABBER_NET_ASSEMBLY_TARGET) $(JABBER_NET_ASSEMBLY_TARGET).mdb endif if ENABLE_ENGINE_JABBR EXTRA_JSON_LIBS = \ $(JSON_ASSEMBLY_TARGET) $(JSON_ASSEMBLY_TARGET).mdb EXTRA_JABBR_LIBS = \ $(SIGNALR_CLIENT_ASSEMBLY_TARGET) $(SIGNALR_CLIENT_ASSEMBLY_TARGET).mdb \ $(JABBR_CLIENT_ASSEMBLY_TARGET) $(JABBR_CLIENT_ASSEMBLY_TARGET).mdb endif if ENABLE_ENGINE_IRC EXTRA_IRC_LIBS = \ $(SMARTIRC4NET_ASSEMBLY_TARGET) $(SMARTIRC4NET_ASSEMBLY_TARGET).mdb endif EXTRA_PROXY_LIBS = \ $(STARKSOFTPROXY_ASSEMBLY_TARGET) $(STARKSOFTPROXY_ASSEMBLY_TARGET).mdb if BUNDLE_DB4O EXTRA_DB4O_LIBS = \ $(DB4O_ASSEMBLY_TARGET) $(DB4O_ASSEMBLY_TARGET).mdb # $(DB4O_INSTR_ASSEMBLY_TARGET) $(DB4O_INSTR_ASSEMBLY_TARGET).mdb \ # $(DB4O_NQ_ASSEMBLY_TARGET) $(DB4O_NQ_ASSEMBLY_TARGET).mdb endif pkgappdir = $(pkglibdir) pkgapp_DATA = \ $(EXTRA_SERVICESTACK_LIBS) \ $(EXTRA_JSON_LIBS) \ $(EXTRA_TWITTER_LIBS) \ $(EXTRA_XMPP_LIBS) \ $(EXTRA_DB4O_LIBS) \ $(EXTRA_IRC_LIBS) \ $(EXTRA_PROXY_LIBS) \ $(EXTRA_JABBR_LIBS) EXTRA_DIST = \ $(SERVICESTACK_TEXT_SRCDIR) $(SERVICESTACK_TEXT_EXTRA_FILES) \ $(SERVICESTACK_INTERFACES_SRCDIR) $(SERVICESTACK_INTERFACES_EXTRA_FILES) \ $(SERVICESTACK_COMMON_SRCDIR) $(SERVICESTACK_COMMON_EXTRA_FILES) \ $(JSON_SRCDIR) $(JSON_EXTRA_FILES) \ $(TWITTERIZER_SRCDIR) $(TWITTERIZER_EXTRA_FILES) \ $(JABBER_NET_SRCDIR) $(JABBER_NET_EXTRA_FILES) \ $(DB4O_SRCDIR) $(DB4O_EXTRA_FILES) \ $(STARKSOFTPROXY_SRCDIR) $(STARKSOFTPROXY_EXTRA_FILES) \ $(SMARTIRC4NET_SRCDIR) $(SMARTIRC4NET_EXTRA_FILES) \ $(SIGNALR_CLIENT_SOURCE_FILES) $(SIGNALR_CLIENT_EXTRA_FILES) \ $(JABBR_CLIENT_SOURCE_FILES) $(JABBR_CLIENT_EXTRA_FILES) # $(SERVICESTACK_TEXT_SOURCE_FILES) $(SERVICESTACK_TEXT_BUILD_FILE) \ # $(SERVICESTACK_INTERFACES_SOURCE_FILES) $(SERVICESTACK_INTERFACES_BUILD_FILE) \ # $(SERVICESTACK_COMMON_SOURCE_FILES) $(SERVICESTACK_COMMON_BUILD_FILE) \ # $(JSON_SOURCE_FILES) $(JSON_BUILD_FILE) $(JSON_SRCDIR)/Dynamic.snk \ # $(TWITTERIZER_SOURCE_FILES) $(TWITTERIZER_EXTRA_FILES) $(TWITTERIZER_BUILD_FILE) \ # $(JABBER_NET_SOURCE_FILES) $(JABBER_NET_EXTRA_FILES) $(JABBER_NET_BUILD_FILE) \ # $(DB4O_SOURCE_FILES) $(DB4O_BUILD_FILE) \ # $(DB4O_INSTR_SOURCE_FILES) $(DB4O_INSTR_BUILD_FILE) \ # $(DB4O_NQ_SOURCE_FILES) $(DB4O_NQ_BUILD_FILE) CLEANFILES = \ $(JSON_CLEAN_FILES) \ $(JABBER_NET_CLEAN_FILES) \ $(TWITTERIZER_CLEAN_FILES) \ $(SIGNALR_CLIENT_CLEAN_FILES) \ $(SMARTIRC4NET_CLEAN_FILES) \ $(STARKSOFTPROXY_CLEAN_FILES) \ $(JABBR_CLIENT_CLEAN_FILES) # end of magic $(SERVICESTACK_TEXT_ASSEMBLY_TARGET) $(SERVICESTACK_TEXT_ASSEMBLY_TARGET).mdb: $(SERVICESTACK_TEXT_BUILD_FILE) $(SERVICESTACK_TEXT_SOURCE_FILES) $(XBUILD) $(SERVICESTACK_TEXT_XBUILD_FLAGS) $(SERVICESTACK_TEXT_BUILD_FILE) $(SERVICESTACK_INTERFACES_ASSEMBLY_TARGET) $(SERVICESTACK_INTERFACES_ASSEMBLY_TARGET).mdb: $(SERVICESTACK_INTERFACES_BUILD_FILE) $(SERVICESTACK_INTERFACES_SOURCE_FILES) $(XBUILD) $(SERVICESTACK_INTERFACES_XBUILD_FLAGS) $(SERVICESTACK_INTERFACES_BUILD_FILE) $(SERVICESTACK_COMMON_ASSEMBLY_TARGET) $(SERVICESTACK_COMMON_ASSEMBLY_TARGET).mdb: $(SERVICESTACK_TEXT_ASSEMBLY_TARGET) $(SERVICESTACK_COMMON_BUILD_FILE) $(SERVICESTACK_COMMON_SOURCE_FILES) $(XBUILD) $(SERVICESTACK_COMMON_XBUILD_FLAGS) $(SERVICESTACK_COMMON_BUILD_FILE) $(JSON_ASSEMBLY_TARGET) $(JSON_ASSEMBLY_TARGET).mdb: $(JSON_BUILD_FILE) $(JSON_SOURCE_FILES) $(XBUILD) $(JSON_XBUILD_FLAGS) $(JSON_BUILD_FILE) $(TWITTERIZER_ASSEMBLY_TARGET) $(TWITTERIZER_ASSEMBLY_TARGET).mdb: $(TWITTERIZER_BUILD_FILE) $(TWITTERIZER_SOURCE_FILES) $(XBUILD) $(TWITTERIZER_XBUILD_FLAGS) $(TWITTERIZER_BUILD_FILE) $(JABBER_NET_ASSEMBLY_TARGET) $(JABBER_NET_ASSEMBLY_TARGET).mdb: $(JABBER_NET_BUILD_FILE) $(JABBER_NET_SOURCE_FILES) $(XBUILD) $(JABBER_NET_XBUILD_FLAGS) $(JABBER_NET_BUILD_FILE) $(SMARTIRC4NET_ASSEMBLY_TARGET) $(SMARTIRC4NET_ASSEMBLY_TARGET).mdb: $(SMARTIRC4NET_BUILD_FILE) $(SMARTIRC4NET_SOURCE_FILES) $(XBUILD) $(SMARTIRC4NET_XBUILD_FLAGS) $(SMARTIRC4NET_BUILD_FILE) $(STARKSOFTPROXY_ASSEMBLY_TARGET) $(STARKSOFTPROXY_ASSEMBLY_TARGET).mdb: $(STARKSOFTPROXY_BUILD_FILE) $(STARKSOFTPROXY_SOURCE_FILES) $(XBUILD) $(STARKSOFTPROXY_XBUILD_FLAGS) $(STARKSOFTPROXY_BUILD_FILE) $(DB4O_ASSEMBLY_TARGET) $(DB4O_ASSEMBLY_TARGET).mdb: $(DB4O_BUILD_FILE) $(DB4O_SOURCE_FILES) $(XBUILD) $(DB4O_XBUILD_FLAGS) $(DB4O_BUILD_FILE) #$(DB4O_INSTR_ASSEMBLY_TARGET) $(DB4O_INSTR_ASSEMBLY_TARGET).mdb: $(DB4O_INSTR_BUILD_FILE) $(DB4O_INSTR_SOURCE_FILES) # $(XBUILD) $(DB4O_INSTR_XBUILD_FLAGS) $(DB4O_INSTR_BUILD_FILE) #$(DB4O_NQ_ASSEMBLY_TARGET) $(DB4O_NQ_ASSEMBLY_TARGET).mdb: $(DB4O_NQ_BUILD_FILE) $(DB4O_NQ_SOURCE_FILES) # $(XBUILD) $(DB4O_NQ_XBUILD_FLAGS) $(DB4O_NQ_BUILD_FILE) $(SIGNALR_CLIENT_ASSEMBLY_TARGET) $(SIGNALR_CLIENT_ASSEMBLY_TARGET).mdb: $(SIGNALR_CLIENT_BUILD_FILE) $(SIGNALR_CLIENT_SOURCE_FILES) $(XBUILD) $(SIGNALR_CLIENT_XBUILD_FLAGS) $(SIGNALR_CLIENT_BUILD_FILE) $(JABBR_CLIENT_ASSEMBLY_TARGET) $(JABBR_CLIENT_ASSEMBLY_TARGET).mdb: $(JABBR_CLIENT_BUILD_FILE) $(JABBR_CLIENT_SOURCE_FILES) $(XBUILD) $(JABBR_CLIENT_XBUILD_FLAGS) $(JABBR_CLIENT_BUILD_FILE) clean-local: $(XBUILD) $(SERVICESTACK_TEXT_XBUILD_FLAGS) /t:Clean $(SERVICESTACK_TEXT_BUILD_FILE) $(XBUILD) $(SERVICESTACK_INTERFACES_XBUILD_FLAGS) /t:Clean $(SERVICESTACK_INTERFACES_BUILD_FILE) $(XBUILD) $(SERVICESTACK_COMMON_XBUILD_FLAGS) /t:Clean $(SERVICESTACK_COMMON_BUILD_FILE) if ENABLE_ENGINE_IRC $(XBUILD) $(SMARTIRC4NET_XBUILD_FLAGS) /t:Clean $(SMARTIRC4NET_BUILD_FILE) endif $(XBUILD) $(STARKSOFTPROXY_XBUILD_FLAGS) /t:Clean $(STARKSOFTPROXY_BUILD_FILE) if ENABLE_ENGINE_TWITTER $(XBUILD) $(JSON_XBUILD_FLAGS) /t:Clean $(JSON_BUILD_FILE) $(XBUILD) $(TWITTERIZER_XBUILD_FLAGS) /t:Clean $(TWITTERIZER_BUILD_FILE) endif if ENABLE_ENGINE_XMPP $(XBUILD) $(JABBER_NET_XBUILD_FLAGS) /t:Clean $(JABBER_NET_BUILD_FILE) endif if ENABLE_ENGINE_JABBR $(XBUILD) $(JSON_XBUILD_FLAGS) /t:Clean $(JSON_BUILD_FILE) $(XBUILD) $(SIGNALR_CLIENT_XBUILD_FLAGS) /t:Clean $(SIGNALR_CLIENT_BUILD_FILE) $(XBUILD) $(JABBR_CLIENT_XBUILD_FLAGS) /t:Clean $(JABBR_CLIENT_BUILD_FILE) endif if BUNDLE_DB4O $(XBUILD) $(DB4O_XBUILD_FLAGS) /t:Clean $(DB4O_BUILD_FILE) # $(XBUILD) $(DB4O_INSTR_XBUILD_FLAGS) /t:Clean $(DB4O_INSTR_BUILD_FILE) # $(XBUILD) $(DB4O_NQ_XBUILD_FLAGS) /t:Clean $(DB4O_NQ_BUILD_FILE) endif distdir: $(DISTFILES) $(DIST_SUBDIRS) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @for DISTFILE in $(DISTFILES); do \ if [ -d "$$DISTFILE" ]; then \ mkdir -p $(distdir)/$(srcdir)/$$DISTFILE; \ rsync -a \ --prune-empty-dirs \ --include='*/' \ --include='*.cs' \ --exclude='*' \ $$DISTFILE/ $(distdir)/$(srcdir)/$$DISTFILE; \ else \ DISTFILES="$$DISTFILES $$DISTFILE"; \ fi \ done; \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list="$$DISTFILES"; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -z "$$file"; then continue; fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done smuxi-0.11/lib/agsxmpp/0000755000175000017500000000000012311344240015615 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/0000755000175000017500000000000012311344240017274 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/XmppClientConnectionState.cs0000644000175000017500000000530112204443225024732 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP { /// /// Represents the current state of a XMPPConnection /// public enum XmppConnectionState { /// /// Session is Disconnected /// Disconnected, /// /// The Socket is Connecting /// Connecting, /// /// The Socket is Connected /// Connected, /// /// The XMPP Session is authenticating /// Authenticating, /// /// The XMPP session is autrhenticated /// Authenticated, /// /// Resource Binding gets started /// Binding, /// /// Resource Binded with sucess /// Binded, StartSession, /// /// Initialize Stream Compression /// StartCompression, /// /// Stream is compressed now /// Compressed, SessionStarted, /// /// We are switching from a normal connection to a secure SSL connection (StartTLS) /// Securing, /// /// started the progress to register a new account /// Registering, /// /// Account was registered successful /// Registered } } smuxi-0.11/lib/agsxmpp/agsxmpp/PacketGrabber.cs0000644000175000017500000000402012204443225022317 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections; namespace agsXMPP { /// /// Summary description for Grabber. /// public class PacketGrabber { internal Hashtable m_grabbing = new Hashtable(); internal XmppConnection m_connection = null; public PacketGrabber() { } public void Clear() { // need locking here to make sure that we dont acces the Hashtable // from another thread lock(this) { m_grabbing.Clear(); } } /// /// Pending request can be removed. /// This is useful when a ressource for the callback is destroyed and /// we are not interested anymore at the result. /// /// ID of the Iq we are not interested anymore public void Remove(string id) { if (m_grabbing.ContainsKey(id)) m_grabbing.Remove(id); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Factory/0000755000175000017500000000000012204443225020707 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Factory/SaslFactory.cs0000644000175000017500000000643112204443225023474 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections; using agsXMPP.Sasl; using agsXMPP.Sasl.Facebook; using agsXMPP.Sasl.Plain; using agsXMPP.Sasl.DigestMD5; using agsXMPP.Sasl.Anonymous; using agsXMPP.Sasl.XGoogleToken; #if !(CF || CF_2) using agsXMPP.Sasl.Scram; #endif #if !(CF || CF_2 || MONO) using agsXMPP.Sasl.Gssapi; #endif namespace agsXMPP.Factory { /// /// SASL factory /// public class SaslFactory { /// /// This Hashtable stores Mapping of mechanism <--> SASL class in agsXMPP /// private static readonly Hashtable m_table = new Hashtable(); static SaslFactory() { AddMechanism(protocol.sasl.Mechanism.GetMechanismName(protocol.sasl.MechanismType.PLAIN), typeof(PlainMechanism)); AddMechanism(protocol.sasl.Mechanism.GetMechanismName(protocol.sasl.MechanismType.DIGEST_MD5), typeof(DigestMD5Mechanism)); AddMechanism(protocol.sasl.Mechanism.GetMechanismName(protocol.sasl.MechanismType.ANONYMOUS), typeof(AnonymousMechanism)); AddMechanism(protocol.sasl.Mechanism.GetMechanismName(protocol.sasl.MechanismType.X_GOOGLE_TOKEN), typeof(XGoogleTokenMechanism)); AddMechanism(protocol.sasl.Mechanism.GetMechanismName(protocol.sasl.MechanismType.X_FACEBOOK_PLATFORM), typeof(FacebookMechanism)); #if !(CF || CF_2) AddMechanism(protocol.sasl.Mechanism.GetMechanismName(protocol.sasl.MechanismType.SCRAM_SHA_1), typeof(ScramSha1Mechanism)); #endif #if !(CF || CF_2 || MONO) AddMechanism(protocol.sasl.Mechanism.GetMechanismName(protocol.sasl.MechanismType.GSSAPI), typeof(GssapiMechanism)); #endif } public static Mechanism GetMechanism(string mechanism) { var t = (Type) m_table[mechanism]; if (t != null) return (Mechanism) Activator.CreateInstance(t); else return null; } /// /// Adds new Element Types to the Hashtable /// Use this function to register new SASL mechanisms /// /// /// public static void AddMechanism(string mechanism, System.Type t) { m_table.Add( mechanism, t); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Factory/ElementType.cs0000644000175000017500000000356712204443225023504 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.Factory { /// /// /// public class ElementType { private string m_TagName; private string m_Namespace; /// /// /// /// /// public ElementType(string TagName, string Namespace) { this.m_TagName = TagName; this.m_Namespace = Namespace; } public override string ToString() { if ((m_Namespace != null) && (m_Namespace != string.Empty)) { return (m_Namespace + ":" + m_TagName); } return m_TagName; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Factory/ElementFactory.cs0000644000175000017500000006121312204443225024162 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections; using agsXMPP.Xml.Dom; namespace agsXMPP.Factory { /// /// Factory class that implements the factory pattern for builing our Elements. /// public class ElementFactory { /// /// This Hashtable stores Mapping of protocol (tag/namespace) to the agsXMPP objects /// private static Hashtable m_table = new Hashtable(); static ElementFactory() { AddElementType("iq", Uri.CLIENT, typeof(agsXMPP.protocol.client.IQ)); AddElementType("message", Uri.CLIENT, typeof(agsXMPP.protocol.client.Message)); AddElementType("presence", Uri.CLIENT, typeof(agsXMPP.protocol.client.Presence)); AddElementType("error", Uri.CLIENT, typeof(agsXMPP.protocol.client.Error)); AddElementType("agent", Uri.IQ_AGENTS, typeof(agsXMPP.protocol.iq.agent.Agent)); AddElementType("item", Uri.IQ_ROSTER, typeof(agsXMPP.protocol.iq.roster.RosterItem)); AddElementType("group", Uri.IQ_ROSTER, typeof(agsXMPP.protocol.Base.Group)); AddElementType("group", Uri.X_ROSTERX, typeof(agsXMPP.protocol.Base.Group)); AddElementType("item", Uri.IQ_SEARCH, typeof(agsXMPP.protocol.iq.search.SearchItem)); // Stream stuff AddElementType("stream", Uri.STREAM, typeof(agsXMPP.protocol.Stream)); AddElementType("error", Uri.STREAM, typeof(agsXMPP.protocol.Error)); AddElementType("query", Uri.IQ_AUTH, typeof(agsXMPP.protocol.iq.auth.Auth)); AddElementType("query", Uri.IQ_AGENTS, typeof(agsXMPP.protocol.iq.agent.Agents)); AddElementType("query", Uri.IQ_ROSTER, typeof(agsXMPP.protocol.iq.roster.Roster)); AddElementType("query", Uri.IQ_LAST, typeof(agsXMPP.protocol.iq.last.Last)); AddElementType("query", Uri.IQ_VERSION, typeof(agsXMPP.protocol.iq.version.Version)); AddElementType("query", Uri.IQ_TIME, typeof(agsXMPP.protocol.iq.time.Time)); AddElementType("query", Uri.IQ_OOB, typeof(agsXMPP.protocol.iq.oob.Oob)); AddElementType("query", Uri.IQ_SEARCH, typeof(agsXMPP.protocol.iq.search.Search)); AddElementType("query", Uri.IQ_BROWSE, typeof(agsXMPP.protocol.iq.browse.Browse)); AddElementType("query", Uri.IQ_AVATAR, typeof(agsXMPP.protocol.iq.avatar.Avatar)); AddElementType("query", Uri.IQ_REGISTER, typeof(agsXMPP.protocol.iq.register.Register)); AddElementType("query", Uri.IQ_PRIVATE, typeof(agsXMPP.protocol.iq.@private.Private)); // Privacy Lists AddElementType("query", Uri.IQ_PRIVACY, typeof(agsXMPP.protocol.iq.privacy.Privacy)); AddElementType("item", Uri.IQ_PRIVACY, typeof(agsXMPP.protocol.iq.privacy.Item)); AddElementType("list", Uri.IQ_PRIVACY, typeof(agsXMPP.protocol.iq.privacy.List)); AddElementType("active", Uri.IQ_PRIVACY, typeof(agsXMPP.protocol.iq.privacy.Active)); AddElementType("default", Uri.IQ_PRIVACY, typeof(agsXMPP.protocol.iq.privacy.Default)); // Browse AddElementType("service", Uri.IQ_BROWSE, typeof(agsXMPP.protocol.iq.browse.Service)); AddElementType("item", Uri.IQ_BROWSE, typeof(agsXMPP.protocol.iq.browse.BrowseItem)); // Service Discovery AddElementType("query", Uri.DISCO_ITEMS, typeof(agsXMPP.protocol.iq.disco.DiscoItems)); AddElementType("query", Uri.DISCO_INFO, typeof(agsXMPP.protocol.iq.disco.DiscoInfo)); AddElementType("feature", Uri.DISCO_INFO, typeof(agsXMPP.protocol.iq.disco.DiscoFeature)); AddElementType("identity", Uri.DISCO_INFO, typeof(agsXMPP.protocol.iq.disco.DiscoIdentity)); AddElementType("item", Uri.DISCO_ITEMS, typeof(agsXMPP.protocol.iq.disco.DiscoItem)); AddElementType("x", Uri.X_DELAY, typeof(agsXMPP.protocol.x.Delay)); AddElementType("x", Uri.X_AVATAR, typeof(agsXMPP.protocol.x.Avatar)); AddElementType("x", Uri.X_CONFERENCE, typeof(agsXMPP.protocol.x.Conference)); AddElementType("x", Uri.X_EVENT, typeof(agsXMPP.protocol.x.Event)); //AddElementType("x", Uri.STORAGE_AVATAR, typeof(agsXMPP.protocol.storage.Avatar)); AddElementType("query", Uri.STORAGE_AVATAR, typeof(agsXMPP.protocol.storage.Avatar)); // XData Stuff AddElementType("x", Uri.X_DATA, typeof(agsXMPP.protocol.x.data.Data)); AddElementType("field", Uri.X_DATA, typeof(agsXMPP.protocol.x.data.Field)); AddElementType("option", Uri.X_DATA, typeof(agsXMPP.protocol.x.data.Option)); AddElementType("value", Uri.X_DATA, typeof(agsXMPP.protocol.x.data.Value)); AddElementType("reported", Uri.X_DATA, typeof(agsXMPP.protocol.x.data.Reported)); AddElementType("item", Uri.X_DATA, typeof(agsXMPP.protocol.x.data.Item)); AddElementType("features", Uri.STREAM, typeof(agsXMPP.protocol.stream.Features)); AddElementType("register", Uri.FEATURE_IQ_REGISTER, typeof(agsXMPP.protocol.stream.feature.Register)); AddElementType("compression", Uri.FEATURE_COMPRESS, typeof(agsXMPP.protocol.stream.feature.compression.Compression)); AddElementType("method", Uri.FEATURE_COMPRESS, typeof(agsXMPP.protocol.stream.feature.compression.Method)); AddElementType("bind", Uri.BIND, typeof(agsXMPP.protocol.iq.bind.Bind)); AddElementType("session", Uri.SESSION, typeof(agsXMPP.protocol.iq.session.Session)); // TLS stuff AddElementType("failure", Uri.TLS, typeof(agsXMPP.protocol.tls.Failure)); AddElementType("proceed", Uri.TLS, typeof(agsXMPP.protocol.tls.Proceed)); AddElementType("starttls", Uri.TLS, typeof(agsXMPP.protocol.tls.StartTls)); // SASL stuff AddElementType("mechanisms", Uri.SASL, typeof(agsXMPP.protocol.sasl.Mechanisms)); AddElementType("mechanism", Uri.SASL, typeof(agsXMPP.protocol.sasl.Mechanism)); AddElementType("auth", Uri.SASL, typeof(agsXMPP.protocol.sasl.Auth)); AddElementType("response", Uri.SASL, typeof(agsXMPP.protocol.sasl.Response)); AddElementType("challenge", Uri.SASL, typeof(agsXMPP.protocol.sasl.Challenge)); // TODO, this is a dirty hacks for the buggy BOSH Proxy // BEGIN AddElementType("challenge", Uri.CLIENT, typeof(agsXMPP.protocol.sasl.Challenge)); AddElementType("success", Uri.CLIENT, typeof(agsXMPP.protocol.sasl.Success)); // END AddElementType("failure", Uri.SASL, typeof(agsXMPP.protocol.sasl.Failure)); AddElementType("abort", Uri.SASL, typeof(agsXMPP.protocol.sasl.Abort)); AddElementType("success", Uri.SASL, typeof(agsXMPP.protocol.sasl.Success)); // Vcard stuff AddElementType("vCard", Uri.VCARD, typeof(agsXMPP.protocol.iq.vcard.Vcard)); AddElementType("TEL", Uri.VCARD, typeof(agsXMPP.protocol.iq.vcard.Telephone)); AddElementType("ORG", Uri.VCARD, typeof(agsXMPP.protocol.iq.vcard.Organization)); AddElementType("N", Uri.VCARD, typeof(agsXMPP.protocol.iq.vcard.Name)); AddElementType("EMAIL", Uri.VCARD, typeof(agsXMPP.protocol.iq.vcard.Email)); AddElementType("ADR", Uri.VCARD, typeof(agsXMPP.protocol.iq.vcard.Address)); #if !CF AddElementType("PHOTO", Uri.VCARD, typeof(agsXMPP.protocol.iq.vcard.Photo)); #endif // Server stuff //AddElementType("stream", Uri.SERVER, typeof(agsXMPP.protocol.server.Stream)); //AddElementType("message", Uri.SERVER, typeof(agsXMPP.protocol.server.Message)); // Component stuff AddElementType("handshake", Uri.ACCEPT, typeof(agsXMPP.protocol.component.Handshake)); AddElementType("log", Uri.ACCEPT, typeof(agsXMPP.protocol.component.Log)); AddElementType("route", Uri.ACCEPT, typeof(agsXMPP.protocol.component.Route)); AddElementType("iq", Uri.ACCEPT, typeof(agsXMPP.protocol.component.IQ)); AddElementType("message", Uri.ACCEPT, typeof(agsXMPP.protocol.component.Message)); AddElementType("presence", Uri.ACCEPT, typeof(agsXMPP.protocol.component.Presence)); AddElementType("error", Uri.ACCEPT, typeof(agsXMPP.protocol.component.Error)); //Extensions (JEPS) AddElementType("header", Uri.SHIM, typeof(agsXMPP.protocol.extensions.shim.Header)); AddElementType("headers", Uri.SHIM, typeof(agsXMPP.protocol.extensions.shim.Headers)); AddElementType("roster", Uri.ROSTER_DELIMITER, typeof(agsXMPP.protocol.iq.roster.Delimiter)); AddElementType("p", Uri.PRIMARY, typeof(agsXMPP.protocol.extensions.primary.Primary)); AddElementType("nick", Uri.NICK, typeof(agsXMPP.protocol.extensions.nickname.Nickname)); AddElementType("item", Uri.X_ROSTERX, typeof(agsXMPP.protocol.x.rosterx.RosterItem)); AddElementType("x", Uri.X_ROSTERX, typeof(agsXMPP.protocol.x.rosterx.RosterX)); // Filetransfer stuff AddElementType("file", Uri.SI_FILE_TRANSFER, typeof(agsXMPP.protocol.extensions.filetransfer.File)); AddElementType("range", Uri.SI_FILE_TRANSFER, typeof(agsXMPP.protocol.extensions.filetransfer.Range)); // FeatureNeg AddElementType("feature", Uri.FEATURE_NEG, typeof(agsXMPP.protocol.extensions.featureneg.FeatureNeg)); // Bytestreams AddElementType("query", Uri.BYTESTREAMS, typeof(agsXMPP.protocol.extensions.bytestreams.ByteStream)); AddElementType("streamhost", Uri.BYTESTREAMS, typeof(agsXMPP.protocol.extensions.bytestreams.StreamHost)); AddElementType("streamhost-used", Uri.BYTESTREAMS, typeof(agsXMPP.protocol.extensions.bytestreams.StreamHostUsed)); AddElementType("activate", Uri.BYTESTREAMS, typeof(agsXMPP.protocol.extensions.bytestreams.Activate)); AddElementType("udpsuccess", Uri.BYTESTREAMS, typeof(agsXMPP.protocol.extensions.bytestreams.UdpSuccess)); AddElementType("si", Uri.SI, typeof(agsXMPP.protocol.extensions.si.SI)); AddElementType("html", Uri.XHTML_IM, typeof(agsXMPP.protocol.extensions.html.Html)); AddElementType("body", Uri.XHTML, typeof(agsXMPP.protocol.extensions.html.Body)); AddElementType("compressed", Uri.COMPRESS, typeof(agsXMPP.protocol.extensions.compression.Compressed)); AddElementType("compress", Uri.COMPRESS, typeof(agsXMPP.protocol.extensions.compression.Compress)); AddElementType("failure", Uri.COMPRESS, typeof(agsXMPP.protocol.extensions.compression.Failure)); // MUC (JEP-0045 Multi User Chat) AddElementType("x", Uri.MUC, typeof(agsXMPP.protocol.x.muc.Muc)); AddElementType("x", Uri.MUC_USER, typeof(agsXMPP.protocol.x.muc.User)); AddElementType("item", Uri.MUC_USER, typeof(agsXMPP.protocol.x.muc.Item)); AddElementType("status", Uri.MUC_USER, typeof(agsXMPP.protocol.x.muc.Status)); AddElementType("invite", Uri.MUC_USER, typeof(agsXMPP.protocol.x.muc.Invite)); AddElementType("decline", Uri.MUC_USER, typeof(agsXMPP.protocol.x.muc.Decline)); AddElementType("actor", Uri.MUC_USER, typeof(agsXMPP.protocol.x.muc.Actor)); AddElementType("history", Uri.MUC, typeof(agsXMPP.protocol.x.muc.History)); AddElementType("query", Uri.MUC_ADMIN, typeof(agsXMPP.protocol.x.muc.iq.admin.Admin)); AddElementType("item", Uri.MUC_ADMIN, typeof(agsXMPP.protocol.x.muc.iq.admin.Item)); AddElementType("query", Uri.MUC_OWNER, typeof(agsXMPP.protocol.x.muc.iq.owner.Owner)); AddElementType("destroy", Uri.MUC_OWNER, typeof(agsXMPP.protocol.x.muc.owner.Destroy)); AddElementType("destroy", Uri.MUC_USER, typeof(agsXMPP.protocol.x.muc.user.Destroy)); //Jabber RPC JEP 0009 AddElementType("query", Uri.IQ_RPC, typeof(agsXMPP.protocol.iq.rpc.Rpc)); AddElementType("methodCall", Uri.IQ_RPC, typeof(agsXMPP.protocol.iq.rpc.MethodCall)); AddElementType("methodResponse", Uri.IQ_RPC, typeof(agsXMPP.protocol.iq.rpc.MethodResponse)); // Chatstates Jep-0085 AddElementType("active", Uri.CHATSTATES, typeof(agsXMPP.protocol.extensions.chatstates.Active)); AddElementType("inactive", Uri.CHATSTATES, typeof(agsXMPP.protocol.extensions.chatstates.Inactive)); AddElementType("composing", Uri.CHATSTATES, typeof(agsXMPP.protocol.extensions.chatstates.Composing)); AddElementType("paused", Uri.CHATSTATES, typeof(agsXMPP.protocol.extensions.chatstates.Paused)); AddElementType("gone", Uri.CHATSTATES, typeof(agsXMPP.protocol.extensions.chatstates.Gone)); // Jivesoftware Extenstions AddElementType("phone-event", Uri.JIVESOFTWARE_PHONE, typeof(agsXMPP.protocol.extensions.jivesoftware.phone.PhoneEvent)); AddElementType("phone-action", Uri.JIVESOFTWARE_PHONE, typeof(agsXMPP.protocol.extensions.jivesoftware.phone.PhoneAction)); AddElementType("phone-status", Uri.JIVESOFTWARE_PHONE, typeof(agsXMPP.protocol.extensions.jivesoftware.phone.PhoneStatus)); // Jingle stuff is in heavy development, we commit this once the most changes on the Jeps are done //AddElementType("jingle", Uri.JINGLE, typeof(agsXMPP.protocol.extensions.jingle.Jingle)); //AddElementType("candidate", Uri.JINGLE, typeof(agsXMPP.protocol.extensions.jingle.Candidate)); AddElementType("c", Uri.CAPS, typeof(agsXMPP.protocol.extensions.caps.Capabilities)); AddElementType("geoloc", Uri.GEOLOC, typeof(agsXMPP.protocol.extensions.geoloc.GeoLoc)); // Xmpp Ping AddElementType("ping", Uri.PING, typeof(agsXMPP.protocol.extensions.ping.Ping)); //Ad-Hock Commands AddElementType("command", Uri.COMMANDS, typeof(agsXMPP.protocol.extensions.commands.Command)); AddElementType("actions", Uri.COMMANDS, typeof(agsXMPP.protocol.extensions.commands.Actions)); AddElementType("note", Uri.COMMANDS, typeof(agsXMPP.protocol.extensions.commands.Note)); // ********** // * PubSub * // ********** // Owner namespace AddElementType("affiliate", Uri.PUBSUB_OWNER, typeof(agsXMPP.protocol.extensions.pubsub.owner.Affiliate)); AddElementType("affiliates", Uri.PUBSUB_OWNER, typeof(agsXMPP.protocol.extensions.pubsub.owner.Affiliates)); AddElementType("configure", Uri.PUBSUB_OWNER, typeof(agsXMPP.protocol.extensions.pubsub.owner.Configure)); AddElementType("delete", Uri.PUBSUB_OWNER, typeof(agsXMPP.protocol.extensions.pubsub.owner.Delete)); AddElementType("pending", Uri.PUBSUB_OWNER, typeof(agsXMPP.protocol.extensions.pubsub.owner.Pending)); AddElementType("pubsub", Uri.PUBSUB_OWNER, typeof(agsXMPP.protocol.extensions.pubsub.owner.PubSub)); AddElementType("purge", Uri.PUBSUB_OWNER, typeof(agsXMPP.protocol.extensions.pubsub.owner.Purge)); AddElementType("subscriber", Uri.PUBSUB_OWNER, typeof(agsXMPP.protocol.extensions.pubsub.owner.Subscriber)); AddElementType("subscribers", Uri.PUBSUB_OWNER, typeof(agsXMPP.protocol.extensions.pubsub.owner.Subscribers)); // Event namespace AddElementType("delete", Uri.PUBSUB_EVENT, typeof(agsXMPP.protocol.extensions.pubsub.@event.Delete)); AddElementType("event", Uri.PUBSUB_EVENT, typeof(agsXMPP.protocol.extensions.pubsub.@event.Event)); AddElementType("item", Uri.PUBSUB_EVENT, typeof(agsXMPP.protocol.extensions.pubsub.@event.Item)); AddElementType("items", Uri.PUBSUB_EVENT, typeof(agsXMPP.protocol.extensions.pubsub.@event.Items)); AddElementType("purge", Uri.PUBSUB_EVENT, typeof(agsXMPP.protocol.extensions.pubsub.@event.Purge)); // Main Pubsub namespace AddElementType("affiliation", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Affiliation)); AddElementType("affiliations", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Affiliations)); AddElementType("configure", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Configure)); AddElementType("create", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Create)); AddElementType("configure", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Configure)); AddElementType("item", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Item)); AddElementType("items", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Items)); AddElementType("options", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Options)); AddElementType("publish", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Publish)); AddElementType("pubsub", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.PubSub)); AddElementType("retract", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Retract)); AddElementType("subscribe", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Subscribe)); AddElementType("subscribe-options", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.SubscribeOptions)); AddElementType("subscription", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Subscription)); AddElementType("subscriptions", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Subscriptions)); AddElementType("unsubscribe", Uri.PUBSUB, typeof(agsXMPP.protocol.extensions.pubsub.Unsubscribe)); // HTTP Binding XEP-0124 AddElementType("body", Uri.HTTP_BIND, typeof(agsXMPP.protocol.extensions.bosh.Body)); // Message receipts XEP-0184 AddElementType("received", Uri.MSG_RECEIPT, typeof(agsXMPP.protocol.extensions.msgreceipts.Received)); AddElementType("request", Uri.MSG_RECEIPT, typeof(agsXMPP.protocol.extensions.msgreceipts.Request)); // Bookmark storage XEP-0048 AddElementType("storage", Uri.STORAGE_BOOKMARKS, typeof(agsXMPP.protocol.extensions.bookmarks.Storage)); AddElementType("url", Uri.STORAGE_BOOKMARKS, typeof(agsXMPP.protocol.extensions.bookmarks.Url)); AddElementType("conference", Uri.STORAGE_BOOKMARKS, typeof(agsXMPP.protocol.extensions.bookmarks.Conference)); // XEP-0047: In-Band Bytestreams (IBB) AddElementType("open", Uri.IBB, typeof(agsXMPP.protocol.extensions.ibb.Open)); AddElementType("data", Uri.IBB, typeof(agsXMPP.protocol.extensions.ibb.Data)); AddElementType("close", Uri.IBB, typeof(agsXMPP.protocol.extensions.ibb.Close)); // XEP-0153: vCard-Based Avatars AddElementType("x", Uri.VCARD_UPDATE, typeof(agsXMPP.protocol.x.vcard_update.VcardUpdate)); // AMP AddElementType("amp", Uri.AMP, typeof(agsXMPP.protocol.extensions.amp.Amp)); AddElementType("rule", Uri.AMP, typeof(agsXMPP.protocol.extensions.amp.Rule)); // Urn Time AddElementType("time", Uri.URN_TIME, typeof(agsXMPP.protocol.time.Time)); // XEP-0145 Annotations AddElementType("storage", Uri.STORAGE_ROSTERNOTES, typeof(agsXMPP.protocol.extensions.bookmarks.RosterNotes)); AddElementType("note", Uri.STORAGE_ROSTERNOTES, typeof(agsXMPP.protocol.extensions.bookmarks.RosterNote)); } /// /// Adds new Element Types to the Hashtable /// Use this function also to register your own created Elements. /// If a element is already registered it gets overwritten. This behaviour is also useful if you you want to overwrite /// classes and add your own derived classes to the factory. /// /// FQN /// /// public static void AddElementType(string tag, string ns, System.Type t) { ElementType et = new ElementType(tag, ns); string key = et.ToString(); // added thread safety on a user request lock (m_table) { if (m_table.ContainsKey(key)) m_table[key] = t; else m_table.Add(et.ToString(), t); } } /// /// /// /// /// /// /// public static Element GetElement(string prefix, string tag, string ns) { if (ns == null) ns = ""; ElementType et = new ElementType(tag, ns); System.Type t = (System.Type) m_table[et.ToString()]; Element ret; if (t != null) ret = (Element) System.Activator.CreateInstance(t); else ret = new Element(tag); ret.Prefix = prefix; if (ns!="") ret.Namespace = ns; return ret; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/IqGrabber.cs0000644000175000017500000001203012250206660021462 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections; using System.Threading; using agsXMPP.protocol.client; //using agsXMPP.protocol.component; using agsXMPP.Xml; namespace agsXMPP { public class IqGrabber : PacketGrabber { /// /// /// /// public IqGrabber(XmppClientConnection conn) { m_connection = conn; conn.OnIq += OnIq; } public IqGrabber(XmppComponentConnection conn) { m_connection = conn; conn.OnIq += OnIq; } #if !CF private IQ synchronousResponse = null; private int m_SynchronousTimeout = 5000; /// /// Timeout for synchronous requests, default value is 5000 (5 seconds) /// public int SynchronousTimeout { get { return m_SynchronousTimeout; } set { m_SynchronousTimeout = value; } } #endif /// /// An IQ Element is received. Now check if its one we are looking for and /// raise the event in this case. /// /// /// public void OnIq(object sender, IQEventArgs e) { // the tracker handles on iq responses, which are either result or error if (e.IQ.Type != IqType.error && e.IQ.Type != IqType.result) return; string id = e.IQ.Id; if(id == null) return; IqHandler td; lock (m_grabbing) { td = (IqHandler) m_grabbing[id]; if (td == null) { return; } m_grabbing.Remove(id); } td(this, e); } /// /// Send an IQ Request and store the object with callback in the Hashtable /// /// The iq to send /// the callback function which gets raised for the response public void SendIq(IQ iq, IqHandler cb) { // check if the callback is null, in case of wrong usage of this class if (cb == null) { throw new ArgumentNullException("cb"); } if (iq == null) { throw new ArgumentNullException("cb"); } m_grabbing[iq.Id] = cb; m_connection.Send(iq); } #if !CF /// /// Sends an Iq synchronous and return the response or null on timeout /// /// The IQ to send /// /// The response IQ or null on timeout public IQ SendIq(agsXMPP.protocol.client.IQ iq, int timeout) { synchronousResponse = null; AutoResetEvent are = new AutoResetEvent(false); SendIq(iq, delegate (object sender, IQEventArgs e) { e.Handled = true; are.Set(); } ); if (!are.WaitOne(timeout, true)) { // Timed out lock (m_grabbing) { if (m_grabbing.ContainsKey(iq.Id)) m_grabbing.Remove(iq.Id); } return null; } return synchronousResponse; } /// /// Sends an Iq synchronous and return the response or null on timeout. /// Timeout time used is /// /// The IQ to send /// The response IQ or null on timeout public IQ SendIq(IQ iq) { return SendIq(iq, m_SynchronousTimeout); } #endif } }smuxi-0.11/lib/agsxmpp/agsxmpp/Collections/0000755000175000017500000000000012204443225021556 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Collections/BareJidComparer.cs0000644000175000017500000000345512204443225025105 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections; namespace agsXMPP.Collections { /// /// /// public class BareJidComparer : IComparer { /// /// /// /// /// /// public int Compare(object x, object y) { if (x is Jid && y is Jid) { Jid jidX = (Jid)x; Jid jidY = (Jid)y; if (jidX.Bare == jidY.Bare) return 0; else return String.Compare(jidX.Bare, jidY.Bare); } throw new ArgumentException("the objects to compare must be Jids"); } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Collections/FullJidComparer.cs0000644000175000017500000000350712204443225025134 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections; namespace agsXMPP.Collections { /// /// /// public class FullJidComparer : IComparer { /// /// /// /// /// /// public int Compare(object x, object y) { if (x is Jid && y is Jid) { Jid jidX = (Jid)x; Jid jidY = (Jid)y; if (jidX.ToString() == jidY.ToString()) return 0; else return String.Compare(jidX.ToString(), jidY.ToString()); } throw new ArgumentException("the objects to compare must be Jids"); } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Exceptions/0000755000175000017500000000000012245370027021425 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Exceptions/StartTlsException.cs0000644000175000017500000000250212245370027025412 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.Exceptions { public class StartTlsException : Exception { public StartTlsException() { } public StartTlsException(string msg) : base(msg) { } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Exceptions/RegisterException.cs0000644000175000017500000000250212204443225025412 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.Exceptions { public class RegisterException : Exception { public RegisterException() { } public RegisterException(string msg) : base(msg) { } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Exceptions/XmlRpcException.cs0000644000175000017500000000313312204443225025034 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.Exceptions { public class XmlRpcException : Exception { public XmlRpcException() : base() { } public XmlRpcException(string msg) : base(msg) { } public XmlRpcException(int code, string msg) : base(msg) { this.m_Code = code; } private int m_Code; public int Code { get { return m_Code; } set { m_Code = value; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Exceptions/JidException.cs0000644000175000017500000000272512204443225024343 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.Exceptions { public class JidException : Exception { /// /// /// public JidException() { } /// /// /// /// public JidException(string msg) : base(msg) { } } }smuxi-0.11/lib/agsxmpp/agsxmpp/starksoftproxy/0000755000175000017500000000000012204443226022423 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/starksoftproxy/HttpProxyClient.cs0000644000175000017500000004343412204443226026102 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Text; using System.Net.Sockets; using System.Threading; using System.Globalization; using System.ComponentModel; namespace Starksoft.Net.Proxy { /// /// HTTP connection proxy class. This class implements the HTTP standard proxy protocol. /// /// You can use this class to set up a connection to an HTTP proxy server. Calling the /// CreateConnection() method initiates the proxy connection and returns a standard /// System.Net.Socks.TcpClient object that can be used as normal. The proxy plumbing /// is all handled for you. /// /// /// /// /// public class HttpProxyClient : IProxyClient { private string _proxyHost; private int _proxyPort; private HttpResponseCodes _respCode; private string _respText; private TcpClient _tcpClient; private const int HTTP_PROXY_DEFAULT_PORT = 8080; private const string HTTP_PROXY_CONNECT_CMD = "CONNECT {0}:{1} HTTP/1.0\r\nHOST {0}:{1}\r\n\r\n"; private const int WAIT_FOR_DATA_INTERVAL = 50; // 50 ms private const int WAIT_FOR_DATA_TIMEOUT = 15000; // 15 seconds private const string PROXY_NAME = "HTTP"; private enum HttpResponseCodes { None = 0, Continue = 100, SwitchingProtocols = 101, OK = 200, Created = 201, Accepted = 202, NonAuthoritiveInformation = 203, NoContent = 204, ResetContent = 205, PartialContent = 206, MultipleChoices = 300, MovedPermanetly = 301, Found = 302, SeeOther = 303, NotModified = 304, UserProxy = 305, TemporaryRedirect = 307, BadRequest = 400, Unauthorized = 401, PaymentRequired = 402, Forbidden = 403, NotFound = 404, MethodNotAllowed = 405, NotAcceptable = 406, ProxyAuthenticantionRequired = 407, RequestTimeout = 408, Conflict = 409, Gone = 410, PreconditionFailed = 411, RequestEntityTooLarge = 413, RequestURITooLong = 414, UnsupportedMediaType = 415, RequestedRangeNotSatisfied = 416, ExpectationFailed = 417, InternalServerError = 500, NotImplemented = 501, BadGateway = 502, ServiceUnavailable = 503, GatewayTimeout = 504, HTTPVersionNotSupported = 505 } /// /// Constructor. /// public HttpProxyClient() { } /// /// Creates a HTTP proxy client object using the supplied TcpClient object connection. /// /// A TcpClient connection object. public HttpProxyClient(TcpClient tcpClient) { if (tcpClient == null) throw new ArgumentNullException("tcpClient"); _tcpClient = tcpClient; } /// /// Constructor. The default HTTP proxy port 8080 is used. /// /// Host name or IP address of the proxy. public HttpProxyClient(string proxyHost) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); _proxyHost = proxyHost; _proxyPort = HTTP_PROXY_DEFAULT_PORT; } /// /// Constructor. /// /// Host name or IP address of the proxy server. /// Port number for the proxy server. public HttpProxyClient(string proxyHost, int proxyPort) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); _proxyHost = proxyHost; _proxyPort = proxyPort; } /// /// Gets or sets host name or IP address of the proxy server. /// public string ProxyHost { get { return _proxyHost; } set { _proxyHost = value; } } /// /// Gets or sets port number for the proxy server. /// public int ProxyPort { get { return _proxyPort; } set { _proxyPort = value; } } /// /// Gets String representing the name of the proxy. /// /// This property will always return the value 'HTTP' public string ProxyName { get { return PROXY_NAME; } } /// /// Gets or sets the TcpClient object. /// This property can be set prior to executing CreateConnection to use an existing TcpClient connection. /// public TcpClient TcpClient { get { return _tcpClient; } set { _tcpClient = value; } } /// /// Creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public TcpClient CreateConnection(string destinationHost, int destinationPort) { try { // if we have no connection, create one if (_tcpClient == null) { if (String.IsNullOrEmpty(_proxyHost)) throw new ProxyException("ProxyHost property must contain a value."); if (_proxyPort <= 0 || _proxyPort > 65535) throw new ProxyException("ProxyPort value must be greater than zero and less than 65535"); // create new tcp client object to the proxy server _tcpClient = new TcpClient(); // attempt to open the connection _tcpClient.Connect(_proxyHost, _proxyPort); } // send connection command to proxy host for the specified destination host and port SendConnectionCommand(destinationHost, destinationPort); // return the open proxied tcp client object to the caller for normal use return _tcpClient; } catch (SocketException ex) { throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "Connection to proxy host {0} on port {1} failed.", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient)), ex); } } private void SendConnectionCommand(string host, int port) { NetworkStream stream = _tcpClient.GetStream(); // PROXY SERVER REQUEST // ======================================================================= //CONNECT starksoft.com:443 HTTP/1.0 //HOST starksoft.com:443 //[... other HTTP header lines ending with if required]> // // Last Empty Line string connectCmd = String.Format(CultureInfo.InvariantCulture, HTTP_PROXY_CONNECT_CMD, host, port.ToString(CultureInfo.InvariantCulture)); byte[] request = ASCIIEncoding.ASCII.GetBytes(connectCmd); // send the connect request stream.Write(request, 0, request.Length); // wait for the proxy server to respond WaitForData(stream); // PROXY SERVER RESPONSE // ======================================================================= //HTTP/1.0 200 Connection Established //[.... other HTTP header lines ending with .. //ignore all of them] // // Last Empty Line // create an byte response array byte[] response = new byte[_tcpClient.ReceiveBufferSize]; StringBuilder sbuilder = new StringBuilder(); int bytes = 0; long total = 0; do { bytes = stream.Read(response, 0, _tcpClient.ReceiveBufferSize); total += bytes; sbuilder.Append(System.Text.ASCIIEncoding.UTF8.GetString(response, 0, bytes)); } while (stream.DataAvailable); ParseResponse(sbuilder.ToString()); // evaluate the reply code for an error condition if (_respCode != HttpResponseCodes.OK) HandleProxyCommandError(host, port); } private void HandleProxyCommandError(string host, int port) { string msg; switch (_respCode) { case HttpResponseCodes.None: msg = String.Format(CultureInfo.InvariantCulture, "Proxy destination {0} on port {1} failed to return a recognized HTTP response code. Server response: {2}", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient), _respText); break; case HttpResponseCodes.BadGateway: //HTTP/1.1 502 Proxy Error (The specified Secure Sockets Layer (SSL) port is not allowed. ISA Server is not configured to allow SSL requests from this port. Most Web browsers use port 443 for SSL requests.) msg = String.Format(CultureInfo.InvariantCulture, "Proxy destination {0} on port {1} responded with a 502 code - Bad Gateway. If you are connecting to a Microsoft ISA destination please refer to knowledge based article Q283284 for more information. Server response: {2}", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient), _respText); break; default: msg = String.Format(CultureInfo.InvariantCulture, "Proxy destination {0} on port {1} responded with a {2} code - {3}", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient), ((int)_respCode).ToString(CultureInfo.InvariantCulture), _respText); break; } // throw a new application exception throw new ProxyException(msg); } private void WaitForData(NetworkStream stream) { int sleepTime = 0; while (!stream.DataAvailable) { Thread.Sleep(WAIT_FOR_DATA_INTERVAL); sleepTime += WAIT_FOR_DATA_INTERVAL; if (sleepTime > WAIT_FOR_DATA_TIMEOUT) throw new ProxyException(String.Format("A timeout while waiting for the proxy server at {0} on port {1} to respond.", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient) )); } } private void ParseResponse(string response) { string[] data = null; // get rid of the LF character if it exists and then split the string on all CR data = response.Replace('\n', ' ').Split('\r'); ParseCodeAndText(data[0]); } private void ParseCodeAndText(string line) { int begin = 0; int end = 0; string val = null; if (line.IndexOf("HTTP") == -1) throw new ProxyException(String.Format("No HTTP response received from proxy destination. Server response: {0}.", line)); begin = line.IndexOf(" ") + 1; end = line.IndexOf(" ", begin); val = line.Substring(begin, end - begin); Int32 code = 0; if (!Int32.TryParse(val, out code)) throw new ProxyException(String.Format("An invalid response code was received from proxy destination. Server response: {0}.", line)); _respCode = (HttpResponseCodes)code; _respText = line.Substring(end + 1).Trim(); } #region "Async Methods" private BackgroundWorker _asyncWorker; private Exception _asyncException; bool _asyncCancelled; /// /// Gets a value indicating whether an asynchronous operation is running. /// /// Returns true if an asynchronous operation is running; otherwise, false. /// public bool IsBusy { get { return _asyncWorker == null ? false : _asyncWorker.IsBusy; } } /// /// Gets a value indicating whether an asynchronous operation is cancelled. /// /// Returns true if an asynchronous operation is cancelled; otherwise, false. /// public bool IsAsyncCancelled { get { return _asyncCancelled; } } /// /// Cancels any asychronous operation that is currently active. /// public void CancelAsync() { if (_asyncWorker != null && !_asyncWorker.CancellationPending && _asyncWorker.IsBusy) { _asyncCancelled = true; _asyncWorker.CancelAsync(); } } private void CreateAsyncWorker() { if (_asyncWorker != null) _asyncWorker.Dispose(); _asyncException = null; _asyncWorker = null; _asyncCancelled = false; _asyncWorker = new BackgroundWorker(); } /// /// Event handler for CreateConnectionAsync method completed. /// public event EventHandler CreateConnectionAsyncCompleted; /// /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public void CreateConnectionAsync(string destinationHost, int destinationPort) { if (_asyncWorker != null && _asyncWorker.IsBusy) throw new InvalidOperationException("The HttpProxy object is already busy executing another asynchronous operation. You can only execute one asychronous method at a time."); CreateAsyncWorker(); _asyncWorker.WorkerSupportsCancellation = true; _asyncWorker.DoWork += new DoWorkEventHandler(CreateConnectionAsync_DoWork); _asyncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CreateConnectionAsync_RunWorkerCompleted); Object[] args = new Object[2]; args[0] = destinationHost; args[1] = destinationPort; _asyncWorker.RunWorkerAsync(args); } private void CreateConnectionAsync_DoWork(object sender, DoWorkEventArgs e) { try { Object[] args = (Object[])e.Argument; e.Result = CreateConnection((string)args[0], (int)args[1]); } catch (Exception ex) { _asyncException = ex; } } private void CreateConnectionAsync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (CreateConnectionAsyncCompleted != null) CreateConnectionAsyncCompleted(this, new CreateConnectionAsyncCompletedEventArgs(_asyncException, _asyncCancelled, (TcpClient)e.Result)); } #endregion } } smuxi-0.11/lib/agsxmpp/agsxmpp/starksoftproxy/Socks4ProxyClient.cs0000644000175000017500000006030612204443226026326 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Text; using System.Net; using System.Net.Sockets; using System.Globalization; using System.IO; using System.Threading; using System.ComponentModel; namespace Starksoft.Net.Proxy { /// /// Socks4 connection proxy class. This class implements the Socks4 standard proxy protocol. /// /// /// This class implements the Socks4 proxy protocol standard for TCP communciations. /// public class Socks4ProxyClient : IProxyClient { private const int WAIT_FOR_DATA_INTERVAL = 50; // 50 ms private const int WAIT_FOR_DATA_TIMEOUT = 15000; // 15 seconds private const string PROXY_NAME = "SOCKS4"; private TcpClient _tcpClient; private string _proxyHost; private int _proxyPort; private string _proxyUserId; /// /// Default Socks4 proxy port. /// internal const int SOCKS_PROXY_DEFAULT_PORT = 1080; /// /// Socks4 version number. /// internal const byte SOCKS4_VERSION_NUMBER = 4; /// /// Socks4 connection command value. /// internal const byte SOCKS4_CMD_CONNECT = 0x01; /// /// Socks4 bind command value. /// internal const byte SOCKS4_CMD_BIND = 0x02; /// /// Socks4 reply request grant response value. /// internal const byte SOCKS4_CMD_REPLY_REQUEST_GRANTED = 90; /// /// Socks4 reply request rejected or failed response value. /// internal const byte SOCKS4_CMD_REPLY_REQUEST_REJECTED_OR_FAILED = 91; /// /// Socks4 reply request rejected becauase the proxy server can not connect to the IDENTD server value. /// internal const byte SOCKS4_CMD_REPLY_REQUEST_REJECTED_CANNOT_CONNECT_TO_IDENTD = 92; /// /// Socks4 reply request rejected because of a different IDENTD server. /// internal const byte SOCKS4_CMD_REPLY_REQUEST_REJECTED_DIFFERENT_IDENTD = 93; /// /// Create a Socks4 proxy client object. The default proxy port 1080 is used. /// public Socks4ProxyClient() { } /// /// Creates a Socks4 proxy client object using the supplied TcpClient object connection. /// /// A TcpClient connection object. public Socks4ProxyClient(TcpClient tcpClient) { if (tcpClient == null) throw new ArgumentNullException("tcpClient"); _tcpClient = tcpClient; } /// /// Create a Socks4 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. /// Proxy user identification information. public Socks4ProxyClient(string proxyHost, string proxyUserId) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyUserId == null) throw new ArgumentNullException("proxyUserId"); _proxyHost = proxyHost; _proxyPort = SOCKS_PROXY_DEFAULT_PORT; _proxyUserId = proxyUserId; } /// /// Create a Socks4 proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. /// Proxy user identification information. public Socks4ProxyClient(string proxyHost, int proxyPort, string proxyUserId) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); if (proxyUserId == null) throw new ArgumentNullException("proxyUserId"); _proxyHost = proxyHost; _proxyPort = proxyPort; _proxyUserId = proxyUserId; } /// /// Create a Socks4 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. public Socks4ProxyClient(string proxyHost) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); _proxyHost = proxyHost; _proxyPort = SOCKS_PROXY_DEFAULT_PORT; } /// /// Create a Socks4 proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. public Socks4ProxyClient(string proxyHost, int proxyPort) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); _proxyHost = proxyHost; _proxyPort = proxyPort; } /// /// Gets or sets host name or IP address of the proxy server. /// public string ProxyHost { get { return _proxyHost; } set { _proxyHost = value; } } /// /// Gets or sets port used to connect to proxy server. /// public int ProxyPort { get { return _proxyPort; } set { _proxyPort = value; } } /// /// Gets String representing the name of the proxy. /// /// This property will always return the value 'SOCKS4' virtual public string ProxyName { get { return PROXY_NAME; } } /// /// Gets or sets proxy user identification information. /// public string ProxyUserId { get { return _proxyUserId; } set { _proxyUserId = value; } } /// /// Gets or sets the TcpClient object. /// This property can be set prior to executing CreateConnection to use an existing TcpClient connection. /// public TcpClient TcpClient { get { return _tcpClient; } set { _tcpClient = value; } } /// /// Creates a TCP connection to the destination host through the proxy server /// host. /// /// Destination host name or IP address of the destination server. /// Port number to connect to on the destination server. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public TcpClient CreateConnection(string destinationHost, int destinationPort) { if (String.IsNullOrEmpty(destinationHost)) throw new ArgumentNullException("destinationHost"); if (destinationPort <= 0 || destinationPort > 65535) throw new ArgumentOutOfRangeException("destinationPort", "port must be greater than zero and less than 65535"); try { // if we have no connection, create one if (_tcpClient == null) { if (String.IsNullOrEmpty(_proxyHost)) throw new ProxyException("ProxyHost property must contain a value."); if (_proxyPort <= 0 || _proxyPort > 65535) throw new ProxyException("ProxyPort value must be greater than zero and less than 65535"); // create new tcp client object to the proxy server _tcpClient = new TcpClient(); // attempt to open the connection _tcpClient.Connect(_proxyHost, _proxyPort); } // send connection command to proxy host for the specified destination host and port SendCommand(_tcpClient.GetStream(), SOCKS4_CMD_CONNECT, destinationHost, destinationPort, _proxyUserId); // return the open proxied tcp client object to the caller for normal use return _tcpClient; } catch (Exception ex) { throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "Connection to proxy host {0} on port {1} failed.", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient)), ex); } } /// /// Sends a command to the proxy server. /// /// Proxy server data stream. /// Proxy byte command to execute. /// Destination host name or IP address. /// Destination port number /// IDENTD user ID value. internal virtual void SendCommand(NetworkStream proxy, byte command, string destinationHost, int destinationPort, string userId) { // PROXY SERVER REQUEST // The client connects to the SOCKS server and sends a CONNECT request when // it wants to establish a connection to an application server. The client // includes in the request packet the IP address and the port number of the // destination host, and userid, in the following format. // // +----+----+----+----+----+----+----+----+----+----+....+----+ // | VN | CD | DSTPORT | DSTIP | USERID |NULL| // +----+----+----+----+----+----+----+----+----+----+....+----+ // # of bytes: 1 1 2 4 variable 1 // // VN is the SOCKS protocol version number and should be 4. CD is the // SOCKS command code and should be 1 for CONNECT request. NULL is a byte // of all zero bits. // userId needs to be a zero length string so that the GetBytes method // works properly if (userId == null) userId = ""; byte[] destIp = GetIPAddressBytes(destinationHost); byte[] destPort = GetDestinationPortBytes(destinationPort); byte[] userIdBytes = ASCIIEncoding.ASCII.GetBytes(userId); byte[] request = new byte[9 + userIdBytes.Length]; // set the bits on the request byte array request[0] = SOCKS4_VERSION_NUMBER; request[1] = command; destPort.CopyTo(request, 2); destIp.CopyTo(request, 4); userIdBytes.CopyTo(request, 8); request[8 + userIdBytes.Length] = 0x00; // null (byte with all zeros) terminator for userId // send the connect request proxy.Write(request, 0, request.Length); // wait for the proxy server to respond WaitForData(proxy); // PROXY SERVER RESPONSE // The SOCKS server checks to see whether such a request should be granted // based on any combination of source IP address, destination IP address, // destination port number, the userid, and information it may obtain by // consulting IDENT, cf. RFC 1413. If the request is granted, the SOCKS // server makes a connection to the specified port of the destination host. // A reply packet is sent to the client when this connection is established, // or when the request is rejected or the operation fails. // // +----+----+----+----+----+----+----+----+ // | VN | CD | DSTPORT | DSTIP | // +----+----+----+----+----+----+----+----+ // # of bytes: 1 1 2 4 // // VN is the version of the reply code and should be 0. CD is the result // code with one of the following values: // // 90: request granted // 91: request rejected or failed // 92: request rejected becuase SOCKS server cannot connect to // identd on the client // 93: request rejected because the client program and identd // report different user-ids // // The remaining fields are ignored. // // The SOCKS server closes its connection immediately after notifying // the client of a failed or rejected request. For a successful request, // the SOCKS server gets ready to relay traffic on both directions. This // enables the client to do I/O on its connection as if it were directly // connected to the application server. // create an 8 byte response array byte[] response = new byte[8]; // read the resonse from the network stream proxy.Read(response, 0, 8); // evaluate the reply code for an error condition if (response[1] != SOCKS4_CMD_REPLY_REQUEST_GRANTED) HandleProxyCommandError(response, destinationHost, destinationPort); } /// /// Translate the host name or IP address to a byte array. /// /// Host name or IP address. /// Byte array representing IP address in bytes. internal byte[] GetIPAddressBytes(string destinationHost) { IPAddress ipAddr = null; // if the address doesn't parse then try to resolve with dns if (!IPAddress.TryParse(destinationHost, out ipAddr)) { try { ipAddr = Dns.GetHostEntry(destinationHost).AddressList[0]; } catch (Exception ex) { throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "A error occurred while attempting to DNS resolve the host name {0}.", destinationHost), ex); } } // return address bytes return ipAddr.GetAddressBytes(); } /// /// Translate the destination port value to a byte array. /// /// Destination port. /// Byte array representing an 16 bit port number as two bytes. internal byte[] GetDestinationPortBytes(int value) { byte[] array = new byte[2]; array[0] = Convert.ToByte(value / 256); array[1] = Convert.ToByte(value % 256); return array; } /// /// Receive a byte array from the proxy server and determine and handle and errors that may have occurred. /// /// Proxy server command response as a byte array. /// Destination host. /// Destination port number. internal void HandleProxyCommandError(byte[] response, string destinationHost, int destinationPort) { if (response == null) throw new ArgumentNullException("response"); // extract the reply code byte replyCode = response[1]; // extract the ip v4 address (4 bytes) byte[] ipBytes = new byte[4]; for (int i = 0; i < 4; i++) ipBytes[i] = response[i + 4]; // convert the ip address to an IPAddress object IPAddress ipAddr = new IPAddress(ipBytes); // extract the port number big endian (2 bytes) byte[] portBytes = new byte[2]; portBytes[0] = response[3]; portBytes[1] = response[2]; Int16 port = BitConverter.ToInt16(portBytes, 0); // translate the reply code error number to human readable text string proxyErrorText; switch (replyCode) { case SOCKS4_CMD_REPLY_REQUEST_REJECTED_OR_FAILED: proxyErrorText = "connection request was rejected or failed"; break; case SOCKS4_CMD_REPLY_REQUEST_REJECTED_CANNOT_CONNECT_TO_IDENTD: proxyErrorText = "connection request was rejected because SOCKS destination cannot connect to identd on the client"; break; case SOCKS4_CMD_REPLY_REQUEST_REJECTED_DIFFERENT_IDENTD: proxyErrorText = "connection request rejected because the client program and identd report different user-ids"; break; default: proxyErrorText = String.Format(CultureInfo.InvariantCulture, "proxy client received an unknown reply with the code value '{0}' from the proxy destination", replyCode.ToString(CultureInfo.InvariantCulture)); break; } // build the exeception message string string exceptionMsg = String.Format(CultureInfo.InvariantCulture, "The {0} concerning destination host {1} port number {2}. The destination reported the host as {3} port {4}.", proxyErrorText, destinationHost, destinationPort, ipAddr.ToString(), port.ToString(CultureInfo.InvariantCulture)); // throw a new application exception throw new ProxyException(exceptionMsg); } internal void WaitForData(NetworkStream stream) { int sleepTime = 0; while (!stream.DataAvailable) { Thread.Sleep(WAIT_FOR_DATA_INTERVAL); sleepTime += WAIT_FOR_DATA_INTERVAL; if (sleepTime > WAIT_FOR_DATA_TIMEOUT) throw new ProxyException("A timeout while waiting for the proxy destination to respond."); } } #region "Async Methods" private BackgroundWorker _asyncWorker; private Exception _asyncException; bool _asyncCancelled; /// /// Gets a value indicating whether an asynchronous operation is running. /// /// Returns true if an asynchronous operation is running; otherwise, false. /// public bool IsBusy { get { return _asyncWorker == null ? false : _asyncWorker.IsBusy; } } /// /// Gets a value indicating whether an asynchronous operation is cancelled. /// /// Returns true if an asynchronous operation is cancelled; otherwise, false. /// public bool IsAsyncCancelled { get { return _asyncCancelled; } } /// /// Cancels any asychronous operation that is currently active. /// public void CancelAsync() { if (_asyncWorker != null && !_asyncWorker.CancellationPending && _asyncWorker.IsBusy) { _asyncCancelled = true; _asyncWorker.CancelAsync(); } } private void CreateAsyncWorker() { if (_asyncWorker != null) _asyncWorker.Dispose(); _asyncException = null; _asyncWorker = null; _asyncCancelled = false; _asyncWorker = new BackgroundWorker(); } /// /// Event handler for CreateConnectionAsync method completed. /// public event EventHandler CreateConnectionAsyncCompleted; /// /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port /// using the supplied open TcpClient object with an open connection to proxy server. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns TcpClient object that can be used normally to communicate /// with the destination server. /// /// /// This instructs the proxy server to make a pass through connection to the specified destination host on the specified /// port. /// public void CreateConnectionAsync(string destinationHost, int destinationPort) { if (_asyncWorker != null && _asyncWorker.IsBusy) throw new InvalidOperationException("The Socks4/4a object is already busy executing another asynchronous operation. You can only execute one asychronous method at a time."); CreateAsyncWorker(); _asyncWorker.WorkerSupportsCancellation = true; _asyncWorker.DoWork += new DoWorkEventHandler(CreateConnectionAsync_DoWork); _asyncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CreateConnectionAsync_RunWorkerCompleted); Object[] args = new Object[2]; args[0] = destinationHost; args[1] = destinationPort; _asyncWorker.RunWorkerAsync(args); } private void CreateConnectionAsync_DoWork(object sender, DoWorkEventArgs e) { try { Object[] args = (Object[])e.Argument; e.Result = CreateConnection((string)args[0], (int)args[1]); } catch (Exception ex) { _asyncException = ex; } } private void CreateConnectionAsync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (CreateConnectionAsyncCompleted != null) CreateConnectionAsyncCompleted(this, new CreateConnectionAsyncCompletedEventArgs(_asyncException, _asyncCancelled, (TcpClient)e.Result)); } #endregion } } smuxi-0.11/lib/agsxmpp/agsxmpp/starksoftproxy/EventArgs/0000755000175000017500000000000012204443226024321 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/starksoftproxy/EventArgs/CreateConnectionAsyncCompletedEventArgs.cs0000644000175000017500000000446712204443226034560 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Net.Sockets; using System.ComponentModel; namespace Starksoft.Net.Proxy { /// /// Event arguments class for the EncryptAsyncCompleted event. /// public class CreateConnectionAsyncCompletedEventArgs : AsyncCompletedEventArgs { private TcpClient _proxyConnection; /// /// Constructor. /// /// Exception information generated by the event. /// Cancelled event flag. This flag is set to true if the event was cancelled. /// Proxy Connection. The initialized and open TcpClient proxy connection. public CreateConnectionAsyncCompletedEventArgs(Exception error, bool cancelled, TcpClient proxyConnection) : base(error, cancelled, null) { _proxyConnection = proxyConnection; } /// /// The proxy connection. /// public TcpClient ProxyConnection { get { return _proxyConnection; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/starksoftproxy/Socks5ProxyClient.cs0000644000175000017500000007701512204443226026334 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Text; using System.Net; using System.Net.Sockets; using System.Globalization; using System.ComponentModel; namespace Starksoft.Net.Proxy { /// /// Socks5 connection proxy class. This class implements the Socks5 standard proxy protocol. /// /// /// This implementation supports TCP proxy connections with a Socks v5 server. /// public class Socks5ProxyClient : IProxyClient { private string _proxyHost; private int _proxyPort; private string _proxyUserName; private string _proxyPassword; private SocksAuthentication _proxyAuthMethod; private TcpClient _tcpClient; private const string PROXY_NAME = "SOCKS5"; private const int SOCKS5_DEFAULT_PORT = 1080; private const byte SOCKS5_VERSION_NUMBER = 5; private const byte SOCKS5_RESERVED = 0x00; private const byte SOCKS5_AUTH_NUMBER_OF_AUTH_METHODS_SUPPORTED = 2; private const byte SOCKS5_AUTH_METHOD_NO_AUTHENTICATION_REQUIRED = 0x00; private const byte SOCKS5_AUTH_METHOD_GSSAPI = 0x01; private const byte SOCKS5_AUTH_METHOD_USERNAME_PASSWORD = 0x02; private const byte SOCKS5_AUTH_METHOD_IANA_ASSIGNED_RANGE_BEGIN = 0x03; private const byte SOCKS5_AUTH_METHOD_IANA_ASSIGNED_RANGE_END = 0x7f; private const byte SOCKS5_AUTH_METHOD_RESERVED_RANGE_BEGIN = 0x80; private const byte SOCKS5_AUTH_METHOD_RESERVED_RANGE_END = 0xfe; private const byte SOCKS5_AUTH_METHOD_REPLY_NO_ACCEPTABLE_METHODS = 0xff; private const byte SOCKS5_CMD_CONNECT = 0x01; private const byte SOCKS5_CMD_BIND = 0x02; private const byte SOCKS5_CMD_UDP_ASSOCIATE = 0x03; private const byte SOCKS5_CMD_REPLY_SUCCEEDED = 0x00; private const byte SOCKS5_CMD_REPLY_GENERAL_SOCKS_SERVER_FAILURE = 0x01; private const byte SOCKS5_CMD_REPLY_CONNECTION_NOT_ALLOWED_BY_RULESET = 0x02; private const byte SOCKS5_CMD_REPLY_NETWORK_UNREACHABLE = 0x03; private const byte SOCKS5_CMD_REPLY_HOST_UNREACHABLE = 0x04; private const byte SOCKS5_CMD_REPLY_CONNECTION_REFUSED = 0x05; private const byte SOCKS5_CMD_REPLY_TTL_EXPIRED = 0x06; private const byte SOCKS5_CMD_REPLY_COMMAND_NOT_SUPPORTED = 0x07; private const byte SOCKS5_CMD_REPLY_ADDRESS_TYPE_NOT_SUPPORTED = 0x08; private const byte SOCKS5_ADDRTYPE_IPV4 = 0x01; private const byte SOCKS5_ADDRTYPE_DOMAIN_NAME = 0x03; private const byte SOCKS5_ADDRTYPE_IPV6 = 0x04; /// /// Authentication itemType. /// private enum SocksAuthentication { /// /// No authentication used. /// None, /// /// Username and password authentication. /// UsernamePassword } /// /// Create a Socks5 proxy client object. /// public Socks5ProxyClient() { } /// /// Creates a Socks5 proxy client object using the supplied TcpClient object connection. /// /// A TcpClient connection object. public Socks5ProxyClient(TcpClient tcpClient) { if (tcpClient == null) throw new ArgumentNullException("tcpClient"); _tcpClient = tcpClient; } /// /// Create a Socks5 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. public Socks5ProxyClient(string proxyHost) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); _proxyHost = proxyHost; _proxyPort = SOCKS5_DEFAULT_PORT; } /// /// Create a Socks5 proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. public Socks5ProxyClient(string proxyHost, int proxyPort) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); _proxyHost = proxyHost; _proxyPort = proxyPort; } /// /// Create a Socks5 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. /// Proxy authentication user name. /// Proxy authentication password. public Socks5ProxyClient(string proxyHost, string proxyUserName, string proxyPassword) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyUserName == null) throw new ArgumentNullException("proxyUserName"); if (proxyPassword == null) throw new ArgumentNullException("proxyPassword"); _proxyHost = proxyHost; _proxyPort = SOCKS5_DEFAULT_PORT; _proxyUserName = proxyUserName; _proxyPassword = proxyPassword; } /// /// Create a Socks5 proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. /// Proxy authentication user name. /// Proxy authentication password. public Socks5ProxyClient(string proxyHost, int proxyPort, string proxyUserName, string proxyPassword) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); if (proxyUserName == null) throw new ArgumentNullException("proxyUserName"); if (proxyPassword == null) throw new ArgumentNullException("proxyPassword"); _proxyHost = proxyHost; _proxyPort = proxyPort; _proxyUserName = proxyUserName; _proxyPassword = proxyPassword; } /// /// Gets or sets host name or IP address of the proxy server. /// public string ProxyHost { get { return _proxyHost; } set { _proxyHost = value; } } /// /// Gets or sets port used to connect to proxy server. /// public int ProxyPort { get { return _proxyPort; } set { _proxyPort = value; } } /// /// Gets String representing the name of the proxy. /// /// This property will always return the value 'SOCKS5' public string ProxyName { get { return PROXY_NAME; } } /// /// Gets or sets proxy authentication user name. /// public string ProxyUserName { get { return _proxyUserName; } set { _proxyUserName = value; } } /// /// Gets or sets proxy authentication password. /// public string ProxyPassword { get { return _proxyPassword; } set { _proxyPassword = value; } } /// /// Gets or sets the TcpClient object. /// This property can be set prior to executing CreateConnection to use an existing TcpClient connection. /// public TcpClient TcpClient { get { return _tcpClient; } set { _tcpClient = value; } } /// /// Creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address of the destination server. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public TcpClient CreateConnection(string destinationHost, int destinationPort) { if (String.IsNullOrEmpty(destinationHost)) throw new ArgumentNullException("destinationHost"); if (destinationPort <= 0 || destinationPort > 65535) throw new ArgumentOutOfRangeException("destinationPort", "port must be greater than zero and less than 65535"); try { // if we have no connection, create one if (_tcpClient == null) { if (String.IsNullOrEmpty(_proxyHost)) throw new ProxyException("ProxyHost property must contain a value."); if (_proxyPort <= 0 || _proxyPort > 65535) throw new ProxyException("ProxyPort value must be greater than zero and less than 65535"); // create new tcp client object to the proxy server _tcpClient = new TcpClient(); // attempt to open the connection _tcpClient.Connect(_proxyHost, _proxyPort); } // determine which authentication method the client would like to use DetermineClientAuthMethod(); // negotiate which authentication methods are supported / accepted by the server NegotiateServerAuthMethod(); // send a connect command to the proxy server for destination host and port SendCommand(SOCKS5_CMD_CONNECT, destinationHost, destinationPort); // return the open proxied tcp client object to the caller for normal use return _tcpClient; } catch (Exception ex) { throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "Connection to proxy host {0} on port {1} failed.", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient)), ex); } } private void DetermineClientAuthMethod() { // set the authentication itemType used based on values inputed by the user if (_proxyUserName != null && _proxyPassword != null) _proxyAuthMethod = SocksAuthentication.UsernamePassword; else _proxyAuthMethod = SocksAuthentication.None; } private void NegotiateServerAuthMethod() { // get a reference to the network stream NetworkStream stream = _tcpClient.GetStream(); // SERVER AUTHENTICATION REQUEST // The client connects to the server, and sends a version // identifier/method selection message: // // +----+----------+----------+ // |VER | NMETHODS | METHODS | // +----+----------+----------+ // | 1 | 1 | 1 to 255 | // +----+----------+----------+ byte[] authRequest = new byte[4]; authRequest[0] = SOCKS5_VERSION_NUMBER; authRequest[1] = SOCKS5_AUTH_NUMBER_OF_AUTH_METHODS_SUPPORTED; authRequest[2] = SOCKS5_AUTH_METHOD_NO_AUTHENTICATION_REQUIRED; authRequest[3] = SOCKS5_AUTH_METHOD_USERNAME_PASSWORD; // send the request to the server specifying authentication types supported by the client. stream.Write(authRequest, 0, authRequest.Length); // SERVER AUTHENTICATION RESPONSE // The server selects from one of the methods given in METHODS, and // sends a METHOD selection message: // // +----+--------+ // |VER | METHOD | // +----+--------+ // | 1 | 1 | // +----+--------+ // // If the selected METHOD is X'FF', none of the methods listed by the // client are acceptable, and the client MUST close the connection. // // The values currently defined for METHOD are: // * X'00' NO AUTHENTICATION REQUIRED // * X'01' GSSAPI // * X'02' USERNAME/PASSWORD // * X'03' to X'7F' IANA ASSIGNED // * X'80' to X'FE' RESERVED FOR PRIVATE METHODS // * X'FF' NO ACCEPTABLE METHODS // receive the server response byte[] response = new byte[2]; stream.Read(response, 0, response.Length); // the first byte contains the socks version number (e.g. 5) // the second byte contains the auth method acceptable to the proxy server byte acceptedAuthMethod = response[1]; // if the server does not accept any of our supported authenication methods then throw an error if (acceptedAuthMethod == SOCKS5_AUTH_METHOD_REPLY_NO_ACCEPTABLE_METHODS) { _tcpClient.Close(); throw new ProxyException("The proxy destination does not accept the supported proxy client authentication methods."); } // if the server accepts a username and password authentication and none is provided by the user then throw an error if (acceptedAuthMethod == SOCKS5_AUTH_METHOD_USERNAME_PASSWORD && _proxyAuthMethod == SocksAuthentication.None) { _tcpClient.Close(); throw new ProxyException("The proxy destination requires a username and password for authentication."); } if (acceptedAuthMethod == SOCKS5_AUTH_METHOD_USERNAME_PASSWORD) { // USERNAME / PASSWORD SERVER REQUEST // Once the SOCKS V5 server has started, and the client has selected the // Username/Password Authentication protocol, the Username/Password // subnegotiation begins. This begins with the client producing a // Username/Password request: // // +----+------+----------+------+----------+ // |VER | ULEN | UNAME | PLEN | PASSWD | // +----+------+----------+------+----------+ // | 1 | 1 | 1 to 255 | 1 | 1 to 255 | // +----+------+----------+------+----------+ byte[] credentials = new byte[_proxyUserName.Length + _proxyPassword.Length + 3]; credentials[0] = 1; credentials[1] = (byte)_proxyUserName.Length; Array.Copy(ASCIIEncoding.ASCII.GetBytes(_proxyUserName), 0, credentials, 2, _proxyUserName.Length); credentials[_proxyUserName.Length + 2] = (byte)_proxyPassword.Length; Array.Copy(ASCIIEncoding.ASCII.GetBytes(_proxyPassword), 0, credentials, _proxyUserName.Length + 3, _proxyPassword.Length); // USERNAME / PASSWORD SERVER RESPONSE // The server verifies the supplied UNAME and PASSWD, and sends the // following response: // // +----+--------+ // |VER | STATUS | // +----+--------+ // | 1 | 1 | // +----+--------+ // // A STATUS field of X'00' indicates success. If the server returns a // `failure' (STATUS value other than X'00') status, it MUST close the // connection. stream.Write(credentials, 0, credentials.Length); byte[] crResponse = new byte[2]; stream.Read(crResponse, 0, crResponse.Length); if (crResponse[1] != 0) { _tcpClient.Close(); throw new ProxyException("Proxy authentification failure!"); } } } private byte GetDestAddressType(string host) { IPAddress ipAddr = null; bool result = IPAddress.TryParse(host, out ipAddr); if (!result) return SOCKS5_ADDRTYPE_DOMAIN_NAME; switch (ipAddr.AddressFamily) { case AddressFamily.InterNetwork: return SOCKS5_ADDRTYPE_IPV4; case AddressFamily.InterNetworkV6: return SOCKS5_ADDRTYPE_IPV6; default: throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "The host addess {0} of type '{1}' is not a supported address type. The supported types are InterNetwork and InterNetworkV6.", host, Enum.GetName(typeof(AddressFamily), ipAddr.AddressFamily))); } } private byte[] GetDestAddressBytes(byte addressType, string host) { switch (addressType) { case SOCKS5_ADDRTYPE_IPV4: case SOCKS5_ADDRTYPE_IPV6: return IPAddress.Parse(host).GetAddressBytes(); case SOCKS5_ADDRTYPE_DOMAIN_NAME: // create a byte array to hold the host name bytes plus one byte to store the length byte[] bytes = new byte[host.Length + 1]; // if the address field contains a fully-qualified domain name. The first // octet of the address field contains the number of octets of name that // follow, there is no terminating NUL octet. bytes[0] = Convert.ToByte(host.Length); Encoding.ASCII.GetBytes(host).CopyTo(bytes, 1); return bytes; default: return null; } } private byte[] GetDestPortBytes(int value) { byte[] array = new byte[2]; array[0] = Convert.ToByte(value / 256); array[1] = Convert.ToByte(value % 256); return array; } private void SendCommand(byte command, string destinationHost, int destinationPort) { NetworkStream stream = _tcpClient.GetStream(); byte addressType = GetDestAddressType(destinationHost); byte[] destAddr = GetDestAddressBytes(addressType, destinationHost); byte[] destPort = GetDestPortBytes(destinationPort); // The connection request is made up of 6 bytes plus the // length of the variable address byte array // // +----+-----+-------+------+----------+----------+ // |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT | // +----+-----+-------+------+----------+----------+ // | 1 | 1 | X'00' | 1 | Variable | 2 | // +----+-----+-------+------+----------+----------+ // // * VER protocol version: X'05' // * CMD // * CONNECT X'01' // * BIND X'02' // * UDP ASSOCIATE X'03' // * RSV RESERVED // * ATYP address itemType of following address // * IP V4 address: X'01' // * DOMAINNAME: X'03' // * IP V6 address: X'04' // * DST.ADDR desired destination address // * DST.PORT desired destination port in network octet order byte[] request = new byte[4 + destAddr.Length + 2]; request[0] = SOCKS5_VERSION_NUMBER; request[1] = command; request[2] = SOCKS5_RESERVED; request[3] = addressType; destAddr.CopyTo(request, 4); destPort.CopyTo(request, 4 + destAddr.Length); // send connect request. stream.Write(request, 0, request.Length); // PROXY SERVER RESPONSE // +----+-----+-------+------+----------+----------+ // |VER | REP | RSV | ATYP | BND.ADDR | BND.PORT | // +----+-----+-------+------+----------+----------+ // | 1 | 1 | X'00' | 1 | Variable | 2 | // +----+-----+-------+------+----------+----------+ // // * VER protocol version: X'05' // * REP Reply field: // * X'00' succeeded // * X'01' general SOCKS server failure // * X'02' connection not allowed by ruleset // * X'03' Network unreachable // * X'04' Host unreachable // * X'05' Connection refused // * X'06' TTL expired // * X'07' Command not supported // * X'08' Address itemType not supported // * X'09' to X'FF' unassigned //* RSV RESERVED //* ATYP address itemType of following address byte[] response = new byte[255]; // read proxy server response var responseSize = stream.Read(response, 0, response.Length); byte replyCode = response[1]; // evaluate the reply code for an error condition if (responseSize < 2 || replyCode != SOCKS5_CMD_REPLY_SUCCEEDED) HandleProxyCommandError(response, destinationHost, destinationPort ); } private void HandleProxyCommandError(byte[] response, string destinationHost, int destinationPort) { string proxyErrorText; byte replyCode = response[1]; byte addrType = response[3]; string addr = ""; Int16 port = 0; switch (addrType) { case SOCKS5_ADDRTYPE_DOMAIN_NAME: int addrLen = Convert.ToInt32(response[4]); byte[] addrBytes = new byte[addrLen]; for (int i = 0; i < addrLen; i++) addrBytes[i] = response[i + 5]; addr = System.Text.ASCIIEncoding.ASCII.GetString(addrBytes); byte[] portBytesDomain = new byte[2]; portBytesDomain[0] = response[6 + addrLen]; portBytesDomain[1] = response[5 + addrLen]; port = BitConverter.ToInt16(portBytesDomain, 0); break; case SOCKS5_ADDRTYPE_IPV4: byte[] ipv4Bytes = new byte[4]; for (int i = 0; i < 4; i++) ipv4Bytes[i] = response[i + 4]; IPAddress ipv4 = new IPAddress(ipv4Bytes); addr = ipv4.ToString(); byte[] portBytesIpv4 = new byte[2]; portBytesIpv4[0] = response[9]; portBytesIpv4[1] = response[8]; port = BitConverter.ToInt16(portBytesIpv4, 0); break; case SOCKS5_ADDRTYPE_IPV6: byte[] ipv6Bytes = new byte[16]; for (int i = 0; i < 16; i++) ipv6Bytes[i] = response[i + 4]; IPAddress ipv6 = new IPAddress(ipv6Bytes); addr = ipv6.ToString(); byte[] portBytesIpv6 = new byte[2]; portBytesIpv6[0] = response[21]; portBytesIpv6[1] = response[20]; port = BitConverter.ToInt16(portBytesIpv6, 0); break; } switch (replyCode) { case SOCKS5_CMD_REPLY_GENERAL_SOCKS_SERVER_FAILURE: proxyErrorText = "a general socks destination failure occurred"; break; case SOCKS5_CMD_REPLY_CONNECTION_NOT_ALLOWED_BY_RULESET: proxyErrorText = "the connection is not allowed by proxy destination rule set"; break; case SOCKS5_CMD_REPLY_NETWORK_UNREACHABLE: proxyErrorText = "the network was unreachable"; break; case SOCKS5_CMD_REPLY_HOST_UNREACHABLE: proxyErrorText = "the host was unreachable"; break; case SOCKS5_CMD_REPLY_CONNECTION_REFUSED: proxyErrorText = "the connection was refused by the remote network"; break; case SOCKS5_CMD_REPLY_TTL_EXPIRED: proxyErrorText = "the time to live (TTL) has expired"; break; case SOCKS5_CMD_REPLY_COMMAND_NOT_SUPPORTED: proxyErrorText = "the command issued by the proxy client is not supported by the proxy destination"; break; case SOCKS5_CMD_REPLY_ADDRESS_TYPE_NOT_SUPPORTED: proxyErrorText = "the address type specified is not supported"; break; default: proxyErrorText = String.Format(CultureInfo.InvariantCulture, "that an unknown reply with the code value '{0}' was received by the destination", replyCode.ToString(CultureInfo.InvariantCulture)); break; } string exceptionMsg = String.Format(CultureInfo.InvariantCulture, "The {0} concerning destination host {1} port number {2}. The destination reported the host as {3} port {4}.", proxyErrorText, destinationHost, destinationPort, addr, port.ToString(CultureInfo.InvariantCulture)); throw new ProxyException(exceptionMsg); } #region "Async Methods" private BackgroundWorker _asyncWorker; private Exception _asyncException; bool _asyncCancelled; /// /// Gets a value indicating whether an asynchronous operation is running. /// /// Returns true if an asynchronous operation is running; otherwise, false. /// public bool IsBusy { get { return _asyncWorker == null ? false : _asyncWorker.IsBusy; } } /// /// Gets a value indicating whether an asynchronous operation is cancelled. /// /// Returns true if an asynchronous operation is cancelled; otherwise, false. /// public bool IsAsyncCancelled { get { return _asyncCancelled; } } /// /// Cancels any asychronous operation that is currently active. /// public void CancelAsync() { if (_asyncWorker != null && !_asyncWorker.CancellationPending && _asyncWorker.IsBusy) { _asyncCancelled = true; _asyncWorker.CancelAsync(); } } private void CreateAsyncWorker() { if (_asyncWorker != null) _asyncWorker.Dispose(); _asyncException = null; _asyncWorker = null; _asyncCancelled = false; _asyncWorker = new BackgroundWorker(); } /// /// Event handler for CreateConnectionAsync method completed. /// public event EventHandler CreateConnectionAsyncCompleted; /// /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns TcpClient object that can be used normally to communicate /// with the destination server. /// /// /// This method instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public void CreateConnectionAsync(string destinationHost, int destinationPort) { if (_asyncWorker != null && _asyncWorker.IsBusy) throw new InvalidOperationException("The Socks4 object is already busy executing another asynchronous operation. You can only execute one asychronous method at a time."); CreateAsyncWorker(); _asyncWorker.WorkerSupportsCancellation = true; _asyncWorker.DoWork += new DoWorkEventHandler(CreateConnectionAsync_DoWork); _asyncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CreateConnectionAsync_RunWorkerCompleted); Object[] args = new Object[2]; args[0] = destinationHost; args[1] = destinationPort; _asyncWorker.RunWorkerAsync(args); } private void CreateConnectionAsync_DoWork(object sender, DoWorkEventArgs e) { try { Object[] args = (Object[])e.Argument; e.Result = CreateConnection((string)args[0], (int)args[1]); } catch (Exception ex) { _asyncException = ex; } } private void CreateConnectionAsync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (CreateConnectionAsyncCompleted != null) CreateConnectionAsyncCompleted(this, new CreateConnectionAsyncCompletedEventArgs(_asyncException, _asyncCancelled, (TcpClient)e.Result)); } #endregion } } smuxi-0.11/lib/agsxmpp/agsxmpp/starksoftproxy/Exceptions/0000755000175000017500000000000012204443226024544 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/starksoftproxy/Exceptions/ProxyException.cs0000644000175000017500000000475012204443226030101 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Runtime.Serialization; namespace Starksoft.Net.Proxy { /// /// This exception is thrown when a general, unexpected proxy error. /// [Serializable()] public class ProxyException : Exception { /// /// Constructor. /// public ProxyException() { } /// /// Constructor. /// /// Exception message text. public ProxyException(string message) : base(message) { } /// /// Constructor. /// /// Exception message text. /// The inner exception object. public ProxyException(string message, Exception innerException) : base(message, innerException) { } /// /// Constructor. /// /// Serialization information. /// Stream context information. protected ProxyException(SerializationInfo info, StreamingContext context) : base(info, context) { } } }smuxi-0.11/lib/agsxmpp/agsxmpp/starksoftproxy/IProxyClient.cs0000644000175000017500000000771512204443226025355 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Collections.Generic; using System.Text; using System.Net.Sockets; namespace Starksoft.Net.Proxy { /// /// Proxy client interface. This is the interface that all proxy clients must implement. /// public interface IProxyClient { /// /// Event handler for CreateConnectionAsync method completed. /// event EventHandler CreateConnectionAsyncCompleted; /// /// Gets or sets proxy host name or IP address. /// string ProxyHost { get; set; } /// /// Gets or sets proxy port number. /// int ProxyPort { get; set; } /// /// Gets String representing the name of the proxy. /// string ProxyName { get; } /// /// Gets or set the TcpClient object if one was specified in the constructor. /// TcpClient TcpClient { get; set; } /// /// Creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// TcpClient CreateConnection(string destinationHost, int destinationPort); /// /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// void CreateConnectionAsync(string destinationHost, int destinationPort); } } smuxi-0.11/lib/agsxmpp/agsxmpp/starksoftproxy/Utils.cs0000644000175000017500000000174512204443226024061 0ustar00meebeymeebey00000000000000using System; using System.Text; using System.Globalization; using System.Net.Sockets; namespace Starksoft.Net.Proxy { internal static class Utils { internal static string GetHost(TcpClient client) { if (client == null) throw new ArgumentNullException("client"); string host = ""; try { host = ((System.Net.IPEndPoint)client.Client.RemoteEndPoint).Address.ToString(); } catch { }; return host; } internal static string GetPort(TcpClient client) { if (client == null) throw new ArgumentNullException("client"); string port = ""; try { port = ((System.Net.IPEndPoint)client.Client.RemoteEndPoint).Port.ToString(CultureInfo.InvariantCulture); } catch { }; return port; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/starksoftproxy/Socks4aProxyClient.cs0000644000175000017500000002571212204443226026471 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Text; using System.Net; using System.Net.Sockets; using System.IO; namespace Starksoft.Net.Proxy { /// /// Socks4a connection proxy class. This class implements the Socks4a standard proxy protocol /// which is an extension of the Socks4 protocol /// /// /// In Socks version 4A if the client cannot resolve the destination host's domain name /// to find its IP address the server will attempt to resolve it. /// public class Socks4aProxyClient : Socks4ProxyClient { private const string PROXY_NAME = "SOCKS4a"; /// /// Default constructor. /// public Socks4aProxyClient() : base() { } /// /// Creates a Socks4 proxy client object using the supplied TcpClient object connection. /// /// An open TcpClient object with an established connection. public Socks4aProxyClient(TcpClient tcpClient) : base(tcpClient) { } /// /// Create a Socks4a proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. /// Proxy user identification information for an IDENTD server. public Socks4aProxyClient(string proxyHost, string proxyUserId) : base(proxyHost, proxyUserId) { } /// /// Create a Socks4a proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. /// Proxy user identification information. public Socks4aProxyClient(string proxyHost, int proxyPort, string proxyUserId) : base(proxyHost, proxyPort, proxyUserId) { } /// /// Create a Socks4 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. public Socks4aProxyClient(string proxyHost) : base(proxyHost) { } /// /// Create a Socks4a proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. public Socks4aProxyClient(string proxyHost, int proxyPort) : base(proxyHost, proxyPort) { } /// /// Gets String representing the name of the proxy. /// /// This property will always return the value 'SOCKS4a' public override string ProxyName { get { return PROXY_NAME; } } /// /// Sends a command to the proxy server. /// /// Proxy server data stream. /// Proxy byte command to execute. /// Destination host name or IP address. /// Destination port number /// IDENTD user ID value. /// /// This method override the SendCommand message in the Sock4ProxyClient object. The override adds support for the /// Socks4a extensions which allow the proxy client to optionally command the proxy server to resolve the /// destination host IP address. /// internal override void SendCommand(NetworkStream proxy, byte command, string destinationHost, int destinationPort, string userId) { // PROXY SERVER REQUEST //Please read SOCKS4.protocol first for an description of the version 4 //protocol. This extension is intended to allow the use of SOCKS on hosts //which are not capable of resolving all domain names. // //In version 4, the client sends the following packet to the SOCKS server //to request a CONNECT or a BIND operation: // // +----+----+----+----+----+----+----+----+----+----+....+----+ // | VN | CD | DSTPORT | DSTIP | USERID |NULL| // +----+----+----+----+----+----+----+----+----+----+....+----+ // # of bytes: 1 1 2 4 variable 1 // //VN is the SOCKS protocol version number and should be 4. CD is the //SOCKS command code and should be 1 for CONNECT or 2 for BIND. NULL //is a byte of all zero bits. // //For version 4A, if the client cannot resolve the destination host's //domain name to find its IP address, it should set the first three bytes //of DSTIP to NULL and the last byte to a non-zero value. (This corresponds //to IP address 0.0.0.x, with x nonzero. As decreed by IANA -- The //Internet Assigned Numbers Authority -- such an address is inadmissible //as a destination IP address and thus should never occur if the client //can resolve the domain name.) Following the NULL byte terminating //USERID, the client must sends the destination domain name and termiantes //it with another NULL byte. This is used for both CONNECT and BIND requests. // //A server using protocol 4A must check the DSTIP in the request packet. //If it represent address 0.0.0.x with nonzero x, the server must read //in the domain name that the client sends in the packet. The server //should resolve the domain name and make connection to the destination //host if it can. // //SOCKSified sockd may pass domain names that it cannot resolve to //the next-hop SOCKS server. // userId needs to be a zero length string so that the GetBytes method // works properly if (userId == null) userId = ""; byte[] destIp = {0,0,0,1}; // build the invalid ip address as specified in the 4a protocol byte[] destPort = GetDestinationPortBytes(destinationPort); byte[] userIdBytes = ASCIIEncoding.ASCII.GetBytes(userId); byte[] hostBytes = ASCIIEncoding.ASCII.GetBytes(destinationHost); byte[] request = new byte[10 + userIdBytes.Length + hostBytes.Length]; // set the bits on the request byte array request[0] = SOCKS4_VERSION_NUMBER; request[1] = command; destPort.CopyTo(request, 2); destIp.CopyTo(request, 4); userIdBytes.CopyTo(request, 8); // copy the userid to the request byte array request[8 + userIdBytes.Length] = 0x00; // null (byte with all zeros) terminator for userId hostBytes.CopyTo(request, 9 + userIdBytes.Length); // copy the host name to the request byte array request[9 + userIdBytes.Length + hostBytes.Length] = 0x00; // null (byte with all zeros) terminator for userId // send the connect request proxy.Write(request, 0, request.Length); // wait for the proxy server to send a response base.WaitForData(proxy); // PROXY SERVER RESPONSE // The SOCKS server checks to see whether such a request should be granted // based on any combination of source IP address, destination IP address, // destination port number, the userid, and information it may obtain by // consulting IDENT, cf. RFC 1413. If the request is granted, the SOCKS // server makes a connection to the specified port of the destination host. // A reply packet is sent to the client when this connection is established, // or when the request is rejected or the operation fails. // // +----+----+----+----+----+----+----+----+ // | VN | CD | DSTPORT | DSTIP | // +----+----+----+----+----+----+----+----+ // # of bytes: 1 1 2 4 // // VN is the version of the reply code and should be 0. CD is the result // code with one of the following values: // // 90: request granted // 91: request rejected or failed // 92: request rejected becuase SOCKS server cannot connect to // identd on the client // 93: request rejected because the client program and identd // report different user-ids // // The remaining fields are ignored. // // The SOCKS server closes its connection immediately after notifying // the client of a failed or rejected request. For a successful request, // the SOCKS server gets ready to relay traffic on both directions. This // enables the client to do I/O on its connection as if it were directly // connected to the application server. // create an 8 byte response array byte[] response = new byte[8]; // read the resonse from the network stream proxy.Read(response, 0, 8); // evaluate the reply code for an error condition if (response[1] != SOCKS4_CMD_REPLY_REQUEST_GRANTED) HandleProxyCommandError(response, destinationHost, destinationPort); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/starksoftproxy/ProxyClientFactory.cs0000644000175000017500000002113412204443226026563 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Collections.Generic; using System.Text; using System.Net.Sockets; namespace Starksoft.Net.Proxy { /// /// The type of proxy. /// public enum ProxyType { /// /// No Proxy specified. Note this option will cause an exception to be thrown if used to create a proxy object by the factory. /// None, /// /// HTTP Proxy /// Http, /// /// SOCKS v4 Proxy /// Socks4, /// /// SOCKS v4a Proxy /// Socks4a, /// /// SOCKS v5 Proxy /// Socks5 } /// /// Factory class for creating new proxy client objects. /// /// /// /// // create an instance of the client proxy factory /// ProxyClientFactory factory = new ProxyClientFactory(); /// /// // use the proxy client factory to generically specify the type of proxy to create /// // the proxy factory method CreateProxyClient returns an IProxyClient object /// IProxyClient proxy = factory.CreateProxyClient(ProxyType.Http, "localhost", 6588); /// /// // create a connection through the proxy to www.starksoft.com over port 80 /// System.Net.Sockets.TcpClient tcpClient = proxy.CreateConnection("www.starksoft.com", 80); /// /// public class ProxyClientFactory { /// /// Factory method for creating new proxy client objects. /// /// The type of proxy client to create. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type) { if (type == ProxyType.None) throw new ArgumentOutOfRangeException("type"); switch (type) { case ProxyType.Http: return new HttpProxyClient(); case ProxyType.Socks4: return new Socks4ProxyClient(); case ProxyType.Socks4a: return new Socks4aProxyClient(); case ProxyType.Socks5: return new Socks5ProxyClient(); default: throw new ProxyException(String.Format("Unknown proxy type {0}.", type.ToString())); } } /// /// Factory method for creating new proxy client objects using an existing TcpClient connection object. /// /// The type of proxy client to create. /// Open TcpClient object. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type, TcpClient tcpClient) { if (type == ProxyType.None) throw new ArgumentOutOfRangeException("type"); switch (type) { case ProxyType.Http: return new HttpProxyClient(tcpClient); case ProxyType.Socks4: return new Socks4ProxyClient(tcpClient); case ProxyType.Socks4a: return new Socks4aProxyClient(tcpClient); case ProxyType.Socks5: return new Socks5ProxyClient(tcpClient); default: throw new ProxyException(String.Format("Unknown proxy type {0}.", type.ToString())); } } /// /// Factory method for creating new proxy client objects. /// /// The type of proxy client to create. /// The proxy host or IP address. /// The proxy port number. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type, string proxyHost, int proxyPort) { if (type == ProxyType.None) throw new ArgumentOutOfRangeException("type"); switch (type) { case ProxyType.Http: return new HttpProxyClient(proxyHost, proxyPort); case ProxyType.Socks4: return new Socks4ProxyClient(proxyHost, proxyPort); case ProxyType.Socks4a: return new Socks4aProxyClient(proxyHost, proxyPort); case ProxyType.Socks5: return new Socks5ProxyClient(proxyHost, proxyPort); default: throw new ProxyException(String.Format("Unknown proxy type {0}.", type.ToString())); } } /// /// Factory method for creating new proxy client objects. /// /// The type of proxy client to create. /// The proxy host or IP address. /// The proxy port number. /// The proxy username. This parameter is only used by Socks4 and Socks5 proxy objects. /// The proxy user password. This parameter is only used Socks5 proxy objects. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword) { if (type == ProxyType.None) throw new ArgumentOutOfRangeException("type"); switch (type) { case ProxyType.Http: return new HttpProxyClient(proxyHost, proxyPort); case ProxyType.Socks4: return new Socks4ProxyClient(proxyHost, proxyPort, proxyUsername); case ProxyType.Socks4a: return new Socks4aProxyClient(proxyHost, proxyPort, proxyUsername); case ProxyType.Socks5: return new Socks5ProxyClient(proxyHost, proxyPort, proxyUsername, proxyPassword); default: throw new ProxyException(String.Format("Unknown proxy type {0}.", type.ToString())); } } /// /// Factory method for creating new proxy client objects. /// /// The type of proxy client to create. /// Open TcpClient object. /// The proxy host or IP address. /// The proxy port number. /// The proxy username. This parameter is only used by Socks4 and Socks5 proxy objects. /// The proxy user password. This parameter is only used Socks5 proxy objects. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type, TcpClient tcpClient, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword) { IProxyClient c = CreateProxyClient(type, proxyHost, proxyPort, proxyUsername, proxyPassword); c.TcpClient = tcpClient; return c; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Uri.cs0000644000175000017500000002470712204443225020400 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP { public class Uri { public const string STREAM = "http://etherx.jabber.org/streams"; public const string CLIENT = "jabber:client"; public const string SERVER = "jabber:server"; public const string IQ_AGENTS = "jabber:iq:agents"; public const string IQ_ROSTER = "jabber:iq:roster"; public const string IQ_AUTH = "jabber:iq:auth"; public const string IQ_REGISTER = "jabber:iq:register"; public const string IQ_OOB = "jabber:iq:oob"; public const string IQ_LAST = "jabber:iq:last"; public const string IQ_TIME = "jabber:iq:time"; public const string IQ_VERSION = "jabber:iq:version"; public const string IQ_BROWSE = "jabber:iq:browse"; public const string IQ_SEARCH = "jabber:iq:search"; public const string IQ_AVATAR = "jabber:iq:avatar"; public const string IQ_PRIVATE = "jabber:iq:private"; public const string IQ_PRIVACY = "jabber:iq:privacy"; /// /// JEP-0009: Jabber-RPC /// public const string IQ_RPC = "jabber:iq:rpc"; public const string X_DELAY = "jabber:x:delay"; public const string X_EVENT = "jabber:x:event"; public const string X_AVATAR = "jabber:x:avatar"; public const string X_CONFERENCE = "jabber:x:conference"; /// /// jabber:x:data /// public const string X_DATA = "jabber:x:data"; /// /// JEP-0144 Roster Item Exchange /// public const string X_ROSTERX = "http://jabber.org/protocol/rosterx"; /// /// Multi User Chat (MUC) JEP-0045 /// http://jabber.org/protocol/muc /// public const string MUC = "http://jabber.org/protocol/muc"; /// /// http://jabber.org/protocol/muc#user /// public const string MUC_USER = "http://jabber.org/protocol/muc#user"; /// /// "http://jabber.org/protocol/muc#admin /// public const string MUC_ADMIN = "http://jabber.org/protocol/muc#admin"; /// /// http://jabber.org/protocol/muc#owner /// public const string MUC_OWNER = "http://jabber.org/protocol/muc#owner"; // Service Disovery public const string DISCO_ITEMS = "http://jabber.org/protocol/disco#items"; public const string DISCO_INFO = "http://jabber.org/protocol/disco#info"; public const string STORAGE_AVATAR = "storage:client:avatar"; public const string VCARD = "vcard-temp"; // New XMPP Stuff /// /// urn:ietf:params:xml:ns:xmpp-streams /// public const string STREAMS = "urn:ietf:params:xml:ns:xmpp-streams"; public const string STANZAS = "urn:ietf:params:xml:ns:xmpp-stanzas"; public const string TLS = "urn:ietf:params:xml:ns:xmpp-tls"; public const string SASL = "urn:ietf:params:xml:ns:xmpp-sasl"; public const string SESSION = "urn:ietf:params:xml:ns:xmpp-session"; public const string BIND = "urn:ietf:params:xml:ns:xmpp-bind"; /// /// jabber:component:accept /// public const string ACCEPT = "jabber:component:accept"; // Features // public const string FEATURE_IQ_REGISTER = "http://jabber.org/features/iq-register"; /// /// Stream Compression http://jabber.org/features/compress /// public const string FEATURE_COMPRESS = "http://jabber.org/features/compress"; // Extensions (JEPs) public const string SHIM = "http://jabber.org/protocol/shim"; public const string PRIMARY = "http://jabber.org/protocol/primary"; /// /// JEP-0172 User nickname /// http://jabber.org/protocol/nick /// public const string NICK = "http://jabber.org/protocol/nick"; /// /// JEP-0085 Chat State Notifications /// http://jabber.org/protocol/chatstates /// public const string CHATSTATES = "http://jabber.org/protocol/chatstates"; /// /// JEP-0138: Stream Compression /// public const string COMPRESS = "http://jabber.org/protocol/compress"; /// /// JEP-0020: Feature Negotiation http://jabber.org/protocol/feature-neg /// public const string FEATURE_NEG = "http://jabber.org/protocol/feature-neg"; /// /// JEO-0095 http://jabber.org/protocol/si /// public const string SI = "http://jabber.org/protocol/si"; /// /// JEO-0096 http://jabber.org/protocol/si/profile/file-transfer /// public const string SI_FILE_TRANSFER = "http://jabber.org/protocol/si/profile/file-transfer"; /// /// JEP-0065 SOCKS5 bytestreams /// http://jabber.org/protocol/bytestreams /// public const string BYTESTREAMS = "http://jabber.org/protocol/bytestreams"; // JEP-0083 public const string ROSTER_DELIMITER = "roster:delimiter"; // Jive Software Namespaces /// /// Jivesoftware asterisk-im extension (http://jivesoftware.com/xmlns/phone); /// public const string JIVESOFTWARE_PHONE = "http://jivesoftware.com/xmlns/phone"; /// /// JEP-0071: XHTML-IM (http://jivesoftware.com/xmlns/phone) /// public const string XHTML_IM = "http://jabber.org/protocol/xhtml-im"; public const string XHTML = "http://www.w3.org/1999/xhtml"; /// /// XEP-0115: Entity Capabilities (http://jabber.org/protocol/caps) /// public const string CAPS = "http://jabber.org/protocol/caps"; /// /// Jingle http://jabber.org/protocol/jingle /// public const string JINGLE = "http://jabber.org/protocol/jingle"; /// /// Jingle audio format description http://jabber.org/protocol/jingle/description/audio /// public const string JINGLE_AUDIO_DESCRIPTION = "http://jabber.org/protocol/jingle/description/audio"; /// /// Jingle Info audio http://jabber.org/protocol/jingle/info/audio; /// public const string JINGLE_AUDIO_INFO = "http://jabber.org/protocol/jingle/info/audio"; public const string JINGLE_VIDEO_DESCRIPTION = "http://jabber.org/protocol/jingle/description/video"; /// /// GeoLoc (http://jabber.org/protocol/geoloc) /// public const string GEOLOC = "http://jabber.org/protocol/geoloc"; /// /// XMPP ping /// Namespace: urn:xmpp:ping /// http://www.xmpp.org/extensions/xep-0199.html /// public const string PING = "urn:xmpp:ping"; /// /// Ad-Hoc Commands (http://jabber.org/protocol/commands) /// public const string COMMANDS = "http://jabber.org/protocol/commands"; // Pubsub stuff public const string PUBSUB = "http://jabber.org/protocol/pubsub"; public const string PUBSUB_EVENT = "http://jabber.org/protocol/pubsub#event"; public const string PUBSUB_OWNER = "http://jabber.org/protocol/pubsub#owner"; // Http-Binding XEP-0124 public const string HTTP_BIND = "http://jabber.org/protocol/httpbind"; /// /// XEP-0184: Message Receipts /// urn:xmpp:receipts /// public const string MSG_RECEIPT = "urn:xmpp:receipts"; /// /// XEP-0048: Bookmark Storage /// storage:bookmarks /// public const string STORAGE_BOOKMARKS = "storage:bookmarks"; /// /// XEP-0047: In-Band Bytestreams (IBB) /// http://jabber.org/protocol/ibb /// public const string IBB = "http://jabber.org/protocol/ibb"; /// /// /// http://jabber.org/protocol/amp /// public const string AMP = "http://jabber.org/protocol/amp"; /// /// XEP-0153: vCard-Based Avatars /// vcard-temp:x:update /// public const string VCARD_UPDATE = "vcard-temp:x:update"; public const string URN_TIME = "urn:xmpp:time"; /// /// XEP-0145 Annotations /// storage:rosternotes /// public const string STORAGE_ROSTERNOTES = "storage:rosternotes"; } }smuxi-0.11/lib/agsxmpp/agsxmpp/IO/0000755000175000017500000000000012204443225017607 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/IO/StringWriterWithEncoding.cs0000644000175000017500000000323212204443225025104 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.IO; using System.Text; namespace agsXMPP.IO { /// /// This class is inherited from the StringWriter Class /// The standard StringWriter class supports no encoding /// With this Class we can set the Encoding of a StringWriter in the Constructor /// public class StringWriterWithEncoding : StringWriter { Encoding m_Encoding; public StringWriterWithEncoding (Encoding encoding) { this.m_Encoding = encoding; } public override Encoding Encoding { get { return m_Encoding; } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/0000755000175000017500000000000012204443225022110 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/DeflaterEngine.cs0000644000175000017500000005420612204443225025322 0ustar00meebeymeebey00000000000000// DeflaterEngine.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; using agsXMPP.IO.Compression.Checksums; namespace agsXMPP.IO.Compression { /// /// Strategies for deflater /// public enum DeflateStrategy { /// /// The default strategy /// Default = 0, /// /// This strategy will only allow longer string repetitions. It is /// useful for random data with a small character set. /// Filtered = 1, /// /// This strategy will not look for string repetitions at all. It /// only encodes with Huffman trees (which means, that more common /// characters get a smaller encoding. /// HuffmanOnly = 2 } // DEFLATE ALGORITHM: // // The uncompressed stream is inserted into the window array. When // the window array is full the first half is thrown away and the // second half is copied to the beginning. // // The head array is a hash table. Three characters build a hash value // and they the value points to the corresponding index in window of // the last string with this hash. The prev array implements a // linked list of matches with the same hash: prev[index & WMASK] points // to the previous index with the same hash. // /// /// Low level compression engine for deflate algorithm which uses a 32K sliding window /// with secondary compression from Huffman/Shannon-Fano codes. /// public class DeflaterEngine : DeflaterConstants { static int TOO_FAR = 4096; int ins_h; /// /// Hashtable, hashing three characters to an index for window, so /// that window[index]..window[index+2] have this hash code. /// Note that the array should really be unsigned short, so you need /// to and the values with 0xffff. /// short[] head; /// /// prev[index & WMASK] points to the previous index that has the /// same hash code as the string starting at index. This way /// entries with the same hash code are in a linked list. /// Note that the array should really be unsigned short, so you need /// to and the values with 0xffff. /// short[] prev; int matchStart; int matchLen; bool prevAvailable; int blockStart; /// /// Points to the current character in the window. /// int strstart; /// /// lookahead is the number of characters starting at strstart in /// window that are valid. /// So window[strstart] until window[strstart+lookahead-1] are valid /// characters. /// int lookahead; /// /// This array contains the part of the uncompressed stream that /// is of relevance. The current character is indexed by strstart. /// byte[] window; DeflateStrategy strategy; int max_chain, max_lazy, niceLength, goodLength; /// /// The current compression function. /// int comprFunc; /// /// The input data for compression. /// byte[] inputBuf; /// /// The total bytes of input read. /// int totalIn; /// /// The offset into inputBuf, where input data starts. /// int inputOff; /// /// The end offset of the input data. /// int inputEnd; DeflaterPending pending; DeflaterHuffman huffman; /// /// The adler checksum /// Adler32 adler; /// /// Construct instance with pending buffer /// /// /// Pending buffer to use /// > public DeflaterEngine(DeflaterPending pending) { this.pending = pending; huffman = new DeflaterHuffman(pending); adler = new Adler32(); window = new byte[2 * WSIZE]; head = new short[HASH_SIZE]; prev = new short[WSIZE]; // We start at index 1, to avoid an implementation deficiency, that // we cannot build a repeat pattern at index 0. blockStart = strstart = 1; } /// /// Reset internal state /// public void Reset() { huffman.Reset(); adler.Reset(); blockStart = strstart = 1; lookahead = 0; totalIn = 0; prevAvailable = false; matchLen = MIN_MATCH - 1; for (int i = 0; i < HASH_SIZE; i++) { head[i] = 0; } for (int i = 0; i < WSIZE; i++) { prev[i] = 0; } } /// /// Reset Adler checksum /// public void ResetAdler() { adler.Reset(); } /// /// Get current value of Adler checksum /// public int Adler { get { return (int)adler.Value; } } /// /// Total data processed /// public int TotalIn { get { return totalIn; } } /// /// Get/set the deflate strategy /// public DeflateStrategy Strategy { get { return strategy; } set { strategy = value; } } /// /// Set the deflate level (0-9) /// public void SetLevel(int lvl) { goodLength = DeflaterConstants.GOOD_LENGTH[lvl]; max_lazy = DeflaterConstants.MAX_LAZY[lvl]; niceLength = DeflaterConstants.NICE_LENGTH[lvl]; max_chain = DeflaterConstants.MAX_CHAIN[lvl]; if (DeflaterConstants.COMPR_FUNC[lvl] != comprFunc) { /* if (DeflaterConstants.DEBUGGING) { Console.WriteLine("Change from " + comprFunc + " to " + DeflaterConstants.COMPR_FUNC[lvl]); } */ switch (comprFunc) { case DEFLATE_STORED: if (strstart > blockStart) { huffman.FlushStoredBlock(window, blockStart, strstart - blockStart, false); blockStart = strstart; } UpdateHash(); break; case DEFLATE_FAST: if (strstart > blockStart) { huffman.FlushBlock(window, blockStart, strstart - blockStart, false); blockStart = strstart; } break; case DEFLATE_SLOW: if (prevAvailable) { huffman.TallyLit(window[strstart-1] & 0xff); } if (strstart > blockStart) { huffman.FlushBlock(window, blockStart, strstart - blockStart, false); blockStart = strstart; } prevAvailable = false; matchLen = MIN_MATCH - 1; break; } comprFunc = COMPR_FUNC[lvl]; } } void UpdateHash() { /* if (DEBUGGING) { Console.WriteLine("updateHash: "+strstart); } */ ins_h = (window[strstart] << HASH_SHIFT) ^ window[strstart + 1]; } /// /// Inserts the current string in the head hash and returns the previous /// value for this hash. /// /// The previous hash value int InsertString() { short match; int hash = ((ins_h << HASH_SHIFT) ^ window[strstart + (MIN_MATCH -1)]) & HASH_MASK; /* if (DeflaterConstants.DEBUGGING) { if (hash != (((window[strstart] << (2*HASH_SHIFT)) ^ (window[strstart + 1] << HASH_SHIFT) ^ (window[strstart + 2])) & HASH_MASK)) { throw new SharpZipBaseException("hash inconsistent: " + hash + "/" +window[strstart] + "," +window[strstart+1] + "," +window[strstart+2] + "," + HASH_SHIFT); } } */ prev[strstart & WMASK] = match = head[hash]; head[hash] = (short)strstart; ins_h = hash; return match & 0xffff; } void SlideWindow() { Array.Copy(window, WSIZE, window, 0, WSIZE); matchStart -= WSIZE; strstart -= WSIZE; blockStart -= WSIZE; /* Slide the hash table (could be avoided with 32 bit values * at the expense of memory usage). */ for (int i = 0; i < HASH_SIZE; ++i) { int m = head[i] & 0xffff; head[i] = (short)(m >= WSIZE ? (m - WSIZE) : 0); } /* Slide the prev table. */ for (int i = 0; i < WSIZE; i++) { int m = prev[i] & 0xffff; prev[i] = (short)(m >= WSIZE ? (m - WSIZE) : 0); } } /// /// Fill the window /// public void FillWindow() { /* If the window is almost full and there is insufficient lookahead, * move the upper half to the lower one to make room in the upper half. */ if (strstart >= WSIZE + MAX_DIST) { SlideWindow(); } /* If there is not enough lookahead, but still some input left, * read in the input */ while (lookahead < DeflaterConstants.MIN_LOOKAHEAD && inputOff < inputEnd) { int more = 2 * WSIZE - lookahead - strstart; if (more > inputEnd - inputOff) { more = inputEnd - inputOff; } System.Array.Copy(inputBuf, inputOff, window, strstart + lookahead, more); adler.Update(inputBuf, inputOff, more); inputOff += more; totalIn += more; lookahead += more; } if (lookahead >= MIN_MATCH) { UpdateHash(); } } /// /// Find the best (longest) string in the window matching the /// string starting at strstart. /// /// Preconditions: /// /// strstart + MAX_MATCH <= window.length. /// /// /// True if a match greater than the minimum length is found bool FindLongestMatch(int curMatch) { int chainLength = this.max_chain; int niceLength = this.niceLength; short[] prev = this.prev; int scan = this.strstart; int match; int best_end = this.strstart + matchLen; int best_len = Math.Max(matchLen, MIN_MATCH - 1); int limit = Math.Max(strstart - MAX_DIST, 0); int strend = strstart + MAX_MATCH - 1; byte scan_end1 = window[best_end - 1]; byte scan_end = window[best_end]; /* Do not waste too much time if we already have a good match: */ if (best_len >= this.goodLength) { chainLength >>= 2; } /* Do not look for matches beyond the end of the input. This is necessary * to make deflate deterministic. */ if (niceLength > lookahead) { niceLength = lookahead; } /* if (DeflaterConstants.DEBUGGING && strstart > 2 * WSIZE - MIN_LOOKAHEAD) { throw new InvalidOperationException("need lookahead"); } */ do { /* if (DeflaterConstants.DEBUGGING && curMatch >= strstart) { throw new InvalidOperationException("future match"); } */ if (window[curMatch + best_len] != scan_end || window[curMatch + best_len - 1] != scan_end1 || window[curMatch] != window[scan] || window[curMatch + 1] != window[scan + 1]) { continue; } match = curMatch + 2; scan += 2; /* We check for insufficient lookahead only every 8th comparison; * the 256th check will be made at strstart + 258. */ while (window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && scan < strend) ; if (scan > best_end) { /* if (DeflaterConstants.DEBUGGING && ins_h == 0) System.err.println("Found match: "+curMatch+"-"+(scan-strstart)); */ matchStart = curMatch; best_end = scan; best_len = scan - strstart; if (best_len >= niceLength) { break; } scan_end1 = window[best_end - 1]; scan_end = window[best_end]; } scan = strstart; } while ((curMatch = (prev[curMatch & WMASK] & 0xffff)) > limit && --chainLength != 0); matchLen = Math.Min(best_len, lookahead); return matchLen >= MIN_MATCH; } /// /// Set compression dictionary /// public void SetDictionary(byte[] buffer, int offset, int length) { /* if (DeflaterConstants.DEBUGGING && strstart != 1) { throw new InvalidOperationException("strstart not 1"); } */ adler.Update(buffer, offset, length); if (length < MIN_MATCH) { return; } if (length > MAX_DIST) { offset += length - MAX_DIST; length = MAX_DIST; } System.Array.Copy(buffer, offset, window, strstart, length); UpdateHash(); --length; while (--length > 0) { InsertString(); strstart++; } strstart += 2; blockStart = strstart; } bool DeflateStored(bool flush, bool finish) { if (!flush && lookahead == 0) { return false; } strstart += lookahead; lookahead = 0; int storedLen = strstart - blockStart; if ((storedLen >= DeflaterConstants.MAX_BLOCK_SIZE) || /* Block is full */ (blockStart < WSIZE && storedLen >= MAX_DIST) || /* Block may move out of window */ flush) { bool lastBlock = finish; if (storedLen > DeflaterConstants.MAX_BLOCK_SIZE) { storedLen = DeflaterConstants.MAX_BLOCK_SIZE; lastBlock = false; } /* if (DeflaterConstants.DEBUGGING) { Console.WriteLine("storedBlock["+storedLen+","+lastBlock+"]"); } */ huffman.FlushStoredBlock(window, blockStart, storedLen, lastBlock); blockStart += storedLen; return !lastBlock; } return true; } private bool DeflateFast(bool flush, bool finish) { if (lookahead < MIN_LOOKAHEAD && !flush) { return false; } while (lookahead >= MIN_LOOKAHEAD || flush) { if (lookahead == 0) { /* We are flushing everything */ huffman.FlushBlock(window, blockStart, strstart - blockStart, finish); blockStart = strstart; return false; } if (strstart > 2 * WSIZE - MIN_LOOKAHEAD) { /* slide window, as findLongestMatch needs this. * This should only happen when flushing and the window * is almost full. */ SlideWindow(); } int hashHead; if (lookahead >= MIN_MATCH && (hashHead = InsertString()) != 0 && strategy != DeflateStrategy.HuffmanOnly && strstart - hashHead <= MAX_DIST && FindLongestMatch(hashHead)) { /* longestMatch sets matchStart and matchLen */ /* if (DeflaterConstants.DEBUGGING) { for (int i = 0 ; i < matchLen; i++) { if (window[strstart+i] != window[matchStart + i]) { throw new SharpZipBaseException("Match failure"); } } } */ // -jr- Hak hak hak this stops problems with fast/low compression and index out of range if (huffman.TallyDist(strstart - matchStart, matchLen)) { bool lastBlock = finish && lookahead == 0; huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock); blockStart = strstart; } lookahead -= matchLen; if (matchLen <= max_lazy && lookahead >= MIN_MATCH) { while (--matchLen > 0) { ++strstart; InsertString(); } ++strstart; } else { strstart += matchLen; if (lookahead >= MIN_MATCH - 1) { UpdateHash(); } } matchLen = MIN_MATCH - 1; continue; } else { /* No match found */ huffman.TallyLit(window[strstart] & 0xff); ++strstart; --lookahead; } if (huffman.IsFull()) { bool lastBlock = finish && lookahead == 0; huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock); blockStart = strstart; return !lastBlock; } } return true; } bool DeflateSlow(bool flush, bool finish) { if (lookahead < MIN_LOOKAHEAD && !flush) { return false; } while (lookahead >= MIN_LOOKAHEAD || flush) { if (lookahead == 0) { if (prevAvailable) { huffman.TallyLit(window[strstart-1] & 0xff); } prevAvailable = false; // We are flushing everything /* if (DeflaterConstants.DEBUGGING && !flush) { throw new SharpZipBaseException("Not flushing, but no lookahead"); } */ huffman.FlushBlock(window, blockStart, strstart - blockStart, finish); blockStart = strstart; return false; } if (strstart >= 2 * WSIZE - MIN_LOOKAHEAD) { /* slide window, as findLongestMatch need this. * This should only happen when flushing and the window * is almost full. */ SlideWindow(); } int prevMatch = matchStart; int prevLen = matchLen; if (lookahead >= MIN_MATCH) { int hashHead = InsertString(); if (strategy != DeflateStrategy.HuffmanOnly && hashHead != 0 && strstart - hashHead <= MAX_DIST && FindLongestMatch(hashHead)) { /* longestMatch sets matchStart and matchLen */ /* Discard match if too small and too far away */ if (matchLen <= 5 && (strategy == DeflateStrategy.Filtered || (matchLen == MIN_MATCH && strstart - matchStart > TOO_FAR))) { matchLen = MIN_MATCH - 1; } } } /* previous match was better */ if (prevLen >= MIN_MATCH && matchLen <= prevLen) { /* if (DeflaterConstants.DEBUGGING) { for (int i = 0 ; i < matchLen; i++) { if (window[strstart-1+i] != window[prevMatch + i]) throw new SharpZipBaseException(); } } */ huffman.TallyDist(strstart - 1 - prevMatch, prevLen); prevLen -= 2; do { strstart++; lookahead--; if (lookahead >= MIN_MATCH) { InsertString(); } } while (--prevLen > 0); strstart ++; lookahead--; prevAvailable = false; matchLen = MIN_MATCH - 1; } else { if (prevAvailable) { huffman.TallyLit(window[strstart-1] & 0xff); } prevAvailable = true; strstart++; lookahead--; } if (huffman.IsFull()) { int len = strstart - blockStart; if (prevAvailable) { len--; } bool lastBlock = (finish && lookahead == 0 && !prevAvailable); huffman.FlushBlock(window, blockStart, len, lastBlock); blockStart += len; return !lastBlock; } } return true; } /// /// Deflate drives actual compression of data /// public bool Deflate(bool flush, bool finish) { bool progress; do { FillWindow(); bool canFlush = flush && inputOff == inputEnd; // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("window: ["+blockStart+","+strstart+"," // +lookahead+"], "+comprFunc+","+canFlush); // } switch (comprFunc) { case DEFLATE_STORED: progress = DeflateStored(canFlush, finish); break; case DEFLATE_FAST: progress = DeflateFast(canFlush, finish); break; case DEFLATE_SLOW: progress = DeflateSlow(canFlush, finish); break; default: throw new InvalidOperationException("unknown comprFunc"); } } while (pending.IsFlushed && progress); /* repeat while we have no pending output and progress was made */ return progress; } /// /// Sets input data to be deflated. Should only be called when NeedsInput() /// returns true /// /// The buffer containing input data. /// The index of the first byte of data. /// The number of bytes of data to use as input. public void SetInput(byte[] buf, int off, int len) { if (inputOff < inputEnd) { throw new InvalidOperationException("Old input was not completely processed"); } int end = off + len; /* We want to throw an ArrayIndexOutOfBoundsException early. The * check is very tricky: it also handles integer wrap around. */ if (0 > off || off > end || end > buf.Length) { throw new ArgumentOutOfRangeException(); } inputBuf = buf; inputOff = off; inputEnd = end; } /// /// Return true if input is needed via SetInput /// public bool NeedsInput() { return inputEnd == inputOff; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/InflaterDynHeader.cs0000644000175000017500000001366312204443225026000 0ustar00meebeymeebey00000000000000// InflaterDynHeader.cs // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; using agsXMPP.IO.Compression.Streams; namespace agsXMPP.IO.Compression { class InflaterDynHeader { const int LNUM = 0; const int DNUM = 1; const int BLNUM = 2; const int BLLENS = 3; const int LENS = 4; const int REPS = 5; static readonly int[] repMin = { 3, 3, 11 }; static readonly int[] repBits = { 2, 3, 7 }; byte[] blLens; byte[] litdistLens; InflaterHuffmanTree blTree; int mode; int lnum, dnum, blnum, num; int repSymbol; byte lastLen; int ptr; static readonly int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; public InflaterDynHeader() { } public bool Decode(StreamManipulator input) { decode_loop: for (;;) { switch (mode) { case LNUM: lnum = input.PeekBits(5); if (lnum < 0) { return false; } lnum += 257; input.DropBits(5); // System.err.println("LNUM: "+lnum); mode = DNUM; goto case DNUM; // fall through case DNUM: dnum = input.PeekBits(5); if (dnum < 0) { return false; } dnum++; input.DropBits(5); // System.err.println("DNUM: "+dnum); num = lnum+dnum; litdistLens = new byte[num]; mode = BLNUM; goto case BLNUM; // fall through case BLNUM: blnum = input.PeekBits(4); if (blnum < 0) { return false; } blnum += 4; input.DropBits(4); blLens = new byte[19]; ptr = 0; // System.err.println("BLNUM: "+blnum); mode = BLLENS; goto case BLLENS; // fall through case BLLENS: while (ptr < blnum) { int len = input.PeekBits(3); if (len < 0) { return false; } input.DropBits(3); // System.err.println("blLens["+BL_ORDER[ptr]+"]: "+len); blLens[BL_ORDER[ptr]] = (byte) len; ptr++; } blTree = new InflaterHuffmanTree(blLens); blLens = null; ptr = 0; mode = LENS; goto case LENS; // fall through case LENS: { int symbol; while (((symbol = blTree.GetSymbol(input)) & ~15) == 0) { /* Normal case: symbol in [0..15] */ // System.err.println("litdistLens["+ptr+"]: "+symbol); litdistLens[ptr++] = lastLen = (byte)symbol; if (ptr == num) { /* Finished */ return true; } } /* need more input ? */ if (symbol < 0) { return false; } /* otherwise repeat code */ if (symbol >= 17) { /* repeat zero */ // System.err.println("repeating zero"); lastLen = 0; } else { if (ptr == 0) { throw new SharpZipBaseException(); } } repSymbol = symbol-16; } mode = REPS; goto case REPS; // fall through case REPS: { int bits = repBits[repSymbol]; int count = input.PeekBits(bits); if (count < 0) { return false; } input.DropBits(bits); count += repMin[repSymbol]; // System.err.println("litdistLens repeated: "+count); if (ptr + count > num) { throw new SharpZipBaseException(); } while (count-- > 0) { litdistLens[ptr++] = lastLen; } if (ptr == num) { /* Finished */ return true; } } mode = LENS; goto decode_loop; } } } public InflaterHuffmanTree BuildLitLenTree() { byte[] litlenLens = new byte[lnum]; Array.Copy(litdistLens, 0, litlenLens, 0, lnum); return new InflaterHuffmanTree(litlenLens); } public InflaterHuffmanTree BuildDistTree() { byte[] distLens = new byte[dnum]; Array.Copy(litdistLens, lnum, distLens, 0, dnum); return new InflaterHuffmanTree(distLens); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/PendingBuffer.cs0000644000175000017500000001671312204443225025165 0ustar00meebeymeebey00000000000000// PendingBuffer.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace agsXMPP.IO.Compression { /// /// This class is general purpose class for writing data to a buffer. /// /// It allows you to write bits as well as bytes /// Based on DeflaterPending.java /// /// author of the original java version : Jochen Hoenicke /// public class PendingBuffer { /// Internal work buffer /// protected byte[] buf; int start; int end; uint bits; int bitCount; /// /// construct instance using default buffer size of 4096 /// public PendingBuffer() : this( 4096 ) { } /// /// construct instance using specified buffer size /// /// /// size to use for internal buffer /// public PendingBuffer(int bufsize) { buf = new byte[bufsize]; } /// /// Clear internal state/buffers /// public void Reset() { start = end = bitCount = 0; } /// /// write a byte to buffer /// /// /// value to write /// public void WriteByte(int b) { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } buf[end++] = (byte) b; } /// /// Write a short value to buffer LSB first /// /// /// value to write /// public void WriteShort(int s) { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } buf[end++] = (byte) s; buf[end++] = (byte) (s >> 8); } /// /// write an integer LSB first /// /// value to write public void WriteInt(int s) { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } buf[end++] = (byte) s; buf[end++] = (byte) (s >> 8); buf[end++] = (byte) (s >> 16); buf[end++] = (byte) (s >> 24); } /// /// Write a block of data to buffer /// /// data to write /// offset of first byte to write /// number of bytes to write public void WriteBlock(byte[] block, int offset, int len) { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } System.Array.Copy(block, offset, buf, end, len); end += len; } /// /// The number of bits written to the buffer /// public int BitCount { get { return bitCount; } } /// /// Align internal buffer on a byte boundary /// public void AlignToByte() { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } if (bitCount > 0) { buf[end++] = (byte) bits; if (bitCount > 8) { buf[end++] = (byte) (bits >> 8); } } bits = 0; bitCount = 0; } /// /// Write bits to internal buffer /// /// source of bits /// number of bits to write public void WriteBits(int b, int count) { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("writeBits("+b+","+count+")"); // } bits |= (uint)(b << bitCount); bitCount += count; if (bitCount >= 16) { buf[end++] = (byte) bits; buf[end++] = (byte) (bits >> 8); bits >>= 16; bitCount -= 16; } } /// /// Write a short value to internal buffer most significant byte first /// /// value to write public void WriteShortMSB(int s) { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } buf[end++] = (byte) (s >> 8); buf[end++] = (byte) s; } /// /// Indicates if buffer has been flushed /// public bool IsFlushed { get { return end == 0; } } /// /// Flushes the pending buffer into the given output array. If the /// output array is to small, only a partial flush is done. /// /// /// the output array; /// /// /// the offset into output array; /// /// /// length the maximum number of bytes to store; /// /// /// IndexOutOfBoundsException if offset or length are invalid. /// public int Flush(byte[] output, int offset, int length) { if (bitCount >= 8) { buf[end++] = (byte) bits; bits >>= 8; bitCount -= 8; } if (length > end - start) { length = end - start; System.Array.Copy(buf, start, output, offset, length); start = 0; end = 0; } else { System.Array.Copy(buf, start, output, offset, length); start += length; } return length; } /// /// Convert internal buffer to byte array. /// Buffer is empty on completion /// /// /// converted buffer contents contents /// public byte[] ToByteArray() { byte[] ret = new byte[end - start]; System.Array.Copy(buf, start, ret, 0, ret.Length); start = 0; end = 0; return ret; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/Checksums/0000755000175000017500000000000012204443225024035 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/Checksums/IChecksum.cs0000644000175000017500000000666712204443225026256 0ustar00meebeymeebey00000000000000// IChecksum.cs - Interface to compute a data checksum // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. namespace agsXMPP.IO.Compression.Checksums { /// /// Interface to compute a data checksum used by checked input/output streams. /// A data checksum can be updated by one byte or with a byte array. After each /// update the value of the current checksum can be returned by calling /// getValue. The complete checksum object can also be reset /// so it can be used again with new data. /// public interface IChecksum { /// /// Returns the data checksum computed so far. /// long Value { get; } /// /// Resets the data checksum as if no update was ever called. /// void Reset(); /// /// Adds one byte to the data checksum. /// /// /// the data value to add. The high byte of the int is ignored. /// void Update(int bval); /// /// Updates the data checksum with the bytes taken from the array. /// /// /// buffer an array of bytes /// void Update(byte[] buffer); /// /// Adds the byte array to the data checksum. /// /// /// the buffer which contains the data /// /// /// the offset in the buffer where the data starts /// /// /// the length of the data /// void Update(byte[] buf, int off, int len); } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/Checksums/Adler32.cs0000644000175000017500000001546512204443225025573 0ustar00meebeymeebey00000000000000// Adler32.cs - Computes Adler32 data checksum of a data stream // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace agsXMPP.IO.Compression.Checksums { /// /// Computes Adler32 checksum for a stream of data. An Adler32 /// checksum is not as reliable as a CRC32 checksum, but a lot faster to /// compute. /// /// The specification for Adler32 may be found in RFC 1950. /// ZLIB Compressed Data Format Specification version 3.3) /// /// /// From that document: /// /// "ADLER32 (Adler-32 checksum) /// This contains a checksum value of the uncompressed data /// (excluding any dictionary data) computed according to Adler-32 /// algorithm. This algorithm is a 32-bit extension and improvement /// of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 /// standard. /// /// Adler-32 is composed of two sums accumulated per byte: s1 is /// the sum of all bytes, s2 is the sum of all s1 values. Both sums /// are done modulo 65521. s1 is initialized to 1, s2 to zero. The /// Adler-32 checksum is stored as s2*65536 + s1 in most- /// significant-byte first (network) order." /// /// "8.2. The Adler-32 algorithm /// /// The Adler-32 algorithm is much faster than the CRC32 algorithm yet /// still provides an extremely low probability of undetected errors. /// /// The modulo on unsigned long accumulators can be delayed for 5552 /// bytes, so the modulo operation time is negligible. If the bytes /// are a, b, c, the second sum is 3a + 2b + c + 3, and so is position /// and order sensitive, unlike the first sum, which is just a /// checksum. That 65521 is prime is important to avoid a possible /// large class of two-byte errors that leave the check unchanged. /// (The Fletcher checksum uses 255, which is not prime and which also /// makes the Fletcher check insensitive to single byte changes 0 - /// 255.) /// /// The sum s1 is initialized to 1 instead of zero to make the length /// of the sequence part of s2, so that the length does not have to be /// checked separately. (Any sequence of zeroes has a Fletcher /// checksum of zero.)" /// /// /// public sealed class Adler32 : IChecksum { /// /// largest prime smaller than 65536 /// readonly static uint BASE = 65521; uint checksum; /// /// Returns the Adler32 data checksum computed so far. /// public long Value { get { return checksum; } } /// /// Creates a new instance of the Adler32 class. /// The checksum starts off with a value of 1. /// public Adler32() { Reset(); } /// /// Resets the Adler32 checksum to the initial value. /// public void Reset() { checksum = 1; } /// /// Updates the checksum with the byte b. /// /// /// The data value to add. The high byte of the int is ignored. /// public void Update(int bval) { // We could make a length 1 byte array and call update again, but I // would rather not have that overhead uint s1 = checksum & 0xFFFF; uint s2 = checksum >> 16; s1 = (s1 + ((uint)bval & 0xFF)) % BASE; s2 = (s1 + s2) % BASE; checksum = (s2 << 16) + s1; } /// /// Updates the checksum with an array of bytes. /// /// /// The source of the data to update with. /// public void Update(byte[] buffer) { Update(buffer, 0, buffer.Length); } /// /// Updates the checksum with the bytes taken from the array. /// /// /// an array of bytes /// /// /// the start of the data used for this update /// /// /// the number of bytes to use for this update /// public void Update(byte[] buf, int off, int len) { if (buf == null) { throw new ArgumentNullException("buf"); } if (off < 0 || len < 0 || off + len > buf.Length) { throw new ArgumentOutOfRangeException(); } //(By Per Bothner) uint s1 = checksum & 0xFFFF; uint s2 = checksum >> 16; while (len > 0) { // We can defer the modulo operation: // s1 maximally grows from 65521 to 65521 + 255 * 3800 // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31 int n = 3800; if (n > len) { n = len; } len -= n; while (--n >= 0) { s1 = s1 + (uint)(buf[off++] & 0xFF); s2 = s2 + s1; } s1 %= BASE; s2 %= BASE; } checksum = (s2 << 16) | s1; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/DeflaterPending.cs0000644000175000017500000000451312204443225025475 0ustar00meebeymeebey00000000000000// DeflaterPending.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. namespace agsXMPP.IO.Compression { /// /// This class stores the pending output of the Deflater. /// /// author of the original java version : Jochen Hoenicke /// public class DeflaterPending : PendingBuffer { /// /// Construct instance with default buffer size /// public DeflaterPending() : base(DeflaterConstants.PENDING_BUF_SIZE) { } } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/Deflater.cs0000644000175000017500000004315512204443225024175 0ustar00meebeymeebey00000000000000// Deflater.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace agsXMPP.IO.Compression { /// /// This is the Deflater class. The deflater class compresses input /// with the deflate algorithm described in RFC 1951. It has several /// compression levels and three different strategies described below. /// /// This class is not thread safe. This is inherent in the API, due /// to the split of deflate and setInput. /// /// author of the original java version : Jochen Hoenicke /// public class Deflater { /// /// The best and slowest compression level. This tries to find very /// long and distant string repetitions. /// public static int BEST_COMPRESSION = 9; /// /// The worst but fastest compression level. /// public static int BEST_SPEED = 1; /// /// The default compression level. /// public static int DEFAULT_COMPRESSION = -1; /// /// This level won't compress at all but output uncompressed blocks. /// public static int NO_COMPRESSION = 0; /// /// The compression method. This is the only method supported so far. /// There is no need to use this constant at all. /// public static int DEFLATED = 8; /* * The Deflater can do the following state transitions: * * (1) -> INIT_STATE ----> INIT_FINISHING_STATE ---. * / | (2) (5) | * / v (5) | * (3)| SETDICT_STATE ---> SETDICT_FINISHING_STATE |(3) * \ | (3) | ,-------' * | | | (3) / * v v (5) v v * (1) -> BUSY_STATE ----> FINISHING_STATE * | (6) * v * FINISHED_STATE * \_____________________________________/ * | (7) * v * CLOSED_STATE * * (1) If we should produce a header we start in INIT_STATE, otherwise * we start in BUSY_STATE. * (2) A dictionary may be set only when we are in INIT_STATE, then * we change the state as indicated. * (3) Whether a dictionary is set or not, on the first call of deflate * we change to BUSY_STATE. * (4) -- intentionally left blank -- :) * (5) FINISHING_STATE is entered, when flush() is called to indicate that * there is no more INPUT. There are also states indicating, that * the header wasn't written yet. * (6) FINISHED_STATE is entered, when everything has been flushed to the * internal pending output buffer. * (7) At any time (7) * */ private static int IS_SETDICT = 0x01; private static int IS_FLUSHING = 0x04; private static int IS_FINISHING = 0x08; private static int INIT_STATE = 0x00; private static int SETDICT_STATE = 0x01; // private static int INIT_FINISHING_STATE = 0x08; // private static int SETDICT_FINISHING_STATE = 0x09; private static int BUSY_STATE = 0x10; private static int FLUSHING_STATE = 0x14; private static int FINISHING_STATE = 0x1c; private static int FINISHED_STATE = 0x1e; private static int CLOSED_STATE = 0x7f; /// /// Compression level. /// private int level; /// /// If true no Zlib/RFC1950 headers or footers are generated /// private bool noZlibHeaderOrFooter; /// /// The current state. /// private int state; /// /// The total bytes of output written. /// private long totalOut; /// /// The pending output. /// private DeflaterPending pending; /// /// The deflater engine. /// private DeflaterEngine engine; /// /// Creates a new deflater with default compression level. /// public Deflater() : this(DEFAULT_COMPRESSION, false) { } /// /// Creates a new deflater with given compression level. /// /// /// the compression level, a value between NO_COMPRESSION /// and BEST_COMPRESSION, or DEFAULT_COMPRESSION. /// /// if lvl is out of range. public Deflater(int lvl) : this(lvl, false) { } /// /// Creates a new deflater with given compression level. /// /// /// the compression level, a value between NO_COMPRESSION /// and BEST_COMPRESSION. /// /// /// true, if we should suppress the Zlib/RFC1950 header at the /// beginning and the adler checksum at the end of the output. This is /// useful for the GZIP/PKZIP formats. /// /// if lvl is out of range. public Deflater(int level, bool noZlibHeaderOrFooter) { if (level == DEFAULT_COMPRESSION) { level = 6; } else if (level < NO_COMPRESSION || level > BEST_COMPRESSION) { throw new ArgumentOutOfRangeException("level"); } pending = new DeflaterPending(); engine = new DeflaterEngine(pending); this.noZlibHeaderOrFooter = noZlibHeaderOrFooter; SetStrategy(DeflateStrategy.Default); SetLevel(level); Reset(); } /// /// Resets the deflater. The deflater acts afterwards as if it was /// just created with the same compression level and strategy as it /// had before. /// public void Reset() { state = (noZlibHeaderOrFooter ? BUSY_STATE : INIT_STATE); totalOut = 0; pending.Reset(); engine.Reset(); } /// /// Gets the current adler checksum of the data that was processed so far. /// public int Adler { get { return engine.Adler; } } /// /// Gets the number of input bytes processed so far. /// public int TotalIn { get { return engine.TotalIn; } } /// /// Gets the number of output bytes so far. /// public long TotalOut { get { return totalOut; } } /// /// Flushes the current input block. Further calls to deflate() will /// produce enough output to inflate everything in the current input /// block. This is not part of Sun's JDK so I have made it package /// private. It is used by DeflaterOutputStream to implement /// flush(). /// public void Flush() { state |= IS_FLUSHING; } /// /// Finishes the deflater with the current input block. It is an error /// to give more input after this method was called. This method must /// be called to force all bytes to be flushed. /// public void Finish() { state |= IS_FLUSHING | IS_FINISHING; } /// /// Returns true if the stream was finished and no more output bytes /// are available. /// public bool IsFinished { get { return state == FINISHED_STATE && pending.IsFlushed; } } /// /// Returns true, if the input buffer is empty. /// You should then call setInput(). /// NOTE: This method can also return true when the stream /// was finished. /// public bool IsNeedingInput { get { return engine.NeedsInput(); } } /// /// Sets the data which should be compressed next. This should be only /// called when needsInput indicates that more input is needed. /// If you call setInput when needsInput() returns false, the /// previous input that is still pending will be thrown away. /// The given byte array should not be changed, before needsInput() returns /// true again. /// This call is equivalent to setInput(input, 0, input.length). /// /// /// the buffer containing the input data. /// /// /// if the buffer was finished() or ended(). /// public void SetInput(byte[] input) { SetInput(input, 0, input.Length); } /// /// Sets the data which should be compressed next. This should be /// only called when needsInput indicates that more input is needed. /// The given byte array should not be changed, before needsInput() returns /// true again. /// /// /// the buffer containing the input data. /// /// /// the start of the data. /// /// /// the length of the data. /// /// /// if the buffer was finished() or ended() or if previous input is still pending. /// public void SetInput(byte[] input, int off, int len) { if ((state & IS_FINISHING) != 0) { throw new InvalidOperationException("finish()/end() already called"); } engine.SetInput(input, off, len); } /// /// Sets the compression level. There is no guarantee of the exact /// position of the change, but if you call this when needsInput is /// true the change of compression level will occur somewhere near /// before the end of the so far given input. /// /// /// the new compression level. /// public void SetLevel(int lvl) { if (lvl == DEFAULT_COMPRESSION) { lvl = 6; } else if (lvl < NO_COMPRESSION || lvl > BEST_COMPRESSION) { throw new ArgumentOutOfRangeException("lvl"); } if (level != lvl) { level = lvl; engine.SetLevel(lvl); } } /// /// Get current compression level /// /// Returns the current compression level public int GetLevel() { return level; } /// /// Sets the compression strategy. Strategy is one of /// DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED. For the exact /// position where the strategy is changed, the same as for /// setLevel() applies. /// /// /// The new compression strategy. /// public void SetStrategy(DeflateStrategy strategy) { engine.Strategy = strategy; } /// /// Deflates the current input block with to the given array. /// /// /// The buffer where compressed data is stored /// /// /// The number of compressed bytes added to the output, or 0 if either /// needsInput() or finished() returns true or length is zero. /// public int Deflate(byte[] output) { return Deflate(output, 0, output.Length); } /// /// Deflates the current input block to the given array. /// /// /// Buffer to store the compressed data. /// /// /// Offset into the output array. /// /// /// The maximum number of bytes that may be stored. /// /// /// The number of compressed bytes added to the output, or 0 if either /// needsInput() or finished() returns true or length is zero. /// /// /// If end() was previously called. /// /// /// If offset and/or length don't match the array length. /// public int Deflate(byte[] output, int offset, int length) { int origLength = length; if (state == CLOSED_STATE) { throw new InvalidOperationException("Deflater closed"); } if (state < BUSY_STATE) { /* output header */ int header = (DEFLATED + ((DeflaterConstants.MAX_WBITS - 8) << 4)) << 8; int level_flags = (level - 1) >> 1; if (level_flags < 0 || level_flags > 3) { level_flags = 3; } header |= level_flags << 6; if ((state & IS_SETDICT) != 0) { /* Dictionary was set */ header |= DeflaterConstants.PRESET_DICT; } header += 31 - (header % 31); pending.WriteShortMSB(header); if ((state & IS_SETDICT) != 0) { int chksum = engine.Adler; engine.ResetAdler(); pending.WriteShortMSB(chksum >> 16); pending.WriteShortMSB(chksum & 0xffff); } state = BUSY_STATE | (state & (IS_FLUSHING | IS_FINISHING)); } for (;;) { int count = pending.Flush(output, offset, length); offset += count; totalOut += count; length -= count; if (length == 0 || state == FINISHED_STATE) { break; } if (!engine.Deflate((state & IS_FLUSHING) != 0, (state & IS_FINISHING) != 0)) { if (state == BUSY_STATE) { /* We need more input now */ return origLength - length; } else if (state == FLUSHING_STATE) { if (level != NO_COMPRESSION) { /* We have to supply some lookahead. 8 bit lookahead * is needed by the zlib inflater, and we must fill * the next byte, so that all bits are flushed. */ int neededbits = 8 + ((-pending.BitCount) & 7); while (neededbits > 0) { /* write a static tree block consisting solely of * an EOF: */ pending.WriteBits(2, 10); neededbits -= 10; } } state = BUSY_STATE; } else if (state == FINISHING_STATE) { pending.AlignToByte(); // Compressed data is complete. Write footer information if required. if (!noZlibHeaderOrFooter) { int adler = engine.Adler; pending.WriteShortMSB(adler >> 16); pending.WriteShortMSB(adler & 0xffff); } state = FINISHED_STATE; } } } return origLength - length; } /// /// Sets the dictionary which should be used in the deflate process. /// This call is equivalent to setDictionary(dict, 0, dict.Length). /// /// /// the dictionary. /// /// /// if setInput () or deflate () were already called or another dictionary was already set. /// public void SetDictionary(byte[] dict) { SetDictionary(dict, 0, dict.Length); } /// /// Sets the dictionary which should be used in the deflate process. /// The dictionary is a byte array containing strings that are /// likely to occur in the data which should be compressed. The /// dictionary is not stored in the compressed output, only a /// checksum. To decompress the output you need to supply the same /// dictionary again. /// /// /// The dictionary data /// /// /// An offset into the dictionary. /// /// /// The length of the dictionary data to use /// /// /// If setInput () or deflate () were already called or another dictionary was already set. /// public void SetDictionary(byte[] dict, int offset, int length) { if (state != INIT_STATE) { throw new InvalidOperationException(); } state = SETDICT_STATE; engine.SetDictionary(dict, offset, length); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/Streams/0000755000175000017500000000000012204443225023526 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/Streams/StreamManipulator.cs0000644000175000017500000002045312204443225027530 0ustar00meebeymeebey00000000000000// StreamManipulator.cs // // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace agsXMPP.IO.Compression.Streams { /// /// This class allows us to retrieve a specified number of bits from /// the input buffer, as well as copy big byte blocks. /// /// It uses an int buffer to store up to 31 bits for direct /// manipulation. This guarantees that we can get at least 16 bits, /// but we only need at most 15, so this is all safe. /// /// There are some optimizations in this class, for example, you must /// never peek more than 8 bits more than needed, and you must first /// peek bits before you may drop them. This is not a general purpose /// class but optimized for the behaviour of the Inflater. /// /// authors of the original java version : John Leuner, Jochen Hoenicke /// public class StreamManipulator { private byte[] window; private int window_start = 0; private int window_end = 0; private uint buffer = 0; private int bits_in_buffer = 0; /// /// Get the next n bits but don't increase input pointer. n must be /// less or equal 16 and if this call succeeds, you must drop /// at least n - 8 bits in the next call. /// /// /// the value of the bits, or -1 if not enough bits available. */ /// public int PeekBits(int n) { if (bits_in_buffer < n) { if (window_start == window_end) { return -1; // ok } buffer |= (uint)((window[window_start++] & 0xff | (window[window_start++] & 0xff) << 8) << bits_in_buffer); bits_in_buffer += 16; } return (int)(buffer & ((1 << n) - 1)); } /// /// Drops the next n bits from the input. You should have called PeekBits /// with a bigger or equal n before, to make sure that enough bits are in /// the bit buffer. /// public void DropBits(int n) { buffer >>= n; bits_in_buffer -= n; } /// /// Gets the next n bits and increases input pointer. This is equivalent /// to PeekBits followed by dropBits, except for correct error handling. /// /// /// the value of the bits, or -1 if not enough bits available. /// public int GetBits(int n) { int bits = PeekBits(n); if (bits >= 0) { DropBits(n); } return bits; } /// /// Gets the number of bits available in the bit buffer. This must be /// only called when a previous PeekBits() returned -1. /// /// /// the number of bits available. /// public int AvailableBits { get { return bits_in_buffer; } } /// /// Gets the number of bytes available. /// /// /// The number of bytes available. /// public int AvailableBytes { get { return window_end - window_start + (bits_in_buffer >> 3); } } /// /// Skips to the next byte boundary. /// public void SkipToByteBoundary() { buffer >>= (bits_in_buffer & 7); bits_in_buffer &= ~7; } /// /// Returns true when SetInput can be called /// public bool IsNeedingInput { get { return window_start == window_end; } } /// /// Copies length bytes from input buffer to output buffer starting /// at output[offset]. You have to make sure, that the buffer is /// byte aligned. If not enough bytes are available, copies fewer /// bytes. /// /// /// The buffer to copy bytes to. /// /// /// The offset in the buffer at which copying starts /// /// /// The length to copy, 0 is allowed. /// /// /// The number of bytes copied, 0 if no bytes were available. /// /// /// Length is less than zero /// /// /// Bit buffer isnt byte aligned /// public int CopyBytes(byte[] output, int offset, int length) { if (length < 0) { throw new ArgumentOutOfRangeException("length"); } if ((bits_in_buffer & 7) != 0) { /* bits_in_buffer may only be 0 or a multiple of 8 */ throw new InvalidOperationException("Bit buffer is not byte aligned!"); } int count = 0; while (bits_in_buffer > 0 && length > 0) { output[offset++] = (byte) buffer; buffer >>= 8; bits_in_buffer -= 8; length--; count++; } if (length == 0) { return count; } int avail = window_end - window_start; if (length > avail) { length = avail; } System.Array.Copy(window, window_start, output, offset, length); window_start += length; if (((window_start - window_end) & 1) != 0) { /* We always want an even number of bytes in input, see peekBits */ buffer = (uint)(window[window_start++] & 0xff); bits_in_buffer = 8; } return count + length; } /// /// Constructs a default StreamManipulator with all buffers empty /// public StreamManipulator() { } /// /// resets state and empties internal buffers /// public void Reset() { buffer = (uint)(window_start = window_end = bits_in_buffer = 0); } /// /// Add more input for consumption. /// Only call when IsNeedingInput returns true /// /// data to be input /// offset of first byte of input /// length of input public void SetInput(byte[] buf, int off, int len) { if (window_start < window_end) { throw new InvalidOperationException("Old input was not completely processed"); } int end = off + len; /* We want to throw an ArrayIndexOutOfBoundsException early. The * check is very tricky: it also handles integer wrap around. */ if (0 > off || off > end || end > buf.Length) { throw new ArgumentOutOfRangeException(); } if ((len & 1) != 0) { /* We always want an even number of bytes in input, see peekBits */ buffer |= (uint)((buf[off++] & 0xff) << bits_in_buffer); bits_in_buffer += 8; } window = buf; window_start = off; window_end = end; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/Streams/OutputWindow.cs0000644000175000017500000001631712204443225026555 0ustar00meebeymeebey00000000000000// OutputWindow.cs // // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace agsXMPP.IO.Compression.Streams { /// /// Contains the output from the Inflation process. /// We need to have a window so that we can refer backwards into the output stream /// to repeat stuff.
/// Author of the original java version : John Leuner ///
public class OutputWindow { private static int WINDOW_SIZE = 1 << 15; private static int WINDOW_MASK = WINDOW_SIZE - 1; private byte[] window = new byte[WINDOW_SIZE]; //The window is 2^15 bytes private int windowEnd = 0; private int windowFilled = 0; /// /// Write a byte to this output window /// /// value to write /// /// if window is full /// public void Write(int abyte) { if (windowFilled++ == WINDOW_SIZE) { throw new InvalidOperationException("Window full"); } window[windowEnd++] = (byte) abyte; windowEnd &= WINDOW_MASK; } private void SlowRepeat(int repStart, int len, int dist) { while (len-- > 0) { window[windowEnd++] = window[repStart++]; windowEnd &= WINDOW_MASK; repStart &= WINDOW_MASK; } } /// /// Append a byte pattern already in the window itself /// /// length of pattern to copy /// distance from end of window pattern occurs /// /// If the repeated data overflows the window /// public void Repeat(int len, int dist) { if ((windowFilled += len) > WINDOW_SIZE) { throw new InvalidOperationException("Window full"); } int rep_start = (windowEnd - dist) & WINDOW_MASK; int border = WINDOW_SIZE - len; if (rep_start <= border && windowEnd < border) { if (len <= dist) { System.Array.Copy(window, rep_start, window, windowEnd, len); windowEnd += len; } else { /* We have to copy manually, since the repeat pattern overlaps. */ while (len-- > 0) { window[windowEnd++] = window[rep_start++]; } } } else { SlowRepeat(rep_start, len, dist); } } /// /// Copy from input manipulator to internal window /// /// source of data /// length of data to copy /// the number of bytes copied public int CopyStored(StreamManipulator input, int len) { len = Math.Min(Math.Min(len, WINDOW_SIZE - windowFilled), input.AvailableBytes); int copied; int tailLen = WINDOW_SIZE - windowEnd; if (len > tailLen) { copied = input.CopyBytes(window, windowEnd, tailLen); if (copied == tailLen) { copied += input.CopyBytes(window, 0, len - tailLen); } } else { copied = input.CopyBytes(window, windowEnd, len); } windowEnd = (windowEnd + copied) & WINDOW_MASK; windowFilled += copied; return copied; } /// /// Copy dictionary to window /// /// source dictionary /// offset of start in source dictionary /// length of dictionary /// /// If window isnt empty /// public void CopyDict(byte[] dict, int offset, int len) { if (windowFilled > 0) { throw new InvalidOperationException(); } if (len > WINDOW_SIZE) { offset += len - WINDOW_SIZE; len = WINDOW_SIZE; } System.Array.Copy(dict, offset, window, 0, len); windowEnd = len & WINDOW_MASK; } /// /// Get remaining unfilled space in window /// /// Number of bytes left in window public int GetFreeSpace() { return WINDOW_SIZE - windowFilled; } /// /// Get bytes available for output in window /// /// Number of bytes filled public int GetAvailable() { return windowFilled; } /// /// Copy contents of window to output /// /// buffer to copy to /// offset to start at /// number of bytes to count /// The number of bytes copied /// /// If a window underflow occurs /// public int CopyOutput(byte[] output, int offset, int len) { int copy_end = windowEnd; if (len > windowFilled) { len = windowFilled; } else { copy_end = (windowEnd - windowFilled + len) & WINDOW_MASK; } int copied = len; int tailLen = len - copy_end; if (tailLen > 0) { System.Array.Copy(window, WINDOW_SIZE - tailLen, output, offset, tailLen); offset += tailLen; len = copy_end; } System.Array.Copy(window, copy_end - len, output, offset, len); windowFilled -= copied; if (windowFilled < 0) { throw new InvalidOperationException(); } return copied; } /// /// Reset by clearing window so GetAvailable returns 0 /// public void Reset() { windowFilled = windowEnd = 0; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/DeflaterConstants.cs0000644000175000017500000001344212204443225026066 0ustar00meebeymeebey00000000000000// DeflaterConstants.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace agsXMPP.IO.Compression { /// /// This class contains constants used for deflation. /// public class DeflaterConstants { /// /// Set to true to enable debugging /// public const bool DEBUGGING = false; /// /// Written to Zip file to identify a stored block /// public const int STORED_BLOCK = 0; /// /// Identifies static tree in Zip file /// public const int STATIC_TREES = 1; /// /// Identifies dynamic tree in Zip file /// public const int DYN_TREES = 2; /// /// Header flag indicating a preset dictionary for deflation /// public const int PRESET_DICT = 0x20; /// /// Sets internal buffer sizes for Huffman encoding /// public const int DEFAULT_MEM_LEVEL = 8; /// /// Internal compression engine constant /// public const int MAX_MATCH = 258; /// /// Internal compression engine constant /// public const int MIN_MATCH = 3; /// /// Internal compression engine constant /// public const int MAX_WBITS = 15; /// /// Internal compression engine constant /// public const int WSIZE = 1 << MAX_WBITS; /// /// Internal compression engine constant /// public const int WMASK = WSIZE - 1; /// /// Internal compression engine constant /// public const int HASH_BITS = DEFAULT_MEM_LEVEL + 7; /// /// Internal compression engine constant /// public const int HASH_SIZE = 1 << HASH_BITS; /// /// Internal compression engine constant /// public const int HASH_MASK = HASH_SIZE - 1; /// /// Internal compression engine constant /// public const int HASH_SHIFT = (HASH_BITS + MIN_MATCH - 1) / MIN_MATCH; /// /// Internal compression engine constant /// public const int MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; /// /// Internal compression engine constant /// public const int MAX_DIST = WSIZE - MIN_LOOKAHEAD; /// /// Internal compression engine constant /// public const int PENDING_BUF_SIZE = 1 << (DEFAULT_MEM_LEVEL + 8); /// /// Internal compression engine constant /// public static int MAX_BLOCK_SIZE = Math.Min(65535, PENDING_BUF_SIZE - 5); /// /// Internal compression engine constant /// public const int DEFLATE_STORED = 0; /// /// Internal compression engine constant /// public const int DEFLATE_FAST = 1; /// /// Internal compression engine constant /// public const int DEFLATE_SLOW = 2; /// /// Internal compression engine constant /// public static int[] GOOD_LENGTH = { 0, 4, 4, 4, 4, 8, 8, 8, 32, 32 }; /// /// Internal compression engine constant /// public static int[] MAX_LAZY = { 0, 4, 5, 6, 4, 16, 16, 32, 128, 258 }; /// /// Internal compression engine constant /// public static int[] NICE_LENGTH = { 0, 8, 16, 32, 16, 32, 128, 128, 258, 258 }; /// /// Internal compression engine constant /// public static int[] MAX_CHAIN = { 0, 4, 8, 32, 16, 32, 128, 256, 1024, 4096 }; /// /// Internal compression engine constant /// public static int[] COMPR_FUNC = { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2 }; } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/SharpZipBaseException.cs0000644000175000017500000000575312204443225026663 0ustar00meebeymeebey00000000000000// SharpZipBaseException.cs // // Copyright 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace agsXMPP.IO.Compression { /// /// SharpZipBaseException is the base exception class for the SharpZipLibrary. /// All library exceptions are derived from this. /// public class SharpZipBaseException : ApplicationException { /// /// Initializes a new instance of the SharpZipLibraryException class. /// public SharpZipBaseException() { } /// /// Initializes a new instance of the SharpZipLibraryException class with a specified error message. /// public SharpZipBaseException(string msg) : base(msg) { } /// /// Initializes a new instance of the SharpZipLibraryException class with a specified /// error message and a reference to the inner exception that is the cause of this exception. /// /// Error message string /// The inner exception public SharpZipBaseException(string message, Exception innerException) : base(message, innerException) { } } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/InflaterHuffmanTree.cs0000644000175000017500000001524012204443225026332 0ustar00meebeymeebey00000000000000// InflaterHuffmanTree.cs // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; using agsXMPP.IO.Compression.Streams; namespace agsXMPP.IO.Compression { /// /// Huffman tree used for inflation /// public class InflaterHuffmanTree { static int MAX_BITLEN = 15; short[] tree; /// /// Literal length tree /// public static InflaterHuffmanTree defLitLenTree; /// /// Distance tree /// public static InflaterHuffmanTree defDistTree; static InflaterHuffmanTree() { try { byte[] codeLengths = new byte[288]; int i = 0; while (i < 144) { codeLengths[i++] = 8; } while (i < 256) { codeLengths[i++] = 9; } while (i < 280) { codeLengths[i++] = 7; } while (i < 288) { codeLengths[i++] = 8; } defLitLenTree = new InflaterHuffmanTree(codeLengths); codeLengths = new byte[32]; i = 0; while (i < 32) { codeLengths[i++] = 5; } defDistTree = new InflaterHuffmanTree(codeLengths); } catch (Exception) { throw new SharpZipBaseException("InflaterHuffmanTree: static tree length illegal"); } } /// /// Constructs a Huffman tree from the array of code lengths. /// /// /// the array of code lengths /// public InflaterHuffmanTree(byte[] codeLengths) { BuildTree(codeLengths); } void BuildTree(byte[] codeLengths) { int[] blCount = new int[MAX_BITLEN + 1]; int[] nextCode = new int[MAX_BITLEN + 1]; for (int i = 0; i < codeLengths.Length; i++) { int bits = codeLengths[i]; if (bits > 0) { blCount[bits]++; } } int code = 0; int treeSize = 512; for (int bits = 1; bits <= MAX_BITLEN; bits++) { nextCode[bits] = code; code += blCount[bits] << (16 - bits); if (bits >= 10) { /* We need an extra table for bit lengths >= 10. */ int start = nextCode[bits] & 0x1ff80; int end = code & 0x1ff80; treeSize += (end - start) >> (16 - bits); } } /* -jr comment this out! doesnt work for dynamic trees and pkzip 2.04g if (code != 65536) { throw new SharpZipBaseException("Code lengths don't add up properly."); } */ /* Now create and fill the extra tables from longest to shortest * bit len. This way the sub trees will be aligned. */ tree = new short[treeSize]; int treePtr = 512; for (int bits = MAX_BITLEN; bits >= 10; bits--) { int end = code & 0x1ff80; code -= blCount[bits] << (16 - bits); int start = code & 0x1ff80; for (int i = start; i < end; i += 1 << 7) { tree[DeflaterHuffman.BitReverse(i)] = (short) ((-treePtr << 4) | bits); treePtr += 1 << (bits-9); } } for (int i = 0; i < codeLengths.Length; i++) { int bits = codeLengths[i]; if (bits == 0) { continue; } code = nextCode[bits]; int revcode = DeflaterHuffman.BitReverse(code); if (bits <= 9) { do { tree[revcode] = (short) ((i << 4) | bits); revcode += 1 << bits; } while (revcode < 512); } else { int subTree = tree[revcode & 511]; int treeLen = 1 << (subTree & 15); subTree = -(subTree >> 4); do { tree[subTree | (revcode >> 9)] = (short) ((i << 4) | bits); revcode += 1 << bits; } while (revcode < treeLen); } nextCode[bits] = code + (1 << (16 - bits)); } } /// /// Reads the next symbol from input. The symbol is encoded using the /// huffman tree. /// /// /// input the input source. /// /// /// the next symbol, or -1 if not enough input is available. /// public int GetSymbol(StreamManipulator input) { int lookahead, symbol; if ((lookahead = input.PeekBits(9)) >= 0) { if ((symbol = tree[lookahead]) >= 0) { input.DropBits(symbol & 15); return symbol >> 4; } int subtree = -(symbol >> 4); int bitlen = symbol & 15; if ((lookahead = input.PeekBits(bitlen)) >= 0) { symbol = tree[subtree | (lookahead >> 9)]; input.DropBits(symbol & 15); return symbol >> 4; } else { int bits = input.AvailableBits; lookahead = input.PeekBits(bits); symbol = tree[subtree | (lookahead >> 9)]; if ((symbol & 15) <= bits) { input.DropBits(symbol & 15); return symbol >> 4; } else { return -1; } } } else { int bits = input.AvailableBits; lookahead = input.PeekBits(bits); symbol = tree[lookahead]; if (symbol >= 0 && (symbol & 15) <= bits) { input.DropBits(symbol & 15); return symbol >> 4; } else { return -1; } } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/DeflaterHuffman.cs0000644000175000017500000006142112204443225025476 0ustar00meebeymeebey00000000000000// DeflaterHuffman.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace agsXMPP.IO.Compression { /// /// This is the DeflaterHuffman class. /// /// This class is not thread safe. This is inherent in the API, due /// to the split of deflate and setInput. /// /// author of the original java version : Jochen Hoenicke /// public class DeflaterHuffman { static int BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6); static int LITERAL_NUM = 286; static int DIST_NUM = 30; static int BITLEN_NUM = 19; static int REP_3_6 = 16; static int REP_3_10 = 17; static int REP_11_138 = 18; static int EOF_SYMBOL = 256; static int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; static byte[] bit4Reverse = { 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 }; /// /// Not documented /// public class Tree { /// /// Not documented /// public short[] freqs; /// /// Not documented /// public byte[] length; /// /// Not documented /// public int minNumCodes; /// /// Not documented /// public int numCodes; short[] codes; int[] bl_counts; int maxLength; DeflaterHuffman dh; /// /// Not documented /// public Tree(DeflaterHuffman dh, int elems, int minCodes, int maxLength) { this.dh = dh; this.minNumCodes = minCodes; this.maxLength = maxLength; freqs = new short[elems]; bl_counts = new int[maxLength]; } /// /// Resets the internal state of the tree /// public void Reset() { for (int i = 0; i < freqs.Length; i++) { freqs[i] = 0; } codes = null; length = null; } /// /// Not documented /// public void WriteSymbol(int code) { // if (DeflaterConstants.DEBUGGING) { // freqs[code]--; // // Console.Write("writeSymbol("+freqs.length+","+code+"): "); // } dh.pending.WriteBits(codes[code] & 0xffff, length[code]); } /// /// Check that at least one frequency is non-zero /// /// /// No frequencies are non-zero /// public void CheckEmpty() { bool empty = true; for (int i = 0; i < freqs.Length; i++) { if (freqs[i] != 0) { //Console.WriteLine("freqs[" + i + "] == " + freqs[i]); empty = false; } } if (!empty) { throw new SharpZipBaseException("!Empty"); } //Console.WriteLine("checkEmpty suceeded!"); } /// /// Set static codes and length /// /// new codes /// length for new codes public void SetStaticCodes(short[] stCodes, byte[] stLength) { codes = stCodes; length = stLength; } /// /// Build dynamic codes and lengths /// public void BuildCodes() { int numSymbols = freqs.Length; int[] nextCode = new int[maxLength]; int code = 0; codes = new short[freqs.Length]; // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("buildCodes: "+freqs.Length); // } for (int bits = 0; bits < maxLength; bits++) { nextCode[bits] = code; code += bl_counts[bits] << (15 - bits); // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("bits: " + ( bits + 1) + " count: " + bl_counts[bits] // +" nextCode: "+code); // } } if (DeflaterConstants.DEBUGGING && code != 65536) { throw new SharpZipBaseException("Inconsistent bl_counts!"); } for (int i=0; i < numCodes; i++) { int bits = length[i]; if (bits > 0) { // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("codes["+i+"] = rev(" + nextCode[bits-1]+"), // +bits); // } codes[i] = BitReverse(nextCode[bits-1]); nextCode[bits-1] += 1 << (16 - bits); } } } void BuildLength(int[] childs) { this.length = new byte [freqs.Length]; int numNodes = childs.Length / 2; int numLeafs = (numNodes + 1) / 2; int overflow = 0; for (int i = 0; i < maxLength; i++) { bl_counts[i] = 0; } /* First calculate optimal bit lengths */ int[] lengths = new int[numNodes]; lengths[numNodes-1] = 0; for (int i = numNodes - 1; i >= 0; i--) { if (childs[2*i+1] != -1) { int bitLength = lengths[i] + 1; if (bitLength > maxLength) { bitLength = maxLength; overflow++; } lengths[childs[2*i]] = lengths[childs[2*i+1]] = bitLength; } else { /* A leaf node */ int bitLength = lengths[i]; bl_counts[bitLength - 1]++; this.length[childs[2*i]] = (byte) lengths[i]; } } // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("Tree "+freqs.Length+" lengths:"); // for (int i=0; i < numLeafs; i++) { // //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]] // + " len: "+length[childs[2*i]]); // } // } if (overflow == 0) { return; } int incrBitLen = maxLength - 1; do { /* Find the first bit length which could increase: */ while (bl_counts[--incrBitLen] == 0) ; /* Move this node one down and remove a corresponding * amount of overflow nodes. */ do { bl_counts[incrBitLen]--; bl_counts[++incrBitLen]++; overflow -= 1 << (maxLength - 1 - incrBitLen); } while (overflow > 0 && incrBitLen < maxLength - 1); } while (overflow > 0); /* We may have overshot above. Move some nodes from maxLength to * maxLength-1 in that case. */ bl_counts[maxLength-1] += overflow; bl_counts[maxLength-2] -= overflow; /* Now recompute all bit lengths, scanning in increasing * frequency. It is simpler to reconstruct all lengths instead of * fixing only the wrong ones. This idea is taken from 'ar' * written by Haruhiko Okumura. * * The nodes were inserted with decreasing frequency into the childs * array. */ int nodePtr = 2 * numLeafs; for (int bits = maxLength; bits != 0; bits--) { int n = bl_counts[bits-1]; while (n > 0) { int childPtr = 2*childs[nodePtr++]; if (childs[childPtr + 1] == -1) { /* We found another leaf */ length[childs[childPtr]] = (byte) bits; n--; } } } // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("*** After overflow elimination. ***"); // for (int i=0; i < numLeafs; i++) { // //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]] // + " len: "+length[childs[2*i]]); // } // } } /// /// Not documented /// public void BuildTree() { int numSymbols = freqs.Length; /* heap is a priority queue, sorted by frequency, least frequent * nodes first. The heap is a binary tree, with the property, that * the parent node is smaller than both child nodes. This assures * that the smallest node is the first parent. * * The binary tree is encoded in an array: 0 is root node and * the nodes 2*n+1, 2*n+2 are the child nodes of node n. */ int[] heap = new int[numSymbols]; int heapLen = 0; int maxCode = 0; for (int n = 0; n < numSymbols; n++) { int freq = freqs[n]; if (freq != 0) { /* Insert n into heap */ int pos = heapLen++; int ppos; while (pos > 0 && freqs[heap[ppos = (pos - 1) / 2]] > freq) { heap[pos] = heap[ppos]; pos = ppos; } heap[pos] = n; maxCode = n; } } /* We could encode a single literal with 0 bits but then we * don't see the literals. Therefore we force at least two * literals to avoid this case. We don't care about order in * this case, both literals get a 1 bit code. */ while (heapLen < 2) { int node = maxCode < 2 ? ++maxCode : 0; heap[heapLen++] = node; } numCodes = Math.Max(maxCode + 1, minNumCodes); int numLeafs = heapLen; int[] childs = new int[4*heapLen - 2]; int[] values = new int[2*heapLen - 1]; int numNodes = numLeafs; for (int i = 0; i < heapLen; i++) { int node = heap[i]; childs[2*i] = node; childs[2*i+1] = -1; values[i] = freqs[node] << 8; heap[i] = i; } /* Construct the Huffman tree by repeatedly combining the least two * frequent nodes. */ do { int first = heap[0]; int last = heap[--heapLen]; /* Propagate the hole to the leafs of the heap */ int ppos = 0; int path = 1; while (path < heapLen) { if (path + 1 < heapLen && values[heap[path]] > values[heap[path+1]]) { path++; } heap[ppos] = heap[path]; ppos = path; path = path * 2 + 1; } /* Now propagate the last element down along path. Normally * it shouldn't go too deep. */ int lastVal = values[last]; while ((path = ppos) > 0 && values[heap[ppos = (path - 1)/2]] > lastVal) { heap[path] = heap[ppos]; } heap[path] = last; int second = heap[0]; /* Create a new node father of first and second */ last = numNodes++; childs[2*last] = first; childs[2*last+1] = second; int mindepth = Math.Min(values[first] & 0xff, values[second] & 0xff); values[last] = lastVal = values[first] + values[second] - mindepth + 1; /* Again, propagate the hole to the leafs */ ppos = 0; path = 1; while (path < heapLen) { if (path + 1 < heapLen && values[heap[path]] > values[heap[path+1]]) { path++; } heap[ppos] = heap[path]; ppos = path; path = ppos * 2 + 1; } /* Now propagate the new element down along path */ while ((path = ppos) > 0 && values[heap[ppos = (path - 1)/2]] > lastVal) { heap[path] = heap[ppos]; } heap[path] = last; } while (heapLen > 1); if (heap[0] != childs.Length / 2 - 1) { throw new SharpZipBaseException("Heap invariant violated"); } BuildLength(childs); } /// /// Get encoded length /// /// Encoded length, the sum of frequencies * lengths public int GetEncodedLength() { int len = 0; for (int i = 0; i < freqs.Length; i++) { len += freqs[i] * length[i]; } return len; } /// /// Not documented /// public void CalcBLFreq(Tree blTree) { int max_count; /* max repeat count */ int min_count; /* min repeat count */ int count; /* repeat count of the current code */ int curlen = -1; /* length of current code */ int i = 0; while (i < numCodes) { count = 1; int nextlen = length[i]; if (nextlen == 0) { max_count = 138; min_count = 3; } else { max_count = 6; min_count = 3; if (curlen != nextlen) { blTree.freqs[nextlen]++; count = 0; } } curlen = nextlen; i++; while (i < numCodes && curlen == length[i]) { i++; if (++count >= max_count) { break; } } if (count < min_count) { blTree.freqs[curlen] += (short)count; } else if (curlen != 0) { blTree.freqs[REP_3_6]++; } else if (count <= 10) { blTree.freqs[REP_3_10]++; } else { blTree.freqs[REP_11_138]++; } } } /// /// Write tree values /// /// Tree to write public void WriteTree(Tree blTree) { int max_count; /* max repeat count */ int min_count; /* min repeat count */ int count; /* repeat count of the current code */ int curlen = -1; /* length of current code */ int i = 0; while (i < numCodes) { count = 1; int nextlen = length[i]; if (nextlen == 0) { max_count = 138; min_count = 3; } else { max_count = 6; min_count = 3; if (curlen != nextlen) { blTree.WriteSymbol(nextlen); count = 0; } } curlen = nextlen; i++; while (i < numCodes && curlen == length[i]) { i++; if (++count >= max_count) { break; } } if (count < min_count) { while (count-- > 0) { blTree.WriteSymbol(curlen); } } else if (curlen != 0) { blTree.WriteSymbol(REP_3_6); dh.pending.WriteBits(count - 3, 2); } else if (count <= 10) { blTree.WriteSymbol(REP_3_10); dh.pending.WriteBits(count - 3, 3); } else { blTree.WriteSymbol(REP_11_138); dh.pending.WriteBits(count - 11, 7); } } } } /// /// Pending buffer to use /// public DeflaterPending pending; Tree literalTree, distTree, blTree; short[] d_buf; byte[] l_buf; int last_lit; int extra_bits; static short[] staticLCodes; static byte[] staticLLength; static short[] staticDCodes; static byte[] staticDLength; /// /// Reverse the bits of a 16 bit value. /// /// Value to reverse bits /// Value with bits reversed public static short BitReverse(int toReverse) { return (short) (bit4Reverse[toReverse & 0xF] << 12 | bit4Reverse[(toReverse >> 4) & 0xF] << 8 | bit4Reverse[(toReverse >> 8) & 0xF] << 4 | bit4Reverse[toReverse >> 12]); } static DeflaterHuffman() { /* See RFC 1951 3.2.6 */ /* Literal codes */ staticLCodes = new short[LITERAL_NUM]; staticLLength = new byte[LITERAL_NUM]; int i = 0; while (i < 144) { staticLCodes[i] = BitReverse((0x030 + i) << 8); staticLLength[i++] = 8; } while (i < 256) { staticLCodes[i] = BitReverse((0x190 - 144 + i) << 7); staticLLength[i++] = 9; } while (i < 280) { staticLCodes[i] = BitReverse((0x000 - 256 + i) << 9); staticLLength[i++] = 7; } while (i < LITERAL_NUM) { staticLCodes[i] = BitReverse((0x0c0 - 280 + i) << 8); staticLLength[i++] = 8; } /* Distant codes */ staticDCodes = new short[DIST_NUM]; staticDLength = new byte[DIST_NUM]; for (i = 0; i < DIST_NUM; i++) { staticDCodes[i] = BitReverse(i << 11); staticDLength[i] = 5; } } /// /// Construct instance with pending buffer /// /// Pending buffer to use public DeflaterHuffman(DeflaterPending pending) { this.pending = pending; literalTree = new Tree(this, LITERAL_NUM, 257, 15); distTree = new Tree(this, DIST_NUM, 1, 15); blTree = new Tree(this, BITLEN_NUM, 4, 7); d_buf = new short[BUFSIZE]; l_buf = new byte [BUFSIZE]; } /// /// Reset internal state /// public void Reset() { last_lit = 0; extra_bits = 0; literalTree.Reset(); distTree.Reset(); blTree.Reset(); } int Lcode(int len) { if (len == 255) { return 285; } int code = 257; while (len >= 8) { code += 4; len >>= 1; } return code + len; } int Dcode(int distance) { int code = 0; while (distance >= 4) { code += 2; distance >>= 1; } return code + distance; } /// /// Write all trees to pending buffer /// public void SendAllTrees(int blTreeCodes) { blTree.BuildCodes(); literalTree.BuildCodes(); distTree.BuildCodes(); pending.WriteBits(literalTree.numCodes - 257, 5); pending.WriteBits(distTree.numCodes - 1, 5); pending.WriteBits(blTreeCodes - 4, 4); for (int rank = 0; rank < blTreeCodes; rank++) { pending.WriteBits(blTree.length[BL_ORDER[rank]], 3); } literalTree.WriteTree(blTree); distTree.WriteTree(blTree); // if (DeflaterConstants.DEBUGGING) { // blTree.CheckEmpty(); // } } /// /// Compress current buffer writing data to pending buffer /// public void CompressBlock() { for (int i = 0; i < last_lit; i++) { int litlen = l_buf[i] & 0xff; int dist = d_buf[i]; if (dist-- != 0) { // if (DeflaterConstants.DEBUGGING) { // Console.Write("["+(dist+1)+","+(litlen+3)+"]: "); // } int lc = Lcode(litlen); literalTree.WriteSymbol(lc); int bits = (lc - 261) / 4; if (bits > 0 && bits <= 5) { pending.WriteBits(litlen & ((1 << bits) - 1), bits); } int dc = Dcode(dist); distTree.WriteSymbol(dc); bits = dc / 2 - 1; if (bits > 0) { pending.WriteBits(dist & ((1 << bits) - 1), bits); } } else { // if (DeflaterConstants.DEBUGGING) { // if (litlen > 32 && litlen < 127) { // Console.Write("("+(char)litlen+"): "); // } else { // Console.Write("{"+litlen+"}: "); // } // } literalTree.WriteSymbol(litlen); } } // if (DeflaterConstants.DEBUGGING) { // Console.Write("EOF: "); // } literalTree.WriteSymbol(EOF_SYMBOL); // if (DeflaterConstants.DEBUGGING) { // literalTree.CheckEmpty(); // distTree.CheckEmpty(); // } } /// /// Flush block to output with no compression /// /// Data to write /// Index of first byte to write /// Count of bytes to write /// True if this is the last block public void FlushStoredBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) { // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("Flushing stored block "+ storedLength); // } pending.WriteBits((DeflaterConstants.STORED_BLOCK << 1) + (lastBlock ? 1 : 0), 3); pending.AlignToByte(); pending.WriteShort(storedLength); pending.WriteShort(~storedLength); pending.WriteBlock(stored, storedOffset, storedLength); Reset(); } /// /// Flush block to output with compression /// /// Data to flush /// Index of first byte to flush /// Count of bytes to flush /// True if this is the last block public void FlushBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) { literalTree.freqs[EOF_SYMBOL]++; /* Build trees */ literalTree.BuildTree(); distTree.BuildTree(); /* Calculate bitlen frequency */ literalTree.CalcBLFreq(blTree); distTree.CalcBLFreq(blTree); /* Build bitlen tree */ blTree.BuildTree(); int blTreeCodes = 4; for (int i = 18; i > blTreeCodes; i--) { if (blTree.length[BL_ORDER[i]] > 0) { blTreeCodes = i+1; } } int opt_len = 14 + blTreeCodes * 3 + blTree.GetEncodedLength() + literalTree.GetEncodedLength() + distTree.GetEncodedLength() + extra_bits; int static_len = extra_bits; for (int i = 0; i < LITERAL_NUM; i++) { static_len += literalTree.freqs[i] * staticLLength[i]; } for (int i = 0; i < DIST_NUM; i++) { static_len += distTree.freqs[i] * staticDLength[i]; } if (opt_len >= static_len) { /* Force static trees */ opt_len = static_len; } if (storedOffset >= 0 && (storedLength + 4 < (opt_len >> 3))) { /* Store Block */ // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("Storing, since " + storedLength + " < " + opt_len // + " <= " + static_len); // } FlushStoredBlock(stored, storedOffset, storedLength, lastBlock); } else if (opt_len == static_len) { /* Encode with static tree */ pending.WriteBits((DeflaterConstants.STATIC_TREES << 1) + (lastBlock ? 1 : 0), 3); literalTree.SetStaticCodes(staticLCodes, staticLLength); distTree.SetStaticCodes(staticDCodes, staticDLength); CompressBlock(); Reset(); } else { /* Encode with dynamic tree */ pending.WriteBits((DeflaterConstants.DYN_TREES << 1) + (lastBlock ? 1 : 0), 3); SendAllTrees(blTreeCodes); CompressBlock(); Reset(); } } /// /// Get value indicating if internal buffer is full /// /// true if buffer is full public bool IsFull() { return last_lit >= BUFSIZE; } /// /// Add literal to buffer /// /// /// Value indicating internal buffer is full public bool TallyLit(int lit) { // if (DeflaterConstants.DEBUGGING) { // if (lit > 32 && lit < 127) { // //Console.WriteLine("("+(char)lit+")"); // } else { // //Console.WriteLine("{"+lit+"}"); // } // } d_buf[last_lit] = 0; l_buf[last_lit++] = (byte)lit; literalTree.freqs[lit]++; return IsFull(); } /// /// Add distance code and length to literal and distance trees /// /// Distance code /// Length /// Value indicating if internal buffer is full public bool TallyDist(int dist, int len) { // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("["+dist+","+len+"]"); // } d_buf[last_lit] = (short)dist; l_buf[last_lit++] = (byte)(len - 3); int lc = Lcode(len - 3); literalTree.freqs[lc]++; if (lc >= 265 && lc < 285) { extra_bits += (lc - 261) / 4; } int dc = Dcode(dist - 1); distTree.freqs[dc]++; if (dc >= 4) { extra_bits += dc / 2 - 1; } return IsFull(); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/IO/Compression/Inflater.cs0000644000175000017500000005674412204443225024223 0ustar00meebeymeebey00000000000000// Inflater.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; using agsXMPP.IO.Compression.Checksums; using agsXMPP.IO.Compression.Streams; namespace agsXMPP.IO.Compression { /// /// Inflater is used to decompress data that has been compressed according /// to the "deflate" standard described in rfc1951. /// /// By default Zlib (rfc1950) headers and footers are expected in the input. /// You can use constructor public Inflater(bool noHeader) passing true /// if there is no Zlib header information /// /// The usage is as following. First you have to set some input with /// setInput(), then inflate() it. If inflate doesn't /// inflate any bytes there may be three reasons: ///
    ///
  • needsInput() returns true because the input buffer is empty. /// You have to provide more input with setInput(). /// NOTE: needsInput() also returns true when, the stream is finished. ///
  • ///
  • needsDictionary() returns true, you have to provide a preset /// dictionary with setDictionary().
  • ///
  • finished() returns true, the inflater has finished.
  • ///
/// Once the first output byte is produced, a dictionary will not be /// needed at a later stage. /// /// author of the original java version : John Leuner, Jochen Hoenicke ///
public class Inflater { /// /// Copy lengths for literal codes 257..285 /// static int[] CPLENS = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 }; /// /// Extra bits for literal codes 257..285 /// static int[] CPLEXT = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; /// /// Copy offsets for distance codes 0..29 /// static int[] CPDIST = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 }; /// /// Extra bits for distance codes /// static int[] CPDEXT = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 }; /// /// These are the possible states for an inflater /// const int DECODE_HEADER = 0; const int DECODE_DICT = 1; const int DECODE_BLOCKS = 2; const int DECODE_STORED_LEN1 = 3; const int DECODE_STORED_LEN2 = 4; const int DECODE_STORED = 5; const int DECODE_DYN_HEADER = 6; const int DECODE_HUFFMAN = 7; const int DECODE_HUFFMAN_LENBITS = 8; const int DECODE_HUFFMAN_DIST = 9; const int DECODE_HUFFMAN_DISTBITS = 10; const int DECODE_CHKSUM = 11; const int FINISHED = 12; /// /// This variable contains the current state. /// int mode; /// /// The adler checksum of the dictionary or of the decompressed /// stream, as it is written in the header resp. footer of the /// compressed stream. /// Only valid if mode is DECODE_DICT or DECODE_CHKSUM. /// int readAdler; /// /// The number of bits needed to complete the current state. This /// is valid, if mode is DECODE_DICT, DECODE_CHKSUM, /// DECODE_HUFFMAN_LENBITS or DECODE_HUFFMAN_DISTBITS. /// int neededBits; int repLength; int repDist; int uncomprLen; /// /// True, if the last block flag was set in the last block of the /// inflated stream. This means that the stream ends after the /// current block. /// bool isLastBlock; /// /// The total number of inflated bytes. /// int totalOut; /// /// The total number of bytes set with setInput(). This is not the /// value returned by the TotalIn property, since this also includes the /// unprocessed input. /// int totalIn; /// /// This variable stores the noHeader flag that was given to the constructor. /// True means, that the inflated stream doesn't contain a Zlib header or /// footer. /// bool noHeader; StreamManipulator input; OutputWindow outputWindow; InflaterDynHeader dynHeader; InflaterHuffmanTree litlenTree, distTree; Adler32 adler; /// /// Creates a new inflater or RFC1951 decompressor /// RFC1950/Zlib headers and footers will be expected in the input data /// public Inflater() : this(false) { } /// /// Creates a new inflater. /// /// /// True if no RFC1950/Zlib header and footer fields are expected in the input data /// /// This is used for GZIPed/Zipped input. /// /// For compatibility with /// Sun JDK you should provide one byte of input more than needed in /// this case. /// public Inflater(bool noHeader) { this.noHeader = noHeader; this.adler = new Adler32(); input = new StreamManipulator(); outputWindow = new OutputWindow(); mode = noHeader ? DECODE_BLOCKS : DECODE_HEADER; } /// /// Resets the inflater so that a new stream can be decompressed. All /// pending input and output will be discarded. /// public void Reset() { mode = noHeader ? DECODE_BLOCKS : DECODE_HEADER; totalIn = totalOut = 0; input.Reset(); outputWindow.Reset(); dynHeader = null; litlenTree = null; distTree = null; isLastBlock = false; adler.Reset(); } /// /// Decodes a zlib/RFC1950 header. /// /// /// False if more input is needed. /// /// /// The header is invalid. /// private bool DecodeHeader() { int header = input.PeekBits(16); if (header < 0) { return false; } input.DropBits(16); /* The header is written in "wrong" byte order */ header = ((header << 8) | (header >> 8)) & 0xffff; if (header % 31 != 0) { throw new SharpZipBaseException("Header checksum illegal"); } if ((header & 0x0f00) != (Deflater.DEFLATED << 8)) { throw new SharpZipBaseException("Compression Method unknown"); } /* Maximum size of the backwards window in bits. * We currently ignore this, but we could use it to make the * inflater window more space efficient. On the other hand the * full window (15 bits) is needed most times, anyway. int max_wbits = ((header & 0x7000) >> 12) + 8; */ if ((header & 0x0020) == 0) { // Dictionary flag? mode = DECODE_BLOCKS; } else { mode = DECODE_DICT; neededBits = 32; } return true; } /// /// Decodes the dictionary checksum after the deflate header. /// /// /// False if more input is needed. /// private bool DecodeDict() { while (neededBits > 0) { int dictByte = input.PeekBits(8); if (dictByte < 0) { return false; } input.DropBits(8); readAdler = (readAdler << 8) | dictByte; neededBits -= 8; } return false; } /// /// Decodes the huffman encoded symbols in the input stream. /// /// /// false if more input is needed, true if output window is /// full or the current block ends. /// /// /// if deflated stream is invalid. /// private bool DecodeHuffman() { int free = outputWindow.GetFreeSpace(); while (free >= 258) { int symbol; switch (mode) { case DECODE_HUFFMAN: /* This is the inner loop so it is optimized a bit */ while (((symbol = litlenTree.GetSymbol(input)) & ~0xff) == 0) { outputWindow.Write(symbol); if (--free < 258) { return true; } } if (symbol < 257) { if (symbol < 0) { return false; } else { /* symbol == 256: end of block */ distTree = null; litlenTree = null; mode = DECODE_BLOCKS; return true; } } try { repLength = CPLENS[symbol - 257]; neededBits = CPLEXT[symbol - 257]; } catch (Exception) { throw new SharpZipBaseException("Illegal rep length code"); } goto case DECODE_HUFFMAN_LENBITS; /* fall through */ case DECODE_HUFFMAN_LENBITS: if (neededBits > 0) { mode = DECODE_HUFFMAN_LENBITS; int i = input.PeekBits(neededBits); if (i < 0) { return false; } input.DropBits(neededBits); repLength += i; } mode = DECODE_HUFFMAN_DIST; goto case DECODE_HUFFMAN_DIST;/* fall through */ case DECODE_HUFFMAN_DIST: symbol = distTree.GetSymbol(input); if (symbol < 0) { return false; } try { repDist = CPDIST[symbol]; neededBits = CPDEXT[symbol]; } catch (Exception) { throw new SharpZipBaseException("Illegal rep dist code"); } goto case DECODE_HUFFMAN_DISTBITS;/* fall through */ case DECODE_HUFFMAN_DISTBITS: if (neededBits > 0) { mode = DECODE_HUFFMAN_DISTBITS; int i = input.PeekBits(neededBits); if (i < 0) { return false; } input.DropBits(neededBits); repDist += i; } outputWindow.Repeat(repLength, repDist); free -= repLength; mode = DECODE_HUFFMAN; break; default: throw new SharpZipBaseException("Inflater unknown mode"); } } return true; } /// /// Decodes the adler checksum after the deflate stream. /// /// /// false if more input is needed. /// /// /// If checksum doesn't match. /// private bool DecodeChksum() { while (neededBits > 0) { int chkByte = input.PeekBits(8); if (chkByte < 0) { return false; } input.DropBits(8); readAdler = (readAdler << 8) | chkByte; neededBits -= 8; } if ((int) adler.Value != readAdler) { throw new SharpZipBaseException("Adler chksum doesn't match: " + (int)adler.Value + " vs. " + readAdler); } mode = FINISHED; return false; } /// /// Decodes the deflated stream. /// /// /// false if more input is needed, or if finished. /// /// /// if deflated stream is invalid. /// private bool Decode() { switch (mode) { case DECODE_HEADER: return DecodeHeader(); case DECODE_DICT: return DecodeDict(); case DECODE_CHKSUM: return DecodeChksum(); case DECODE_BLOCKS: if (isLastBlock) { if (noHeader) { mode = FINISHED; return false; } else { input.SkipToByteBoundary(); neededBits = 32; mode = DECODE_CHKSUM; return true; } } int type = input.PeekBits(3); if (type < 0) { return false; } input.DropBits(3); if ((type & 1) != 0) { isLastBlock = true; } switch (type >> 1){ case DeflaterConstants.STORED_BLOCK: input.SkipToByteBoundary(); mode = DECODE_STORED_LEN1; break; case DeflaterConstants.STATIC_TREES: litlenTree = InflaterHuffmanTree.defLitLenTree; distTree = InflaterHuffmanTree.defDistTree; mode = DECODE_HUFFMAN; break; case DeflaterConstants.DYN_TREES: dynHeader = new InflaterDynHeader(); mode = DECODE_DYN_HEADER; break; default: throw new SharpZipBaseException("Unknown block type " + type); } return true; case DECODE_STORED_LEN1: { if ((uncomprLen = input.PeekBits(16)) < 0) { return false; } input.DropBits(16); mode = DECODE_STORED_LEN2; } goto case DECODE_STORED_LEN2; /* fall through */ case DECODE_STORED_LEN2: { int nlen = input.PeekBits(16); if (nlen < 0) { return false; } input.DropBits(16); if (nlen != (uncomprLen ^ 0xffff)) { throw new SharpZipBaseException("broken uncompressed block"); } mode = DECODE_STORED; } goto case DECODE_STORED;/* fall through */ case DECODE_STORED: { int more = outputWindow.CopyStored(input, uncomprLen); uncomprLen -= more; if (uncomprLen == 0) { mode = DECODE_BLOCKS; return true; } return !input.IsNeedingInput; } case DECODE_DYN_HEADER: if (!dynHeader.Decode(input)) { return false; } litlenTree = dynHeader.BuildLitLenTree(); distTree = dynHeader.BuildDistTree(); mode = DECODE_HUFFMAN; goto case DECODE_HUFFMAN; /* fall through */ case DECODE_HUFFMAN: case DECODE_HUFFMAN_LENBITS: case DECODE_HUFFMAN_DIST: case DECODE_HUFFMAN_DISTBITS: return DecodeHuffman(); case FINISHED: return false; default: throw new SharpZipBaseException("Inflater.Decode unknown mode"); } } /// /// Sets the preset dictionary. This should only be called, if /// needsDictionary() returns true and it should set the same /// dictionary, that was used for deflating. The getAdler() /// function returns the checksum of the dictionary needed. /// /// /// The dictionary. /// public void SetDictionary(byte[] buffer) { SetDictionary(buffer, 0, buffer.Length); } /// /// Sets the preset dictionary. This should only be called, if /// needsDictionary() returns true and it should set the same /// dictionary, that was used for deflating. The getAdler() /// function returns the checksum of the dictionary needed. /// /// /// The dictionary. /// /// /// The offset into buffer where the dictionary starts. /// /// /// The length of the dictionary. /// /// /// No dictionary is needed. /// /// /// The adler checksum for the buffer is invalid /// public void SetDictionary(byte[] buffer, int offset, int len) { if (!IsNeedingDictionary) { throw new InvalidOperationException(); } adler.Update(buffer, offset, len); if ((int)adler.Value != readAdler) { throw new SharpZipBaseException("Wrong adler checksum"); } adler.Reset(); outputWindow.CopyDict(buffer, offset, len); mode = DECODE_BLOCKS; } /// /// Sets the input. This should only be called, if needsInput() /// returns true. /// /// /// the input. /// public void SetInput(byte[] buf) { SetInput(buf, 0, buf.Length); } /// /// Sets the input. This should only be called, if needsInput() /// returns true. /// /// /// The source of input data /// /// /// The offset into buffer where the input starts. /// /// /// The number of bytes of input to use. /// /// /// No input is needed. /// /// /// The off and/or len are wrong. /// public void SetInput(byte[] buffer, int offset, int length) { input.SetInput(buffer, offset, length); totalIn += length; } /// /// Inflates the compressed stream to the output buffer. If this /// returns 0, you should check, whether needsDictionary(), /// needsInput() or finished() returns true, to determine why no /// further output is produced. /// /// /// the output buffer. /// /// /// the number of bytes written to the buffer, 0 if no further /// output can be produced. /// /// /// if buf has length 0. /// /// /// if deflated stream is invalid. /// public int Inflate(byte[] buf) { return Inflate(buf, 0, buf.Length); } /// /// Inflates the compressed stream to the output buffer. If this /// returns 0, you should check, whether needsDictionary(), /// needsInput() or finished() returns true, to determine why no /// further output is produced. /// /// /// the output buffer. /// /// /// the offset into buffer where the output should start. /// /// /// the maximum length of the output. /// /// /// the number of bytes written to the buffer, 0 if no further output can be produced. /// /// /// if len is <= 0. /// /// /// if the offset and/or len are wrong. /// /// /// if deflated stream is invalid. /// public int Inflate(byte[] buf, int offset, int len) { if (len < 0) { throw new ArgumentOutOfRangeException("len < 0"); } // Special case: len may be zero if (len == 0) { if (IsFinished == false) { // -jr- 08-Nov-2003 INFLATE_BUG fix.. Decode(); } return 0; } /* // Check for correct buff, off, len triple if (off < 0 || off + len >= buf.Length) { throw new ArgumentException("off/len outside buf bounds"); } */ int count = 0; int more; do { if (mode != DECODE_CHKSUM) { /* Don't give away any output, if we are waiting for the * checksum in the input stream. * * With this trick we have always: * needsInput() and not finished() * implies more output can be produced. */ more = outputWindow.CopyOutput(buf, offset, len); adler.Update(buf, offset, more); offset += more; count += more; totalOut += more; len -= more; if (len == 0) { return count; } } } while (Decode() || (outputWindow.GetAvailable() > 0 && mode != DECODE_CHKSUM)); return count; } /// /// Returns true, if the input buffer is empty. /// You should then call setInput(). /// NOTE: This method also returns true when the stream is finished. /// public bool IsNeedingInput { get { return input.IsNeedingInput; } } /// /// Returns true, if a preset dictionary is needed to inflate the input. /// public bool IsNeedingDictionary { get { return mode == DECODE_DICT && neededBits == 0; } } /// /// Returns true, if the inflater has finished. This means, that no /// input is needed and no output can be produced. /// public bool IsFinished { get { return mode == FINISHED && outputWindow.GetAvailable() == 0; } } /// /// Gets the adler checksum. This is either the checksum of all /// uncompressed bytes returned by inflate(), or if needsDictionary() /// returns true (and thus no output was yet produced) this is the /// adler checksum of the expected dictionary. /// /// /// the adler checksum. /// public int Adler { get { return IsNeedingDictionary ? readAdler : (int) adler.Value; } } /// /// Gets the total number of output bytes returned by inflate(). /// /// /// the total number of output bytes. /// public int TotalOut { get { return totalOut; } } /// /// Gets the total number of processed compressed input bytes. /// /// /// The total number of bytes of processed input bytes. /// public int TotalIn { get { return totalIn - RemainingInput; } } #if TEST_HAK /// /// -jr test hak trying to figure out a bug /// public int UnseenInput { get { return totalIn - ((input.AvailableBits + 7) >> 3); } } /// /// -jr test hak trying to figure out a bug /// public int PlainTotalIn { get { return totalIn; } } #endif /// /// Gets the number of unprocessed input bytes. Useful, if the end of the /// stream is reached and you want to further process the bytes after /// the deflate stream. /// /// /// The number of bytes of the input which have not been processed. /// public int RemainingInput { get { return input.AvailableBytes; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/XmppComponentConnection.cs0000644000175000017500000002576412250206660024475 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Net; using agsXMPP.Xml.Dom; using agsXMPP.protocol; using agsXMPP.protocol.component; using agsXMPP.Xml; namespace agsXMPP { /// /// /// use this class to write components that connect to a Jabebr/XMPP server /// /// /// http://www.xmpp.org/extensions/xep-0114.html /// /// public class XmppComponentConnection : XmppConnection { // This route stuff is old undocumented jabberd(2) stuff. hopefully we can get rid of this one day // or somebody writes up and XEP public delegate void RouteHandler (object sender, Route r); private bool m_CleanUpDone; private bool m_StreamStarted; #region << Constructors >> /// /// Creates a new Component Connection to a given server and port /// public XmppComponentConnection() { m_IqGrabber = new IqGrabber(this); } /// /// Creates a new Component Connection to a given server and port /// /// host/ip of the listening server /// port the server listens for the connection public XmppComponentConnection(string server, int port) : this() { base.Server = server; base.Port = port; } /// /// Creates a new Component Connection to a given server, port and password (secret) /// /// host/ip of the listening server /// port the server listens for the connection /// password public XmppComponentConnection(string server, int port, string password) : this(server,port) { this.Password = password; } #endregion #region << Properties and Member Variables >> private string m_Password = null; private bool m_Authenticated = false; private Jid m_ComponentJid = null; private IqGrabber m_IqGrabber = null; public string Password { get { return m_Password; } set { m_Password = value; } } /// /// Are we Authenticated to the server? This is readonly and set by the library /// public bool Authenticated { get { return m_Authenticated; } } /// /// The Domain of the component. /// /// eg: jabber.ag-software.de /// /// public Jid ComponentJid { get { return m_ComponentJid; } set { m_ComponentJid = value; } } public IqGrabber IqGrabber { get { return m_IqGrabber; } set { m_IqGrabber = value; } } #endregion #region << Events >> // public event ErrorHandler OnError; /// /// connection is authenticated now and ready for receiving Route, Log and Xdb Packets /// public event ObjectHandler OnLogin; public event ObjectHandler OnClose; /// /// handler for incoming routet packtes from the server /// public event RouteHandler OnRoute; /// /// Event that occurs on authentication errors /// e.g. wrong password, user doesnt exist etc... /// public event XmppElementHandler OnAuthError; /// /// Stream errors <stream:error/> /// public event XmppElementHandler OnStreamError; /// /// Event occurs on Socket Errors /// public event ErrorHandler OnSocketError; /// /// /// public event IqHandler OnIq; /// /// We received a message. This could be a chat message, headline, normal message or a groupchat message. /// There are also XMPP extension which are embedded in messages. /// e.g. X-Data forms. /// public event MessageHandler OnMessage; /// /// We received a presence from a contact or chatroom. /// Also subscriptions is handles in this event. /// public event PresenceHandler OnPresence; #endregion public void Open() { _Open(); } /// /// /// /// /// public void Open(string server, int port) { this.Server = server; this.Port = port; _Open(); } private void _Open() { m_CleanUpDone = false; m_StreamStarted = false; if (ConnectServer == null) SocketConnect(base.Server, base.Port); else SocketConnect(this.ConnectServer, base.Port); } private void SendOpenStream() { // StringBuilder sb = new StringBuilder(); //sb.Append(""); sb.Append(""); Open(sb.ToString()); } private void Login() { // Send Handshake Send( new Handshake(this.m_Password, this.StreamId) ); } #region << Stream Parser events >> public override void StreamParserOnStreamStart(object sender, Node e) { base.StreamParserOnStreamStart (sender, e); m_StreamStarted = true; Login(); } public override void StreamParserOnStreamEnd(object sender, Node e) { base.StreamParserOnStreamEnd (sender, e); if(!m_CleanUpDone) CleanupSession(); } public override void StreamParserOnStreamElement(object sender, ElementEventArgs eventArgs) { base.StreamParserOnStreamElement (sender, eventArgs); var e = eventArgs.Element; if (e is Handshake) { m_Authenticated = true; if (OnLogin != null) OnLogin(this); if (KeepAlive) CreateKeepAliveTimer(); eventArgs.Handled = true; } else if (e is Route) { if (OnRoute != null) OnRoute(this, e as Route); eventArgs.Handled = true; } else if (e is protocol.Error) { protocol.Error streamErr = e as protocol.Error; switch (streamErr.Condition) { // Auth errors are important for the users here, so throw catch auth errors // in a separate event here case agsXMPP.protocol.StreamErrorCondition.NotAuthorized: // Authentication Error if (OnAuthError != null) OnAuthError(this, e as Element); break; default: if (OnStreamError != null) OnStreamError(this, e as Element); break; } eventArgs.Handled = true; } else if (e is Message) { if (OnMessage != null) { OnMessage(this, e as Message); eventArgs.Handled = true; } } else if (e is Presence) { if (OnPresence != null) { OnPresence(this, e as Presence); eventArgs.Handled = true; } } else if (e is IQ) { if (OnIq != null) { var iqEventArgs = new protocol.client.IQEventArgs((IQ)e); OnIq(this, iqEventArgs); if (iqEventArgs.Handled) { eventArgs.Handled = true; } } } } private void m_StreamParser_OnStreamError(object sender, Exception ex) { if(!m_CleanUpDone) CleanupSession(); } #endregion #region << ClientSocket Events >> public override void SocketOnConnect(object sender) { base.SocketOnConnect (sender); SendOpenStream(); } public override void SocketOnDisconnect(object sender) { base.SocketOnDisconnect (sender); if(!m_CleanUpDone) CleanupSession(); } public override void SocketOnError(object sender, Exception ex) { base.SocketOnError(sender, ex); if (m_StreamStarted && !m_CleanUpDone) CleanupSession(); if (OnSocketError != null) OnSocketError(this, ex); } #endregion public override void Send(Element e) { // this is a hack to not send the xmlns="jabber:component:accept" with all packets Element dummyEl = new Element("a"); dummyEl.Namespace = Uri.ACCEPT; dummyEl.AddChild(e); string toSend = dummyEl.ToString(); Send(toSend.Substring(35, toSend.Length - 35 - 4)); } private void CleanupSession() { // This cleanup has only to be done if we were able to connect and teh XMPP Stream was started DestroyKeepAliveTimer(); m_CleanUpDone = true; StreamParser.Reset(); m_IqGrabber.Clear(); if (OnClose!=null) OnClose(this); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/0000755000175000017500000000000012250206660020041 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Dom/0000755000175000017500000000000012250206660020560 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Dom/NodeList.cs0000644000175000017500000000612412204443225022632 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections; namespace agsXMPP.Xml.Dom { /// /// /// public class NodeList : CollectionBase { /// /// Owner (Parent) of the ChildElement Collection /// private Node m_Owner = null; public NodeList() { } public NodeList(Node owner) { m_Owner = owner; } public void Add(Node e) { // can't add a empty node, so return immediately // Some people tried this which caused an error if (e == null) return; if (m_Owner != null) { e.Parent = m_Owner; if (e.Namespace == null) e.Namespace = m_Owner.Namespace; } e.m_Index = Count; List.Add(e); } // Method implementation from the CollectionBase class public void Remove(int index) { if (index > Count - 1 || index < 0) { // Handle the error that occurs if the valid page index is // not supplied. // This exception will be written to the calling function throw new Exception("Index out of bounds"); } List.RemoveAt(index); RebuildIndex(index); } public void Remove(Element e) { int idx = e.Index; List.Remove(e); RebuildIndex(idx); } public Node Item(int index) { return (Node) this.List[index]; } public object[] ToArray() { object[] ar = new object[this.List.Count]; for (int i = 0; i < this.List.Count; i++) { ar[i] = this.List[i]; } return ar; } internal void RebuildIndex() { RebuildIndex(0); } internal void RebuildIndex(int start) { for (int i = start; i < Count; i++) { Node node = (Node) List[i]; node.m_Index = i; } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Dom/Comment.cs0000644000175000017500000000253412204443225022514 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ namespace agsXMPP.Xml.Dom { /// /// Summary description for Comment. /// public class Comment : Node { public Comment() { NodeType = NodeType.Comment; } public Comment(string text) : this() { Value = text; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Dom/CData.cs0000644000175000017500000000260512204443225022065 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2011 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ namespace agsXMPP.Xml.Dom { /// /// /// public class CData : Node { public CData() { NodeType = NodeType.Cdata; } public CData(string data) : this() { Value = data; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Dom/Element.cs0000644000175000017500000010212612204443225022501 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; using System.Text; using System.IO; using System.Xml; namespace agsXMPP.Xml.Dom { public class Element : Node { // Member Variables private string m_TagName; private string m_Prefix; private ListDictionary m_Attributes; private Text m_Value = new Text(); public Element() { NodeType = NodeType.Element; AddChild(m_Value); m_Attributes = new ListDictionary(); m_TagName = ""; Value = ""; } public Element(string tagName) :this() { m_TagName = tagName; } public Element(string tagName, string tagText) : this(tagName) { Value = tagText; } public Element(string tagName, bool tagText) : this(tagName, tagText ? "true" : "false") { } public Element(string tagName, string tagText, string ns) : this(tagName, tagText) { Namespace = ns; } /// /// Is this Element a Rootnode? /// public bool IsRootElement { get { return (Parent != null ? false : true); } } public override string Value { get { return m_Value.Value; } set { m_Value.Value = value; } } public string Prefix { get { return m_Prefix; } set { m_Prefix = value; } } /// /// The Full Qualified Name /// public string TagName { get { return m_TagName; } set { m_TagName = value; } } public string TextBase64 { get { byte[] b = Convert.FromBase64String(Value); return Encoding.ASCII.GetString(b, 0, b.Length); } set { byte[] b = Encoding.UTF8.GetBytes(value); //byte[] b = Encoding.Default.GetBytes(value); Value = Convert.ToBase64String(b, 0, b.Length); } } public ListDictionary Attributes { get { return m_Attributes; } } public object GetAttributeEnum(string name, Type enumType) { string att = GetAttribute(name); if ((att == null)) return -1; try { #if CF return util.Enum.Parse(enumType, att, true); #else return Enum.Parse(enumType, att, true); #endif } catch (Exception) { return -1; } } public string GetAttribute(string name) { if (HasAttribute(name)) return (string) m_Attributes[name]; return null; } public int GetAttributeInt(string name) { if (HasAttribute(name)) { return int.Parse((string) m_Attributes[name]); } return 0; } public long GetAttributeLong(string name) { if (HasAttribute(name)) { return long.Parse((string) m_Attributes[name]); } return 0; } /// /// Reads a boolean Attribute, if the attrib is absent it returns also false. /// /// /// public bool GetAttributeBool(string name) { if (HasAttribute(name)) { string tmp = (string) m_Attributes[name]; if (tmp.ToLower() == "true") return true; return false; } return false; } public Jid GetAttributeJid(string name) { if (HasAttribute(name)) return new Jid(this.GetAttribute(name)); return null; } /// /// /// /// /// /// public double GetAttributeDouble(string name, IFormatProvider ifp) { if (HasAttribute(name)) { try { return double.Parse((string)m_Attributes[name], ifp); } catch { return double.NaN; } } return double.NaN; } /// /// Get a Attribute of type double (Decimal seperator = ".") /// /// /// public double GetAttributeDouble(string name) { // Parse the double always in english format ==> "." = Decimal seperator NumberFormatInfo nfi = new NumberFormatInfo(); nfi.NumberGroupSeparator = "."; return GetAttributeDouble(name, nfi); } public bool HasAttribute(string name) { return Attributes.Contains(name); } /// /// Return the Text of the first Tag with a specified Name. /// It doesnt traverse the while tree and checks only the unerlying childnodes /// /// Name of Tag to find as string /// public string GetTag(string TagName) { Element tag = this._SelectElement(this, TagName); if ( tag != null) return tag.Value; return null; } public string GetTag(string TagName, bool traverseChildren) { Element tag = this._SelectElement(this, TagName, traverseChildren); if ( tag != null) return tag.Value; return null; } public string GetTag(System.Type type) { Element tag = this._SelectElement(this, type); if ( tag != null) return tag.Value; return null; } public string GetTagBase64(string TagName) { byte[] b = Convert.FromBase64String(GetTag(TagName)); return Encoding.ASCII.GetString(b, 0, b.Length); } /// /// Adds a Tag and encodes the Data to BASE64 /// /// /// public void SetTagBase64(string argTagname, string argText) { byte[] b = Encoding.Unicode.GetBytes(argText); SetTag(argTagname, Convert.ToBase64String(b, 0, b.Length)); } /// /// Adds a Tag end decodes the byte buffer to BASE64 /// /// /// public void SetTagBase64(string argTagname, byte[] buffer) { SetTag(argTagname, Convert.ToBase64String(buffer, 0, buffer.Length)); } public void SetTag(string argTagname, string argText) { if (HasTag(argTagname) == false) AddChild(new Element(argTagname, argText)); else SelectSingleElement(argTagname).Value = argText; } public void SetTag(Type type, string argText) { if (HasTag(type) == false) { Element newel; newel = (Element) Activator.CreateInstance(type); newel.Value = argText; AddChild(newel); } else SelectSingleElement(type).Value = argText; } public void SetTag(Type type) { if (HasTag(type)) RemoveTag(type); AddChild( (Element) Activator.CreateInstance(type) ); } public void SetTag(string argTagname) { SetTag(argTagname, ""); } public void SetTag(string argTagname, string argText, string argNS) { if (HasTag(argTagname) == false) AddChild(new Element(argTagname, argText, argNS)); else { Element e = SelectSingleElement(argTagname); e.Value = argText; e.Namespace = argNS; } } public void SetTag(string argTagname, double dbl, IFormatProvider ifp) { SetTag(argTagname, dbl.ToString(ifp)); } public void SetTag(string argTagname, double dbl) { NumberFormatInfo nfi = new NumberFormatInfo(); nfi.NumberGroupSeparator = "."; SetTag(argTagname, dbl, nfi); } public void SetTag(string argTagname, bool val) { SetTag(argTagname, val ? "true" : "false"); } public void SetTag(string argTagname, int val) { SetTag(argTagname, val.ToString()); } public void SetTag(string argTagname, Jid jid) { SetTag(argTagname, jid.ToString()); } public void AddTag(string argTagname, string argText) { AddChild(new Element(argTagname, argText)); } public void AddTag(string argTagname) { AddChild(new Element(argTagname)); } public object GetTagEnum(string name, System.Type enumType) { string tag = this.GetTag(name); if ( (tag == null) || (tag.Length == 0) ) return -1; try { #if CF return util.Enum.Parse(enumType, tag, true); #else return Enum.Parse(enumType, tag, true); #endif } catch (Exception) { return -1; } } /// /// Return the Text of the first Tag with a specified Name in all childnodes as boolean /// /// name of Tag to findas string /// public bool GetTagBool(string TagName) { Element tag = this._SelectElement(this, TagName); if ( tag != null) { if (tag.Value.ToLower() == "false" || tag.Value.ToLower() == "0") { return false; } if(tag.Value.ToLower() == "true" || tag.Value.ToLower() == "1") { return true; } return false; } return false; } public int GetTagInt(string TagName) { Element tag = _SelectElement(this, TagName); if ( tag != null) return int.Parse(tag.Value); return 0; } public Jid GetTagJid(string TagName) { string jid = GetTag(TagName); if (jid != null) return new Jid(jid); return null; } /// /// Get a Tag of type double (Decimal seperator = ".") /// /// /// public double GetTagDouble(string argTagName) { // Parse the double always in english format ==> "." = Decimal seperator NumberFormatInfo nfi = new NumberFormatInfo(); nfi.NumberGroupSeparator = "."; return GetTagDouble(argTagName, nfi); } /// /// Get a Tag of type double with the given iFormatProvider /// /// /// /// public double GetTagDouble(string argTagName, IFormatProvider ifp) { string val = GetTag(argTagName); if (val != null) return Double.Parse(val, ifp); return Double.NaN; } public bool HasTag(string name) { Element tag = _SelectElement(this, name); if ( tag != null) return true; return false; } public bool HasTag(string name, bool traverseChildren) { Element tag = _SelectElement(this, name, traverseChildren); if ( tag != null) return true; return false; } public bool HasTag(Type type) { Element tag = _SelectElement(this, type); if ( tag != null) return true; return false; } public bool HasTag() where T : Element { return SelectSingleElement() != null; } public bool HasTagt(bool traverseChildren) where T : Element { return SelectSingleElement(traverseChildren) != null; } public bool HasTag(Type type, bool traverseChildren) { Element tag = this._SelectElement(this, type, traverseChildren); if ( tag != null) return true; return false; } /// /// /// /// /// public object HasTagEnum(Type enumType) { #if CF || CF_2 string[] members = Util.Enum.GetNames(enumType); #else string[] members = Enum.GetNames(enumType); #endif foreach (string member in members) { if (HasTag(member)) #if CF return util.Enum.Parse(enumType, member, false); #else return Enum.Parse(enumType, member, false); #endif } return -1; } /// /// Remove a Tag when it exists /// /// Tagname to remove /// true when existing and removed, false when not existing public bool RemoveTag(string TagName) { Element tag = _SelectElement(this, TagName); if ( tag != null) { tag.Remove(); return true; } return false; } /// /// Remove a Tag when it exists /// /// Type of the tag that should be removed /// true when existing and removed, false when not existing public bool RemoveTag(Type type) { Element tag = _SelectElement(this, type); if (tag != null) { tag.Remove(); return true; } return false; } public bool RemoveTag() where T : Element { Element tag = SelectSingleElement(); if (tag != null) { tag.Remove(); return true; } return false; } /// /// Removes all Tags of the given type. Doesnt traverse the tree /// /// Type of the tags that should be removed /// true when tags were removed, false when no tags were found and removed public bool RemoveTags(Type type) { bool ret = false; ElementList list = SelectElements(type); if (list.Count > 0) ret = true; foreach (Element e in list) e.Remove(); return ret; } /// /// Removes all Tags of the given type. Doesnt traverse the tree /// /// Type of the tags that should be removed /// true when tags were removed, false when no tags were found and removed public bool RemoveTags() where T : Element { return RemoveTags(typeof (T)); } /// /// Same as AddChild, but Replaces the childelement when it exists /// /// public void ReplaceChild(Element e) { if (HasTag(e.TagName)) RemoveTag(e.TagName); AddChild(e); } public string Attribute(string name) { return (string) m_Attributes[name]; } /// /// Removes a Attribute /// /// Attribute as string to remove public void RemoveAttribute(string name) { if (HasAttribute(name)) { Attributes.Remove(name); } } /// /// Adds a new Attribue or changes a Attriv when already exists /// /// name of Attribute to add/change /// value of teh Attribute to add/change public void SetAttribute(string name, string val) { // When the attrib already exists then we overweite it // So we must remove it first and add it again then if (HasAttribute(name)) { Attributes.Remove(name); } m_Attributes.Add(name, val); } /// /// /// /// /// public void SetAttribute(string name, int value) { SetAttribute(name, value.ToString()); } /// /// /// /// /// public void SetAttribute(string name, long value) { SetAttribute(name, value.ToString()); } /// /// Writes a boolean attribute, the value is either 'true' or 'false' /// /// /// public void SetAttribute(string name, bool val) { // When the attrib already exists then we overweite it // So we must remove it first and add it again then if (HasAttribute(name)) { Attributes.Remove(name); } m_Attributes.Add(name, val ? "true" : "false"); } /// /// Set a attribute of type Jid /// /// /// public void SetAttribute(string name, Jid value) { if (value != null) SetAttribute(name, value.ToString()); else RemoveAttribute(name); } /// /// Set a attribute from a double in english number format /// /// /// public void SetAttribute(string name, double value) { NumberFormatInfo nfi = new NumberFormatInfo(); nfi.NumberGroupSeparator = "."; SetAttribute(name, value, nfi); } /// /// Set a attribute from a double with the given Format provider /// /// /// /// public void SetAttribute(string name, double value, IFormatProvider ifp) { SetAttribute(name, value.ToString(ifp)); } public void SetNamespace(string value) { SetAttribute("xmlns", value); } private CData GetFirstCDataNode() { foreach (Node ch in ChildNodes) { if (ch.NodeType == NodeType.Cdata) return ch as CData; } return null; } /// /// Has this Element some CDATA? /// /// public bool HasData() { return GetFirstCDataNode() != null; } /// /// Get the CDATA /// /// public string GetData() { var data = GetFirstCDataNode(); return data == null ? null : data.Value; } /// /// Set the CDATA /// /// public void SetData(string cdata) { var data = GetFirstCDataNode(); if (data == null) { data = new CData(); AddChild(data); } data.Value = cdata; } public string InnerXml { get { if (ChildNodes.Count > 0) { string xml = ""; try { for (int i = 0; i < ChildNodes.Count; i++) { if (ChildNodes.Item(i).NodeType == NodeType.Element) xml += ChildNodes.Item(i).ToString(); else if (ChildNodes.Item(i).NodeType == NodeType.Text) xml += ChildNodes.Item(i).Value; } } catch (Exception) { } return xml; } return null; } set { Document doc = new Document(); doc.LoadXml(value); Element root = doc.RootElement; if (root != null) { ChildNodes.Clear(); AddChild(root); } } } /// /// returns whether the current element has child elements or not. /// cares only about element, not text nodes etc... /// public bool HasChildElements { get { foreach (Node e in ChildNodes) { if (e.NodeType == NodeType.Element) return true; } return false; } } /// /// returns the first child element (no textNodes) /// public Element FirstChild { get { if (ChildNodes.Count > 0) { foreach (Node e in ChildNodes) { if (e.NodeType == NodeType.Element) return e as Element; } return null; } return null; } } /// /// Returns the first ChildNode, doesnt matter of which type it is /// public Node FirstNode { get { if(ChildNodes.Count > 0) return ChildNodes.Item(0) as Node; return null; } } /// /// Returns the last ChildNode, doesnt matter of which type it is /// public Node LastNode { get { if(ChildNodes.Count > 0) return ChildNodes.Item(ChildNodes.Count -1) as Node; return null; } } internal string StartTag() { using (StringWriter sw = new StringWriter()) { using (XmlTextWriter tw = new XmlTextWriter(sw)) { tw.Formatting = Formatting.None; if (Prefix == null) tw.WriteStartElement(TagName); else tw.WriteStartElement(Prefix + ":" + TagName); // Write Namespace if (Namespace != null && Namespace.Length != 0 ) { if (Prefix == null) tw.WriteAttributeString("xmlns", Namespace); else tw.WriteAttributeString("xmlns:" + Prefix, Namespace); } foreach (string attName in this.Attributes.Keys) { tw.WriteAttributeString(attName, Attribute(attName)); } tw.Flush(); tw.Close(); return sw.ToString().Replace("/>", ">"); } } } internal string EndTag() { if (Prefix == null) return ""; return ""; } #region << Xml Select Functions >> /// /// Find a Element by type /// /// /// public Element SelectSingleElement(System.Type type) { return _SelectElement(this, type); } /// /// find a Element by type and loop thru all children /// /// /// /// public Element SelectSingleElement(System.Type type, bool loopChildren) { return _SelectElement(this, type, true); } public Element SelectSingleElement(string TagName) { return _SelectElement(this, TagName); } public Element SelectSingleElement(string TagName, bool traverseChildren) { return _SelectElement(this, TagName, true); } public Element SelectSingleElement(string TagName, string AttribName, string AttribValue) { return _SelectElement(this, TagName, AttribName, AttribValue); } public Element SelectSingleElement(string TagName, string ns) { return _SelectElement(this, TagName, ns, true); } public Element SelectSingleElement(string TagName, string ns, bool traverseChildren) { return _SelectElement(this, TagName, ns, traverseChildren); } public T SelectSingleElement() where T : Element { return (T)_SelectElement(this, typeof(T)); } public T SelectSingleElement(bool traverseChildren) where T : Element { return (T)_SelectElement(this, typeof(T), traverseChildren); } /// /// Returns all childNodes with the given Tagname, /// this function doesn't traverse the whole tree!!! /// /// /// public ElementList SelectElements(string TagName) { ElementList es = new ElementList(); //return this._SelectElements(this, TagName, es); return _SelectElements(this, TagName, es, false); } public ElementList SelectElements(string TagName, bool traverseChildren) { ElementList es = new ElementList(); //return this._SelectElements(this, TagName, es); return _SelectElements(this, TagName, es, traverseChildren); } public ElementList SelectElements(System.Type type) { ElementList es = new ElementList(); return _SelectElements(this, type, es); } /// /// returns a nodelist of all found nodes of the given Type /// /// /// /// /// private ElementList _SelectElements(Element e, Type type, ElementList es) { return _SelectElements(e, type, es, false); } private ElementList _SelectElements(Element e, Type type, ElementList es, bool traverseChildren) { if (e.ChildNodes.Count > 0) { foreach(Node n in e.ChildNodes) { if (n.NodeType == NodeType.Element) { if (n.GetType() == type) { es.Add(n); } if (traverseChildren) _SelectElements((Element) n, type, es, true); } } } return es; } /// /// Select a single element. /// This function doesnt traverse the whole tree and checks only the underlying childnodes /// /// /// /// private Element _SelectElement(Node se, string tagname) { return _SelectElement(se, tagname, false); } /// /// Select a single element /// /// /// /// when set to true then the function traverses the whole tree /// private Element _SelectElement(Node se, string tagname, bool traverseChildren) { Element rElement = null; if (se.ChildNodes.Count > 0) { foreach(Node ch in se.ChildNodes) { if (ch.NodeType == NodeType.Element) { if ( ((Element) ch).TagName == tagname ) { rElement = (Element) ch; return rElement; } else { if( traverseChildren) { rElement = _SelectElement(ch, tagname, true); if (rElement != null) break; } } } } } return rElement; } private Element _SelectElement(Node se, System.Type type) { return _SelectElement(se, type, false); } private Element _SelectElement(Node se, System.Type type, bool traverseChildren) { Element rElement = null; if (se.ChildNodes.Count > 0) { foreach(Node ch in se.ChildNodes) { if (ch.NodeType == NodeType.Element) { if ( ch.GetType() == type ) { rElement = (Element) ch; return rElement; } else { if( traverseChildren) { rElement = _SelectElement(ch, type, true); if (rElement != null) break; } } } } } return rElement; } private Element _SelectElement(Node se, string tagname, string AttribName, string AttribValue) { Element rElement = null; if (se.NodeType == NodeType.Element) { Element e = se as Element; if (e.m_TagName == tagname) { if (e.HasAttribute(AttribName)) { if (e.GetAttribute(AttribName) == AttribValue) { rElement = e; return rElement; } } } } if (se.ChildNodes.Count > 0) { foreach(Node ch in se.ChildNodes) { rElement = _SelectElement(ch, tagname, AttribName, AttribValue); if (rElement != null) break; } } return rElement; } /// /// Find Element by Namespace /// /// The se. /// The tagname. /// The name space. /// if set to true [traverse children]. /// private Element _SelectElement(Node se, string tagname, string nameSpace, bool traverseChildren) { Element rElement = null; if (se.ChildNodes.Count > 0) { foreach (Node ch in se.ChildNodes) { if (ch.NodeType == NodeType.Element) { Element e = ch as Element; if (e.TagName == tagname && e.Namespace == nameSpace) { rElement = (Element)ch; return rElement; } else { if (traverseChildren) { rElement = _SelectElement(ch, tagname, nameSpace, traverseChildren); if (rElement != null) break; } } } } } return rElement; } private ElementList _SelectElements(Element e, string tagname, ElementList es, bool traverseChildren) { if (e.ChildNodes.Count > 0) { foreach(Node n in e.ChildNodes) { if (n.NodeType == NodeType.Element) { if ( ((Element) n).m_TagName == tagname) { es.Add(n); } if (traverseChildren) _SelectElements((Element) n, tagname, es, true); } } } return es; } public List SelectElements() where T : Element { return SelectElements(false); } public List SelectElements(bool traverseChildren) where T : Element { List list = new List(); return this._SelectElements(this, list, traverseChildren); } private List _SelectElements(Element e, List list, bool traverseChildren) where T : Element { if (e.ChildNodes.Count > 0) { foreach (Node n in e.ChildNodes) { if (n.NodeType == NodeType.Element) { if (n.GetType() == typeof(T)) { list.Add(n as T); } if (traverseChildren) _SelectElements((Element)n, list, true); } } } return list; } #endregion } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Dom/DomLoader.cs0000644000175000017500000000336612250206660022765 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System.IO; namespace agsXMPP.Xml.Dom { /// /// internal class that loads a xml document from a string or stream /// internal class DomLoader { public static void Load(string xml, Document doc) { var sp =new StreamParser(); sp.OnStreamStart += (sender, node) => doc.ChildNodes.Add(node); sp.OnStreamElement += (sender, args) => doc.RootElement.ChildNodes.Add(args.Element); byte[] b = System.Text.Encoding.UTF8.GetBytes(xml); sp.Push(b, 0, b.Length); } public static void Load(StreamReader sr, Document doc) { Load(sr.ReadToEnd(), doc); } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Dom/Node.cs0000644000175000017500000001511312204443225021774 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System.IO; using System.Xml; using System.Text; using agsXMPP.IO; namespace agsXMPP.Xml.Dom { public enum NodeType { Document, // xmlDocument Element, // normal Element Text, // Textnode Cdata, // CDATA Section Comment, // comment Declaration // processing instruction } /// /// /// public abstract class Node { internal Node Parent; private NodeType m_NodeType; private string m_Value; private string m_Namespace; internal int m_Index; private readonly NodeList m_ChildNodes; protected Node() { m_ChildNodes = new NodeList(this); } public NodeType NodeType { get { return m_NodeType; } set { m_NodeType = value; } } public virtual string Value { get { return m_Value; } set { m_Value = value; } } public string Namespace { get { return m_Namespace; } set { m_Namespace = value; } } public int Index { get { return m_Index; } } public NodeList ChildNodes { get { return this.m_ChildNodes; } } public void Remove() { if ( Parent!=null ) { int idx = m_Index; Parent.ChildNodes.RemoveAt(idx); Parent.ChildNodes.RebuildIndex(idx); } } public void RemoveAllChildNodes() { m_ChildNodes.Clear(); } /// /// Appends the given Element as child element /// /// public virtual void AddChild(Node e) { m_ChildNodes.Add(e); } /// /// Returns the Xml of the current Element (Node) as string /// public override string ToString() { return BuildXml(this, Formatting.None, 0, ' '); } public string ToString(Encoding enc) { using (var tw = new StringWriterWithEncoding(enc)) { //System.IO.StringWriter tw = new StringWriter(); using (var w = new XmlTextWriter(tw)) { // Format the Output. So its human readable in notepad // Without that everyting is in one line w.Formatting = Formatting.Indented; w.Indentation = 3; WriteTree(this, w, null); return tw.ToString(); } } } /// /// returns the Xml, difference to the Xml property is that you can set formatting porperties /// /// /// public string ToString(Formatting format) { return BuildXml(this, format, 3, ' '); } /// /// returns the Xml, difference to the Xml property is that you can set formatting properties /// /// /// /// public string ToString(Formatting format, int indent) { return BuildXml(this, format, indent, ' '); } #region << Xml Serializer Functions >> private string BuildXml(Node e, Formatting format, int indent, char indentchar) { if ( e != null ) { using(var tw = new StringWriter()) { using(var w = new XmlTextWriter(tw)) { w.Formatting = format; w.Indentation = indent; w.IndentChar = indentchar; WriteTree(this, w, null); return tw.ToString(); } } } return ""; } private void WriteTree(Node e, XmlTextWriter tw, Node parent) { if (e.NodeType == NodeType.Document) { //Write the ProcessingInstruction node. // ... Document doc = e as Document; string pi = null; if (doc.Version != null) pi += "version='" + doc.Version + "'"; if (doc.Encoding != null) { if (pi != null) pi += " "; pi += "encoding='" + doc.Encoding + "'"; } if (pi != null) tw.WriteProcessingInstruction("xml", pi); foreach(Node n in e.ChildNodes) { WriteTree(n, tw, e); } } else if (e.NodeType == NodeType.Text) { tw.WriteString(e.Value); } else if (e.NodeType == NodeType.Comment) { tw.WriteComment(e.Value); } else if (e.NodeType == NodeType.Cdata) { tw.WriteCData(e.Value); } else if (e.NodeType == NodeType.Element) { Element el = e as Element; if (el.Prefix==null) tw.WriteStartElement( el.TagName ); else tw.WriteStartElement( el.Prefix + ":" + el.TagName ); // Write Namespace if ( (parent == null || parent.Namespace != el.Namespace) && el.Namespace != null && el.Namespace.Length !=0 ) { if (el.Prefix==null) tw.WriteAttributeString("xmlns", el.Namespace); else tw.WriteAttributeString("xmlns:" + el.Prefix , el.Namespace); } foreach (string attName in el.Attributes.Keys) { tw.WriteAttributeString(attName, el.Attribute(attName)); } //tw.WriteString(el.Value); if (el.ChildNodes.Count > 0) { foreach(Node n in el.ChildNodes) { WriteTree(n, tw, e); } tw.WriteEndElement(); } else { tw.WriteEndElement(); } } } #endregion } } smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Dom/Document.cs0000644000175000017500000000613312204443225022667 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System.IO; namespace agsXMPP.Xml.Dom { /// /// /// public class Document : Node { public Document() { NodeType = NodeType.Document; } public Element RootElement { get { foreach (Node n in this.ChildNodes) { if(n.NodeType == NodeType.Element) return n as Element; } return null; } } #region << Properties and Member Variables >> private string m_Encoding = null; private string m_Version = null; public string Encoding { get { return m_Encoding; } set { m_Encoding = value; } } public string Version { get { return m_Version; } set { m_Version = value; } } #endregion /// /// Clears the Document /// public void Clear() { this.ChildNodes.Clear(); } #region << Load functions >> public void LoadXml(string xml) { if (!string.IsNullOrEmpty(xml)) { DomLoader.Load(xml, this); } } public bool LoadFile(string filename) { if (File.Exists(filename)) { try { using(var sr = new StreamReader(filename)) { DomLoader.Load(sr, this); sr.Close(); return true; } } catch { return false; } } return false; } public bool LoadStream(Stream stream) { try { using(var sr = new StreamReader(stream)) { DomLoader.Load(sr, this); sr.Close(); return true; } } catch { return false; } } public void Save(string filename) { using (var w = new StreamWriter(filename)) { w.Write(ToString(System.Text.Encoding.UTF8)); w.Flush(); w.Close(); } } #endregion } } smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Dom/Text.cs0000644000175000017500000000245512204443225022040 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ namespace agsXMPP.Xml.Dom { /// /// /// public class Text : Node { public Text() { NodeType = NodeType.Text; } public Text(string text) : this() { Value = text; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Dom/ElementList.cs0000644000175000017500000000402712204443225023336 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections; namespace agsXMPP.Xml.Dom { public class ElementList : CollectionBase { public void Add(Node e) { // can't add a empty node, so return immediately // Some people tried dthis which caused an error if (e == null) return; List.Add(e); } // Method implementation from the CollectionBase class public void Remove(int index) { if (index > Count - 1 || index < 0) { // Handle the error that occurs if the valid page index is // not supplied. // This exception will be written to the calling function throw new Exception("Index out of bounds"); } List.RemoveAt(index); } public void Remove(Element e) { List.Remove(e); } public Element Item(int index) { return (Element) List[index]; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Xpnet/0000755000175000017500000000000012204443225021136 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Xpnet/ContentToken.cs0000644000175000017500000001301012204443225024073 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * xpnet is a deriviative of James Clark's XP parser. * See copying.txt for more info. */ using System; namespace agsXMPP.Xml.Xpnet { /// /// Represents information returned by Encoding.tokenizeContent. /// @see Encoding#tokenizeContent /// public class ContentToken : Token { private const int INIT_ATT_COUNT = 8; private int attCount = 0; private int[] attNameStart = new int[INIT_ATT_COUNT]; private int[] attNameEnd = new int[INIT_ATT_COUNT]; private int[] attValueStart = new int[INIT_ATT_COUNT]; private int[] attValueEnd = new int[INIT_ATT_COUNT]; private bool[] attNormalized = new bool[INIT_ATT_COUNT]; /// /// Returns the number of attributes specified in the start-tag or empty element tag. /// /// public int getAttributeSpecifiedCount() { return attCount; } /// /// Returns the index of the first character of the name of the /// attribute index i. /// /// /// public int getAttributeNameStart(int i) { if (i >= attCount) throw new System.IndexOutOfRangeException(); return attNameStart[i]; } /** * Returns the index following the last character of the name of the * attribute index i. */ public int getAttributeNameEnd(int i) { if (i >= attCount) throw new System.IndexOutOfRangeException(); return attNameEnd[i]; } /** * Returns the index of the character following the opening quote of * attribute index i. */ public int getAttributeValueStart(int i) { if (i >= attCount) throw new System.IndexOutOfRangeException(); return attValueStart[i]; } /** * Returns the index of the closing quote attribute index i. */ public int getAttributeValueEnd(int i) { if (i >= attCount) throw new System.IndexOutOfRangeException(); return attValueEnd[i]; } /** * Returns true if attribute index i does not need to * be normalized. This is an optimization that allows further processing * of the attribute to be avoided when it is known that normalization * cannot change the value of the attribute. */ public bool isAttributeNormalized(int i) { if (i >= attCount) throw new System.IndexOutOfRangeException(); return attNormalized[i]; } /// /// Clear out all of the current attributes /// public void clearAttributes() { attCount = 0; } /// /// Add a new attribute /// /// /// /// /// /// public void appendAttribute(int nameStart, int nameEnd, int valueStart, int valueEnd, bool normalized) { if (attCount == attNameStart.Length) { attNameStart = grow(attNameStart); attNameEnd = grow(attNameEnd); attValueStart = grow(attValueStart); attValueEnd = grow(attValueEnd); attNormalized = grow(attNormalized); } attNameStart[attCount] = nameStart; attNameEnd[attCount] = nameEnd; attValueStart[attCount] = valueStart; attValueEnd[attCount] = valueEnd; attNormalized[attCount] = normalized; ++attCount; } /// /// Is the current attribute unique? /// /// public void checkAttributeUniqueness(byte[] buf) { for (int i = 1; i < attCount; i++) { int len = attNameEnd[i] - attNameStart[i]; for (int j = 0; j < i; j++) { if (attNameEnd[j] - attNameStart[j] == len) { int n = len; int s1 = attNameStart[i]; int s2 = attNameStart[j]; do { if (--n < 0) throw new InvalidTokenException(attNameStart[i], InvalidTokenException.DUPLICATE_ATTRIBUTE); } while (buf[s1++] == buf[s2++]); } } } } private static int[] grow(int[] v) { int[] tem = v; v = new int[tem.Length << 1]; Array.Copy(tem, 0, v, 0, tem.Length); return v; } private static bool[] grow(bool[] v) { bool[] tem = v; v = new bool[tem.Length << 1]; Array.Copy(tem, 0, v, 0, tem.Length); return v; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Xpnet/NamespaceStack.cs0000644000175000017500000000673712204443225024364 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * xpnet is a deriviative of James Clark's XP parser. * See copying.txt for more info. */ using System.Collections.Generic; namespace agsXMPP.Xml.Xpnet { /// /// Namespace stack. /// public class NamespaceStack { private readonly Stack> stack = new Stack>(); /// /// Create a new stack, primed with xmlns and xml as prefixes. /// public NamespaceStack() { Push(); AddNamespace("xmlns", "http://www.w3.org/2000/xmlns/"); AddNamespace("xml", "http://www.w3.org/XML/1998/namespace"); } /// /// Declare a new scope, typically at the start of each element /// public void Push() { stack.Push(new Dictionary()); } /// /// Pop the current scope off the stack. Typically at the end of each element. /// public void Pop() { stack.Pop(); } /// /// Add a namespace to the current scope. /// /// /// public void AddNamespace(string prefix, string uri) { stack.Peek().Add(prefix, uri); } /// /// Lookup a prefix to find a namespace. Searches down the stack, starting at the current scope. /// /// /// public string LookupNamespace(string prefix) { foreach (Dictionary ht in stack) { if ((ht.Count > 0) && (ht.ContainsKey(prefix))) return ht[prefix]; } return ""; } /// /// The current default namespace. /// public string DefaultNamespace { get { return LookupNamespace(string.Empty); } } /// /// Clears this instance. /// public void Clear() { #if !CF stack.Clear(); #else while (m_stack.Count > 0) m_stack.Pop(); #endif } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Xpnet/Position.cs0000644000175000017500000000447412204443225023302 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * xpnet is a deriviative of James Clark's XP parser. * See copying.txt for more info. */ namespace agsXMPP.Xml.Xpnet { /** * Represents a position in an entity. * A position can be modified by Encoding.movePosition. * @see Encoding#movePosition * @version $Revision: 1.2 $ $Date: 1998/02/17 04:24:15 $ */ public class Position : System.ICloneable { private int lineNumber; private int columnNumber; /** * Creates a position for the start of an entity: the line number is * 1 and the column number is 0. */ public Position() { lineNumber = 1; columnNumber = 0; } /** * Returns the line number. * The first line number is 1. */ public int LineNumber { get {return lineNumber;} set {lineNumber = value;} } /** * Returns the column number. * The first column number is 0. * A tab character is not treated specially. */ public int ColumnNumber { get { return columnNumber; } set { columnNumber = value; } } /** * Returns a copy of this position. */ public object Clone() { #if CF throw new util.NotImplementedException(); #else throw new System.NotImplementedException(); #endif } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Xpnet/Token.cs0000644000175000017500000000510712204443225022550 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * xpnet is a deriviative of James Clark's XP parser. * See copying.txt for more info. */ namespace agsXMPP.Xml.Xpnet { /// /// A token that was parsed. /// public class Token { private int tokenEnd = -1; private int nameEnd = -1; private char refChar1 = (char)0; private char refChar2 = (char)0; /// /// The end of the current token, in relation to the beginning of the buffer. /// public int TokenEnd { get {return tokenEnd;} set {tokenEnd = value; } } /// /// The end of the current token's name, in relation to the beginning of the buffer. /// public int NameEnd { get {return nameEnd;} set {nameEnd = value;} } //public char RefChar //{ // get {return refChar1;} //} /// /// The parsed-out character. & for &amp; /// public char RefChar1 { get {return refChar1;} set {refChar1 = value; } } /// /// The second of two parsed-out characters. TODO: find example. /// public char RefChar2 { get {return refChar2;} set {refChar2 = value; } } /* public void getRefCharPair(char[] ch, int off) { ch[off] = refChar1; ch[off + 1] = refChar2; } */ } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Xpnet/NS.cs0000644000175000017500000001044412204443225022010 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2010 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* -------------------------------------------------------------------------- * Copyrights * * Portions created by or assigned to Cursive Systems, Inc. are * Copyright (c) 2002-2005 Cursive Systems, Inc. All Rights Reserved. Contact * information for Cursive Systems, Inc. is available at * http://www.cursive.net/. * * License * * Jabber-Net can be used under either JOSL or the GPL. * See LICENSE.txt for details. * --------------------------------------------------------------------------*/ using System.Collections; namespace agsXMPP.Xml.xpnet { /// /// Namespace stack. /// public class NS { private Stack m_stack = new Stack(); /// /// Create a new stack, primed with xmlns and xml as prefixes. /// public NS() { PushScope(); AddNamespace("xmlns", "http://www.w3.org/2000/xmlns/"); AddNamespace("xml", "http://www.w3.org/XML/1998/namespace"); } /// /// Declare a new scope, typically at the start of each element /// public void PushScope() { m_stack.Push(new Hashtable()); } /// /// Pop the current scope off the stack. Typically at the end of each element. /// public void PopScope() { m_stack.Pop(); } /// /// Add a namespace to the current scope. /// /// /// public void AddNamespace(string prefix, string uri) { ((Hashtable)m_stack.Peek()).Add(prefix, uri); } /// /// Lookup a prefix to find a namespace. Searches down the stack, starting at the current scope. /// /// /// public string LookupNamespace(string prefix) { foreach (Hashtable ht in m_stack) { if ((ht.Count > 0) && (ht.ContainsKey(prefix))) return (string)ht[prefix]; } return ""; } /// /// The current default namespace. /// public string DefaultNamespace { get { return LookupNamespace(string.Empty); } } /// /// Debug output only. /// /// public override string ToString() { System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (Hashtable ht in m_stack) { sb.Append("---\n"); foreach (string k in ht.Keys) { sb.Append(string.Format("{0}={1}\n", k, ht[k])); } } return sb.ToString(); } public void Clear() { #if !CF m_stack.Clear(); #else while (m_stack.Count > 0) m_stack.Pop(); #endif } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Xpnet/UTF8Encoding.cs0000644000175000017500000002727112204443225023673 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * xpnet is a deriviative of James Clark's XP parser. * See copying.txt for more info. */ namespace agsXMPP.Xml.Xpnet { /// /// UTF-8 specific tokenizer. /// public class UTF8Encoding : Encoding { private static readonly int[] utf8HiTypeTable = new int[] { /* 0x80 */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0x84 */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0x88 */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0x8C */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0x90 */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0x94 */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0x98 */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0x9C */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0xA0 */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0xA4 */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0xA8 */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0xAC */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0xB0 */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0xB4 */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0xB8 */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0xBC */ BT_MALFORM, BT_MALFORM, BT_MALFORM, BT_MALFORM, /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, /* 0xF4 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM }; private static int[] utf8TypeTable = new int[256]; static UTF8Encoding() { System.Array.Copy(asciiTypeTable, 0, utf8TypeTable, 0, 128); System.Array.Copy(utf8HiTypeTable, 0, utf8TypeTable, 128, 128); } /// /// New tokenizer /// public UTF8Encoding() : base(1) { } /// /// What is the type of the current byte? /// /// /// /// protected override int byteType(byte[] buf, int off) { return utf8TypeTable[buf[off] & 0xFF]; } /// /// Current byte to ASCII char /// /// /// /// protected override char byteToAscii(byte[] buf, int off) { return (char)buf[off]; } /// /// c is a significant ASCII character /// /// /// /// /// protected override bool charMatches(byte[] buf, int off, char c) { return ((char)buf[off]) == c; } /// /// A 2 byte UTF-8 representation splits the characters 11 bits /// between the bottom 5 and 6 bits of the bytes. /// /// /// /// protected override int byteType2(byte[] buf, int off) { int[] page = charTypeTable[(buf[off] >> 2) & 0x7]; return page[((buf[off] & 3) << 6) | (buf[off + 1] & 0x3F)]; } /* A 3 byte UTF-8 representation splits the characters 16 bits between the bottom 4, 6 and 6 bits of the bytes. */ /* This will (incorrectly) return BT_LEAD4 for surrogates, but that doesn't matter. */ int byteType3(byte[] buf, int off) { int[] page = charTypeTable[((buf[off] & 0xF) << 4) | ((buf[off + 1] >> 2) & 0xF)]; return page[((buf[off + 1] & 3) << 6) | (buf[off + 2] & 0x3F)]; } void check3(byte[] buf, int off) { switch (buf[off]) { case 0xEF: /* 0xFFFF 0xFFFE */ if ((buf[off + 1] == 0xBF) && ((buf[off + 2] == 0xBF) || (buf[off + 2] == 0xBE))) throw new InvalidTokenException(off); return; case 0xED: /* 0xD800..0xDFFF <=> top 5 bits are 11011 */ if ((buf[off + 1] & 0x20) != 0) throw new InvalidTokenException(off); return; default: return; } } void check4(byte[] buf, int off) { switch (buf[off] & 0x7) { default: return; case 5: case 6: case 7: break; case 4: if ((buf[off + 1] & 0x30) == 0) return; break; } throw new InvalidTokenException(off); } /// /// /// /// /// /// /// /// /// protected override int convert(byte[] sourceBuf, int sourceStart, int sourceEnd, char[] targetBuf, int targetStart) { int initTargetStart = targetStart; int c; while (sourceStart != sourceEnd) { byte b = sourceBuf[sourceStart++]; if (b >= 0) targetBuf[targetStart++] = (char)b; else { switch (utf8TypeTable[b & 0xFF]) { case BT_LEAD2: /* 5, 6 */ targetBuf[targetStart++] = (char)(((b & 0x1F) << 6) | (sourceBuf[sourceStart++] & 0x3F)); break; case BT_LEAD3: /* 4, 6, 6 */ c = (b & 0xF) << 12; c |= (sourceBuf[sourceStart++] & 0x3F) << 6; c |= (sourceBuf[sourceStart++] & 0x3F); targetBuf[targetStart++] = (char)c; break; case BT_LEAD4: /* 3, 6, 6, 6 */ c = (b & 0x7) << 18; c |= (sourceBuf[sourceStart++] & 0x3F) << 12; c |= (sourceBuf[sourceStart++] & 0x3F) << 6; c |= (sourceBuf[sourceStart++] & 0x3F); c -= 0x10000; targetBuf[targetStart++] = (char)((c >> 10) | 0xD800); targetBuf[targetStart++] = (char)((c & ((1 << 10) - 1)) | 0xDC00); break; } } } return targetStart - initTargetStart; } /// /// /// /// /// /// /// protected override void movePosition(byte[] buf, int off, int end, Position pos) { /* Maintain the invariant: off - colDiff == colNumber. */ int colDiff = off - pos.ColumnNumber; int lineNumber = pos.LineNumber; while (off != end) { byte b = buf[off]; if (b >= 0) { ++off; switch (b) { case (byte)'\n': lineNumber += 1; colDiff = off; break; case (byte)'\r': lineNumber += 1; if (off != end && buf[off] == '\n') off++; colDiff = off; break; } } else { switch (utf8TypeTable[b & 0xFF]) { default: off += 1; break; case BT_LEAD2: off += 2; colDiff++; break; case BT_LEAD3: off += 3; colDiff += 2; break; case BT_LEAD4: off += 4; colDiff += 3; break; } } } pos.ColumnNumber = off - colDiff; pos.LineNumber = lineNumber; } int extendData(byte[] buf, int off, int end) { while (off != end) { int type = utf8TypeTable[buf[off] & 0xFF]; if (type >= 0) off++; else if (type < BT_LEAD4) break; else { if (end - off + type < 0) break; switch (type) { case BT_LEAD3: check3(buf, off); break; case BT_LEAD4: check4(buf, off); break; } off -= (int)type; // this is an ugly hack, James } } return off; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Xpnet/BufferAggregate.cs0000644000175000017500000001062212204443225024506 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * xpnet is a deriviative of James Clark's XP parser. * See copying.txt for more info. */ using System.IO; namespace agsXMPP.Xml.Xpnet { /// /// Aggregate byte arrays together, so we can parse across IP packet boundaries /// public class BufferAggregate { // RingBuffer of the Nieblung private class BufNode { public byte[] buf; public BufNode next = null; } private MemoryStream m_stream = new MemoryStream(); private BufNode m_head = null; private BufNode m_tail = null; /// /// Create an empty buffer /// public BufferAggregate() { } /// /// Write to the buffer. Please make sure that you won't use this memory any more after you hand it in. /// It will get mangled. /// /// public void Write(byte[] buf) { m_stream.Write(buf, 0, buf.Length); if (m_tail == null) { m_head = m_tail = new BufNode(); m_head.buf = buf; } else { BufNode n = new BufNode(); n.buf = buf; m_tail.next = n; m_tail = n; } } /// /// Get the current aggregate contents of the buffer. /// /// public byte[] GetBuffer() { return m_stream.ToArray(); } /// /// Clear the first "offset" bytes of the buffer, so they won't be parsed again. /// /// public void Clear(int offset) { int s = 0; int save = -1; BufNode bn = null; for (bn = m_head; bn != null; bn = bn.next) { if (s + bn.buf.Length <= offset) { if (s + bn.buf.Length == offset) { bn = bn.next; break; } s += bn.buf.Length; } else { save = s + bn.buf.Length - offset; break; } } m_head = bn; if (m_head == null) m_tail = null; if (save > 0) { byte[] buf = new byte[save]; System.Buffer.BlockCopy(m_head.buf, m_head.buf.Length - save, buf, 0, save); m_head.buf = buf; } m_stream.SetLength(0); for (bn = m_head; bn != null; bn = bn.next) { m_stream.Write(bn.buf, 0, bn.buf.Length); } } /// /// UTF8 encode the current contents of the buffer. Just for prettiness in the debugger. /// /// public override string ToString() { byte[] b = GetBuffer(); return System.Text.Encoding.UTF8.GetString(b, 0, b.Length); } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Xpnet/Encoding.cs0000644000175000017500000035206112204443225023222 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * xpnet is a deriviative of James Clark's XP parser. * See copying.txt for more info. */ namespace agsXMPP.Xml.Xpnet { /// /// Tokens that might have been found /// public enum TOK { /** * Represents one or more characters of data. */ DATA_CHARS, /** * Represents a newline (CR, LF or CR followed by LF) in data. */ DATA_NEWLINE, /** * Represents a complete start-tag <name>, * that doesn't have any attribute specifications. */ START_TAG_NO_ATTS, /** * Represents a complete start-tag <name * att="val">, that contains one or more * attribute specifications. */ START_TAG_WITH_ATTS, /** * Represents an empty element tag <name/>, * that doesn't have any attribute specifications. */ EMPTY_ELEMENT_NO_ATTS, /** * Represents an empty element tag <name * att="val"/>, that contains one or more * attribute specifications. */ EMPTY_ELEMENT_WITH_ATTS, /** * Represents a complete end-tag </name>. */ END_TAG, /** * Represents the start of a CDATA section * <![CDATA[. */ CDATA_SECT_OPEN, /** * Represents the end of a CDATA section ]]>. */ CDATA_SECT_CLOSE, /** * Represents a general entity reference. */ ENTITY_REF, /** * Represents a general entity reference to a one of the 5 * predefined entities amp, lt, * gt, quot, apos. */ MAGIC_ENTITY_REF, /** * Represents a numeric character reference (decimal or * hexadecimal), when the referenced character is less * than or equal to 0xFFFF and so is represented by a * single char. */ CHAR_REF, /** * Represents a numeric character reference (decimal or * hexadecimal), when the referenced character is greater * than 0xFFFF and so is represented by a pair of chars. */ CHAR_PAIR_REF, /** * Represents a processing instruction. */ PI, /** * Represents an XML declaration or text declaration (a * processing instruction whose target is * xml). */ XML_DECL, /** * Represents a comment <!-- comment -->. * This can occur both in the prolog and in content. */ COMMENT, /** * Represents a white space character in an attribute * value, excluding white space characters that are part * of line boundaries. */ ATTRIBUTE_VALUE_S, /** * Represents a parameter entity reference in the prolog. */ PARAM_ENTITY_REF, /** * Represents whitespace in the prolog. * The token contains one or more whitespace characters. */ PROLOG_S, /** * Represents <!NAME in the prolog. */ DECL_OPEN, /** * Represents > in the prolog. */ DECL_CLOSE, /** * Represents a name in the prolog. */ NAME, /** * Represents a name token in the prolog that is not a name. */ NMTOKEN, /** * Represents #NAME in the prolog. */ POUND_NAME, /** * Represents | in the prolog. */ OR, /** * Represents a % in the prolog that does not start * a parameter entity reference. * This can occur in an entity declaration. */ PERCENT, /** * Represents a ( in the prolog. */ OPEN_PAREN, /** * Represents a ) in the prolog that is not * followed immediately by any of * *, + or ?. */ CLOSE_PAREN, /** * Represents [ in the prolog. */ OPEN_BRACKET, /** * Represents ] in the prolog. */ CLOSE_BRACKET, /** * Represents a literal (EntityValue, AttValue, SystemLiteral or * PubidLiteral). */ LITERAL, /** * Represents a name followed immediately by ?. */ NAME_QUESTION, /** * Represents a name followed immediately by *. */ NAME_ASTERISK, /** * Represents a name followed immediately by +. */ NAME_PLUS, /** * Represents <![ in the prolog. */ COND_SECT_OPEN, /** * Represents ]]> in the prolog. */ COND_SECT_CLOSE, /** * Represents )? in the prolog. */ CLOSE_PAREN_QUESTION, /** * Represents )* in the prolog. */ CLOSE_PAREN_ASTERISK, /** * Represents )+ in the prolog. */ CLOSE_PAREN_PLUS, /** * Represents , in the prolog. */ COMMA, }; /// /// Base tokenizer class /// public abstract class Encoding { // Bytes with type < 0 may not be data in content. // The negation of the lead byte type gives the total number of bytes. /// /// Need more bytes /// protected const int BT_LEAD2 = -2; /// /// Need more bytes /// protected const int BT_LEAD3 = -3; /// /// Need more bytes /// protected const int BT_LEAD4 = -4; /// /// Not XML /// protected const int BT_NONXML = BT_LEAD4 - 1; /// /// Malformed XML /// protected const int BT_MALFORM = BT_NONXML - 1; /// /// Less than /// protected const int BT_LT = BT_MALFORM - 1; /// /// Ampersand /// protected const int BT_AMP = BT_LT - 1; /// /// right square bracket /// protected const int BT_RSQB = BT_AMP - 1; /// /// carriage return /// protected const int BT_CR = BT_RSQB - 1; /// /// line feed /// protected const int BT_LF = BT_CR - 1; // Bytes with type >= 0 are treated as data in content. /// /// greater than /// protected const int BT_GT = 0; /// /// Quote /// protected const int BT_QUOT = BT_GT + 1; /// /// Apostrophe /// protected const int BT_APOS = BT_QUOT + 1; /// /// Equal sign /// protected const int BT_EQUALS = BT_APOS + 1; /// /// Question mark /// protected const int BT_QUEST = BT_EQUALS + 1; /// /// Exclamation point /// protected const int BT_EXCL = BT_QUEST + 1; /// /// Solidus (/) /// protected const int BT_SOL = BT_EXCL + 1; /// /// Semicolon /// protected const int BT_SEMI = BT_SOL + 1; /// /// Hash /// protected const int BT_NUM = BT_SEMI + 1; /// /// Left square bracket /// protected const int BT_LSQB = BT_NUM + 1; /// /// space /// protected const int BT_S = BT_LSQB + 1; /// /// /// protected const int BT_NMSTRT = BT_S + 1; /// /// /// protected const int BT_NAME = BT_NMSTRT + 1; /// /// Minus /// protected const int BT_MINUS = BT_NAME + 1; /// /// Other /// protected const int BT_OTHER = BT_MINUS + 1; /// /// Percent /// protected const int BT_PERCNT = BT_OTHER + 1; /// /// Left paren /// protected const int BT_LPAR = BT_PERCNT + 1; /// /// Right paren /// protected const int BT_RPAR = BT_LPAR + 1; /// /// /// protected const int BT_AST = BT_RPAR + 1; /// /// + /// protected const int BT_PLUS = BT_AST + 1; /// /// , /// protected const int BT_COMMA = BT_PLUS + 1; /// /// Pipe /// protected const int BT_VERBAR = BT_COMMA + 1; /// /// What syntax do each of the ASCII7 characters have? /// protected static readonly int [] asciiTypeTable = new int[] { /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, /* 0x30 */ BT_NAME, BT_NAME, BT_NAME, BT_NAME, /* 0x34 */ BT_NAME, BT_NAME, BT_NAME, BT_NAME, /* 0x38 */ BT_NAME, BT_NAME, BT_NMSTRT, BT_SEMI, /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, /* 0x40 */ BT_OTHER, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x44 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, /* 0x60 */ BT_OTHER, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x64 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, }; /// /// /// /// /// /// /// /// /// protected abstract int convert(byte[] sourceBuf, int sourceStart, int sourceEnd, char[] targetBuf, int targetStart); private static Encoding utf8Encoding; private const byte UTF8_ENCODING = 0; private const byte UTF16_LITTLE_ENDIAN_ENCODING = 1; private const byte UTF16_BIG_ENDIAN_ENCODING = 2; private const byte INTERNAL_ENCODING = 3; private const byte ISO8859_1_ENCODING = 4; private const byte ASCII_ENCODING = 5; private static Encoding getEncoding(byte enc) { switch (enc) { case UTF8_ENCODING: if (utf8Encoding == null) utf8Encoding = new UTF8Encoding(); return utf8Encoding; /* case UTF16_LITTLE_ENDIAN_ENCODING: if (utf16LittleEndianEncoding == null) utf16LittleEndianEncoding = new UTF16LittleEndianEncoding(); return utf16LittleEndianEncoding; case UTF16_BIG_ENDIAN_ENCODING: if (utf16BigEndianEncoding == null) utf16BigEndianEncoding = new UTF16BigEndianEncoding(); return utf16BigEndianEncoding; case INTERNAL_ENCODING: if (internalEncoding == null) internalEncoding = new InternalEncoding(); return internalEncoding; case ISO8859_1_ENCODING: if (iso8859_1Encoding == null) iso8859_1Encoding = new ISO8859_1Encoding(); return iso8859_1Encoding; case ASCII_ENCODING: if (asciiEncoding == null) asciiEncoding = new ASCIIEncoding(); return asciiEncoding; */ } return null; } private int minBPC; /// /// Constructor called by subclasses to set the minimum bytes per character /// /// protected Encoding(int minBPC) { this.minBPC = minBPC; } /// /// Get the byte type of the next byte. There are guaranteed to be minBPC available bytes starting at off. /// /// /// /// protected abstract int byteType(byte[] buf, int off); /// /// Really only works for ASCII7. /// /// /// /// protected abstract char byteToAscii(byte[] buf, int off); /// /// This must only be called when c is an (XML significant) /// ASCII character. /// /// /// /// /// protected abstract bool charMatches(byte[] buf, int off, char c); /// /// Called only when byteType(buf, off) == BT_LEAD2 /// /// /// /// protected virtual int byteType2(byte[] buf, int off) { return BT_OTHER; } /// /// Called only when byteType(buf, off) == BT_LEAD3 /// /// /// /// int byteType3(byte[] buf, int off) { return BT_OTHER; } /// /// Called only when byteType(buf, off) == BT_LEAD4 /// /// /// /// int byteType4(byte[] buf, int off) { return BT_OTHER; } void check2(byte[] buf, int off) { } void check3(byte[] buf, int off) { } void check4(byte[] buf, int off) { } /** * Moves a position forward. On entry, pos gives * the position of the byte at index off in * buf. On exit, it pos will give * the position of the byte at index end, which * must be greater than or equal to off. The * bytes between off and end must * encode one or more complete characters. A carriage return * followed by a line feed will be treated as a single line * delimiter provided that they are given to * movePosition together. */ protected abstract void movePosition(byte[] buf, int off, int end, Position pos); private void checkCharMatches(byte[] buf, int off, char c) { if (!charMatches(buf, off, c)) throw new InvalidTokenException(off); } /* off points to character following "'); token.TokenEnd = off + minBPC; return TOK.COMMENT; } break; default: off += minBPC; break; } } } throw new PartialTokenException(); } /* off points to character following " */ switch (byteType(buf, off + minBPC)) { case BT_S: case BT_CR: case BT_LF: case BT_PERCNT: throw new InvalidTokenException(off); } /* fall through */ goto case BT_S; case BT_S: case BT_CR: case BT_LF: token.TokenEnd = off; return TOK.DECL_OPEN; case BT_NMSTRT: off += minBPC; break; default: throw new InvalidTokenException(off); } } throw new PartialTokenException(); } private bool targetIsXml(byte[] buf, int off, int end) { bool upper = false; if (end - off != minBPC*3) return false; switch (byteToAscii(buf, off)) { case 'x': break; case 'X': upper = true; break; default: return false; } off += minBPC; switch (byteToAscii(buf, off)) { case 'm': break; case 'M': upper = true; break; default: return false; } off += minBPC; switch (byteToAscii(buf, off)) { case 'l': break; case 'L': upper = true; break; default: return false; } if (upper) throw new InvalidTokenException(off, InvalidTokenException.XML_TARGET); return true; } /* off points to character following "')) { token.TokenEnd = off + minBPC; if (isXml) return TOK.XML_DECL; else return TOK.PI; } break; default: off += minBPC; break; } } throw new PartialTokenException(); case BT_QUEST: token.NameEnd = off; off += minBPC; if (off == end) throw new PartialTokenException(); checkCharMatches(buf, off, '>'); token.TokenEnd = off + minBPC; return (targetIsXml(buf, target, token.NameEnd) ? TOK.XML_DECL : TOK.PI); default: throw new InvalidTokenException(off); } } throw new PartialTokenException(); } /* off points to character following " *
  • TOK.DATA_CHARS
  • *
  • TOK.DATA_NEWLINE
  • *
  • TOK.CDATA_SECT_CLOSE
  • * *

    * Information about the token is stored in token. *

    * After TOK.CDATA_SECT_CLOSE is returned, the application * should use tokenizeContent. * * @exception EmptyTokenException if the subarray is empty * @exception PartialTokenException if the subarray contains only part of * a legal token * @exception InvalidTokenException if the subarrary does not start * with a legal token or part of one * @exception ExtensibleTokenException if the subarray encodes just a carriage * return ('\r') * * @see #TOK.DATA_CHARS * @see #TOK.DATA_NEWLINE * @see #TOK.CDATA_SECT_CLOSE * @see Token * @see EmptyTokenException * @see PartialTokenException * @see InvalidTokenException * @see ExtensibleTokenException * @see #tokenizeContent */ public TOK tokenizeCdataSection(byte[] buf, int off, int end, Token token) { if (minBPC > 1) end = adjustEnd(off, end); if (off == end) throw new EmptyTokenException(); switch (byteType(buf, off)) { case BT_RSQB: off += minBPC; if (off == end) throw new PartialTokenException(); if (!charMatches(buf, off, ']')) break; off += minBPC; if (off == end) throw new PartialTokenException(); if (!charMatches(buf, off, '>')) { off -= minBPC; break; } token.TokenEnd = off + minBPC; return TOK.CDATA_SECT_CLOSE; case BT_CR: off += minBPC; if (off == end) throw new ExtensibleTokenException(TOK.DATA_NEWLINE); if (byteType(buf, off) == BT_LF) off += minBPC; token.TokenEnd = off; return TOK.DATA_NEWLINE; case BT_LF: token.TokenEnd = off + minBPC; return TOK.DATA_NEWLINE; case BT_NONXML: case BT_MALFORM: throw new InvalidTokenException(off); case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); check2(buf, off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); check3(buf, off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); check4(buf, off); off += 4; break; default: off += minBPC; break; } token.TokenEnd = extendCdata(buf, off, end); return TOK.DATA_CHARS; } int extendCdata(byte[] buf, int off, int end) { while (off != end) { switch (byteType(buf, off)) { case BT_LEAD2: if (end - off < 2) return off; check2(buf, off); off += 2; break; case BT_LEAD3: if (end - off < 3) return off; check3(buf, off); off += 3; break; case BT_LEAD4: if (end - off < 4) return off; check4(buf, off); off += 4; break; case BT_RSQB: case BT_NONXML: case BT_MALFORM: case BT_CR: case BT_LF: return off; default: off += minBPC; break; } } return off; } /* off points to character following "= 0x110000) throw new InvalidTokenException(off); } } throw new PartialTokenException(); } /* off points to character following "&#" */ private TOK scanCharRef(byte[] buf, int off, int end, Token token) { if (off != end) { int c = byteToAscii(buf, off); switch (c) { case 'x': return scanHexCharRef(buf, off + minBPC, end, token); case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: throw new InvalidTokenException(off); } int num = c - '0'; for (off += minBPC; off != end; off += minBPC) { c = byteToAscii(buf, off); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': num = num * 10 + (c - '0'); if (num < 0x110000) break; /* fall through */ goto default; default: throw new InvalidTokenException(off); case ';': token.TokenEnd = off + minBPC; return setRefChar(num, token); } } } throw new PartialTokenException(); } /* num is known to be < 0x110000; return the token code */ private TOK setRefChar(int num, Token token) { if (num < 0x10000) { switch (charTypeTable[num >> 8][num & 0xFF]) { case BT_NONXML: case BT_LEAD4: case BT_MALFORM: throw new InvalidTokenException(token.TokenEnd - minBPC); } token.RefChar1 = (char)num; return TOK.CHAR_REF; } else { num -= 0x10000; token.RefChar1 = (char)((num >> 10) + 0xD800); token.RefChar2 = (char)((num & ((1 << 10) - 1)) + 0xDC00); return TOK.CHAR_PAIR_REF; } } private bool isMagicEntityRef(byte[] buf, int off, int end, Token token) { switch (byteToAscii(buf, off)) { case 'a': if (end - off < minBPC*4) break; switch (byteToAscii(buf, off + minBPC)) { case 'm': if (charMatches(buf, off + minBPC*2, 'p') && charMatches(buf, off + minBPC*3, ';')) { token.TokenEnd = off + minBPC*4; token.RefChar1 = '&'; return true; } break; case 'p': if (end - off >= minBPC*5 && charMatches(buf, off + minBPC*2, 'o') && charMatches(buf, off + minBPC*3, 's') && charMatches(buf, off + minBPC*4, ';')) { token.TokenEnd = off + minBPC*5; token.RefChar1 = '\''; return true; } break; } break; case 'l': if (end - off >= minBPC*3 && charMatches(buf, off + minBPC, 't') && charMatches(buf, off + minBPC*2, ';')) { token.TokenEnd = off + minBPC*3; token.RefChar1 = '<'; return true; } break; case 'g': if (end - off >= minBPC*3 && charMatches(buf, off + minBPC, 't') && charMatches(buf, off + minBPC*2, ';')) { token.TokenEnd = off + minBPC*3; token.RefChar1 = '>'; return true; } break; case 'q': if (end - off >= minBPC*5 && charMatches(buf, off + minBPC, 'u') && charMatches(buf, off + minBPC*2, 'o') && charMatches(buf, off + minBPC*3, 't') && charMatches(buf, off + minBPC*4, ';')) { token.TokenEnd = off + minBPC*5; token.RefChar1 = '"'; return true; } break; } return false; } /* off points to character following "&" */ private TOK scanRef(byte[] buf, int off, int end, Token token) { if (off == end) throw new PartialTokenException(); if (isMagicEntityRef(buf, off, end, token)) return TOK.MAGIC_ENTITY_REF; switch (byteType(buf, off)) { case BT_NMSTRT: off += minBPC; break; case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); if (byteType2(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); if (byteType3(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); if (byteType4(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); off += 4; break; case BT_NUM: return scanCharRef(buf, off + minBPC, end, token); default: throw new InvalidTokenException(off); } while (off != end) { switch (byteType(buf, off)) { case BT_NMSTRT: case BT_NAME: case BT_MINUS: off += minBPC; break; case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); if (!isNameChar2(buf, off)) throw new InvalidTokenException(off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); if (!isNameChar3(buf, off)) throw new InvalidTokenException(off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); if (!isNameChar4(buf, off)) throw new InvalidTokenException(off); off += 4; break; case BT_SEMI: token.NameEnd = off; token.TokenEnd = off + minBPC; return TOK.ENTITY_REF; default: throw new InvalidTokenException(off); } } throw new PartialTokenException(); } /* off points to character following first character of attribute name */ private TOK scanAtts(int nameStart, byte[] buf, int off, int end, ContentToken token) { int NameEnd = -1; while (off != end) { switch (byteType(buf, off)) { case BT_NMSTRT: case BT_NAME: case BT_MINUS: off += minBPC; break; case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); if (!isNameChar2(buf, off)) throw new InvalidTokenException(off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); if (!isNameChar3(buf, off)) throw new InvalidTokenException(off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); if (!isNameChar4(buf, off)) throw new InvalidTokenException(off); off += 4; break; case BT_S: case BT_CR: case BT_LF: NameEnd = off; for (;;) { off += minBPC; if (off == end) throw new PartialTokenException(); switch (byteType(buf, off)) { case BT_EQUALS: goto loop; case BT_S: case BT_LF: case BT_CR: break; default: throw new InvalidTokenException(off); } } loop: ; /* fall through */ goto case BT_EQUALS; case BT_EQUALS: { if (NameEnd < 0) NameEnd = off; int open; for (;;) { off += minBPC; if (off == end) throw new PartialTokenException(); open = byteType(buf, off); if (open == BT_QUOT || open == BT_APOS) break; switch (open) { case BT_S: case BT_LF: case BT_CR: break; default: throw new InvalidTokenException(off); } } off += minBPC; int valueStart = off; bool normalized = true; int t; /* in attribute value */ for (;;) { if (off == end) throw new PartialTokenException(); t = byteType(buf, off); if (t == open) break; switch (t) { case BT_NONXML: case BT_MALFORM: throw new InvalidTokenException(off); case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); check2(buf, off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); check3(buf, off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); check4(buf, off); off += 4; break; case BT_AMP: { normalized = false; int saveNameEnd = token.NameEnd; scanRef(buf, off + minBPC, end, token); token.NameEnd = saveNameEnd; off = token.TokenEnd; break; } case BT_S: if (normalized && (off == valueStart || byteToAscii(buf, off) != ' ' || (off + minBPC != end && (byteToAscii(buf, off + minBPC) == ' ' || byteType(buf, off + minBPC) == open)))) normalized = false; off += minBPC; break; case BT_LT: throw new InvalidTokenException(off); case BT_LF: case BT_CR: normalized = false; /* fall through */ goto default; default: off += minBPC; break; } } token.appendAttribute(nameStart, NameEnd, valueStart, off, normalized); off += minBPC; if (off == end) throw new PartialTokenException(); t = byteType(buf, off); switch (t) { case BT_S: case BT_CR: case BT_LF: off += minBPC; if (off == end) throw new PartialTokenException(); t = byteType(buf, off); break; case BT_GT: case BT_SOL: break; default: throw new InvalidTokenException(off); } /* off points to closing quote */ for (;;) { switch (t) { case BT_NMSTRT: nameStart = off; off += minBPC; goto skipToName; case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); if (byteType2(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); nameStart = off; off += 2; goto skipToName; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); if (byteType3(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); nameStart = off; off += 3; goto skipToName; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); if (byteType4(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); nameStart = off; off += 4; goto skipToName; case BT_S: case BT_CR: case BT_LF: break; case BT_GT: token.checkAttributeUniqueness(buf); token.TokenEnd = off + minBPC; return TOK.START_TAG_WITH_ATTS; case BT_SOL: off += minBPC; if (off == end) throw new PartialTokenException(); checkCharMatches(buf, off, '>'); token.checkAttributeUniqueness(buf); token.TokenEnd = off + minBPC; return TOK.EMPTY_ELEMENT_WITH_ATTS; default: throw new InvalidTokenException(off); } off += minBPC; if (off == end) throw new PartialTokenException(); t = byteType(buf, off); } skipToName: NameEnd = -1; break; } default: throw new InvalidTokenException(off); } } throw new PartialTokenException(); } /* off points to character following "<" */ private TOK scanLt(byte[] buf, int off, int end, ContentToken token) { if (off == end) throw new PartialTokenException(); switch (byteType(buf, off)) { case BT_NMSTRT: off += minBPC; break; case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); if (byteType2(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); if (byteType3(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); if (byteType4(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); off += 4; break; case BT_EXCL: if ((off += minBPC) == end) throw new PartialTokenException(); switch (byteType(buf, off)) { case BT_MINUS: return scanComment(buf, off + minBPC, end, token); case BT_LSQB: return scanCdataSection(buf, off + minBPC, end, token); } throw new InvalidTokenException(off); case BT_QUEST: return scanPi(buf, off + minBPC, end, token); case BT_SOL: return scanEndTag(buf, off + minBPC, end, token); default: throw new InvalidTokenException(off); } /* we have a start-tag */ token.NameEnd = -1; token.clearAttributes(); while (off != end) { switch (byteType(buf, off)) { case BT_NMSTRT: case BT_NAME: case BT_MINUS: off += minBPC; break; case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); if (!isNameChar2(buf, off)) throw new InvalidTokenException(off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); if (!isNameChar3(buf, off)) throw new InvalidTokenException(off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); if (!isNameChar4(buf, off)) throw new InvalidTokenException(off); off += 4; break; case BT_S: case BT_CR: case BT_LF: token.NameEnd = off; off += minBPC; for (;;) { if (off == end) throw new PartialTokenException(); switch (byteType(buf, off)) { case BT_NMSTRT: return scanAtts(off, buf, off + minBPC, end, token); case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); if (byteType2(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); return scanAtts(off, buf, off + 2, end, token); case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); if (byteType3(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); return scanAtts(off, buf, off + 3, end, token); case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); if (byteType4(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); return scanAtts(off, buf, off + 4, end, token); case BT_GT: case BT_SOL: goto loop; case BT_S: case BT_CR: case BT_LF: off += minBPC; break; default: throw new InvalidTokenException(off); } } loop: break; case BT_GT: if (token.NameEnd < 0) token.NameEnd = off; token.TokenEnd = off + minBPC; return TOK.START_TAG_NO_ATTS; case BT_SOL: if (token.NameEnd < 0) token.NameEnd = off; off += minBPC; if (off == end) throw new PartialTokenException(); checkCharMatches(buf, off, '>'); token.TokenEnd = off + minBPC; return TOK.EMPTY_ELEMENT_NO_ATTS; default: throw new InvalidTokenException(off); } } throw new PartialTokenException(); } // Ensure that we always scan a multiple of minBPC bytes. private int adjustEnd(int off, int end) { int n = end - off; if ((n & (minBPC - 1)) != 0) { n &= ~(minBPC - 1); if (n == 0) throw new PartialCharException(off); return off + n; } else return end; } /** * Scans the first token of a byte subarrary that contains content. * Returns one of the following integers according to the type of token * that the subarray starts with: *
      *
    • TOK.START_TAG_NO_ATTS
    • *
    • TOK.START_TAG_WITH_ATTS
    • *
    • TOK.EMPTY_ELEMENT_NO_ATTS
    • *
    • TOK.EMPTY_ELEMENT_WITH_ATTS
    • *
    • TOK.END_TAG
    • *
    • TOK.DATA_CHARS
    • *
    • TOK.DATA_NEWLINE
    • *
    • TOK.CDATA_SECT_OPEN
    • *
    • TOK.ENTITY_REF
    • *
    • TOK.MAGIC_ENTITY_REF
    • *
    • TOK.CHAR_REF
    • *
    • TOK.CHAR_PAIR_REF
    • *
    • TOK.PI
    • *
    • TOK.XML_DECL
    • *
    • TOK.COMMENT
    • *
    *

    * Information about the token is stored in token. *

    * When TOK.CDATA_SECT_OPEN is returned, * tokenizeCdataSection should be called until * it returns TOK.CDATA_SECT. * * @exception EmptyTokenException if the subarray is empty * @exception PartialTokenException if the subarray contains only part of * a legal token * @exception InvalidTokenException if the subarrary does not start * with a legal token or part of one * @exception ExtensibleTokenException if the subarray encodes just a carriage * return ('\r') * * @see #TOK.START_TAG_NO_ATTS * @see #TOK.START_TAG_WITH_ATTS * @see #TOK.EMPTY_ELEMENT_NO_ATTS * @see #TOK.EMPTY_ELEMENT_WITH_ATTS * @see #TOK.END_TAG * @see #TOK.DATA_CHARS * @see #TOK.DATA_NEWLINE * @see #TOK.CDATA_SECT_OPEN * @see #TOK.ENTITY_REF * @see #TOK.MAGIC_ENTITY_REF * @see #TOK.CHAR_REF * @see #TOK.CHAR_PAIR_REF * @see #TOK.PI * @see #TOK.XML_DECL * @see #TOK.COMMENT * @see ContentToken * @see EmptyTokenException * @see PartialTokenException * @see InvalidTokenException * @see ExtensibleTokenException * @see #tokenizeCdataSection */ public TOK tokenizeContent(byte[] buf, int off, int end, ContentToken token) { if (minBPC > 1) end = adjustEnd(off, end); if (off == end) throw new EmptyTokenException(); switch (byteType(buf, off)) { case BT_LT: return scanLt(buf, off + minBPC, end, token); case BT_AMP: return scanRef(buf, off + minBPC, end, token); case BT_CR: off += minBPC; if (off == end) throw new ExtensibleTokenException(TOK.DATA_NEWLINE); if (byteType(buf, off) == BT_LF) off += minBPC; token.TokenEnd = off; return TOK.DATA_NEWLINE; case BT_LF: token.TokenEnd = off + minBPC; return TOK.DATA_NEWLINE; case BT_RSQB: off += minBPC; if (off == end) throw new ExtensibleTokenException(TOK.DATA_CHARS); if (!charMatches(buf, off, ']')) break; off += minBPC; if (off == end) throw new ExtensibleTokenException(TOK.DATA_CHARS); if (!charMatches(buf, off, '>')) { off -= minBPC; break; } throw new InvalidTokenException(off); case BT_NONXML: case BT_MALFORM: throw new InvalidTokenException(off); case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); check2(buf, off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); check3(buf, off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); check4(buf, off); off += 4; break; default: off += minBPC; break; } token.TokenEnd = extendData(buf, off, end); return TOK.DATA_CHARS; } int extendData(byte[] buf, int off, int end) { while (off != end) { switch (byteType(buf, off)) { case BT_LEAD2: if (end - off < 2) return off; check2(buf, off); off += 2; break; case BT_LEAD3: if (end - off < 3) return off; check3(buf, off); off += 3; break; case BT_LEAD4: if (end - off < 4) return off; check4(buf, off); off += 4; break; case BT_RSQB: case BT_AMP: case BT_LT: case BT_NONXML: case BT_MALFORM: case BT_CR: case BT_LF: return off; default: off += minBPC; break; } } return off; } /* off points to character following "%" */ private TOK scanPercent(byte[] buf, int off, int end, Token token) { if (off == end) throw new PartialTokenException(); switch (byteType(buf, off)) { case BT_NMSTRT: off += minBPC; break; case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); if (byteType2(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); if (byteType3(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); if (byteType4(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); off += 4; break; case BT_S: case BT_LF: case BT_CR: case BT_PERCNT: token.TokenEnd = off; return TOK.PERCENT; default: throw new InvalidTokenException(off); } while (off != end) { switch (byteType(buf, off)) { case BT_NMSTRT: case BT_NAME: case BT_MINUS: off += minBPC; break; case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); if (!isNameChar2(buf, off)) throw new InvalidTokenException(off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); if (!isNameChar3(buf, off)) throw new InvalidTokenException(off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); if (!isNameChar4(buf, off)) throw new InvalidTokenException(off); off += 4; break; case BT_SEMI: token.NameEnd = off; token.TokenEnd = off + minBPC; return TOK.PARAM_ENTITY_REF; default: throw new InvalidTokenException(off); } } throw new PartialTokenException(); } private TOK scanPoundName(byte[] buf, int off, int end, Token token) { if (off == end) throw new PartialTokenException(); switch (byteType(buf, off)) { case BT_NMSTRT: off += minBPC; break; case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); if (byteType2(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); if (byteType3(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); if (byteType4(buf, off) != BT_NMSTRT) throw new InvalidTokenException(off); off += 4; break; default: throw new InvalidTokenException(off); } while (off != end) { switch (byteType(buf, off)) { case BT_NMSTRT: case BT_NAME: case BT_MINUS: off += minBPC; break; case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); if (!isNameChar2(buf, off)) throw new InvalidTokenException(off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); if (!isNameChar3(buf, off)) throw new InvalidTokenException(off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); if (!isNameChar4(buf, off)) throw new InvalidTokenException(off); off += 4; break; case BT_CR: case BT_LF: case BT_S: case BT_RPAR: case BT_GT: case BT_PERCNT: case BT_VERBAR: token.TokenEnd = off; return TOK.POUND_NAME; default: throw new InvalidTokenException(off); } } throw new ExtensibleTokenException(TOK.POUND_NAME); } private TOK scanLit(int open, byte[] buf, int off, int end, Token token) { while (off != end) { int t = byteType(buf, off); switch (t) { case BT_LEAD2: if (end - off < 2) throw new PartialTokenException(); check2(buf, off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialTokenException(); check3(buf, off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialTokenException(); check4(buf, off); off += 4; break; case BT_NONXML: case BT_MALFORM: throw new InvalidTokenException(off); case BT_QUOT: case BT_APOS: off += minBPC; if (t != open) break; if (off == end) throw new ExtensibleTokenException(TOK.LITERAL); switch (byteType(buf, off)) { case BT_S: case BT_CR: case BT_LF: case BT_GT: case BT_PERCNT: case BT_LSQB: token.TokenEnd = off; return TOK.LITERAL; default: throw new InvalidTokenException(off); } default: off += minBPC; break; } } throw new PartialTokenException(); } /** * Returns an encoding object to be used to start parsing an * external entity. The encoding is chosen based on the * initial 4 bytes of the entity. * * @param buf the byte array containing the initial bytes of * the entity @param off the index in buf of the * first byte of the entity @param end the index in * buf following the last available byte of the * entity; end - off must be greater than or * equal to 4 unless the entity has fewer that 4 bytes, in * which case it must be equal to the length of the entity * @param token receives information about the presence of a * byte order mark; if the entity starts with a byte order * mark then token.getTokenEnd() will return * off + 2, otherwise it will return * off * * @see TextDecl * @see XmlDecl * @see #TOK.XML_DECL * @see #getEncoding * @see #getInternalEncoding */ public static Encoding getInitialEncoding(byte[] buf, int off, int end, Token token) { token.TokenEnd = off; switch (end - off) { case 0: break; case 1: if (buf[off] > 127) return null; break; default: int b0 = buf[off] & 0xFF; int b1 = buf[off + 1] & 0xFF; switch ((b0 << 8) | b1) { case 0xFEFF: token.TokenEnd = off + 2; /* fall through */ goto case '<'; case '<': /* not legal; but not a fatal error */ return getEncoding(UTF16_BIG_ENDIAN_ENCODING); case 0xFFFE: token.TokenEnd = off + 2; /* fall through */ goto case '<' << 8; case '<' << 8: /* not legal; but not a fatal error */ return getEncoding(UTF16_LITTLE_ENDIAN_ENCODING); } break; } return getEncoding(UTF8_ENCODING); } /** * Returns an Encoding corresponding to the * specified IANA character set name. Returns this * Encoding if the name is null. Returns null if * the specified encoding is not supported. Note that there * are two distinct Encoding objects associated * with the name UTF-16, one for each possible * byte order; if this Encoding is UTF-16 with * little-endian byte ordering, then * getEncoding("UTF-16") will return this, * otherwise it will return an Encoding for * UTF-16 with big-endian byte ordering. @param name a string * specifying the IANA name of the encoding; this is case * insensitive */ public Encoding getEncoding(string name) { if (name == null) return this; switch (name.ToUpper()) { case "UTF-8": return getEncoding(UTF8_ENCODING); /* case "UTF-16": return getUTF16Encoding(); case "ISO-8859-1": return getEncoding(ISO8859_1_ENCODING); case "US-ASCII": return getEncoding(ASCII_ENCODING); */ } return null; } /** * Returns an Encoding for entities encoded with * a single-byte encoding (an encoding in which each byte * represents exactly one character). @param map a string * specifying the character represented by each byte; the * string must have a length of 256; * map.charAt(b) specifies the character encoded * by byte b; bytes that do not represent any * character should be mapped to \uFFFD */ public Encoding getSingleByteEncoding(string map) { //return new SingleByteEncoding(map); #if CF throw new util.NotImplementedException(); #else throw new System.NotImplementedException(); #endif } /** * Returns an Encoding object for use with * internal entities. This is a UTF-16 big endian encoding, * except that newlines are assumed to have been normalized * into line feed, so carriage return is treated like a space. */ public static Encoding getInternalEncoding() { return getEncoding(INTERNAL_ENCODING); } /** * Scans the first token of a byte subarray that contains part of a * prolog. * Returns one of the following integers according to the type of token * that the subarray starts with: *
      *
    • TOK.PI
    • *
    • TOK.XML_DECL
    • *
    • TOK.COMMENT
    • *
    • TOK.PARAM_ENTITY_REF
    • *
    • TOK.PROLOG_S
    • *
    • TOK.DECL_OPEN
    • *
    • TOK.DECL_CLOSE
    • *
    • TOK.NAME
    • *
    • TOK.NMTOKEN
    • *
    • TOK.POUND_NAME
    • *
    • TOK.OR
    • *
    • TOK.PERCENT
    • *
    • TOK.OPEN_PAREN
    • *
    • TOK.CLOSE_PAREN
    • *
    • TOK.OPEN_BRACKET
    • *
    • TOK.CLOSE_BRACKET
    • *
    • TOK.LITERAL
    • *
    • TOK.NAME_QUESTION
    • *
    • TOK.NAME_ASTERISK
    • *
    • TOK.NAME_PLUS
    • *
    • TOK.COND_SECT_OPEN
    • *
    • TOK.COND_SECT_CLOSE
    • *
    • TOK.CLOSE_PAREN_QUESTION
    • *
    • TOK.CLOSE_PAREN_ASTERISK
    • *
    • TOK.CLOSE_PAREN_PLUS
    • *
    • TOK.COMMA
    • *
    * @exception EmptyTokenException if the subarray is empty * @exception PartialTokenException if the subarray contains only part of * a legal token * @exception InvalidTokenException if the subarrary does not start * with a legal token or part of one * @exception EndOfPrologException if the subarray starts with the document * element; tokenizeContent should be used on the remainder * of the entity * @exception ExtensibleTokenException if the subarray is a legal token * but subsequent bytes in the same entity could be part of the token * @see #TOK.PI * @see #TOK.XML_DECL * @see #TOK.COMMENT * @see #TOK.PARAM_ENTITY_REF * @see #TOK.PROLOG_S * @see #TOK.DECL_OPEN * @see #TOK.DECL_CLOSE * @see #TOK.NAME * @see #TOK.NMTOKEN * @see #TOK.POUND_NAME * @see #TOK.OR * @see #TOK.PERCENT * @see #TOK.OPEN_PAREN * @see #TOK.CLOSE_PAREN * @see #TOK.OPEN_BRACKET * @see #TOK.CLOSE_BRACKET * @see #TOK.LITERAL * @see #TOK.NAME_QUESTION * @see #TOK.NAME_ASTERISK * @see #TOK.NAME_PLUS * @see #TOK.COND_SECT_OPEN * @see #TOK.COND_SECT_CLOSE * @see #TOK.CLOSE_PAREN_QUESTION * @see #TOK.CLOSE_PAREN_ASTERISK * @see #TOK.CLOSE_PAREN_PLUS * @see #TOK.COMMA * @see ContentToken * @see EmptyTokenException * @see PartialTokenException * @see InvalidTokenException * @see ExtensibleTokenException * @see EndOfPrologException */ public TOK tokenizeProlog(byte[] buf, int off, int end, Token token) { TOK tok; if (minBPC > 1) end = adjustEnd(off, end); if (off == end) throw new EmptyTokenException(); switch (byteType(buf, off)) { case BT_QUOT: return scanLit(BT_QUOT, buf, off + minBPC, end, token); case BT_APOS: return scanLit(BT_APOS, buf, off + minBPC, end, token); case BT_LT: { off += minBPC; if (off == end) throw new PartialTokenException(); switch (byteType(buf, off)) { case BT_EXCL: return scanDecl(buf, off + minBPC, end, token); case BT_QUEST: return scanPi(buf, off + minBPC, end, token); case BT_NMSTRT: case BT_LEAD2: case BT_LEAD3: case BT_LEAD4: token.TokenEnd = off - minBPC; throw new EndOfPrologException(); } throw new InvalidTokenException(off); } case BT_CR: if (off + minBPC == end) throw new ExtensibleTokenException(TOK.PROLOG_S); /* fall through */ goto case BT_S; case BT_S: case BT_LF: for (;;) { off += minBPC; if (off == end) break; switch (byteType(buf, off)) { case BT_S: case BT_LF: break; case BT_CR: /* don't split CR/LF pair */ if (off + minBPC != end) break; /* fall through */ goto default; default: token.TokenEnd = off; return TOK.PROLOG_S; } } token.TokenEnd = off; return TOK.PROLOG_S; case BT_PERCNT: return scanPercent(buf, off + minBPC, end, token); case BT_COMMA: token.TokenEnd = off + minBPC; return TOK.COMMA; case BT_LSQB: token.TokenEnd = off + minBPC; return TOK.OPEN_BRACKET; case BT_RSQB: off += minBPC; if (off == end) throw new ExtensibleTokenException(TOK.CLOSE_BRACKET); if (charMatches(buf, off, ']')) { if (off + minBPC == end) throw new PartialTokenException(); if (charMatches(buf, off + minBPC, '>')) { token.TokenEnd = off + 2*minBPC; return TOK.COND_SECT_CLOSE; } } token.TokenEnd = off; return TOK.CLOSE_BRACKET; case BT_LPAR: token.TokenEnd = off + minBPC; return TOK.OPEN_PAREN; case BT_RPAR: off += minBPC; if (off == end) throw new ExtensibleTokenException(TOK.CLOSE_PAREN); switch (byteType(buf, off)) { case BT_AST: token.TokenEnd = off + minBPC; return TOK.CLOSE_PAREN_ASTERISK; case BT_QUEST: token.TokenEnd = off + minBPC; return TOK.CLOSE_PAREN_QUESTION; case BT_PLUS: token.TokenEnd = off + minBPC; return TOK.CLOSE_PAREN_PLUS; case BT_CR: case BT_LF: case BT_S: case BT_GT: case BT_COMMA: case BT_VERBAR: case BT_RPAR: token.TokenEnd = off; return TOK.CLOSE_PAREN; } throw new InvalidTokenException(off); case BT_VERBAR: token.TokenEnd = off + minBPC; return TOK.OR; case BT_GT: token.TokenEnd = off + minBPC; return TOK.DECL_CLOSE; case BT_NUM: return scanPoundName(buf, off + minBPC, end, token); case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); switch (byteType2(buf, off)) { case BT_NMSTRT: off += 2; tok = TOK.NAME; break; case BT_NAME: off += 2; tok = TOK.NMTOKEN; break; default: throw new InvalidTokenException(off); } break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); switch (byteType3(buf, off)) { case BT_NMSTRT: off += 3; tok = TOK.NAME; break; case BT_NAME: off += 3; tok = TOK.NMTOKEN; break; default: throw new InvalidTokenException(off); } break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); switch (byteType4(buf, off)) { case BT_NMSTRT: off += 4; tok = TOK.NAME; break; case BT_NAME: off += 4; tok = TOK.NMTOKEN; break; default: throw new InvalidTokenException(off); } break; case BT_NMSTRT: tok = TOK.NAME; off += minBPC; break; case BT_NAME: case BT_MINUS: tok = TOK.NMTOKEN; off += minBPC; break; default: throw new InvalidTokenException(off); } while (off != end) { switch (byteType(buf, off)) { case BT_NMSTRT: case BT_NAME: case BT_MINUS: off += minBPC; break; case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); if (!isNameChar2(buf, off)) throw new InvalidTokenException(off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); if (!isNameChar3(buf, off)) throw new InvalidTokenException(off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); if (!isNameChar4(buf, off)) throw new InvalidTokenException(off); off += 4; break; case BT_GT: case BT_RPAR: case BT_COMMA: case BT_VERBAR: case BT_LSQB: case BT_PERCNT: case BT_S: case BT_CR: case BT_LF: token.TokenEnd = off; return tok; case BT_PLUS: if (tok != TOK.NAME) throw new InvalidTokenException(off); token.TokenEnd = off + minBPC; return TOK.NAME_PLUS; case BT_AST: if (tok != TOK.NAME) throw new InvalidTokenException(off); token.TokenEnd = off + minBPC; return TOK.NAME_ASTERISK; case BT_QUEST: if (tok != TOK.NAME) throw new InvalidTokenException(off); token.TokenEnd = off + minBPC; return TOK.NAME_QUESTION; default: throw new InvalidTokenException(off); } } throw new ExtensibleTokenException(tok); } /** * Scans the first token of a byte subarrary that contains part of * literal attribute value. The opening and closing delimiters * are not included in the subarrary. * Returns one of the following integers according to the type of * token that the subarray starts with: *
      *
    • TOK.DATA_CHARS
    • *
    • TOK.DATA_NEWLINE
    • *
    • TOK.ATTRIBUTE_VALUE_S
    • *
    • TOK.MAGIC_ENTITY_REF
    • *
    • TOK.ENTITY_REF
    • *
    • TOK.CHAR_REF
    • *
    • TOK.CHAR_PAIR_REF
    • *
    * @exception EmptyTokenException if the subarray is empty * @exception PartialTokenException if the subarray contains only part of * a legal token * @exception InvalidTokenException if the subarrary does not start * with a legal token or part of one * @exception ExtensibleTokenException if the subarray encodes just a carriage * return ('\r') * @see #TOK.DATA_CHARS * @see #TOK.DATA_NEWLINE * @see #TOK.ATTRIBUTE_VALUE_S * @see #TOK.MAGIC_ENTITY_REF * @see #TOK.ENTITY_REF * @see #TOK.CHAR_REF * @see #TOK.CHAR_PAIR_REF * @see Token * @see EmptyTokenException * @see PartialTokenException * @see InvalidTokenException * @see ExtensibleTokenException */ public TOK tokenizeAttributeValue(byte[] buf, int off, int end, Token token) { if (minBPC > 1) end = adjustEnd(off, end); if (off == end) throw new EmptyTokenException(); int start = off; while (off != end) { switch (byteType(buf, off)) { case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); off += 4; break; case BT_AMP: if (off == start) return scanRef(buf, off + minBPC, end, token); token.TokenEnd = off; return TOK.DATA_CHARS; case BT_LT: /* this is for inside entity references */ throw new InvalidTokenException(off); case BT_S: if (off == start) { token.TokenEnd = off + minBPC; return TOK.ATTRIBUTE_VALUE_S; } token.TokenEnd = off; return TOK.DATA_CHARS; case BT_LF: if (off == start) { token.TokenEnd = off + minBPC; return TOK.DATA_NEWLINE; } token.TokenEnd = off; return TOK.DATA_CHARS; case BT_CR: if (off == start) { off += minBPC; if (off == end) throw new ExtensibleTokenException(TOK.DATA_NEWLINE); if (byteType(buf, off) == BT_LF) off += minBPC; token.TokenEnd = off; return TOK.DATA_NEWLINE; } token.TokenEnd = off; return TOK.DATA_CHARS; default: off += minBPC; break; } } token.TokenEnd = off; return TOK.DATA_CHARS; } /** * Scans the first token of a byte subarrary that contains part of * literal entity value. The opening and closing delimiters * are not included in the subarrary. * Returns one of the following integers according to the type of * token that the subarray starts with: *
      *
    • TOK.DATA_CHARS
    • *
    • TOK.DATA_NEWLINE
    • *
    • TOK.PARAM_ENTITY_REF
    • *
    • TOK.MAGIC_ENTITY_REF
    • *
    • TOK.ENTITY_REF
    • *
    • TOK.CHAR_REF
    • *
    • TOK.CHAR_PAIR_REF
    • *
    * @exception EmptyTokenException if the subarray is empty * @exception PartialTokenException if the subarray contains only part of * a legal token * @exception InvalidTokenException if the subarrary does not start * with a legal token or part of one * @exception ExtensibleTokenException if the subarray encodes just a carriage * return ('\r') * @see #TOK.DATA_CHARS * @see #TOK.DATA_NEWLINE * @see #TOK.MAGIC_ENTITY_REF * @see #TOK.ENTITY_REF * @see #TOK.PARAM_ENTITY_REF * @see #TOK.CHAR_REF * @see #TOK.CHAR_PAIR_REF * @see Token * @see EmptyTokenException * @see PartialTokenException * @see InvalidTokenException * @see ExtensibleTokenException */ public TOK tokenizeEntityValue(byte[] buf, int off, int end, Token token) { if (minBPC > 1) end = adjustEnd(off, end); if (off == end) throw new EmptyTokenException(); int start = off; while (off != end) { switch (byteType(buf, off)) { case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); off += 4; break; case BT_AMP: if (off == start) return scanRef(buf, off + minBPC, end, token); token.TokenEnd = off; return TOK.DATA_CHARS; case BT_PERCNT: if (off == start) return scanPercent(buf, off + minBPC, end, token); token.TokenEnd = off; return TOK.DATA_CHARS; case BT_LF: if (off == start) { token.TokenEnd = off + minBPC; return TOK.DATA_NEWLINE; } token.TokenEnd = off; return TOK.DATA_CHARS; case BT_CR: if (off == start) { off += minBPC; if (off == end) throw new ExtensibleTokenException(TOK.DATA_NEWLINE); if (byteType(buf, off) == BT_LF) off += minBPC; token.TokenEnd = off; return TOK.DATA_NEWLINE; } token.TokenEnd = off; return TOK.DATA_CHARS; default: off += minBPC; break; } } token.TokenEnd = off; return TOK.DATA_CHARS; } /** * Skips over an ignored conditional section. * The subarray starts following the <![ IGNORE [. * * @return the index of the character following the closing * ]]> * * @exception PartialTokenException if the subarray does not contain the * complete ignored conditional section * @exception InvalidTokenException if the ignored conditional section * contains illegal characters */ public int skipIgnoreSect(byte[] buf, int off, int end) { if (minBPC > 1) end = adjustEnd(off, end); int level = 0; while (off != end) { switch (byteType(buf, off)) { case BT_LEAD2: if (end - off < 2) throw new PartialCharException(off); check2(buf, off); off += 2; break; case BT_LEAD3: if (end - off < 3) throw new PartialCharException(off); check3(buf, off); off += 3; break; case BT_LEAD4: if (end - off < 4) throw new PartialCharException(off); check4(buf, off); off += 4; break; case BT_NONXML: case BT_MALFORM: throw new InvalidTokenException(off); case BT_LT: off += minBPC; if (off == end) goto loop; if (!charMatches(buf, off, '!')) break; off += minBPC; if (off == end) goto loop; if (!charMatches(buf, off, '[')) break; level++; off += minBPC; break; case BT_RSQB: off += minBPC; if (off == end) goto loop; if (!charMatches(buf, off, ']')) break; off += minBPC; if (off == end) goto loop; if (charMatches(buf, off, '>')) { if (level == 0) return off + minBPC; level--; } else if (charMatches(buf, off, ']')) break; off += minBPC; break; default: off += minBPC; break; } } loop: throw new PartialTokenException(); } /** * Checks that a literal contained in the specified byte subarray * is a legal public identifier and returns a string with * the normalized content of the public id. * The subarray includes the opening and closing quotes. * @exception InvalidTokenException if it is not a legal public identifier */ public string getPublicId(byte[] buf, int off, int end) { System.Text.StringBuilder sbuf = new System.Text.StringBuilder(); off += minBPC; end -= minBPC; for (; off != end; off += minBPC) { char c = (char)byteToAscii(buf, off); switch (byteType(buf, off)) { case BT_MINUS: case BT_APOS: case BT_LPAR: case BT_RPAR: case BT_PLUS: case BT_COMMA: case BT_SOL: case BT_EQUALS: case BT_QUEST: case BT_SEMI: case BT_EXCL: case BT_AST: case BT_PERCNT: case BT_NUM: sbuf.Append(c); break; case BT_S: if (charMatches(buf, off, '\t')) throw new InvalidTokenException(off); /* fall through */ goto case BT_CR; case BT_CR: case BT_LF: if ((sbuf.Length > 0) && (sbuf[sbuf.Length - 1] != ' ')) sbuf.Append(' '); break; case BT_NAME: case BT_NMSTRT: if ((c & ~0x7f) == 0) { sbuf.Append(c); break; } // fall through goto default; default: switch (c) { case '$': case '@': break; default: throw new InvalidTokenException(off); } break; } } if (sbuf.Length > 0 && sbuf[sbuf.Length - 1] == ' ') sbuf.Length = sbuf.Length - 1; return sbuf.ToString(); } /** * Returns true if the specified byte subarray is equal to the string. * The string must contain only XML significant characters. */ public bool matchesXMLstring(byte[] buf, int off, int end, string str) { int len = str.Length; if (len*minBPC != end - off) return false; for (int i = 0; i < len; off += minBPC, i++) { if (!charMatches(buf, off, str[i])) return false; } return true; } /** * Skips over XML whitespace characters at the start of the specified * subarray. * * @return the index of the first non-whitespace character, * end if there is the subarray is all whitespace */ public int skipS(byte[] buf, int off, int end) { while (off < end) { switch (byteType(buf, off)) { case BT_S: case BT_CR: case BT_LF: off += minBPC; break; default: goto loop; } } loop: return off; } private bool isNameChar2(byte[] buf, int off) { int bt = byteType2(buf, off); return bt == BT_NAME || bt == BT_NMSTRT; } private bool isNameChar3(byte[] buf, int off) { int bt = byteType3(buf, off); return bt == BT_NAME || bt == BT_NMSTRT; } private bool isNameChar4(byte[] buf, int off) { int bt = byteType4(buf, off); return bt == BT_NAME || bt == BT_NMSTRT; } private const string nameStartSingles = "\u003a\u005f\u0386\u038c\u03da\u03dc\u03de\u03e0\u0559\u06d5\u093d\u09b2" + "\u0a5e\u0a8d\u0abd\u0ae0\u0b3d\u0b9c\u0cde\u0e30\u0e84\u0e8a\u0e8d\u0ea5" + "\u0ea7\u0eb0\u0ebd\u1100\u1109\u113c\u113e\u1140\u114c\u114e\u1150\u1159" + "\u1163\u1165\u1167\u1169\u1175\u119e\u11a8\u11ab\u11ba\u11eb\u11f0\u11f9" + "\u1f59\u1f5b\u1f5d\u1fbe\u2126\u212e\u3007"; private const string nameStartRanges = "\u0041\u005a\u0061\u007a\u00c0\u00d6\u00d8\u00f6\u00f8\u00ff\u0100\u0131" + "\u0134\u013e\u0141\u0148\u014a\u017e\u0180\u01c3\u01cd\u01f0\u01f4\u01f5" + "\u01fa\u0217\u0250\u02a8\u02bb\u02c1\u0388\u038a\u038e\u03a1\u03a3\u03ce" + "\u03d0\u03d6\u03e2\u03f3\u0401\u040c\u040e\u044f\u0451\u045c\u045e\u0481" + "\u0490\u04c4\u04c7\u04c8\u04cb\u04cc\u04d0\u04eb\u04ee\u04f5\u04f8\u04f9" + "\u0531\u0556\u0561\u0586\u05d0\u05ea\u05f0\u05f2\u0621\u063a\u0641\u064a" + "\u0671\u06b7\u06ba\u06be\u06c0\u06ce\u06d0\u06d3\u06e5\u06e6\u0905\u0939" + "\u0958\u0961\u0985\u098c\u098f\u0990\u0993\u09a8\u09aa\u09b0\u09b6\u09b9" + "\u09dc\u09dd\u09df\u09e1\u09f0\u09f1\u0a05\u0a0a\u0a0f\u0a10\u0a13\u0a28" + "\u0a2a\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59\u0a5c\u0a72\u0a74" + "\u0a85\u0a8b\u0a8f\u0a91\u0a93\u0aa8\u0aaa\u0ab0\u0ab2\u0ab3\u0ab5\u0ab9" + "\u0b05\u0b0c\u0b0f\u0b10\u0b13\u0b28\u0b2a\u0b30\u0b32\u0b33\u0b36\u0b39" + "\u0b5c\u0b5d\u0b5f\u0b61\u0b85\u0b8a\u0b8e\u0b90\u0b92\u0b95\u0b99\u0b9a" + "\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8\u0baa\u0bae\u0bb5\u0bb7\u0bb9\u0c05\u0c0c" + "\u0c0e\u0c10\u0c12\u0c28\u0c2a\u0c33\u0c35\u0c39\u0c60\u0c61\u0c85\u0c8c" + "\u0c8e\u0c90\u0c92\u0ca8\u0caa\u0cb3\u0cb5\u0cb9\u0ce0\u0ce1\u0d05\u0d0c" + "\u0d0e\u0d10\u0d12\u0d28\u0d2a\u0d39\u0d60\u0d61\u0e01\u0e2e\u0e32\u0e33" + "\u0e40\u0e45\u0e81\u0e82\u0e87\u0e88\u0e94\u0e97\u0e99\u0e9f\u0ea1\u0ea3" + "\u0eaa\u0eab\u0ead\u0eae\u0eb2\u0eb3\u0ec0\u0ec4\u0f40\u0f47\u0f49\u0f69" + "\u10a0\u10c5\u10d0\u10f6\u1102\u1103\u1105\u1107\u110b\u110c\u110e\u1112" + "\u1154\u1155\u115f\u1161\u116d\u116e\u1172\u1173\u11ae\u11af\u11b7\u11b8" + "\u11bc\u11c2\u1e00\u1e9b\u1ea0\u1ef9\u1f00\u1f15\u1f18\u1f1d\u1f20\u1f45" + "\u1f48\u1f4d\u1f50\u1f57\u1f5f\u1f7d\u1f80\u1fb4\u1fb6\u1fbc\u1fc2\u1fc4" + "\u1fc6\u1fcc\u1fd0\u1fd3\u1fd6\u1fdb\u1fe0\u1fec\u1ff2\u1ff4\u1ff6\u1ffc" + "\u212a\u212b\u2180\u2182\u3041\u3094\u30a1\u30fa\u3105\u312c\uac00\ud7a3" + "\u4e00\u9fa5\u3021\u3029"; private const string nameSingles = "\u002d\u002e\u05bf\u05c4\u0670\u093c\u094d\u09bc\u09be\u09bf\u09d7\u0a02" + "\u0a3c\u0a3e\u0a3f\u0abc\u0b3c\u0bd7\u0d57\u0e31\u0eb1\u0f35\u0f37\u0f39" + "\u0f3e\u0f3f\u0f97\u0fb9\u20e1\u3099\u309a\u00b7\u02d0\u02d1\u0387\u0640" + "\u0e46\u0ec6\u3005"; private const string nameRanges = "\u0300\u0345\u0360\u0361\u0483\u0486\u0591\u05a1\u05a3\u05b9\u05bb\u05bd" + "\u05c1\u05c2\u064b\u0652\u06d6\u06dc\u06dd\u06df\u06e0\u06e4\u06e7\u06e8" + "\u06ea\u06ed\u0901\u0903\u093e\u094c\u0951\u0954\u0962\u0963\u0981\u0983" + "\u09c0\u09c4\u09c7\u09c8\u09cb\u09cd\u09e2\u09e3\u0a40\u0a42\u0a47\u0a48" + "\u0a4b\u0a4d\u0a70\u0a71\u0a81\u0a83\u0abe\u0ac5\u0ac7\u0ac9\u0acb\u0acd" + "\u0b01\u0b03\u0b3e\u0b43\u0b47\u0b48\u0b4b\u0b4d\u0b56\u0b57\u0b82\u0b83" + "\u0bbe\u0bc2\u0bc6\u0bc8\u0bca\u0bcd\u0c01\u0c03\u0c3e\u0c44\u0c46\u0c48" + "\u0c4a\u0c4d\u0c55\u0c56\u0c82\u0c83\u0cbe\u0cc4\u0cc6\u0cc8\u0cca\u0ccd" + "\u0cd5\u0cd6\u0d02\u0d03\u0d3e\u0d43\u0d46\u0d48\u0d4a\u0d4d\u0e34\u0e3a" + "\u0e47\u0e4e\u0eb4\u0eb9\u0ebb\u0ebc\u0ec8\u0ecd\u0f18\u0f19\u0f71\u0f84" + "\u0f86\u0f8b\u0f90\u0f95\u0f99\u0fad\u0fb1\u0fb7\u20d0\u20dc\u302a\u302f" + "\u0030\u0039\u0660\u0669\u06f0\u06f9\u0966\u096f\u09e6\u09ef\u0a66\u0a6f" + "\u0ae6\u0aef\u0b66\u0b6f\u0be7\u0bef\u0c66\u0c6f\u0ce6\u0cef\u0d66\u0d6f" + "\u0e50\u0e59\u0ed0\u0ed9\u0f20\u0f29\u3031\u3035\u309d\u309e\u30fc\u30fe"; /// /// /// protected static int[][] charTypeTable; private static void setCharType(char c, int type) { if (c < 0x80) return; int hi = c >> 8; if (charTypeTable[hi] == null) { charTypeTable[hi] = new int[256]; for (int i = 0; i < 256; i++) charTypeTable[hi][i] = BT_OTHER; } charTypeTable[hi][c & 0xFF] = type; } private static void setCharType(char min, char max, int type) { int[] shared = null; do { if ((min & 0xFF) == 0) { for (; min + (char)0xFF <= max; min += (char)0x100) { if (shared == null) { shared = new int[256]; for (int i = 0; i < 256; i++) shared[i] = type; } charTypeTable[min >> 8] = shared; if (min + 0xFF == max) return; } } setCharType(min, type); } while (min++ != max); } static Encoding() { charTypeTable = new int[256][]; foreach (char c in nameSingles) setCharType(c, BT_NAME); for (int i = 0; i < nameRanges.Length; i += 2) setCharType(nameRanges[i], nameRanges[i + 1], BT_NAME); for (int i = 0; i < nameStartSingles.Length; i++) setCharType(nameStartSingles[i], BT_NMSTRT); for (int i = 0; i < nameStartRanges.Length; i += 2) setCharType(nameStartRanges[i], nameStartRanges[i + 1], BT_NMSTRT); setCharType('\uD800', '\uDBFF', BT_LEAD4); setCharType('\uDC00', '\uDFFF', BT_MALFORM); setCharType('\uFFFE', '\uFFFF', BT_NONXML); int[] other = new int[256]; for (int i = 0; i < 256; i++) other[i] = BT_OTHER; for (int i = 0; i < 256; i++) if (charTypeTable[i] == null) charTypeTable[i] = other; System.Array.Copy(asciiTypeTable, 0, charTypeTable[0], 0, 128); } /** * Returns the minimum number of bytes required to represent a single * character in this encoding. The value will be 1, 2 or 4. */ public int MinBytesPerChar { get { return minBPC; } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/Xpnet/Exceptions.cs0000644000175000017500000001227112204443225023611 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * xpnet is a deriviative of James Clark's XP parser. * See copying.txt for more info. */ namespace agsXMPP.Xml.Xpnet { /// /// Base class for other exceptions /// public class TokenException : System.Exception { } /// /// An empty token was detected. This only happens with a buffer of length 0 is passed in /// to the parser. /// public class EmptyTokenException : TokenException { } /// /// End of prolog. /// public class EndOfPrologException : TokenException { } /** * Thrown to indicate that the byte subarray being tokenized is a legal XML * token, but that subsequent bytes in the same entity could be part of * the token. For example, Encoding.tokenizeProlog * would throw this if the byte subarray consists of a legal XML name. * @version $Revision: 1.3 $ $Date: 1998/02/17 04:24:06 $ */ public class ExtensibleTokenException : TokenException { private TOK tokType; /// /// /// /// public ExtensibleTokenException(TOK tokType) { this.tokType = tokType; } /** * Returns the type of token in the byte subarrary. */ public TOK TokenType { get { return tokType; } } } /// /// Several kinds of token problems. /// public class InvalidTokenException : TokenException { private int offset; private byte type; /// /// An illegal character /// public const byte ILLEGAL_CHAR = 0; /// /// Doc prefix wasn't XML /// public const byte XML_TARGET = 1; /// /// More than one attribute with the same name on the same element /// public const byte DUPLICATE_ATTRIBUTE = 2; /// /// Some other type of bad token detected /// /// /// public InvalidTokenException(int offset, byte type) { this.offset = offset; this.type = type; } /// /// Illegal character detected /// /// public InvalidTokenException(int offset) { this.offset = offset; this.type = ILLEGAL_CHAR; } /// /// Offset into the buffer where the problem ocurred. /// public int Offset { get { return this.offset; } } /// /// Type of exception /// public int Type { get { return this.type; } } } /** * Thrown to indicate that the subarray being tokenized is not the * complete encoding of one or more characters, but might be if * more bytes were added. * @version $Revision: 1.2 $ $Date: 1998/02/17 04:24:11 $ */ public class PartialCharException : PartialTokenException { private int leadByteIndex; /// /// /// /// public PartialCharException(int leadByteIndex) { this.leadByteIndex = leadByteIndex; } /** * Returns the index of the first byte that is not part of the complete * encoding of a character. */ public int LeadByteIndex { get { return leadByteIndex; } } } /// /// A partial token was received. Try again, after you add more bytes to the buffer. /// public class PartialTokenException : TokenException { } }smuxi-0.11/lib/agsxmpp/agsxmpp/Xml/StreamParser.cs0000644000175000017500000004134312250206660023005 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.IO; using System.Threading; using System.Collections; using agsXMPP.Xml; using agsXMPP.Xml.Dom; using agsXMPP.Factory; using agsXMPP.Xml.Xpnet; using agsXMPP.protocol.client; namespace agsXMPP.Xml { public delegate void StreamError (object sender, Exception ex); public delegate void StreamHandler (object sender, Node e); /// /// Stream Parser is a lighweight Streaming XML Parser. /// public class StreamParser { // Stream Event Handlers public event StreamHandler OnStreamStart; public event StreamHandler OnStreamEnd; public event EventHandler OnStreamElement; public event EventHandler StreamElementNotHandled; /// /// Event for XML-Stream errors /// public event StreamError OnStreamError; /// /// Event for general errors /// public event ErrorHandler OnError; private int m_Depth; private Node m_root; private Element current; private static System.Text.Encoding utf = System.Text.Encoding.UTF8; private Encoding m_enc = new UTF8Encoding(); private BufferAggregate m_buf = new BufferAggregate(); private NamespaceStack m_NamespaceStack = new NamespaceStack(); private bool m_cdata; public StreamParser() { } /// /// Reset the XML Stream /// public void Reset() { m_Depth = 0; m_root = null; current = null; m_cdata = false; m_buf = null; m_buf = new BufferAggregate(); //m_buf.Clear(0); m_NamespaceStack.Clear(); } /// /// Reset the XML Stream /// /// new Stream that is used for parsing public long Depth { get { return m_Depth; } } private Object thisLock = new Object(); /// /// Put bytes into the parser. /// /// The bytes to put into the parse stream /// Offset into buf to start at /// Number of bytes to write public void Push(byte[] buf, int offset, int length) { // or assert, really, but this is a little nicer. if (length == 0) return; // No locking is required. Read() won't get called again // until this method returns. // TODO: only do this copy if we have a partial token at the // end of parsing. byte[] copy = new byte[length]; System.Buffer.BlockCopy(buf, offset, copy, 0, length); m_buf.Write(copy); byte[] b = m_buf.GetBuffer(); int off = 0; TOK tok = TOK.END_TAG; ContentToken ct = new ContentToken(); try { while (off < b.Length) { if (m_cdata) tok = m_enc.tokenizeCdataSection(b, off, b.Length, ct); else tok = m_enc.tokenizeContent(b, off, b.Length, ct); switch (tok) { case TOK.EMPTY_ELEMENT_NO_ATTS: case TOK.EMPTY_ELEMENT_WITH_ATTS: StartTag(b, off, ct, tok); EndTag(b, off, ct, tok); break; case TOK.START_TAG_NO_ATTS: case TOK.START_TAG_WITH_ATTS: StartTag(b, off, ct, tok); break; case TOK.END_TAG: EndTag(b, off, ct, tok); break; case TOK.DATA_CHARS: case TOK.DATA_NEWLINE: AddText(utf.GetString(b, off, ct.TokenEnd - off)); break; case TOK.CHAR_REF: case TOK.MAGIC_ENTITY_REF: AddText(new string(new char[] { ct.RefChar1 })); break; case TOK.CHAR_PAIR_REF: AddText(new string(new char[] {ct.RefChar1, ct.RefChar2})); break; case TOK.COMMENT: if (current != null) { // 3 int start = off + 4 * m_enc.MinBytesPerChar; int end = ct.TokenEnd - off - 7 * m_enc.MinBytesPerChar; string text = utf.GetString(b, start, end); current.AddChild(new Comment(text)); } break; case TOK.CDATA_SECT_OPEN: m_cdata = true; break; case TOK.CDATA_SECT_CLOSE: m_cdata = false; break; case TOK.XML_DECL: // thou shalt use UTF8, and XML version 1. // i shall ignore evidence to the contrary... // TODO: Throw an exception if these assuptions are // wrong break; case TOK.ENTITY_REF: case TOK.PI: #if CF throw new util.NotImplementedException("Token type not implemented: " + tok); #else throw new System.NotImplementedException("Token type not implemented: " + tok); #endif } off = ct.TokenEnd; } } catch (PartialTokenException) { // ignored; } catch (ExtensibleTokenException) { // ignored; } catch (Exception ex) { if (OnStreamError != null) OnStreamError(this, ex); } finally { m_buf.Clear(off); } } private void StartTag(byte[] buf, int offset, ContentToken ct, TOK tok) { m_Depth++; int colon; string name; string prefix; Hashtable ht = new Hashtable(); m_NamespaceStack.Push(); // if i have attributes if ((tok == TOK.START_TAG_WITH_ATTS) || (tok == TOK.EMPTY_ELEMENT_WITH_ATTS)) { int start; int end; string val; for (int i=0; i // 0) { prefix = name.Substring(0, colon); name = name.Substring(colon + 1); ns = m_NamespaceStack.LookupNamespace(prefix); } else { ns = m_NamespaceStack.DefaultNamespace; } Element newel = ElementFactory.GetElement(prefix, name, ns); foreach (string attrname in ht.Keys) { newel.SetAttribute(attrname, (string)ht[attrname]); } if (m_root == null) { m_root = newel; //FireOnDocumentStart(m_root); if (OnStreamStart!=null) OnStreamStart(this, m_root); } else { if (current != null) current.AddChild(newel); current = newel; } } private void EndTag(byte[] buf, int offset, ContentToken ct, TOK tok) { m_Depth--; m_NamespaceStack.Pop(); if (current == null) {// end of doc if (OnStreamEnd!=null) OnStreamEnd(this, m_root); // FireOnDocumentEnd(); return; } string name = null; if ((tok == TOK.EMPTY_ELEMENT_WITH_ATTS) || (tok == TOK.EMPTY_ELEMENT_NO_ATTS)) name = utf.GetString(buf, offset + m_enc.MinBytesPerChar, ct.NameEnd - offset - m_enc.MinBytesPerChar); else name = utf.GetString(buf, offset + m_enc.MinBytesPerChar*2, ct.NameEnd - offset - m_enc.MinBytesPerChar*2); // if (current.Name != name) // throw new Exception("Invalid end tag: " + name + // " != " + current.Name); Element parent = (Element) current.Parent; if (parent == null) { DoRaiseOnStreamElement(current); //if (OnStreamElement!=null) // OnStreamElement(this, current); //FireOnElement(current); } current = parent; } /// /// If users didnt use the library correctly and had no local error handles /// it always crashed here and disconencted the socket. /// Catch this errors here now and foreward them. /// /// internal void DoRaiseOnStreamElement(Element el) { try { if (OnStreamElement != null) { var eventArgs = new ElementEventArgs(el); OnStreamElement(this, eventArgs); if (!eventArgs.Handled) { OnStreamElementNotHandled(el); } } } catch (Exception ex) { if (OnError != null) OnError(this, ex); } } void OnStreamElementNotHandled(Element el) { if (StreamElementNotHandled != null) { StreamElementNotHandled(this, new UnhandledElementEventArgs(el)); } } private string NormalizeAttributeValue(byte[] buf, int offset, int length) { if (length == 0) return null; string val = null; BufferAggregate buffer = new BufferAggregate(); byte[] copy = new byte[length]; System.Buffer.BlockCopy(buf, offset, copy, 0, length); buffer.Write(copy); byte[] b = buffer.GetBuffer(); int off = 0; TOK tok = TOK.END_TAG; ContentToken ct = new ContentToken(); try { while (off < b.Length) { //tok = m_enc.tokenizeContent(b, off, b.Length, ct); tok = m_enc.tokenizeAttributeValue(b, off, b.Length, ct); switch (tok) { case TOK.ATTRIBUTE_VALUE_S: case TOK.DATA_CHARS: case TOK.DATA_NEWLINE: val += (utf.GetString(b, off, ct.TokenEnd - off)); break; case TOK.CHAR_REF: case TOK.MAGIC_ENTITY_REF: val += new string(new char[] { ct.RefChar1 }); break; case TOK.CHAR_PAIR_REF: val += new string(new char[] {ct.RefChar1, ct.RefChar2}); break; case TOK.ENTITY_REF: #if CF throw new util.NotImplementedException("Token type not implemented: " + tok); #else throw new System.NotImplementedException("Token type not implemented: " + tok); #endif } off = ct.TokenEnd; } } catch (PartialTokenException) { // ignored; } catch (ExtensibleTokenException) { // ignored; } catch (Exception ex) { if (OnStreamError != null) OnStreamError(this, ex); } finally { buffer.Clear(off); } return val; } private void AddText(string text) { if (text == "") return; //Console.WriteLine("AddText:" + text); //Console.WriteLine(lastTOK); if (current != null) { if (m_cdata) { Node last = current.LastNode; if (last != null && last.NodeType == NodeType.Cdata) last.Value = last.Value + text; else current.AddChild(new CData(text)); } else { Node last = current.LastNode; if (last != null && last.NodeType == NodeType.Text) last.Value = last.Value + text; else current.AddChild(new Text(text)); } } else { // text in root element Node last = ((Element)m_root).LastNode; if (m_cdata) { if (last != null && last.NodeType == NodeType.Cdata) last.Value = last.Value + text; else m_root.AddChild(new CData(text)); } else { if (last != null && last.NodeType == NodeType.Text) last.Value = last.Value + text; else m_root.AddChild(new Text(text)); } } } } public class UnhandledElementEventArgs : EventArgs { public Element Element { get; private set; } public UnhandledElementEventArgs(Element el) { if (el == null) { throw new ArgumentNullException("el"); } Element = el; } } public class ElementEventArgs : EventArgs { public Element Element { get; private set; } public bool Handled { get; set; } public ElementEventArgs(Element el) { if (el == null) { throw new ArgumentNullException("el"); } Element = el; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Id.cs0000644000175000017500000000617312204443225020172 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP { public enum IdType { /// /// Numeric Id's are generated by increasing a long value /// Numeric, /// /// Guid Id's are unique, Guid packet Id's should be used for server and component applications, /// or apps which very long sessions (multiple days, weeks or years) /// Guid } /// /// This class takes care anout out unique Message Ids /// public class Id { public Id() { } private static long m_id = 0; private static string m_Prefix = "agsXMPP_"; private static IdType m_Type = IdType.Numeric; public static IdType Type { get { return m_Type; } #if !CF // readyonly on CF1 set { m_Type = value; } #endif } #if !CF public static string GetNextId() { if (m_Type == IdType.Numeric) { m_id++; return m_Prefix + m_id.ToString(); } else { return m_Prefix + Guid.NewGuid().ToString(); } } #else // On CF 1.0 we have no GUID class, so only increasing numberical id's are supported // We could create GUID's on CF 1.0 with the Crypto API if we want to. public static string GetNextId() { m_id++; return m_Prefix + m_id.ToString(); } #endif /// /// Reset the id counter to agsXmpp_1 again /// public static void Reset() { m_id = 0; } /// /// to Save Bandwidth on Mobile devices you can change the prefix /// null is also possible to optimize Bandwidth usage /// public static string Prefix { get { return m_Prefix; } set { if (value == null) m_Prefix = ""; else m_Prefix = value; } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/0000755000175000017500000000000012204443225020012 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/Punycode.cs0000644000175000017500000001446012204443225022134 0ustar00meebeymeebey00000000000000/// Copyright (C) 2004 Free Software Foundation, Inc. /// * /// Author: Alexander Gnauck AG-Software, mailto:gnauck@ag-software.de /// * /// This file is part of GNU Libidn. /// * /// This library is free software; you can redistribute it and/or /// modify it under the terms of the GNU Lesser General Public License /// as published by the Free Software Foundation; either version 2.1 of /// the License, or (at your option) any later version. /// * /// This library is distributed in the hope that it will be useful, but /// WITHOUT ANY WARRANTY; without even the implied warranty of /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU /// Lesser General Public License for more details. /// * /// You should have received a copy of the GNU Lesser General Public /// License along with this library; if not, write to the Free Software /// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 /// USA /// using System; using System.Text; namespace agsXMPP.Idn { public class Punycode { /* Punycode parameters */ internal const int TMIN = 1; internal const int TMAX = 26; internal const int BASE = 36; internal const int INITIAL_N = 128; internal const int INITIAL_BIAS = 72; internal const int DAMP = 700; internal const int SKEW = 38; internal const char DELIMITER = '-'; /// /// Punycodes a unicode string. /// /// Unicode string. /// Punycoded string. public static string Encode(string input) { int n = INITIAL_N; int delta = 0; int bias = INITIAL_BIAS; StringBuilder output = new StringBuilder(); // Copy all basic code points to the output int b = 0; for (int i = 0; i < input.Length; i++) { char c = input[i]; if (IsBasic(c)) { output.Append(c); b++; } } // Append delimiter if (b > 0) { output.Append(DELIMITER); } int h = b; while (h < input.Length) { int m = System.Int32.MaxValue; // Find the minimum code point >= n for (int i = 0; i < input.Length; i++) { int c = input[i]; if (c >= n && c < m) { m = c; } } if (m - n > (System.Int32.MaxValue - delta) / (h + 1)) { throw new PunycodeException(PunycodeException.OVERFLOW); } delta = delta + (m - n) * (h + 1); n = m; for (int j = 0; j < input.Length; j++) { int c = input[j]; if (c < n) { delta++; if (0 == delta) { throw new PunycodeException(PunycodeException.OVERFLOW); } } if (c == n) { int q = delta; for (int k = BASE; ; k += BASE) { int t; if (k <= bias) { t = TMIN; } else if (k >= bias + TMAX) { t = TMAX; } else { t = k - bias; } if (q < t) { break; } output.Append((char) Digit2Codepoint(t + (q - t) % (BASE - t))); q = (q - t) / (BASE - t); } output.Append((char) Digit2Codepoint(q)); bias = Adapt(delta, h + 1, h == b); delta = 0; h++; } } delta++; n++; } return output.ToString(); } /// /// Decode a punycoded string. /// /// Punycode string /// Unicode string. public static string Decode(string input) { int n = INITIAL_N; int i = 0; int bias = INITIAL_BIAS; StringBuilder output = new StringBuilder(); int d = input.LastIndexOf((System.Char) DELIMITER); if (d > 0) { for (int j = 0; j < d; j++) { char c = input[j]; if (!IsBasic(c)) { throw new PunycodeException(PunycodeException.BAD_INPUT); } output.Append(c); } d++; } else { d = 0; } while (d < input.Length) { int oldi = i; int w = 1; for (int k = BASE; ; k += BASE) { if (d == input.Length) { throw new PunycodeException(PunycodeException.BAD_INPUT); } int c = input[d++]; int digit = Codepoint2Digit(c); if (digit > (System.Int32.MaxValue - i) / w) { throw new PunycodeException(PunycodeException.OVERFLOW); } i = i + digit * w; int t; if (k <= bias) { t = TMIN; } else if (k >= bias + TMAX) { t = TMAX; } else { t = k - bias; } if (digit < t) { break; } w = w * (BASE - t); } bias = Adapt(i - oldi, output.Length + 1, oldi == 0); if (i / (output.Length + 1) > Int32.MaxValue - n) { throw new PunycodeException(PunycodeException.OVERFLOW); } n = n + i / (output.Length + 1); i = i % (output.Length + 1); // following overload is not supported on CF //output.Insert(i,(char) n); output.Insert(i, new char[1] { (char) n }); i++; } return output.ToString(); } public static int Adapt(int delta, int numpoints, bool first) { if (first) { delta = delta / DAMP; } else { delta = delta / 2; } delta = delta + (delta / numpoints); int k = 0; while (delta > ((BASE - TMIN) * TMAX) / 2) { delta = delta / (BASE - TMIN); k = k + BASE; } return k + ((BASE - TMIN + 1) * delta) / (delta + SKEW); } public static bool IsBasic(char c) { return c < 0x80; } public static int Digit2Codepoint(int d) { if (d < 26) { // 0..25 : 'a'..'z' return d + 'a'; } else if (d < 36) { // 26..35 : '0'..'9'; return d - 26 + '0'; } else { throw new PunycodeException(PunycodeException.BAD_INPUT); } } public static int Codepoint2Digit(int c) { if (c - '0' < 10) { // '0'..'9' : 26..35 return c - '0' + 26; } else if (c - 'a' < 26) { // 'a'..'z' : 0..25 return c - 'a'; } else { throw new PunycodeException(PunycodeException.BAD_INPUT); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/RFC3454.cs0000644000175000017500000055516612204443225021315 0ustar00meebeymeebey00000000000000// Do not edit !!! // this file is generated automatically using System; namespace agsXMPP.Idn { public class RFC3454 { public static char[][] A1 = new char[][] { new char[] { '\u0221' }, /* 0221 */ new char[] { '\u0234', '\u024F' }, /* 0234-024F */ new char[] { '\u02AE', '\u02AF' }, /* 02AE-02AF */ new char[] { '\u02EF', '\u02FF' }, /* 02EF-02FF */ new char[] { '\u0350', '\u035F' }, /* 0350-035F */ new char[] { '\u0370', '\u0373' }, /* 0370-0373 */ new char[] { '\u0376', '\u0379' }, /* 0376-0379 */ new char[] { '\u037B', '\u037D' }, /* 037B-037D */ new char[] { '\u037F', '\u0383' }, /* 037F-0383 */ new char[] { '\u038B' }, /* 038B */ new char[] { '\u038D' }, /* 038D */ new char[] { '\u03A2' }, /* 03A2 */ new char[] { '\u03CF' }, /* 03CF */ new char[] { '\u03F7', '\u03FF' }, /* 03F7-03FF */ new char[] { '\u0487' }, /* 0487 */ new char[] { '\u04CF' }, /* 04CF */ new char[] { '\u04F6', '\u04F7' }, /* 04F6-04F7 */ new char[] { '\u04FA', '\u04FF' }, /* 04FA-04FF */ new char[] { '\u0510', '\u0530' }, /* 0510-0530 */ new char[] { '\u0557', '\u0558' }, /* 0557-0558 */ new char[] { '\u0560' }, /* 0560 */ new char[] { '\u0588' }, /* 0588 */ new char[] { '\u058B', '\u0590' }, /* 058B-0590 */ new char[] { '\u05A2' }, /* 05A2 */ new char[] { '\u05BA' }, /* 05BA */ new char[] { '\u05C5', '\u05CF' }, /* 05C5-05CF */ new char[] { '\u05EB', '\u05EF' }, /* 05EB-05EF */ new char[] { '\u05F5', '\u060B' }, /* 05F5-060B */ new char[] { '\u060D', '\u061A' }, /* 060D-061A */ new char[] { '\u061C', '\u061E' }, /* 061C-061E */ new char[] { '\u0620' }, /* 0620 */ new char[] { '\u063B', '\u063F' }, /* 063B-063F */ new char[] { '\u0656', '\u065F' }, /* 0656-065F */ new char[] { '\u06EE', '\u06EF' }, /* 06EE-06EF */ new char[] { '\u06FF' }, /* 06FF */ new char[] { '\u070E' }, /* 070E */ new char[] { '\u072D', '\u072F' }, /* 072D-072F */ new char[] { '\u074B', '\u077F' }, /* 074B-077F */ new char[] { '\u07B2', '\u0900' }, /* 07B2-0900 */ new char[] { '\u0904' }, /* 0904 */ new char[] { '\u093A', '\u093B' }, /* 093A-093B */ new char[] { '\u094E', '\u094F' }, /* 094E-094F */ new char[] { '\u0955', '\u0957' }, /* 0955-0957 */ new char[] { '\u0971', '\u0980' }, /* 0971-0980 */ new char[] { '\u0984' }, /* 0984 */ new char[] { '\u098D', '\u098E' }, /* 098D-098E */ new char[] { '\u0991', '\u0992' }, /* 0991-0992 */ new char[] { '\u09A9' }, /* 09A9 */ new char[] { '\u09B1' }, /* 09B1 */ new char[] { '\u09B3', '\u09B5' }, /* 09B3-09B5 */ new char[] { '\u09BA', '\u09BB' }, /* 09BA-09BB */ new char[] { '\u09BD' }, /* 09BD */ new char[] { '\u09C5', '\u09C6' }, /* 09C5-09C6 */ new char[] { '\u09C9', '\u09CA' }, /* 09C9-09CA */ new char[] { '\u09CE', '\u09D6' }, /* 09CE-09D6 */ new char[] { '\u09D8', '\u09DB' }, /* 09D8-09DB */ new char[] { '\u09DE' }, /* 09DE */ new char[] { '\u09E4', '\u09E5' }, /* 09E4-09E5 */ new char[] { '\u09FB', '\u0A01' }, /* 09FB-0A01 */ new char[] { '\u0A03', '\u0A04' }, /* 0A03-0A04 */ new char[] { '\u0A0B', '\u0A0E' }, /* 0A0B-0A0E */ new char[] { '\u0A11', '\u0A12' }, /* 0A11-0A12 */ new char[] { '\u0A29' }, /* 0A29 */ new char[] { '\u0A31' }, /* 0A31 */ new char[] { '\u0A34' }, /* 0A34 */ new char[] { '\u0A37' }, /* 0A37 */ new char[] { '\u0A3A', '\u0A3B' }, /* 0A3A-0A3B */ new char[] { '\u0A3D' }, /* 0A3D */ new char[] { '\u0A43', '\u0A46' }, /* 0A43-0A46 */ new char[] { '\u0A49', '\u0A4A' }, /* 0A49-0A4A */ new char[] { '\u0A4E', '\u0A58' }, /* 0A4E-0A58 */ new char[] { '\u0A5D' }, /* 0A5D */ new char[] { '\u0A5F', '\u0A65' }, /* 0A5F-0A65 */ new char[] { '\u0A75', '\u0A80' }, /* 0A75-0A80 */ new char[] { '\u0A84' }, /* 0A84 */ new char[] { '\u0A8C' }, /* 0A8C */ new char[] { '\u0A8E' }, /* 0A8E */ new char[] { '\u0A92' }, /* 0A92 */ new char[] { '\u0AA9' }, /* 0AA9 */ new char[] { '\u0AB1' }, /* 0AB1 */ new char[] { '\u0AB4' }, /* 0AB4 */ new char[] { '\u0ABA', '\u0ABB' }, /* 0ABA-0ABB */ new char[] { '\u0AC6' }, /* 0AC6 */ new char[] { '\u0ACA' }, /* 0ACA */ new char[] { '\u0ACE', '\u0ACF' }, /* 0ACE-0ACF */ new char[] { '\u0AD1', '\u0ADF' }, /* 0AD1-0ADF */ new char[] { '\u0AE1', '\u0AE5' }, /* 0AE1-0AE5 */ new char[] { '\u0AF0', '\u0B00' }, /* 0AF0-0B00 */ new char[] { '\u0B04' }, /* 0B04 */ new char[] { '\u0B0D', '\u0B0E' }, /* 0B0D-0B0E */ new char[] { '\u0B11', '\u0B12' }, /* 0B11-0B12 */ new char[] { '\u0B29' }, /* 0B29 */ new char[] { '\u0B31' }, /* 0B31 */ new char[] { '\u0B34', '\u0B35' }, /* 0B34-0B35 */ new char[] { '\u0B3A', '\u0B3B' }, /* 0B3A-0B3B */ new char[] { '\u0B44', '\u0B46' }, /* 0B44-0B46 */ new char[] { '\u0B49', '\u0B4A' }, /* 0B49-0B4A */ new char[] { '\u0B4E', '\u0B55' }, /* 0B4E-0B55 */ new char[] { '\u0B58', '\u0B5B' }, /* 0B58-0B5B */ new char[] { '\u0B5E' }, /* 0B5E */ new char[] { '\u0B62', '\u0B65' }, /* 0B62-0B65 */ new char[] { '\u0B71', '\u0B81' }, /* 0B71-0B81 */ new char[] { '\u0B84' }, /* 0B84 */ new char[] { '\u0B8B', '\u0B8D' }, /* 0B8B-0B8D */ new char[] { '\u0B91' }, /* 0B91 */ new char[] { '\u0B96', '\u0B98' }, /* 0B96-0B98 */ new char[] { '\u0B9B' }, /* 0B9B */ new char[] { '\u0B9D' }, /* 0B9D */ new char[] { '\u0BA0', '\u0BA2' }, /* 0BA0-0BA2 */ new char[] { '\u0BA5', '\u0BA7' }, /* 0BA5-0BA7 */ new char[] { '\u0BAB', '\u0BAD' }, /* 0BAB-0BAD */ new char[] { '\u0BB6' }, /* 0BB6 */ new char[] { '\u0BBA', '\u0BBD' }, /* 0BBA-0BBD */ new char[] { '\u0BC3', '\u0BC5' }, /* 0BC3-0BC5 */ new char[] { '\u0BC9' }, /* 0BC9 */ new char[] { '\u0BCE', '\u0BD6' }, /* 0BCE-0BD6 */ new char[] { '\u0BD8', '\u0BE6' }, /* 0BD8-0BE6 */ new char[] { '\u0BF3', '\u0C00' }, /* 0BF3-0C00 */ new char[] { '\u0C04' }, /* 0C04 */ new char[] { '\u0C0D' }, /* 0C0D */ new char[] { '\u0C11' }, /* 0C11 */ new char[] { '\u0C29' }, /* 0C29 */ new char[] { '\u0C34' }, /* 0C34 */ new char[] { '\u0C3A', '\u0C3D' }, /* 0C3A-0C3D */ new char[] { '\u0C45' }, /* 0C45 */ new char[] { '\u0C49' }, /* 0C49 */ new char[] { '\u0C4E', '\u0C54' }, /* 0C4E-0C54 */ new char[] { '\u0C57', '\u0C5F' }, /* 0C57-0C5F */ new char[] { '\u0C62', '\u0C65' }, /* 0C62-0C65 */ new char[] { '\u0C70', '\u0C81' }, /* 0C70-0C81 */ new char[] { '\u0C84' }, /* 0C84 */ new char[] { '\u0C8D' }, /* 0C8D */ new char[] { '\u0C91' }, /* 0C91 */ new char[] { '\u0CA9' }, /* 0CA9 */ new char[] { '\u0CB4' }, /* 0CB4 */ new char[] { '\u0CBA', '\u0CBD' }, /* 0CBA-0CBD */ new char[] { '\u0CC5' }, /* 0CC5 */ new char[] { '\u0CC9' }, /* 0CC9 */ new char[] { '\u0CCE', '\u0CD4' }, /* 0CCE-0CD4 */ new char[] { '\u0CD7', '\u0CDD' }, /* 0CD7-0CDD */ new char[] { '\u0CDF' }, /* 0CDF */ new char[] { '\u0CE2', '\u0CE5' }, /* 0CE2-0CE5 */ new char[] { '\u0CF0', '\u0D01' }, /* 0CF0-0D01 */ new char[] { '\u0D04' }, /* 0D04 */ new char[] { '\u0D0D' }, /* 0D0D */ new char[] { '\u0D11' }, /* 0D11 */ new char[] { '\u0D29' }, /* 0D29 */ new char[] { '\u0D3A', '\u0D3D' }, /* 0D3A-0D3D */ new char[] { '\u0D44', '\u0D45' }, /* 0D44-0D45 */ new char[] { '\u0D49' }, /* 0D49 */ new char[] { '\u0D4E', '\u0D56' }, /* 0D4E-0D56 */ new char[] { '\u0D58', '\u0D5F' }, /* 0D58-0D5F */ new char[] { '\u0D62', '\u0D65' }, /* 0D62-0D65 */ new char[] { '\u0D70', '\u0D81' }, /* 0D70-0D81 */ new char[] { '\u0D84' }, /* 0D84 */ new char[] { '\u0D97', '\u0D99' }, /* 0D97-0D99 */ new char[] { '\u0DB2' }, /* 0DB2 */ new char[] { '\u0DBC' }, /* 0DBC */ new char[] { '\u0DBE', '\u0DBF' }, /* 0DBE-0DBF */ new char[] { '\u0DC7', '\u0DC9' }, /* 0DC7-0DC9 */ new char[] { '\u0DCB', '\u0DCE' }, /* 0DCB-0DCE */ new char[] { '\u0DD5' }, /* 0DD5 */ new char[] { '\u0DD7' }, /* 0DD7 */ new char[] { '\u0DE0', '\u0DF1' }, /* 0DE0-0DF1 */ new char[] { '\u0DF5', '\u0E00' }, /* 0DF5-0E00 */ new char[] { '\u0E3B', '\u0E3E' }, /* 0E3B-0E3E */ new char[] { '\u0E5C', '\u0E80' }, /* 0E5C-0E80 */ new char[] { '\u0E83' }, /* 0E83 */ new char[] { '\u0E85', '\u0E86' }, /* 0E85-0E86 */ new char[] { '\u0E89' }, /* 0E89 */ new char[] { '\u0E8B', '\u0E8C' }, /* 0E8B-0E8C */ new char[] { '\u0E8E', '\u0E93' }, /* 0E8E-0E93 */ new char[] { '\u0E98' }, /* 0E98 */ new char[] { '\u0EA0' }, /* 0EA0 */ new char[] { '\u0EA4' }, /* 0EA4 */ new char[] { '\u0EA6' }, /* 0EA6 */ new char[] { '\u0EA8', '\u0EA9' }, /* 0EA8-0EA9 */ new char[] { '\u0EAC' }, /* 0EAC */ new char[] { '\u0EBA' }, /* 0EBA */ new char[] { '\u0EBE', '\u0EBF' }, /* 0EBE-0EBF */ new char[] { '\u0EC5' }, /* 0EC5 */ new char[] { '\u0EC7' }, /* 0EC7 */ new char[] { '\u0ECE', '\u0ECF' }, /* 0ECE-0ECF */ new char[] { '\u0EDA', '\u0EDB' }, /* 0EDA-0EDB */ new char[] { '\u0EDE', '\u0EFF' }, /* 0EDE-0EFF */ new char[] { '\u0F48' }, /* 0F48 */ new char[] { '\u0F6B', '\u0F70' }, /* 0F6B-0F70 */ new char[] { '\u0F8C', '\u0F8F' }, /* 0F8C-0F8F */ new char[] { '\u0F98' }, /* 0F98 */ new char[] { '\u0FBD' }, /* 0FBD */ new char[] { '\u0FCD', '\u0FCE' }, /* 0FCD-0FCE */ new char[] { '\u0FD0', '\u0FFF' }, /* 0FD0-0FFF */ new char[] { '\u1022' }, /* 1022 */ new char[] { '\u1028' }, /* 1028 */ new char[] { '\u102B' }, /* 102B */ new char[] { '\u1033', '\u1035' }, /* 1033-1035 */ new char[] { '\u103A', '\u103F' }, /* 103A-103F */ new char[] { '\u105A', '\u109F' }, /* 105A-109F */ new char[] { '\u10C6', '\u10CF' }, /* 10C6-10CF */ new char[] { '\u10F9', '\u10FA' }, /* 10F9-10FA */ new char[] { '\u10FC', '\u10FF' }, /* 10FC-10FF */ new char[] { '\u115A', '\u115E' }, /* 115A-115E */ new char[] { '\u11A3', '\u11A7' }, /* 11A3-11A7 */ new char[] { '\u11FA', '\u11FF' }, /* 11FA-11FF */ new char[] { '\u1207' }, /* 1207 */ new char[] { '\u1247' }, /* 1247 */ new char[] { '\u1249' }, /* 1249 */ new char[] { '\u124E', '\u124F' }, /* 124E-124F */ new char[] { '\u1257' }, /* 1257 */ new char[] { '\u1259' }, /* 1259 */ new char[] { '\u125E', '\u125F' }, /* 125E-125F */ new char[] { '\u1287' }, /* 1287 */ new char[] { '\u1289' }, /* 1289 */ new char[] { '\u128E', '\u128F' }, /* 128E-128F */ new char[] { '\u12AF' }, /* 12AF */ new char[] { '\u12B1' }, /* 12B1 */ new char[] { '\u12B6', '\u12B7' }, /* 12B6-12B7 */ new char[] { '\u12BF' }, /* 12BF */ new char[] { '\u12C1' }, /* 12C1 */ new char[] { '\u12C6', '\u12C7' }, /* 12C6-12C7 */ new char[] { '\u12CF' }, /* 12CF */ new char[] { '\u12D7' }, /* 12D7 */ new char[] { '\u12EF' }, /* 12EF */ new char[] { '\u130F' }, /* 130F */ new char[] { '\u1311' }, /* 1311 */ new char[] { '\u1316', '\u1317' }, /* 1316-1317 */ new char[] { '\u131F' }, /* 131F */ new char[] { '\u1347' }, /* 1347 */ new char[] { '\u135B', '\u1360' }, /* 135B-1360 */ new char[] { '\u137D', '\u139F' }, /* 137D-139F */ new char[] { '\u13F5', '\u1400' }, /* 13F5-1400 */ new char[] { '\u1677', '\u167F' }, /* 1677-167F */ new char[] { '\u169D', '\u169F' }, /* 169D-169F */ new char[] { '\u16F1', '\u16FF' }, /* 16F1-16FF */ new char[] { '\u170D' }, /* 170D */ new char[] { '\u1715', '\u171F' }, /* 1715-171F */ new char[] { '\u1737', '\u173F' }, /* 1737-173F */ new char[] { '\u1754', '\u175F' }, /* 1754-175F */ new char[] { '\u176D' }, /* 176D */ new char[] { '\u1771' }, /* 1771 */ new char[] { '\u1774', '\u177F' }, /* 1774-177F */ new char[] { '\u17DD', '\u17DF' }, /* 17DD-17DF */ new char[] { '\u17EA', '\u17FF' }, /* 17EA-17FF */ new char[] { '\u180F' }, /* 180F */ new char[] { '\u181A', '\u181F' }, /* 181A-181F */ new char[] { '\u1878', '\u187F' }, /* 1878-187F */ new char[] { '\u18AA', '\u1DFF' }, /* 18AA-1DFF */ new char[] { '\u1E9C', '\u1E9F' }, /* 1E9C-1E9F */ new char[] { '\u1EFA', '\u1EFF' }, /* 1EFA-1EFF */ new char[] { '\u1F16', '\u1F17' }, /* 1F16-1F17 */ new char[] { '\u1F1E', '\u1F1F' }, /* 1F1E-1F1F */ new char[] { '\u1F46', '\u1F47' }, /* 1F46-1F47 */ new char[] { '\u1F4E', '\u1F4F' }, /* 1F4E-1F4F */ new char[] { '\u1F58' }, /* 1F58 */ new char[] { '\u1F5A' }, /* 1F5A */ new char[] { '\u1F5C' }, /* 1F5C */ new char[] { '\u1F5E' }, /* 1F5E */ new char[] { '\u1F7E', '\u1F7F' }, /* 1F7E-1F7F */ new char[] { '\u1FB5' }, /* 1FB5 */ new char[] { '\u1FC5' }, /* 1FC5 */ new char[] { '\u1FD4', '\u1FD5' }, /* 1FD4-1FD5 */ new char[] { '\u1FDC' }, /* 1FDC */ new char[] { '\u1FF0', '\u1FF1' }, /* 1FF0-1FF1 */ new char[] { '\u1FF5' }, /* 1FF5 */ new char[] { '\u1FFF' }, /* 1FFF */ new char[] { '\u2053', '\u2056' }, /* 2053-2056 */ new char[] { '\u2058', '\u205E' }, /* 2058-205E */ new char[] { '\u2064', '\u2069' }, /* 2064-2069 */ new char[] { '\u2072', '\u2073' }, /* 2072-2073 */ new char[] { '\u208F', '\u209F' }, /* 208F-209F */ new char[] { '\u20B2', '\u20CF' }, /* 20B2-20CF */ new char[] { '\u20EB', '\u20FF' }, /* 20EB-20FF */ new char[] { '\u213B', '\u213C' }, /* 213B-213C */ new char[] { '\u214C', '\u2152' }, /* 214C-2152 */ new char[] { '\u2184', '\u218F' }, /* 2184-218F */ new char[] { '\u23CF', '\u23FF' }, /* 23CF-23FF */ new char[] { '\u2427', '\u243F' }, /* 2427-243F */ new char[] { '\u244B', '\u245F' }, /* 244B-245F */ new char[] { '\u24FF' }, /* 24FF */ new char[] { '\u2614', '\u2615' }, /* 2614-2615 */ new char[] { '\u2618' }, /* 2618 */ new char[] { '\u267E', '\u267F' }, /* 267E-267F */ new char[] { '\u268A', '\u2700' }, /* 268A-2700 */ new char[] { '\u2705' }, /* 2705 */ new char[] { '\u270A', '\u270B' }, /* 270A-270B */ new char[] { '\u2728' }, /* 2728 */ new char[] { '\u274C' }, /* 274C */ new char[] { '\u274E' }, /* 274E */ new char[] { '\u2753', '\u2755' }, /* 2753-2755 */ new char[] { '\u2757' }, /* 2757 */ new char[] { '\u275F', '\u2760' }, /* 275F-2760 */ new char[] { '\u2795', '\u2797' }, /* 2795-2797 */ new char[] { '\u27B0' }, /* 27B0 */ new char[] { '\u27BF', '\u27CF' }, /* 27BF-27CF */ new char[] { '\u27EC', '\u27EF' }, /* 27EC-27EF */ new char[] { '\u2B00', '\u2E7F' }, /* 2B00-2E7F */ new char[] { '\u2E9A' }, /* 2E9A */ new char[] { '\u2EF4', '\u2EFF' }, /* 2EF4-2EFF */ new char[] { '\u2FD6', '\u2FEF' }, /* 2FD6-2FEF */ new char[] { '\u2FFC', '\u2FFF' }, /* 2FFC-2FFF */ new char[] { '\u3040' }, /* 3040 */ new char[] { '\u3097', '\u3098' }, /* 3097-3098 */ new char[] { '\u3100', '\u3104' }, /* 3100-3104 */ new char[] { '\u312D', '\u3130' }, /* 312D-3130 */ new char[] { '\u318F' }, /* 318F */ new char[] { '\u31B8', '\u31EF' }, /* 31B8-31EF */ new char[] { '\u321D', '\u321F' }, /* 321D-321F */ new char[] { '\u3244', '\u3250' }, /* 3244-3250 */ new char[] { '\u327C', '\u327E' }, /* 327C-327E */ new char[] { '\u32CC', '\u32CF' }, /* 32CC-32CF */ new char[] { '\u32FF' }, /* 32FF */ new char[] { '\u3377', '\u337A' }, /* 3377-337A */ new char[] { '\u33DE', '\u33DF' }, /* 33DE-33DF */ new char[] { '\u33FF' }, /* 33FF */ new char[] { '\u4DB6', '\u4DFF' }, /* 4DB6-4DFF */ new char[] { '\u9FA6', '\u9FFF' }, /* 9FA6-9FFF */ new char[] { '\uA48D', '\uA48F' }, /* A48D-A48F */ new char[] { '\uA4C7', '\uABFF' }, /* A4C7-ABFF */ new char[] { '\uD7A4', '\uD7FF' }, /* D7A4-D7FF */ new char[] { '\uFA2E', '\uFA2F' }, /* FA2E-FA2F */ new char[] { '\uFA6B', '\uFAFF' }, /* FA6B-FAFF */ new char[] { '\uFB07', '\uFB12' }, /* FB07-FB12 */ new char[] { '\uFB18', '\uFB1C' }, /* FB18-FB1C */ new char[] { '\uFB37' }, /* FB37 */ new char[] { '\uFB3D' }, /* FB3D */ new char[] { '\uFB3F' }, /* FB3F */ new char[] { '\uFB42' }, /* FB42 */ new char[] { '\uFB45' }, /* FB45 */ new char[] { '\uFBB2', '\uFBD2' }, /* FBB2-FBD2 */ new char[] { '\uFD40', '\uFD4F' }, /* FD40-FD4F */ new char[] { '\uFD90', '\uFD91' }, /* FD90-FD91 */ new char[] { '\uFDC8', '\uFDCF' }, /* FDC8-FDCF */ new char[] { '\uFDFD', '\uFDFF' }, /* FDFD-FDFF */ new char[] { '\uFE10', '\uFE1F' }, /* FE10-FE1F */ new char[] { '\uFE24', '\uFE2F' }, /* FE24-FE2F */ new char[] { '\uFE47', '\uFE48' }, /* FE47-FE48 */ new char[] { '\uFE53' }, /* FE53 */ new char[] { '\uFE67' }, /* FE67 */ new char[] { '\uFE6C', '\uFE6F' }, /* FE6C-FE6F */ new char[] { '\uFE75' }, /* FE75 */ new char[] { '\uFEFD', '\uFEFE' }, /* FEFD-FEFE */ new char[] { '\uFF00' }, /* FF00 */ new char[] { '\uFFBF', '\uFFC1' }, /* FFBF-FFC1 */ new char[] { '\uFFC8', '\uFFC9' }, /* FFC8-FFC9 */ new char[] { '\uFFD0', '\uFFD1' }, /* FFD0-FFD1 */ new char[] { '\uFFD8', '\uFFD9' }, /* FFD8-FFD9 */ new char[] { '\uFFDD', '\uFFDF' }, /* FFDD-FFDF */ new char[] { '\uFFE7' }, /* FFE7 */ new char[] { '\uFFEF', '\uFFF8' }, /* FFEF-FFF8 */ /* Skip characters outside the range of .NET unicode 10000-102FF */ /* Skip characters outside the range of .NET unicode 1031F */ /* Skip characters outside the range of .NET unicode 10324-1032F */ /* Skip characters outside the range of .NET unicode 1034B-103FF */ /* Skip characters outside the range of .NET unicode 10426-10427 */ /* Skip characters outside the range of .NET unicode 1044E-1CFFF */ /* Skip characters outside the range of .NET unicode 1D0F6-1D0FF */ /* Skip characters outside the range of .NET unicode 1D127-1D129 */ /* Skip characters outside the range of .NET unicode 1D1DE-1D3FF */ /* Skip characters outside the range of .NET unicode 1D455 */ /* Skip characters outside the range of .NET unicode 1D49D */ /* Skip characters outside the range of .NET unicode 1D4A0-1D4A1 */ /* Skip characters outside the range of .NET unicode 1D4A3-1D4A4 */ /* Skip characters outside the range of .NET unicode 1D4A7-1D4A8 */ /* Skip characters outside the range of .NET unicode 1D4AD */ /* Skip characters outside the range of .NET unicode 1D4BA */ /* Skip characters outside the range of .NET unicode 1D4BC */ /* Skip characters outside the range of .NET unicode 1D4C1 */ /* Skip characters outside the range of .NET unicode 1D4C4 */ /* Skip characters outside the range of .NET unicode 1D506 */ /* Skip characters outside the range of .NET unicode 1D50B-1D50C */ /* Skip characters outside the range of .NET unicode 1D515 */ /* Skip characters outside the range of .NET unicode 1D51D */ /* Skip characters outside the range of .NET unicode 1D53A */ /* Skip characters outside the range of .NET unicode 1D53F */ /* Skip characters outside the range of .NET unicode 1D545 */ /* Skip characters outside the range of .NET unicode 1D547-1D549 */ /* Skip characters outside the range of .NET unicode 1D551 */ /* Skip characters outside the range of .NET unicode 1D6A4-1D6A7 */ /* Skip characters outside the range of .NET unicode 1D7CA-1D7CD */ /* Skip characters outside the range of .NET unicode 1D800-1FFFD */ /* Skip characters outside the range of .NET unicode 2A6D7-2F7FF */ /* Skip characters outside the range of .NET unicode 2FA1E-2FFFD */ /* Skip characters outside the range of .NET unicode 30000-3FFFD */ /* Skip characters outside the range of .NET unicode 40000-4FFFD */ /* Skip characters outside the range of .NET unicode 50000-5FFFD */ /* Skip characters outside the range of .NET unicode 60000-6FFFD */ /* Skip characters outside the range of .NET unicode 70000-7FFFD */ /* Skip characters outside the range of .NET unicode 80000-8FFFD */ /* Skip characters outside the range of .NET unicode 90000-9FFFD */ /* Skip characters outside the range of .NET unicode A0000-AFFFD */ /* Skip characters outside the range of .NET unicode B0000-BFFFD */ /* Skip characters outside the range of .NET unicode C0000-CFFFD */ /* Skip characters outside the range of .NET unicode D0000-DFFFD */ /* Skip characters outside the range of .NET unicode E0000 */ /* Skip characters outside the range of .NET unicode E0002-E001F */ /* Skip characters outside the range of .NET unicode E0080-EFFFD */ }; public static char[] B1 = new char[] { '\u00AD', /* 00AD; ; Map to nothing */ '\u034F', /* 034F; ; Map to nothing */ '\u1806', /* 1806; ; Map to nothing */ '\u180B', /* 180B; ; Map to nothing */ '\u180C', /* 180C; ; Map to nothing */ '\u180D', /* 180D; ; Map to nothing */ '\u200B', /* 200B; ; Map to nothing */ '\u200C', /* 200C; ; Map to nothing */ '\u200D', /* 200D; ; Map to nothing */ '\u2060', /* 2060; ; Map to nothing */ '\uFE00', /* FE00; ; Map to nothing */ '\uFE01', /* FE01; ; Map to nothing */ '\uFE02', /* FE02; ; Map to nothing */ '\uFE03', /* FE03; ; Map to nothing */ '\uFE04', /* FE04; ; Map to nothing */ '\uFE05', /* FE05; ; Map to nothing */ '\uFE06', /* FE06; ; Map to nothing */ '\uFE07', /* FE07; ; Map to nothing */ '\uFE08', /* FE08; ; Map to nothing */ '\uFE09', /* FE09; ; Map to nothing */ '\uFE0A', /* FE0A; ; Map to nothing */ '\uFE0B', /* FE0B; ; Map to nothing */ '\uFE0C', /* FE0C; ; Map to nothing */ '\uFE0D', /* FE0D; ; Map to nothing */ '\uFE0E', /* FE0E; ; Map to nothing */ '\uFE0F', /* FE0F; ; Map to nothing */ '\uFEFF', /* FEFF; ; Map to nothing */ }; public static char[] B2search = new char[] { '\u0041', /*0041; 0061; Case map*/ '\u0042', /*0042; 0062; Case map*/ '\u0043', /*0043; 0063; Case map*/ '\u0044', /*0044; 0064; Case map*/ '\u0045', /*0045; 0065; Case map*/ '\u0046', /*0046; 0066; Case map*/ '\u0047', /*0047; 0067; Case map*/ '\u0048', /*0048; 0068; Case map*/ '\u0049', /*0049; 0069; Case map*/ '\u004A', /*004A; 006A; Case map*/ '\u004B', /*004B; 006B; Case map*/ '\u004C', /*004C; 006C; Case map*/ '\u004D', /*004D; 006D; Case map*/ '\u004E', /*004E; 006E; Case map*/ '\u004F', /*004F; 006F; Case map*/ '\u0050', /*0050; 0070; Case map*/ '\u0051', /*0051; 0071; Case map*/ '\u0052', /*0052; 0072; Case map*/ '\u0053', /*0053; 0073; Case map*/ '\u0054', /*0054; 0074; Case map*/ '\u0055', /*0055; 0075; Case map*/ '\u0056', /*0056; 0076; Case map*/ '\u0057', /*0057; 0077; Case map*/ '\u0058', /*0058; 0078; Case map*/ '\u0059', /*0059; 0079; Case map*/ '\u005A', /*005A; 007A; Case map*/ '\u00B5', /*00B5; 03BC; Case map*/ '\u00C0', /*00C0; 00E0; Case map*/ '\u00C1', /*00C1; 00E1; Case map*/ '\u00C2', /*00C2; 00E2; Case map*/ '\u00C3', /*00C3; 00E3; Case map*/ '\u00C4', /*00C4; 00E4; Case map*/ '\u00C5', /*00C5; 00E5; Case map*/ '\u00C6', /*00C6; 00E6; Case map*/ '\u00C7', /*00C7; 00E7; Case map*/ '\u00C8', /*00C8; 00E8; Case map*/ '\u00C9', /*00C9; 00E9; Case map*/ '\u00CA', /*00CA; 00EA; Case map*/ '\u00CB', /*00CB; 00EB; Case map*/ '\u00CC', /*00CC; 00EC; Case map*/ '\u00CD', /*00CD; 00ED; Case map*/ '\u00CE', /*00CE; 00EE; Case map*/ '\u00CF', /*00CF; 00EF; Case map*/ '\u00D0', /*00D0; 00F0; Case map*/ '\u00D1', /*00D1; 00F1; Case map*/ '\u00D2', /*00D2; 00F2; Case map*/ '\u00D3', /*00D3; 00F3; Case map*/ '\u00D4', /*00D4; 00F4; Case map*/ '\u00D5', /*00D5; 00F5; Case map*/ '\u00D6', /*00D6; 00F6; Case map*/ '\u00D8', /*00D8; 00F8; Case map*/ '\u00D9', /*00D9; 00F9; Case map*/ '\u00DA', /*00DA; 00FA; Case map*/ '\u00DB', /*00DB; 00FB; Case map*/ '\u00DC', /*00DC; 00FC; Case map*/ '\u00DD', /*00DD; 00FD; Case map*/ '\u00DE', /*00DE; 00FE; Case map*/ '\u00DF', /*00DF; 0073 0073; Case map*/ '\u0100', /*0100; 0101; Case map*/ '\u0102', /*0102; 0103; Case map*/ '\u0104', /*0104; 0105; Case map*/ '\u0106', /*0106; 0107; Case map*/ '\u0108', /*0108; 0109; Case map*/ '\u010A', /*010A; 010B; Case map*/ '\u010C', /*010C; 010D; Case map*/ '\u010E', /*010E; 010F; Case map*/ '\u0110', /*0110; 0111; Case map*/ '\u0112', /*0112; 0113; Case map*/ '\u0114', /*0114; 0115; Case map*/ '\u0116', /*0116; 0117; Case map*/ '\u0118', /*0118; 0119; Case map*/ '\u011A', /*011A; 011B; Case map*/ '\u011C', /*011C; 011D; Case map*/ '\u011E', /*011E; 011F; Case map*/ '\u0120', /*0120; 0121; Case map*/ '\u0122', /*0122; 0123; Case map*/ '\u0124', /*0124; 0125; Case map*/ '\u0126', /*0126; 0127; Case map*/ '\u0128', /*0128; 0129; Case map*/ '\u012A', /*012A; 012B; Case map*/ '\u012C', /*012C; 012D; Case map*/ '\u012E', /*012E; 012F; Case map*/ '\u0130', /*0130; 0069 0307; Case map*/ '\u0132', /*0132; 0133; Case map*/ '\u0134', /*0134; 0135; Case map*/ '\u0136', /*0136; 0137; Case map*/ '\u0139', /*0139; 013A; Case map*/ '\u013B', /*013B; 013C; Case map*/ '\u013D', /*013D; 013E; Case map*/ '\u013F', /*013F; 0140; Case map*/ '\u0141', /*0141; 0142; Case map*/ '\u0143', /*0143; 0144; Case map*/ '\u0145', /*0145; 0146; Case map*/ '\u0147', /*0147; 0148; Case map*/ '\u0149', /*0149; 02BC 006E; Case map*/ '\u014A', /*014A; 014B; Case map*/ '\u014C', /*014C; 014D; Case map*/ '\u014E', /*014E; 014F; Case map*/ '\u0150', /*0150; 0151; Case map*/ '\u0152', /*0152; 0153; Case map*/ '\u0154', /*0154; 0155; Case map*/ '\u0156', /*0156; 0157; Case map*/ '\u0158', /*0158; 0159; Case map*/ '\u015A', /*015A; 015B; Case map*/ '\u015C', /*015C; 015D; Case map*/ '\u015E', /*015E; 015F; Case map*/ '\u0160', /*0160; 0161; Case map*/ '\u0162', /*0162; 0163; Case map*/ '\u0164', /*0164; 0165; Case map*/ '\u0166', /*0166; 0167; Case map*/ '\u0168', /*0168; 0169; Case map*/ '\u016A', /*016A; 016B; Case map*/ '\u016C', /*016C; 016D; Case map*/ '\u016E', /*016E; 016F; Case map*/ '\u0170', /*0170; 0171; Case map*/ '\u0172', /*0172; 0173; Case map*/ '\u0174', /*0174; 0175; Case map*/ '\u0176', /*0176; 0177; Case map*/ '\u0178', /*0178; 00FF; Case map*/ '\u0179', /*0179; 017A; Case map*/ '\u017B', /*017B; 017C; Case map*/ '\u017D', /*017D; 017E; Case map*/ '\u017F', /*017F; 0073; Case map*/ '\u0181', /*0181; 0253; Case map*/ '\u0182', /*0182; 0183; Case map*/ '\u0184', /*0184; 0185; Case map*/ '\u0186', /*0186; 0254; Case map*/ '\u0187', /*0187; 0188; Case map*/ '\u0189', /*0189; 0256; Case map*/ '\u018A', /*018A; 0257; Case map*/ '\u018B', /*018B; 018C; Case map*/ '\u018E', /*018E; 01DD; Case map*/ '\u018F', /*018F; 0259; Case map*/ '\u0190', /*0190; 025B; Case map*/ '\u0191', /*0191; 0192; Case map*/ '\u0193', /*0193; 0260; Case map*/ '\u0194', /*0194; 0263; Case map*/ '\u0196', /*0196; 0269; Case map*/ '\u0197', /*0197; 0268; Case map*/ '\u0198', /*0198; 0199; Case map*/ '\u019C', /*019C; 026F; Case map*/ '\u019D', /*019D; 0272; Case map*/ '\u019F', /*019F; 0275; Case map*/ '\u01A0', /*01A0; 01A1; Case map*/ '\u01A2', /*01A2; 01A3; Case map*/ '\u01A4', /*01A4; 01A5; Case map*/ '\u01A6', /*01A6; 0280; Case map*/ '\u01A7', /*01A7; 01A8; Case map*/ '\u01A9', /*01A9; 0283; Case map*/ '\u01AC', /*01AC; 01AD; Case map*/ '\u01AE', /*01AE; 0288; Case map*/ '\u01AF', /*01AF; 01B0; Case map*/ '\u01B1', /*01B1; 028A; Case map*/ '\u01B2', /*01B2; 028B; Case map*/ '\u01B3', /*01B3; 01B4; Case map*/ '\u01B5', /*01B5; 01B6; Case map*/ '\u01B7', /*01B7; 0292; Case map*/ '\u01B8', /*01B8; 01B9; Case map*/ '\u01BC', /*01BC; 01BD; Case map*/ '\u01C4', /*01C4; 01C6; Case map*/ '\u01C5', /*01C5; 01C6; Case map*/ '\u01C7', /*01C7; 01C9; Case map*/ '\u01C8', /*01C8; 01C9; Case map*/ '\u01CA', /*01CA; 01CC; Case map*/ '\u01CB', /*01CB; 01CC; Case map*/ '\u01CD', /*01CD; 01CE; Case map*/ '\u01CF', /*01CF; 01D0; Case map*/ '\u01D1', /*01D1; 01D2; Case map*/ '\u01D3', /*01D3; 01D4; Case map*/ '\u01D5', /*01D5; 01D6; Case map*/ '\u01D7', /*01D7; 01D8; Case map*/ '\u01D9', /*01D9; 01DA; Case map*/ '\u01DB', /*01DB; 01DC; Case map*/ '\u01DE', /*01DE; 01DF; Case map*/ '\u01E0', /*01E0; 01E1; Case map*/ '\u01E2', /*01E2; 01E3; Case map*/ '\u01E4', /*01E4; 01E5; Case map*/ '\u01E6', /*01E6; 01E7; Case map*/ '\u01E8', /*01E8; 01E9; Case map*/ '\u01EA', /*01EA; 01EB; Case map*/ '\u01EC', /*01EC; 01ED; Case map*/ '\u01EE', /*01EE; 01EF; Case map*/ '\u01F0', /*01F0; 006A 030C; Case map*/ '\u01F1', /*01F1; 01F3; Case map*/ '\u01F2', /*01F2; 01F3; Case map*/ '\u01F4', /*01F4; 01F5; Case map*/ '\u01F6', /*01F6; 0195; Case map*/ '\u01F7', /*01F7; 01BF; Case map*/ '\u01F8', /*01F8; 01F9; Case map*/ '\u01FA', /*01FA; 01FB; Case map*/ '\u01FC', /*01FC; 01FD; Case map*/ '\u01FE', /*01FE; 01FF; Case map*/ '\u0200', /*0200; 0201; Case map*/ '\u0202', /*0202; 0203; Case map*/ '\u0204', /*0204; 0205; Case map*/ '\u0206', /*0206; 0207; Case map*/ '\u0208', /*0208; 0209; Case map*/ '\u020A', /*020A; 020B; Case map*/ '\u020C', /*020C; 020D; Case map*/ '\u020E', /*020E; 020F; Case map*/ '\u0210', /*0210; 0211; Case map*/ '\u0212', /*0212; 0213; Case map*/ '\u0214', /*0214; 0215; Case map*/ '\u0216', /*0216; 0217; Case map*/ '\u0218', /*0218; 0219; Case map*/ '\u021A', /*021A; 021B; Case map*/ '\u021C', /*021C; 021D; Case map*/ '\u021E', /*021E; 021F; Case map*/ '\u0220', /*0220; 019E; Case map*/ '\u0222', /*0222; 0223; Case map*/ '\u0224', /*0224; 0225; Case map*/ '\u0226', /*0226; 0227; Case map*/ '\u0228', /*0228; 0229; Case map*/ '\u022A', /*022A; 022B; Case map*/ '\u022C', /*022C; 022D; Case map*/ '\u022E', /*022E; 022F; Case map*/ '\u0230', /*0230; 0231; Case map*/ '\u0232', /*0232; 0233; Case map*/ '\u0345', /*0345; 03B9; Case map*/ '\u037A', /*037A; 0020 03B9; Additional folding*/ '\u0386', /*0386; 03AC; Case map*/ '\u0388', /*0388; 03AD; Case map*/ '\u0389', /*0389; 03AE; Case map*/ '\u038A', /*038A; 03AF; Case map*/ '\u038C', /*038C; 03CC; Case map*/ '\u038E', /*038E; 03CD; Case map*/ '\u038F', /*038F; 03CE; Case map*/ '\u0390', /*0390; 03B9 0308 0301; Case map*/ '\u0391', /*0391; 03B1; Case map*/ '\u0392', /*0392; 03B2; Case map*/ '\u0393', /*0393; 03B3; Case map*/ '\u0394', /*0394; 03B4; Case map*/ '\u0395', /*0395; 03B5; Case map*/ '\u0396', /*0396; 03B6; Case map*/ '\u0397', /*0397; 03B7; Case map*/ '\u0398', /*0398; 03B8; Case map*/ '\u0399', /*0399; 03B9; Case map*/ '\u039A', /*039A; 03BA; Case map*/ '\u039B', /*039B; 03BB; Case map*/ '\u039C', /*039C; 03BC; Case map*/ '\u039D', /*039D; 03BD; Case map*/ '\u039E', /*039E; 03BE; Case map*/ '\u039F', /*039F; 03BF; Case map*/ '\u03A0', /*03A0; 03C0; Case map*/ '\u03A1', /*03A1; 03C1; Case map*/ '\u03A3', /*03A3; 03C3; Case map*/ '\u03A4', /*03A4; 03C4; Case map*/ '\u03A5', /*03A5; 03C5; Case map*/ '\u03A6', /*03A6; 03C6; Case map*/ '\u03A7', /*03A7; 03C7; Case map*/ '\u03A8', /*03A8; 03C8; Case map*/ '\u03A9', /*03A9; 03C9; Case map*/ '\u03AA', /*03AA; 03CA; Case map*/ '\u03AB', /*03AB; 03CB; Case map*/ '\u03B0', /*03B0; 03C5 0308 0301; Case map*/ '\u03C2', /*03C2; 03C3; Case map*/ '\u03D0', /*03D0; 03B2; Case map*/ '\u03D1', /*03D1; 03B8; Case map*/ '\u03D2', /*03D2; 03C5; Additional folding*/ '\u03D3', /*03D3; 03CD; Additional folding*/ '\u03D4', /*03D4; 03CB; Additional folding*/ '\u03D5', /*03D5; 03C6; Case map*/ '\u03D6', /*03D6; 03C0; Case map*/ '\u03D8', /*03D8; 03D9; Case map*/ '\u03DA', /*03DA; 03DB; Case map*/ '\u03DC', /*03DC; 03DD; Case map*/ '\u03DE', /*03DE; 03DF; Case map*/ '\u03E0', /*03E0; 03E1; Case map*/ '\u03E2', /*03E2; 03E3; Case map*/ '\u03E4', /*03E4; 03E5; Case map*/ '\u03E6', /*03E6; 03E7; Case map*/ '\u03E8', /*03E8; 03E9; Case map*/ '\u03EA', /*03EA; 03EB; Case map*/ '\u03EC', /*03EC; 03ED; Case map*/ '\u03EE', /*03EE; 03EF; Case map*/ '\u03F0', /*03F0; 03BA; Case map*/ '\u03F1', /*03F1; 03C1; Case map*/ '\u03F2', /*03F2; 03C3; Case map*/ '\u03F4', /*03F4; 03B8; Case map*/ '\u03F5', /*03F5; 03B5; Case map*/ '\u0400', /*0400; 0450; Case map*/ '\u0401', /*0401; 0451; Case map*/ '\u0402', /*0402; 0452; Case map*/ '\u0403', /*0403; 0453; Case map*/ '\u0404', /*0404; 0454; Case map*/ '\u0405', /*0405; 0455; Case map*/ '\u0406', /*0406; 0456; Case map*/ '\u0407', /*0407; 0457; Case map*/ '\u0408', /*0408; 0458; Case map*/ '\u0409', /*0409; 0459; Case map*/ '\u040A', /*040A; 045A; Case map*/ '\u040B', /*040B; 045B; Case map*/ '\u040C', /*040C; 045C; Case map*/ '\u040D', /*040D; 045D; Case map*/ '\u040E', /*040E; 045E; Case map*/ '\u040F', /*040F; 045F; Case map*/ '\u0410', /*0410; 0430; Case map*/ '\u0411', /*0411; 0431; Case map*/ '\u0412', /*0412; 0432; Case map*/ '\u0413', /*0413; 0433; Case map*/ '\u0414', /*0414; 0434; Case map*/ '\u0415', /*0415; 0435; Case map*/ '\u0416', /*0416; 0436; Case map*/ '\u0417', /*0417; 0437; Case map*/ '\u0418', /*0418; 0438; Case map*/ '\u0419', /*0419; 0439; Case map*/ '\u041A', /*041A; 043A; Case map*/ '\u041B', /*041B; 043B; Case map*/ '\u041C', /*041C; 043C; Case map*/ '\u041D', /*041D; 043D; Case map*/ '\u041E', /*041E; 043E; Case map*/ '\u041F', /*041F; 043F; Case map*/ '\u0420', /*0420; 0440; Case map*/ '\u0421', /*0421; 0441; Case map*/ '\u0422', /*0422; 0442; Case map*/ '\u0423', /*0423; 0443; Case map*/ '\u0424', /*0424; 0444; Case map*/ '\u0425', /*0425; 0445; Case map*/ '\u0426', /*0426; 0446; Case map*/ '\u0427', /*0427; 0447; Case map*/ '\u0428', /*0428; 0448; Case map*/ '\u0429', /*0429; 0449; Case map*/ '\u042A', /*042A; 044A; Case map*/ '\u042B', /*042B; 044B; Case map*/ '\u042C', /*042C; 044C; Case map*/ '\u042D', /*042D; 044D; Case map*/ '\u042E', /*042E; 044E; Case map*/ '\u042F', /*042F; 044F; Case map*/ '\u0460', /*0460; 0461; Case map*/ '\u0462', /*0462; 0463; Case map*/ '\u0464', /*0464; 0465; Case map*/ '\u0466', /*0466; 0467; Case map*/ '\u0468', /*0468; 0469; Case map*/ '\u046A', /*046A; 046B; Case map*/ '\u046C', /*046C; 046D; Case map*/ '\u046E', /*046E; 046F; Case map*/ '\u0470', /*0470; 0471; Case map*/ '\u0472', /*0472; 0473; Case map*/ '\u0474', /*0474; 0475; Case map*/ '\u0476', /*0476; 0477; Case map*/ '\u0478', /*0478; 0479; Case map*/ '\u047A', /*047A; 047B; Case map*/ '\u047C', /*047C; 047D; Case map*/ '\u047E', /*047E; 047F; Case map*/ '\u0480', /*0480; 0481; Case map*/ '\u048A', /*048A; 048B; Case map*/ '\u048C', /*048C; 048D; Case map*/ '\u048E', /*048E; 048F; Case map*/ '\u0490', /*0490; 0491; Case map*/ '\u0492', /*0492; 0493; Case map*/ '\u0494', /*0494; 0495; Case map*/ '\u0496', /*0496; 0497; Case map*/ '\u0498', /*0498; 0499; Case map*/ '\u049A', /*049A; 049B; Case map*/ '\u049C', /*049C; 049D; Case map*/ '\u049E', /*049E; 049F; Case map*/ '\u04A0', /*04A0; 04A1; Case map*/ '\u04A2', /*04A2; 04A3; Case map*/ '\u04A4', /*04A4; 04A5; Case map*/ '\u04A6', /*04A6; 04A7; Case map*/ '\u04A8', /*04A8; 04A9; Case map*/ '\u04AA', /*04AA; 04AB; Case map*/ '\u04AC', /*04AC; 04AD; Case map*/ '\u04AE', /*04AE; 04AF; Case map*/ '\u04B0', /*04B0; 04B1; Case map*/ '\u04B2', /*04B2; 04B3; Case map*/ '\u04B4', /*04B4; 04B5; Case map*/ '\u04B6', /*04B6; 04B7; Case map*/ '\u04B8', /*04B8; 04B9; Case map*/ '\u04BA', /*04BA; 04BB; Case map*/ '\u04BC', /*04BC; 04BD; Case map*/ '\u04BE', /*04BE; 04BF; Case map*/ '\u04C1', /*04C1; 04C2; Case map*/ '\u04C3', /*04C3; 04C4; Case map*/ '\u04C5', /*04C5; 04C6; Case map*/ '\u04C7', /*04C7; 04C8; Case map*/ '\u04C9', /*04C9; 04CA; Case map*/ '\u04CB', /*04CB; 04CC; Case map*/ '\u04CD', /*04CD; 04CE; Case map*/ '\u04D0', /*04D0; 04D1; Case map*/ '\u04D2', /*04D2; 04D3; Case map*/ '\u04D4', /*04D4; 04D5; Case map*/ '\u04D6', /*04D6; 04D7; Case map*/ '\u04D8', /*04D8; 04D9; Case map*/ '\u04DA', /*04DA; 04DB; Case map*/ '\u04DC', /*04DC; 04DD; Case map*/ '\u04DE', /*04DE; 04DF; Case map*/ '\u04E0', /*04E0; 04E1; Case map*/ '\u04E2', /*04E2; 04E3; Case map*/ '\u04E4', /*04E4; 04E5; Case map*/ '\u04E6', /*04E6; 04E7; Case map*/ '\u04E8', /*04E8; 04E9; Case map*/ '\u04EA', /*04EA; 04EB; Case map*/ '\u04EC', /*04EC; 04ED; Case map*/ '\u04EE', /*04EE; 04EF; Case map*/ '\u04F0', /*04F0; 04F1; Case map*/ '\u04F2', /*04F2; 04F3; Case map*/ '\u04F4', /*04F4; 04F5; Case map*/ '\u04F8', /*04F8; 04F9; Case map*/ '\u0500', /*0500; 0501; Case map*/ '\u0502', /*0502; 0503; Case map*/ '\u0504', /*0504; 0505; Case map*/ '\u0506', /*0506; 0507; Case map*/ '\u0508', /*0508; 0509; Case map*/ '\u050A', /*050A; 050B; Case map*/ '\u050C', /*050C; 050D; Case map*/ '\u050E', /*050E; 050F; Case map*/ '\u0531', /*0531; 0561; Case map*/ '\u0532', /*0532; 0562; Case map*/ '\u0533', /*0533; 0563; Case map*/ '\u0534', /*0534; 0564; Case map*/ '\u0535', /*0535; 0565; Case map*/ '\u0536', /*0536; 0566; Case map*/ '\u0537', /*0537; 0567; Case map*/ '\u0538', /*0538; 0568; Case map*/ '\u0539', /*0539; 0569; Case map*/ '\u053A', /*053A; 056A; Case map*/ '\u053B', /*053B; 056B; Case map*/ '\u053C', /*053C; 056C; Case map*/ '\u053D', /*053D; 056D; Case map*/ '\u053E', /*053E; 056E; Case map*/ '\u053F', /*053F; 056F; Case map*/ '\u0540', /*0540; 0570; Case map*/ '\u0541', /*0541; 0571; Case map*/ '\u0542', /*0542; 0572; Case map*/ '\u0543', /*0543; 0573; Case map*/ '\u0544', /*0544; 0574; Case map*/ '\u0545', /*0545; 0575; Case map*/ '\u0546', /*0546; 0576; Case map*/ '\u0547', /*0547; 0577; Case map*/ '\u0548', /*0548; 0578; Case map*/ '\u0549', /*0549; 0579; Case map*/ '\u054A', /*054A; 057A; Case map*/ '\u054B', /*054B; 057B; Case map*/ '\u054C', /*054C; 057C; Case map*/ '\u054D', /*054D; 057D; Case map*/ '\u054E', /*054E; 057E; Case map*/ '\u054F', /*054F; 057F; Case map*/ '\u0550', /*0550; 0580; Case map*/ '\u0551', /*0551; 0581; Case map*/ '\u0552', /*0552; 0582; Case map*/ '\u0553', /*0553; 0583; Case map*/ '\u0554', /*0554; 0584; Case map*/ '\u0555', /*0555; 0585; Case map*/ '\u0556', /*0556; 0586; Case map*/ '\u0587', /*0587; 0565 0582; Case map*/ '\u1E00', /*1E00; 1E01; Case map*/ '\u1E02', /*1E02; 1E03; Case map*/ '\u1E04', /*1E04; 1E05; Case map*/ '\u1E06', /*1E06; 1E07; Case map*/ '\u1E08', /*1E08; 1E09; Case map*/ '\u1E0A', /*1E0A; 1E0B; Case map*/ '\u1E0C', /*1E0C; 1E0D; Case map*/ '\u1E0E', /*1E0E; 1E0F; Case map*/ '\u1E10', /*1E10; 1E11; Case map*/ '\u1E12', /*1E12; 1E13; Case map*/ '\u1E14', /*1E14; 1E15; Case map*/ '\u1E16', /*1E16; 1E17; Case map*/ '\u1E18', /*1E18; 1E19; Case map*/ '\u1E1A', /*1E1A; 1E1B; Case map*/ '\u1E1C', /*1E1C; 1E1D; Case map*/ '\u1E1E', /*1E1E; 1E1F; Case map*/ '\u1E20', /*1E20; 1E21; Case map*/ '\u1E22', /*1E22; 1E23; Case map*/ '\u1E24', /*1E24; 1E25; Case map*/ '\u1E26', /*1E26; 1E27; Case map*/ '\u1E28', /*1E28; 1E29; Case map*/ '\u1E2A', /*1E2A; 1E2B; Case map*/ '\u1E2C', /*1E2C; 1E2D; Case map*/ '\u1E2E', /*1E2E; 1E2F; Case map*/ '\u1E30', /*1E30; 1E31; Case map*/ '\u1E32', /*1E32; 1E33; Case map*/ '\u1E34', /*1E34; 1E35; Case map*/ '\u1E36', /*1E36; 1E37; Case map*/ '\u1E38', /*1E38; 1E39; Case map*/ '\u1E3A', /*1E3A; 1E3B; Case map*/ '\u1E3C', /*1E3C; 1E3D; Case map*/ '\u1E3E', /*1E3E; 1E3F; Case map*/ '\u1E40', /*1E40; 1E41; Case map*/ '\u1E42', /*1E42; 1E43; Case map*/ '\u1E44', /*1E44; 1E45; Case map*/ '\u1E46', /*1E46; 1E47; Case map*/ '\u1E48', /*1E48; 1E49; Case map*/ '\u1E4A', /*1E4A; 1E4B; Case map*/ '\u1E4C', /*1E4C; 1E4D; Case map*/ '\u1E4E', /*1E4E; 1E4F; Case map*/ '\u1E50', /*1E50; 1E51; Case map*/ '\u1E52', /*1E52; 1E53; Case map*/ '\u1E54', /*1E54; 1E55; Case map*/ '\u1E56', /*1E56; 1E57; Case map*/ '\u1E58', /*1E58; 1E59; Case map*/ '\u1E5A', /*1E5A; 1E5B; Case map*/ '\u1E5C', /*1E5C; 1E5D; Case map*/ '\u1E5E', /*1E5E; 1E5F; Case map*/ '\u1E60', /*1E60; 1E61; Case map*/ '\u1E62', /*1E62; 1E63; Case map*/ '\u1E64', /*1E64; 1E65; Case map*/ '\u1E66', /*1E66; 1E67; Case map*/ '\u1E68', /*1E68; 1E69; Case map*/ '\u1E6A', /*1E6A; 1E6B; Case map*/ '\u1E6C', /*1E6C; 1E6D; Case map*/ '\u1E6E', /*1E6E; 1E6F; Case map*/ '\u1E70', /*1E70; 1E71; Case map*/ '\u1E72', /*1E72; 1E73; Case map*/ '\u1E74', /*1E74; 1E75; Case map*/ '\u1E76', /*1E76; 1E77; Case map*/ '\u1E78', /*1E78; 1E79; Case map*/ '\u1E7A', /*1E7A; 1E7B; Case map*/ '\u1E7C', /*1E7C; 1E7D; Case map*/ '\u1E7E', /*1E7E; 1E7F; Case map*/ '\u1E80', /*1E80; 1E81; Case map*/ '\u1E82', /*1E82; 1E83; Case map*/ '\u1E84', /*1E84; 1E85; Case map*/ '\u1E86', /*1E86; 1E87; Case map*/ '\u1E88', /*1E88; 1E89; Case map*/ '\u1E8A', /*1E8A; 1E8B; Case map*/ '\u1E8C', /*1E8C; 1E8D; Case map*/ '\u1E8E', /*1E8E; 1E8F; Case map*/ '\u1E90', /*1E90; 1E91; Case map*/ '\u1E92', /*1E92; 1E93; Case map*/ '\u1E94', /*1E94; 1E95; Case map*/ '\u1E96', /*1E96; 0068 0331; Case map*/ '\u1E97', /*1E97; 0074 0308; Case map*/ '\u1E98', /*1E98; 0077 030A; Case map*/ '\u1E99', /*1E99; 0079 030A; Case map*/ '\u1E9A', /*1E9A; 0061 02BE; Case map*/ '\u1E9B', /*1E9B; 1E61; Case map*/ '\u1EA0', /*1EA0; 1EA1; Case map*/ '\u1EA2', /*1EA2; 1EA3; Case map*/ '\u1EA4', /*1EA4; 1EA5; Case map*/ '\u1EA6', /*1EA6; 1EA7; Case map*/ '\u1EA8', /*1EA8; 1EA9; Case map*/ '\u1EAA', /*1EAA; 1EAB; Case map*/ '\u1EAC', /*1EAC; 1EAD; Case map*/ '\u1EAE', /*1EAE; 1EAF; Case map*/ '\u1EB0', /*1EB0; 1EB1; Case map*/ '\u1EB2', /*1EB2; 1EB3; Case map*/ '\u1EB4', /*1EB4; 1EB5; Case map*/ '\u1EB6', /*1EB6; 1EB7; Case map*/ '\u1EB8', /*1EB8; 1EB9; Case map*/ '\u1EBA', /*1EBA; 1EBB; Case map*/ '\u1EBC', /*1EBC; 1EBD; Case map*/ '\u1EBE', /*1EBE; 1EBF; Case map*/ '\u1EC0', /*1EC0; 1EC1; Case map*/ '\u1EC2', /*1EC2; 1EC3; Case map*/ '\u1EC4', /*1EC4; 1EC5; Case map*/ '\u1EC6', /*1EC6; 1EC7; Case map*/ '\u1EC8', /*1EC8; 1EC9; Case map*/ '\u1ECA', /*1ECA; 1ECB; Case map*/ '\u1ECC', /*1ECC; 1ECD; Case map*/ '\u1ECE', /*1ECE; 1ECF; Case map*/ '\u1ED0', /*1ED0; 1ED1; Case map*/ '\u1ED2', /*1ED2; 1ED3; Case map*/ '\u1ED4', /*1ED4; 1ED5; Case map*/ '\u1ED6', /*1ED6; 1ED7; Case map*/ '\u1ED8', /*1ED8; 1ED9; Case map*/ '\u1EDA', /*1EDA; 1EDB; Case map*/ '\u1EDC', /*1EDC; 1EDD; Case map*/ '\u1EDE', /*1EDE; 1EDF; Case map*/ '\u1EE0', /*1EE0; 1EE1; Case map*/ '\u1EE2', /*1EE2; 1EE3; Case map*/ '\u1EE4', /*1EE4; 1EE5; Case map*/ '\u1EE6', /*1EE6; 1EE7; Case map*/ '\u1EE8', /*1EE8; 1EE9; Case map*/ '\u1EEA', /*1EEA; 1EEB; Case map*/ '\u1EEC', /*1EEC; 1EED; Case map*/ '\u1EEE', /*1EEE; 1EEF; Case map*/ '\u1EF0', /*1EF0; 1EF1; Case map*/ '\u1EF2', /*1EF2; 1EF3; Case map*/ '\u1EF4', /*1EF4; 1EF5; Case map*/ '\u1EF6', /*1EF6; 1EF7; Case map*/ '\u1EF8', /*1EF8; 1EF9; Case map*/ '\u1F08', /*1F08; 1F00; Case map*/ '\u1F09', /*1F09; 1F01; Case map*/ '\u1F0A', /*1F0A; 1F02; Case map*/ '\u1F0B', /*1F0B; 1F03; Case map*/ '\u1F0C', /*1F0C; 1F04; Case map*/ '\u1F0D', /*1F0D; 1F05; Case map*/ '\u1F0E', /*1F0E; 1F06; Case map*/ '\u1F0F', /*1F0F; 1F07; Case map*/ '\u1F18', /*1F18; 1F10; Case map*/ '\u1F19', /*1F19; 1F11; Case map*/ '\u1F1A', /*1F1A; 1F12; Case map*/ '\u1F1B', /*1F1B; 1F13; Case map*/ '\u1F1C', /*1F1C; 1F14; Case map*/ '\u1F1D', /*1F1D; 1F15; Case map*/ '\u1F28', /*1F28; 1F20; Case map*/ '\u1F29', /*1F29; 1F21; Case map*/ '\u1F2A', /*1F2A; 1F22; Case map*/ '\u1F2B', /*1F2B; 1F23; Case map*/ '\u1F2C', /*1F2C; 1F24; Case map*/ '\u1F2D', /*1F2D; 1F25; Case map*/ '\u1F2E', /*1F2E; 1F26; Case map*/ '\u1F2F', /*1F2F; 1F27; Case map*/ '\u1F38', /*1F38; 1F30; Case map*/ '\u1F39', /*1F39; 1F31; Case map*/ '\u1F3A', /*1F3A; 1F32; Case map*/ '\u1F3B', /*1F3B; 1F33; Case map*/ '\u1F3C', /*1F3C; 1F34; Case map*/ '\u1F3D', /*1F3D; 1F35; Case map*/ '\u1F3E', /*1F3E; 1F36; Case map*/ '\u1F3F', /*1F3F; 1F37; Case map*/ '\u1F48', /*1F48; 1F40; Case map*/ '\u1F49', /*1F49; 1F41; Case map*/ '\u1F4A', /*1F4A; 1F42; Case map*/ '\u1F4B', /*1F4B; 1F43; Case map*/ '\u1F4C', /*1F4C; 1F44; Case map*/ '\u1F4D', /*1F4D; 1F45; Case map*/ '\u1F50', /*1F50; 03C5 0313; Case map*/ '\u1F52', /*1F52; 03C5 0313 0300; Case map*/ '\u1F54', /*1F54; 03C5 0313 0301; Case map*/ '\u1F56', /*1F56; 03C5 0313 0342; Case map*/ '\u1F59', /*1F59; 1F51; Case map*/ '\u1F5B', /*1F5B; 1F53; Case map*/ '\u1F5D', /*1F5D; 1F55; Case map*/ '\u1F5F', /*1F5F; 1F57; Case map*/ '\u1F68', /*1F68; 1F60; Case map*/ '\u1F69', /*1F69; 1F61; Case map*/ '\u1F6A', /*1F6A; 1F62; Case map*/ '\u1F6B', /*1F6B; 1F63; Case map*/ '\u1F6C', /*1F6C; 1F64; Case map*/ '\u1F6D', /*1F6D; 1F65; Case map*/ '\u1F6E', /*1F6E; 1F66; Case map*/ '\u1F6F', /*1F6F; 1F67; Case map*/ '\u1F80', /*1F80; 1F00 03B9; Case map*/ '\u1F81', /*1F81; 1F01 03B9; Case map*/ '\u1F82', /*1F82; 1F02 03B9; Case map*/ '\u1F83', /*1F83; 1F03 03B9; Case map*/ '\u1F84', /*1F84; 1F04 03B9; Case map*/ '\u1F85', /*1F85; 1F05 03B9; Case map*/ '\u1F86', /*1F86; 1F06 03B9; Case map*/ '\u1F87', /*1F87; 1F07 03B9; Case map*/ '\u1F88', /*1F88; 1F00 03B9; Case map*/ '\u1F89', /*1F89; 1F01 03B9; Case map*/ '\u1F8A', /*1F8A; 1F02 03B9; Case map*/ '\u1F8B', /*1F8B; 1F03 03B9; Case map*/ '\u1F8C', /*1F8C; 1F04 03B9; Case map*/ '\u1F8D', /*1F8D; 1F05 03B9; Case map*/ '\u1F8E', /*1F8E; 1F06 03B9; Case map*/ '\u1F8F', /*1F8F; 1F07 03B9; Case map*/ '\u1F90', /*1F90; 1F20 03B9; Case map*/ '\u1F91', /*1F91; 1F21 03B9; Case map*/ '\u1F92', /*1F92; 1F22 03B9; Case map*/ '\u1F93', /*1F93; 1F23 03B9; Case map*/ '\u1F94', /*1F94; 1F24 03B9; Case map*/ '\u1F95', /*1F95; 1F25 03B9; Case map*/ '\u1F96', /*1F96; 1F26 03B9; Case map*/ '\u1F97', /*1F97; 1F27 03B9; Case map*/ '\u1F98', /*1F98; 1F20 03B9; Case map*/ '\u1F99', /*1F99; 1F21 03B9; Case map*/ '\u1F9A', /*1F9A; 1F22 03B9; Case map*/ '\u1F9B', /*1F9B; 1F23 03B9; Case map*/ '\u1F9C', /*1F9C; 1F24 03B9; Case map*/ '\u1F9D', /*1F9D; 1F25 03B9; Case map*/ '\u1F9E', /*1F9E; 1F26 03B9; Case map*/ '\u1F9F', /*1F9F; 1F27 03B9; Case map*/ '\u1FA0', /*1FA0; 1F60 03B9; Case map*/ '\u1FA1', /*1FA1; 1F61 03B9; Case map*/ '\u1FA2', /*1FA2; 1F62 03B9; Case map*/ '\u1FA3', /*1FA3; 1F63 03B9; Case map*/ '\u1FA4', /*1FA4; 1F64 03B9; Case map*/ '\u1FA5', /*1FA5; 1F65 03B9; Case map*/ '\u1FA6', /*1FA6; 1F66 03B9; Case map*/ '\u1FA7', /*1FA7; 1F67 03B9; Case map*/ '\u1FA8', /*1FA8; 1F60 03B9; Case map*/ '\u1FA9', /*1FA9; 1F61 03B9; Case map*/ '\u1FAA', /*1FAA; 1F62 03B9; Case map*/ '\u1FAB', /*1FAB; 1F63 03B9; Case map*/ '\u1FAC', /*1FAC; 1F64 03B9; Case map*/ '\u1FAD', /*1FAD; 1F65 03B9; Case map*/ '\u1FAE', /*1FAE; 1F66 03B9; Case map*/ '\u1FAF', /*1FAF; 1F67 03B9; Case map*/ '\u1FB2', /*1FB2; 1F70 03B9; Case map*/ '\u1FB3', /*1FB3; 03B1 03B9; Case map*/ '\u1FB4', /*1FB4; 03AC 03B9; Case map*/ '\u1FB6', /*1FB6; 03B1 0342; Case map*/ '\u1FB7', /*1FB7; 03B1 0342 03B9; Case map*/ '\u1FB8', /*1FB8; 1FB0; Case map*/ '\u1FB9', /*1FB9; 1FB1; Case map*/ '\u1FBA', /*1FBA; 1F70; Case map*/ '\u1FBB', /*1FBB; 1F71; Case map*/ '\u1FBC', /*1FBC; 03B1 03B9; Case map*/ '\u1FBE', /*1FBE; 03B9; Case map*/ '\u1FC2', /*1FC2; 1F74 03B9; Case map*/ '\u1FC3', /*1FC3; 03B7 03B9; Case map*/ '\u1FC4', /*1FC4; 03AE 03B9; Case map*/ '\u1FC6', /*1FC6; 03B7 0342; Case map*/ '\u1FC7', /*1FC7; 03B7 0342 03B9; Case map*/ '\u1FC8', /*1FC8; 1F72; Case map*/ '\u1FC9', /*1FC9; 1F73; Case map*/ '\u1FCA', /*1FCA; 1F74; Case map*/ '\u1FCB', /*1FCB; 1F75; Case map*/ '\u1FCC', /*1FCC; 03B7 03B9; Case map*/ '\u1FD2', /*1FD2; 03B9 0308 0300; Case map*/ '\u1FD3', /*1FD3; 03B9 0308 0301; Case map*/ '\u1FD6', /*1FD6; 03B9 0342; Case map*/ '\u1FD7', /*1FD7; 03B9 0308 0342; Case map*/ '\u1FD8', /*1FD8; 1FD0; Case map*/ '\u1FD9', /*1FD9; 1FD1; Case map*/ '\u1FDA', /*1FDA; 1F76; Case map*/ '\u1FDB', /*1FDB; 1F77; Case map*/ '\u1FE2', /*1FE2; 03C5 0308 0300; Case map*/ '\u1FE3', /*1FE3; 03C5 0308 0301; Case map*/ '\u1FE4', /*1FE4; 03C1 0313; Case map*/ '\u1FE6', /*1FE6; 03C5 0342; Case map*/ '\u1FE7', /*1FE7; 03C5 0308 0342; Case map*/ '\u1FE8', /*1FE8; 1FE0; Case map*/ '\u1FE9', /*1FE9; 1FE1; Case map*/ '\u1FEA', /*1FEA; 1F7A; Case map*/ '\u1FEB', /*1FEB; 1F7B; Case map*/ '\u1FEC', /*1FEC; 1FE5; Case map*/ '\u1FF2', /*1FF2; 1F7C 03B9; Case map*/ '\u1FF3', /*1FF3; 03C9 03B9; Case map*/ '\u1FF4', /*1FF4; 03CE 03B9; Case map*/ '\u1FF6', /*1FF6; 03C9 0342; Case map*/ '\u1FF7', /*1FF7; 03C9 0342 03B9; Case map*/ '\u1FF8', /*1FF8; 1F78; Case map*/ '\u1FF9', /*1FF9; 1F79; Case map*/ '\u1FFA', /*1FFA; 1F7C; Case map*/ '\u1FFB', /*1FFB; 1F7D; Case map*/ '\u1FFC', /*1FFC; 03C9 03B9; Case map*/ '\u20A8', /*20A8; 0072 0073; Additional folding*/ '\u2102', /*2102; 0063; Additional folding*/ '\u2103', /*2103; 00B0 0063; Additional folding*/ '\u2107', /*2107; 025B; Additional folding*/ '\u2109', /*2109; 00B0 0066; Additional folding*/ '\u210B', /*210B; 0068; Additional folding*/ '\u210C', /*210C; 0068; Additional folding*/ '\u210D', /*210D; 0068; Additional folding*/ '\u2110', /*2110; 0069; Additional folding*/ '\u2111', /*2111; 0069; Additional folding*/ '\u2112', /*2112; 006C; Additional folding*/ '\u2115', /*2115; 006E; Additional folding*/ '\u2116', /*2116; 006E 006F; Additional folding*/ '\u2119', /*2119; 0070; Additional folding*/ '\u211A', /*211A; 0071; Additional folding*/ '\u211B', /*211B; 0072; Additional folding*/ '\u211C', /*211C; 0072; Additional folding*/ '\u211D', /*211D; 0072; Additional folding*/ '\u2120', /*2120; 0073 006D; Additional folding*/ '\u2121', /*2121; 0074 0065 006C; Additional folding*/ '\u2122', /*2122; 0074 006D; Additional folding*/ '\u2124', /*2124; 007A; Additional folding*/ '\u2126', /*2126; 03C9; Case map*/ '\u2128', /*2128; 007A; Additional folding*/ '\u212A', /*212A; 006B; Case map*/ '\u212B', /*212B; 00E5; Case map*/ '\u212C', /*212C; 0062; Additional folding*/ '\u212D', /*212D; 0063; Additional folding*/ '\u2130', /*2130; 0065; Additional folding*/ '\u2131', /*2131; 0066; Additional folding*/ '\u2133', /*2133; 006D; Additional folding*/ '\u213E', /*213E; 03B3; Additional folding*/ '\u213F', /*213F; 03C0; Additional folding*/ '\u2145', /*2145; 0064; Additional folding*/ '\u2160', /*2160; 2170; Case map*/ '\u2161', /*2161; 2171; Case map*/ '\u2162', /*2162; 2172; Case map*/ '\u2163', /*2163; 2173; Case map*/ '\u2164', /*2164; 2174; Case map*/ '\u2165', /*2165; 2175; Case map*/ '\u2166', /*2166; 2176; Case map*/ '\u2167', /*2167; 2177; Case map*/ '\u2168', /*2168; 2178; Case map*/ '\u2169', /*2169; 2179; Case map*/ '\u216A', /*216A; 217A; Case map*/ '\u216B', /*216B; 217B; Case map*/ '\u216C', /*216C; 217C; Case map*/ '\u216D', /*216D; 217D; Case map*/ '\u216E', /*216E; 217E; Case map*/ '\u216F', /*216F; 217F; Case map*/ '\u24B6', /*24B6; 24D0; Case map*/ '\u24B7', /*24B7; 24D1; Case map*/ '\u24B8', /*24B8; 24D2; Case map*/ '\u24B9', /*24B9; 24D3; Case map*/ '\u24BA', /*24BA; 24D4; Case map*/ '\u24BB', /*24BB; 24D5; Case map*/ '\u24BC', /*24BC; 24D6; Case map*/ '\u24BD', /*24BD; 24D7; Case map*/ '\u24BE', /*24BE; 24D8; Case map*/ '\u24BF', /*24BF; 24D9; Case map*/ '\u24C0', /*24C0; 24DA; Case map*/ '\u24C1', /*24C1; 24DB; Case map*/ '\u24C2', /*24C2; 24DC; Case map*/ '\u24C3', /*24C3; 24DD; Case map*/ '\u24C4', /*24C4; 24DE; Case map*/ '\u24C5', /*24C5; 24DF; Case map*/ '\u24C6', /*24C6; 24E0; Case map*/ '\u24C7', /*24C7; 24E1; Case map*/ '\u24C8', /*24C8; 24E2; Case map*/ '\u24C9', /*24C9; 24E3; Case map*/ '\u24CA', /*24CA; 24E4; Case map*/ '\u24CB', /*24CB; 24E5; Case map*/ '\u24CC', /*24CC; 24E6; Case map*/ '\u24CD', /*24CD; 24E7; Case map*/ '\u24CE', /*24CE; 24E8; Case map*/ '\u24CF', /*24CF; 24E9; Case map*/ '\u3371', /*3371; 0068 0070 0061; Additional folding*/ '\u3373', /*3373; 0061 0075; Additional folding*/ '\u3375', /*3375; 006F 0076; Additional folding*/ '\u3380', /*3380; 0070 0061; Additional folding*/ '\u3381', /*3381; 006E 0061; Additional folding*/ '\u3382', /*3382; 03BC 0061; Additional folding*/ '\u3383', /*3383; 006D 0061; Additional folding*/ '\u3384', /*3384; 006B 0061; Additional folding*/ '\u3385', /*3385; 006B 0062; Additional folding*/ '\u3386', /*3386; 006D 0062; Additional folding*/ '\u3387', /*3387; 0067 0062; Additional folding*/ '\u338A', /*338A; 0070 0066; Additional folding*/ '\u338B', /*338B; 006E 0066; Additional folding*/ '\u338C', /*338C; 03BC 0066; Additional folding*/ '\u3390', /*3390; 0068 007A; Additional folding*/ '\u3391', /*3391; 006B 0068 007A; Additional folding*/ '\u3392', /*3392; 006D 0068 007A; Additional folding*/ '\u3393', /*3393; 0067 0068 007A; Additional folding*/ '\u3394', /*3394; 0074 0068 007A; Additional folding*/ '\u33A9', /*33A9; 0070 0061; Additional folding*/ '\u33AA', /*33AA; 006B 0070 0061; Additional folding*/ '\u33AB', /*33AB; 006D 0070 0061; Additional folding*/ '\u33AC', /*33AC; 0067 0070 0061; Additional folding*/ '\u33B4', /*33B4; 0070 0076; Additional folding*/ '\u33B5', /*33B5; 006E 0076; Additional folding*/ '\u33B6', /*33B6; 03BC 0076; Additional folding*/ '\u33B7', /*33B7; 006D 0076; Additional folding*/ '\u33B8', /*33B8; 006B 0076; Additional folding*/ '\u33B9', /*33B9; 006D 0076; Additional folding*/ '\u33BA', /*33BA; 0070 0077; Additional folding*/ '\u33BB', /*33BB; 006E 0077; Additional folding*/ '\u33BC', /*33BC; 03BC 0077; Additional folding*/ '\u33BD', /*33BD; 006D 0077; Additional folding*/ '\u33BE', /*33BE; 006B 0077; Additional folding*/ '\u33BF', /*33BF; 006D 0077; Additional folding*/ '\u33C0', /*33C0; 006B 03C9; Additional folding*/ '\u33C1', /*33C1; 006D 03C9; Additional folding*/ '\u33C3', /*33C3; 0062 0071; Additional folding*/ '\u33C6', /*33C6; 0063 2215 006B 0067; Additional folding*/ '\u33C7', /*33C7; 0063 006F 002E; Additional folding*/ '\u33C8', /*33C8; 0064 0062; Additional folding*/ '\u33C9', /*33C9; 0067 0079; Additional folding*/ '\u33CB', /*33CB; 0068 0070; Additional folding*/ '\u33CD', /*33CD; 006B 006B; Additional folding*/ '\u33CE', /*33CE; 006B 006D; Additional folding*/ '\u33D7', /*33D7; 0070 0068; Additional folding*/ '\u33D9', /*33D9; 0070 0070 006D; Additional folding*/ '\u33DA', /*33DA; 0070 0072; Additional folding*/ '\u33DC', /*33DC; 0073 0076; Additional folding*/ '\u33DD', /*33DD; 0077 0062; Additional folding*/ '\uFB00', /*FB00; 0066 0066; Case map*/ '\uFB01', /*FB01; 0066 0069; Case map*/ '\uFB02', /*FB02; 0066 006C; Case map*/ '\uFB03', /*FB03; 0066 0066 0069; Case map*/ '\uFB04', /*FB04; 0066 0066 006C; Case map*/ '\uFB05', /*FB05; 0073 0074; Case map*/ '\uFB06', /*FB06; 0073 0074; Case map*/ '\uFB13', /*FB13; 0574 0576; Case map*/ '\uFB14', /*FB14; 0574 0565; Case map*/ '\uFB15', /*FB15; 0574 056B; Case map*/ '\uFB16', /*FB16; 057E 0576; Case map*/ '\uFB17', /*FB17; 0574 056D; Case map*/ '\uFF21', /*FF21; FF41; Case map*/ '\uFF22', /*FF22; FF42; Case map*/ '\uFF23', /*FF23; FF43; Case map*/ '\uFF24', /*FF24; FF44; Case map*/ '\uFF25', /*FF25; FF45; Case map*/ '\uFF26', /*FF26; FF46; Case map*/ '\uFF27', /*FF27; FF47; Case map*/ '\uFF28', /*FF28; FF48; Case map*/ '\uFF29', /*FF29; FF49; Case map*/ '\uFF2A', /*FF2A; FF4A; Case map*/ '\uFF2B', /*FF2B; FF4B; Case map*/ '\uFF2C', /*FF2C; FF4C; Case map*/ '\uFF2D', /*FF2D; FF4D; Case map*/ '\uFF2E', /*FF2E; FF4E; Case map*/ '\uFF2F', /*FF2F; FF4F; Case map*/ '\uFF30', /*FF30; FF50; Case map*/ '\uFF31', /*FF31; FF51; Case map*/ '\uFF32', /*FF32; FF52; Case map*/ '\uFF33', /*FF33; FF53; Case map*/ '\uFF34', /*FF34; FF54; Case map*/ '\uFF35', /*FF35; FF55; Case map*/ '\uFF36', /*FF36; FF56; Case map*/ '\uFF37', /*FF37; FF57; Case map*/ '\uFF38', /*FF38; FF58; Case map*/ '\uFF39', /*FF39; FF59; Case map*/ '\uFF3A', /*FF3A; FF5A; Case map*/ }; public static string[] B2replace = new string[] { "\u0061", /*0041; 0061; Case map*/ "\u0062", /*0042; 0062; Case map*/ "\u0063", /*0043; 0063; Case map*/ "\u0064", /*0044; 0064; Case map*/ "\u0065", /*0045; 0065; Case map*/ "\u0066", /*0046; 0066; Case map*/ "\u0067", /*0047; 0067; Case map*/ "\u0068", /*0048; 0068; Case map*/ "\u0069", /*0049; 0069; Case map*/ "\u006A", /*004A; 006A; Case map*/ "\u006B", /*004B; 006B; Case map*/ "\u006C", /*004C; 006C; Case map*/ "\u006D", /*004D; 006D; Case map*/ "\u006E", /*004E; 006E; Case map*/ "\u006F", /*004F; 006F; Case map*/ "\u0070", /*0050; 0070; Case map*/ "\u0071", /*0051; 0071; Case map*/ "\u0072", /*0052; 0072; Case map*/ "\u0073", /*0053; 0073; Case map*/ "\u0074", /*0054; 0074; Case map*/ "\u0075", /*0055; 0075; Case map*/ "\u0076", /*0056; 0076; Case map*/ "\u0077", /*0057; 0077; Case map*/ "\u0078", /*0058; 0078; Case map*/ "\u0079", /*0059; 0079; Case map*/ "\u007A", /*005A; 007A; Case map*/ "\u03BC", /*00B5; 03BC; Case map*/ "\u00E0", /*00C0; 00E0; Case map*/ "\u00E1", /*00C1; 00E1; Case map*/ "\u00E2", /*00C2; 00E2; Case map*/ "\u00E3", /*00C3; 00E3; Case map*/ "\u00E4", /*00C4; 00E4; Case map*/ "\u00E5", /*00C5; 00E5; Case map*/ "\u00E6", /*00C6; 00E6; Case map*/ "\u00E7", /*00C7; 00E7; Case map*/ "\u00E8", /*00C8; 00E8; Case map*/ "\u00E9", /*00C9; 00E9; Case map*/ "\u00EA", /*00CA; 00EA; Case map*/ "\u00EB", /*00CB; 00EB; Case map*/ "\u00EC", /*00CC; 00EC; Case map*/ "\u00ED", /*00CD; 00ED; Case map*/ "\u00EE", /*00CE; 00EE; Case map*/ "\u00EF", /*00CF; 00EF; Case map*/ "\u00F0", /*00D0; 00F0; Case map*/ "\u00F1", /*00D1; 00F1; Case map*/ "\u00F2", /*00D2; 00F2; Case map*/ "\u00F3", /*00D3; 00F3; Case map*/ "\u00F4", /*00D4; 00F4; Case map*/ "\u00F5", /*00D5; 00F5; Case map*/ "\u00F6", /*00D6; 00F6; Case map*/ "\u00F8", /*00D8; 00F8; Case map*/ "\u00F9", /*00D9; 00F9; Case map*/ "\u00FA", /*00DA; 00FA; Case map*/ "\u00FB", /*00DB; 00FB; Case map*/ "\u00FC", /*00DC; 00FC; Case map*/ "\u00FD", /*00DD; 00FD; Case map*/ "\u00FE", /*00DE; 00FE; Case map*/ "\u0073\u0073", /*00DF; 0073 0073; Case map*/ "\u0101", /*0100; 0101; Case map*/ "\u0103", /*0102; 0103; Case map*/ "\u0105", /*0104; 0105; Case map*/ "\u0107", /*0106; 0107; Case map*/ "\u0109", /*0108; 0109; Case map*/ "\u010B", /*010A; 010B; Case map*/ "\u010D", /*010C; 010D; Case map*/ "\u010F", /*010E; 010F; Case map*/ "\u0111", /*0110; 0111; Case map*/ "\u0113", /*0112; 0113; Case map*/ "\u0115", /*0114; 0115; Case map*/ "\u0117", /*0116; 0117; Case map*/ "\u0119", /*0118; 0119; Case map*/ "\u011B", /*011A; 011B; Case map*/ "\u011D", /*011C; 011D; Case map*/ "\u011F", /*011E; 011F; Case map*/ "\u0121", /*0120; 0121; Case map*/ "\u0123", /*0122; 0123; Case map*/ "\u0125", /*0124; 0125; Case map*/ "\u0127", /*0126; 0127; Case map*/ "\u0129", /*0128; 0129; Case map*/ "\u012B", /*012A; 012B; Case map*/ "\u012D", /*012C; 012D; Case map*/ "\u012F", /*012E; 012F; Case map*/ "\u0069\u0307", /*0130; 0069 0307; Case map*/ "\u0133", /*0132; 0133; Case map*/ "\u0135", /*0134; 0135; Case map*/ "\u0137", /*0136; 0137; Case map*/ "\u013A", /*0139; 013A; Case map*/ "\u013C", /*013B; 013C; Case map*/ "\u013E", /*013D; 013E; Case map*/ "\u0140", /*013F; 0140; Case map*/ "\u0142", /*0141; 0142; Case map*/ "\u0144", /*0143; 0144; Case map*/ "\u0146", /*0145; 0146; Case map*/ "\u0148", /*0147; 0148; Case map*/ "\u02BC\u006E", /*0149; 02BC 006E; Case map*/ "\u014B", /*014A; 014B; Case map*/ "\u014D", /*014C; 014D; Case map*/ "\u014F", /*014E; 014F; Case map*/ "\u0151", /*0150; 0151; Case map*/ "\u0153", /*0152; 0153; Case map*/ "\u0155", /*0154; 0155; Case map*/ "\u0157", /*0156; 0157; Case map*/ "\u0159", /*0158; 0159; Case map*/ "\u015B", /*015A; 015B; Case map*/ "\u015D", /*015C; 015D; Case map*/ "\u015F", /*015E; 015F; Case map*/ "\u0161", /*0160; 0161; Case map*/ "\u0163", /*0162; 0163; Case map*/ "\u0165", /*0164; 0165; Case map*/ "\u0167", /*0166; 0167; Case map*/ "\u0169", /*0168; 0169; Case map*/ "\u016B", /*016A; 016B; Case map*/ "\u016D", /*016C; 016D; Case map*/ "\u016F", /*016E; 016F; Case map*/ "\u0171", /*0170; 0171; Case map*/ "\u0173", /*0172; 0173; Case map*/ "\u0175", /*0174; 0175; Case map*/ "\u0177", /*0176; 0177; Case map*/ "\u00FF", /*0178; 00FF; Case map*/ "\u017A", /*0179; 017A; Case map*/ "\u017C", /*017B; 017C; Case map*/ "\u017E", /*017D; 017E; Case map*/ "\u0073", /*017F; 0073; Case map*/ "\u0253", /*0181; 0253; Case map*/ "\u0183", /*0182; 0183; Case map*/ "\u0185", /*0184; 0185; Case map*/ "\u0254", /*0186; 0254; Case map*/ "\u0188", /*0187; 0188; Case map*/ "\u0256", /*0189; 0256; Case map*/ "\u0257", /*018A; 0257; Case map*/ "\u018C", /*018B; 018C; Case map*/ "\u01DD", /*018E; 01DD; Case map*/ "\u0259", /*018F; 0259; Case map*/ "\u025B", /*0190; 025B; Case map*/ "\u0192", /*0191; 0192; Case map*/ "\u0260", /*0193; 0260; Case map*/ "\u0263", /*0194; 0263; Case map*/ "\u0269", /*0196; 0269; Case map*/ "\u0268", /*0197; 0268; Case map*/ "\u0199", /*0198; 0199; Case map*/ "\u026F", /*019C; 026F; Case map*/ "\u0272", /*019D; 0272; Case map*/ "\u0275", /*019F; 0275; Case map*/ "\u01A1", /*01A0; 01A1; Case map*/ "\u01A3", /*01A2; 01A3; Case map*/ "\u01A5", /*01A4; 01A5; Case map*/ "\u0280", /*01A6; 0280; Case map*/ "\u01A8", /*01A7; 01A8; Case map*/ "\u0283", /*01A9; 0283; Case map*/ "\u01AD", /*01AC; 01AD; Case map*/ "\u0288", /*01AE; 0288; Case map*/ "\u01B0", /*01AF; 01B0; Case map*/ "\u028A", /*01B1; 028A; Case map*/ "\u028B", /*01B2; 028B; Case map*/ "\u01B4", /*01B3; 01B4; Case map*/ "\u01B6", /*01B5; 01B6; Case map*/ "\u0292", /*01B7; 0292; Case map*/ "\u01B9", /*01B8; 01B9; Case map*/ "\u01BD", /*01BC; 01BD; Case map*/ "\u01C6", /*01C4; 01C6; Case map*/ "\u01C6", /*01C5; 01C6; Case map*/ "\u01C9", /*01C7; 01C9; Case map*/ "\u01C9", /*01C8; 01C9; Case map*/ "\u01CC", /*01CA; 01CC; Case map*/ "\u01CC", /*01CB; 01CC; Case map*/ "\u01CE", /*01CD; 01CE; Case map*/ "\u01D0", /*01CF; 01D0; Case map*/ "\u01D2", /*01D1; 01D2; Case map*/ "\u01D4", /*01D3; 01D4; Case map*/ "\u01D6", /*01D5; 01D6; Case map*/ "\u01D8", /*01D7; 01D8; Case map*/ "\u01DA", /*01D9; 01DA; Case map*/ "\u01DC", /*01DB; 01DC; Case map*/ "\u01DF", /*01DE; 01DF; Case map*/ "\u01E1", /*01E0; 01E1; Case map*/ "\u01E3", /*01E2; 01E3; Case map*/ "\u01E5", /*01E4; 01E5; Case map*/ "\u01E7", /*01E6; 01E7; Case map*/ "\u01E9", /*01E8; 01E9; Case map*/ "\u01EB", /*01EA; 01EB; Case map*/ "\u01ED", /*01EC; 01ED; Case map*/ "\u01EF", /*01EE; 01EF; Case map*/ "\u006A\u030C", /*01F0; 006A 030C; Case map*/ "\u01F3", /*01F1; 01F3; Case map*/ "\u01F3", /*01F2; 01F3; Case map*/ "\u01F5", /*01F4; 01F5; Case map*/ "\u0195", /*01F6; 0195; Case map*/ "\u01BF", /*01F7; 01BF; Case map*/ "\u01F9", /*01F8; 01F9; Case map*/ "\u01FB", /*01FA; 01FB; Case map*/ "\u01FD", /*01FC; 01FD; Case map*/ "\u01FF", /*01FE; 01FF; Case map*/ "\u0201", /*0200; 0201; Case map*/ "\u0203", /*0202; 0203; Case map*/ "\u0205", /*0204; 0205; Case map*/ "\u0207", /*0206; 0207; Case map*/ "\u0209", /*0208; 0209; Case map*/ "\u020B", /*020A; 020B; Case map*/ "\u020D", /*020C; 020D; Case map*/ "\u020F", /*020E; 020F; Case map*/ "\u0211", /*0210; 0211; Case map*/ "\u0213", /*0212; 0213; Case map*/ "\u0215", /*0214; 0215; Case map*/ "\u0217", /*0216; 0217; Case map*/ "\u0219", /*0218; 0219; Case map*/ "\u021B", /*021A; 021B; Case map*/ "\u021D", /*021C; 021D; Case map*/ "\u021F", /*021E; 021F; Case map*/ "\u019E", /*0220; 019E; Case map*/ "\u0223", /*0222; 0223; Case map*/ "\u0225", /*0224; 0225; Case map*/ "\u0227", /*0226; 0227; Case map*/ "\u0229", /*0228; 0229; Case map*/ "\u022B", /*022A; 022B; Case map*/ "\u022D", /*022C; 022D; Case map*/ "\u022F", /*022E; 022F; Case map*/ "\u0231", /*0230; 0231; Case map*/ "\u0233", /*0232; 0233; Case map*/ "\u03B9", /*0345; 03B9; Case map*/ "\u0020\u03B9", /*037A; 0020 03B9; Additional folding*/ "\u03AC", /*0386; 03AC; Case map*/ "\u03AD", /*0388; 03AD; Case map*/ "\u03AE", /*0389; 03AE; Case map*/ "\u03AF", /*038A; 03AF; Case map*/ "\u03CC", /*038C; 03CC; Case map*/ "\u03CD", /*038E; 03CD; Case map*/ "\u03CE", /*038F; 03CE; Case map*/ "\u03B9\u0308\u0301", /*0390; 03B9 0308 0301; Case map*/ "\u03B1", /*0391; 03B1; Case map*/ "\u03B2", /*0392; 03B2; Case map*/ "\u03B3", /*0393; 03B3; Case map*/ "\u03B4", /*0394; 03B4; Case map*/ "\u03B5", /*0395; 03B5; Case map*/ "\u03B6", /*0396; 03B6; Case map*/ "\u03B7", /*0397; 03B7; Case map*/ "\u03B8", /*0398; 03B8; Case map*/ "\u03B9", /*0399; 03B9; Case map*/ "\u03BA", /*039A; 03BA; Case map*/ "\u03BB", /*039B; 03BB; Case map*/ "\u03BC", /*039C; 03BC; Case map*/ "\u03BD", /*039D; 03BD; Case map*/ "\u03BE", /*039E; 03BE; Case map*/ "\u03BF", /*039F; 03BF; Case map*/ "\u03C0", /*03A0; 03C0; Case map*/ "\u03C1", /*03A1; 03C1; Case map*/ "\u03C3", /*03A3; 03C3; Case map*/ "\u03C4", /*03A4; 03C4; Case map*/ "\u03C5", /*03A5; 03C5; Case map*/ "\u03C6", /*03A6; 03C6; Case map*/ "\u03C7", /*03A7; 03C7; Case map*/ "\u03C8", /*03A8; 03C8; Case map*/ "\u03C9", /*03A9; 03C9; Case map*/ "\u03CA", /*03AA; 03CA; Case map*/ "\u03CB", /*03AB; 03CB; Case map*/ "\u03C5\u0308\u0301", /*03B0; 03C5 0308 0301; Case map*/ "\u03C3", /*03C2; 03C3; Case map*/ "\u03B2", /*03D0; 03B2; Case map*/ "\u03B8", /*03D1; 03B8; Case map*/ "\u03C5", /*03D2; 03C5; Additional folding*/ "\u03CD", /*03D3; 03CD; Additional folding*/ "\u03CB", /*03D4; 03CB; Additional folding*/ "\u03C6", /*03D5; 03C6; Case map*/ "\u03C0", /*03D6; 03C0; Case map*/ "\u03D9", /*03D8; 03D9; Case map*/ "\u03DB", /*03DA; 03DB; Case map*/ "\u03DD", /*03DC; 03DD; Case map*/ "\u03DF", /*03DE; 03DF; Case map*/ "\u03E1", /*03E0; 03E1; Case map*/ "\u03E3", /*03E2; 03E3; Case map*/ "\u03E5", /*03E4; 03E5; Case map*/ "\u03E7", /*03E6; 03E7; Case map*/ "\u03E9", /*03E8; 03E9; Case map*/ "\u03EB", /*03EA; 03EB; Case map*/ "\u03ED", /*03EC; 03ED; Case map*/ "\u03EF", /*03EE; 03EF; Case map*/ "\u03BA", /*03F0; 03BA; Case map*/ "\u03C1", /*03F1; 03C1; Case map*/ "\u03C3", /*03F2; 03C3; Case map*/ "\u03B8", /*03F4; 03B8; Case map*/ "\u03B5", /*03F5; 03B5; Case map*/ "\u0450", /*0400; 0450; Case map*/ "\u0451", /*0401; 0451; Case map*/ "\u0452", /*0402; 0452; Case map*/ "\u0453", /*0403; 0453; Case map*/ "\u0454", /*0404; 0454; Case map*/ "\u0455", /*0405; 0455; Case map*/ "\u0456", /*0406; 0456; Case map*/ "\u0457", /*0407; 0457; Case map*/ "\u0458", /*0408; 0458; Case map*/ "\u0459", /*0409; 0459; Case map*/ "\u045A", /*040A; 045A; Case map*/ "\u045B", /*040B; 045B; Case map*/ "\u045C", /*040C; 045C; Case map*/ "\u045D", /*040D; 045D; Case map*/ "\u045E", /*040E; 045E; Case map*/ "\u045F", /*040F; 045F; Case map*/ "\u0430", /*0410; 0430; Case map*/ "\u0431", /*0411; 0431; Case map*/ "\u0432", /*0412; 0432; Case map*/ "\u0433", /*0413; 0433; Case map*/ "\u0434", /*0414; 0434; Case map*/ "\u0435", /*0415; 0435; Case map*/ "\u0436", /*0416; 0436; Case map*/ "\u0437", /*0417; 0437; Case map*/ "\u0438", /*0418; 0438; Case map*/ "\u0439", /*0419; 0439; Case map*/ "\u043A", /*041A; 043A; Case map*/ "\u043B", /*041B; 043B; Case map*/ "\u043C", /*041C; 043C; Case map*/ "\u043D", /*041D; 043D; Case map*/ "\u043E", /*041E; 043E; Case map*/ "\u043F", /*041F; 043F; Case map*/ "\u0440", /*0420; 0440; Case map*/ "\u0441", /*0421; 0441; Case map*/ "\u0442", /*0422; 0442; Case map*/ "\u0443", /*0423; 0443; Case map*/ "\u0444", /*0424; 0444; Case map*/ "\u0445", /*0425; 0445; Case map*/ "\u0446", /*0426; 0446; Case map*/ "\u0447", /*0427; 0447; Case map*/ "\u0448", /*0428; 0448; Case map*/ "\u0449", /*0429; 0449; Case map*/ "\u044A", /*042A; 044A; Case map*/ "\u044B", /*042B; 044B; Case map*/ "\u044C", /*042C; 044C; Case map*/ "\u044D", /*042D; 044D; Case map*/ "\u044E", /*042E; 044E; Case map*/ "\u044F", /*042F; 044F; Case map*/ "\u0461", /*0460; 0461; Case map*/ "\u0463", /*0462; 0463; Case map*/ "\u0465", /*0464; 0465; Case map*/ "\u0467", /*0466; 0467; Case map*/ "\u0469", /*0468; 0469; Case map*/ "\u046B", /*046A; 046B; Case map*/ "\u046D", /*046C; 046D; Case map*/ "\u046F", /*046E; 046F; Case map*/ "\u0471", /*0470; 0471; Case map*/ "\u0473", /*0472; 0473; Case map*/ "\u0475", /*0474; 0475; Case map*/ "\u0477", /*0476; 0477; Case map*/ "\u0479", /*0478; 0479; Case map*/ "\u047B", /*047A; 047B; Case map*/ "\u047D", /*047C; 047D; Case map*/ "\u047F", /*047E; 047F; Case map*/ "\u0481", /*0480; 0481; Case map*/ "\u048B", /*048A; 048B; Case map*/ "\u048D", /*048C; 048D; Case map*/ "\u048F", /*048E; 048F; Case map*/ "\u0491", /*0490; 0491; Case map*/ "\u0493", /*0492; 0493; Case map*/ "\u0495", /*0494; 0495; Case map*/ "\u0497", /*0496; 0497; Case map*/ "\u0499", /*0498; 0499; Case map*/ "\u049B", /*049A; 049B; Case map*/ "\u049D", /*049C; 049D; Case map*/ "\u049F", /*049E; 049F; Case map*/ "\u04A1", /*04A0; 04A1; Case map*/ "\u04A3", /*04A2; 04A3; Case map*/ "\u04A5", /*04A4; 04A5; Case map*/ "\u04A7", /*04A6; 04A7; Case map*/ "\u04A9", /*04A8; 04A9; Case map*/ "\u04AB", /*04AA; 04AB; Case map*/ "\u04AD", /*04AC; 04AD; Case map*/ "\u04AF", /*04AE; 04AF; Case map*/ "\u04B1", /*04B0; 04B1; Case map*/ "\u04B3", /*04B2; 04B3; Case map*/ "\u04B5", /*04B4; 04B5; Case map*/ "\u04B7", /*04B6; 04B7; Case map*/ "\u04B9", /*04B8; 04B9; Case map*/ "\u04BB", /*04BA; 04BB; Case map*/ "\u04BD", /*04BC; 04BD; Case map*/ "\u04BF", /*04BE; 04BF; Case map*/ "\u04C2", /*04C1; 04C2; Case map*/ "\u04C4", /*04C3; 04C4; Case map*/ "\u04C6", /*04C5; 04C6; Case map*/ "\u04C8", /*04C7; 04C8; Case map*/ "\u04CA", /*04C9; 04CA; Case map*/ "\u04CC", /*04CB; 04CC; Case map*/ "\u04CE", /*04CD; 04CE; Case map*/ "\u04D1", /*04D0; 04D1; Case map*/ "\u04D3", /*04D2; 04D3; Case map*/ "\u04D5", /*04D4; 04D5; Case map*/ "\u04D7", /*04D6; 04D7; Case map*/ "\u04D9", /*04D8; 04D9; Case map*/ "\u04DB", /*04DA; 04DB; Case map*/ "\u04DD", /*04DC; 04DD; Case map*/ "\u04DF", /*04DE; 04DF; Case map*/ "\u04E1", /*04E0; 04E1; Case map*/ "\u04E3", /*04E2; 04E3; Case map*/ "\u04E5", /*04E4; 04E5; Case map*/ "\u04E7", /*04E6; 04E7; Case map*/ "\u04E9", /*04E8; 04E9; Case map*/ "\u04EB", /*04EA; 04EB; Case map*/ "\u04ED", /*04EC; 04ED; Case map*/ "\u04EF", /*04EE; 04EF; Case map*/ "\u04F1", /*04F0; 04F1; Case map*/ "\u04F3", /*04F2; 04F3; Case map*/ "\u04F5", /*04F4; 04F5; Case map*/ "\u04F9", /*04F8; 04F9; Case map*/ "\u0501", /*0500; 0501; Case map*/ "\u0503", /*0502; 0503; Case map*/ "\u0505", /*0504; 0505; Case map*/ "\u0507", /*0506; 0507; Case map*/ "\u0509", /*0508; 0509; Case map*/ "\u050B", /*050A; 050B; Case map*/ "\u050D", /*050C; 050D; Case map*/ "\u050F", /*050E; 050F; Case map*/ "\u0561", /*0531; 0561; Case map*/ "\u0562", /*0532; 0562; Case map*/ "\u0563", /*0533; 0563; Case map*/ "\u0564", /*0534; 0564; Case map*/ "\u0565", /*0535; 0565; Case map*/ "\u0566", /*0536; 0566; Case map*/ "\u0567", /*0537; 0567; Case map*/ "\u0568", /*0538; 0568; Case map*/ "\u0569", /*0539; 0569; Case map*/ "\u056A", /*053A; 056A; Case map*/ "\u056B", /*053B; 056B; Case map*/ "\u056C", /*053C; 056C; Case map*/ "\u056D", /*053D; 056D; Case map*/ "\u056E", /*053E; 056E; Case map*/ "\u056F", /*053F; 056F; Case map*/ "\u0570", /*0540; 0570; Case map*/ "\u0571", /*0541; 0571; Case map*/ "\u0572", /*0542; 0572; Case map*/ "\u0573", /*0543; 0573; Case map*/ "\u0574", /*0544; 0574; Case map*/ "\u0575", /*0545; 0575; Case map*/ "\u0576", /*0546; 0576; Case map*/ "\u0577", /*0547; 0577; Case map*/ "\u0578", /*0548; 0578; Case map*/ "\u0579", /*0549; 0579; Case map*/ "\u057A", /*054A; 057A; Case map*/ "\u057B", /*054B; 057B; Case map*/ "\u057C", /*054C; 057C; Case map*/ "\u057D", /*054D; 057D; Case map*/ "\u057E", /*054E; 057E; Case map*/ "\u057F", /*054F; 057F; Case map*/ "\u0580", /*0550; 0580; Case map*/ "\u0581", /*0551; 0581; Case map*/ "\u0582", /*0552; 0582; Case map*/ "\u0583", /*0553; 0583; Case map*/ "\u0584", /*0554; 0584; Case map*/ "\u0585", /*0555; 0585; Case map*/ "\u0586", /*0556; 0586; Case map*/ "\u0565\u0582", /*0587; 0565 0582; Case map*/ "\u1E01", /*1E00; 1E01; Case map*/ "\u1E03", /*1E02; 1E03; Case map*/ "\u1E05", /*1E04; 1E05; Case map*/ "\u1E07", /*1E06; 1E07; Case map*/ "\u1E09", /*1E08; 1E09; Case map*/ "\u1E0B", /*1E0A; 1E0B; Case map*/ "\u1E0D", /*1E0C; 1E0D; Case map*/ "\u1E0F", /*1E0E; 1E0F; Case map*/ "\u1E11", /*1E10; 1E11; Case map*/ "\u1E13", /*1E12; 1E13; Case map*/ "\u1E15", /*1E14; 1E15; Case map*/ "\u1E17", /*1E16; 1E17; Case map*/ "\u1E19", /*1E18; 1E19; Case map*/ "\u1E1B", /*1E1A; 1E1B; Case map*/ "\u1E1D", /*1E1C; 1E1D; Case map*/ "\u1E1F", /*1E1E; 1E1F; Case map*/ "\u1E21", /*1E20; 1E21; Case map*/ "\u1E23", /*1E22; 1E23; Case map*/ "\u1E25", /*1E24; 1E25; Case map*/ "\u1E27", /*1E26; 1E27; Case map*/ "\u1E29", /*1E28; 1E29; Case map*/ "\u1E2B", /*1E2A; 1E2B; Case map*/ "\u1E2D", /*1E2C; 1E2D; Case map*/ "\u1E2F", /*1E2E; 1E2F; Case map*/ "\u1E31", /*1E30; 1E31; Case map*/ "\u1E33", /*1E32; 1E33; Case map*/ "\u1E35", /*1E34; 1E35; Case map*/ "\u1E37", /*1E36; 1E37; Case map*/ "\u1E39", /*1E38; 1E39; Case map*/ "\u1E3B", /*1E3A; 1E3B; Case map*/ "\u1E3D", /*1E3C; 1E3D; Case map*/ "\u1E3F", /*1E3E; 1E3F; Case map*/ "\u1E41", /*1E40; 1E41; Case map*/ "\u1E43", /*1E42; 1E43; Case map*/ "\u1E45", /*1E44; 1E45; Case map*/ "\u1E47", /*1E46; 1E47; Case map*/ "\u1E49", /*1E48; 1E49; Case map*/ "\u1E4B", /*1E4A; 1E4B; Case map*/ "\u1E4D", /*1E4C; 1E4D; Case map*/ "\u1E4F", /*1E4E; 1E4F; Case map*/ "\u1E51", /*1E50; 1E51; Case map*/ "\u1E53", /*1E52; 1E53; Case map*/ "\u1E55", /*1E54; 1E55; Case map*/ "\u1E57", /*1E56; 1E57; Case map*/ "\u1E59", /*1E58; 1E59; Case map*/ "\u1E5B", /*1E5A; 1E5B; Case map*/ "\u1E5D", /*1E5C; 1E5D; Case map*/ "\u1E5F", /*1E5E; 1E5F; Case map*/ "\u1E61", /*1E60; 1E61; Case map*/ "\u1E63", /*1E62; 1E63; Case map*/ "\u1E65", /*1E64; 1E65; Case map*/ "\u1E67", /*1E66; 1E67; Case map*/ "\u1E69", /*1E68; 1E69; Case map*/ "\u1E6B", /*1E6A; 1E6B; Case map*/ "\u1E6D", /*1E6C; 1E6D; Case map*/ "\u1E6F", /*1E6E; 1E6F; Case map*/ "\u1E71", /*1E70; 1E71; Case map*/ "\u1E73", /*1E72; 1E73; Case map*/ "\u1E75", /*1E74; 1E75; Case map*/ "\u1E77", /*1E76; 1E77; Case map*/ "\u1E79", /*1E78; 1E79; Case map*/ "\u1E7B", /*1E7A; 1E7B; Case map*/ "\u1E7D", /*1E7C; 1E7D; Case map*/ "\u1E7F", /*1E7E; 1E7F; Case map*/ "\u1E81", /*1E80; 1E81; Case map*/ "\u1E83", /*1E82; 1E83; Case map*/ "\u1E85", /*1E84; 1E85; Case map*/ "\u1E87", /*1E86; 1E87; Case map*/ "\u1E89", /*1E88; 1E89; Case map*/ "\u1E8B", /*1E8A; 1E8B; Case map*/ "\u1E8D", /*1E8C; 1E8D; Case map*/ "\u1E8F", /*1E8E; 1E8F; Case map*/ "\u1E91", /*1E90; 1E91; Case map*/ "\u1E93", /*1E92; 1E93; Case map*/ "\u1E95", /*1E94; 1E95; Case map*/ "\u0068\u0331", /*1E96; 0068 0331; Case map*/ "\u0074\u0308", /*1E97; 0074 0308; Case map*/ "\u0077\u030A", /*1E98; 0077 030A; Case map*/ "\u0079\u030A", /*1E99; 0079 030A; Case map*/ "\u0061\u02BE", /*1E9A; 0061 02BE; Case map*/ "\u1E61", /*1E9B; 1E61; Case map*/ "\u1EA1", /*1EA0; 1EA1; Case map*/ "\u1EA3", /*1EA2; 1EA3; Case map*/ "\u1EA5", /*1EA4; 1EA5; Case map*/ "\u1EA7", /*1EA6; 1EA7; Case map*/ "\u1EA9", /*1EA8; 1EA9; Case map*/ "\u1EAB", /*1EAA; 1EAB; Case map*/ "\u1EAD", /*1EAC; 1EAD; Case map*/ "\u1EAF", /*1EAE; 1EAF; Case map*/ "\u1EB1", /*1EB0; 1EB1; Case map*/ "\u1EB3", /*1EB2; 1EB3; Case map*/ "\u1EB5", /*1EB4; 1EB5; Case map*/ "\u1EB7", /*1EB6; 1EB7; Case map*/ "\u1EB9", /*1EB8; 1EB9; Case map*/ "\u1EBB", /*1EBA; 1EBB; Case map*/ "\u1EBD", /*1EBC; 1EBD; Case map*/ "\u1EBF", /*1EBE; 1EBF; Case map*/ "\u1EC1", /*1EC0; 1EC1; Case map*/ "\u1EC3", /*1EC2; 1EC3; Case map*/ "\u1EC5", /*1EC4; 1EC5; Case map*/ "\u1EC7", /*1EC6; 1EC7; Case map*/ "\u1EC9", /*1EC8; 1EC9; Case map*/ "\u1ECB", /*1ECA; 1ECB; Case map*/ "\u1ECD", /*1ECC; 1ECD; Case map*/ "\u1ECF", /*1ECE; 1ECF; Case map*/ "\u1ED1", /*1ED0; 1ED1; Case map*/ "\u1ED3", /*1ED2; 1ED3; Case map*/ "\u1ED5", /*1ED4; 1ED5; Case map*/ "\u1ED7", /*1ED6; 1ED7; Case map*/ "\u1ED9", /*1ED8; 1ED9; Case map*/ "\u1EDB", /*1EDA; 1EDB; Case map*/ "\u1EDD", /*1EDC; 1EDD; Case map*/ "\u1EDF", /*1EDE; 1EDF; Case map*/ "\u1EE1", /*1EE0; 1EE1; Case map*/ "\u1EE3", /*1EE2; 1EE3; Case map*/ "\u1EE5", /*1EE4; 1EE5; Case map*/ "\u1EE7", /*1EE6; 1EE7; Case map*/ "\u1EE9", /*1EE8; 1EE9; Case map*/ "\u1EEB", /*1EEA; 1EEB; Case map*/ "\u1EED", /*1EEC; 1EED; Case map*/ "\u1EEF", /*1EEE; 1EEF; Case map*/ "\u1EF1", /*1EF0; 1EF1; Case map*/ "\u1EF3", /*1EF2; 1EF3; Case map*/ "\u1EF5", /*1EF4; 1EF5; Case map*/ "\u1EF7", /*1EF6; 1EF7; Case map*/ "\u1EF9", /*1EF8; 1EF9; Case map*/ "\u1F00", /*1F08; 1F00; Case map*/ "\u1F01", /*1F09; 1F01; Case map*/ "\u1F02", /*1F0A; 1F02; Case map*/ "\u1F03", /*1F0B; 1F03; Case map*/ "\u1F04", /*1F0C; 1F04; Case map*/ "\u1F05", /*1F0D; 1F05; Case map*/ "\u1F06", /*1F0E; 1F06; Case map*/ "\u1F07", /*1F0F; 1F07; Case map*/ "\u1F10", /*1F18; 1F10; Case map*/ "\u1F11", /*1F19; 1F11; Case map*/ "\u1F12", /*1F1A; 1F12; Case map*/ "\u1F13", /*1F1B; 1F13; Case map*/ "\u1F14", /*1F1C; 1F14; Case map*/ "\u1F15", /*1F1D; 1F15; Case map*/ "\u1F20", /*1F28; 1F20; Case map*/ "\u1F21", /*1F29; 1F21; Case map*/ "\u1F22", /*1F2A; 1F22; Case map*/ "\u1F23", /*1F2B; 1F23; Case map*/ "\u1F24", /*1F2C; 1F24; Case map*/ "\u1F25", /*1F2D; 1F25; Case map*/ "\u1F26", /*1F2E; 1F26; Case map*/ "\u1F27", /*1F2F; 1F27; Case map*/ "\u1F30", /*1F38; 1F30; Case map*/ "\u1F31", /*1F39; 1F31; Case map*/ "\u1F32", /*1F3A; 1F32; Case map*/ "\u1F33", /*1F3B; 1F33; Case map*/ "\u1F34", /*1F3C; 1F34; Case map*/ "\u1F35", /*1F3D; 1F35; Case map*/ "\u1F36", /*1F3E; 1F36; Case map*/ "\u1F37", /*1F3F; 1F37; Case map*/ "\u1F40", /*1F48; 1F40; Case map*/ "\u1F41", /*1F49; 1F41; Case map*/ "\u1F42", /*1F4A; 1F42; Case map*/ "\u1F43", /*1F4B; 1F43; Case map*/ "\u1F44", /*1F4C; 1F44; Case map*/ "\u1F45", /*1F4D; 1F45; Case map*/ "\u03C5\u0313", /*1F50; 03C5 0313; Case map*/ "\u03C5\u0313\u0300", /*1F52; 03C5 0313 0300; Case map*/ "\u03C5\u0313\u0301", /*1F54; 03C5 0313 0301; Case map*/ "\u03C5\u0313\u0342", /*1F56; 03C5 0313 0342; Case map*/ "\u1F51", /*1F59; 1F51; Case map*/ "\u1F53", /*1F5B; 1F53; Case map*/ "\u1F55", /*1F5D; 1F55; Case map*/ "\u1F57", /*1F5F; 1F57; Case map*/ "\u1F60", /*1F68; 1F60; Case map*/ "\u1F61", /*1F69; 1F61; Case map*/ "\u1F62", /*1F6A; 1F62; Case map*/ "\u1F63", /*1F6B; 1F63; Case map*/ "\u1F64", /*1F6C; 1F64; Case map*/ "\u1F65", /*1F6D; 1F65; Case map*/ "\u1F66", /*1F6E; 1F66; Case map*/ "\u1F67", /*1F6F; 1F67; Case map*/ "\u1F00\u03B9", /*1F80; 1F00 03B9; Case map*/ "\u1F01\u03B9", /*1F81; 1F01 03B9; Case map*/ "\u1F02\u03B9", /*1F82; 1F02 03B9; Case map*/ "\u1F03\u03B9", /*1F83; 1F03 03B9; Case map*/ "\u1F04\u03B9", /*1F84; 1F04 03B9; Case map*/ "\u1F05\u03B9", /*1F85; 1F05 03B9; Case map*/ "\u1F06\u03B9", /*1F86; 1F06 03B9; Case map*/ "\u1F07\u03B9", /*1F87; 1F07 03B9; Case map*/ "\u1F00\u03B9", /*1F88; 1F00 03B9; Case map*/ "\u1F01\u03B9", /*1F89; 1F01 03B9; Case map*/ "\u1F02\u03B9", /*1F8A; 1F02 03B9; Case map*/ "\u1F03\u03B9", /*1F8B; 1F03 03B9; Case map*/ "\u1F04\u03B9", /*1F8C; 1F04 03B9; Case map*/ "\u1F05\u03B9", /*1F8D; 1F05 03B9; Case map*/ "\u1F06\u03B9", /*1F8E; 1F06 03B9; Case map*/ "\u1F07\u03B9", /*1F8F; 1F07 03B9; Case map*/ "\u1F20\u03B9", /*1F90; 1F20 03B9; Case map*/ "\u1F21\u03B9", /*1F91; 1F21 03B9; Case map*/ "\u1F22\u03B9", /*1F92; 1F22 03B9; Case map*/ "\u1F23\u03B9", /*1F93; 1F23 03B9; Case map*/ "\u1F24\u03B9", /*1F94; 1F24 03B9; Case map*/ "\u1F25\u03B9", /*1F95; 1F25 03B9; Case map*/ "\u1F26\u03B9", /*1F96; 1F26 03B9; Case map*/ "\u1F27\u03B9", /*1F97; 1F27 03B9; Case map*/ "\u1F20\u03B9", /*1F98; 1F20 03B9; Case map*/ "\u1F21\u03B9", /*1F99; 1F21 03B9; Case map*/ "\u1F22\u03B9", /*1F9A; 1F22 03B9; Case map*/ "\u1F23\u03B9", /*1F9B; 1F23 03B9; Case map*/ "\u1F24\u03B9", /*1F9C; 1F24 03B9; Case map*/ "\u1F25\u03B9", /*1F9D; 1F25 03B9; Case map*/ "\u1F26\u03B9", /*1F9E; 1F26 03B9; Case map*/ "\u1F27\u03B9", /*1F9F; 1F27 03B9; Case map*/ "\u1F60\u03B9", /*1FA0; 1F60 03B9; Case map*/ "\u1F61\u03B9", /*1FA1; 1F61 03B9; Case map*/ "\u1F62\u03B9", /*1FA2; 1F62 03B9; Case map*/ "\u1F63\u03B9", /*1FA3; 1F63 03B9; Case map*/ "\u1F64\u03B9", /*1FA4; 1F64 03B9; Case map*/ "\u1F65\u03B9", /*1FA5; 1F65 03B9; Case map*/ "\u1F66\u03B9", /*1FA6; 1F66 03B9; Case map*/ "\u1F67\u03B9", /*1FA7; 1F67 03B9; Case map*/ "\u1F60\u03B9", /*1FA8; 1F60 03B9; Case map*/ "\u1F61\u03B9", /*1FA9; 1F61 03B9; Case map*/ "\u1F62\u03B9", /*1FAA; 1F62 03B9; Case map*/ "\u1F63\u03B9", /*1FAB; 1F63 03B9; Case map*/ "\u1F64\u03B9", /*1FAC; 1F64 03B9; Case map*/ "\u1F65\u03B9", /*1FAD; 1F65 03B9; Case map*/ "\u1F66\u03B9", /*1FAE; 1F66 03B9; Case map*/ "\u1F67\u03B9", /*1FAF; 1F67 03B9; Case map*/ "\u1F70\u03B9", /*1FB2; 1F70 03B9; Case map*/ "\u03B1\u03B9", /*1FB3; 03B1 03B9; Case map*/ "\u03AC\u03B9", /*1FB4; 03AC 03B9; Case map*/ "\u03B1\u0342", /*1FB6; 03B1 0342; Case map*/ "\u03B1\u0342\u03B9", /*1FB7; 03B1 0342 03B9; Case map*/ "\u1FB0", /*1FB8; 1FB0; Case map*/ "\u1FB1", /*1FB9; 1FB1; Case map*/ "\u1F70", /*1FBA; 1F70; Case map*/ "\u1F71", /*1FBB; 1F71; Case map*/ "\u03B1\u03B9", /*1FBC; 03B1 03B9; Case map*/ "\u03B9", /*1FBE; 03B9; Case map*/ "\u1F74\u03B9", /*1FC2; 1F74 03B9; Case map*/ "\u03B7\u03B9", /*1FC3; 03B7 03B9; Case map*/ "\u03AE\u03B9", /*1FC4; 03AE 03B9; Case map*/ "\u03B7\u0342", /*1FC6; 03B7 0342; Case map*/ "\u03B7\u0342\u03B9", /*1FC7; 03B7 0342 03B9; Case map*/ "\u1F72", /*1FC8; 1F72; Case map*/ "\u1F73", /*1FC9; 1F73; Case map*/ "\u1F74", /*1FCA; 1F74; Case map*/ "\u1F75", /*1FCB; 1F75; Case map*/ "\u03B7\u03B9", /*1FCC; 03B7 03B9; Case map*/ "\u03B9\u0308\u0300", /*1FD2; 03B9 0308 0300; Case map*/ "\u03B9\u0308\u0301", /*1FD3; 03B9 0308 0301; Case map*/ "\u03B9\u0342", /*1FD6; 03B9 0342; Case map*/ "\u03B9\u0308\u0342", /*1FD7; 03B9 0308 0342; Case map*/ "\u1FD0", /*1FD8; 1FD0; Case map*/ "\u1FD1", /*1FD9; 1FD1; Case map*/ "\u1F76", /*1FDA; 1F76; Case map*/ "\u1F77", /*1FDB; 1F77; Case map*/ "\u03C5\u0308\u0300", /*1FE2; 03C5 0308 0300; Case map*/ "\u03C5\u0308\u0301", /*1FE3; 03C5 0308 0301; Case map*/ "\u03C1\u0313", /*1FE4; 03C1 0313; Case map*/ "\u03C5\u0342", /*1FE6; 03C5 0342; Case map*/ "\u03C5\u0308\u0342", /*1FE7; 03C5 0308 0342; Case map*/ "\u1FE0", /*1FE8; 1FE0; Case map*/ "\u1FE1", /*1FE9; 1FE1; Case map*/ "\u1F7A", /*1FEA; 1F7A; Case map*/ "\u1F7B", /*1FEB; 1F7B; Case map*/ "\u1FE5", /*1FEC; 1FE5; Case map*/ "\u1F7C\u03B9", /*1FF2; 1F7C 03B9; Case map*/ "\u03C9\u03B9", /*1FF3; 03C9 03B9; Case map*/ "\u03CE\u03B9", /*1FF4; 03CE 03B9; Case map*/ "\u03C9\u0342", /*1FF6; 03C9 0342; Case map*/ "\u03C9\u0342\u03B9", /*1FF7; 03C9 0342 03B9; Case map*/ "\u1F78", /*1FF8; 1F78; Case map*/ "\u1F79", /*1FF9; 1F79; Case map*/ "\u1F7C", /*1FFA; 1F7C; Case map*/ "\u1F7D", /*1FFB; 1F7D; Case map*/ "\u03C9\u03B9", /*1FFC; 03C9 03B9; Case map*/ "\u0072\u0073", /*20A8; 0072 0073; Additional folding*/ "\u0063", /*2102; 0063; Additional folding*/ "\u00B0\u0063", /*2103; 00B0 0063; Additional folding*/ "\u025B", /*2107; 025B; Additional folding*/ "\u00B0\u0066", /*2109; 00B0 0066; Additional folding*/ "\u0068", /*210B; 0068; Additional folding*/ "\u0068", /*210C; 0068; Additional folding*/ "\u0068", /*210D; 0068; Additional folding*/ "\u0069", /*2110; 0069; Additional folding*/ "\u0069", /*2111; 0069; Additional folding*/ "\u006C", /*2112; 006C; Additional folding*/ "\u006E", /*2115; 006E; Additional folding*/ "\u006E\u006F", /*2116; 006E 006F; Additional folding*/ "\u0070", /*2119; 0070; Additional folding*/ "\u0071", /*211A; 0071; Additional folding*/ "\u0072", /*211B; 0072; Additional folding*/ "\u0072", /*211C; 0072; Additional folding*/ "\u0072", /*211D; 0072; Additional folding*/ "\u0073\u006D", /*2120; 0073 006D; Additional folding*/ "\u0074\u0065\u006C", /*2121; 0074 0065 006C; Additional folding*/ "\u0074\u006D", /*2122; 0074 006D; Additional folding*/ "\u007A", /*2124; 007A; Additional folding*/ "\u03C9", /*2126; 03C9; Case map*/ "\u007A", /*2128; 007A; Additional folding*/ "\u006B", /*212A; 006B; Case map*/ "\u00E5", /*212B; 00E5; Case map*/ "\u0062", /*212C; 0062; Additional folding*/ "\u0063", /*212D; 0063; Additional folding*/ "\u0065", /*2130; 0065; Additional folding*/ "\u0066", /*2131; 0066; Additional folding*/ "\u006D", /*2133; 006D; Additional folding*/ "\u03B3", /*213E; 03B3; Additional folding*/ "\u03C0", /*213F; 03C0; Additional folding*/ "\u0064", /*2145; 0064; Additional folding*/ "\u2170", /*2160; 2170; Case map*/ "\u2171", /*2161; 2171; Case map*/ "\u2172", /*2162; 2172; Case map*/ "\u2173", /*2163; 2173; Case map*/ "\u2174", /*2164; 2174; Case map*/ "\u2175", /*2165; 2175; Case map*/ "\u2176", /*2166; 2176; Case map*/ "\u2177", /*2167; 2177; Case map*/ "\u2178", /*2168; 2178; Case map*/ "\u2179", /*2169; 2179; Case map*/ "\u217A", /*216A; 217A; Case map*/ "\u217B", /*216B; 217B; Case map*/ "\u217C", /*216C; 217C; Case map*/ "\u217D", /*216D; 217D; Case map*/ "\u217E", /*216E; 217E; Case map*/ "\u217F", /*216F; 217F; Case map*/ "\u24D0", /*24B6; 24D0; Case map*/ "\u24D1", /*24B7; 24D1; Case map*/ "\u24D2", /*24B8; 24D2; Case map*/ "\u24D3", /*24B9; 24D3; Case map*/ "\u24D4", /*24BA; 24D4; Case map*/ "\u24D5", /*24BB; 24D5; Case map*/ "\u24D6", /*24BC; 24D6; Case map*/ "\u24D7", /*24BD; 24D7; Case map*/ "\u24D8", /*24BE; 24D8; Case map*/ "\u24D9", /*24BF; 24D9; Case map*/ "\u24DA", /*24C0; 24DA; Case map*/ "\u24DB", /*24C1; 24DB; Case map*/ "\u24DC", /*24C2; 24DC; Case map*/ "\u24DD", /*24C3; 24DD; Case map*/ "\u24DE", /*24C4; 24DE; Case map*/ "\u24DF", /*24C5; 24DF; Case map*/ "\u24E0", /*24C6; 24E0; Case map*/ "\u24E1", /*24C7; 24E1; Case map*/ "\u24E2", /*24C8; 24E2; Case map*/ "\u24E3", /*24C9; 24E3; Case map*/ "\u24E4", /*24CA; 24E4; Case map*/ "\u24E5", /*24CB; 24E5; Case map*/ "\u24E6", /*24CC; 24E6; Case map*/ "\u24E7", /*24CD; 24E7; Case map*/ "\u24E8", /*24CE; 24E8; Case map*/ "\u24E9", /*24CF; 24E9; Case map*/ "\u0068\u0070\u0061", /*3371; 0068 0070 0061; Additional folding*/ "\u0061\u0075", /*3373; 0061 0075; Additional folding*/ "\u006F\u0076", /*3375; 006F 0076; Additional folding*/ "\u0070\u0061", /*3380; 0070 0061; Additional folding*/ "\u006E\u0061", /*3381; 006E 0061; Additional folding*/ "\u03BC\u0061", /*3382; 03BC 0061; Additional folding*/ "\u006D\u0061", /*3383; 006D 0061; Additional folding*/ "\u006B\u0061", /*3384; 006B 0061; Additional folding*/ "\u006B\u0062", /*3385; 006B 0062; Additional folding*/ "\u006D\u0062", /*3386; 006D 0062; Additional folding*/ "\u0067\u0062", /*3387; 0067 0062; Additional folding*/ "\u0070\u0066", /*338A; 0070 0066; Additional folding*/ "\u006E\u0066", /*338B; 006E 0066; Additional folding*/ "\u03BC\u0066", /*338C; 03BC 0066; Additional folding*/ "\u0068\u007A", /*3390; 0068 007A; Additional folding*/ "\u006B\u0068\u007A", /*3391; 006B 0068 007A; Additional folding*/ "\u006D\u0068\u007A", /*3392; 006D 0068 007A; Additional folding*/ "\u0067\u0068\u007A", /*3393; 0067 0068 007A; Additional folding*/ "\u0074\u0068\u007A", /*3394; 0074 0068 007A; Additional folding*/ "\u0070\u0061", /*33A9; 0070 0061; Additional folding*/ "\u006B\u0070\u0061", /*33AA; 006B 0070 0061; Additional folding*/ "\u006D\u0070\u0061", /*33AB; 006D 0070 0061; Additional folding*/ "\u0067\u0070\u0061", /*33AC; 0067 0070 0061; Additional folding*/ "\u0070\u0076", /*33B4; 0070 0076; Additional folding*/ "\u006E\u0076", /*33B5; 006E 0076; Additional folding*/ "\u03BC\u0076", /*33B6; 03BC 0076; Additional folding*/ "\u006D\u0076", /*33B7; 006D 0076; Additional folding*/ "\u006B\u0076", /*33B8; 006B 0076; Additional folding*/ "\u006D\u0076", /*33B9; 006D 0076; Additional folding*/ "\u0070\u0077", /*33BA; 0070 0077; Additional folding*/ "\u006E\u0077", /*33BB; 006E 0077; Additional folding*/ "\u03BC\u0077", /*33BC; 03BC 0077; Additional folding*/ "\u006D\u0077", /*33BD; 006D 0077; Additional folding*/ "\u006B\u0077", /*33BE; 006B 0077; Additional folding*/ "\u006D\u0077", /*33BF; 006D 0077; Additional folding*/ "\u006B\u03C9", /*33C0; 006B 03C9; Additional folding*/ "\u006D\u03C9", /*33C1; 006D 03C9; Additional folding*/ "\u0062\u0071", /*33C3; 0062 0071; Additional folding*/ "\u0063\u2215\u006B\u0067", /*33C6; 0063 2215 006B 0067; Additional folding*/ "\u0063\u006F\u002E", /*33C7; 0063 006F 002E; Additional folding*/ "\u0064\u0062", /*33C8; 0064 0062; Additional folding*/ "\u0067\u0079", /*33C9; 0067 0079; Additional folding*/ "\u0068\u0070", /*33CB; 0068 0070; Additional folding*/ "\u006B\u006B", /*33CD; 006B 006B; Additional folding*/ "\u006B\u006D", /*33CE; 006B 006D; Additional folding*/ "\u0070\u0068", /*33D7; 0070 0068; Additional folding*/ "\u0070\u0070\u006D", /*33D9; 0070 0070 006D; Additional folding*/ "\u0070\u0072", /*33DA; 0070 0072; Additional folding*/ "\u0073\u0076", /*33DC; 0073 0076; Additional folding*/ "\u0077\u0062", /*33DD; 0077 0062; Additional folding*/ "\u0066\u0066", /*FB00; 0066 0066; Case map*/ "\u0066\u0069", /*FB01; 0066 0069; Case map*/ "\u0066\u006C", /*FB02; 0066 006C; Case map*/ "\u0066\u0066\u0069", /*FB03; 0066 0066 0069; Case map*/ "\u0066\u0066\u006C", /*FB04; 0066 0066 006C; Case map*/ "\u0073\u0074", /*FB05; 0073 0074; Case map*/ "\u0073\u0074", /*FB06; 0073 0074; Case map*/ "\u0574\u0576", /*FB13; 0574 0576; Case map*/ "\u0574\u0565", /*FB14; 0574 0565; Case map*/ "\u0574\u056B", /*FB15; 0574 056B; Case map*/ "\u057E\u0576", /*FB16; 057E 0576; Case map*/ "\u0574\u056D", /*FB17; 0574 056D; Case map*/ "\uFF41", /*FF21; FF41; Case map*/ "\uFF42", /*FF22; FF42; Case map*/ "\uFF43", /*FF23; FF43; Case map*/ "\uFF44", /*FF24; FF44; Case map*/ "\uFF45", /*FF25; FF45; Case map*/ "\uFF46", /*FF26; FF46; Case map*/ "\uFF47", /*FF27; FF47; Case map*/ "\uFF48", /*FF28; FF48; Case map*/ "\uFF49", /*FF29; FF49; Case map*/ "\uFF4A", /*FF2A; FF4A; Case map*/ "\uFF4B", /*FF2B; FF4B; Case map*/ "\uFF4C", /*FF2C; FF4C; Case map*/ "\uFF4D", /*FF2D; FF4D; Case map*/ "\uFF4E", /*FF2E; FF4E; Case map*/ "\uFF4F", /*FF2F; FF4F; Case map*/ "\uFF50", /*FF30; FF50; Case map*/ "\uFF51", /*FF31; FF51; Case map*/ "\uFF52", /*FF32; FF52; Case map*/ "\uFF53", /*FF33; FF53; Case map*/ "\uFF54", /*FF34; FF54; Case map*/ "\uFF55", /*FF35; FF55; Case map*/ "\uFF56", /*FF36; FF56; Case map*/ "\uFF57", /*FF37; FF57; Case map*/ "\uFF58", /*FF38; FF58; Case map*/ "\uFF59", /*FF39; FF59; Case map*/ "\uFF5A", /*FF3A; FF5A; Case map*/ }; public static char[] B3search = new char[] { '\u0041', /*0041; 0061; Case map*/ '\u0042', /*0042; 0062; Case map*/ '\u0043', /*0043; 0063; Case map*/ '\u0044', /*0044; 0064; Case map*/ '\u0045', /*0045; 0065; Case map*/ '\u0046', /*0046; 0066; Case map*/ '\u0047', /*0047; 0067; Case map*/ '\u0048', /*0048; 0068; Case map*/ '\u0049', /*0049; 0069; Case map*/ '\u004A', /*004A; 006A; Case map*/ '\u004B', /*004B; 006B; Case map*/ '\u004C', /*004C; 006C; Case map*/ '\u004D', /*004D; 006D; Case map*/ '\u004E', /*004E; 006E; Case map*/ '\u004F', /*004F; 006F; Case map*/ '\u0050', /*0050; 0070; Case map*/ '\u0051', /*0051; 0071; Case map*/ '\u0052', /*0052; 0072; Case map*/ '\u0053', /*0053; 0073; Case map*/ '\u0054', /*0054; 0074; Case map*/ '\u0055', /*0055; 0075; Case map*/ '\u0056', /*0056; 0076; Case map*/ '\u0057', /*0057; 0077; Case map*/ '\u0058', /*0058; 0078; Case map*/ '\u0059', /*0059; 0079; Case map*/ '\u005A', /*005A; 007A; Case map*/ '\u00B5', /*00B5; 03BC; Case map*/ '\u00C0', /*00C0; 00E0; Case map*/ '\u00C1', /*00C1; 00E1; Case map*/ '\u00C2', /*00C2; 00E2; Case map*/ '\u00C3', /*00C3; 00E3; Case map*/ '\u00C4', /*00C4; 00E4; Case map*/ '\u00C5', /*00C5; 00E5; Case map*/ '\u00C6', /*00C6; 00E6; Case map*/ '\u00C7', /*00C7; 00E7; Case map*/ '\u00C8', /*00C8; 00E8; Case map*/ '\u00C9', /*00C9; 00E9; Case map*/ '\u00CA', /*00CA; 00EA; Case map*/ '\u00CB', /*00CB; 00EB; Case map*/ '\u00CC', /*00CC; 00EC; Case map*/ '\u00CD', /*00CD; 00ED; Case map*/ '\u00CE', /*00CE; 00EE; Case map*/ '\u00CF', /*00CF; 00EF; Case map*/ '\u00D0', /*00D0; 00F0; Case map*/ '\u00D1', /*00D1; 00F1; Case map*/ '\u00D2', /*00D2; 00F2; Case map*/ '\u00D3', /*00D3; 00F3; Case map*/ '\u00D4', /*00D4; 00F4; Case map*/ '\u00D5', /*00D5; 00F5; Case map*/ '\u00D6', /*00D6; 00F6; Case map*/ '\u00D8', /*00D8; 00F8; Case map*/ '\u00D9', /*00D9; 00F9; Case map*/ '\u00DA', /*00DA; 00FA; Case map*/ '\u00DB', /*00DB; 00FB; Case map*/ '\u00DC', /*00DC; 00FC; Case map*/ '\u00DD', /*00DD; 00FD; Case map*/ '\u00DE', /*00DE; 00FE; Case map*/ '\u00DF', /*00DF; 0073 0073; Case map*/ '\u0100', /*0100; 0101; Case map*/ '\u0102', /*0102; 0103; Case map*/ '\u0104', /*0104; 0105; Case map*/ '\u0106', /*0106; 0107; Case map*/ '\u0108', /*0108; 0109; Case map*/ '\u010A', /*010A; 010B; Case map*/ '\u010C', /*010C; 010D; Case map*/ '\u010E', /*010E; 010F; Case map*/ '\u0110', /*0110; 0111; Case map*/ '\u0112', /*0112; 0113; Case map*/ '\u0114', /*0114; 0115; Case map*/ '\u0116', /*0116; 0117; Case map*/ '\u0118', /*0118; 0119; Case map*/ '\u011A', /*011A; 011B; Case map*/ '\u011C', /*011C; 011D; Case map*/ '\u011E', /*011E; 011F; Case map*/ '\u0120', /*0120; 0121; Case map*/ '\u0122', /*0122; 0123; Case map*/ '\u0124', /*0124; 0125; Case map*/ '\u0126', /*0126; 0127; Case map*/ '\u0128', /*0128; 0129; Case map*/ '\u012A', /*012A; 012B; Case map*/ '\u012C', /*012C; 012D; Case map*/ '\u012E', /*012E; 012F; Case map*/ '\u0130', /*0130; 0069 0307; Case map*/ '\u0132', /*0132; 0133; Case map*/ '\u0134', /*0134; 0135; Case map*/ '\u0136', /*0136; 0137; Case map*/ '\u0139', /*0139; 013A; Case map*/ '\u013B', /*013B; 013C; Case map*/ '\u013D', /*013D; 013E; Case map*/ '\u013F', /*013F; 0140; Case map*/ '\u0141', /*0141; 0142; Case map*/ '\u0143', /*0143; 0144; Case map*/ '\u0145', /*0145; 0146; Case map*/ '\u0147', /*0147; 0148; Case map*/ '\u0149', /*0149; 02BC 006E; Case map*/ '\u014A', /*014A; 014B; Case map*/ '\u014C', /*014C; 014D; Case map*/ '\u014E', /*014E; 014F; Case map*/ '\u0150', /*0150; 0151; Case map*/ '\u0152', /*0152; 0153; Case map*/ '\u0154', /*0154; 0155; Case map*/ '\u0156', /*0156; 0157; Case map*/ '\u0158', /*0158; 0159; Case map*/ '\u015A', /*015A; 015B; Case map*/ '\u015C', /*015C; 015D; Case map*/ '\u015E', /*015E; 015F; Case map*/ '\u0160', /*0160; 0161; Case map*/ '\u0162', /*0162; 0163; Case map*/ '\u0164', /*0164; 0165; Case map*/ '\u0166', /*0166; 0167; Case map*/ '\u0168', /*0168; 0169; Case map*/ '\u016A', /*016A; 016B; Case map*/ '\u016C', /*016C; 016D; Case map*/ '\u016E', /*016E; 016F; Case map*/ '\u0170', /*0170; 0171; Case map*/ '\u0172', /*0172; 0173; Case map*/ '\u0174', /*0174; 0175; Case map*/ '\u0176', /*0176; 0177; Case map*/ '\u0178', /*0178; 00FF; Case map*/ '\u0179', /*0179; 017A; Case map*/ '\u017B', /*017B; 017C; Case map*/ '\u017D', /*017D; 017E; Case map*/ '\u017F', /*017F; 0073; Case map*/ '\u0181', /*0181; 0253; Case map*/ '\u0182', /*0182; 0183; Case map*/ '\u0184', /*0184; 0185; Case map*/ '\u0186', /*0186; 0254; Case map*/ '\u0187', /*0187; 0188; Case map*/ '\u0189', /*0189; 0256; Case map*/ '\u018A', /*018A; 0257; Case map*/ '\u018B', /*018B; 018C; Case map*/ '\u018E', /*018E; 01DD; Case map*/ '\u018F', /*018F; 0259; Case map*/ '\u0190', /*0190; 025B; Case map*/ '\u0191', /*0191; 0192; Case map*/ '\u0193', /*0193; 0260; Case map*/ '\u0194', /*0194; 0263; Case map*/ '\u0196', /*0196; 0269; Case map*/ '\u0197', /*0197; 0268; Case map*/ '\u0198', /*0198; 0199; Case map*/ '\u019C', /*019C; 026F; Case map*/ '\u019D', /*019D; 0272; Case map*/ '\u019F', /*019F; 0275; Case map*/ '\u01A0', /*01A0; 01A1; Case map*/ '\u01A2', /*01A2; 01A3; Case map*/ '\u01A4', /*01A4; 01A5; Case map*/ '\u01A6', /*01A6; 0280; Case map*/ '\u01A7', /*01A7; 01A8; Case map*/ '\u01A9', /*01A9; 0283; Case map*/ '\u01AC', /*01AC; 01AD; Case map*/ '\u01AE', /*01AE; 0288; Case map*/ '\u01AF', /*01AF; 01B0; Case map*/ '\u01B1', /*01B1; 028A; Case map*/ '\u01B2', /*01B2; 028B; Case map*/ '\u01B3', /*01B3; 01B4; Case map*/ '\u01B5', /*01B5; 01B6; Case map*/ '\u01B7', /*01B7; 0292; Case map*/ '\u01B8', /*01B8; 01B9; Case map*/ '\u01BC', /*01BC; 01BD; Case map*/ '\u01C4', /*01C4; 01C6; Case map*/ '\u01C5', /*01C5; 01C6; Case map*/ '\u01C7', /*01C7; 01C9; Case map*/ '\u01C8', /*01C8; 01C9; Case map*/ '\u01CA', /*01CA; 01CC; Case map*/ '\u01CB', /*01CB; 01CC; Case map*/ '\u01CD', /*01CD; 01CE; Case map*/ '\u01CF', /*01CF; 01D0; Case map*/ '\u01D1', /*01D1; 01D2; Case map*/ '\u01D3', /*01D3; 01D4; Case map*/ '\u01D5', /*01D5; 01D6; Case map*/ '\u01D7', /*01D7; 01D8; Case map*/ '\u01D9', /*01D9; 01DA; Case map*/ '\u01DB', /*01DB; 01DC; Case map*/ '\u01DE', /*01DE; 01DF; Case map*/ '\u01E0', /*01E0; 01E1; Case map*/ '\u01E2', /*01E2; 01E3; Case map*/ '\u01E4', /*01E4; 01E5; Case map*/ '\u01E6', /*01E6; 01E7; Case map*/ '\u01E8', /*01E8; 01E9; Case map*/ '\u01EA', /*01EA; 01EB; Case map*/ '\u01EC', /*01EC; 01ED; Case map*/ '\u01EE', /*01EE; 01EF; Case map*/ '\u01F0', /*01F0; 006A 030C; Case map*/ '\u01F1', /*01F1; 01F3; Case map*/ '\u01F2', /*01F2; 01F3; Case map*/ '\u01F4', /*01F4; 01F5; Case map*/ '\u01F6', /*01F6; 0195; Case map*/ '\u01F7', /*01F7; 01BF; Case map*/ '\u01F8', /*01F8; 01F9; Case map*/ '\u01FA', /*01FA; 01FB; Case map*/ '\u01FC', /*01FC; 01FD; Case map*/ '\u01FE', /*01FE; 01FF; Case map*/ '\u0200', /*0200; 0201; Case map*/ '\u0202', /*0202; 0203; Case map*/ '\u0204', /*0204; 0205; Case map*/ '\u0206', /*0206; 0207; Case map*/ '\u0208', /*0208; 0209; Case map*/ '\u020A', /*020A; 020B; Case map*/ '\u020C', /*020C; 020D; Case map*/ '\u020E', /*020E; 020F; Case map*/ '\u0210', /*0210; 0211; Case map*/ '\u0212', /*0212; 0213; Case map*/ '\u0214', /*0214; 0215; Case map*/ '\u0216', /*0216; 0217; Case map*/ '\u0218', /*0218; 0219; Case map*/ '\u021A', /*021A; 021B; Case map*/ '\u021C', /*021C; 021D; Case map*/ '\u021E', /*021E; 021F; Case map*/ '\u0220', /*0220; 019E; Case map*/ '\u0222', /*0222; 0223; Case map*/ '\u0224', /*0224; 0225; Case map*/ '\u0226', /*0226; 0227; Case map*/ '\u0228', /*0228; 0229; Case map*/ '\u022A', /*022A; 022B; Case map*/ '\u022C', /*022C; 022D; Case map*/ '\u022E', /*022E; 022F; Case map*/ '\u0230', /*0230; 0231; Case map*/ '\u0232', /*0232; 0233; Case map*/ '\u0345', /*0345; 03B9; Case map*/ '\u0386', /*0386; 03AC; Case map*/ '\u0388', /*0388; 03AD; Case map*/ '\u0389', /*0389; 03AE; Case map*/ '\u038A', /*038A; 03AF; Case map*/ '\u038C', /*038C; 03CC; Case map*/ '\u038E', /*038E; 03CD; Case map*/ '\u038F', /*038F; 03CE; Case map*/ '\u0390', /*0390; 03B9 0308 0301; Case map*/ '\u0391', /*0391; 03B1; Case map*/ '\u0392', /*0392; 03B2; Case map*/ '\u0393', /*0393; 03B3; Case map*/ '\u0394', /*0394; 03B4; Case map*/ '\u0395', /*0395; 03B5; Case map*/ '\u0396', /*0396; 03B6; Case map*/ '\u0397', /*0397; 03B7; Case map*/ '\u0398', /*0398; 03B8; Case map*/ '\u0399', /*0399; 03B9; Case map*/ '\u039A', /*039A; 03BA; Case map*/ '\u039B', /*039B; 03BB; Case map*/ '\u039C', /*039C; 03BC; Case map*/ '\u039D', /*039D; 03BD; Case map*/ '\u039E', /*039E; 03BE; Case map*/ '\u039F', /*039F; 03BF; Case map*/ '\u03A0', /*03A0; 03C0; Case map*/ '\u03A1', /*03A1; 03C1; Case map*/ '\u03A3', /*03A3; 03C3; Case map*/ '\u03A4', /*03A4; 03C4; Case map*/ '\u03A5', /*03A5; 03C5; Case map*/ '\u03A6', /*03A6; 03C6; Case map*/ '\u03A7', /*03A7; 03C7; Case map*/ '\u03A8', /*03A8; 03C8; Case map*/ '\u03A9', /*03A9; 03C9; Case map*/ '\u03AA', /*03AA; 03CA; Case map*/ '\u03AB', /*03AB; 03CB; Case map*/ '\u03B0', /*03B0; 03C5 0308 0301; Case map*/ '\u03C2', /*03C2; 03C3; Case map*/ '\u03D0', /*03D0; 03B2; Case map*/ '\u03D1', /*03D1; 03B8; Case map*/ '\u03D5', /*03D5; 03C6; Case map*/ '\u03D6', /*03D6; 03C0; Case map*/ '\u03D8', /*03D8; 03D9; Case map*/ '\u03DA', /*03DA; 03DB; Case map*/ '\u03DC', /*03DC; 03DD; Case map*/ '\u03DE', /*03DE; 03DF; Case map*/ '\u03E0', /*03E0; 03E1; Case map*/ '\u03E2', /*03E2; 03E3; Case map*/ '\u03E4', /*03E4; 03E5; Case map*/ '\u03E6', /*03E6; 03E7; Case map*/ '\u03E8', /*03E8; 03E9; Case map*/ '\u03EA', /*03EA; 03EB; Case map*/ '\u03EC', /*03EC; 03ED; Case map*/ '\u03EE', /*03EE; 03EF; Case map*/ '\u03F0', /*03F0; 03BA; Case map*/ '\u03F1', /*03F1; 03C1; Case map*/ '\u03F2', /*03F2; 03C3; Case map*/ '\u03F4', /*03F4; 03B8; Case map*/ '\u03F5', /*03F5; 03B5; Case map*/ '\u0400', /*0400; 0450; Case map*/ '\u0401', /*0401; 0451; Case map*/ '\u0402', /*0402; 0452; Case map*/ '\u0403', /*0403; 0453; Case map*/ '\u0404', /*0404; 0454; Case map*/ '\u0405', /*0405; 0455; Case map*/ '\u0406', /*0406; 0456; Case map*/ '\u0407', /*0407; 0457; Case map*/ '\u0408', /*0408; 0458; Case map*/ '\u0409', /*0409; 0459; Case map*/ '\u040A', /*040A; 045A; Case map*/ '\u040B', /*040B; 045B; Case map*/ '\u040C', /*040C; 045C; Case map*/ '\u040D', /*040D; 045D; Case map*/ '\u040E', /*040E; 045E; Case map*/ '\u040F', /*040F; 045F; Case map*/ '\u0410', /*0410; 0430; Case map*/ '\u0411', /*0411; 0431; Case map*/ '\u0412', /*0412; 0432; Case map*/ '\u0413', /*0413; 0433; Case map*/ '\u0414', /*0414; 0434; Case map*/ '\u0415', /*0415; 0435; Case map*/ '\u0416', /*0416; 0436; Case map*/ '\u0417', /*0417; 0437; Case map*/ '\u0418', /*0418; 0438; Case map*/ '\u0419', /*0419; 0439; Case map*/ '\u041A', /*041A; 043A; Case map*/ '\u041B', /*041B; 043B; Case map*/ '\u041C', /*041C; 043C; Case map*/ '\u041D', /*041D; 043D; Case map*/ '\u041E', /*041E; 043E; Case map*/ '\u041F', /*041F; 043F; Case map*/ '\u0420', /*0420; 0440; Case map*/ '\u0421', /*0421; 0441; Case map*/ '\u0422', /*0422; 0442; Case map*/ '\u0423', /*0423; 0443; Case map*/ '\u0424', /*0424; 0444; Case map*/ '\u0425', /*0425; 0445; Case map*/ '\u0426', /*0426; 0446; Case map*/ '\u0427', /*0427; 0447; Case map*/ '\u0428', /*0428; 0448; Case map*/ '\u0429', /*0429; 0449; Case map*/ '\u042A', /*042A; 044A; Case map*/ '\u042B', /*042B; 044B; Case map*/ '\u042C', /*042C; 044C; Case map*/ '\u042D', /*042D; 044D; Case map*/ '\u042E', /*042E; 044E; Case map*/ '\u042F', /*042F; 044F; Case map*/ '\u0460', /*0460; 0461; Case map*/ '\u0462', /*0462; 0463; Case map*/ '\u0464', /*0464; 0465; Case map*/ '\u0466', /*0466; 0467; Case map*/ '\u0468', /*0468; 0469; Case map*/ '\u046A', /*046A; 046B; Case map*/ '\u046C', /*046C; 046D; Case map*/ '\u046E', /*046E; 046F; Case map*/ '\u0470', /*0470; 0471; Case map*/ '\u0472', /*0472; 0473; Case map*/ '\u0474', /*0474; 0475; Case map*/ '\u0476', /*0476; 0477; Case map*/ '\u0478', /*0478; 0479; Case map*/ '\u047A', /*047A; 047B; Case map*/ '\u047C', /*047C; 047D; Case map*/ '\u047E', /*047E; 047F; Case map*/ '\u0480', /*0480; 0481; Case map*/ '\u048A', /*048A; 048B; Case map*/ '\u048C', /*048C; 048D; Case map*/ '\u048E', /*048E; 048F; Case map*/ '\u0490', /*0490; 0491; Case map*/ '\u0492', /*0492; 0493; Case map*/ '\u0494', /*0494; 0495; Case map*/ '\u0496', /*0496; 0497; Case map*/ '\u0498', /*0498; 0499; Case map*/ '\u049A', /*049A; 049B; Case map*/ '\u049C', /*049C; 049D; Case map*/ '\u049E', /*049E; 049F; Case map*/ '\u04A0', /*04A0; 04A1; Case map*/ '\u04A2', /*04A2; 04A3; Case map*/ '\u04A4', /*04A4; 04A5; Case map*/ '\u04A6', /*04A6; 04A7; Case map*/ '\u04A8', /*04A8; 04A9; Case map*/ '\u04AA', /*04AA; 04AB; Case map*/ '\u04AC', /*04AC; 04AD; Case map*/ '\u04AE', /*04AE; 04AF; Case map*/ '\u04B0', /*04B0; 04B1; Case map*/ '\u04B2', /*04B2; 04B3; Case map*/ '\u04B4', /*04B4; 04B5; Case map*/ '\u04B6', /*04B6; 04B7; Case map*/ '\u04B8', /*04B8; 04B9; Case map*/ '\u04BA', /*04BA; 04BB; Case map*/ '\u04BC', /*04BC; 04BD; Case map*/ '\u04BE', /*04BE; 04BF; Case map*/ '\u04C1', /*04C1; 04C2; Case map*/ '\u04C3', /*04C3; 04C4; Case map*/ '\u04C5', /*04C5; 04C6; Case map*/ '\u04C7', /*04C7; 04C8; Case map*/ '\u04C9', /*04C9; 04CA; Case map*/ '\u04CB', /*04CB; 04CC; Case map*/ '\u04CD', /*04CD; 04CE; Case map*/ '\u04D0', /*04D0; 04D1; Case map*/ '\u04D2', /*04D2; 04D3; Case map*/ '\u04D4', /*04D4; 04D5; Case map*/ '\u04D6', /*04D6; 04D7; Case map*/ '\u04D8', /*04D8; 04D9; Case map*/ '\u04DA', /*04DA; 04DB; Case map*/ '\u04DC', /*04DC; 04DD; Case map*/ '\u04DE', /*04DE; 04DF; Case map*/ '\u04E0', /*04E0; 04E1; Case map*/ '\u04E2', /*04E2; 04E3; Case map*/ '\u04E4', /*04E4; 04E5; Case map*/ '\u04E6', /*04E6; 04E7; Case map*/ '\u04E8', /*04E8; 04E9; Case map*/ '\u04EA', /*04EA; 04EB; Case map*/ '\u04EC', /*04EC; 04ED; Case map*/ '\u04EE', /*04EE; 04EF; Case map*/ '\u04F0', /*04F0; 04F1; Case map*/ '\u04F2', /*04F2; 04F3; Case map*/ '\u04F4', /*04F4; 04F5; Case map*/ '\u04F8', /*04F8; 04F9; Case map*/ '\u0500', /*0500; 0501; Case map*/ '\u0502', /*0502; 0503; Case map*/ '\u0504', /*0504; 0505; Case map*/ '\u0506', /*0506; 0507; Case map*/ '\u0508', /*0508; 0509; Case map*/ '\u050A', /*050A; 050B; Case map*/ '\u050C', /*050C; 050D; Case map*/ '\u050E', /*050E; 050F; Case map*/ '\u0531', /*0531; 0561; Case map*/ '\u0532', /*0532; 0562; Case map*/ '\u0533', /*0533; 0563; Case map*/ '\u0534', /*0534; 0564; Case map*/ '\u0535', /*0535; 0565; Case map*/ '\u0536', /*0536; 0566; Case map*/ '\u0537', /*0537; 0567; Case map*/ '\u0538', /*0538; 0568; Case map*/ '\u0539', /*0539; 0569; Case map*/ '\u053A', /*053A; 056A; Case map*/ '\u053B', /*053B; 056B; Case map*/ '\u053C', /*053C; 056C; Case map*/ '\u053D', /*053D; 056D; Case map*/ '\u053E', /*053E; 056E; Case map*/ '\u053F', /*053F; 056F; Case map*/ '\u0540', /*0540; 0570; Case map*/ '\u0541', /*0541; 0571; Case map*/ '\u0542', /*0542; 0572; Case map*/ '\u0543', /*0543; 0573; Case map*/ '\u0544', /*0544; 0574; Case map*/ '\u0545', /*0545; 0575; Case map*/ '\u0546', /*0546; 0576; Case map*/ '\u0547', /*0547; 0577; Case map*/ '\u0548', /*0548; 0578; Case map*/ '\u0549', /*0549; 0579; Case map*/ '\u054A', /*054A; 057A; Case map*/ '\u054B', /*054B; 057B; Case map*/ '\u054C', /*054C; 057C; Case map*/ '\u054D', /*054D; 057D; Case map*/ '\u054E', /*054E; 057E; Case map*/ '\u054F', /*054F; 057F; Case map*/ '\u0550', /*0550; 0580; Case map*/ '\u0551', /*0551; 0581; Case map*/ '\u0552', /*0552; 0582; Case map*/ '\u0553', /*0553; 0583; Case map*/ '\u0554', /*0554; 0584; Case map*/ '\u0555', /*0555; 0585; Case map*/ '\u0556', /*0556; 0586; Case map*/ '\u0587', /*0587; 0565 0582; Case map*/ '\u1E00', /*1E00; 1E01; Case map*/ '\u1E02', /*1E02; 1E03; Case map*/ '\u1E04', /*1E04; 1E05; Case map*/ '\u1E06', /*1E06; 1E07; Case map*/ '\u1E08', /*1E08; 1E09; Case map*/ '\u1E0A', /*1E0A; 1E0B; Case map*/ '\u1E0C', /*1E0C; 1E0D; Case map*/ '\u1E0E', /*1E0E; 1E0F; Case map*/ '\u1E10', /*1E10; 1E11; Case map*/ '\u1E12', /*1E12; 1E13; Case map*/ '\u1E14', /*1E14; 1E15; Case map*/ '\u1E16', /*1E16; 1E17; Case map*/ '\u1E18', /*1E18; 1E19; Case map*/ '\u1E1A', /*1E1A; 1E1B; Case map*/ '\u1E1C', /*1E1C; 1E1D; Case map*/ '\u1E1E', /*1E1E; 1E1F; Case map*/ '\u1E20', /*1E20; 1E21; Case map*/ '\u1E22', /*1E22; 1E23; Case map*/ '\u1E24', /*1E24; 1E25; Case map*/ '\u1E26', /*1E26; 1E27; Case map*/ '\u1E28', /*1E28; 1E29; Case map*/ '\u1E2A', /*1E2A; 1E2B; Case map*/ '\u1E2C', /*1E2C; 1E2D; Case map*/ '\u1E2E', /*1E2E; 1E2F; Case map*/ '\u1E30', /*1E30; 1E31; Case map*/ '\u1E32', /*1E32; 1E33; Case map*/ '\u1E34', /*1E34; 1E35; Case map*/ '\u1E36', /*1E36; 1E37; Case map*/ '\u1E38', /*1E38; 1E39; Case map*/ '\u1E3A', /*1E3A; 1E3B; Case map*/ '\u1E3C', /*1E3C; 1E3D; Case map*/ '\u1E3E', /*1E3E; 1E3F; Case map*/ '\u1E40', /*1E40; 1E41; Case map*/ '\u1E42', /*1E42; 1E43; Case map*/ '\u1E44', /*1E44; 1E45; Case map*/ '\u1E46', /*1E46; 1E47; Case map*/ '\u1E48', /*1E48; 1E49; Case map*/ '\u1E4A', /*1E4A; 1E4B; Case map*/ '\u1E4C', /*1E4C; 1E4D; Case map*/ '\u1E4E', /*1E4E; 1E4F; Case map*/ '\u1E50', /*1E50; 1E51; Case map*/ '\u1E52', /*1E52; 1E53; Case map*/ '\u1E54', /*1E54; 1E55; Case map*/ '\u1E56', /*1E56; 1E57; Case map*/ '\u1E58', /*1E58; 1E59; Case map*/ '\u1E5A', /*1E5A; 1E5B; Case map*/ '\u1E5C', /*1E5C; 1E5D; Case map*/ '\u1E5E', /*1E5E; 1E5F; Case map*/ '\u1E60', /*1E60; 1E61; Case map*/ '\u1E62', /*1E62; 1E63; Case map*/ '\u1E64', /*1E64; 1E65; Case map*/ '\u1E66', /*1E66; 1E67; Case map*/ '\u1E68', /*1E68; 1E69; Case map*/ '\u1E6A', /*1E6A; 1E6B; Case map*/ '\u1E6C', /*1E6C; 1E6D; Case map*/ '\u1E6E', /*1E6E; 1E6F; Case map*/ '\u1E70', /*1E70; 1E71; Case map*/ '\u1E72', /*1E72; 1E73; Case map*/ '\u1E74', /*1E74; 1E75; Case map*/ '\u1E76', /*1E76; 1E77; Case map*/ '\u1E78', /*1E78; 1E79; Case map*/ '\u1E7A', /*1E7A; 1E7B; Case map*/ '\u1E7C', /*1E7C; 1E7D; Case map*/ '\u1E7E', /*1E7E; 1E7F; Case map*/ '\u1E80', /*1E80; 1E81; Case map*/ '\u1E82', /*1E82; 1E83; Case map*/ '\u1E84', /*1E84; 1E85; Case map*/ '\u1E86', /*1E86; 1E87; Case map*/ '\u1E88', /*1E88; 1E89; Case map*/ '\u1E8A', /*1E8A; 1E8B; Case map*/ '\u1E8C', /*1E8C; 1E8D; Case map*/ '\u1E8E', /*1E8E; 1E8F; Case map*/ '\u1E90', /*1E90; 1E91; Case map*/ '\u1E92', /*1E92; 1E93; Case map*/ '\u1E94', /*1E94; 1E95; Case map*/ '\u1E96', /*1E96; 0068 0331; Case map*/ '\u1E97', /*1E97; 0074 0308; Case map*/ '\u1E98', /*1E98; 0077 030A; Case map*/ '\u1E99', /*1E99; 0079 030A; Case map*/ '\u1E9A', /*1E9A; 0061 02BE; Case map*/ '\u1E9B', /*1E9B; 1E61; Case map*/ '\u1EA0', /*1EA0; 1EA1; Case map*/ '\u1EA2', /*1EA2; 1EA3; Case map*/ '\u1EA4', /*1EA4; 1EA5; Case map*/ '\u1EA6', /*1EA6; 1EA7; Case map*/ '\u1EA8', /*1EA8; 1EA9; Case map*/ '\u1EAA', /*1EAA; 1EAB; Case map*/ '\u1EAC', /*1EAC; 1EAD; Case map*/ '\u1EAE', /*1EAE; 1EAF; Case map*/ '\u1EB0', /*1EB0; 1EB1; Case map*/ '\u1EB2', /*1EB2; 1EB3; Case map*/ '\u1EB4', /*1EB4; 1EB5; Case map*/ '\u1EB6', /*1EB6; 1EB7; Case map*/ '\u1EB8', /*1EB8; 1EB9; Case map*/ '\u1EBA', /*1EBA; 1EBB; Case map*/ '\u1EBC', /*1EBC; 1EBD; Case map*/ '\u1EBE', /*1EBE; 1EBF; Case map*/ '\u1EC0', /*1EC0; 1EC1; Case map*/ '\u1EC2', /*1EC2; 1EC3; Case map*/ '\u1EC4', /*1EC4; 1EC5; Case map*/ '\u1EC6', /*1EC6; 1EC7; Case map*/ '\u1EC8', /*1EC8; 1EC9; Case map*/ '\u1ECA', /*1ECA; 1ECB; Case map*/ '\u1ECC', /*1ECC; 1ECD; Case map*/ '\u1ECE', /*1ECE; 1ECF; Case map*/ '\u1ED0', /*1ED0; 1ED1; Case map*/ '\u1ED2', /*1ED2; 1ED3; Case map*/ '\u1ED4', /*1ED4; 1ED5; Case map*/ '\u1ED6', /*1ED6; 1ED7; Case map*/ '\u1ED8', /*1ED8; 1ED9; Case map*/ '\u1EDA', /*1EDA; 1EDB; Case map*/ '\u1EDC', /*1EDC; 1EDD; Case map*/ '\u1EDE', /*1EDE; 1EDF; Case map*/ '\u1EE0', /*1EE0; 1EE1; Case map*/ '\u1EE2', /*1EE2; 1EE3; Case map*/ '\u1EE4', /*1EE4; 1EE5; Case map*/ '\u1EE6', /*1EE6; 1EE7; Case map*/ '\u1EE8', /*1EE8; 1EE9; Case map*/ '\u1EEA', /*1EEA; 1EEB; Case map*/ '\u1EEC', /*1EEC; 1EED; Case map*/ '\u1EEE', /*1EEE; 1EEF; Case map*/ '\u1EF0', /*1EF0; 1EF1; Case map*/ '\u1EF2', /*1EF2; 1EF3; Case map*/ '\u1EF4', /*1EF4; 1EF5; Case map*/ '\u1EF6', /*1EF6; 1EF7; Case map*/ '\u1EF8', /*1EF8; 1EF9; Case map*/ '\u1F08', /*1F08; 1F00; Case map*/ '\u1F09', /*1F09; 1F01; Case map*/ '\u1F0A', /*1F0A; 1F02; Case map*/ '\u1F0B', /*1F0B; 1F03; Case map*/ '\u1F0C', /*1F0C; 1F04; Case map*/ '\u1F0D', /*1F0D; 1F05; Case map*/ '\u1F0E', /*1F0E; 1F06; Case map*/ '\u1F0F', /*1F0F; 1F07; Case map*/ '\u1F18', /*1F18; 1F10; Case map*/ '\u1F19', /*1F19; 1F11; Case map*/ '\u1F1A', /*1F1A; 1F12; Case map*/ '\u1F1B', /*1F1B; 1F13; Case map*/ '\u1F1C', /*1F1C; 1F14; Case map*/ '\u1F1D', /*1F1D; 1F15; Case map*/ '\u1F28', /*1F28; 1F20; Case map*/ '\u1F29', /*1F29; 1F21; Case map*/ '\u1F2A', /*1F2A; 1F22; Case map*/ '\u1F2B', /*1F2B; 1F23; Case map*/ '\u1F2C', /*1F2C; 1F24; Case map*/ '\u1F2D', /*1F2D; 1F25; Case map*/ '\u1F2E', /*1F2E; 1F26; Case map*/ '\u1F2F', /*1F2F; 1F27; Case map*/ '\u1F38', /*1F38; 1F30; Case map*/ '\u1F39', /*1F39; 1F31; Case map*/ '\u1F3A', /*1F3A; 1F32; Case map*/ '\u1F3B', /*1F3B; 1F33; Case map*/ '\u1F3C', /*1F3C; 1F34; Case map*/ '\u1F3D', /*1F3D; 1F35; Case map*/ '\u1F3E', /*1F3E; 1F36; Case map*/ '\u1F3F', /*1F3F; 1F37; Case map*/ '\u1F48', /*1F48; 1F40; Case map*/ '\u1F49', /*1F49; 1F41; Case map*/ '\u1F4A', /*1F4A; 1F42; Case map*/ '\u1F4B', /*1F4B; 1F43; Case map*/ '\u1F4C', /*1F4C; 1F44; Case map*/ '\u1F4D', /*1F4D; 1F45; Case map*/ '\u1F50', /*1F50; 03C5 0313; Case map*/ '\u1F52', /*1F52; 03C5 0313 0300; Case map*/ '\u1F54', /*1F54; 03C5 0313 0301; Case map*/ '\u1F56', /*1F56; 03C5 0313 0342; Case map*/ '\u1F59', /*1F59; 1F51; Case map*/ '\u1F5B', /*1F5B; 1F53; Case map*/ '\u1F5D', /*1F5D; 1F55; Case map*/ '\u1F5F', /*1F5F; 1F57; Case map*/ '\u1F68', /*1F68; 1F60; Case map*/ '\u1F69', /*1F69; 1F61; Case map*/ '\u1F6A', /*1F6A; 1F62; Case map*/ '\u1F6B', /*1F6B; 1F63; Case map*/ '\u1F6C', /*1F6C; 1F64; Case map*/ '\u1F6D', /*1F6D; 1F65; Case map*/ '\u1F6E', /*1F6E; 1F66; Case map*/ '\u1F6F', /*1F6F; 1F67; Case map*/ '\u1F80', /*1F80; 1F00 03B9; Case map*/ '\u1F81', /*1F81; 1F01 03B9; Case map*/ '\u1F82', /*1F82; 1F02 03B9; Case map*/ '\u1F83', /*1F83; 1F03 03B9; Case map*/ '\u1F84', /*1F84; 1F04 03B9; Case map*/ '\u1F85', /*1F85; 1F05 03B9; Case map*/ '\u1F86', /*1F86; 1F06 03B9; Case map*/ '\u1F87', /*1F87; 1F07 03B9; Case map*/ '\u1F88', /*1F88; 1F00 03B9; Case map*/ '\u1F89', /*1F89; 1F01 03B9; Case map*/ '\u1F8A', /*1F8A; 1F02 03B9; Case map*/ '\u1F8B', /*1F8B; 1F03 03B9; Case map*/ '\u1F8C', /*1F8C; 1F04 03B9; Case map*/ '\u1F8D', /*1F8D; 1F05 03B9; Case map*/ '\u1F8E', /*1F8E; 1F06 03B9; Case map*/ '\u1F8F', /*1F8F; 1F07 03B9; Case map*/ '\u1F90', /*1F90; 1F20 03B9; Case map*/ '\u1F91', /*1F91; 1F21 03B9; Case map*/ '\u1F92', /*1F92; 1F22 03B9; Case map*/ '\u1F93', /*1F93; 1F23 03B9; Case map*/ '\u1F94', /*1F94; 1F24 03B9; Case map*/ '\u1F95', /*1F95; 1F25 03B9; Case map*/ '\u1F96', /*1F96; 1F26 03B9; Case map*/ '\u1F97', /*1F97; 1F27 03B9; Case map*/ '\u1F98', /*1F98; 1F20 03B9; Case map*/ '\u1F99', /*1F99; 1F21 03B9; Case map*/ '\u1F9A', /*1F9A; 1F22 03B9; Case map*/ '\u1F9B', /*1F9B; 1F23 03B9; Case map*/ '\u1F9C', /*1F9C; 1F24 03B9; Case map*/ '\u1F9D', /*1F9D; 1F25 03B9; Case map*/ '\u1F9E', /*1F9E; 1F26 03B9; Case map*/ '\u1F9F', /*1F9F; 1F27 03B9; Case map*/ '\u1FA0', /*1FA0; 1F60 03B9; Case map*/ '\u1FA1', /*1FA1; 1F61 03B9; Case map*/ '\u1FA2', /*1FA2; 1F62 03B9; Case map*/ '\u1FA3', /*1FA3; 1F63 03B9; Case map*/ '\u1FA4', /*1FA4; 1F64 03B9; Case map*/ '\u1FA5', /*1FA5; 1F65 03B9; Case map*/ '\u1FA6', /*1FA6; 1F66 03B9; Case map*/ '\u1FA7', /*1FA7; 1F67 03B9; Case map*/ '\u1FA8', /*1FA8; 1F60 03B9; Case map*/ '\u1FA9', /*1FA9; 1F61 03B9; Case map*/ '\u1FAA', /*1FAA; 1F62 03B9; Case map*/ '\u1FAB', /*1FAB; 1F63 03B9; Case map*/ '\u1FAC', /*1FAC; 1F64 03B9; Case map*/ '\u1FAD', /*1FAD; 1F65 03B9; Case map*/ '\u1FAE', /*1FAE; 1F66 03B9; Case map*/ '\u1FAF', /*1FAF; 1F67 03B9; Case map*/ '\u1FB2', /*1FB2; 1F70 03B9; Case map*/ '\u1FB3', /*1FB3; 03B1 03B9; Case map*/ '\u1FB4', /*1FB4; 03AC 03B9; Case map*/ '\u1FB6', /*1FB6; 03B1 0342; Case map*/ '\u1FB7', /*1FB7; 03B1 0342 03B9; Case map*/ '\u1FB8', /*1FB8; 1FB0; Case map*/ '\u1FB9', /*1FB9; 1FB1; Case map*/ '\u1FBA', /*1FBA; 1F70; Case map*/ '\u1FBB', /*1FBB; 1F71; Case map*/ '\u1FBC', /*1FBC; 03B1 03B9; Case map*/ '\u1FBE', /*1FBE; 03B9; Case map*/ '\u1FC2', /*1FC2; 1F74 03B9; Case map*/ '\u1FC3', /*1FC3; 03B7 03B9; Case map*/ '\u1FC4', /*1FC4; 03AE 03B9; Case map*/ '\u1FC6', /*1FC6; 03B7 0342; Case map*/ '\u1FC7', /*1FC7; 03B7 0342 03B9; Case map*/ '\u1FC8', /*1FC8; 1F72; Case map*/ '\u1FC9', /*1FC9; 1F73; Case map*/ '\u1FCA', /*1FCA; 1F74; Case map*/ '\u1FCB', /*1FCB; 1F75; Case map*/ '\u1FCC', /*1FCC; 03B7 03B9; Case map*/ '\u1FD2', /*1FD2; 03B9 0308 0300; Case map*/ '\u1FD3', /*1FD3; 03B9 0308 0301; Case map*/ '\u1FD6', /*1FD6; 03B9 0342; Case map*/ '\u1FD7', /*1FD7; 03B9 0308 0342; Case map*/ '\u1FD8', /*1FD8; 1FD0; Case map*/ '\u1FD9', /*1FD9; 1FD1; Case map*/ '\u1FDA', /*1FDA; 1F76; Case map*/ '\u1FDB', /*1FDB; 1F77; Case map*/ '\u1FE2', /*1FE2; 03C5 0308 0300; Case map*/ '\u1FE3', /*1FE3; 03C5 0308 0301; Case map*/ '\u1FE4', /*1FE4; 03C1 0313; Case map*/ '\u1FE6', /*1FE6; 03C5 0342; Case map*/ '\u1FE7', /*1FE7; 03C5 0308 0342; Case map*/ '\u1FE8', /*1FE8; 1FE0; Case map*/ '\u1FE9', /*1FE9; 1FE1; Case map*/ '\u1FEA', /*1FEA; 1F7A; Case map*/ '\u1FEB', /*1FEB; 1F7B; Case map*/ '\u1FEC', /*1FEC; 1FE5; Case map*/ '\u1FF2', /*1FF2; 1F7C 03B9; Case map*/ '\u1FF3', /*1FF3; 03C9 03B9; Case map*/ '\u1FF4', /*1FF4; 03CE 03B9; Case map*/ '\u1FF6', /*1FF6; 03C9 0342; Case map*/ '\u1FF7', /*1FF7; 03C9 0342 03B9; Case map*/ '\u1FF8', /*1FF8; 1F78; Case map*/ '\u1FF9', /*1FF9; 1F79; Case map*/ '\u1FFA', /*1FFA; 1F7C; Case map*/ '\u1FFB', /*1FFB; 1F7D; Case map*/ '\u1FFC', /*1FFC; 03C9 03B9; Case map*/ '\u2126', /*2126; 03C9; Case map*/ '\u212A', /*212A; 006B; Case map*/ '\u212B', /*212B; 00E5; Case map*/ '\u2160', /*2160; 2170; Case map*/ '\u2161', /*2161; 2171; Case map*/ '\u2162', /*2162; 2172; Case map*/ '\u2163', /*2163; 2173; Case map*/ '\u2164', /*2164; 2174; Case map*/ '\u2165', /*2165; 2175; Case map*/ '\u2166', /*2166; 2176; Case map*/ '\u2167', /*2167; 2177; Case map*/ '\u2168', /*2168; 2178; Case map*/ '\u2169', /*2169; 2179; Case map*/ '\u216A', /*216A; 217A; Case map*/ '\u216B', /*216B; 217B; Case map*/ '\u216C', /*216C; 217C; Case map*/ '\u216D', /*216D; 217D; Case map*/ '\u216E', /*216E; 217E; Case map*/ '\u216F', /*216F; 217F; Case map*/ '\u24B6', /*24B6; 24D0; Case map*/ '\u24B7', /*24B7; 24D1; Case map*/ '\u24B8', /*24B8; 24D2; Case map*/ '\u24B9', /*24B9; 24D3; Case map*/ '\u24BA', /*24BA; 24D4; Case map*/ '\u24BB', /*24BB; 24D5; Case map*/ '\u24BC', /*24BC; 24D6; Case map*/ '\u24BD', /*24BD; 24D7; Case map*/ '\u24BE', /*24BE; 24D8; Case map*/ '\u24BF', /*24BF; 24D9; Case map*/ '\u24C0', /*24C0; 24DA; Case map*/ '\u24C1', /*24C1; 24DB; Case map*/ '\u24C2', /*24C2; 24DC; Case map*/ '\u24C3', /*24C3; 24DD; Case map*/ '\u24C4', /*24C4; 24DE; Case map*/ '\u24C5', /*24C5; 24DF; Case map*/ '\u24C6', /*24C6; 24E0; Case map*/ '\u24C7', /*24C7; 24E1; Case map*/ '\u24C8', /*24C8; 24E2; Case map*/ '\u24C9', /*24C9; 24E3; Case map*/ '\u24CA', /*24CA; 24E4; Case map*/ '\u24CB', /*24CB; 24E5; Case map*/ '\u24CC', /*24CC; 24E6; Case map*/ '\u24CD', /*24CD; 24E7; Case map*/ '\u24CE', /*24CE; 24E8; Case map*/ '\u24CF', /*24CF; 24E9; Case map*/ '\uFB00', /*FB00; 0066 0066; Case map*/ '\uFB01', /*FB01; 0066 0069; Case map*/ '\uFB02', /*FB02; 0066 006C; Case map*/ '\uFB03', /*FB03; 0066 0066 0069; Case map*/ '\uFB04', /*FB04; 0066 0066 006C; Case map*/ '\uFB05', /*FB05; 0073 0074; Case map*/ '\uFB06', /*FB06; 0073 0074; Case map*/ '\uFB13', /*FB13; 0574 0576; Case map*/ '\uFB14', /*FB14; 0574 0565; Case map*/ '\uFB15', /*FB15; 0574 056B; Case map*/ '\uFB16', /*FB16; 057E 0576; Case map*/ '\uFB17', /*FB17; 0574 056D; Case map*/ '\uFF21', /*FF21; FF41; Case map*/ '\uFF22', /*FF22; FF42; Case map*/ '\uFF23', /*FF23; FF43; Case map*/ '\uFF24', /*FF24; FF44; Case map*/ '\uFF25', /*FF25; FF45; Case map*/ '\uFF26', /*FF26; FF46; Case map*/ '\uFF27', /*FF27; FF47; Case map*/ '\uFF28', /*FF28; FF48; Case map*/ '\uFF29', /*FF29; FF49; Case map*/ '\uFF2A', /*FF2A; FF4A; Case map*/ '\uFF2B', /*FF2B; FF4B; Case map*/ '\uFF2C', /*FF2C; FF4C; Case map*/ '\uFF2D', /*FF2D; FF4D; Case map*/ '\uFF2E', /*FF2E; FF4E; Case map*/ '\uFF2F', /*FF2F; FF4F; Case map*/ '\uFF30', /*FF30; FF50; Case map*/ '\uFF31', /*FF31; FF51; Case map*/ '\uFF32', /*FF32; FF52; Case map*/ '\uFF33', /*FF33; FF53; Case map*/ '\uFF34', /*FF34; FF54; Case map*/ '\uFF35', /*FF35; FF55; Case map*/ '\uFF36', /*FF36; FF56; Case map*/ '\uFF37', /*FF37; FF57; Case map*/ '\uFF38', /*FF38; FF58; Case map*/ '\uFF39', /*FF39; FF59; Case map*/ '\uFF3A', /*FF3A; FF5A; Case map*/ }; public static string[] B3replace = new string[] { "\u0061", /*0041; 0061; Case map*/ "\u0062", /*0042; 0062; Case map*/ "\u0063", /*0043; 0063; Case map*/ "\u0064", /*0044; 0064; Case map*/ "\u0065", /*0045; 0065; Case map*/ "\u0066", /*0046; 0066; Case map*/ "\u0067", /*0047; 0067; Case map*/ "\u0068", /*0048; 0068; Case map*/ "\u0069", /*0049; 0069; Case map*/ "\u006A", /*004A; 006A; Case map*/ "\u006B", /*004B; 006B; Case map*/ "\u006C", /*004C; 006C; Case map*/ "\u006D", /*004D; 006D; Case map*/ "\u006E", /*004E; 006E; Case map*/ "\u006F", /*004F; 006F; Case map*/ "\u0070", /*0050; 0070; Case map*/ "\u0071", /*0051; 0071; Case map*/ "\u0072", /*0052; 0072; Case map*/ "\u0073", /*0053; 0073; Case map*/ "\u0074", /*0054; 0074; Case map*/ "\u0075", /*0055; 0075; Case map*/ "\u0076", /*0056; 0076; Case map*/ "\u0077", /*0057; 0077; Case map*/ "\u0078", /*0058; 0078; Case map*/ "\u0079", /*0059; 0079; Case map*/ "\u007A", /*005A; 007A; Case map*/ "\u03BC", /*00B5; 03BC; Case map*/ "\u00E0", /*00C0; 00E0; Case map*/ "\u00E1", /*00C1; 00E1; Case map*/ "\u00E2", /*00C2; 00E2; Case map*/ "\u00E3", /*00C3; 00E3; Case map*/ "\u00E4", /*00C4; 00E4; Case map*/ "\u00E5", /*00C5; 00E5; Case map*/ "\u00E6", /*00C6; 00E6; Case map*/ "\u00E7", /*00C7; 00E7; Case map*/ "\u00E8", /*00C8; 00E8; Case map*/ "\u00E9", /*00C9; 00E9; Case map*/ "\u00EA", /*00CA; 00EA; Case map*/ "\u00EB", /*00CB; 00EB; Case map*/ "\u00EC", /*00CC; 00EC; Case map*/ "\u00ED", /*00CD; 00ED; Case map*/ "\u00EE", /*00CE; 00EE; Case map*/ "\u00EF", /*00CF; 00EF; Case map*/ "\u00F0", /*00D0; 00F0; Case map*/ "\u00F1", /*00D1; 00F1; Case map*/ "\u00F2", /*00D2; 00F2; Case map*/ "\u00F3", /*00D3; 00F3; Case map*/ "\u00F4", /*00D4; 00F4; Case map*/ "\u00F5", /*00D5; 00F5; Case map*/ "\u00F6", /*00D6; 00F6; Case map*/ "\u00F8", /*00D8; 00F8; Case map*/ "\u00F9", /*00D9; 00F9; Case map*/ "\u00FA", /*00DA; 00FA; Case map*/ "\u00FB", /*00DB; 00FB; Case map*/ "\u00FC", /*00DC; 00FC; Case map*/ "\u00FD", /*00DD; 00FD; Case map*/ "\u00FE", /*00DE; 00FE; Case map*/ "\u0073\u0073", /*00DF; 0073 0073; Case map*/ "\u0101", /*0100; 0101; Case map*/ "\u0103", /*0102; 0103; Case map*/ "\u0105", /*0104; 0105; Case map*/ "\u0107", /*0106; 0107; Case map*/ "\u0109", /*0108; 0109; Case map*/ "\u010B", /*010A; 010B; Case map*/ "\u010D", /*010C; 010D; Case map*/ "\u010F", /*010E; 010F; Case map*/ "\u0111", /*0110; 0111; Case map*/ "\u0113", /*0112; 0113; Case map*/ "\u0115", /*0114; 0115; Case map*/ "\u0117", /*0116; 0117; Case map*/ "\u0119", /*0118; 0119; Case map*/ "\u011B", /*011A; 011B; Case map*/ "\u011D", /*011C; 011D; Case map*/ "\u011F", /*011E; 011F; Case map*/ "\u0121", /*0120; 0121; Case map*/ "\u0123", /*0122; 0123; Case map*/ "\u0125", /*0124; 0125; Case map*/ "\u0127", /*0126; 0127; Case map*/ "\u0129", /*0128; 0129; Case map*/ "\u012B", /*012A; 012B; Case map*/ "\u012D", /*012C; 012D; Case map*/ "\u012F", /*012E; 012F; Case map*/ "\u0069\u0307", /*0130; 0069 0307; Case map*/ "\u0133", /*0132; 0133; Case map*/ "\u0135", /*0134; 0135; Case map*/ "\u0137", /*0136; 0137; Case map*/ "\u013A", /*0139; 013A; Case map*/ "\u013C", /*013B; 013C; Case map*/ "\u013E", /*013D; 013E; Case map*/ "\u0140", /*013F; 0140; Case map*/ "\u0142", /*0141; 0142; Case map*/ "\u0144", /*0143; 0144; Case map*/ "\u0146", /*0145; 0146; Case map*/ "\u0148", /*0147; 0148; Case map*/ "\u02BC\u006E", /*0149; 02BC 006E; Case map*/ "\u014B", /*014A; 014B; Case map*/ "\u014D", /*014C; 014D; Case map*/ "\u014F", /*014E; 014F; Case map*/ "\u0151", /*0150; 0151; Case map*/ "\u0153", /*0152; 0153; Case map*/ "\u0155", /*0154; 0155; Case map*/ "\u0157", /*0156; 0157; Case map*/ "\u0159", /*0158; 0159; Case map*/ "\u015B", /*015A; 015B; Case map*/ "\u015D", /*015C; 015D; Case map*/ "\u015F", /*015E; 015F; Case map*/ "\u0161", /*0160; 0161; Case map*/ "\u0163", /*0162; 0163; Case map*/ "\u0165", /*0164; 0165; Case map*/ "\u0167", /*0166; 0167; Case map*/ "\u0169", /*0168; 0169; Case map*/ "\u016B", /*016A; 016B; Case map*/ "\u016D", /*016C; 016D; Case map*/ "\u016F", /*016E; 016F; Case map*/ "\u0171", /*0170; 0171; Case map*/ "\u0173", /*0172; 0173; Case map*/ "\u0175", /*0174; 0175; Case map*/ "\u0177", /*0176; 0177; Case map*/ "\u00FF", /*0178; 00FF; Case map*/ "\u017A", /*0179; 017A; Case map*/ "\u017C", /*017B; 017C; Case map*/ "\u017E", /*017D; 017E; Case map*/ "\u0073", /*017F; 0073; Case map*/ "\u0253", /*0181; 0253; Case map*/ "\u0183", /*0182; 0183; Case map*/ "\u0185", /*0184; 0185; Case map*/ "\u0254", /*0186; 0254; Case map*/ "\u0188", /*0187; 0188; Case map*/ "\u0256", /*0189; 0256; Case map*/ "\u0257", /*018A; 0257; Case map*/ "\u018C", /*018B; 018C; Case map*/ "\u01DD", /*018E; 01DD; Case map*/ "\u0259", /*018F; 0259; Case map*/ "\u025B", /*0190; 025B; Case map*/ "\u0192", /*0191; 0192; Case map*/ "\u0260", /*0193; 0260; Case map*/ "\u0263", /*0194; 0263; Case map*/ "\u0269", /*0196; 0269; Case map*/ "\u0268", /*0197; 0268; Case map*/ "\u0199", /*0198; 0199; Case map*/ "\u026F", /*019C; 026F; Case map*/ "\u0272", /*019D; 0272; Case map*/ "\u0275", /*019F; 0275; Case map*/ "\u01A1", /*01A0; 01A1; Case map*/ "\u01A3", /*01A2; 01A3; Case map*/ "\u01A5", /*01A4; 01A5; Case map*/ "\u0280", /*01A6; 0280; Case map*/ "\u01A8", /*01A7; 01A8; Case map*/ "\u0283", /*01A9; 0283; Case map*/ "\u01AD", /*01AC; 01AD; Case map*/ "\u0288", /*01AE; 0288; Case map*/ "\u01B0", /*01AF; 01B0; Case map*/ "\u028A", /*01B1; 028A; Case map*/ "\u028B", /*01B2; 028B; Case map*/ "\u01B4", /*01B3; 01B4; Case map*/ "\u01B6", /*01B5; 01B6; Case map*/ "\u0292", /*01B7; 0292; Case map*/ "\u01B9", /*01B8; 01B9; Case map*/ "\u01BD", /*01BC; 01BD; Case map*/ "\u01C6", /*01C4; 01C6; Case map*/ "\u01C6", /*01C5; 01C6; Case map*/ "\u01C9", /*01C7; 01C9; Case map*/ "\u01C9", /*01C8; 01C9; Case map*/ "\u01CC", /*01CA; 01CC; Case map*/ "\u01CC", /*01CB; 01CC; Case map*/ "\u01CE", /*01CD; 01CE; Case map*/ "\u01D0", /*01CF; 01D0; Case map*/ "\u01D2", /*01D1; 01D2; Case map*/ "\u01D4", /*01D3; 01D4; Case map*/ "\u01D6", /*01D5; 01D6; Case map*/ "\u01D8", /*01D7; 01D8; Case map*/ "\u01DA", /*01D9; 01DA; Case map*/ "\u01DC", /*01DB; 01DC; Case map*/ "\u01DF", /*01DE; 01DF; Case map*/ "\u01E1", /*01E0; 01E1; Case map*/ "\u01E3", /*01E2; 01E3; Case map*/ "\u01E5", /*01E4; 01E5; Case map*/ "\u01E7", /*01E6; 01E7; Case map*/ "\u01E9", /*01E8; 01E9; Case map*/ "\u01EB", /*01EA; 01EB; Case map*/ "\u01ED", /*01EC; 01ED; Case map*/ "\u01EF", /*01EE; 01EF; Case map*/ "\u006A\u030C", /*01F0; 006A 030C; Case map*/ "\u01F3", /*01F1; 01F3; Case map*/ "\u01F3", /*01F2; 01F3; Case map*/ "\u01F5", /*01F4; 01F5; Case map*/ "\u0195", /*01F6; 0195; Case map*/ "\u01BF", /*01F7; 01BF; Case map*/ "\u01F9", /*01F8; 01F9; Case map*/ "\u01FB", /*01FA; 01FB; Case map*/ "\u01FD", /*01FC; 01FD; Case map*/ "\u01FF", /*01FE; 01FF; Case map*/ "\u0201", /*0200; 0201; Case map*/ "\u0203", /*0202; 0203; Case map*/ "\u0205", /*0204; 0205; Case map*/ "\u0207", /*0206; 0207; Case map*/ "\u0209", /*0208; 0209; Case map*/ "\u020B", /*020A; 020B; Case map*/ "\u020D", /*020C; 020D; Case map*/ "\u020F", /*020E; 020F; Case map*/ "\u0211", /*0210; 0211; Case map*/ "\u0213", /*0212; 0213; Case map*/ "\u0215", /*0214; 0215; Case map*/ "\u0217", /*0216; 0217; Case map*/ "\u0219", /*0218; 0219; Case map*/ "\u021B", /*021A; 021B; Case map*/ "\u021D", /*021C; 021D; Case map*/ "\u021F", /*021E; 021F; Case map*/ "\u019E", /*0220; 019E; Case map*/ "\u0223", /*0222; 0223; Case map*/ "\u0225", /*0224; 0225; Case map*/ "\u0227", /*0226; 0227; Case map*/ "\u0229", /*0228; 0229; Case map*/ "\u022B", /*022A; 022B; Case map*/ "\u022D", /*022C; 022D; Case map*/ "\u022F", /*022E; 022F; Case map*/ "\u0231", /*0230; 0231; Case map*/ "\u0233", /*0232; 0233; Case map*/ "\u03B9", /*0345; 03B9; Case map*/ "\u03AC", /*0386; 03AC; Case map*/ "\u03AD", /*0388; 03AD; Case map*/ "\u03AE", /*0389; 03AE; Case map*/ "\u03AF", /*038A; 03AF; Case map*/ "\u03CC", /*038C; 03CC; Case map*/ "\u03CD", /*038E; 03CD; Case map*/ "\u03CE", /*038F; 03CE; Case map*/ "\u03B9\u0308\u0301", /*0390; 03B9 0308 0301; Case map*/ "\u03B1", /*0391; 03B1; Case map*/ "\u03B2", /*0392; 03B2; Case map*/ "\u03B3", /*0393; 03B3; Case map*/ "\u03B4", /*0394; 03B4; Case map*/ "\u03B5", /*0395; 03B5; Case map*/ "\u03B6", /*0396; 03B6; Case map*/ "\u03B7", /*0397; 03B7; Case map*/ "\u03B8", /*0398; 03B8; Case map*/ "\u03B9", /*0399; 03B9; Case map*/ "\u03BA", /*039A; 03BA; Case map*/ "\u03BB", /*039B; 03BB; Case map*/ "\u03BC", /*039C; 03BC; Case map*/ "\u03BD", /*039D; 03BD; Case map*/ "\u03BE", /*039E; 03BE; Case map*/ "\u03BF", /*039F; 03BF; Case map*/ "\u03C0", /*03A0; 03C0; Case map*/ "\u03C1", /*03A1; 03C1; Case map*/ "\u03C3", /*03A3; 03C3; Case map*/ "\u03C4", /*03A4; 03C4; Case map*/ "\u03C5", /*03A5; 03C5; Case map*/ "\u03C6", /*03A6; 03C6; Case map*/ "\u03C7", /*03A7; 03C7; Case map*/ "\u03C8", /*03A8; 03C8; Case map*/ "\u03C9", /*03A9; 03C9; Case map*/ "\u03CA", /*03AA; 03CA; Case map*/ "\u03CB", /*03AB; 03CB; Case map*/ "\u03C5\u0308\u0301", /*03B0; 03C5 0308 0301; Case map*/ "\u03C3", /*03C2; 03C3; Case map*/ "\u03B2", /*03D0; 03B2; Case map*/ "\u03B8", /*03D1; 03B8; Case map*/ "\u03C6", /*03D5; 03C6; Case map*/ "\u03C0", /*03D6; 03C0; Case map*/ "\u03D9", /*03D8; 03D9; Case map*/ "\u03DB", /*03DA; 03DB; Case map*/ "\u03DD", /*03DC; 03DD; Case map*/ "\u03DF", /*03DE; 03DF; Case map*/ "\u03E1", /*03E0; 03E1; Case map*/ "\u03E3", /*03E2; 03E3; Case map*/ "\u03E5", /*03E4; 03E5; Case map*/ "\u03E7", /*03E6; 03E7; Case map*/ "\u03E9", /*03E8; 03E9; Case map*/ "\u03EB", /*03EA; 03EB; Case map*/ "\u03ED", /*03EC; 03ED; Case map*/ "\u03EF", /*03EE; 03EF; Case map*/ "\u03BA", /*03F0; 03BA; Case map*/ "\u03C1", /*03F1; 03C1; Case map*/ "\u03C3", /*03F2; 03C3; Case map*/ "\u03B8", /*03F4; 03B8; Case map*/ "\u03B5", /*03F5; 03B5; Case map*/ "\u0450", /*0400; 0450; Case map*/ "\u0451", /*0401; 0451; Case map*/ "\u0452", /*0402; 0452; Case map*/ "\u0453", /*0403; 0453; Case map*/ "\u0454", /*0404; 0454; Case map*/ "\u0455", /*0405; 0455; Case map*/ "\u0456", /*0406; 0456; Case map*/ "\u0457", /*0407; 0457; Case map*/ "\u0458", /*0408; 0458; Case map*/ "\u0459", /*0409; 0459; Case map*/ "\u045A", /*040A; 045A; Case map*/ "\u045B", /*040B; 045B; Case map*/ "\u045C", /*040C; 045C; Case map*/ "\u045D", /*040D; 045D; Case map*/ "\u045E", /*040E; 045E; Case map*/ "\u045F", /*040F; 045F; Case map*/ "\u0430", /*0410; 0430; Case map*/ "\u0431", /*0411; 0431; Case map*/ "\u0432", /*0412; 0432; Case map*/ "\u0433", /*0413; 0433; Case map*/ "\u0434", /*0414; 0434; Case map*/ "\u0435", /*0415; 0435; Case map*/ "\u0436", /*0416; 0436; Case map*/ "\u0437", /*0417; 0437; Case map*/ "\u0438", /*0418; 0438; Case map*/ "\u0439", /*0419; 0439; Case map*/ "\u043A", /*041A; 043A; Case map*/ "\u043B", /*041B; 043B; Case map*/ "\u043C", /*041C; 043C; Case map*/ "\u043D", /*041D; 043D; Case map*/ "\u043E", /*041E; 043E; Case map*/ "\u043F", /*041F; 043F; Case map*/ "\u0440", /*0420; 0440; Case map*/ "\u0441", /*0421; 0441; Case map*/ "\u0442", /*0422; 0442; Case map*/ "\u0443", /*0423; 0443; Case map*/ "\u0444", /*0424; 0444; Case map*/ "\u0445", /*0425; 0445; Case map*/ "\u0446", /*0426; 0446; Case map*/ "\u0447", /*0427; 0447; Case map*/ "\u0448", /*0428; 0448; Case map*/ "\u0449", /*0429; 0449; Case map*/ "\u044A", /*042A; 044A; Case map*/ "\u044B", /*042B; 044B; Case map*/ "\u044C", /*042C; 044C; Case map*/ "\u044D", /*042D; 044D; Case map*/ "\u044E", /*042E; 044E; Case map*/ "\u044F", /*042F; 044F; Case map*/ "\u0461", /*0460; 0461; Case map*/ "\u0463", /*0462; 0463; Case map*/ "\u0465", /*0464; 0465; Case map*/ "\u0467", /*0466; 0467; Case map*/ "\u0469", /*0468; 0469; Case map*/ "\u046B", /*046A; 046B; Case map*/ "\u046D", /*046C; 046D; Case map*/ "\u046F", /*046E; 046F; Case map*/ "\u0471", /*0470; 0471; Case map*/ "\u0473", /*0472; 0473; Case map*/ "\u0475", /*0474; 0475; Case map*/ "\u0477", /*0476; 0477; Case map*/ "\u0479", /*0478; 0479; Case map*/ "\u047B", /*047A; 047B; Case map*/ "\u047D", /*047C; 047D; Case map*/ "\u047F", /*047E; 047F; Case map*/ "\u0481", /*0480; 0481; Case map*/ "\u048B", /*048A; 048B; Case map*/ "\u048D", /*048C; 048D; Case map*/ "\u048F", /*048E; 048F; Case map*/ "\u0491", /*0490; 0491; Case map*/ "\u0493", /*0492; 0493; Case map*/ "\u0495", /*0494; 0495; Case map*/ "\u0497", /*0496; 0497; Case map*/ "\u0499", /*0498; 0499; Case map*/ "\u049B", /*049A; 049B; Case map*/ "\u049D", /*049C; 049D; Case map*/ "\u049F", /*049E; 049F; Case map*/ "\u04A1", /*04A0; 04A1; Case map*/ "\u04A3", /*04A2; 04A3; Case map*/ "\u04A5", /*04A4; 04A5; Case map*/ "\u04A7", /*04A6; 04A7; Case map*/ "\u04A9", /*04A8; 04A9; Case map*/ "\u04AB", /*04AA; 04AB; Case map*/ "\u04AD", /*04AC; 04AD; Case map*/ "\u04AF", /*04AE; 04AF; Case map*/ "\u04B1", /*04B0; 04B1; Case map*/ "\u04B3", /*04B2; 04B3; Case map*/ "\u04B5", /*04B4; 04B5; Case map*/ "\u04B7", /*04B6; 04B7; Case map*/ "\u04B9", /*04B8; 04B9; Case map*/ "\u04BB", /*04BA; 04BB; Case map*/ "\u04BD", /*04BC; 04BD; Case map*/ "\u04BF", /*04BE; 04BF; Case map*/ "\u04C2", /*04C1; 04C2; Case map*/ "\u04C4", /*04C3; 04C4; Case map*/ "\u04C6", /*04C5; 04C6; Case map*/ "\u04C8", /*04C7; 04C8; Case map*/ "\u04CA", /*04C9; 04CA; Case map*/ "\u04CC", /*04CB; 04CC; Case map*/ "\u04CE", /*04CD; 04CE; Case map*/ "\u04D1", /*04D0; 04D1; Case map*/ "\u04D3", /*04D2; 04D3; Case map*/ "\u04D5", /*04D4; 04D5; Case map*/ "\u04D7", /*04D6; 04D7; Case map*/ "\u04D9", /*04D8; 04D9; Case map*/ "\u04DB", /*04DA; 04DB; Case map*/ "\u04DD", /*04DC; 04DD; Case map*/ "\u04DF", /*04DE; 04DF; Case map*/ "\u04E1", /*04E0; 04E1; Case map*/ "\u04E3", /*04E2; 04E3; Case map*/ "\u04E5", /*04E4; 04E5; Case map*/ "\u04E7", /*04E6; 04E7; Case map*/ "\u04E9", /*04E8; 04E9; Case map*/ "\u04EB", /*04EA; 04EB; Case map*/ "\u04ED", /*04EC; 04ED; Case map*/ "\u04EF", /*04EE; 04EF; Case map*/ "\u04F1", /*04F0; 04F1; Case map*/ "\u04F3", /*04F2; 04F3; Case map*/ "\u04F5", /*04F4; 04F5; Case map*/ "\u04F9", /*04F8; 04F9; Case map*/ "\u0501", /*0500; 0501; Case map*/ "\u0503", /*0502; 0503; Case map*/ "\u0505", /*0504; 0505; Case map*/ "\u0507", /*0506; 0507; Case map*/ "\u0509", /*0508; 0509; Case map*/ "\u050B", /*050A; 050B; Case map*/ "\u050D", /*050C; 050D; Case map*/ "\u050F", /*050E; 050F; Case map*/ "\u0561", /*0531; 0561; Case map*/ "\u0562", /*0532; 0562; Case map*/ "\u0563", /*0533; 0563; Case map*/ "\u0564", /*0534; 0564; Case map*/ "\u0565", /*0535; 0565; Case map*/ "\u0566", /*0536; 0566; Case map*/ "\u0567", /*0537; 0567; Case map*/ "\u0568", /*0538; 0568; Case map*/ "\u0569", /*0539; 0569; Case map*/ "\u056A", /*053A; 056A; Case map*/ "\u056B", /*053B; 056B; Case map*/ "\u056C", /*053C; 056C; Case map*/ "\u056D", /*053D; 056D; Case map*/ "\u056E", /*053E; 056E; Case map*/ "\u056F", /*053F; 056F; Case map*/ "\u0570", /*0540; 0570; Case map*/ "\u0571", /*0541; 0571; Case map*/ "\u0572", /*0542; 0572; Case map*/ "\u0573", /*0543; 0573; Case map*/ "\u0574", /*0544; 0574; Case map*/ "\u0575", /*0545; 0575; Case map*/ "\u0576", /*0546; 0576; Case map*/ "\u0577", /*0547; 0577; Case map*/ "\u0578", /*0548; 0578; Case map*/ "\u0579", /*0549; 0579; Case map*/ "\u057A", /*054A; 057A; Case map*/ "\u057B", /*054B; 057B; Case map*/ "\u057C", /*054C; 057C; Case map*/ "\u057D", /*054D; 057D; Case map*/ "\u057E", /*054E; 057E; Case map*/ "\u057F", /*054F; 057F; Case map*/ "\u0580", /*0550; 0580; Case map*/ "\u0581", /*0551; 0581; Case map*/ "\u0582", /*0552; 0582; Case map*/ "\u0583", /*0553; 0583; Case map*/ "\u0584", /*0554; 0584; Case map*/ "\u0585", /*0555; 0585; Case map*/ "\u0586", /*0556; 0586; Case map*/ "\u0565\u0582", /*0587; 0565 0582; Case map*/ "\u1E01", /*1E00; 1E01; Case map*/ "\u1E03", /*1E02; 1E03; Case map*/ "\u1E05", /*1E04; 1E05; Case map*/ "\u1E07", /*1E06; 1E07; Case map*/ "\u1E09", /*1E08; 1E09; Case map*/ "\u1E0B", /*1E0A; 1E0B; Case map*/ "\u1E0D", /*1E0C; 1E0D; Case map*/ "\u1E0F", /*1E0E; 1E0F; Case map*/ "\u1E11", /*1E10; 1E11; Case map*/ "\u1E13", /*1E12; 1E13; Case map*/ "\u1E15", /*1E14; 1E15; Case map*/ "\u1E17", /*1E16; 1E17; Case map*/ "\u1E19", /*1E18; 1E19; Case map*/ "\u1E1B", /*1E1A; 1E1B; Case map*/ "\u1E1D", /*1E1C; 1E1D; Case map*/ "\u1E1F", /*1E1E; 1E1F; Case map*/ "\u1E21", /*1E20; 1E21; Case map*/ "\u1E23", /*1E22; 1E23; Case map*/ "\u1E25", /*1E24; 1E25; Case map*/ "\u1E27", /*1E26; 1E27; Case map*/ "\u1E29", /*1E28; 1E29; Case map*/ "\u1E2B", /*1E2A; 1E2B; Case map*/ "\u1E2D", /*1E2C; 1E2D; Case map*/ "\u1E2F", /*1E2E; 1E2F; Case map*/ "\u1E31", /*1E30; 1E31; Case map*/ "\u1E33", /*1E32; 1E33; Case map*/ "\u1E35", /*1E34; 1E35; Case map*/ "\u1E37", /*1E36; 1E37; Case map*/ "\u1E39", /*1E38; 1E39; Case map*/ "\u1E3B", /*1E3A; 1E3B; Case map*/ "\u1E3D", /*1E3C; 1E3D; Case map*/ "\u1E3F", /*1E3E; 1E3F; Case map*/ "\u1E41", /*1E40; 1E41; Case map*/ "\u1E43", /*1E42; 1E43; Case map*/ "\u1E45", /*1E44; 1E45; Case map*/ "\u1E47", /*1E46; 1E47; Case map*/ "\u1E49", /*1E48; 1E49; Case map*/ "\u1E4B", /*1E4A; 1E4B; Case map*/ "\u1E4D", /*1E4C; 1E4D; Case map*/ "\u1E4F", /*1E4E; 1E4F; Case map*/ "\u1E51", /*1E50; 1E51; Case map*/ "\u1E53", /*1E52; 1E53; Case map*/ "\u1E55", /*1E54; 1E55; Case map*/ "\u1E57", /*1E56; 1E57; Case map*/ "\u1E59", /*1E58; 1E59; Case map*/ "\u1E5B", /*1E5A; 1E5B; Case map*/ "\u1E5D", /*1E5C; 1E5D; Case map*/ "\u1E5F", /*1E5E; 1E5F; Case map*/ "\u1E61", /*1E60; 1E61; Case map*/ "\u1E63", /*1E62; 1E63; Case map*/ "\u1E65", /*1E64; 1E65; Case map*/ "\u1E67", /*1E66; 1E67; Case map*/ "\u1E69", /*1E68; 1E69; Case map*/ "\u1E6B", /*1E6A; 1E6B; Case map*/ "\u1E6D", /*1E6C; 1E6D; Case map*/ "\u1E6F", /*1E6E; 1E6F; Case map*/ "\u1E71", /*1E70; 1E71; Case map*/ "\u1E73", /*1E72; 1E73; Case map*/ "\u1E75", /*1E74; 1E75; Case map*/ "\u1E77", /*1E76; 1E77; Case map*/ "\u1E79", /*1E78; 1E79; Case map*/ "\u1E7B", /*1E7A; 1E7B; Case map*/ "\u1E7D", /*1E7C; 1E7D; Case map*/ "\u1E7F", /*1E7E; 1E7F; Case map*/ "\u1E81", /*1E80; 1E81; Case map*/ "\u1E83", /*1E82; 1E83; Case map*/ "\u1E85", /*1E84; 1E85; Case map*/ "\u1E87", /*1E86; 1E87; Case map*/ "\u1E89", /*1E88; 1E89; Case map*/ "\u1E8B", /*1E8A; 1E8B; Case map*/ "\u1E8D", /*1E8C; 1E8D; Case map*/ "\u1E8F", /*1E8E; 1E8F; Case map*/ "\u1E91", /*1E90; 1E91; Case map*/ "\u1E93", /*1E92; 1E93; Case map*/ "\u1E95", /*1E94; 1E95; Case map*/ "\u0068\u0331", /*1E96; 0068 0331; Case map*/ "\u0074\u0308", /*1E97; 0074 0308; Case map*/ "\u0077\u030A", /*1E98; 0077 030A; Case map*/ "\u0079\u030A", /*1E99; 0079 030A; Case map*/ "\u0061\u02BE", /*1E9A; 0061 02BE; Case map*/ "\u1E61", /*1E9B; 1E61; Case map*/ "\u1EA1", /*1EA0; 1EA1; Case map*/ "\u1EA3", /*1EA2; 1EA3; Case map*/ "\u1EA5", /*1EA4; 1EA5; Case map*/ "\u1EA7", /*1EA6; 1EA7; Case map*/ "\u1EA9", /*1EA8; 1EA9; Case map*/ "\u1EAB", /*1EAA; 1EAB; Case map*/ "\u1EAD", /*1EAC; 1EAD; Case map*/ "\u1EAF", /*1EAE; 1EAF; Case map*/ "\u1EB1", /*1EB0; 1EB1; Case map*/ "\u1EB3", /*1EB2; 1EB3; Case map*/ "\u1EB5", /*1EB4; 1EB5; Case map*/ "\u1EB7", /*1EB6; 1EB7; Case map*/ "\u1EB9", /*1EB8; 1EB9; Case map*/ "\u1EBB", /*1EBA; 1EBB; Case map*/ "\u1EBD", /*1EBC; 1EBD; Case map*/ "\u1EBF", /*1EBE; 1EBF; Case map*/ "\u1EC1", /*1EC0; 1EC1; Case map*/ "\u1EC3", /*1EC2; 1EC3; Case map*/ "\u1EC5", /*1EC4; 1EC5; Case map*/ "\u1EC7", /*1EC6; 1EC7; Case map*/ "\u1EC9", /*1EC8; 1EC9; Case map*/ "\u1ECB", /*1ECA; 1ECB; Case map*/ "\u1ECD", /*1ECC; 1ECD; Case map*/ "\u1ECF", /*1ECE; 1ECF; Case map*/ "\u1ED1", /*1ED0; 1ED1; Case map*/ "\u1ED3", /*1ED2; 1ED3; Case map*/ "\u1ED5", /*1ED4; 1ED5; Case map*/ "\u1ED7", /*1ED6; 1ED7; Case map*/ "\u1ED9", /*1ED8; 1ED9; Case map*/ "\u1EDB", /*1EDA; 1EDB; Case map*/ "\u1EDD", /*1EDC; 1EDD; Case map*/ "\u1EDF", /*1EDE; 1EDF; Case map*/ "\u1EE1", /*1EE0; 1EE1; Case map*/ "\u1EE3", /*1EE2; 1EE3; Case map*/ "\u1EE5", /*1EE4; 1EE5; Case map*/ "\u1EE7", /*1EE6; 1EE7; Case map*/ "\u1EE9", /*1EE8; 1EE9; Case map*/ "\u1EEB", /*1EEA; 1EEB; Case map*/ "\u1EED", /*1EEC; 1EED; Case map*/ "\u1EEF", /*1EEE; 1EEF; Case map*/ "\u1EF1", /*1EF0; 1EF1; Case map*/ "\u1EF3", /*1EF2; 1EF3; Case map*/ "\u1EF5", /*1EF4; 1EF5; Case map*/ "\u1EF7", /*1EF6; 1EF7; Case map*/ "\u1EF9", /*1EF8; 1EF9; Case map*/ "\u1F00", /*1F08; 1F00; Case map*/ "\u1F01", /*1F09; 1F01; Case map*/ "\u1F02", /*1F0A; 1F02; Case map*/ "\u1F03", /*1F0B; 1F03; Case map*/ "\u1F04", /*1F0C; 1F04; Case map*/ "\u1F05", /*1F0D; 1F05; Case map*/ "\u1F06", /*1F0E; 1F06; Case map*/ "\u1F07", /*1F0F; 1F07; Case map*/ "\u1F10", /*1F18; 1F10; Case map*/ "\u1F11", /*1F19; 1F11; Case map*/ "\u1F12", /*1F1A; 1F12; Case map*/ "\u1F13", /*1F1B; 1F13; Case map*/ "\u1F14", /*1F1C; 1F14; Case map*/ "\u1F15", /*1F1D; 1F15; Case map*/ "\u1F20", /*1F28; 1F20; Case map*/ "\u1F21", /*1F29; 1F21; Case map*/ "\u1F22", /*1F2A; 1F22; Case map*/ "\u1F23", /*1F2B; 1F23; Case map*/ "\u1F24", /*1F2C; 1F24; Case map*/ "\u1F25", /*1F2D; 1F25; Case map*/ "\u1F26", /*1F2E; 1F26; Case map*/ "\u1F27", /*1F2F; 1F27; Case map*/ "\u1F30", /*1F38; 1F30; Case map*/ "\u1F31", /*1F39; 1F31; Case map*/ "\u1F32", /*1F3A; 1F32; Case map*/ "\u1F33", /*1F3B; 1F33; Case map*/ "\u1F34", /*1F3C; 1F34; Case map*/ "\u1F35", /*1F3D; 1F35; Case map*/ "\u1F36", /*1F3E; 1F36; Case map*/ "\u1F37", /*1F3F; 1F37; Case map*/ "\u1F40", /*1F48; 1F40; Case map*/ "\u1F41", /*1F49; 1F41; Case map*/ "\u1F42", /*1F4A; 1F42; Case map*/ "\u1F43", /*1F4B; 1F43; Case map*/ "\u1F44", /*1F4C; 1F44; Case map*/ "\u1F45", /*1F4D; 1F45; Case map*/ "\u03C5\u0313", /*1F50; 03C5 0313; Case map*/ "\u03C5\u0313\u0300", /*1F52; 03C5 0313 0300; Case map*/ "\u03C5\u0313\u0301", /*1F54; 03C5 0313 0301; Case map*/ "\u03C5\u0313\u0342", /*1F56; 03C5 0313 0342; Case map*/ "\u1F51", /*1F59; 1F51; Case map*/ "\u1F53", /*1F5B; 1F53; Case map*/ "\u1F55", /*1F5D; 1F55; Case map*/ "\u1F57", /*1F5F; 1F57; Case map*/ "\u1F60", /*1F68; 1F60; Case map*/ "\u1F61", /*1F69; 1F61; Case map*/ "\u1F62", /*1F6A; 1F62; Case map*/ "\u1F63", /*1F6B; 1F63; Case map*/ "\u1F64", /*1F6C; 1F64; Case map*/ "\u1F65", /*1F6D; 1F65; Case map*/ "\u1F66", /*1F6E; 1F66; Case map*/ "\u1F67", /*1F6F; 1F67; Case map*/ "\u1F00\u03B9", /*1F80; 1F00 03B9; Case map*/ "\u1F01\u03B9", /*1F81; 1F01 03B9; Case map*/ "\u1F02\u03B9", /*1F82; 1F02 03B9; Case map*/ "\u1F03\u03B9", /*1F83; 1F03 03B9; Case map*/ "\u1F04\u03B9", /*1F84; 1F04 03B9; Case map*/ "\u1F05\u03B9", /*1F85; 1F05 03B9; Case map*/ "\u1F06\u03B9", /*1F86; 1F06 03B9; Case map*/ "\u1F07\u03B9", /*1F87; 1F07 03B9; Case map*/ "\u1F00\u03B9", /*1F88; 1F00 03B9; Case map*/ "\u1F01\u03B9", /*1F89; 1F01 03B9; Case map*/ "\u1F02\u03B9", /*1F8A; 1F02 03B9; Case map*/ "\u1F03\u03B9", /*1F8B; 1F03 03B9; Case map*/ "\u1F04\u03B9", /*1F8C; 1F04 03B9; Case map*/ "\u1F05\u03B9", /*1F8D; 1F05 03B9; Case map*/ "\u1F06\u03B9", /*1F8E; 1F06 03B9; Case map*/ "\u1F07\u03B9", /*1F8F; 1F07 03B9; Case map*/ "\u1F20\u03B9", /*1F90; 1F20 03B9; Case map*/ "\u1F21\u03B9", /*1F91; 1F21 03B9; Case map*/ "\u1F22\u03B9", /*1F92; 1F22 03B9; Case map*/ "\u1F23\u03B9", /*1F93; 1F23 03B9; Case map*/ "\u1F24\u03B9", /*1F94; 1F24 03B9; Case map*/ "\u1F25\u03B9", /*1F95; 1F25 03B9; Case map*/ "\u1F26\u03B9", /*1F96; 1F26 03B9; Case map*/ "\u1F27\u03B9", /*1F97; 1F27 03B9; Case map*/ "\u1F20\u03B9", /*1F98; 1F20 03B9; Case map*/ "\u1F21\u03B9", /*1F99; 1F21 03B9; Case map*/ "\u1F22\u03B9", /*1F9A; 1F22 03B9; Case map*/ "\u1F23\u03B9", /*1F9B; 1F23 03B9; Case map*/ "\u1F24\u03B9", /*1F9C; 1F24 03B9; Case map*/ "\u1F25\u03B9", /*1F9D; 1F25 03B9; Case map*/ "\u1F26\u03B9", /*1F9E; 1F26 03B9; Case map*/ "\u1F27\u03B9", /*1F9F; 1F27 03B9; Case map*/ "\u1F60\u03B9", /*1FA0; 1F60 03B9; Case map*/ "\u1F61\u03B9", /*1FA1; 1F61 03B9; Case map*/ "\u1F62\u03B9", /*1FA2; 1F62 03B9; Case map*/ "\u1F63\u03B9", /*1FA3; 1F63 03B9; Case map*/ "\u1F64\u03B9", /*1FA4; 1F64 03B9; Case map*/ "\u1F65\u03B9", /*1FA5; 1F65 03B9; Case map*/ "\u1F66\u03B9", /*1FA6; 1F66 03B9; Case map*/ "\u1F67\u03B9", /*1FA7; 1F67 03B9; Case map*/ "\u1F60\u03B9", /*1FA8; 1F60 03B9; Case map*/ "\u1F61\u03B9", /*1FA9; 1F61 03B9; Case map*/ "\u1F62\u03B9", /*1FAA; 1F62 03B9; Case map*/ "\u1F63\u03B9", /*1FAB; 1F63 03B9; Case map*/ "\u1F64\u03B9", /*1FAC; 1F64 03B9; Case map*/ "\u1F65\u03B9", /*1FAD; 1F65 03B9; Case map*/ "\u1F66\u03B9", /*1FAE; 1F66 03B9; Case map*/ "\u1F67\u03B9", /*1FAF; 1F67 03B9; Case map*/ "\u1F70\u03B9", /*1FB2; 1F70 03B9; Case map*/ "\u03B1\u03B9", /*1FB3; 03B1 03B9; Case map*/ "\u03AC\u03B9", /*1FB4; 03AC 03B9; Case map*/ "\u03B1\u0342", /*1FB6; 03B1 0342; Case map*/ "\u03B1\u0342\u03B9", /*1FB7; 03B1 0342 03B9; Case map*/ "\u1FB0", /*1FB8; 1FB0; Case map*/ "\u1FB1", /*1FB9; 1FB1; Case map*/ "\u1F70", /*1FBA; 1F70; Case map*/ "\u1F71", /*1FBB; 1F71; Case map*/ "\u03B1\u03B9", /*1FBC; 03B1 03B9; Case map*/ "\u03B9", /*1FBE; 03B9; Case map*/ "\u1F74\u03B9", /*1FC2; 1F74 03B9; Case map*/ "\u03B7\u03B9", /*1FC3; 03B7 03B9; Case map*/ "\u03AE\u03B9", /*1FC4; 03AE 03B9; Case map*/ "\u03B7\u0342", /*1FC6; 03B7 0342; Case map*/ "\u03B7\u0342\u03B9", /*1FC7; 03B7 0342 03B9; Case map*/ "\u1F72", /*1FC8; 1F72; Case map*/ "\u1F73", /*1FC9; 1F73; Case map*/ "\u1F74", /*1FCA; 1F74; Case map*/ "\u1F75", /*1FCB; 1F75; Case map*/ "\u03B7\u03B9", /*1FCC; 03B7 03B9; Case map*/ "\u03B9\u0308\u0300", /*1FD2; 03B9 0308 0300; Case map*/ "\u03B9\u0308\u0301", /*1FD3; 03B9 0308 0301; Case map*/ "\u03B9\u0342", /*1FD6; 03B9 0342; Case map*/ "\u03B9\u0308\u0342", /*1FD7; 03B9 0308 0342; Case map*/ "\u1FD0", /*1FD8; 1FD0; Case map*/ "\u1FD1", /*1FD9; 1FD1; Case map*/ "\u1F76", /*1FDA; 1F76; Case map*/ "\u1F77", /*1FDB; 1F77; Case map*/ "\u03C5\u0308\u0300", /*1FE2; 03C5 0308 0300; Case map*/ "\u03C5\u0308\u0301", /*1FE3; 03C5 0308 0301; Case map*/ "\u03C1\u0313", /*1FE4; 03C1 0313; Case map*/ "\u03C5\u0342", /*1FE6; 03C5 0342; Case map*/ "\u03C5\u0308\u0342", /*1FE7; 03C5 0308 0342; Case map*/ "\u1FE0", /*1FE8; 1FE0; Case map*/ "\u1FE1", /*1FE9; 1FE1; Case map*/ "\u1F7A", /*1FEA; 1F7A; Case map*/ "\u1F7B", /*1FEB; 1F7B; Case map*/ "\u1FE5", /*1FEC; 1FE5; Case map*/ "\u1F7C\u03B9", /*1FF2; 1F7C 03B9; Case map*/ "\u03C9\u03B9", /*1FF3; 03C9 03B9; Case map*/ "\u03CE\u03B9", /*1FF4; 03CE 03B9; Case map*/ "\u03C9\u0342", /*1FF6; 03C9 0342; Case map*/ "\u03C9\u0342\u03B9", /*1FF7; 03C9 0342 03B9; Case map*/ "\u1F78", /*1FF8; 1F78; Case map*/ "\u1F79", /*1FF9; 1F79; Case map*/ "\u1F7C", /*1FFA; 1F7C; Case map*/ "\u1F7D", /*1FFB; 1F7D; Case map*/ "\u03C9\u03B9", /*1FFC; 03C9 03B9; Case map*/ "\u03C9", /*2126; 03C9; Case map*/ "\u006B", /*212A; 006B; Case map*/ "\u00E5", /*212B; 00E5; Case map*/ "\u2170", /*2160; 2170; Case map*/ "\u2171", /*2161; 2171; Case map*/ "\u2172", /*2162; 2172; Case map*/ "\u2173", /*2163; 2173; Case map*/ "\u2174", /*2164; 2174; Case map*/ "\u2175", /*2165; 2175; Case map*/ "\u2176", /*2166; 2176; Case map*/ "\u2177", /*2167; 2177; Case map*/ "\u2178", /*2168; 2178; Case map*/ "\u2179", /*2169; 2179; Case map*/ "\u217A", /*216A; 217A; Case map*/ "\u217B", /*216B; 217B; Case map*/ "\u217C", /*216C; 217C; Case map*/ "\u217D", /*216D; 217D; Case map*/ "\u217E", /*216E; 217E; Case map*/ "\u217F", /*216F; 217F; Case map*/ "\u24D0", /*24B6; 24D0; Case map*/ "\u24D1", /*24B7; 24D1; Case map*/ "\u24D2", /*24B8; 24D2; Case map*/ "\u24D3", /*24B9; 24D3; Case map*/ "\u24D4", /*24BA; 24D4; Case map*/ "\u24D5", /*24BB; 24D5; Case map*/ "\u24D6", /*24BC; 24D6; Case map*/ "\u24D7", /*24BD; 24D7; Case map*/ "\u24D8", /*24BE; 24D8; Case map*/ "\u24D9", /*24BF; 24D9; Case map*/ "\u24DA", /*24C0; 24DA; Case map*/ "\u24DB", /*24C1; 24DB; Case map*/ "\u24DC", /*24C2; 24DC; Case map*/ "\u24DD", /*24C3; 24DD; Case map*/ "\u24DE", /*24C4; 24DE; Case map*/ "\u24DF", /*24C5; 24DF; Case map*/ "\u24E0", /*24C6; 24E0; Case map*/ "\u24E1", /*24C7; 24E1; Case map*/ "\u24E2", /*24C8; 24E2; Case map*/ "\u24E3", /*24C9; 24E3; Case map*/ "\u24E4", /*24CA; 24E4; Case map*/ "\u24E5", /*24CB; 24E5; Case map*/ "\u24E6", /*24CC; 24E6; Case map*/ "\u24E7", /*24CD; 24E7; Case map*/ "\u24E8", /*24CE; 24E8; Case map*/ "\u24E9", /*24CF; 24E9; Case map*/ "\u0066\u0066", /*FB00; 0066 0066; Case map*/ "\u0066\u0069", /*FB01; 0066 0069; Case map*/ "\u0066\u006C", /*FB02; 0066 006C; Case map*/ "\u0066\u0066\u0069", /*FB03; 0066 0066 0069; Case map*/ "\u0066\u0066\u006C", /*FB04; 0066 0066 006C; Case map*/ "\u0073\u0074", /*FB05; 0073 0074; Case map*/ "\u0073\u0074", /*FB06; 0073 0074; Case map*/ "\u0574\u0576", /*FB13; 0574 0576; Case map*/ "\u0574\u0565", /*FB14; 0574 0565; Case map*/ "\u0574\u056B", /*FB15; 0574 056B; Case map*/ "\u057E\u0576", /*FB16; 057E 0576; Case map*/ "\u0574\u056D", /*FB17; 0574 056D; Case map*/ "\uFF41", /*FF21; FF41; Case map*/ "\uFF42", /*FF22; FF42; Case map*/ "\uFF43", /*FF23; FF43; Case map*/ "\uFF44", /*FF24; FF44; Case map*/ "\uFF45", /*FF25; FF45; Case map*/ "\uFF46", /*FF26; FF46; Case map*/ "\uFF47", /*FF27; FF47; Case map*/ "\uFF48", /*FF28; FF48; Case map*/ "\uFF49", /*FF29; FF49; Case map*/ "\uFF4A", /*FF2A; FF4A; Case map*/ "\uFF4B", /*FF2B; FF4B; Case map*/ "\uFF4C", /*FF2C; FF4C; Case map*/ "\uFF4D", /*FF2D; FF4D; Case map*/ "\uFF4E", /*FF2E; FF4E; Case map*/ "\uFF4F", /*FF2F; FF4F; Case map*/ "\uFF50", /*FF30; FF50; Case map*/ "\uFF51", /*FF31; FF51; Case map*/ "\uFF52", /*FF32; FF52; Case map*/ "\uFF53", /*FF33; FF53; Case map*/ "\uFF54", /*FF34; FF54; Case map*/ "\uFF55", /*FF35; FF55; Case map*/ "\uFF56", /*FF36; FF56; Case map*/ "\uFF57", /*FF37; FF57; Case map*/ "\uFF58", /*FF38; FF58; Case map*/ "\uFF59", /*FF39; FF59; Case map*/ "\uFF5A", /*FF3A; FF5A; Case map*/ }; public static char[] C11 = new char[] { '\u0020', /* 0020; SPACE */ }; public static char[] C12 = new char[] { '\u00A0', /* 00A0; NO-BREAK SPACE */ '\u1680', /* 1680; OGHAM SPACE MARK */ '\u2000', /* 2000; EN QUAD */ '\u2001', /* 2001; EM QUAD */ '\u2002', /* 2002; EN SPACE */ '\u2003', /* 2003; EM SPACE */ '\u2004', /* 2004; THREE-PER-EM SPACE */ '\u2005', /* 2005; FOUR-PER-EM SPACE */ '\u2006', /* 2006; SIX-PER-EM SPACE */ '\u2007', /* 2007; FIGURE SPACE */ '\u2008', /* 2008; PUNCTUATION SPACE */ '\u2009', /* 2009; THIN SPACE */ '\u200A', /* 200A; HAIR SPACE */ '\u200B', /* 200B; ZERO WIDTH SPACE */ '\u202F', /* 202F; NARROW NO-BREAK SPACE */ '\u205F', /* 205F; MEDIUM MATHEMATICAL SPACE */ '\u3000', /* 3000; IDEOGRAPHIC SPACE */ }; public static char[][] C21 = new char[][] { new char[] { '\u0000', '\u001F' }, /* 0000-001F; [CONTROL CHARACTERS] */ new char[] { '\u007F' }, /* 007F; DELETE */ }; public static char[][] C22 = new char[][] { new char[] { '\u0080', '\u009F' }, /* 0080-009F; [CONTROL CHARACTERS] */ new char[] { '\u06DD' }, /* 06DD; ARABIC END OF AYAH */ new char[] { '\u070F' }, /* 070F; SYRIAC ABBREVIATION MARK */ new char[] { '\u180E' }, /* 180E; MONGOLIAN VOWEL SEPARATOR */ new char[] { '\u200C' }, /* 200C; ZERO WIDTH NON-JOINER */ new char[] { '\u200D' }, /* 200D; ZERO WIDTH JOINER */ new char[] { '\u2028' }, /* 2028; LINE SEPARATOR */ new char[] { '\u2029' }, /* 2029; PARAGRAPH SEPARATOR */ new char[] { '\u2060' }, /* 2060; WORD JOINER */ new char[] { '\u2061' }, /* 2061; FUNCTION APPLICATION */ new char[] { '\u2062' }, /* 2062; INVISIBLE TIMES */ new char[] { '\u2063' }, /* 2063; INVISIBLE SEPARATOR */ new char[] { '\u206A', '\u206F' }, /* 206A-206F; [CONTROL CHARACTERS] */ new char[] { '\uFEFF' }, /* FEFF; ZERO WIDTH NO-BREAK SPACE */ new char[] { '\uFFF9', '\uFFFC' }, /* FFF9-FFFC; [CONTROL CHARACTERS] */ }; public static char[][] C3 = new char[][] { new char[] { '\uE000', '\uF8FF' }, /* E000-F8FF; [PRIVATE USE, PLANE 0] */ }; public static char[][] C4 = new char[][] { new char[] { '\uFDD0', '\uFDEF' }, /* FDD0-FDEF; [NONCHARACTER CODE POINTS] */ new char[] { '\uFFFE', '\uFFFF' }, /* FFFE-FFFF; [NONCHARACTER CODE POINTS] */ }; public static char[][] C5 = new char[][] { new char[] { '\uD800', '\uDFFF' }, /* D800-DFFF; [SURROGATE CODES] */ }; public static char[][] C6 = new char[][] { new char[] { '\uFFF9' }, /* FFF9; INTERLINEAR ANNOTATION ANCHOR */ new char[] { '\uFFFA' }, /* FFFA; INTERLINEAR ANNOTATION SEPARATOR */ new char[] { '\uFFFB' }, /* FFFB; INTERLINEAR ANNOTATION TERMINATOR */ new char[] { '\uFFFC' }, /* FFFC; OBJECT REPLACEMENT CHARACTER */ new char[] { '\uFFFD' }, /* FFFD; REPLACEMENT CHARACTER */ }; public static char[][] C7 = new char[][] { new char[] { '\u2FF0', '\u2FFB' }, /* 2FF0-2FFB; [IDEOGRAPHIC DESCRIPTION CHARACTERS] */ }; public static char[][] C8 = new char[][] { new char[] { '\u0340' }, /* 0340; COMBINING GRAVE TONE MARK */ new char[] { '\u0341' }, /* 0341; COMBINING ACUTE TONE MARK */ new char[] { '\u200E' }, /* 200E; LEFT-TO-RIGHT MARK */ new char[] { '\u200F' }, /* 200F; RIGHT-TO-LEFT MARK */ new char[] { '\u202A' }, /* 202A; LEFT-TO-RIGHT EMBEDDING */ new char[] { '\u202B' }, /* 202B; RIGHT-TO-LEFT EMBEDDING */ new char[] { '\u202C' }, /* 202C; POP DIRECTIONAL FORMATTING */ new char[] { '\u202D' }, /* 202D; LEFT-TO-RIGHT OVERRIDE */ new char[] { '\u202E' }, /* 202E; RIGHT-TO-LEFT OVERRIDE */ new char[] { '\u206A' }, /* 206A; INHIBIT SYMMETRIC SWAPPING */ new char[] { '\u206B' }, /* 206B; ACTIVATE SYMMETRIC SWAPPING */ new char[] { '\u206C' }, /* 206C; INHIBIT ARABIC FORM SHAPING */ new char[] { '\u206D' }, /* 206D; ACTIVATE ARABIC FORM SHAPING */ new char[] { '\u206E' }, /* 206E; NATIONAL DIGIT SHAPES */ new char[] { '\u206F' }, /* 206F; NOMINAL DIGIT SHAPES */ }; public static char[][] D1 = new char[][] { new char[] { '\u05BE' }, /* 05BE */ new char[] { '\u05C0' }, /* 05C0 */ new char[] { '\u05C3' }, /* 05C3 */ new char[] { '\u05D0', '\u05EA' }, /* 05D0-05EA */ new char[] { '\u05F0', '\u05F4' }, /* 05F0-05F4 */ new char[] { '\u061B' }, /* 061B */ new char[] { '\u061F' }, /* 061F */ new char[] { '\u0621', '\u063A' }, /* 0621-063A */ new char[] { '\u0640', '\u064A' }, /* 0640-064A */ new char[] { '\u066D', '\u066F' }, /* 066D-066F */ new char[] { '\u0671', '\u06D5' }, /* 0671-06D5 */ new char[] { '\u06DD' }, /* 06DD */ new char[] { '\u06E5', '\u06E6' }, /* 06E5-06E6 */ new char[] { '\u06FA', '\u06FE' }, /* 06FA-06FE */ new char[] { '\u0700', '\u070D' }, /* 0700-070D */ new char[] { '\u0710' }, /* 0710 */ new char[] { '\u0712', '\u072C' }, /* 0712-072C */ new char[] { '\u0780', '\u07A5' }, /* 0780-07A5 */ new char[] { '\u07B1' }, /* 07B1 */ new char[] { '\u200F' }, /* 200F */ new char[] { '\uFB1D' }, /* FB1D */ new char[] { '\uFB1F', '\uFB28' }, /* FB1F-FB28 */ new char[] { '\uFB2A', '\uFB36' }, /* FB2A-FB36 */ new char[] { '\uFB38', '\uFB3C' }, /* FB38-FB3C */ new char[] { '\uFB3E' }, /* FB3E */ new char[] { '\uFB40', '\uFB41' }, /* FB40-FB41 */ new char[] { '\uFB43', '\uFB44' }, /* FB43-FB44 */ new char[] { '\uFB46', '\uFBB1' }, /* FB46-FBB1 */ new char[] { '\uFBD3', '\uFD3D' }, /* FBD3-FD3D */ new char[] { '\uFD50', '\uFD8F' }, /* FD50-FD8F */ new char[] { '\uFD92', '\uFDC7' }, /* FD92-FDC7 */ new char[] { '\uFDF0', '\uFDFC' }, /* FDF0-FDFC */ new char[] { '\uFE70', '\uFE74' }, /* FE70-FE74 */ new char[] { '\uFE76', '\uFEFC' }, /* FE76-FEFC */ }; public static char[][] D2 = new char[][] { new char[] { '\u0041', '\u005A' }, /* 0041-005A */ new char[] { '\u0061', '\u007A' }, /* 0061-007A */ new char[] { '\u00AA' }, /* 00AA */ new char[] { '\u00B5' }, /* 00B5 */ new char[] { '\u00BA' }, /* 00BA */ new char[] { '\u00C0', '\u00D6' }, /* 00C0-00D6 */ new char[] { '\u00D8', '\u00F6' }, /* 00D8-00F6 */ new char[] { '\u00F8', '\u0220' }, /* 00F8-0220 */ new char[] { '\u0222', '\u0233' }, /* 0222-0233 */ new char[] { '\u0250', '\u02AD' }, /* 0250-02AD */ new char[] { '\u02B0', '\u02B8' }, /* 02B0-02B8 */ new char[] { '\u02BB', '\u02C1' }, /* 02BB-02C1 */ new char[] { '\u02D0', '\u02D1' }, /* 02D0-02D1 */ new char[] { '\u02E0', '\u02E4' }, /* 02E0-02E4 */ new char[] { '\u02EE' }, /* 02EE */ new char[] { '\u037A' }, /* 037A */ new char[] { '\u0386' }, /* 0386 */ new char[] { '\u0388', '\u038A' }, /* 0388-038A */ new char[] { '\u038C' }, /* 038C */ new char[] { '\u038E', '\u03A1' }, /* 038E-03A1 */ new char[] { '\u03A3', '\u03CE' }, /* 03A3-03CE */ new char[] { '\u03D0', '\u03F5' }, /* 03D0-03F5 */ new char[] { '\u0400', '\u0482' }, /* 0400-0482 */ new char[] { '\u048A', '\u04CE' }, /* 048A-04CE */ new char[] { '\u04D0', '\u04F5' }, /* 04D0-04F5 */ new char[] { '\u04F8', '\u04F9' }, /* 04F8-04F9 */ new char[] { '\u0500', '\u050F' }, /* 0500-050F */ new char[] { '\u0531', '\u0556' }, /* 0531-0556 */ new char[] { '\u0559', '\u055F' }, /* 0559-055F */ new char[] { '\u0561', '\u0587' }, /* 0561-0587 */ new char[] { '\u0589' }, /* 0589 */ new char[] { '\u0903' }, /* 0903 */ new char[] { '\u0905', '\u0939' }, /* 0905-0939 */ new char[] { '\u093D', '\u0940' }, /* 093D-0940 */ new char[] { '\u0949', '\u094C' }, /* 0949-094C */ new char[] { '\u0950' }, /* 0950 */ new char[] { '\u0958', '\u0961' }, /* 0958-0961 */ new char[] { '\u0964', '\u0970' }, /* 0964-0970 */ new char[] { '\u0982', '\u0983' }, /* 0982-0983 */ new char[] { '\u0985', '\u098C' }, /* 0985-098C */ new char[] { '\u098F', '\u0990' }, /* 098F-0990 */ new char[] { '\u0993', '\u09A8' }, /* 0993-09A8 */ new char[] { '\u09AA', '\u09B0' }, /* 09AA-09B0 */ new char[] { '\u09B2' }, /* 09B2 */ new char[] { '\u09B6', '\u09B9' }, /* 09B6-09B9 */ new char[] { '\u09BE', '\u09C0' }, /* 09BE-09C0 */ new char[] { '\u09C7', '\u09C8' }, /* 09C7-09C8 */ new char[] { '\u09CB', '\u09CC' }, /* 09CB-09CC */ new char[] { '\u09D7' }, /* 09D7 */ new char[] { '\u09DC', '\u09DD' }, /* 09DC-09DD */ new char[] { '\u09DF', '\u09E1' }, /* 09DF-09E1 */ new char[] { '\u09E6', '\u09F1' }, /* 09E6-09F1 */ new char[] { '\u09F4', '\u09FA' }, /* 09F4-09FA */ new char[] { '\u0A05', '\u0A0A' }, /* 0A05-0A0A */ new char[] { '\u0A0F', '\u0A10' }, /* 0A0F-0A10 */ new char[] { '\u0A13', '\u0A28' }, /* 0A13-0A28 */ new char[] { '\u0A2A', '\u0A30' }, /* 0A2A-0A30 */ new char[] { '\u0A32', '\u0A33' }, /* 0A32-0A33 */ new char[] { '\u0A35', '\u0A36' }, /* 0A35-0A36 */ new char[] { '\u0A38', '\u0A39' }, /* 0A38-0A39 */ new char[] { '\u0A3E', '\u0A40' }, /* 0A3E-0A40 */ new char[] { '\u0A59', '\u0A5C' }, /* 0A59-0A5C */ new char[] { '\u0A5E' }, /* 0A5E */ new char[] { '\u0A66', '\u0A6F' }, /* 0A66-0A6F */ new char[] { '\u0A72', '\u0A74' }, /* 0A72-0A74 */ new char[] { '\u0A83' }, /* 0A83 */ new char[] { '\u0A85', '\u0A8B' }, /* 0A85-0A8B */ new char[] { '\u0A8D' }, /* 0A8D */ new char[] { '\u0A8F', '\u0A91' }, /* 0A8F-0A91 */ new char[] { '\u0A93', '\u0AA8' }, /* 0A93-0AA8 */ new char[] { '\u0AAA', '\u0AB0' }, /* 0AAA-0AB0 */ new char[] { '\u0AB2', '\u0AB3' }, /* 0AB2-0AB3 */ new char[] { '\u0AB5', '\u0AB9' }, /* 0AB5-0AB9 */ new char[] { '\u0ABD', '\u0AC0' }, /* 0ABD-0AC0 */ new char[] { '\u0AC9' }, /* 0AC9 */ new char[] { '\u0ACB', '\u0ACC' }, /* 0ACB-0ACC */ new char[] { '\u0AD0' }, /* 0AD0 */ new char[] { '\u0AE0' }, /* 0AE0 */ new char[] { '\u0AE6', '\u0AEF' }, /* 0AE6-0AEF */ new char[] { '\u0B02', '\u0B03' }, /* 0B02-0B03 */ new char[] { '\u0B05', '\u0B0C' }, /* 0B05-0B0C */ new char[] { '\u0B0F', '\u0B10' }, /* 0B0F-0B10 */ new char[] { '\u0B13', '\u0B28' }, /* 0B13-0B28 */ new char[] { '\u0B2A', '\u0B30' }, /* 0B2A-0B30 */ new char[] { '\u0B32', '\u0B33' }, /* 0B32-0B33 */ new char[] { '\u0B36', '\u0B39' }, /* 0B36-0B39 */ new char[] { '\u0B3D', '\u0B3E' }, /* 0B3D-0B3E */ new char[] { '\u0B40' }, /* 0B40 */ new char[] { '\u0B47', '\u0B48' }, /* 0B47-0B48 */ new char[] { '\u0B4B', '\u0B4C' }, /* 0B4B-0B4C */ new char[] { '\u0B57' }, /* 0B57 */ new char[] { '\u0B5C', '\u0B5D' }, /* 0B5C-0B5D */ new char[] { '\u0B5F', '\u0B61' }, /* 0B5F-0B61 */ new char[] { '\u0B66', '\u0B70' }, /* 0B66-0B70 */ new char[] { '\u0B83' }, /* 0B83 */ new char[] { '\u0B85', '\u0B8A' }, /* 0B85-0B8A */ new char[] { '\u0B8E', '\u0B90' }, /* 0B8E-0B90 */ new char[] { '\u0B92', '\u0B95' }, /* 0B92-0B95 */ new char[] { '\u0B99', '\u0B9A' }, /* 0B99-0B9A */ new char[] { '\u0B9C' }, /* 0B9C */ new char[] { '\u0B9E', '\u0B9F' }, /* 0B9E-0B9F */ new char[] { '\u0BA3', '\u0BA4' }, /* 0BA3-0BA4 */ new char[] { '\u0BA8', '\u0BAA' }, /* 0BA8-0BAA */ new char[] { '\u0BAE', '\u0BB5' }, /* 0BAE-0BB5 */ new char[] { '\u0BB7', '\u0BB9' }, /* 0BB7-0BB9 */ new char[] { '\u0BBE', '\u0BBF' }, /* 0BBE-0BBF */ new char[] { '\u0BC1', '\u0BC2' }, /* 0BC1-0BC2 */ new char[] { '\u0BC6', '\u0BC8' }, /* 0BC6-0BC8 */ new char[] { '\u0BCA', '\u0BCC' }, /* 0BCA-0BCC */ new char[] { '\u0BD7' }, /* 0BD7 */ new char[] { '\u0BE7', '\u0BF2' }, /* 0BE7-0BF2 */ new char[] { '\u0C01', '\u0C03' }, /* 0C01-0C03 */ new char[] { '\u0C05', '\u0C0C' }, /* 0C05-0C0C */ new char[] { '\u0C0E', '\u0C10' }, /* 0C0E-0C10 */ new char[] { '\u0C12', '\u0C28' }, /* 0C12-0C28 */ new char[] { '\u0C2A', '\u0C33' }, /* 0C2A-0C33 */ new char[] { '\u0C35', '\u0C39' }, /* 0C35-0C39 */ new char[] { '\u0C41', '\u0C44' }, /* 0C41-0C44 */ new char[] { '\u0C60', '\u0C61' }, /* 0C60-0C61 */ new char[] { '\u0C66', '\u0C6F' }, /* 0C66-0C6F */ new char[] { '\u0C82', '\u0C83' }, /* 0C82-0C83 */ new char[] { '\u0C85', '\u0C8C' }, /* 0C85-0C8C */ new char[] { '\u0C8E', '\u0C90' }, /* 0C8E-0C90 */ new char[] { '\u0C92', '\u0CA8' }, /* 0C92-0CA8 */ new char[] { '\u0CAA', '\u0CB3' }, /* 0CAA-0CB3 */ new char[] { '\u0CB5', '\u0CB9' }, /* 0CB5-0CB9 */ new char[] { '\u0CBE' }, /* 0CBE */ new char[] { '\u0CC0', '\u0CC4' }, /* 0CC0-0CC4 */ new char[] { '\u0CC7', '\u0CC8' }, /* 0CC7-0CC8 */ new char[] { '\u0CCA', '\u0CCB' }, /* 0CCA-0CCB */ new char[] { '\u0CD5', '\u0CD6' }, /* 0CD5-0CD6 */ new char[] { '\u0CDE' }, /* 0CDE */ new char[] { '\u0CE0', '\u0CE1' }, /* 0CE0-0CE1 */ new char[] { '\u0CE6', '\u0CEF' }, /* 0CE6-0CEF */ new char[] { '\u0D02', '\u0D03' }, /* 0D02-0D03 */ new char[] { '\u0D05', '\u0D0C' }, /* 0D05-0D0C */ new char[] { '\u0D0E', '\u0D10' }, /* 0D0E-0D10 */ new char[] { '\u0D12', '\u0D28' }, /* 0D12-0D28 */ new char[] { '\u0D2A', '\u0D39' }, /* 0D2A-0D39 */ new char[] { '\u0D3E', '\u0D40' }, /* 0D3E-0D40 */ new char[] { '\u0D46', '\u0D48' }, /* 0D46-0D48 */ new char[] { '\u0D4A', '\u0D4C' }, /* 0D4A-0D4C */ new char[] { '\u0D57' }, /* 0D57 */ new char[] { '\u0D60', '\u0D61' }, /* 0D60-0D61 */ new char[] { '\u0D66', '\u0D6F' }, /* 0D66-0D6F */ new char[] { '\u0D82', '\u0D83' }, /* 0D82-0D83 */ new char[] { '\u0D85', '\u0D96' }, /* 0D85-0D96 */ new char[] { '\u0D9A', '\u0DB1' }, /* 0D9A-0DB1 */ new char[] { '\u0DB3', '\u0DBB' }, /* 0DB3-0DBB */ new char[] { '\u0DBD' }, /* 0DBD */ new char[] { '\u0DC0', '\u0DC6' }, /* 0DC0-0DC6 */ new char[] { '\u0DCF', '\u0DD1' }, /* 0DCF-0DD1 */ new char[] { '\u0DD8', '\u0DDF' }, /* 0DD8-0DDF */ new char[] { '\u0DF2', '\u0DF4' }, /* 0DF2-0DF4 */ new char[] { '\u0E01', '\u0E30' }, /* 0E01-0E30 */ new char[] { '\u0E32', '\u0E33' }, /* 0E32-0E33 */ new char[] { '\u0E40', '\u0E46' }, /* 0E40-0E46 */ new char[] { '\u0E4F', '\u0E5B' }, /* 0E4F-0E5B */ new char[] { '\u0E81', '\u0E82' }, /* 0E81-0E82 */ new char[] { '\u0E84' }, /* 0E84 */ new char[] { '\u0E87', '\u0E88' }, /* 0E87-0E88 */ new char[] { '\u0E8A' }, /* 0E8A */ new char[] { '\u0E8D' }, /* 0E8D */ new char[] { '\u0E94', '\u0E97' }, /* 0E94-0E97 */ new char[] { '\u0E99', '\u0E9F' }, /* 0E99-0E9F */ new char[] { '\u0EA1', '\u0EA3' }, /* 0EA1-0EA3 */ new char[] { '\u0EA5' }, /* 0EA5 */ new char[] { '\u0EA7' }, /* 0EA7 */ new char[] { '\u0EAA', '\u0EAB' }, /* 0EAA-0EAB */ new char[] { '\u0EAD', '\u0EB0' }, /* 0EAD-0EB0 */ new char[] { '\u0EB2', '\u0EB3' }, /* 0EB2-0EB3 */ new char[] { '\u0EBD' }, /* 0EBD */ new char[] { '\u0EC0', '\u0EC4' }, /* 0EC0-0EC4 */ new char[] { '\u0EC6' }, /* 0EC6 */ new char[] { '\u0ED0', '\u0ED9' }, /* 0ED0-0ED9 */ new char[] { '\u0EDC', '\u0EDD' }, /* 0EDC-0EDD */ new char[] { '\u0F00', '\u0F17' }, /* 0F00-0F17 */ new char[] { '\u0F1A', '\u0F34' }, /* 0F1A-0F34 */ new char[] { '\u0F36' }, /* 0F36 */ new char[] { '\u0F38' }, /* 0F38 */ new char[] { '\u0F3E', '\u0F47' }, /* 0F3E-0F47 */ new char[] { '\u0F49', '\u0F6A' }, /* 0F49-0F6A */ new char[] { '\u0F7F' }, /* 0F7F */ new char[] { '\u0F85' }, /* 0F85 */ new char[] { '\u0F88', '\u0F8B' }, /* 0F88-0F8B */ new char[] { '\u0FBE', '\u0FC5' }, /* 0FBE-0FC5 */ new char[] { '\u0FC7', '\u0FCC' }, /* 0FC7-0FCC */ new char[] { '\u0FCF' }, /* 0FCF */ new char[] { '\u1000', '\u1021' }, /* 1000-1021 */ new char[] { '\u1023', '\u1027' }, /* 1023-1027 */ new char[] { '\u1029', '\u102A' }, /* 1029-102A */ new char[] { '\u102C' }, /* 102C */ new char[] { '\u1031' }, /* 1031 */ new char[] { '\u1038' }, /* 1038 */ new char[] { '\u1040', '\u1057' }, /* 1040-1057 */ new char[] { '\u10A0', '\u10C5' }, /* 10A0-10C5 */ new char[] { '\u10D0', '\u10F8' }, /* 10D0-10F8 */ new char[] { '\u10FB' }, /* 10FB */ new char[] { '\u1100', '\u1159' }, /* 1100-1159 */ new char[] { '\u115F', '\u11A2' }, /* 115F-11A2 */ new char[] { '\u11A8', '\u11F9' }, /* 11A8-11F9 */ new char[] { '\u1200', '\u1206' }, /* 1200-1206 */ new char[] { '\u1208', '\u1246' }, /* 1208-1246 */ new char[] { '\u1248' }, /* 1248 */ new char[] { '\u124A', '\u124D' }, /* 124A-124D */ new char[] { '\u1250', '\u1256' }, /* 1250-1256 */ new char[] { '\u1258' }, /* 1258 */ new char[] { '\u125A', '\u125D' }, /* 125A-125D */ new char[] { '\u1260', '\u1286' }, /* 1260-1286 */ new char[] { '\u1288' }, /* 1288 */ new char[] { '\u128A', '\u128D' }, /* 128A-128D */ new char[] { '\u1290', '\u12AE' }, /* 1290-12AE */ new char[] { '\u12B0' }, /* 12B0 */ new char[] { '\u12B2', '\u12B5' }, /* 12B2-12B5 */ new char[] { '\u12B8', '\u12BE' }, /* 12B8-12BE */ new char[] { '\u12C0' }, /* 12C0 */ new char[] { '\u12C2', '\u12C5' }, /* 12C2-12C5 */ new char[] { '\u12C8', '\u12CE' }, /* 12C8-12CE */ new char[] { '\u12D0', '\u12D6' }, /* 12D0-12D6 */ new char[] { '\u12D8', '\u12EE' }, /* 12D8-12EE */ new char[] { '\u12F0', '\u130E' }, /* 12F0-130E */ new char[] { '\u1310' }, /* 1310 */ new char[] { '\u1312', '\u1315' }, /* 1312-1315 */ new char[] { '\u1318', '\u131E' }, /* 1318-131E */ new char[] { '\u1320', '\u1346' }, /* 1320-1346 */ new char[] { '\u1348', '\u135A' }, /* 1348-135A */ new char[] { '\u1361', '\u137C' }, /* 1361-137C */ new char[] { '\u13A0', '\u13F4' }, /* 13A0-13F4 */ new char[] { '\u1401', '\u1676' }, /* 1401-1676 */ new char[] { '\u1681', '\u169A' }, /* 1681-169A */ new char[] { '\u16A0', '\u16F0' }, /* 16A0-16F0 */ new char[] { '\u1700', '\u170C' }, /* 1700-170C */ new char[] { '\u170E', '\u1711' }, /* 170E-1711 */ new char[] { '\u1720', '\u1731' }, /* 1720-1731 */ new char[] { '\u1735', '\u1736' }, /* 1735-1736 */ new char[] { '\u1740', '\u1751' }, /* 1740-1751 */ new char[] { '\u1760', '\u176C' }, /* 1760-176C */ new char[] { '\u176E', '\u1770' }, /* 176E-1770 */ new char[] { '\u1780', '\u17B6' }, /* 1780-17B6 */ new char[] { '\u17BE', '\u17C5' }, /* 17BE-17C5 */ new char[] { '\u17C7', '\u17C8' }, /* 17C7-17C8 */ new char[] { '\u17D4', '\u17DA' }, /* 17D4-17DA */ new char[] { '\u17DC' }, /* 17DC */ new char[] { '\u17E0', '\u17E9' }, /* 17E0-17E9 */ new char[] { '\u1810', '\u1819' }, /* 1810-1819 */ new char[] { '\u1820', '\u1877' }, /* 1820-1877 */ new char[] { '\u1880', '\u18A8' }, /* 1880-18A8 */ new char[] { '\u1E00', '\u1E9B' }, /* 1E00-1E9B */ new char[] { '\u1EA0', '\u1EF9' }, /* 1EA0-1EF9 */ new char[] { '\u1F00', '\u1F15' }, /* 1F00-1F15 */ new char[] { '\u1F18', '\u1F1D' }, /* 1F18-1F1D */ new char[] { '\u1F20', '\u1F45' }, /* 1F20-1F45 */ new char[] { '\u1F48', '\u1F4D' }, /* 1F48-1F4D */ new char[] { '\u1F50', '\u1F57' }, /* 1F50-1F57 */ new char[] { '\u1F59' }, /* 1F59 */ new char[] { '\u1F5B' }, /* 1F5B */ new char[] { '\u1F5D' }, /* 1F5D */ new char[] { '\u1F5F', '\u1F7D' }, /* 1F5F-1F7D */ new char[] { '\u1F80', '\u1FB4' }, /* 1F80-1FB4 */ new char[] { '\u1FB6', '\u1FBC' }, /* 1FB6-1FBC */ new char[] { '\u1FBE' }, /* 1FBE */ new char[] { '\u1FC2', '\u1FC4' }, /* 1FC2-1FC4 */ new char[] { '\u1FC6', '\u1FCC' }, /* 1FC6-1FCC */ new char[] { '\u1FD0', '\u1FD3' }, /* 1FD0-1FD3 */ new char[] { '\u1FD6', '\u1FDB' }, /* 1FD6-1FDB */ new char[] { '\u1FE0', '\u1FEC' }, /* 1FE0-1FEC */ new char[] { '\u1FF2', '\u1FF4' }, /* 1FF2-1FF4 */ new char[] { '\u1FF6', '\u1FFC' }, /* 1FF6-1FFC */ new char[] { '\u200E' }, /* 200E */ new char[] { '\u2071' }, /* 2071 */ new char[] { '\u207F' }, /* 207F */ new char[] { '\u2102' }, /* 2102 */ new char[] { '\u2107' }, /* 2107 */ new char[] { '\u210A', '\u2113' }, /* 210A-2113 */ new char[] { '\u2115' }, /* 2115 */ new char[] { '\u2119', '\u211D' }, /* 2119-211D */ new char[] { '\u2124' }, /* 2124 */ new char[] { '\u2126' }, /* 2126 */ new char[] { '\u2128' }, /* 2128 */ new char[] { '\u212A', '\u212D' }, /* 212A-212D */ new char[] { '\u212F', '\u2131' }, /* 212F-2131 */ new char[] { '\u2133', '\u2139' }, /* 2133-2139 */ new char[] { '\u213D', '\u213F' }, /* 213D-213F */ new char[] { '\u2145', '\u2149' }, /* 2145-2149 */ new char[] { '\u2160', '\u2183' }, /* 2160-2183 */ new char[] { '\u2336', '\u237A' }, /* 2336-237A */ new char[] { '\u2395' }, /* 2395 */ new char[] { '\u249C', '\u24E9' }, /* 249C-24E9 */ new char[] { '\u3005', '\u3007' }, /* 3005-3007 */ new char[] { '\u3021', '\u3029' }, /* 3021-3029 */ new char[] { '\u3031', '\u3035' }, /* 3031-3035 */ new char[] { '\u3038', '\u303C' }, /* 3038-303C */ new char[] { '\u3041', '\u3096' }, /* 3041-3096 */ new char[] { '\u309D', '\u309F' }, /* 309D-309F */ new char[] { '\u30A1', '\u30FA' }, /* 30A1-30FA */ new char[] { '\u30FC', '\u30FF' }, /* 30FC-30FF */ new char[] { '\u3105', '\u312C' }, /* 3105-312C */ new char[] { '\u3131', '\u318E' }, /* 3131-318E */ new char[] { '\u3190', '\u31B7' }, /* 3190-31B7 */ new char[] { '\u31F0', '\u321C' }, /* 31F0-321C */ new char[] { '\u3220', '\u3243' }, /* 3220-3243 */ new char[] { '\u3260', '\u327B' }, /* 3260-327B */ new char[] { '\u327F', '\u32B0' }, /* 327F-32B0 */ new char[] { '\u32C0', '\u32CB' }, /* 32C0-32CB */ new char[] { '\u32D0', '\u32FE' }, /* 32D0-32FE */ new char[] { '\u3300', '\u3376' }, /* 3300-3376 */ new char[] { '\u337B', '\u33DD' }, /* 337B-33DD */ new char[] { '\u33E0', '\u33FE' }, /* 33E0-33FE */ new char[] { '\u3400', '\u4DB5' }, /* 3400-4DB5 */ new char[] { '\u4E00', '\u9FA5' }, /* 4E00-9FA5 */ new char[] { '\uA000', '\uA48C' }, /* A000-A48C */ new char[] { '\uAC00', '\uD7A3' }, /* AC00-D7A3 */ new char[] { '\uD800', '\uFA2D' }, /* D800-FA2D */ new char[] { '\uFA30', '\uFA6A' }, /* FA30-FA6A */ new char[] { '\uFB00', '\uFB06' }, /* FB00-FB06 */ new char[] { '\uFB13', '\uFB17' }, /* FB13-FB17 */ new char[] { '\uFF21', '\uFF3A' }, /* FF21-FF3A */ new char[] { '\uFF41', '\uFF5A' }, /* FF41-FF5A */ new char[] { '\uFF66', '\uFFBE' }, /* FF66-FFBE */ new char[] { '\uFFC2', '\uFFC7' }, /* FFC2-FFC7 */ new char[] { '\uFFCA', '\uFFCF' }, /* FFCA-FFCF */ new char[] { '\uFFD2', '\uFFD7' }, /* FFD2-FFD7 */ new char[] { '\uFFDA', '\uFFDC' }, /* FFDA-FFDC */ }; } }smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/IDNA.cs0000644000175000017500000001725512204443225021066 0ustar00meebeymeebey00000000000000/// Copyright (C) 2004 Free Software Foundation, Inc. /// * /// Author: Alexander Gnauck AG-Software, mailto:gnauck@ag-software.de /// * /// This file is part of GNU Libidn. /// * /// This library is free software; you can redistribute it and/or /// modify it under the terms of the GNU Lesser General Public License /// as published by the Free Software Foundation; either version 2.1 of /// the License, or (at your option) any later version. /// * /// This library is distributed in the hope that it will be useful, but /// WITHOUT ANY WARRANTY; without even the implied warranty of /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU /// Lesser General Public License for more details. /// * /// You should have received a copy of the GNU Lesser General Public /// License along with this library; if not, write to the Free Software /// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 /// USA /// using System; using System.Text; namespace agsXMPP.Idn { public class IDNA { public const string ACE_PREFIX = "xn--"; /// /// Converts a Unicode string to ASCII using the procedure in RFC3490 /// section 4.1. Unassigned characters are not allowed and STD3 ASCII /// rules are enforced. The input string may be a domain name /// containing dots. /// /// Unicode string. /// Encoded string. public static string ToASCII(string input) { StringBuilder o = new StringBuilder(); StringBuilder h = new StringBuilder(); for (int i = 0; i < input.Length; i++) { char c = input[i]; if (c == '.' || c == '\u3002' || c == '\uff0e' || c == '\uff61') { o.Append(ToASCII(h.ToString(), false, true)); o.Append('.'); h = new StringBuilder(); } else { h.Append(c); } } o.Append(ToASCII(h.ToString(), false, true)); return o.ToString(); } /// /// Converts a Unicode string to ASCII using the procedure in RFC3490 /// section 4.1. Unassigned characters are not allowed and STD3 ASCII /// rules are enforced. /// /// Unicode string. /// Unassigned characters, allowed or not? /// STD3 ASCII rules, enforced or not? /// Encoded string. public static string ToASCII(string input, bool allowUnassigned, bool useSTD3ASCIIRules) { // Step 1: Check if the string contains code points outside // the ASCII range 0..0x7c. bool nonASCII = false; for (int i = 0; i < input.Length; i++) { int c = input[i]; if (c > 0x7f) { nonASCII = true; break; } } // Step 2: Perform the nameprep operation. if (nonASCII) { try { input = Stringprep.NamePrep(input, allowUnassigned); } catch (StringprepException e) { // TODO throw new IDNAException(e); } } // Step 3: - Verify the absence of non-LDH ASCII code points // (char) 0..0x2c, 0x2e..0x2f, 0x3a..0x40, 0x5b..0x60, // (char) 0x7b..0x7f // - Verify the absence of leading and trailing // hyphen-minus if (useSTD3ASCIIRules) { for (int i = 0; i < input.Length; i++) { int c = input[i]; if ((c <= 0x2c) || (c >= 0x2e && c <= 0x2f) || (c >= 0x3a && c <= 0x40) || (c >= 0x5b && c <= 0x60) || (c >= 0x7b && c <= 0x7f)) { throw new IDNAException(IDNAException.CONTAINS_NON_LDH); } } if (input.StartsWith("-") || input.EndsWith("-")) { throw new IDNAException(IDNAException.CONTAINS_HYPHEN); } } // Step 4: If all code points are inside 0..0x7f, skip to step 8 nonASCII = false; for (int i = 0; i < input.Length; i++) { int c = input[i]; if (c > 0x7f) { nonASCII = true; break; } } string output = input; if (nonASCII) { // Step 5: Verify that the sequence does not begin with the ACE prefix. if (input.StartsWith(ACE_PREFIX)) { throw new IDNAException(IDNAException.CONTAINS_ACE_PREFIX); } // Step 6: Punycode try { output = Punycode.Encode(input); } catch (PunycodeException e) { // TODO throw new IDNAException(e); } // Step 7: Prepend the ACE prefix. output = ACE_PREFIX + output; } // Step 8: Check that the length is inside 1..63. if (output.Length < 1 || output.Length > 63) { throw new IDNAException(IDNAException.TOO_LONG); } return output; } /// /// Converts an ASCII-encoded string to Unicode. Unassigned /// characters are not allowed and STD3 hostnames are enforced. Input /// may be domain name containing dots. /// /// ASCII input string. /// Unicode string. public static string ToUnicode(string input) { input = input.ToLower(); StringBuilder o = new StringBuilder(); StringBuilder h = new StringBuilder(); for (int i = 0; i < input.Length; i++) { char c = input[i]; if (c == '.' || c == '\u3002' || c == '\uff0e' || c == '\uff61') { o.Append(ToUnicode(h.ToString(), false, true)); o.Append(c); h = new StringBuilder(); } else { h.Append(c); } } o.Append(ToUnicode(h.ToString(), false, true)); return o.ToString(); } /// /// Converts an ASCII-encoded string to Unicode. /// /// ASCII input string. /// Allow unassigned Unicode characters. /// Check that the output conforms to STD3. /// Unicode string. public static string ToUnicode(string input, bool allowUnassigned, bool useSTD3ASCIIRules) { string original = input; bool nonASCII = false; // Step 1: If all code points are inside 0..0x7f, skip to step 3. for (int i = 0; i < input.Length; i++) { int c = input[i]; if (c > 0x7f) { nonASCII = true; break; } } // Step 2: Perform the Nameprep operation. if (nonASCII) { try { input = Stringprep.NamePrep(input, allowUnassigned); } catch (StringprepException e) { // ToUnicode never fails! return original; } } // Step 3: Verify the sequence starts with the ACE prefix. if (!input.StartsWith(ACE_PREFIX)) { // ToUnicode never fails! return original; } string stored = input; // Step 4: Remove the ACE prefix. input = input.Substring(ACE_PREFIX.Length); // Step 5: Decode using punycode string output; try { output = Punycode.Decode(input); } catch (PunycodeException e) { // ToUnicode never fails! return original; } // Step 6: Apply toASCII string ascii; try { ascii = ToASCII(output, allowUnassigned, useSTD3ASCIIRules); } catch (IDNAException e) { // ToUnicode never fails! return original; } // Step 7: Compare case-insensitively. if (!ascii.ToUpper().Equals(stored.ToUpper())) { // ToUnicode never fails! return original; } // Step 8: Return the result. return output; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/Stringprep.cs0000644000175000017500000003026512204443225022504 0ustar00meebeymeebey00000000000000/// Copyright (C) 2004 Free Software Foundation, Inc. /// * /// Author: Alexander Gnauck AG-Software, mailto:gnauck@ag-software.de /// * /// This file is part of GNU Libidn. /// * /// This library is free software; you can redistribute it and/or /// modify it under the terms of the GNU Lesser General Public License /// as published by the Free Software Foundation; either version 2.1 of /// the License, or (at your option) any later version. /// * /// This library is distributed in the hope that it will be useful, but /// WITHOUT ANY WARRANTY; without even the implied warranty of /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU /// Lesser General Public License for more details. /// * /// You should have received a copy of the GNU Lesser General Public /// License along with this library; if not, write to the Free Software /// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 /// USA /// using System; using System.Text; namespace agsXMPP.Idn { /// This class offers static methods for preparing internationalized /// strings. It supports the following stringprep profiles: ///
      ///
    • RFC3491 nameprep ///
    • RFC3920 XMPP nodeprep and resourceprep ///
    /// Note that this implementation only supports 16-bit Unicode code /// points. ///
    public class Stringprep { /// Preps a name according to the Stringprep profile defined in /// RFC3491. Unassigned code points are not allowed. /// * /// /// the name to prep. /// /// the prepped name. /// @throws StringprepException If the name cannot be prepped with /// this profile. /// @throws NullPointerException If the name is null. /// /// public static string NamePrep(string input) { return NamePrep(input, false); } /// Preps a name according to the Stringprep profile defined in /// RFC3491. /// * /// /// the name to prep. /// /// true if the name may contain unassigned /// code points. /// /// the prepped name. /// @throws StringprepException If the name cannot be prepped with /// this profile. /// @throws NullPointerException If the name is null. /// /// public static string NamePrep(string input, bool allowUnassigned) { if (input == null) { throw new System.NullReferenceException(); } StringBuilder s = new StringBuilder(input); if (!allowUnassigned && Contains(s, RFC3454.A1)) { throw new StringprepException(StringprepException.CONTAINS_UNASSIGNED); } Filter(s, RFC3454.B1); Map(s, RFC3454.B2search, RFC3454.B2replace); s = new StringBuilder(NFKC.NormalizeNFKC(s.ToString())); // B.3 is only needed if NFKC is not used, right? // map(s, RFC3454.B3search, RFC3454.B3replace); if (Contains(s, RFC3454.C12) || Contains(s, RFC3454.C22) || Contains(s, RFC3454.C3) || Contains(s, RFC3454.C4) || Contains(s, RFC3454.C5) || Contains(s, RFC3454.C6) || Contains(s, RFC3454.C7) || Contains(s, RFC3454.C8)) { // Table C.9 only contains code points > 0xFFFF which Java // doesn't handle throw new StringprepException(StringprepException.CONTAINS_PROHIBITED); } // Bidi handling bool r = Contains(s, RFC3454.D1); bool l = Contains(s, RFC3454.D2); // RFC 3454, section 6, requirement 1: already handled above (table C.8) // RFC 3454, section 6, requirement 2 if (r && l) { throw new StringprepException(StringprepException.BIDI_BOTHRAL); } // RFC 3454, section 6, requirement 3 if (r) { if (!Contains(s[0], RFC3454.D1) || !Contains(s[s.Length - 1], RFC3454.D1)) { throw new StringprepException(StringprepException.BIDI_LTRAL); } } return s.ToString(); } /** * Characters prohibited by RFC3920 nodeprep that aren't defined as * part of the RFC3454 tables. */ private static char [] RFC3920_NODEPREP_PROHIBIT = new char [] { '\u0022', '\u0026', '\'', '\u002F', '\u003A', '\u003C', '\u003E', '\u0040' }; /// Preps a node name according to the Stringprep profile defined in /// RFC3920. Unassigned code points are not allowed. /// * /// /// the node name to prep. /// /// the prepped node name. /// @throws StringprepException If the node name cannot be prepped /// with this profile. /// @throws NullPointerException If the node name is null. /// /// public static string NodePrep(string input) { return NodePrep(input, false); } /// /// Preps a node name according to the Stringprep profile defined in RFC3920. /// /// the node name to prep. /// /// true if the node name may contain /// unassigned code points. /// /// the prepped node name. /// @throws StringprepException If the node name cannot be prepped /// with this profile. /// @throws NullPointerException If the node name is null. /// /// public static string NodePrep(string input, bool allowUnassigned) { if (input == null) { throw new System.NullReferenceException(); } StringBuilder s = new StringBuilder(input); if (!allowUnassigned && Contains(s, RFC3454.A1)) { throw new StringprepException(StringprepException.CONTAINS_UNASSIGNED); } Filter(s, RFC3454.B1); Map(s, RFC3454.B2search, RFC3454.B2replace); s = new StringBuilder(NFKC.NormalizeNFKC(s.ToString())); if (Contains(s, RFC3454.C11) || Contains(s, RFC3454.C12) || Contains(s, RFC3454.C21) || Contains(s, RFC3454.C22) || Contains(s, RFC3454.C3) || Contains(s, RFC3454.C4) || Contains(s, RFC3454.C5) || Contains(s, RFC3454.C6) || Contains(s, RFC3454.C7) || Contains(s, RFC3454.C8) || Contains(s, RFC3920_NODEPREP_PROHIBIT)) { // Table C.9 only contains code points > 0xFFFF which Java // doesn't handle throw new StringprepException(StringprepException.CONTAINS_PROHIBITED); } // Bidi handling bool r = Contains(s, RFC3454.D1); bool l = Contains(s, RFC3454.D2); // RFC 3454, section 6, requirement 1: already handled above (table C.8) // RFC 3454, section 6, requirement 2 if (r && l) { throw new StringprepException(StringprepException.BIDI_BOTHRAL); } // RFC 3454, section 6, requirement 3 if (r) { if (!Contains(s[0], RFC3454.D1) || !Contains(s[s.Length - 1], RFC3454.D1)) { throw new StringprepException(StringprepException.BIDI_LTRAL); } } return s.ToString(); } /// /// Preps a resource name according to the Stringprep profile defined /// in RFC3920. Unassigned code points are not allowed. /// /// the resource name to prep. /// /// the prepped node name. /// @throws StringprepException If the resource name cannot be prepped /// with this profile. /// @throws NullPointerException If the resource name is null. /// /// public static string ResourcePrep(string input) { return ResourcePrep(input, false); } /// /// Preps a resource name according to the Stringprep profile defined /// in RFC3920. /// /// the resource name to prep. /// /// true if the resource name may contain /// unassigned code points. /// /// /// the prepped node name. /// @throws StringprepException If the resource name cannot be prepped /// with this profile. /// @throws NullPointerException If the resource name is null. /// /// public static string ResourcePrep(string input, bool allowUnassigned) { if (input == null) { throw new System.NullReferenceException(); } StringBuilder s = new StringBuilder(input); if (!allowUnassigned && Contains(s, RFC3454.A1)) { throw new StringprepException(StringprepException.CONTAINS_UNASSIGNED); } Filter(s, RFC3454.B1); s = new StringBuilder(NFKC.NormalizeNFKC(s.ToString())); if (Contains(s, RFC3454.C12) || Contains(s, RFC3454.C21) || Contains(s, RFC3454.C22) || Contains(s, RFC3454.C3) || Contains(s, RFC3454.C4) || Contains(s, RFC3454.C5) || Contains(s, RFC3454.C6) || Contains(s, RFC3454.C7) || Contains(s, RFC3454.C8)) { // Table C.9 only contains code points > 0xFFFF which Java // doesn't handle throw new StringprepException(StringprepException.CONTAINS_PROHIBITED); } // Bidi handling bool r = Contains(s, RFC3454.D1); bool l = Contains(s, RFC3454.D2); // RFC 3454, section 6, requirement 1: already handled above (table C.8) // RFC 3454, section 6, requirement 2 if (r && l) { throw new StringprepException(StringprepException.BIDI_BOTHRAL); } // RFC 3454, section 6, requirement 3 if (r) { if (!Contains(s[0], RFC3454.D1) || !Contains(s[s.Length - 1], RFC3454.D1)) { throw new StringprepException(StringprepException.BIDI_LTRAL); } } return s.ToString(); } internal static bool Contains(StringBuilder s, char[] p) { for (int i = 0; i < p.Length; i++) { char c = p[i]; for (int j = 0; j < s.Length; j++) { if (c == s[j]) { return true; } } } return false; } internal static bool Contains(StringBuilder s, char[][] p) { for (int i = 0; i < p.Length; i++) { char[] r = p[i]; if (1 == r.Length) { char c = r[0]; for (int j = 0; j < s.Length; j++) { if (c == s[j]) { return true; } } } else if (2 == r.Length) { char f = r[0]; char t = r[1]; for (int j = 0; j < s.Length; j++) { if (f <= s[j] && t >= s[j]) { return true; } } } } return false; } internal static bool Contains(char c, char[][] p) { for (int i = 0; i < p.Length; i++) { char[] r = p[i]; if (1 == r.Length) { if (c == r[0]) { return true; } } else if (2 == r.Length) { char f = r[0]; char t = r[1]; if (f <= c && t >= c) { return true; } } } return false; } internal static void Filter(StringBuilder s, char[] f) { for (int i = 0; i < f.Length; i++) { char c = f[i]; int j = 0; while (j < s.Length) { if (c == s[j]) { //s.deleteCharAt(j); s.Remove(j, 1); } else { j++; } } } } internal static void Filter(StringBuilder s, char[][] f) { for (int i = 0; i < f.Length; i++) { char[] r = f[i]; if (1 == r.Length) { char c = r[0]; int j = 0; while (j < s.Length) { if (c == s[j]) { //s.deleteCharAt(j); s.Remove(j, 1); } else { j++; } } } else if (2 == r.Length) { char from = r[0]; char to = r[1]; int j = 0; while (j < s.Length) { if (from <= s[j] && to >= s[j]) { //s.deleteCharAt(j); s.Remove(j, 1); } else { j++; } } } } } internal static void Map(StringBuilder s, char[] search, string[] replace) { for (int i = 0; i < search.Length; i++) { char c = search[i]; int j = 0; while (j < s.Length) { if (c == s[j]) { //s.deleteCharAt(j); s.Remove(j, 1); if (null != replace[i]) { s.Insert(j, replace[i]); j += replace[i].Length - 1; } } else { j++; } } } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/CombiningClass.cs0000644000175000017500000006723512204443225023251 0ustar00meebeymeebey00000000000000// Do not edit !!! // this file is generated automatically namespace agsXMPP.Idn { public class CombiningClass { public static readonly int[,] c = new int[,] { { /* Page 3 */ 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 232, 220, 220, 220, 220, 232, 216, 220, 220, 220, 220, 220, 202, 202, 220, 220, 220, 220, 202, 202, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1, 1, 1, 1, 1, 220, 220, 220, 220, 230, 230, 230, 230, 230, 230, 230, 230, 240, 230, 220, 220, 220, 230, 230, 230, 220, 220, 0, 230, 230, 230, 220, 220, 220, 220, 230, 232, 220, 220, 230, 233, 234, 234, 233, 234, 234, 233, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 4 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 5 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 230, 230, 230, 230, 220, 230, 230, 230, 222, 220, 230, 230, 230, 230, 230, 230, 220, 220, 220, 220, 220, 220, 230, 230, 220, 230, 230, 222, 228, 230, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 0, 23, 0, 24, 25, 0, 230, 220, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 6 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, 230, 230, 230, 230, 30, 31, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 28, 29, 30, 31, 32, 33, 34, 230, 230, 220, 220, 230, 230, 230, 230, 230, 220, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, 230, 230, 230, 0, 0, 230, 230, 230, 230, 220, 230, 0, 0, 230, 230, 0, 220, 230, 230, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 7 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 220, 230, 230, 220, 230, 230, 220, 220, 220, 230, 220, 220, 230, 220, 230, 230, 230, 220, 230, 220, 230, 220, 230, 220, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, 230, 230, 230, 220, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 9 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 230, 220, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 11 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 12 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 84, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 13 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 14 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 103, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 122, 122, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 15 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 0, 220, 0, 216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, 130, 0, 132, 0, 0, 0, 0, 0, 130, 130, 130, 130, 0, 0, 130, 0, 230, 230, 9, 0, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 16 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 19 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 23 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 24 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 25 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 230, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 26 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 27 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 220, 230, 230, 230, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 28 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 29 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 220, 230, 230, 230, 230, 230, 230, 230, 220, 230, 230, 234, 214, 220, 202, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 220, }, { /* Page 32 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 1, 1, 230, 230, 230, 230, 1, 1, 1, 230, 230, 0, 0, 0, 0, 230, 0, 0, 0, 1, 1, 230, 220, 230, 1, 1, 220, 220, 220, 220, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 45 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, }, { /* Page 48 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 218, 228, 232, 222, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 166 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 168 */ 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 169 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 220, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 251 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* Page 254 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, }; public static readonly int[] i = new int[] { -1, -1, -1, 0, 1, 2, 3, 4, -1, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, 13, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, -1, -1, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 24, -1, 25, 26, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, -1, -1, 28, -1, }; } }smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/Composition.cs0000644000175000017500000016172012204443225022653 0ustar00meebeymeebey00000000000000// Do not edit !!! // this file is generated automatically namespace agsXMPP.Idn { public class Composition { /* jagged Array */ public static readonly char[][] multiFirst = new char[][] { new char[] { '\u00C0', '\u00C1', '\u00C2', '\u00C3', '\u0100', '\u0102', '\u0226', '\u00C4', '\u1EA2', '\u00C5', '\u01CD', '\u0200', '\u0202', '\u1EA0', '\u1E00', '\u0104', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E02', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E04', '\u0000', '\u0000', '\u1E06', }, new char[] { '\u0000', '\u0106', '\u0108', '\u0000', '\u0000', '\u0000', '\u010A', '\u0000', '\u0000', '\u0000', '\u010C', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u00C7', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E0A', '\u0000', '\u0000', '\u0000', '\u010E', '\u0000', '\u0000', '\u1E0C', '\u0000', '\u0000', '\u1E0E', '\u1E10', '\u1E12', }, new char[] { '\u00C8', '\u00C9', '\u00CA', '\u1EBC', '\u0112', '\u0114', '\u0116', '\u00CB', '\u1EBA', '\u0000', '\u011A', '\u0204', '\u0206', '\u1EB8', '\u0000', '\u0118', '\u0000', '\u0228', '\u1E18', '\u1E1A', }, new char[] { '\u0000', '\u01F4', '\u011C', '\u0000', '\u1E20', '\u011E', '\u0120', '\u0000', '\u0000', '\u0000', '\u01E6', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0122', }, new char[] { '\u0000', '\u0000', '\u0124', '\u0000', '\u0000', '\u0000', '\u1E22', '\u1E26', '\u0000', '\u0000', '\u021E', '\u0000', '\u0000', '\u1E24', '\u0000', '\u0000', '\u0000', '\u1E28', '\u0000', '\u0000', '\u1E2A', }, new char[] { '\u00CC', '\u00CD', '\u00CE', '\u0128', '\u012A', '\u012C', '\u0130', '\u00CF', '\u1EC8', '\u0000', '\u01CF', '\u0208', '\u020A', '\u1ECA', '\u0000', '\u012E', '\u0000', '\u0000', '\u0000', '\u1E2C', }, new char[] { '\u0000', '\u1E30', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u01E8', '\u0000', '\u0000', '\u1E32', '\u0000', '\u0000', '\u1E34', '\u0136', }, new char[] { '\u0000', '\u0139', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u013D', '\u0000', '\u0000', '\u1E36', '\u0000', '\u0000', '\u1E3A', '\u013B', '\u1E3C', }, new char[] { '\u0000', '\u1E3E', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E40', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E42', }, new char[] { '\u01F8', '\u0143', '\u0000', '\u00D1', '\u0000', '\u0000', '\u1E44', '\u0000', '\u0000', '\u0000', '\u0147', '\u0000', '\u0000', '\u1E46', '\u0000', '\u0000', '\u1E48', '\u0145', '\u1E4A', }, new char[] { '\u00D2', '\u00D3', '\u00D4', '\u00D5', '\u014C', '\u014E', '\u022E', '\u00D6', '\u1ECE', '\u0000', '\u01D1', '\u020C', '\u020E', '\u1ECC', '\u0000', '\u01EA', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0150', '\u01A0', }, new char[] { '\u0000', '\u1E54', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E56', }, new char[] { '\u0000', '\u0154', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E58', '\u0000', '\u0000', '\u0000', '\u0158', '\u0210', '\u0212', '\u1E5A', '\u0000', '\u0000', '\u1E5E', '\u0156', }, new char[] { '\u0000', '\u015A', '\u015C', '\u0000', '\u0000', '\u0000', '\u1E60', '\u0000', '\u0000', '\u0000', '\u0160', '\u0000', '\u0000', '\u1E62', '\u0000', '\u0000', '\u0000', '\u015E', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0218', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E6A', '\u0000', '\u0000', '\u0000', '\u0164', '\u0000', '\u0000', '\u1E6C', '\u0000', '\u0000', '\u1E6E', '\u0162', '\u1E70', '\u0000', '\u0000', '\u0000', '\u0000', '\u021A', }, new char[] { '\u00D9', '\u00DA', '\u00DB', '\u0168', '\u016A', '\u016C', '\u0000', '\u00DC', '\u1EE6', '\u016E', '\u01D3', '\u0214', '\u0216', '\u1EE4', '\u0000', '\u0172', '\u0000', '\u0000', '\u1E76', '\u1E74', '\u0000', '\u0170', '\u01AF', '\u0000', '\u1E72', }, new char[] { '\u0000', '\u0000', '\u0000', '\u1E7C', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E7E', }, new char[] { '\u1E80', '\u1E82', '\u0174', '\u0000', '\u0000', '\u0000', '\u1E86', '\u1E84', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E88', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E8A', '\u1E8C', }, new char[] { '\u1EF2', '\u00DD', '\u0176', '\u1EF8', '\u0232', '\u0000', '\u1E8E', '\u0178', '\u1EF6', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EF4', }, new char[] { '\u0000', '\u0179', '\u1E90', '\u0000', '\u0000', '\u0000', '\u017B', '\u0000', '\u0000', '\u0000', '\u017D', '\u0000', '\u0000', '\u1E92', '\u0000', '\u0000', '\u1E94', }, new char[] { '\u00E0', '\u00E1', '\u00E2', '\u00E3', '\u0101', '\u0103', '\u0227', '\u00E4', '\u1EA3', '\u00E5', '\u01CE', '\u0201', '\u0203', '\u1EA1', '\u1E01', '\u0105', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E03', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E05', '\u0000', '\u0000', '\u1E07', }, new char[] { '\u0000', '\u0107', '\u0109', '\u0000', '\u0000', '\u0000', '\u010B', '\u0000', '\u0000', '\u0000', '\u010D', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u00E7', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E0B', '\u0000', '\u0000', '\u0000', '\u010F', '\u0000', '\u0000', '\u1E0D', '\u0000', '\u0000', '\u1E0F', '\u1E11', '\u1E13', }, new char[] { '\u00E8', '\u00E9', '\u00EA', '\u1EBD', '\u0113', '\u0115', '\u0117', '\u00EB', '\u1EBB', '\u0000', '\u011B', '\u0205', '\u0207', '\u1EB9', '\u0000', '\u0119', '\u0000', '\u0229', '\u1E19', '\u1E1B', }, new char[] { '\u0000', '\u01F5', '\u011D', '\u0000', '\u1E21', '\u011F', '\u0121', '\u0000', '\u0000', '\u0000', '\u01E7', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0123', }, new char[] { '\u0000', '\u0000', '\u0125', '\u0000', '\u0000', '\u0000', '\u1E23', '\u1E27', '\u0000', '\u0000', '\u021F', '\u0000', '\u0000', '\u1E25', '\u0000', '\u0000', '\u1E96', '\u1E29', '\u0000', '\u0000', '\u1E2B', }, new char[] { '\u00EC', '\u00ED', '\u00EE', '\u0129', '\u012B', '\u012D', '\u0000', '\u00EF', '\u1EC9', '\u0000', '\u01D0', '\u0209', '\u020B', '\u1ECB', '\u0000', '\u012F', '\u0000', '\u0000', '\u0000', '\u1E2D', }, new char[] { '\u0000', '\u0000', '\u0135', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u01F0', }, new char[] { '\u0000', '\u1E31', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u01E9', '\u0000', '\u0000', '\u1E33', '\u0000', '\u0000', '\u1E35', '\u0137', }, new char[] { '\u0000', '\u013A', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u013E', '\u0000', '\u0000', '\u1E37', '\u0000', '\u0000', '\u1E3B', '\u013C', '\u1E3D', }, new char[] { '\u0000', '\u1E3F', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E41', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E43', }, new char[] { '\u01F9', '\u0144', '\u0000', '\u00F1', '\u0000', '\u0000', '\u1E45', '\u0000', '\u0000', '\u0000', '\u0148', '\u0000', '\u0000', '\u1E47', '\u0000', '\u0000', '\u1E49', '\u0146', '\u1E4B', }, new char[] { '\u00F2', '\u00F3', '\u00F4', '\u00F5', '\u014D', '\u014F', '\u022F', '\u00F6', '\u1ECF', '\u0000', '\u01D2', '\u020D', '\u020F', '\u1ECD', '\u0000', '\u01EB', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0151', '\u01A1', }, new char[] { '\u0000', '\u1E55', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E57', }, new char[] { '\u0000', '\u0155', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E59', '\u0000', '\u0000', '\u0000', '\u0159', '\u0211', '\u0213', '\u1E5B', '\u0000', '\u0000', '\u1E5F', '\u0157', }, new char[] { '\u0000', '\u015B', '\u015D', '\u0000', '\u0000', '\u0000', '\u1E61', '\u0000', '\u0000', '\u0000', '\u0161', '\u0000', '\u0000', '\u1E63', '\u0000', '\u0000', '\u0000', '\u015F', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0219', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E6B', '\u1E97', '\u0000', '\u0000', '\u0165', '\u0000', '\u0000', '\u1E6D', '\u0000', '\u0000', '\u1E6F', '\u0163', '\u1E71', '\u0000', '\u0000', '\u0000', '\u0000', '\u021B', }, new char[] { '\u00F9', '\u00FA', '\u00FB', '\u0169', '\u016B', '\u016D', '\u0000', '\u00FC', '\u1EE7', '\u016F', '\u01D4', '\u0215', '\u0217', '\u1EE5', '\u0000', '\u0173', '\u0000', '\u0000', '\u1E77', '\u1E75', '\u0000', '\u0171', '\u01B0', '\u0000', '\u1E73', }, new char[] { '\u0000', '\u0000', '\u0000', '\u1E7D', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E7F', }, new char[] { '\u1E81', '\u1E83', '\u0175', '\u0000', '\u0000', '\u0000', '\u1E87', '\u1E85', '\u0000', '\u1E98', '\u0000', '\u0000', '\u0000', '\u1E89', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1E8B', '\u1E8D', }, new char[] { '\u1EF3', '\u00FD', '\u0177', '\u1EF9', '\u0233', '\u0000', '\u1E8F', '\u00FF', '\u1EF7', '\u1E99', '\u0000', '\u0000', '\u0000', '\u1EF5', }, new char[] { '\u0000', '\u017A', '\u1E91', '\u0000', '\u0000', '\u0000', '\u017C', '\u0000', '\u0000', '\u0000', '\u017E', '\u0000', '\u0000', '\u1E93', '\u0000', '\u0000', '\u1E95', }, new char[] { '\u1FED', '\u0385', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1FC1', }, new char[] { '\u1EA6', '\u1EA4', '\u0000', '\u1EAA', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EA8', }, new char[] { '\u0000', '\u01FC', '\u0000', '\u0000', '\u01E2', }, new char[] { '\u1EC0', '\u1EBE', '\u0000', '\u1EC4', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EC2', }, new char[] { '\u1ED2', '\u1ED0', '\u0000', '\u1ED6', '\u0000', '\u0000', '\u0000', '\u0000', '\u1ED4', }, new char[] { '\u0000', '\u1E4C', '\u0000', '\u0000', '\u022C', '\u0000', '\u0000', '\u1E4E', }, new char[] { '\u01DB', '\u01D7', '\u0000', '\u0000', '\u01D5', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u01D9', }, new char[] { '\u1EA7', '\u1EA5', '\u0000', '\u1EAB', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EA9', }, new char[] { '\u0000', '\u01FD', '\u0000', '\u0000', '\u01E3', }, new char[] { '\u1EC1', '\u1EBF', '\u0000', '\u1EC5', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EC3', }, new char[] { '\u1ED3', '\u1ED1', '\u0000', '\u1ED7', '\u0000', '\u0000', '\u0000', '\u0000', '\u1ED5', }, new char[] { '\u0000', '\u1E4D', '\u0000', '\u0000', '\u022D', '\u0000', '\u0000', '\u1E4F', }, new char[] { '\u01DC', '\u01D8', '\u0000', '\u0000', '\u01D6', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u01DA', }, new char[] { '\u1EB0', '\u1EAE', '\u0000', '\u1EB4', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EB2', }, new char[] { '\u1EB1', '\u1EAF', '\u0000', '\u1EB5', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EB3', }, new char[] { '\u1E14', '\u1E16', }, new char[] { '\u1E15', '\u1E17', }, new char[] { '\u1E50', '\u1E52', }, new char[] { '\u1E51', '\u1E53', }, new char[] { '\u1EDC', '\u1EDA', '\u0000', '\u1EE0', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EDE', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EE2', }, new char[] { '\u1EDD', '\u1EDB', '\u0000', '\u1EE1', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EDF', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EE3', }, new char[] { '\u1EEA', '\u1EE8', '\u0000', '\u1EEE', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EEC', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EF0', }, new char[] { '\u1EEB', '\u1EE9', '\u0000', '\u1EEF', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EED', '\u0000', '\u0000', '\u0000', '\u0000', '\u1EF1', }, new char[] { '\u1FBA', '\u0386', '\u0000', '\u0000', '\u1FB9', '\u1FB8', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F08', '\u1F09', '\u1FBC', }, new char[] { '\u1FC8', '\u0388', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F18', '\u1F19', }, new char[] { '\u1FCA', '\u0389', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F28', '\u1F29', '\u1FCC', }, new char[] { '\u1FDA', '\u038A', '\u0000', '\u0000', '\u1FD9', '\u1FD8', '\u0000', '\u03AA', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F38', '\u1F39', }, new char[] { '\u1FF8', '\u038C', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F48', '\u1F49', }, new char[] { '\u1FEA', '\u038E', '\u0000', '\u0000', '\u1FE9', '\u1FE8', '\u0000', '\u03AB', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F59', }, new char[] { '\u1FFA', '\u038F', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F68', '\u1F69', '\u1FFC', }, new char[] { '\u1F70', '\u03AC', '\u0000', '\u0000', '\u1FB1', '\u1FB0', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1FB6', '\u1F00', '\u1F01', '\u1FB3', }, new char[] { '\u1F72', '\u03AD', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F10', '\u1F11', }, new char[] { '\u1F74', '\u03AE', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1FC6', '\u1F20', '\u1F21', '\u1FC3', }, new char[] { '\u1F76', '\u03AF', '\u0000', '\u0000', '\u1FD1', '\u1FD0', '\u0000', '\u03CA', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1FD6', '\u1F30', '\u1F31', }, new char[] { '\u1F78', '\u03CC', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F40', '\u1F41', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1FE4', '\u1FE5', }, new char[] { '\u1F7A', '\u03CD', '\u0000', '\u0000', '\u1FE1', '\u1FE0', '\u0000', '\u03CB', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1FE6', '\u1F50', '\u1F51', }, new char[] { '\u1F7C', '\u03CE', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1FF6', '\u1F60', '\u1F61', '\u1FF3', }, new char[] { '\u1FD2', '\u0390', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1FD7', }, new char[] { '\u1FE2', '\u03B0', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1FE7', }, new char[] { '\u0000', '\u03D3', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u03D4', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u04D0', '\u0000', '\u04D2', }, new char[] { '\u0400', '\u0000', '\u0000', '\u0000', '\u0000', '\u04D6', '\u0000', '\u0401', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u04C1', '\u0000', '\u04DC', }, new char[] { '\u040D', '\u0000', '\u0000', '\u0000', '\u04E2', '\u0419', '\u0000', '\u04E4', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u04EE', '\u040E', '\u0000', '\u04F0', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u04F2', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u04D1', '\u0000', '\u04D3', }, new char[] { '\u0450', '\u0000', '\u0000', '\u0000', '\u0000', '\u04D7', '\u0000', '\u0451', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u04C2', '\u0000', '\u04DD', }, new char[] { '\u045D', '\u0000', '\u0000', '\u0000', '\u04E3', '\u0439', '\u0000', '\u04E5', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u04EF', '\u045E', '\u0000', '\u04F1', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u04F3', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0623', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0BCA', '\u0BCC', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0CC7', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0D4A', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0DDA', }, new char[] { '\u0000', '\u0000', '\u1EAC', '\u0000', '\u0000', '\u1EB6', }, new char[] { '\u0000', '\u0000', '\u1EAD', '\u0000', '\u0000', '\u1EB7', }, new char[] { '\u1F02', '\u1F04', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F06', '\u0000', '\u0000', '\u1F80', }, new char[] { '\u1F03', '\u1F05', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F07', '\u0000', '\u0000', '\u1F81', }, new char[] { '\u1F0A', '\u1F0C', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F0E', '\u0000', '\u0000', '\u1F88', }, new char[] { '\u1F0B', '\u1F0D', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F0F', '\u0000', '\u0000', '\u1F89', }, new char[] { '\u1F12', '\u1F14', }, new char[] { '\u1F13', '\u1F15', }, new char[] { '\u1F1A', '\u1F1C', }, new char[] { '\u1F1B', '\u1F1D', }, new char[] { '\u1F22', '\u1F24', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F26', '\u0000', '\u0000', '\u1F90', }, new char[] { '\u1F23', '\u1F25', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F27', '\u0000', '\u0000', '\u1F91', }, new char[] { '\u1F2A', '\u1F2C', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F2E', '\u0000', '\u0000', '\u1F98', }, new char[] { '\u1F2B', '\u1F2D', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F2F', '\u0000', '\u0000', '\u1F99', }, new char[] { '\u1F32', '\u1F34', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F36', }, new char[] { '\u1F33', '\u1F35', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F37', }, new char[] { '\u1F3A', '\u1F3C', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F3E', }, new char[] { '\u1F3B', '\u1F3D', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F3F', }, new char[] { '\u1F42', '\u1F44', }, new char[] { '\u1F43', '\u1F45', }, new char[] { '\u1F4A', '\u1F4C', }, new char[] { '\u1F4B', '\u1F4D', }, new char[] { '\u1F52', '\u1F54', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F56', }, new char[] { '\u1F53', '\u1F55', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F57', }, new char[] { '\u1F5B', '\u1F5D', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F5F', }, new char[] { '\u1F62', '\u1F64', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F66', '\u0000', '\u0000', '\u1FA0', }, new char[] { '\u1F63', '\u1F65', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F67', '\u0000', '\u0000', '\u1FA1', }, new char[] { '\u1F6A', '\u1F6C', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F6E', '\u0000', '\u0000', '\u1FA8', }, new char[] { '\u1F6B', '\u1F6D', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1F6F', '\u0000', '\u0000', '\u1FA9', }, new char[] { '\u1FCD', '\u1FCE', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1FCF', }, new char[] { '\u1FDD', '\u1FDE', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u1FDF', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u3070', '\u3071', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u3073', '\u3074', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u3076', '\u3077', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u3079', '\u307A', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u307C', '\u307D', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u30D0', '\u30D1', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u30D3', '\u30D4', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u30D6', '\u30D7', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u30D9', '\u30DA', }, new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u30DC', '\u30DD', }, }; public static readonly char[,] singleFirst = new char[,] { { '\u0338', '\u226E' }, { '\u0338', '\u2260' }, { '\u0338', '\u226F' }, { '\u0307', '\u1E1E' }, { '\u0302', '\u0134' }, { '\u0307', '\u1E1F' }, { '\u0304', '\u01DE' }, { '\u0301', '\u01FA' }, { '\u0301', '\u1E08' }, { '\u0301', '\u1E2E' }, { '\u0304', '\u022A' }, { '\u0301', '\u01FE' }, { '\u0304', '\u01DF' }, { '\u0301', '\u01FB' }, { '\u0301', '\u1E09' }, { '\u0301', '\u1E2F' }, { '\u0304', '\u022B' }, { '\u0301', '\u01FF' }, { '\u0307', '\u1E64' }, { '\u0307', '\u1E65' }, { '\u0307', '\u1E66' }, { '\u0307', '\u1E67' }, { '\u0301', '\u1E78' }, { '\u0301', '\u1E79' }, { '\u0308', '\u1E7A' }, { '\u0308', '\u1E7B' }, { '\u0307', '\u1E9B' }, { '\u030C', '\u01EE' }, { '\u0304', '\u01EC' }, { '\u0304', '\u01ED' }, { '\u0304', '\u01E0' }, { '\u0304', '\u01E1' }, { '\u0306', '\u1E1C' }, { '\u0306', '\u1E1D' }, { '\u0304', '\u0230' }, { '\u0304', '\u0231' }, { '\u030C', '\u01EF' }, { '\u0314', '\u1FEC' }, { '\u0345', '\u1FB4' }, { '\u0345', '\u1FC4' }, { '\u0345', '\u1FF4' }, { '\u0308', '\u0407' }, { '\u0301', '\u0403' }, { '\u0308', '\u04DE' }, { '\u0301', '\u040C' }, { '\u0308', '\u04E6' }, { '\u0308', '\u04F4' }, { '\u0308', '\u04F8' }, { '\u0308', '\u04EC' }, { '\u0301', '\u0453' }, { '\u0308', '\u04DF' }, { '\u0301', '\u045C' }, { '\u0308', '\u04E7' }, { '\u0308', '\u04F5' }, { '\u0308', '\u04F9' }, { '\u0308', '\u04ED' }, { '\u0308', '\u0457' }, { '\u030F', '\u0476' }, { '\u030F', '\u0477' }, { '\u0308', '\u04DA' }, { '\u0308', '\u04DB' }, { '\u0308', '\u04EA' }, { '\u0308', '\u04EB' }, { '\u0654', '\u0624' }, { '\u0654', '\u0626' }, { '\u0654', '\u06C2' }, { '\u0654', '\u06D3' }, { '\u0654', '\u06C0' }, { '\u093C', '\u0929' }, { '\u093C', '\u0931' }, { '\u093C', '\u0934' }, { '\u0BD7', '\u0B94' }, { '\u0BBE', '\u0BCB' }, { '\u0C56', '\u0C48' }, { '\u0CD5', '\u0CC0' }, { '\u0CD5', '\u0CCB' }, { '\u0D3E', '\u0D4B' }, { '\u0DCA', '\u0DDD' }, { '\u102E', '\u1026' }, { '\u1B35', '\u1B06' }, { '\u1B35', '\u1B08' }, { '\u1B35', '\u1B0A' }, { '\u1B35', '\u1B0C' }, { '\u1B35', '\u1B0E' }, { '\u1B35', '\u1B12' }, { '\u1B35', '\u1B3B' }, { '\u1B35', '\u1B3D' }, { '\u1B35', '\u1B40' }, { '\u1B35', '\u1B41' }, { '\u1B35', '\u1B43' }, { '\u0304', '\u1E38' }, { '\u0304', '\u1E39' }, { '\u0304', '\u1E5C' }, { '\u0304', '\u1E5D' }, { '\u0307', '\u1E68' }, { '\u0307', '\u1E69' }, { '\u0302', '\u1EC6' }, { '\u0302', '\u1EC7' }, { '\u0302', '\u1ED8' }, { '\u0302', '\u1ED9' }, { '\u0345', '\u1F82' }, { '\u0345', '\u1F83' }, { '\u0345', '\u1F84' }, { '\u0345', '\u1F85' }, { '\u0345', '\u1F86' }, { '\u0345', '\u1F87' }, { '\u0345', '\u1F8A' }, { '\u0345', '\u1F8B' }, { '\u0345', '\u1F8C' }, { '\u0345', '\u1F8D' }, { '\u0345', '\u1F8E' }, { '\u0345', '\u1F8F' }, { '\u0345', '\u1F92' }, { '\u0345', '\u1F93' }, { '\u0345', '\u1F94' }, { '\u0345', '\u1F95' }, { '\u0345', '\u1F96' }, { '\u0345', '\u1F97' }, { '\u0345', '\u1F9A' }, { '\u0345', '\u1F9B' }, { '\u0345', '\u1F9C' }, { '\u0345', '\u1F9D' }, { '\u0345', '\u1F9E' }, { '\u0345', '\u1F9F' }, { '\u0345', '\u1FA2' }, { '\u0345', '\u1FA3' }, { '\u0345', '\u1FA4' }, { '\u0345', '\u1FA5' }, { '\u0345', '\u1FA6' }, { '\u0345', '\u1FA7' }, { '\u0345', '\u1FAA' }, { '\u0345', '\u1FAB' }, { '\u0345', '\u1FAC' }, { '\u0345', '\u1FAD' }, { '\u0345', '\u1FAE' }, { '\u0345', '\u1FAF' }, { '\u0345', '\u1FB2' }, { '\u0345', '\u1FC2' }, { '\u0345', '\u1FF2' }, { '\u0345', '\u1FB7' }, { '\u0345', '\u1FC7' }, { '\u0345', '\u1FF7' }, { '\u0338', '\u219A' }, { '\u0338', '\u219B' }, { '\u0338', '\u21AE' }, { '\u0338', '\u21CD' }, { '\u0338', '\u21CF' }, { '\u0338', '\u21CE' }, { '\u0338', '\u2204' }, { '\u0338', '\u2209' }, { '\u0338', '\u220C' }, { '\u0338', '\u2224' }, { '\u0338', '\u2226' }, { '\u0338', '\u2241' }, { '\u0338', '\u2244' }, { '\u0338', '\u2247' }, { '\u0338', '\u2249' }, { '\u0338', '\u226D' }, { '\u0338', '\u2262' }, { '\u0338', '\u2270' }, { '\u0338', '\u2271' }, { '\u0338', '\u2274' }, { '\u0338', '\u2275' }, { '\u0338', '\u2278' }, { '\u0338', '\u2279' }, { '\u0338', '\u2280' }, { '\u0338', '\u2281' }, { '\u0338', '\u22E0' }, { '\u0338', '\u22E1' }, { '\u0338', '\u2284' }, { '\u0338', '\u2285' }, { '\u0338', '\u2288' }, { '\u0338', '\u2289' }, { '\u0338', '\u22E2' }, { '\u0338', '\u22E3' }, { '\u0338', '\u22AC' }, { '\u0338', '\u22AD' }, { '\u0338', '\u22AE' }, { '\u0338', '\u22AF' }, { '\u0338', '\u22EA' }, { '\u0338', '\u22EB' }, { '\u0338', '\u22EC' }, { '\u0338', '\u22ED' }, { '\u3099', '\u3094' }, { '\u3099', '\u304C' }, { '\u3099', '\u304E' }, { '\u3099', '\u3050' }, { '\u3099', '\u3052' }, { '\u3099', '\u3054' }, { '\u3099', '\u3056' }, { '\u3099', '\u3058' }, { '\u3099', '\u305A' }, { '\u3099', '\u305C' }, { '\u3099', '\u305E' }, { '\u3099', '\u3060' }, { '\u3099', '\u3062' }, { '\u3099', '\u3065' }, { '\u3099', '\u3067' }, { '\u3099', '\u3069' }, { '\u3099', '\u309E' }, { '\u3099', '\u30F4' }, { '\u3099', '\u30AC' }, { '\u3099', '\u30AE' }, { '\u3099', '\u30B0' }, { '\u3099', '\u30B2' }, { '\u3099', '\u30B4' }, { '\u3099', '\u30B6' }, { '\u3099', '\u30B8' }, { '\u3099', '\u30BA' }, { '\u3099', '\u30BC' }, { '\u3099', '\u30BE' }, { '\u3099', '\u30C0' }, { '\u3099', '\u30C2' }, { '\u3099', '\u30C5' }, { '\u3099', '\u30C7' }, { '\u3099', '\u30C9' }, { '\u3099', '\u30F7' }, { '\u3099', '\u30F8' }, { '\u3099', '\u30F9' }, { '\u3099', '\u30FA' }, { '\u3099', '\u30FE' }, }; public static readonly char[,] singleSecond = new char[,] { { '\u0627', '\u0622' }, { '\u0627', '\u0625' }, { '\u09C7', '\u09CB' }, { '\u09C7', '\u09CC' }, { '\u0B47', '\u0B4B' }, { '\u0B47', '\u0B48' }, { '\u0B47', '\u0B4C' }, { '\u0CC6', '\u0CCA' }, { '\u0CC6', '\u0CC8' }, { '\u0D46', '\u0D4C' }, { '\u0DD9', '\u0DDC' }, { '\u0DD9', '\u0DDE' }, }; public static readonly int multiSecondStart = 144; public static readonly int singleFirstStart = 181; public static readonly int singleSecondStart = 402; public static readonly int[] composePage = new int[] { 0, 1, 2, 3, 4, -1, 5, -1, -1, 6, -1, 7, 8, 9, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, 12, 13, -1, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, -1, }; public static readonly int[,] composeData = new int[,] { { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 181, 182, 183, -1, -1, 0, 1, 2, 3, 4, 184, 5, 6, 7, 185, 8, 9, 10, 11, 12, 13, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, 23, 24, 25, 26, 27, 186, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, -1, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 187, 188, 49, 189, -1, -1, 50, -1, -1, -1, -1, 190, -1, -1, -1, -1, 51, 52, 191, -1, 192, -1, -1, -1, 53, -1, -1, -1, -1, -1, 54, -1, 193, 194, 55, 195, -1, -1, 56, -1, -1, -1, -1, 196, -1, -1, -1, -1, 57, 58, 197, -1, 198, -1, -1, -1, 59, -1, -1, -1, }, { -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 64, 65, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 199, 200, -1, -1, -1, -1, 201, 202, -1, -1, -1, -1, -1, -1, 203, 204, 205, 206, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 207, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 68, 69, -1, -1, -1, -1, -1, -1, 208, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 211, 212, 213, 214, -1, -1, -1, -1, 215, 216, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 217, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { 144, 145, 146, 147, 148, -1, 149, 150, 151, 152, 153, 165, 154, -1, -1, 155, -1, 156, -1, 170, 171, -1, -1, -1, -1, -1, -1, 166, -1, -1, -1, -1, -1, -1, -1, 157, 168, 158, 167, 161, 159, -1, -1, -1, -1, 162, 164, -1, 163, 160, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 169, -1, -1, 172, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 70, -1, -1, -1, 71, -1, 72, -1, 73, -1, -1, -1, -1, -1, 74, -1, 218, -1, -1, -1, 75, -1, -1, -1, 76, -1, -1, 219, -1, 220, -1, -1, 77, -1, -1, -1, 78, -1, 79, -1, 80, -1, -1, -1, -1, -1, 81, -1, 82, -1, -1, -1, 83, -1, -1, -1, 84, 85, 86, -1, -1, 221, -1, -1, -1, 87, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, -1, -1, -1, -1, 222, -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, -1, -1, 223, -1, 89, 90, 224, 91, -1, 225, -1, -1, -1, 226, -1, -1, -1, -1, 92, -1, -1, -1, 227, -1, -1, -1, 228, -1, 229, -1, -1, 93, -1, -1, 230, -1, 94, 95, 231, 96, -1, 232, -1, -1, -1, 233, -1, -1, -1, -1, 97, -1, -1, -1, 234, -1, -1, -1, 235, -1, 236, -1, -1, -1, -1, -1, -1, -1, -1, 237, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 238, 239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 242, 243, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 98, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 244, -1, 245, -1, -1, -1, -1, -1, -1, -1, -1, 402, 173, 403, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 246, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 247, -1, -1, 248, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 249, -1, -1, -1, -1, -1, -1, -1, 250, -1, -1, 251, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 404, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 405, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 406, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 407, 408, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 174, -1, -1, -1, -1, -1, -1, -1, 99, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 175, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 254, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 255, -1, -1, 409, -1, -1, -1, 100, -1, -1, -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 176, 410, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 177, -1, -1, -1, -1, -1, -1, -1, 101, 257, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 411, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 178, -1, -1, -1, -1, 412, -1, -1, -1, -1, -1, -1, -1, -1, -1, 102, -1, -1, 258, -1, -1, 413, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 259, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, -1, -1, -1, 260, -1, 261, -1, 262, -1, 263, -1, 264, -1, -1, -1, 265, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 266, -1, 267, -1, 268, 269, -1, -1, 270, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, 272, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 273, 274, -1, -1, -1, -1, -1, -1, 275, 276, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, 104, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 277, 278, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 279, 280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { 105, 106, 281, 282, 283, 284, 285, 286, 107, 108, 287, 288, 289, 290, 291, 292, 109, 110, -1, -1, -1, -1, -1, -1, 111, 112, -1, -1, -1, -1, -1, -1, 113, 114, 293, 294, 295, 296, 297, 298, 115, 116, 299, 300, 301, 302, 303, 304, 117, 118, -1, -1, -1, -1, -1, -1, 119, 120, -1, -1, -1, -1, -1, -1, 121, 122, -1, -1, -1, -1, -1, -1, 123, 124, -1, -1, -1, -1, -1, -1, 125, 126, -1, -1, -1, -1, -1, -1, -1, 127, -1, -1, -1, -1, -1, -1, 128, 129, 305, 306, 307, 308, 309, 310, 130, 131, 311, 312, 313, 314, 315, 316, 317, -1, -1, -1, 318, -1, -1, -1, -1, -1, -1, -1, 319, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 320, -1, -1, -1, -1, -1, -1, -1, -1, 132, -1, -1, -1, -1, -1, -1, 321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 322, -1, -1, -1, -1, -1, -1, -1, 133, -1, }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 323, -1, 324, -1, 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, -1, 327, -1, 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, -1, 329, -1, -1, -1, -1, 330, -1, -1, 331, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 332, -1, 333, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 334, -1, -1, -1, -1, -1, -1, 335, -1, 336, -1, -1, 337, -1, -1, -1, -1, 338, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 339, -1, -1, 340, 341, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 342, 343, -1, -1, 344, 345, -1, -1, 346, 347, 348, 349, -1, -1, -1, -1, 350, 351, -1, -1, 352, 353, -1, -1, -1, -1, -1, -1, -1, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 356, -1, -1, -1, -1, -1, 357, 358, -1, 359, -1, -1, -1, -1, -1, -1, 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 364, -1, -1, -1, -1, 365, -1, 366, -1, 367, -1, 368, -1, 369, -1, 370, -1, 371, -1, 372, -1, 373, -1, 374, -1, 375, -1, 376, -1, -1, 377, -1, 378, -1, 379, -1, -1, -1, -1, -1, -1, 134, -1, -1, 135, -1, -1, 136, -1, -1, 137, -1, -1, 138, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 179, 180, -1, -1, 380, -1, -1, -1, -1, -1, -1, -1, -1, 381, -1, -1, -1, -1, 382, -1, 383, -1, 384, -1, 385, -1, 386, -1, 387, -1, 388, -1, 389, -1, 390, -1, 391, -1, 392, -1, 393, -1, -1, 394, -1, 395, -1, 396, -1, -1, -1, -1, -1, -1, 139, -1, -1, 140, -1, -1, 141, -1, -1, 142, -1, -1, 143, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, 399, 400, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 401, -1, -1, }, }; } }smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/PunycodeException.cs0000644000175000017500000000256412204443225024015 0ustar00meebeymeebey00000000000000/// Copyright (C) 2004 Free Software Foundation, Inc. /// * /// Author: Alexander Gnauck AG-Software, mailto:gnauck@ag-software.de /// * /// This file is part of GNU Libidn. /// * /// This library is free software; you can redistribute it and/or /// modify it under the terms of the GNU Lesser General Public License /// as published by the Free Software Foundation; either version 2.1 of /// the License, or (at your option) any later version. /// * /// This library is distributed in the hope that it will be useful, but /// WITHOUT ANY WARRANTY; without even the implied warranty of /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU /// Lesser General Public License for more details. /// * /// You should have received a copy of the GNU Lesser General Public /// License along with this library; if not, write to the Free Software /// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 /// USA /// using System; namespace agsXMPP.Idn { public class PunycodeException : Exception { public static string OVERFLOW = "Overflow."; public static string BAD_INPUT = "Bad input."; /// /// Creates a new PunycodeException. /// /// message public PunycodeException(string message) : base(message) { } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/DecompositionMappings.cs0000644000175000017500000017111012204443225024655 0ustar00meebeymeebey00000000000000// Do not edit !!! // this file is generated automatically namespace agsXMPP.Idn { public class DecompositionMappings { public static readonly string[] m = new string[] { "\u0020", "\u0020\u0308", "\u0061", "\u0020\u0304", "\u0032", "\u0033", "\u0020\u0301", "\u03BC", "\u0020\u0327", "\u0031", "\u006F", "\u0031\u2044\u0034", "\u0031\u2044\u0032", "\u0033\u2044\u0034", "\u0041\u0300", "\u0041\u0301", "\u0041\u0302", "\u0041\u0303", "\u0041\u0308", "\u0041\u030A", "\u0043\u0327", "\u0045\u0300", "\u0045\u0301", "\u0045\u0302", "\u0045\u0308", "\u0049\u0300", "\u0049\u0301", "\u0049\u0302", "\u0049\u0308", "\u004E\u0303", "\u004F\u0300", "\u004F\u0301", "\u004F\u0302", "\u004F\u0303", "\u004F\u0308", "\u0055\u0300", "\u0055\u0301", "\u0055\u0302", "\u0055\u0308", "\u0059\u0301", "\u0061\u0300", "\u0061\u0301", "\u0061\u0302", "\u0061\u0303", "\u0061\u0308", "\u0061\u030A", "\u0063\u0327", "\u0065\u0300", "\u0065\u0301", "\u0065\u0302", "\u0065\u0308", "\u0069\u0300", "\u0069\u0301", "\u0069\u0302", "\u0069\u0308", "\u006E\u0303", "\u006F\u0300", "\u006F\u0301", "\u006F\u0302", "\u006F\u0303", "\u006F\u0308", "\u0075\u0300", "\u0075\u0301", "\u0075\u0302", "\u0075\u0308", "\u0079\u0301", "\u0079\u0308", "\u0041\u0304", "\u0061\u0304", "\u0041\u0306", "\u0061\u0306", "\u0041\u0328", "\u0061\u0328", "\u0043\u0301", "\u0063\u0301", "\u0043\u0302", "\u0063\u0302", "\u0043\u0307", "\u0063\u0307", "\u0043\u030C", "\u0063\u030C", "\u0044\u030C", "\u0064\u030C", "\u0045\u0304", "\u0065\u0304", "\u0045\u0306", "\u0065\u0306", "\u0045\u0307", "\u0065\u0307", "\u0045\u0328", "\u0065\u0328", "\u0045\u030C", "\u0065\u030C", "\u0047\u0302", "\u0067\u0302", "\u0047\u0306", "\u0067\u0306", "\u0047\u0307", "\u0067\u0307", "\u0047\u0327", "\u0067\u0327", "\u0048\u0302", "\u0068\u0302", "\u0049\u0303", "\u0069\u0303", "\u0049\u0304", "\u0069\u0304", "\u0049\u0306", "\u0069\u0306", "\u0049\u0328", "\u0069\u0328", "\u0049\u0307", "\u0049\u004A", "\u0069\u006A", "\u004A\u0302", "\u006A\u0302", "\u004B\u0327", "\u006B\u0327", "\u004C\u0301", "\u006C\u0301", "\u004C\u0327", "\u006C\u0327", "\u004C\u030C", "\u006C\u030C", "\u004C\u00B7", "\u006C\u00B7", "\u004E\u0301", "\u006E\u0301", "\u004E\u0327", "\u006E\u0327", "\u004E\u030C", "\u006E\u030C", "\u02BC\u006E", "\u004F\u0304", "\u006F\u0304", "\u004F\u0306", "\u006F\u0306", "\u004F\u030B", "\u006F\u030B", "\u0052\u0301", "\u0072\u0301", "\u0052\u0327", "\u0072\u0327", "\u0052\u030C", "\u0072\u030C", "\u0053\u0301", "\u0073\u0301", "\u0053\u0302", "\u0073\u0302", "\u0053\u0327", "\u0073\u0327", "\u0053\u030C", "\u0073\u030C", "\u0054\u0327", "\u0074\u0327", "\u0054\u030C", "\u0074\u030C", "\u0055\u0303", "\u0075\u0303", "\u0055\u0304", "\u0075\u0304", "\u0055\u0306", "\u0075\u0306", "\u0055\u030A", "\u0075\u030A", "\u0055\u030B", "\u0075\u030B", "\u0055\u0328", "\u0075\u0328", "\u0057\u0302", "\u0077\u0302", "\u0059\u0302", "\u0079\u0302", "\u0059\u0308", "\u005A\u0301", "\u007A\u0301", "\u005A\u0307", "\u007A\u0307", "\u005A\u030C", "\u007A\u030C", "\u0073", "\u004F\u031B", "\u006F\u031B", "\u0055\u031B", "\u0075\u031B", "\u0044\u005A\u030C", "\u0044\u007A\u030C", "\u0064\u007A\u030C", "\u004C\u004A", "\u004C\u006A", "\u006C\u006A", "\u004E\u004A", "\u004E\u006A", "\u006E\u006A", "\u0041\u030C", "\u0061\u030C", "\u0049\u030C", "\u0069\u030C", "\u004F\u030C", "\u006F\u030C", "\u0055\u030C", "\u0075\u030C", "\u0055\u0308\u0304", "\u0075\u0308\u0304", "\u0055\u0308\u0301", "\u0075\u0308\u0301", "\u0055\u0308\u030C", "\u0075\u0308\u030C", "\u0055\u0308\u0300", "\u0075\u0308\u0300", "\u0041\u0308\u0304", "\u0061\u0308\u0304", "\u0041\u0307\u0304", "\u0061\u0307\u0304", "\u00C6\u0304", "\u00E6\u0304", "\u0047\u030C", "\u0067\u030C", "\u004B\u030C", "\u006B\u030C", "\u004F\u0328", "\u006F\u0328", "\u004F\u0328\u0304", "\u006F\u0328\u0304", "\u01B7\u030C", "\u0292\u030C", "\u006A\u030C", "\u0044\u005A", "\u0044\u007A", "\u0064\u007A", "\u0047\u0301", "\u0067\u0301", "\u004E\u0300", "\u006E\u0300", "\u0041\u030A\u0301", "\u0061\u030A\u0301", "\u00C6\u0301", "\u00E6\u0301", "\u00D8\u0301", "\u00F8\u0301", "\u0041\u030F", "\u0061\u030F", "\u0041\u0311", "\u0061\u0311", "\u0045\u030F", "\u0065\u030F", "\u0045\u0311", "\u0065\u0311", "\u0049\u030F", "\u0069\u030F", "\u0049\u0311", "\u0069\u0311", "\u004F\u030F", "\u006F\u030F", "\u004F\u0311", "\u006F\u0311", "\u0052\u030F", "\u0072\u030F", "\u0052\u0311", "\u0072\u0311", "\u0055\u030F", "\u0075\u030F", "\u0055\u0311", "\u0075\u0311", "\u0053\u0326", "\u0073\u0326", "\u0054\u0326", "\u0074\u0326", "\u0048\u030C", "\u0068\u030C", "\u0041\u0307", "\u0061\u0307", "\u0045\u0327", "\u0065\u0327", "\u004F\u0308\u0304", "\u006F\u0308\u0304", "\u004F\u0303\u0304", "\u006F\u0303\u0304", "\u004F\u0307", "\u006F\u0307", "\u004F\u0307\u0304", "\u006F\u0307\u0304", "\u0059\u0304", "\u0079\u0304", "\u0068", "\u0266", "\u006A", "\u0072", "\u0279", "\u027B", "\u0281", "\u0077", "\u0079", "\u0020\u0306", "\u0020\u0307", "\u0020\u030A", "\u0020\u0328", "\u0020\u0303", "\u0020\u030B", "\u0263", "\u006C", "\u0078", "\u0295", "\u0300", "\u0301", "\u0313", "\u0308\u0301", "\u02B9", "\u0020\u0345", "\u003B", "\u0020\u0308\u0301", "\u0391\u0301", "\u00B7", "\u0395\u0301", "\u0397\u0301", "\u0399\u0301", "\u039F\u0301", "\u03A5\u0301", "\u03A9\u0301", "\u03B9\u0308\u0301", "\u0399\u0308", "\u03A5\u0308", "\u03B1\u0301", "\u03B5\u0301", "\u03B7\u0301", "\u03B9\u0301", "\u03C5\u0308\u0301", "\u03B9\u0308", "\u03C5\u0308", "\u03BF\u0301", "\u03C5\u0301", "\u03C9\u0301", "\u03B2", "\u03B8", "\u03A5", "\u03C6", "\u03C0", "\u03BA", "\u03C1", "\u03C2", "\u0398", "\u03B5", "\u03A3", "\u0415\u0300", "\u0415\u0308", "\u0413\u0301", "\u0406\u0308", "\u041A\u0301", "\u0418\u0300", "\u0423\u0306", "\u0418\u0306", "\u0438\u0306", "\u0435\u0300", "\u0435\u0308", "\u0433\u0301", "\u0456\u0308", "\u043A\u0301", "\u0438\u0300", "\u0443\u0306", "\u0474\u030F", "\u0475\u030F", "\u0416\u0306", "\u0436\u0306", "\u0410\u0306", "\u0430\u0306", "\u0410\u0308", "\u0430\u0308", "\u0415\u0306", "\u0435\u0306", "\u04D8\u0308", "\u04D9\u0308", "\u0416\u0308", "\u0436\u0308", "\u0417\u0308", "\u0437\u0308", "\u0418\u0304", "\u0438\u0304", "\u0418\u0308", "\u0438\u0308", "\u041E\u0308", "\u043E\u0308", "\u04E8\u0308", "\u04E9\u0308", "\u042D\u0308", "\u044D\u0308", "\u0423\u0304", "\u0443\u0304", "\u0423\u0308", "\u0443\u0308", "\u0423\u030B", "\u0443\u030B", "\u0427\u0308", "\u0447\u0308", "\u042B\u0308", "\u044B\u0308", "\u0565\u0582", "\u0627\u0653", "\u0627\u0654", "\u0648\u0654", "\u0627\u0655", "\u064A\u0654", "\u0627\u0674", "\u0648\u0674", "\u06C7\u0674", "\u064A\u0674", "\u06D5\u0654", "\u06C1\u0654", "\u06D2\u0654", "\u0928\u093C", "\u0930\u093C", "\u0933\u093C", "\u0915\u093C", "\u0916\u093C", "\u0917\u093C", "\u091C\u093C", "\u0921\u093C", "\u0922\u093C", "\u092B\u093C", "\u092F\u093C", "\u09C7\u09BE", "\u09C7\u09D7", "\u09A1\u09BC", "\u09A2\u09BC", "\u09AF\u09BC", "\u0A32\u0A3C", "\u0A38\u0A3C", "\u0A16\u0A3C", "\u0A17\u0A3C", "\u0A1C\u0A3C", "\u0A2B\u0A3C", "\u0B47\u0B56", "\u0B47\u0B3E", "\u0B47\u0B57", "\u0B21\u0B3C", "\u0B22\u0B3C", "\u0B92\u0BD7", "\u0BC6\u0BBE", "\u0BC7\u0BBE", "\u0BC6\u0BD7", "\u0C46\u0C56", "\u0CBF\u0CD5", "\u0CC6\u0CD5", "\u0CC6\u0CD6", "\u0CC6\u0CC2", "\u0CC6\u0CC2\u0CD5", "\u0D46\u0D3E", "\u0D47\u0D3E", "\u0D46\u0D57", "\u0DD9\u0DCA", "\u0DD9\u0DCF", "\u0DD9\u0DCF\u0DCA", "\u0DD9\u0DDF", "\u0E4D\u0E32", "\u0ECD\u0EB2", "\u0EAB\u0E99", "\u0EAB\u0EA1", "\u0F0B", "\u0F42\u0FB7", "\u0F4C\u0FB7", "\u0F51\u0FB7", "\u0F56\u0FB7", "\u0F5B\u0FB7", "\u0F40\u0FB5", "\u0F71\u0F72", "\u0F71\u0F74", "\u0FB2\u0F80", "\u0FB2\u0F71\u0F80", "\u0FB3\u0F80", "\u0FB3\u0F71\u0F80", "\u0F71\u0F80", "\u0F92\u0FB7", "\u0F9C\u0FB7", "\u0FA1\u0FB7", "\u0FA6\u0FB7", "\u0FAB\u0FB7", "\u0F90\u0FB5", "\u1025\u102E", "\u10DC", "\u1B05\u1B35", "\u1B07\u1B35", "\u1B09\u1B35", "\u1B0B\u1B35", "\u1B0D\u1B35", "\u1B11\u1B35", "\u1B3A\u1B35", "\u1B3C\u1B35", "\u1B3E\u1B35", "\u1B3F\u1B35", "\u1B42\u1B35", "\u0041", "\u00C6", "\u0042", "\u0044", "\u0045", "\u018E", "\u0047", "\u0048", "\u0049", "\u004A", "\u004B", "\u004C", "\u004D", "\u004E", "\u004F", "\u0222", "\u0050", "\u0052", "\u0054", "\u0055", "\u0057", "\u0250", "\u0251", "\u1D02", "\u0062", "\u0064", "\u0065", "\u0259", "\u025B", "\u025C", "\u0067", "\u006B", "\u006D", "\u014B", "\u0254", "\u1D16", "\u1D17", "\u0070", "\u0074", "\u0075", "\u1D1D", "\u026F", "\u0076", "\u1D25", "\u03B3", "\u03B4", "\u03C7", "\u0069", "\u043D", "\u0252", "\u0063", "\u0255", "\u00F0", "\u0066", "\u025F", "\u0261", "\u0265", "\u0268", "\u0269", "\u026A", "\u1D7B", "\u029D", "\u026D", "\u1D85", "\u029F", "\u0271", "\u0270", "\u0272", "\u0273", "\u0274", "\u0275", "\u0278", "\u0282", "\u0283", "\u01AB", "\u0289", "\u028A", "\u1D1C", "\u028B", "\u028C", "\u007A", "\u0290", "\u0291", "\u0292", "\u0041\u0325", "\u0061\u0325", "\u0042\u0307", "\u0062\u0307", "\u0042\u0323", "\u0062\u0323", "\u0042\u0331", "\u0062\u0331", "\u0043\u0327\u0301", "\u0063\u0327\u0301", "\u0044\u0307", "\u0064\u0307", "\u0044\u0323", "\u0064\u0323", "\u0044\u0331", "\u0064\u0331", "\u0044\u0327", "\u0064\u0327", "\u0044\u032D", "\u0064\u032D", "\u0045\u0304\u0300", "\u0065\u0304\u0300", "\u0045\u0304\u0301", "\u0065\u0304\u0301", "\u0045\u032D", "\u0065\u032D", "\u0045\u0330", "\u0065\u0330", "\u0045\u0327\u0306", "\u0065\u0327\u0306", "\u0046\u0307", "\u0066\u0307", "\u0047\u0304", "\u0067\u0304", "\u0048\u0307", "\u0068\u0307", "\u0048\u0323", "\u0068\u0323", "\u0048\u0308", "\u0068\u0308", "\u0048\u0327", "\u0068\u0327", "\u0048\u032E", "\u0068\u032E", "\u0049\u0330", "\u0069\u0330", "\u0049\u0308\u0301", "\u0069\u0308\u0301", "\u004B\u0301", "\u006B\u0301", "\u004B\u0323", "\u006B\u0323", "\u004B\u0331", "\u006B\u0331", "\u004C\u0323", "\u006C\u0323", "\u004C\u0323\u0304", "\u006C\u0323\u0304", "\u004C\u0331", "\u006C\u0331", "\u004C\u032D", "\u006C\u032D", "\u004D\u0301", "\u006D\u0301", "\u004D\u0307", "\u006D\u0307", "\u004D\u0323", "\u006D\u0323", "\u004E\u0307", "\u006E\u0307", "\u004E\u0323", "\u006E\u0323", "\u004E\u0331", "\u006E\u0331", "\u004E\u032D", "\u006E\u032D", "\u004F\u0303\u0301", "\u006F\u0303\u0301", "\u004F\u0303\u0308", "\u006F\u0303\u0308", "\u004F\u0304\u0300", "\u006F\u0304\u0300", "\u004F\u0304\u0301", "\u006F\u0304\u0301", "\u0050\u0301", "\u0070\u0301", "\u0050\u0307", "\u0070\u0307", "\u0052\u0307", "\u0072\u0307", "\u0052\u0323", "\u0072\u0323", "\u0052\u0323\u0304", "\u0072\u0323\u0304", "\u0052\u0331", "\u0072\u0331", "\u0053\u0307", "\u0073\u0307", "\u0053\u0323", "\u0073\u0323", "\u0053\u0301\u0307", "\u0073\u0301\u0307", "\u0053\u030C\u0307", "\u0073\u030C\u0307", "\u0053\u0323\u0307", "\u0073\u0323\u0307", "\u0054\u0307", "\u0074\u0307", "\u0054\u0323", "\u0074\u0323", "\u0054\u0331", "\u0074\u0331", "\u0054\u032D", "\u0074\u032D", "\u0055\u0324", "\u0075\u0324", "\u0055\u0330", "\u0075\u0330", "\u0055\u032D", "\u0075\u032D", "\u0055\u0303\u0301", "\u0075\u0303\u0301", "\u0055\u0304\u0308", "\u0075\u0304\u0308", "\u0056\u0303", "\u0076\u0303", "\u0056\u0323", "\u0076\u0323", "\u0057\u0300", "\u0077\u0300", "\u0057\u0301", "\u0077\u0301", "\u0057\u0308", "\u0077\u0308", "\u0057\u0307", "\u0077\u0307", "\u0057\u0323", "\u0077\u0323", "\u0058\u0307", "\u0078\u0307", "\u0058\u0308", "\u0078\u0308", "\u0059\u0307", "\u0079\u0307", "\u005A\u0302", "\u007A\u0302", "\u005A\u0323", "\u007A\u0323", "\u005A\u0331", "\u007A\u0331", "\u0068\u0331", "\u0074\u0308", "\u0077\u030A", "\u0079\u030A", "\u0061\u02BE", "\u0041\u0323", "\u0061\u0323", "\u0041\u0309", "\u0061\u0309", "\u0041\u0302\u0301", "\u0061\u0302\u0301", "\u0041\u0302\u0300", "\u0061\u0302\u0300", "\u0041\u0302\u0309", "\u0061\u0302\u0309", "\u0041\u0302\u0303", "\u0061\u0302\u0303", "\u0041\u0323\u0302", "\u0061\u0323\u0302", "\u0041\u0306\u0301", "\u0061\u0306\u0301", "\u0041\u0306\u0300", "\u0061\u0306\u0300", "\u0041\u0306\u0309", "\u0061\u0306\u0309", "\u0041\u0306\u0303", "\u0061\u0306\u0303", "\u0041\u0323\u0306", "\u0061\u0323\u0306", "\u0045\u0323", "\u0065\u0323", "\u0045\u0309", "\u0065\u0309", "\u0045\u0303", "\u0065\u0303", "\u0045\u0302\u0301", "\u0065\u0302\u0301", "\u0045\u0302\u0300", "\u0065\u0302\u0300", "\u0045\u0302\u0309", "\u0065\u0302\u0309", "\u0045\u0302\u0303", "\u0065\u0302\u0303", "\u0045\u0323\u0302", "\u0065\u0323\u0302", "\u0049\u0309", "\u0069\u0309", "\u0049\u0323", "\u0069\u0323", "\u004F\u0323", "\u006F\u0323", "\u004F\u0309", "\u006F\u0309", "\u004F\u0302\u0301", "\u006F\u0302\u0301", "\u004F\u0302\u0300", "\u006F\u0302\u0300", "\u004F\u0302\u0309", "\u006F\u0302\u0309", "\u004F\u0302\u0303", "\u006F\u0302\u0303", "\u004F\u0323\u0302", "\u006F\u0323\u0302", "\u004F\u031B\u0301", "\u006F\u031B\u0301", "\u004F\u031B\u0300", "\u006F\u031B\u0300", "\u004F\u031B\u0309", "\u006F\u031B\u0309", "\u004F\u031B\u0303", "\u006F\u031B\u0303", "\u004F\u031B\u0323", "\u006F\u031B\u0323", "\u0055\u0323", "\u0075\u0323", "\u0055\u0309", "\u0075\u0309", "\u0055\u031B\u0301", "\u0075\u031B\u0301", "\u0055\u031B\u0300", "\u0075\u031B\u0300", "\u0055\u031B\u0309", "\u0075\u031B\u0309", "\u0055\u031B\u0303", "\u0075\u031B\u0303", "\u0055\u031B\u0323", "\u0075\u031B\u0323", "\u0059\u0300", "\u0079\u0300", "\u0059\u0323", "\u0079\u0323", "\u0059\u0309", "\u0079\u0309", "\u0059\u0303", "\u0079\u0303", "\u03B1\u0313", "\u03B1\u0314", "\u03B1\u0313\u0300", "\u03B1\u0314\u0300", "\u03B1\u0313\u0301", "\u03B1\u0314\u0301", "\u03B1\u0313\u0342", "\u03B1\u0314\u0342", "\u0391\u0313", "\u0391\u0314", "\u0391\u0313\u0300", "\u0391\u0314\u0300", "\u0391\u0313\u0301", "\u0391\u0314\u0301", "\u0391\u0313\u0342", "\u0391\u0314\u0342", "\u03B5\u0313", "\u03B5\u0314", "\u03B5\u0313\u0300", "\u03B5\u0314\u0300", "\u03B5\u0313\u0301", "\u03B5\u0314\u0301", "\u0395\u0313", "\u0395\u0314", "\u0395\u0313\u0300", "\u0395\u0314\u0300", "\u0395\u0313\u0301", "\u0395\u0314\u0301", "\u03B7\u0313", "\u03B7\u0314", "\u03B7\u0313\u0300", "\u03B7\u0314\u0300", "\u03B7\u0313\u0301", "\u03B7\u0314\u0301", "\u03B7\u0313\u0342", "\u03B7\u0314\u0342", "\u0397\u0313", "\u0397\u0314", "\u0397\u0313\u0300", "\u0397\u0314\u0300", "\u0397\u0313\u0301", "\u0397\u0314\u0301", "\u0397\u0313\u0342", "\u0397\u0314\u0342", "\u03B9\u0313", "\u03B9\u0314", "\u03B9\u0313\u0300", "\u03B9\u0314\u0300", "\u03B9\u0313\u0301", "\u03B9\u0314\u0301", "\u03B9\u0313\u0342", "\u03B9\u0314\u0342", "\u0399\u0313", "\u0399\u0314", "\u0399\u0313\u0300", "\u0399\u0314\u0300", "\u0399\u0313\u0301", "\u0399\u0314\u0301", "\u0399\u0313\u0342", "\u0399\u0314\u0342", "\u03BF\u0313", "\u03BF\u0314", "\u03BF\u0313\u0300", "\u03BF\u0314\u0300", "\u03BF\u0313\u0301", "\u03BF\u0314\u0301", "\u039F\u0313", "\u039F\u0314", "\u039F\u0313\u0300", "\u039F\u0314\u0300", "\u039F\u0313\u0301", "\u039F\u0314\u0301", "\u03C5\u0313", "\u03C5\u0314", "\u03C5\u0313\u0300", "\u03C5\u0314\u0300", "\u03C5\u0313\u0301", "\u03C5\u0314\u0301", "\u03C5\u0313\u0342", "\u03C5\u0314\u0342", "\u03A5\u0314", "\u03A5\u0314\u0300", "\u03A5\u0314\u0301", "\u03A5\u0314\u0342", "\u03C9\u0313", "\u03C9\u0314", "\u03C9\u0313\u0300", "\u03C9\u0314\u0300", "\u03C9\u0313\u0301", "\u03C9\u0314\u0301", "\u03C9\u0313\u0342", "\u03C9\u0314\u0342", "\u03A9\u0313", "\u03A9\u0314", "\u03A9\u0313\u0300", "\u03A9\u0314\u0300", "\u03A9\u0313\u0301", "\u03A9\u0314\u0301", "\u03A9\u0313\u0342", "\u03A9\u0314\u0342", "\u03B1\u0300", "\u03B5\u0300", "\u03B7\u0300", "\u03B9\u0300", "\u03BF\u0300", "\u03C5\u0300", "\u03C9\u0300", "\u03B1\u0313\u0345", "\u03B1\u0314\u0345", "\u03B1\u0313\u0300\u0345", "\u03B1\u0314\u0300\u0345", "\u03B1\u0313\u0301\u0345", "\u03B1\u0314\u0301\u0345", "\u03B1\u0313\u0342\u0345", "\u03B1\u0314\u0342\u0345", "\u0391\u0313\u0345", "\u0391\u0314\u0345", "\u0391\u0313\u0300\u0345", "\u0391\u0314\u0300\u0345", "\u0391\u0313\u0301\u0345", "\u0391\u0314\u0301\u0345", "\u0391\u0313\u0342\u0345", "\u0391\u0314\u0342\u0345", "\u03B7\u0313\u0345", "\u03B7\u0314\u0345", "\u03B7\u0313\u0300\u0345", "\u03B7\u0314\u0300\u0345", "\u03B7\u0313\u0301\u0345", "\u03B7\u0314\u0301\u0345", "\u03B7\u0313\u0342\u0345", "\u03B7\u0314\u0342\u0345", "\u0397\u0313\u0345", "\u0397\u0314\u0345", "\u0397\u0313\u0300\u0345", "\u0397\u0314\u0300\u0345", "\u0397\u0313\u0301\u0345", "\u0397\u0314\u0301\u0345", "\u0397\u0313\u0342\u0345", "\u0397\u0314\u0342\u0345", "\u03C9\u0313\u0345", "\u03C9\u0314\u0345", "\u03C9\u0313\u0300\u0345", "\u03C9\u0314\u0300\u0345", "\u03C9\u0313\u0301\u0345", "\u03C9\u0314\u0301\u0345", "\u03C9\u0313\u0342\u0345", "\u03C9\u0314\u0342\u0345", "\u03A9\u0313\u0345", "\u03A9\u0314\u0345", "\u03A9\u0313\u0300\u0345", "\u03A9\u0314\u0300\u0345", "\u03A9\u0313\u0301\u0345", "\u03A9\u0314\u0301\u0345", "\u03A9\u0313\u0342\u0345", "\u03A9\u0314\u0342\u0345", "\u03B1\u0306", "\u03B1\u0304", "\u03B1\u0300\u0345", "\u03B1\u0345", "\u03B1\u0301\u0345", "\u03B1\u0342", "\u03B1\u0342\u0345", "\u0391\u0306", "\u0391\u0304", "\u0391\u0300", "\u0391\u0345", "\u0020\u0313", "\u03B9", "\u0020\u0342", "\u0020\u0308\u0342", "\u03B7\u0300\u0345", "\u03B7\u0345", "\u03B7\u0301\u0345", "\u03B7\u0342", "\u03B7\u0342\u0345", "\u0395\u0300", "\u0397\u0300", "\u0397\u0345", "\u0020\u0313\u0300", "\u0020\u0313\u0301", "\u0020\u0313\u0342", "\u03B9\u0306", "\u03B9\u0304", "\u03B9\u0308\u0300", "\u03B9\u0342", "\u03B9\u0308\u0342", "\u0399\u0306", "\u0399\u0304", "\u0399\u0300", "\u0020\u0314\u0300", "\u0020\u0314\u0301", "\u0020\u0314\u0342", "\u03C5\u0306", "\u03C5\u0304", "\u03C5\u0308\u0300", "\u03C1\u0313", "\u03C1\u0314", "\u03C5\u0342", "\u03C5\u0308\u0342", "\u03A5\u0306", "\u03A5\u0304", "\u03A5\u0300", "\u03A1\u0314", "\u0020\u0308\u0300", "\u0060", "\u03C9\u0300\u0345", "\u03C9\u0345", "\u03C9\u0301\u0345", "\u03C9\u0342", "\u03C9\u0342\u0345", "\u039F\u0300", "\u03A9\u0300", "\u03A9\u0345", "\u0020\u0314", "\u2010", "\u0020\u0333", "\u002E", "\u002E\u002E", "\u002E\u002E\u002E", "\u2032\u2032", "\u2032\u2032\u2032", "\u2035\u2035", "\u2035\u2035\u2035", "\u0021\u0021", "\u0020\u0305", "\u003F\u003F", "\u003F\u0021", "\u0021\u003F", "\u2032\u2032\u2032\u2032", "\u0030", "\u0034", "\u0035", "\u0036", "\u0037", "\u0038", "\u0039", "\u002B", "\u2212", "\u003D", "\u0028", "\u0029", "\u006E", "\u0052\u0073", "\u0061\u002F\u0063", "\u0061\u002F\u0073", "\u0043", "\u00B0\u0043", "\u0063\u002F\u006F", "\u0063\u002F\u0075", "\u0190", "\u00B0\u0046", "\u0127", "\u004E\u006F", "\u0051", "\u0053\u004D", "\u0054\u0045\u004C", "\u0054\u004D", "\u005A", "\u03A9", "\u0046", "\u05D0", "\u05D1", "\u05D2", "\u05D3", "\u0046\u0041\u0058", "\u0393", "\u03A0", "\u2211", "\u0031\u2044\u0033", "\u0032\u2044\u0033", "\u0031\u2044\u0035", "\u0032\u2044\u0035", "\u0033\u2044\u0035", "\u0034\u2044\u0035", "\u0031\u2044\u0036", "\u0035\u2044\u0036", "\u0031\u2044\u0038", "\u0033\u2044\u0038", "\u0035\u2044\u0038", "\u0037\u2044\u0038", "\u0031\u2044", "\u0049\u0049", "\u0049\u0049\u0049", "\u0049\u0056", "\u0056", "\u0056\u0049", "\u0056\u0049\u0049", "\u0056\u0049\u0049\u0049", "\u0049\u0058", "\u0058", "\u0058\u0049", "\u0058\u0049\u0049", "\u0069\u0069", "\u0069\u0069\u0069", "\u0069\u0076", "\u0076\u0069", "\u0076\u0069\u0069", "\u0076\u0069\u0069\u0069", "\u0069\u0078", "\u0078\u0069", "\u0078\u0069\u0069", "\u2190\u0338", "\u2192\u0338", "\u2194\u0338", "\u21D0\u0338", "\u21D4\u0338", "\u21D2\u0338", "\u2203\u0338", "\u2208\u0338", "\u220B\u0338", "\u2223\u0338", "\u2225\u0338", "\u222B\u222B", "\u222B\u222B\u222B", "\u222E\u222E", "\u222E\u222E\u222E", "\u223C\u0338", "\u2243\u0338", "\u2245\u0338", "\u2248\u0338", "\u003D\u0338", "\u2261\u0338", "\u224D\u0338", "\u003C\u0338", "\u003E\u0338", "\u2264\u0338", "\u2265\u0338", "\u2272\u0338", "\u2273\u0338", "\u2276\u0338", "\u2277\u0338", "\u227A\u0338", "\u227B\u0338", "\u2282\u0338", "\u2283\u0338", "\u2286\u0338", "\u2287\u0338", "\u22A2\u0338", "\u22A8\u0338", "\u22A9\u0338", "\u22AB\u0338", "\u227C\u0338", "\u227D\u0338", "\u2291\u0338", "\u2292\u0338", "\u22B2\u0338", "\u22B3\u0338", "\u22B4\u0338", "\u22B5\u0338", "\u3008", "\u3009", "\u0031\u0030", "\u0031\u0031", "\u0031\u0032", "\u0031\u0033", "\u0031\u0034", "\u0031\u0035", "\u0031\u0036", "\u0031\u0037", "\u0031\u0038", "\u0031\u0039", "\u0032\u0030", "\u0028\u0031\u0029", "\u0028\u0032\u0029", "\u0028\u0033\u0029", "\u0028\u0034\u0029", "\u0028\u0035\u0029", "\u0028\u0036\u0029", "\u0028\u0037\u0029", "\u0028\u0038\u0029", "\u0028\u0039\u0029", "\u0028\u0031\u0030\u0029", "\u0028\u0031\u0031\u0029", "\u0028\u0031\u0032\u0029", "\u0028\u0031\u0033\u0029", "\u0028\u0031\u0034\u0029", "\u0028\u0031\u0035\u0029", "\u0028\u0031\u0036\u0029", "\u0028\u0031\u0037\u0029", "\u0028\u0031\u0038\u0029", "\u0028\u0031\u0039\u0029", "\u0028\u0032\u0030\u0029", "\u0031\u002E", "\u0032\u002E", "\u0033\u002E", "\u0034\u002E", "\u0035\u002E", "\u0036\u002E", "\u0037\u002E", "\u0038\u002E", "\u0039\u002E", "\u0031\u0030\u002E", "\u0031\u0031\u002E", "\u0031\u0032\u002E", "\u0031\u0033\u002E", "\u0031\u0034\u002E", "\u0031\u0035\u002E", "\u0031\u0036\u002E", "\u0031\u0037\u002E", "\u0031\u0038\u002E", "\u0031\u0039\u002E", "\u0032\u0030\u002E", "\u0028\u0061\u0029", "\u0028\u0062\u0029", "\u0028\u0063\u0029", "\u0028\u0064\u0029", "\u0028\u0065\u0029", "\u0028\u0066\u0029", "\u0028\u0067\u0029", "\u0028\u0068\u0029", "\u0028\u0069\u0029", "\u0028\u006A\u0029", "\u0028\u006B\u0029", "\u0028\u006C\u0029", "\u0028\u006D\u0029", "\u0028\u006E\u0029", "\u0028\u006F\u0029", "\u0028\u0070\u0029", "\u0028\u0071\u0029", "\u0028\u0072\u0029", "\u0028\u0073\u0029", "\u0028\u0074\u0029", "\u0028\u0075\u0029", "\u0028\u0076\u0029", "\u0028\u0077\u0029", "\u0028\u0078\u0029", "\u0028\u0079\u0029", "\u0028\u007A\u0029", "\u0053", "\u0059", "\u0071", "\u222B\u222B\u222B\u222B", "\u003A\u003A\u003D", "\u003D\u003D", "\u003D\u003D\u003D", "\u2ADD\u0338", "\u2D61", "\u6BCD", "\u9F9F", "\u4E00", "\u4E28", "\u4E36", "\u4E3F", "\u4E59", "\u4E85", "\u4E8C", "\u4EA0", "\u4EBA", "\u513F", "\u5165", "\u516B", "\u5182", "\u5196", "\u51AB", "\u51E0", "\u51F5", "\u5200", "\u529B", "\u52F9", "\u5315", "\u531A", "\u5338", "\u5341", "\u535C", "\u5369", "\u5382", "\u53B6", "\u53C8", "\u53E3", "\u56D7", "\u571F", "\u58EB", "\u5902", "\u590A", "\u5915", "\u5927", "\u5973", "\u5B50", "\u5B80", "\u5BF8", "\u5C0F", "\u5C22", "\u5C38", "\u5C6E", "\u5C71", "\u5DDB", "\u5DE5", "\u5DF1", "\u5DFE", "\u5E72", "\u5E7A", "\u5E7F", "\u5EF4", "\u5EFE", "\u5F0B", "\u5F13", "\u5F50", "\u5F61", "\u5F73", "\u5FC3", "\u6208", "\u6236", "\u624B", "\u652F", "\u6534", "\u6587", "\u6597", "\u65A4", "\u65B9", "\u65E0", "\u65E5", "\u66F0", "\u6708", "\u6728", "\u6B20", "\u6B62", "\u6B79", "\u6BB3", "\u6BCB", "\u6BD4", "\u6BDB", "\u6C0F", "\u6C14", "\u6C34", "\u706B", "\u722A", "\u7236", "\u723B", "\u723F", "\u7247", "\u7259", "\u725B", "\u72AC", "\u7384", "\u7389", "\u74DC", "\u74E6", "\u7518", "\u751F", "\u7528", "\u7530", "\u758B", "\u7592", "\u7676", "\u767D", "\u76AE", "\u76BF", "\u76EE", "\u77DB", "\u77E2", "\u77F3", "\u793A", "\u79B8", "\u79BE", "\u7A74", "\u7ACB", "\u7AF9", "\u7C73", "\u7CF8", "\u7F36", "\u7F51", "\u7F8A", "\u7FBD", "\u8001", "\u800C", "\u8012", "\u8033", "\u807F", "\u8089", "\u81E3", "\u81EA", "\u81F3", "\u81FC", "\u820C", "\u821B", "\u821F", "\u826E", "\u8272", "\u8278", "\u864D", "\u866B", "\u8840", "\u884C", "\u8863", "\u897E", "\u898B", "\u89D2", "\u8A00", "\u8C37", "\u8C46", "\u8C55", "\u8C78", "\u8C9D", "\u8D64", "\u8D70", "\u8DB3", "\u8EAB", "\u8ECA", "\u8F9B", "\u8FB0", "\u8FB5", "\u9091", "\u9149", "\u91C6", "\u91CC", "\u91D1", "\u9577", "\u9580", "\u961C", "\u96B6", "\u96B9", "\u96E8", "\u9751", "\u975E", "\u9762", "\u9769", "\u97CB", "\u97ED", "\u97F3", "\u9801", "\u98A8", "\u98DB", "\u98DF", "\u9996", "\u9999", "\u99AC", "\u9AA8", "\u9AD8", "\u9ADF", "\u9B25", "\u9B2F", "\u9B32", "\u9B3C", "\u9B5A", "\u9CE5", "\u9E75", "\u9E7F", "\u9EA5", "\u9EBB", "\u9EC3", "\u9ECD", "\u9ED1", "\u9EF9", "\u9EFD", "\u9F0E", "\u9F13", "\u9F20", "\u9F3B", "\u9F4A", "\u9F52", "\u9F8D", "\u9F9C", "\u9FA0", "\u3012", "\u5344", "\u5345", "\u304B\u3099", "\u304D\u3099", "\u304F\u3099", "\u3051\u3099", "\u3053\u3099", "\u3055\u3099", "\u3057\u3099", "\u3059\u3099", "\u305B\u3099", "\u305D\u3099", "\u305F\u3099", "\u3061\u3099", "\u3064\u3099", "\u3066\u3099", "\u3068\u3099", "\u306F\u3099", "\u306F\u309A", "\u3072\u3099", "\u3072\u309A", "\u3075\u3099", "\u3075\u309A", "\u3078\u3099", "\u3078\u309A", "\u307B\u3099", "\u307B\u309A", "\u3046\u3099", "\u0020\u3099", "\u0020\u309A", "\u309D\u3099", "\u3088\u308A", "\u30AB\u3099", "\u30AD\u3099", "\u30AF\u3099", "\u30B1\u3099", "\u30B3\u3099", "\u30B5\u3099", "\u30B7\u3099", "\u30B9\u3099", "\u30BB\u3099", "\u30BD\u3099", "\u30BF\u3099", "\u30C1\u3099", "\u30C4\u3099", "\u30C6\u3099", "\u30C8\u3099", "\u30CF\u3099", "\u30CF\u309A", "\u30D2\u3099", "\u30D2\u309A", "\u30D5\u3099", "\u30D5\u309A", "\u30D8\u3099", "\u30D8\u309A", "\u30DB\u3099", "\u30DB\u309A", "\u30A6\u3099", "\u30EF\u3099", "\u30F0\u3099", "\u30F1\u3099", "\u30F2\u3099", "\u30FD\u3099", "\u30B3\u30C8", "\u1100", "\u1101", "\u11AA", "\u1102", "\u11AC", "\u11AD", "\u1103", "\u1104", "\u1105", "\u11B0", "\u11B1", "\u11B2", "\u11B3", "\u11B4", "\u11B5", "\u111A", "\u1106", "\u1107", "\u1108", "\u1121", "\u1109", "\u110A", "\u110B", "\u110C", "\u110D", "\u110E", "\u110F", "\u1110", "\u1111", "\u1112", "\u1161", "\u1162", "\u1163", "\u1164", "\u1165", "\u1166", "\u1167", "\u1168", "\u1169", "\u116A", "\u116B", "\u116C", "\u116D", "\u116E", "\u116F", "\u1170", "\u1171", "\u1172", "\u1173", "\u1174", "\u1175", "\u1160", "\u1114", "\u1115", "\u11C7", "\u11C8", "\u11CC", "\u11CE", "\u11D3", "\u11D7", "\u11D9", "\u111C", "\u11DD", "\u11DF", "\u111D", "\u111E", "\u1120", "\u1122", "\u1123", "\u1127", "\u1129", "\u112B", "\u112C", "\u112D", "\u112E", "\u112F", "\u1132", "\u1136", "\u1140", "\u1147", "\u114C", "\u11F1", "\u11F2", "\u1157", "\u1158", "\u1159", "\u1184", "\u1185", "\u1188", "\u1191", "\u1192", "\u1194", "\u119E", "\u11A1", "\u4E09", "\u56DB", "\u4E0A", "\u4E2D", "\u4E0B", "\u7532", "\u4E19", "\u4E01", "\u5929", "\u5730", "\u0028\u1100\u0029", "\u0028\u1102\u0029", "\u0028\u1103\u0029", "\u0028\u1105\u0029", "\u0028\u1106\u0029", "\u0028\u1107\u0029", "\u0028\u1109\u0029", "\u0028\u110B\u0029", "\u0028\u110C\u0029", "\u0028\u110E\u0029", "\u0028\u110F\u0029", "\u0028\u1110\u0029", "\u0028\u1111\u0029", "\u0028\u1112\u0029", "\u0028\u1100\u1161\u0029", "\u0028\u1102\u1161\u0029", "\u0028\u1103\u1161\u0029", "\u0028\u1105\u1161\u0029", "\u0028\u1106\u1161\u0029", "\u0028\u1107\u1161\u0029", "\u0028\u1109\u1161\u0029", "\u0028\u110B\u1161\u0029", "\u0028\u110C\u1161\u0029", "\u0028\u110E\u1161\u0029", "\u0028\u110F\u1161\u0029", "\u0028\u1110\u1161\u0029", "\u0028\u1111\u1161\u0029", "\u0028\u1112\u1161\u0029", "\u0028\u110C\u116E\u0029", "\u0028\u110B\u1169\u110C\u1165\u11AB\u0029", "\u0028\u110B\u1169\u1112\u116E\u0029", "\u0028\u4E00\u0029", "\u0028\u4E8C\u0029", "\u0028\u4E09\u0029", "\u0028\u56DB\u0029", "\u0028\u4E94\u0029", "\u0028\u516D\u0029", "\u0028\u4E03\u0029", "\u0028\u516B\u0029", "\u0028\u4E5D\u0029", "\u0028\u5341\u0029", "\u0028\u6708\u0029", "\u0028\u706B\u0029", "\u0028\u6C34\u0029", "\u0028\u6728\u0029", "\u0028\u91D1\u0029", "\u0028\u571F\u0029", "\u0028\u65E5\u0029", "\u0028\u682A\u0029", "\u0028\u6709\u0029", "\u0028\u793E\u0029", "\u0028\u540D\u0029", "\u0028\u7279\u0029", "\u0028\u8CA1\u0029", "\u0028\u795D\u0029", "\u0028\u52B4\u0029", "\u0028\u4EE3\u0029", "\u0028\u547C\u0029", "\u0028\u5B66\u0029", "\u0028\u76E3\u0029", "\u0028\u4F01\u0029", "\u0028\u8CC7\u0029", "\u0028\u5354\u0029", "\u0028\u796D\u0029", "\u0028\u4F11\u0029", "\u0028\u81EA\u0029", "\u0028\u81F3\u0029", "\u0050\u0054\u0045", "\u0032\u0031", "\u0032\u0032", "\u0032\u0033", "\u0032\u0034", "\u0032\u0035", "\u0032\u0036", "\u0032\u0037", "\u0032\u0038", "\u0032\u0039", "\u0033\u0030", "\u0033\u0031", "\u0033\u0032", "\u0033\u0033", "\u0033\u0034", "\u0033\u0035", "\u1100\u1161", "\u1102\u1161", "\u1103\u1161", "\u1105\u1161", "\u1106\u1161", "\u1107\u1161", "\u1109\u1161", "\u110B\u1161", "\u110C\u1161", "\u110E\u1161", "\u110F\u1161", "\u1110\u1161", "\u1111\u1161", "\u1112\u1161", "\u110E\u1161\u11B7\u1100\u1169", "\u110C\u116E\u110B\u1174", "\u110B\u116E", "\u4E94", "\u516D", "\u4E03", "\u4E5D", "\u682A", "\u6709", "\u793E", "\u540D", "\u7279", "\u8CA1", "\u795D", "\u52B4", "\u79D8", "\u7537", "\u9069", "\u512A", "\u5370", "\u6CE8", "\u9805", "\u4F11", "\u5199", "\u6B63", "\u5DE6", "\u53F3", "\u533B", "\u5B97", "\u5B66", "\u76E3", "\u4F01", "\u8CC7", "\u5354", "\u591C", "\u0033\u0036", "\u0033\u0037", "\u0033\u0038", "\u0033\u0039", "\u0034\u0030", "\u0034\u0031", "\u0034\u0032", "\u0034\u0033", "\u0034\u0034", "\u0034\u0035", "\u0034\u0036", "\u0034\u0037", "\u0034\u0038", "\u0034\u0039", "\u0035\u0030", "\u0031\u6708", "\u0032\u6708", "\u0033\u6708", "\u0034\u6708", "\u0035\u6708", "\u0036\u6708", "\u0037\u6708", "\u0038\u6708", "\u0039\u6708", "\u0031\u0030\u6708", "\u0031\u0031\u6708", "\u0031\u0032\u6708", "\u0048\u0067", "\u0065\u0072\u0067", "\u0065\u0056", "\u004C\u0054\u0044", "\u30A2", "\u30A4", "\u30A6", "\u30A8", "\u30AA", "\u30AB", "\u30AD", "\u30AF", "\u30B1", "\u30B3", "\u30B5", "\u30B7", "\u30B9", "\u30BB", "\u30BD", "\u30BF", "\u30C1", "\u30C4", "\u30C6", "\u30C8", "\u30CA", "\u30CB", "\u30CC", "\u30CD", "\u30CE", "\u30CF", "\u30D2", "\u30D5", "\u30D8", "\u30DB", "\u30DE", "\u30DF", "\u30E0", "\u30E1", "\u30E2", "\u30E4", "\u30E6", "\u30E8", "\u30E9", "\u30EA", "\u30EB", "\u30EC", "\u30ED", "\u30EF", "\u30F0", "\u30F1", "\u30F2", "\u30A2\u30CF\u309A\u30FC\u30C8", "\u30A2\u30EB\u30D5\u30A1", "\u30A2\u30F3\u30D8\u309A\u30A2", "\u30A2\u30FC\u30EB", "\u30A4\u30CB\u30F3\u30AF\u3099", "\u30A4\u30F3\u30C1", "\u30A6\u30A9\u30F3", "\u30A8\u30B9\u30AF\u30FC\u30C8\u3099", "\u30A8\u30FC\u30AB\u30FC", "\u30AA\u30F3\u30B9", "\u30AA\u30FC\u30E0", "\u30AB\u30A4\u30EA", "\u30AB\u30E9\u30C3\u30C8", "\u30AB\u30ED\u30EA\u30FC", "\u30AB\u3099\u30ED\u30F3", "\u30AB\u3099\u30F3\u30DE", "\u30AD\u3099\u30AB\u3099", "\u30AD\u3099\u30CB\u30FC", "\u30AD\u30E5\u30EA\u30FC", "\u30AD\u3099\u30EB\u30BF\u3099\u30FC", "\u30AD\u30ED", "\u30AD\u30ED\u30AF\u3099\u30E9\u30E0", "\u30AD\u30ED\u30E1\u30FC\u30C8\u30EB", "\u30AD\u30ED\u30EF\u30C3\u30C8", "\u30AF\u3099\u30E9\u30E0", "\u30AF\u3099\u30E9\u30E0\u30C8\u30F3", "\u30AF\u30EB\u30BB\u3099\u30A4\u30ED", "\u30AF\u30ED\u30FC\u30CD", "\u30B1\u30FC\u30B9", "\u30B3\u30EB\u30CA", "\u30B3\u30FC\u30DB\u309A", "\u30B5\u30A4\u30AF\u30EB", "\u30B5\u30F3\u30C1\u30FC\u30E0", "\u30B7\u30EA\u30F3\u30AF\u3099", "\u30BB\u30F3\u30C1", "\u30BB\u30F3\u30C8", "\u30BF\u3099\u30FC\u30B9", "\u30C6\u3099\u30B7", "\u30C8\u3099\u30EB", "\u30C8\u30F3", "\u30CA\u30CE", "\u30CE\u30C3\u30C8", "\u30CF\u30A4\u30C4", "\u30CF\u309A\u30FC\u30BB\u30F3\u30C8", "\u30CF\u309A\u30FC\u30C4", "\u30CF\u3099\u30FC\u30EC\u30EB", "\u30D2\u309A\u30A2\u30B9\u30C8\u30EB", "\u30D2\u309A\u30AF\u30EB", "\u30D2\u309A\u30B3", "\u30D2\u3099\u30EB", "\u30D5\u30A1\u30E9\u30C3\u30C8\u3099", "\u30D5\u30A3\u30FC\u30C8", "\u30D5\u3099\u30C3\u30B7\u30A7\u30EB", "\u30D5\u30E9\u30F3", "\u30D8\u30AF\u30BF\u30FC\u30EB", "\u30D8\u309A\u30BD", "\u30D8\u309A\u30CB\u30D2", "\u30D8\u30EB\u30C4", "\u30D8\u309A\u30F3\u30B9", "\u30D8\u309A\u30FC\u30B7\u3099", "\u30D8\u3099\u30FC\u30BF", "\u30DB\u309A\u30A4\u30F3\u30C8", "\u30DB\u3099\u30EB\u30C8", "\u30DB\u30F3", "\u30DB\u309A\u30F3\u30C8\u3099", "\u30DB\u30FC\u30EB", "\u30DB\u30FC\u30F3", "\u30DE\u30A4\u30AF\u30ED", "\u30DE\u30A4\u30EB", "\u30DE\u30C3\u30CF", "\u30DE\u30EB\u30AF", "\u30DE\u30F3\u30B7\u30E7\u30F3", "\u30DF\u30AF\u30ED\u30F3", "\u30DF\u30EA", "\u30DF\u30EA\u30CF\u3099\u30FC\u30EB", "\u30E1\u30AB\u3099", "\u30E1\u30AB\u3099\u30C8\u30F3", "\u30E1\u30FC\u30C8\u30EB", "\u30E4\u30FC\u30C8\u3099", "\u30E4\u30FC\u30EB", "\u30E6\u30A2\u30F3", "\u30EA\u30C3\u30C8\u30EB", "\u30EA\u30E9", "\u30EB\u30D2\u309A\u30FC", "\u30EB\u30FC\u30D5\u3099\u30EB", "\u30EC\u30E0", "\u30EC\u30F3\u30C8\u30B1\u3099\u30F3", "\u30EF\u30C3\u30C8", "\u0030\u70B9", "\u0031\u70B9", "\u0032\u70B9", "\u0033\u70B9", "\u0034\u70B9", "\u0035\u70B9", "\u0036\u70B9", "\u0037\u70B9", "\u0038\u70B9", "\u0039\u70B9", "\u0031\u0030\u70B9", "\u0031\u0031\u70B9", "\u0031\u0032\u70B9", "\u0031\u0033\u70B9", "\u0031\u0034\u70B9", "\u0031\u0035\u70B9", "\u0031\u0036\u70B9", "\u0031\u0037\u70B9", "\u0031\u0038\u70B9", "\u0031\u0039\u70B9", "\u0032\u0030\u70B9", "\u0032\u0031\u70B9", "\u0032\u0032\u70B9", "\u0032\u0033\u70B9", "\u0032\u0034\u70B9", "\u0068\u0050\u0061", "\u0064\u0061", "\u0041\u0055", "\u0062\u0061\u0072", "\u006F\u0056", "\u0070\u0063", "\u0064\u006D", "\u0064\u006D\u0032", "\u0064\u006D\u0033", "\u0049\u0055", "\u5E73\u6210", "\u662D\u548C", "\u5927\u6B63", "\u660E\u6CBB", "\u682A\u5F0F\u4F1A\u793E", "\u0070\u0041", "\u006E\u0041", "\u03BC\u0041", "\u006D\u0041", "\u006B\u0041", "\u004B\u0042", "\u004D\u0042", "\u0047\u0042", "\u0063\u0061\u006C", "\u006B\u0063\u0061\u006C", "\u0070\u0046", "\u006E\u0046", "\u03BC\u0046", "\u03BC\u0067", "\u006D\u0067", "\u006B\u0067", "\u0048\u007A", "\u006B\u0048\u007A", "\u004D\u0048\u007A", "\u0047\u0048\u007A", "\u0054\u0048\u007A", "\u03BC\u006C", "\u006D\u006C", "\u0064\u006C", "\u006B\u006C", "\u0066\u006D", "\u006E\u006D", "\u03BC\u006D", "\u006D\u006D", "\u0063\u006D", "\u006B\u006D", "\u006D\u006D\u0032", "\u0063\u006D\u0032", "\u006D\u0032", "\u006B\u006D\u0032", "\u006D\u006D\u0033", "\u0063\u006D\u0033", "\u006D\u0033", "\u006B\u006D\u0033", "\u006D\u2215\u0073", "\u006D\u2215\u0073\u0032", "\u0050\u0061", "\u006B\u0050\u0061", "\u004D\u0050\u0061", "\u0047\u0050\u0061", "\u0072\u0061\u0064", "\u0072\u0061\u0064\u2215\u0073", "\u0072\u0061\u0064\u2215\u0073\u0032", "\u0070\u0073", "\u006E\u0073", "\u03BC\u0073", "\u006D\u0073", "\u0070\u0056", "\u006E\u0056", "\u03BC\u0056", "\u006D\u0056", "\u006B\u0056", "\u004D\u0056", "\u0070\u0057", "\u006E\u0057", "\u03BC\u0057", "\u006D\u0057", "\u006B\u0057", "\u004D\u0057", "\u006B\u03A9", "\u004D\u03A9", "\u0061\u002E\u006D\u002E", "\u0042\u0071", "\u0063\u0063", "\u0063\u0064", "\u0043\u2215\u006B\u0067", "\u0043\u006F\u002E", "\u0064\u0042", "\u0047\u0079", "\u0068\u0061", "\u0048\u0050", "\u0069\u006E", "\u004B\u004B", "\u004B\u004D", "\u006B\u0074", "\u006C\u006D", "\u006C\u006E", "\u006C\u006F\u0067", "\u006C\u0078", "\u006D\u0062", "\u006D\u0069\u006C", "\u006D\u006F\u006C", "\u0050\u0048", "\u0070\u002E\u006D\u002E", "\u0050\u0050\u004D", "\u0050\u0052", "\u0073\u0072", "\u0053\u0076", "\u0057\u0062", "\u0056\u2215\u006D", "\u0041\u2215\u006D", "\u0031\u65E5", "\u0032\u65E5", "\u0033\u65E5", "\u0034\u65E5", "\u0035\u65E5", "\u0036\u65E5", "\u0037\u65E5", "\u0038\u65E5", "\u0039\u65E5", "\u0031\u0030\u65E5", "\u0031\u0031\u65E5", "\u0031\u0032\u65E5", "\u0031\u0033\u65E5", "\u0031\u0034\u65E5", "\u0031\u0035\u65E5", "\u0031\u0036\u65E5", "\u0031\u0037\u65E5", "\u0031\u0038\u65E5", "\u0031\u0039\u65E5", "\u0032\u0030\u65E5", "\u0032\u0031\u65E5", "\u0032\u0032\u65E5", "\u0032\u0033\u65E5", "\u0032\u0034\u65E5", "\u0032\u0035\u65E5", "\u0032\u0036\u65E5", "\u0032\u0037\u65E5", "\u0032\u0038\u65E5", "\u0032\u0039\u65E5", "\u0033\u0030\u65E5", "\u0033\u0031\u65E5", "\u0067\u0061\u006C", "\uA76F", "\u8C48", "\u66F4", "\u8CC8", "\u6ED1", "\u4E32", "\u53E5", "\u5951", "\u5587", "\u5948", "\u61F6", "\u7669", "\u7F85", "\u863F", "\u87BA", "\u88F8", "\u908F", "\u6A02", "\u6D1B", "\u70D9", "\u73DE", "\u843D", "\u916A", "\u99F1", "\u4E82", "\u5375", "\u6B04", "\u721B", "\u862D", "\u9E1E", "\u5D50", "\u6FEB", "\u85CD", "\u8964", "\u62C9", "\u81D8", "\u881F", "\u5ECA", "\u6717", "\u6D6A", "\u72FC", "\u90CE", "\u4F86", "\u51B7", "\u52DE", "\u64C4", "\u6AD3", "\u7210", "\u76E7", "\u8606", "\u865C", "\u8DEF", "\u9732", "\u9B6F", "\u9DFA", "\u788C", "\u797F", "\u7DA0", "\u83C9", "\u9304", "\u8AD6", "\u58DF", "\u5F04", "\u7C60", "\u807E", "\u7262", "\u78CA", "\u8CC2", "\u96F7", "\u58D8", "\u5C62", "\u6A13", "\u6DDA", "\u6F0F", "\u7D2F", "\u7E37", "\u964B", "\u52D2", "\u808B", "\u51DC", "\u51CC", "\u7A1C", "\u7DBE", "\u83F1", "\u9675", "\u8B80", "\u62CF", "\u8AFE", "\u4E39", "\u5BE7", "\u6012", "\u7387", "\u7570", "\u5317", "\u78FB", "\u4FBF", "\u5FA9", "\u4E0D", "\u6CCC", "\u6578", "\u7D22", "\u53C3", "\u585E", "\u7701", "\u8449", "\u8AAA", "\u6BBA", "\u6C88", "\u62FE", "\u82E5", "\u63A0", "\u7565", "\u4EAE", "\u5169", "\u51C9", "\u6881", "\u7CE7", "\u826F", "\u8AD2", "\u91CF", "\u52F5", "\u5442", "\u5EEC", "\u65C5", "\u6FFE", "\u792A", "\u95AD", "\u9A6A", "\u9E97", "\u9ECE", "\u66C6", "\u6B77", "\u8F62", "\u5E74", "\u6190", "\u6200", "\u649A", "\u6F23", "\u7149", "\u7489", "\u79CA", "\u7DF4", "\u806F", "\u8F26", "\u84EE", "\u9023", "\u934A", "\u5217", "\u52A3", "\u54BD", "\u70C8", "\u88C2", "\u5EC9", "\u5FF5", "\u637B", "\u6BAE", "\u7C3E", "\u7375", "\u4EE4", "\u56F9", "\u5DBA", "\u601C", "\u73B2", "\u7469", "\u7F9A", "\u8046", "\u9234", "\u96F6", "\u9748", "\u9818", "\u4F8B", "\u79AE", "\u91B4", "\u96B8", "\u60E1", "\u4E86", "\u50DA", "\u5BEE", "\u5C3F", "\u6599", "\u71CE", "\u7642", "\u84FC", "\u907C", "\u6688", "\u962E", "\u5289", "\u677B", "\u67F3", "\u6D41", "\u6E9C", "\u7409", "\u7559", "\u786B", "\u7D10", "\u985E", "\u622E", "\u9678", "\u502B", "\u5D19", "\u6DEA", "\u8F2A", "\u5F8B", "\u6144", "\u6817", "\u9686", "\u5229", "\u540F", "\u5C65", "\u6613", "\u674E", "\u68A8", "\u6CE5", "\u7406", "\u75E2", "\u7F79", "\u88CF", "\u88E1", "\u96E2", "\u533F", "\u6EBA", "\u541D", "\u71D0", "\u7498", "\u85FA", "\u96A3", "\u9C57", "\u9E9F", "\u6797", "\u6DCB", "\u81E8", "\u7B20", "\u7C92", "\u72C0", "\u7099", "\u8B58", "\u4EC0", "\u8336", "\u523A", "\u5207", "\u5EA6", "\u62D3", "\u7CD6", "\u5B85", "\u6D1E", "\u66B4", "\u8F3B", "\u964D", "\u5ED3", "\u5140", "\u55C0", "\u585A", "\u6674", "\u51DE", "\u732A", "\u76CA", "\u793C", "\u795E", "\u7965", "\u798F", "\u9756", "\u7CBE", "\u8612", "\u8AF8", "\u9038", "\u90FD", "\u98EF", "\u98FC", "\u9928", "\u9DB4", "\u4FAE", "\u50E7", "\u514D", "\u52C9", "\u52E4", "\u5351", "\u559D", "\u5606", "\u5668", "\u5840", "\u58A8", "\u5C64", "\u6094", "\u6168", "\u618E", "\u61F2", "\u654F", "\u65E2", "\u6691", "\u6885", "\u6D77", "\u6E1A", "\u6F22", "\u716E", "\u722B", "\u7422", "\u7891", "\u7949", "\u7948", "\u7950", "\u7956", "\u798D", "\u798E", "\u7A40", "\u7A81", "\u7BC0", "\u7E09", "\u7E41", "\u7F72", "\u8005", "\u81ED", "\u8279", "\u8457", "\u8910", "\u8996", "\u8B01", "\u8B39", "\u8CD3", "\u8D08", "\u8FB6", "\u96E3", "\u97FF", "\u983B", "\u4E26", "\u51B5", "\u5168", "\u4F80", "\u5145", "\u5180", "\u52C7", "\u52FA", "\u5555", "\u5599", "\u55E2", "\u58B3", "\u5944", "\u5954", "\u5A62", "\u5B28", "\u5ED2", "\u5ED9", "\u5F69", "\u5FAD", "\u60D8", "\u614E", "\u6108", "\u6160", "\u6234", "\u63C4", "\u641C", "\u6452", "\u6556", "\u671B", "\u6756", "\u6EDB", "\u6ECB", "\u701E", "\u77A7", "\u7235", "\u72AF", "\u7471", "\u7506", "\u753B", "\u761D", "\u761F", "\u76DB", "\u76F4", "\u774A", "\u7740", "\u78CC", "\u7AB1", "\u7C7B", "\u7D5B", "\u7F3E", "\u8352", "\u83EF", "\u8779", "\u8941", "\u8986", "\u8ABF", "\u8ACB", "\u8AED", "\u8B8A", "\u8F38", "\u9072", "\u9199", "\u9276", "\u967C", "\u97DB", "\u980B", "\u9B12", "\u2284A", "\u22844", "\u233D5", "\u3B9D", "\u4018", "\u4039", "\u25249", "\u25CD0", "\u27ED3", "\u9F43", "\u9F8E", "\u0066\u0066", "\u0066\u0069", "\u0066\u006C", "\u0066\u0066\u0069", "\u0066\u0066\u006C", "\u0073\u0074", "\u0574\u0576", "\u0574\u0565", "\u0574\u056B", "\u057E\u0576", "\u0574\u056D", "\u05D9\u05B4", "\u05F2\u05B7", "\u05E2", "\u05D4", "\u05DB", "\u05DC", "\u05DD", "\u05E8", "\u05EA", "\u05E9\u05C1", "\u05E9\u05C2", "\u05E9\u05BC\u05C1", "\u05E9\u05BC\u05C2", "\u05D0\u05B7", "\u05D0\u05B8", "\u05D0\u05BC", "\u05D1\u05BC", "\u05D2\u05BC", "\u05D3\u05BC", "\u05D4\u05BC", "\u05D5\u05BC", "\u05D6\u05BC", "\u05D8\u05BC", "\u05D9\u05BC", "\u05DA\u05BC", "\u05DB\u05BC", "\u05DC\u05BC", "\u05DE\u05BC", "\u05E0\u05BC", "\u05E1\u05BC", "\u05E3\u05BC", "\u05E4\u05BC", "\u05E6\u05BC", "\u05E7\u05BC", "\u05E8\u05BC", "\u05E9\u05BC", "\u05EA\u05BC", "\u05D5\u05B9", "\u05D1\u05BF", "\u05DB\u05BF", "\u05E4\u05BF", "\u05D0\u05DC", "\u0671", "\u067B", "\u067E", "\u0680", "\u067A", "\u067F", "\u0679", "\u06A4", "\u06A6", "\u0684", "\u0683", "\u0686", "\u0687", "\u068D", "\u068C", "\u068E", "\u0688", "\u0698", "\u0691", "\u06A9", "\u06AF", "\u06B3", "\u06B1", "\u06BA", "\u06BB", "\u06C1", "\u06BE", "\u06D2", "\u06AD", "\u06C7", "\u06C6", "\u06C8", "\u06CB", "\u06C5", "\u06C9", "\u06D0", "\u0649", "\u064A\u0654\u0627", "\u064A\u0654\u06D5", "\u064A\u0654\u0648", "\u064A\u0654\u06C7", "\u064A\u0654\u06C6", "\u064A\u0654\u06C8", "\u064A\u0654\u06D0", "\u064A\u0654\u0649", "\u06CC", "\u064A\u0654\u062C", "\u064A\u0654\u062D", "\u064A\u0654\u0645", "\u064A\u0654\u064A", "\u0628\u062C", "\u0628\u062D", "\u0628\u062E", "\u0628\u0645", "\u0628\u0649", "\u0628\u064A", "\u062A\u062C", "\u062A\u062D", "\u062A\u062E", "\u062A\u0645", "\u062A\u0649", "\u062A\u064A", "\u062B\u062C", "\u062B\u0645", "\u062B\u0649", "\u062B\u064A", "\u062C\u062D", "\u062C\u0645", "\u062D\u062C", "\u062D\u0645", "\u062E\u062C", "\u062E\u062D", "\u062E\u0645", "\u0633\u062C", "\u0633\u062D", "\u0633\u062E", "\u0633\u0645", "\u0635\u062D", "\u0635\u0645", "\u0636\u062C", "\u0636\u062D", "\u0636\u062E", "\u0636\u0645", "\u0637\u062D", "\u0637\u0645", "\u0638\u0645", "\u0639\u062C", "\u0639\u0645", "\u063A\u062C", "\u063A\u0645", "\u0641\u062C", "\u0641\u062D", "\u0641\u062E", "\u0641\u0645", "\u0641\u0649", "\u0641\u064A", "\u0642\u062D", "\u0642\u0645", "\u0642\u0649", "\u0642\u064A", "\u0643\u0627", "\u0643\u062C", "\u0643\u062D", "\u0643\u062E", "\u0643\u0644", "\u0643\u0645", "\u0643\u0649", "\u0643\u064A", "\u0644\u062C", "\u0644\u062D", "\u0644\u062E", "\u0644\u0645", "\u0644\u0649", "\u0644\u064A", "\u0645\u062C", "\u0645\u062D", "\u0645\u062E", "\u0645\u0645", "\u0645\u0649", "\u0645\u064A", "\u0646\u062C", "\u0646\u062D", "\u0646\u062E", "\u0646\u0645", "\u0646\u0649", "\u0646\u064A", "\u0647\u062C", "\u0647\u0645", "\u0647\u0649", "\u0647\u064A", "\u064A\u062C", "\u064A\u062D", "\u064A\u062E", "\u064A\u0645", "\u064A\u0649", "\u064A\u064A", "\u0630\u0670", "\u0631\u0670", "\u0649\u0670", "\u0020\u064C\u0651", "\u0020\u064D\u0651", "\u0020\u064E\u0651", "\u0020\u064F\u0651", "\u0020\u0650\u0651", "\u0020\u0651\u0670", "\u064A\u0654\u0631", "\u064A\u0654\u0632", "\u064A\u0654\u0646", "\u0628\u0631", "\u0628\u0632", "\u0628\u0646", "\u062A\u0631", "\u062A\u0632", "\u062A\u0646", "\u062B\u0631", "\u062B\u0632", "\u062B\u0646", "\u0645\u0627", "\u0646\u0631", "\u0646\u0632", "\u0646\u0646", "\u064A\u0631", "\u064A\u0632", "\u064A\u0646", "\u064A\u0654\u062E", "\u064A\u0654\u0647", "\u0628\u0647", "\u062A\u0647", "\u0635\u062E", "\u0644\u0647", "\u0646\u0647", "\u0647\u0670", "\u064A\u0647", "\u062B\u0647", "\u0633\u0647", "\u0634\u0645", "\u0634\u0647", "\u0640\u064E\u0651", "\u0640\u064F\u0651", "\u0640\u0650\u0651", "\u0637\u0649", "\u0637\u064A", "\u0639\u0649", "\u0639\u064A", "\u063A\u0649", "\u063A\u064A", "\u0633\u0649", "\u0633\u064A", "\u0634\u0649", "\u0634\u064A", "\u062D\u0649", "\u062D\u064A", "\u062C\u0649", "\u062C\u064A", "\u062E\u0649", "\u062E\u064A", "\u0635\u0649", "\u0635\u064A", "\u0636\u0649", "\u0636\u064A", "\u0634\u062C", "\u0634\u062D", "\u0634\u062E", "\u0634\u0631", "\u0633\u0631", "\u0635\u0631", "\u0636\u0631", "\u0627\u064B", "\u062A\u062C\u0645", "\u062A\u062D\u062C", "\u062A\u062D\u0645", "\u062A\u062E\u0645", "\u062A\u0645\u062C", "\u062A\u0645\u062D", "\u062A\u0645\u062E", "\u062C\u0645\u062D", "\u062D\u0645\u064A", "\u062D\u0645\u0649", "\u0633\u062D\u062C", "\u0633\u062C\u062D", "\u0633\u062C\u0649", "\u0633\u0645\u062D", "\u0633\u0645\u062C", "\u0633\u0645\u0645", "\u0635\u062D\u062D", "\u0635\u0645\u0645", "\u0634\u062D\u0645", "\u0634\u062C\u064A", "\u0634\u0645\u062E", "\u0634\u0645\u0645", "\u0636\u062D\u0649", "\u0636\u062E\u0645", "\u0637\u0645\u062D", "\u0637\u0645\u0645", "\u0637\u0645\u064A", "\u0639\u062C\u0645", "\u0639\u0645\u0645", "\u0639\u0645\u0649", "\u063A\u0645\u0645", "\u063A\u0645\u064A", "\u063A\u0645\u0649", "\u0641\u062E\u0645", "\u0642\u0645\u062D", "\u0642\u0645\u0645", "\u0644\u062D\u0645", "\u0644\u062D\u064A", "\u0644\u062D\u0649", "\u0644\u062C\u062C", "\u0644\u062E\u0645", "\u0644\u0645\u062D", "\u0645\u062D\u062C", "\u0645\u062D\u0645", "\u0645\u062D\u064A", "\u0645\u062C\u062D", "\u0645\u062C\u0645", "\u0645\u062E\u062C", "\u0645\u062E\u0645", "\u0645\u062C\u062E", "\u0647\u0645\u062C", "\u0647\u0645\u0645", "\u0646\u062D\u0645", "\u0646\u062D\u0649", "\u0646\u062C\u0645", "\u0646\u062C\u0649", "\u0646\u0645\u064A", "\u0646\u0645\u0649", "\u064A\u0645\u0645", "\u0628\u062E\u064A", "\u062A\u062C\u064A", "\u062A\u062C\u0649", "\u062A\u062E\u064A", "\u062A\u062E\u0649", "\u062A\u0645\u064A", "\u062A\u0645\u0649", "\u062C\u0645\u064A", "\u062C\u062D\u0649", "\u062C\u0645\u0649", "\u0633\u062E\u0649", "\u0635\u062D\u064A", "\u0634\u062D\u064A", "\u0636\u062D\u064A", "\u0644\u062C\u064A", "\u0644\u0645\u064A", "\u064A\u062D\u064A", "\u064A\u062C\u064A", "\u064A\u0645\u064A", "\u0645\u0645\u064A", "\u0642\u0645\u064A", "\u0646\u062D\u064A", "\u0639\u0645\u064A", "\u0643\u0645\u064A", "\u0646\u062C\u062D", "\u0645\u062E\u064A", "\u0644\u062C\u0645", "\u0643\u0645\u0645", "\u062C\u062D\u064A", "\u062D\u062C\u064A", "\u0645\u062C\u064A", "\u0641\u0645\u064A", "\u0628\u062D\u064A", "\u0633\u062E\u064A", "\u0646\u062C\u064A", "\u0635\u0644\u06D2", "\u0642\u0644\u06D2", "\u0627\u0644\u0644\u0647", "\u0627\u0643\u0628\u0631", "\u0645\u062D\u0645\u062F", "\u0635\u0644\u0639\u0645", "\u0631\u0633\u0648\u0644", "\u0639\u0644\u064A\u0647", "\u0648\u0633\u0644\u0645", "\u0635\u0644\u0649", "\u0635\u0644\u0649\u0020\u0627\u0644\u0644\u0647\u0020\u0639\u0644\u064A\u0647\u0020\u0648\u0633\u0644\u0645", "\u062C\u0644\u0020\u062C\u0644\u0627\u0644\u0647", "\u0631\u06CC\u0627\u0644", "\u002C", "\u3001", "\u3002", "\u003A", "\u0021", "\u003F", "\u3016", "\u3017", "\u2014", "\u2013", "\u005F", "\u007B", "\u007D", "\u3014", "\u3015", "\u3010", "\u3011", "\u300A", "\u300B", "\u300C", "\u300D", "\u300E", "\u300F", "\u005B", "\u005D", "\u0023", "\u0026", "\u002A", "\u002D", "\u003C", "\u003E", "\\", "\u0024", "\u0025", "\u0040", "\u0020\u064B", "\u0640\u064B", "\u0020\u064C", "\u0020\u064D", "\u0020\u064E", "\u0640\u064E", "\u0020\u064F", "\u0640\u064F", "\u0020\u0650", "\u0640\u0650", "\u0020\u0651", "\u0640\u0651", "\u0020\u0652", "\u0640\u0652", "\u0621", "\u0627", "\u0628", "\u0629", "\u062A", "\u062B", "\u062C", "\u062D", "\u062E", "\u062F", "\u0630", "\u0631", "\u0632", "\u0633", "\u0634", "\u0635", "\u0636", "\u0637", "\u0638", "\u0639", "\u063A", "\u0641", "\u0642", "\u0643", "\u0644", "\u0645", "\u0646", "\u0647", "\u0648", "\u064A", "\u0644\u0627\u0653", "\u0644\u0627\u0654", "\u0644\u0627\u0655", "\u0644\u0627", "\"", "\u0027", "\u002F", "\u005E", "\u007C", "\u007E", "\u2985", "\u2986", "\u30FB", "\u30A1", "\u30A3", "\u30A5", "\u30A7", "\u30A9", "\u30E3", "\u30E5", "\u30E7", "\u30C3", "\u30FC", "\u30F3", "\u3099", "\u309A", "\u00A2", "\u00A3", "\u00AC", "\u00A6", "\u00A5", "\u20A9", "\u2502", "\u2190", "\u2191", "\u2192", "\u2193", "\u25A0", "\u25CB", }; } }smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/StringprepException.cs0000644000175000017500000000277212204443225024365 0ustar00meebeymeebey00000000000000/// Copyright (C) 2004 Free Software Foundation, Inc. /// * /// Author: Alexander Gnauck AG-Software, mailto:gnauck@ag-software.de /// * /// This file is part of GNU Libidn. /// * /// This library is free software; you can redistribute it and/or /// modify it under the terms of the GNU Lesser General Public License /// as published by the Free Software Foundation; either version 2.1 of /// the License, or (at your option) any later version. /// * /// This library is distributed in the hope that it will be useful, but /// WITHOUT ANY WARRANTY; without even the implied warranty of /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU /// Lesser General Public License for more details. /// * /// You should have received a copy of the GNU Lesser General Public /// License along with this library; if not, write to the Free Software /// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 /// USA /// using System; namespace agsXMPP.Idn { public class StringprepException : Exception { public static string CONTAINS_UNASSIGNED = "Contains unassigned code points."; public static string CONTAINS_PROHIBITED = "Contains prohibited code points."; public static string BIDI_BOTHRAL = "Contains both R and AL code points."; public static string BIDI_LTRAL = "Leading and trailing code points not both R or AL."; public StringprepException(string message) : base(message) { } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/DecompositionKeys.cs0000644000175000017500000023360112204443225024016 0ustar00meebeymeebey00000000000000// Do not edit !!! // this file is generated automatically namespace agsXMPP.Idn { public class DecompositionKeys { public static readonly int[] k = new int[] { '\u00A0', 0, '\u00A8', 1, '\u00AA', 2, '\u00AF', 3, '\u00B2', 4, '\u00B3', 5, '\u00B4', 6, '\u00B5', 7, '\u00B8', 8, '\u00B9', 9, '\u00BA', 10, '\u00BC', 11, '\u00BD', 12, '\u00BE', 13, '\u00C0', 14, '\u00C1', 15, '\u00C2', 16, '\u00C3', 17, '\u00C4', 18, '\u00C5', 19, '\u00C7', 20, '\u00C8', 21, '\u00C9', 22, '\u00CA', 23, '\u00CB', 24, '\u00CC', 25, '\u00CD', 26, '\u00CE', 27, '\u00CF', 28, '\u00D1', 29, '\u00D2', 30, '\u00D3', 31, '\u00D4', 32, '\u00D5', 33, '\u00D6', 34, '\u00D9', 35, '\u00DA', 36, '\u00DB', 37, '\u00DC', 38, '\u00DD', 39, '\u00E0', 40, '\u00E1', 41, '\u00E2', 42, '\u00E3', 43, '\u00E4', 44, '\u00E5', 45, '\u00E7', 46, '\u00E8', 47, '\u00E9', 48, '\u00EA', 49, '\u00EB', 50, '\u00EC', 51, '\u00ED', 52, '\u00EE', 53, '\u00EF', 54, '\u00F1', 55, '\u00F2', 56, '\u00F3', 57, '\u00F4', 58, '\u00F5', 59, '\u00F6', 60, '\u00F9', 61, '\u00FA', 62, '\u00FB', 63, '\u00FC', 64, '\u00FD', 65, '\u00FF', 66, '\u0100', 67, '\u0101', 68, '\u0102', 69, '\u0103', 70, '\u0104', 71, '\u0105', 72, '\u0106', 73, '\u0107', 74, '\u0108', 75, '\u0109', 76, '\u010A', 77, '\u010B', 78, '\u010C', 79, '\u010D', 80, '\u010E', 81, '\u010F', 82, '\u0112', 83, '\u0113', 84, '\u0114', 85, '\u0115', 86, '\u0116', 87, '\u0117', 88, '\u0118', 89, '\u0119', 90, '\u011A', 91, '\u011B', 92, '\u011C', 93, '\u011D', 94, '\u011E', 95, '\u011F', 96, '\u0120', 97, '\u0121', 98, '\u0122', 99, '\u0123', 100, '\u0124', 101, '\u0125', 102, '\u0128', 103, '\u0129', 104, '\u012A', 105, '\u012B', 106, '\u012C', 107, '\u012D', 108, '\u012E', 109, '\u012F', 110, '\u0130', 111, '\u0132', 112, '\u0133', 113, '\u0134', 114, '\u0135', 115, '\u0136', 116, '\u0137', 117, '\u0139', 118, '\u013A', 119, '\u013B', 120, '\u013C', 121, '\u013D', 122, '\u013E', 123, '\u013F', 124, '\u0140', 125, '\u0143', 126, '\u0144', 127, '\u0145', 128, '\u0146', 129, '\u0147', 130, '\u0148', 131, '\u0149', 132, '\u014C', 133, '\u014D', 134, '\u014E', 135, '\u014F', 136, '\u0150', 137, '\u0151', 138, '\u0154', 139, '\u0155', 140, '\u0156', 141, '\u0157', 142, '\u0158', 143, '\u0159', 144, '\u015A', 145, '\u015B', 146, '\u015C', 147, '\u015D', 148, '\u015E', 149, '\u015F', 150, '\u0160', 151, '\u0161', 152, '\u0162', 153, '\u0163', 154, '\u0164', 155, '\u0165', 156, '\u0168', 157, '\u0169', 158, '\u016A', 159, '\u016B', 160, '\u016C', 161, '\u016D', 162, '\u016E', 163, '\u016F', 164, '\u0170', 165, '\u0171', 166, '\u0172', 167, '\u0173', 168, '\u0174', 169, '\u0175', 170, '\u0176', 171, '\u0177', 172, '\u0178', 173, '\u0179', 174, '\u017A', 175, '\u017B', 176, '\u017C', 177, '\u017D', 178, '\u017E', 179, '\u017F', 180, '\u01A0', 181, '\u01A1', 182, '\u01AF', 183, '\u01B0', 184, '\u01C4', 185, '\u01C5', 186, '\u01C6', 187, '\u01C7', 188, '\u01C8', 189, '\u01C9', 190, '\u01CA', 191, '\u01CB', 192, '\u01CC', 193, '\u01CD', 194, '\u01CE', 195, '\u01CF', 196, '\u01D0', 197, '\u01D1', 198, '\u01D2', 199, '\u01D3', 200, '\u01D4', 201, '\u01D5', 202, '\u01D6', 203, '\u01D7', 204, '\u01D8', 205, '\u01D9', 206, '\u01DA', 207, '\u01DB', 208, '\u01DC', 209, '\u01DE', 210, '\u01DF', 211, '\u01E0', 212, '\u01E1', 213, '\u01E2', 214, '\u01E3', 215, '\u01E6', 216, '\u01E7', 217, '\u01E8', 218, '\u01E9', 219, '\u01EA', 220, '\u01EB', 221, '\u01EC', 222, '\u01ED', 223, '\u01EE', 224, '\u01EF', 225, '\u01F0', 226, '\u01F1', 227, '\u01F2', 228, '\u01F3', 229, '\u01F4', 230, '\u01F5', 231, '\u01F8', 232, '\u01F9', 233, '\u01FA', 234, '\u01FB', 235, '\u01FC', 236, '\u01FD', 237, '\u01FE', 238, '\u01FF', 239, '\u0200', 240, '\u0201', 241, '\u0202', 242, '\u0203', 243, '\u0204', 244, '\u0205', 245, '\u0206', 246, '\u0207', 247, '\u0208', 248, '\u0209', 249, '\u020A', 250, '\u020B', 251, '\u020C', 252, '\u020D', 253, '\u020E', 254, '\u020F', 255, '\u0210', 256, '\u0211', 257, '\u0212', 258, '\u0213', 259, '\u0214', 260, '\u0215', 261, '\u0216', 262, '\u0217', 263, '\u0218', 264, '\u0219', 265, '\u021A', 266, '\u021B', 267, '\u021E', 268, '\u021F', 269, '\u0226', 270, '\u0227', 271, '\u0228', 272, '\u0229', 273, '\u022A', 274, '\u022B', 275, '\u022C', 276, '\u022D', 277, '\u022E', 278, '\u022F', 279, '\u0230', 280, '\u0231', 281, '\u0232', 282, '\u0233', 283, '\u02B0', 284, '\u02B1', 285, '\u02B2', 286, '\u02B3', 287, '\u02B4', 288, '\u02B5', 289, '\u02B6', 290, '\u02B7', 291, '\u02B8', 292, '\u02D8', 293, '\u02D9', 294, '\u02DA', 295, '\u02DB', 296, '\u02DC', 297, '\u02DD', 298, '\u02E0', 299, '\u02E1', 300, '\u02E2', 180, '\u02E3', 301, '\u02E4', 302, '\u0340', 303, '\u0341', 304, '\u0343', 305, '\u0344', 306, '\u0374', 307, '\u037A', 308, '\u037E', 309, '\u0384', 6, '\u0385', 310, '\u0386', 311, '\u0387', 312, '\u0388', 313, '\u0389', 314, '\u038A', 315, '\u038C', 316, '\u038E', 317, '\u038F', 318, '\u0390', 319, '\u03AA', 320, '\u03AB', 321, '\u03AC', 322, '\u03AD', 323, '\u03AE', 324, '\u03AF', 325, '\u03B0', 326, '\u03CA', 327, '\u03CB', 328, '\u03CC', 329, '\u03CD', 330, '\u03CE', 331, '\u03D0', 332, '\u03D1', 333, '\u03D2', 334, '\u03D3', 317, '\u03D4', 321, '\u03D5', 335, '\u03D6', 336, '\u03F0', 337, '\u03F1', 338, '\u03F2', 339, '\u03F4', 340, '\u03F5', 341, '\u03F9', 342, '\u0400', 343, '\u0401', 344, '\u0403', 345, '\u0407', 346, '\u040C', 347, '\u040D', 348, '\u040E', 349, '\u0419', 350, '\u0439', 351, '\u0450', 352, '\u0451', 353, '\u0453', 354, '\u0457', 355, '\u045C', 356, '\u045D', 357, '\u045E', 358, '\u0476', 359, '\u0477', 360, '\u04C1', 361, '\u04C2', 362, '\u04D0', 363, '\u04D1', 364, '\u04D2', 365, '\u04D3', 366, '\u04D6', 367, '\u04D7', 368, '\u04DA', 369, '\u04DB', 370, '\u04DC', 371, '\u04DD', 372, '\u04DE', 373, '\u04DF', 374, '\u04E2', 375, '\u04E3', 376, '\u04E4', 377, '\u04E5', 378, '\u04E6', 379, '\u04E7', 380, '\u04EA', 381, '\u04EB', 382, '\u04EC', 383, '\u04ED', 384, '\u04EE', 385, '\u04EF', 386, '\u04F0', 387, '\u04F1', 388, '\u04F2', 389, '\u04F3', 390, '\u04F4', 391, '\u04F5', 392, '\u04F8', 393, '\u04F9', 394, '\u0587', 395, '\u0622', 396, '\u0623', 397, '\u0624', 398, '\u0625', 399, '\u0626', 400, '\u0675', 401, '\u0676', 402, '\u0677', 403, '\u0678', 404, '\u06C0', 405, '\u06C2', 406, '\u06D3', 407, '\u0929', 408, '\u0931', 409, '\u0934', 410, '\u0958', 411, '\u0959', 412, '\u095A', 413, '\u095B', 414, '\u095C', 415, '\u095D', 416, '\u095E', 417, '\u095F', 418, '\u09CB', 419, '\u09CC', 420, '\u09DC', 421, '\u09DD', 422, '\u09DF', 423, '\u0A33', 424, '\u0A36', 425, '\u0A59', 426, '\u0A5A', 427, '\u0A5B', 428, '\u0A5E', 429, '\u0B48', 430, '\u0B4B', 431, '\u0B4C', 432, '\u0B5C', 433, '\u0B5D', 434, '\u0B94', 435, '\u0BCA', 436, '\u0BCB', 437, '\u0BCC', 438, '\u0C48', 439, '\u0CC0', 440, '\u0CC7', 441, '\u0CC8', 442, '\u0CCA', 443, '\u0CCB', 444, '\u0D4A', 445, '\u0D4B', 446, '\u0D4C', 447, '\u0DDA', 448, '\u0DDC', 449, '\u0DDD', 450, '\u0DDE', 451, '\u0E33', 452, '\u0EB3', 453, '\u0EDC', 454, '\u0EDD', 455, '\u0F0C', 456, '\u0F43', 457, '\u0F4D', 458, '\u0F52', 459, '\u0F57', 460, '\u0F5C', 461, '\u0F69', 462, '\u0F73', 463, '\u0F75', 464, '\u0F76', 465, '\u0F77', 466, '\u0F78', 467, '\u0F79', 468, '\u0F81', 469, '\u0F93', 470, '\u0F9D', 471, '\u0FA2', 472, '\u0FA7', 473, '\u0FAC', 474, '\u0FB9', 475, '\u1026', 476, '\u10FC', 477, '\u1B06', 478, '\u1B08', 479, '\u1B0A', 480, '\u1B0C', 481, '\u1B0E', 482, '\u1B12', 483, '\u1B3B', 484, '\u1B3D', 485, '\u1B40', 486, '\u1B41', 487, '\u1B43', 488, '\u1D2C', 489, '\u1D2D', 490, '\u1D2E', 491, '\u1D30', 492, '\u1D31', 493, '\u1D32', 494, '\u1D33', 495, '\u1D34', 496, '\u1D35', 497, '\u1D36', 498, '\u1D37', 499, '\u1D38', 500, '\u1D39', 501, '\u1D3A', 502, '\u1D3C', 503, '\u1D3D', 504, '\u1D3E', 505, '\u1D3F', 506, '\u1D40', 507, '\u1D41', 508, '\u1D42', 509, '\u1D43', 2, '\u1D44', 510, '\u1D45', 511, '\u1D46', 512, '\u1D47', 513, '\u1D48', 514, '\u1D49', 515, '\u1D4A', 516, '\u1D4B', 517, '\u1D4C', 518, '\u1D4D', 519, '\u1D4F', 520, '\u1D50', 521, '\u1D51', 522, '\u1D52', 10, '\u1D53', 523, '\u1D54', 524, '\u1D55', 525, '\u1D56', 526, '\u1D57', 527, '\u1D58', 528, '\u1D59', 529, '\u1D5A', 530, '\u1D5B', 531, '\u1D5C', 532, '\u1D5D', 332, '\u1D5E', 533, '\u1D5F', 534, '\u1D60', 335, '\u1D61', 535, '\u1D62', 536, '\u1D63', 287, '\u1D64', 528, '\u1D65', 531, '\u1D66', 332, '\u1D67', 533, '\u1D68', 338, '\u1D69', 335, '\u1D6A', 535, '\u1D78', 537, '\u1D9B', 538, '\u1D9C', 539, '\u1D9D', 540, '\u1D9E', 541, '\u1D9F', 518, '\u1DA0', 542, '\u1DA1', 543, '\u1DA2', 544, '\u1DA3', 545, '\u1DA4', 546, '\u1DA5', 547, '\u1DA6', 548, '\u1DA7', 549, '\u1DA8', 550, '\u1DA9', 551, '\u1DAA', 552, '\u1DAB', 553, '\u1DAC', 554, '\u1DAD', 555, '\u1DAE', 556, '\u1DAF', 557, '\u1DB0', 558, '\u1DB1', 559, '\u1DB2', 560, '\u1DB3', 561, '\u1DB4', 562, '\u1DB5', 563, '\u1DB6', 564, '\u1DB7', 565, '\u1DB8', 566, '\u1DB9', 567, '\u1DBA', 568, '\u1DBB', 569, '\u1DBC', 570, '\u1DBD', 571, '\u1DBE', 572, '\u1DBF', 333, '\u1E00', 573, '\u1E01', 574, '\u1E02', 575, '\u1E03', 576, '\u1E04', 577, '\u1E05', 578, '\u1E06', 579, '\u1E07', 580, '\u1E08', 581, '\u1E09', 582, '\u1E0A', 583, '\u1E0B', 584, '\u1E0C', 585, '\u1E0D', 586, '\u1E0E', 587, '\u1E0F', 588, '\u1E10', 589, '\u1E11', 590, '\u1E12', 591, '\u1E13', 592, '\u1E14', 593, '\u1E15', 594, '\u1E16', 595, '\u1E17', 596, '\u1E18', 597, '\u1E19', 598, '\u1E1A', 599, '\u1E1B', 600, '\u1E1C', 601, '\u1E1D', 602, '\u1E1E', 603, '\u1E1F', 604, '\u1E20', 605, '\u1E21', 606, '\u1E22', 607, '\u1E23', 608, '\u1E24', 609, '\u1E25', 610, '\u1E26', 611, '\u1E27', 612, '\u1E28', 613, '\u1E29', 614, '\u1E2A', 615, '\u1E2B', 616, '\u1E2C', 617, '\u1E2D', 618, '\u1E2E', 619, '\u1E2F', 620, '\u1E30', 621, '\u1E31', 622, '\u1E32', 623, '\u1E33', 624, '\u1E34', 625, '\u1E35', 626, '\u1E36', 627, '\u1E37', 628, '\u1E38', 629, '\u1E39', 630, '\u1E3A', 631, '\u1E3B', 632, '\u1E3C', 633, '\u1E3D', 634, '\u1E3E', 635, '\u1E3F', 636, '\u1E40', 637, '\u1E41', 638, '\u1E42', 639, '\u1E43', 640, '\u1E44', 641, '\u1E45', 642, '\u1E46', 643, '\u1E47', 644, '\u1E48', 645, '\u1E49', 646, '\u1E4A', 647, '\u1E4B', 648, '\u1E4C', 649, '\u1E4D', 650, '\u1E4E', 651, '\u1E4F', 652, '\u1E50', 653, '\u1E51', 654, '\u1E52', 655, '\u1E53', 656, '\u1E54', 657, '\u1E55', 658, '\u1E56', 659, '\u1E57', 660, '\u1E58', 661, '\u1E59', 662, '\u1E5A', 663, '\u1E5B', 664, '\u1E5C', 665, '\u1E5D', 666, '\u1E5E', 667, '\u1E5F', 668, '\u1E60', 669, '\u1E61', 670, '\u1E62', 671, '\u1E63', 672, '\u1E64', 673, '\u1E65', 674, '\u1E66', 675, '\u1E67', 676, '\u1E68', 677, '\u1E69', 678, '\u1E6A', 679, '\u1E6B', 680, '\u1E6C', 681, '\u1E6D', 682, '\u1E6E', 683, '\u1E6F', 684, '\u1E70', 685, '\u1E71', 686, '\u1E72', 687, '\u1E73', 688, '\u1E74', 689, '\u1E75', 690, '\u1E76', 691, '\u1E77', 692, '\u1E78', 693, '\u1E79', 694, '\u1E7A', 695, '\u1E7B', 696, '\u1E7C', 697, '\u1E7D', 698, '\u1E7E', 699, '\u1E7F', 700, '\u1E80', 701, '\u1E81', 702, '\u1E82', 703, '\u1E83', 704, '\u1E84', 705, '\u1E85', 706, '\u1E86', 707, '\u1E87', 708, '\u1E88', 709, '\u1E89', 710, '\u1E8A', 711, '\u1E8B', 712, '\u1E8C', 713, '\u1E8D', 714, '\u1E8E', 715, '\u1E8F', 716, '\u1E90', 717, '\u1E91', 718, '\u1E92', 719, '\u1E93', 720, '\u1E94', 721, '\u1E95', 722, '\u1E96', 723, '\u1E97', 724, '\u1E98', 725, '\u1E99', 726, '\u1E9A', 727, '\u1E9B', 670, '\u1EA0', 728, '\u1EA1', 729, '\u1EA2', 730, '\u1EA3', 731, '\u1EA4', 732, '\u1EA5', 733, '\u1EA6', 734, '\u1EA7', 735, '\u1EA8', 736, '\u1EA9', 737, '\u1EAA', 738, '\u1EAB', 739, '\u1EAC', 740, '\u1EAD', 741, '\u1EAE', 742, '\u1EAF', 743, '\u1EB0', 744, '\u1EB1', 745, '\u1EB2', 746, '\u1EB3', 747, '\u1EB4', 748, '\u1EB5', 749, '\u1EB6', 750, '\u1EB7', 751, '\u1EB8', 752, '\u1EB9', 753, '\u1EBA', 754, '\u1EBB', 755, '\u1EBC', 756, '\u1EBD', 757, '\u1EBE', 758, '\u1EBF', 759, '\u1EC0', 760, '\u1EC1', 761, '\u1EC2', 762, '\u1EC3', 763, '\u1EC4', 764, '\u1EC5', 765, '\u1EC6', 766, '\u1EC7', 767, '\u1EC8', 768, '\u1EC9', 769, '\u1ECA', 770, '\u1ECB', 771, '\u1ECC', 772, '\u1ECD', 773, '\u1ECE', 774, '\u1ECF', 775, '\u1ED0', 776, '\u1ED1', 777, '\u1ED2', 778, '\u1ED3', 779, '\u1ED4', 780, '\u1ED5', 781, '\u1ED6', 782, '\u1ED7', 783, '\u1ED8', 784, '\u1ED9', 785, '\u1EDA', 786, '\u1EDB', 787, '\u1EDC', 788, '\u1EDD', 789, '\u1EDE', 790, '\u1EDF', 791, '\u1EE0', 792, '\u1EE1', 793, '\u1EE2', 794, '\u1EE3', 795, '\u1EE4', 796, '\u1EE5', 797, '\u1EE6', 798, '\u1EE7', 799, '\u1EE8', 800, '\u1EE9', 801, '\u1EEA', 802, '\u1EEB', 803, '\u1EEC', 804, '\u1EED', 805, '\u1EEE', 806, '\u1EEF', 807, '\u1EF0', 808, '\u1EF1', 809, '\u1EF2', 810, '\u1EF3', 811, '\u1EF4', 812, '\u1EF5', 813, '\u1EF6', 814, '\u1EF7', 815, '\u1EF8', 816, '\u1EF9', 817, '\u1F00', 818, '\u1F01', 819, '\u1F02', 820, '\u1F03', 821, '\u1F04', 822, '\u1F05', 823, '\u1F06', 824, '\u1F07', 825, '\u1F08', 826, '\u1F09', 827, '\u1F0A', 828, '\u1F0B', 829, '\u1F0C', 830, '\u1F0D', 831, '\u1F0E', 832, '\u1F0F', 833, '\u1F10', 834, '\u1F11', 835, '\u1F12', 836, '\u1F13', 837, '\u1F14', 838, '\u1F15', 839, '\u1F18', 840, '\u1F19', 841, '\u1F1A', 842, '\u1F1B', 843, '\u1F1C', 844, '\u1F1D', 845, '\u1F20', 846, '\u1F21', 847, '\u1F22', 848, '\u1F23', 849, '\u1F24', 850, '\u1F25', 851, '\u1F26', 852, '\u1F27', 853, '\u1F28', 854, '\u1F29', 855, '\u1F2A', 856, '\u1F2B', 857, '\u1F2C', 858, '\u1F2D', 859, '\u1F2E', 860, '\u1F2F', 861, '\u1F30', 862, '\u1F31', 863, '\u1F32', 864, '\u1F33', 865, '\u1F34', 866, '\u1F35', 867, '\u1F36', 868, '\u1F37', 869, '\u1F38', 870, '\u1F39', 871, '\u1F3A', 872, '\u1F3B', 873, '\u1F3C', 874, '\u1F3D', 875, '\u1F3E', 876, '\u1F3F', 877, '\u1F40', 878, '\u1F41', 879, '\u1F42', 880, '\u1F43', 881, '\u1F44', 882, '\u1F45', 883, '\u1F48', 884, '\u1F49', 885, '\u1F4A', 886, '\u1F4B', 887, '\u1F4C', 888, '\u1F4D', 889, '\u1F50', 890, '\u1F51', 891, '\u1F52', 892, '\u1F53', 893, '\u1F54', 894, '\u1F55', 895, '\u1F56', 896, '\u1F57', 897, '\u1F59', 898, '\u1F5B', 899, '\u1F5D', 900, '\u1F5F', 901, '\u1F60', 902, '\u1F61', 903, '\u1F62', 904, '\u1F63', 905, '\u1F64', 906, '\u1F65', 907, '\u1F66', 908, '\u1F67', 909, '\u1F68', 910, '\u1F69', 911, '\u1F6A', 912, '\u1F6B', 913, '\u1F6C', 914, '\u1F6D', 915, '\u1F6E', 916, '\u1F6F', 917, '\u1F70', 918, '\u1F71', 322, '\u1F72', 919, '\u1F73', 323, '\u1F74', 920, '\u1F75', 324, '\u1F76', 921, '\u1F77', 325, '\u1F78', 922, '\u1F79', 329, '\u1F7A', 923, '\u1F7B', 330, '\u1F7C', 924, '\u1F7D', 331, '\u1F80', 925, '\u1F81', 926, '\u1F82', 927, '\u1F83', 928, '\u1F84', 929, '\u1F85', 930, '\u1F86', 931, '\u1F87', 932, '\u1F88', 933, '\u1F89', 934, '\u1F8A', 935, '\u1F8B', 936, '\u1F8C', 937, '\u1F8D', 938, '\u1F8E', 939, '\u1F8F', 940, '\u1F90', 941, '\u1F91', 942, '\u1F92', 943, '\u1F93', 944, '\u1F94', 945, '\u1F95', 946, '\u1F96', 947, '\u1F97', 948, '\u1F98', 949, '\u1F99', 950, '\u1F9A', 951, '\u1F9B', 952, '\u1F9C', 953, '\u1F9D', 954, '\u1F9E', 955, '\u1F9F', 956, '\u1FA0', 957, '\u1FA1', 958, '\u1FA2', 959, '\u1FA3', 960, '\u1FA4', 961, '\u1FA5', 962, '\u1FA6', 963, '\u1FA7', 964, '\u1FA8', 965, '\u1FA9', 966, '\u1FAA', 967, '\u1FAB', 968, '\u1FAC', 969, '\u1FAD', 970, '\u1FAE', 971, '\u1FAF', 972, '\u1FB0', 973, '\u1FB1', 974, '\u1FB2', 975, '\u1FB3', 976, '\u1FB4', 977, '\u1FB6', 978, '\u1FB7', 979, '\u1FB8', 980, '\u1FB9', 981, '\u1FBA', 982, '\u1FBB', 311, '\u1FBC', 983, '\u1FBD', 984, '\u1FBE', 985, '\u1FBF', 984, '\u1FC0', 986, '\u1FC1', 987, '\u1FC2', 988, '\u1FC3', 989, '\u1FC4', 990, '\u1FC6', 991, '\u1FC7', 992, '\u1FC8', 993, '\u1FC9', 313, '\u1FCA', 994, '\u1FCB', 314, '\u1FCC', 995, '\u1FCD', 996, '\u1FCE', 997, '\u1FCF', 998, '\u1FD0', 999, '\u1FD1', 1000, '\u1FD2', 1001, '\u1FD3', 319, '\u1FD6', 1002, '\u1FD7', 1003, '\u1FD8', 1004, '\u1FD9', 1005, '\u1FDA', 1006, '\u1FDB', 315, '\u1FDD', 1007, '\u1FDE', 1008, '\u1FDF', 1009, '\u1FE0', 1010, '\u1FE1', 1011, '\u1FE2', 1012, '\u1FE3', 326, '\u1FE4', 1013, '\u1FE5', 1014, '\u1FE6', 1015, '\u1FE7', 1016, '\u1FE8', 1017, '\u1FE9', 1018, '\u1FEA', 1019, '\u1FEB', 317, '\u1FEC', 1020, '\u1FED', 1021, '\u1FEE', 310, '\u1FEF', 1022, '\u1FF2', 1023, '\u1FF3', 1024, '\u1FF4', 1025, '\u1FF6', 1026, '\u1FF7', 1027, '\u1FF8', 1028, '\u1FF9', 316, '\u1FFA', 1029, '\u1FFB', 318, '\u1FFC', 1030, '\u1FFD', 6, '\u1FFE', 1031, '\u2000', 0, '\u2001', 0, '\u2002', 0, '\u2003', 0, '\u2004', 0, '\u2005', 0, '\u2006', 0, '\u2007', 0, '\u2008', 0, '\u2009', 0, '\u200A', 0, '\u2011', 1032, '\u2017', 1033, '\u2024', 1034, '\u2025', 1035, '\u2026', 1036, '\u202F', 0, '\u2033', 1037, '\u2034', 1038, '\u2036', 1039, '\u2037', 1040, '\u203C', 1041, '\u203E', 1042, '\u2047', 1043, '\u2048', 1044, '\u2049', 1045, '\u2057', 1046, '\u205F', 0, '\u2070', 1047, '\u2071', 536, '\u2074', 1048, '\u2075', 1049, '\u2076', 1050, '\u2077', 1051, '\u2078', 1052, '\u2079', 1053, '\u207A', 1054, '\u207B', 1055, '\u207C', 1056, '\u207D', 1057, '\u207E', 1058, '\u207F', 1059, '\u2080', 1047, '\u2081', 9, '\u2082', 4, '\u2083', 5, '\u2084', 1048, '\u2085', 1049, '\u2086', 1050, '\u2087', 1051, '\u2088', 1052, '\u2089', 1053, '\u208A', 1054, '\u208B', 1055, '\u208C', 1056, '\u208D', 1057, '\u208E', 1058, '\u2090', 2, '\u2091', 515, '\u2092', 10, '\u2093', 301, '\u2094', 516, '\u20A8', 1060, '\u2100', 1061, '\u2101', 1062, '\u2102', 1063, '\u2103', 1064, '\u2105', 1065, '\u2106', 1066, '\u2107', 1067, '\u2109', 1068, '\u210A', 519, '\u210B', 496, '\u210C', 496, '\u210D', 496, '\u210E', 284, '\u210F', 1069, '\u2110', 497, '\u2111', 497, '\u2112', 500, '\u2113', 300, '\u2115', 502, '\u2116', 1070, '\u2119', 505, '\u211A', 1071, '\u211B', 506, '\u211C', 506, '\u211D', 506, '\u2120', 1072, '\u2121', 1073, '\u2122', 1074, '\u2124', 1075, '\u2126', 1076, '\u2128', 1075, '\u212A', 499, '\u212B', 19, '\u212C', 491, '\u212D', 1063, '\u212F', 515, '\u2130', 493, '\u2131', 1077, '\u2133', 501, '\u2134', 10, '\u2135', 1078, '\u2136', 1079, '\u2137', 1080, '\u2138', 1081, '\u2139', 536, '\u213B', 1082, '\u213C', 336, '\u213D', 533, '\u213E', 1083, '\u213F', 1084, '\u2140', 1085, '\u2145', 492, '\u2146', 514, '\u2147', 515, '\u2148', 536, '\u2149', 286, '\u2153', 1086, '\u2154', 1087, '\u2155', 1088, '\u2156', 1089, '\u2157', 1090, '\u2158', 1091, '\u2159', 1092, '\u215A', 1093, '\u215B', 1094, '\u215C', 1095, '\u215D', 1096, '\u215E', 1097, '\u215F', 1098, '\u2160', 497, '\u2161', 1099, '\u2162', 1100, '\u2163', 1101, '\u2164', 1102, '\u2165', 1103, '\u2166', 1104, '\u2167', 1105, '\u2168', 1106, '\u2169', 1107, '\u216A', 1108, '\u216B', 1109, '\u216C', 500, '\u216D', 1063, '\u216E', 492, '\u216F', 501, '\u2170', 536, '\u2171', 1110, '\u2172', 1111, '\u2173', 1112, '\u2174', 531, '\u2175', 1113, '\u2176', 1114, '\u2177', 1115, '\u2178', 1116, '\u2179', 301, '\u217A', 1117, '\u217B', 1118, '\u217C', 300, '\u217D', 539, '\u217E', 514, '\u217F', 521, '\u219A', 1119, '\u219B', 1120, '\u21AE', 1121, '\u21CD', 1122, '\u21CE', 1123, '\u21CF', 1124, '\u2204', 1125, '\u2209', 1126, '\u220C', 1127, '\u2224', 1128, '\u2226', 1129, '\u222C', 1130, '\u222D', 1131, '\u222F', 1132, '\u2230', 1133, '\u2241', 1134, '\u2244', 1135, '\u2247', 1136, '\u2249', 1137, '\u2260', 1138, '\u2262', 1139, '\u226D', 1140, '\u226E', 1141, '\u226F', 1142, '\u2270', 1143, '\u2271', 1144, '\u2274', 1145, '\u2275', 1146, '\u2278', 1147, '\u2279', 1148, '\u2280', 1149, '\u2281', 1150, '\u2284', 1151, '\u2285', 1152, '\u2288', 1153, '\u2289', 1154, '\u22AC', 1155, '\u22AD', 1156, '\u22AE', 1157, '\u22AF', 1158, '\u22E0', 1159, '\u22E1', 1160, '\u22E2', 1161, '\u22E3', 1162, '\u22EA', 1163, '\u22EB', 1164, '\u22EC', 1165, '\u22ED', 1166, '\u2329', 1167, '\u232A', 1168, '\u2460', 9, '\u2461', 4, '\u2462', 5, '\u2463', 1048, '\u2464', 1049, '\u2465', 1050, '\u2466', 1051, '\u2467', 1052, '\u2468', 1053, '\u2469', 1169, '\u246A', 1170, '\u246B', 1171, '\u246C', 1172, '\u246D', 1173, '\u246E', 1174, '\u246F', 1175, '\u2470', 1176, '\u2471', 1177, '\u2472', 1178, '\u2473', 1179, '\u2474', 1180, '\u2475', 1181, '\u2476', 1182, '\u2477', 1183, '\u2478', 1184, '\u2479', 1185, '\u247A', 1186, '\u247B', 1187, '\u247C', 1188, '\u247D', 1189, '\u247E', 1190, '\u247F', 1191, '\u2480', 1192, '\u2481', 1193, '\u2482', 1194, '\u2483', 1195, '\u2484', 1196, '\u2485', 1197, '\u2486', 1198, '\u2487', 1199, '\u2488', 1200, '\u2489', 1201, '\u248A', 1202, '\u248B', 1203, '\u248C', 1204, '\u248D', 1205, '\u248E', 1206, '\u248F', 1207, '\u2490', 1208, '\u2491', 1209, '\u2492', 1210, '\u2493', 1211, '\u2494', 1212, '\u2495', 1213, '\u2496', 1214, '\u2497', 1215, '\u2498', 1216, '\u2499', 1217, '\u249A', 1218, '\u249B', 1219, '\u249C', 1220, '\u249D', 1221, '\u249E', 1222, '\u249F', 1223, '\u24A0', 1224, '\u24A1', 1225, '\u24A2', 1226, '\u24A3', 1227, '\u24A4', 1228, '\u24A5', 1229, '\u24A6', 1230, '\u24A7', 1231, '\u24A8', 1232, '\u24A9', 1233, '\u24AA', 1234, '\u24AB', 1235, '\u24AC', 1236, '\u24AD', 1237, '\u24AE', 1238, '\u24AF', 1239, '\u24B0', 1240, '\u24B1', 1241, '\u24B2', 1242, '\u24B3', 1243, '\u24B4', 1244, '\u24B5', 1245, '\u24B6', 489, '\u24B7', 491, '\u24B8', 1063, '\u24B9', 492, '\u24BA', 493, '\u24BB', 1077, '\u24BC', 495, '\u24BD', 496, '\u24BE', 497, '\u24BF', 498, '\u24C0', 499, '\u24C1', 500, '\u24C2', 501, '\u24C3', 502, '\u24C4', 503, '\u24C5', 505, '\u24C6', 1071, '\u24C7', 506, '\u24C8', 1246, '\u24C9', 507, '\u24CA', 508, '\u24CB', 1102, '\u24CC', 509, '\u24CD', 1107, '\u24CE', 1247, '\u24CF', 1075, '\u24D0', 2, '\u24D1', 513, '\u24D2', 539, '\u24D3', 514, '\u24D4', 515, '\u24D5', 542, '\u24D6', 519, '\u24D7', 284, '\u24D8', 536, '\u24D9', 286, '\u24DA', 520, '\u24DB', 300, '\u24DC', 521, '\u24DD', 1059, '\u24DE', 10, '\u24DF', 526, '\u24E0', 1248, '\u24E1', 287, '\u24E2', 180, '\u24E3', 527, '\u24E4', 528, '\u24E5', 531, '\u24E6', 291, '\u24E7', 301, '\u24E8', 292, '\u24E9', 569, '\u24EA', 1047, '\u2A0C', 1249, '\u2A74', 1250, '\u2A75', 1251, '\u2A76', 1252, '\u2ADC', 1253, '\u2C7C', 286, '\u2C7D', 1102, '\u2D6F', 1254, '\u2E9F', 1255, '\u2EF3', 1256, '\u2F00', 1257, '\u2F01', 1258, '\u2F02', 1259, '\u2F03', 1260, '\u2F04', 1261, '\u2F05', 1262, '\u2F06', 1263, '\u2F07', 1264, '\u2F08', 1265, '\u2F09', 1266, '\u2F0A', 1267, '\u2F0B', 1268, '\u2F0C', 1269, '\u2F0D', 1270, '\u2F0E', 1271, '\u2F0F', 1272, '\u2F10', 1273, '\u2F11', 1274, '\u2F12', 1275, '\u2F13', 1276, '\u2F14', 1277, '\u2F15', 1278, '\u2F16', 1279, '\u2F17', 1280, '\u2F18', 1281, '\u2F19', 1282, '\u2F1A', 1283, '\u2F1B', 1284, '\u2F1C', 1285, '\u2F1D', 1286, '\u2F1E', 1287, '\u2F1F', 1288, '\u2F20', 1289, '\u2F21', 1290, '\u2F22', 1291, '\u2F23', 1292, '\u2F24', 1293, '\u2F25', 1294, '\u2F26', 1295, '\u2F27', 1296, '\u2F28', 1297, '\u2F29', 1298, '\u2F2A', 1299, '\u2F2B', 1300, '\u2F2C', 1301, '\u2F2D', 1302, '\u2F2E', 1303, '\u2F2F', 1304, '\u2F30', 1305, '\u2F31', 1306, '\u2F32', 1307, '\u2F33', 1308, '\u2F34', 1309, '\u2F35', 1310, '\u2F36', 1311, '\u2F37', 1312, '\u2F38', 1313, '\u2F39', 1314, '\u2F3A', 1315, '\u2F3B', 1316, '\u2F3C', 1317, '\u2F3D', 1318, '\u2F3E', 1319, '\u2F3F', 1320, '\u2F40', 1321, '\u2F41', 1322, '\u2F42', 1323, '\u2F43', 1324, '\u2F44', 1325, '\u2F45', 1326, '\u2F46', 1327, '\u2F47', 1328, '\u2F48', 1329, '\u2F49', 1330, '\u2F4A', 1331, '\u2F4B', 1332, '\u2F4C', 1333, '\u2F4D', 1334, '\u2F4E', 1335, '\u2F4F', 1336, '\u2F50', 1337, '\u2F51', 1338, '\u2F52', 1339, '\u2F53', 1340, '\u2F54', 1341, '\u2F55', 1342, '\u2F56', 1343, '\u2F57', 1344, '\u2F58', 1345, '\u2F59', 1346, '\u2F5A', 1347, '\u2F5B', 1348, '\u2F5C', 1349, '\u2F5D', 1350, '\u2F5E', 1351, '\u2F5F', 1352, '\u2F60', 1353, '\u2F61', 1354, '\u2F62', 1355, '\u2F63', 1356, '\u2F64', 1357, '\u2F65', 1358, '\u2F66', 1359, '\u2F67', 1360, '\u2F68', 1361, '\u2F69', 1362, '\u2F6A', 1363, '\u2F6B', 1364, '\u2F6C', 1365, '\u2F6D', 1366, '\u2F6E', 1367, '\u2F6F', 1368, '\u2F70', 1369, '\u2F71', 1370, '\u2F72', 1371, '\u2F73', 1372, '\u2F74', 1373, '\u2F75', 1374, '\u2F76', 1375, '\u2F77', 1376, '\u2F78', 1377, '\u2F79', 1378, '\u2F7A', 1379, '\u2F7B', 1380, '\u2F7C', 1381, '\u2F7D', 1382, '\u2F7E', 1383, '\u2F7F', 1384, '\u2F80', 1385, '\u2F81', 1386, '\u2F82', 1387, '\u2F83', 1388, '\u2F84', 1389, '\u2F85', 1390, '\u2F86', 1391, '\u2F87', 1392, '\u2F88', 1393, '\u2F89', 1394, '\u2F8A', 1395, '\u2F8B', 1396, '\u2F8C', 1397, '\u2F8D', 1398, '\u2F8E', 1399, '\u2F8F', 1400, '\u2F90', 1401, '\u2F91', 1402, '\u2F92', 1403, '\u2F93', 1404, '\u2F94', 1405, '\u2F95', 1406, '\u2F96', 1407, '\u2F97', 1408, '\u2F98', 1409, '\u2F99', 1410, '\u2F9A', 1411, '\u2F9B', 1412, '\u2F9C', 1413, '\u2F9D', 1414, '\u2F9E', 1415, '\u2F9F', 1416, '\u2FA0', 1417, '\u2FA1', 1418, '\u2FA2', 1419, '\u2FA3', 1420, '\u2FA4', 1421, '\u2FA5', 1422, '\u2FA6', 1423, '\u2FA7', 1424, '\u2FA8', 1425, '\u2FA9', 1426, '\u2FAA', 1427, '\u2FAB', 1428, '\u2FAC', 1429, '\u2FAD', 1430, '\u2FAE', 1431, '\u2FAF', 1432, '\u2FB0', 1433, '\u2FB1', 1434, '\u2FB2', 1435, '\u2FB3', 1436, '\u2FB4', 1437, '\u2FB5', 1438, '\u2FB6', 1439, '\u2FB7', 1440, '\u2FB8', 1441, '\u2FB9', 1442, '\u2FBA', 1443, '\u2FBB', 1444, '\u2FBC', 1445, '\u2FBD', 1446, '\u2FBE', 1447, '\u2FBF', 1448, '\u2FC0', 1449, '\u2FC1', 1450, '\u2FC2', 1451, '\u2FC3', 1452, '\u2FC4', 1453, '\u2FC5', 1454, '\u2FC6', 1455, '\u2FC7', 1456, '\u2FC8', 1457, '\u2FC9', 1458, '\u2FCA', 1459, '\u2FCB', 1460, '\u2FCC', 1461, '\u2FCD', 1462, '\u2FCE', 1463, '\u2FCF', 1464, '\u2FD0', 1465, '\u2FD1', 1466, '\u2FD2', 1467, '\u2FD3', 1468, '\u2FD4', 1469, '\u2FD5', 1470, '\u3000', 0, '\u3036', 1471, '\u3038', 1280, '\u3039', 1472, '\u303A', 1473, '\u304C', 1474, '\u304E', 1475, '\u3050', 1476, '\u3052', 1477, '\u3054', 1478, '\u3056', 1479, '\u3058', 1480, '\u305A', 1481, '\u305C', 1482, '\u305E', 1483, '\u3060', 1484, '\u3062', 1485, '\u3065', 1486, '\u3067', 1487, '\u3069', 1488, '\u3070', 1489, '\u3071', 1490, '\u3073', 1491, '\u3074', 1492, '\u3076', 1493, '\u3077', 1494, '\u3079', 1495, '\u307A', 1496, '\u307C', 1497, '\u307D', 1498, '\u3094', 1499, '\u309B', 1500, '\u309C', 1501, '\u309E', 1502, '\u309F', 1503, '\u30AC', 1504, '\u30AE', 1505, '\u30B0', 1506, '\u30B2', 1507, '\u30B4', 1508, '\u30B6', 1509, '\u30B8', 1510, '\u30BA', 1511, '\u30BC', 1512, '\u30BE', 1513, '\u30C0', 1514, '\u30C2', 1515, '\u30C5', 1516, '\u30C7', 1517, '\u30C9', 1518, '\u30D0', 1519, '\u30D1', 1520, '\u30D3', 1521, '\u30D4', 1522, '\u30D6', 1523, '\u30D7', 1524, '\u30D9', 1525, '\u30DA', 1526, '\u30DC', 1527, '\u30DD', 1528, '\u30F4', 1529, '\u30F7', 1530, '\u30F8', 1531, '\u30F9', 1532, '\u30FA', 1533, '\u30FE', 1534, '\u30FF', 1535, '\u3131', 1536, '\u3132', 1537, '\u3133', 1538, '\u3134', 1539, '\u3135', 1540, '\u3136', 1541, '\u3137', 1542, '\u3138', 1543, '\u3139', 1544, '\u313A', 1545, '\u313B', 1546, '\u313C', 1547, '\u313D', 1548, '\u313E', 1549, '\u313F', 1550, '\u3140', 1551, '\u3141', 1552, '\u3142', 1553, '\u3143', 1554, '\u3144', 1555, '\u3145', 1556, '\u3146', 1557, '\u3147', 1558, '\u3148', 1559, '\u3149', 1560, '\u314A', 1561, '\u314B', 1562, '\u314C', 1563, '\u314D', 1564, '\u314E', 1565, '\u314F', 1566, '\u3150', 1567, '\u3151', 1568, '\u3152', 1569, '\u3153', 1570, '\u3154', 1571, '\u3155', 1572, '\u3156', 1573, '\u3157', 1574, '\u3158', 1575, '\u3159', 1576, '\u315A', 1577, '\u315B', 1578, '\u315C', 1579, '\u315D', 1580, '\u315E', 1581, '\u315F', 1582, '\u3160', 1583, '\u3161', 1584, '\u3162', 1585, '\u3163', 1586, '\u3164', 1587, '\u3165', 1588, '\u3166', 1589, '\u3167', 1590, '\u3168', 1591, '\u3169', 1592, '\u316A', 1593, '\u316B', 1594, '\u316C', 1595, '\u316D', 1596, '\u316E', 1597, '\u316F', 1598, '\u3170', 1599, '\u3171', 1600, '\u3172', 1601, '\u3173', 1602, '\u3174', 1603, '\u3175', 1604, '\u3176', 1605, '\u3177', 1606, '\u3178', 1607, '\u3179', 1608, '\u317A', 1609, '\u317B', 1610, '\u317C', 1611, '\u317D', 1612, '\u317E', 1613, '\u317F', 1614, '\u3180', 1615, '\u3181', 1616, '\u3182', 1617, '\u3183', 1618, '\u3184', 1619, '\u3185', 1620, '\u3186', 1621, '\u3187', 1622, '\u3188', 1623, '\u3189', 1624, '\u318A', 1625, '\u318B', 1626, '\u318C', 1627, '\u318D', 1628, '\u318E', 1629, '\u3192', 1257, '\u3193', 1263, '\u3194', 1630, '\u3195', 1631, '\u3196', 1632, '\u3197', 1633, '\u3198', 1634, '\u3199', 1635, '\u319A', 1261, '\u319B', 1636, '\u319C', 1637, '\u319D', 1638, '\u319E', 1639, '\u319F', 1265, '\u3200', 1640, '\u3201', 1641, '\u3202', 1642, '\u3203', 1643, '\u3204', 1644, '\u3205', 1645, '\u3206', 1646, '\u3207', 1647, '\u3208', 1648, '\u3209', 1649, '\u320A', 1650, '\u320B', 1651, '\u320C', 1652, '\u320D', 1653, '\u320E', 1654, '\u320F', 1655, '\u3210', 1656, '\u3211', 1657, '\u3212', 1658, '\u3213', 1659, '\u3214', 1660, '\u3215', 1661, '\u3216', 1662, '\u3217', 1663, '\u3218', 1664, '\u3219', 1665, '\u321A', 1666, '\u321B', 1667, '\u321C', 1668, '\u321D', 1669, '\u321E', 1670, '\u3220', 1671, '\u3221', 1672, '\u3222', 1673, '\u3223', 1674, '\u3224', 1675, '\u3225', 1676, '\u3226', 1677, '\u3227', 1678, '\u3228', 1679, '\u3229', 1680, '\u322A', 1681, '\u322B', 1682, '\u322C', 1683, '\u322D', 1684, '\u322E', 1685, '\u322F', 1686, '\u3230', 1687, '\u3231', 1688, '\u3232', 1689, '\u3233', 1690, '\u3234', 1691, '\u3235', 1692, '\u3236', 1693, '\u3237', 1694, '\u3238', 1695, '\u3239', 1696, '\u323A', 1697, '\u323B', 1698, '\u323C', 1699, '\u323D', 1700, '\u323E', 1701, '\u323F', 1702, '\u3240', 1703, '\u3241', 1704, '\u3242', 1705, '\u3243', 1706, '\u3250', 1707, '\u3251', 1708, '\u3252', 1709, '\u3253', 1710, '\u3254', 1711, '\u3255', 1712, '\u3256', 1713, '\u3257', 1714, '\u3258', 1715, '\u3259', 1716, '\u325A', 1717, '\u325B', 1718, '\u325C', 1719, '\u325D', 1720, '\u325E', 1721, '\u325F', 1722, '\u3260', 1536, '\u3261', 1539, '\u3262', 1542, '\u3263', 1544, '\u3264', 1552, '\u3265', 1553, '\u3266', 1556, '\u3267', 1558, '\u3268', 1559, '\u3269', 1561, '\u326A', 1562, '\u326B', 1563, '\u326C', 1564, '\u326D', 1565, '\u326E', 1723, '\u326F', 1724, '\u3270', 1725, '\u3271', 1726, '\u3272', 1727, '\u3273', 1728, '\u3274', 1729, '\u3275', 1730, '\u3276', 1731, '\u3277', 1732, '\u3278', 1733, '\u3279', 1734, '\u327A', 1735, '\u327B', 1736, '\u327C', 1737, '\u327D', 1738, '\u327E', 1739, '\u3280', 1257, '\u3281', 1263, '\u3282', 1630, '\u3283', 1631, '\u3284', 1740, '\u3285', 1741, '\u3286', 1742, '\u3287', 1268, '\u3288', 1743, '\u3289', 1280, '\u328A', 1330, '\u328B', 1342, '\u328C', 1341, '\u328D', 1331, '\u328E', 1423, '\u328F', 1288, '\u3290', 1328, '\u3291', 1744, '\u3292', 1745, '\u3293', 1746, '\u3294', 1747, '\u3295', 1748, '\u3296', 1749, '\u3297', 1750, '\u3298', 1751, '\u3299', 1752, '\u329A', 1753, '\u329B', 1294, '\u329C', 1754, '\u329D', 1755, '\u329E', 1756, '\u329F', 1757, '\u32A0', 1758, '\u32A1', 1759, '\u32A2', 1760, '\u32A3', 1761, '\u32A4', 1632, '\u32A5', 1633, '\u32A6', 1634, '\u32A7', 1762, '\u32A8', 1763, '\u32A9', 1764, '\u32AA', 1765, '\u32AB', 1766, '\u32AC', 1767, '\u32AD', 1768, '\u32AE', 1769, '\u32AF', 1770, '\u32B0', 1771, '\u32B1', 1772, '\u32B2', 1773, '\u32B3', 1774, '\u32B4', 1775, '\u32B5', 1776, '\u32B6', 1777, '\u32B7', 1778, '\u32B8', 1779, '\u32B9', 1780, '\u32BA', 1781, '\u32BB', 1782, '\u32BC', 1783, '\u32BD', 1784, '\u32BE', 1785, '\u32BF', 1786, '\u32C0', 1787, '\u32C1', 1788, '\u32C2', 1789, '\u32C3', 1790, '\u32C4', 1791, '\u32C5', 1792, '\u32C6', 1793, '\u32C7', 1794, '\u32C8', 1795, '\u32C9', 1796, '\u32CA', 1797, '\u32CB', 1798, '\u32CC', 1799, '\u32CD', 1800, '\u32CE', 1801, '\u32CF', 1802, '\u32D0', 1803, '\u32D1', 1804, '\u32D2', 1805, '\u32D3', 1806, '\u32D4', 1807, '\u32D5', 1808, '\u32D6', 1809, '\u32D7', 1810, '\u32D8', 1811, '\u32D9', 1812, '\u32DA', 1813, '\u32DB', 1814, '\u32DC', 1815, '\u32DD', 1816, '\u32DE', 1817, '\u32DF', 1818, '\u32E0', 1819, '\u32E1', 1820, '\u32E2', 1821, '\u32E3', 1822, '\u32E4', 1823, '\u32E5', 1824, '\u32E6', 1825, '\u32E7', 1826, '\u32E8', 1827, '\u32E9', 1828, '\u32EA', 1829, '\u32EB', 1830, '\u32EC', 1831, '\u32ED', 1832, '\u32EE', 1833, '\u32EF', 1834, '\u32F0', 1835, '\u32F1', 1836, '\u32F2', 1837, '\u32F3', 1838, '\u32F4', 1839, '\u32F5', 1840, '\u32F6', 1841, '\u32F7', 1842, '\u32F8', 1843, '\u32F9', 1844, '\u32FA', 1845, '\u32FB', 1846, '\u32FC', 1847, '\u32FD', 1848, '\u32FE', 1849, '\u3300', 1850, '\u3301', 1851, '\u3302', 1852, '\u3303', 1853, '\u3304', 1854, '\u3305', 1855, '\u3306', 1856, '\u3307', 1857, '\u3308', 1858, '\u3309', 1859, '\u330A', 1860, '\u330B', 1861, '\u330C', 1862, '\u330D', 1863, '\u330E', 1864, '\u330F', 1865, '\u3310', 1866, '\u3311', 1867, '\u3312', 1868, '\u3313', 1869, '\u3314', 1870, '\u3315', 1871, '\u3316', 1872, '\u3317', 1873, '\u3318', 1874, '\u3319', 1875, '\u331A', 1876, '\u331B', 1877, '\u331C', 1878, '\u331D', 1879, '\u331E', 1880, '\u331F', 1881, '\u3320', 1882, '\u3321', 1883, '\u3322', 1884, '\u3323', 1885, '\u3324', 1886, '\u3325', 1887, '\u3326', 1888, '\u3327', 1889, '\u3328', 1890, '\u3329', 1891, '\u332A', 1892, '\u332B', 1893, '\u332C', 1894, '\u332D', 1895, '\u332E', 1896, '\u332F', 1897, '\u3330', 1898, '\u3331', 1899, '\u3332', 1900, '\u3333', 1901, '\u3334', 1902, '\u3335', 1903, '\u3336', 1904, '\u3337', 1905, '\u3338', 1906, '\u3339', 1907, '\u333A', 1908, '\u333B', 1909, '\u333C', 1910, '\u333D', 1911, '\u333E', 1912, '\u333F', 1913, '\u3340', 1914, '\u3341', 1915, '\u3342', 1916, '\u3343', 1917, '\u3344', 1918, '\u3345', 1919, '\u3346', 1920, '\u3347', 1921, '\u3348', 1922, '\u3349', 1923, '\u334A', 1924, '\u334B', 1925, '\u334C', 1926, '\u334D', 1927, '\u334E', 1928, '\u334F', 1929, '\u3350', 1930, '\u3351', 1931, '\u3352', 1932, '\u3353', 1933, '\u3354', 1934, '\u3355', 1935, '\u3356', 1936, '\u3357', 1937, '\u3358', 1938, '\u3359', 1939, '\u335A', 1940, '\u335B', 1941, '\u335C', 1942, '\u335D', 1943, '\u335E', 1944, '\u335F', 1945, '\u3360', 1946, '\u3361', 1947, '\u3362', 1948, '\u3363', 1949, '\u3364', 1950, '\u3365', 1951, '\u3366', 1952, '\u3367', 1953, '\u3368', 1954, '\u3369', 1955, '\u336A', 1956, '\u336B', 1957, '\u336C', 1958, '\u336D', 1959, '\u336E', 1960, '\u336F', 1961, '\u3370', 1962, '\u3371', 1963, '\u3372', 1964, '\u3373', 1965, '\u3374', 1966, '\u3375', 1967, '\u3376', 1968, '\u3377', 1969, '\u3378', 1970, '\u3379', 1971, '\u337A', 1972, '\u337B', 1973, '\u337C', 1974, '\u337D', 1975, '\u337E', 1976, '\u337F', 1977, '\u3380', 1978, '\u3381', 1979, '\u3382', 1980, '\u3383', 1981, '\u3384', 1982, '\u3385', 1983, '\u3386', 1984, '\u3387', 1985, '\u3388', 1986, '\u3389', 1987, '\u338A', 1988, '\u338B', 1989, '\u338C', 1990, '\u338D', 1991, '\u338E', 1992, '\u338F', 1993, '\u3390', 1994, '\u3391', 1995, '\u3392', 1996, '\u3393', 1997, '\u3394', 1998, '\u3395', 1999, '\u3396', 2000, '\u3397', 2001, '\u3398', 2002, '\u3399', 2003, '\u339A', 2004, '\u339B', 2005, '\u339C', 2006, '\u339D', 2007, '\u339E', 2008, '\u339F', 2009, '\u33A0', 2010, '\u33A1', 2011, '\u33A2', 2012, '\u33A3', 2013, '\u33A4', 2014, '\u33A5', 2015, '\u33A6', 2016, '\u33A7', 2017, '\u33A8', 2018, '\u33A9', 2019, '\u33AA', 2020, '\u33AB', 2021, '\u33AC', 2022, '\u33AD', 2023, '\u33AE', 2024, '\u33AF', 2025, '\u33B0', 2026, '\u33B1', 2027, '\u33B2', 2028, '\u33B3', 2029, '\u33B4', 2030, '\u33B5', 2031, '\u33B6', 2032, '\u33B7', 2033, '\u33B8', 2034, '\u33B9', 2035, '\u33BA', 2036, '\u33BB', 2037, '\u33BC', 2038, '\u33BD', 2039, '\u33BE', 2040, '\u33BF', 2041, '\u33C0', 2042, '\u33C1', 2043, '\u33C2', 2044, '\u33C3', 2045, '\u33C4', 2046, '\u33C5', 2047, '\u33C6', 2048, '\u33C7', 2049, '\u33C8', 2050, '\u33C9', 2051, '\u33CA', 2052, '\u33CB', 2053, '\u33CC', 2054, '\u33CD', 2055, '\u33CE', 2056, '\u33CF', 2057, '\u33D0', 2058, '\u33D1', 2059, '\u33D2', 2060, '\u33D3', 2061, '\u33D4', 2062, '\u33D5', 2063, '\u33D6', 2064, '\u33D7', 2065, '\u33D8', 2066, '\u33D9', 2067, '\u33DA', 2068, '\u33DB', 2069, '\u33DC', 2070, '\u33DD', 2071, '\u33DE', 2072, '\u33DF', 2073, '\u33E0', 2074, '\u33E1', 2075, '\u33E2', 2076, '\u33E3', 2077, '\u33E4', 2078, '\u33E5', 2079, '\u33E6', 2080, '\u33E7', 2081, '\u33E8', 2082, '\u33E9', 2083, '\u33EA', 2084, '\u33EB', 2085, '\u33EC', 2086, '\u33ED', 2087, '\u33EE', 2088, '\u33EF', 2089, '\u33F0', 2090, '\u33F1', 2091, '\u33F2', 2092, '\u33F3', 2093, '\u33F4', 2094, '\u33F5', 2095, '\u33F6', 2096, '\u33F7', 2097, '\u33F8', 2098, '\u33F9', 2099, '\u33FA', 2100, '\u33FB', 2101, '\u33FC', 2102, '\u33FD', 2103, '\u33FE', 2104, '\u33FF', 2105, '\uA770', 2106, '\uF900', 2107, '\uF901', 2108, '\uF902', 1415, '\uF903', 2109, '\uF904', 2110, '\uF905', 2111, '\uF906', 2112, '\uF907', 1469, '\uF908', 1469, '\uF909', 2113, '\uF90A', 1423, '\uF90B', 2114, '\uF90C', 2115, '\uF90D', 2116, '\uF90E', 2117, '\uF90F', 2118, '\uF910', 2119, '\uF911', 2120, '\uF912', 2121, '\uF913', 2122, '\uF914', 2123, '\uF915', 2124, '\uF916', 2125, '\uF917', 2126, '\uF918', 2127, '\uF919', 2128, '\uF91A', 2129, '\uF91B', 2130, '\uF91C', 2131, '\uF91D', 2132, '\uF91E', 2133, '\uF91F', 2134, '\uF920', 2135, '\uF921', 2136, '\uF922', 2137, '\uF923', 2138, '\uF924', 2139, '\uF925', 2140, '\uF926', 2141, '\uF927', 2142, '\uF928', 2143, '\uF929', 2144, '\uF92A', 2145, '\uF92B', 2146, '\uF92C', 2147, '\uF92D', 2148, '\uF92E', 2149, '\uF92F', 2150, '\uF930', 2151, '\uF931', 2152, '\uF932', 2153, '\uF933', 2154, '\uF934', 1381, '\uF935', 2155, '\uF936', 2156, '\uF937', 2157, '\uF938', 2158, '\uF939', 2159, '\uF93A', 2160, '\uF93B', 2161, '\uF93C', 2162, '\uF93D', 2163, '\uF93E', 2164, '\uF93F', 2165, '\uF940', 1454, '\uF941', 2166, '\uF942', 2167, '\uF943', 2168, '\uF944', 2169, '\uF945', 2170, '\uF946', 2171, '\uF947', 2172, '\uF948', 2173, '\uF949', 2174, '\uF94A', 2175, '\uF94B', 2176, '\uF94C', 2177, '\uF94D', 2178, '\uF94E', 2179, '\uF94F', 2180, '\uF950', 2181, '\uF951', 2182, '\uF952', 2183, '\uF953', 2184, '\uF954', 2185, '\uF955', 2186, '\uF956', 2187, '\uF957', 2188, '\uF958', 2189, '\uF959', 2190, '\uF95A', 2191, '\uF95B', 2192, '\uF95C', 2123, '\uF95D', 2193, '\uF95E', 2194, '\uF95F', 2195, '\uF960', 2196, '\uF961', 2197, '\uF962', 2198, '\uF963', 2199, '\uF964', 2200, '\uF965', 2201, '\uF966', 2202, '\uF967', 2203, '\uF968', 2204, '\uF969', 2205, '\uF96A', 2206, '\uF96B', 2207, '\uF96C', 2208, '\uF96D', 2209, '\uF96E', 2210, '\uF96F', 2211, '\uF970', 2212, '\uF971', 1417, '\uF972', 2213, '\uF973', 2214, '\uF974', 2215, '\uF975', 2216, '\uF976', 2217, '\uF977', 2218, '\uF978', 2219, '\uF979', 2220, '\uF97A', 2221, '\uF97B', 2222, '\uF97C', 2223, '\uF97D', 2224, '\uF97E', 2225, '\uF97F', 2226, '\uF980', 2227, '\uF981', 1294, '\uF982', 2228, '\uF983', 2229, '\uF984', 2230, '\uF985', 2231, '\uF986', 2232, '\uF987', 2233, '\uF988', 2234, '\uF989', 2235, '\uF98A', 1275, '\uF98B', 2236, '\uF98C', 2237, '\uF98D', 2238, '\uF98E', 2239, '\uF98F', 2240, '\uF990', 2241, '\uF991', 2242, '\uF992', 2243, '\uF993', 2244, '\uF994', 2245, '\uF995', 2246, '\uF996', 2247, '\uF997', 2248, '\uF998', 2249, '\uF999', 2250, '\uF99A', 2251, '\uF99B', 2252, '\uF99C', 2253, '\uF99D', 2254, '\uF99E', 2255, '\uF99F', 2256, '\uF9A0', 2257, '\uF9A1', 2211, '\uF9A2', 2258, '\uF9A3', 2259, '\uF9A4', 2260, '\uF9A5', 2261, '\uF9A6', 2262, '\uF9A7', 2263, '\uF9A8', 2264, '\uF9A9', 2265, '\uF9AA', 2195, '\uF9AB', 2266, '\uF9AC', 2267, '\uF9AD', 2268, '\uF9AE', 2269, '\uF9AF', 2270, '\uF9B0', 2271, '\uF9B1', 2272, '\uF9B2', 2273, '\uF9B3', 2274, '\uF9B4', 2275, '\uF9B5', 2276, '\uF9B6', 2277, '\uF9B7', 2278, '\uF9B8', 2279, '\uF9B9', 2280, '\uF9BA', 2281, '\uF9BB', 2282, '\uF9BC', 2283, '\uF9BD', 2284, '\uF9BE', 2285, '\uF9BF', 2123, '\uF9C0', 2286, '\uF9C1', 2287, '\uF9C2', 2288, '\uF9C3', 2289, '\uF9C4', 1468, '\uF9C5', 2290, '\uF9C6', 2291, '\uF9C7', 2292, '\uF9C8', 2293, '\uF9C9', 2294, '\uF9CA', 2295, '\uF9CB', 2296, '\uF9CC', 2297, '\uF9CD', 2298, '\uF9CE', 2299, '\uF9CF', 2300, '\uF9D0', 2301, '\uF9D1', 1741, '\uF9D2', 2302, '\uF9D3', 2303, '\uF9D4', 2304, '\uF9D5', 2305, '\uF9D6', 2306, '\uF9D7', 2307, '\uF9D8', 2308, '\uF9D9', 2309, '\uF9DA', 2310, '\uF9DB', 2197, '\uF9DC', 2311, '\uF9DD', 2312, '\uF9DE', 2313, '\uF9DF', 2314, '\uF9E0', 2315, '\uF9E1', 2316, '\uF9E2', 2317, '\uF9E3', 2318, '\uF9E4', 2319, '\uF9E5', 2320, '\uF9E6', 2321, '\uF9E7', 2322, '\uF9E8', 2323, '\uF9E9', 1422, '\uF9EA', 2324, '\uF9EB', 2325, '\uF9EC', 2326, '\uF9ED', 2327, '\uF9EE', 2328, '\uF9EF', 2329, '\uF9F0', 2330, '\uF9F1', 2331, '\uF9F2', 2332, '\uF9F3', 2333, '\uF9F4', 2334, '\uF9F5', 2335, '\uF9F6', 2336, '\uF9F7', 1373, '\uF9F8', 2337, '\uF9F9', 2338, '\uF9FA', 2339, '\uF9FB', 2340, '\uF9FC', 2341, '\uF9FD', 2342, '\uF9FE', 2343, '\uF9FF', 2344, '\uFA00', 2345, '\uFA01', 2346, '\uFA02', 2347, '\uFA03', 2348, '\uFA04', 2349, '\uFA05', 2350, '\uFA06', 2351, '\uFA07', 2352, '\uFA08', 1400, '\uFA09', 2353, '\uFA0A', 1403, '\uFA0B', 2354, '\uFA0C', 2355, '\uFA0D', 2356, '\uFA10', 2357, '\uFA12', 2358, '\uFA15', 2359, '\uFA16', 2360, '\uFA17', 2361, '\uFA18', 2362, '\uFA19', 2363, '\uFA1A', 2364, '\uFA1B', 2365, '\uFA1C', 2366, '\uFA1D', 2367, '\uFA1E', 1380, '\uFA20', 2368, '\uFA22', 2369, '\uFA25', 2370, '\uFA26', 2371, '\uFA2A', 2372, '\uFA2B', 2373, '\uFA2C', 2374, '\uFA2D', 2375, '\uFA30', 2376, '\uFA31', 2377, '\uFA32', 2378, '\uFA33', 2379, '\uFA34', 2380, '\uFA35', 2381, '\uFA36', 2382, '\uFA37', 2383, '\uFA38', 2384, '\uFA39', 2385, '\uFA3A', 2386, '\uFA3B', 2387, '\uFA3C', 1301, '\uFA3D', 2388, '\uFA3E', 2389, '\uFA3F', 2390, '\uFA40', 2391, '\uFA41', 2392, '\uFA42', 2393, '\uFA43', 2394, '\uFA44', 2395, '\uFA45', 2396, '\uFA46', 2397, '\uFA47', 2398, '\uFA48', 2399, '\uFA49', 2400, '\uFA4A', 2401, '\uFA4B', 2402, '\uFA4C', 1746, '\uFA4D', 2403, '\uFA4E', 2404, '\uFA4F', 2405, '\uFA50', 2406, '\uFA51', 1750, '\uFA52', 2407, '\uFA53', 2408, '\uFA54', 2409, '\uFA55', 2410, '\uFA56', 2411, '\uFA57', 2247, '\uFA58', 2412, '\uFA59', 2413, '\uFA5A', 2414, '\uFA5B', 2415, '\uFA5C', 2416, '\uFA5D', 2417, '\uFA5E', 2417, '\uFA5F', 2418, '\uFA60', 2419, '\uFA61', 2420, '\uFA62', 2421, '\uFA63', 2422, '\uFA64', 2423, '\uFA65', 2424, '\uFA66', 2425, '\uFA67', 2370, '\uFA68', 2426, '\uFA69', 2427, '\uFA6A', 2428, '\uFA70', 2429, '\uFA71', 2430, '\uFA72', 2431, '\uFA73', 2432, '\uFA74', 2433, '\uFA75', 2434, '\uFA76', 2435, '\uFA77', 2436, '\uFA78', 2382, '\uFA79', 2437, '\uFA7A', 2438, '\uFA7B', 2439, '\uFA7C', 2357, '\uFA7D', 2440, '\uFA7E', 2441, '\uFA7F', 2442, '\uFA80', 2443, '\uFA81', 2444, '\uFA82', 2445, '\uFA83', 2446, '\uFA84', 2447, '\uFA85', 2448, '\uFA86', 2449, '\uFA87', 2450, '\uFA88', 2451, '\uFA89', 2390, '\uFA8A', 2452, '\uFA8B', 2391, '\uFA8C', 2453, '\uFA8D', 2454, '\uFA8E', 2455, '\uFA8F', 2456, '\uFA90', 2457, '\uFA91', 2358, '\uFA92', 2144, '\uFA93', 2458, '\uFA94', 2459, '\uFA95', 1334, '\uFA96', 2212, '\uFA97', 2295, '\uFA98', 2460, '\uFA99', 2461, '\uFA9A', 2398, '\uFA9B', 2462, '\uFA9C', 2399, '\uFA9D', 2463, '\uFA9E', 2464, '\uFA9F', 2465, '\uFAA0', 2360, '\uFAA1', 2466, '\uFAA2', 2467, '\uFAA3', 2468, '\uFAA4', 2469, '\uFAA5', 2470, '\uFAA6', 2361, '\uFAA7', 2471, '\uFAA8', 2472, '\uFAA9', 2473, '\uFAAA', 2474, '\uFAAB', 2475, '\uFAAC', 2476, '\uFAAD', 2411, '\uFAAE', 2477, '\uFAAF', 2478, '\uFAB0', 2247, '\uFAB1', 2479, '\uFAB2', 2415, '\uFAB3', 2480, '\uFAB4', 2481, '\uFAB5', 2482, '\uFAB6', 2483, '\uFAB7', 2484, '\uFAB8', 2420, '\uFAB9', 2485, '\uFABA', 2369, '\uFABB', 2486, '\uFABC', 2421, '\uFABD', 2193, '\uFABE', 2487, '\uFABF', 2422, '\uFAC0', 2488, '\uFAC1', 2424, '\uFAC2', 2489, '\uFAC3', 2490, '\uFAC4', 2491, '\uFAC5', 2492, '\uFAC6', 2493, '\uFAC7', 2426, '\uFAC8', 2366, '\uFAC9', 2494, '\uFACA', 2427, '\uFACB', 2495, '\uFACC', 2428, '\uFACD', 2496, '\uFACE', 1469, '\uFACF', 2497, '\uFAD0', 2498, '\uFAD1', 2499, '\uFAD2', 2500, '\uFAD3', 2501, '\uFAD4', 2502, '\uFAD5', 2503, '\uFAD6', 2504, '\uFAD7', 2505, '\uFAD8', 2506, '\uFAD9', 2507, '\uFB00', 2508, '\uFB01', 2509, '\uFB02', 2510, '\uFB03', 2511, '\uFB04', 2512, '\uFB05', 2513, '\uFB06', 2513, '\uFB13', 2514, '\uFB14', 2515, '\uFB15', 2516, '\uFB16', 2517, '\uFB17', 2518, '\uFB1D', 2519, '\uFB1F', 2520, '\uFB20', 2521, '\uFB21', 1078, '\uFB22', 1081, '\uFB23', 2522, '\uFB24', 2523, '\uFB25', 2524, '\uFB26', 2525, '\uFB27', 2526, '\uFB28', 2527, '\uFB29', 1054, '\uFB2A', 2528, '\uFB2B', 2529, '\uFB2C', 2530, '\uFB2D', 2531, '\uFB2E', 2532, '\uFB2F', 2533, '\uFB30', 2534, '\uFB31', 2535, '\uFB32', 2536, '\uFB33', 2537, '\uFB34', 2538, '\uFB35', 2539, '\uFB36', 2540, '\uFB38', 2541, '\uFB39', 2542, '\uFB3A', 2543, '\uFB3B', 2544, '\uFB3C', 2545, '\uFB3E', 2546, '\uFB40', 2547, '\uFB41', 2548, '\uFB43', 2549, '\uFB44', 2550, '\uFB46', 2551, '\uFB47', 2552, '\uFB48', 2553, '\uFB49', 2554, '\uFB4A', 2555, '\uFB4B', 2556, '\uFB4C', 2557, '\uFB4D', 2558, '\uFB4E', 2559, '\uFB4F', 2560, '\uFB50', 2561, '\uFB51', 2561, '\uFB52', 2562, '\uFB53', 2562, '\uFB54', 2562, '\uFB55', 2562, '\uFB56', 2563, '\uFB57', 2563, '\uFB58', 2563, '\uFB59', 2563, '\uFB5A', 2564, '\uFB5B', 2564, '\uFB5C', 2564, '\uFB5D', 2564, '\uFB5E', 2565, '\uFB5F', 2565, '\uFB60', 2565, '\uFB61', 2565, '\uFB62', 2566, '\uFB63', 2566, '\uFB64', 2566, '\uFB65', 2566, '\uFB66', 2567, '\uFB67', 2567, '\uFB68', 2567, '\uFB69', 2567, '\uFB6A', 2568, '\uFB6B', 2568, '\uFB6C', 2568, '\uFB6D', 2568, '\uFB6E', 2569, '\uFB6F', 2569, '\uFB70', 2569, '\uFB71', 2569, '\uFB72', 2570, '\uFB73', 2570, '\uFB74', 2570, '\uFB75', 2570, '\uFB76', 2571, '\uFB77', 2571, '\uFB78', 2571, '\uFB79', 2571, '\uFB7A', 2572, '\uFB7B', 2572, '\uFB7C', 2572, '\uFB7D', 2572, '\uFB7E', 2573, '\uFB7F', 2573, '\uFB80', 2573, '\uFB81', 2573, '\uFB82', 2574, '\uFB83', 2574, '\uFB84', 2575, '\uFB85', 2575, '\uFB86', 2576, '\uFB87', 2576, '\uFB88', 2577, '\uFB89', 2577, '\uFB8A', 2578, '\uFB8B', 2578, '\uFB8C', 2579, '\uFB8D', 2579, '\uFB8E', 2580, '\uFB8F', 2580, '\uFB90', 2580, '\uFB91', 2580, '\uFB92', 2581, '\uFB93', 2581, '\uFB94', 2581, '\uFB95', 2581, '\uFB96', 2582, '\uFB97', 2582, '\uFB98', 2582, '\uFB99', 2582, '\uFB9A', 2583, '\uFB9B', 2583, '\uFB9C', 2583, '\uFB9D', 2583, '\uFB9E', 2584, '\uFB9F', 2584, '\uFBA0', 2585, '\uFBA1', 2585, '\uFBA2', 2585, '\uFBA3', 2585, '\uFBA4', 405, '\uFBA5', 405, '\uFBA6', 2586, '\uFBA7', 2586, '\uFBA8', 2586, '\uFBA9', 2586, '\uFBAA', 2587, '\uFBAB', 2587, '\uFBAC', 2587, '\uFBAD', 2587, '\uFBAE', 2588, '\uFBAF', 2588, '\uFBB0', 407, '\uFBB1', 407, '\uFBD3', 2589, '\uFBD4', 2589, '\uFBD5', 2589, '\uFBD6', 2589, '\uFBD7', 2590, '\uFBD8', 2590, '\uFBD9', 2591, '\uFBDA', 2591, '\uFBDB', 2592, '\uFBDC', 2592, '\uFBDD', 403, '\uFBDE', 2593, '\uFBDF', 2593, '\uFBE0', 2594, '\uFBE1', 2594, '\uFBE2', 2595, '\uFBE3', 2595, '\uFBE4', 2596, '\uFBE5', 2596, '\uFBE6', 2596, '\uFBE7', 2596, '\uFBE8', 2597, '\uFBE9', 2597, '\uFBEA', 2598, '\uFBEB', 2598, '\uFBEC', 2599, '\uFBED', 2599, '\uFBEE', 2600, '\uFBEF', 2600, '\uFBF0', 2601, '\uFBF1', 2601, '\uFBF2', 2602, '\uFBF3', 2602, '\uFBF4', 2603, '\uFBF5', 2603, '\uFBF6', 2604, '\uFBF7', 2604, '\uFBF8', 2604, '\uFBF9', 2605, '\uFBFA', 2605, '\uFBFB', 2605, '\uFBFC', 2606, '\uFBFD', 2606, '\uFBFE', 2606, '\uFBFF', 2606, '\uFC00', 2607, '\uFC01', 2608, '\uFC02', 2609, '\uFC03', 2605, '\uFC04', 2610, '\uFC05', 2611, '\uFC06', 2612, '\uFC07', 2613, '\uFC08', 2614, '\uFC09', 2615, '\uFC0A', 2616, '\uFC0B', 2617, '\uFC0C', 2618, '\uFC0D', 2619, '\uFC0E', 2620, '\uFC0F', 2621, '\uFC10', 2622, '\uFC11', 2623, '\uFC12', 2624, '\uFC13', 2625, '\uFC14', 2626, '\uFC15', 2627, '\uFC16', 2628, '\uFC17', 2629, '\uFC18', 2630, '\uFC19', 2631, '\uFC1A', 2632, '\uFC1B', 2633, '\uFC1C', 2634, '\uFC1D', 2635, '\uFC1E', 2636, '\uFC1F', 2637, '\uFC20', 2638, '\uFC21', 2639, '\uFC22', 2640, '\uFC23', 2641, '\uFC24', 2642, '\uFC25', 2643, '\uFC26', 2644, '\uFC27', 2645, '\uFC28', 2646, '\uFC29', 2647, '\uFC2A', 2648, '\uFC2B', 2649, '\uFC2C', 2650, '\uFC2D', 2651, '\uFC2E', 2652, '\uFC2F', 2653, '\uFC30', 2654, '\uFC31', 2655, '\uFC32', 2656, '\uFC33', 2657, '\uFC34', 2658, '\uFC35', 2659, '\uFC36', 2660, '\uFC37', 2661, '\uFC38', 2662, '\uFC39', 2663, '\uFC3A', 2664, '\uFC3B', 2665, '\uFC3C', 2666, '\uFC3D', 2667, '\uFC3E', 2668, '\uFC3F', 2669, '\uFC40', 2670, '\uFC41', 2671, '\uFC42', 2672, '\uFC43', 2673, '\uFC44', 2674, '\uFC45', 2675, '\uFC46', 2676, '\uFC47', 2677, '\uFC48', 2678, '\uFC49', 2679, '\uFC4A', 2680, '\uFC4B', 2681, '\uFC4C', 2682, '\uFC4D', 2683, '\uFC4E', 2684, '\uFC4F', 2685, '\uFC50', 2686, '\uFC51', 2687, '\uFC52', 2688, '\uFC53', 2689, '\uFC54', 2690, '\uFC55', 2691, '\uFC56', 2692, '\uFC57', 2693, '\uFC58', 2694, '\uFC59', 2695, '\uFC5A', 2696, '\uFC5B', 2697, '\uFC5C', 2698, '\uFC5D', 2699, '\uFC5E', 2700, '\uFC5F', 2701, '\uFC60', 2702, '\uFC61', 2703, '\uFC62', 2704, '\uFC63', 2705, '\uFC64', 2706, '\uFC65', 2707, '\uFC66', 2609, '\uFC67', 2708, '\uFC68', 2605, '\uFC69', 2610, '\uFC6A', 2709, '\uFC6B', 2710, '\uFC6C', 2614, '\uFC6D', 2711, '\uFC6E', 2615, '\uFC6F', 2616, '\uFC70', 2712, '\uFC71', 2713, '\uFC72', 2620, '\uFC73', 2714, '\uFC74', 2621, '\uFC75', 2622, '\uFC76', 2715, '\uFC77', 2716, '\uFC78', 2624, '\uFC79', 2717, '\uFC7A', 2625, '\uFC7B', 2626, '\uFC7C', 2655, '\uFC7D', 2656, '\uFC7E', 2659, '\uFC7F', 2660, '\uFC80', 2661, '\uFC81', 2665, '\uFC82', 2666, '\uFC83', 2667, '\uFC84', 2668, '\uFC85', 2672, '\uFC86', 2673, '\uFC87', 2674, '\uFC88', 2718, '\uFC89', 2678, '\uFC8A', 2719, '\uFC8B', 2720, '\uFC8C', 2684, '\uFC8D', 2721, '\uFC8E', 2685, '\uFC8F', 2686, '\uFC90', 2699, '\uFC91', 2722, '\uFC92', 2723, '\uFC93', 2694, '\uFC94', 2724, '\uFC95', 2695, '\uFC96', 2696, '\uFC97', 2607, '\uFC98', 2608, '\uFC99', 2725, '\uFC9A', 2609, '\uFC9B', 2726, '\uFC9C', 2611, '\uFC9D', 2612, '\uFC9E', 2613, '\uFC9F', 2614, '\uFCA0', 2727, '\uFCA1', 2617, '\uFCA2', 2618, '\uFCA3', 2619, '\uFCA4', 2620, '\uFCA5', 2728, '\uFCA6', 2624, '\uFCA7', 2627, '\uFCA8', 2628, '\uFCA9', 2629, '\uFCAA', 2630, '\uFCAB', 2631, '\uFCAC', 2633, '\uFCAD', 2634, '\uFCAE', 2635, '\uFCAF', 2636, '\uFCB0', 2637, '\uFCB1', 2638, '\uFCB2', 2729, '\uFCB3', 2639, '\uFCB4', 2640, '\uFCB5', 2641, '\uFCB6', 2642, '\uFCB7', 2643, '\uFCB8', 2644, '\uFCB9', 2646, '\uFCBA', 2647, '\uFCBB', 2648, '\uFCBC', 2649, '\uFCBD', 2650, '\uFCBE', 2651, '\uFCBF', 2652, '\uFCC0', 2653, '\uFCC1', 2654, '\uFCC2', 2657, '\uFCC3', 2658, '\uFCC4', 2662, '\uFCC5', 2663, '\uFCC6', 2664, '\uFCC7', 2665, '\uFCC8', 2666, '\uFCC9', 2669, '\uFCCA', 2670, '\uFCCB', 2671, '\uFCCC', 2672, '\uFCCD', 2730, '\uFCCE', 2675, '\uFCCF', 2676, '\uFCD0', 2677, '\uFCD1', 2678, '\uFCD2', 2681, '\uFCD3', 2682, '\uFCD4', 2683, '\uFCD5', 2684, '\uFCD6', 2731, '\uFCD7', 2687, '\uFCD8', 2688, '\uFCD9', 2732, '\uFCDA', 2691, '\uFCDB', 2692, '\uFCDC', 2693, '\uFCDD', 2694, '\uFCDE', 2733, '\uFCDF', 2609, '\uFCE0', 2726, '\uFCE1', 2614, '\uFCE2', 2727, '\uFCE3', 2620, '\uFCE4', 2728, '\uFCE5', 2624, '\uFCE6', 2734, '\uFCE7', 2637, '\uFCE8', 2735, '\uFCE9', 2736, '\uFCEA', 2737, '\uFCEB', 2665, '\uFCEC', 2666, '\uFCED', 2672, '\uFCEE', 2684, '\uFCEF', 2731, '\uFCF0', 2694, '\uFCF1', 2733, '\uFCF2', 2738, '\uFCF3', 2739, '\uFCF4', 2740, '\uFCF5', 2741, '\uFCF6', 2742, '\uFCF7', 2743, '\uFCF8', 2744, '\uFCF9', 2745, '\uFCFA', 2746, '\uFCFB', 2747, '\uFCFC', 2748, '\uFCFD', 2749, '\uFCFE', 2750, '\uFCFF', 2751, '\uFD00', 2752, '\uFD01', 2753, '\uFD02', 2754, '\uFD03', 2755, '\uFD04', 2756, '\uFD05', 2757, '\uFD06', 2758, '\uFD07', 2759, '\uFD08', 2760, '\uFD09', 2761, '\uFD0A', 2762, '\uFD0B', 2763, '\uFD0C', 2736, '\uFD0D', 2764, '\uFD0E', 2765, '\uFD0F', 2766, '\uFD10', 2767, '\uFD11', 2741, '\uFD12', 2742, '\uFD13', 2743, '\uFD14', 2744, '\uFD15', 2745, '\uFD16', 2746, '\uFD17', 2747, '\uFD18', 2748, '\uFD19', 2749, '\uFD1A', 2750, '\uFD1B', 2751, '\uFD1C', 2752, '\uFD1D', 2753, '\uFD1E', 2754, '\uFD1F', 2755, '\uFD20', 2756, '\uFD21', 2757, '\uFD22', 2758, '\uFD23', 2759, '\uFD24', 2760, '\uFD25', 2761, '\uFD26', 2762, '\uFD27', 2763, '\uFD28', 2736, '\uFD29', 2764, '\uFD2A', 2765, '\uFD2B', 2766, '\uFD2C', 2767, '\uFD2D', 2761, '\uFD2E', 2762, '\uFD2F', 2763, '\uFD30', 2736, '\uFD31', 2735, '\uFD32', 2737, '\uFD33', 2645, '\uFD34', 2634, '\uFD35', 2635, '\uFD36', 2636, '\uFD37', 2761, '\uFD38', 2762, '\uFD39', 2763, '\uFD3A', 2645, '\uFD3B', 2646, '\uFD3C', 2768, '\uFD3D', 2768, '\uFD50', 2769, '\uFD51', 2770, '\uFD52', 2770, '\uFD53', 2771, '\uFD54', 2772, '\uFD55', 2773, '\uFD56', 2774, '\uFD57', 2775, '\uFD58', 2776, '\uFD59', 2776, '\uFD5A', 2777, '\uFD5B', 2778, '\uFD5C', 2779, '\uFD5D', 2780, '\uFD5E', 2781, '\uFD5F', 2782, '\uFD60', 2782, '\uFD61', 2783, '\uFD62', 2784, '\uFD63', 2784, '\uFD64', 2785, '\uFD65', 2785, '\uFD66', 2786, '\uFD67', 2787, '\uFD68', 2787, '\uFD69', 2788, '\uFD6A', 2789, '\uFD6B', 2789, '\uFD6C', 2790, '\uFD6D', 2790, '\uFD6E', 2791, '\uFD6F', 2792, '\uFD70', 2792, '\uFD71', 2793, '\uFD72', 2793, '\uFD73', 2794, '\uFD74', 2795, '\uFD75', 2796, '\uFD76', 2797, '\uFD77', 2797, '\uFD78', 2798, '\uFD79', 2799, '\uFD7A', 2800, '\uFD7B', 2801, '\uFD7C', 2802, '\uFD7D', 2802, '\uFD7E', 2803, '\uFD7F', 2804, '\uFD80', 2805, '\uFD81', 2806, '\uFD82', 2807, '\uFD83', 2808, '\uFD84', 2808, '\uFD85', 2809, '\uFD86', 2809, '\uFD87', 2810, '\uFD88', 2810, '\uFD89', 2811, '\uFD8A', 2812, '\uFD8B', 2813, '\uFD8C', 2814, '\uFD8D', 2815, '\uFD8E', 2816, '\uFD8F', 2817, '\uFD92', 2818, '\uFD93', 2819, '\uFD94', 2820, '\uFD95', 2821, '\uFD96', 2822, '\uFD97', 2823, '\uFD98', 2823, '\uFD99', 2824, '\uFD9A', 2825, '\uFD9B', 2826, '\uFD9C', 2827, '\uFD9D', 2827, '\uFD9E', 2828, '\uFD9F', 2829, '\uFDA0', 2830, '\uFDA1', 2831, '\uFDA2', 2832, '\uFDA3', 2833, '\uFDA4', 2834, '\uFDA5', 2835, '\uFDA6', 2836, '\uFDA7', 2837, '\uFDA8', 2838, '\uFDA9', 2839, '\uFDAA', 2840, '\uFDAB', 2841, '\uFDAC', 2842, '\uFDAD', 2843, '\uFDAE', 2844, '\uFDAF', 2845, '\uFDB0', 2846, '\uFDB1', 2847, '\uFDB2', 2848, '\uFDB3', 2849, '\uFDB4', 2803, '\uFDB5', 2805, '\uFDB6', 2850, '\uFDB7', 2851, '\uFDB8', 2852, '\uFDB9', 2853, '\uFDBA', 2854, '\uFDBB', 2855, '\uFDBC', 2854, '\uFDBD', 2852, '\uFDBE', 2856, '\uFDBF', 2857, '\uFDC0', 2858, '\uFDC1', 2859, '\uFDC2', 2860, '\uFDC3', 2855, '\uFDC4', 2796, '\uFDC5', 2786, '\uFDC6', 2861, '\uFDC7', 2862, '\uFDF0', 2863, '\uFDF1', 2864, '\uFDF2', 2865, '\uFDF3', 2866, '\uFDF4', 2867, '\uFDF5', 2868, '\uFDF6', 2869, '\uFDF7', 2870, '\uFDF8', 2871, '\uFDF9', 2872, '\uFDFA', 2873, '\uFDFB', 2874, '\uFDFC', 2875, '\uFE10', 2876, '\uFE11', 2877, '\uFE12', 2878, '\uFE13', 2879, '\uFE14', 309, '\uFE15', 2880, '\uFE16', 2881, '\uFE17', 2882, '\uFE18', 2883, '\uFE19', 1036, '\uFE30', 1035, '\uFE31', 2884, '\uFE32', 2885, '\uFE33', 2886, '\uFE34', 2886, '\uFE35', 1057, '\uFE36', 1058, '\uFE37', 2887, '\uFE38', 2888, '\uFE39', 2889, '\uFE3A', 2890, '\uFE3B', 2891, '\uFE3C', 2892, '\uFE3D', 2893, '\uFE3E', 2894, '\uFE3F', 1167, '\uFE40', 1168, '\uFE41', 2895, '\uFE42', 2896, '\uFE43', 2897, '\uFE44', 2898, '\uFE47', 2899, '\uFE48', 2900, '\uFE49', 1042, '\uFE4A', 1042, '\uFE4B', 1042, '\uFE4C', 1042, '\uFE4D', 2886, '\uFE4E', 2886, '\uFE4F', 2886, '\uFE50', 2876, '\uFE51', 2877, '\uFE52', 1034, '\uFE54', 309, '\uFE55', 2879, '\uFE56', 2881, '\uFE57', 2880, '\uFE58', 2884, '\uFE59', 1057, '\uFE5A', 1058, '\uFE5B', 2887, '\uFE5C', 2888, '\uFE5D', 2889, '\uFE5E', 2890, '\uFE5F', 2901, '\uFE60', 2902, '\uFE61', 2903, '\uFE62', 1054, '\uFE63', 2904, '\uFE64', 2905, '\uFE65', 2906, '\uFE66', 1056, '\uFE68', 2907, '\uFE69', 2908, '\uFE6A', 2909, '\uFE6B', 2910, '\uFE70', 2911, '\uFE71', 2912, '\uFE72', 2913, '\uFE74', 2914, '\uFE76', 2915, '\uFE77', 2916, '\uFE78', 2917, '\uFE79', 2918, '\uFE7A', 2919, '\uFE7B', 2920, '\uFE7C', 2921, '\uFE7D', 2922, '\uFE7E', 2923, '\uFE7F', 2924, '\uFE80', 2925, '\uFE81', 396, '\uFE82', 396, '\uFE83', 397, '\uFE84', 397, '\uFE85', 398, '\uFE86', 398, '\uFE87', 399, '\uFE88', 399, '\uFE89', 400, '\uFE8A', 400, '\uFE8B', 400, '\uFE8C', 400, '\uFE8D', 2926, '\uFE8E', 2926, '\uFE8F', 2927, '\uFE90', 2927, '\uFE91', 2927, '\uFE92', 2927, '\uFE93', 2928, '\uFE94', 2928, '\uFE95', 2929, '\uFE96', 2929, '\uFE97', 2929, '\uFE98', 2929, '\uFE99', 2930, '\uFE9A', 2930, '\uFE9B', 2930, '\uFE9C', 2930, '\uFE9D', 2931, '\uFE9E', 2931, '\uFE9F', 2931, '\uFEA0', 2931, '\uFEA1', 2932, '\uFEA2', 2932, '\uFEA3', 2932, '\uFEA4', 2932, '\uFEA5', 2933, '\uFEA6', 2933, '\uFEA7', 2933, '\uFEA8', 2933, '\uFEA9', 2934, '\uFEAA', 2934, '\uFEAB', 2935, '\uFEAC', 2935, '\uFEAD', 2936, '\uFEAE', 2936, '\uFEAF', 2937, '\uFEB0', 2937, '\uFEB1', 2938, '\uFEB2', 2938, '\uFEB3', 2938, '\uFEB4', 2938, '\uFEB5', 2939, '\uFEB6', 2939, '\uFEB7', 2939, '\uFEB8', 2939, '\uFEB9', 2940, '\uFEBA', 2940, '\uFEBB', 2940, '\uFEBC', 2940, '\uFEBD', 2941, '\uFEBE', 2941, '\uFEBF', 2941, '\uFEC0', 2941, '\uFEC1', 2942, '\uFEC2', 2942, '\uFEC3', 2942, '\uFEC4', 2942, '\uFEC5', 2943, '\uFEC6', 2943, '\uFEC7', 2943, '\uFEC8', 2943, '\uFEC9', 2944, '\uFECA', 2944, '\uFECB', 2944, '\uFECC', 2944, '\uFECD', 2945, '\uFECE', 2945, '\uFECF', 2945, '\uFED0', 2945, '\uFED1', 2946, '\uFED2', 2946, '\uFED3', 2946, '\uFED4', 2946, '\uFED5', 2947, '\uFED6', 2947, '\uFED7', 2947, '\uFED8', 2947, '\uFED9', 2948, '\uFEDA', 2948, '\uFEDB', 2948, '\uFEDC', 2948, '\uFEDD', 2949, '\uFEDE', 2949, '\uFEDF', 2949, '\uFEE0', 2949, '\uFEE1', 2950, '\uFEE2', 2950, '\uFEE3', 2950, '\uFEE4', 2950, '\uFEE5', 2951, '\uFEE6', 2951, '\uFEE7', 2951, '\uFEE8', 2951, '\uFEE9', 2952, '\uFEEA', 2952, '\uFEEB', 2952, '\uFEEC', 2952, '\uFEED', 2953, '\uFEEE', 2953, '\uFEEF', 2597, '\uFEF0', 2597, '\uFEF1', 2954, '\uFEF2', 2954, '\uFEF3', 2954, '\uFEF4', 2954, '\uFEF5', 2955, '\uFEF6', 2955, '\uFEF7', 2956, '\uFEF8', 2956, '\uFEF9', 2957, '\uFEFA', 2957, '\uFEFB', 2958, '\uFEFC', 2958, '\uFF01', 2880, '\uFF02', 2959, '\uFF03', 2901, '\uFF04', 2908, '\uFF05', 2909, '\uFF06', 2902, '\uFF07', 2960, '\uFF08', 1057, '\uFF09', 1058, '\uFF0A', 2903, '\uFF0B', 1054, '\uFF0C', 2876, '\uFF0D', 2904, '\uFF0E', 1034, '\uFF0F', 2961, '\uFF10', 1047, '\uFF11', 9, '\uFF12', 4, '\uFF13', 5, '\uFF14', 1048, '\uFF15', 1049, '\uFF16', 1050, '\uFF17', 1051, '\uFF18', 1052, '\uFF19', 1053, '\uFF1A', 2879, '\uFF1B', 309, '\uFF1C', 2905, '\uFF1D', 1056, '\uFF1E', 2906, '\uFF1F', 2881, '\uFF20', 2910, '\uFF21', 489, '\uFF22', 491, '\uFF23', 1063, '\uFF24', 492, '\uFF25', 493, '\uFF26', 1077, '\uFF27', 495, '\uFF28', 496, '\uFF29', 497, '\uFF2A', 498, '\uFF2B', 499, '\uFF2C', 500, '\uFF2D', 501, '\uFF2E', 502, '\uFF2F', 503, '\uFF30', 505, '\uFF31', 1071, '\uFF32', 506, '\uFF33', 1246, '\uFF34', 507, '\uFF35', 508, '\uFF36', 1102, '\uFF37', 509, '\uFF38', 1107, '\uFF39', 1247, '\uFF3A', 1075, '\uFF3B', 2899, '\uFF3C', 2907, '\uFF3D', 2900, '\uFF3E', 2962, '\uFF3F', 2886, '\uFF40', 1022, '\uFF41', 2, '\uFF42', 513, '\uFF43', 539, '\uFF44', 514, '\uFF45', 515, '\uFF46', 542, '\uFF47', 519, '\uFF48', 284, '\uFF49', 536, '\uFF4A', 286, '\uFF4B', 520, '\uFF4C', 300, '\uFF4D', 521, '\uFF4E', 1059, '\uFF4F', 10, '\uFF50', 526, '\uFF51', 1248, '\uFF52', 287, '\uFF53', 180, '\uFF54', 527, '\uFF55', 528, '\uFF56', 531, '\uFF57', 291, '\uFF58', 301, '\uFF59', 292, '\uFF5A', 569, '\uFF5B', 2887, '\uFF5C', 2963, '\uFF5D', 2888, '\uFF5E', 2964, '\uFF5F', 2965, '\uFF60', 2966, '\uFF61', 2878, '\uFF62', 2895, '\uFF63', 2896, '\uFF64', 2877, '\uFF65', 2967, '\uFF66', 1849, '\uFF67', 2968, '\uFF68', 2969, '\uFF69', 2970, '\uFF6A', 2971, '\uFF6B', 2972, '\uFF6C', 2973, '\uFF6D', 2974, '\uFF6E', 2975, '\uFF6F', 2976, '\uFF70', 2977, '\uFF71', 1803, '\uFF72', 1804, '\uFF73', 1805, '\uFF74', 1806, '\uFF75', 1807, '\uFF76', 1808, '\uFF77', 1809, '\uFF78', 1810, '\uFF79', 1811, '\uFF7A', 1812, '\uFF7B', 1813, '\uFF7C', 1814, '\uFF7D', 1815, '\uFF7E', 1816, '\uFF7F', 1817, '\uFF80', 1818, '\uFF81', 1819, '\uFF82', 1820, '\uFF83', 1821, '\uFF84', 1822, '\uFF85', 1823, '\uFF86', 1824, '\uFF87', 1825, '\uFF88', 1826, '\uFF89', 1827, '\uFF8A', 1828, '\uFF8B', 1829, '\uFF8C', 1830, '\uFF8D', 1831, '\uFF8E', 1832, '\uFF8F', 1833, '\uFF90', 1834, '\uFF91', 1835, '\uFF92', 1836, '\uFF93', 1837, '\uFF94', 1838, '\uFF95', 1839, '\uFF96', 1840, '\uFF97', 1841, '\uFF98', 1842, '\uFF99', 1843, '\uFF9A', 1844, '\uFF9B', 1845, '\uFF9C', 1846, '\uFF9D', 2978, '\uFF9E', 2979, '\uFF9F', 2980, '\uFFA0', 1587, '\uFFA1', 1536, '\uFFA2', 1537, '\uFFA3', 1538, '\uFFA4', 1539, '\uFFA5', 1540, '\uFFA6', 1541, '\uFFA7', 1542, '\uFFA8', 1543, '\uFFA9', 1544, '\uFFAA', 1545, '\uFFAB', 1546, '\uFFAC', 1547, '\uFFAD', 1548, '\uFFAE', 1549, '\uFFAF', 1550, '\uFFB0', 1551, '\uFFB1', 1552, '\uFFB2', 1553, '\uFFB3', 1554, '\uFFB4', 1555, '\uFFB5', 1556, '\uFFB6', 1557, '\uFFB7', 1558, '\uFFB8', 1559, '\uFFB9', 1560, '\uFFBA', 1561, '\uFFBB', 1562, '\uFFBC', 1563, '\uFFBD', 1564, '\uFFBE', 1565, '\uFFC2', 1566, '\uFFC3', 1567, '\uFFC4', 1568, '\uFFC5', 1569, '\uFFC6', 1570, '\uFFC7', 1571, '\uFFCA', 1572, '\uFFCB', 1573, '\uFFCC', 1574, '\uFFCD', 1575, '\uFFCE', 1576, '\uFFCF', 1577, '\uFFD2', 1578, '\uFFD3', 1579, '\uFFD4', 1580, '\uFFD5', 1581, '\uFFD6', 1582, '\uFFD7', 1583, '\uFFDA', 1584, '\uFFDB', 1585, '\uFFDC', 1586, '\uFFE0', 2981, '\uFFE1', 2982, '\uFFE2', 2983, '\uFFE3', 3, '\uFFE4', 2984, '\uFFE5', 2985, '\uFFE6', 2986, '\uFFE8', 2987, '\uFFE9', 2988, '\uFFEA', 2989, '\uFFEB', 2990, '\uFFEC', 2991, '\uFFED', 2992, '\uFFEE', 2993, }; } }smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/IDNAException.cs0000644000175000017500000000311312204443225022731 0ustar00meebeymeebey00000000000000/// Copyright (C) 2004 Free Software Foundation, Inc. /// * /// Author: Alexander Gnauck AG-Software, mailto:gnauck@ag-software.de /// * /// This file is part of GNU Libidn. /// * /// This library is free software; you can redistribute it and/or /// modify it under the terms of the GNU Lesser General Public License /// as published by the Free Software Foundation; either version 2.1 of /// the License, or (at your option) any later version. /// * /// This library is distributed in the hope that it will be useful, but /// WITHOUT ANY WARRANTY; without even the implied warranty of /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU /// Lesser General Public License for more details. /// * /// You should have received a copy of the GNU Lesser General Public /// License along with this library; if not, write to the Free Software /// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 /// USA /// using System; namespace agsXMPP.Idn { public class IDNAException : System.Exception { public static string CONTAINS_NON_LDH = "Contains non-LDH characters."; public static string CONTAINS_HYPHEN = "Leading or trailing hyphen not allowed."; public static string CONTAINS_ACE_PREFIX = "ACE prefix (xn--) not allowed."; public static string TOO_LONG = "String too long."; public IDNAException(string m) : base(m) { } // TODO public IDNAException(StringprepException e) :base( "", e) { } public IDNAException(PunycodeException e) : base( "", e) { } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Idn/NFKC.cs0000644000175000017500000002250212204443225021063 0ustar00meebeymeebey00000000000000/// Copyright (C) 2004 Free Software Foundation, Inc. /// * /// Author: Alexander Gnauck AG-Software, mailto:gnauck@ag-software.de /// * /// This file is part of GNU Libidn. /// * /// This library is free software; you can redistribute it and/or /// modify it under the terms of the GNU Lesser General Public License /// as published by the Free Software Foundation; either version 2.1 of /// the License, or (at your option) any later version. /// * /// This library is distributed in the hope that it will be useful, but /// WITHOUT ANY WARRANTY; without even the implied warranty of /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU /// Lesser General Public License for more details. /// * /// You should have received a copy of the GNU Lesser General Public /// License along with this library; if not, write to the Free Software /// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 /// USA /// using System; using System.Text; namespace agsXMPP.Idn { public class NFKC { /// /// Applies NFKC normalization to a string. /// /// The string to normalize. /// An NFKC normalized string. public static string NormalizeNFKC(string sbIn) { StringBuilder sbOut = new StringBuilder(); for (int i = 0; i < sbIn.Length; i++) { char code = sbIn[i]; // In Unicode 3.0, Hangul was defined as the block from U+AC00 // to U+D7A3, however, since Unicode 3.2 the block extends until // U+D7AF. The decomposeHangul function only decomposes until // U+D7A3. Should this be changed? if (code >= 0xAC00 && code <= 0xD7AF) { sbOut.Append(decomposeHangul(code)); } else { int index = decomposeIndex(code); if (index == - 1) { sbOut.Append(code); } else { sbOut.Append(DecompositionMappings.m[index]); } } } // Bring the stringbuffer into canonical order. canonicalOrdering(sbOut); // Do the canonical composition. int last_cc = 0; int last_start = 0; for (int i = 0; i < sbOut.Length; i++) { int cc = combiningClass(sbOut[i]); if (i > 0 && (last_cc == 0 || last_cc != cc)) { // Try to combine characters char a = sbOut[last_start]; char b = sbOut[i]; int c = compose(a, b); if (c != - 1) { sbOut[last_start] = (char) c; //sbOut.deleteCharAt(i); sbOut.Remove(i, 1); i--; if (i == last_start) { last_cc = 0; } else { last_cc = combiningClass(sbOut[i - 1]); } continue; } } if (cc == 0) { last_start = i; } last_cc = cc; } return sbOut.ToString(); } /// /// Returns the index inside the decomposition table, implemented /// using a binary search. /// /// Character to look up. /// Index if found, -1 otherwise. internal static int decomposeIndex(char c) { int start = 0; int end = DecompositionKeys.k.Length / 2; while (true) { int half = (start + end) / 2; int code = DecompositionKeys.k[half * 2]; if (c == code) { return DecompositionKeys.k[half * 2 + 1]; } if (half == start) { // Character not found return - 1; } else if (c > code) { start = half; } else { end = half; } } } /// /// Returns the combining class of a given character. /// /// The character. /// The combining class. internal static int combiningClass(char c) { int h = c >> 8; int l = c & 0xff; int i = CombiningClass.i[h]; if (i > - 1) { return CombiningClass.c[i, l]; } else { return 0; } } /// /// Rearranges characters in a stringbuffer in order to respect the /// canonical ordering properties. /// /// StringBuffer to rearrange. internal static void canonicalOrdering(StringBuilder sbIn) { bool isOrdered = false; while (!isOrdered) { isOrdered = true; // 24.10.2005 int lastCC = 0; if (sbIn.Length > 0) lastCC = combiningClass(sbIn[0]); for (int i = 0; i < sbIn.Length - 1; i++) { int nextCC = combiningClass(sbIn[i + 1]); if (nextCC != 0 && lastCC > nextCC) { for (int j = i + 1; j > 0; j--) { if (combiningClass(sbIn[j - 1]) <= nextCC) { break; } char t = sbIn[j]; sbIn[j] = sbIn[j - 1]; sbIn[j - 1] = t; isOrdered = false; } nextCC = lastCC; } lastCC = nextCC; } } } /// /// Returns the index inside the composition table. /// /// Character to look up. /// Index if found, -1 otherwise. internal static int composeIndex(char a) { if (a >> 8 >= Composition.composePage.Length) { return - 1; } int ap = Composition.composePage[a >> 8]; if (ap == - 1) { return - 1; } return Composition.composeData[ap, a & 0xff]; } /// /// Tries to compose two characters canonically. /// /// First character. /// Second character. /// The composed character or -1 if no composition could be found. internal static int compose(char a, char b) { int h = composeHangul(a, b); if (h != - 1) { return h; } int ai = composeIndex(a); if (ai >= Composition.singleFirstStart && ai < Composition.singleSecondStart) { if (b == Composition.singleFirst[ai - Composition.singleFirstStart, 0]) { return Composition.singleFirst[ai - Composition.singleFirstStart, 1]; } else { return - 1; } } int bi = composeIndex(b); if (bi >= Composition.singleSecondStart) { if (a == Composition.singleSecond[bi - Composition.singleSecondStart,0]) { return Composition.singleSecond[bi - Composition.singleSecondStart,1]; } else { return - 1; } } if (ai >= 0 && ai < Composition.multiSecondStart && bi >= Composition.multiSecondStart && bi < Composition.singleFirstStart) { char[] f = Composition.multiFirst[ai]; if (bi - Composition.multiSecondStart < f.Length) { char r = f[bi - Composition.multiSecondStart]; if (r == 0) { return - 1; } else { return r; } } } return - 1; } /// /// Entire hangul code copied from: /// http://www.unicode.org/unicode/reports/tr15/ /// Several hangul specific constants /// internal const int SBase = 0xAC00; internal const int LBase = 0x1100; internal const int VBase = 0x1161; internal const int TBase = 0x11A7; internal const int LCount = 19; internal const int VCount = 21; internal const int TCount = 28; internal static readonly int NCount = VCount * TCount; internal static readonly int SCount = LCount * NCount; /// /// Decomposes a hangul character. /// /// A character to decompose. /// A string containing the hangul decomposition of the input /// character. If no hangul decomposition can be found, a string /// containing the character itself is returned. internal static string decomposeHangul(char s) { int SIndex = s - SBase; if (SIndex < 0 || SIndex >= SCount) { return s.ToString(); } StringBuilder result = new StringBuilder(); int L = LBase + SIndex / NCount; int V = VBase + (SIndex % NCount) / TCount; int T = TBase + SIndex % TCount; result.Append((char) L); result.Append((char) V); if (T != TBase) result.Append((char) T); return result.ToString(); } /// /// Composes two hangul characters. /// /// First character. /// Second character. /// Returns the composed character or -1 if the two characters cannot be composed. internal static int composeHangul(char a, char b) { // 1. check to see if two current characters are L and V int LIndex = a - LBase; if (0 <= LIndex && LIndex < LCount) { int VIndex = b - VBase; if (0 <= VIndex && VIndex < VCount) { // make syllable of form LV return SBase + (LIndex * VCount + VIndex) * TCount; } } // 2. check to see if two current characters are LV and T int SIndex = a - SBase; if (0 <= SIndex && SIndex < SCount && (SIndex % TCount) == 0) { int TIndex = b - TBase; if (0 <= TIndex && TIndex <= TCount) { // make syllable of form LVT return a + TIndex; } } return - 1; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Util/0000755000175000017500000000000012204443225020215 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Util/Runtime.cs0000644000175000017500000000104012204443225022162 0ustar00meebeymeebey00000000000000using System; namespace agsXMPP.Util { static class Runtime { public static bool IsMono() { Type t = Type.GetType ("Mono.Runtime"); if (t != null) return true; return false; } public static bool IsUnix() { int p = (int) Environment.OSVersion.Platform; if ((p == 4) || (p == 6) || (p == 128)) return true; return false; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Util/Date.cs0000644000175000017500000000746612204443225021436 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.Util { /// /// Class handles the XMPP time format /// public class Time { /* */ /// /// /// /// /// public static DateTime Date(string date) { // better put here a try catch in case a client sends a wrong formatted date try { DateTime dt = new DateTime( int.Parse(date.Substring(0, 4)), int.Parse(date.Substring(4, 2)), int.Parse(date.Substring(6, 2)), int.Parse(date.Substring(9, 2)), int.Parse(date.Substring(12, 2)), int.Parse(date.Substring(15, 2)) ); return dt.ToLocalTime(); } catch { return DateTime.MinValue; } } /// /// Get a XMPP string representation of a Date /// /// DateTime /// XMPP string representation of a DateTime value public static string Date(DateTime date) { return date.ToString("yyyyMMddTHH:mm:ss"); } /// /// The new standard used by XMPP in JEP-82 (ISO-8601) /// 1970-01-01T00:00Z /// /// /// public static DateTime ISO_8601Date(string date) { // .NET does a great Job parsing this Date profile try { return DateTime.Parse(date); } catch { return DateTime.MinValue; } } /// /// The new standard used by XMPP in JEP-82 (ISO-8601) /// converts a local DateTime to a ISO-8601 formatted date in UTC format. /// 1970-01-01T00:00Z /// /// local Datetime /// public static string ISO_8601Date(DateTime date) { return date.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); //return date.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); //return date.ToString("yyyy-MM-ddTHH:mm:ssZ"); //("yyyy'-'MM'-'dd HH':'mm':'ss'Z'") } public static TimeSpan UtcOffset() { var localZone = TimeZone.CurrentTimeZone; var currentDate = DateTime.Now; return localZone.GetUtcOffset(currentDate); } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Util/Enum.cs0000644000175000017500000001131712204443225021453 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Reflection; namespace agsXMPP.Util { /// /// Provides helper functions for Enumerations. /// /// Extends the System.Enum Class. /// System.Enum Class public class Enum { #if CF #region << Enum.Parse() for CF, credits to OpenNetCF.net for this function>> /// /// Use this on CF 1.0, CF 2 includes Enum.Parse() now /// /// /// /// /// public static object Parse(System.Type enumType, string value, bool ignoreCase) { //throw an exception on null value if(value.TrimEnd(' ')=="") { throw new ArgumentException("value is either an empty string (\"\") or only contains white space."); } else { //type must be a derivative of enum if(enumType.BaseType==Type.GetType("System.Enum")) { //remove all spaces string[] memberNames = value.Replace(" ","").Split(','); //collect the results //we are cheating and using a long regardless of the underlying type of the enum //this is so we can use ordinary operators to add up each value //I suspect there is a more efficient way of doing this - I will update the code if there is long returnVal = 0; //for each of the members, add numerical value to returnVal foreach(string thisMember in memberNames) { //skip this string segment if blank if(thisMember!="") { try { if(ignoreCase) { returnVal += (long)Convert.ChangeType(enumType.GetField(thisMember, BindingFlags.Public | BindingFlags.Static | BindingFlags.IgnoreCase).GetValue(null),returnVal.GetType(), null); } else { returnVal += (long)Convert.ChangeType(enumType.GetField(thisMember, BindingFlags.Public | BindingFlags.Static).GetValue(null),returnVal.GetType(), null); } } catch { try { //try getting the numeric value supplied and converting it returnVal += (long)Convert.ChangeType(System.Enum.ToObject(enumType, Convert.ChangeType(thisMember, System.Enum.GetUnderlyingType(enumType), null)),typeof(long),null); } catch { throw new ArgumentException("value is a name, but not one of the named constants defined for the enumeration."); } // } } } //return the total converted back to the correct enum type return System.Enum.ToObject(enumType, returnVal); } else { //the type supplied does not derive from enum throw new ArgumentException("enumType parameter is not an System.Enum"); } } } #endregion #endif #if CF || CF_2 || SL public static string[] GetNames(System.Type enumType) { if(enumType.BaseType==Type.GetType("System.Enum")) { //get the public static fields (members of the enum) System.Reflection.FieldInfo[] fi = enumType.GetFields(BindingFlags.Static | BindingFlags.Public); //create a new enum array string[] names = new string[fi.Length]; //populate with the values for(int iEnum = 0; iEnum < fi.Length; iEnum++) { names[iEnum] = fi[iEnum].Name; } //return the array return names; } else { //the type supplied does not derive from enum throw new ArgumentException("enumType parameter is not an System.Enum"); } } #endif } } smuxi-0.11/lib/agsxmpp/agsxmpp/Util/RandomNumberGenerator.cs0000644000175000017500000000465312204443225025014 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2007 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if CF using System; namespace agsXMPP.util { /// /// Represents the abstract class from which all implementations of cryptographic random number generators derive. /// Its a replacement for System.Security.RandomNumberGenerator /// which is not abailavle on the compact framework /// public abstract class RandomNumberGenerator { public RandomNumberGenerator() { } /// /// Creates an instance of an implementation of a cryptographic random number generator. /// /// a new instance of a cryptographic random number generator. public static RandomNumberGenerator Create() { return new RNGCryptoServiceProvider(); } /// /// When overridden in a derived class, fills an array of bytes with a cryptographically strong random sequence of values. /// /// The array to fill with cryptographically strong random bytes. public abstract void GetBytes(byte[] data); /// /// When overridden in a derived class, fills an array of bytes with a cryptographically strong random sequence of nonzero values. /// /// The array to fill with cryptographically strong random nonzero bytes. public abstract void GetNonZeroBytes(byte[] data); } } #endifsmuxi-0.11/lib/agsxmpp/agsxmpp/Util/WinCeApi.cs0000644000175000017500000000312412204443225022203 0ustar00meebeymeebey00000000000000#if !MONO using System; using System.Runtime.InteropServices; namespace agsXMPP.util { /// /// Crypto API for Windows CE, Pocket PC and Smartphone /// will be used for Hashing and the RandomNumberGenerator /// internal class WinCeApi { public enum SecurityProviderType { RSA_FULL = 1, HP_HASHVAL = 2, CALG_MD5 = 32771, CALG_SHA1 = 32772 } [DllImport("coredll.dll")] public static extern bool CryptAcquireContext(out IntPtr hProv, string pszContainer, string pszProvider, int dwProvType,int dwFlags); [DllImport("coredll.dll")] public static extern bool CryptCreateHash(IntPtr hProv, int Algid, IntPtr hKey, int dwFlags, out IntPtr phHash); [DllImport("coredll.dll")] public static extern bool CryptHashData(IntPtr hHash, byte [] pbData, int dwDataLen, int dwFlags); [DllImport("coredll.dll")] public static extern bool CryptGetHashParam(IntPtr hHash, int dwParam, byte[] pbData, ref int pdwDataLen, int dwFlags); [DllImport("coredll.dll")] public static extern bool CryptDestroyHash(IntPtr hHash); [DllImport("coredll.dll")] public static extern bool CryptReleaseContext(IntPtr hProv, int dwFlags); [DllImport("coredll.dll", EntryPoint="CryptGenRandom", SetLastError=true)] public static extern bool CryptGenRandomCe(IntPtr hProv, int dwLen, byte[] pbBuffer); [DllImport("advapi32.dll", EntryPoint="CryptGenRandom", SetLastError=true)] public static extern bool CryptGenRandomXp(IntPtr hProv, int dwLen, byte[] pbBuffer); } } #endifsmuxi-0.11/lib/agsxmpp/agsxmpp/Util/Hash.cs0000644000175000017500000001316412204443225021434 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System.Text; #if !CF using System.Security.Cryptography; #endif namespace agsXMPP.Util { /// /// Helper class for hashing. /// public class Hash { #region << SHA1 Hash Desktop Framework and Mono >> #if !CF public static string Sha1Hash(string pass) { SHA1 sha = SHA1.Create(); byte[] hash = sha.ComputeHash(Encoding.UTF8.GetBytes(pass)); return HexToString(hash); } public static byte[] Sha1HashBytes(string pass) { SHA1 sha = SHA1.Create(); return sha.ComputeHash(Encoding.UTF8.GetBytes(pass)); } public static byte[] Sha1HashBytes(byte[] pass) { using (var sha = new SHA1Managed()) { return sha.ComputeHash(pass); } } #endif /// /// Converts all bytes in the Array to a string representation. /// /// /// string representation public static string HexToString(byte[] buf) { StringBuilder sb = new StringBuilder(); foreach (byte b in buf) { sb.Append(b.ToString("x2")); } return sb.ToString(); } #endregion #region << SHA1 Hash Compact Framework >> #if CF /// /// return a SHA1 Hash on PPC and Smartphone /// /// /// public static byte[] Sha1Hash(byte[] pass) { IntPtr hProv; bool retVal = WinCeApi.CryptAcquireContext( out hProv, null, null, (int) WinCeApi.SecurityProviderType.RSA_FULL, 0 ); IntPtr hHash; retVal = WinCeApi.CryptCreateHash( hProv, (int) WinCeApi.SecurityProviderType.CALG_SHA1, IntPtr.Zero, 0, out hHash ); byte [] publicKey = pass; int publicKeyLen = publicKey.Length; retVal = WinCeApi.CryptHashData( hHash, publicKey, publicKeyLen, 0 ); int bufferLen = 20; //SHA1 size byte [] buffer = new byte[bufferLen]; retVal = WinCeApi.CryptGetHashParam( hHash, (int) WinCeApi.SecurityProviderType.HP_HASHVAL, buffer, ref bufferLen, 0 ); retVal = WinCeApi.CryptDestroyHash( hHash ); retVal = WinCeApi.CryptReleaseContext( hProv, 0 ); return buffer; } /// /// return a SHA1 Hash on PPC and Smartphone /// /// /// public static string Sha1Hash(string pass) { return HexToString(Sha1Hash(System.Text.Encoding.ASCII.GetBytes(pass))); } /// /// return a SHA1 Hash on PPC and Smartphone /// /// /// public static byte[] Sha1HashBytes(string pass) { return Sha1Hash(System.Text.Encoding.UTF8.GetBytes(pass)); } /// /// omputes the MD5 hash value for the specified byte array. /// /// The input for which to compute the hash code. /// The computed hash code. public static byte[] MD5Hash(byte[] pass) { IntPtr hProv; bool retVal = WinCeApi.CryptAcquireContext( out hProv, null, null, (int) WinCeApi.SecurityProviderType.RSA_FULL, 0 ); IntPtr hHash; retVal = WinCeApi.CryptCreateHash( hProv, (int) WinCeApi.SecurityProviderType.CALG_MD5, IntPtr.Zero, 0, out hHash ); byte [] publicKey = pass; int publicKeyLen = publicKey.Length; retVal = WinCeApi.CryptHashData( hHash, publicKey, publicKeyLen, 0 ); int bufferLen = 16; //SHA1 size byte [] buffer = new byte[bufferLen]; retVal = WinCeApi.CryptGetHashParam( hHash, (int) WinCeApi.SecurityProviderType.HP_HASHVAL, buffer, ref bufferLen, 0 ); retVal = WinCeApi.CryptDestroyHash( hHash ); retVal = WinCeApi.CryptReleaseContext( hProv, 0 ); return buffer; } #endif #endregion #if !(CF || CF_2) public static byte[] HMAC(byte[] key, byte[] data) { using (var hmacsha1 = new HMACSHA1(key, true)) { byte[] bytes = hmacsha1.ComputeHash(data); return bytes; } } public static byte[] HMAC(string key, byte[] data) { return HMAC(Encoding.UTF8.GetBytes(key), data); } public static byte[] HMAC(byte[] key, string data) { return HMAC(key, Encoding.UTF8.GetBytes(data)); } public static byte[] HMAC(string key, string data) { return HMAC(Encoding.UTF8.GetBytes(key), Encoding.UTF8.GetBytes(data)); } #endif } }smuxi-0.11/lib/agsxmpp/agsxmpp/Util/Exceptions.cs0000644000175000017500000000047312204443225022671 0ustar00meebeymeebey00000000000000using System; namespace agsXMPP.util { /// /// Summary description for Exceptions. /// public class NotImplementedException : Exception { public NotImplementedException() { } public NotImplementedException(string message) : base(message) { } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Util/RNGCryptoServiceProvider.cs0000644000175000017500000000603512204443225025433 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2007 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if CF using System; namespace agsXMPP.util { /// /// Implements a cryptographic Random Number Generator (RNG) using the implementation /// provided by the cryptographic service provider (CSP). /// Its a replacement for System.Security.Cryptography.RandomNumberGenerator which /// is not available in the compact framework. /// public class RNGCryptoServiceProvider : RandomNumberGenerator { public RNGCryptoServiceProvider() { } /// /// Fills an array of bytes with a cryptographically strong random sequence of values. /// /// The array to fill with cryptographically strong random bytes. public override void GetBytes(byte[] seed) { seed = _GetRandomBytes(seed); } /// /// Fills an array of bytes with a cryptographically strong random sequence of nonzero values. /// /// The array to fill with cryptographically strong random nonzero bytes. public override void GetNonZeroBytes(byte[] seed) { seed = _GetNonZeroBytes(seed); } #region << private functions >> private byte [] _GetRandomBytes(byte[] seed) { IntPtr prov; bool retVal = WinCeApi.CryptAcquireContext(out prov, null, null, (int) WinCeApi.SecurityProviderType.RSA_FULL, 0); retVal = _CryptGenRandom(prov, seed.Length, seed); WinCeApi.CryptReleaseContext(prov, 0); return seed; } private bool _CryptGenRandom(IntPtr hProv, int dwLen, byte[] pbBuffer) { if(System.Environment.OSVersion.Platform == PlatformID.WinCE) return WinCeApi.CryptGenRandomCe(hProv, dwLen, pbBuffer); else return WinCeApi.CryptGenRandomXp(hProv, dwLen, pbBuffer); } private byte [] _GetNonZeroBytes(byte[] seed) { byte [] buf = _GetRandomBytes(seed); for(int i=0; i Debug AnyCPU 10.0.0 2.0 {C6379274-C5DE-41A2-AE3E-753F85A557BA} Library agsxmpp agsxmpp true full false bin\Debug TRACE;DEBUG;SSL;STRINGPREP prompt 4 false none false bin\Release prompt 4 false TRACE;DEBUG;SSL;STRINGPREP {3F8CF2C1-EA37-444F-8693-A3A00B1131D2} StarkSoftProxy {3F8CF2C1-EA37-444F-8693-A3A00B1131D2} StarkSoftProxy smuxi-0.11/lib/agsxmpp/agsxmpp/Jid.cs0000644000175000017500000004012112204443225020333 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using System.Collections; using agsXMPP.Exceptions; using agsXMPP.Collections; #if STRINGPREP using agsXMPP.Idn; #endif namespace agsXMPP { /// /// Class for building and handling XMPP Id's (JID's) /// public class Jid : IComparable, IEquatable { /* 14 possible invalid forms of JIDs and some variations on valid JIDs with invalid lengths, viz: jidforms = [ "", "@", "@/resource", "@domain", "@domain/", "@domain/resource", "nodename@", "/", "nodename@domain/", "nodename@/", "@/", "nodename/", "/resource", "nodename@/resource", ] TODO Each allowable portion of a JID (node identifier, domain identifier, and resource identifier) MUST NOT be more than 1023 bytes in length, resulting in a maximum total size (including the '@' and '/' separators) of 3071 bytes. stringprep with libIDN m_User ==> nodeprep m_Server ==> nameprep m_Resource ==> resourceprep */ // !!! // use this internal variables only if you know what you are doing // !!! internal string m_Jid = null; internal string m_User = null; internal string m_Server = null; internal string m_Resource = null; /// /// Create a new JID object from a string. The input string must be a valid jabberId and already prepared with stringprep. /// Otherwise use one of the other constructors with escapes the node and prepares the gives balues with the stringprep /// profiles /// /// XMPP ID, in string form examples: user@server/Resource, user@server public Jid(string jid) { m_Jid = jid; Parse(jid); } /// /// builds a new Jid object /// /// XMPP User part /// XMPP Domain part /// XMPP Resource part public Jid(string user, string server, string resource) { #if !STRINGPREP if (user != null) { user = EscapeNode(user); m_User = user.ToLower(); } if (server != null) m_Server = server.ToLower(); if (resource != null) m_Resource = resource; #else if (user != null) { user = EscapeNode(user); m_User = Stringprep.NodePrep(user); } if (server != null) m_Server = Stringprep.NamePrep(server); if (resource != null) m_Resource = Stringprep.ResourcePrep(resource); #endif BuildJid(); } /// /// Parses a JabberId from a string. If we parse a jid we assume it's correct and already prepared via stringprep. /// /// jis to parse as string /// true if the jid could be parsed, false if an error occured public bool Parse(string fullJid) { string user = null; string server = null; string resource = null; try { if (fullJid == null || fullJid.Length == 0) { return false; } m_Jid = fullJid; int atPos = m_Jid.IndexOf('@'); int slashPos = m_Jid.IndexOf('/'); // some more validations // @... or /... if (atPos == 0 || slashPos == 0) return false; // nodename@ if (atPos + 1 == fullJid.Length) return false; // @/ at followed by resource separator if (atPos + 1 == slashPos) return false; if (atPos == -1) { user = null; if (slashPos == -1) { // JID Contains only the Server server = m_Jid; } else { // JID Contains only the Server and Resource server = m_Jid.Substring(0, slashPos); resource = m_Jid.Substring(slashPos + 1); } } else { if (slashPos == -1) { // We have no resource // Devide User and Server (user@server) server = m_Jid.Substring(atPos + 1); user = m_Jid.Substring(0, atPos); } else { // We have all user = m_Jid.Substring(0, atPos); server = m_Jid.Substring(atPos + 1, slashPos - atPos - 1); resource = m_Jid.Substring(slashPos + 1); } } if (user != null) this.m_User = user; if (server != null) this.m_Server = server; if (resource != null) this.m_Resource = resource; return true; } catch (Exception) { return false; } } internal void BuildJid() { m_Jid = BuildJid(m_User, m_Server, m_Resource); } private string BuildJid(string user, string server, string resource) { StringBuilder sb = new StringBuilder(); if (user != null) { sb.Append(user); sb.Append("@"); } sb.Append(server); if (resource != null) { sb.Append("/"); sb.Append(resource); } return sb.ToString(); } public override string ToString() { return m_Jid; } /// /// the user part of the JabberId. /// public string User { get { return m_User; } set { // first Encode the user/node string tmpUser = EscapeNode(value); #if !STRINGPREP if (value != null) m_User = tmpUser.ToLower(); else m_User = null; #else if (value != null) m_User = Stringprep.NodePrep(tmpUser); else m_User = null; #endif BuildJid(); } } /// /// Only Server /// public string Server { get { return m_Server; } set { #if !STRINGPREP if (value != null) m_Server = value.ToLower(); else m_Server = null; #else if (value != null) m_Server = Stringprep.NamePrep(value); else m_Server = null; #endif BuildJid(); } } /// /// Only the Resource field. /// null for none /// public string Resource { get { return m_Resource; } set { #if !STRINGPREP if (value != null) m_Resource = value; else m_Resource = null; #else if (value != null) m_Resource = Stringprep.ResourcePrep(value); else m_Resource = null; #endif BuildJid(); } } /// /// The Bare Jid only (user@server). /// public string Bare { get { return BuildJid(m_User, m_Server, null); } } #region << Overrides >> /// /// This compares the full Jid by default /// /// /// public override bool Equals(object obj) { return Equals(obj, new FullJidComparer()); } public override int GetHashCode() { int hcode = 0; if (m_User !=null) hcode ^= m_User.GetHashCode(); if (m_Server != null) hcode ^= m_Server.GetHashCode(); if (m_Resource != null) hcode ^= m_Resource.GetHashCode(); return hcode; } #endregion public bool Equals(object other, System.Collections.IComparer comparer) { if (comparer.Compare(other, this) == 0) return true; else return false; } /* public static bool operator !=(Jid jid1, Jid jid2) { return !jid1.Equals(jid2, new FullJidComparer()); } public static bool operator ==(Jid jid1, Jid jid2) { return jid1.Equals(jid2, new FullJidComparer()); } */ #region << implicit operators >> static public implicit operator Jid(string value) { return new Jid(value); } static public implicit operator string(Jid jid) { return jid.ToString(); } #endregion #region IComparable Members public int CompareTo(object obj) { if (obj is Jid) { Jid jid = obj as Jid; FullJidComparer comparer = new FullJidComparer(); return comparer.Compare(obj, this); } throw new ArgumentException("object is not a Jid"); } #endregion #region IEquatable Members public bool Equals(Jid other) { FullJidComparer comparer = new FullJidComparer(); if (comparer.Compare(other, this) == 0) return true; else return false; } #endregion #region << XEP-0106: JID Escaping >> /// /// /// Escape a node according to XEP-0106 /// /// /// http://www.xmpp.org/extensions/xep-0106.html /// /// /// /// public static string EscapeNode(string node) { if (node == null) return null; StringBuilder sb = new StringBuilder(); for (int i = 0; i < node.Length; i++) { /* \20 " \22 & \26 ' \27 / \2f : \3a < \3c > \3e @ \40 \ \5c */ char c = node[i]; switch (c) { case ' ': sb.Append(@"\20"); break; case '"': sb.Append(@"\22"); break; case '&': sb.Append(@"\26"); break; case '\'': sb.Append(@"\27"); break; case '/': sb.Append(@"\2f"); break; case ':': sb.Append(@"\3a"); break; case '<': sb.Append(@"\3c"); break; case '>': sb.Append(@"\3e"); break; case '@': sb.Append(@"\40"); break; case '\\': sb.Append(@"\5c"); break; default: sb.Append(c); break; } } return sb.ToString(); } /// /// /// unescape a node according to XEP-0106 /// /// /// http://www.xmpp.org/extensions/xep-0106.html /// /// /// /// public static string UnescapeNode(string node) { if (node == null) return null; StringBuilder sb = new StringBuilder(); for (int i = 0; i < node.Length; i++) { char c1 = node[i]; if (c1 == '\\' && i + 2 < node.Length) { i += 1; char c2 = node[i]; i += 1; char c3 = node[i]; if (c2 == '2') { switch (c3) { case '0': sb.Append(' '); break; case '2': sb.Append('"'); break; case '6': sb.Append('&'); break; case '7': sb.Append('\''); break; case 'f': sb.Append('/'); break; } } else if (c2 == '3') { switch (c3) { case 'a': sb.Append(':'); break; case 'c': sb.Append('<'); break; case 'e': sb.Append('>'); break; } } else if (c2 == '4') { if (c3 == '0') sb.Append("@"); } else if (c2 == '5') { if (c3 == 'c') sb.Append("\\"); } } else sb.Append(c1); } return sb.ToString(); } #endregion } }smuxi-0.11/lib/agsxmpp/agsxmpp/Properties/0000755000175000017500000000000012204443225021434 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Properties/AssemblyInfo.cs0000644000175000017500000000614012204443225024357 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Reflection; using System.Runtime.CompilerServices; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyTitle("agsXMPP")] [assembly: AssemblyDescription("agsXMPP Library")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("AG-Software")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("AG-Software")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.3.0")] [assembly: CLSCompliant(true)] // // In order to sign your assembly you must specify a key to use. Refer to the // Microsoft .NET Framework documentation for more information on assembly signing. // // Use the attributes below to control which key is used for signing. // // Notes: // (*) If no key is specified - the assembly cannot be signed. // (*) KeyName refers to a key that has been installed in the Crypto Service // Provider (CSP) on your machine. // (*) If the key file and a key name attributes are both specified, the // following processing occurs: // (1) If the KeyName can be found in the CSP - that key is used. // (2) If the KeyName does not exist and the KeyFile does exist, the key // in the file is installed into the CSP and used. // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework // documentation for more information on this. // [assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")] #if CF [assembly: AssemblyKeyFile(@"..\..\key.snk")] #endif //[assembly: AssemblyKeyName("")] smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/0000755000175000017500000000000012204443225021141 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/tls/0000755000175000017500000000000012204443225021743 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/tls/Proceed.cs0000644000175000017500000000273412204443225023661 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.tls { // Step 5: Server informs client that it is allowed to proceed: // /// /// Summary description for Proceed. /// public class Proceed : Element { public Proceed() { this.TagName = "proceed"; this.Namespace = Uri.TLS; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/tls/StartTls.cs0000644000175000017500000000337412204443225024061 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.tls { // Step 4: Client sends the STARTTLS command to server: // /// /// Summary description for starttls. /// public class StartTls : Element { public StartTls() { this.TagName = "starttls"; this.Namespace = Uri.TLS; } public bool Required { get { return HasTag("required"); } set { if (value == false) { if (HasTag("required")) RemoveTag("required"); } else { if (!HasTag("required")) SetTag("required"); } } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/tls/Failure.cs0000644000175000017500000000304612204443225023664 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.tls { // Step 5 (alt): Server informs client that TLS negotiation has failed and closes both stream and TCP connection: // //
    /// /// Summary description for Failure. /// public class Failure : Element { public Failure() { this.TagName = "failure"; this.Namespace = Uri.TLS; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/0000755000175000017500000000000012204443225021410 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/Delay.cs0000644000175000017500000000430012204443225022772 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x { // // Extended Away // xa5 // // /// /// /// Delay class for Timestamps /// /// /// Mainly used in offline and groupchat messages. This is the time when the message was received by the server /// /// public class Delay : Element { public Delay() { this.TagName = "x"; this.Namespace = Uri.X_DELAY; } public Jid From { get { if (HasAttribute("from")) return new Jid(GetAttribute("from")); else return null; } set { SetAttribute("from", value.ToString()); } } public DateTime Stamp { get { return Util.Time.Date(GetAttribute("stamp")); } set { SetAttribute("stamp", Util.Time.Date(value)); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/Event.cs0000644000175000017500000001077612204443225023033 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x { /// /// JEP-0022: Message Events /// This JEP defines protocol extensions used to request and respond to events relating to the delivery, display, and composition of messages. /// public class Event : Element { public Event() { this.TagName = "x"; this.Namespace = Uri.X_EVENT; } /// /// Indicates that the message has been stored offline by the intended recipient's server. /// This event is triggered only if the intended recipient's server supports offline storage, /// has that support enabled, and the recipient is offline when the server receives the message for delivery. /// public bool Offline { get { return HasTag("offline"); } set { RemoveTag("offline"); if (value) AddTag("offline"); } } /// /// Indicates that the message has been delivered to the recipient. /// This signifies that the message has reached the recipient's Jabber client, /// but does not necessarily mean that the message has been displayed. /// This event is to be raised by the Jabber client. /// public bool Delivered { get { return HasTag("delivered"); } set { RemoveTag("delivered"); if (value) AddTag("delivered"); } } /// /// Once the message has been received by the recipient's Jabber client, /// it may be displayed to the user. /// This event indicates that the message has been displayed, and is to be raised by the Jabber client. /// Even if a message is displayed multiple times, this event should be raised only once. /// public bool Displayed { get { return HasTag("displayed"); } set { RemoveTag("displayed"); if (value) AddTag("displayed"); } } /// /// In threaded chat conversations, this indicates that the recipient is composing a reply to a message. /// The event is to be raised by the recipient's Jabber client. /// A Jabber client is allowed to raise this event multiple times in response to the same request, /// providing the original event is cancelled first. /// public bool Composing { get { return HasTag("composing"); } set { RemoveTag("composing"); if (value) AddTag("composing"); } } /// /// 'id' attribute of the original message to which this event notification pertains. /// (If no 'id' attribute was included in the original message, then the id tag must still be included with no /// public string Id { get { return GetTag("id"); } set { SetTag("id", value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/vcard_update/0000755000175000017500000000000012204443225024051 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/vcard_update/VcardUpdate.cs0000644000175000017500000000524012204443225026603 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.vcard_update { /* */ public class VcardUpdate : Element { /// /// Initializes a new instance of the class. /// public VcardUpdate() { this.TagName = "x"; this.Namespace = Uri.VCARD_UPDATE; } /// /// Initializes a new instance of the class. /// /// The photo. public VcardUpdate(string photo) : this() { Photo = photo; } /// /// SHA1 hash of the avatar image data /// if no image/avatar should be advertised, or other clients should be forced /// to remove the image set it to a empty string value ("") /// if this protocol is supported but you ae not ready o advertise a imaeg yet /// set teh value to null. /// Otherwise teh value must the SHA1 hash of the image data. /// public string Photo { get { return GetTag("photo"); } set { if (value == null) RemoveTag("photo"); else SetTag("photo", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/0000755000175000017500000000000012250206660022175 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/Role.cs0000644000175000017500000000255212204443225023430 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.x.muc { /// /// There are four defined roles that an occupant may have /// public enum Role { /// /// the absence of a role /// none, moderator, participant, visitor } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/History.cs0000644000175000017500000001061312204443225024165 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.muc { /* Example 29. User Requests Limit on Number of Messages in History Example 30. User Requests History in Last 3 Minutes Example 31. User Requests All History Since the Beginning of the Unix Era */ /// /// This is used to get the history of a muc room /// public class History : Element { #region << Constructors >> /// /// Empty default constructor /// public History() { this.TagName = "history"; this.Namespace = Uri.MUC; } /// /// get the history starting from a given date when available /// /// public History(DateTime date) : this() { this.Since = date; } /// /// Specify the maximum nunber of messages to retrieve from the history /// /// public History(int max) : this() { this.MaxStanzas = max; } #endregion /// /// request the last xxx seconds of history when available /// public int Seconds { get { return GetAttributeInt("seconds"); } set { SetAttribute("seconds", value); } } /// /// Request maximum stanzas of history when available /// public int MaxStanzas { get { return GetAttributeInt("maxstanzas"); } set { SetAttribute("maxstanzas", value); } } /// /// Request history from a given date when available /// public DateTime Since { get { return Util.Time.ISO_8601Date(GetAttribute("since")); } set { SetAttribute("since", Util.Time.ISO_8601Date(value)); } } /// /// Limit the total number of characters in the history to "X" /// (where the character count is the characters of the complete XML stanzas, /// not only their XML character data). /// public int MaxCharacters { get { return GetAttributeInt("maxchars"); } set { SetAttribute("maxchars", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/User.cs0000644000175000017500000001211112204443225023435 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System.Collections.Generic; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.muc { /// /// Summary description for MucUser. /// public class User : Element { /* This room is not anonymous. Hey Hecate, this is the place for all good witches! You have been invited to darkcave@macbeth by crone1@shakespeare.lit. Hey Hecate, this is the place for all good witches! cauldron Hey Hecate, this is the place for all good witches! */ public User() { TagName = "x"; Namespace = Uri.MUC_USER; } public Item Item { get { return SelectSingleElement(typeof(Item)) as Item; } set { RemoveTag(typeof(Item)); AddChild(value); } } /// /// Gets or sets the status codes. /// /// The status codes. public List StatusCodes { get { return SelectElements(); } set { RemoveTags(); foreach (Status status in value) AddChild(status); } } /// /// The Status Element /// public Status Status { get { return SelectSingleElement(typeof(Status)) as Status; } set { if (HasTag(typeof(Status))) RemoveTag(typeof(Status)); if (value != null) AddChild(value); } } /// /// The Invite Element /// public Invite Invite { get { return SelectSingleElement(typeof(Invite)) as Invite; } set { if (HasTag(typeof(Invite))) RemoveTag(typeof(Invite)); if (value != null) AddChild(value); } } /// /// The Decline Element /// public Decline Decline { get { return SelectSingleElement(typeof(Decline)) as Decline; } set { if (HasTag(typeof(Decline))) RemoveTag(typeof(Decline)); if (value != null) AddChild(value); } } public string Password { set { SetTag("password", value); } get { return GetTag("password"); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/StatusCode.cs0000644000175000017500000001104112204443225024576 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ namespace agsXMPP.protocol.x.muc { /// /// StatusCode /// public enum StatusCode { /// /// Unkown status code. /// Unknown = -1, /// /// Inform user that any occupant is allowed to see the user's full JID. /// FullJidVisible = 100, /// /// Inform user that his or her affiliation changed while not in the room. /// AffiliationChanged = 101, /// /// Inform occupants that room now shows unavailable members. /// ShowUnavailableMembers = 102, /// /// Inform occupants that room now does not show unavailable members . /// HideUnavailableMembers = 103, /// /// Inform occupants that a non-privacy-related room configuration change has occurred. /// ConfigurationChanged = 104, /// /// Inform user that presence refers to one of its own room occupants . /// SelfPresence = 110, /// /// Inform occupants that room logging is now enabled. /// LoggingEnabled = 170, /// /// Inform occupants that room logging is now disabled. /// LoggingDisabled = 171, /// /// Inform occupants that the room is now non-anonymous. /// RoomNonAnonymous = 172, /// /// Inform occupants that the room is now semi-anonymous. /// RoomSemiAnonymous = 173, /// /// Inform occupants that the room is now fully-anonymous. /// RoomAnonymous = 174, /// /// Inform user that a new room has been created. /// RoomCreated = 201, /// /// Inform user that service has assigned or modified occupant's roomnick. /// ModifiedNick = 210, /// /// Inform user that he or she has been banned from the room. /// Banned = 301, /// /// Inform all occupants of new room nickname. /// NewNickname = 303, /// /// Inform user that he or she has been kicked from the room. /// Kicked = 307, /// /// Inform user that he or she is being removed from the room because of an affiliation change. /// // TODO, find better name AffiliationChange = 321, /// /// Inform user that he or she is being removed from the room because the room /// has been changed to members-only and the user is not a member. /// MembersOnly = 322, /// /// Inform user that he or she is being removed from the room because of a system shutdown. /// Shutdown = 332 } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/Invitation.cs0000644000175000017500000000335712204443225024657 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.muc { /// /// A base class vor Decline and Invite /// We need From, To and SwitchDirection here. This is why we inherit from XmppPacket Base /// public abstract class Invitation : Base.Stanza { public Invitation() { this.Namespace = Uri.MUC_USER; } /// /// A reason why you want to invite this contact /// public string Reason { set { SetTag("reason", value); } get { return GetTag("reason"); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/owner/0000755000175000017500000000000012204443225023326 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/owner/Destroy.cs0000644000175000017500000000604312204443225025311 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.muc.owner { /* Macbeth doth come. */ /// /// /// public class Destroy : Element { #region << Constructor >> public Destroy() { this.TagName = "destroy"; this.Namespace = Uri.MUC_OWNER; } public Destroy(string reason) : this() { Reason = reason; } public Destroy(Jid altVenue) : this() { AlternateVenue = altVenue; } public Destroy(string reason, Jid altVenue) : this() { Reason = reason; AlternateVenue = altVenue; } #endregion /// /// Pptional attribute for a alternate venue /// public Jid AlternateVenue { get { if (HasAttribute("jid")) return new Jid(this.GetAttribute("jid")); else return null; } set { if (value != null) this.SetAttribute("jid", value.ToString()); } } public string Reason { set { SetTag("reason", value); } get { return GetTag("reason"); } } public string Password { set { SetTag("password", value); } get { return GetTag("password"); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/Muc.cs0000644000175000017500000000425712204443225023257 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.muc { /* secret */ /// /// Summary description for MucUser. /// public class Muc : Element { #region << Constructor >> public Muc() { this.TagName = "x"; this.Namespace = Uri.MUC; } #endregion public string Password { set { SetTag("password", value); } get { return GetTag("password"); } } /// /// The History object /// public History History { get { return SelectSingleElement(typeof(History)) as History; } set { if (HasTag(typeof(History))) RemoveTag(typeof(History)); if (value != null) this.AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/iq/0000755000175000017500000000000012204443225022605 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/iq/admin/0000755000175000017500000000000012204443225023675 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/iq/admin/AdminIq.cs0000644000175000017500000000446712204443225025561 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.x.muc.iq.admin { /* Example 72. Moderator Kicks Occupant Avaunt, you cullion! */ /// /// /// public class AdminIq : IQ { private Admin m_Admin = new Admin(); public AdminIq() { base.Query = m_Admin; this.GenerateId(); } public AdminIq(IqType type) : this() { this.Type = type; } public AdminIq(IqType type, Jid to) : this(type) { this.To = to; } public AdminIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Admin Query { get { return m_Admin; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/iq/admin/Admin.cs0000644000175000017500000000500712204443225025256 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.muc.iq.admin { /* Avaunt, you cullion! */ /// /// /// public class Admin : Element { public Admin() { this.TagName = "query"; this.Namespace = Uri.MUC_ADMIN; } /// /// /// /// public void AddItem(Item item) { AddChild(item); } /// /// Adds the items. /// /// The items. public void AddItems(Item[] items) { foreach (Item itm in items) { AddItem(itm); } } /// /// /// /// public Item[] GetItems() { ElementList nl = SelectElements(typeof(Item)); Item[] items = new Item[nl.Count]; int i = 0; foreach (Item itm in nl) { items[i] = itm; i++; } return items; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/iq/admin/Item.cs0000644000175000017500000000671612204443225025134 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.x.muc.iq.admin { public class Item : agsXMPP.protocol.x.muc.Item { /// /// /// public Item() : base() { this.Namespace = Uri.MUC_ADMIN; } /// /// /// /// public Item(Affiliation affiliation) : this() { this.Affiliation = affiliation; } public Item(Affiliation affiliation, Jid jid) : this(affiliation) { this.Jid = jid; } /// /// /// /// public Item(Role role) : this() { this.Role = role; } public Item(Role role, Jid jid) : this(role) { this.Jid = jid; } public Item(Jid jid) : this() { this.Jid = jid; } /// /// /// /// /// public Item(Affiliation affiliation, Role role) : this(affiliation) { this.Role = role; } /// /// /// /// /// /// public Item(Affiliation affiliation, Role role, Jid jid) : this(affiliation, role) { this.Jid = jid; } /// /// /// /// /// /// public Item(Affiliation affiliation, Role role, string reason) : this(affiliation, role) { this.Reason = reason; } /// /// /// /// /// /// /// public Item(Affiliation affiliation, Role role, Jid jid, string reason) : this(affiliation, role, jid) { this.Reason = reason; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/iq/owner/0000755000175000017500000000000012204443225023737 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/iq/owner/OwnerIq.cs0000644000175000017500000000446312204443225025661 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.x.muc.iq.owner { /* Example 72. Moderator Kicks Occupant Avaunt, you cullion! */ /// /// /// public class OwnerIq : IQ { private Owner m_Owner = new Owner(); public OwnerIq() { base.Query = m_Owner; this.GenerateId(); } public OwnerIq(IqType type) : this() { this.Type = type; } public OwnerIq(IqType type, Jid to) : this(type) { this.To = to; } public OwnerIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Owner Query { get { return m_Owner; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/iq/owner/Owner.cs0000644000175000017500000000310312204443225025355 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.muc.iq.owner { /* */ public class Owner : Element { public Owner() { TagName = "query"; Namespace = Uri.MUC_OWNER; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/Invite.cs0000644000175000017500000000637412204443225023773 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; using agsXMPP.protocol.extensions.nickname; namespace agsXMPP.protocol.x.muc { /* Hey Hecate, this is the place for all good witches! */ /// /// Invite other users t a chatroom /// public class Invite : Invitation { #region << Constructors >> public Invite() : base() { this.TagName = "invite"; } public Invite(string reason) : this() { this.Reason = reason; } public Invite(Jid to) : this() { this.To = to; } public Invite(Jid to, string reason): this() { this.To = to; this.Reason = reason; } #endregion /* This coven needs both wiccarocks and hag66. */ public bool Continue { get { return GetTag("continue") == null ? false : true; } set { if (value) SetTag("continue"); else RemoveTag("continue"); } } /// /// Nickname Element /// public Nickname Nickname { get { return SelectSingleElement(typeof(Nickname)) as Nickname; } set { if (HasTag(typeof(Nickname))) RemoveTag(typeof(Nickname)); if (value != null) this.AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/Affiliation.cs0000644000175000017500000000262012204443225024750 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.x.muc { /// /// There are five defined affiliations that a user may have in relation to a room /// public enum Affiliation { /// /// the absence of an affiliation /// none, owner, admin, member, outcast } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/user/0000755000175000017500000000000012204443225023152 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/user/Destroy.cs0000644000175000017500000000341112204443225025131 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.x.muc.user { public class Destroy : agsXMPP.protocol.x.muc.owner.Destroy { #region << Constructor >> public Destroy() : base() { this.Namespace = Uri.MUC_USER; } public Destroy(string reason) : this() { Reason = reason; } public Destroy(Jid altVenue) : this() { AlternateVenue = altVenue; } public Destroy(string reason, Jid altVenue) : this() { Reason = reason; AlternateVenue = altVenue; } #endregion } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/Status.cs0000644000175000017500000000376412204443225024020 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.muc { /* */ /// /// Summary description for MucUser. /// public class Status : Element { #region << Constructors >> public Status() { this.TagName = "status"; this.Namespace = Uri.MUC_USER; } public Status(StatusCode code) : this() { this.Code = code; } public Status(int code) : this() { SetAttribute("code", code); } #endregion public StatusCode Code { get { return (StatusCode)GetAttributeEnum("code", typeof(StatusCode)); } set { SetAttribute("code", value.ToString()); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/Destroy.cs0000644000175000017500000000603512204443225024160 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2008 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.muc { /* Macbeth doth come. */ /// /// /// public class Destroy : Element { #region << Constructor >> public Destroy() { this.TagName = "destroy"; this.Namespace = Uri.MUC_OWNER; } public Destroy(string reason) : this() { Reason = reason; } public Destroy(Jid altVenue) : this() { AlternateVenue = altVenue; } public Destroy(string reason, Jid altVenue) : this() { Reason = reason; AlternateVenue = altVenue; } #endregion /// /// Pptional attribute for a alternate venue /// public Jid AlternateVenue { get { if (HasAttribute("jid")) return new Jid(this.GetAttribute("jid")); else return null; } set { if (value != null) this.SetAttribute("jid", value.ToString()); } } public string Reason { set { SetTag("reason", value); } get { return GetTag("reason"); } } public string Password { set { SetTag("password", value); } get { return GetTag("password"); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/Item.cs0000644000175000017500000001063312204443225023424 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.muc { /// /// Summary description for Item. /// public class Item : agsXMPP.protocol.Base.Item { /* Avaunt, you cullion! */ /// /// /// public Item() : base() { this.TagName = "item"; this.Namespace = Uri.MUC_USER; } /// /// /// /// public Item(Affiliation affiliation) : this() { this.Affiliation = affiliation; } /// /// /// /// public Item(Role role) : this() { this.Role = role; } /// /// /// /// /// public Item(Affiliation affiliation, Role role) : this(affiliation) { this.Role = role; } /// /// /// /// /// /// public Item(Affiliation affiliation, Role role, string reason) : this(affiliation, role) { this.Reason = reason; } /// /// /// public Role Role { get { return (Role) GetAttributeEnum("role", typeof(Role)); } set { SetAttribute("role", value.ToString()); } } /// /// /// public Affiliation Affiliation { get { return (Affiliation) GetAttributeEnum("affiliation", typeof(Affiliation)); } set { SetAttribute("affiliation", value.ToString()); } } /// /// /// public string Nickname { get { return GetAttribute("nick"); } set { SetAttribute("nick", value); } } /// /// /// public string Reason { set { SetTag("reason", value); } get { return GetTag("reason"); } } public Actor Actor { get { return SelectSingleElement(typeof(Actor)) as Actor; } set { if (HasTag(typeof(Actor))) RemoveTag(typeof(Actor)); if (value != null) this.AddChild(value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/Actor.cs0000644000175000017500000000274112204443225023577 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.muc { public class Actor : Element { public Actor() { this.TagName = "actor"; this.Namespace = Uri.MUC_USER; } public Jid Jid { get { return GetAttributeJid("jid"); } set { SetAttribute("jid", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/MucManager.cs0000644000175000017500000015573412250206660024562 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.protocol.client; using agsXMPP.protocol.x.muc; using agsXMPP.protocol.x.muc.iq; using agsXMPP.protocol.x.muc.iq.admin; using agsXMPP.protocol.x.muc.iq.owner; using agsXMPP.protocol.x.data; namespace agsXMPP.protocol.x.muc { /// /// A helper class for Multi User Chat /// public class MucManager { private XmppClientConnection m_connection = null; public MucManager(XmppClientConnection con) { m_connection = con; } #region << Invite >> /* Hey Hecate, this is the place for all good witches! */ /// /// Invite a contact to join a chatroom /// /// The Jid of the contact to invite /// The Jid of the chatroom public void Invite(Jid to, Jid room) { Invite(to, room, null); } /// /// Invite a contact to join a chatroom /// /// The Jid of the contact to invite /// The Jid of the chatroom /// The reason. public void Invite(Jid to, Jid room, string reason) { Invite(to, room, reason, null); } /// /// Invite a contact to join a chatroom /// /// The Jid of the contact to invite /// The Jid of the chatroom /// The reason. /// The password required to enter the room. public void Invite(Jid to, Jid room, string reason, string password) { Invite(new Jid[1] { to }, room, reason, password); } /// /// Invite multiple contacts to a chatroom /// /// /// /// public void Invite(Jid[] jids, Jid room, string reason, string password) { Message msg = new Message(); msg.To = room; User user = new User(); foreach (Jid jid in jids) { if (reason != null) user.AddChild(new Invite(jid, reason)); else user.AddChild(new Invite(jid)); } if (password != null) { user.Password = password; } msg.AddChild(user); m_connection.Send(msg); } #endregion #region << Decline Invite >> /// /// Decline a groupchat invitation /// /// the jid which invited us /// to room to which we send the decline (this is normally the same room we were invited to) public void Decline(Jid to, Jid room) { Decline(to, room, null); } /// /// Decline a groupchat invitation /// /// the jid which invited us /// to room to which we send the decline (this is normally the same room we were invited to) /// reason why we decline the invitation public void Decline(Jid to, Jid room, string reason) { Message msg = new Message(); msg.To = room; User user = new User(); if (reason != null) user.Decline = new Decline(to, reason); else user.Decline = new Decline(to); msg.AddChild(user); m_connection.Send(msg); } #endregion /* Fire Burn and Cauldron Bubble! */ /// /// Change the subject of a room /// /// /// public void ChangeSubject(Jid room, string newSubject) { ChangeSubject(room, newSubject, null); } /// /// Change the subject of a room /// /// /// /// public void ChangeSubject(Jid room, string newSubject, string body) { Message msg = new Message(); msg.Type = MessageType.groupchat; msg.To = room; msg.Subject = newSubject; if (body != null) msg.Body = body; m_connection.Send(msg); } /// /// Change the Nickname in a room /// /// /// public void ChangeNickname(Jid room, string newNick) { Jid to = new Jid(room.ToString()); to.Resource = newNick; Presence pres = new Presence(); pres.To = to; m_connection.Send(pres); } /* */ /// /// Join a chatroom /// /// jid of the room to join /// nickname to use in the room public void JoinRoom(Jid room, string nickname) { JoinRoom(room, nickname, null, false); } /// /// Join a chatroom /// /// jid of the room to join /// nickname to use in the room /// true for joining without chat room history public void JoinRoom(Jid room, string nickname, bool disableHistory) { JoinRoom(room, nickname, null, disableHistory); } public void JoinRoom(Jid room, string nickname, string password) { JoinRoom(room, nickname, password, false); } /// /// Join a chatroom /// /// jid of the room to join /// nickname to use in the room /// password for password protected chat rooms /// true for joining without chat room history public void JoinRoom(Jid room, string nickname, string password, bool disableHistory) { /* cauldron join room and request no history */ Jid to = new Jid(room.ToString()); to.Resource = nickname; Presence pres = new Presence(); pres.To = to; Muc x = new Muc(); if (password != null) x.Password = password; if (disableHistory) { History hist = new History(); hist.MaxCharacters = 0; x.History = hist; } pres.AddChild(x); m_connection.Send(pres); } /// /// Leave a conference room /// /// /// public void LeaveRoom(Jid room, string nickname) { Jid to = new Jid(room.ToString()); to.Resource = nickname; Presence pres = new Presence(); pres.To = to; pres.Type = PresenceType.unavailable; m_connection.Send(pres); } /* 9.1.2 Creating an Instant Room If the initial room owner wants to accept the default room configuration (i.e., create an "instant room"), the room owner MUST decline an initial configuration form by sending an IQ set to the itself containing a element qualified by the 'http://jabber.org/protocol/muc#owner' namespace, where the only child of the is an empty element that is qualified by the 'jabber:x:data' namespace and that possesses a 'type' attribute whose value is "submit": Example 129. Owner Requests Instant Room */ /// /// create an "instant room". This means you accept the default configuration and dont want to configure the room. /// /// public void AcceptDefaultConfiguration(Jid room) { AcceptDefaultConfiguration(room, null); } /// /// create an "instant room". This means you accept the default configuration and dont want to configure the room. /// /// /// /// public void AcceptDefaultConfiguration(Jid room, IqHandler cb) { OwnerIq oIq = new agsXMPP.protocol.x.muc.iq.owner.OwnerIq(IqType.set, room); oIq.Query.AddChild(new Data(XDataFormType.submit)); if (cb == null) m_connection.Send(oIq); else m_connection.IqGrabber.SendIq(oIq, cb); } /* */ /// /// Request the configuration form of a chatroom. /// You can request the from when creating a new room. or at any time later if you want to change the room configuration. /// Only room owners can request this from. Otherwise the service must return a 403 forbidden error /// /// public void RequestConfigurationForm(Jid room) { RequestConfigurationForm(room, null); } /// /// Request the configuration form of a chatroom. /// You can request the from when creating a new room. or at any time later if you want to change the room configuration. /// Only room owners can request this from. Otherwise the service must return a 403 forbidden error /// /// /// /// public void RequestConfigurationForm(Jid room, IqHandler cb) { OwnerIq oIq = new agsXMPP.protocol.x.muc.iq.owner.OwnerIq(IqType.get, room); m_connection.IqGrabber.SendIq(oIq, cb); } /* Avaunt, you cullion! */ /// /// Kick a occupant /// A moderator has permissions kick a visitor or participant from a room. /// The kick is normally performed based on the occupant's room nickname (though it MAY be based on the full JID) /// and is completed by setting the role of a participant or visitor to a value of "none". /// /// Jid of the room to which this iq is sent /// Nickname od the occupant to kick public void KickOccupant(Jid room, string nickname) { KickOccupant(room, nickname, null, null); } /// /// Kick a occupant /// A moderator has permissions kick a visitor or participant from a room. /// The kick is normally performed based on the occupant's room nickname (though it MAY be based on the full JID) /// and is completed by setting the role of a participant or visitor to a value of "none". /// /// Jid of the room to which this iq is sent /// Nickname od the occupant to kick /// A optional reason why you kick this occupant public void KickOccupant(Jid room, string nickname, string reason) { KickOccupant(room, nickname, reason, null); } /// /// Kick a occupant /// A moderator has permissions kick a visitor or participant from a room. /// The kick is normally performed based on the occupant's room nickname (though it MAY be based on the full JID) /// and is completed by setting the role of a participant or visitor to a value of "none". /// /// Jid of the room to which this iq is sent /// Nickname od the occupant to kick /// A optional reason why you kick this occupant /// Callback which is invoked with the result to this iq /// Callback which is invoked with the result to this iq public void KickOccupant(Jid room, string nickname, string reason, IqHandler cb) { ChangeRole(Role.none, room, nickname, reason, cb); } /* Example 77. Moderator Grants Voice to a Visitor A worthy witch indeed! */ /// /// /// /// Jid of the room to which this iq is sent /// public void GrantVoice(Jid room, string nickname) { GrantVoice(room, nickname, null, null); } /// /// /// /// Jid of the room to which this iq is sent /// /// public void GrantVoice(Jid room, string nickname, string reason) { GrantVoice(room, nickname, reason, null); } /// /// /// /// Jid of the room to which this iq is sent /// /// /// /// public void GrantVoice(Jid room, string nickname, string reason, IqHandler cb) { ChangeRole(Role.participant, room, nickname, reason, cb); } /* Example 80. Moderator Revokes Voice from a Participant */ /// /// In a moderated room, a moderator may want to revoke a participant's privileges to speak. /// The moderator can revoke voice from a participant by changing the participant's role to "visitor": /// /// Jid of the room to which this iq is sent /// public void RevokeVoice(Jid room, string nickname) { RevokeVoice(room, nickname, null, null); } /// /// In a moderated room, a moderator may want to revoke a participant's privileges to speak. /// The moderator can revoke voice from a participant by changing the participant's role to "visitor": /// /// Jid of the room to which this iq is sent /// /// public void RevokeVoice(Jid room, string nickname, string reason) { RevokeVoice(room, nickname, reason, null); } /// /// In a moderated room, a moderator may want to revoke a participant's privileges to speak. /// The moderator can revoke voice from a participant by changing the participant's role to "visitor": /// /// Jid of the room to which this iq is sent /// /// /// /// public void RevokeVoice(Jid room, string nickname, string reason, IqHandler cb) { ChangeRole(Role.visitor, room, nickname, reason, cb); } /* A moderator in a moderated room may want to modify the voice list. To do so, the moderator first requests the voice list by querying the room for all occupants with a role of 'participant'. Example 84. Moderator Requests Voice List */ /// /// A moderator in a moderated room may want to modify the voice list. /// To do so, the moderator first requests the voice list by querying the room for all occupants /// with a role of 'participant'. /// The service MUST then return the voice list to the moderator; each item MUST include /// the 'nick' and 'role' attributes and SHOULD include the 'affiliation' and 'jid' attributes. /// The moderator MAY then modify the voice list. In order to do so, the moderator MUST send the /// changed items (i.e., only the "delta") back to the service; each item MUST include /// the 'nick' attribute and 'role' attribute (normally set to a value of "participant" or "visitor") /// but SHOULD NOT include the 'jid' attribute and MUST NOT include the 'affiliation' attribute /// (which is used to manage affiliations such as owner rather than the participant role), /// /// Jid of the room to which this iq is sent public void RequestVoiceList(Jid room) { RequestVoiceList(room, null); } /// /// A moderator in a moderated room may want to modify the voice list. /// To do so, the moderator first requests the voice list by querying the room for all occupants /// with a role of 'participant'. /// The service MUST then return the voice list to the moderator; each item MUST include /// the 'nick' and 'role' attributes and SHOULD include the 'affiliation' and 'jid' attributes. /// The moderator MAY then modify the voice list. In order to do so, the moderator MUST send the /// changed items (i.e., only the "delta") back to the service; each item MUST include /// the 'nick' attribute and 'role' attribute (normally set to a value of "participant" or "visitor") /// but SHOULD NOT include the 'jid' attribute and MUST NOT include the 'affiliation' attribute /// (which is used to manage affiliations such as owner rather than the participant role), /// /// Jid of the room to which this iq is sent /// /// public void RequestVoiceList(Jid room, IqHandler cb) { RequestList(Role.participant, room, cb); } /* Example 89. Admin Bans User Treason */ /// /// /// /// /// public void BanUser(Jid room, Jid user) { BanUser(room, user, null, null); } /// /// /// /// /// /// public void BanUser(Jid room, Jid user, string reason) { BanUser(room, user, reason, null); } /// /// /// /// /// /// /// /// public void BanUser(Jid room, Jid user, string reason, IqHandler cb) { ChangeAffiliation(Affiliation.outcast, room, user, null, reason, cb); } /* A room admin may want to modify the ban list. Note: The ban list is always based on a user's bare JID, although a nick (perhaps the last room nickname associated with that JID) MAY be included for convenience. To modify the list of banned JIDs, the admin first requests the ban list by querying the room for all users with an affiliation of 'outcast'. Example 94. Admin Requests Ban List */ /// /// A room admin may want to modify the ban list. /// /// Note: The ban list is always based on a user's bare JID, /// although a nick (perhaps the last room nickname associated with that JID) MAY be included for convenience. /// To modify the list of banned JIDs, the admin first requests the ban list by querying the room for all /// users with an affiliation of 'outcast'. /// /// /// public void RequestBanList(Jid room) { RequestBanList(room, null); } /// /// A room admin may want to modify the ban list. /// /// Note: The ban list is always based on a user's bare JID, /// although a nick (perhaps the last room nickname associated with that JID) MAY be included for convenience. /// To modify the list of banned JIDs, the admin first requests the ban list by querying the room for all /// users with an affiliation of 'outcast'. /// /// /// /// /// public void RequestBanList(Jid room, IqHandler cb) { RequestList(Affiliation.outcast, room, cb); } /* An owner can grant administrative privileges to a member or unaffiliated user; this is done by changing the user's affiliation to "admin": Example 155. Owner Grants Admin Privileges */ /// /// Grant administrative privileges to a member or unaffiliated user. /// This could be done by an room owner /// /// /// public void GrantAdminPrivileges(Jid room, Jid user) { GrantAdminPrivileges(room, user, null); } /// /// Grant administrative privileges to a member or unaffiliated user. /// This could be done by an room owner /// /// /// /// /// public void GrantAdminPrivileges(Jid room, Jid user, IqHandler cb) { ChangeAffiliation(Affiliation.admin, room, user, cb); } /* An admin can grant membership to a user; this is done by changing the user's affiliation to "member" (normally based on nick if the user is in the room, or on bare JID if not; in either case, if the nick is provided, that nick becomes the user's default nick in the room if that functionality is supported by the implementation) Example 98. Admin Grants Membership */ /// /// An admin can grant membership to a user; /// this is done by changing the user's affiliation to "member" /// (normally based on nick if the user is in the room, or on bare JID if not; /// in either case, if the nick is provided, that nick becomes the user's default nick in the room /// if that functionality is supported by the implementation) /// /// /// public void GrantMembership(Jid room, Jid user) { GrantMembership(room, user, null, null); } /// /// An admin can grant membership to a user; /// this is done by changing the user's affiliation to "member" /// (normally based on nick if the user is in the room, or on bare JID if not; /// in either case, if the nick is provided, that nick becomes the user's default nick in the room /// if that functionality is supported by the implementation) /// /// /// /// public void GrantMembership(Jid room, Jid user, string reason) { GrantMembership(room, user, reason, null); } /// /// An admin can grant membership to a user; /// this is done by changing the user's affiliation to "member" /// (normally based on nick if the user is in the room, or on bare JID if not; /// in either case, if the nick is provided, that nick becomes the user's default nick in the room /// if that functionality is supported by the implementation) /// /// /// /// /// /// public void GrantMembership(Jid room, Jid user, string reason, IqHandler cb) { ChangeAffiliation(Affiliation.member, room, user, null, reason, cb); } /// /// An admin can grant membership to a user; /// this is done by changing the user's affiliation to "member" /// (normally based on nick if the user is in the room, or on bare JID if not; /// in either case, if the nick is provided, that nick becomes the user's default nick in the room /// if that functionality is supported by the implementation) /// /// /// public void GrantMembership(Jid room, string nickname) { GrantMembership(room, nickname, null, null); } /// /// An admin can grant membership to a user; /// this is done by changing the user's affiliation to "member" /// (normally based on nick if the user is in the room, or on bare JID if not; /// in either case, if the nick is provided, that nick becomes the user's default nick in the room /// if that functionality is supported by the implementation) /// /// /// /// public void GrantMembership(Jid room, string nickname, string reason) { GrantMembership(room, nickname, reason, null); } /// /// An admin can grant membership to a user; /// this is done by changing the user's affiliation to "member" /// (normally based on nick if the user is in the room, or on bare JID if not; /// in either case, if the nick is provided, that nick becomes the user's default nick in the room /// if that functionality is supported by the implementation) /// /// /// /// /// /// public void GrantMembership(Jid room, string nickname, string reason, IqHandler cb) { ChangeAffiliation(Affiliation.member, room, nickname, reason, cb); } /* Example 144. Owner Grants Ownership Privileges */ /// /// If allowed by an implementation, an owner MAY grant ownership privileges to another user. /// /// /// public void GrantOwnershipPrivileges(Jid room, Jid user) { ChangeAffiliation(Affiliation.owner, room, user, null, null); } /// /// If allowed by an implementation, an owner MAY grant ownership privileges to another user. /// /// /// /// /// public void GrantOwnershipPrivileges(Jid room, Jid user, IqHandler cb) { ChangeAffiliation(Affiliation.owner, room, user, cb); } /* 8.4 Revoking Membership An admin may want to revoke a user's membership; this is done by changing the user's affiliation to "none": Example 101. Admin Revokes Membership */ /// /// An admin may want to revoke a user's membership /// this is done by changing the user's affiliation to "none" /// /// /// public void RevokeMembership(Jid room, string nickname) { RevokeMembership(room, nickname, null, null); } /// /// An admin may want to revoke a user's membership /// this is done by changing the user's affiliation to "none" /// /// /// /// public void RevokeMembership(Jid room, string nickname, string reason) { RevokeMembership(room, nickname, reason, null); } /// /// An admin may want to revoke a user's membership /// this is done by changing the user's affiliation to "none" /// /// /// /// /// /// public void RevokeMembership(Jid room, string nickname, string reason, IqHandler cb) { ChangeAffiliation(Affiliation.none, room, nickname, reason, cb); } /* 9.8 Modifying the Admin List A room owner may want to modify the admin list. To do so, the owner first requests the admin list by querying the room for all users with an affiliation of 'admin'. Example 161. Owner Requests Admin List */ /// /// Request the list of admins. This could be done by the room owner /// /// public void RequestAdminList(Jid room) { RequestAdminList(room, null); } /// /// Request the list of admins. This could be done by the room owner /// /// /// /// public void RequestAdminList(Jid room, IqHandler cb) { RequestList(Affiliation.admin, room, cb); } /* If allowed by an implementation, a room owner may want to modify the owner list. To do so, the owner first requests the owner list by querying the room for all users with an affiliation of 'owner'. Example 150. Owner Requests Owner List */ /// /// Request the owner list of a room /// /// public void RequestOwnerList(Jid room) { RequestOwnerList(room, null); } /// /// Request the owner list of a room /// /// /// /// public void RequestOwnerList(Jid room, IqHandler cb) { RequestList(Affiliation.owner, room, cb); } /* Example 105. Admin Requests Member List */ /// /// In the context of a members-only room, the member list is essentially a "whitelist" of people /// who are allowed to enter the room. Anyone who is not a member is effectively banned from entering the room, /// even if their affiliation is not "outcast". /// In the context of an open room, the member list is simply a list of users (bare JID and reserved nick) /// who are registered with the room. Such users may appear in a room roster, have their room nickname reserved, /// be returned in search results or FAQ queries, and the like. /// It is RECOMMENDED that only room admins have the privilege to modify the member list in members-only rooms. /// To do so, the admin first requests the member list by querying the room for all users with an affiliation of "member" /// /// public void RequestMemberList(Jid room) { RequestMemberList(room, null); } /// /// In the context of a members-only room, the member list is essentially a "whitelist" of people /// who are allowed to enter the room. Anyone who is not a member is effectively banned from entering the room, /// even if their affiliation is not "outcast". /// In the context of an open room, the member list is simply a list of users (bare JID and reserved nick) /// who are registered with the room. Such users may appear in a room roster, have their room nickname reserved, /// be returned in search results or FAQ queries, and the like. /// It is RECOMMENDED that only room admins have the privilege to modify the member list in members-only rooms. /// To do so, the admin first requests the member list by querying the room for all users with an affiliation of "member" /// /// /// /// public void RequestMemberList(Jid room, IqHandler cb) { RequestList(Affiliation.member, room, cb); } /* 8.6 Granting Moderator Privileges An admin may want to grant moderator privileges to a participant or visitor; this is done by changing the user's role to "moderator": Example 113. Admin Grants Moderator Privileges */ /// /// An admin may want to grant moderator privileges to a participant or visitor /// this is done by changing the user's role to "moderator" /// /// /// public void GrantModeratorPrivileges(Jid room, string nickname) { GrantModeratorPrivileges(room, nickname, null, null); } /// /// An admin may want to grant moderator privileges to a participant or visitor /// this is done by changing the user's role to "moderator" /// /// /// /// public void GrantModeratorPrivileges(Jid room, string nickname, string reason) { GrantModeratorPrivileges(room, nickname, reason, null); } /// /// An admin may want to grant moderator privileges to a participant or visitor /// this is done by changing the user's role to "moderator" /// /// /// /// /// /// public void GrantModeratorPrivileges(Jid room, string nickname, string reason, IqHandler cb) { ChangeRole(Role.moderator, room, nickname, reason, cb); } /* 8.7 Revoking Moderator Privileges An admin may want to revoke a user's moderator privileges. An admin MAY revoke moderator privileges only from a user whose affiliation is "member" or "none" (i.e., not from an owner or admin). The privilege is revoked by changing the user's role to "participant": Example 116. Admin Revokes Moderator Privileges */ public void RevokeModerator(Jid room, string nickname) { RevokeModerator(room, nickname, null, null); } public void RevokeModerator(Jid room, string nickname, string reason) { RevokeModerator(room, nickname, reason, null); } public void RevokeModerator(Jid room, string nickname, string reason, IqHandler cb) { ChangeRole(Role.participant, room, nickname, reason, cb); } /* 8.8 Modifying the Moderator List An admin may want to modify the moderator list. To do so, the admin first requests the moderator list by querying the room for all users with a role of 'moderator'. Example 120. Admin Requests Moderator List */ /// /// Requests the moderator list. /// /// The room. public void RequestModeratorList(Jid room) { RequestModeratorList(room, null); } /// /// Requests the moderator list. /// /// The room. /// The cb. /// The cb arg. public void RequestModeratorList(Jid room, IqHandler cb) { RequestList(Role.moderator, room, cb); } public void RequestList(Affiliation affiliation, Jid room, IqHandler cb) { AdminIq aIq = new AdminIq(); aIq.To = room; aIq.Type = IqType.get; aIq.Query.AddItem(new agsXMPP.protocol.x.muc.iq.admin.Item(affiliation)); if (cb == null) m_connection.Send(aIq); else m_connection.IqGrabber.SendIq(aIq, cb); } public void RequestList(Role role, Jid room, IqHandler cb) { AdminIq aIq = new AdminIq(); aIq.To = room; aIq.Type = IqType.get; aIq.Query.AddItem(new agsXMPP.protocol.x.muc.iq.admin.Item(role)); if (cb == null) m_connection.Send(aIq); else m_connection.IqGrabber.SendIq(aIq, cb); } #region << Create Reserved Room >> /// /// Creates a reserved room. The MUC server replies to this request either with an error if the room already exists /// or another error occured. Or with the configuration for, for the reserved room which you have submit in the /// second step /// /// Jid of the room to create public void CreateReservedRoom(Jid room) { CreateReservedRoom(room, null); } /// /// /// Creates a reserved room. The MUC server replies to this request either with an error if the room already exists /// or another error occured. Or with the configuration for, for the reserved room which you have submit in the /// second step. /// /// /// Jid of the room to create /// callback for the response /// optional callback arguments public void CreateReservedRoom(Jid room, IqHandler cb) { /* */ OwnerIq iq = new OwnerIq(); iq.Type = IqType.get; iq.To = room; if (cb == null) m_connection.Send(iq); else m_connection.IqGrabber.SendIq(iq, cb); } #endregion #region << Destroy Room >> public void DestroyRoom(Jid room, Jid altVenue) { DestroyRoom(room, altVenue, null, null); } public void DestroyRoom(Jid room, Jid altVenue, IqHandler cb) { DestroyRoom(room, altVenue, null, cb); } public void DestroyRoom(Jid room, string reason) { DestroyRoom(room, null, reason, null); } public void DestroyRoom(Jid room, string reason, IqHandler cb) { DestroyRoom(room, null, reason, cb); } public void DestroyRoom(Jid room, Jid altVenue, string reason) { DestroyRoom(room, altVenue, reason, null); } public void DestroyRoom(Jid room, Jid altVenue, string reason, IqHandler cb) { /* Example 177. Owner Submits Room Destruction Request Macbeth doth come. */ OwnerIq iq = new OwnerIq(); iq.Type = IqType.set; iq.To = room; owner.Destroy destroy = new owner.Destroy(); if (reason != null) destroy.Reason = reason; if (altVenue != null) destroy.AlternateVenue = altVenue; iq.Query.AddChild(destroy); if (cb == null) m_connection.Send(iq); else m_connection.IqGrabber.SendIq(iq, cb); } #endregion public void ModifyList(Jid room, agsXMPP.protocol.x.muc.iq.admin.Item[] items) { ModifyList(room, items, null); } public void ModifyList(Jid room, agsXMPP.protocol.x.muc.iq.admin.Item[] items, IqHandler cb) { AdminIq aIq = new AdminIq(); aIq.To = room; aIq.Type = IqType.set; foreach (agsXMPP.protocol.x.muc.iq.admin.Item itm in items) { aIq.Query.AddItem(itm); } if (cb == null) m_connection.Send(aIq); else m_connection.IqGrabber.SendIq(aIq, cb); } #region << private functions >> private void ChangeRole(Role role, Jid room, string nickname, string reason, IqHandler cb) { AdminIq aIq = new AdminIq(); aIq.To = room; aIq.Type = IqType.set; agsXMPP.protocol.x.muc.iq.admin.Item itm = new agsXMPP.protocol.x.muc.iq.admin.Item(); itm.Role = role; itm.Nickname = nickname; if (reason != null) itm.Reason = reason; aIq.Query.AddItem(itm); if (cb == null) m_connection.Send(aIq); else m_connection.IqGrabber.SendIq(aIq, cb); } private void ChangeAffiliation(Affiliation affiliation, Jid room, string nickname, string reason, IqHandler cb) { AdminIq aIq = new AdminIq(); aIq.To = room; aIq.Type = IqType.set; agsXMPP.protocol.x.muc.iq.admin.Item itm = new agsXMPP.protocol.x.muc.iq.admin.Item(); itm.Affiliation = affiliation; if (nickname != null) itm.Nickname = nickname; if (reason != null) itm.Reason = reason; aIq.Query.AddItem(itm); if (cb == null) m_connection.Send(aIq); else m_connection.IqGrabber.SendIq(aIq, cb); } private void ChangeAffiliation(Affiliation affiliation, Jid room, Jid user, IqHandler cb) { ChangeAffiliation(affiliation, room, user, null, null, cb); } private void ChangeAffiliation(Affiliation affiliation, Jid room, Jid user, string nickname, string reason, IqHandler cb) { var aIq = new AdminIq(); aIq.To = room; aIq.Type = IqType.set; agsXMPP.protocol.x.muc.iq.admin.Item itm = new agsXMPP.protocol.x.muc.iq.admin.Item(); itm.Affiliation = affiliation; if (user != null) itm.Jid = user; if (nickname != null) itm.Nickname = nickname; if (reason != null) itm.Reason = reason; aIq.Query.AddItem(itm); if (cb == null) m_connection.Send(aIq); else m_connection.IqGrabber.SendIq(aIq, cb); } #endregion } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/muc/Decline.cs0000644000175000017500000000504012204443225024065 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.x.muc { /* Example 45. Invitee Declines Invitation Sorry, I'm too busy right now. Example 46. Room Informs Invitor that Invitation Was Declined Sorry, I'm too busy right now. */ public class Decline : Invitation { #region << Constructors >> public Decline() : base() { this.TagName = "decline"; } public Decline(string reason) : this() { this.Reason = reason; } public Decline(Jid to) : this() { this.To = to; } public Decline(Jid to, string reason): this() { this.To = to; this.Reason = reason; } #endregion } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/Conference.cs0000644000175000017500000000351612204443225024013 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x { /* You have been invited to darkcave@macbeth. */ /// /// is used for inviting somebody to a chatroom /// public class Conference : Element { public Conference() { this.TagName = "x"; this.Namespace = Uri.X_CONFERENCE; } public Conference(Jid room) : this() { Chatroom = room; } /// /// Room Jid /// public Jid Chatroom { get { return new Jid(GetAttribute("jid")); } set { SetAttribute("jid", value.ToString()); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/data/0000755000175000017500000000000012204443225022321 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/data/Field.cs0000644000175000017500000001712612204443225023702 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.data { /* * <instructions/> <field var='field-name' type='{field-type}' label='description'> <desc/> <required/> <value>field-value</value> <option label='option-label'><value>option-value</value></option> <option label='option-label'><value>option-value</value></option> </field> </x> */ /// <summary> /// /// </summary> public class Field : Element { public Field() { this.TagName = "field"; this.Namespace = Uri.X_DATA; } public Field(FieldType type) : this() { this.Type = type; } public Field(string var, string label, FieldType type) : this() { this.Type = type; this.Var = var; this.Label = label; } #region << Properties >> public string Var { get { return GetAttribute("var"); } set { SetAttribute("var", value); } } public string Label { get { return GetAttribute("label"); } set { SetAttribute("label", value); } } public FieldType Type { get { switch (GetAttribute("type")) { case "boolean": return FieldType.Boolean; case "fixed": return FieldType.Fixed; case "hidden": return FieldType.Hidden; case "jid-multi": return FieldType.Jid_Multi; case "jid-single": return FieldType.Jid_Single; case "list-multi": return FieldType.List_Multi; case "list-single": return FieldType.List_Single; case "text-multi": return FieldType.Text_Multi; case "text-private": return FieldType.Text_Private; case "text-single": return FieldType.Text_Single; default: return FieldType.Unknown; } } set { switch (value) { case FieldType.Boolean: SetAttribute("type", "boolean"); break; case FieldType.Fixed: SetAttribute("type", "fixed"); break; case FieldType.Hidden: SetAttribute("type", "hidden"); break; case FieldType.Jid_Multi: SetAttribute("type", "jid-multi"); break; case FieldType.Jid_Single: SetAttribute("type", "jid-single"); break; case FieldType.List_Multi: SetAttribute("type", "list-multi"); break; case FieldType.List_Single: SetAttribute("type", "list-single"); break; case FieldType.Text_Multi: SetAttribute("type", "text-multi"); break; case FieldType.Text_Private: SetAttribute("type", "text-private"); break; case FieldType.Text_Single: SetAttribute("type", "text-single"); break; default: RemoveAttribute("type"); break; } } } public string Description { get { return GetTag("desc"); } set { SetTag("desc", value); } } /// <summary> /// Is this field a required field? /// </summary> public bool IsRequired { get { return HasTag("required"); } set { if (value == true) SetTag("required"); else RemoveTag("required"); } } #endregion #region << Methods and Functions >> /// <summary> /// The value of the field. /// </summary> public string GetValue() { return GetTag(typeof(Value)); //return GetTag("value"); } public bool HasValue(string val) { foreach(string s in GetValues()) { if(s == val) return true; } return false; } /// <summary> /// /// </summary> /// <param name="val"></param> /// <returns></returns> public void SetValue(string val) { SetTag(typeof(Value), val); } /// <summary> /// Set the value of boolean fields /// </summary> /// <param name="val"></param> public void SetValueBool(bool val) { SetValue( val ? "1" : "0" ); } /// <summary> /// Get the value of boolean fields /// </summary> /// <returns></returns> public bool GetValueBool() { // only "0" and "1" are valid. We dont care about other buggy implementations string val = GetValue(); if (val == null || val == "0") return false; else return true; } /// <summary> /// Returns the value as Jif for the Jid fields. /// Or null when the value is not a valid Jid. /// </summary> /// <returns></returns> public Jid GetValueJid() { try { return new Jid(GetValue()); } catch { return null; } } /// <summary> /// Adds a value /// </summary> /// <remarks> /// you can call this function multiple times to add values to "multi" fields /// </remarks> /// <param name="val"></param> public void AddValue(string val) { AddChild(new Value(val)); //AddTag("value", val); } /// <summary> /// Adds multiple values to the already existing values from a string array /// </summary> /// <param name="vals"></param> public void AddValues(string[] vals) { if (vals.Length > 0) { foreach (string s in vals) AddValue(s); } } /// <summary> /// Adds multiple values. All already existing values will be removed /// </summary> /// <param name="vals"></param> public void SetValues(string[] vals) { ElementList nl = SelectElements(typeof(Value)); foreach(Element e in nl) e.Remove(); AddValues(vals); } /// <summary> /// Gets all values for multi fields as Array /// </summary> /// <returns>string Array that contains all the values</returns> public string[] GetValues() { ElementList nl = SelectElements(typeof(Value)); string[] values = new string[nl.Count]; int i = 0; foreach (Element val in nl) { values[i] = val.Value; i++; } return values; } public Option AddOption(string label, string val) { Option opt = new Option(label, val); AddChild(opt); return opt; } public Option AddOption() { Option opt = new Option(); AddChild(opt); return opt; } public void AddOption(Option opt) { AddChild(opt); } public Option[] GetOptions() { ElementList nl = SelectElements(typeof(Option)); int i = 0; Option[] result = new Option[nl.Count]; foreach (Option o in nl) { result[i] = o; i++; } return result; } #endregion } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/data/Reported.cs������������������������������������������0000644�0001750�0001750�00000003071�12204443225�024435� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.data { /// <summary> /// Used in XData seach reports. /// includes the headers of the search results /// </summary> public class Reported : FieldContainer { #region << Constructors >> public Reported() { this.TagName = "reported"; this.Namespace = Uri.X_DATA; } #endregion } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/data/Option.cs��������������������������������������������0000644�0001750�0001750�00000005032�12204443225�024120� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.data { /* <x xmlns='jabber:x:data' type='{form-type}'> <title/> <instructions/> <field var='field-name' type='{field-type}' label='description'> <desc/> <required/> <value>field-value</value> <option label='option-label'><value>option-value</value></option> <option label='option-label'><value>option-value</value></option> </field> </x> <xs:element name='option'> <xs:complexType> <xs:sequence> <xs:element ref='value'/> </xs:sequence> <xs:attribute name='label' type='xs:string' use='optional'/> </xs:complexType> </xs:element> */ /// <summary> /// Field Option. /// </summary> public class Option : Element { #region << Constructors >> public Option() { this.TagName = "option"; this.Namespace = Uri.X_DATA; } public Option(string label, string val) : this() { Label = label; SetValue(val); } #endregion #region << Properties >> /// <summary> /// Label of the option /// </summary> public string Label { get { return GetAttribute("label"); } set { SetAttribute("label", value); } } #endregion /// <summary> /// Value of the Option /// </summary> public string GetValue() { return GetTag(typeof(Value)); } public void SetValue(string val) { SetTag(typeof(Value), val); } } }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/data/FieldTypes.cs����������������������������������������0000644�0001750�0001750�00000006304�12204443225�024723� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.x.data { /// <summary> /// Field Types /// </summary> public enum FieldType { /// <summary> /// a unknown fieldtype /// </summary> Unknown, /// <summary> /// The field enables an entity to gather or provide an either-or choice between two options. The allowable values are 1 for yes/true/assent and 0 for no/false/decline. The default value is 0. /// </summary> Boolean, /// <summary> /// The field is intended for data description (e.g., human-readable text such as "section" headers) rather than data gathering or provision. The <value/> child SHOULD NOT contain newlines (the \n and \r characters); instead an application SHOULD generate multiple fixed fields, each with one <value/> child. /// </summary> Fixed, /// <summary> /// The field is not shown to the entity providing information, but instead is returned with the form. /// </summary> Hidden, /// <summary> /// The field enables an entity to gather or provide multiple Jabber IDs. /// </summary> Jid_Multi, /// <summary> /// The field enables an entity to gather or provide a single Jabber ID. /// </summary> Jid_Single, /// <summary> /// The field enables an entity to gather or provide one or more options from among many. /// </summary> List_Multi, /// <summary> /// The field enables an entity to gather or provide one option from among many. /// </summary> List_Single, /// <summary> /// The field enables an entity to gather or provide multiple lines of text. /// </summary> Text_Multi, /// <summary> /// password style textbox. /// The field enables an entity to gather or provide a single line or word of text, which shall be obscured in an interface (e.g., *****). /// </summary> Text_Private, /// <summary> /// The field enables an entity to gather or provide a single line or word of text, which may be shown in an interface. This field type is the default and MUST be assumed if an entity receives a field type it does not understand. /// </summary> Text_Single } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/data/FieldContainer.cs������������������������������������0000644�0001750�0001750�00000005761�12204443225�025547� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.data { /// <summary> /// Bass class for all xdata classes that contain xData fields /// </summary> public abstract class FieldContainer : Element { /// <summary> /// Initializes a new instance of the <see cref="FieldContainer"/> class. /// </summary> public FieldContainer() { } #region << public Methods >> /// <summary> /// /// </summary> /// <returns></returns> public Field AddField() { Field f = new Field(); AddChild(f); return f; } /// <summary> /// /// </summary> /// <param name="field"></param> public Field AddField(Field field) { AddChild(field); return field; } /// <summary> /// Retrieve a field with the given "var" /// </summary> /// <param name="var"></param> /// <returns></returns> public Field GetField(string var) { ElementList nl = SelectElements(typeof(Field)); foreach (Element e in nl) { Field f = e as Field; if (f.Var == var) return f; } return null; } /// <summary> /// Gets a list of all form fields /// </summary> /// <returns></returns> public Field[] GetFields() { ElementList nl = SelectElements(typeof(Field)); Field[] fields = new Field[nl.Count]; int i = 0; foreach (Element e in nl) { fields[i] = (Field)e; i++; } return fields; } #endregion } } ���������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/data/Value.cs���������������������������������������������0000644�0001750�0001750�00000002774�12204443225�023736� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.data { /// <summary> /// Summary description for Value. /// </summary> public class Value : Element { public Value() { this.TagName = "value"; this.Namespace = Uri.X_DATA; } public Value(string val) : this() { Value = val; } public Value(bool val) : this() { Value = val ? "1" : "0"; } } } ����smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/data/Item.cs����������������������������������������������0000644�0001750�0001750�00000003001�12204443225�023540� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.x.data { /// <summary> /// Used in XData seach. /// includes the headers of the search results /// </summary> public class Item : FieldContainer { #region << Constructors >> public Item() { this.TagName = "item"; this.Namespace = Uri.X_DATA; } #endregion } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/data/Data.cs����������������������������������������������0000644�0001750�0001750�00000010676�12204443225�023533� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.data { /// <summary> /// Form Types /// </summary> public enum XDataFormType { /// <summary> /// The forms-processing entity is asking the forms-submitting entity to complete a form. /// </summary> form, /// <summary> /// The forms-submitting entity is submitting data to the forms-processing entity. /// </summary> submit, /// <summary> /// The forms-submitting entity has cancelled submission of data to the forms-processing entity. /// </summary> cancel, /// <summary> /// The forms-processing entity is returning data (e.g., search results) to the forms-submitting entity, or the data is a generic data set. /// </summary> result } /// <summary> /// Summary for Data. /// </summary> public class Data : FieldContainer { /* The base syntax for the 'jabber:x:data' namespace is as follows (a formal description can be found in the XML Schema section below): <x xmlns='jabber:x:data' type='{form-type}'> <title/> <instructions/> <field var='field-name' type='{field-type}' label='description'> <desc/> <required/> <value>field-value</value> <option label='option-label'><value>option-value</value></option> <option label='option-label'><value>option-value</value></option> </field> </x> */ #region << Constructors >> public Data() { this.TagName = "x"; this.Namespace = Uri.X_DATA; } public Data(XDataFormType type) : this() { this.Type = type; } #endregion #region << Properties >> public string Title { get { return GetTag("title"); } set { SetTag("title", value); } } public string Instructions { get { return GetTag("instructions"); } set { SetTag("instructions", value); } } /// <summary> /// Type of thie XDATA Form. /// </summary> public XDataFormType Type { get { return (XDataFormType) GetAttributeEnum("type", typeof(XDataFormType)); } set { SetAttribute("type", value.ToString());} } public Reported Reported { get { return SelectSingleElement(typeof(Reported)) as Reported; } set { RemoveTag(typeof(Reported)); AddChild(value); } } #endregion #region << public Methods >> /// <summary> /// /// </summary> /// <returns></returns> public Item AddItem() { Item i = new Item(); AddChild(i); return i; } /// <summary> /// /// </summary> /// <param name="item"></param> /// <returns></returns> public Item AddItem(Item item) { AddChild(item); return item; } /// <summary> /// Gets a list of all form fields /// </summary> /// <returns></returns> public Item[] GetItems() { ElementList nl = SelectElements(typeof(Item)); Item[] items = new Item[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (Item) e; i++; } return items; } #endregion } } ������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/rosterx/��������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�023116� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/rosterx/RosterX.cs����������������������������������������0000644�0001750�0001750�00000005005�12204443225�025053� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x.rosterx { /// <summary> /// Roster Item Exchange (JEP-0144) /// </summary> public class RosterX : Element { /* <message from='horatio@denmark.lit' to='hamlet@denmark.lit'> <body>Some visitors, m'lord!</body> <x xmlns='http://jabber.org/protocol/rosterx'> <item action='add' jid='rosencrantz@denmark.lit' name='Rosencrantz'> <group>Visitors</group> </item> <item action='add' jid='guildenstern@denmark.lit' name='Guildenstern'> <group>Visitors</group> </item> </x> </message> */ /// <summary> /// Initializes a new instance of the <see cref="RosterX"/> class. /// </summary> public RosterX() { this.TagName = "x"; this.Namespace = Uri.X_ROSTERX; } /// <summary> /// Gets the roster. /// </summary> /// <returns></returns> public RosterItem[] GetRoster() { ElementList nl = SelectElements(typeof(RosterItem)); int i = 0; RosterItem[] result = new RosterItem[nl.Count]; foreach (RosterItem ri in nl) { result[i] = (RosterItem) ri; i++; } return result; } /// <summary> /// Adds a roster item. /// </summary> /// <param name="r">The r.</param> public void AddRosterItem(RosterItem r) { this.ChildNodes.Add(r); } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/rosterx/RosterItem.cs�������������������������������������0000644�0001750�0001750�00000004007�12204443225�025543� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.Base; namespace agsXMPP.protocol.x.rosterx { public enum Action { NONE = -1, add, remove, modify } /// <summary> /// Summary description for RosterItem. /// </summary> public class RosterItem : agsXMPP.protocol.Base.RosterItem { /* <item action='delete' jid='rosencrantz@denmark' name='Rosencrantz'> <group>Visitors</group> </item> */ public RosterItem() : base() { this.Namespace = Uri.X_ROSTERX; } public RosterItem(Jid jid) : this() { Jid = jid; } public RosterItem(Jid jid, string name) : this(jid) { Name = name; } public RosterItem(Jid jid, string name, Action action) : this(jid, name) { Action = action; } public Action Action { get { return (Action) GetAttributeEnum("action", typeof(Action)); } set { SetAttribute("action", value.ToString()); } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/x/Avatar.cs�������������������������������������������������0000644�0001750�0001750�00000003213�12204443225�023154� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.x { // <x xmlns="jabber:x:avatar"><hash>bbf231f2b7fa1772c2ec5cffa620d3aedb4bd793</hash></x> /// <summary> /// JEP-0008 avatars /// </summary> public class Avatar : Element { public Avatar() { this.TagName = "x"; this.Namespace = Uri.X_AVATAR; } public Avatar(string hash) : this() { Hash = hash; } public string Hash { get { return GetTag("hash"); } set { SetTag("hash", value); } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/server/�����������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�022447� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/server/Presence.cs������������������������������������������0000644�0001750�0001750�00000002445�12204443225�024547� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.server { public class Presence : agsXMPP.protocol.client.Presence { public Presence() { this.Namespace = Uri.SERVER; } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/client/�����������������������������������������������������0000755�0001750�0001750�00000000000�12250206660�022420� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/client/MessageType.cs���������������������������������������0000644�0001750�0001750�00000003657�12204443225�025207� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.client { /// <summary> /// Enumeration that represents the type of a message /// </summary> public enum MessageType { /// <summary> /// This in a normal message, much like an email. You dont expect a fast /// </summary> normal = -1, /// <summary> /// a error messages /// </summary> error, /// <summary> /// is for chat like messages, person to person. Send this if you expect a fast reply. reply or no reply at all. /// </summary> chat, /// <summary> /// is used for sending/receiving messages from/to a chatroom (IRC style chats) /// </summary> /// groupchat, /// <summary> /// Think of this as a news broadcast, or RRS Feed, the message will normally have a URL and Description Associated with it. /// </summary> headline } }���������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/client/IQ.cs������������������������������������������������0000644�0001750�0001750�00000007614�12250206660�023270� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml; using agsXMPP.Xml.Dom; using agsXMPP.protocol.iq; using agsXMPP.protocol.iq.vcard; using agsXMPP.protocol.iq.bind; using agsXMPP.protocol.iq.session; namespace agsXMPP.protocol.client { // a i know that i shouldnt use keywords for Enums. But its much easier this way // because of enum.ToString() and enum.Parse() Members public enum IqType { get, set, result, error } /// <summary> /// Iq Stanza. /// </summary> public class IQ : Base.StanzaWithError { #region << Constructors >> public IQ() { this.TagName = "iq"; this.Namespace = Uri.CLIENT; } public IQ(IqType type) : this() { this.Type = type; } public IQ(Jid from, Jid to) : this() { this.From = from; this.To = to; } public IQ(IqType type, Jid from, Jid to) : this() { this.Type = type; this.From = from; this.To = to; } #endregion public IqType Type { set { SetAttribute("type", value.ToString()); } get { return (IqType) GetAttributeEnum("type", typeof(IqType)); } } /// <summary> /// The query Element. Value can also be null which removes the Query tag when existing /// </summary> public Element Query { get { return this.SelectSingleElement("query"); } set { if (value != null) ReplaceChild(value); else RemoveTag("query"); } } /// <summary> /// Get or Set the VCard if it is a Vcard IQ /// </summary> public virtual Vcard Vcard { get { return this.SelectSingleElement("vCard") as Vcard; } set { if (value != null) ReplaceChild(value); else RemoveTag("vCard"); } } /// <summary> /// Get or Set the Bind ELement if it is a BingIq /// </summary> public virtual Bind Bind { get { return this.SelectSingleElement(typeof(Bind)) as Bind; } set { RemoveTag(typeof(Bind)); if (value != null) AddChild(value); } } /// <summary> /// Get or Set the Session Element if it is a SessionIq /// </summary> public virtual Session Session { get { return this.SelectSingleElement(typeof(Session)) as Session; } set { RemoveTag(typeof(Session)); if (value != null) AddChild(value); } } } } ��������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/client/Error.cs���������������������������������������������0000644�0001750�0001750�00000045260�12250206660�024047� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; // JEP-0086: Error Condition Mappings // <stanza-kind to='sender' type='error'> // [RECOMMENDED to include sender XML here] // <error type='error-type'> // <defined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> // <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' // xml:lang='langcode'> // OPTIONAL descriptive text // </text> // [OPTIONAL application-specific condition element] // </error> // </stanza-kind> // Legacy Error // <error code="501">Not Implemented</error> // XMPP Style Error // <error code='404' type='cancel'> // <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> // </error> namespace agsXMPP.protocol.client { // XMPP error condition XMPP error type Legacy error code // <bad-request/> modify 400 // <conflict/> cancel 409 // <feature-not-implemented/> cancel 501 // <forbidden/> auth 403 // <gone/> modify 302 (permanent) // <internal-server-error/> wait 500 // <item-not-found/> cancel 404 // <jid-malformed/> modify 400 // <not-acceptable/> modify 406 // <not-allowed/> cancel 405 // <not-authorized/> auth 401 // <payment-required/> auth 402 // <recipient-unavailable/> wait 404 // <redirect/> modify 302 (temporary) // <registration-required/> auth 407 // <remote-server-not-found/> cancel 404 // <remote-server-timeout/> wait 504 // <resource-constraint/> wait 500 // <service-unavailable/> cancel 503 // <subscription-required/> auth 407 // <undefined-condition/> [any] 500 // <unexpected-request/> wait 400 /// <summary> /// stanza error condition as defined in RFC 3920 9.3 /// </summary> public enum ErrorCondition { /// <summary> /// The sender has sent a stanza containing XML that does not conform to the appropriate schema or that /// cannot be processed (e.g., an IQ stanza that includes an unrecognized value of the 'type' attribute); /// the associated error type SHOULD be "modify". /// </summary> BadRequest, /// <summary> /// Access cannot be granted because an existing resource exists with the same name or address; /// the associated error type SHOULD be "cancel". /// </summary> Conflict, /// <summary> /// The feature represented in the XML stanza is not implemented by the intended recipient or /// an intermediate server and therefore the stanza cannot be processed; the associated error type SHOULD /// be "cancel" or "modify". /// </summary> FeatureNotImplemented, /// <summary> /// The requesting entity does not possess the required permissions to perform the action; /// the associated error type SHOULD be "auth". /// </summary> Forbidden, /// <summary> /// The recipient or server can no longer be contacted at this address /// (the error stanza MAY contain a new address in the XML character data of the <gone/> element); /// the associated error type SHOULD be "cancel" or "modify". /// </summary> Gone, /// <summary> /// The server could not process the stanza because of a misconfiguration or an otherwise-undefined /// internal server error; the associated error type SHOULD be "wait" or "cancel". /// </summary> InternalServerError, /// <summary> /// The addressed JID or item requested cannot be found; the associated error type SHOULD be "cancel" or "modify". /// </summary> /// <remarks> /// An application MUST NOT return this error if doing so would provide information about the intended /// recipient's network availability to an entity that is not authorized to know such information; /// instead it SHOULD return a <service-unavailable/> error. /// </remarks> ItemNotFound, /// <summary> /// The sending entity has provided or communicated an XMPP address /// (e.g., a value of the 'to' attribute) or aspect thereof (e.g., an XMPP resource identifier) /// that does not adhere to the syntax defined under RFC3920 Section 3 (Addresses); /// the associated error type SHOULD be "modify". /// </summary> JidMalformed, /// <summary> /// The recipient or server understands the request but is refusing to process it because it does not /// meet criteria defined by the recipient or server (e.g., a local policy regarding stanza size /// limits or acceptable words in messages); the associated error type SHOULD be "modify". /// </summary> NotAcceptable, /// <summary> /// The recipient or server does not allow any entity to perform the action (e.g., sending to entities at /// a blacklisted domain); the associated error type SHOULD be "cancel". /// </summary> NotAllowed, /// <summary> /// The sender must provide proper credentials before being allowed to perform the action, or has provided /// improper credentials; the associated error type SHOULD be "auth". /// </summary> NotAuthorized, /// <summary> /// The item requested has not changed since it was last requested; the associated error type SHOULD be "continue". /// </summary> NotModified, /// <summary> /// The requesting entity is not authorized to access the requested service because payment is required; /// the associated error type SHOULD be "auth". /// </summary> PaymentRequired, /// <summary> /// The intended recipient is temporarily unavailable; the associated error type SHOULD be "wait". /// </summary> /// <remarks> /// An application MUST NOT return this error if doing so would provide information about the /// intended recipient's network availability to an entity that is not authorized to know such /// information; instead it SHOULD return a <service-unavailable/> error. /// </remarks> RecipientUnavailable, /// <summary> /// The recipient or server is redirecting requests for this information to another entity, /// typically in a temporary fashion; the associated error type SHOULD be "modify" and the error stanza /// SHOULD contain the alternate address (which SHOULD be a valid JID) in the XML character data /// of the <redirect/> element. /// </summary> Redirect, /// <summary> /// The requesting entity is not authorized to access the requested service because prior /// registration is required; the associated error type SHOULD be "auth". /// </summary> RegistrationRequired, /// <summary> /// A remote server or service specified as part or all of the JID of the intended recipient /// does not exist; the associated error type SHOULD be "cancel". /// </summary> RemoteServerNotFound, /// <summary> /// A remote server or service specified as part or all of the JID of the intended recipient /// (or required to fulfill a request) could not be contacted within a reasonable amount /// of time; the associated error type SHOULD be "wait". /// </summary> RemoteServerTimeout, /// <summary> /// The server or recipient lacks the system resources necessary to service the request; /// the associated error type SHOULD be "wait". /// </summary> ResourceConstraint, /// <summary> /// The server or recipient does not currently provide the requested service; /// the associated error type SHOULD be "cancel". /// </summary> /// <remarks> /// An application SHOULD return a <service-unavailable/> error instead of /// <item-not-found/> or <recipient-unavailable/> if sending one of the latter /// errors would provide information about the intended recipient's network /// availability to an entity that is not authorized to know such information. /// </remarks> ServiceUnavailable, /// <summary> /// The requesting entity is not authorized to access the requested service /// because a prior subscription is required; the associated error type SHOULD be "auth". /// </summary> SubscriptionRequired, /// <summary> /// The error condition is not one of those defined by the other conditions in this list; /// any error type may be associated with this condition, and it SHOULD be used only in conjunction /// with an application-specific condition. /// </summary> UndefinedCondition, /// <summary> /// The recipient or server understood the request but was not expecting it at this time /// (e.g., the request was out of order); the associated error type SHOULD be "wait" or "modify". /// </summary> UnexpectedRequest } // The value of the <error/> element's 'type' attribute MUST be one of the following: // * cancel -- do not retry (the error is unrecoverable) // * continue -- proceed (the condition was only a warning) // * modify -- retry after changing the data sent // * auth -- retry after providing credentials // * wait -- retry after waiting (the error is temporary) public enum ErrorType { cancel, @continue, modify, auth, wait } /// <summary> /// Summary description for Error. /// </summary> public class Error : Element { #region << Constructors >> public Error() { this.Namespace = Uri.CLIENT; this.TagName = "error"; } /// <summary> /// Creates an error Element according the the condition /// The type attrib as added automatically as decribed in the XMPP specs /// This is the prefered way to create error Elements /// </summary> /// <param name="condition"></param> public Error(ErrorCondition condition) : this() { this.Condition = condition; } public Error(ErrorCondition condition, string text) : this(condition) { ErrorText = text; } public Error(ErrorType type) : this() { Type = type; } public Error(ErrorType type, ErrorCondition condition) : this(type) { this.Condition = condition; } #endregion /// <summary> /// The error Description /// </summary> [Obsolete("Use ErrorText Property instead")] public string Message { get { return this.Value; } set { this.Value = value; } } /// <summary> /// The optional error text /// </summary> public string ErrorText { get { return GetTag("text"); } set { SetTag("text", value, Uri.STANZAS); } } public ErrorType Type { get { return (ErrorType) GetAttributeEnum("type", typeof(ErrorType)); } set { SetAttribute("type", value.ToString()); } } public ErrorCondition Condition { get { if (HasTag("bad-request")) // <bad-request/> return ErrorCondition.BadRequest; else if (HasTag("conflict")) // <conflict/> return ErrorCondition.Conflict; else if (HasTag("feature-not-implemented"))// <feature-not-implemented/> return ErrorCondition.FeatureNotImplemented; else if (HasTag("forbidden")) // <forbidden/> return ErrorCondition.Forbidden; else if (HasTag("gone")) // <gone/> return ErrorCondition.Gone; else if (HasTag("internal-server-error")) // <internal-server-error/> return ErrorCondition.InternalServerError; else if (HasTag("item-not-found")) // <item-not-found/> return ErrorCondition.ItemNotFound; else if (HasTag("jid-malformed")) // <jid-malformed/> return ErrorCondition.JidMalformed; else if (HasTag("not-acceptable")) // <not-acceptable/> return ErrorCondition.NotAcceptable; else if (HasTag("not-allowed")) // <not-allowed/> return ErrorCondition.NotAllowed; else if (HasTag("not-authorized")) // <not-authorized/> return ErrorCondition.NotAuthorized; else if (HasTag("not-modified")) // <not-modified/> return ErrorCondition.NotModified; else if (HasTag("payment-required")) // <payment-required/> return ErrorCondition.PaymentRequired; else if (HasTag("recipient-unavailable")) // <recipient-unavailable/> return ErrorCondition.RecipientUnavailable; else if (HasTag("redirect")) // <redirect/> return ErrorCondition.Redirect; else if (HasTag("registration-required")) // <registration-required/> return ErrorCondition.RegistrationRequired; else if (HasTag("remote-server-not-found")) // <remote-server-not-found/> return ErrorCondition.RemoteServerNotFound; else if (HasTag("remote-server-timeout")) // <remote-server-timeout/> return ErrorCondition.RemoteServerTimeout; else if (HasTag("resource-constraint")) // <resource-constraint/> return ErrorCondition.ResourceConstraint; else if (HasTag("service-unavailable")) // <service-unavailable/> return ErrorCondition.ServiceUnavailable; else if (HasTag("subscription-required")) // <subscription-required/> return ErrorCondition.SubscriptionRequired; else if (HasTag("undefined-condition")) // <undefined-condition/> return ErrorCondition.UndefinedCondition; else if (HasTag("unexpected-request")) // <unexpected-request/> return ErrorCondition.UnexpectedRequest; else return ErrorCondition.UndefinedCondition; } set { switch (value) { case ErrorCondition.BadRequest: SetTag("bad-request", "", Uri.STANZAS); Type = ErrorType.modify; break; case ErrorCondition.Conflict: SetTag("conflict", "", Uri.STANZAS); Type = ErrorType.cancel; break; case ErrorCondition.FeatureNotImplemented: SetTag("feature-not-implemented", "", Uri.STANZAS); Type = ErrorType.cancel; break; case ErrorCondition.Forbidden: SetTag("forbidden", "", Uri.STANZAS); Type = ErrorType.auth; break; case ErrorCondition.Gone: SetTag("gone", "", Uri.STANZAS); Type = ErrorType.modify; break; case ErrorCondition.InternalServerError: SetTag("internal-server-error", "", Uri.STANZAS); Type = ErrorType.wait; break; case ErrorCondition.ItemNotFound: SetTag("item-not-found", "", Uri.STANZAS); Type = ErrorType.cancel; break; case ErrorCondition.JidMalformed: SetTag("jid-malformed", "", Uri.STANZAS); Type = ErrorType.modify; break; case ErrorCondition.NotAcceptable: SetTag("not-acceptable", "", Uri.STANZAS); Type = ErrorType.modify; break; case ErrorCondition.NotAllowed: SetTag("not-allowed", "", Uri.STANZAS); Type = ErrorType.cancel; break; case ErrorCondition.NotAuthorized: SetTag("not-authorized", "", Uri.STANZAS); Type = ErrorType.auth; break; case ErrorCondition.NotModified: SetTag("not-modified", "", Uri.STANZAS); Type = ErrorType.modify; break; case ErrorCondition.PaymentRequired: SetTag("payment-required", "", Uri.STANZAS); Type = ErrorType.auth; break; case ErrorCondition.RecipientUnavailable: SetTag("recipient-unavailable", "", Uri.STANZAS); Type = ErrorType.wait; break; case ErrorCondition.Redirect: SetTag("redirect", "", Uri.STANZAS); Type = ErrorType.modify; break; case ErrorCondition.RegistrationRequired: SetTag("registration-required", "", Uri.STANZAS); Type = ErrorType.auth; break; case ErrorCondition.RemoteServerNotFound: SetTag("remote-server-not-found", "", Uri.STANZAS); Type = ErrorType.cancel; break; case ErrorCondition.RemoteServerTimeout: SetTag("remote-server-timeout", "", Uri.STANZAS); Type = ErrorType.wait; break; case ErrorCondition.ResourceConstraint: SetTag("resource-constraint", "", Uri.STANZAS); Type = ErrorType.wait; break; case ErrorCondition.ServiceUnavailable: SetTag("service-unavailable", "", Uri.STANZAS); Type = ErrorType.cancel; break; case ErrorCondition.SubscriptionRequired: SetTag("subscription-required", "", Uri.STANZAS); Type = ErrorType.auth; break; case ErrorCondition.UndefinedCondition: SetTag("undefined-condition", "", Uri.STANZAS); // could be any break; case ErrorCondition.UnexpectedRequest: SetTag("unexpected-request", "", Uri.STANZAS); Type = ErrorType.wait; break; } } } } }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/client/PresenceType.cs��������������������������������������0000644�0001750�0001750�00000004771�12204443225�025365� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.client { /// <summary> /// Enumeration for the Presence Type structure. /// This enum is used to describe what type of Subscription Type the current subscription is. /// When sending a presence or receiving a subscription this type is used to easily identify the type of subscription it is. /// </summary> public enum PresenceType { /// <summary> /// Used when one wants to send presence to someone/server/transport that youre available. /// </summary> available = -1, /// <summary> /// Used to send a subscription request to someone. /// </summary> subscribe, /// <summary> /// Used to accept a subscription request. /// </summary> subscribed, /// <summary> /// Used to unsubscribe someone from your presence. /// </summary> unsubscribe, /// <summary> /// Used to deny a subscription request. /// </summary> unsubscribed, /// <summary> /// Used when one wants to send presence to someone/server/transport that youre unavailable. /// </summary> unavailable, /// <summary> /// Used when you want to see your roster, but don't want anyone on you roster to see you /// </summary> invisible, /// <summary> /// presence error /// </summary> error, /// <summary> /// used in server to server protocol to request presences /// </summary> probe } }�������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/client/PresenceManager.cs�����������������������������������0000644�0001750�0001750�00000007505�12204443225�026014� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.client { /// <summary> /// Helper class for managing presence and subscriptions /// </summary> public class PresenceManager { private XmppClientConnection m_connection = null; public PresenceManager(XmppClientConnection con) { m_connection = con; } /// <summary> /// Subscribe to a contact /// </summary> /// <param name="to">Bare Jid of the rosteritem we want to subscribe</param> public void Subscribe(Jid to) { // <presence to='contact@example.org' type='subscribe'/> Presence pres = new Presence(); pres.Type = PresenceType.subscribe; pres.To = to; m_connection.Send(pres); } /// <summary> /// Subscribe to a contact /// </summary> /// <param name="to">Bare Jid of the rosteritem we want to subscribe</param> /// <param name="message">a message which normally contains the reason why we want to subscibe to this contact</param> public void Subscribe(Jid to, string message) { Presence pres = new Presence(); pres.Type = PresenceType.subscribe; pres.To = to; pres.Status = message; m_connection.Send(pres); } /// <summary> /// Unsubscribe from a contact /// </summary> /// <param name="to">Bare Jid of the rosteritem we want to unsubscribe</param> public void Unsubscribe(Jid to) { // <presence to='contact@example.org' type='subscribe'/> Presence pres = new Presence(); pres.Type = PresenceType.unsubscribe; pres.To = to; m_connection.Send(pres); } //Example: Approving a subscription request: //<presence to='romeo@example.net' type='subscribed'/> /// <summary> /// Approve a subscription request /// </summary> /// <param name="to">Bare Jid to approve</param> public void ApproveSubscriptionRequest(Jid to) { // <presence to='contact@example.org' type='subscribe'/> Presence pres = new Presence(); pres.Type = PresenceType.subscribed; pres.To = to; m_connection.Send(pres); } //Example: Refusing a presence subscription request: //<presence to='romeo@example.net' type='unsubscribed'/> /// <summary> /// Refuse subscription request /// </summary> /// <param name="to">Bare Jid to approve</param> public void RefuseSubscriptionRequest(Jid to) { // <presence to='contact@example.org' type='subscribe'/> Presence pres = new Presence(); pres.Type = PresenceType.unsubscribed; pres.To = to; m_connection.Send(pres); } } }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/client/ShowType.cs������������������������������������������0000644�0001750�0001750�00000004031�12204443225�024526� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.client { // # away -- The entity or resource is temporarily away. // # chat -- The entity or resource is actively interested in chatting. // # dnd -- The entity or resource is busy (dnd = "Do Not Disturb"). // # xa -- The entity or resource is away for an extended period (xa = "eXtended Away"). /// <summary> /// Enumeration that represents the online state. /// </summary> public enum ShowType { /// <summary> /// /// </summary> NONE = -1, /// <summary> /// The entity or resource is temporarily away. /// </summary> away, /// <summary> /// The entity or resource is actively interested in chatting. /// </summary> chat, /// <summary> /// The entity or resource is busy (dnd = "Do Not Disturb"). /// </summary> dnd, /// <summary> /// The entity or resource is away for an extended period (xa = "eXtended Away"). /// </summary> xa, } }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/client/Handler.cs�������������������������������������������0000644�0001750�0001750�00000003241�12250206660�024324� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.client { public delegate void MessageHandler (object sender, Message msg); public delegate void PresenceHandler(object sender, Presence pres); public delegate void IqHandler (object sender, IQEventArgs args); public class IQEventArgs : EventArgs { public IQ IQ { get; private set; } public bool Handled { get; set; } public IQEventArgs(IQ iq) { if (iq == null) { throw new ArgumentNullException("iq"); } IQ = iq; } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/client/Message.cs�������������������������������������������0000644�0001750�0001750�00000025466�12250206660�024350� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.x; using agsXMPP.protocol.extensions.html; using agsXMPP.protocol.extensions.chatstates; using agsXMPP.protocol.extensions.nickname; using agsXMPP.protocol.extensions.shim; namespace agsXMPP.protocol.client { /// <summary> /// This class represents a XMPP message. /// </summary> public class Message : Base.StanzaWithError { #region << Constructors >> public Message() { this.TagName = "message"; this.Namespace = Uri.CLIENT; } public Message(Jid to) : this() { To = to; } public Message(Jid to, string body) : this(to) { Body = body; } public Message(Jid to, Jid from) : this() { To = to; From = from; } public Message(string to, string body) : this() { To = new Jid(to); Body = body; } public Message(Jid to, string body, string subject) : this() { To = to; Body = body; Subject = subject; } public Message(string to, string body, string subject) : this() { To = new Jid(to); Body = body; Subject = subject; } public Message(string to, string body, string subject, string thread) : this() { To = new Jid(to); Body = body; Subject = subject; Thread = thread; } public Message(Jid to, string body, string subject, string thread) : this() { To = to; Body = body; Subject = subject; Thread = thread; } public Message(string to, MessageType type, string body) : this() { To = new Jid(to); Type = type; Body = body; } public Message(Jid to, MessageType type, string body) : this() { To = to; Type = type; Body = body; } public Message(string to, MessageType type, string body, string subject) : this() { To = new Jid(to); Type = type; Body = body; Subject = subject; } public Message(Jid to, MessageType type, string body, string subject) : this() { To = to; Type = type; Body = body; Subject = subject; } public Message(string to, MessageType type, string body, string subject, string thread) : this() { To = new Jid(to); Type = type; Body = body; Subject = subject; Thread = thread; } public Message(Jid to, MessageType type, string body, string subject, string thread) : this() { To = to; Type = type; Body = body; Subject = subject; Thread = thread; } public Message(Jid to, Jid from, string body) : this() { To = to; From = from; Body = body; } public Message(Jid to, Jid from, string body, string subject) : this() { To = to; From = from; Body = body; Subject = subject; } public Message(Jid to, Jid from, string body, string subject, string thread) : this() { To = to; From = from; Body = body; Subject = subject; Thread = thread; } public Message(Jid to, Jid from, MessageType type, string body) : this() { To = to; From = from; Type = type; Body = body; } public Message(Jid to, Jid from, MessageType type, string body, string subject) : this() { To = to; From = from; Type = type; Body = body; Subject = subject; } public Message(Jid to, Jid from, MessageType type, string body, string subject, string thread) : this() { To = to; From = from; Type = type; Body = body; Subject = subject; Thread = thread; } #endregion #region << Properties >> /// <summary> /// The body of the message. This contains the message text. /// </summary> public string Body { set { SetTag("body", value); } get { return GetTag("body"); } } /// <summary> /// subject of this message. Its like a subject in a email. The Subject is optional. /// </summary> public string Subject { set { SetTag("subject", value); } get { return GetTag("subject"); } } /// <summary> /// messages and conversations could be threaded. You can compare this with threads in newsgroups or forums. /// Threads are optional. /// </summary> public string Thread { set { SetTag("thread", value); } get { return GetTag("thread"); } } /// <summary> /// message type (chat, groupchat, normal, headline or error). /// </summary> public MessageType Type { get { return (MessageType) GetAttributeEnum("type", typeof(MessageType)); } set { if (value == MessageType.normal) RemoveAttribute("type"); else SetAttribute("type", value.ToString()); } } /// <summary> /// The html part of the message if you want to support the html-im Jep. This part of the message is optional. /// </summary> public Html Html { get { return (Html) SelectSingleElement(typeof(Html)); } set { RemoveTag(typeof(Html)); if (value != null) AddChild(value); } } /// <summary> /// The event Element for JEP-0022 Message events /// </summary> public Event XEvent { get { return SelectSingleElement(typeof(Event)) as Event; } set { if (HasTag(typeof(Event))) RemoveTag(typeof(Event)); if (value != null) this.AddChild(value); } } /// <summary> /// The event Element for JEP-0022 Message events /// </summary> public Delay XDelay { get { return SelectSingleElement(typeof(Delay)) as Delay; } set { if (HasTag(typeof(Delay))) RemoveTag(typeof(Delay)); if (value != null) this.AddChild(value); } } /// <summary> /// Stanza Headers and Internet Metadata /// </summary> public Headers Headers { get { return SelectSingleElement(typeof(Headers)) as Headers; } set { if (HasTag(typeof(Headers))) RemoveTag(typeof(Headers)); if (value != null) this.AddChild(value); } } /// <summary> /// Nickname Element /// </summary> public Nickname Nickname { get { return SelectSingleElement(typeof(Nickname)) as Nickname; } set { if (HasTag(typeof(Nickname))) RemoveTag(typeof(Nickname)); if (value != null) this.AddChild(value); } } /// <summary> /// /// </summary> public x.muc.User MucUser { get { return SelectSingleElement(typeof(x.muc.User)) as x.muc.User; } set { if (HasTag(typeof(x.muc.User))) RemoveTag(typeof(x.muc.User)); if (value != null) this.AddChild(value); } } #region << Chatstate Properties >> public Chatstate Chatstate { get { if (HasTag(typeof(Active))) return Chatstate.active; else if (HasTag(typeof(Inactive))) return Chatstate.inactive; else if (HasTag(typeof(Composing))) return Chatstate.composing; else if (HasTag(typeof(Paused))) return Chatstate.paused; else if (HasTag(typeof(Gone))) return Chatstate.gone; else return Chatstate.None; } set { RemoveChatstate(); switch (value) { case Chatstate.active: AddChild(new Active()); break; case Chatstate.inactive: AddChild(new Inactive()); break; case Chatstate.composing: AddChild(new Composing()); break; case Chatstate.paused: AddChild(new Paused()); break; case Chatstate.gone: AddChild(new Gone()); break; } } } private void RemoveChatstate() { RemoveTag(typeof(Active)); RemoveTag(typeof(Inactive)); RemoveTag(typeof(Composing)); RemoveTag(typeof(Paused)); RemoveTag(typeof(Gone)); } #endregion #endregion #region << Methods and Functions >> #if !CF /// <summary> /// Create a new unique Thread indendifier /// </summary> /// <returns></returns> public string CreateNewThread() { string guid = Guid.NewGuid().ToString().ToLower(); Thread = guid; return guid; } #endif #endregion } }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/client/Presence.cs������������������������������������������0000644�0001750�0001750�00000016074�12250206660�024523� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.extensions.primary; using agsXMPP.protocol.extensions.nickname; using agsXMPP.protocol.extensions.caps; namespace agsXMPP.protocol.client { /// <summary> /// Zusammenfassung fr Presence. /// </summary> public class Presence : Base.StanzaWithError { #region << Constructors >> public Presence() { this.TagName = "presence"; this.Namespace = Uri.CLIENT; } public Presence(ShowType show, string status) : this() { this.Show = show; this.Status = status; } public Presence(ShowType show, string status, int priority) : this(show, status) { this.Priority = priority; } #endregion /// <summary> /// The OPTIONAL statuc contains a natural-language description of availability status. /// It is normally used in conjunction with the show element to provide a detailed description of an availability state /// (e.g., "In a meeting"). /// </summary> public string Status { get { return GetTag("status"); } set { SetTag("status", value); } } /// <summary> /// The type of a presence stanza is OPTIONAL. /// A presence stanza that does not possess a type attribute is used to signal to the server that the sender is online and available /// for communication. If included, the type attribute specifies a lack of availability, a request to manage a subscription /// to another entity's presence, a request for another entity's current presence, or an error related to a previously-sent /// presence stanza. /// </summary> public PresenceType Type { get { return (PresenceType) GetAttributeEnum("type", typeof(PresenceType)); } set { // dont add type="available" if (value == PresenceType.available) RemoveAttribute("type"); else SetAttribute("type", value.ToString()); } } /// <summary> /// The OPTIONAL show element contains non-human-readable XML character data that specifies the particular availability /// status of an entity or specific resource. /// </summary> public ShowType Show { get { return (ShowType) GetTagEnum("show", typeof(ShowType)); } set { if (value != ShowType.NONE) SetTag("show", value.ToString()); else RemoveAttribute("show"); } } /// <summary> /// The priority level of the resource. The value MUST be an integer between -128 and +127. /// If no priority is provided, a server SHOULD consider the priority to be zero. /// </summary> /// <remarks> /// For information regarding the semantics of priority values in stanza routing /// within instant messaging and presence applications, refer to Server Rules /// for Handling XML StanzasServer Rules for Handling XML Stanzas. /// </remarks> public int Priority { get { try { return int.Parse(GetTag("priority")); } catch { return 0; } } set { SetTag("priority", value.ToString()); } } public x.Delay XDelay { get { return SelectSingleElement(typeof(x.Delay)) as x.Delay; } set { if (HasTag(typeof(x.Delay))) RemoveTag(typeof(x.Delay)); if (value != null) this.AddChild(value); } } public bool IsPrimary { get { return GetTag(typeof(Primary)) == null ? false : true; } set { if (value) SetTag(typeof(Primary)); else RemoveTag(typeof(Primary)); } } /// <summary> /// /// </summary> public x.muc.User MucUser { get { return SelectSingleElement(typeof(x.muc.User)) as x.muc.User; } set { if (HasTag(typeof(x.muc.User))) RemoveTag(typeof(x.muc.User)); if (value != null) this.AddChild(value); } } /// <summary> /// The muc element. Doesn't have much use /// </summary> public x.muc.Muc Muc { get { return SelectSingleElement(typeof(x.muc.Muc)) as x.muc.Muc; } set { if (HasTag(typeof(x.muc.Muc))) RemoveTag(typeof(x.muc.Muc)); if (value != null) this.AddChild(value); } } /// <summary> /// in case of away, says how long the user was idle /// </summary> public iq.last.Last Last { get { return SelectSingleElement(typeof(iq.last.Last)) as iq.last.Last; } set { if (HasTag(typeof(iq.last.Last))) RemoveTag(typeof(iq.last.Last)); if (value != null) this.AddChild(value); } } /// <summary> /// Nickname Element /// </summary> public Nickname Nickname { get { return SelectSingleElement(typeof(Nickname)) as Nickname; } set { if (HasTag(typeof(Nickname))) RemoveTag(typeof(Nickname)); if (value != null) AddChild(value); } } public Capabilities Capabilities { get { return SelectSingleElement<Capabilities>(); } set { RemoveTag<Capabilities>(); if (value != null) AddChild(value); } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Time/�������������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�022037� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Time/Time.cs������������������������������������������������0000644�0001750�0001750�00000005616�12204443225�023274� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.time { public class Time : Element { /// <summary> /// XEP-0202: Entity Time /// </summary> public Time() { TagName = "time"; Namespace = Uri.URN_TIME; } /// <summary> /// Gets or sets the UTC offset. /// </summary> /// <value>The UTC offset.</value> public TimeSpan UtcOffset { get { var tzo = GetTag("tzo"); if (tzo == null) return TimeSpan.Zero; /* .NET is not able to parse the following format: "-03:30" so we append the minutes and .NET is happy. -10:00 len:6 10:00 len:5 */ if (tzo.Length == 5 || tzo.Length == 6) tzo += ":00"; return TimeSpan.Parse(tzo); } set { SetTag("tzo", FormatOffset(value)); } } /// <summary> /// Gets or sets the date time. /// </summary> /// <value>The date time.</value> public DateTime DateTime { get { return Util.Time.ISO_8601Date(GetTag("utc")); } set { SetTag("utc", Util.Time.ISO_8601Date(value)); } } /// <summary> /// Sets the utc offset and time automatically. /// </summary> public void SetDateTimeNow() { UtcOffset = Util.Time.UtcOffset(); DateTime = DateTime.Now; } static string FormatOffset(TimeSpan ts) { return String.Format("{0:00}:{1:00}", ts.Hours, Math.Abs(ts.Minutes)); } } }������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Error.cs����������������������������������������������������0000644�0001750�0001750�00000051762�12204443225�022574� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol { /* <stream:error> <defined-condition xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> <text xmlns='urn:ietf:params:xml:ns:xmpp-streams' xml:lang='langcode'> OPTIONAL descriptive text </text> [OPTIONAL application-specific condition element] </stream:error> */ /* RFC 4.7.3. Defined Conditions The following stream-level error conditions are defined: * <bad-format/> -- the entity has sent XML that cannot be processed; this error MAY be used instead of the more specific XML-related errors, such as <bad-namespace-prefix/>, <invalid-xml/>, <restricted-xml/>, <unsupported-encoding/>, and <xml-not-well-formed/>, although the more specific errors are preferred. * <bad-namespace-prefix/> -- the entity has sent a namespace prefix that is unsupported, or has sent no namespace prefix on an element that requires such a prefix (see XML Namespace Names and Prefixes (XML Namespace Names and Prefixes)). * <conflict/> -- the server is closing the active stream for this entity because a new stream has been initiated that conflicts with the existing stream. * <connection-timeout/> -- the entity has not generated any traffic over the stream for some period of time (configurable according to a local service policy). * <host-gone/> -- the value of the 'to' attribute provided by the initiating entity in the stream header corresponds to a hostname that is no longer hosted by the server. * <host-unknown/> -- the value of the 'to' attribute provided by the initiating entity in the stream header does not correspond to a hostname that is hosted by the server. * <improper-addressing/> -- a stanza sent between two servers lacks a 'to' or 'from' attribute (or the attribute has no value). * <internal-server-error/> -- the server has experienced a misconfiguration or an otherwise-undefined internal error that prevents it from servicing the stream. * <invalid-from/> -- the JID or hostname provided in a 'from' address does not match an authorized JID or validated domain negotiated between servers via SASL or dialback, or between a client and a server via authentication and resource binding. * <invalid-id/> -- the stream ID or dialback ID is invalid or does not match an ID previously provided. * <invalid-namespace/> -- the streams namespace name is something other than "http://etherx.jabber.org/streams" or the dialback namespace name is something other than "jabber:server:dialback" (see XML Namespace Names and Prefixes (XML Namespace Names and Prefixes)). * <invalid-xml/> -- the entity has sent invalid XML over the stream to a server that performs validation (see Validation (Validation)). * <not-authorized/> -- the entity has attempted to send data before the stream has been authenticated, or otherwise is not authorized to perform an action related to stream negotiation; the receiving entity MUST NOT process the offending stanza before sending the stream error. * <policy-violation/> -- the entity has violated some local service policy; the server MAY choose to specify the policy in the <text/> element or an application-specific condition element. * <remote-connection-failed/> -- the server is unable to properly connect to a remote entity that is required for authentication or authorization. * <resource-constraint/> -- the server lacks the system resources necessary to service the stream. * <restricted-xml/> -- the entity has attempted to send restricted XML features such as a comment, processing instruction, DTD, entity reference, or unescaped character (see Restrictions (Restrictions)). * <see-other-host/> -- the server will not provide service to the initiating entity but is redirecting traffic to another host; the server SHOULD specify the alternate hostname or IP address (which MUST be a valid domain identifier) as the XML character data of the <see-other-host/> element. * <system-shutdown/> -- the server is being shut down and all active streams are being closed. * <undefined-condition/> -- the error condition is not one of those defined by the other conditions in this list; this error condition SHOULD be used only in conjunction with an application-specific condition. * <unsupported-encoding/> -- the initiating entity has encoded the stream in an encoding that is not supported by the server (see Character Encoding (Character Encoding)). * <unsupported-stanza-type/> -- the initiating entity has sent a first-level child of the stream that is not supported by the server. * <unsupported-version/> -- the value of the 'version' attribute provided by the initiating entity in the stream header specifies a version of XMPP that is not supported by the server; the server MAY specify the version(s) it supports in the <text/> element. * <xml-not-well-formed/> -- the initiating entity has sent XML that is not well-formed as defined by [XML] (Bray, T., Paoli, J., Sperberg-McQueen, C., and E. Maler, Extensible Markup Language (XML) 1.0 (2nd ed), October 2000.). */ public enum StreamErrorCondition { /// <summary> /// unknown error condition /// </summary> UnknownCondition = -1, /// <summary> /// the entity has sent XML that cannot be processed; this error MAY be used instead of the more specific XML-related errors, such as <bad-namespace-prefix/>, <invalid-xml/>, <restricted-xml/>, <unsupported-encoding/>, and <xml-not-well-formed/>, although the more specific errors are preferred. /// </summary> BadFormat, /// <summary> /// the entity has sent a namespace prefix that is unsupported, or has sent no namespace prefix on an element that requires such a prefix (see XML Namespace Names and Prefixes (XML Namespace Names and Prefixes)). /// </summary> BadNamespacePrefix, /// <summary> /// the server is closing the active stream for this entity because a new stream has been initiated that conflicts with the existing stream. /// </summary> Conflict, /// <summary> /// the entity has not generated any traffic over the stream for some period of time (configurable according to a local service policy). /// </summary> ConnectionTimeout, /// <summary> /// the value of the 'to' attribute provided by the initiating entity in the stream header corresponds to a hostname that is no longer hosted by the server. /// </summary> HostGone, /// <summary> /// the value of the 'to' attribute provided by the initiating entity in the stream header does not correspond to a hostname that is hosted by the server. /// </summary> HostUnknown, /// <summary> /// a stanza sent between two servers lacks a 'to' or 'from' attribute (or the attribute has no value). /// </summary> ImproperAddressing, /// <summary> /// the server has experienced a misconfiguration or an otherwise-undefined internal error that prevents it from servicing the stream. /// </summary> InternalServerError, /// <summary> /// the JID or hostname provided in a 'from' address does not match an authorized JID or validated domain negotiated between servers via SASL or dialback, or between a client and a server via authentication and resource binding. /// </summary> InvalidFrom, /// <summary> /// the stream ID or dialback ID is invalid or does not match an ID previously provided. /// </summary> InvalidId, /// <summary> /// the streams namespace name is something other than "http://etherx.jabber.org/streams" or the dialback namespace name is something other than "jabber:server:dialback" (see XML Namespace Names and Prefixes (XML Namespace Names and Prefixes)). /// </summary> InvalidNamespace, /// <summary> /// the entity has sent invalid XML over the stream to a server that performs validation. /// </summary> InvalidXml, /// <summary> /// the entity has attempted to send data before the stream has been authenticated, or otherwise is not authorized to perform an action related to stream negotiation; the receiving entity MUST NOT process the offending stanza before sending the stream error. /// </summary> NotAuthorized, /// <summary> /// the entity has violated some local service policy; the server MAY choose to specify the policy in the <text/> element or an application-specific condition element. /// </summary> PolicyViolation, /// <summary> /// the server is unable to properly connect to a remote entity that is required for authentication or authorization. /// </summary> RemoteConnectionFailed, /// <summary> /// the server lacks the system resources necessary to service the stream. /// </summary> ResourceConstraint, /// <summary> /// the entity has attempted to send restricted XML features such as a comment, processing instruction, DTD, entity reference, or unescaped character (see Restrictions (Restrictions)). /// </summary> RestrictedXml, /// <summary> /// the server will not provide service to the initiating entity but is redirecting traffic to another host; the server SHOULD specify the alternate hostname or IP address (which MUST be a valid domain identifier) as the XML character data of the <see-other-host/> element. /// </summary> SeeOtherHost, /// <summary> /// the server is being shut down and all active streams are being closed. /// </summary> SystemShutdown, /// <summary> /// the error condition is not one of those defined by the other conditions in this list; this error condition SHOULD be used only in conjunction with an application-specific condition. /// </summary> UndefinedCondition, /// <summary> /// the initiating entity has encoded the stream in an encoding that is not supported by the server. /// </summary> UnsupportedEncoding, /// <summary> /// the initiating entity has sent a first-level child of the stream that is not supported by the server. /// </summary> UnsupportedStanzaType, /// <summary> /// the value of the 'version' attribute provided by the initiating entity in the stream header specifies a version of XMPP that is not supported by the server; the server MAY specify the version(s) it supports in the <text/> element. /// </summary> UnsupportedVersion, /// <summary> /// the initiating entity has sent XML that is not well-formed as defined by the XML specs. /// </summary> XmlNotWellFormed } // <stream:error>Invalid handshake</stream:error> // <stream:error>Socket override by another connection.</stream:error> /// <summary> /// Stream Errors <stream:error> /// </summary> public class Error : Element { public Error() { this.TagName = "error"; this.Namespace = Uri.STREAM; } public Error(StreamErrorCondition condition) : this() { this.Condition = condition; } /* public Error(string msg) : this() { Message = msg; } /// <summary> /// The error Description /// </summary> public string Message { get { return this.Value; } set { this.Value = value; } } */ public StreamErrorCondition Condition { get { if (HasTag("bad-format")) return StreamErrorCondition.BadFormat; else if (HasTag("bad-namespace-prefix")) return StreamErrorCondition.BadNamespacePrefix; else if (HasTag("conflict")) return StreamErrorCondition.Conflict; else if (HasTag("connection-timeout")) return StreamErrorCondition.ConnectionTimeout; else if (HasTag("host-gone")) return StreamErrorCondition.HostGone; else if (HasTag("host-unknown")) return StreamErrorCondition.HostUnknown; else if (HasTag("improper-addressing")) return StreamErrorCondition.ImproperAddressing; else if (HasTag("internal-server-error")) return StreamErrorCondition.InternalServerError; else if (HasTag("invalid-from")) return StreamErrorCondition.InvalidFrom; else if (HasTag("invalid-id")) return StreamErrorCondition.InvalidId; else if (HasTag("invalid-namespace")) return StreamErrorCondition.InvalidNamespace; else if (HasTag("invalid-xml")) return StreamErrorCondition.InvalidXml; else if (HasTag("not-authorized")) return StreamErrorCondition.NotAuthorized; else if (HasTag("policy-violation")) return StreamErrorCondition.PolicyViolation; else if (HasTag("remote-connection-failed")) return StreamErrorCondition.RemoteConnectionFailed; else if (HasTag("resource-constraint")) return StreamErrorCondition.ResourceConstraint; else if (HasTag("restricted-xml")) return StreamErrorCondition.RestrictedXml; else if (HasTag("see-other-host")) return StreamErrorCondition.SeeOtherHost; else if (HasTag("system-shutdown")) return StreamErrorCondition.SystemShutdown; else if (HasTag("undefined-condition")) return StreamErrorCondition.UndefinedCondition; else if (HasTag("unsupported-encoding")) return StreamErrorCondition.UnsupportedEncoding; else if (HasTag("unsupported-stanza-type")) return StreamErrorCondition.UnsupportedStanzaType; else if (HasTag("unsupported-version")) return StreamErrorCondition.UnsupportedVersion; else if (HasTag("xml-not-well-formed")) return StreamErrorCondition.XmlNotWellFormed; else return StreamErrorCondition.UnknownCondition; } set { switch (value) { case StreamErrorCondition.BadFormat: SetTag("bad-format", "", Uri.STREAMS); break; case StreamErrorCondition.BadNamespacePrefix: SetTag("bad-namespace-prefix", "", Uri.STREAMS); break; case StreamErrorCondition.Conflict: SetTag("conflict", "", Uri.STREAMS); break; case StreamErrorCondition.ConnectionTimeout: SetTag("connection-timeout", "", Uri.STREAMS); break; case StreamErrorCondition.HostGone: SetTag("host-gone", "", Uri.STREAMS); break; case StreamErrorCondition.HostUnknown: SetTag("host-unknown", "", Uri.STREAMS); break; case StreamErrorCondition.ImproperAddressing: SetTag("improper-addressing", "", Uri.STREAMS); break; case StreamErrorCondition.InternalServerError: SetTag("internal-server-error", "", Uri.STREAMS); break; case StreamErrorCondition.InvalidFrom: SetTag("invalid-from", "", Uri.STREAMS); break; case StreamErrorCondition.InvalidId: SetTag("invalid-id", "", Uri.STREAMS); break; case StreamErrorCondition.InvalidNamespace: SetTag("invalid-namespace", "", Uri.STREAMS); break; case StreamErrorCondition.InvalidXml: SetTag("invalid-xml", "", Uri.STREAMS); break; case StreamErrorCondition.NotAuthorized: SetTag("not-authorized", "", Uri.STREAMS); break; case StreamErrorCondition.PolicyViolation: SetTag("policy-violation", "", Uri.STREAMS); break; case StreamErrorCondition.RemoteConnectionFailed: SetTag("remote-connection-failed", "", Uri.STREAMS); break; case StreamErrorCondition.ResourceConstraint: SetTag("resource-constraint", "", Uri.STREAMS); break; case StreamErrorCondition.RestrictedXml: SetTag("restricted-xml", "", Uri.STREAMS); break; case StreamErrorCondition.SeeOtherHost: SetTag("see-other-host", "", Uri.STREAMS); break; case StreamErrorCondition.SystemShutdown: SetTag("system-shutdown", "", Uri.STREAMS); break; case StreamErrorCondition.UndefinedCondition: SetTag("undefined-condition", "", Uri.STREAMS); break; case StreamErrorCondition.UnsupportedEncoding: SetTag("unsupported-encoding", "", Uri.STREAMS); break; case StreamErrorCondition.UnsupportedStanzaType: SetTag("unsupported-stanza-type", "", Uri.STREAMS); break; case StreamErrorCondition.UnsupportedVersion: SetTag("unsupported-version", "", Uri.STREAMS); break; case StreamErrorCondition.XmlNotWellFormed: SetTag("xml-not-well-formed", "", Uri.STREAMS); break; default: return; } } } /// <summary> /// <para> /// The <text/> element is OPTIONAL. If included, it SHOULD be used only to provide descriptive or diagnostic information /// that supplements the meaning of a defined condition or application-specific condition. /// </para> /// <para> /// It SHOULD NOT be interpreted programmatically by an application. /// It SHOULD NOT be used as the error message presented to a user, but MAY be shown in addition to the error message /// associated with the included condition element (or elements). /// </para> /// </summary> public string Text { get { return GetTag("text"); } set { SetTag("text", value, Uri.STREAMS); } } } } ��������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/storage/����������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�022605� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/storage/AvatarIq.cs�����������������������������������������0000644�0001750�0001750�00000003775�12204443225�024660� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.storage { // Once such data has been set, the avatar can be retrieved by any requesting client from the avatar-generating client's public XML storage: // // Example 8. // // <iq id='1' type='get' to='user@server'> // <query xmlns='storage:client:avatar'/> // </iq> /// <summary> /// Summary description for AvatarIq. /// </summary> public class AvatarIq : IQ { private Avatar m_Avatar = new Avatar(); public AvatarIq() { base.Query = m_Avatar; this.GenerateId(); } public AvatarIq(IqType type) : this() { this.Type = type; } public AvatarIq(IqType type, Jid to) : this(type) { this.To = to; } public AvatarIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Avatar Query { get { return m_Avatar; } } } } ���smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/storage/Avatar.cs�������������������������������������������0000644�0001750�0001750�00000003040�12204443225�024347� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.storage { // <iq id='0' type='set' to='user@server'> // <query xmlns='storage:client:avatar'> // <data mimetype='image/jpeg'> // Base64 Encoded Data // </data> // </query> // </iq> /// <summary> /// Summary description for Avatar. /// </summary> public class Avatar : Base.Avatar { public Avatar() : base() { this.Namespace = Uri.STORAGE_AVATAR; } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/component/��������������������������������������������������0000755�0001750�0001750�00000000000�12250206660�023144� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/component/Handshake.cs��������������������������������������0000644�0001750�0001750�00000003571�12204443225�025366� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.Base; using agsXMPP.Xml; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.component { //<handshake>aaee83c26aeeafcbabeabfcbcd50df997e0a2a1e</handshake> /// <summary> /// Handshake Element /// </summary> public class Handshake : Stanza { public Handshake() { this.TagName = "handshake"; this.Namespace = Uri.ACCEPT; } public Handshake(string password, string streamid) : this() { SetAuth(password, streamid); } public void SetAuth(string password, string streamId) { this.Value = Util.Hash.Sha1Hash(streamId + password); } /// <summary> /// Digest (Hash) for authentication /// </summary> public string Digest { get { return this.Value; } set { this.Value = value; } } } } ���������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/component/Log.cs��������������������������������������������0000644�0001750�0001750�00000004313�12204443225�024214� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.Base; using agsXMPP.Xml; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.component { public enum LogType { NONE = -1, warn, info, verbose, debug, notice } /// <summary> /// Zusammenfassung fr Log. /// </summary> public class Log : Stanza { public Log() { this.TagName = "log"; this.Namespace = Uri.ACCEPT; } /// <summary> /// creates a new Log Packet with the given message /// </summary> /// <param name="message"></param> public Log(string message) : this() { this.Value = message; } /// <summary> /// Gets or Sets the logtype /// </summary> public LogType Type { get { return (LogType) GetAttributeEnum("type", typeof(LogType)); } set { if (value == LogType.NONE) RemoveAttribute("type"); else SetAttribute("type", value.ToString()); } } /// <summary> /// The namespace for logging /// </summary> public string LogNamespace { get { return GetAttribute("ns"); } set { SetAttribute("ns", value); } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/component/IQ.cs���������������������������������������������0000644�0001750�0001750�00000004716�12204443225�024013� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #region Using directives using System; #endregion namespace agsXMPP.protocol.component { /// <summary> /// Summary description for Iq. /// </summary> public class IQ : agsXMPP.protocol.client.IQ { #region << Constructors >> public IQ() : base() { this.Namespace = Uri.ACCEPT; } public IQ(agsXMPP.protocol.client.IqType type) : base(type) { this.Namespace = Uri.ACCEPT; } public IQ(Jid from, Jid to) : base(from, to) { this.Namespace = Uri.ACCEPT; } public IQ(agsXMPP.protocol.client.IqType type, Jid from, Jid to) : base(type, from, to) { this.Namespace = Uri.ACCEPT; } #endregion /// <summary> /// Error Child Element /// </summary> public new agsXMPP.protocol.component.Error Error { get { return SelectSingleElement(typeof(agsXMPP.protocol.component.Error)) as agsXMPP.protocol.component.Error; } set { if (HasTag(typeof(agsXMPP.protocol.component.Error))) RemoveTag(typeof(agsXMPP.protocol.component.Error)); if (value != null) this.AddChild(value); } } } } ��������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/component/Error.cs������������������������������������������0000644�0001750�0001750�00000003751�12250206660�024572� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.component { /// <summary> /// Summary description for Error. /// </summary> public class Error : agsXMPP.protocol.client.Error { public Error() : base() { this.Namespace = Uri.ACCEPT; } public Error(agsXMPP.protocol.client.ErrorType type) : base(type) { this.Namespace = Uri.ACCEPT; } /// <summary> /// Creates an error Element according the the condition /// The type attrib as added automatically as decribed in the XMPP specs /// This is the prefered way to create error Elements /// </summary> /// <param name="condition"></param> public Error(agsXMPP.protocol.client.ErrorCondition condition) : base(condition) { this.Namespace = Uri.ACCEPT; } } } �����������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/component/Route.cs������������������������������������������0000644�0001750�0001750�00000004743�12204443225�024600� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.Base; using agsXMPP.Xml; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.component { public enum RouteType { NONE = -1, error, auth, session } /// <summary> /// /// </summary> public class Route : Stanza { public Route() { this.TagName = "route"; this.Namespace = Uri.ACCEPT; } public Route(Element route) : this() { RouteElement = route; } public Route(Element route, Jid from, Jid to) : this() { RouteElement = route; From = from; To = to; } public Route(Element route, Jid from, Jid to, RouteType type) : this() { RouteElement = route; From = from; To = to; Type = type; } /// <summary> /// Gets or Sets the logtype /// </summary> public RouteType Type { get { return (RouteType) GetAttributeEnum("type", typeof(RouteType)); } set { if (value == RouteType.NONE) RemoveAttribute("type"); else SetAttribute("type", value.ToString()); } } /// <summary> /// sets or gets the element to route /// </summary> public Element RouteElement { get { return this.FirstChild as Element; } set { if (this.HasChildElements) this.RemoveAllChildNodes(); if (value != null) this.AddChild(value); } } } }�����������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/component/Handler.cs����������������������������������������0000644�0001750�0001750�00000002553�12250206660�025055� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.component { public delegate void MessageHandler (object sender, Message msg); public delegate void PresenceHandler (object sender, Presence pres); public delegate void IqHandler (object sender, client.IQEventArgs args); } �����������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/component/Message.cs����������������������������������������0000644�0001750�0001750�00000013437�12204443225�025066� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #region Using directives using System; #endregion namespace agsXMPP.protocol.component { /// <summary> /// Summary description for Message. /// </summary> public class Message : agsXMPP.protocol.client.Message { #region << Constructors >> public Message() : base() { this.Namespace = Uri.ACCEPT; } public Message(Jid to) : base(to) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, string body) : base(to, body) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, Jid from) : base(to, from) { this.Namespace = Uri.ACCEPT; } public Message(string to, string body) : base(to, body) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, string body, string subject) : base(to, body, subject) { this.Namespace = Uri.ACCEPT; } public Message(string to, string body, string subject) : base(to, body, subject) { this.Namespace = Uri.ACCEPT; } public Message(string to, string body, string subject, string thread) : base(to, body, subject, thread) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, string body, string subject, string thread) : base(to, body, subject, thread) { this.Namespace = Uri.ACCEPT; } public Message(string to, agsXMPP.protocol.client.MessageType type, string body) : base(to, type, body) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, agsXMPP.protocol.client.MessageType type, string body) : base(to, type, body) { this.Namespace = Uri.ACCEPT; } public Message(string to, agsXMPP.protocol.client.MessageType type, string body, string subject) : base(to, type, body, subject) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, agsXMPP.protocol.client.MessageType type, string body, string subject) : base(to, type, body, subject) { this.Namespace = Uri.ACCEPT; } public Message(string to, agsXMPP.protocol.client.MessageType type, string body, string subject, string thread) : base(to, type, body, subject, thread) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, agsXMPP.protocol.client.MessageType type, string body, string subject, string thread) : base(to, type, body, subject, thread) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, Jid from, string body) : base(to, from, body) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, Jid from, string body, string subject) : base(to, from, body, subject) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, Jid from, string body, string subject, string thread) : base(to, from, body, subject, thread) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, Jid from, agsXMPP.protocol.client.MessageType type, string body) : base(to, from, type, body) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, Jid from, agsXMPP.protocol.client.MessageType type, string body, string subject) : base(to, from, type, body, subject) { this.Namespace = Uri.ACCEPT; } public Message(Jid to, Jid from, agsXMPP.protocol.client.MessageType type, string body, string subject, string thread) : base(to, from, type, body, subject, thread) { this.Namespace = Uri.ACCEPT; } #endregion /// <summary> /// Error Child Element /// </summary> public new agsXMPP.protocol.component.Error Error { get { return SelectSingleElement(typeof(agsXMPP.protocol.component.Error)) as agsXMPP.protocol.component.Error; } set { if (HasTag(typeof(agsXMPP.protocol.component.Error))) RemoveTag(typeof(agsXMPP.protocol.component.Error)); if (value != null) this.AddChild(value); } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/component/Presence.cs���������������������������������������0000644�0001750�0001750�00000004647�12204443225�025251� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #region Using directives using System; #endregion namespace agsXMPP.protocol.component { /// <summary> /// Summary description for Presence. /// </summary> public class Presence : agsXMPP.protocol.client.Presence { #region << Constructors >> public Presence() : base() { this.Namespace = Uri.ACCEPT; } public Presence(agsXMPP.protocol.client.ShowType show, string status) : this() { this.Show = show; this.Status = status; } public Presence(agsXMPP.protocol.client.ShowType show, string status, int priority) : this(show, status) { this.Priority = priority; } #endregion /// <summary> /// Error Child Element /// </summary> public new agsXMPP.protocol.component.Error Error { get { return SelectSingleElement(typeof(agsXMPP.protocol.component.Error)) as agsXMPP.protocol.component.Error; } set { if (HasTag(typeof(agsXMPP.protocol.component.Error))) RemoveTag(typeof(agsXMPP.protocol.component.Error)); if (value != null) this.AddChild(value); } } } } �����������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/sasl/�������������������������������������������������������0000755�0001750�0001750�00000000000�12245370027�022107� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/sasl/Response.cs��������������������������������������������0000644�0001750�0001750�00000003646�12204443225�024241� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; //<response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> //dXNlcm5hbWU9InNvbWVub2RlIixyZWFsbT0ic29tZXJlYWxtIixub25jZT0i //T0E2TUc5dEVRR20yaGgiLGNub25jZT0iT0E2TUhYaDZWcVRyUmsiLG5jPTAw //MDAwMDAxLHFvcD1hdXRoLGRpZ2VzdC11cmk9InhtcHAvZXhhbXBsZS5jb20i //LHJlc3BvbnNlPWQzODhkYWQ5MGQ0YmJkNzYwYTE1MjMyMWYyMTQzYWY3LGNo //YXJzZXQ9dXRmLTgK //</response> namespace agsXMPP.protocol.sasl { /// <summary> /// Summary description for Response. /// </summary> public class Response : Element { public Response() { TagName = "response"; Namespace = Uri.SASL; } public Response(string text) : this() { TextBase64 = text; } //public Response(byte[] bytes) // : this() //{ // this.Value = Convert.ToBase64String(bytes); //} } }������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/sasl/Mechanism.cs�������������������������������������������0000644�0001750�0001750�00000021253�12204443225�024341� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Sasl; using agsXMPP.Xml.Dom; // <mechanism>DIGEST-MD5</mechanism> // <mechanism>PLAIN</mechanism> //MECHANISMS USAGE REFERENCE OWNER //---------- ----- --------- ----- //KERBEROS_V4 LIMITED [RFC2222] IESG <iesg@ietf.org> //GSSAPI COMMON [RFC2222] IESG <iesg@ietf.org> //SKEY OBSOLETE [RFC2444] IESG <iesg@ietf.org> //EXTERNAL COMMON [RFC2222] IESG <iesg@ietf.org> //CRAM-MD5 LIMITED [RFC2195] IESG <iesg@ietf.org> //ANONYMOUS COMMON [RFC2245] IESG <iesg@ietf.org> //OTP COMMON [RFC2444] IESG <iesg@ietf.org> //GSS-SPNEGO LIMITED [Leach] Paul Leach <paulle@microsoft.com> //PLAIN COMMON [RFC2595] IESG <iesg@ietf.org> //SECURID COMMON [RFC2808] Magnus Nystrom <magnus@rsasecurity.com> //NTLM LIMITED [Leach] Paul Leach <paulle@microsoft.com> //NMAS_LOGIN LIMITED [Gayman] Mark G. Gayman <mgayman@novell.com> //NMAS_AUTHEN LIMITED [Gayman] Mark G. Gayman <mgayman@novell.com> //DIGEST-MD5 COMMON [RFC2831] IESG <iesg@ietf.org> //9798-U-RSA-SHA1-ENC COMMON [RFC3163] robert.zuccherato@entrust.com //9798-M-RSA-SHA1-ENC COMMON [RFC3163] robert.zuccherato@entrust.com //9798-U-DSA-SHA1 COMMON [RFC3163] robert.zuccherato@entrust.com //9798-M-DSA-SHA1 COMMON [RFC3163] robert.zuccherato@entrust.com //9798-U-ECDSA-SHA1 COMMON [RFC3163] robert.zuccherato@entrust.com //9798-M-ECDSA-SHA1 COMMON [RFC3163] robert.zuccherato@entrust.com //KERBEROS_V5 COMMON [Josefsson] Simon Josefsson <simon@josefsson.org> //NMAS-SAMBA-AUTH LIMITED [Brimhall] Vince Brimhall <vbrimhall@novell.com> namespace agsXMPP.protocol.sasl { public enum MechanismType { NONE = 0, KERBEROS_V4, GSSAPI, SKEY, EXTERNAL, CRAM_MD5, ANONYMOUS, OTP, GSS_SPNEGO, PLAIN, SECURID, NTLM, NMAS_LOGIN, NMAS_AUTHEN, DIGEST_MD5, ISO_9798_U_RSA_SHA1_ENC, ISO_9798_M_RSA_SHA1_ENC, ISO_9798_U_DSA_SHA1, ISO_9798_M_DSA_SHA1, ISO_9798_U_ECDSA_SHA1, ISO_9798_M_ECDSA_SHA1, KERBEROS_V5, NMAS_SAMBA_AUTH, X_GOOGLE_TOKEN, SCRAM_SHA_1, X_FACEBOOK_PLATFORM } /// <summary> /// Summary description for Mechanism. /// </summary> public class Mechanism : Element { public Mechanism() { this.TagName = "mechanism"; this.Namespace = Uri.SASL; } public Mechanism(MechanismType mechanism) : this() { MechanismType = mechanism; } /// <summary> /// SASL mechanis as enum /// </summary> public MechanismType MechanismType { get { return GetMechanismType(this.Value); } set { this.Value = GetMechanismName(value); } } public static MechanismType GetMechanismType(string mechanism) { switch (mechanism) { //case "KERBEROS_V4": // return MechanismType.KERBEROS_V4; case "GSSAPI": return MechanismType.GSSAPI; //case "SKEY": // return MechanismType.SKEY; //case "EXTERNAL": // return MechanismType.EXTERNAL; //case "CRAM-MD5": // return MechanismType.CRAM_MD5; //case "ANONYMOUS": // return MechanismType.ANONYMOUS; //case "OTP": // return MechanismType.OTP; //case "GSS-SPNEGO": // return MechanismType.GSS_SPNEGO; case "PLAIN": return MechanismType.PLAIN; //case "SECURID": // return MechanismType.SECURID; //case "NTLM": // return MechanismType.NTLM; //case "NMAS_LOGIN": // return MechanismType.NMAS_LOGIN; //case "NMAS_AUTHEN": // return MechanismType.NMAS_AUTHEN; case "DIGEST-MD5": return MechanismType.DIGEST_MD5; //case "9798-U-RSA-SHA1-ENC": // return MechanismType.ISO_9798_U_RSA_SHA1_ENC; //case "9798-M-RSA-SHA1-ENC": // return MechanismType.ISO_9798_M_RSA_SHA1_ENC; //case "9798-U-DSA-SHA1": // return MechanismType.ISO_9798_U_DSA_SHA1; //case "9798-M-DSA-SHA1": // return MechanismType.ISO_9798_M_DSA_SHA1; //case "9798-U-ECDSA-SHA1": // return MechanismType.ISO_9798_U_ECDSA_SHA1; //case "9798-M-ECDSA-SHA1": // return MechanismType.ISO_9798_M_ECDSA_SHA1; //case "KERBEROS_V5": // return MechanismType.KERBEROS_V5; //case "NMAS-SAMBA-AUTH": // return MechanismType.NMAS_SAMBA_AUTH; case "X-GOOGLE-TOKEN": return MechanismType.X_GOOGLE_TOKEN; case "SCRAM-SHA-1": return MechanismType.SCRAM_SHA_1; case "X-FACEBOOK-PLATFORM": return MechanismType.X_FACEBOOK_PLATFORM; default: return MechanismType.NONE; } } public static string GetMechanismName(MechanismType mechanism) { switch (mechanism) { case MechanismType.KERBEROS_V4: return "KERBEROS_V4"; case MechanismType.GSSAPI: return "GSSAPI"; case MechanismType.SKEY: return "SKEY"; case MechanismType.EXTERNAL: return "EXTERNAL"; case MechanismType.CRAM_MD5: return "CRAM-MD5"; case MechanismType.ANONYMOUS: return "ANONYMOUS"; case MechanismType.OTP: return "OTP"; case MechanismType.GSS_SPNEGO: return "GSS-SPNEGO"; case MechanismType.PLAIN: return "PLAIN"; case MechanismType.SECURID: return "SECURID"; case MechanismType.NTLM: return "NTLM"; case MechanismType.NMAS_LOGIN: return "NMAS_LOGIN"; case MechanismType.NMAS_AUTHEN: return "NMAS_AUTHEN"; case MechanismType.DIGEST_MD5: return "DIGEST-MD5"; case MechanismType.ISO_9798_U_RSA_SHA1_ENC: return "9798-U-RSA-SHA1-ENC"; case MechanismType.ISO_9798_M_RSA_SHA1_ENC: return "9798-M-RSA-SHA1-ENC"; case MechanismType.ISO_9798_U_DSA_SHA1: return "9798-U-DSA-SHA1"; case MechanismType.ISO_9798_M_DSA_SHA1: return "9798-M-DSA-SHA1"; case MechanismType.ISO_9798_U_ECDSA_SHA1: return "9798-U-ECDSA-SHA1"; case MechanismType.ISO_9798_M_ECDSA_SHA1: return "9798-M-ECDSA-SHA1"; case MechanismType.KERBEROS_V5: return "KERBEROS_V5"; case MechanismType.NMAS_SAMBA_AUTH: return "NMAS-SAMBA-AUTH"; case MechanismType.X_GOOGLE_TOKEN: return "X-GOOGLE-TOKEN"; case MechanismType.SCRAM_SHA_1: return "SCRAM-SHA-1"; case MechanismType.X_FACEBOOK_PLATFORM: return "X-FACEBOOK-PLATFORM"; default: return null; } } /// <summary> /// Gets or sets the kerberos principal. /// </summary> /// <value>The kerberos proncipal.</value> public string KerberosPrincipal { get { return GetAttribute("kerb:principal"); } set { SetAttribute("kerb:principal", value); } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/sasl/Abort.cs�����������������������������������������������0000644�0001750�0001750�00000002532�12204443225�023503� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.sasl { /// <summary> /// Summary description for Abort. /// </summary> public class Abort : Element { public Abort() { this.TagName = "abort"; this.Namespace = Uri.SASL; } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/sasl/Auth.cs������������������������������������������������0000644�0001750�0001750�00000003475�12204443225�023344� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; // <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'/> namespace agsXMPP.protocol.sasl { /// <summary> /// Summary description for Auth. /// </summary> public class Auth : Element { public Auth() { this.TagName = "auth"; this.Namespace = Uri.SASL; } public Auth(MechanismType type) : this() { MechanismType = type; } public Auth(MechanismType type, string text) : this(type) { this.Value = text; } public MechanismType MechanismType { get { return Mechanism.GetMechanismType(GetAttribute("mechanism")); } set { SetAttribute("mechanism", Mechanism.GetMechanismName(value)); } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/sasl/FailureCondition.cs������������������������������������0000644�0001750�0001750�00000005120�12245370027�025672� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������using System; namespace agsXMPP.protocol.sasl { public enum FailureCondition { /// <summary> /// The receiving entity acknowledges an <abort/> element sent by the initiating entity; sent in reply to the <abort/> element. /// </summary> aborted, /// <summary> /// The mechanism chosen by the initiating entity may be used only if the stream is already encrypted; provided in response to the <auth/> element. /// </summary> encryption_required, /// <summary> /// The data provided by the initiating entity could not be processed because the [BASE64] (Josefsson, S., The Base16, Base32, and Base64 Data Encodings, July 2003.) encoding is incorrect (e.g., because the encoding does not adhere to the definition in Section 3 of [BASE64] (Josefsson, S., The Base16, Base32, and Base64 Data Encodings, July 2003.)); sent in reply to a <response/> element or an <auth/> element with initial response data. /// </summary> incorrect_encoding, /// <summary> /// The authzid provided by the initiating entity is invalid, either because it is incorrectly formatted or because the initiating entity does not have permissions to authorize that ID; sent in reply to a <response/> element or an <auth/> element with initial response data. /// </summary> invalid_authzid, /// <summary> /// The initiating entity did not provide a mechanism or requested a mechanism that is not supported by the receiving entity; sent in reply to an <auth/> element. /// </summary> invalid_mechanism, /// <summary> /// The mechanism requested by the initiating entity is weaker than server policy permits for that initiating entity; sent in reply to a <response/> element or an <auth/> element with initial response data. /// </summary> mechanism_too_weak, /// <summary> /// The authentication failed because the initiating entity did not provide valid credentials (this includes but is not limited to the case of an unknown username); sent in reply to a <response/> element or an <auth/> element with initial response data. /// </summary> not_authorized, /// <summary> /// The authentication failed because of a temporary error condition within the receiving entity; sent in reply to an <auth/> element or <response/> element. /// </summary> temporary_auth_failure, UnknownCondition } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/sasl/Challenge.cs�������������������������������������������0000644�0001750�0001750�00000003025�12204443225�024314� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.Xml.Dom; //<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> //cmVhbG09InNvbWVyZWFsbSIsbm9uY2U9Ik9BNk1HOXRFUUdtMmhoIixxb3A9ImF1dGgi //LGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNzCg== //</challenge> namespace agsXMPP.protocol.sasl { /// <summary> /// Summary description for Challenge. /// </summary> public class Challenge : Element { public Challenge() { TagName = "challenge"; Namespace = Uri.SASL; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/sasl/Mechanisms.cs������������������������������������������0000644�0001750�0001750�00000005020�12204443225�024516� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml; using agsXMPP.Xml.Dom; // <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> // <mechanism>DIGEST-MD5</mechanism> // <mechanism>PLAIN</mechanism> // </mechanisms> namespace agsXMPP.protocol.sasl { /// <summary> /// Summary description for Mechanisms. /// </summary> public class Mechanisms : Element { public Mechanisms() { this.TagName = "mechanisms"; this.Namespace = Uri.SASL; } public Mechanism[] GetMechanisms() { ElementList elements = SelectElements("mechanism"); Mechanism[] items = new Mechanism[elements.Count]; int i=0; foreach (Element e in elements) { items[i] = (Mechanism) e; i++; } return items; } public bool SupportsMechanism(MechanismType type) { foreach( Mechanism m in GetMechanisms()) { if (m.MechanismType == type) return true; } return false; } /// <summary> /// Gets the given mechanism. /// </summary> /// <param name="type">The mechanism type.</param> /// <returns></returns> public Mechanism GetMechanism(MechanismType type) { foreach (Mechanism m in GetMechanisms()) { if (m.MechanismType == type) return m; } return null; } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/sasl/Failure.cs���������������������������������������������0000644�0001750�0001750�00000007226�12245370027�024034� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; // <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> // <incorrect-encoding/> // </failure> namespace agsXMPP.protocol.sasl { /// <summary> /// Summary description for Failure. /// </summary> public class Failure : Element { public Failure() { this.TagName = "failure"; this.Namespace = Uri.SASL; } public Failure(FailureCondition cond) : this() { Condition = cond; } public FailureCondition Condition { get { if (HasTag("aborted")) return FailureCondition.aborted; else if (HasTag("incorrect-encoding")) return FailureCondition.incorrect_encoding; else if (HasTag("encryption-required")) return FailureCondition.encryption_required; else if (HasTag("invalid-authzid")) return FailureCondition.invalid_authzid; else if (HasTag("invalid-mechanism")) return FailureCondition.invalid_mechanism; else if (HasTag("mechanism-too-weak")) return FailureCondition.mechanism_too_weak; else if (HasTag("not-authorized")) return FailureCondition.not_authorized; else if (HasTag("temporary-auth-failure")) return FailureCondition.temporary_auth_failure; else return FailureCondition.UnknownCondition; } set { if (value == FailureCondition.aborted) SetTag("aborted"); else if (value == FailureCondition.incorrect_encoding) SetTag("incorrect-encoding"); else if (value == FailureCondition.encryption_required) SetTag("encryption-required"); else if (value == FailureCondition.invalid_authzid) SetTag("invalid-authzid"); else if (value == FailureCondition.invalid_mechanism) SetTag("invalid-mechanism"); else if (value == FailureCondition.mechanism_too_weak) SetTag("mechanism-too-weak"); else if (value == FailureCondition.not_authorized) SetTag("not-authorized"); else if (value == FailureCondition.temporary_auth_failure) SetTag("temporary-auth-failure"); } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/sasl/Success.cs���������������������������������������������0000644�0001750�0001750�00000002632�12204443225�024045� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; // <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/> namespace agsXMPP.protocol.sasl { /// <summary> /// Summary description for Success. /// </summary> public class Success : Element { public Success() { this.TagName = "success"; this.Namespace = Uri.SASL; } } } ������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/stream/�����������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�022434� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/stream/Features.cs������������������������������������������0000644�0001750�0001750�00000013423�12204443225�024544� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; using agsXMPP.protocol.tls; using agsXMPP.protocol.client; using agsXMPP.protocol.iq.bind; using agsXMPP.protocol.stream.feature; using agsXMPP.protocol.stream.feature.compression; using agsXMPP.protocol.extensions.caps; //</stream:features> // <stream:features> // <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> // <mechanism>DIGEST-MD5</mechanism> // <mechanism>PLAIN</mechanism> // </mechanisms> // </stream:features> // <stream:features> // <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'> // <required/> // </starttls> // <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> // <mechanism>DIGEST-MD5</mechanism> // <mechanism>PLAIN</mechanism> // </mechanisms> // </stream:features> namespace agsXMPP.protocol.stream { /// <summary> /// Summary description for Features. /// </summary> public class Features : Element { public Features() { this.TagName = "features"; this.Namespace = Uri.STREAM; } public StartTls StartTls { get { return SelectSingleElement(typeof(StartTls)) as StartTls; } set { if (HasTag(typeof(StartTls))) RemoveTag(typeof(StartTls)); if (value != null) this.AddChild(value); } } public Bind Bind { get { return SelectSingleElement(typeof(Bind)) as Bind; } set { if(HasTag(typeof(Bind))) RemoveTag(typeof(Bind)); if (value != null) this.AddChild(value); } } // <stream:stream from="beta.soapbox.net" xml:lang="de" id="373af7e9-6107-4729-8cea-e8b8ea05ceea" xmlns="jabber:client" version="1.0" xmlns:stream="http://etherx.jabber.org/streams"> // <stream:features xmlns:stream="http://etherx.jabber.org/streams"> // <compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression> // <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" /> // <register xmlns="http://jabber.org/features/iq-register" /> // <auth xmlns="http://jabber.org/features/iq-auth" /> // <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"> // <mechanism>PLAIN</mechanism> // <mechanism>DIGEST-MD5</mechanism> // <mechanism>ANONYMOUS</mechanism> // </mechanisms> // </stream:features> public Compression Compression { get { return SelectSingleElement(typeof(Compression)) as Compression; } set { if (HasTag(typeof(Compression))) RemoveTag(typeof(Compression)); if (value != null) this.AddChild(value); } } public Register Register { get { return SelectSingleElement(typeof(Register)) as Register; } set { if (HasTag(typeof(Register))) RemoveTag(typeof(Register)); if (value != null) this.AddChild(value); } } public sasl.Mechanisms Mechanisms { get { return SelectSingleElement(typeof(sasl.Mechanisms)) as sasl.Mechanisms; } set { if (HasTag(typeof(sasl.Mechanisms))) RemoveTag(typeof(sasl.Mechanisms)); if (value != null) this.AddChild(value); } } public bool SupportsBind { get { return Bind!=null ? true : false; } } public bool SupportsStartTls { get { return StartTls!=null ? true : false; } } /// <summary> /// Is Stream Compression supported? /// </summary> public bool SupportsCompression { get { return Compression != null ? true : false; } } /// <summary> /// Is Registration supported? /// </summary> public bool SupportsRegistration { get { return Register != null ? true : false; } } public Capabilities Capabilities { get { return SelectSingleElement<Capabilities>(); } set { RemoveTag<Capabilities>(); if (value != null) AddChild(value); } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/stream/feature/���������������������������������������������0000755�0001750�0001750�00000000000�12204443225�024067� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/stream/feature/Register.cs����������������������������������0000644�0001750�0001750�00000003102�12204443225�026176� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; //<stream:stream xmlns:stream='http://etherx.jabber.org/streams/' //xmlns='jabber:client' //from='somedomain' //version='1.0'> //<stream:features> //... //<register xmlns='http://jabber.org/features/iq-register'/> //... namespace agsXMPP.protocol.stream.feature { /// <summary> /// /// </summary> public class Register : Element { public Register() { this.TagName = "register"; this.Namespace = Uri.FEATURE_IQ_REGISTER; } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/stream/feature/compression/���������������������������������0000755�0001750�0001750�00000000000�12204443225�026430� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/stream/feature/compression/Method.cs������������������������0000644�0001750�0001750�00000004745�12204443225�030211� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; using agsXMPP.protocol.extensions.compression; namespace agsXMPP.protocol.stream.feature.compression { public class Method : Element { /* * <compression xmlns='http://jabber.org/features/compress'> * <method>zlib</method> * </compression> * * <stream:features> * <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> * <compression xmlns='http://jabber.org/features/compress'> * <method>zlib</method> * <method>lzw</method> * </compression> * </stream:features> */ #region << Constructors >> public Method() { this.TagName = "method"; this.Namespace = Uri.FEATURE_COMPRESS; } public Method(CompressionMethod method) : this() { this.Value = method.ToString(); } #endregion public CompressionMethod CompressionMethod { get { #if CF return (CompressionMethod) util.Enum.Parse(typeof(CompressionMethod), this.Value, true); #else return (CompressionMethod) Enum.Parse(typeof(CompressionMethod), this.Value, true); #endif } set { this.Value = value.ToString(); } } } }���������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/stream/feature/compression/Compression.cs�������������������0000644�0001750�0001750�00000007077�12204443225�031273� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; using agsXMPP.protocol.extensions.compression; namespace agsXMPP.protocol.stream.feature.compression { public class Compression : Element { /* * <compression xmlns='http://jabber.org/features/compress'> * <method>zlib</method> * </compression> * * <stream:features> * <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> * <compression xmlns='http://jabber.org/features/compress'> * <method>zlib</method> * <method>lzw</method> * </compression> * </stream:features> */ public Compression() { this.TagName = "compression"; this.Namespace = Uri.FEATURE_COMPRESS; } /// <summary> /// method/algorithm used to compressing the stream /// </summary> public CompressionMethod Method { set { if (value != CompressionMethod.Unknown) SetTag("method", value.ToString()); } get { return (CompressionMethod) GetTagEnum("method", typeof(CompressionMethod)); } } /// <summary> /// Add a compression method/algorithm /// </summary> /// <param name="method"></param> public void AddMethod(CompressionMethod method) { if (!SupportsMethod(method)) AddChild(new Method(method)); } /// <summary> /// Is the given compression method/algrithm supported? /// </summary> /// <param name="method"></param> /// <returns></returns> public bool SupportsMethod(CompressionMethod method) { ElementList nList = SelectElements(typeof(Method)); foreach (Method m in nList) { if (m.CompressionMethod == method) return true; } return false; } public Method[] GetMethods() { ElementList methods = SelectElements(typeof(Method)); Method[] items = new Method[methods.Count]; int i = 0; foreach (Method m in methods) { items[i] = m; i++; } return items; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/���������������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�021552� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/disco/���������������������������������������������������0000755�0001750�0001750�00000000000�12250206660�022654� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/disco/DiscoItem.cs���������������������������������������0000644�0001750�0001750�00000004026�12204443225�025064� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.disco { public enum DiscoAction { NONE = -1, remove, update } /// <summary> /// /// </summary> public class DiscoItem : Element { public DiscoItem() { this.TagName = "item"; this.Namespace = Uri.DISCO_ITEMS; } public Jid Jid { get { return new Jid(GetAttribute("jid")); } set { SetAttribute("jid", value.ToString()); } } public string Name { get { return GetAttribute("name"); } set { SetAttribute("name", value); } } public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } public DiscoAction Action { get { return (DiscoAction) GetAttributeEnum("action", typeof(DiscoAction)); } set { if (value == DiscoAction.NONE) RemoveAttribute("action"); else SetAttribute("action", value.ToString()); } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/disco/DiscoInfoIq.cs�������������������������������������0000644�0001750�0001750�00000003160�12204443225�025351� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.disco { /// <summary> /// Discovering Information About a Jabber Entity /// </summary> public class DiscoInfoIq : IQ { private DiscoInfo m_DiscoInfo = new DiscoInfo(); public DiscoInfoIq() { base.Query = m_DiscoInfo; this.GenerateId(); } public DiscoInfoIq(IqType type) : this() { this.Type = type; } public new DiscoInfo Query { get { return m_DiscoInfo; } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/disco/DiscoInfo.cs���������������������������������������0000644�0001750�0001750�00000010670�12204443225�025063� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP; using agsXMPP.protocol; using agsXMPP.Xml.Dom; /* Example 1. Querying for further information <iq type='get' from='romeo@montague.net/orchard' to='plays.shakespeare.lit' id='info1'> <query xmlns='http://jabber.org/protocol/disco#info'/> </iq> Example 2. Result-set for information request <iq type='result' from='plays.shakespeare.lit' to='romeo@montague.net/orchard' id='info1'> <query xmlns='http://jabber.org/protocol/disco#info'> <identity category='conference' type='text' name='Play-Specific Chatrooms'/> <identity category='directory' type='chatroom' name='Play-Specific Chatrooms'/> <feature var='http://jabber.org/protocol/disco#info'/> <feature var='http://jabber.org/protocol/disco#items'/> <feature var='http://jabber.org/protocol/muc'/> <feature var='jabber:iq:register'/> <feature var='jabber:iq:search'/> <feature var='jabber:iq:time'/> <feature var='jabber:iq:version'/> </query> </iq> Example 3. Target entity does not exist <iq type='error' from='plays.shakespeare.lit' to='romeo@montague.net/orchard' id='info1'> <query xmlns='http://jabber.org/protocol/disco#info'/> <error code='404' type='cancel'> <item-not-found xmlns='urn:ietf:xml:params:ns:xmpp-stanzas'/> </error> </iq> */ namespace agsXMPP.protocol.iq.disco { /// <summary> /// Discovering Information About a Jabber Entity /// </summary> public class DiscoInfo : Element { public DiscoInfo() { this.TagName = "query"; this.Namespace = Uri.DISCO_INFO; } /// <summary> /// Optional node Attrib /// </summary> public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } public DiscoIdentity AddIdentity() { DiscoIdentity id = new DiscoIdentity(); AddChild(id); return id; } public void AddIdentity(DiscoIdentity id) { AddChild(id); } public DiscoFeature AddFeature() { DiscoFeature f = new DiscoFeature(); AddChild(f); return f; } public void AddFeature(DiscoFeature f) { AddChild(f); } public DiscoIdentity[] GetIdentities() { ElementList nl = SelectElements(typeof(DiscoIdentity)); DiscoIdentity[] items = new DiscoIdentity[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (DiscoIdentity) e; i++; } return items; } /// <summary> /// Gets all Features /// </summary> /// <returns></returns> public DiscoFeature[] GetFeatures() { ElementList nl = SelectElements(typeof(DiscoFeature)); DiscoFeature[] items = new DiscoFeature[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (DiscoFeature) e; i++; } return items; } /// <summary> /// Check if a feature is supported /// </summary> /// <param name="var"></param> /// <returns></returns> public bool HasFeature(string var) { DiscoFeature[] features = GetFeatures(); foreach (DiscoFeature feat in features) { if (feat.Var == var) return true; } return false; } } } ������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/disco/Features.cs����������������������������������������0000644�0001750�0001750�00000030007�12204443225�024760� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2007 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.iq.disco { /// <summary> /// Disco Features Enumeration /// </summary> public class Features { // Application supports DNS SRV lookups of XMPP services. RFC 3920: XMPP Core, RFC 3921: XMPP IM public const string FEAT_DNSSRV = "dnssrv"; // Application supports Unicode characters throughout, including in displayed text, JIDs, and passwords. N/A public const string FEAT_FULL_UNICODE = "fullunicode"; // gc-1.0 Support for the "groupchat 1.0" protocol. JEP-0045: Multi-User Chat public const string FEAT_GROUPCHAT_1 = "gc-1.0"; // http://jabber.org/protocol/amp?action=alert Support for the "alert" action in Advanced Message Processing. JEP-0079: Advanced Message Processing public const string FEAT_AMP_ACTION_ALERT = "http://jabber.org/protocol/amp?action=alert"; // http://jabber.org/protocol/amp?action=drop Support for the "drop" action in Advanced Message Processing. JEP-0079: Advanced Message Processing public const string FEAT_AMP_ACTION_DROP = "http://jabber.org/protocol/amp?action=drop"; // http://jabber.org/protocol/amp?action=error Support for the "error" action in Advanced Message Processing. JEP-0079: Advanced Message Processing public const string FEAT_AMP_ACTION_ERROR = "http://jabber.org/protocol/amp?action=error "; /// http://jabber.org/protocol/amp?action=notify Support for the "notify" action in Advanced Message Processing. JEP-0079: Advanced Message Processing public const string FEAT_AMP_ACTION_NOTIFY = "http://jabber.org/protocol/amp?action=notify"; // http://jabber.org/protocol/amp?condition=deliver Support for the "deliver" condition in Advanced Message Processing. JEP-0079: Advanced Message Processing public const string FEAT_AMP_CONDITION_DELIVER = "http://jabber.org/protocol/amp?condition=deliver "; // http://jabber.org/protocol/amp?condition=expire-at Support for the "expire-at" condition in Advanced Message Processing. JEP-0079: Advanced Message Processing public const string FEAT_AMP_CONDITION_EXPIRE_AT = "http://jabber.org/protocol/amp?condition=expire-at"; // http://jabber.org/protocol/amp?condition=match-resource Support for the "match-resource" condition in Advanced Message Processing. JEP-0079: Advanced Message Processing public const string FEAT_AMP_CONDITION_MATCH_RESOURCE = "http://jabber.org/protocol/amp?condition=match-resource"; // http://jabber.org/protocol/disco#publish Support for the "publishing" feature of service discovery. JEP-0030: Service Discovery public const string FEAT_PUBLISH = "http://jabber.org/protocol/disco#publish"; //http://jabber.org/protocol/muc#register Support for the muc#register FORM_TYPE JEP-0045 public const string FEAT_MUC_REGISTER = "http://jabber.org/protocol/muc#register"; // http://jabber.org/protocol/muc#roomconfig Support for the muc#roomconfig FORM_TYPE JEP-0045 public const string FEAT_MUC_ROOMCONFIG = "http://jabber.org/protocol/muc#roomconfig"; // http://jabber.org/protocol/muc#roominfo Support for the muc#roominfo FORM_TYPE JEP-0045 public const string FEAT_MUC_ROOMINFO = "http://jabber.org/protocol/muc#roominfo"; // http://jabber.org/protocol/pubsub#collections Collection nodes are supported. JEP-0060 // http://jabber.org/protocol/pubsub#config-node Configuration of node options is supported. JEP-0060 public const string FEAT_PUBSUB_CONFIG_NODE = "http://jabber.org/protocol/pubsub#collections"; // http://jabber.org/protocol/pubsub#create-nodes Creation of nodes is supported. JEP-0060 public const string FEAT_PUBSUB_CREATE_NODES = "http://jabber.org/protocol/pubsub#create-nodes"; // http://jabber.org/protocol/pubsub#delete-any Any publisher may delete an item (not only the originating publisher). JEP-0060 public const string FEAT_PUBSUB_DELETE_ANY = "http://jabber.org/protocol/pubsub#create-nodes"; // http://jabber.org/protocol/pubsub#delete-nodes Deletion of nodes is supported. JEP-0060 public const string FEAT_PUBSUB_DELETE_NODES = "http://jabber.org/protocol/pubsub#delete-nodes"; // http://jabber.org/protocol/pubsub#instant-nodes Creation of instant nodes is supported. JEP-0060 public const string FEAT_PUBSUB_INSTANT_NODES = "http://jabber.org/protocol/pubsub#instant-nodes"; // http://jabber.org/protocol/pubsub#item-ids Publishers may specify item identifiers. JEP-0060 public const string FEAT_OUBSUB_ITEM_IDS = "http://jabber.org/protocol/pubsub#item-ids"; // http://jabber.org/protocol/pubsub#leased-subscription Time-based subscriptions are supported. JEP-0060 public const string FEAT_PUBSUB_LEASED_SUBSCRIPTION = "http://jabber.org/protocol/pubsub#leased-subscription"; // http://jabber.org/protocol/pubsub#meta-data Node meta-data is supported. JEP-0060 public const string FEAT_PUBSUB_META = "http://jabber.org/protocol/pubsub#meta-data"; // http://jabber.org/protocol/pubsub#multi-subscribe A single entity may subscribe to a node multiple times. JEP-0060 public const string FEAT_PUBSUB_MULTI_SUBSCRIBE = "http://jabber.org/protocol/pubsub#multi-subscribe"; // http://jabber.org/protocol/pubsub#outcast-affiliation The outcast affiliation is supported. JEP-0060 public const string FEAT_PUBSUB_OUTCAST_AFFILIATION = "http://jabber.org/protocol/pubsub#outcast-affiliation"; // http://jabber.org/protocol/pubsub#persistent-items Persistent items are supported. JEP-0060 public const string FEAT_PUBSUB_PERSISTENT_ITEMS = "http://jabber.org/protocol/pubsub#persistent-items"; // http://jabber.org/protocol/pubsub#presence-notifications Presence-based delivery of event notifications is supported. JEP-0060 public const string FEAT_PUBSUB_PRESENCE_NOTIFICATIONS = "http://jabber.org/protocol/pubsub#presence-notifications"; // http://jabber.org/protocol/pubsub#publisher-affiliation The publisher affiliation is supported. JEP-0060 public const string FEAT_PUBSUB_PUBLISHER_AFFILIATION = "http://jabber.org/protocol/pubsub#publisher-affiliation"; // http://jabber.org/protocol/pubsub#purge-nodes Purging of nodes is supported. JEP-0060 public const string FEAT_PUBSUB_PURGE_NODES = "http://jabber.org/protocol/pubsub#purge-nodes"; // http://jabber.org/protocol/pubsub#retract-items Item retraction is supported. JEP-0060 public const string FEAT_PUBSUB_RETRACT_ITEMS = "http://jabber.org/protocol/pubsub#retract-items"; // http://jabber.org/protocol/pubsub#retrieve-affiliations Retrieval of current affiliations is supported. JEP-0060 public const string FEAT_PUBSUB_RETRIEVE_AFFILIATIONS = "http://jabber.org/protocol/pubsub#retrieve-affiliations"; // http://jabber.org/protocol/pubsub#retrieve-items Item retrieval is supported. JEP-0060 public const string FEAT_PUBSUB_RETRIEVE_ITEMS = "http://jabber.org/protocol/pubsub#retrieve-items"; // http://jabber.org/protocol/pubsub#subscribe Subscribing and unsubscribing are supported. JEP-0060 public const string FEAT_PUBSUB_SUBSCRIBE = "http://jabber.org/protocol/pubsub#subscribe"; // http://jabber.org/protocol/pubsub#subscription-options Configuration of subscription options is supported. JEP-0060 public const string FEAT_PUBSUB_SUBSCRIPTIONS_OPTIONS = "http://jabber.org/protocol/pubsub#subscription-options"; // http://jabber.org/protocol/waitinglist/schemes/mailto Waiting list service supports the mailto: URI scheme. JEP-0130 public const string FEAT_WAITINGLIST_MAILTO = "http://jabber.org/protocol/waitinglist/schemes/mailto"; // http://jabber.org/protocol/waitinglist/schemes/tel Waiting list service supports the tel: URI scheme. JEP-0130 public const string FEAT_WAITINGLIST_TEL = "http://jabber.org/protocol/waitinglist/schemes/tel"; // ipv6 Application supports IPv6. N/A public const string FEAT_IPV6 = "ipv6"; // msglog Application performs logging or archiving of messages. N/A public const string FEAT_MESSAGE_LOG = "msglog"; // msgoffline Server stores messages offline for later delivery. N/A public const string FEAT_MESSAGE_OFFLINE = "msgoffline"; // muc_hidden Hidden room in Multi-User Chat (MUC) JEP-0045 public const string FEAT_MUC_HIDDEN = "muc_hidden"; // muc_membersonly Members-only room in Multi-User Chat (MUC) JEP-0045 public const string FEAT_MUC_MEMBERSONLY = "muc_membersonly"; // muc_moderated Moderated room in Multi-User Chat (MUC) JEP-0045 public const string FEAT_MUC_MODERATED = "muc_moderated"; // muc_nonanonymous Non-anonymous room in Multi-User Chat (MUC) JEP-0045 public const string FEAT_MUC_NONANONYMOUS = "muc_nonanonymous"; // muc_open Open room in Multi-User Chat (MUC) JEP-0045 public const string FEAT_MUC_OPEN = "muc_open"; // muc_passwordprotected Password-protected room in Multi-User Chat (MUC) JEP-0045 public const string FEAT_MUC_PASSWORDPROTECTED = "muc_passwordprotected"; // muc_persistent Persistent room in Multi-User Chat (MUC) JEP-0045 public const string FEAT_MUC_PERSISTANT = "muc_persistent"; // muc_public Public room in Multi-User Chat (MUC) JEP-0045 public const string FEAT_MUC_PUBLIC = "muc_public"; // muc_rooms List of MUC rooms (each as a separate item) JEP-0045 public const string FEAT_MUC_ROOMS = "muc_rooms"; // muc_semianonymous Semi-anonymous room in Multi-User Chat (MUC) JEP-0045 public const string FEAT_SEMIANONYMOUS = "muc_semianonymous"; // muc_temporary Temporary room in Multi-User Chat (MUC) JEP-0045 public const string FEAT_MUC_TEMPORARY = "muc_temporary"; // muc_unmoderated Unmoderated room in Multi-User Chat (MUC) JEP-0045 public const string FEAT_MUC_UNMODERATED = "muc_unmoderated"; // muc_unsecured Unsecured room in Multi-User Chat (MUC) JEP-0045 public const string FEAT_MUC_UNSECURED = "muc_unsecured"; // sslc2s Application supports old-style (pre-TLS) SSL connections on a dedicated port. N/A public const string FEAT_SSL_C2S = "sslc2s"; // stringprep Application supports the nameprep, nodeprep, and resourceprep profiles of stringprep. RFC 3920: XMPP Core public const string FEAT_STRINGPREP = "stringprep"; // urn:ietf:params:xml:ns:xmpp-sasl#c2s Application supports client-to-server SASL. RFC 3920: XMPP Core public const string FEAT_SASL_C2S = "urn:ietf:params:xml:ns:xmpp-sasl#c2s"; // urn:ietf:params:xml:ns:xmpp-sasl#s2s Application supports server-to-server SASL. RFC 3920: XMPP Core public const string FEAT_SASL_S2S = "urn:ietf:params:xml:ns:xmpp-sasl#s2s"; // urn:ietf:params:xml:ns:xmpp-tls#c2s Application supports client-to-server TLS. RFC 3920: XMPP Core public const string FEAT_TLS_C2S = "urn:ietf:params:xml:ns:xmpp-tls#c2s"; // urn:ietf:params:xml:ns:xmpp-tls#s2s Application supports server-to-server TLS. RFC 3920: XMPP Core public const string FEAT_TLS_S2S = "urn:ietf:params:xml:ns:xmpp-tls#s2s"; // xmllang Application supports the 'xml:lang' attribute as described in RFC 3920. RFC 3920: XMPP Core public const string FEAT_XMLLANG = "xmllang"; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/disco/DiscoItemsIq.cs������������������������������������0000644�0001750�0001750�00000005305�12204443225�025542� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.disco { /* Example 10. Requesting all items <iq type='get' from='romeo@montague.net/orchard' to='shakespeare.lit' id='items1'> <query xmlns='http://jabber.org/protocol/disco#items'/> </iq> Example 11. Result-set for all items <iq type='result' from='shakespeare.lit' to='romeo@montague.net/orchard' id='items1'> <query xmlns='http://jabber.org/protocol/disco#items'> <item jid='people.shakespeare.lit' name='Directory of Characters'/> <item jid='plays.shakespeare.lit' name='Play-Specific Chatrooms'/> <item jid='mim.shakespeare.lit' name='Gateway to Marlowe IM'/> <item jid='words.shakespeare.lit' name='Shakespearean Lexicon'/> <item jid='globe.shakespeare.lit' name='Calendar of Performances'/> <item jid='headlines.shakespeare.lit' name='Latest Shakespearean News'/> <item jid='catalog.shakespeare.lit' name='Buy Shakespeare Stuff!'/> <item jid='en2fr.shakespeare.lit' name='French Translation Service'/> </query> </iq> */ /// <summary> /// Discovering the Items Associated with a Jabber Entity /// </summary> public class DiscoItemsIq : IQ { private DiscoItems m_DiscoItems = new DiscoItems(); public DiscoItemsIq() { base.Query = m_DiscoItems; this.GenerateId(); } public DiscoItemsIq(IqType type) : this() { this.Type = type; } public new DiscoItems Query { get { return m_DiscoItems; } } } }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/disco/DiscoItems.cs��������������������������������������0000644�0001750�0001750�00000006427�12204443225�025256� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.disco { /* Example 10. Requesting all items <iq type='get' from='romeo@montague.net/orchard' to='shakespeare.lit' id='items1'> <query xmlns='http://jabber.org/protocol/disco#items'/> </iq> Example 11. Result-set for all items <iq type='result' from='shakespeare.lit' to='romeo@montague.net/orchard' id='items1'> <query xmlns='http://jabber.org/protocol/disco#items'> <item jid='people.shakespeare.lit' name='Directory of Characters'/> <item jid='plays.shakespeare.lit' name='Play-Specific Chatrooms'/> <item jid='mim.shakespeare.lit' name='Gateway to Marlowe IM'/> <item jid='words.shakespeare.lit' name='Shakespearean Lexicon'/> <item jid='globe.shakespeare.lit' name='Calendar of Performances'/> <item jid='headlines.shakespeare.lit' name='Latest Shakespearean News'/> <item jid='catalog.shakespeare.lit' name='Buy Shakespeare Stuff!'/> <item jid='en2fr.shakespeare.lit' name='French Translation Service'/> </query> </iq> Example 12. Empty result set <iq type='result' from='shakespeare.lit' to='romeo@montague.net/orchard' id='items1'> <query xmlns='http://jabber.org/protocol/disco#items'/> </iq> */ /// <summary> /// Discovering the Items Associated with a Jabber Entity /// </summary> public class DiscoItems : IQ { public DiscoItems() { this.TagName = "query"; this.Namespace = Uri.DISCO_ITEMS; } /// <summary> /// The node to discover (Optional) /// </summary> public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } public DiscoItem AddDiscoItem() { DiscoItem item = new DiscoItem(); AddChild(item); return item; } public void AddDiscoItem(DiscoItem item) { AddChild(item); } public DiscoItem[] GetDiscoItems() { ElementList nl = SelectElements(typeof(DiscoItem)); DiscoItem[] items = new DiscoItem[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (DiscoItem) e; i++; } return items; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/disco/DiscoManager.cs������������������������������������0000644�0001750�0001750�00000014763�12250206660�025552� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; using agsXMPP.protocol.iq.disco; namespace agsXMPP.protocol.iq.disco { public class DiscoManager { private XmppClientConnection xmppConnection = null; /// <summary> /// Constructor /// </summary> /// <param name="con"></param> public DiscoManager(XmppClientConnection con) { xmppConnection = con; xmppConnection.OnIq += new IqHandler(OnIq); } #region << Properties >> private bool m_AutoAnswerDiscoInfoRequests = true; /// <summary> /// Automatically answer DiscoInfo requests. /// Set disco information (identties and features) in the DiscoInfo property object. /// </summary> public bool AutoAnswerDiscoInfoRequests { get { return m_AutoAnswerDiscoInfoRequests; } set { m_AutoAnswerDiscoInfoRequests = value; } } #endregion private void OnIq(object sender, IQEventArgs e) { // DiscoInfo if (m_AutoAnswerDiscoInfoRequests && e.IQ.Query is DiscoInfo && e.IQ.Type == IqType.get) { e.Handled = true; ProcessDiscoInfo(e.IQ); } } private void ProcessDiscoInfo(IQ iq) { IQ diiq = new IQ(); diiq.To = iq.From; diiq.Id = iq.Id; diiq.Type = IqType.result; diiq.Query = xmppConnection.DiscoInfo; xmppConnection.Send(diiq); } #region << Discover Info >> public void DiscoverInformation(Jid to) { DiscoverInformation(to, null, null, null); } public void DiscoverInformation(Jid to, Jid from) { DiscoverInformation(to, from, null, null); } public void DiscoverInformation(Jid to, IqHandler cb) { DiscoverInformation(to, null, null, cb); } public void DiscoverInformation(Jid to, Jid from, IqHandler cb) { DiscoverInformation(to, from, null, cb); } public void DiscoverInformation(Jid to, string node) { DiscoverInformation(to, null, node, null); } public void DiscoverInformation(Jid to, Jid from, string node) { DiscoverInformation(to, from, node, null); } public void DiscoverInformation(Jid to, string node, IqHandler cb) { DiscoverInformation(to, null, node, cb); } public void DiscoverInformation(Jid to, Jid from, string node, IqHandler cb) { /* Example 9. Querying a specific JID and node combination <iq type='get' from='romeo@montague.net/orchard' to='mim.shakespeare.lit' id='info3'> <query xmlns='http://jabber.org/protocol/disco#info' node='http://jabber.org/protocol/commands'/> </iq> Example 10. JID+node result <iq type='result' from='mim.shakespeare.lit' to='romeo@montague.net/orchard' id='info3'> <query xmlns='http://jabber.org/protocol/disco#info' node='http://jabber.org/protocol/commands'> <identity category='automation' type='command-list'/> </query> </iq> */ DiscoInfoIq discoIq = new DiscoInfoIq(IqType.get); discoIq.To = to; if (from != null) discoIq.From = from; if (node != null && node.Length > 0) discoIq.Query.Node = node; xmppConnection.IqGrabber.SendIq(discoIq, cb); } #endregion #region << Discover Items >> public void DiscoverItems(Jid to) { DiscoverItems(to, null, null, null); } public void DiscoverItems(Jid to, Jid from) { DiscoverItems(to, from, null, null); } public void DiscoverItems(Jid to, IqHandler cb) { DiscoverItems(to, null, null, cb); } public void DiscoverItems(Jid to, Jid from, IqHandler cb) { DiscoverItems(to, from, null, cb); } public void DiscoverItems(Jid to, string node) { DiscoverItems(to, null, node, null); } public void DiscoverItems(Jid to, Jid from, string node) { DiscoverItems(to, from, node, null); } public void DiscoverItems(Jid to, string node, IqHandler cb) { DiscoverItems(to, null, node, cb); } public void DiscoverItems(Jid to, Jid from, string node, IqHandler cb) { DiscoItemsIq discoIq = new DiscoItemsIq(IqType.get); discoIq.To = to; if (from != null) discoIq.From = from; if (node != null && node.Length > 0) discoIq.Query.Node = node; xmppConnection.IqGrabber.SendIq(discoIq, cb); } #endregion } }�������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/disco/DiscoIdentity.cs�����������������������������������0000644�0001750�0001750�00000006003�12204443225�025754� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.disco { /* <iq type='result' from='plays.shakespeare.lit' to='romeo@montague.net/orchard' id='info1'> <query xmlns='http://jabber.org/protocol/disco#info'> <identity category='conference' type='text' name='Play-Specific Chatrooms'/> <identity category='directory' type='chatroom' name='Play-Specific Chatrooms'/> <feature var='http://jabber.org/protocol/disco#info'/> <feature var='http://jabber.org/protocol/disco#items'/> <feature var='http://jabber.org/protocol/muc'/> <feature var='jabber:iq:register'/> <feature var='jabber:iq:search'/> <feature var='jabber:iq:time'/> <feature var='jabber:iq:version'/> </query> </iq> */ /// <summary> /// Summary description for DiscoIdentity. /// </summary> public class DiscoIdentity : Element { public DiscoIdentity() { this.TagName = "identity"; this.Namespace = Uri.DISCO_INFO; } public DiscoIdentity(string type, string name, string category) : this() { Type = type; Name = name; Category = category; } public DiscoIdentity(string type, string category) : this() { Type = type; Category = category; } /// <summary> /// type name for the entity /// </summary> public string Type { get { return GetAttribute("type"); } set { SetAttribute("type", value); } } /// <summary> /// natural-language name for the entity /// </summary> public string Name { get { return GetAttribute("name"); } set { SetAttribute("name", value); } } /// <summary> /// category name for the entity /// </summary> public string Category { get { return GetAttribute("category"); } set { SetAttribute("category", value); } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/disco/DiscoFeature.cs������������������������������������0000644�0001750�0001750�00000005252�12204443225�025563� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.disco { /// <summary> /// Disco feature /// </summary> /// <remarks> /// see: http://www.jabber.org/registrar/disco-features.html /// </remarks> public class DiscoFeature : Element { /* <iq type='result' from='plays.shakespeare.lit' to='romeo@montague.net/orchard' id='info1'> <query xmlns='http://jabber.org/protocol/disco#info'> <identity category='conference' type='text' name='Play-Specific Chatrooms'/> <identity category='directory' type='chatroom' name='Play-Specific Chatrooms'/> <feature var='http://jabber.org/protocol/disco#info'/> <feature var='http://jabber.org/protocol/disco#items'/> <feature var='http://jabber.org/protocol/muc'/> <feature var='jabber:iq:register'/> <feature var='jabber:iq:search'/> <feature var='jabber:iq:time'/> <feature var='jabber:iq:version'/> </query> </iq> */ #region << Constructors >> public DiscoFeature() { this.TagName = "feature"; this.Namespace = Uri.DISCO_INFO; } public DiscoFeature(string var) : this() { Var = var; } #endregion /// <summary> /// feature name or namespace /// </summary> public string Var { get { return GetAttribute("var"); } set { SetAttribute("var", value); } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/roster/��������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�023070� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/roster/Delimiter.cs��������������������������������������0000644�0001750�0001750�00000004055�12204443225�025341� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.roster { /// <summary> /// Extension JEP-0083, delimiter for nested roster groups /// </summary> public class Delimiter : Element { /* 3.1 Querying for the delimiter All compliant clients SHOULD query for an existing delimiter at login. Example 1. Querying for the Delimiter CLIENT: CLIENT: <iq type='get' id='1'> <query xmlns='jabber:iq:private'> <roster xmlns='roster:delimiter'/> </query> </iq> SERVER: <iq type='result' id='1' from='bill@shakespeare.lit/Globe' to='bill@shakespeare.lit/Globe'> <query xmlns='jabber:iq:private'> <roster xmlns='roster:delimiter'>::</roster> </query> </iq> */ public Delimiter() { this.TagName = "roster"; this.Namespace = Uri.ROSTER_DELIMITER; } public Delimiter(string delimiter) : this() { this.Value = delimiter; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/roster/Roster.cs�����������������������������������������0000644�0001750�0001750�00000003542�12204443225�024701� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.roster { /// <summary> /// Zusammenfassung fr Roster. /// </summary> public class Roster : Element { // Request Roster: // <iq id='someid' to='myjabber.net' type='get'> // <query xmlns='jabber:iq:roster'/> // </iq> public Roster() { this.TagName = "query"; this.Namespace = Uri.IQ_ROSTER; } public RosterItem[] GetRoster() { ElementList nl = SelectElements(typeof(RosterItem)); int i = 0; RosterItem[] result = new RosterItem[nl.Count]; foreach (RosterItem ri in nl) { result[i] = (RosterItem) ri; i++; } return result; } public void AddRosterItem(RosterItem r) { this.ChildNodes.Add(r); } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/roster/RosterIq.cs���������������������������������������0000644�0001750�0001750�00000003307�12204443225�025172� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol; using agsXMPP.protocol.client; // Request Roster: // <iq id='someid' to='myjabber.net' type='get'> // <query xmlns='jabber:iq:roster'/> // </iq> namespace agsXMPP.protocol.iq.roster { /// <summary> /// Build a new roster query, jabber:iq:roster /// </summary> public class RosterIq : IQ { private Roster m_Roster = new Roster(); public RosterIq() { base.Query = m_Roster; this.GenerateId(); } public RosterIq(IqType type) : this() { this.Type = type; } public new Roster Query { get { return m_Roster; } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/roster/RosterItem.cs�������������������������������������0000644�0001750�0001750�00000007064�12204443225�025523� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.Base; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.roster { // jabber:iq:roster // <iq from="user@server.com/Office" id="doroster_1" type="result"> // <query xmlns="jabber:iq:roster"> // <item subscription="both" name="juiliet" jid="11111@icq.myjabber.net"><group>ICQ</group></item> // <item subscription="both" name="roman" jid="22222@icq.myjabber.net"><group>ICQ</group></item> // <item subscription="both" name="angie" jid="33333@icq.myjabber.net"><group>ICQ</group></item> // <item subscription="both" name="bob" jid="44444@icq.myjabber.net"><group>ICQ</group></item> // </query> // </iq> // # "none" -- the user does not have a subscription to the contact's presence information, and the contact does not have a subscription to the user's presence information // # "to" -- the user has a subscription to the contact's presence information, but the contact does not have a subscription to the user's presence information // # "from" -- the contact has a subscription to the user's presence information, but the user does not have a subscription to the contact's presence information // # "both" -- both the user and the contact have subscriptions to each other's presence information // TODO rename to Ask and move to a seperate file, so it matches better to all other enums public enum AskType { NONE = -1, subscribe, unsubscribe } // TODO rename to Subscription and move to a seperate file, so it matches better to all other enums public enum SubscriptionType { none, to, from, both, remove } /// <summary> /// Item is used in jabber:iq:roster, jabber:iq:search /// </summary> public class RosterItem : agsXMPP.protocol.Base.RosterItem { public RosterItem() : base() { this.Namespace = Uri.IQ_ROSTER; } public RosterItem(Jid jid) : this() { Jid = jid; } public RosterItem(Jid jid, string name) : this(jid) { Name = name; } public SubscriptionType Subscription { get { return (SubscriptionType) GetAttributeEnum("subscription", typeof(SubscriptionType)); } set { SetAttribute("subscription", value.ToString()); } } public AskType Ask { get { return (AskType) GetAttributeEnum("ask", typeof(AskType)); } set { if (value == AskType.NONE) RemoveAttribute("ask"); else SetAttribute("ask", value.ToString()); } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/roster/RosterManager.cs����������������������������������0000644�0001750�0001750�00000013370�12204443225�026174� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.roster { /// <summary> /// Helper class that makes it easier to manage your contact list. /// </summary> public class RosterManager { private readonly XmppClientConnection m_connection; #region << Constructors >> /// <summary> /// Constructor /// </summary> /// <param name="con">The XmppClientConnection on which the RosterManager should send the packets</param> public RosterManager(XmppClientConnection con) { m_connection = con; } #endregion #region << Add Contact >> /// <summary> /// Add a contact to the Roster /// </summary> /// <param name="jid">The BARE jid of the rosteritem that should be removed</param> public void AddRosterItem(Jid jid) { AddRosterItem(jid, null, new string[] {}); } /// <summary> /// Add a contact to the Roster /// </summary> /// <param name="jid">The BARE jid of the contact that should be added.</param> /// <param name="nickname">Nickname for the new contact.</param> public void AddRosterItem(Jid jid, string nickname) { AddRosterItem(jid, nickname, new string[] {}); } /// <summary> /// Add a contact to the Roster /// </summary> /// <param name="jid">The BARE jid of the contact that should be added.</param> /// <param name="nickname">Nickname for the new contact.</param> /// <param name="group">The group to which the contact should be added.</param> public void AddRosterItem(Jid jid, string nickname, string group) { AddRosterItem(jid, nickname, new string[] {group}); } /// <summary> /// Add a contact to the Roster. /// </summary> /// <param name="jid">The BARE jid of the contact that should be added.</param> /// <param name="nickname">Nickname for the contact.</param> /// <param name="group">An Array of groups when you want to add the contact to multiple groups.</param> public void AddRosterItem(Jid jid, string nickname, string[] group) { RosterIq riq = new RosterIq(); riq.Type = IqType.set; RosterItem ri = new RosterItem(); ri.Jid = jid; if (nickname != null) ri.Name = nickname; foreach (string g in group) { ri.AddGroup(g); } riq.Query.AddRosterItem(ri); m_connection.Send(riq); } #endregion #region << Update contact >> /// <summary> /// Update a contact /// </summary> /// <param name="jid"></param> public void UpdateRosterItem(Jid jid) { AddRosterItem(jid, null, new string[] { }); } /// <summary> /// Update a contact /// </summary> /// <param name="jid">The BARE jid of the contact that should be updated.</param> /// <param name="nickname">Nickname for the contact to update.</param> public void UpdateRosterItem(Jid jid, string nickname) { AddRosterItem(jid, nickname, new string[] { }); } /// <summary> /// Update a contact /// </summary> /// <param name="jid"></param> /// <param name="nickname"></param> /// <param name="group"></param> public void UpdateRosterItem(Jid jid, string nickname, string group) { AddRosterItem(jid, nickname, new string[] { group }); } /// <summary> /// Update a contact. /// </summary> /// <param name="jid">The BARE jid of the contact that should be updated.</param> /// <param name="nickname">Nickname for the contact to update.</param> /// <param name="group">An Array of groups when you want to add the contact to multiple groups.</param> public void UpdateRosterItem(Jid jid, string nickname, string[] group) { AddRosterItem(jid, nickname, group); } #endregion #region << Remove Contact >> /// <summary> /// Removes a contact from the Roster /// </summary> /// <param name="jid">The BARE jid of the rosteritem that should be removed</param> public void RemoveRosterItem(Jid jid) { RosterIq riq = new RosterIq(); riq.Type = IqType.set; RosterItem ri = new RosterItem(); ri.Jid = jid; ri.Subscription = SubscriptionType.remove; riq.Query.AddRosterItem(ri); m_connection.Send(riq); } #endregion } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/oob/�����������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�022331� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/oob/Oob.cs�����������������������������������������������0000644�0001750�0001750�00000003535�12204443225�023405� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.oob { // <iq type="set" to="horatio@denmark" from="sailor@sea" id="i_oob_001"> // <query xmlns="jabber:iq:oob"> // <url>http://denmark/act4/letter-1.html</url> // <desc>There's a letter for you sir.</desc> // </query> // </iq> /// <summary> /// Zusammenfassung fr Oob. /// </summary> public class Oob : Element { public Oob() { this.TagName = "query"; this.Namespace = Uri.IQ_OOB; } public string Url { set { SetTag("url", value); } get { return GetTag("url"); } } public string Description { set { SetTag("desc", value); } get { return GetTag("desc"); } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/oob/OobIq.cs���������������������������������������������0000644�0001750�0001750�00000003301�12204443225�023666� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.oob { /// <summary> /// Summary description for OobIq. /// </summary> public class OobIq : IQ { private Oob m_Oob = new Oob(); public OobIq() { base.Query = m_Oob; this.GenerateId(); } public OobIq(IqType type) : this() { this.Type = type; } public OobIq(IqType type, Jid to) : this(type) { this.To = to; } public OobIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Oob Query { get { return m_Oob; } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/avatar/��������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�023030� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/avatar/AvatarIq.cs���������������������������������������0000644�0001750�0001750�00000003360�12204443225�025071� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.avatar { /// <summary> /// Summary description for AvatarIq. /// </summary> public class AvatarIq : IQ { private Avatar m_Avatar = new Avatar(); public AvatarIq() { base.Query = m_Avatar; this.GenerateId(); } public AvatarIq(IqType type) : this() { this.Type = type; } public AvatarIq(IqType type, Jid to) : this(type) { this.To = to; } public AvatarIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Avatar Query { get { return m_Avatar; } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/avatar/Avatar.cs�����������������������������������������0000644�0001750�0001750�00000003067�12204443225�024603� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.avatar { // <iq id='2' type='result' to='user@server/resource'> // <query xmlns='jabber:iq:avatar'> // <data mimetype='image/jpeg'> // Base64-Encoded Data // </data> // </query> // </iq> /// <summary> /// Summary description for Avatar. /// </summary> public class Avatar : agsXMPP.protocol.Base.Avatar { public Avatar() : base() { this.Namespace = Uri.IQ_AVATAR; } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/last/����������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�022515� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/last/Last.cs���������������������������������������������0000644�0001750�0001750�00000003552�12204443225�023754� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; // Send: <iq type='get' id='MX_5' to='jfrankel@coversant.net/SoapBox'> // <query xmlns='jabber:iq:last'></query> // </iq> // Recv: <iq from="jfrankel@coversant.net/SoapBox" id="MX_5" to="gnauck@myjabber.net/Office" type="result"> // <query seconds="644" xmlns="jabber:iq:last"/> // </iq> namespace agsXMPP.protocol.iq.last { /// <summary> /// Zusammenfassung fr Last. /// </summary> public class Last : Element { public Last() { this.TagName = "query"; this.Namespace = Uri.IQ_LAST; } /// <summary> /// Seconds since the last activity. /// </summary> public int Seconds { get { return Int32.Parse(GetAttribute("seconds")); } set { SetAttribute("seconds", value.ToString()); } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/last/LastIq.cs�������������������������������������������0000644�0001750�0001750�00000003320�12204443225�024237� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.last { /// <summary> /// Summary description for LastIq. /// </summary> public class LastIq : IQ { private Last m_Last = new Last(); public LastIq() { base.Query = m_Last; this.GenerateId(); } public LastIq(IqType type) : this() { this.Type = type; } public LastIq(IqType type, Jid to) : this(type) { this.To = to; } public LastIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Last Query { get { return m_Last; } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/rpc/�����������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�022336� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/rpc/Rpc.cs�����������������������������������������������0000644�0001750�0001750�00000006143�12204443225�023415� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.rpc { /* Example 1. A typical request <iq type='set' to='responder@company-a.com/jrpc-server' id='1'> <query xmlns='jabber:iq:rpc'> <methodCall> <methodName>examples.getStateName</methodName> <params> <param> <value><i4>6</i4></value> </param> </params> </methodCall> </query> </iq> Example 2. A typical response <iq type='result' to='requester@company-b.com/jrpc-client' from='responder@company-a.com/jrpc-server' id='1'> <query xmlns='jabber:iq:rpc'> <methodResponse> <params> <param> <value><string>Colorado</string></value> </param> </params> </methodResponse> </query> </iq> */ /// <summary> /// JEP-0009: Jabber-RPC, transport RPC over Jabber/XMPP /// </summary> public class Rpc : Element { public Rpc() { TagName = "query"; Namespace = Uri.IQ_RPC; } /// <summary> /// /// </summary> public MethodCall MethodCall { get { return (MethodCall)SelectSingleElement(typeof(MethodCall)); } set { RemoveTag(typeof(MethodCall)); if (value != null) AddChild(value); } } /// <summary> /// /// </summary> public MethodResponse MethodResponse { get { return (MethodResponse)SelectSingleElement(typeof(MethodResponse)); } set { RemoveTag(typeof(MethodResponse)); if (value != null) AddChild(value); } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/rpc/MethodResponse.cs������������������������������������0000644�0001750�0001750�00000017753�12204443225�025641� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections; using System.Globalization; using agsXMPP.Exceptions; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.rpc { /// <summary> /// The method Response element. /// </summary> public class MethodResponse : Element { /* <methodResponse> <fault> <value> <struct> <member> <name>faultCode</name> <value><int>4</int></value> </member> <member> <name>faultString</name> <value><string>Too many parameters.</string></value> </member> </struct> </value> </fault> </methodResponse> */ public MethodResponse() { TagName = "methodResponse"; Namespace = Uri.IQ_RPC; } public void WriteResponse(ArrayList Params) { // remove this tag if exists, in case this function gets // calles multiple times by some guys RemoveTag("params"); var elParams = RpcHelper.WriteParams(Params); if (elParams != null) AddChild(elParams); } /// <summary> /// Parses the XML-RPC resonse and returns an ArrayList with all Parameters. /// In there is an XML-RPC Error it returns an XmlRpcException as single parameter in the ArrayList. /// </summary> /// <returns>Arraylist with parameters, or Arraylist with an exception</returns> public ArrayList GetResponse() { return ParseResponse(); } /// <summary> /// parse the response /// </summary> /// <returns></returns> private ArrayList ParseResponse() { ArrayList al = new ArrayList(); // If an error occurred, the server will return fault Element fault = SelectSingleElement("fault"); if (fault != null) { Hashtable ht = ParseStruct(fault.SelectSingleElement("struct", true)); al.Add(new XmlRpcException((int) ht["faultCode"], (string) ht["faultString"])); } else { Element elParams = SelectSingleElement("params"); ElementList nl = elParams.SelectElements("param"); foreach (Element p in nl) { Element value = p.SelectSingleElement("value"); if (value != null) al.Add(ParseValue(value)); } } return al; } /// <summary> /// Parse a single response value /// </summary> /// <param name="value"></param> /// <returns></returns> private object ParseValue(Element value) { object result = null; if (value != null) { if (value.HasChildElements) { Element next = value.FirstChild; if (next.TagName == "string") result = next.Value; else if (next.TagName == "boolean") result = next.Value == "1"; else if (next.TagName == "i4") result = Int32.Parse(next.Value); else if (next.TagName == "int") // occurs in fault result = int.Parse(next.Value); else if (next.TagName == "double") { NumberFormatInfo numberInfo = new NumberFormatInfo(); numberInfo.NumberDecimalSeparator = "."; result = Double.Parse(next.Value, numberInfo); } else if (next.TagName == "dateTime.iso8601") result = Util.Time.ISO_8601Date(next.Value); else if (next.TagName == "base64") result = Convert.FromBase64String(next.Value); else if (next.TagName == "struct") result = ParseStruct(next); else if (next.TagName == "array") result = ParseArray(next); } else { result = value.Value; } } return result; } /// <summary> /// parse a response array /// </summary> /// <param name="elArray"></param> /// <returns></returns> private ArrayList ParseArray(Element elArray) { //<array> // <data> // <value><string>one</string></value> // <value><string>two</string></value> // <value><string>three</string></value> // <value><string>four</string></value> // <value><string>five</string></value> // </data> //</array> Element data = elArray.SelectSingleElement("data"); if (data != null) { ArrayList al = new ArrayList(); ElementList values = data.SelectElements("value"); foreach (Element val in values) { al.Add(ParseValue(val)); } return al; } return null; } /// <summary> /// parse a response struct /// </summary> /// <param name="el"></param> /// <returns></returns> private Hashtable ParseStruct(Element el) { //<struct> // <member> // <name>x</name> // <value><i4>20</i4></value> // </member> // <member> // <name>y</name> // <value><string>cow</string></value> // </member> // <member> // <name>z</name> // <value><double>3,14</double></value> // </member> //</struct> Hashtable ht = new Hashtable(); ElementList members = el.SelectElements("member"); foreach (Element member in members) { string name = member.GetTag("name"); // parse this member value Element value = member.SelectSingleElement("value"); if (value != null) ht[name] = ParseValue(value); } return ht; } } } ���������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/rpc/RpcIq.cs���������������������������������������������0000644�0001750�0001750�00000003556�12204443225�023714� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.rpc { /// <summary> /// RpcIq. /// </summary> public class RpcIq : IQ { private Rpc m_Rpc = new Rpc(); public RpcIq() { base.Query = m_Rpc; this.GenerateId(); } public RpcIq(IqType type) : this() { this.Type = type; } public RpcIq(IqType type, Jid to) : this(type) { this.To = to; } public RpcIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Rpc Query { get { return m_Rpc; } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/rpc/MethodCall.cs����������������������������������������0000644�0001750�0001750�00000005534�12204443225�024710� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System.Collections; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.rpc { /// <summary> /// The methodCall element. /// </summary> public class MethodCall : Element { /* <methodCall> <methodName>examples.getStateName</methodName> <params> <param><value><i4>41</i4></value></param> </params> </methodCall> */ /// <summary> /// /// </summary> public MethodCall() { TagName = "methodCall"; Namespace = Uri.IQ_RPC; } /// <summary> /// /// </summary> /// <param name="methodName"></param> /// <param name="Params"></param> public MethodCall(string methodName, ArrayList Params) : this() { WriteCall(methodName, Params); } /// <summary> /// /// </summary> public string MethodName { set { SetTag("methodName", value); } get { return GetTag("methodName"); } } /// <summary> /// Write the functions call with params to this Element /// </summary> /// <param name="name"></param> /// <param name="Params"></param> public void WriteCall(string name, ArrayList Params) { MethodName = name; // remove this tag if exists, in case this function gets // calles multiple times by some guys RemoveTag("params"); var elParams = RpcHelper.WriteParams(Params); if (elParams != null) AddChild(elParams); } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/rpc/RpcHelper.cs�����������������������������������������0000644�0001750�0001750�00000010120�12204443225�024543� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������using System; using System.Collections; using System.Globalization; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.rpc { internal class RpcHelper { public static Element WriteParams(ArrayList Params) { if (Params != null && Params.Count > 0) { Element elParams = new Element("params"); for (int i = 0; i < Params.Count; i++) { Element param = new Element("param"); WriteValue(Params[i], param); elParams.AddChild(param); } return elParams; } return null; } /// <summary> /// Writes a single value to a call /// </summary> /// <param name="param"></param> /// <param name="parent"></param> public static void WriteValue(object param, Element parent) { Element value = new Element("value"); if (param is String) { value.AddChild(new Element("string", param as string)); } else if (param is Int32) { value.AddChild(new Element("i4", ((Int32)param).ToString())); } else if (param is Double) { NumberFormatInfo numberInfo = new NumberFormatInfo(); numberInfo.NumberDecimalSeparator = "."; //numberInfo.NumberGroupSeparator = ","; value.AddChild(new Element("double", ((Double)param).ToString(numberInfo))); } else if (param is Boolean) { value.AddChild(new Element("boolean", ((bool)param) ? "1" : "0")); } // XML-RPC dates are formatted in iso8601 standard, same as xmpp, else if (param is DateTime) { value.AddChild(new Element("dateTime.iso8601", Util.Time.ISO_8601Date((DateTime)param))); } // byte arrays must be encoded in Base64 encoding else if (param is byte[]) { byte[] b = (byte[])param; value.AddChild(new Element("base64", Convert.ToBase64String(b, 0, b.Length))); } // Arraylist maps to an XML-RPC array else if (param is ArrayList) { //<array> // <data> // <value> <string>one</string> </value> // <value> <string>two</string> </value> // <value> <string>three</string></value> // </data> //</array> Element array = new Element("array"); Element data = new Element("data"); ArrayList list = param as ArrayList; for (int i = 0; i < list.Count; i++) { WriteValue(list[i], data); } array.AddChild(data); value.AddChild(array); } // java.util.Hashtable maps to an XML-RPC struct else if (param is Hashtable) { Element elStruct = new Element("struct"); Hashtable ht = (Hashtable)param; IEnumerator myEnumerator = ht.Keys.GetEnumerator(); while (myEnumerator.MoveNext()) { Element member = new Element("member"); object key = myEnumerator.Current; if (key != null) { member.AddChild(new Element("name", key.ToString())); WriteValue(ht[key], member); } elStruct.AddChild(member); } value.AddChild(elStruct); } /* else { // Unknown Type } */ parent.AddChild(value); } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/browse/��������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�023053� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/browse/BrowseItem.cs�������������������������������������0000644�0001750�0001750�00000004526�12204443225�025471� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.browse { /// <summary> /// Summary description for BrowseItem. /// </summary> public class BrowseItem : agsXMPP.protocol.Base.Item { /* <item version="0.6.0" name="Public Conferencing" jid="conference.myjabber.net" type="public" category="conference"> <ns>http://jabber.org/protocol/muc</ns> </item> */ public BrowseItem() : base() { this.Namespace = Uri.IQ_BROWSE; } public string Category { get { return GetAttribute("category"); } set { SetAttribute("category", value); } } public string Version { get { return GetAttribute("version"); } set { SetAttribute("version", value); } } public string Type { get { return GetAttribute("type"); } set { SetAttribute("type", value); } } /// <summary> /// Gets all advertised namespaces of this item /// </summary> /// <returns>string array that contains the advertised namespaces</returns> public string[] GetNamespaces() { ElementList elements = SelectElements("ns"); string[] nss = new string[elements.Count]; int i=0; foreach (Element ns in elements) { nss[i] = ns.Value; i++; } return nss; } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/browse/BrowseIq.cs���������������������������������������0000644�0001750�0001750�00000003353�12204443225�025141� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.browse { /// <summary> /// Summary description for BrowseIq. /// </summary> public class BrowseIq : IQ { private Browse m_Browse = new Browse(); public BrowseIq() { base.Query = m_Browse; this.GenerateId(); } public BrowseIq(IqType type) : this() { this.Type = type; } public BrowseIq(IqType type, Jid to) : this(type) { this.To = to; } public BrowseIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Browse Query { get { return m_Browse; } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/browse/Service.cs����������������������������������������0000644�0001750�0001750�00000011505�12204443225�025004� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.browse { /// <summary> /// Historically each category was used as the name of an element, /// and the type was an attribute, such as <service type="aim"/>. /// The proper expression for all new implementations supporting this specification is to express the type information /// as attributes on a generic item element: <item category="service" type="aim"/>. /// When processing returned browse information this new syntax should always be handled first, /// and the old syntax only used if it is important to be able to access older implementations. /// Additional unofficial categories or types may be specified by prefixing their name with /// an "x-", such as "service/x-virgeim" or "x-location/gps". /// Changes to the official categories and subtypes may be defined either by revising this JEP or by activating another JEP. /// Removal of a category or subtype must be noted in this document. /// </summary> public class Service : Element { /* <iq from="myjabber.net" xmlns="jabber:client" id="agsXMPP_5" type="result" to="gnauck@myjabber.net/myJabber v3.5"> <service name="myJabber Server" jid="myjabber.net" type="jabber" xmlns="jabber:iq:browse"> <item version="0.6.0" name="Public Conferencing" jid="conference.myjabber.net" type="public" category="conference"> <ns>http://jabber.org/protocol/muc</ns> </item> <service name="AIM Transport" jid="aim.myjabber.net" type="aim"> <ns>jabber:iq:gateway</ns> <ns>jabber:iq:register</ns> </service> <service name="Yahoo! Transport" jid="yahoo.myjabber.net" type="yahoo"> <ns>jabber:iq:gateway</ns> <ns>jabber:iq:register</ns> </service> <service name="ICQ Transport" jid="icq.myjabber.net" type="icq"> <ns>jabber:iq:gateway</ns> <ns>jabber:iq:register</ns> </service> <service name="MSN Transport" jid="msn.myjabber.net" type="msn"> <ns>jabber:iq:gateway</ns> <ns>jabber:iq:register</ns> </service> <item name="Online Users" jid="myjabber.net/admin"/> <ns>jabber:iq:admin</ns> </service> </iq> */ public Service() { this.TagName = "service"; this.Namespace = Uri.IQ_BROWSE; } public string Name { get { return GetAttribute("name"); } set { SetAttribute("name", value); } } public Jid Jid { get { return new Jid(GetAttribute("jid")); } set { SetAttribute("jid", value.ToString()); } } public string Type { get { return GetAttribute("type"); } set { SetAttribute("type", value); } } /// <summary> /// Gets all advertised namespaces of this service /// </summary> /// <returns>string array that contains the advertised namespaces</returns> public string[] GetNamespaces() { ElementList elements = SelectElements("ns"); string[] nss = new string[elements.Count]; int i=0; foreach (Element ns in elements) { nss[i] = ns.Value; i++; } return nss; } public BrowseItem[] GetItems() { ElementList nl = SelectElements(typeof(BrowseItem)); BrowseItem[] items = new BrowseItem[nl.Count]; int i = 0; foreach (Element item in nl) { items[i] = item as BrowseItem; i++; } return items; } /// <summary> /// Gets all "ChilsServices" od this service /// </summary> /// <returns></returns> public Service[] GetServices() { ElementList nl = SelectElements(typeof(Service)); Service[] Services = new Service[nl.Count]; int i = 0; foreach (Element service in nl) { Services[i] = service as Service; i++; } return Services; } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/browse/Browse.cs�����������������������������������������0000644�0001750�0001750�00000005620�12204443225�024646� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; // JEP-0011: Jabber Browsing // // This JEP defines a way to describe information about Jabber entities and the relationships between entities. // Note: This JEP is superseded by JEP-0030: Service Discovery. // WARNING: This JEP has been deprecated by the Jabber Software Foundation. // Implementation of the protocol described herein is not recommended. Developers desiring similar functionality should // implement the protocol that supersedes this one (if any). // Most components and gateways still dont implement Service discovery. So we must use jabber:iq:browse for them until everything // is replaced with JEP 30 (Service Discovery). namespace agsXMPP.protocol.iq.browse { /// <summary> /// Summary description for Browse. /// </summary> public class Browse : Element { public Browse() { this.TagName = "query"; this.Namespace = Uri.IQ_BROWSE; } public string Category { get { return GetAttribute("category"); } set { SetAttribute("category", value); } } public string Type { get { return GetAttribute("type"); } set { SetAttribute("type", value); } } public string Name { get { return GetAttribute("name"); } set { SetAttribute("name", value); } } public string[] GetNamespaces() { ElementList elements = SelectElements("ns"); string[] nss = new string[elements.Count]; int i=0; foreach (Element ns in elements) { nss[i] = ns.Value; i++; } return nss; } public BrowseItem[] GetItems() { ElementList nl = SelectElements(typeof(BrowseItem)); BrowseItem[] items = new BrowseItem[nl.Count]; int i = 0; foreach (Element item in nl) { items[i] = item as BrowseItem; i++; } return items; } } } ����������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/vcard/���������������������������������������������������0000755�0001750�0001750�00000000000�12204443225�022651� 5����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/vcard/VcardIq.cs�����������������������������������������0000644�0001750�0001750�00000004336�12204443225�024537� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.vcard { //<iq id="id_62" to="gnauck@myjabber.net" type="get"><vCard xmlns="vcard-temp"/></iq> /// <summary> /// Summary description for VcardIq. /// </summary> public class VcardIq : IQ { private Vcard m_Vcard = new Vcard(); #region << Constructors >> public VcardIq() { this.GenerateId(); this.AddChild(m_Vcard); } public VcardIq(IqType type) : this() { this.Type = type; } public VcardIq(IqType type, Vcard vcard) : this(type) { this.Vcard = vcard; } public VcardIq(IqType type, Jid to) : this(type) { this.To = to; } public VcardIq(IqType type, Jid to, Vcard vcard) : this(type, to) { this.Vcard = vcard; } public VcardIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public VcardIq(IqType type, Jid to, Jid from, Vcard vcard) : this(type, to, from) { this.Vcard = vcard; } #endregion public override Vcard Vcard { get { return m_Vcard; } set { ReplaceChild(value); } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/vcard/Telephone.cs���������������������������������������0000644�0001750�0001750�00000004767�12204443225�025141� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.vcard { public enum TelephoneLocation { NONE = -1, HOME, WORK } public enum TelephoneType { NONE = -1, VOICE, FAX, PAGER, MSG, CELL, VIDEO, BBS, MODEM, ISDN, PCS, PREF, NUMBER } /// <summary> /// Zusammenfassung fr Telephone. /// </summary> public class Telephone : Element { // <TEL><VOICE/><WORK/><NUMBER>303-308-3282</NUMBER></TEL> // <TEL><FAX/><WORK/><NUMBER/></TEL> // <TEL><MSG/><WORK/><NUMBER/></TEL> #region << Constructors >> public Telephone() { this.TagName = "TEL"; this.Namespace = Uri.VCARD; } public Telephone(TelephoneLocation loc, TelephoneType type, string number) : this() { if(loc != TelephoneLocation.NONE) this.Location = loc; if(type != TelephoneType.NONE) this.Type = type; this.Number = number; } #endregion public string Number { get { return GetTag("NUMBER"); } set { SetTag("NUMBER", value); } } public TelephoneLocation Location { get { return (TelephoneLocation) HasTagEnum(typeof(TelephoneLocation)); } set { SetTag(value.ToString()); } } public TelephoneType Type { get { return (TelephoneType) HasTagEnum(typeof(TelephoneType)); } set { SetTag(value.ToString()); } } } } ���������smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/vcard/Vcard.cs�������������������������������������������0000644�0001750�0001750�00000021605�12204443225�024243� 0����������������������������������������������������������������������������������������������������ustar�00meebey��������������������������meebey��������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.IO; using agsXMPP.Xml.Dom; using agsXMPP.protocol.iq.vcard; // JEP-0054 // http://www.jabber.org/jeps/jep-0054.html // Example 2. Receiving One's Own vCard // // <iq // to='stpeter@jabber.org/Gabber' // type='result' // id='v1'> // <vCard xmlns='vcard-temp'> // <FN>Peter Saint-Andre</FN> // <N> // <FAMILY>Saint-Andre<FAMILY> // <GIVEN>Peter</GIVEN> // <MIDDLE/> // </N> // <NICKNAME>stpeter</NICKNAME> // <URL>http://www.jabber.org/people/stpeter.php</URL> // <BDAY>1966-08-06</BDAY> // <ORG> // <ORGNAME>Jabber Software Foundation</ORGNAME> // <ORGUNIT/> // </ORG> // <TITLE>Executive Director // Patron Saint // 303-308-3282 // // // // // Suite 600 // 1899 Wynkoop Street // Denver // CO // 80202 // USA // // 303-555-1212 // // // // // // // Denver // CO // 80209 // USA // // stpeter@jabber.org // stpeter@jabber.org // // More information about me is located on my // personal website: http://www.saint-andre.com/ // // // // namespace agsXMPP.protocol.iq.vcard { // // /// /// Summary description for Vcard. /// public class Vcard : Element { #region << Constructors >> public Vcard() { this.TagName = "vCard"; this.Namespace = Uri.VCARD; } #endregion /// /// /// public string Url { get { return GetTag("URL"); } set { SetTag("URL", value); } } /// /// /// public DateTime Birthday { get { try { string sDate = GetTag("BDAY"); if (sDate != null) return DateTime.Parse(sDate); else return DateTime.MinValue; } catch { return DateTime.MinValue; } } set { SetTag("BDAY", value.ToString("yyyy-MM-dd")); } } /// /// /// public string Title { get { return GetTag("TITLE"); } set { SetTag("TITLE", value); } } /// /// /// public string Role { get { return GetTag("ROLE"); } set { SetTag("ROLE", value); } } public string Fullname { get { return GetTag("FN"); } set { SetTag("FN", value); } } public string Nickname { get { return GetTag("NICKNAME"); } set { SetTag("NICKNAME", value); } } public Jid JabberId { get { return new Jid(GetTag("JABBERID")); } set { SetTag("JABBERID", value.ToString()); } } /// /// /// public string Description { get { return GetTag("DESC"); } set { SetTag("DESC", value); } } /// /// /// public Name Name { get { return SelectSingleElement(typeof(Name)) as Name; } set { Element n = SelectSingleElement(typeof(Name)); if (n != null) n.Remove(); AddChild(value); } } #if !CF /// /// a Photograph /// public Photo Photo { get { return SelectSingleElement(typeof(Photo)) as Photo; } set { Element p = SelectSingleElement(typeof(Photo)); if (p != null) p.Remove(); AddChild(value); } } #endif /// /// /// public Organization Organization { get { return SelectSingleElement(typeof(Organization)) as Organization; } set { Element org = SelectSingleElement(typeof(Organization)); if (org != null) org.Remove(); AddChild(value); } } /// /// /// /// public Address[] GetAddresses() { ElementList el = SelectElements(typeof(Address)); int i = 0; Address[] result = new Address[el.Count]; foreach (Address add in el) { result[i] = add; i++; } return result; } /// /// /// /// /// public Address GetAddress(AddressLocation loc) { foreach (Address adr in GetAddresses()) { if (adr.Location == loc) return adr; } return null; } public void AddAddress(Address addr) { Address a = GetAddress(addr.Location); if (a != null) a.Remove(); this.AddChild(addr); } public Address GetPreferedAddress() { foreach (Address adr in GetAddresses()) { if (adr.IsPrefered) return adr; } return null; } public Telephone[] GetTelephoneNumbers() { ElementList el = SelectElements(typeof(Telephone)); int i = 0; Telephone[] result = new Telephone[el.Count]; foreach (Telephone tel in el) { result[i] = tel; i++; } return result; } public Telephone GetTelephoneNumber(TelephoneType type, TelephoneLocation loc) { foreach (Telephone phone in GetTelephoneNumbers()) { if (phone.Type == type && phone.Location == loc) return phone; } return null; } public void AddTelephoneNumber(Telephone tel) { Telephone t = GetTelephoneNumber(tel.Type, tel.Location); if (t != null) t.Remove(); this.AddChild(tel); } /// /// Adds a new Email Adress object /// /// public void AddEmailAddress(Email mail) { Email e = GetEmailAddress(mail.Type); if (e != null) e.Remove(); this.AddChild(mail); } /// /// Get all Email addresses /// /// public Email[] GetEmailAddresses() { ElementList el = SelectElements(typeof(Email)); int i = 0; Email[] result = new Email[el.Count]; foreach (Email mail in el) { result[i] = mail; i++; } return result; } public Email GetEmailAddress(EmailType type) { foreach (Email email in GetEmailAddresses()) { if (email.Type == type) return email; } return null; } public Email GetPreferedEmailAddress() { foreach (Email email in GetEmailAddresses()) { if (email.IsPrefered) return email; } return null; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/vcard/Address.cs0000644000175000017500000000660012204443225024567 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.vcard { public enum AddressLocation { NONE = -1, HOME, WORK } /// /// /// public class Address : Element { // // // // // Suite 600 // 1899 Wynkoop Street // Denver // CO // 80202 // USA // public Address() { this.TagName = "ADR"; this.Namespace = Uri.VCARD; } public Address(AddressLocation loc, string extra, string street, string locality, string region, string postalcode, string country, bool prefered) : this() { Location = loc; ExtraAddress = extra; Street = street; Locality = locality; Region = region; PostalCode = postalcode; Country = country; IsPrefered = prefered; } public AddressLocation Location { get { return (AddressLocation) HasTagEnum(typeof(AddressLocation)); } set { SetTag(value.ToString()); } } public bool IsPrefered { get { return HasTag("PREF"); } set { if (value == true) SetTag("PREF"); else RemoveTag("PREF"); } } public string ExtraAddress { get { return GetTag("EXTADD"); } set { SetTag("EXTADD", value); } } public string Street { get { return GetTag("STREET"); } set { SetTag("STREET", value); } } public string Locality { get { return GetTag("LOCALITY"); } set { SetTag("LOCALITY", value); } } public string Region { get { return GetTag("REGION"); } set { SetTag("REGION", value); } } public string PostalCode { get { return GetTag("PCODE"); } set { SetTag("PCODE", value); } } public string Country { get { return GetTag("CTRY"); } set { SetTag("CTRY", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/vcard/Organization.cs0000644000175000017500000000346012204443225025647 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.vcard { /// /// /// public class Organization : Element { // // Jabber Software Foundation // // #region << Constructors >> public Organization() { this.TagName = "ORG"; this.Namespace = Uri.VCARD; } public Organization(string name, string unit) : this() { this.Name = name; this.Unit = unit; } #endregion public string Name { get { return GetTag("ORGNAME"); } set { SetTag("ORGNAME", value); } } public string Unit { get { return GetTag("ORGUNIT"); } set { SetTag("ORGUNIT", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/vcard/Photo.cs0000644000175000017500000001347312204443225024301 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if !CF using System; using System.IO; #if !SL using System.Drawing; using System.Drawing.Imaging; #endif using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.vcard { /// /// Vcard Photo /// When you dont want System.Drawing in the Lib just remove the photo stuff /// public class Photo : Element { // // #region << Constructors >> public Photo() { this.TagName = "PHOTO"; this.Namespace = Uri.VCARD; } #if !SL public Photo(Image image, ImageFormat format) : this() { SetImage(image, format); } #endif public Photo(string url) : this() { SetImage(url); } #endregion /// /// The Media Type, Only available when BINVAL /// public string Type { //image get { return GetTag("TYPE"); } set { SetTag("TYPE", value); } } /// /// Sets the URL of an external image /// /// public void SetImage(string url) { SetTag("EXTVAL", url); } /* /// /// Sets a internal Image /// /// public void SetImage(Image image) { Image = image; } */ #if !SL public void SetImage(Image image, ImageFormat format) { // if we have no FOrmatprovider then we save the image as PNG if (format == null) format = ImageFormat.Png; // 17.05.2006 // fixed GDI+ bug see also http://www.bobpowell.net/imagefileconvert.htm string sType = "image"; if (format == ImageFormat.Jpeg) sType = "image/jpeg"; else if (format == ImageFormat.Png) sType = "image/png"; else if (format == ImageFormat.Gif) sType = "image/gif"; #if!CF_2 else if (format == ImageFormat.Tiff) sType = "image/tiff"; #endif SetTag("TYPE", sType); //create temporary Image temp = new Bitmap(image.Width, image.Height); //get graphics Graphics g = Graphics.FromImage(temp); //copy image // i hope this overload of DrawImage works now on all Frameworks, also CF2 g.DrawImage(image, new Rectangle(0, 0, temp.Width, temp.Height), new Rectangle(0, 0, image.Width, image.Height), GraphicsUnit.Pixel); //g.DrawImage(image, 0, 0, image.Width, image.Height); g.Dispose(); MemoryStream ms = new MemoryStream(); temp.Save(ms, format); byte[] buf = ms.GetBuffer(); SetTagBase64("BINVAL", buf); } /// /// returns the image format or null for unknown formats or TYPES /// public ImageFormat ImageFormat { get { string sType = GetTag("TYPE"); if (sType == "image/jpeg") return ImageFormat.Jpeg; else if (sType == "image/png") return ImageFormat.Png; else if (sType == "image/gif") return ImageFormat.Gif; #if!CF_2 else if (sType == "image/tiff") return ImageFormat.Tiff; #endif else return null; } } /// /// gets or sets the from internal (binary) or external source /// When external then it trys to get the image with a Webrequest /// public System.Drawing.Image Image { get { try { if (HasTag("BINVAL")) { byte[] pic = Convert.FromBase64String(GetTag("BINVAL")); System.IO.MemoryStream ms = new System.IO.MemoryStream(pic, 0, pic.Length); return new System.Drawing.Bitmap(ms); } else if (HasTag("EXTVAL")) { System.Net.WebRequest req = System.Net.WebRequest.Create(GetTag("EXTVAL")); System.Net.WebResponse response = req.GetResponse(); return new System.Drawing.Bitmap(response.GetResponseStream()); } else return null; } catch { return null; } } /* set { SetTag("TYPE", "image"); MemoryStream ms = new MemoryStream(); // Save the Image as PNG to the Memorystream value.Save(ms, ImageFormat.Png); byte[] buf = ms.GetBuffer(); SetTagBase64("BINVAL", buf); } */ } #endif } } #endifsmuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/vcard/Name.cs0000644000175000017500000000365412204443225024070 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.vcard { /// /// /// public class Name : Element { // // Saint-Andre // Peter // // #region << Constructors >> public Name() { this.TagName = "N"; this.Namespace = Uri.VCARD; } public Name(string family, string given, string middle) : this() { this.Family = family; this.Given = given; this.Middle = middle; } #endregion public string Family { get { return GetTag("FAMILY"); } set { SetTag("FAMILY", value); } } public string Given { get { return GetTag("GIVEN"); } set { SetTag("GIVEN", value); } } public string Middle { get { return GetTag("MIDDLE"); } set { SetTag("MIDDLE", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/vcard/Email.cs0000644000175000017500000000523112204443225024230 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.vcard { // // public enum EmailType { NONE = -1, HOME, WORK, INTERNET, X400, } /// /// /// public class Email : Element { // stpeter@jabber.org #region << Constructors >> public Email() { this.TagName = "EMAIL"; this.Namespace = Uri.VCARD; } /// /// /// /// Type of the new Email Adress /// Email Adress /// Is this adressed prefered public Email(EmailType type, string userid, bool prefered) : this() { Type = type; IsPrefered = prefered; UserId = userid; } #endregion public EmailType Type { get { return (EmailType) HasTagEnum(typeof(EmailType)); } set { if (value != EmailType.NONE) SetTag(value.ToString()); } } /// /// Is this the prefered contact adress? /// public bool IsPrefered { get { return HasTag("PREF"); } set { if (value == true) SetTag("PREF"); else RemoveTag("PREF"); } } /// /// The email Adress /// public string UserId { get { return GetTag("USERID"); } set { SetTag("USERID", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/register/0000755000175000017500000000000012204443225023376 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/register/RegisterIq.cs0000644000175000017500000000343712204443225026012 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.register { /// /// Used for registering new usernames on Jabber/XMPP Servers /// public class RegisterIq : IQ { private Register m_Register = new Register(); public RegisterIq() { base.Query = m_Register; this.GenerateId(); } public RegisterIq(IqType type) : this() { this.Type = type; } public RegisterIq(IqType type, Jid to) : this(type) { this.To = to; } public RegisterIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Register Query { get { return m_Register; } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/register/RegisterEventArgs.cs0000644000175000017500000000405312204443225027332 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.iq.register { public delegate void RegisterEventHandler(object sender, RegisterEventArgs args); public class RegisterEventArgs { public RegisterEventArgs() { } public RegisterEventArgs(Register reg) { m_Register = reg; } // by default we register automatically private bool m_Auto = true; private Register m_Register; /// /// Set Auto to true if the library should register automatically /// Set it to false if you want to fill out the registration fields manual /// public bool Auto { get { return m_Auto; } set { m_Auto = value; } } public Register Register { get { return m_Register; } set { m_Register = value; } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/register/Register.cs0000644000175000017500000000731112204443225025513 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.x.data; using agsXMPP.Xml; using agsXMPP.Xml.Dom; // Sample 1 // gnauck2secret // // Sample 2 // test1secret // test1mysecretChoose a username and password to register with this server. namespace agsXMPP.protocol.iq.register { /// /// Used for registering new usernames on Jabber/XMPP Servers /// public class Register : Element { #region << Constructors >> public Register() { this.TagName = "query"; this.Namespace = Uri.IQ_REGISTER; } public Register(string username, string password) : this() { Username = username; Password = password; } #endregion #region << Properties >> public string Username { get { return GetTag("username"); } set { SetTag("username", value); } } public string Password { get { return GetTag("password"); } set { SetTag("password", value); } } public string Instructions { get { return GetTag("instructions"); } set { SetTag("instructions", value); } } public string Name { get { return GetTag("name"); } set { SetTag("name", value); } } public string Email { get { return GetTag("email"); } set { SetTag("email", value); } } /// /// Remove registration from the server /// public bool RemoveAccount { get { return HasTag("remove"); } set { if (value == true) SetTag("remove"); else RemoveTag("remove"); } } /// /// The X-Data Element /// public Data Data { get { return SelectSingleElement(typeof(Data)) as Data; } set { if (HasTag(typeof(Data))) RemoveTag(typeof(Data)); if (value != null) this.AddChild(value); } } #endregion } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/agent/0000755000175000017500000000000012204443225022650 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/agent/Agents.cs0000644000175000017500000000455712204443225024433 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.agent { // Send: // // // Recv: // // Public Conferencingpublic // AIM TransportaimEnter ID // Yahoo! TransportyahooEnter ID // ICQ TransporticqEnter ID // MSN TransportmsnEnter ID // // /// /// Zusammenfassung fr Agent. /// public class Agents : Element { public Agents() { this.TagName = "query"; this.Namespace = Uri.IQ_AGENTS; } public ElementList GetAgents() { return SelectElements("agent"); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/agent/AgentsIq.cs0000644000175000017500000000354612204443225024722 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; // Request Agents: // // // namespace agsXMPP.protocol.iq.agent { /// /// Summary description for AgentsIq. /// public class AgentsIq : IQ { private Agents m_Agents = new Agents(); public AgentsIq() { base.Query = m_Agents; this.GenerateId(); } public AgentsIq(IqType type) : this() { this.Type = type; } public AgentsIq(IqType type, Jid to) : this(type) { this.To = to; } public AgentsIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Agents Query { get { return m_Agents; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/agent/Agent.cs0000644000175000017500000000674712204443225024253 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.agent { // Public Conferencingpublic // AIM TransportaimEnter ID // Yahoo! TransportyahooEnter ID // ICQ TransporticqEnter ID // MSN TransportmsnEnter ID /// /// Zusammenfassung fr Agent. /// public class Agent : Element { public Agent() { this.TagName = "agent"; this.Namespace = Uri.IQ_AGENTS; } public Jid Jid { get { return new Jid(this.GetAttribute("jid")); } set { SetAttribute("jid", value.ToString()); } } public string Name { get { return GetTag("name"); } set { SetTag("name", value); } } public string Service { get { return GetTag("service"); } set { SetTag("service", value); } } public string Description { get { return GetTag("description"); } set { SetTag("description", value); } } /// /// Can we register this agent/transport /// public bool CanRegister { get { return HasTag("register"); } set { if (value == true) SetTag("register"); else RemoveTag("register"); } } /// /// Can we search thru this agent/transport /// public bool CanSearch { get { return HasTag("search"); } set { if (value == true) SetTag("search"); else RemoveTag("search"); } } /// /// Is this agent a transport? /// public bool IsTransport { get { return HasTag("transport"); } set { if (value == true) SetTag("transport"); else RemoveTag("transport"); } } /// /// Is this agent for groupchat /// public bool IsGroupchat { get { return HasTag("groupchat"); } set { if (value == true) SetTag("groupchat"); else RemoveTag("groupchat"); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/privacy/0000755000175000017500000000000012250206660023230 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/privacy/Type.cs0000644000175000017500000000270612204443225024504 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.iq.privacy { public enum Type { NONE = -1, /// /// /// jid, /// /// /// group, /// /// /// subscription } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/privacy/PrivacyIq.cs0000644000175000017500000000365212204443225025473 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.privacy { /// /// Summary description for PrivateIq. /// public class PrivacyIq : IQ { Privacy m_Privacy = new Privacy(); public PrivacyIq() { base.Query = m_Privacy; this.GenerateId(); } public PrivacyIq(IqType type) : this() { this.Type = type; } public PrivacyIq(IqType type, Jid to) : this(type) { this.To = to; } public PrivacyIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Privacy Query { get { return m_Privacy; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/privacy/Active.cs0000644000175000017500000000267012204443225024776 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.iq.privacy { /// /// The active list /// public class Active : List { public Active() { this.TagName = "active"; } public Active(string name) : this() { Name = name; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/privacy/Stanza.cs0000644000175000017500000000456312204443225025026 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.iq.privacy { /// /// enum for block or allow communications. /// This flags could be combined under the following conditions. /// /// /// /// All must stand alone, its not allowed to combine thsi flag /// Message, Iq, IncomingPresence and Outgoing Presence could be combined, /// but its not allowed to combine more than 3 of this flag. /// If you need all of them you have to use the All flag /// /// public enum Stanza { /// /// Block all stanzas /// !!! Don't combine this flag with others!!! /// All = 0, /// /// Block messages /// Message = 1, /// /// Block IQs /// Iq = 2, /// /// Block Incoming Presences /// IncomingPresence = 4, /// /// Block Outgoing Presences /// OutgoingPresence = 8, } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/privacy/List.cs0000644000175000017500000000521012204443225024467 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.privacy { public class List : Element { public List() { this.TagName = "list"; this.Namespace = Uri.IQ_PRIVACY; } public List(string name) : this() { Name = name; } public string Name { get { return GetAttribute("name"); } set { SetAttribute("name", value); } } /// /// Gets all Rules (Items) when available /// /// public Item[] GetItems() { ElementList el = SelectElements(typeof(Item)); int i = 0; Item[] result = new Item[el.Count]; foreach (Item itm in el) { result[i] = itm; i++; } return result; } /// /// Adds a rule (item) to the list /// /// public void AddItem(Item item) { this.AddChild(item); } public void AddItems(Item[] items) { foreach (Item item in items) { this.AddChild(item); } } /// /// Remove all items/rules of this list /// public void RemoveAllItems() { this.RemoveTags(typeof(Item)); } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/privacy/Action.cs0000644000175000017500000000263712204443225025003 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.iq.privacy { /// /// privacy lis action /// public enum Action { /// /// /// allow, /// /// /// deny } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/privacy/Default.cs0000644000175000017500000000267512204443225025154 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.iq.privacy { /// /// The default list /// public class Default : List { public Default() { this.TagName = "default"; } public Default(string name) : this() { Name = name; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/privacy/PrivacyManager.cs0000644000175000017500000003244012250206660026472 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP; using agsXMPP.protocol.client; using agsXMPP.protocol.iq.privacy; namespace agsXMPP.protocol.iq.privacy { /// /// Helper class for managing server side privacy lists (blocking communication) /// public class PrivacyManager { private XmppClientConnection m_connection = null; public PrivacyManager(XmppClientConnection con) { m_connection = con; } /// /// Retrieving all Privacy Lists /// public void GetLists() { GetLists(null); } /// /// Retrieving all Privacy Lists /// /// Callback for the server result /// Callback arguments for the result when needed public void GetLists(IqHandler cb) { /* Example: Client requests names of privacy lists from server: Example: Server sends names of privacy lists to client, preceded by active list and default list: */ PrivacyIq pIq = new PrivacyIq(); pIq.Type = agsXMPP.protocol.client.IqType.get; SendStanza(pIq, cb); } /// /// Requests a privacy list from the server by its name /// /// name of the privacy list to retrieve public void GetList(string name) { GetList(name, null); } /// /// Requests a privacy list from the server by its name /// /// name of the privacy list to retrieve /// Callback for the server result /// Callback arguments for the result when needed public void GetList(string name, IqHandler cb) { /* Example: Client requests a privacy list from server: Example: Server sends a privacy list to client: */ PrivacyIq pIq = new PrivacyIq(); pIq.Type = agsXMPP.protocol.client.IqType.get; pIq.Query.AddList(new List(name)); SendStanza(pIq, cb); } /// /// Remove a privacy list /// /// name of the privacy list to remove public void RemoveList(string name) { RemoveList(name, null); } /// /// Remove a privacy list /// /// name of the privacy list to remove /// Callback for the server result /// Callback arguments for the result when needed public void RemoveList(string name, IqHandler cb) { PrivacyIq pIq = new PrivacyIq(); pIq.Type = agsXMPP.protocol.client.IqType.set; pIq.Query.AddList(new List(name)); SendStanza(pIq, cb); } /// /// Decline the use of any active list /// public void DeclineActiveList() { DeclineActiveList(null); } /// /// Decline the use of any active list /// /// Callback for the server result /// Callback arguments for the result when needed public void DeclineActiveList(IqHandler cb) { /* In order to decline the use of any active list, the connected resource MUST send an empty element with no 'name' attribute. Example: Client declines the use of active lists: Example: Server acknowledges success of declining any active list: */ PrivacyIq pIq = new PrivacyIq(); pIq.Type = agsXMPP.protocol.client.IqType.set; pIq.Query.Active = new Active(); SendStanza(pIq, cb); } /// /// Change the active list /// /// public void ChangeActiveList(string name) { ChangeActiveList(name, null); } /// /// Change the active list /// /// /// Callback for the server result /// Callback arguments for the result when needed public void ChangeActiveList(string name, IqHandler cb) { /* Example: Client requests change of active list: The server MUST activate and apply the requested list before sending the result back to the client. Example: Server acknowledges success of active list change: If the user attempts to set an active list but a list by that name does not exist, the server MUST return an stanza error to the user: Example: Client attempts to set a non-existent list as active: */ PrivacyIq pIq = new PrivacyIq(); pIq.Type = agsXMPP.protocol.client.IqType.set; pIq.Query.Active = new Active(name); SendStanza(pIq, cb); } /// /// Change the default list /// /// name of the new default list public void ChangeDefaultList(string name) { ChangeDefaultList(name, null); } /// /// Change the default list /// /// name of the new default list /// Callback for the server result /// Callback arguments for the result when needed public void ChangeDefaultList(string name, IqHandler cb) { PrivacyIq pIq = new PrivacyIq(); pIq.Type = agsXMPP.protocol.client.IqType.set; pIq.Query.Default = new Default(name); SendStanza(pIq, cb); } /// /// Decline the use of the default list /// public void DeclineDefaultList() { DeclineDefaultList(null); } /// /// Decline the use of the default list /// /// Callback for the server result /// Callback arguments for the result when needed public void DeclineDefaultList(IqHandler cb) { PrivacyIq pIq = new PrivacyIq(); pIq.Type = agsXMPP.protocol.client.IqType.set; pIq.Query.Default = new Default(); SendStanza(pIq, cb); } /// /// Update the list with the given name and rules. /// /// /// Specify the desired changes to the list by including all elements/rules in the list /// (not the "delta") /// /// name of the list /// rules of this list public void UpdateList(string name, Item[] rules) { UpdateList(name, rules, null); } /// /// Update the list with the given name and rules. /// /// /// Specify the desired changes to the list by including all elements/rules in the list /// (not the "delta") /// /// name of this list /// rules of this list /// Callback for the server result /// Callback arguments for the result when needed public void UpdateList(string name, Item[] rules, IqHandler cb) { PrivacyIq pIq = new PrivacyIq(); pIq.Type = agsXMPP.protocol.client.IqType.set; // create a new list with the given name List list = new List(name); list.AddItems(rules); // add the list to the query pIq.Query.AddList(list); SendStanza(pIq, cb); } /// /// Add a new list with the given name and rules /// /// /// public void AddList(string name, Item[] rules) { AddList(name, rules, null); } /// /// Add a new list with the given name and rules. /// /// /// ///// Callback for the server result /// Callback arguments for the result when needed public void AddList(string name, Item[] rules, IqHandler cb) { UpdateList(name, rules, cb); } /// /// Sends a PrivacyIq over the active connection /// /// /// /// private void SendStanza(PrivacyIq pIq, IqHandler cb) { if (cb == null) m_connection.Send(pIq); else m_connection.IqGrabber.SendIq(pIq, cb); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/privacy/RuleManager.cs0000644000175000017500000001075412204443225025767 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.protocol.iq.roster; namespace agsXMPP.protocol.iq.privacy { /// /// Helper class for creating rules for communication blocking /// public class RuleManager { /// /// Block stanzas by Jid /// /// /// /// stanzas you want to block /// public Item BlockByJid(Jid jidToBlock, int order, Stanza stanza) { return new Item(Action.deny, order, Type.jid, jidToBlock.ToString(), stanza); } /// /// Block stanzas for a given roster group /// /// /// /// stanzas you want to block /// public Item BlockByGroup(string group, int order, Stanza stanza) { return new Item(Action.deny, order, Type.group, group, stanza); } /// /// Block stanzas by subscription type /// /// /// /// stanzas you want to block /// public Item BlockBySubscription(SubscriptionType subType, int order, Stanza stanza) { return new Item(Action.deny, order, Type.subscription, subType.ToString(), stanza); } /// /// Block globally (all users) the given stanzas /// /// /// stanzas you want to block /// public Item BlockGlobal(int order, Stanza stanza) { return new Item(Action.deny, order, stanza); } /// /// Allow stanzas by Jid /// /// /// /// stanzas you want to block /// public Item AllowByJid(Jid jidToBlock, int order, Stanza stanza) { return new Item(Action.allow, order, Type.jid, jidToBlock.ToString(), stanza); } /// /// Allow stanzas for a given roster group /// /// /// /// stanzas you want to block /// public Item AllowByGroup(string group, int order, Stanza stanza) { return new Item(Action.allow, order, Type.group, group, stanza); } /// /// Allow stanzas by subscription type /// /// /// /// stanzas you want to block /// public Item AllowBySubscription(SubscriptionType subType, int order, Stanza stanza) { return new Item(Action.allow, order, Type.subscription, subType.ToString(), stanza); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/privacy/Item.cs0000644000175000017500000001604312204443225024460 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.privacy { /// /// This class represents a rule which is used for blocking communication /// public class Item : Element { #region << Constructors >> /// /// Default Contructor /// public Item() { this.TagName = "item"; this.Namespace = Uri.IQ_PRIVACY; } /// /// /// /// /// public Item(Action action, int order) : this() { Action = action; Order = order; } /// /// /// /// /// /// public Item(Action action, int order, Stanza stanza) : this(action, order) { Stanza = stanza; } /// /// /// /// /// /// /// public Item(Action action, int order, Type type, string value) : this(action, order) { Type = type; Val = value; } /// /// /// /// /// /// /// /// public Item(Action action, int order, Type type, string value, Stanza stanza) : this(action, order, type, value) { Stanza = stanza; } #endregion public Action Action { get { return (Action)GetAttributeEnum("action", typeof(Action)); } set { SetAttribute("action", value.ToString()); } } public Type Type { get { return (Type)GetAttributeEnum("type", typeof(Type)); } set { if (value != Type.NONE) SetAttribute("type", value.ToString()); else RemoveAttribute("type"); } } /// /// The order of this rule /// public int Order { get { return GetAttributeInt("order"); } set { SetAttribute("order", value); } } /// /// The value to match of this rule /// public string Val { get { return GetAttribute("value"); } set { SetAttribute("value", value); } } /// /// Block Iq stanzas /// public bool BlockIq { get { return HasTag("iq"); } set { if (value) this.SetTag("iq"); else this.RemoveTag("iq"); } } /// /// Block messages /// public bool BlockMessage { get { return HasTag("message"); } set { if (value) this.SetTag("message"); else this.RemoveTag("message"); } } /// /// Block incoming presence /// public bool BlockIncomingPresence { get { return HasTag("presence-in"); } set { if (value) this.SetTag("presence-in"); else this.RemoveTag("presence-in"); } } /// /// Block outgoing presence /// public bool BlockOutgoingPresence { get { return HasTag("presence-out"); } set { if (value) this.SetTag("presence-out"); else this.RemoveTag("presence-out"); } } /// /// which stanzas should be blocked? /// public Stanza Stanza { get { Stanza result = Stanza.All; if (BlockIq) result |= Stanza.Iq; if (BlockMessage) result |= Stanza.Message; if (BlockIncomingPresence) result |= Stanza.IncomingPresence; if (BlockOutgoingPresence) result |= Stanza.OutgoingPresence; return result; } set { if (value == Stanza.All) { // Block All Communications BlockIq = false; BlockMessage = false; BlockIncomingPresence = false; BlockOutgoingPresence = false; } else { BlockIq = ((value & Stanza.Iq) == Stanza.Iq); BlockMessage = ((value & Stanza.Message) == Stanza.Message); BlockIncomingPresence = ((value & Stanza.IncomingPresence) == Stanza.IncomingPresence); BlockOutgoingPresence = ((value & Stanza.OutgoingPresence) == Stanza.OutgoingPresence); } } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/privacy/Privacy.cs0000644000175000017500000000566112204443225025203 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.privacy { public class Privacy : Element { public Privacy() { this.TagName = "query"; this.Namespace = Uri.IQ_PRIVACY; } /// /// Add a provacy list /// /// public void AddList(List list) { this.AddChild(list); } /// /// Get all Lists /// /// Array of all privacy lists public List[] GetList() { ElementList el = SelectElements(typeof(List)); int i = 0; List[] result = new List[el.Count]; foreach (List list in el) { result[i] = list; i++; } return result; } /// /// The active list /// public Active Active { get { return SelectSingleElement(typeof(Active)) as Active; } set { if (HasTag(typeof(Active))) RemoveTag(typeof(Active)); if (value != null) this.AddChild(value); } } /// /// The default list /// public Default Default { get { return SelectSingleElement(typeof(Default)) as Default; } set { if (HasTag(typeof(Default))) RemoveTag(typeof(Default)); this.AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/search/0000755000175000017500000000000012204443225023017 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/search/SearchIq.cs0000644000175000017500000000371512204443225025053 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; // Example 1. Requesting Search Fields // // // // namespace agsXMPP.protocol.iq.search { /// /// Summary description for SearchIq. /// public class SearchIq : IQ { private Search m_Search = new Search(); public SearchIq() { base.Query = m_Search; this.GenerateId(); } public SearchIq(IqType type) : this() { this.Type = type; } public SearchIq(IqType type, Jid to) : this(type) { this.To = to; } public SearchIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Search Query { get { return m_Search; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/search/SearchItem.cs0000644000175000017500000000602012204443225025370 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.search { // jabber:iq:search // Example 4. Receiving Search Results // // // // // Juliet // Capulet // JuliC // juliet@shakespeare.lit // // // Tybalt // Capulet // ty // tybalt@shakespeare.lit // // // /// /// /// public class SearchItem : Element { public SearchItem() { this.TagName = "item"; this.Namespace = Uri.IQ_SEARCH; } public Jid Jid { get { if (HasAttribute("jid")) return new Jid(this.GetAttribute("jid")); else return null; } set { if (value != null) this.SetAttribute("jid", value.ToString()); else RemoveAttribute("jid"); } } public string Firstname { get { return GetTag("first"); } set { SetTag("first", value); } } public string Lastname { get { return GetTag("last"); } set { SetTag("last", value); } } /// /// Nickname, null when not available /// public string Nickname { get { return GetTag("nick"); } set { SetTag("nick", value); } } public string Email { get { return GetTag("email"); } set { SetTag("email", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/search/Search.cs0000644000175000017500000000761312204443225024562 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.x.data; using agsXMPP.Xml.Dom; // Example 1. Requesting Search Fields // // // // // // The service MUST then return the possible search fields to the user, and MAY include instructions: // // Example 2. Receiving Search Fields // // // // // Fill in one or more fields to search // for any matching Jabber users. // // // // // // // namespace agsXMPP.protocol.iq.search { /// /// http://www.jabber.org/jeps/jep-0055.html /// public class Search : Element { public Search() { this.TagName = "query"; this.Namespace = Uri.IQ_SEARCH; } public string Instructions { get { return GetTag("instructions"); } set { SetTag("instructions", value); } } public string Firstname { get { return GetTag("first"); } set { SetTag("first", value); } } public string Lastname { get { return GetTag("last"); } set { SetTag("last", value); } } public string Nickname { get { return GetTag("nick"); } set { SetTag("nick", value); } } public string Email { get { return GetTag("email"); } set { SetTag("email", value); } } /// /// The X-Data Element /// public Data Data { get { return SelectSingleElement(typeof(Data)) as Data; } set { if (HasTag(typeof(Data))) RemoveTag(typeof(Data)); if (value != null) this.AddChild(value); } } /// /// Retrieve the result items of a search /// //public ElementList GetItems //{ // get // { // return this.SelectElements("item"); // } //} public SearchItem[] GetItems() { ElementList nl = SelectElements(typeof(SearchItem)); SearchItem[] items = new SearchItem[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (SearchItem)e; i++; } return items; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/time/0000755000175000017500000000000012204443225022510 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/time/Time.cs0000644000175000017500000000456012204443225023742 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.time { /* 20020910T17:58:35 MDT Tue Sep 10 12:58:35 2002 */ /// /// XEP-0090: Entity Time /// public class Time : Element { public Time() { this.TagName = "query"; this.Namespace = Uri.IQ_TIME; } public string Utc { get { return GetTag("utc"); } set { SetTag("utc", value); } } /// /// Timezone /// public string Tz { get { return GetTag("tz"); } set { SetTag("tz", value); } } /// /// Human-readable date/time. /// public string Display { get { return GetTag("display"); } set { SetTag("display", value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/time/TimeIq.cs0000644000175000017500000000332012204443225024225 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.time { /// /// Summary description for TimeIq. /// public class TimeIq : IQ { private Time m_Time = new Time(); public TimeIq() { base.Query = m_Time; this.GenerateId(); } public TimeIq(IqType type) : this() { this.Type = type; } public TimeIq(IqType type, Jid to) : this(type) { this.To = to; } public TimeIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Time Query { get { return m_Time; } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/bind/0000755000175000017500000000000012204443225022466 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/bind/BindIq.cs0000644000175000017500000000323712204443225024170 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.bind { /// /// Summary description for BindIq. /// public class BindIq : IQ { private Bind m_Bind = new Bind(); public BindIq() { GenerateId(); AddChild(m_Bind); } public BindIq(IqType type) : this() { Type = type; } public BindIq(IqType type, string resource) : this(type) { m_Bind.Resource = resource; } public new Bind Query { get { return m_Bind; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/bind/Bind.cs0000644000175000017500000000420212204443225023667 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.bind { /// /// Summary description for Bind. /// public class Bind : Element { // SENT: // Exodus // // RECV: // user@server.org/agsxmpp // public Bind() { this.TagName = "bind"; this.Namespace = Uri.BIND; } public Bind(string resource) : this() { this.Resource = resource; } public Bind(Jid jid) : this() { this.Jid = jid; } /// /// The resource to bind /// public string Resource { get { return GetTag("resource"); } set { SetTag("resource", value); } } /// /// The jid the server created /// public Jid Jid { get { return GetTagJid("jid"); } set { SetTag("jid", value.ToString()); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/version/0000755000175000017500000000000012204443225023237 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/version/VersionIq.cs0000644000175000017500000000334712204443225025514 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.version { /// /// Summary description for VersionIq. /// public class VersionIq : IQ { private Version m_Version = new Version(); public VersionIq() { base.Query = m_Version; this.GenerateId(); } public VersionIq(IqType type) : this() { this.Type = type; } public VersionIq(IqType type, Jid to) : this(type) { this.To = to; } public VersionIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Version Query { get { return m_Version; } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/version/Version.cs0000644000175000017500000000411512204443225025214 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.version { // Send: // // // // Recv: // // SoapBox // 2.1.2 beta // Windows NT 5.1 (en-us) // // /// /// Zusammenfassung fr Version. /// public class Version : Element { public Version() { this.TagName = "query"; this.Namespace = Uri.IQ_VERSION; } public string Name { set { SetTag("name", value); } get { return GetTag("name"); } } public string Ver { set { SetTag("version", value); } get { return GetTag("version"); } } public string Os { set { SetTag("os", value); } get { return GetTag("os"); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/session/0000755000175000017500000000000012204443225023235 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/session/SessionIq.cs0000644000175000017500000000365512204443225025512 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.session { /// /// Starting the session, this is done after resource binding /// public class SessionIq : IQ { /* SEND: RECV: */ private Session m_Session = new Session(); public SessionIq() { this.GenerateId(); this.AddChild(m_Session); } public SessionIq(IqType type) : this() { this.Type = type; } public SessionIq(IqType type, Jid to) : this() { this.Type = type; this.To = to; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/session/Session.cs0000644000175000017500000000255312204443225025214 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.session { /// /// Summary description for Session. /// public class Session : Element { public Session() { this.TagName = "session"; this.Namespace = Uri.SESSION; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/private/0000755000175000017500000000000012204443225023224 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/private/PrivateIq.cs0000644000175000017500000000334112204443225025460 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.@private { /// /// Summary description for PrivateIq. /// public class PrivateIq : IQ { Private m_Private = new Private(); public PrivateIq() { base.Query = m_Private; this.GenerateId(); } public PrivateIq(IqType type) : this() { this.Type = type; } public PrivateIq(IqType type, Jid to) : this(type) { this.To = to; } public PrivateIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Private Query { get { return m_Private; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/private/Private.cs0000644000175000017500000000557712204443225025203 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml; using agsXMPP.Xml.Dom; using agsXMPP.protocol.extensions.bookmarks; namespace agsXMPP.protocol.iq.@private { /// /// Private XML Storage JEP-0049 /// /// /// A Jabber client can store any arbitrary XML on the server side by sending an /// iq stanza of type "set" to the server with a query child scoped by the 'jabber:iq:private' namespace. /// The query element MAY contain any arbitrary XML fragment as long as the root element of that /// fragment is scoped by its own namespace. The data can then be retrieved by sending an iq stanza /// of type "get" with a query child scoped by the 'jabber:iq:private' namespace, /// which in turn contains a child element scoped by the namespace used for storage of that fragment. /// Using this method, Jabber entities can store private data on the server and retrieve it /// whenever necessary. The data stored might be anything, as long as it is valid XML. /// One typical usage for this namespace is the server-side storage of client-specific preferences; /// another is Bookmark Storage. /// public class Private : Element { public Private() { this.TagName = "query"; this.Namespace = Uri.IQ_PRIVATE; } /// /// The Storage object /// public Storage Storage { get { return SelectSingleElement(typeof(Storage)) as Storage; } set { if (HasTag(typeof(Storage))) RemoveTag(typeof(Storage)); if (value != null) this.AddChild(value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/auth/0000755000175000017500000000000012204443225022513 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/auth/Auth.cs0000644000175000017500000000670012204443225023746 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.iq.auth { // Send: // gnauck // // Recv:gnauck // // Send:gnauck27c05d464e3f908db3b2ca1729674bfddb28daf2Office // Recv: /// /// /// public class Auth : Element { #region << Constructors >> public Auth() { this.TagName = "query"; this.Namespace = Uri.IQ_AUTH; } #endregion #region << Properties >> public string Username { get { return GetTag("username"); } set { SetTag("username", value); } } public string Password { get { return GetTag("password"); } set { SetTag("password", value); } } public string Resource { get { return GetTag("resource"); } set { SetTag("resource", value); } } public string Digest { get { return GetTag("digest"); } set { SetTag("digest", value); } } #endregion #region << Public Methods >> /// /// /// /// /// /// public void SetAuthDigest(string username, string password, string StreamID) { // Jive Messenger has a problem when we dont remove the password Tag this.RemoveTag("password"); this.Username = username; this.Digest = Util.Hash.Sha1Hash(StreamID + password); } /// /// /// /// /// public void SetAuthPlain(string username, string password) { // remove digest Tag when existing this.RemoveTag("digest"); this.Username = username; this.Password = password; } /// /// /// public void SetAuth(string username, string password, string streamId) { if(HasTag("digest")) SetAuthDigest(username, password, streamId); else SetAuthPlain(username,password); } #endregion } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/iq/auth/AuthIq.cs0000644000175000017500000000332512204443225024240 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.iq.auth { /// /// Summary description for AuthIq. /// public class AuthIq : IQ { private Auth m_Auth = new Auth(); public AuthIq() { base.Query = m_Auth; this.GenerateId(); } public AuthIq(IqType type) : this() { this.Type = type; } public AuthIq(IqType type, Jid to) : this(type) { this.To = to; } public AuthIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new Auth Query { get { return m_Auth; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/0000755000175000017500000000000012204443225023340 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/html/0000755000175000017500000000000012204443225024304 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/html/Html.cs0000644000175000017500000000423012204443225025536 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.html { /* * * hi! * * *

    hi!

    * * *
    */ public class Html : Element { public Html() { this.TagName = "html"; this.Namespace = Uri.XHTML_IM; } /// /// The Body Element of the XHTML Message /// public Body Body { get { return SelectSingleElement(typeof(Body)) as Body; } set { if (HasTag(typeof(Body))) RemoveTag(typeof(Body)); if (value != null) this.AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/html/Body.cs0000644000175000017500000000357312204443225025540 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.html { /// /// The Body Element of a XHTML message /// public class Body : Element { public Body() { this.TagName = "body"; this.Namespace = Uri.XHTML; } /// /// /// public string InnerHtml { get { // Thats a HACK string xml = this.ToString(); int start = xml.IndexOf(">"); int end = xml.LastIndexOf(""); return xml.Substring(start + 1, end - start -1); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/geoloc/0000755000175000017500000000000012204443225024610 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/geoloc/GeoLoc.cs0000644000175000017500000001240312204443225026307 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.geoloc { /* Element Name Inclusion Datatype Definition alt MAY xs:decimal Altitude in meters above or below sea level bearing MAY xs:decimal GPS bearing (direction in which the entity is heading to reach its next waypoint), measured in decimal degrees relative to true north [2] datum MAY xs:string GPS datum [3] description MAY xs:string A natural-language description of the location error MAY xs:decimal Horizontal GPS error in arc minutes lat MUST xs:decimal Latitude in decimal degrees North lon MUST xs:decimal Longitude in decimal degrees East timestamp MAY xs:datetime UTC timestamp specifying the moment when the reading was taken (MUST conform to the DateTime profile of Jabber Date and Time Profiles [4]) */ /// /// XEP-0080 Geographical Location (GeoLoc) /// This JEP defines a format for capturing data about an entity's geographical location (geoloc). /// The namespace defined herein is intended to provide a semi-structured format for /// describing a geographical location that may change fairly frequently, /// where the geoloc information is provided as Global Positioning System (GPS) coordinates. /// public class GeoLoc : Element { #region << Constructors >> /// /// /// public GeoLoc() { this.TagName = "geoloc"; this.Namespace = Uri.GEOLOC; } /// /// /// /// /// public GeoLoc(double latitude, double longitude) : this() { Latitude = latitude; Longitude = longitude; } #endregion /// /// A natural-language description of the location /// public string Description { get { return GetTag("description"); } set { SetTag("description", value); } } /// /// GPS datum /// public string Datum { get { return GetTag("datum"); } set { SetTag("datum", value); } } /// /// Latitude in decimal degrees North /// public double Latitude { get { return GetTagDouble("lat"); } set { SetTag("lat", value); } } /// /// Longitude in decimal degrees East /// public double Longitude { get { return GetTagDouble("lon"); } set { SetTag("lon", value); } } /// /// Altitude in meters above or below sea level /// public double Altitude { get { return GetTagDouble("alt"); } set { SetTag("alt", value); } } /// /// GPS bearing (direction in which the entity is heading to reach its next waypoint), /// measured in decimal degrees relative to true north /// public double Bearing { get { return GetTagDouble("bearing"); } set { SetTag("bearing", value); } } /// /// Horizontal GPS error in arc minutes /// public double Error { get { return GetTagDouble("error"); } set { SetTag("error", value); } } /// /// UTC timestamp specifying the moment when the reading was taken /// public DateTime Timestamp { get { return Util.Time.ISO_8601Date(GetTag("timestamp")); } set { SetTag("timestamp", Util.Time.ISO_8601Date(value)); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/geoloc/GeoLocIq.cs0000644000175000017500000000365212204443225026607 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.extensions.geoloc { /// /// a GeoLoc InfoQuery /// public class GeoLocIq : IQ { private GeoLoc m_GeoLoc = new GeoLoc(); public GeoLocIq() { base.Query = m_GeoLoc; this.GenerateId(); } public GeoLocIq(IqType type) : this() { this.Type = type; } public GeoLocIq(IqType type, Jid to) : this(type) { this.To = to; } public GeoLocIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public new GeoLoc Query { get { return m_GeoLoc; } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/ibb/0000755000175000017500000000000012204443225024074 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/ibb/Base.cs0000644000175000017500000000312312204443225025274 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.ibb { /// /// IBB base class /// public abstract class Base : Element { public Base() { this.Namespace = Uri.IBB; } /// /// Sid /// public string Sid { get { return GetAttribute("sid"); } set { SetAttribute("sid", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/ibb/Open.cs0000644000175000017500000000466612204443225025340 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.ibb { /* */ public class Open : Base { /// /// /// public Open() { this.TagName = "open"; } /// /// /// /// /// public Open(string sid, long blocksize) : this() { this.Sid = sid; this.BlockSize = blocksize; } /// /// Block size /// public long BlockSize { get { return GetAttributeLong("block-size"); } set { SetAttribute("block-size", value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/ibb/Close.cs0000644000175000017500000000334012204443225025470 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.ibb { /* */ /// /// /// public class Close : Base { /// /// /// public Close() { this.TagName = "close"; } /// /// /// /// public Close(string sid) : this() { this.Sid = sid; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/ibb/Data.cs0000644000175000017500000000553412204443225025303 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.ibb { /* qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA */ /// /// /// public class Data : Base { /// /// /// public Data() { this.TagName = "data"; } /// /// /// /// /// public Data(string sid, int seq) : this() { this.Sid = sid; this.Sequence = seq; } /// /// the sequence /// public int Sequence { get { return GetAttributeInt("seq"); } set { SetAttribute("seq", value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/amp/0000755000175000017500000000000012204443225024115 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/amp/Rule.cs0000644000175000017500000001017012204443225025352 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.amp { public class Rule : Element { public Rule() { this.TagName = "rule"; this.Namespace = Uri.AMP; } public Rule(Condition condition, string val, Action action) : this() { Condition = condition; Val = val; Action = action; } /// /// The 'value' attribute defines how the condition is matched. /// This attribute MUST be present, and MUST NOT be an empty string (""). /// The interpretation of this attribute's value is determined by the 'condition' attribute. /// public string Val { get { return GetAttribute("value"); } set { SetAttribute("value", value); } } /// /// The 'action' attribute defines the result for this rule. /// This attribute MUST be present, and MUST be either a value defined in the Defined Actions section, /// or one registered with the XMPP Registrar. /// public Action Action { get { return (Action) GetAttributeEnum("action", typeof(Action)); } set { if (value ==Action.Unknown) RemoveAttribute("action"); else SetAttribute("action", value.ToString()); } } /// /// The 'condition' attribute defines the overall condition this rule applies to. /// This attribute MUST be present, and MUST be either a value defined in the Defined Conditions section, /// or one registered with the XMPP Registrar. /// public Condition Condition { get { switch (GetAttribute("condition")) { case "deliver": return Condition.Deliver; case "expire-at": return Condition.ExprireAt; case "match-resource": return Condition.MatchResource; default: return Condition.Unknown; } } set { switch (value) { case Condition.Deliver: SetAttribute("condition", "deliver"); break; case Condition.ExprireAt: SetAttribute("condition", "expire-at"); break; case Condition.MatchResource: SetAttribute("condition", "match-resource"); break; } } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/amp/Action.cs0000644000175000017500000000240412204443225025661 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.extensions.amp { public enum Action { Unknown = -1, alert, drop, error, notify } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/amp/Amp.cs0000644000175000017500000001003312204443225025156 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.amp { /* */ public class Amp : Base.DirectionalElement { public Amp() { this.TagName = "amp"; this.Namespace = Uri.AMP; } /// /// The 'status' attribute specifies the reason for the amp element. /// When specifying semantics to be applied (client to server), this attribute MUST NOT be present. /// When replying to a sending entity regarding a met condition, this attribute MUST be present and /// SHOULD be the value of the 'action' attribute for the triggered rule. /// (Note: Individual action definitions MAY provide their own requirements.) /// public Action Status { get { return (Action) GetAttributeEnum("status", typeof(Action)); } set { if (value == Action.Unknown) RemoveAttribute("status"); else SetAttribute("status", value.ToString()); } } /// /// The 'per-hop' attribute flags the contained ruleset for processing at each server in the route /// between the original sender and original intended recipient. /// This attribute MAY be present, and MUST be either "true" or "false". /// If not present, the default is "false". /// public bool PerHop { get { return GetAttributeBool("per-hop"); } set { SetAttribute("per-hop", value); } } public void AddRule(Rule rule) { AddChild(rule); } public Rule AddRule() { Rule rule = new Rule(); AddChild(rule); return rule; } /// /// Gets a list of all form fields /// /// public Rule[] GetRules() { ElementList nl = SelectElements(typeof(Rule)); Rule[] items = new Rule[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (Rule)e; i++; } return items; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/amp/Condition.cs0000644000175000017500000000241512204443225026374 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.extensions.amp { public enum Condition { Unknown = -1, Deliver, ExprireAt, MatchResource } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/nickname/0000755000175000017500000000000012204443225025125 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/nickname/Nickname.cs0000644000175000017500000000300012204443225027172 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.nickname { // Ishmael public class Nickname : Element { public Nickname() { this.TagName = "nick"; this.Namespace = Uri.NICK; } public Nickname(string nick) : this() { Value = nick; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/featureneg/0000755000175000017500000000000012204443225025465 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/featureneg/FeatureNeg.cs0000644000175000017500000000540112204443225030041 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.x.data; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.featureneg { /// /// JEP-0020: Feature Negotiation /// This JEP defines a A protocol that enables two Jabber entities to mutually negotiate feature options. /// public class FeatureNeg : Element { /* */ public FeatureNeg() { this.TagName = "feature"; this.Namespace = Uri.FEATURE_NEG; } /// /// data form of type "form" which defines the available options for one or more features. /// Each feature is represented as an x-data "field", which MUST be of type "list-single". /// public Data Data { get { Element data = SelectSingleElement(typeof(Data)); if (data!=null) return data as Data; else return null; } set { if (HasTag(typeof(Data))) RemoveTag(typeof(Data)); AddChild(value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/featureneg/FeatureNegIq.cs0000644000175000017500000000470412204443225030340 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.featureneg { /// /// JEP-0020: Feature Negotiation /// This JEP defines a A protocol that enables two Jabber entities to mutually negotiate feature options. /// public class FeatureNegIq : IQ { /* */ private FeatureNeg m_FeatureNeg = new FeatureNeg(); public FeatureNegIq() { this.AddChild(m_FeatureNeg); this.GenerateId(); } public FeatureNegIq(IqType type) : this() { this.Type = type; } public FeatureNeg FeatureNeg { get { return m_FeatureNeg; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/si/0000755000175000017500000000000012204443225023753 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/si/SIIq.cs0000644000175000017500000000456212204443225025116 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.extensions.si { /* http://jabber.org/protocol/bytestreams */ /// /// /// public class SIIq : IQ { private SI m_SI = new SI(); public SIIq() { this.GenerateId(); this.AddChild(m_SI); } public SIIq(IqType type) : this() { this.Type = type; } public SIIq(IqType type, Jid to) : this(type) { this.To = to; } public SIIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public SI SI { get { return m_SI; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/si/SI.cs0000644000175000017500000000776312204443225024632 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; using agsXMPP.protocol.extensions.filetransfer; using agsXMPP.protocol.extensions.featureneg; namespace agsXMPP.protocol.extensions.si { /// /// JEP-0095: Stream Initiation. /// This JEP defines a protocol for initiating a stream (with meta information) between any two Jabber entities. /// public class SI : Element { public SI() { this.TagName = "si"; this.Namespace = Uri.SI; } //id='a0' //mime-type='text/plain' /// /// The "id" attribute is an opaque identifier. /// This attribute MUST be present on type='set', and MUST be a valid string. /// This SHOULD NOT be sent back on type='result', since the <iq/> "id" attribute provides the only context needed. /// This value is generated by the Sender, and the same value MUST be used throughout a session when talking to the Receiver. /// public string Id { get { return GetAttribute("id"); } set { SetAttribute("id", value); } } /// /// The "mime-type" attribute identifies the MIME-type for the data across the stream. /// This attribute MUST be a valid MIME-type as registered with the Internet Assigned Numbers Authority (IANA) [3] /// (specifically, as listed at "http://www.iana.org/assignments/media-types"). /// During negotiation, this attribute SHOULD be present, and is otherwise not required. /// If not included during negotiation, its value is assumed to be "binary/octect-stream". /// public string MimeType { get { return GetAttribute("mime-type"); } set { SetAttribute("mime-type", value); } } /// /// The "profile" attribute defines the SI profile in use. This value MUST be present during negotiation, /// and is the namespace of the profile to use. /// public string Profile { get { return GetAttribute("profile"); } set { SetAttribute("profile", value); } } /// /// the FeatureNeg Element /// public FeatureNeg FeatureNeg { get { return SelectSingleElement(typeof(FeatureNeg)) as FeatureNeg; } set { if (HasTag(typeof(FeatureNeg))) RemoveTag(typeof(FeatureNeg)); if (value != null) this.AddChild(value); } } /// /// the File Element /// public File File { get { return SelectSingleElement(typeof(File)) as File; } set { if (HasTag(typeof(File))) RemoveTag(typeof(File)); if (value != null) this.AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/0000755000175000017500000000000012250206660024641 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Configure.cs0000644000175000017500000000502412204443225027111 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.x.data; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { public class Configure : PubSubAction { #region << Constructors >> public Configure() : base() { this.TagName = "configure"; } public Configure(string node) : this() { this.Node = node; } public Configure(Type type) : this() { this.Type = type; } public Configure(string node, Type type) : this(node) { this.Type = type; } #endregion public Access Access { get { return (Access)GetAttributeEnum("access", typeof(Access)); } set { if (value == Access.NONE) RemoveAttribute("access"); else SetAttribute("access", value.ToString()); } } /// /// The x-Data Element /// public Data Data { get { return SelectSingleElement(typeof(Data)) as Data; } set { if (HasTag(typeof(Data))) RemoveTag(typeof(Data)); if (value != null) this.AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Options.cs0000644000175000017500000000713712204443225026632 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.x.data; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { /* */ public class Options : Element { #region << Constructors >> public Options() { this.TagName = "options"; this.Namespace = Uri.PUBSUB; } public Options(Jid jid) : this() { this.Jid = jid; } public Options(Jid jid, string node) : this(jid) { this.Node = node; } public Options(Jid jid, string node, string subId) : this(jid, node) { this.SubId = subId; } #endregion public Jid Jid { get { if (HasAttribute("jid")) return new Jid(this.GetAttribute("jid")); else return null; } set { if (value!=null) this.SetAttribute("jid", value.ToString()); } } public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } public string SubId { get { return GetAttribute("subid"); } set { SetAttribute("subid", value); } } /// /// The X-Data Element/Form /// public Data Data { get { return SelectSingleElement(typeof(Data)) as Data; } set { if (HasTag(typeof(Data))) RemoveTag(typeof(Data)); if (value != null) this.AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Type.cs0000644000175000017500000000235412204443225026114 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.extensions.pubsub { public enum Type { NONE = -1, collection, leaf } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Affiliations.cs0000644000175000017500000000540312204443225027601 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { /* */ public class Affiliations : Element { #region << Consrtuctors >> public Affiliations() { this.TagName = "affiliations"; this.Namespace = Uri.PUBSUB; } #endregion public Affiliation AddAffiliation() { Affiliation aff = new Affiliation(); AddChild(aff); return aff; } public Affiliation AddAffiliation(Affiliation aff) { AddChild(aff); return aff; } public Affiliation[] GetAffiliations() { ElementList nl = SelectElements(typeof(Affiliation)); Affiliation[] items = new Affiliation[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (Affiliation) e; i++; } return items; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Subscribe.cs0000644000175000017500000000471412204443225027116 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { public class Subscribe : Element { /* Example 25. Entity subscribes to a node */ #region << Constructors >> public Subscribe() { this.TagName = "subscribe"; this.Namespace = Uri.PUBSUB; } public Subscribe(string node, Jid jid) : this() { this.Node = node; this.Jid = jid; } #endregion public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } public Jid Jid { get { if (HasAttribute("jid")) return new Jid(this.GetAttribute("jid")); else return null; } set { if (value != null) this.SetAttribute("jid", value.ToString()); else RemoveAttribute("jid"); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Unsubscribe.cs0000644000175000017500000000453212204443225027457 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.extensions.pubsub { /* Example 38. Entity unsubscribes from a node */ // looks exactly the same as subscribe, but has an additional Attribute subid public class Unsubscribe : Subscribe { #region << Constructors >> public Unsubscribe() : base() { this.TagName = "unsubscribe"; } public Unsubscribe(string node, Jid jid) : this() { this.Node = node; this.Jid = jid; } public Unsubscribe(string node, Jid jid, string subid) : this(node, jid) { SubId = subid; } #endregion public string SubId { get { return GetAttribute("subid"); } set { SetAttribute("subid", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/PubSubManager.cs0000644000175000017500000010105612250206660027666 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP; using agsXMPP.protocol.client; namespace agsXMPP.protocol.extensions.pubsub { public class PubSubManager { private XmppClientConnection m_connection = null; #region << Constructors >> public PubSubManager(XmppClientConnection con) { m_connection = con; } #endregion #region << Create Instant Node >> /* Example 6. Client requests an instant node */ public void CreateInstantNode(Jid to) { CreateInstantNode(to, null, null); } public void CreateInstantNode(Jid to, Jid from) { CreateInstantNode(to, from, null); } public void CreateInstantNode(Jid to, IqHandler cb) { CreateInstantNode(to, null, cb); } public void CreateInstantNode(Jid to, Jid from, IqHandler cb) { PubSubIq pubsubIq = new PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; pubsubIq.PubSub.Create = new Create(); if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Create Node >> /* Example 1. Entity requests a new node with default configuration. */ /// /// Create a Node with default configuration /// /// /// public void CreateNode(Jid to, string node) { CreateNode(to, null, node, true, null); } public void CreateNode(Jid to, Jid from, string node) { CreateNode(to, from, node, true, null); } /// /// Create a Node /// /// /// /// public void CreateNode(Jid to, Jid from, string node, bool defaultConfig) { CreateNode(to, from, node, defaultConfig, null); } public void CreateNode(Jid to, string node, bool defaultConfig, IqHandler cb) { CreateNode(to, null, node, defaultConfig, cb); } public void CreateNode(Jid to, Jid from, string node, bool defaultConfig, IqHandler cb) { PubSubIq pubsubIq = new PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; pubsubIq.PubSub.Create = new Create(node); if (defaultConfig) pubsubIq.PubSub.Configure = new Configure(); if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << CreateCollection Node >> /* To create a new collection node, the requesting entity MUST specify a type of "collection" when asking the service to create the node. [20] Example 185. Entity requests a new collection node Example 186. Service responds with success */ public void CreateCollectionNode(Jid to, string node, bool defaultConfig) { CreateCollectionNode(to, null, node, defaultConfig, null); } public void CreateCollectionNode(Jid to, string node, bool defaultConfig, IqHandler cb) { CreateCollectionNode(to, null, node, defaultConfig, cb); } public void CreateCollectionNode(Jid to, Jid from, string node, bool defaultConfig) { CreateCollectionNode(to, from, node, defaultConfig, null); } public void CreateCollectionNode(Jid to, Jid from, string node, bool defaultConfig, IqHandler cb) { PubSubIq pubsubIq = new PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; pubsubIq.PubSub.Create = new Create(node, Type.collection); if (defaultConfig) pubsubIq.PubSub.Configure = new Configure(); if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Delete Node >> /* Example 133. Owner deletes a node */ public void DeleteNode(Jid to, string node) { DeleteNode(to, null, node, null); } public void DeleteNode(Jid to, string node, IqHandler cb) { DeleteNode(to, null, node, cb); } public void DeleteNode(Jid to, Jid from, string node) { DeleteNode(to, from, node, null); } public void DeleteNode(Jid to, Jid from, string node, IqHandler cb) { owner.PubSubIq pubsubIq = new owner.PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; pubsubIq.PubSub.Delete = new owner.Delete(node); if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Purge Node >> /* Example 139. Owner purges all items from a node */ public void PurgeNode(Jid to, string node) { PurgeNode(to, null, node, null); } public void PurgeNode(Jid to, string node, IqHandler cb) { PurgeNode(to, null, node, cb); } public void PurgeNode(Jid to, Jid from, string node) { PurgeNode(to, from, node, null); } public void PurgeNode(Jid to, Jid from, string node, IqHandler cb) { owner.PubSubIq pubsubIq = new owner.PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; pubsubIq.PubSub.Purge = new owner.Purge(node); if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Publish to a Node >> /* Example 9. Entity publishes an item with an ItemID Ralph Vaughan Williams Concerto in F for Bass Tuba Golden Brass: The Collector's Edition */ /// /// Publish a payload to a Node /// /// /// /// public void PublishItem(Jid to, string node, Item payload) { PublishItem(to, null, node, payload, null); } /// /// Publish a payload to a Node /// /// /// /// /// public void PublishItem(Jid to, string node, Item payload, IqHandler cb) { PublishItem(to, null, node, payload, cb); } /// /// Publish a payload to a Node /// /// /// /// /// public void PublishItem(Jid to, Jid from, string node, Item payload) { PublishItem(to, from, node, payload, null); } /// /// Publish a payload to a Node /// /// /// /// /// /// public void PublishItem(Jid to, Jid from, string node, Item payload, IqHandler cb) { PubSubIq pubsubIq = new PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; Publish publish = new Publish(node); publish.AddItem(payload); pubsubIq.PubSub.Publish = publish; if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Retract >> /* */ public void RetractItem(Jid to, string node, string id) { RetractItem(to, null, node, id, null); } public void RetractItem(Jid to, string node, string id, IqHandler cb) { RetractItem(to, null, node, id, cb); } public void RetractItem(Jid to, Jid from, string node, string id) { RetractItem(to, from, node, id, null); } public void RetractItem(Jid to, Jid from, string node, string id, IqHandler cb) { PubSubIq pubsubIq = new PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; pubsubIq.PubSub.Retract = new Retract(node, id); if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Subscribe >> /* */ /// /// /// /// Jid of the Publish Subscribe Service /// Jid which should be subscribed /// node to which we want to subscribe public void Subscribe(Jid to, Jid subscribe, string node) { Subscribe(to, null, subscribe, node, null); } public void Subscribe(Jid to, Jid subscribe, string node, IqHandler cb) { Subscribe(to, null, subscribe, node, cb); } public void Subscribe(Jid to, Jid from, Jid subscribe, string node) { Subscribe(to, from, subscribe, node, null); } public void Subscribe(Jid to, Jid from, Jid subscribe, string node, IqHandler cb) { PubSubIq pubsubIq = new PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; pubsubIq.PubSub.Subscribe = new Subscribe(node, subscribe); if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Unsubscribe >> /* Example 38. Entity unsubscribes from a node */ /// /// /// /// Jid of the Publish Subscribe Service /// Jid which should be subscribed /// node to which we want to subscribe public void Unsubscribe(Jid to, Jid unsubscribe, string node) { Unsubscribe(to, null, unsubscribe, node, null, null); } public void Unsubscribe(Jid to, Jid unsubscribe, string node, string subid) { Unsubscribe(to, null, unsubscribe, node, subid, null); } public void Unsubscribe(Jid to, Jid unsubscribe, string node, IqHandler cb) { Unsubscribe(to, null, unsubscribe, node, cb); } public void Unsubscribe(Jid to, Jid unsubscribe, string node, string subid, IqHandler cb) { Unsubscribe(to, null, unsubscribe, node, subid, cb); } public void Unsubscribe(Jid to, Jid from, Jid unsubscribe, string node) { Unsubscribe(to, from, unsubscribe, node, null, null); } public void Unsubscribe(Jid to, Jid from, Jid unsubscribe, string node, string subid) { Unsubscribe(to, from, unsubscribe, node, subid, null); } public void Unsubscribe(Jid to, Jid from, Jid unsubscribe, string node, IqHandler cb) { Unsubscribe(to, from, unsubscribe, node, cb); } public void Unsubscribe(Jid to, Jid from, Jid unsubscribe, string node, string subid, IqHandler cb) { PubSubIq pubsubIq = new PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; Unsubscribe unsub = new Unsubscribe(node, unsubscribe); if (subid != null) unsub.SubId = subid; pubsubIq.PubSub.Unsubscribe = unsub; if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Request Subscriptions >>> /* */ public void RequestSubscriptions(Jid to) { RequestSubscriptions(to, null, null); } public void RequestSubscriptions(Jid to, IqHandler cb) { RequestSubscriptions(to, null, cb); } public void RequestSubscriptions(Jid to, Jid from) { RequestSubscriptions(to, from, null); } public void RequestSubscriptions(Jid to, Jid from, IqHandler cb) { PubSubIq pubsubIq = new PubSubIq(IqType.get, to); if (from != null) pubsubIq.From = from; pubsubIq.PubSub.Subscriptions = new Subscriptions(); if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Owner Request Affiliations >> /* */ public void RequestAffiliations(Jid to) { RequestAffiliations(to, null, null); } public void RequestAffiliations(Jid to, IqHandler cb) { RequestAffiliations(to, null, cb); } public void RequestAffiliations(Jid to, Jid from) { RequestAffiliations(to, from, null); } public void RequestAffiliations(Jid to, Jid from, IqHandler cb) { PubSubIq pubsubIq = new PubSubIq(IqType.get, to); if (from != null) pubsubIq.From = from; pubsubIq.PubSub.Affiliations = new Affiliations(); if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Request Subscription Options >> /* */ public void RequestSubscriptionOptions(Jid to, Jid subscribe, string node) { RequestSubscriptionOptions(to, null, subscribe, node, null); } public void RequestSubscriptionOptions(Jid to, Jid subscribe, string node, IqHandler cb) { RequestSubscriptionOptions(to, null, subscribe, node, cb); } public void RequestSubscriptionOptions(Jid to, Jid from, Jid subscribe, string node) { RequestSubscriptionOptions(to, from, subscribe, node, null); } public void RequestSubscriptionOptions(Jid to, Jid from, Jid subscribe, string node, IqHandler cb) { PubSubIq pubsubIq = new PubSubIq(IqType.get, to); if (from != null) pubsubIq.From = from; pubsubIq.PubSub.Options = new Options(subscribe, node); if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Request All Subscribers >> /* */ public void OwnerRequestSubscribers(Jid to, string node) { OwnerRequestSubscribers(to, null, node, null); } public void OwnerRequestSubscribers(Jid to, string node, IqHandler cb) { OwnerRequestSubscribers(to, null, node, cb); } public void OwnerRequestSubscribers(Jid to, Jid from, string node) { OwnerRequestSubscribers(to, from, node, null); } public void OwnerRequestSubscribers(Jid to, Jid from, string node, IqHandler cb) { owner.PubSubIq pubsubIq = new owner.PubSubIq(IqType.get, to); if (from != null) pubsubIq.From = from; pubsubIq.PubSub.Subscribers = new agsXMPP.protocol.extensions.pubsub.owner.Subscribers(node); if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Modifying single Subscription State >> /* Upon receiving the subscribers list, the node owner MAY modify subscription states. The owner MUST send only modified subscription states (i.e., a "delta"), not the complete list. (Note: If the 'subscription' attribute is not specified in a modification request, then the value MUST NOT be changed.) Example 163. Owner modifies subscriptions */ public void OwnerModifySubscriptionState(Jid to, string node, Jid subscriber, SubscriptionState state) { OwnerModifySubscriptionState(to, null, node, subscriber, state, null); } public void OwnerModifySubscriptionState(Jid to, string node, Jid subscriber, SubscriptionState state, IqHandler cb) { OwnerModifySubscriptionState(to, null, node, subscriber, state, cb); } public void OwnerModifySubscriptionState(Jid to, Jid from, string node, Jid subscriber, SubscriptionState state) { OwnerModifySubscriptionState(to, from, node, subscriber, state, null); } public void OwnerModifySubscriptionState(Jid to, Jid from, string node, Jid subscriber, SubscriptionState state, IqHandler cb) { owner.PubSubIq pubsubIq = new owner.PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; owner.Subscribers subs = new owner.Subscribers(node); subs.AddSubscriber(new owner.Subscriber(subscriber, state)); pubsubIq.PubSub.Subscribers = subs; if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Modifying multiple Subscription States >> /* */ public void OwnerModifySubscriptionStates(Jid to, string node, owner.Subscriber[] subscribers) { OwnerModifySubscriptionStates(to, null, node, subscribers, null); } public void OwnerModifySubscriptionStates(Jid to, string node, owner.Subscriber[] subscribers, IqHandler cb) { OwnerModifySubscriptionStates(to, null, node, subscribers, cb); } public void OwnerModifySubscriptionStates(Jid to, Jid from, string node, owner.Subscriber[] subscribers) { OwnerModifySubscriptionStates(to, from, node, subscribers, null); } public void OwnerModifySubscriptionStates(Jid to, Jid from, string node, owner.Subscriber[] subscribers, IqHandler cb) { owner.PubSubIq pubsubIq = new owner.PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; owner.Subscribers subs = new owner.Subscribers(node); subs.AddSubscribers(subscribers); pubsubIq.PubSub.Subscribers = subs; if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Owner Request Affiliations >> /* Example 168. Owner requests all affiliated entities */ public void OwnerRequestAffiliations(Jid to, string node) { OwnerRequestAffiliations(to, null, node, null); } public void OwnerRequestAffiliations(Jid to, string node, IqHandler cb) { OwnerRequestAffiliations(to, null, node, cb); } public void OwnerRequestAffiliations(Jid to, Jid from, string node) { OwnerRequestAffiliations(to, from, node, null); } public void OwnerRequestAffiliations(Jid to, Jid from, string node, IqHandler cb) { owner.PubSubIq pubsubIq = new owner.PubSubIq(IqType.get, to); if (from != null) pubsubIq.From = from; pubsubIq.PubSub.Affiliates = new owner.Affiliates(node); if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Owner Set/Modify Affiliation >> /* Owner modifies a single affiliation */ public void OwnerModifyAffiliation(Jid to, string node, Jid affiliate, AffiliationType affiliation) { OwnerModifyAffiliation(to, null, node, affiliate, affiliation, null); } public void OwnerModifyAffiliation(Jid to, string node, Jid affiliate, AffiliationType affiliation, IqHandler cb) { OwnerModifyAffiliation(to, null, node, affiliate, affiliation, cb); } public void OwnerModifyAffiliation(Jid to, Jid from, string node, Jid affiliate, AffiliationType affiliation) { OwnerModifyAffiliation(to, from, node, affiliate, affiliation, null); } public void OwnerModifyAffiliation(Jid to, Jid from, string node, Jid affiliate, AffiliationType affiliation, IqHandler cb) { owner.PubSubIq pubsubIq = new owner.PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; owner.Affiliates aff = new owner.Affiliates(node); aff.AddAffiliate(new owner.Affiliate(affiliate, affiliation)); pubsubIq.PubSub.Affiliates = aff; if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion #region << Owner Modify Affiliations >> /* Owner modifies a single affiliation */ public void OwnerModifyAffiliations(Jid to, string node, owner.Affiliate[] affiliates) { OwnerModifyAffiliations(to, null, node, affiliates, null); } public void OwnerModifyAffiliations(Jid to, string node, owner.Affiliate[] affiliates, IqHandler cb) { OwnerModifyAffiliations(to, null, node, affiliates, cb); } public void OwnerModifyAffiliations(Jid to, Jid from, string node, owner.Affiliate[] affiliates) { OwnerModifyAffiliations(to, from, node, affiliates, null); } public void OwnerModifyAffiliations(Jid to, Jid from, string node, owner.Affiliate[] affiliates, IqHandler cb) { owner.PubSubIq pubsubIq = new owner.PubSubIq(IqType.set, to); if (from != null) pubsubIq.From = from; owner.Affiliates affs = new owner.Affiliates(node); affs.AddAffiliates(affiliates); pubsubIq.PubSub.Affiliates = affs; if (cb == null) m_connection.Send(pubsubIq); else m_connection.IqGrabber.SendIq(pubsubIq, cb); } #endregion } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Access.cs0000644000175000017500000000343612204443225026376 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.extensions.pubsub { /* */ public enum Access { NONE = -1, open, authorize, presence, roster, whitelist } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/SubscribeOptions.cs0000644000175000017500000000540712204443225030472 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { /* Example 36. Service replies with success and indicates that subscription configuration is required */ public class SubscribeOptions : Element { #region << Constructors >> public SubscribeOptions() { this.TagName = "subscribe-options"; this.Namespace = Uri.PUBSUB; } public SubscribeOptions(bool required) { this.Required = required; } #endregion public bool Required { get { return HasTag("required"); } set { if (value) SetTag("required"); else RemoveTag("required"); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Retract.cs0000644000175000017500000000513712204443225026601 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { // Publish and retract looks exactly the same, so inherit from publish here public class Retract : Publish { /* A service SHOULD allow a publisher to delete an item once it has been published to a node that supports persistent items. To delete an item, the publisher sends a retract request as shown in the following examples. The element MUST possess a 'node' attribute and SHOULD contain one element (but MAY contain more than one element for Batch Processing of item retractions); the element MUST be empty and MUST possess an 'id' attribute. */ public Retract() : base() { this.TagName = "retract"; } public Retract(string node) : this() { this.Node = node; } public Retract(string node, string id) : this(node) { this.AddItem(new Item(id)); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Items.cs0000644000175000017500000000576012204443225026260 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { /* */ public class Items : Publish { #region << Constructors >> public Items() : base() { this.TagName = "items"; } public Items(string node) : this() { this.Node = node; } public Items(string node, string subId) : this(node) { this.SubId = subId; } public Items(string node, string subId, int maxItems) : this(node, subId) { this.MaxItems = maxItems; } #endregion //public string Node //{ // get { return GetAttribute("node"); } // set { SetAttribute("node", value); } //} public string SubId { get { return GetAttribute("subid"); } set { SetAttribute("subid", value); } } public int MaxItems { get { return GetAttributeInt("max_items"); } set { SetAttribute("max_items", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/PubSubAction.cs0000644000175000017500000000355612204443225027536 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { public abstract class PubSubAction : Element { public PubSubAction() { this.Namespace = Uri.PUBSUB; } public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } public Type Type { get { return (Type)GetAttributeEnum("type", typeof(Type)); } set { if (value == Type.NONE) RemoveAttribute("type"); else SetAttribute("type", value.ToString()); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Publish.cs0000644000175000017500000000764012204443225026604 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { /* Example 9. Entity publishes an item with an ItemID of the Payload Type UserTune Ralph Vaughan Williams Concerto in F for Bass Tuba Golden Brass: The Collector's Edition */ public class Publish : Element { #region << Constructors >> public Publish() { this.TagName = "publish"; this.Namespace = Uri.PUBSUB; } /// /// Its recommended to use this constructor because a node is required /// /// Node to publish public Publish(string node) : this() { this.Node = node; } public Publish(string node, Item item) : this(node) { this.AddItem(item); } #endregion /// /// The node to publish to. This Property is required /// public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } /// /// Add a payload Item /// /// returns the added Item public Item AddItem() { Item item = new Item(); AddChild(item); return item; } /// /// /// /// /// returns the added item public Item AddItem(Item item) { AddChild(item); return item; } /// /// This will return all payload items. Multiple items are possible, but doe the most implementaions one item /// should be enough /// /// returns an Array of Items public Item[] GetItems() { ElementList nl = SelectElements(typeof(Item)); Item[] items = new Item[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (Item)e; i++; } return items; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/owner/0000755000175000017500000000000012204443225025772 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/owner/Purge.cs0000644000175000017500000000301412204443225027401 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.extensions.pubsub.owner { // Only the Namespace is different to Purge in the Event Namespace public class Purge : @event.Purge { #region << Constructors >> public Purge() : base() { this.Namespace = Uri.PUBSUB_OWNER; } public Purge(string node) : this() { this.Node = node; } #endregion } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/owner/Configure.cs0000644000175000017500000000415312204443225030245 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.protocol.x.data; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub.owner { public class Configure : Element { #region << Constructor >> public Configure() { TagName = "configure"; Namespace = Uri.PUBSUB_OWNER; } public Configure(string node) : this() { Node = node; } #endregion public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } /// /// The x-Data Element /// public Data Data { get { return SelectSingleElement(typeof(Data)) as Data; } set { if (HasTag(typeof(Data))) RemoveTag(typeof(Data)); if (value != null) AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/owner/Pending.cs0000644000175000017500000000422412204443225027707 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.x.data; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub.owner { public class Pending : Element { #region << Constructors >> public Pending() { this.TagName = "pending"; this.Namespace = Uri.PUBSUB_OWNER; } public Pending(string node) : this() { this.Node = node; } #endregion public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } /// /// The x-Data Element /// public Data Data { get { return SelectSingleElement(typeof(Data)) as Data; } set { if (HasTag(typeof(Data))) RemoveTag(typeof(Data)); if (value != null) this.AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/owner/Subscribers.cs0000644000175000017500000000753112204443225030615 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub.owner { /* */ public class Subscribers : Element { #region << Constructors >> public Subscribers() { this.TagName = "subscribers"; this.Namespace = Uri.PUBSUB_OWNER; } public Subscribers(string node) : this() { this.Node = node; } #endregion public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } /// /// Add a Subscriber /// /// public Subscriber AddSubscriber() { Subscriber subscriber = new Subscriber(); AddChild(subscriber); return subscriber; } /// /// Add a Subscriber /// /// the Subscriber to add /// public Subscriber AddSubscriber(Subscriber subscriber) { AddChild(subscriber); return subscriber; } public void AddSubscribers(Subscriber[] subscribers) { foreach (Subscriber subscriber in subscribers) { AddSubscriber(subscriber); } } /// /// /// /// public Subscriber[] GetSubscribers() { ElementList nl = SelectElements(typeof(Subscriber)); Subscriber[] subscribers = new Subscriber[nl.Count]; int i = 0; foreach (Element e in nl) { subscribers[i] = (Subscriber) e; i++; } return subscribers; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/owner/PubSubIq.cs0000644000175000017500000000453012204443225030015 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.protocol.client; namespace agsXMPP.protocol.extensions.pubsub.owner { public class PubSubIq : IQ { /* Example 133. Owner deletes a node */ private PubSub m_PubSub = new PubSub(); #region << Constructors >> public PubSubIq() { this.GenerateId(); this.AddChild(m_PubSub); } public PubSubIq(IqType type) : this() { this.Type = type; } public PubSubIq(IqType type, Jid to) : this(type) { this.To = to; } public PubSubIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } #endregion public PubSub PubSub { get { return m_PubSub; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/owner/Affiliate.cs0000644000175000017500000000711712204443225030213 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub.owner { /* */ public class Affiliate : Element { #region << Constructors >> public Affiliate() { this.TagName = "affiliate"; this.Namespace = Uri.PUBSUB_OWNER; } public Affiliate(Jid jid, AffiliationType affiliation) : this() { this.Jid = jid; this.Affiliation = affiliation; } #endregion public Jid Jid { get { if (HasAttribute("jid")) return new Jid(this.GetAttribute("jid")); else return null; } set { if (value != null) this.SetAttribute("jid", value.ToString()); } } public AffiliationType Affiliation { get { return (AffiliationType) GetAttributeEnum("affiliation", typeof(AffiliationType)); } set { SetAttribute("affiliation", value.ToString()); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/owner/PubSub.cs0000644000175000017500000000656712204443225027537 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub.owner { public class PubSub : Element { public PubSub() { this.TagName = "pubsub"; this.Namespace = Uri.PUBSUB_OWNER; } public Delete Delete { get { return SelectSingleElement(typeof(Delete)) as Delete; } set { if (HasTag(typeof(Delete))) RemoveTag(typeof(Delete)); if (value != null) this.AddChild(value); } } public Purge Purge { get { return SelectSingleElement(typeof(Purge)) as Purge; } set { if (HasTag(typeof(Purge))) RemoveTag(typeof(Purge)); if (value != null) this.AddChild(value); } } public Subscribers Subscribers { get { return SelectSingleElement(typeof(Subscribers)) as Subscribers; } set { if (HasTag(typeof(Subscribers))) RemoveTag(typeof(Subscribers)); if (value != null) this.AddChild(value); } } public Affiliates Affiliates { get { return SelectSingleElement(typeof(Affiliates)) as Affiliates; } set { if (HasTag(typeof(Affiliates))) RemoveTag(typeof(Affiliates)); if (value != null) this.AddChild(value); } } public Configure Configure { get { return SelectSingleElement(typeof(Configure)) as Configure; } set { if (HasTag(typeof(Configure))) RemoveTag(typeof(Configure)); if (value != null) this.AddChild(value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/owner/Delete.cs0000644000175000017500000000305212204443225027523 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.extensions.pubsub.owner { // Only the Namespace is different to Delete in the event Namespace public class Delete : @event.Delete { #region << Constructors >> public Delete() : base() { this.Namespace = Uri.PUBSUB_OWNER; } public Delete(string node) { this.Node = node; } #endregion } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/owner/Subscriber.cs0000644000175000017500000000675012204443225030434 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub.owner { /* */ public class Subscriber : Element { #region << Constructors >> public Subscriber() { this.TagName = "subscriber"; this.Namespace = Uri.PUBSUB_OWNER; } public Subscriber(Jid jid, SubscriptionState sub) : this() { this.Jid = jid; this.SubscriptionState = sub; } #endregion public SubscriptionState SubscriptionState { get { return (SubscriptionState)GetAttributeEnum("subscription", typeof(SubscriptionState)); } set { SetAttribute("subscription", value.ToString()); } } public Jid Jid { get { if (HasAttribute("jid")) return new Jid(this.GetAttribute("jid")); else return null; } set { if (value!=null) this.SetAttribute("jid", value.ToString()); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/owner/Affiliates.cs0000644000175000017500000000754212204443225030400 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub.owner { /* */ public class Affiliates : Element { #region << Constructors >> public Affiliates() { this.TagName = "affiliates"; this.Namespace = Uri.PUBSUB_OWNER; } public Affiliates(string node) : this() { this.Node = node; } #endregion public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } /// /// /// /// public Affiliate AddAffiliate() { Affiliate affiliate = new Affiliate(); AddChild(affiliate); return affiliate; } /// /// /// /// /// public Affiliate AddAffiliate(Affiliate affiliate) { AddChild(affiliate); return affiliate; } /// /// /// /// public void AddAffiliates(Affiliate[] affiliates) { foreach (Affiliate affiliate in affiliates) { AddAffiliate(affiliate); } } /// /// /// /// public Affiliate[] GetAffiliates() { ElementList nl = SelectElements(typeof(Affiliate)); Affiliate[] affiliates = new Affiliate[nl.Count]; int i = 0; foreach (Element e in nl) { affiliates[i] = (Affiliate)e; i++; } return affiliates; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Create.cs0000644000175000017500000000434512204443225026400 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { public class Create : PubSubAction { /* ... ... */ #region << Constructors >> public Create() : base() { this.TagName = "create"; } public Create(string node) : this() { this.Node = node; } public Create(Type type) : this() { this.Type = type; } public Create(string node, Type type) : this(node) { this.Type = type; } #endregion } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/event/0000755000175000017500000000000012204443225025761 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/event/Purge.cs0000644000175000017500000000323012204443225027370 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub.@event { public class Purge : Element { #region << Constructors >> public Purge() { this.TagName = "purge"; this.Namespace = Uri.PUBSUB_EVENT; } public Purge(string node) : this() { this.Node = node; } #endregion public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/event/Event.cs0000644000175000017500000000503212204443225027371 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub.@event { public class Event : Element { public Event() { this.TagName = "event"; this.Namespace = Uri.PUBSUB_EVENT; } public Delete Delete { get { return SelectSingleElement(typeof(Delete)) as Delete; } set { if (HasTag(typeof(Delete))) RemoveTag(typeof(Delete)); if (value != null) this.AddChild(value); } } public Purge Purge { get { return SelectSingleElement(typeof(Purge)) as Purge; } set { if (HasTag(typeof(Purge))) RemoveTag(typeof(Purge)); if (value != null) this.AddChild(value); } } public Items Items { get { return SelectSingleElement(typeof(Items)) as Items; } set { if (HasTag(typeof(Items))) RemoveTag(typeof(Items)); if (value != null) this.AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/event/Items.cs0000644000175000017500000001042112204443225027367 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub.@event { /* Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z */ public class Items : Element { #region << Constructors >> public Items() { this.TagName = "items"; this.Namespace = Uri.PUBSUB_EVENT; } public Items(string node) : this() { this.Node = node; } #endregion public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } /// /// Add a payload Item /// /// returns the added Item public Item AddItem() { Item item = new Item(); AddChild(item); return item; } /// /// /// /// /// returns the added item public Item AddItem(Item item) { AddChild(item); return item; } /// /// This will return all payload items. Multiple items are possible, but doe the most implementaions one item /// should be enough /// /// returns an Array of Items public Item[] GetItems() { ElementList nl = SelectElements(typeof(Item)); Item[] items = new Item[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (Item)e; i++; } return items; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/event/Item.cs0000644000175000017500000000673212204443225027216 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.extensions.pubsub.@event { /* Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z */ // This class is the same as the Item class in the main pubsub namespace, // so inherit it and overwrite some properties and functions public class Item : agsXMPP.protocol.extensions.pubsub.Item { #region << Constructors >> public Item() : base() { this.Namespace = Uri.PUBSUB_EVENT; } public Item(string id) : this() { this.Id = id; } #endregion private const string RETRACT = "retract"; public bool Retract { get { return HasTag(RETRACT); } set { if (value) SetTag(RETRACT); else RemoveTag(RETRACT); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/event/Delete.cs0000644000175000017500000000322212204443225027511 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub.@event { public class Delete : Element { #region << Constructors >> public Delete() { this.TagName = "delete"; this.Namespace = Uri.PUBSUB_EVENT; } public Delete(string node) : this() { this.Node = node; } #endregion public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/PubSubIq.cs0000644000175000017500000000462012204443225026663 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.protocol.client; namespace agsXMPP.protocol.extensions.pubsub { public class PubSubIq : IQ { /* Example 1. Entity requests a new node with default configuration. */ private PubSub m_PubSub = new PubSub(); #region << Constructors >> public PubSubIq() { this.GenerateId(); this.AddChild(m_PubSub); } public PubSubIq(IqType type) : this() { this.Type = type; } public PubSubIq(IqType type, Jid to) : this(type) { this.To = to; } public PubSubIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } #endregion public PubSub PubSub { get { return m_PubSub; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/AffiliationType.cs0000644000175000017500000000251312204443225030257 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.extensions.pubsub { /// /// /// public enum AffiliationType { /// /// the absence of an affiliation /// none, owner, publisher, outcast } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Affiliation.cs0000644000175000017500000000503512204443225027417 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { /* */ public class Affiliation : Element { #region << Constructors >> public Affiliation() { this.TagName = "affiliation"; this.Namespace = Uri.PUBSUB; } public Affiliation(Jid jid, AffiliationType affiliation) { this.Jid = jid; this.AffiliationType = affiliation; } public Affiliation(string node, Jid jid, AffiliationType affiliation) : this(jid, affiliation) { this.Node = node; } #endregion public Jid Jid { get { if (HasAttribute("jid")) return new Jid(this.GetAttribute("jid")); else return null; } set { if (value!=null) this.SetAttribute("jid", value.ToString()); } } public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } public AffiliationType AffiliationType { get { return (AffiliationType)GetAttributeEnum("affiliation", typeof(AffiliationType)); } set { SetAttribute("affiliation", value.ToString()); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/SubscriptionState.cs0000644000175000017500000000522612204443225030661 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.extensions.pubsub { /* None The node MUST NOT send event notifications or payloads to the Entity. Pending An entity has requested to subscribe to a node and the request has not yet been approved by a node owner. The node MUST NOT send event notifications or payloads to the entity while it is in this state. Unconfigured An entity has subscribed but its subscription options have not yet been configured. The node MAY send event notifications or payloads to the entity while it is in this state. The service MAY timeout unconfigured subscriptions. Subscribed */ public enum SubscriptionState { /// /// The node MUST NOT send event notifications or payloads to the Entity. /// none, /// /// An entity has requested to subscribe to a node and the request has not yet been approved /// by a node owner. The node MUST NOT send event notifications or payloads to the entity /// while it is in this state. /// pending, /// /// An entity has subscribed but its subscription options have not yet been configured. /// The node MAY send event notifications or payloads to the entity while it is in this state. /// The service MAY timeout unconfigured subscriptions. /// unconfigured, /// /// /// subscribed } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/PubSub.cs0000644000175000017500000001311712204443225026372 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { public class PubSub : Element { public PubSub() { this.TagName = "pubsub"; this.Namespace = Uri.PUBSUB; } /// /// the Create Element of the Pubsub Element /// public Create Create { get { return SelectSingleElement(typeof(Create)) as Create; } set { if (HasTag(typeof(Create))) RemoveTag(typeof(Create)); if (value != null) this.AddChild(value); } } public Publish Publish { get { return SelectSingleElement(typeof(Publish)) as Publish; } set { if (HasTag(typeof(Publish))) RemoveTag(typeof(Publish)); if (value != null) this.AddChild(value); } } public Retract Retract { get { return SelectSingleElement(typeof(Retract)) as Retract; } set { if (HasTag(typeof(Retract))) RemoveTag(typeof(Retract)); if (value != null) this.AddChild(value); } } public Subscribe Subscribe { get { return SelectSingleElement(typeof(Subscribe)) as Subscribe; } set { if (HasTag(typeof(Subscribe))) RemoveTag(typeof(Subscribe)); if (value != null) this.AddChild(value); } } public Unsubscribe Unsubscribe { get { return SelectSingleElement(typeof(Unsubscribe)) as Unsubscribe; } set { if (HasTag(typeof(Unsubscribe))) RemoveTag(typeof(Unsubscribe)); if (value != null) this.AddChild(value); } } public Subscriptions Subscriptions { get { return SelectSingleElement(typeof(Subscriptions)) as Subscriptions; } set { if (HasTag(typeof(Subscriptions))) RemoveTag(typeof(Subscriptions)); if (value != null) this.AddChild(value); } } public Affiliations Affiliations { get { return SelectSingleElement(typeof(Affiliations)) as Affiliations; } set { if (HasTag(typeof(Affiliations))) RemoveTag(typeof(Affiliations)); if (value != null) this.AddChild(value); } } public Options Options { get { return SelectSingleElement(typeof(Options)) as Options; } set { if (HasTag(typeof(Options))) RemoveTag(typeof(Options)); if (value != null) this.AddChild(value); } } public Items Items { get { return SelectSingleElement(typeof(Items)) as Items; } set { if (HasTag(typeof(Items))) RemoveTag(typeof(Items)); if (value != null) this.AddChild(value); } } /// /// The Configure Element of the PunSub Element /// public Configure Configure { get { return SelectSingleElement(typeof(Configure)) as Configure; } set { if (HasTag(typeof(Configure))) RemoveTag(typeof(Configure)); if (value != null) this.AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Item.cs0000644000175000017500000000366412204443225026076 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { /* */ public class Item : Element { public Item() { this.TagName = "item"; this.Namespace = Uri.PUBSUB; } public Item(string id) : this() { this.Id = id; } /// /// The optional id /// public string Id { get { return GetAttribute("id"); } set { SetAttribute("id", value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Subscriptions.cs0000644000175000017500000000701712204443225030043 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { public class Subscriptions : Element { /* Example 14. Entity requests all current subscriptions Example 15. Service returns all current subscriptions */ public Subscriptions() { this.TagName = "subscriptions"; this.Namespace = Uri.PUBSUB; } /// /// /// /// public Subscription AddSubscription() { Subscription sub = new Subscription(); AddChild(sub); return sub; } /// /// /// /// /// public Subscription AddSubscription(Subscription sub) { AddChild(sub); return sub; } public Subscription[] GetSubscriptions() { ElementList nl = SelectElements(typeof(Subscription)); Subscription[] items = new Subscription[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (Subscription) e; i++; } return items; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/pubsub/Subscription.cs0000644000175000017500000001532512204443225027661 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.pubsub { public class Subscription : Element { /* Example 23. Service replies with success Example 36. Service replies with success and indicates that subscription configuration is required */ #region << Constructors >> public Subscription() { this.TagName = "subscription"; this.Namespace = Uri.PUBSUB; } public Subscription(Jid jid) : this() { this.Jid = jid; } public Subscription(Jid jid, SubscriptionState subType) : this(jid) { this.SubscriptionState = subType; } public Subscription(Jid jid, string node) : this() { this.Node = node; } public Subscription(Jid jid, string node, SubscriptionState subType) : this(jid, node) { this.SubscriptionState = subType; } public Subscription(Jid jid, string node, string subId) : this(jid, node) { this.SubId = subId; } public Subscription(Jid jid, string node, string subId, SubscriptionState subType) : this(jid, node, subId) { this.SubscriptionState = subType; } #endregion /// /// Node (optional) /// public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } public Jid Jid { get { if (HasAttribute("jid")) return new Jid(this.GetAttribute("jid")); else return null; } set { if (value != null) this.SetAttribute("jid", value.ToString()); else RemoveAttribute("jid"); } } /// /// Subscription ID (optional) /// public string SubId { get { return GetAttribute("subid"); } set { if (value != null) SetAttribute("subid", value); else RemoveAttribute("subid"); } } //public Affiliation Affiliation //{ // get // { // return (Affiliation)GetAttributeEnum("affiliation", typeof(Affiliation)); // } // set // { // SetAttribute("affiliation", value.ToString()); // } //} public SubscriptionState SubscriptionState { get { return (SubscriptionState) GetAttributeEnum("subscription", typeof(SubscriptionState)); } set { SetAttribute("subscription", value.ToString()); } } public SubscribeOptions SubscribeOptions { get { return SelectSingleElement(typeof(SubscribeOptions)) as SubscribeOptions; } set { if (HasTag(typeof(SubscribeOptions))) RemoveTag(typeof(SubscribeOptions)); if (value != null) this.AddChild(value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/primary/0000755000175000017500000000000012204443225025023 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/primary/Primary.cs0000644000175000017500000000303712204443225027000 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.primary { /// /// http://www.jabber.org/jeps/inbox/primary.html /// public class Primary : Element { /* I'm back!

    */ public Primary() { this.TagName = "p"; this.Namespace = Uri.PRIMARY; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/compression/0000755000175000017500000000000012204443225025701 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/compression/Compress.cs0000644000175000017500000000451412204443225030027 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.compression { // // zlib // public class Compress : Element { #region << Constructors >> public Compress() { this.TagName = "compress"; this.Namespace = Uri.COMPRESS; } ///

    /// Constructor with a given method/algorithm for Stream compression /// /// method/algorithm used to compressing the stream public Compress(CompressionMethod method) : this() { this.Method = method; } #endregion /// /// method/algorithm used to compressing the stream /// public CompressionMethod Method { set { if (value != CompressionMethod.Unknown) SetTag("method", value.ToString()); } get { return (CompressionMethod) GetTagEnum("method", typeof(CompressionMethod)); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/compression/Compressed.cs0000644000175000017500000000304312204443225030334 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.compression { /* * Example 5. Receiving Entity Acknowledges Stream Compression * */ public class Compressed : Element { public Compressed() { this.TagName = "compressed"; this.Namespace = Uri.COMPRESS; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/compression/CompressionMethod.cs0000644000175000017500000000236112204443225031674 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.extensions.compression { public enum CompressionMethod { Unknown = -1, zlib, lzw } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/compression/Failure.cs0000644000175000017500000000451312204443225027622 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.compression { /* * * Note: If the initiating entity did not understand any of the advertised compression methods, * it SHOULD ignore the compression option and proceed as if no compression methods were advertised. * * If the initiating entity requests a stream compression method that is not supported by the * receiving entity, the receiving entity MUST return an error: * * Example 3. Receiving Entity Reports That Method is Unsupported * * * * * If the receiving entity cannot establish compression using the requested method for any * other reason, it MUST return a error: * * Example 4. Receiving Entity Reports That Compression Setup Failed * * * */ public class Failure : Element { public Failure() { this.TagName = "failure"; this.Namespace = Uri.COMPRESS; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/ping/0000755000175000017500000000000012204443225024275 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/ping/PingIq.cs0000644000175000017500000000337012204443225026016 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol; using agsXMPP.protocol.client; namespace agsXMPP.protocol.extensions.ping { /// /// /// public class PingIq : IQ { private Ping m_Ping = new Ping(); #region << Constructors >> public PingIq() { base.Query = m_Ping; this.GenerateId(); } public PingIq(Jid to) : this() { To = to; } public PingIq(Jid to, Jid from) : this() { To = to; From = from; } #endregion public new Ping Query { get { return m_Ping; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/ping/Ping.cs0000644000175000017500000000275412204443225025531 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.ping { /* * * * */ public class Ping : Element { public Ping() { this.TagName = "ping"; this.Namespace = Uri.PING; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bookmarks/0000755000175000017500000000000012250206660025331 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bookmarks/Url.cs0000644000175000017500000000447112204443225026427 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.bookmarks { /// /// URLs are fairly simple, as they only need to store a URL and a title, /// and the client then can simply launch the appropriate browser. /// public class Url : Element { /* */ public Url() { this.TagName = "url"; this.Namespace = Uri.STORAGE_BOOKMARKS; } public Url(string address, string name) : this() { Address = address; Name = name; } /// /// A description/name for this bookmark /// public string Name { get { return GetAttribute("name"); } set { SetAttribute("name", value); } } /// /// The url address to store e.g. http://www.ag-software,de/ /// public string Address { get { return GetAttribute("url"); } set { SetAttribute("url", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bookmarks/Conference.cs0000644000175000017500000000772112204443225027735 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.bookmarks { /// /// One of the most common uses of bookmarks will likely be to bookmark /// conference rooms on various Jabber servers /// public class Conference : Element { /* Puck titania */ public Conference() { this.TagName = "conference"; this.Namespace = Uri.STORAGE_BOOKMARKS; } public Conference(Jid jid, string name) : this() { Jid = jid; Name = name; } public Conference(Jid jid, string name, string nickname) : this( jid, name) { Nickname = nickname; } public Conference(Jid jid, string name, string nickname, string password) : this(jid, name, nickname) { Password = password; } public Conference(Jid jid, string name, string nickname, string password, bool autojoin) : this(jid, name, nickname, password) { AutoJoin = autojoin; } /// /// A name/description for this bookmarked room /// public string Name { get { return GetAttribute("name"); } set { SetAttribute("name", value); } } /// /// Should the client join this room automatically after successfuil login? /// public bool AutoJoin { get { return GetAttributeBool("autojoin"); } set { SetAttribute("autojoin", value); } } /// /// The Jid of the bookmarked room /// public Jid Jid { get { return GetAttributeJid("jid"); } set { SetAttribute("jid", value); } } /// /// The Nickname for this room /// public string Nickname { get { return GetTag("nick"); } set { SetTag("nick", value); } } /// /// The password for password protected rooms /// public string Password { get { return GetTag("password"); } set { SetTag("password", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bookmarks/StorageIq.cs0000644000175000017500000000331712204443225027561 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; using agsXMPP.protocol.client; using agsXMPP.protocol.iq.@private; namespace agsXMPP.protocol.extensions.bookmarks { /// /// /// public class StorageIq : PrivateIq { public StorageIq() { this.Query.AddChild(new Storage()); } public StorageIq(IqType type) : this() { this.Type = type; } public StorageIq(IqType type, Jid to) : this(type) { this.To = to; } public StorageIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bookmarks/RosterNote.cs0000644000175000017500000000644112204443225027770 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.bookmarks { /// /// Annotations are stored using server-side private XML storage. /// A storage element contains a collection of one or more notes elements, /// each representing a note about a given entity. /// public class RosterNote : Element { /* Seems to be a good writer Oh my sweetest love ... */ public RosterNote() { TagName = "note"; Namespace = Uri.STORAGE_ROSTERNOTES; } public RosterNote(Jid jid, DateTime cdate, DateTime mdate, string note) : this() { Jid = jid; CreationDate = cdate; ModificationDate = mdate; Value = note; } /// /// Creation date time /// public DateTime CreationDate { get { return Util.Time.ISO_8601Date(GetAttribute("cdate")); } set { SetAttribute("cdate", Util.Time.ISO_8601Date(value)); } } /// /// Modification date tiime /// public DateTime ModificationDate { get { return Util.Time.ISO_8601Date(GetAttribute("mdate")); } set { SetAttribute("mdate", Util.Time.ISO_8601Date(value)); } } /// /// The Jid of the bookmarked room /// public Jid Jid { get { return GetAttributeJid("jid"); } set { SetAttribute("jid", value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bookmarks/RosterNotes.cs0000644000175000017500000000645312204443225030156 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.bookmarks { /// /// /// public class RosterNotes : Element { /* Seems to be a good writer Oh my sweetest love ... */ public RosterNotes() { TagName = "storage"; Namespace = Uri.STORAGE_ROSTERNOTES; } /// /// Add a note to the storage object /// /// The note. /// public RosterNote AddNote(RosterNote note) { AddChild(note); return note; } /// /// Add a note to the storage object /// /// /// /// /// /// public RosterNote AddNote(Jid jid, DateTime cdate, DateTime mdate, string note) { return AddNote(new RosterNote(jid, cdate, mdate, note)); } /// /// get all roster notes /// /// public RosterNote[] GetRosterNotes() { ElementList nl = SelectElements(typeof(RosterNote)); RosterNote[] items = new RosterNote[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (RosterNote)e; i++; } return items; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bookmarks/Storage.cs0000644000175000017500000001401312204443225027262 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.bookmarks { /// /// /// public class Storage : Element { /* Puck titania */ public Storage() { TagName = "storage"; Namespace = Uri.STORAGE_BOOKMARKS; } /// /// Add a conference bookmark to the storage object /// /// /// public Conference AddConference(Conference conf) { AddChild(conf); return conf; } /// /// Add a conference bookmark to the storage object /// /// /// /// public Conference AddConference(Jid jid, string name) { return AddConference(new Conference(jid, name)); } /// /// Add a conference bookmark to the storage object /// /// /// /// /// public Conference AddConference(Jid jid, string name, string nickname) { return AddConference(new Conference(jid, name, nickname)); } /// /// Add a conference bookmark to the storage object /// /// /// /// /// /// public Conference AddConference(Jid jid, string name, string nickname, string password) { return AddConference(new Conference(jid, name, nickname, password)); } /// /// /// /// /// /// /// /// /// public Conference AddConference(Jid jid, string name, string nickname, string password, bool autojoin) { return AddConference(new Conference(jid, name, nickname, password, autojoin)); } /// /// add multiple conference bookmarks /// /// public void AddConferences(Conference[] confs) { foreach (Conference conf in confs) { AddConference(conf); } } /// /// get all conference booksmarks /// /// public Conference[] GetConferences() { ElementList nl = SelectElements(typeof(Conference)); Conference[] items = new Conference[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (Conference)e; i++; } return items; } /// /// add a url bookmark /// /// /// public Url AddUrl(Url url) { AddChild(url); return url; } public Url AddUrl(string address, string name) { return AddUrl(new Url(address, name)); } /// /// add multiple url bookmarks /// /// public void AddUrls(Url[] urls) { foreach (Url url in urls) { AddUrl(url); } } /// /// Get all url bookmarks /// /// public Url[] GetUrls() { ElementList nl = SelectElements(typeof(Url)); Url[] items = new Url[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (Url) e; i++; } return items; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bookmarks/BookmarkManager.cs0000644000175000017500000001107112250206660030720 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.extensions.bookmarks { public class BookmarkManager { private XmppClientConnection m_connection = null; public BookmarkManager(XmppClientConnection con) { m_connection = con; } #region << Request Bookmarks >> /// /// Request the bookmarks from the storage on the server /// public void RequestBookmarks() { RequestBookmarks(null); } /// /// Request the bookmarks from the storage on the server /// /// /// public void RequestBookmarks(IqHandler cb) { StorageIq siq = new StorageIq(IqType.get); if (cb == null) m_connection.Send(siq); else m_connection.IqGrabber.SendIq(siq, cb); } #endregion #region << Store Bookmarks >> /// /// Send booksmarks to the server storage /// /// public void StoreBookmarks(Url[] urls) { StoreBookmarks(urls, null, null); } /// /// Send booksmarks to the server storage /// /// /// /// public void StoreBookmarks(Url[] urls, IqHandler cb) { StoreBookmarks(urls, null, cb); } /// /// Send booksmarks to the server storage /// /// public void StoreBookmarks(Conference[] conferences) { StoreBookmarks(null, conferences, null); } /// /// Send booksmarks to the server storage /// /// /// /// public void StoreBookmarks(Conference[] conferences, IqHandler cb) { StoreBookmarks(null, conferences, cb); } /// /// Send booksmarks to the server storage /// /// /// public void StoreBookmarks(Url[] urls, Conference[] conferences) { StoreBookmarks(urls, conferences, null); } /// /// Send booksmarks to the server storage /// /// /// /// /// public void StoreBookmarks(Url[] urls, Conference[] conferences, IqHandler cb) { StorageIq siq = new StorageIq(IqType.set); if (urls != null) siq.Query.Storage.AddUrls(urls); if (conferences != null) siq.Query.Storage.AddConferences(conferences); if (cb == null) m_connection.Send(siq); else m_connection.IqGrabber.SendIq(siq, cb); } #endregion } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bytestreams/0000755000175000017500000000000012204443225025702 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bytestreams/ByteStream.cs0000644000175000017500000001454712204443225030323 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.bytestreams { /* target@host2/bar */ /// /// ByteStreams /// public class ByteStream : Element { public ByteStream() { this.TagName = "query"; this.Namespace = Uri.BYTESTREAMS; } public string Sid { set { SetAttribute("sid", value); } get { return GetAttribute("sid"); } } public Mode Mode { get { return (Mode) GetAttributeEnum("mode", typeof(Mode)); } set { if (value != Mode.NONE) SetAttribute("mode", value.ToString()); else RemoveAttribute("mode"); } } /// /// Add a StreamHost /// /// public StreamHost AddStreamHost() { StreamHost sh = new StreamHost(); AddChild(sh); return sh; } /// /// Add a StreamHost /// /// /// public StreamHost AddStreamHost(StreamHost sh) { AddChild(sh); return sh; } /// /// Add a StreamHost /// /// /// /// public StreamHost AddStreamHost(Jid jid, string host) { StreamHost sh = new StreamHost(jid, host); AddChild(sh); return sh; } /// /// Add a StreamHost /// /// /// /// /// public StreamHost AddStreamHost(Jid jid, string host, int port) { StreamHost sh = new StreamHost(jid, host, port); AddChild(sh); return sh; } /// /// Add a StreamHost /// /// /// /// /// /// public StreamHost AddStreamHost(Jid jid, string host, int port, string zeroconf) { StreamHost sh = new StreamHost(jid, host, port, zeroconf); AddChild(sh); return sh; } /// /// Get the list of streamhosts /// /// public StreamHost[] GetStreamHosts() { ElementList nl = SelectElements(typeof(StreamHost)); StreamHost[] hosts = new StreamHost[nl.Count]; int i = 0; foreach (Element e in nl) { hosts[i] = (StreamHost) e; i++; } return hosts; } /// /// The activate Element /// public Activate Activate { get { return SelectSingleElement(typeof(Activate)) as Activate; } set { if (HasTag(typeof(Activate))) RemoveTag(typeof(Activate)); if (value != null) this.AddChild(value); } } public StreamHostUsed StreamHostUsed { get { return SelectSingleElement(typeof(StreamHostUsed)) as StreamHostUsed; } set { if (HasTag(typeof(StreamHostUsed))) RemoveTag(typeof(StreamHostUsed)); if (value != null) this.AddChild(value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bytestreams/StreamHostUsed.cs0000644000175000017500000000521712204443225031150 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.bytestreams { /* */ /// /// The element indicates the StreamHost connected to. /// This element has a single attribute for the JID of the StreamHost to which the Target connected. /// This element MUST NOT contain any content node. /// The "jid" attribute specifies the full JID of the StreamHost. /// This attribute MUST be present, and MUST be a valid JID for use with an <iq/>. /// public class StreamHostUsed : Element { public StreamHostUsed() { this.TagName = "streamhost-used"; this.Namespace = Uri.BYTESTREAMS; } public StreamHostUsed(Jid jid) : this() { Jid = jid; } /// /// Jid of the streamhost /// public Jid Jid { get { if (HasAttribute("jid")) return new Jid(this.GetAttribute("jid")); else return null; } set { if (value!=null) this.SetAttribute("jid", value.ToString()); else RemoveAttribute("jid"); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bytestreams/UdpSuccess.cs0000644000175000017500000000354312204443225030317 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.bytestreams { /* */ public class UdpSuccess : Element { public UdpSuccess(string dstaddr) { this.TagName = "udpsuccess"; this.Namespace = Uri.BYTESTREAMS; DestinationAddress = dstaddr; } public string DestinationAddress { get { return GetAttribute("dstaddr"); } set { SetAttribute("dstaddr", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bytestreams/ByteStreamIq.cs0000644000175000017500000000420612204443225030604 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; namespace agsXMPP.protocol.extensions.bytestreams { /// /// a Bytestream IQ /// public class ByteStreamIq : IQ { private ByteStream m_ByteStream = new ByteStream(); public ByteStreamIq() { base.Query = m_ByteStream; this.GenerateId(); } public ByteStreamIq(IqType type) : this() { this.Type = type; } public ByteStreamIq(IqType type, Jid to) : this(type) { this.To = to; } public ByteStreamIq(IqType type, Jid to, Jid from) : this(type, to) { this.From = from; } public ByteStreamIq(IqType type, Jid to, Jid from, string Id) : this(type, to, from) { this.Id = Id; } public new ByteStream Query { get { return m_ByteStream; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bytestreams/StreamHost.cs0000644000175000017500000001005612204443225030324 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.bytestreams { /* */ public class StreamHost : Element { public StreamHost() { this.TagName = "streamhost"; this.Namespace = Uri.BYTESTREAMS; } public StreamHost(Jid jid, string host) : this() { Jid = jid; Host = host; } public StreamHost(Jid jid, string host, int port) : this(jid, host) { Port = port; } public StreamHost(Jid jid, string host, int port, string zeroconf) : this(jid, host, port) { Zeroconf = zeroconf; } /// /// a port associated with the hostname or IP address for SOCKS5 communications over TCP /// public int Port { get { return GetAttributeInt("port"); } set { SetAttribute("port", value); } } /// /// the hostname or IP address of the StreamHost for SOCKS5 communications over TCP /// public string Host { get { return GetAttribute("host"); } set { SetAttribute("host", value); } } /// /// The XMPP/Jabber id of the streamhost /// public Jid Jid { get { if (HasAttribute("jid")) return new Jid(this.GetAttribute("jid")); else return null; } set { if (value != null) this.SetAttribute("jid", value.ToString()); else RemoveAttribute("jid"); } } /// /// a zeroconf [5] identifier to which an entity may connect, for which the service identifier and /// protocol name SHOULD be "_jabber.bytestreams". /// public string Zeroconf { get { return GetAttribute("zeroconf"); } set { SetAttribute("zeroconf", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bytestreams/Activate.cs0000644000175000017500000000373012204443225027774 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.bytestreams { public class Activate : Element { public Activate() { this.TagName = "activate"; this.Namespace = Uri.BYTESTREAMS; } public Activate(Jid jid) : this() { Jid = jid; } /// /// the full JID of the Target to activate /// public Jid Jid { get { if (Value == null) return null; else return new Jid(Value); } set { if (value != null) Value = value.ToString(); else Value = null; } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bytestreams/Mode.cs0000644000175000017500000000250612204443225027120 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.extensions.bytestreams { /// /// The Mode for the bytestream socket layer (tcp or udp) /// public enum Mode { NONE = -1, tcp, udp } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/jivesoftware/0000755000175000017500000000000012204443225026050 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/jivesoftware/phone/0000755000175000017500000000000012204443225027161 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/jivesoftware/phone/ActionType.cs0000644000175000017500000000273312204443225031574 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.extensions.jivesoftware.phone { /// /// Action type, Currently supported types are DIAL and FORWARD /// public enum ActionType { /// /// /// DIAL, /// /// /// FORWARD } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/jivesoftware/phone/PhoneAction.cs0000644000175000017500000000733712204443225031731 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.jivesoftware.phone { public class PhoneAction : Element { /* * Actions are sent by the client to perform tasks such as dialing, checking for messages, etc. Actions are sent as IQ's (type set), as with the following child stanza: * * * 5035555555 * * * Currently supported types are DIAL and FORWARD. * In most implementations, issuing a dial command will cause the user's phone to ring. * Once the user picks up, the specified extension will be dialed. * * Dialing can also be performed by jid too. The jid must be dialed must be mapped on the server to an extension * * * andrew@jivesoftware.com * * * Issuing a action wth a type FORWARD should transfer a call that has already been * established to a third party. The FORWARD type requires an extension or jid child element * * * 5035555555 * * */ #region << Constructors >> /// /// /// public PhoneAction() { this.TagName = "phone-action"; this.Namespace = Uri.JIVESOFTWARE_PHONE; } public PhoneAction(ActionType type) : this() { Type = type; } public PhoneAction(ActionType type, string extension) : this(type) { Extension = extension; } public PhoneAction(ActionType type, Jid jid) : this(type) { Jid = jid; } #endregion public ActionType Type { set { SetAttribute("type", value.ToString()); } get { return (ActionType)GetAttributeEnum("type", typeof(ActionType)); } } public string Extension { get { return GetTag("extension"); } set { SetTag("extension", value); } } public Jid Jid { get { return new Jid(GetTag("jid")); } set { SetTag("jid", value.ToString()); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/jivesoftware/phone/PhoneStatusType.cs0000644000175000017500000000313012204443225032624 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.extensions.jivesoftware.phone { /// /// Events are sent to the user when their phone is ringing, /// when a call ends, etc. As with presence, /// pubsub should probably be the mechanism used for sending this information, /// but message packets are used to send events for the time being /// public enum PhoneStatusType { RING, DIALED, ON_PHONE, HANG_UP } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/jivesoftware/phone/PhoneStatus.cs0000644000175000017500000000513512204443225031771 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.jivesoftware.phone { /// /// A user's presence is updated when on a phone call. /// The Jive Messenger/Asterisk implementation will update the user's presence automatically /// by adding the following packet extension to the user's presence: /// <phone-status xmlns="http://jivesoftware.com/xmlns/phone" status="ON_PHONE" > /// Jive Messenger can also be configured to change the user's availability /// to "Away -- on the phone" when the user is on a call (in addition to the packet extension). /// This is useful when interacting with clients that don't understand the extended presence information /// or when using transports to other IM networks where extended presence information is not available. /// public class PhoneStatus : Element { /* * ; * */ public PhoneStatus() { this.TagName = "phone-status"; this.Namespace = Uri.JIVESOFTWARE_PHONE; } public PhoneStatusType Status { set { SetAttribute("status", value.ToString()); } get { return (PhoneStatusType)GetAttributeEnum("status", typeof(PhoneStatusType)); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/jivesoftware/phone/PhoneEvent.cs0000644000175000017500000000671112204443225031570 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.jivesoftware.phone { /* * * * * * * * * */ /// /// Events are sent to the user when their phone is ringing, when a call ends, etc. /// This packet is send within a message packet (subelement of message) /// public class PhoneEvent : Element { #region << Constructors >> public PhoneEvent() { this.TagName = "phone-event"; this.Namespace = Uri.JIVESOFTWARE_PHONE; } public PhoneEvent(PhoneStatusType status) : this() { Type = status; } public PhoneEvent(PhoneStatusType status, string device) : this(status) { Device = device; } public PhoneEvent(PhoneStatusType status, string device, string id) : this(status, device) { CallId = id; } public PhoneEvent(PhoneStatusType status, string device, string id, string callerId): this(status, device, id) { CallerId = callerId; } #endregion public string CallId { get { return GetAttribute("callID"); } set { SetAttribute("callID", value); } } public string Device { get { return GetAttribute("device"); } set { SetAttribute("device", value); } } public PhoneStatusType Type { set { SetAttribute("type", value.ToString()); } get { return (PhoneStatusType)GetAttributeEnum("type", typeof(PhoneStatusType)); } } public string CallerId { get { return GetTag("callerID"); } set { SetTag("callerID", value); } } public string CallerIdName { get { return GetTag("callerIDName"); } set { SetTag("callerIDName", value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/caps/0000755000175000017500000000000012204443225024266 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/caps/Capabilities.cs0000644000175000017500000002230512204443225027210 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections; using System.Text; using agsXMPP.protocol.iq.disco; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.caps { /* Example 1. Annotated presence sent Example 2. Annotated presence sent, with feature extensions */ /// /// /// It is often desirable for a Jabber/XMPP application (commonly but not necessarily a client) to take different actions /// depending on the capabilities of another application from which it receives presence information. Examples include: /// /// /// /// Showing a different set of icons depending on the capabilities of other clients. /// /// /// Not sending XHTML-IM content to plaintext clients such as cell phones. /// /// /// Allowing the initiation of Voice over IP (VoIP) sessions only to clients that support VoIP. /// /// /// Not showing a "Send a File" button if another user's client does not support File Transfer. /// /// /// /// Recently, some existing Jabber clients have begun sending Software Version requests to each entity from which they /// receive presence. That solution is impractical on a larger scale, particularly for users or applications with large rosters. /// This document proposes a more robust and scalable solution: namely, a presence-based mechanism for exchanging information /// about entity capabilities. /// /// public class Capabilities : Element { /// /// /// public Capabilities() { this.TagName = "c"; this.Namespace = Uri.CAPS; } /// /// /// /// /// public Capabilities(string version, string node) : this() { Version = version; Node = node; } /// /// Required node attribute /// public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } /// /// Required version attribute /// public string Version { get { return GetAttribute("ver"); } set { SetAttribute("ver", value); } } /// /// Required Hash-Type. /// public string Hash { get { return GetAttribute("hash"); } set { SetAttribute("hash", value); } } [Obsolete("This property is deprecated with version 1.4 of XEP-0115. You shouldn't use this propety anymore.")] public string[] Extensions { get { string ext = GetAttribute("ext"); if (ext != null) { string[] ret = ext.Split(' '); return ret; } else { return null; } } set { if (value != null) { string temp = null; for (int i = 0; i < value.Length; i++) { temp += value[i]; if (i < value.Length - 1) temp += " "; } SetAttribute("ext", temp); } } } /// /// Builds and sets the caps ver attribute from a DiscoInfo object /// /// public void SetVersion(DiscoInfo di) { Hash = "sha-1"; Version = BuildCapsVersion(di); } private string BuildCapsVersion(DiscoInfo di) { /* 1. Initialize an empty string S. 2. Sort the service discovery identities by category and then by type (if it exists), formatted as 'category' '/' 'type'. 3. For each identity, append the 'category/type' to S, followed by the '<' character. 4. Sort the supported features. 5. For each feature, append the feature to S, followed by the '<' character. 6. Compute ver by hashing S using the SHA-1 algorithm as specified in RFC 3174 [17] (with binary output) and encoding the hash using Base64 as specified in Section 4 of RFC 4648 [18] (note: the Base64 output MUST NOT include whitespace and MUST set padding bits to zero). [19] */ ArrayList features = new ArrayList(); ArrayList identities = new ArrayList(); foreach (DiscoIdentity did in di.GetIdentities()) identities.Add(did.Type == null ? did.Category : did.Category + "/" + did.Type); foreach (DiscoFeature df in di.GetFeatures()) features.Add(df.Var); identities.Sort(); features.Sort(); StringBuilder S = new StringBuilder(); foreach (string s in identities) S.Append(s + "<"); foreach (string s in features) S.Append(s + "<"); byte[] sha1 = Util.Hash.Sha1HashBytes(S.ToString()); #if CF return Convert.ToBase64String(sha1, 0, sha1.Length); #else return Convert.ToBase64String(sha1); #endif } #region << Extension Helpers >> public void AddExtension(string ext) { string[] extensions = this.Extensions; // check if the extension already exists if (extensions != null && Array.IndexOf(extensions, ext, extensions.GetLowerBound(0), extensions.Length) >= 0) return; int size = extensions == null ? 1 : extensions.Length + 1; string[] tmpExtensions = new string[size]; if (size > 1) extensions.CopyTo(tmpExtensions, 0); tmpExtensions[size - 1] = ext; this.Extensions = tmpExtensions; } public void RemoveExtension(string ext) { string[] extensions = this.Extensions; if (extensions != null) { if (Array.IndexOf(extensions, ext, extensions.GetLowerBound(0), extensions.Length) >= 0) { int i = 0; string[] tmpExtensions = new string[extensions.Length -1]; foreach (string s in extensions) { if (s != ext) tmpExtensions[i++] = s; } this.Extensions = tmpExtensions; } } } public bool ContainsExtension(string ext) { string[] extensions = this.Extensions; if (extensions == null) return false; if (Array.IndexOf(extensions, ext, extensions.GetLowerBound(0), extensions.Length) >= 0) return true; else return false; } #endregion } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/msgreceipts/0000755000175000017500000000000012204443225025665 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/msgreceipts/Received.cs0000644000175000017500000000301112204443225027735 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.msgreceipts { /// /// /// public class Received : Element { /* * */ public Received() { this.TagName = "received"; this.Namespace = Uri.MSG_RECEIPT; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/msgreceipts/Request.cs0000644000175000017500000000300312204443225027640 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.msgreceipts { /// /// /// public class Request : Element { /* * */ public Request() { this.TagName = "request"; this.Namespace = Uri.MSG_RECEIPT; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/filetransfer/0000755000175000017500000000000012204443225026024 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/filetransfer/Range.cs0000644000175000017500000000473512204443225027420 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.filetransfer { /// /// When range is sent in the offer, it should have no attributes. /// This signifies that the sender can do ranged transfers. /// When no range element is sent in the Stream Initiation result, the Sender MUST send the complete file starting at offset 0. /// More generally, data is sent over the stream byte for byte starting at the offset position for the length specified. /// public class Range : Element { /* */ public Range() { this.TagName = "range"; this.Namespace = Uri.SI_FILE_TRANSFER; } public Range(long offset, long length) : this() { Offset = offset; Length = length; } /// /// Specifies the position, in bytes, to start transferring the file data from. /// This defaults to zero (0) if not specified. /// public long Offset { get { return GetAttributeLong("offset"); } set { SetAttribute("offset", value.ToString());} } /// /// Specifies the number of bytes to retrieve starting at offset. /// This defaults to the length of the file from offset to the end. /// public long Length { get { return GetAttributeLong("length"); } set { SetAttribute("length", value.ToString());} } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/filetransfer/File.cs0000644000175000017500000000754212204443225027242 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.filetransfer { /// /// Summary description for File. /// public class File : Element { /* Example 1: Example 2: This is a test. If this were a real file... Example 3: */ public File() { this.TagName = "file"; this.Namespace = Uri.SI_FILE_TRANSFER; } public File(string name, long size) : this() { Name = name; Size = size; } /// /// The file name. Its required /// public string Name { get { return GetAttribute("name"); } set { SetAttribute("name", value); } } /// /// Size of the file. This is required /// public long Size { get { return GetAttributeLong("size"); } set { SetAttribute("size", value.ToString()); } } /// /// a Hash checksum of the file /// public string Hash { get { return GetAttribute("hash"); } set { SetAttribute("hash", value); } } /// /// file date /// public DateTime Date { get { return Util.Time.ISO_8601Date(GetAttribute("date")); } set { SetAttribute("date", Util.Time.ISO_8601Date(value)); } } /// /// is used to provide a sender-generated description of the file so the receiver can better understand what is being sent. /// It MUST NOT be sent in the result. /// public string Description { get { return GetTag("desc"); } set { SetTag("desc", value);} } public Range Range { get { Element range =SelectSingleElement(typeof(Range)); if (range != null) return range as Range; else return null; } set { RemoveTag(typeof(Range)); AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/shim/0000755000175000017500000000000012204443225024300 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/shim/Header.cs0000644000175000017500000000353012204443225026020 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.shim { /// /// JEP-0131: Stanza Headers and Internet Metadata (SHIM) /// public class Header : Element { // //
    123456789@capulet.com
    //
    shakespeare,<xmpp/>
    //
    #region << Constructors >> public Header() { this.TagName = "header"; this.Namespace = Uri.SHIM; } public Header(string name, string val) : this() { this.Name = name; this.Value = val; } #endregion public string Name { get { return GetAttribute("name"); } set { SetAttribute("name", value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/shim/Headers.cs0000644000175000017500000000607012204443225026205 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.shim { /// /// JEP-0131: Stanza Headers and Internet Metadata (SHIM) /// public class Headers : Element { // //
    123456789@capulet.com
    //
    shakespeare,<xmpp/>
    //
    public Headers() { this.TagName = "headers"; this.Namespace = Uri.SHIM; } /// /// Adds a new Header /// /// public Header AddHeader() { Header h = new Header(); AddChild(h); return h; } /// /// Adds the given Header /// /// /// returns the given Header public Header AddHeader(Header header) { AddChild(header); return header; } /// /// Adds a new Header /// /// header name /// header value /// returns the new added header public Header AddHeader(string name, string val) { Header header = new Header(name, val); AddChild(header); return header; } public void SetHeader(string name, string val) { Header header = GetHeader(name); if (header != null) header.Value = val; else AddHeader(name, val); } /// /// /// /// public Header GetHeader(string name) { return (Header) SelectSingleElement("header", "name", name); } public Header[] GetHeaders() { ElementList nl = SelectElements("header"); Header[] headers = new Header[nl.Count]; int i = 0; foreach (Element e in nl) { headers[i] = (Header) e; i++; } return headers; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/chatstates/0000755000175000017500000000000012204443225025503 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/chatstates/Active.cs0000644000175000017500000000334012204443225027245 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.chatstates { /// /// User is actively participating in the chat session. /// User accepts an initial content message, sends a content message, /// gives focus to the chat interface, or is otherwise paying attention to the conversation. /// public class Active : Element { /// /// Initializes a new instance of the class. /// public Active() { TagName = Chatstate.active.ToString(); Namespace = Uri.CHATSTATES; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/chatstates/Paused.cs0000644000175000017500000000325512204443225027260 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.chatstates { /// /// User had been composing but now has stopped. /// User was composing but has not interacted with the message input interface for a short period of time (e.g., 5 seconds). /// public class Paused : Element { /// /// Initializes a new instance of the class. /// public Paused() { TagName = Chatstate.paused.ToString(); Namespace = Uri.CHATSTATES; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/chatstates/Chatstate.cs0000644000175000017500000000354012204443225027754 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.extensions.chatstates { /// /// Enumeration of supported Chatstates (JEP-0085) /// public enum Chatstate { /// /// No Chatstate at all /// None, /// /// Active Chatstate /// active, /// /// Inactive Chatstate /// inactive, /// /// Composing Chatstate /// composing, /// /// Gone Chatstate /// gone, /// /// Paused Chatstate /// paused } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/chatstates/Gone.cs0000644000175000017500000000342112204443225026722 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.chatstates { /// /// User has effectively ended their participation in the chat session. /// User has not interacted with the chat interface, system, or device for a relatively long period of time /// (e.g., 2 minutes), or has terminated the chat interface (e.g., by closing the chat window). /// public class Gone : Element { /// /// Initializes a new instance of the class. /// public Gone() { TagName = Chatstate.gone.ToString(); Namespace = Uri.CHATSTATES; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/chatstates/Composing.cs0000644000175000017500000000330112204443225027765 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.chatstates { /// /// User is composing a message. /// User is interacting with a message input interface specific to this chat session /// (e.g., by typing in the input area of a chat window). /// public class Composing : Element { /// /// Initializes a new instance of the class. /// public Composing() { TagName = Chatstate.composing.ToString(); Namespace = Uri.CHATSTATES; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/chatstates/Inactive.cs0000644000175000017500000000326412204443225027601 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.chatstates { /// /// User has not been actively participating in the chat session. /// User has not interacted with the chat interface for an intermediate period of time (e.g., 30 seconds). /// public class Inactive : Element { /// /// Initializes a new instance of the class. /// public Inactive() { TagName = Chatstate.inactive.ToString(); Namespace = Uri.CHATSTATES; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bosh/0000755000175000017500000000000012204443225024273 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bosh/BoshType.cs0000644000175000017500000000232212204443225026356 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ namespace agsXMPP.protocol.extensions.bosh { public enum BoshType { NONE = -1, error, terminate } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/bosh/Body.cs0000644000175000017500000001635212204443225025526 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.bosh { public class Body : Element { public Body() { this.TagName = "body"; this.Namespace = Uri.HTTP_BIND; } /* POST /webclient HTTP/1.1 Host: httpcm.jabber.org Accept-Encoding: gzip, deflate Content-Type: text/xml; charset=utf-8 Content-Length: 153 HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: 128 */ public string Sid { get { return GetAttribute("sid"); } set { SetAttribute("sid", value); } } public long Rid { get { return GetAttributeLong("rid"); } set { SetAttribute("rid", value); } } public long Ack { get { return GetAttributeLong("ack"); } set { SetAttribute("ack", value); } } public bool Secure { get { return GetAttributeBool("secure"); } set { SetAttribute("secure", value); } } /// /// Specifies the longest time (in seconds) that the connection manager is allowed to wait before responding to any request /// during the session. This enables the client to limit the delay before it discovers any network failure, /// and to prevent its HTTP/TCP connection from expiring due to inactivity. /// public int Wait { get { return GetAttributeInt("wait"); } set { SetAttribute("wait", value); } } /// /// If the connection manager supports session pausing (inactivity) then it SHOULD advertise that to the client by including a 'maxpause' /// attribute in the session creation response element. The value of the attribute indicates the maximum length of a temporary /// session pause (in seconds) that a client MAY request. /// public int MaxPause { get { return GetAttributeInt("maxpause"); } set { SetAttribute("maxpause", value); } } public int Inactivity { get { return GetAttributeInt("inactivity"); } set { SetAttribute("inactivity", value); } } public int Polling { get { return GetAttributeInt("polling"); } set { SetAttribute("polling", value); } } public int Requests { get { return GetAttributeInt("requests"); } set { SetAttribute("requests", value); } } /// /// Specifies the target domain of the first stream. /// public Jid To { get { return GetAttributeJid("to"); } set { SetAttribute("to", value); } } public Jid From { get { return GetAttributeJid("from"); } set { SetAttribute("from", value); } } /// /// specifies the maximum number of requests the connection manager is allowed to keep waiting at any one time during the session. /// If the client is not able to use HTTP Pipelining then this SHOULD be set to "1". /// public int Hold { get { return GetAttributeInt("hold"); } set { SetAttribute("hold", value); } } /// /// /// Specifies the highest version of the BOSH protocol that the client supports. /// The numbering scheme is "." (where the minor number MAY be incremented higher than a single digit, /// so it MUST be treated as a separate integer). /// /// /// The 'ver' attribute should not be confused with the version of any protocol being transported. /// /// public string Version { get { return GetAttribute("ver"); } set { SetAttribute("ver", value); } } public string NewKey { get { return GetAttribute("newkey"); } set { SetAttribute("newkey", value); } } public string Key { get { return GetAttribute("key"); } set { SetAttribute("key", value); } } public BoshType Type { get { return (BoshType) GetAttributeEnum("type", typeof(BoshType)); } set { if (value == BoshType.NONE) RemoveAttribute("type"); else SetAttribute("type", value.ToString()); } } public string XmppVersion { get { return GetAttribute("xmpp:version"); } set { AddBoshNamespace(); SetAttribute("xmpp:version", value); } } public bool XmppRestart { get { return GetAttributeBool("xmpp:restart"); } set { AddBoshNamespace(); SetAttribute("xmpp:restart", value); } } internal void AddBoshNamespace() { this.SetAttribute("xmlns:xmpp", "urn:xmpp:xbosh"); } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/commands/0000755000175000017500000000000012204443225025141 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/commands/Actions.cs0000644000175000017500000001132312204443225027070 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.commands { /* */ public class Actions : Element { public Actions() { this.TagName = "actions"; this.Namespace = Uri.COMMANDS; } /// /// Optional Execute Action, only complete, next and previous is allowed /// public Action Execute { get { return (Action) GetAttributeEnum("execute", typeof(Action)); } set { if (value == Action.NONE) RemoveAttribute("execute"); else SetAttribute("execute", value.ToString()); } } /// /// /// public bool Complete { get { return HasTag("complete"); } set { if (value) this.SetTag("complete"); else this.RemoveTag("complete"); } } public bool Next { get { return HasTag("next"); } set { if (value) this.SetTag("next"); else this.RemoveTag("next"); } } public bool Previous { get { return HasTag("prev"); } set { if (value) this.SetTag("prev"); else this.RemoveTag("prev"); } } /// /// Actions, only complete, prev and next are allowed here and can be combined /// public Action Action { get { Action res = 0; if (Complete) res |= Action.complete; if (Previous) res |= Action.prev; if (Next) res |= Action.next; if (res == 0) return Action.NONE; else return res; } set { if (value == Action.NONE) { Complete = false; Previous = false; Next = false; } else { Complete = ((value & Action.complete) == Action.complete); Previous = ((value & Action.prev) == Action.prev); Next = ((value & Action.next) == Action.next); } } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/commands/NoteType.cs0000644000175000017500000000233712204443225027244 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.extensions.commands { public enum NoteType { error, info, warn } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/commands/Action.cs0000644000175000017500000000344412204443225026712 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; namespace agsXMPP.protocol.extensions.commands { /* */ public enum Action { NONE = -1, next = 1, prev = 2, complete = 4, execute = 8, cancel = 16 } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/commands/Status.cs0000644000175000017500000000315012204443225026752 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.extensions.commands { /* * */ public enum Status { NONE = -1, canceled, completed, executing } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/commands/Command.cs0000644000175000017500000001143412204443225027051 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; using agsXMPP.protocol.x.data; namespace agsXMPP.protocol.extensions.commands { public class Command : Element { #region << Constructors >> public Command() { this.TagName = "command"; this.Namespace = Uri.COMMANDS; } public Command(string node) : this() { this.Node = node; } public Command(Action action) : this() { this.Action = action; } public Command(Status status) : this() { this.Status = status; } public Command(string node, string sessionId) : this(node) { this.SessionId = sessionId; } public Command(string node, string sessionId, Action action) : this(node, sessionId) { this.Action = action; } public Command(string node, string sessionId, Status status) : this(node, sessionId) { this.Status = status; } public Command(string node, string sessionId, Action action, Status status) : this(node, sessionId, action) { this.Status = status; } #endregion public Action Action { get { return (Action) GetAttributeEnum("action", typeof(Action)); } set { if (value == Action.NONE) RemoveAttribute("action"); else SetAttribute("action", value.ToString()); } } public Status Status { get { return (Status) GetAttributeEnum("status", typeof(Status)); } set { if (value == Status.NONE) RemoveAttribute("status"); else SetAttribute("status", value.ToString()); } } // /// /// Node is Required /// public string Node { get { return GetAttribute("node"); } set { SetAttribute("node", value); } } // public string SessionId { get { return GetAttribute("sessionid"); } set { SetAttribute("sessionid", value); } } /// /// The X-Data Element /// public Data Data { get { return SelectSingleElement(typeof(Data)) as Data; } set { if (HasTag(typeof(Data))) RemoveTag(typeof(Data)); if (value != null) this.AddChild(value); } } public Note Note { get { return SelectSingleElement(typeof(Note)) as Note; } set { if (HasTag(typeof(Note))) RemoveTag(typeof(Note)); if (value != null) this.AddChild(value); } } public Actions Actions { get { return SelectSingleElement(typeof(Actions)) as Actions; } set { if (HasTag(typeof(Actions))) RemoveTag(typeof(Actions)); if (value != null) this.AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/extensions/commands/Note.cs0000644000175000017500000000557112204443225026405 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.extensions.commands { /* Service 'httpd' has been configured. */ public class Note : Element { /// /// Default constructor /// public Note() { this.TagName = "note"; this.Namespace = Uri.COMMANDS; } /// /// /// /// public Note(NoteType type) : this() { this.Type = type; } /// /// /// /// /// public Note(string text, NoteType type) : this(type) { this.Value = text; } public NoteType Type { get { return (NoteType)GetAttributeEnum("type", typeof(NoteType)); } set { SetAttribute("type", value.ToString()); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Base/0000755000175000017500000000000012250206660022014 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Base/Stanza.cs0000644000175000017500000000667412250206660023620 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml; using agsXMPP.Xml.Dom; using agsXMPP.protocol.client; namespace agsXMPP.protocol.Base { /// /// Base XMPP Element /// This must ne used to build all other new packets /// public abstract class Stanza : DirectionalElement { public Stanza() : base() { } public Stanza(string tag) : base(tag) { } public Stanza(string tag, string ns) : base(tag) { this.Namespace = ns; } public Stanza(string tag, string text, string ns) : base(tag, text) { this.Namespace = ns; } public string Id { get { return this.GetAttribute("id"); } set { this.SetAttribute("id", value); } } /// /// Generates a automatic id for the packet. /// !!! Overwrites existing Ids /// /// public void GenerateId() { string sId = agsXMPP.Id.GetNextId(); this.Id = sId; } /// /// XML Language attribute /// /// /// The language 'xml:lang' attribute SHOULD be included by the initiating entity on the header for the initial stream /// to specify the default language of any human-readable XML character data it sends over that stream. /// If the attribute is included, the receiving entity SHOULD remember that value as the default for both the /// initial stream and the response stream; if the attribute is not included, the receiving entity SHOULD use /// a configurable default value for both streams, which it MUST communicate in the header for the response stream. /// For all stanzas sent over the initial stream, if the initiating entity does not include an 'xml:lang' attribute, /// the receiving entity SHOULD apply the default value; if the initiating entity does include an 'xml:lang' attribute, /// the receiving entity MUST NOT modify or delete it (see also xml:langxml:lang). /// The value of the 'xml:lang' attribute MUST conform to the format defined in RFC 3066 (Tags for the Identification of Languages, January 2001.[LANGTAGS]). /// public string Language { get { return GetAttribute("xml:lang"); } set { SetAttribute("xml:lang", value); } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Base/Group.cs0000644000175000017500000000310412204443225023434 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.Base { /// /// Summary description for Group. /// public class Group : Element { public Group() { this.TagName = "group"; } public Group(string groupname) : this() { this.Name = groupname; } /// /// gets or sets the Name of the contact group /// public string Name { set { this.Value = value; } get { return this.Value; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Base/StanzaWithError.cs0000644000175000017500000000321712250206660025454 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Oliver Schneider // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using agsXMPP.Xml; using agsXMPP.Xml.Dom; using agsXMPP.protocol.client; using ClientError = agsXMPP.protocol.client.Error; namespace agsXMPP.protocol.Base { public class StanzaWithError : Stanza { /// /// Error Child Element /// public ClientError Error { get { return SelectSingleElement(typeof(ClientError)) as ClientError; } set { // set type automatically to error SetAttribute("type", "error"); if (HasTag(typeof(ClientError))) RemoveTag(typeof(ClientError)); if (value != null) this.AddChild(value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Base/RosterItem.cs0000644000175000017500000000646212204443225024447 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.Base { // jabber:iq:roster // // // ICQ // ICQ // ICQ // ICQ // // // # "none" -- the user does not have a subscription to the contact's presence information, and the contact does not have a subscription to the user's presence information // # "to" -- the user has a subscription to the contact's presence information, but the contact does not have a subscription to the user's presence information // # "from" -- the contact has a subscription to the user's presence information, but the user does not have a subscription to the contact's presence information // # "both" -- both the user and the contact have subscriptions to each other's presence information /// /// Item is used in jabber:iq:roster, x roster /// public class RosterItem : Item { public RosterItem() : base() { } /// /// Groups a roster Item is assigned to /// public ElementList GetGroups() { return this.SelectElements("group"); } /// /// Add a new group to the Rosteritem /// /// public void AddGroup(string groupname) { Group g = new Group(groupname); this.AddChild(g); } public bool HasGroup(string groupname) { ElementList groups = GetGroups(); foreach (Group g in groups) { if (g.Name == groupname) return true; } return false; } public void RemoveGroup(string groupname) { ElementList groups = GetGroups(); foreach (Group g in groups) { if (g.Name == groupname) { g.Remove(); return; } } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Base/Item.cs0000644000175000017500000000351612204443225023245 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.Base { /// /// Summary description for Item. /// public class Item : Element { public Item() { this.TagName = "item"; } public Jid Jid { get { if (HasAttribute("jid")) return new Jid(this.GetAttribute("jid")); else return null; } set { if (value != null) this.SetAttribute("jid", value.ToString()); } } public string Name { get { return GetAttribute("name"); } set { SetAttribute("name", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Base/DirectionalElement.cs0000644000175000017500000000642512204443225026120 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml; using agsXMPP.Xml.Dom; using agsXMPP.protocol.client; namespace agsXMPP.protocol.Base { /// /// Base XMPP Element /// This must ne used to build all other new packets /// public abstract class DirectionalElement : Element { public DirectionalElement() : base() { } public DirectionalElement(string tag) : base(tag) { } public DirectionalElement(string tag, string ns) : base(tag) { this.Namespace = ns; } public DirectionalElement(string tag, string text, string ns) : base(tag, text) { this.Namespace = ns; } public Jid From { get { if (HasAttribute("from")) return new Jid(this.GetAttribute("from")); else return null; } set { if (value != null) this.SetAttribute("from", value.ToString()); else RemoveAttribute("from"); } } public Jid To { get { if (HasAttribute("to")) return new Jid(this.GetAttribute("to")); else return null; } set { if (value != null) this.SetAttribute("to", value.ToString()); else RemoveAttribute("to"); } } /// /// Switches the from and to attributes when existing /// public void SwitchDirection() { Jid from = From; Jid to = To; // Remove from and to now RemoveAttribute("from"); RemoveAttribute("to"); Jid helper = null; helper = from; from = to; to = helper; From = from; To = to; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Base/Stream.cs0000644000175000017500000000343512204443225023602 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol.Base { /// /// Summary description for Stream. /// public class Stream : Stanza { public Stream() { this.TagName = "stream"; } /// /// The StreamID of the current JabberSession. /// Returns null when none available. /// public string StreamId { get { return GetAttribute("id"); } set { SetAttribute("id", value); } } /// /// See XMPP-Core 4.4.1 "Version Support" /// public string Version { get { return GetAttribute("version"); } set { SetAttribute("version", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Base/Avatar.cs0000644000175000017500000000373012204443225023563 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.Xml.Dom; namespace agsXMPP.protocol.Base { // Avatar is in multiple Namespaces. So better to work with a Base class /// /// Summary description for Avatar. /// public class Avatar : Element { public Avatar() { this.TagName = "query"; } public byte[] Data { get { if ( HasTag("data") ) return Convert.FromBase64String(GetTag("data")); else return null; } set { SetTag("data", Convert.ToBase64String(value, 0, value.Length)); } } public string MimeType { get { Element data = SelectSingleElement("data"); if (data != null) return GetAttribute("mimetype"); else return null; } set { Element data = SelectSingleElement("data"); if (data != null) SetAttribute("mimetype", value); } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/protocol/Stream.cs0000644000175000017500000000261012204443225022722 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.protocol { /// /// stream:stream Element /// This is the first Element we receive from the server. /// It encloses our whole xmpp session. /// public class Stream : Base.Stream { public Stream() { this.Namespace = Uri.STREAM; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/PresenceGrabber.cs0000644000175000017500000001036212204443225022662 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections; using agsXMPP.protocol; using agsXMPP.protocol.client; using agsXMPP.Collections; namespace agsXMPP { public delegate void PresenceCB(object sender, Presence pres, object data); public class PresenceGrabber : PacketGrabber { /// /// Initializes a new instance of the class. /// /// The conn. public PresenceGrabber(XmppClientConnection conn) { m_connection = conn; conn.OnPresence += new PresenceHandler(m_connection_OnPresence); } public void Add(Jid jid, PresenceCB cb, object cbArg) { lock (m_grabbing) { if (m_grabbing.ContainsKey(jid.ToString())) return; } TrackerData td = new TrackerData(); td.cb = cb; td.data = cbArg; td.comparer = new BareJidComparer(); lock (m_grabbing) { m_grabbing.Add(jid.ToString(), td); } } /// /// Adds the specified jid. /// /// The jid. /// The comparer. /// The callback. /// The callback Arguments. public void Add(Jid jid, IComparer comparer, PresenceCB cb, object cbArg) { lock (m_grabbing) { if (m_grabbing.ContainsKey(jid.ToString())) return; } TrackerData td = new TrackerData(); td.cb = cb; td.data = cbArg; td.comparer = comparer; lock (m_grabbing) { m_grabbing.Add(jid.ToString(), td); } } /// /// Pending request can be removed. /// This is useful when a ressource for the callback is destroyed and /// we are not interested anymore at the result. /// /// ID of the Iq we are not interested anymore public void Remove(Jid jid) { lock (m_grabbing) { if (m_grabbing.ContainsKey(jid.ToString())) m_grabbing.Remove(jid.ToString()); } } private class TrackerData { public PresenceCB cb; public object data; // by default the Bare Jid is compared public IComparer comparer; } /// /// A presence is received. Now check if its from a Jid we are looking for and /// raise the event in this case. /// /// /// private void m_connection_OnPresence(object sender, Presence pres) { if (pres == null) return; lock (m_grabbing) { IDictionaryEnumerator myEnum = m_grabbing.GetEnumerator(); while(myEnum.MoveNext()) { TrackerData t = myEnum.Value as TrackerData; if (t.comparer.Compare(new Jid((string)myEnum.Key), pres.From) == 0) { // Execute the callback t.cb(this, pres, t.data); } } } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/MessageGrabber.cs0000644000175000017500000000754012204443225022506 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections; using agsXMPP.protocol; using agsXMPP.protocol.client; using agsXMPP.Collections; namespace agsXMPP { public delegate void MessageCB(object sender, Message msg, object data); public class MessageGrabber : PacketGrabber { /// /// /// /// public MessageGrabber(XmppClientConnection conn) { m_connection = conn; conn.OnMessage += new MessageHandler(m_connection_OnMessage); } public void Add(Jid jid, MessageCB cb, object cbArg) { lock (m_grabbing) { if (m_grabbing.ContainsKey(jid.ToString())) return; } TrackerData td = new TrackerData(); td.cb = cb; td.data = cbArg; td.comparer = new BareJidComparer(); lock (m_grabbing) { m_grabbing.Add(jid.ToString(), td); } } public void Add(Jid jid, IComparer comparer, MessageCB cb, object cbArg) { lock (m_grabbing) { if (m_grabbing.ContainsKey(jid.ToString())) return; } TrackerData td = new TrackerData(); td.cb = cb; td.data = cbArg; td.comparer = comparer; lock (m_grabbing) { m_grabbing.Add(jid.ToString(), td); } } /// /// Pending request can be removed. /// This is useful when a ressource for the callback is destroyed and /// we are not interested anymore at the result. /// /// ID of the Iq we are not interested anymore public void Remove(Jid jid) { lock (m_grabbing) { if (m_grabbing.ContainsKey(jid.ToString())) m_grabbing.Remove(jid.ToString()); } } private class TrackerData { public MessageCB cb; public object data; // by default the Bare Jid is compared public IComparer comparer; } /// /// A Message is received. Now check if its from a Jid we are looking for and /// raise the event in this case. /// /// /// private void m_connection_OnMessage(object sender, Message msg) { if (msg == null) return; lock (m_grabbing) { IDictionaryEnumerator myEnum = m_grabbing.GetEnumerator(); while(myEnum.MoveNext()) { TrackerData t = myEnum.Value as TrackerData; if (t.comparer.Compare(new Jid((string)myEnum.Key), msg.From) == 0) { // Execute the callback t.cb(this, msg, t.data); } } } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Net/0000755000175000017500000000000012245370027020032 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/0000755000175000017500000000000012204443225020552 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/IPConfigurationInformation.cs0000644000175000017500000000402012204443225026343 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System.Collections.Generic; using System.Net; using System.Net.NetworkInformation; namespace agsXMPP.Net.Dns { /// /// Summary description for IPConfigurationInformation. /// public class IPConfigurationInformation { public static List DnsServers { get { var dnsServers = new List(); var interfaces = NetworkInterface.GetAllNetworkInterfaces(); foreach (var eth in interfaces) { if (eth.OperationalStatus == OperationalStatus.Up) { var ethProperties = eth.GetIPProperties(); var dnsHosts = ethProperties.DnsAddresses; dnsServers.AddRange(dnsHosts); } } return dnsServers; } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/Response.cs0000644000175000017500000001172412204443225022704 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // // Bdev.Net.Dns by Rob Philpott, Big Developments Ltd. Please send all bugs/enhancements to // rob@bigdevelopments.co.uk This file and the code contained within is freeware and may be // distributed and edited without restriction. // using System; using System.Net; namespace agsXMPP.Net.Dns { /// /// A Response is a logical representation of the byte data returned from a DNS query /// public class Response { // these are fields we're interested in from the message private readonly ReturnCode _returnCode; private readonly bool _authoritativeAnswer; private readonly bool _recursionAvailable; private readonly bool _truncated; private readonly Question[] _questions; private readonly Answer[] _answers; private readonly NameServer[] _nameServers; private readonly AdditionalRecord[] _additionalRecords; // these fields are readonly outside the assembly - use r/o properties public ReturnCode ReturnCode { get { return _returnCode; }} public bool AuthoritativeAnswer { get { return _authoritativeAnswer; }} public bool RecursionAvailable { get { return _recursionAvailable; }} public bool MessageTruncated { get { return _truncated; }} public Question[] Questions { get { return _questions; }} public Answer[] Answers { get { return _answers; }} public NameServer[] NameServers { get { return _nameServers; }} public AdditionalRecord[] AdditionalRecords { get { return _additionalRecords; }} /// /// Construct a Response object from the supplied byte array /// /// a byte array returned from a DNS server query internal Response(byte[] message) { // the bit flags are in bytes 2 and 3 byte flags1 = message[2]; byte flags2 = message[3]; // get return code from lowest 4 bits of byte 3 int returnCode = flags2 & 15; // if its in the reserved section, set to other if (returnCode > 6) returnCode = 6; _returnCode = (ReturnCode)returnCode; // other bit flags _authoritativeAnswer = ((flags1 & 4) != 0); _recursionAvailable = ((flags2 & 128) != 0); _truncated = ((flags1 & 2) != 0); // create the arrays of response objects _questions = new Question[GetShort(message, 4)]; _answers = new Answer[GetShort(message, 6)]; _nameServers = new NameServer[GetShort(message, 8)]; _additionalRecords = new AdditionalRecord[GetShort(message, 10)]; // need a pointer to do this, position just after the header Pointer pointer = new Pointer(message, 12); // and now populate them, they always follow this order for (int index = 0; index < _questions.Length; index++) { try { // try to build a quesion from the response _questions[index] = new Question(pointer); } catch (Exception ex) { // something grim has happened, we can't continue throw new InvalidResponseException(ex); } } for (int index = 0; index < _answers.Length; index++) { _answers[index] = new Answer(pointer); } for (int index = 0; index < _nameServers.Length; index++) { _nameServers[index] = new NameServer(pointer); } for (int index = 0; index < _additionalRecords.Length; index++) { _additionalRecords[index] = new AdditionalRecord(pointer); } } /// /// Convert 2 bytes to a short. It would have been nice to use BitConverter for this, /// it however reads the bytes in the wrong order (at least on Windows) /// /// byte array to look in /// position to look at /// short representation of the two bytes private static short GetShort(byte[] message, int position) { return (short)(message[position]<<8 | message[position+1]); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/ResourceRecord.cs0000644000175000017500000000713512204443225024035 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // // Bdev.Net.Dns by Rob Philpott, Big Developments Ltd. Please send all bugs/enhancements to // rob@bigdevelopments.co.uk This file and the code contained within is freeware and may be // distributed and edited without restriction. // using System; namespace agsXMPP.Net.Dns { /// /// Represents a Resource Record as detailed in RFC1035 4.1.3 /// public class ResourceRecord { // private, constructor initialised fields private readonly string _domain; private readonly DnsType _dnsType; private readonly DnsClass _dnsClass; private readonly int _Ttl; private readonly RecordBase _record; // read only properties applicable for all records public string Domain { get { return _domain; } } public DnsType Type { get { return _dnsType; } } public DnsClass Class { get { return _dnsClass; } } public int Ttl { get { return _Ttl; } } public RecordBase Record { get { return _record; } } /// /// Construct a resource record from a pointer to a byte array /// /// the position in the byte array of the record internal ResourceRecord(Pointer pointer) { // extract the domain, question type, question class and Ttl _domain = pointer.ReadDomain(); _dnsType = (DnsType) pointer.ReadShort(); _dnsClass = (DnsClass) pointer.ReadShort(); _Ttl = pointer.ReadInt(); // the next short is the record length, we only use it for unrecognised record types int recordLength = pointer.ReadShort(); // and create the appropriate RDATA record based on the dnsType switch (_dnsType) { case DnsType.SRV: _record = new SRVRecord(pointer); break; default: { // move the pointer over this unrecognised record pointer.Position += recordLength; break; } } } } // Answers, Name Servers and Additional Records all share the same RR format public class Answer : ResourceRecord { internal Answer(Pointer pointer) : base(pointer) {} } public class NameServer : ResourceRecord { internal NameServer(Pointer pointer) : base(pointer) {} } public class AdditionalRecord : ResourceRecord { internal AdditionalRecord(Pointer pointer) : base(pointer) {} } }smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/Pointer.cs0000644000175000017500000001365012204443225022526 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // // Bdev.Net.Dns by Rob Philpott, Big Developments Ltd. Please send all bugs/enhancements to // rob@bigdevelopments.co.uk This file and the code contained within is freeware and may be // distributed and edited without restriction. // using System; using System.Text; namespace agsXMPP.Net.Dns { /// /// Logical representation of a pointer, but in fact a byte array reference and a position in it. This /// is used to read logical units (bytes, shorts, integers, domain names etc.) from a byte array, keeping /// the pointer updated and pointing to the next record. This type of Pointer can be considered the logical /// equivalent of an (unsigned char*) in C++ /// internal class Pointer { // a pointer is a reference to the message and an index private byte[] _message; private int _position; // pointers can only be created by passing on an existing message public Pointer(byte[] message, int position) { _message = message; _position = position; } public int Position { get { return _position; } set { _position = value; } } /// /// Shallow copy function /// /// public Pointer Copy() { return new Pointer(_message, _position); } /// /// Adjust the pointers position within the message /// /// new position in the message public void SetPosition(int position) { _position = position; } /// /// Overloads the + operator to allow advancing the pointer by so many bytes /// /// the initial pointer /// the offset to add to the pointer in bytes /// a reference to a new pointer moved forward by offset bytes public static Pointer operator+(Pointer pointer, int offset) { return new Pointer(pointer._message, pointer._position + offset); } /// /// Reads a single byte at the current pointer, does not advance pointer /// /// the byte at the pointer public byte Peek() { return _message[_position]; } /// /// Reads a single byte at the current pointer, advancing pointer /// /// the byte at the pointer public byte ReadByte() { return _message[_position++]; } /// /// Reads two bytes to form a short at the current pointer, advancing pointer /// /// the byte at the pointer public short ReadShort() { return (short)(ReadByte()<<8 | ReadByte()); } /// /// Reads four bytes to form a int at the current pointer, advancing pointer /// /// the byte at the pointer public int ReadInt() { return (ushort)ReadShort()<<16 | (ushort)ReadShort(); } /// /// Reads a single byte as a char at the current pointer, advancing pointer /// /// the byte at the pointer public char ReadChar() { return (char)ReadByte(); } /// /// Reads a domain name from the byte array. The method by which this works is described /// in RFC1035 - 4.1.4. Essentially to minimise the size of the message, if part of a domain /// name already been seen in the message, rather than repeating it, a pointer to the existing /// definition is used. Each word in a domain name is a label, and is preceded by its length /// /// eg. bigdevelopments.co.uk /// /// is [15] (size of bigdevelopments) + "bigdevelopments" /// [2] "co" /// [2] "uk" /// [1] 0 (NULL) /// /// the byte at the pointer public string ReadDomain() { StringBuilder domain = new StringBuilder(); int length = 0; // get the length of the first label while ((length = ReadByte()) != 0) { // top 2 bits set denotes domain name compression and to reference elsewhere if ((length & 0xc0) == 0xc0) { // work out the existing domain name, copy this pointer Pointer newPointer = Copy(); // and move it to where specified here newPointer.SetPosition((length & 0x3f)<<8 | ReadByte()); // repeat call recursively domain.Append(newPointer.ReadDomain()); return domain.ToString(); } // if not using compression, copy a char at a time to the domain name while (length > 0) { domain.Append(ReadChar()); length--; } // if size of next label isn't null (end of domain name) add a period ready for next label if (Peek() != 0) domain.Append('.'); } // and return return domain.ToString(); } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/SRVRecord.cs0000644000175000017500000000666112204443225022723 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.Net.Dns { /// /// Summary description for SRVRecord. /// public class SRVRecord : RecordBase, IComparable { /// /// Constructs a NS record by reading bytes from a return message /// /// A logical pointer to the bytes holding the record internal SRVRecord(Pointer pointer) { m_Priority = pointer.ReadShort(); m_Weight = pointer.ReadShort(); m_Port = pointer.ReadShort(); m_Target = pointer.ReadDomain(); } // the fields exposed outside the assembly private int m_Priority; private int m_Weight; private int m_Port; private string m_Target; public int Priority { get { return m_Priority; } } public int Weight { get { return m_Weight; } } public int Port { get { return m_Port; } } public string Target { get { return m_Target; } } public override string ToString() { return string.Format("\n priority = {0}\n weight = {1}\n port = {2}\n target = {3}", m_Priority, m_Weight, m_Port, m_Target); } /// /// Implements the IComparable interface so that we can sort the SRV records by their /// lowest priority /// /// the other SRVRecord to compare against /// 1, 0, -1 public int CompareTo(object obj) { SRVRecord srvOther = (SRVRecord)obj; // we want to be able to sort them by priority from lowest to highest. if (m_Priority < srvOther.m_Priority) return -1; if (m_Priority > srvOther.m_Priority) return 1; // if the priority is the same, sort by highest weight to lowest (higher // weighting means that server should get more of the requests) if (m_Weight > srvOther.m_Weight) return -1; if (m_Weight < srvOther.m_Weight) return 1; return 0; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/Question.cs0000644000175000017500000001003412204443225022706 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // // Bdev.Net.Dns by Rob Philpott, Big Developments Ltd. Please send all bugs/enhancements to // rob@bigdevelopments.co.uk This file and the code contained within is freeware and may be // distributed and edited without restriction. // using System; using System.Text.RegularExpressions; namespace agsXMPP.Net.Dns { /// /// Represents a DNS Question, comprising of a domain to query, the type of query (QTYPE) and the class /// of query (QCLASS). This class is an encapsulation of these three things, and extensive argument checking /// in the constructor as this may well be created outside the assembly (public protection) /// public class Question { // A question is these three things combined private readonly string _domain; private readonly DnsType _dnsType; private readonly DnsClass _dnsClass; // expose them read/only to the world public string Domain { get { return _domain; }} public DnsType Type { get { return _dnsType; }} public DnsClass Class { get { return _dnsClass; }} /// /// Construct the question from parameters, checking for safety /// /// the domain name to query eg. bigdevelopments.co.uk /// the QTYPE of query eg. DnsType.MX /// the CLASS of query, invariably DnsClass.IN public Question(string domain, DnsType dnsType, DnsClass dnsClass) { // check the input parameters if (domain == null) throw new ArgumentNullException("domain"); // do a sanity check on the domain name to make sure its legal if (domain.Length ==0 || domain.Length>255 || !Regex.IsMatch(domain, @"^[a-z|A-Z|0-9|\-|_]{1,63}(\.[a-z|A-Z|0-9|\-|_]{1,63})+$")) { // domain names can't be bigger tan 255 chars, and individal labels can't be bigger than 63 chars throw new ArgumentException("The supplied domain name was not in the correct form", "domain"); } // sanity check the DnsType parameter if (!Enum.IsDefined(typeof(DnsType), dnsType) || dnsType == DnsType.None) { throw new ArgumentOutOfRangeException("dnsType"); } // sanity check the DnsClass parameter if (!Enum.IsDefined(typeof(DnsClass), dnsClass) || dnsClass == DnsClass.None) { throw new ArgumentOutOfRangeException("dnsClass"); } // just remember the values _domain = domain; _dnsType = dnsType; _dnsClass = dnsClass; } /// /// Construct the question reading from a DNS Server response. Consult RFC1035 4.1.2 /// for byte-wise details of this structure in byte array form /// /// a logical pointer to the Question in byte array form internal Question(Pointer pointer) { // extract from the message _domain = pointer.ReadDomain(); _dnsType = (DnsType)pointer.ReadShort(); _dnsClass = (DnsClass)pointer.ReadShort(); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/NoResponseException.cs0000644000175000017500000000350612204443225025057 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // // Bdev.Net.Dns by Rob Philpott, Big Developments Ltd. Please send all bugs/enhancements to // rob@bigdevelopments.co.uk This file and the code contained within is freeware and may be // distributed and edited without restriction. // using System; namespace agsXMPP.Net.Dns { /// /// Thrown when the server does not respond /// public class NoResponseException : SystemException { public NoResponseException() { // no implementation } public NoResponseException(Exception innerException) : base(null, innerException) { // no implementation } public NoResponseException(string message, Exception innerException) : base (message, innerException) { // no implementation } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/InvalidResponseException.cs0000644000175000017500000000406712204443225026074 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // // Bdev.Net.Dns by Rob Philpott, Big Developments Ltd. Please send all bugs/enhancements to // rob@bigdevelopments.co.uk This file and the code contained within is freeware and may be // distributed and edited without restriction. // using System; namespace agsXMPP.Net.Dns { /// /// Thrown when the server delivers a response we are not expecting to hear /// public class InvalidResponseException : SystemException { public InvalidResponseException() { // no implementation } public InvalidResponseException(Exception innerException) : base(null, innerException) { // no implementation } public InvalidResponseException(string message, Exception innerException) : base (message, innerException) { // no implementation } //protected InvalidResponseException(SerializationInfo info, StreamingContext context) : base(info, context) //{ // // no implementation //} } } smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/RecordBase.cs0000644000175000017500000000304412204443225023113 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // // Bdev.Net.Dns by Rob Philpott, Big Developments Ltd. Please send all bugs/enhancements to // rob@bigdevelopments.co.uk This file and the code contained within is freeware and may be // distributed and edited without restriction. // using System; namespace agsXMPP.Net.Dns { /// /// A simple base class for the different ResourceRecords, ANAME, MX, SOA, NS etc. /// public abstract class RecordBase { // no implementation } } smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/Enums.cs0000644000175000017500000000746212204443225022201 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // // Bdev.Net.Dns by Rob Philpott, Big Developments Ltd. Please send all bugs/enhancements to // rob@bigdevelopments.co.uk This file and the code contained within is freeware and may be // distributed and edited without restriction. // using System; namespace agsXMPP.Net.Dns { /// /// The DNS TYPE (RFC1035 3.2.2/3). Not all are supported /// public enum DnsType { None = 0, /// /// a host address /// ANAME = 1, /// /// an authoritative name server /// NS = 2, // MD = 3, Obsolete // MF = 5, Obsolete /// /// the canonical name for an alias /// CNAME = 5, /// /// marks the start of a zone of authority /// SOA = 6, // MB = 7, EXPERIMENTAL // MG = 8, EXPERIMENTAL // MR = 9, EXPERIMENTAL // NULL = 10, EXPERIMENTAL /// /// a well known service description /// WKS = 11, /// /// a domain name pointer /// PTR = 12, /// /// host information /// HINFO = 13, /// /// mailbox or mail list information /// MINFO = 14, /// /// mail exchange /// MX = 15, /// /// text strings /// TXT = 16, /// /// SRV Records /// SRV = 33, } /// /// The DNS CLASS (RFC1035 3.2.4/5) /// Internet will be the one we'll be using (IN), the others are for completeness /// public enum DnsClass { None = 0, IN = 1, CS = 2, CH = 3, HS = 4 } /// /// (RFC1035 4.1.1) These are the return codes the server can send back /// public enum ReturnCode { Success = 0, FormatError = 1, ServerFailure = 2, NameError = 3, NotImplemented = 4, Refused = 5, Other = 6 } /// /// (RFC1035 4.1.1) These are the Query Types which apply to all questions in a request /// public enum Opcode { StandardQuery = 0, InverseQuery = 1, StatusRequest = 2, Reserved3 = 3, Reserved4 = 4, Reserved5 = 5, Reserved6 = 6, Reserved7 = 7, Reserved8 = 8, Reserved9 = 9, Reserved10 = 10, Reserved11 = 11, Reserved12 = 12, Reserved13 = 13, Reserved14 = 14, Reserved15 = 15, } } smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/Resolver.cs0000644000175000017500000001637112204443225022712 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // // Bdev.Net.Dns by Rob Philpott, Big Developments Ltd. Please send all bugs/enhancements to // rob@bigdevelopments.co.uk This file and the code contained within is freeware and may be // distributed and edited without restriction. // using System; using System.Collections; using System.Net; using System.Net.Sockets; namespace agsXMPP.Net.Dns { /// /// Summary description for Dns. /// public sealed class Resolver { const int _dnsPort = 53; const int _udpRetryAttempts = 2; static int _uniqueId; const int _udpTimeout = 1000; /// /// Private constructor - this static class should never be instantiated /// private Resolver() { // no implementation } /// /// Shorthand form to make SRV querying easier, essentially wraps up the retreival /// of the SRV records, and sorts them by preference /// /// domain name to retreive SRV RRs for /// the server we're going to ask /// An array of SRVRecords public static SRVRecord[] SRVLookup(string domain, IPAddress dnsServer) { // check the inputs if (domain == null) throw new ArgumentNullException("domain"); if (dnsServer == null) throw new ArgumentNullException("dnsServer"); // create a request for this Request request = new Request(); // add one question - the SRV IN lookup for the supplied domain request.AddQuestion(new Question(domain, DnsType.SRV, DnsClass.IN)); // fire it off Response response = Lookup(request, dnsServer); // if we didn't get a response, then return null if (response == null) return null; // create a growable array of SRV records ArrayList resourceRecords = new ArrayList(); // add each of the answers to the array foreach (Answer answer in response.Answers) { // if the answer is an SRV record if (answer.Type == DnsType.SRV) { // add it to our array resourceRecords.Add(answer.Record); } } // create array of MX records SRVRecord[] srvRecords = new SRVRecord[resourceRecords.Count]; // copy from the array list resourceRecords.CopyTo(srvRecords); // sort into lowest preference order Array.Sort(srvRecords); // and return return srvRecords; } /// /// The principal look up function, which sends a request message to the given /// DNS server and collects a response. This implementation re-sends the message /// via UDP up to two times in the event of no response/packet loss /// /// The logical request to send to the server /// The IP address of the DNS server we are querying /// The logical response from the DNS server or null if no response public static Response Lookup(Request request, IPAddress dnsServer) { // check the inputs if (request == null) throw new ArgumentNullException("request"); if (dnsServer == null) throw new ArgumentNullException("dnsServer"); // We will not catch exceptions here, rather just refer them to the caller // create an end point to communicate with IPEndPoint server = new IPEndPoint(dnsServer, _dnsPort); // get the message byte[] requestMessage = request.GetMessage(); // send the request and get the response byte[] responseMessage = UdpTransfer(server, requestMessage); // and populate a response object from that and return it return new Response(responseMessage); } private static byte[] UdpTransfer(IPEndPoint server, byte[] requestMessage) { // UDP can fail - if it does try again keeping track of how many attempts we've made int attempts = 0; // try repeatedly in case of failure while (attempts <= _udpRetryAttempts) { // firstly, uniquely mark this request with an id unchecked { // substitute in an id unique to this lookup, the request has no idea about this requestMessage[0] = (byte)(_uniqueId >> 8); requestMessage[1] = (byte)_uniqueId; } // we'll be send and receiving a UDP packet Socket socket; if (Socket.OSSupportsIPv6 && (server.AddressFamily == AddressFamily.InterNetworkV6)) socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Dgram, ProtocolType.Udp); // V6 else socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); // we will wait at most 1 second for a dns reply socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, _udpTimeout); // send it off to the server socket.SendTo(requestMessage, requestMessage.Length, SocketFlags.None, server); // RFC1035 states that the maximum size of a UDP datagram is 512 octets (bytes) byte[] responseMessage = new byte[512]; try { // wait for a response upto 1 second socket.Receive(responseMessage); // make sure the message returned is ours if (responseMessage[0] == requestMessage[0] && responseMessage[1] == requestMessage[1]) { // its a valid response - return it, this is our successful exit point return responseMessage; } } catch (SocketException) { // failure - we better try again, but remember how many attempts attempts++; } finally { // increase the unique id _uniqueId++; // close the socket socket.Close(); } } // the operation has failed, this is our unsuccessful exit point throw new NoResponseException(); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Net/Dns/Request.cs0000644000175000017500000001331412204443225022533 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // // Bdev.Net.Dns by Rob Philpott, Big Developments Ltd. Please send all bugs/enhancements to // rob@bigdevelopments.co.uk This file and the code contained within is freeware and may be // distributed and edited without restriction. // using System; using System.Net; using System.Net.Sockets; using System.Collections; namespace agsXMPP.Net.Dns { /// /// A Request logically consists of a number of questions to ask the DNS Server. Create a request and /// add questions to it, then pass the request to Resolver.Lookup to query the DNS Server. It is important /// to note that many DNS Servers DO NOT SUPPORT MORE THAN 1 QUESTION PER REQUEST, and it is advised that /// you only add one question to a request. If not ensure you check Response.ReturnCode to see what the /// server has to say about it. /// public class Request { // A request is a series of questions, an 'opcode' (RFC1035 4.1.1) and a flag to denote // whether recursion is required (don't ask..., just assume it is) private ArrayList _questions; private bool _recursionDesired; private Opcode _opCode; public bool RecursionDesired { get { return _recursionDesired; } set { _recursionDesired = value; } } public Opcode Opcode { get { return _opCode; } set { _opCode = value; } } /// /// Construct this object with the default values and create an ArrayList to hold /// the questions as they are added /// public Request() { // default for a request is that recursion is desired and using standard query _recursionDesired = true; _opCode = Opcode.StandardQuery; // create an expandable list of questions _questions = new ArrayList(); } /// /// Adds a question to the request to be sent to the DNS server. /// /// The question to add to the request public void AddQuestion(Question question) { // abandon if null if (question == null) throw new ArgumentNullException("question"); // add this question to our collection _questions.Add(question); } /// /// Convert this request into a byte array ready to send direct to the DNS server /// /// public byte[] GetMessage() { // construct a message for this request. This will be a byte array but we're using // an arraylist as we don't know how big it will be ArrayList data = new ArrayList(); // the id of this message - this will be filled in by the resolver data.Add((byte)0); data.Add((byte)0); // write the bitfields data.Add((byte)(((byte)_opCode<<3) | (_recursionDesired?0x01:0))); data.Add((byte)0); // tell it how many questions unchecked { data.Add((byte)(_questions.Count >> 8)); data.Add((byte)_questions.Count); } // the are no requests, name servers or additional records in a request data.Add((byte)0); data.Add((byte)0); data.Add((byte)0); data.Add((byte)0); data.Add((byte)0); data.Add((byte)0); // that's the header done - now add the questions foreach (Question question in _questions) { AddDomain(data, question.Domain); unchecked { data.Add((byte)0); data.Add((byte)question.Type); data.Add((byte)0); data.Add((byte)question.Class); } } // and convert that to an array byte[] message = new byte[data.Count]; data.CopyTo(message); return message; } /// /// Adds a domain name to the ArrayList of bytes. This implementation does not use /// the domain name compression used in the class Pointer - maybe it should. /// /// The ArrayList representing the byte array message /// the domain name to encode and add to the array private static void AddDomain(ArrayList data, string domainName) { int position = 0; int length = 0; // start from the beginning and go to the end while (position < domainName.Length) { // look for a period, after where we are length = domainName.IndexOf('.', position) - position; // if there isn't one then this labels length is to the end of the string if (length < 0) length = domainName.Length - position; // add the length data.Add((byte)length); // copy a char at a time to the array while (length-- > 0) { data.Add((byte)domainName[position++]); } // step over '.' position++; } // end of domain names data.Add((byte)0); } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Net/BoshClientSocket.cs0000644000175000017500000007555712204443225023603 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.IO; using System.Net; using System.Text; using System.Threading; using System.Collections; using System.Security.Cryptography; using agsXMPP.Xml; using agsXMPP.Xml.Dom; using agsXMPP.protocol.extensions.bosh; namespace agsXMPP.Net { public class WebRequestState { public WebRequestState(WebRequest request) { m_WebRequest = request; } DateTime m_Started; WebRequest m_WebRequest = null; Stream m_RequestStream = null; string m_Output = null; bool m_IsSessionRequest = false; Timer m_TimeOutTimer = null; private bool m_Aborted = false; public int WebRequestId; /// /// when was this request started (timestamp)? /// public DateTime Started { get { return m_Started; } set { m_Started = value; } } public bool IsSessionRequest { get { return m_IsSessionRequest; } set { m_IsSessionRequest = value; } } public string Output { get { return m_Output; } set { m_Output = value; } } public WebRequest WebRequest { get { return m_WebRequest; } set { m_WebRequest = value; } } public Stream RequestStream { get { return m_RequestStream; } set { m_RequestStream = value; } } public Timer TimeOutTimer { get { return m_TimeOutTimer; } set { m_TimeOutTimer = value; } } public bool Aborted { get { return m_Aborted; } set { m_Aborted = value; } } } public class BoshClientSocket : BaseSocket { private const string CONTENT_TYPE = "text/xml; charset=utf-8"; private const string METHOD = "POST"; private const string BOSH_VERSION = "1.6"; private const int WEBREQUEST_TIMEOUT = 5000; private const int OFFSET_WAIT = 5000; private string[] Keys; // Array of keys private int activeRequests = 0; // currently active (waiting) WebRequests private int CurrentKeyIdx; // index of the currect key private Queue m_SendQueue = new Queue(); // Queue for stanzas to send private bool streamStarted = false; // is the stream started? received stream header? private int polling = 0; private bool terminate = false; private bool terminated = false; private DateTime lastSend = DateTime.MinValue; // DateTime of the last activity/response private bool m_KeepAlive = true; private long rid; private bool restart = false; // stream state, are we currently restarting the stream? private string sid; private bool requestIsTerminating = false; private int webRequestId = 1; public BoshClientSocket(XmppConnection con) { base.m_XmppCon = con; } private void Init() { Keys = null; streamStarted = false; terminate = false; terminated = false; } #region << Properties >> private Jid m_To; private int m_Wait = 300; // 5 minutes by default, if you think this is to long change it over the public property private int m_Requests = 2; #if !CF && !CF_2 private int m_MinCountKeys = 1000; private int m_MaxCountKeys = 9999; #else // set this lower on embedded devices because the key generation is slow there private int m_MinCountKeys = 10; private int m_MaxCountKeys = 99; #endif private int m_Hold = 1; // should be 1 private int m_MaxPause = 0; private WebProxy m_Proxy = null; public Jid To { get { return m_To; } set { m_To = value; } } /// /// The longest time (in seconds) that the connection manager is allowed to wait before responding to any request during the session. /// This enables the client to prevent its TCP connection from expiring due to inactivity, as well as to limit the delay before /// it discovers any network failure. /// public int Wait { get { return m_Wait; } set { m_Wait = value; } } public int Requests { get { return m_Requests; } set { m_Requests = value; } } public int MaxCountKeys { get { return m_MaxCountKeys; } set { m_MaxCountKeys = value; } } public int MinCountKeys { get { return m_MinCountKeys; } set { m_MinCountKeys = value; } } /// /// This attribute specifies the maximum number of requests the connection manager is allowed to keep waiting /// at any one time during the session. If the client is not able to use HTTP Pipelining then this SHOULD be set to "1". /// public int Hold { get { return m_Hold; } set { m_Hold = value; } } /// /// Keep Alive for HTTP Webrequests, its disables by default because not many BOSH implementations support Keep Alives /// public bool KeepAlive { get { return m_KeepAlive; } set { m_KeepAlive = value; } } /// /// If the connection manager supports session pausing (see Inactivity) then it SHOULD advertise that to the client /// by including a 'maxpause' attribute in the session creation response element. /// The value of the attribute indicates the maximum length of a temporary session pause (in seconds) that a client MAY request. /// 0 is the default value and indicated that the connection manager supports no session pausing. /// public int MaxPause { get { return m_MaxPause; } set { m_MaxPause = value; } } public bool SupportsSessionPausing { get { return !(m_MaxPause == 0); } } public WebProxy Proxy { get { return m_Proxy; } set { m_Proxy = value; } } #endregion private string DummyStreamHeader { get { // // create dummy stream header StringBuilder sb = new StringBuilder(); sb.Append(""); return sb.ToString(); } } /// /// Generates a bunch of keys /// private void GenerateKeys() { /* 13.3 Generating the Key Sequence Prior to requesting a new session, the client MUST select an unpredictable counter ("n") and an unpredictable value ("seed"). The client then processes the "seed" through a cryptographic hash and converts the resulting 160 bits to a hexadecimal string K(1). It does this "n" times to arrive at the initial key K(n). The hashing algorithm MUST be SHA-1 as defined in RFC 3174. Example 25. Creating the key sequence K(1) = hex(SHA-1(seed)) K(2) = hex(SHA-1(K(1))) ... K(n) = hex(SHA-1(K(n-1))) */ int countKeys = GetRandomNumber(m_MinCountKeys, m_MaxCountKeys); Keys = new string[countKeys]; string prev = GenerateSeed(); for (int i = 0; i < countKeys; i++) { Keys[i] = Util.Hash.Sha1Hash(prev); prev = Keys[i]; } CurrentKeyIdx = countKeys - 1; } private string GenerateSeed() { int m_lenght = 10; #if CF util.RandomNumberGenerator rng = util.RandomNumberGenerator.Create(); #else RandomNumberGenerator rng = RandomNumberGenerator.Create(); #endif byte[] buf = new byte[m_lenght]; rng.GetBytes(buf); return Util.Hash.HexToString(buf); } private int GenerateRid() { int min = 1; int max = int.MaxValue; Random rnd = new Random(); return rnd.Next(min, max); } private int GetRandomNumber(int min, int max) { Random rnd = new Random(); return rnd.Next(min, max); } public override void Reset() { base.Reset(); streamStarted = false; restart = true; } public void RequestBoshSession() { /* Example 1. Requesting a BOSH session POST /webclient HTTP/1.1 Host: httpcm.jabber.org Accept-Encoding: gzip, deflate Content-Type: text/xml; charset=utf-8 Content-Length: 104 */ lastSend = DateTime.Now; // Generate the keys GenerateKeys(); rid = GenerateRid(); Body body = new Body(); /* * */ //window='5' content='text/xml; charset=utf-8' //body.SetAttribute("window", "5"); //body.SetAttribute("content", "text/xml; charset=utf-8"); body.Version = BOSH_VERSION; body.XmppVersion = "1.0"; body.Hold = m_Hold; body.Wait = m_Wait; body.Rid = rid; body.Polling = 0; body.Requests = m_Requests; body.To = new Jid(m_XmppCon.Server); body.NewKey = Keys[CurrentKeyIdx]; body.SetAttribute("xmpp:xmlns", "urn:xmpp:xbosh"); activeRequests++; HttpWebRequest req = (HttpWebRequest) CreateWebrequest(Address); WebRequestState state = new WebRequestState(req); state.Started = DateTime.Now; state.Output = body.ToString(); state.IsSessionRequest = true; req.Method = METHOD; req.ContentType = CONTENT_TYPE; req.Timeout = m_Wait * 1000; req.KeepAlive = m_KeepAlive; req.ContentLength = Encoding.UTF8.GetBytes(state.Output).Length; // state.Output.Length; try { IAsyncResult result = req.BeginGetRequestStream(new AsyncCallback(this.OnGetSessionRequestStream), state); } catch (Exception) { } } private void OnGetSessionRequestStream(IAsyncResult ar) { try { WebRequestState state = ar.AsyncState as WebRequestState; HttpWebRequest req = state.WebRequest as HttpWebRequest; Stream outputStream = req.EndGetRequestStream(ar); byte[] bytes = Encoding.UTF8.GetBytes(state.Output); state.RequestStream = outputStream; IAsyncResult result = outputStream.BeginWrite(bytes, 0, bytes.Length, OnEndWrite, state); } catch (WebException ex) { FireOnError(ex); Disconnect(); } } private void OnGetSessionRequestResponse(IAsyncResult result) { // grab the custom state object WebRequestState state = (WebRequestState)result.AsyncState; HttpWebRequest request = (HttpWebRequest)state.WebRequest; //state.TimeOutTimer.Dispose(); // get the Response HttpWebResponse resp = (HttpWebResponse)request.EndGetResponse(result); // The server must always return a 200 response code, // sending any session errors as specially-formatted identifiers. if (resp.StatusCode != HttpStatusCode.OK) { return; } Stream rs = resp.GetResponseStream(); int readlen; byte[] readbuf = new byte[1024]; MemoryStream ms = new MemoryStream(); while ((readlen = rs.Read(readbuf, 0, readbuf.Length)) > 0) { ms.Write(readbuf, 0, readlen); } byte[] recv = ms.ToArray(); if (recv.Length > 0) { string body = null; string stanzas = null; string res = Encoding.UTF8.GetString(recv, 0, recv.Length); ParseResponse(res, ref body, ref stanzas); Document doc = new Document(); doc.LoadXml(body); Body boshBody = doc.RootElement as Body; sid = boshBody.Sid; polling = boshBody.Polling; m_MaxPause = boshBody.MaxPause; byte[] bin = Encoding.UTF8.GetBytes(DummyStreamHeader + stanzas); base.FireOnReceive(bin, bin.Length); // cleanup webrequest resources ms.Close(); rs.Close(); resp.Close(); activeRequests--; if (activeRequests == 0) StartWebRequest(); } } /// /// This is ugly code, but currently all BOSH server implementaions are not namespace correct, /// which means we can't use the XML parser here and have to spit it with string functions. /// /// /// /// private void ParseResponse(string res, ref string body, ref string stanzas) { res = res.Trim(); if (res.EndsWith("/>")) { // // empty response body = res; stanzas = null; } else { /* * * * * */ // find position of the first closing angle bracket int startPos = res.IndexOf(">"); // find position of the last opening angle bracket int endPos = res.LastIndexOf("<"); body = res.Substring(0, startPos) + "/>"; stanzas = res.Substring(startPos + 1, endPos - startPos - 1); } } #region << Public Methods and Functions >> public override void Connect() { base.Connect(); Init(); FireOnConnect(); RequestBoshSession(); } public override void Disconnect() { base.Disconnect(); FireOnDisconnect(); //m_Connected = false; } public override void Send(byte[] bData) { base.Send(bData); Send(Encoding.UTF8.GetString(bData, 0, bData.Length)); } public override void Send(string data) { base.Send(data); // This are hacks because we send no stream headers and footer in Bosh if (data.StartsWith("")) { protocol.client.Presence pres = new protocol.client.Presence(); pres.Type = agsXMPP.protocol.client.PresenceType.unavailable; data = pres.ToString(); //= ""; terminate = true; } // return; lock (m_SendQueue) { m_SendQueue.Enqueue(data); } CheckDoRequest(); return; } #endregion private void CheckDoRequest() { /* * requestIsTerminating is true when a webrequest is ending * when the requests ends a new request gets started immedialtely, * so we don't have to create another request in the case */ if (!requestIsTerminating) Request(); } private void Request() { if (activeRequests < 2) StartWebRequest(); } private string BuildPostData() { CurrentKeyIdx--; rid++; StringBuilder sb = new StringBuilder(); Body body = new Body(); body.Rid = rid; body.Key = Keys[CurrentKeyIdx]; if (CurrentKeyIdx == 0) { // this is our last key // Generate a new key sequence GenerateKeys(); body.NewKey = Keys[CurrentKeyIdx]; } body.Sid = sid; //body.Polling = 0; body.To = new Jid(m_XmppCon.Server); if (restart) { body.XmppRestart = true; restart = false; } lock (m_SendQueue) { if (terminate && m_SendQueue.Count == 1) body.Type = BoshType.terminate; if (m_SendQueue.Count > 0) { sb.Append(body.StartTag()); while (m_SendQueue.Count > 0) { string data = m_SendQueue.Dequeue() as string; sb.Append(data); } sb.Append(body.EndTag()); return sb.ToString(); } else return body.ToString(); } } private void StartWebRequest() { StartWebRequest(false, null); } private void StartWebRequest(bool retry, string content) { lock (this) { webRequestId++; } activeRequests++; lastSend = DateTime.Now; HttpWebRequest req = (HttpWebRequest) CreateWebrequest(Address);; WebRequestState state = new WebRequestState(req); state.Started = DateTime.Now; state.WebRequestId = webRequestId; if (!retry) state.Output = BuildPostData(); else state.Output = content; req.Method = METHOD; req.ContentType = CONTENT_TYPE; req.Timeout = m_Wait * 1000; req.KeepAlive = m_KeepAlive; req.ContentLength = Encoding.UTF8.GetBytes(state.Output).Length; // Create the delegate that invokes methods for the timer. TimerCallback timerDelegate = TimeOutGetRequestStream; Timer timeoutTimer = new Timer(timerDelegate, state, WEBREQUEST_TIMEOUT, WEBREQUEST_TIMEOUT); state.TimeOutTimer = timeoutTimer; try { req.BeginGetRequestStream(OnGetRequestStream, state); } catch(Exception ex) { //Console.WriteLine(ex.Message); } } public void TimeOutGetRequestStream(Object stateObj) { //Console.WriteLine("Web Request timed out"); WebRequestState state = stateObj as WebRequestState; state.TimeOutTimer.Dispose(); state.Aborted = true; state.WebRequest.Abort(); } private void OnGetRequestStream(IAsyncResult ar) { try { WebRequestState state = ar.AsyncState as WebRequestState; if (state.Aborted) { activeRequests--; StartWebRequest(true, state.Output); } else { state.TimeOutTimer.Dispose(); HttpWebRequest req = state.WebRequest as HttpWebRequest; Stream requestStream = req.EndGetRequestStream(ar); state.RequestStream = requestStream; byte[] bytes = Encoding.UTF8.GetBytes(state.Output); requestStream.BeginWrite(bytes, 0, bytes.Length, OnEndWrite, state); } } catch (Exception ex) { activeRequests--; WebRequestState state = ar.AsyncState as WebRequestState; StartWebRequest(true, state.Output); } } private void OnEndWrite(IAsyncResult ar) { WebRequestState state = ar.AsyncState as WebRequestState; HttpWebRequest req = state.WebRequest as HttpWebRequest; Stream requestStream = state.RequestStream; requestStream.EndWrite(ar); requestStream.Close(); IAsyncResult result; try { if (state.IsSessionRequest) req.BeginGetResponse(OnGetSessionRequestResponse, state); else req.BeginGetResponse(OnGetResponse, state); } catch (Exception ex) { //Console.WriteLine(ex.Message); } } private void OnGetResponse(IAsyncResult ar) { try { requestIsTerminating = true; // grab the custom state object WebRequestState state = (WebRequestState)ar.AsyncState; HttpWebRequest request = (HttpWebRequest)state.WebRequest; HttpWebResponse resp = null; if (request.HaveResponse) { // TODO, its crashing mostly here // get the Response try { resp = (HttpWebResponse) request.EndGetResponse(ar); } catch (WebException ex) { activeRequests--; requestIsTerminating = false; if (ex.Response == null) { StartWebRequest(); } else { HttpWebResponse res = ex.Response as HttpWebResponse; if (res.StatusCode == HttpStatusCode.NotFound) { TerminateBoshSession(); } } return; } // The server must always return a 200 response code, // sending any session errors as specially-formatted identifiers. if (resp.StatusCode != HttpStatusCode.OK) { activeRequests--; requestIsTerminating = false; if (resp.StatusCode == HttpStatusCode.NotFound) { //Console.WriteLine("Not Found"); TerminateBoshSession(); } return; } } else { //Console.WriteLine("No response"); } Stream rs = resp.GetResponseStream(); int readlen; byte[] readbuf = new byte[1024]; MemoryStream ms = new MemoryStream(); while ((readlen = rs.Read(readbuf, 0, readbuf.Length)) > 0) { ms.Write(readbuf, 0, readlen); } byte[] recv = ms.ToArray(); if (recv.Length > 0) { string sbody = null; string stanzas = null; ParseResponse(Encoding.UTF8.GetString(recv, 0, recv.Length), ref sbody, ref stanzas); if (stanzas != null) { byte[] bStanzas = Encoding.UTF8.GetBytes(stanzas); base.FireOnReceive(bStanzas, bStanzas.Length); } else { if (sbody != null) { var doc = new Document(); doc.LoadXml(sbody); if (doc.RootElement != null) { var body = doc.RootElement as Body; if (body.Type == BoshType.terminate) TerminateBoshSession(); } } if (terminate && !terminated) { // empty teminate response TerminateBoshSession(); } } } // cleanup webrequest resources ms.Close(); rs.Close(); resp.Close(); activeRequests--; requestIsTerminating = false; //if (activeRequests == 0 && !terminated) if ( (activeRequests == 0 && !terminated) || (activeRequests == 1 && m_SendQueue.Count > 0) ) { StartWebRequest(); } } catch (Exception ex) { } } private WebRequest CreateWebrequest(string address) { WebRequest webReq = WebRequest.Create(address); #if !CF_2 if (m_Proxy != null) webReq.Proxy = m_Proxy; else { if (webReq.Proxy != null) webReq.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials; } #endif return webReq; } private void TerminateBoshSession() { // empty teminate response byte[] bStanzas = Encoding.UTF8.GetBytes(""); base.FireOnReceive(bStanzas, bStanzas.Length); terminated = true; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Net/PollingSocketException.cs0000644000175000017500000000250212204443225025010 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.Net { /// /// Summary description for PollingSocketException. /// public class PollSocketException : Exception { public PollSocketException(string msg) : base(msg) { } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Net/SynchronousAsyncResult.cs0000644000175000017500000000504712204443225025112 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2008 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.IO; using System.Threading; namespace agsXMPP.net { internal class SynchronousAsyncResult : IAsyncResult { /* object AsyncState { get; } WaitHandle AsyncWaitHandle { get; } bool CompletedSynchronously { get; } bool IsCompleted { get; } */ // Fields //internal Exception _exception; internal bool m_IsCompleted; internal bool m_IsWrite; internal int m_NumRead; internal object m_StateObject; internal ManualResetEvent m_WaitHandle; // Methods internal SynchronousAsyncResult(object asyncStateObject, bool isWrite) { m_StateObject = asyncStateObject; m_IsWrite = isWrite; m_WaitHandle = new ManualResetEvent(false); } // Properties public object AsyncState { get { return m_StateObject; } } public WaitHandle AsyncWaitHandle { get { return this.m_WaitHandle; } } public bool CompletedSynchronously { get { return true; } } public bool IsCompleted { get { return this.m_IsCompleted; } } internal bool IsWrite { get { return m_IsWrite; } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Net/SocketConnectionType.cs0000644000175000017500000000321212204443225024465 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; namespace agsXMPP.Net { /// /// Summary description for SocketType. /// public enum SocketConnectionType { #if !SL /// /// Direct TCP/IP Connection /// Direct, #endif /// /// A HTTP Polling Socket connection (JEP-0025) /// HttpPolling, /// /// XEP-0124: Bidirectional-streams Over Synchronous HTTP (BOSH) /// http://www.xmpp.org/extensions/xep-0124.html /// Bosh } } smuxi-0.11/lib/agsxmpp/agsxmpp/Net/PollClientSocket.cs0000644000175000017500000002636112204443225023603 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.IO; using System.Net; using System.Text; using System.Threading; using System.Collections; using System.Security.Cryptography; #if CF using agsXMPP.util; #endif namespace agsXMPP.Net { /// /// JEP-0025 Jabber HTTP Polling Socket /// public class PollClientSocket : BaseSocket { private const string CONTENT_TYPE = "application/x-www-form-urlencoded"; private const string METHOD = "POST"; private string[] m_Keys; private int m_CurrentKeyIdx; private string m_ID = null; private Queue m_SendQueue = new Queue(); /// /// Object for synchronizing threads /// private Object m_Lock = new Object(); #if CF || CF_2 private DateTime m_WaitUntil; #endif public PollClientSocket() { } #region << Properties and Members >> private bool m_Connected = false; private int m_Interval = 10000; #if !CF private int m_CountKeys = 256; #else // set this lower on embedded devices because the key generation is slow there private int m_CountKeys = 32; #endif private WebProxy m_Proxy = null; /// /// because the client socket is no presintant socket we return always true /// public override bool Connected { get { return true; } } /// /// Poll interval in milliseconds. /// The maximum interval recommended for clients between requests is two minutes (120000); /// Default is 10 seconds (10000) /// public int Interval { get { return m_Interval; } set { m_Interval = value;} } /// /// count of keys to generate each time. Keys are generated with the Sha1 algoritm. /// You can reduce the num,ber of keys to gemerate each time if your device is to slow on generating the keys /// or you want to save memory. /// 256 is the default value, 32 on CF /// public int CountKeys { get { return m_CountKeys; } set { m_CountKeys = value;} } public WebProxy Proxy { get { return m_Proxy; } set { m_Proxy = value; } } #endregion #region << Public Methods and Functions >> public override void Connect() { base.Connect(); FireOnConnect(); Init(); m_Connected = true; // Start a new Thread for polling Thread m_thread = new Thread(new ThreadStart(PollThread)); #if !CF // useful in debug m_thread.Name = "HTTP Polling Thread"; #endif m_thread.Start(); } public override void Disconnect() { base.Disconnect(); FireOnDisconnect(); m_Connected = false; } public override void Send(byte[] bData) { base.Send (bData); Send(Encoding.UTF8.GetString(bData, 0, bData.Length)); } public override void Send(string data) { base.Send (data); #if CF || CF_2 lock (m_Lock) { m_SendQueue.Enqueue(data); } #else lock(m_Lock) { m_SendQueue.Enqueue(data); Monitor.Pulse(m_Lock); } #endif } #endregion private void Init() { m_ID = null; m_Keys = null; m_CurrentKeyIdx = 0; } /// /// Simple algotithm for generating a random key /// /// private string GenerateRandomKey() { // Lenght of the Session ID on bytes, // 16 bytes equaly 32 chars // This should be unique enough int m_lenght = 16; RandomNumberGenerator RNG = RandomNumberGenerator.Create(); byte[] buf = new byte[m_lenght]; RNG.GetBytes(buf); return Util.Hash.HexToString(buf).ToLower(); } /// /// Generates a bunch of keys /// private void GenerateKeys() { string prev = GenerateRandomKey(); m_Keys = new string[m_CountKeys]; for (int i=0; i < m_CountKeys; i++) { byte[] hash = Util.Hash.Sha1HashBytes(prev); m_Keys[i] = Convert.ToBase64String(hash, 0, hash.Length); prev = m_Keys[i]; } m_CurrentKeyIdx = m_CountKeys - 1; } private void PollThread() { /* Example 7. Initial request (with keys) POST /wc12/webclient HTTP/1.1 Content-Type: application/x-www-form-urlencoded Host: webim.jabber.com 0;VvxEk07IFy6hUmG/PPBlTLE2fiA=, POST /wc12/webclient HTTP/1.1 Content-Type: application/x-www-form-urlencoded Host: webim.jabber.com 7776:2054;moPFsvHytDGiJQOjp186AMXAeP0=, hildjj */ while(m_Connected) { string content; string data; // lock(m_lock) // { if (m_SendQueue.Count > 0) data = m_SendQueue.Dequeue() as string; else data = ""; // } if (m_ID == null) { GenerateKeys(); content = string.Format("{0};{1},{2}", "0", m_Keys[m_CurrentKeyIdx], data); } else { if (m_CurrentKeyIdx == 0) { // only 1 Key left string key = m_Keys[0]; // generate new keys GenerateKeys(); /* Example 9. Changing key POST /wc12/webclient HTTP/1.1 Content-Type: application/x-www-form-urlencoded Host: webim.jabber.com 7776:2054;C+7Hteo/D9vJXQ3UfzxbwnXaijM=;Tr697Eff02+32FZp38Xaq2+3Bv4=, */ content = string.Format("{0};{1};{2},{3}", m_ID, key, m_Keys[m_CurrentKeyIdx], data); } else { // m_CurrentKey = CreateNextKey(m_CurrentKey); content = string.Format("{0};{1},{2}", m_ID, m_Keys[m_CurrentKeyIdx], data); } } //Console.WriteLine("used Key index: " + m_CurrentKeyIdx.ToString()); m_CurrentKeyIdx--; byte[] bytes = Encoding.UTF8.GetBytes(content); FireOnSend(bytes, bytes.Length); HttpWebRequest req = (HttpWebRequest) WebRequest.Create(Address); // Set Proxy Information if (m_Proxy != null) req.Proxy = m_Proxy; req.Method = METHOD; //req.KeepAlive = true; req.ContentType = CONTENT_TYPE; req.ContentLength = bytes.Length; req.Timeout = 5000; Stream outputStream; try { outputStream = req.GetRequestStream(); } catch (Exception ex) { base.FireOnError(ex); Disconnect(); return; } outputStream.Write (bytes, 0, bytes.Length); outputStream.Close (); // This does the Webrequest. So catch errors here HttpWebResponse resp; try { resp = (HttpWebResponse) req.GetResponse(); } catch(Exception ex) { FireOnError(ex); return; } // The server must always return a 200 response code, // sending any session errors as specially-formatted identifiers. if (resp.StatusCode != HttpStatusCode.OK) { FireOnError(new PollSocketException("unexpected status code " + resp.StatusCode.ToString())); return; } Stream rs = resp.GetResponseStream(); int readlen; byte[] readbuf = new byte[1024]; MemoryStream ms = new MemoryStream(); while ((readlen = rs.Read(readbuf, 0, readbuf.Length)) > 0) { ms.Write(readbuf, 0, readlen); } byte[] recv = ms.ToArray(); // Read Cookies from Header // Set-Cookie: ID=7776:2054; path=/webclient/; expires=-1 WebHeaderCollection headers = resp.Headers; // Check for any cookies // Didnt get the .NET CookieCollection classes working correct // So read it by hand, i cookie is only another simple header if (headers["Set-Cookie"] != null) { string header = headers["Set-Cookie"]; string[] cookies = header.Split( (char) ';'); Hashtable htCookies = new Hashtable(); foreach(string cookie in cookies) { string[] vals = cookie.Split( (char) '='); if (vals.Length == 2) htCookies.Add(vals[0], vals[1]); } if (htCookies.ContainsKey("ID")) { string id = htCookies["ID"] as string; // if ID ends with its an error message if ( !id.EndsWith(":0")) { // if me dont have the ID yet cache it if (m_ID == null) m_ID = id; } else { // Handle Errors switch (id) { case "0:0": // 3.1.1 Unknown Error // Server returns ID=0:0. // The response body can contain a textual error message. return; case "-1:0": // 3.1.2 Server Error // Server returns ID=-1:0 return; case "-2:0": // 3.1.3 Bad Request // Server returns ID=-2:0 return; case "-3:0": // 3.1.4 Key Sequence Error // Server returns ID=-3:0 return; } } } } // cleanup webrequest resources ms.Close(); rs.Close(); resp.Close(); if (recv.Length > 0) { //Console.WriteLine("RECV: " + Encoding.UTF8.GetString(recv)); FireOnReceive(recv, recv.Length); } else { // We received nothing in the response, // so sleep until next poll #if CF || CF_2 if (m_SendQueue.Count == 0) { m_WaitUntil = DateTime.Now.AddMilliseconds(m_Interval); while (m_SendQueue.Count == 0 && DateTime.Compare(m_WaitUntil, DateTime.Now) > 0) { Thread.Sleep(100); } } #else lock(m_Lock) { if (m_SendQueue.Count == 0) { // Left for debugging //Console.WriteLine("Start Wait: " + m_Interval.ToString()); Monitor.Wait(m_Lock, m_Interval); //Console.WriteLine("End Wait:"); } } #endif } } } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Net/CertificateVerifier.cs0000644000175000017500000000325112204443225024274 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2008 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if BCCRYPTO using System; using Org.BouncyCastle.Crypto.Tls; namespace agsXMPP.net { internal class CertificateVerifier : ICertificateVerifyer { internal event BaseSocket.CertificateValidationCallback OnVerifyCertificate; #region ICertificateVerifyer Members public bool IsValid(Org.BouncyCastle.Asn1.X509.X509CertificateStructure[] certs) { if (OnVerifyCertificate != null) return OnVerifyCertificate(certs); else return true; } #endregion } } #endifsmuxi-0.11/lib/agsxmpp/agsxmpp/Net/ClientSocket.cs0000644000175000017500000004645512245370027022766 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Net; using System.Net.Sockets; using System.Threading; using System.IO; using System.Text; using System.Configuration; using System.Collections; using System.Diagnostics; using Starksoft.Net.Proxy; #if SSL using System.Net.Security; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; #endif #if BCCRYPTO using Org.BouncyCastle.Crypto.Tls; #endif using agsXMPP.IO.Compression; using agsXMPP; namespace agsXMPP.Net { public class ConnectTimeoutException : Exception { public ConnectTimeoutException(string message) : base(message) { } } /// /// Use async sockets to connect, send and receive data over TCP sockets. /// public class ClientSocket : BaseSocket { TcpClient _socket; #if SSL SslStream m_SSLStream; #endif NetworkStream m_Stream; Stream m_NetworkStream = null; const int BUFFERSIZE = 1024; private byte[] m_ReadBuffer = null; private bool m_SSL = false; private bool m_PendingSend = false; private Queue m_SendQueue = new Queue(); /// /// is compression used for this connection /// private bool m_Compressed = false; /// /// is used to compress data /// private Deflater deflater = null; /// /// is used to decompress data /// private Inflater inflater = null; public IProxyClient Proxy { get; set; } #region << Constructor >> public ClientSocket() { } #endregion #region << Properties >> public bool SSL { get { return m_SSL; } #if SSL set { m_SSL = value; } #endif } public override bool SupportsStartTls { #if SSL get { return true; } #else get { return false; } #endif } /// /// Returns true if the socket is connected to the server. The property /// Socket.Connected does not always indicate if the socket is currently /// connected, this polls the socket to determine the latest connection state. /// public override bool Connected { get { // return right away if have not created socket if (_socket == null) return false; return _socket.Connected; // commented this out because it caused problems on some machines. // return the connected property of the socket now //the socket is not connected if the Connected property is false //if (!_socket.Connected) // return false; //// there is no guarantee that the socket is connected even if the //// Connected property is true //try //{ // // poll for error to see if socket is connected // return !_socket.Poll(1, SelectMode.SelectError); //} //catch //{ // return false; //} } } public bool Compressed { get { return m_Compressed; } set { m_Compressed = value; } } #endregion /// /// Connect to the specified address and port number. /// public void Connect(string address, int port) { Address = address; Port = port; Connect(); } public override void Connect() { base.Connect(); // Socket is never compressed at startup m_Compressed = false; IsEncrypted = false; m_ReadBuffer = null; m_ReadBuffer = new byte[BUFFERSIZE]; try { _socket = new TcpClient(); _socket.NoDelay = true; _socket.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, 1); // set timeout, after this the connection will be aborted _socket.ReceiveTimeout = 600 * 1000; _socket.SendTimeout = 600 * 1000; if (Proxy != null) { _socket.Connect(Proxy.ProxyHost, Proxy.ProxyPort); Proxy.TcpClient = _socket; Proxy.CreateConnection(Address, Port); } else { _socket.Connect(Address, Port); } m_Stream = _socket.GetStream(); m_NetworkStream = m_Stream; #if SSL if (m_SSL) InitSSL(); #endif FireOnConnect(); // Setup Receive Callback this.Receive(); } catch (Exception ex) { base.FireOnError(ex); } } #if SSL /// /// Starts TLS on a "normal" connection /// public override bool StartTls() { base.StartTls(); SslProtocols protocol = SslProtocols.Tls; return InitSSL(protocol); } private bool InitSSL() { return InitSSL(SslProtocols.Default); } /// /// /// /// private bool InitSSL(SslProtocols protocol) { m_SSLStream = new SslStream( m_Stream, false, new RemoteCertificateValidationCallback(ValidateCertificate), null ); try { m_SSLStream.AuthenticateAsClient(base.Address, null, protocol, true); // Display the properties and settings for the authenticated stream. //DisplaySecurityLevel(m_SSLStream); //DisplaySecurityServices(m_SSLStream); //DisplayCertificateInformation(m_SSLStream); //DisplayStreamProperties(m_SSLStream); } catch (AuthenticationException e) { if (e.InnerException != null) { //Console.WriteLine("Inner exception: {0}", e.InnerException.Message); } //Console.WriteLine ("Authentication failed - closing the connection."); //client.Close(); Disconnect(); return false; } m_NetworkStream = m_SSLStream; m_SSL = true; IsEncrypted = true; return true; } #region << SSL Properties Display stuff >> private void DisplaySecurityLevel(SslStream stream) { Console.WriteLine("Cipher: {0} strength {1}", stream.CipherAlgorithm, stream.CipherStrength); Console.WriteLine("Hash: {0} strength {1}", stream.HashAlgorithm, stream.HashStrength); Console.WriteLine("Key exchange: {0} strength {1}", stream.KeyExchangeAlgorithm, stream.KeyExchangeStrength); Console.WriteLine("Protocol: {0}", stream.SslProtocol); } private void DisplaySecurityServices(SslStream stream) { Console.WriteLine("Is authenticated: {0} as server? {1}", stream.IsAuthenticated, stream.IsServer); Console.WriteLine("IsSigned: {0}", stream.IsSigned); Console.WriteLine("Is Encrypted: {0}", stream.IsEncrypted); } private void DisplayStreamProperties(SslStream stream) { Console.WriteLine("Can read: {0}, write {1}", stream.CanRead, stream.CanWrite); Console.WriteLine("Can timeout: {0}", stream.CanTimeout); } private void DisplayCertificateInformation(SslStream stream) { //Console.WriteLine("Certificate revocation list checked: {0}", stream.CheckCertRevocationStatus); // Display the properties of the client's certificate. X509Certificate remoteCertificate = stream.RemoteCertificate; if (stream.RemoteCertificate != null) { Console.WriteLine("Remote cert was issued to {0} and is valid from {1} until {2}.", remoteCertificate.Subject, remoteCertificate.GetEffectiveDateString(), remoteCertificate.GetExpirationDateString()); } else { Console.WriteLine("Remote certificate is null."); } } #endregion /// /// Validate the SSL certificate here /// for now we dont stop the SSL connection an return always true /// /// /// /// //private bool ValidateCertificate (X509Certificate certificate, int[] certificateErrors) private bool ValidateCertificate (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return base.FireOnValidateCertificate(sender, certificate, chain, sslPolicyErrors); } #endif #if BCCRYPTO /// /// Starts TLS on a "normal" connection /// public override void StartTls() { base.StartTls(); //TlsProtocolHandler protocolHandler = new TlsProtocolHandler(m_NetworkStream, m_NetworkStream); //Stream st = new NetworkStream(_socket, false); TlsProtocolHandler protocolHandler = new TlsProtocolHandler(m_Stream, m_Stream); //TlsProtocolHandler protocolHandler = new TlsProtocolHandler(st, st); CertificateVerifier certVerify = new CertificateVerifier(); certVerify.OnVerifyCertificate += new CertificateValidationCallback(certVerify_OnVerifyCertificate); protocolHandler.Connect(certVerify); m_NetworkStream = new SslStream(protocolHandler.InputStream, protocolHandler.OutputStream); m_SSL = true; } internal bool certVerify_OnVerifyCertificate(Org.BouncyCastle.Asn1.X509.X509CertificateStructure[] certs) { return base.FireOnValidateCertificate(certs); } #endif /// /// Start Compression on the socket /// public override void StartCompression() { InitCompression(); } /// /// Initialize compression stuff (Inflater, Deflater) /// private void InitCompression() { base.StartCompression(); inflater = new Inflater(); deflater = new Deflater(); // Set the compressed flag to true when we init compression m_Compressed = true; } /// /// Disconnect from the server. /// public override void Disconnect() { base.Disconnect(); lock (this) { // TODO maybe we should notify the user which packets were not sent. m_PendingSend = false; m_SendQueue.Clear(); } // return right away if have not created socket if (_socket == null) return; try { // close the socket which terminates any pending // async operations _socket.Close(); } catch { } FireOnDisconnect(); } /// /// /// /// public override void Send(string data) { Send(Encoding.UTF8.GetBytes(data)); } /// /// Send data to the server. /// public override void Send(byte[] bData) { lock (this) { try { base.FireOnSend(bData, bData.Length); //Console.WriteLine("Socket OnSend: " + System.Text.Encoding.UTF8.GetString(bData, 0, bData.Length)); // compress bytes if we are on a compressed socket if (m_Compressed) { byte[] tmpData = new byte[bData.Length]; bData.CopyTo(tmpData, 0); bData = Compress(bData); // for compression debug statistics // base.FireOnOutgoingCompressionDebug(this, bData, bData.Length, tmpData, tmpData.Length); } // .NET 2.0 SSL Stream issues when sending multiple async packets // http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=124213&SiteID=1 if (m_PendingSend) { m_SendQueue.Enqueue(bData); } else { m_PendingSend = true; try { m_NetworkStream.BeginWrite(bData, 0, bData.Length, new AsyncCallback(EndSend), null); } catch (Exception) { Disconnect(); } } } catch (Exception) { } } } /// /// Read data from server. /// private void Receive() { m_NetworkStream.BeginRead(m_ReadBuffer, 0, BUFFERSIZE, new AsyncCallback(EndReceive), null); } private void EndReceive(IAsyncResult ar) { try { int nBytes; nBytes = m_NetworkStream.EndRead(ar); if (nBytes > 0) { // uncompress Data if we are on a compressed socket if (m_Compressed) { byte[] buf = Decompress(m_ReadBuffer, nBytes); base.FireOnReceive(buf, buf.Length); // for compression debug statistics //base.FireOnInComingCompressionDebug(this, m_ReadBuffer, nBytes, buf, buf.Length); } else { //Console.WriteLine("Socket OnReceive: " + System.Text.Encoding.UTF8.GetString(m_ReadBuffer, 0, nBytes)); // Raise the receive event base.FireOnReceive(m_ReadBuffer, nBytes); } // Setup next Receive Callback if (this.Connected) this.Receive(); } else { Disconnect(); } } catch (ObjectDisposedException) { //object already disposed, just exit return; } catch (System.IO.IOException ex) { //Console.WriteLine("\nSocket Exception: " + ex.Message); Disconnect(); } } private void EndSend(IAsyncResult ar) { lock (this) { try { m_NetworkStream.EndWrite(ar); if (m_SendQueue.Count > 0) { byte[] bData = (byte[])m_SendQueue.Dequeue(); m_NetworkStream.BeginWrite(bData, 0, bData.Length, new AsyncCallback(EndSend), null); } else { m_PendingSend = false; } } catch (Exception) { Disconnect(); } } } #region << compression functions >> /// /// Compress bytes /// /// /// private byte[] Compress(byte[] bIn) { int ret; // The Flush SHOULD be after each STANZA // The libds sends always one complete XML Element/stanza, // it doesn't cache stanza and send them in groups, and also doesnt send partial // stanzas. So everything should be ok here. deflater.SetInput(bIn); deflater.Flush(); MemoryStream ms = new MemoryStream(); do { byte[] buf = new byte[BUFFERSIZE]; ret = deflater.Deflate(buf); if (ret > 0) ms.Write(buf, 0, ret); } while (ret > 0); return ms.ToArray(); } /// /// Decompress bytes /// /// /// /// private byte[] Decompress(byte[] bIn, int length) { int ret; inflater.SetInput(bIn, 0, length); MemoryStream ms = new MemoryStream(); do { byte[] buf = new byte[BUFFERSIZE]; ret = inflater.Inflate(buf); if (ret > 0) ms.Write(buf, 0, ret); } while (ret > 0); return ms.ToArray(); } #endregion } }smuxi-0.11/lib/agsxmpp/agsxmpp/Net/BaseSocket.cs0000644000175000017500000001515112245370027022407 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; #if SSL using System.Net.Security; #endif using System.Security.Cryptography.X509Certificates; namespace agsXMPP.Net { /// /// Base Socket class /// public abstract class BaseSocket { public delegate void OnSocketDataHandler(object sender, byte[] data, int count); //public delegate void OnSocketCompressionDebugHandler(object sender, byte[] CompData, int CompCount, byte[] UncompData, int UncompCount); /* // for compression debug statistics public event OnSocketCompressionDebugHandler OnIncomingCompressionDebug; public event OnSocketCompressionDebugHandler OnOutgoingCompressionDebug; protected void FireOnInComingCompressionDebug(object sender, byte[] CompData, int CompCount, byte[] UncompData, int UncompCount) { if (OnIncomingCompressionDebug != null) OnIncomingCompressionDebug(sender, CompData, CompCount, UncompData, UncompCount); } protected void FireOnOutgoingCompressionDebug(object sender, byte[] CompData, int CompCount, byte[] UncompData, int UncompCount) { if (OnOutgoingCompressionDebug != null) OnOutgoingCompressionDebug(sender, CompData, CompCount, UncompData, UncompCount); } */ #if SSL public event RemoteCertificateValidationCallback OnValidateCertificate; #endif //#if CF_2 // public delegate bool CertificateValidationCallback(X509Certificate cert); // public event CertificateValidationCallback OnValidateCertificate; //#endif #if BCCRYPTO public delegate bool CertificateValidationCallback(Org.BouncyCastle.Asn1.X509.X509CertificateStructure[] certs); public event CertificateValidationCallback OnValidateCertificate; #endif public event OnSocketDataHandler OnReceive; public event OnSocketDataHandler OnSend; public event ObjectHandler OnConnect; public event ObjectHandler OnDisconnect; public event ErrorHandler OnError; private string m_Address = null; private int m_Port = 0; private long m_ConnectTimeout = 10000; // 10 seconds is default internal XmppConnection m_XmppCon = null; public bool IsEncrypted { get; protected set; } public BaseSocket() { } public string Address { get { return m_Address; } set { m_Address = value; } } public int Port { get { return m_Port; } set { m_Port = value; } } protected void FireOnConnect() { if (OnConnect != null) OnConnect(this); } protected void FireOnDisconnect() { if (OnDisconnect != null) OnDisconnect(this); } protected void FireOnReceive(byte[] b, int length) { if (OnReceive != null) OnReceive(this, b, length); } protected void FireOnSend(byte[] b, int length) { if (OnSend != null) OnSend(this, b, length); } protected void FireOnError(Exception ex) { if (OnError != null) OnError(this, ex); } #if SSL // The following method is invoked by the RemoteCertificateValidationDelegate. protected bool FireOnValidateCertificate( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { if (OnValidateCertificate != null) return OnValidateCertificate(sender, certificate, chain, sslPolicyErrors); else return true; //if (sslPolicyErrors == SslPolicyErrors.None) // return true; //Console.WriteLine("Certificate error: {0}", sslPolicyErrors); // Do not allow this client to communicate with unauthenticated servers. //return false; } #endif #if BCCRYPTO protected bool FireOnValidateCertificate(Org.BouncyCastle.Asn1.X509.X509CertificateStructure[] certs) { if (OnValidateCertificate != null) return OnValidateCertificate(certs); else return true; } #endif //#if CF_2 // protected bool FireOnValidateCertificate(X509Certificate cert) // { // if (OnValidateCertificate != null) // return OnValidateCertificate(cert); // else // return true; // } //#endif public virtual bool Connected { get { return false; } } public virtual bool SupportsStartTls { get { return false; } } public virtual long ConnectTimeout { get { return m_ConnectTimeout; } set { m_ConnectTimeout = value; } } #region << Methods >> public virtual void Connect() { } public virtual void Disconnect() { } public virtual bool StartTls() { return true; } public virtual void StartCompression() { } /// /// Added for Bosh because we have to tell the BoshClientSocket when to reset the stream /// public virtual void Reset() { } /// /// /// /// public virtual void Send(string data) { } /// /// Send data to the server. /// public virtual void Send(byte[] bData) { } #endregion } }smuxi-0.11/lib/agsxmpp/agsxmpp/Net/SslStream.cs0000644000175000017500000001512012204443225022271 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2008 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if BCCRYPTO using System; using System.IO; using System.Threading; namespace agsXMPP.net { /// /// /// public class SslStream : Stream { Stream inStream; Stream outStream; public SslStream(Stream inputStream, Stream outputStream) { inStream = inputStream; outStream = outputStream; } public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { //return inStream.BeginRead(buffer, offset, count, callback, state); //if (!this.CanRead) //{ // // __Error.ReadNotSupported(); //} SynchronousAsyncResult ar = new SynchronousAsyncResult(state, false); try { //int num = Read(buffer, offset, count); int num = inStream.Read(buffer, offset, count); ar.m_NumRead = num; ar.m_IsCompleted = true; //ar._waitHandle.Set(); } catch (IOException exception) { //ar._exception = exception; } if (callback != null) { callback(ar); } return ar; } public override int EndRead(IAsyncResult asyncResult) { //return inStream.EndRead(asyncResult); if (asyncResult == null) { throw new ArgumentNullException("asyncResult"); } SynchronousAsyncResult result = asyncResult as SynchronousAsyncResult; if ((result == null) || result.IsWrite) { //__Error.WrongAsyncResult(); } //if (result._EndXxxCalled) //{ // //__Error.EndReadCalledTwice(); //} //result._EndXxxCalled = true; //if (result._exception != null) //{ // throw result._exception; //} return result.m_NumRead; } public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { SynchronousAsyncResult ar = new SynchronousAsyncResult(state, true); try { //Write(buffer, offset, count); outStream.Write(buffer, offset, count); ar.m_IsCompleted = true; //ar._waitHandle.Set(); } catch (IOException exception) { //ar._exception = exception; } if (callback != null) { callback(ar); //callback.BeginInvoke(ar, null, null); } return ar; } public override void EndWrite(IAsyncResult asyncResult) { //outStream.EndWrite(asyncResult); if (asyncResult == null) { throw new ArgumentNullException("asyncResult"); } SynchronousAsyncResult result = asyncResult as SynchronousAsyncResult; if ((result == null) || !result.IsWrite) { //__Error.WrongAsyncResult(); } //if (result._EndXxxCalled) //{ // //__Error.EndWriteCalledTwice(); //} //result._EndXxxCalled = true; //if (result._exception != null) //{ // throw result._exception; //} } public override bool CanSeek { get { throw new Exception("The method or operation is not implemented."); } } public override bool CanRead { get { return inStream.CanRead; } } public override bool CanWrite { get { return outStream.CanWrite; } } public override int Read(byte[] buffer, int offset, int count) { return inStream.Read(buffer, offset, count); } public override int ReadByte() { return inStream.ReadByte(); } public override void Write(byte[] buffer, int offset, int count) { outStream.Write(buffer, offset, count); } public override void WriteByte(byte value) { outStream.WriteByte(value); } public override long Length { get { throw new Exception("The method or operation is not implemented."); } } public override void Flush() { throw new Exception("The method or operation is not implemented."); } public override long Position { get { throw new Exception("The method or operation is not implemented."); } set { throw new Exception("The method or operation is not implemented."); } } public override long Seek(long offset, SeekOrigin origin) { throw new Exception("The method or operation is not implemented."); } public override void SetLength(long value) { throw new Exception("The method or operation is not implemented."); } } } #endifsmuxi-0.11/lib/agsxmpp/agsxmpp/XmppConnection.cs0000644000175000017500000003275312250206660022606 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Text; using System.Threading; using agsXMPP.Net; using agsXMPP.protocol.extensions.bosh; using agsXMPP.Xml; using agsXMPP.Xml.Dom; using agsXMPP.Idn; namespace agsXMPP { public delegate void XmlHandler (object sender, string xml); public delegate void ErrorHandler (object sender, Exception ex); public delegate void XmppConnectionStateHandler (object sender, XmppConnectionState state); /// /// abstract base class XmppConnection. /// public abstract class XmppConnection { private Timer m_KeepaliveTimer = null; #region << Events >> /// /// This event just informs about the current state of the XmppConnection /// public event XmppConnectionStateHandler OnXmppConnectionStateChanged; /// /// a XML packet or text is received. /// This are no winsock events. The Events get generated from the XML parser /// public event XmlHandler OnReadXml; /// /// XML or Text is written to the Socket this includes also the keep alive packages (a single space) /// public event XmlHandler OnWriteXml; public event ErrorHandler OnError; /// /// Data received from the Socket /// public event BaseSocket.OnSocketDataHandler OnReadSocketData; /// /// Data was sent to the socket for sending /// public event BaseSocket.OnSocketDataHandler OnWriteSocketData; #endregion #region << Constructors >> public XmppConnection() { InitSocket(); // Streamparser stuff m_StreamParser = new StreamParser(); m_StreamParser.OnStreamStart += new StreamHandler(StreamParserOnStreamStart); m_StreamParser.OnStreamEnd += new StreamHandler(StreamParserOnStreamEnd); m_StreamParser.OnStreamElement += StreamParserOnStreamElement; m_StreamParser.StreamElementNotHandled += StreamParserStreamElementNotHandled; m_StreamParser.OnStreamError += new StreamError (StreamParserOnStreamError); m_StreamParser.OnError += new ErrorHandler (StreamParserOnError); } public XmppConnection(agsXMPP.Net.SocketConnectionType type) : this() { m_SocketConnectionType = agsXMPP.Net.SocketConnectionType.Direct; } #endregion #region << Properties and Member Variables >> private int m_Port = 5222; private string m_Server = null; private string m_ConnectServer = null; private string m_StreamId = ""; private string m_StreamVersion = "1.0"; private XmppConnectionState m_ConnectionState = XmppConnectionState.Disconnected; private BaseSocket m_ClientSocket = null; private StreamParser m_StreamParser = null; private SocketConnectionType m_SocketConnectionType = SocketConnectionType.Direct; private bool m_AutoResolveConnectServer = true; private int m_KeepAliveInterval = 120; private bool m_KeepAlive = true; /// /// The Port of the remote server for the connection /// public int Port { get { return m_Port; } set { m_Port = value; } } /// /// domain or ip-address of the remote server for the connection /// public string Server { get { return m_Server; } set { #if !STRINGPREP if (value != null) m_Server = value.ToLower(); else m_Server = null; #else if (value != null) m_Server = Stringprep.NamePrep(value); else m_Server = null; #endif } } /// /// /// public string ConnectServer { get { return m_ConnectServer; } set { m_ConnectServer = value; } } /// /// the id of the current xmpp xml-stream /// public string StreamId { get { return m_StreamId; } set { m_StreamId = value; } } /// /// Set to null for old Jabber Protocol without SASL andstream features /// public string StreamVersion { get { return m_StreamVersion; } set { m_StreamVersion = value; } } public XmppConnectionState XmppConnectionState { get { return m_ConnectionState; } } /// /// Read Online Property ClientSocket /// returns the SOcket object used for this connection /// public BaseSocket ClientSocket { get { return m_ClientSocket; } } /// /// the underlaying XMPP StreamParser. Normally you don't need it, but we make it accessible for /// low level access to the stream /// public StreamParser StreamParser { get { return m_StreamParser; } } public SocketConnectionType SocketConnectionType { get { return m_SocketConnectionType; } set { m_SocketConnectionType = value; InitSocket(); } } public bool AutoResolveConnectServer { get { return m_AutoResolveConnectServer; } set { m_AutoResolveConnectServer = value; } } /// /// /// the keep alive interval in seconds. /// Default value is 120 /// /// /// Keep alive packets prevent disconenct on NAT and broadband connections which often /// disconnect if they are idle. /// /// public int KeepAliveInterval { get { return m_KeepAliveInterval; } set { m_KeepAliveInterval = value; } } /// /// Send Keep Alives (for NAT) /// public bool KeepAlive { get { return m_KeepAlive; } set { m_KeepAlive = value; } } #endregion #region << Socket handers >> public virtual void SocketOnConnect(object sender) { DoChangeXmppConnectionState(XmppConnectionState.Connected); } public virtual void SocketOnDisconnect(object sender) { } public virtual void SocketOnReceive(object sender, byte[] data, int count) { if (OnReadSocketData != null) OnReadSocketData(sender, data, count); // put the received bytes to the parser lock (this) { StreamParser.Push(data, 0, count); } } public virtual void SocketOnError(object sender, Exception ex) { } #endregion #region << StreamParser Events >> public virtual void StreamParserOnStreamStart (object sender, Node e) { string xml = e.ToString().Trim(); xml = xml.Substring(0, xml.Length - 2) + ">"; this.FireOnReadXml(this, xml); protocol.Stream st = (protocol.Stream)e; if (st != null) { m_StreamId = st.StreamId; m_StreamVersion = st.Version; } } public virtual void StreamParserOnStreamEnd (object sender, Node e) { Element tag = e as Element; string qName; if (tag.Prefix == null) qName = tag.TagName; else qName = tag.Prefix + ":" + tag.TagName; string xml = ""; this.FireOnReadXml(this, xml); } public virtual void StreamParserStreamElementNotHandled(object sender, UnhandledElementEventArgs eventArgs) { } public virtual void StreamParserOnStreamElement(object sender, ElementEventArgs e) { this.FireOnReadXml(this, e.Element.ToString()); } public virtual void StreamParserOnStreamError (object sender, Exception ex) { } public virtual void StreamParserOnError (object sender, Exception ex) { FireOnError(sender, ex); } #endregion internal void DoChangeXmppConnectionState(XmppConnectionState state) { m_ConnectionState = state; if (OnXmppConnectionStateChanged!=null) OnXmppConnectionStateChanged(this, state); } private void InitSocket() { if (m_ClientSocket != null) { m_ClientSocket.OnConnect -= SocketOnConnect; m_ClientSocket.OnDisconnect -= SocketOnDisconnect; m_ClientSocket.OnReceive -= SocketOnReceive; m_ClientSocket.OnError -= SocketOnError; } m_ClientSocket = null; // Socket Stuff if (m_SocketConnectionType == agsXMPP.Net.SocketConnectionType.HttpPolling) m_ClientSocket= new PollClientSocket(); else if (m_SocketConnectionType == agsXMPP.Net.SocketConnectionType.Bosh) m_ClientSocket = new BoshClientSocket(this); else m_ClientSocket = new ClientSocket(); m_ClientSocket.OnConnect += SocketOnConnect; m_ClientSocket.OnDisconnect += SocketOnDisconnect; m_ClientSocket.OnReceive += SocketOnReceive; m_ClientSocket.OnError += SocketOnError; } /// /// Starts connecting of the socket /// public virtual void SocketConnect() { DoChangeXmppConnectionState(XmppConnectionState.Connecting); ClientSocket.Connect(); } public void SocketConnect(string server, int port) { ClientSocket.Address = server; ClientSocket.Port = port; SocketConnect(); } public void SocketDisconnect() { m_ClientSocket.Disconnect(); } /// /// Send a xml string over the XmppConnection /// /// public void Send(string xml) { FireOnWriteXml(this, xml); m_ClientSocket.Send(xml); if (OnWriteSocketData != null) OnWriteSocketData(this, Encoding.UTF8.GetBytes(xml), xml.Length); // reset keep alive timer if active to make sure the interval is always idle time from the last // outgoing packet if (m_KeepAlive && m_KeepaliveTimer != null) m_KeepaliveTimer.Change(m_KeepAliveInterval * 1000, m_KeepAliveInterval * 1000); } /// /// Send a xml element over the XmppConnection /// /// public virtual void Send(Element e) { Send(e.ToString()); } public void Open(string xml) { Send(xml); } /// /// Send the end of stream /// public virtual void Close() { Send(""); } protected void FireOnReadXml(object sender, string xml) { if (OnReadXml != null) OnReadXml(sender, xml); } protected void FireOnWriteXml(object sender, string xml) { if (OnWriteXml != null) OnWriteXml(sender, xml); } protected void FireOnError(object sender, Exception ex) { if (OnError != null) OnError(sender, ex); } #region << Keepalive Timer functions >> protected void CreateKeepAliveTimer() { // Create the delegate that invokes methods for the timer. TimerCallback timerDelegate = new TimerCallback(KeepAliveTick); int interval = m_KeepAliveInterval * 1000; // Create a timer that waits x seconds, then invokes every x seconds. m_KeepaliveTimer = new Timer(timerDelegate, null, interval, interval); } protected void DestroyKeepAliveTimer() { if (m_KeepaliveTimer == null) return; m_KeepaliveTimer.Dispose(); m_KeepaliveTimer = null; } private void KeepAliveTick(Object state) { // Send a Space for Keep Alive Send(" "); } #endregion } }smuxi-0.11/lib/agsxmpp/agsxmpp/XmppClientConnection.cs0000644000175000017500000015616012250206660023744 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.IO; using System.Text; using System.Collections; using System.Collections.Specialized; using System.ComponentModel; using System.Threading; using System.Net; using System.Net.Sockets; using agsXMPP.Xml; using agsXMPP.Xml.Dom; using agsXMPP.protocol; using agsXMPP.protocol.iq; using agsXMPP.protocol.iq.auth; using agsXMPP.protocol.iq.agent; using agsXMPP.protocol.iq.disco; using agsXMPP.protocol.iq.roster; using agsXMPP.protocol.iq.register; using agsXMPP.protocol.iq.version; using agsXMPP.protocol.stream; using agsXMPP.protocol.stream.feature.compression; using agsXMPP.protocol.client; using agsXMPP.protocol.tls; using agsXMPP.protocol.extensions.caps; using agsXMPP.protocol.extensions.compression; using agsXMPP.Exceptions; using agsXMPP.Sasl; using agsXMPP.Net; using agsXMPP.Net.Dns; using agsXMPP.Idn; namespace agsXMPP { public delegate void ObjectHandler (object sender); public delegate void XmppElementHandler (object sender, Element e); /// /// Summary description for XmppClient. /// public class XmppClientConnection : XmppConnection { const string SRV_RECORD_PREFIX = "_xmpp-client._tcp."; // Delegates public delegate void RosterHandler (object sender, RosterItem item); public delegate void AgentHandler (object sender, Agent agent); private SaslHandler m_SaslHandler = null; private bool m_CleanUpDone; private bool m_StreamStarted; private SRVRecord[] _SRVRecords; private SRVRecord _currentSRVRecord; #region << Properties and Member Variables >> private string m_ClientLanguage = "en"; private string m_ServerLanguage = null; private string m_Username = ""; private string m_Password = ""; private string m_Resource = "agsXMPP"; private string m_Status = ""; private int m_Priority = 5; private ShowType m_Show = ShowType.NONE; private bool m_AutoRoster = true; private bool m_AutoAgents = true; private bool m_AutoPresence = true; #if !(CF || CF_2) private bool m_UseSso = false; internal string m_KerberosPrincipal; #endif private bool m_UseSSL = false; #if (CF || CF_2) && !BCCRYPTO private bool m_UseStartTLS = false; private bool f_ForceStartTLS = false; #else private bool m_UseStartTLS = true; private bool f_ForceStartTLS = true; #endif private bool m_UseCompression = false; internal bool m_Binded = false; private bool m_Authenticated = false; private IqGrabber m_IqGrabber = null; private MessageGrabber m_MessageGrabber = null; private PresenceGrabber m_PresenceGrabber = null; private bool m_RegisterAccount = false; private PresenceManager m_PresenceManager; private RosterManager m_RosterManager; private Capabilities m_Capabilities = new Capabilities(); private string m_ClientVersion = "1.0"; private bool m_EnableCapabilities = false; private DiscoInfo m_DiscoInfo = new DiscoInfo(); /// /// The prefered Client Language Attribute /// /// public string ClientLanguage { get { return m_ClientLanguage; } set { m_ClientLanguage = value; } } /// /// The language which the server decided to use. /// /// public string ServerLanguage { get { return m_ServerLanguage; } } /// /// the username that is used to authenticate to the xmpp server /// public string Username { get { return m_Username; } set { // first Encode the user/node m_Username = value; string tmpUser = Jid.EscapeNode(value); #if !STRINGPREP if (value != null) m_Username = tmpUser.ToLower(); else m_Username = null; #else if (value != null) m_Username = Stringprep.NodePrep(tmpUser); else m_Username = null; #endif } } /// /// the password that is used to authenticate to the xmpp server /// public string Password { get { return m_Password; } set { m_Password = value; } } /// /// the resource for this connection each connection to the server with the same jid needs a unique resource. /// You can also set Resource = null and the server will assign a random Resource for you. /// public string Resource { get { return m_Resource; } set { m_Resource = value; } } /// /// our XMPP id build from Username, Server and Resource Property (user@server/resourcee) /// public Jid MyJID { get { return BuildMyJid(); } } /// /// The status message of this connection which is sent with the presence packets. /// /// /// you have to call the method SendMyPresence to send your updated presence to the server. /// public string Status { get { return m_Status; } set { m_Status = value; } } /// /// The priority of this connection send with the presence packets. /// The OPTIONAL priority element contains non-human-readable XML character data that specifies the priority level /// of the resource. The value MUST be an integer between -128 and +127. If no priority is provided, a server /// SHOULD consider the priority to be zero. /// /// you have to call the method SendMyPresence to send your updated presence to the server. public int Priority { get { return m_Priority; } set { if ((value < -127) || (value > 127)) throw new ArgumentException("The value MUST be an integer between -128 and +127"); m_Priority = value; } } /// /// change the showtype. /// /// you have to call the method SendMyPresence to send your updated presence to the server. public ShowType Show { get { return m_Show; } set { m_Show = value; } } /// /// If set to true then the Roster (contact list) is requested automatically after sucessful login. /// Set this property to false if you don't want to receive your contact list, or request it manual. /// To save bandwidth is makes sense to cache the contact list and don't receive it on each login. /// /// default value is true public bool AutoRoster { get { return m_AutoRoster; } set { m_AutoRoster = value; } } /// /// Sends the presence Automatically after successful login. /// This property works only in combination with AutoRoster (AutoRoster = true). /// public bool AutoPresence { get { return m_AutoPresence; } set { m_AutoPresence = value; } } /// /// If set to true then the Agents are requested automatically after sucessful login. /// Set this property to false if you don't use agents at all, or if you request them manual. /// /// default value is true public bool AutoAgents { get { return m_AutoAgents; } set { m_AutoAgents = value; } } #if !(CF || CF_2) /// /// Use Single sign on (GSSAPI/KERBEROS) /// public bool UseSso { get { return m_UseSso; } set { if (Util.Runtime.IsMono() && Util.Runtime.IsUnix()) throw new NotImplementedException(); m_UseSso = value; } } /// /// Gets the kerberos principal. /// /// The kerberos principal. public string KerberosPrincipal { get { return m_KerberosPrincipal; } set { m_KerberosPrincipal = value; } } #endif /// /// use "old style" ssl for this connection (Port 5223). /// [Obsolete("Try to use ForceStartTls instead")] public bool UseSSL { get { return m_UseSSL; } #if SSL set { // Only one of both can be true m_UseSSL = value; if (value == true) m_UseStartTLS = false; } #endif } public bool ForceStartTls { get { return f_ForceStartTLS; } set { UseStartTLS = UseStartTLS || value; f_ForceStartTLS = value; } } /// /// use Start-TLS on this connection when the server supports it. Make sure UseSSL is false when /// you want to use this feature. /// public bool UseStartTLS { get { return m_UseStartTLS; } #if SSL || BCCRYPTO || CF_2 set { // Only one of both can be true m_UseStartTLS = value; if (value == true) m_UseSSL = false; } #endif } /// /// Use Stream compression to save bandwidth? /// This should not be used in combination with StartTLS, /// because TLS has build in compression (see RFC 2246, http://www.ietf.org/rfc/rfc2246.txt) /// public bool UseCompression { get { return m_UseCompression; } set { m_UseCompression = value; } } /// /// Are we Authenticated to the server? This is readonly and set by the library /// public bool Authenticated { get { return m_Authenticated; } } /// /// is the resource binded? This is readonly and set by the library /// public bool Binded { get { return m_Binded; } } /// /// Should the library register a new account on the server /// public bool RegisterAccount { get { return m_RegisterAccount; } set { m_RegisterAccount = value; } } public IqGrabber IqGrabber { get { return m_IqGrabber; } } public MessageGrabber MessageGrabber { get { return m_MessageGrabber; } } public PresenceGrabber PresenceGrabber { get { return m_PresenceGrabber; } } public RosterManager RosterManager { get { return m_RosterManager; } } public PresenceManager PresenceManager { get { return m_PresenceManager; } } public bool EnableCapabilities { get { return m_EnableCapabilities; } set { m_EnableCapabilities = value; } } public string ClientVersion { get { return m_ClientVersion; } set { m_ClientVersion = value; } } public Capabilities Capabilities { get { return m_Capabilities; } set { m_Capabilities = value; } } public Capabilities ServerCapabilities { get; set; } /// /// The DiscoInfo object is used to respond to DiscoInfo request if AutoAnswerDiscoInfoRequests == true in DisoManager objects, /// it's also used to build the Caps version when EnableCapabilities is set to true. /// /// When EnableCapailities == true call UpdateCapsVersion after each update of the DiscoInfo object /// /// public DiscoInfo DiscoInfo { get { return m_DiscoInfo; } set { m_DiscoInfo = value; } } #endregion #region << Events >> /// /// We are authenticated to the server now. /// public event ObjectHandler OnLogin; /// /// This event occurs after the resource was binded /// public event ObjectHandler OnBinded; /// /// Event that occurs on bind errors /// public event XmppElementHandler OnBindError; /// /// This event is fired when we get register information. /// You ca use this event for custom registrations. /// public event RegisterEventHandler OnRegisterInformation; /// /// This event gets fired after a new account is registered /// public event ObjectHandler OnRegistered; /// /// This event ets fired after a ChangePassword Request was successful /// public event ObjectHandler OnPasswordChanged; /* was never used, comment ot until we need it public event XmppElementHandler OnXmppError; */ /// /// Event that occurs on registration errors /// public event XmppElementHandler OnRegisterError; /// /// Event occurs on Xmpp Stream error elements /// public event XmppElementHandler OnStreamError; /// /// Event that occurs on authentication errors /// e.g. wrong password, user doesnt exist etc... /// public event XmppElementHandler OnAuthError; /// /// Event occurs on Socket Errors /// public event ErrorHandler OnSocketError; public event ObjectHandler OnClose; public event EventHandler SendingServiceUnavailable; /// /// This event is raised when a response to a roster query is received. The roster query contains the contact list. /// This lost could be very large and could contain hundreds of contacts. The are all send in a single XML element from /// the server. Normally you show the contact list in a GUI control in you application (treeview, listview). /// When this event occurs you couls Suspend the GUI for faster drawing and show change the mousepointer to the hourglass /// /// see also OnRosterItem and OnRosterEnd public event ObjectHandler OnRosterStart; /// /// This event is raised when a response to a roster query is received. It notifies you that all RosterItems (contacts) are /// received now. /// When this event occurs you could Resume the GUI and show the normal mousepointer again. /// /// see also OnRosterStart and OnRosterItem public event ObjectHandler OnRosterEnd; /// /// This event is raised when a response to a roster query is received. This event always contains a single RosterItem. /// e.g. you have 150 friends on your contact list, then this event is called 150 times. /// /// see also OnRosterItem and OnRosterEnd public event RosterHandler OnRosterItem; /// /// This event is raised when a response to an agents query which could contain multiple agentitems. /// Normally you show the items in a GUI. This event could be used to suspend the UI for faster drawing. /// /// see also OnAgentItem and OnAgentEnd public event ObjectHandler OnAgentStart; /// /// This event is raised when a response to an agents query which could contain multiple agentitems. /// Normally you show the items in a GUI. This event could be used to resume the suspended userinterface. /// /// see also OnAgentStart and OnAgentItem public event ObjectHandler OnAgentEnd; /// /// This event returns always a single AgentItem from a agents query result. /// This is from the old jabber protocol. Instead of agents Disco (Service Discovery) should be used in modern /// application. But still lots of servers use Agents. /// /// /// see also OnAgentStart and OnAgentEnd public event AgentHandler OnAgentItem; /// /// /// public event IqHandler OnIq; /// /// We received a message. This could be a chat message, headline, normal message or a groupchat message. /// There are also XMPP extension which are embedded in messages. /// e.g. X-Data forms. /// public event MessageHandler OnMessage; /// /// We received a presence from a contact or chatroom. /// Also subscriptions is handles in this event. /// public event PresenceHandler OnPresence; //public event ErrorHandler OnError; public event SaslEventHandler OnSaslStart; public event ObjectHandler OnSaslEnd; #endregion #region << Constructors >> public XmppClientConnection() : base() { m_IqGrabber = new IqGrabber(this); m_MessageGrabber = new MessageGrabber(this); m_PresenceGrabber = new PresenceGrabber(this); m_PresenceManager = new PresenceManager(this); m_RosterManager = new RosterManager(this); } public XmppClientConnection(SocketConnectionType type) : this() { base.SocketConnectionType = type; } /// /// create a new XmppClientConnection with the given JabberId and password /// /// JabberId (user@example.com) /// password public XmppClientConnection(Jid jid, string pass) : this() { base.Server = jid.Server; this.Username = jid.User; this.Password = pass; } /// /// create a new XmppClientConnection with the given server /// Username and Password gets set later /// /// public XmppClientConnection(string server) : this() { base.Server = server; } /// /// create a new XmppClientConnection with the given server and port number /// Username and Password gets set later /// /// public XmppClientConnection(string server, int port) : this(server) { base.Port = port; } #endregion /// /// This method open the connections to the xmpp server and authenticates you to ther server. /// This method is async, don't assume you are already connected when it returns. You have to wait for the OnLogin Event /// public void Open() { _Open(); } /// /// This method open the connections to the xmpp server and authenticates you to ther server. /// This method is async, don't assume you are already connected when it returns. You have to wait for the OnLogin Event /// /// your username /// your password public void Open(string username, string password) { this.Username = username; this.Password = password; _Open(); } /// /// This method open the connections to the xmpp server and authenticates you to ther server. /// This method is async, don't assume you are already connected when it returns. You have to wait for the OnLogin Event /// /// your username /// your passowrd /// resource for this connection public void Open(string username, string password, string resource) { this.m_Username = username; this.m_Password = password; this.m_Resource = resource; _Open(); } /// /// This method open the connections to the xmpp server and authenticates you to ther server. /// This method is async, don't assume you are already connected when it returns. You have to wait for the OnLogin Event /// /// your username /// your password /// resource for this connection /// priority which will be sent with presence packets public void Open(string username, string password, string resource, int priority) { this.m_Username = username; this.m_Password = password; this.m_Resource = resource; this.m_Priority = priority; _Open(); } /// /// This method open the connections to the xmpp server and authenticates you to ther server. /// This method is async, don't assume you are already connected when it returns. You have to wait for the OnLogin Event /// /// your username /// your password /// priority which will be sent with presence packets public void Open(string username, string password, int priority) { this.m_Username = username; this.m_Password = password; this.m_Priority = priority; _Open(); } #region << Socket handers >> public override void SocketOnConnect(object sender) { base.SocketOnConnect(sender); SendStreamHeader(true); } public override void SocketOnDisconnect(object sender) { base.SocketOnDisconnect(sender); if(!m_CleanUpDone) CleanupSession(); } protected virtual void OnSendingServiceUnavailable(SendingServiceUnavailableEventArgs e) { if (SendingServiceUnavailable != null) SendingServiceUnavailable(this, e); } public override void SocketOnError(object sender, Exception ex) { base.SocketOnError(sender, ex); if ((ex.GetType() == typeof(ConnectTimeoutException) || (ex.GetType() == typeof(SocketException) && ((SocketException)ex).ErrorCode == 10061)) && _SRVRecords != null && _SRVRecords.Length > 1) { // connect failed. We are using SRV records and have multiple results. // remove the current record RemoveSrvRecord(_currentSRVRecord); // find and set a new record SetConnectServerFromSRVRecords(); // connect again OpenSocket(); } else { // Fires the socket error if (OnSocketError != null) OnSocketError(this, ex); // Only cleaneUp Session and raise on close if the stream already has started // if teh stream gets closed because of a socket error we have to raise both errors fo course if (m_StreamStarted && !m_CleanUpDone) CleanupSession(); } } #endregion private void _Open() { m_CleanUpDone = false; m_StreamStarted = false; StreamParser.Reset(); #if SSL if (ClientSocket.GetType() == typeof(ClientSocket)) ((ClientSocket) ClientSocket).SSL = m_UseSSL; #endif // this should start later //if (m_KeepAlive) // CreateKeepAliveTimer(); if (SocketConnectionType == SocketConnectionType.Direct && AutoResolveConnectServer) ResolveSrv(); OpenSocket(); } private void OpenSocket() { if (ConnectServer == null) SocketConnect(base.Server, base.Port); else SocketConnect(this.ConnectServer, base.Port); } #region << SRV functions >> /// /// Resolves the connection host of a xmpp domain when SRV records are set /// private void ResolveSrv() { #if !(CF || CF_2) try { // get the machine's default DNS servers var dnsServers = IPConfigurationInformation.DnsServers; if (dnsServers.Count > 0) { // Take the 1st DNS Server for our query IPAddress dnsServer = dnsServers[0]; string queryDomain = SRV_RECORD_PREFIX + Server; _SRVRecords = Resolver.SRVLookup(queryDomain, dnsServer); SetConnectServerFromSRVRecords(); } } catch (Exception ex) { FireOnError(this, ex); } #endif } private void SetConnectServerFromSRVRecords() { // check we have a response if (_SRVRecords != null && _SRVRecords.Length > 0) { //SRVRecord srv = _SRVRecords[0]; _currentSRVRecord = PickSRVRecord(); this.Port = _currentSRVRecord.Port; this.ConnectServer = _currentSRVRecord.Target; } else { // no SRV-Records set _currentSRVRecord = null; this.ConnectServer = null; } } private void RemoveSrvRecord(SRVRecord rec) { int i = 0; SRVRecord[] recs = new SRVRecord[_SRVRecords.Length - 1]; foreach (SRVRecord srv in _SRVRecords) { if (!srv.Equals(rec)) { recs[i] = srv; i++; } } _SRVRecords = recs; } /// /// Picks one of the SRV records. /// priority and weight are evaluated by the following algorithm. /// /// SRVRecord private SRVRecord PickSRVRecord() { SRVRecord ret = null; // total weight of all servers with the same priority int totalWeight = 0; // ArrayList for the servers with the lowest priority ArrayList lowServers = new ArrayList(); // check we have a response if (_SRVRecords != null && _SRVRecords.Length > 0) { // Find server(s) with the highest priority (could be multiple) foreach (SRVRecord srv in _SRVRecords) { if (ret == null) { ret = srv; lowServers.Add(ret); totalWeight = ret.Weight; } else { if (srv.Priority == ret.Priority) { lowServers.Add(srv); totalWeight += srv.Weight; } else if (srv.Priority < ret.Priority) { // found a servr with a lower priority // clear the lowServers Array and start with this server lowServers.Clear(); lowServers.Add(ret); ret = srv; totalWeight = ret.Weight; } else if (srv.Priority > ret.Priority) { // exit the loop, because servers are already sorted by priority break; } } } } // if we have multiple lowServers then we have to pick a random one // BUT we have too involve the weight which can be used for "Load Balancing" here if (lowServers.Count > 1) { if (totalWeight > 0) { // Create a random value between 1 - total Weight int rnd = new Random().Next(1, totalWeight); int i = 0; foreach (SRVRecord sr in lowServers) { if (rnd > i && rnd <= (i + sr.Weight)) { ret = sr; break; } else { i += sr.Weight; } } } else { // Servers have no weight, they are all equal, pick a random server int rnd = new Random().Next(lowServers.Count); ret = (SRVRecord) lowServers[rnd]; } } return ret; } #endregion private void SendStreamHeader(bool startParser) { StringBuilder sb = new StringBuilder(); sb.Append(" // sb.Append(" xml:lang='" + "en" + "' "); sb.Append(">"); Open(sb.ToString()); } /// /// Sends our Presence, the packet is built of Status, Show and Priority /// public void SendMyPresence() { Presence pres = new Presence(m_Show, m_Status, m_Priority); // Add client caps when enabled if (m_EnableCapabilities) { if (m_Capabilities.Version == null) UpdateCapsVersion(); pres.AddChild(m_Capabilities); } this.Send(pres); } /// /// Sets the caps version automatically from the DiscoInfo object. /// Call this member after each change of the DiscoInfo object /// public void UpdateCapsVersion() { m_Capabilities.SetVersion(m_DiscoInfo); } internal void RequestLoginInfo() { AuthIq iq = new AuthIq(IqType.get, new Jid(base.Server)); iq.Query.Username = this.m_Username; IqGrabber.SendIq(iq, OnGetAuthInfo); } /// /// Changing the Password. You should use this function only when connected with SSL or TLS /// because the password is sent in plain text over the connection. /// /// /// /// /// After this request was successful the new password is set automatically in the Username Property /// /// /// value of the new password public void ChangePassword(string newPass) { /* Example 10. Password Change bill newpass Because the password change request contains the password in plain text, a client SHOULD NOT send such a request unless the underlying stream is encrypted (using SSL or TLS) and the client has verified that the server certificate is signed by a trusted certificate authority. A given domain MAY choose to disable password changes if the stream is not properly encrypted, or to disable in-band password changes entirely. If the user provides an empty password element or a password element that contains no XML character data (i.e., either or ), the server or service MUST NOT change the password to a null value, but instead MUST maintain the existing password. Example 11. Host Informs Client of Successful Password Change */ RegisterIq regIq = new RegisterIq(IqType.set, new Jid(base.Server)); regIq.Query.Username = this.m_Username; regIq.Query.Password = newPass; IqGrabber.SendIq(regIq, (object sender, IQEventArgs e) => OnChangePasswordResult(e, newPass) ); } /// /// /// /// /// /// contains the new password private void OnChangePasswordResult(IQEventArgs e, string newPass) { if (e.IQ.Type == IqType.result) { if(OnPasswordChanged!=null) OnPasswordChanged(this); // Set the new password in the Password property on sucess m_Password = newPass; e.Handled = true; } else if (e.IQ.Type == IqType.error) { /* The server or service SHOULD NOT return the original XML sent in IQ error stanzas related to password changes. Example 12. Host Informs Client of Failed Password Change (Bad Request) Example 13. Host Informs Client of Failed Password Change (Not Authorized) Example 14. Server Informs Client of Failed Password Change (Not Allowed) */ if(OnRegisterError!=null) OnRegisterError(this, e.IQ); } } #region << Register new Account >> /// /// requests the registration fields /// /// object which contains the features node which we need later for login again void GetRegistrationFields(Element elem) { // // // RegisterIq regIq = new RegisterIq(IqType.get, new Jid(base.Server)); IqGrabber.SendIq(regIq, (object sender, IQEventArgs e) => OnRegistrationFieldsResult(e, elem) ); } void OnRegistrationFieldsResult(IQEventArgs e, Element data) { if (e.IQ.Type != IqType.error) { if (e.IQ.Query is Register) { RegisterEventArgs args = new RegisterEventArgs(e.IQ.Query as Register); if (OnRegisterInformation != null) OnRegisterInformation(this, args); DoChangeXmppConnectionState(XmppConnectionState.Registering); IQ regIq = new IQ(IqType.set); regIq.GenerateId(); regIq.To = new Jid(base.Server); //RegisterIq regIq = new RegisterIq(IqType.set, new Jid(base.Server)); if (args.Auto) { Register reg = new Register(this.m_Username, this.m_Password); regIq.Query = reg; } else { regIq.Query = args.Register; } IqGrabber.SendIq(regIq, (object sender, IQEventArgs ev) => OnRegisterResult(ev, data) ); e.Handled = true; } } else { if (OnRegisterError != null) OnRegisterError(this, e.IQ); e.Handled = true; // not really } } private void OnRegisterResult(IQEventArgs e, Element data) { /* Example 6. Host Informs Entity of Failed Registration (Username Conflict) bill m1cro$oft billg@bigcompany.com Example 7. Host Informs Entity of Failed Registration (Some Required Information Not Provided) bill Calliope */ if (e.IQ.Type == IqType.result) { DoChangeXmppConnectionState(XmppConnectionState.Registered); if (OnRegistered != null) OnRegistered(this); if (this.StreamVersion != null && this.StreamVersion.StartsWith("1.")) { // init sasl login InitSaslHandler(); var eventArgs = new ElementEventArgs(data); m_SaslHandler.OnStreamElement(this, eventArgs); if (eventArgs.Handled) { e.Handled = true; } } else { // old jabber style login RequestLoginInfo(); e.Handled = true; } } else if (e.IQ.Type == IqType.error) { if (OnRegisterError != null) OnRegisterError(this, e.IQ); } } #endregion private void OnGetAuthInfo(object sender, IQEventArgs e) { // We get smth like this and should add password (digest) and ressource // Recv:gnauck // Send: // gnauck27c05d464e3f908db3b2ca1729674bfddb28daf2Office // // Recv: e.Handled = true; var iq = e.IQ; if (iq.Error != null) { FireOnAuthError(iq); return; } iq.GenerateId(); iq.SwitchDirection(); iq.Type = IqType.set; Auth auth = (Auth) iq.Query; auth.Resource = this.m_Resource; auth.SetAuth(this.m_Username, this.m_Password, this.StreamId); IqGrabber.SendIq(iq, OnAuthenticate); } /// /// Refreshes the myJid Member Variable /// private Jid BuildMyJid() { Jid jid = new Jid(null); jid.m_User = m_Username; jid.m_Server = Server; jid.m_Resource = m_Resource; jid.BuildJid(); return jid; } #region << RequestAgents >> public void RequestAgents() { AgentsIq iq = new AgentsIq(IqType.get, new Jid(base.Server)); IqGrabber.SendIq(iq, OnAgents); } private void OnAgents(object sender, IQEventArgs e) { e.Handled = true; if (OnAgentStart != null) OnAgentStart(this); Agents agents = e.IQ.Query as Agents; if (agents != null) { foreach (Agent a in agents.GetAgents()) { if (OnAgentItem != null) OnAgentItem(this, a); } } if (OnAgentEnd != null) OnAgentEnd(this); e.Handled = true; } #endregion #region << RequestRoster >> public void RequestRoster() { RosterIq iq = new RosterIq(IqType.get); Send(iq); } private void OnRosterIQ(IQ iq) { // if type == result then it must be the "FullRoster" we requested // in this case we raise OnRosterStart and OnRosterEnd // // if type == set its a new added r updated rosteritem. Here we dont raise // OnRosterStart and OnRosterEnd if (iq.Type == IqType.result && OnRosterStart != null) OnRosterStart(this); Roster r = iq.Query as Roster; if (r != null) { foreach (RosterItem i in r.GetRoster()) { if (OnRosterItem != null) OnRosterItem(this, i); } } if (iq.Type == IqType.result && OnRosterEnd != null) OnRosterEnd(this); if (m_AutoPresence && iq.Type == IqType.result) SendMyPresence(); } #endregion private void OnAuthenticate(object sender, IQEventArgs e) { if (e.IQ.Type == IqType.result) { m_Authenticated = true; RaiseOnLogin(); e.Handled = true; } else if(e.IQ.Type == IqType.error) { /* * * * test * dc7e472abb95b65c2b75129ade607170be478b16 * MiniClient * * Unauthorized * * */ if (OnAuthError!=null) OnAuthError(this, e.IQ); } } internal void FireOnAuthError(Element e) { if (OnAuthError!=null) OnAuthError(this, e); } #region << StreamParser Events >> public override void StreamParserOnStreamStart(object sender, Node e) { base.StreamParserOnStreamStart(this, e); m_StreamStarted = true; //m_CleanUpDone = false; moved that to _Open(); protocol.Stream st = (protocol.Stream)e; if (st == null) return; // Read the server language string m_ServerLanguage = st.Language; // Auth stuff if (!RegisterAccount) { if (this.StreamVersion != null && this.StreamVersion.StartsWith("1.")) { if (!Authenticated) { // we assume server supports SASL here, because it advertised a StreamVersion 1.X // and wait for the stream features and initialize the SASL Handler InitSaslHandler(); } } else { // old auth stuff RequestLoginInfo(); } } else { // Register on "old" jabber servers without stream features if (this.StreamVersion == null) GetRegistrationFields(null); } } private void InitSaslHandler() { if (m_SaslHandler == null) { m_SaslHandler = new SaslHandler(this); m_SaslHandler.OnSaslStart += new SaslEventHandler(m_SaslHandler_OnSaslStart); m_SaslHandler.OnSaslEnd += new ObjectHandler(m_SaslHandler_OnSaslEnd); } } public override void StreamParserOnStreamEnd(object sender, Node e) { base.StreamParserOnStreamEnd(sender, e); if (!m_CleanUpDone) CleanupSession(); } public override void StreamParserOnStreamElement(object sender, ElementEventArgs eventArgs) { base.StreamParserOnStreamElement(sender, eventArgs); bool handled = false; var e = eventArgs.Element; if (e is IQ) { IQ iq = e as IQ; if (OnIq != null) { var ev = new IQEventArgs(iq); OnIq(this, ev); handled = handled || ev.Handled; } if ( iq != null && iq.Query != null) { // Roster if (iq.Query is Roster) { OnRosterIQ(iq); handled = true; } } } else if (e is Message) { if (OnMessage != null) { OnMessage(this, e as Message); handled = true; } } else if (e is Presence) { if (OnPresence != null) { OnPresence(this, e as Presence); handled = true; } } else if (e is protocol.stream.Features) { // Stream Features // StartTLS stuff protocol.stream.Features f = e as protocol.stream.Features; #if SSL || BCCRYPTO || CF_2 if (f.SupportsStartTls && m_UseStartTLS) { DoChangeXmppConnectionState(XmppConnectionState.Securing); Send(new StartTls()); } // connection is not encrypted, doesn't support starttls but tls is forced else if (!ClientSocket.IsEncrypted && !f.SupportsStartTls && ForceStartTls) { FireOnError(this, new StartTlsException("StartTls is not supported on this server")); Close(); } else #endif if (m_UseCompression && f.SupportsCompression && f.Compression.SupportsMethod(CompressionMethod.zlib)) { // Check for Stream Compression // we support only ZLIB because its a free algorithm without patents // yes ePatents suck DoChangeXmppConnectionState(XmppConnectionState.StartCompression); Send(new Compress(CompressionMethod.zlib)); } else if (m_RegisterAccount) { // Do registration after TLS when possible if (f.SupportsRegistration) GetRegistrationFields(e); else { // registration is not enabled on this server FireOnError(this, new RegisterException("Registration is not allowed on this server")); Close(); // Close the stream } } ServerCapabilities = f.Capabilities; } #if SSL || BCCRYPTO || CF_2 else if (e is Proceed) { StreamParser.Reset(); if (ClientSocket.StartTls()) { SendStreamHeader(false); DoChangeXmppConnectionState(XmppConnectionState.Authenticating); handled = true; } } #endif else if (e is Compressed) { //DoChangeXmppConnectionState(XmppConnectionState.StartCompression); StreamParser.Reset(); ClientSocket.StartCompression(); // Start new Stream Header compressed. SendStreamHeader(false); DoChangeXmppConnectionState(XmppConnectionState.Compressed); handled = true; } else if (e is agsXMPP.protocol.Error) { if (OnStreamError != null) { OnStreamError(this, e as Element); handled = true; } } if (handled) { eventArgs.Handled = true; } } public override void StreamParserStreamElementNotHandled(object sender, UnhandledElementEventArgs eventArgs) { var stanza = eventArgs.Element as protocol.Base.StanzaWithError; if (stanza == null) { // what should we do here? return; } if (stanza.Error != null) { // don't respond to error messages with service unavailable return; } stanza.Error = new protocol.client.Error(ErrorCondition.ServiceUnavailable); stanza.SwitchDirection(); // allow the client to prevent this message (privacy/security reasons) var ev = new SendingServiceUnavailableEventArgs(stanza); OnSendingServiceUnavailable(ev); if (ev.Cancel) { // the client has cancelled this return; } Send(eventArgs.Element); } public override void StreamParserOnStreamError(object sender, Exception ex) { base.StreamParserOnStreamError(sender, ex); SocketDisconnect(); CleanupSession(); //this._NetworkStream.Close(); FireOnError(this, ex); if (!m_CleanUpDone) CleanupSession(); } #endregion public override void Send(Element e) { if (!(ClientSocket is BoshClientSocket)) { // this is a hack to not send the xmlns="jabber:client" with all packets Element dummyEl = new Element("a"); dummyEl.Namespace = Uri.CLIENT; dummyEl.AddChild(e); string toSend = dummyEl.ToString(); Send(toSend.Substring(25, toSend.Length - 25 - 4)); } else base.Send(e); } /// /// Does the Clieanup of the Session and sends the OnClose Event /// private void CleanupSession() { m_CleanUpDone = true; // TODO, check if this is always OK if (ClientSocket.Connected) ClientSocket.Disconnect(); DoChangeXmppConnectionState(XmppConnectionState.Disconnected); StreamParser.Reset(); m_IqGrabber.Clear(); m_MessageGrabber.Clear(); if (m_SaslHandler != null) { m_SaslHandler.Dispose(); m_SaslHandler = null; } m_Authenticated = false; m_Binded = false; DestroyKeepAliveTimer(); if (OnClose!=null) OnClose(this); } internal void Reset() { // tell also the socket that we need to reset the stream, this is needed for BOSH ClientSocket.Reset(); StreamParser.Reset(); SendStreamHeader(false); } internal void DoRaiseEventBinded() { if (OnBinded!=null) OnBinded(this); } internal void DoRaiseEventBindError(Element iq) { if (OnBindError != null) OnBindError(this, iq); } #region << SASL Handler Events >> private void m_SaslHandler_OnSaslStart(object sender, SaslEventArgs args) { // This acts only as a tunnel to the client if (OnSaslStart!=null) OnSaslStart(this, args); } internal void RaiseOnLogin() { if (KeepAlive) CreateKeepAliveTimer(); if (OnLogin!=null) OnLogin(this); if(m_AutoAgents) RequestAgents(); if (m_AutoRoster) RequestRoster(); } private void m_SaslHandler_OnSaslEnd(object sender) { if (OnSaslEnd!=null) OnSaslEnd(this); m_Authenticated = true; } #endregion } public class SendingServiceUnavailableEventArgs : CancelEventArgs { public protocol.Base.StanzaWithError Stanza { get; protected set; } public SendingServiceUnavailableEventArgs(protocol.Base.StanzaWithError stanza) :base() { Stanza = stanza; } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/0000755000175000017500000000000012250206660020203 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Gssapi/0000755000175000017500000000000012204443225021430 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Gssapi/SSPIHelper.cs0000644000175000017500000005666112204443225023713 0ustar00meebeymeebey00000000000000#if !MONO using System; using System.Runtime.InteropServices; using System.Security.Principal; namespace agsXMPP.Sasl.Gssapi { internal enum SecBufferType { SECBUFFER_VERSION = 0, SECBUFFER_EMPTY = 0, SECBUFFER_DATA = 1, SECBUFFER_TOKEN = 2, SECBUFFER_PADDING = 9, SECBUFFER_STREAM = 10 } [StructLayout(LayoutKind.Sequential)] internal struct SecBuffer : IDisposable { public int cbBuffer; public int BufferType; public IntPtr pvBuffer; public SecBuffer(int bufferSize) { cbBuffer = bufferSize; BufferType = (int)SecBufferType.SECBUFFER_TOKEN; pvBuffer = Marshal.AllocHGlobal(bufferSize); } public SecBuffer(byte[] secBufferBytes) { cbBuffer = secBufferBytes.Length; BufferType = (int)SecBufferType.SECBUFFER_TOKEN; pvBuffer = Marshal.AllocHGlobal(cbBuffer); Marshal.Copy(secBufferBytes, 0, pvBuffer, cbBuffer); } public SecBuffer(byte[] secBufferBytes, SecBufferType bufferType) { BufferType = (int)bufferType; if (secBufferBytes != null && secBufferBytes.Length != 0) { cbBuffer = secBufferBytes.Length; pvBuffer = Marshal.AllocHGlobal(cbBuffer); Marshal.Copy(secBufferBytes, 0, pvBuffer, cbBuffer); } else { cbBuffer = 0; pvBuffer = IntPtr.Zero; } } public void Dispose() { if (pvBuffer != IntPtr.Zero) { Marshal.FreeHGlobal(pvBuffer); pvBuffer = IntPtr.Zero; } } } internal struct MultipleSecBufferHelper { public byte[] Buffer; public SecBufferType BufferType; public MultipleSecBufferHelper(byte[] buffer, SecBufferType bufferType) { Buffer = buffer; BufferType = bufferType; } }; [StructLayout(LayoutKind.Sequential)] internal struct SecBufferDesc : IDisposable { public int ulVersion; public int cBuffers; public IntPtr pBuffers; //Point to SecBuffer public SecBufferDesc(int bufferSize) { ulVersion = (int)SecBufferType.SECBUFFER_VERSION; cBuffers = 1; SecBuffer ThisSecBuffer = new SecBuffer(bufferSize); pBuffers = Marshal.AllocHGlobal(Marshal.SizeOf(ThisSecBuffer)); Marshal.StructureToPtr(ThisSecBuffer, pBuffers, false); } public SecBufferDesc(byte[] secBufferBytes) { ulVersion = (int)SecBufferType.SECBUFFER_VERSION; cBuffers = 1; SecBuffer ThisSecBuffer = new SecBuffer(secBufferBytes); pBuffers = Marshal.AllocHGlobal(Marshal.SizeOf(ThisSecBuffer)); Marshal.StructureToPtr(ThisSecBuffer, pBuffers, false); } internal SecBufferDesc(MultipleSecBufferHelper[] secBufferBytesArray) { if (secBufferBytesArray == null || secBufferBytesArray.Length == 0) { throw new ArgumentException("secBufferBytesArray cannot be null or 0 length"); } ulVersion = (int)SecBufferType.SECBUFFER_VERSION; cBuffers = secBufferBytesArray.Length; //Allocate memory for SecBuffer Array.... pBuffers = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SecBuffer)) * cBuffers); for (int Index = 0; Index < secBufferBytesArray.Length; Index++) { //Super hack: Now allocate memory for the individual SecBuffers //and just copy the bit values to the SecBuffer array!!! SecBuffer ThisSecBuffer = new SecBuffer(secBufferBytesArray[Index].Buffer, secBufferBytesArray[Index].BufferType); //We will write out bits in the following order: //int cbBuffer; //int BufferType; //pvBuffer; //Note: that we won't be releasing the memory allocated by ThisSecBuffer until we //are disposed... int CurrentOffset = Index * Marshal.SizeOf(typeof(SecBuffer)); Marshal.WriteInt32(pBuffers, CurrentOffset, ThisSecBuffer.cbBuffer); int length = CurrentOffset + Marshal.SizeOf(ThisSecBuffer.cbBuffer); Marshal.WriteInt32(pBuffers, length, ThisSecBuffer.BufferType); length = CurrentOffset + Marshal.SizeOf(ThisSecBuffer.cbBuffer) + Marshal.SizeOf(ThisSecBuffer.BufferType); Marshal.WriteIntPtr(pBuffers, length, ThisSecBuffer.pvBuffer); } } public void Dispose() { if (pBuffers != IntPtr.Zero) { if (cBuffers == 1) { SecBuffer ThisSecBuffer = (SecBuffer)Marshal.PtrToStructure(pBuffers, typeof(SecBuffer)); ThisSecBuffer.Dispose(); } else { // Since we aren't sending any messages using the kerberos encrypt/decrypt. // The 1st buffer is going to be empty. We can skip it. for (int Index = 1; Index < cBuffers; Index++) { //The bits were written out the following order: //int cbBuffer; //int BufferType; //pvBuffer; //What we need to do here is to grab a hold of the pvBuffer allocate by the individual //SecBuffer and release it... int CurrentOffset = Index * Marshal.SizeOf(typeof(SecBuffer)); int totalLength = CurrentOffset + Marshal.SizeOf(typeof(int)) + Marshal.SizeOf(typeof(int)); IntPtr SecBufferpvBuffer = Marshal.ReadIntPtr(pBuffers, totalLength); Marshal.FreeHGlobal(SecBufferpvBuffer); } } Marshal.FreeHGlobal(pBuffers); pBuffers = IntPtr.Zero; } } public byte[] GetSecBufferByteArray() { byte[] Buffer = null; if (pBuffers == IntPtr.Zero) { throw new InvalidOperationException("Object has already been disposed!!!"); } if (cBuffers == 1) { SecBuffer ThisSecBuffer = (SecBuffer)Marshal.PtrToStructure(pBuffers, typeof(SecBuffer)); if (ThisSecBuffer.cbBuffer > 0) { Buffer = new byte[ThisSecBuffer.cbBuffer]; Marshal.Copy(ThisSecBuffer.pvBuffer, Buffer, 0, ThisSecBuffer.cbBuffer); } } else { int BytesToAllocate = 0; for (int Index = 0; Index < cBuffers; Index++) { //The bits were written out the following order: //int cbBuffer; //int BufferType; //pvBuffer; //What we need to do here calculate the total number of bytes we need to copy... int CurrentOffset = Index * Marshal.SizeOf(typeof(SecBuffer)); BytesToAllocate += Marshal.ReadInt32(pBuffers, CurrentOffset); } Buffer = new byte[BytesToAllocate]; for (int Index = 0, BufferIndex = 0; Index < cBuffers; Index++) { //The bits were written out the following order: //int cbBuffer; //int BufferType; //pvBuffer; //Now iterate over the individual buffers and put them together into a //byte array... int CurrentOffset = Index * Marshal.SizeOf(typeof(SecBuffer)); int BytesToCopy = Marshal.ReadInt32(pBuffers, CurrentOffset); int length = CurrentOffset + Marshal.SizeOf(typeof(int)) + Marshal.SizeOf(typeof(int)); IntPtr SecBufferpvBuffer = Marshal.ReadIntPtr(pBuffers, length); Marshal.Copy(SecBufferpvBuffer, Buffer, BufferIndex, BytesToCopy); BufferIndex += BytesToCopy; } } return (Buffer); } } [StructLayout(LayoutKind.Sequential)] internal struct SECURITY_INTEGER { public uint LowPart; public int HighPart; public SECURITY_INTEGER(int dummy) { LowPart = 0; HighPart = 0; } }; [StructLayout(LayoutKind.Sequential)] internal struct SECURITY_HANDLE { //both changed from uint - crucial for 64 bit platforms public IntPtr LowPart; public IntPtr HighPart; public SECURITY_HANDLE(int dummy) { LowPart = HighPart = IntPtr.Zero; } }; [StructLayout(LayoutKind.Sequential)] internal struct SecPkgContext_Sizes { public uint cbMaxToken; public uint cbMaxSignature; public uint cbBlockSize; public uint cbSecurityTrailer; }; [StructLayout(LayoutKind.Sequential)] internal struct SEC_WINNT_AUTH_IDENTITY { public string User; public int UserLength; public string Domain; public int DomainLength; public string Password; public int PasswordLength; public int Flags; } internal class SSPIHelper { public const int TOKEN_QUERY = 0x00008; public const uint SEC_E_OK = 0; public const uint SEC_E_INVALID_HANDLE = 0x80090301; public const uint SEC_E_LOGON_DENIED = 0x8009030C; public const uint SEC_I_CONTINUE_NEEDED = 0x90312; public const uint SEC_I_COMPLETE_NEEDED = 0x90313; public const uint SEC_I_COMPLETE_AND_CONTINUE = 0x90314; public const uint SECQOP_WRAP_NO_ENCRYPT = 0x80000001; const int SECPKG_CRED_OUTBOUND = 2; private const int SECURITY_NETWORK_DREP = 0x0; const int MAX_TOKEN_SIZE = 12288; //For AcquireCredentialsHandle in 3er Parameter "fCredentialUse" SECURITY_HANDLE _hOutboundCred = new SECURITY_HANDLE(0); public SECURITY_HANDLE _hClientContext = new SECURITY_HANDLE(0); public const int ISC_REQ_DELEGATE = 0x00000001; public const int ISC_REQ_MUTUAL_AUTH = 0x00000002; public const int ISC_REQ_REPLAY_DETECT = 0x00000004; public const int ISC_REQ_SEQUENCE_DETECT = 0x00000008; public const int ISC_REQ_CONFIDENTIALITY = 0x00000010; public const int ISC_REQ_USE_SESSION_KEY = 0x00000020; public const int ISC_REQ_PROMPT_FOR_CREDS = 0x00000040; public const int ISC_REQ_USE_SUPPLIED_CREDS = 0x00000080; public const int ISC_REQ_ALLOCATE_MEMORY = 0x00000100; public const int ISC_REQ_USE_DCE_STYLE = 0x00000200; public const int ISC_REQ_DATAGRAM = 0x00000400; public const int ISC_REQ_CONNECTION = 0x00000800; public const int ISC_REQ_CALL_LEVEL = 0x00001000; public const int ISC_REQ_FRAGMENT_SUPPLIED = 0x00002000; public const int ISC_REQ_EXTENDED_ERROR = 0x00004000; public const int ISC_REQ_STREAM = 0x00008000; public const int ISC_REQ_INTEGRITY = 0x00010000; public const int ISC_REQ_IDENTIFY = 0x00020000; public const int ISC_REQ_NULL_SESSION = 0x00040000; public const int ISC_REQ_MANUAL_CRED_VALIDATION = 0x00080000; public const int ISC_REQ_RESERVED1 = 0x00100000; public const int ISC_REQ_FRAGMENT_TO_FIT = 0x00200000; public const int SECPKG_ATTR_SIZES = 0; public const int STANDARD_CONTEXT_ATTRIBUTES = ISC_REQ_MUTUAL_AUTH; bool _bGotClientCredentials; #region << dll imports >> #region << AcquireCredentialsHandle >> // http://msdn.microsoft.com/en-us/library/aa374712%28VS.85%29.aspx [DllImport("secur32", CharSet = CharSet.Auto)] static extern uint AcquireCredentialsHandle( string pszPrincipal, //SEC_CHAR* string pszPackage, //SEC_CHAR* //"Kerberos","NTLM","Negotiative" int fCredentialUse, IntPtr PAuthenticationID,//_LUID AuthenticationID,//pvLogonID, //PLUID IntPtr pAuthData,//PVOID IntPtr pGetKeyFn, //SEC_GET_KEY_FN IntPtr pvGetKeyArgument, //PVOID ref SECURITY_HANDLE phCredential, //SecHandle //PCtxtHandle ref ref SECURITY_INTEGER ptsExpiry); //PTimeStamp //TimeStamp ref #endregion #region << InitializeSecurityContext >> // http://msdn.microsoft.com/en-us/library/aa375506%28VS.85%29.aspx [DllImport("secur32", CharSet = CharSet.Auto, SetLastError = true)] static extern uint InitializeSecurityContext( ref SECURITY_HANDLE phCredential,//PCredHandle IntPtr phContext, //PCtxtHandle string pszTargetName, int fContextReq, int Reserved1, int TargetDataRep, IntPtr pInput, //PSecBufferDesc SecBufferDesc int Reserved2, out SECURITY_HANDLE phNewContext, //PCtxtHandle out SecBufferDesc pOutput, //PSecBufferDesc SecBufferDesc out uint pfContextAttr, //managed ulong == 64 bits!!! out SECURITY_INTEGER ptsExpiry); //PTimeStamp [DllImport("secur32", CharSet = CharSet.Auto, SetLastError = true)] static extern uint InitializeSecurityContext( ref SECURITY_HANDLE phCredential,//PCredHandle ref SECURITY_HANDLE phContext, //PCtxtHandle string pszTargetName, int fContextReq, int Reserved1, int TargetDataRep, ref SecBufferDesc SecBufferDesc, //PSecBufferDesc SecBufferDesc int Reserved2, out SECURITY_HANDLE phNewContext, //PCtxtHandle out SecBufferDesc pOutput, //PSecBufferDesc SecBufferDesc out uint pfContextAttr, //managed ulong == 64 bits!!! out SECURITY_INTEGER ptsExpiry); //PTimeStamp #endregion #region << QueryContextAttributes >> [DllImport("secur32.Dll", CharSet = CharSet.Auto, SetLastError = false)] public static extern int QueryContextAttributes(ref SECURITY_HANDLE phContext, uint ulAttribute, out SecPkgContext_Sizes pContextAttributes); #endregion #region << EncryptMessage >> [DllImport("secur32.Dll", CharSet = CharSet.Auto, SetLastError = false)] public static extern int EncryptMessage(ref SECURITY_HANDLE phContext, uint fQOP, //managed ulong == 64 bits!!! ref SecBufferDesc pMessage, uint MessageSeqNo); //managed ulong == 64 bits!!! #endregion #region << DecryptMessage >> [DllImport("secur32.Dll", CharSet = CharSet.Auto, SetLastError = false)] public static extern int DecryptMessage(ref SECURITY_HANDLE phContext, ref SecBufferDesc pMessage, uint MessageSeqNo, out uint pfQOP); #endregion #endregion readonly string _sRemotePrincipal = WindowsIdentity.GetCurrent().Name; #region << Constructors >> public SSPIHelper() { } public SSPIHelper(string sRemotePrincipal) { _sRemotePrincipal = sRemotePrincipal; } #endregion public void Process(byte[] inToken, out byte[] outToken) { if (InitializeKerberosStage) { InitializeClient(inToken, out outToken); } else { if (inToken == null) { throw new Exception("Kerberos failure: Incoming bytes can't be null."); } DecryptMessage(0, inToken, out outToken); inToken = new byte[] { 0x01, 0x00, 0x00, 0x00 }; EncryptMessage(inToken, out outToken); } } private void InitializeClient(byte[] serverToken, out byte[] clientToken) { clientToken = null; SECURITY_INTEGER ClientLifeTime = new SECURITY_INTEGER(0); if (!_bGotClientCredentials) { uint returnValue = AcquireCredentialsHandle(null, "Kerberos", SECPKG_CRED_OUTBOUND, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, ref _hOutboundCred, ref ClientLifeTime); if (returnValue != SEC_E_OK) { throw new Exception("Couldn't acquire client credentials"); } _bGotClientCredentials = true; } uint ss; SecBufferDesc ClientToken = new SecBufferDesc(MAX_TOKEN_SIZE); try { uint ContextAttributes; if (serverToken == null) { ss = InitializeSecurityContext(ref _hOutboundCred, IntPtr.Zero, _sRemotePrincipal, STANDARD_CONTEXT_ATTRIBUTES, 0, SECURITY_NETWORK_DREP, IntPtr.Zero, 0, out _hClientContext, out ClientToken, out ContextAttributes, out ClientLifeTime); } else { SecBufferDesc ServerToken = new SecBufferDesc(serverToken); try { ss = InitializeSecurityContext(ref _hOutboundCred, ref _hClientContext, _sRemotePrincipal, STANDARD_CONTEXT_ATTRIBUTES, 0, SECURITY_NETWORK_DREP, ref ServerToken, 0, out _hClientContext, out ClientToken, out ContextAttributes, out ClientLifeTime); } finally { ServerToken.Dispose(); } } if (ss == SEC_E_LOGON_DENIED) { throw new Exception("Bad username, password or domain."); } else if (ss != SEC_E_OK && ss != SEC_I_CONTINUE_NEEDED) { throw new Exception("InitializeSecurityContext() failed!!!"); } clientToken = ClientToken.GetSecBufferByteArray(); } finally { ClientToken.Dispose(); } InitializeKerberosStage = ss != SEC_E_OK; } private bool bInitializeKerberosStage = true; private bool InitializeKerberosStage { get { return bInitializeKerberosStage; } set { bInitializeKerberosStage = value; } } public void EncryptMessage(byte[] message, out byte[] encryptedBuffer) { encryptedBuffer = null; SECURITY_HANDLE EncryptionContext = _hClientContext; SecPkgContext_Sizes ContextSizes; if (QueryContextAttributes(ref EncryptionContext, SECPKG_ATTR_SIZES, out ContextSizes) != SEC_E_OK) { throw new Exception("QueryContextAttribute() failed!!!"); } MultipleSecBufferHelper[] ThisSecHelper = new MultipleSecBufferHelper[] { new MultipleSecBufferHelper(new byte[ContextSizes.cbSecurityTrailer], SecBufferType.SECBUFFER_TOKEN), new MultipleSecBufferHelper(message, SecBufferType.SECBUFFER_DATA), new MultipleSecBufferHelper(new byte[ContextSizes.cbBlockSize], SecBufferType.SECBUFFER_PADDING) }; SecBufferDesc DescBuffer = new SecBufferDesc(ThisSecHelper); try { if (EncryptMessage(ref EncryptionContext, SECQOP_WRAP_NO_ENCRYPT, ref DescBuffer, 0) != SEC_E_OK) { throw new Exception("EncryptMessage() failed!!!"); } encryptedBuffer = DescBuffer.GetSecBufferByteArray(); } finally { DescBuffer.Dispose(); } } public void DecryptMessage(int messageLength, byte[] encryptedBuffer, out byte[] decryptedBuffer) { decryptedBuffer = null; SECURITY_HANDLE DecryptionContext = _hClientContext; byte[] EncryptedMessage = new byte[messageLength]; Array.Copy(encryptedBuffer, 0, EncryptedMessage, 0, messageLength); int SecurityTrailerLength = encryptedBuffer.Length - messageLength; byte[] SecurityTrailer = new byte[SecurityTrailerLength]; Array.Copy(encryptedBuffer, messageLength, SecurityTrailer, 0, SecurityTrailerLength); MultipleSecBufferHelper[] ThisSecHelper = new MultipleSecBufferHelper[] { new MultipleSecBufferHelper(EncryptedMessage, SecBufferType.SECBUFFER_DATA), new MultipleSecBufferHelper(SecurityTrailer, SecBufferType.SECBUFFER_STREAM) }; SecBufferDesc DescBuffer = new SecBufferDesc(ThisSecHelper); try { uint EncryptionQuality; if (DecryptMessage(ref DecryptionContext, ref DescBuffer, 0, out EncryptionQuality) != SEC_E_OK) { throw new Exception("DecryptMessage() failed!!!"); } decryptedBuffer = new byte[messageLength]; Array.Copy(DescBuffer.GetSecBufferByteArray(), 0, decryptedBuffer, 0, messageLength); } finally { DescBuffer.Dispose(); } } } } #endifsmuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Gssapi/GssapiMechanism.cs0000644000175000017500000000735512204443225025044 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2009 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if !MONO using System; using System.Security.Principal; using agsXMPP.Xml.Dom; using agsXMPP.protocol.sasl; namespace agsXMPP.Sasl.Gssapi { /// /// Handels the SASL Digest MD5 authentication /// public class GssapiMechanism : Mechanism { SSPIHelper sspiHelper; public GssapiMechanism() { } public override void Init(XmppClientConnection con) { XmppClientConnection = con; string kerbPrinc = XmppClientConnection.KerberosPrincipal; /* * try to build the kerberos principal if none is sent by the server or provided by the user. * XCP send the kerberos pricipal, Openfire doesnt. */ if (kerbPrinc == null) kerbPrinc = string.Format("xmpp/{0}@{1}", XmppClientConnection.Server, GetNtDomain()); //if (XmppClientConnection.KerberosPrincipal != null) // sspiHelper = new SSPIHelper(XmppClientConnection.KerberosPrincipal); //else // sspiHelper = new SSPIHelper(); sspiHelper = new SSPIHelper(kerbPrinc); Auth auth = new Auth(MechanismType.GSSAPI); byte[] clientToken; sspiHelper.Process(null, out clientToken); auth.Value = Convert.ToBase64String(clientToken); XmppClientConnection.Send(auth); } public override void Parse(Node e) { if (e is Challenge) { Challenge c = e as Challenge; Response resp; byte[] outBytes; byte[] inBytes = Convert.FromBase64String(c.Value); sspiHelper.Process(inBytes, out outBytes); if (outBytes == null) { resp = new Response(); } else { resp = new Response(); resp.Value = Convert.ToBase64String(outBytes); } XmppClientConnection.Send(resp); } } /// /// returns the NT domain, tis is used for building the kerberos principal when none is provided. /// /// internal string GetNtDomain() { var curName = WindowsIdentity.GetCurrent().Name; var domain = curName.Substring(0, curName.IndexOf('\\')); return domain.ToUpper(); } } } #endifsmuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Plain/0000755000175000017500000000000012204443225021245 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Plain/PlainMechanism.cs0000644000175000017500000000435612204443225024474 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.IO; using System.Text; using agsXMPP; using agsXMPP.Xml.Dom; using agsXMPP.protocol.sasl; namespace agsXMPP.Sasl.Plain { /// /// Summary description for PlainMechanism. /// public class PlainMechanism : Mechanism { private XmppClientConnection m_XmppClient = null; public PlainMechanism() { } public override void Init(XmppClientConnection con) { m_XmppClient = con; // $Message m_XmppClient.Send(new protocol.sasl.Auth(protocol.sasl.MechanismType.PLAIN, Message())); } public override void Parse(Node e) { // not needed here in PLAIN mechanism } private string Message() { // NULL Username NULL Password StringBuilder sb = new StringBuilder(); //sb.Append( (char) 0 ); //sb.Append(this.m_XmppClient.MyJID.Bare); sb.Append( (char) 0 ); sb.Append(this.Username); sb.Append( (char) 0 ); sb.Append(this.Password); byte[] msg = Encoding.UTF8.GetBytes(sb.ToString()); return Convert.ToBase64String(msg, 0, msg.Length); } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Mechanism.cs0000644000175000017500000000530312204443225022436 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using agsXMPP.Xml.Dom; namespace agsXMPP.Sasl { /// /// Summary description for Mechanism. /// public abstract class Mechanism { #region << Properties and member variables >> private XmppClientConnection m_XmppClientConnection; private string m_Username; private string m_Password; private string m_Server; public XmppClientConnection XmppClientConnection { get { return m_XmppClientConnection; } set { m_XmppClientConnection = value; } } /// /// /// public string Username { // lower case that until i implement our c# port of libIDN get { return m_Username; } set { m_Username = value != null ? value.ToLower() : null; } } /// /// /// public string Password { get { return m_Password; } set { m_Password = value; } } /// /// /// public string Server { get { return m_Server; } set { m_Server = value.ToLower(); } } /// /// Extra data for special Sasl mechanisms /// public ExtendedData ExtentedData { get; set; } #endregion /// /// /// /// public abstract void Init(XmppClientConnection con); /// /// /// /// public abstract void Parse(Node e); } }smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Scram/0000755000175000017500000000000012204443225021247 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Scram/ScramSha1Mechanism.cs0000644000175000017500000001533512204443225025214 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections.Generic; using System.Security.Cryptography; using System.Text; using agsXMPP.protocol.sasl; using agsXMPP.Util; using agsXMPP.Xml.Dom; namespace agsXMPP.Sasl.Scram { /// /// /// public class ScramSha1Mechanism : Mechanism { private const int LENGHT_CLIENT_NONE = 24; private string firstClientMessage; private byte[] clientNonce; private string clientNonceB64; private string password; private string username; public ScramSha1Mechanism() { GenerateClientNonce(); } public override void Init(XmppClientConnection con) { XmppClientConnection = con; // Todo SASLPrep username = Username; password = Password; firstClientMessage = GenerateFirstClientMessage(); string msg = ToB64String(firstClientMessage); con.Send(new Auth(MechanismType.SCRAM_SHA_1, msg)); } public override void Parse(Node e) { if (e is Challenge) { Challenge ch = e as Challenge; string msg = ch.TextBase64; string content = GenerateFinalClientMessage(msg); XmppClientConnection.Send(new Response(content)); } } /// /// Generate a random client nonce /// private void GenerateClientNonce() { var random = new Byte[LENGHT_CLIENT_NONE]; var rng = new RNGCryptoServiceProvider(); rng.GetBytes(random); clientNonce = random; clientNonceB64 = Convert.ToBase64String(random); } private static Dictionary ParseMessage(string msg) { var str = msg.Split(','); var dict = new Dictionary(); foreach (string s in str) { int equalPos = s.IndexOf('='); var key = s.Substring(0, equalPos - 0); var val = s.Substring(equalPos + 1); if (!dict.ContainsKey(key)) dict.Add(key, val); } return dict; } internal string GenerateFinalClientMessage(string sMessage) { var pairs = ParseMessage(sMessage); //string clientServerNonce = pairs["r"]; string serverNonce = pairs["r"].Substring(clientNonceB64.Length); var salt = pairs["s"]; // the user's salt - (base64 encoded) var iteration = pairs["i"]; // iteation count // the bare of our first message var clientFirstMessageBare = firstClientMessage.Substring(3); var sb = new StringBuilder(); sb.Append("c=biws,"); // Client/Server nonce sb.Append("r="); sb.Append(clientNonceB64); sb.Append(serverNonce); string clientFinalMessageWithoutProof = sb.ToString(); string authMessage = clientFirstMessageBare + "," + sMessage + "," + clientFinalMessageWithoutProof; var saltedPassword = Hi(password, Convert.FromBase64String(salt), Convert.ToInt32(iteration)); var clientKey = Hash.HMAC(saltedPassword, "Client Key"); var storedKey = Hash.Sha1HashBytes(clientKey); var clientSignature = Hash.HMAC(storedKey, authMessage); var clientProof = new byte[clientKey.Length]; for (var i = 0; i < clientKey.Length; ++i) clientProof[i] = (byte)(clientKey[i] ^ clientSignature[i]); //var serverKey = Hash.HMAC(saltedPassword, "Server Key"); //var serverSignature = Hash.HMAC(serverKey, authMessage); string clientFinalMessage = clientFinalMessageWithoutProof; clientFinalMessage += ",p="; clientFinalMessage += Convert.ToBase64String(clientProof); return clientFinalMessage; } private string GenerateFirstClientMessage() { var sb = new StringBuilder(); // no channel bindings supported sb.Append("n,,"); // username sb.Append("n="); sb.Append(EscapeUsername(username)); sb.Append(","); // client nonce sb.Append("r="); sb.Append(clientNonceB64); return sb.ToString(); } private static string EscapeUsername(string user) { /* The characters ',' or '=' in usernames are sent as '=2C' and '=3D' respectively. If the server receives a username that contains '=' not followed by either '2C' or '3D', then the server MUST fail the authentication. */ var ret = user.Replace(",", "=2C"); ret = ret.Replace("=", "=3D"); return ret; } private static string ToB64String(string sin) { byte[] msg = Encoding.UTF8.GetBytes(sin); return Convert.ToBase64String(msg, 0, msg.Length); } private string FromB64String(string sin) { var b = Convert.FromBase64String(sin); return Encoding.UTF8.GetString(b); } private byte[] Hi(string pass, byte[] salt, int iterations) { var pdb = new Rfc2898DeriveBytes(pass, salt, iterations); return pdb.GetBytes(20); } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/DigestMD5/0000755000175000017500000000000012204443225021727 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/DigestMD5/Step1.cs0000644000175000017500000001363512204443225023262 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; //encoded challenge to client: // // //cmVhbG09InNvbWVyZWFsbSIsbm9uY2U9Ik9BNk1HOXRFUUdtMmhoIixxb3A9ImF1dGgi //LGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNzCg== //The decoded challenge is: // //realm="somerealm",nonce="OA6MG9tEQGm2hh",qop="auth",charset=utf-8,algorithm=md5-sess namespace agsXMPP.Sasl.DigestMD5 { /// /// Summary description for Step1. /// public class Step1 : DigestMD5Mechanism // Mechanism { /// /// Exception occurs when we were unable to parse the challenge /// public class ChallengeParseException : Exception { public ChallengeParseException(string message) : base(message) { } } #region << Constructors >> public Step1() { } public Step1(string message) { m_Message = message; Parse(message); } #endregion #region << Properties >> private string m_Realm; private string m_Nonce; private string m_Qop;// = "auth"; private string m_Charset = "utf-8"; private string m_Algorithm; private string m_Rspauth = null; private string m_Message; public string Realm { get { return m_Realm; } set { m_Realm = value; } } public string Nonce { get { return m_Nonce; } set { m_Nonce = value; } } public string Qop { get { return m_Qop; } set { m_Qop = value; } } public string Charset { get { return m_Charset; } set { m_Charset = value; } } public string Algorithm { get { return m_Algorithm; } set { m_Algorithm = value; } } public string Rspauth { get { return m_Rspauth; } set { m_Rspauth = value; } } #endregion /* nonce="deqOGux/N6hDPtf9vkGMU5Vzae+zfrqpBIvh6LovbBM=", realm="amessage.de", qop="auth,auth-int,auth-conf", cipher="rc4-40,rc4-56,rc4,des,3des", maxbuf=1024, charset=utf-8, algorithm=md5-sess */ private void Parse(string message) { try { int start = 0; int end = 0; while (start < message.Length) { int equalPos = message.IndexOf('=', start); if (equalPos > 0) { // look if the next char is a quote if (message.Substring(equalPos + 1, 1) == "\"") { // quoted value, find the end now end = message.IndexOf('"', equalPos + 2); ParsePair(message.Substring(start, end - start + 1)); start = end + 2; } else { // value is not quoted, ends at the next comma or end of string end = message.IndexOf(',', equalPos + 1); if (end == -1) end = message.Length; ParsePair(message.Substring(start, end - start)); start = end + 1; } } } } catch { throw new ChallengeParseException("Unable to parse challenge"); } } private void ParsePair(string pair) { int equalPos = pair.IndexOf("="); if (equalPos > 0) { string key = pair.Substring(0, equalPos); string data; // is the value quoted? if (pair.Substring(equalPos + 1, 1) == "\"") data = pair.Substring(equalPos + 2, pair.Length - equalPos - 3); else data = pair.Substring(equalPos + 1); switch (key) { case "realm": m_Realm = data; break; case "nonce": m_Nonce = data; break; case "qop": m_Qop = data; break; case "charset": m_Charset = data; break; case "algorithm": m_Algorithm = data; break; case "rspauth": m_Rspauth = data; break; } } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/DigestMD5/DigestMD5Mechanism.cs0000644000175000017500000000504412204443225025633 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP; using agsXMPP.Xml.Dom; using agsXMPP.protocol.sasl; namespace agsXMPP.Sasl.DigestMD5 { /// /// Handels the SASL Digest MD5 authentication /// public class DigestMD5Mechanism : Mechanism { public DigestMD5Mechanism() { } public override void Init(XmppClientConnection con) { base.XmppClientConnection = con; base.XmppClientConnection.Send(new protocol.sasl.Auth(protocol.sasl.MechanismType.DIGEST_MD5)); } public override void Parse(Node e) { if (e is protocol.sasl.Challenge) { protocol.sasl.Challenge c = e as protocol.sasl.Challenge; Step1 step1 = new Step1(c.TextBase64); if (step1.Rspauth == null) { //response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9ImduYXVjayIscmVhbG09IiIsbm9uY2U9IjM4MDQzMjI1MSIsY25vbmNlPSIxNDE4N2MxMDUyODk3N2RiMjZjOWJhNDE2ZDgwNDI4MSIsbmM9MDAwMDAwMDEscW9wPWF1dGgsZGlnZXN0LXVyaT0ieG1wcC9qYWJiZXIucnUiLGNoYXJzZXQ9dXRmLTgscmVzcG9uc2U9NDcwMTI5NDU4Y2EwOGVjYjhhYTIxY2UzMDhhM2U5Nzc Step2 s2 = new Step2(step1, base.Username, base.Password, base.Server); protocol.sasl.Response r = new agsXMPP.protocol.sasl.Response(s2.ToString()); base.XmppClientConnection.Send(r); } else { // SEND: base.XmppClientConnection.Send(new protocol.sasl.Response()); } } } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/DigestMD5/Step2.cs0000644000175000017500000002145112204443225023256 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.IO; using System.Text; #if CF using agsXMPP.util; #endif using System.Security.Cryptography; namespace agsXMPP.Sasl.DigestMD5 { /// /// Summary description for Step2. /// public class Step2 : Step1 { public Step2() { } /// /// builds a step2 message reply to the given step1 message /// /// public Step2(Step1 step1, string username, string password, string server) { this.Nonce = step1.Nonce; // fixed for SASL n amessage servers (jabberd 1.x) if (SupportsAuth(step1.Qop)) this.Qop = "auth"; this.Realm = step1.Realm; this.Charset = step1.Charset; this.Algorithm = step1.Algorithm; this.Username = username; this.Password = password; this.Server = server; GenerateCnonce(); GenerateNc(); GenerateDigestUri(); GenerateResponse(); } /// /// Does the server support Auth? /// /// /// private bool SupportsAuth(string qop) { string[] auth = qop.Split(','); // This overload was not available in the CF, so updated this to the following //bool ret = Array.IndexOf(auth, "auth") < 0 ? false : true; bool ret = Array.IndexOf(auth, "auth", auth.GetLowerBound(0), auth.Length) < 0 ? false : true; return ret; } /// /// parses a message and returns the step2 object /// /// public Step2(string message) { // TODO, important for server stuff } #region << Properties and member variables >> private string m_Cnonce; private string m_Nc; private string m_DigestUri; private string m_Response; private string m_Authzid; public string Cnonce { get { return m_Cnonce; } set { m_Cnonce = value; } } public string Nc { get { return m_Nc; } set { m_Nc = value; } } public string DigestUri { get { return m_DigestUri; } set { m_DigestUri = value; } } public string Response { get { return m_Response; } set { m_Response = value; } } public string Authzid { get { return m_Authzid; } set { m_Authzid = value; } } #endregion public override string ToString() { return GenerateMessage(); } private void GenerateCnonce() { // Lenght of the Session ID on bytes, // 32 bytes equaly 64 chars // 16^64 possibilites for the session IDs (4.294.967.296) // This should be unique enough int m_lenght = 32; RandomNumberGenerator RNG = RandomNumberGenerator.Create(); byte[] buf = new byte[m_lenght]; RNG.GetBytes(buf); m_Cnonce = Util.Hash.HexToString(buf).ToLower(); // m_Cnonce = "e163ceed6cfbf8c1559a9ff373b292c2f926b65719a67a67c69f7f034c50aba3"; } private void GenerateNc() { int nc = 1; m_Nc = nc.ToString().PadLeft(8,'0'); } private void GenerateDigestUri() { m_DigestUri = "xmpp/" + base.Server; } // HEX( KD ( HEX(H(A1)), // { // nonce-value, ":" nc-value, ":", // cnonce-value, ":", qop-value, ":", HEX(H(A2)) })) // // If authzid is specified, then A1 is // // A1 = { H( { username-value, ":", realm-value, ":", passwd } ), // ":", nonce-value, ":", cnonce-value, ":", authzid-value } // // If authzid is not specified, then A1 is // // A1 = { H( { username-value, ":", realm-value, ":", passwd } ), // ":", nonce-value, ":", cnonce-value } // // where // // passwd = *OCTET public void GenerateResponse() { byte[] H1; byte[] H2; byte[] H3; //byte[] temp; string A1; string A2; string A3; string p1; string p2; StringBuilder sb = new StringBuilder(); sb.Append(this.Username); sb.Append(":"); sb.Append(this.Realm); sb.Append(":"); sb.Append(this.Password); #if !CF H1 = new MD5CryptoServiceProvider().ComputeHash(Encoding.UTF8.GetBytes(sb.ToString())); #else //H1 = Encoding.Default.GetBytes(util.Hash.MD5Hash(sb.ToString())); H1 = util.Hash.MD5Hash(Encoding.UTF8.GetBytes(sb.ToString())); #endif sb.Remove(0, sb.Length); sb.Append(":"); sb.Append(this.Nonce); sb.Append(":"); sb.Append(this.Cnonce); if (m_Authzid != null) { sb.Append(":"); sb.Append(m_Authzid); } A1 = sb.ToString(); // sb.Remove(0, sb.Length); // sb.Append(Encoding.Default.GetChars(H1)); // //sb.Append(Encoding.ASCII.GetChars(H1)); // // sb.Append(A1); byte[] bA1 = Encoding.ASCII.GetBytes(A1); byte[] bH1A1 = new byte[H1.Length + bA1.Length]; //Array.Copy(H1, bH1A1, H1.Length); Array.Copy(H1, 0, bH1A1, 0, H1.Length); Array.Copy(bA1, 0, bH1A1, H1.Length, bA1.Length); #if !CF H1 = new MD5CryptoServiceProvider().ComputeHash(bH1A1); //Console.WriteLine(util.Hash.HexToString(H1)); #else //H1 = Encoding.Default.GetBytes(util.Hash.MD5Hash(sb.ToString())); //H1 =util.Hash.MD5Hash(Encoding.Default.GetBytes(sb.ToString())); H1 =util.Hash.MD5Hash(bH1A1); #endif sb.Remove(0,sb.Length); sb.Append("AUTHENTICATE:"); sb.Append(m_DigestUri); if (this.Qop.CompareTo("auth") != 0) { sb.Append(":00000000000000000000000000000000"); } A2 = sb.ToString(); H2 = Encoding.ASCII.GetBytes(A2); #if !CF H2 = new MD5CryptoServiceProvider().ComputeHash(H2); #else //H2 = Encoding.Default.GetBytes(util.Hash.MD5Hash(H2)); H2 =util.Hash.MD5Hash(H2); #endif // create p1 and p2 as the hex representation of H1 and H2 p1 = Util.Hash.HexToString(H1).ToLower(); p2 = Util.Hash.HexToString(H2).ToLower(); sb.Remove(0, sb.Length); sb.Append(p1); sb.Append(":"); sb.Append(this.Nonce); sb.Append(":"); sb.Append(m_Nc); sb.Append(":"); sb.Append(this.m_Cnonce); sb.Append(":"); sb.Append(base.Qop); sb.Append(":"); sb.Append(p2); A3 = sb.ToString(); #if !CF H3 = new MD5CryptoServiceProvider().ComputeHash(Encoding.ASCII.GetBytes(A3)); #else //H3 = Encoding.Default.GetBytes(util.Hash.MD5Hash(A3)); H3 =util.Hash.MD5Hash(Encoding.ASCII.GetBytes(A3)); #endif m_Response = Util.Hash.HexToString(H3).ToLower(); } private string GenerateMessage() { StringBuilder sb = new StringBuilder(); sb.Append("username="); sb.Append(AddQuotes(this.Username)); sb.Append(","); sb.Append("realm="); sb.Append(AddQuotes(this.Realm)); sb.Append(","); sb.Append("nonce="); sb.Append(AddQuotes(this.Nonce)); sb.Append(","); sb.Append("cnonce="); sb.Append(AddQuotes(this.Cnonce)); sb.Append(","); sb.Append("nc="); sb.Append(this.Nc); sb.Append(","); sb.Append("qop="); sb.Append(base.Qop); sb.Append(","); sb.Append("digest-uri="); sb.Append(AddQuotes(this.DigestUri)); sb.Append(","); sb.Append("charset="); sb.Append(this.Charset); sb.Append(","); sb.Append("response="); sb.Append(this.Response); return sb.ToString(); } /// /// return the given string with quotes /// /// /// private string AddQuotes(string s) { // fixed, s can be null (eg. for realm in ejabberd) if (s != null && s.Length > 0) s = s.Replace(@"\", @"\\"); string quote = "\""; return quote + s + quote; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Facebook/0000755000175000017500000000000012204443225021713 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Facebook/FacebookExtendedData.cs0000644000175000017500000000242112204443225026225 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2009 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ namespace agsXMPP.Sasl.Facebook { public class FacebookExtendedData : ExtendedData { public string ApiKey {get; set;} public string AccessToken {get; set;} } } smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Facebook/FacebookMechanism.cs0000644000175000017500000001217312204443225025604 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2009 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.Collections.Generic; using System.Text; using agsXMPP.Xml.Dom; using agsXMPP.protocol.sasl; namespace agsXMPP.Sasl.Facebook { public class FacebookMechanism : Mechanism { private readonly string callId = new Random().Next().ToString(); private const string VERSION = "1.0"; /// /// /// /// public override void Init(XmppClientConnection con) { con.Send(new Auth(MechanismType.X_FACEBOOK_PLATFORM)); } /// /// /// /// public override void Parse(Node e) { if (e is Challenge) { var c = e as Challenge; byte[] bytes = Convert.FromBase64String(c.Value); string msg = Encoding.UTF8.GetString(bytes, 0, bytes.Length); var pairs = ParseMessage(msg); string res = BuildResponse(pairs); XmppClientConnection.Send(new Response(ToB64String(res))); } } static string ToB64String(string sin) { byte[] msg = Encoding.UTF8.GetBytes(sin); return Convert.ToBase64String(msg, 0, msg.Length); } private static Dictionary ParseMessage(string msg) { // example: // version=1&method=auth.xmpp_login&nonce=4346B9BFC5A160D46AF25732ACFC7CC3 var str = msg.Split('&'); var dict = new Dictionary(); foreach (string s in str) { int equalPos = s.IndexOf('='); var key = s.Substring(0, equalPos - 0); var val = s.Substring(equalPos + 1); val = System.Uri.UnescapeDataString(val); if (!dict.ContainsKey(key)) dict.Add(key, val); } return dict; } private string BuildResponse(Dictionary pairs) { /* * string method: Should be the same as the method specified by the server. * string api_key: The application key associated with the calling application. * string session_key: The session key of the logged in user. * float call_id: The request's sequence number. * string sig: An MD5 hash of the current request and your secret key. * string v: This must be set to 1.0 to use this version of the API. * string format: Optional - Ignored. * string cnonce: Optional - Client-selected nonce. Ignored. * string nonce: Should be the same as the nonce specified by the server. creates the response array, new, without session_key and sig http://developers.facebook.com/blog/post/555/ https://developers.facebook.com/docs/chat/ $resp_array = array( 'method' => $challenge_array['method'], 'nonce' => $challenge_array['nonce'], 'access_token' => $access_token, 'api_key' => $options['app_id'], 'call_id' => 0, 'v' => '1.0', ); */ var extData = ExtentedData as FacebookExtendedData; string res = ""; res = res + "method=" + System.Uri.EscapeDataString(pairs["method"]); res = res + "&api_key=" + System.Uri.EscapeDataString(extData.ApiKey); res = res + "&access_token=" + System.Uri.EscapeDataString(extData.AccessToken); res = res + "&v=" + System.Uri.EscapeDataString(VERSION); res = res + "&call_id=" + System.Uri.EscapeDataString(callId); res = res + "&nonce=" + System.Uri.EscapeDataString(pairs["nonce"]); return res; } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Anonymous/0000755000175000017500000000000012204443225022172 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/Anonymous/AnonymousMechanism.cs0000644000175000017500000000543712204443225026347 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP; using agsXMPP.Xml.Dom; using agsXMPP.protocol.sasl; namespace agsXMPP.Sasl.Anonymous { /// /// SALS ANONYMOUS Mechanism, this allows anonymous logins to a xmpp server. /// public class AnonymousMechanism : Mechanism { /* S: DIGEST-MD5 ANONYMOUS * So, the proper exchange for this ANONYMOUS mechanism would be: C: S: or, in case of the optional trace information: C: c2lyaGM= S: */ /// /// /// public AnonymousMechanism() { } /// /// /// /// public override void Init(XmppClientConnection con) { con.Send(new Auth(MechanismType.ANONYMOUS)); } /// /// /// /// public override void Parse(Node e) { // *No Challenges* in SASL ANONYMOUS } } } smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/ExtendedData.cs0000644000175000017500000000223012204443225023060 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2009 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ namespace agsXMPP.Sasl { public abstract class ExtendedData { } } smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/SaslHandler.cs0000644000175000017500000002567412250206660022750 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.client; using agsXMPP.protocol.iq.bind; using agsXMPP.protocol.iq.session; using agsXMPP.protocol.sasl; using agsXMPP.protocol.stream; using agsXMPP.Xml.Dom; using agsXMPP.Xml; namespace agsXMPP.Sasl { /// /// Summary description for SaslHandler. /// internal class SaslHandler : IDisposable { public event SaslEventHandler OnSaslStart; public event ObjectHandler OnSaslEnd; private XmppClientConnection m_XmppClient; private Mechanism m_Mechanism; // Track whether Dispose has been called. private bool m_Disposed; public SaslHandler(XmppClientConnection conn) { m_XmppClient = conn; m_XmppClient.StreamParser.OnStreamElement += OnStreamElement; } // Use C# destructor syntax for finalization code. // This destructor will run only if the Dispose method // does not get called. // It gives your base class the opportunity to finalize. // Do not provide destructors in types derived from this class. ~SaslHandler() { // Do not re-create Dispose clean-up code here. // Calling Dispose(false) is optimal in terms of // readability and maintainability. Dispose(false); } internal void OnStreamElement(object sender, ElementEventArgs eventArgs) { if (m_XmppClient == null) return; if ( m_XmppClient.XmppConnectionState == XmppConnectionState.Securing || m_XmppClient.XmppConnectionState == XmppConnectionState.StartCompression) return; var e = eventArgs.Element; if (e is Features) { Features f = e as Features; if (!m_XmppClient.Authenticated) { // RECV: // DIGEST-MD5PLAIN // // // // SENT: // Select a SASL mechanism SaslEventArgs args = new SaslEventArgs(f.Mechanisms); if (OnSaslStart != null) OnSaslStart(this, args); if (args.Auto) { // Library handles the Sasl stuff if (f.Mechanisms!=null) { if (m_XmppClient.UseStartTLS == false && m_XmppClient.UseSSL == false && f.Mechanisms.SupportsMechanism(MechanismType.X_GOOGLE_TOKEN) ) { // This is the only way to connect to GTalk on a unsecure Socket for now // Secure authentication is done over https requests to pass the // authentication credentials on a secure connection args.Mechanism = protocol.sasl.Mechanism.GetMechanismName(MechanismType.X_GOOGLE_TOKEN); } #if !(CF || CF_2) else if (m_XmppClient.UseSso && f.Mechanisms.SupportsMechanism(MechanismType.GSSAPI)) { args.Mechanism = protocol.sasl.Mechanism.GetMechanismName(MechanismType.GSSAPI); string kerbPrinc = f.Mechanisms.GetMechanism(MechanismType.GSSAPI).KerberosPrincipal; if (kerbPrinc != null) m_XmppClient.KerberosPrincipal = f.Mechanisms.GetMechanism(MechanismType.GSSAPI).KerberosPrincipal; } #endif else if (f.Mechanisms.SupportsMechanism(MechanismType.SCRAM_SHA_1)) { args.Mechanism = protocol.sasl.Mechanism.GetMechanismName(MechanismType.SCRAM_SHA_1); } else if (f.Mechanisms.SupportsMechanism(MechanismType.DIGEST_MD5)) { args.Mechanism = protocol.sasl.Mechanism.GetMechanismName(MechanismType.DIGEST_MD5); } else if (f.Mechanisms.SupportsMechanism(MechanismType.PLAIN)) { args.Mechanism = protocol.sasl.Mechanism.GetMechanismName(MechanismType.PLAIN); } else { args.Mechanism = null; } } else { // Hack for Google // TODO: i don't think we need this anymore. This was in an very early version of the gtalk server. args.Mechanism = null; //args.Mechanism = agsXMPP.protocol.sasl.Mechanism.GetMechanismName(agsXMPP.protocol.sasl.MechanismType.PLAIN); } } if (args.Mechanism != null) { m_Mechanism = Factory.SaslFactory.GetMechanism(args.Mechanism); // Set properties for the SASL mechanism m_Mechanism.Username = m_XmppClient.Username; m_Mechanism.Password = m_XmppClient.Password; m_Mechanism.Server = m_XmppClient.Server; m_Mechanism.ExtentedData = args.ExtentedData; // Call Init Method on the mechanism m_Mechanism.Init(m_XmppClient); } else { m_XmppClient.RequestLoginInfo(); } } else if(!m_XmppClient.Binded) { if (f.SupportsBind) { m_XmppClient.DoChangeXmppConnectionState(XmppConnectionState.Binding); BindIq bIq = string.IsNullOrEmpty(m_XmppClient.Resource) ? new BindIq(IqType.set) : new BindIq(IqType.set, m_XmppClient.Resource); m_XmppClient.IqGrabber.SendIq(bIq, BindResult); } } } else if (e is Challenge) { if (m_Mechanism != null && !m_XmppClient.Authenticated) { m_Mechanism.Parse(e); } } else if (e is Success) { // SASL authentication was successfull if (OnSaslEnd!=null) OnSaslEnd(this); m_XmppClient.DoChangeXmppConnectionState(XmppConnectionState.Authenticated); m_Mechanism = null; m_XmppClient.Reset(); } else if (e is Failure) { // Authentication failure m_XmppClient.FireOnAuthError(e as Element); } } internal void DoBind() { m_XmppClient.DoChangeXmppConnectionState(XmppConnectionState.Binding); BindIq bIq = string.IsNullOrEmpty(m_XmppClient.Resource) ? new BindIq(IqType.set) : new BindIq(IqType.set, m_XmppClient.Resource); m_XmppClient.IqGrabber.SendIq(bIq, BindResult); } private void BindResult(object sender, IQEventArgs e) { var iq = e.IQ; // Once the server has generated a resource identifier for the client or accepted the resource // identifier provided by the client, it MUST return an IQ stanza of type "result" // to the client, which MUST include a child element that specifies the full JID for // the connected resource as determined by the server: // Server informs client of successful resource binding: // // // somenode@example.com/someresource // // if (iq.Type == IqType.result) { // i assume the server could assign another resource here to the client // so grep the resource assigned by the server now Element bind = iq.SelectSingleElement(typeof(Bind)); if (bind != null) { Jid jid = ((Bind)bind).Jid; m_XmppClient.Resource = jid.Resource; m_XmppClient.Username = jid.User; } m_XmppClient.DoChangeXmppConnectionState(XmppConnectionState.Binded); m_XmppClient.m_Binded = true; m_XmppClient.DoRaiseEventBinded(); // success, so start the session now m_XmppClient.DoChangeXmppConnectionState(XmppConnectionState.StartSession); SessionIq sIq = new SessionIq(IqType.set, new Jid(m_XmppClient.Server)); m_XmppClient.IqGrabber.SendIq(sIq, SessionResult); e.Handled = true; } else if (iq.Type == IqType.error) { // TODO, handle bind errors m_XmppClient.DoRaiseEventBindError(iq); } } private void SessionResult(object sender, IQEventArgs e) { if (e.IQ.Type == IqType.result) { m_XmppClient.DoChangeXmppConnectionState(XmppConnectionState.SessionStarted); m_XmppClient.RaiseOnLogin(); e.Handled = true; } else if (e.IQ.Type == IqType.error) { } } #region IDisposable Members public void Dispose() { Dispose(true); } // Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if(!m_Disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if(disposing) { // Dispose managed resources. // Remove the event handler or we will be in trouble with too many events m_XmppClient.StreamParser.OnStreamElement -= OnStreamElement; m_XmppClient = null; m_Mechanism = null; } // Call the appropriate methods to clean up // unmanaged resources here. // If disposing is false, // only the following code is executed. } m_Disposed = true; } #endregion } }smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/XGoogleToken/0000755000175000017500000000000012204443225022547 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/XGoogleToken/XGoogleTokenMechanism.cs0000644000175000017500000001460212204443225027273 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using System.IO; using System.Text; using System.Net; using agsXMPP; using agsXMPP.Xml.Dom; using agsXMPP.protocol.sasl; namespace agsXMPP.Sasl.XGoogleToken { /// /// X-GOOGLE-TOKEN Authentication /// public class XGoogleTokenMechanism : Mechanism { /* see Google API documentation at: http://code.google.com/apis/accounts/AuthForInstalledApps.html http://code.google.com/apis/accounts/AuthForWebApps.html */ private string _Auth = null; private string _Sid = null; private string _Lsid = null; private string _Base64Token = null; private const string METHOD = "POST"; private const string CONTENT_TYPE = "application/x-www-form-urlencoded"; private const string URL_ISSUE_AUTH_TOKEN = "https://www.google.com/accounts/IssueAuthToken"; private const string URL_CLIENT_AUTH = "https://www.google.com/accounts/ClientAuth"; public override void Init(XmppClientConnection con) { base.XmppClientConnection = con; DoClientAuth(); } public override void Parse(Node e) { // not needed here in X-GOOGLE-TOKEN mechanism } private void DoSaslAuth() { // Base 64 Token goes here Auth auth = new Auth(MechanismType.X_GOOGLE_TOKEN, _Base64Token); base.XmppClientConnection.Send(auth); } private void DoClientAuth() { HttpWebRequest request = (HttpWebRequest) HttpWebRequest.Create(URL_CLIENT_AUTH); request.Method = METHOD; request.ContentType = CONTENT_TYPE; #if CF || CF_2 //required for bug workaround request.AllowWriteStreamBuffering = true; #endif request.BeginGetRequestStream(new AsyncCallback(OnGetClientAuthRequestStream), request); } private void OnGetClientAuthRequestStream(IAsyncResult result) { WebRequest request = (System.Net.WebRequest)result.AsyncState; Stream outputStream = request.EndGetRequestStream(result); string data = null; data += "Email=" + base.XmppClientConnection.MyJID.Bare; data += "&Passwd=" + base.Password; data += "&PersistentCookie=false"; //data += "&source=googletalk"; data += "&source=" + base.XmppClientConnection.Resource; data += "&service=mail"; byte[] bytes = Encoding.UTF8.GetBytes(data); outputStream.Write(bytes, 0, bytes.Length); outputStream.Close(); request.BeginGetResponse(new AsyncCallback(OnGetClientAuthResponse), request); } private void OnGetClientAuthResponse(IAsyncResult result) { try { WebRequest request = (WebRequest)result.AsyncState; HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(result); if (response.StatusCode == HttpStatusCode.OK) { Stream dataStream = response.GetResponseStream(); ParseClientAuthResponse(dataStream); dataStream.Close(); response.Close(); _Base64Token = GetToken(_Auth); DoSaslAuth(); } else base.XmppClientConnection.Close(); } catch (WebException we) { if (we.Response is HttpWebResponse // this is also false when Response is null && ((HttpWebResponse)we.Response).StatusCode == HttpStatusCode.Forbidden) { base.XmppClientConnection.FireOnAuthError(null); } base.XmppClientConnection.Close(); } } private void ParseClientAuthResponse(Stream responseStream) { StreamReader reader = new StreamReader(responseStream); string line; while ((line = reader.ReadLine()) != null) { if (line.StartsWith("SID=")) _Sid = line.Substring(4); else if(line.StartsWith("LSID=")) _Lsid = line.Substring(5); else if (line.StartsWith("Auth=")) _Auth = line.Substring(5); } reader.Close(); } private string GetToken(string line) { string temp = "\0" + base.XmppClientConnection.MyJID.Bare + "\0" + line; byte[] b = Encoding.UTF8.GetBytes(temp); return Convert.ToBase64String(b, 0, b.Length); } } }smuxi-0.11/lib/agsxmpp/agsxmpp/Sasl/SaslEventArgs.cs0000644000175000017500000000423212204443225023253 0ustar00meebeymeebey00000000000000/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2003-2012 by AG-Software * * All Rights Reserved. * * Contact information for AG-Software is available at http://www.ag-software.de * * * * Licence: * * The agsXMPP SDK is released under a dual licence * * agsXMPP can be used under either of two licences * * * * A commercial licence which is probably the most appropriate for commercial * * corporate use and closed source projects. * * * * The GNU Public License (GPL) is probably most appropriate for inclusion in * * other open source projects. * * * * See README.html for details. * * * * For general enquiries visit our website at: * * http://www.ag-software.de * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ using System; using agsXMPP.protocol.sasl; using agsXMPP.protocol.stream; namespace agsXMPP.Sasl { public delegate void SaslEventHandler (object sender, SaslEventArgs args); public class SaslEventArgs { #region << Constructors >> public SaslEventArgs() { } public SaslEventArgs(Mechanisms mechanisms) { Mechanisms = mechanisms; } #endregion // by default the library chooses the auth method private bool m_Auto = true; /// /// Set Auto to true if the library should choose the mechanism /// Set it to false for choosing the authentication method yourself /// public bool Auto { get { return m_Auto; } set { m_Auto = value; } } /// /// SASL Mechanism for authentication as string /// public string Mechanism { get; set; } public Mechanisms Mechanisms { get; set; } /// /// Extra Data for special Sasl mechanisms /// public ExtendedData ExtentedData { get; set; } } }smuxi-0.11/lib/SignalR/0000755000175000017500000000000012311344240015475 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/0000755000175000017500000000000012311344240016264 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/0000755000175000017500000000000012311344240024175 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/ConnectionState.cs0000644000175000017500000000046412204443213027631 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. namespace Microsoft.AspNet.SignalR.Client { public enum ConnectionState { Connecting, Connected, Reconnecting, Disconnected } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/HeaderDictionary.cs0000644000175000017500000000602512204443213027746 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Microsoft.AspNet.SignalR.Client { public class HeaderDictionary : IDictionary { private IDictionary _dictionary = new Dictionary(); private readonly IConnection _connection; public HeaderDictionary(IConnection connection) { _connection = connection; } public void Add(string key, string value) { EnsureConnnectionDisconnected(); _dictionary.Add(key, value); } public bool ContainsKey(string key) { return _dictionary.ContainsKey(key); } public ICollection Keys { get { return _dictionary.Keys; } } public bool Remove(string key) { EnsureConnnectionDisconnected(); return _dictionary.Remove(key); } public bool TryGetValue(string key, out string value) { return _dictionary.TryGetValue(key, out value); } public ICollection Values { get { return _dictionary.Values; } } public string this[string key] { get { return _dictionary[key]; } set { EnsureConnnectionDisconnected(); _dictionary[key] = value; } } public void Add(KeyValuePair item) { EnsureConnnectionDisconnected(); _dictionary.Add(item); } public void Clear() { EnsureConnnectionDisconnected(); _dictionary.Clear(); } public bool Contains(KeyValuePair item) { return _dictionary.Contains(item); } public void CopyTo(KeyValuePair[] array, int arrayIndex) { _dictionary.CopyTo(array, arrayIndex); } public int Count { get { return _dictionary.Count; } } public bool IsReadOnly { get { return _connection.State != ConnectionState.Disconnected || _dictionary.IsReadOnly; } } public bool Remove(KeyValuePair item) { EnsureConnnectionDisconnected(); return _dictionary.Remove(item); } public IEnumerator> GetEnumerator() { return _dictionary.GetEnumerator(); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return _dictionary.GetEnumerator(); } private void EnsureConnnectionDisconnected() { if (_connection.State != ConnectionState.Disconnected) { throw new InvalidOperationException(Resources.Error_HeadersCanOnlyBeSetWhenDisconnected); } } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/0000755000175000017500000000000012311344240026354 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/AsyncStreamReader.cs0000644000175000017500000001331012204443213032256 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Infrastructure; namespace Microsoft.AspNet.SignalR.Client.Transports { public class AsyncStreamReader { private readonly object _bufferLock = new object(); private readonly Stream _stream; private byte[] _readBuffer; private int _reading; private Action _setOpened; protected object BufferLock { get { return _bufferLock; } } /// /// Invoked when the stream is open. /// public Action Opened { get; set; } /// /// Invoked when the reader is closed while in the Processing state. /// public Action Closed { get; set; } /// /// Invoked when there's a message if received in the stream. /// public Action> Data { get; set; } /// /// Initializes a new instance of the class. /// /// The stream to read asynchronously payloads from. public AsyncStreamReader(Stream stream) { _stream = stream; } private bool Processing { get { return _reading == State.Processing; } } /// /// Starts the reader. /// public void Start() { if (Interlocked.CompareExchange(ref _reading, State.Processing, State.Initial) == State.Initial) { _setOpened = () => { OnOpened(); }; // FIX: Potential memory leak if Close is called between the CompareExchange and here. _readBuffer = new byte[4096]; // Start the process loop Process(); } } /// /// Closes the connection and the underlying stream. /// private void Close() { Close(exception: null); } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The client receives the exception in the Close callback.")] private void Process() { Read: Task readTask; lock (_bufferLock) { if (Processing && _readBuffer != null) { readTask = _stream.ReadAsync(_readBuffer); } else { return; } } if (readTask.IsCompleted) { try { // Observe all exceptions readTask.Wait(); int read = readTask.Result; if (TryProcessRead(read)) { goto Read; } } catch (Exception ex) { Close(ex); } } else { ReadAsync(readTask); } } private void ReadAsync(Task readTask) { readTask.ContinueWith(task => { if (task.IsFaulted) { Close(task.Exception); } else if (task.IsCanceled) { Close(new OperationCanceledException()); } else { if (TryProcessRead(task.Result)) { Process(); } } }, TaskContinuationOptions.ExecuteSynchronously); } private bool TryProcessRead(int read) { Interlocked.Exchange(ref _setOpened, () => { }).Invoke(); if (read > 0) { // Put chunks in the buffer OnData(new ArraySegment(_readBuffer, 0, read)); return true; } else if (read == 0) { Close(); } return false; } private void Close(Exception exception) { var previousState = Interlocked.Exchange(ref _reading, State.Stopped); if (previousState != State.Stopped) { if (Closed != null) { if (exception != null) { exception = exception.Unwrap(); } Closed(exception); } lock (_bufferLock) { // Release the buffer _readBuffer = null; } } } private void OnOpened() { if (Opened != null) { Opened(); } } private void OnData(ArraySegment buffer) { if (Data != null) { Data(buffer); } } private static class State { public const int Initial = 0; public const int Processing = 1; public const int Stopped = 2; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/LongPollingTransport.cs0000644000175000017500000002204312204443213033046 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Threading; using Microsoft.AspNet.SignalR.Client.Http; using Microsoft.AspNet.SignalR.Client.Infrastructure; using Microsoft.AspNet.SignalR.Infrastructure; namespace Microsoft.AspNet.SignalR.Client.Transports { public class LongPollingTransport : HttpBasedTransport { /// /// The time to wait after a connection drops to try reconnecting. /// public TimeSpan ReconnectDelay { get; set; } /// /// The time to wait after an error happens to continue polling. /// public TimeSpan ErrorDelay { get; set; } /// /// The time to wait after the initial connect http request before it is considered /// open. /// public TimeSpan ConnectDelay { get; set; } public LongPollingTransport() : this(new DefaultHttpClient()) { } public LongPollingTransport(IHttpClient httpClient) : base(httpClient, "longPolling") { ReconnectDelay = TimeSpan.FromSeconds(5); ErrorDelay = TimeSpan.FromSeconds(2); ConnectDelay = TimeSpan.FromSeconds(2); } /// /// Indicates whether or not the transport supports keep alive /// public override bool SupportsKeepAlive { get { return false; } } protected override void OnStart(IConnection connection, string data, CancellationToken disconnectToken, Action initializeCallback, Action errorCallback) { var requestHandler = new PollingRequestHandler(HttpClient); var negotiateInitializer = new NegotiateInitializer(initializeCallback, errorCallback, ConnectDelay); // Save the success and abort cases so we can remove them after transport is initialized Action initializeSuccess = message => { negotiateInitializer.Complete(); }; Action initializeAbort = request => { negotiateInitializer.Abort(disconnectToken); }; requestHandler.OnMessage += initializeSuccess; requestHandler.OnError += negotiateInitializer.Complete; requestHandler.OnAbort += initializeAbort; // Once we've initialized the connection we need to tear down the initializer functions negotiateInitializer.Initialized += () => { requestHandler.OnMessage -= initializeSuccess; requestHandler.OnError -= negotiateInitializer.Complete; requestHandler.OnAbort -= initializeAbort; }; // Add additional actions to each of the PollingRequestHandler events PollingSetup(connection, data, disconnectToken, requestHandler); requestHandler.Start(); // Start initialization, essentially if we have an assume sucess clause in our negotiateInitializer // then we will start the countdown from the point which we start initialization. negotiateInitializer.Initialize(); } [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "We will refactor later.")] private void PollingSetup(IConnection connection, string data, CancellationToken disconnectToken, PollingRequestHandler requestHandler) { // These are created new on each poll var reconnectInvoker = new ThreadSafeInvoker(); var requestDisposer = new Disposer(); requestHandler.ResolveUrl = () => { var url = connection.Url; if (connection.MessageId == null) { url += "connect"; } else if (IsReconnecting(connection)) { url += "reconnect"; } else { url += "poll"; } url += GetReceiveQueryString(connection, data); return url; }; requestHandler.PrepareRequest += req => { connection.PrepareRequest(req); }; requestHandler.OnMessage += message => { var shouldReconnect = false; var disconnectedReceived = false; connection.Trace(TraceLevels.Messages, "LP: OnMessage({0})", message); TransportHelper.ProcessResponse(connection, message, out shouldReconnect, out disconnectedReceived); if (IsReconnecting(connection)) { // If the timeout for the reconnect hasn't fired as yet just fire the // event here before any incoming messages are processed TryReconnect(connection, reconnectInvoker); } if (shouldReconnect) { // Transition into reconnecting state connection.EnsureReconnecting(); } if (disconnectedReceived) { connection.Disconnect(); } }; requestHandler.OnError += exception => { reconnectInvoker.Invoke(); // Transition into reconnecting state connection.EnsureReconnecting(); // Sometimes a connection might have been closed by the server before we get to write anything // so just try again and raise OnError. if (!ExceptionHelper.IsRequestAborted(exception) && !(exception is IOException)) { connection.OnError(exception); } else { requestHandler.Stop(); } }; requestHandler.OnPolling += () => { // Capture the cleanup within a closure so it can persist through multiple requests TryDelayedReconnect(connection, reconnectInvoker); requestDisposer.Set(disconnectToken.SafeRegister(state => { reconnectInvoker.Invoke(); requestHandler.Stop(); }, null)); }; requestHandler.OnAfterPoll = exception => { requestDisposer.Dispose(); if (TryCompleteAbort()) { // Abort() was called, so don't reconnect requestHandler.Stop(); } else { requestDisposer = new Disposer(); reconnectInvoker = new ThreadSafeInvoker(); if (exception != null) { // Delay polling by the error delay return TaskAsyncHelper.Delay(ErrorDelay); } } return TaskAsyncHelper.Empty; }; requestHandler.OnAbort += _ => { // Complete any ongoing calls to Abort() // If someone calls Abort() later, have it no-op CompleteAbort(); }; } private void TryDelayedReconnect(IConnection connection, ThreadSafeInvoker reconnectInvoker) { if (IsReconnecting(connection)) { TaskAsyncHelper.Delay(ReconnectDelay).Then(() => { TryReconnect(connection, reconnectInvoker); }); } } private static void TryReconnect(IConnection connection, ThreadSafeInvoker reconnectInvoker) { // Fire the reconnect event after the delay. reconnectInvoker.Invoke((conn) => FireReconnected(conn), connection); } private static void FireReconnected(IConnection connection) { // Mark the connection as connected if (connection.ChangeState(ConnectionState.Reconnecting, ConnectionState.Connected)) { connection.OnReconnected(); } } private static bool IsReconnecting(IConnection connection) { return connection.State == ConnectionState.Reconnecting; } public override void LostConnection(IConnection connection) { } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/ServerSentEvents/0000755000175000017500000000000012311344240031641 5ustar00meebeymeebey00000000000000ChunkBuffer.cs0000644000175000017500000000327412204443213034322 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/ServerSentEvents// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Text; namespace Microsoft.AspNet.SignalR.Client.Transports.ServerSentEvents { public class ChunkBuffer { private int _offset; private readonly StringBuilder _buffer; private readonly StringBuilder _lineBuilder; public ChunkBuffer() { _buffer = new StringBuilder(); _lineBuilder = new StringBuilder(); } public bool HasChunks { get { return _offset < _buffer.Length; } } public void Add(byte[] buffer, int length) { _buffer.Append(Encoding.UTF8.GetString(buffer, 0, length)); } public void Add(ArraySegment buffer) { _buffer.Append(Encoding.UTF8.GetString(buffer.Array, buffer.Offset, buffer.Count)); } public string ReadLine() { // Lock while reading so that we can make safe assuptions about the buffer indicies for (int i = _offset; i < _buffer.Length; i++, _offset++) { if (_buffer[i] == '\n') { _buffer.Remove(0, _offset + 1); string line = _lineBuilder.ToString().Trim(); #if WINDOWS_PHONE || NET35 _lineBuilder.Length = 0; #else _lineBuilder.Clear(); #endif _offset = 0; return line; } _lineBuilder.Append(_buffer[i]); } return null; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/ServerSentEvents/EventType.cs0000644000175000017500000000042112204443213034111 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. namespace Microsoft.AspNet.SignalR.Client.Transports.ServerSentEvents { public enum EventType { Id, Data } } EventSourceStreamReader.cs0000644000175000017500000000435612204443213036663 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/ServerSentEvents// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.IO; namespace Microsoft.AspNet.SignalR.Client.Transports.ServerSentEvents { /// /// Event source implementation for .NET. This isn't to the spec but it's enough to support SignalR's /// server. /// public class EventSourceStreamReader : AsyncStreamReader { private readonly ChunkBuffer _buffer; private readonly IConnection _connection; /// /// Invoked when there's a message if received in the stream. /// public Action Message { get; set; } /// /// Initializes a new instance of the class. /// /// The connection associated with this event source /// The stream to read event source payloads from. public EventSourceStreamReader(IConnection connection, Stream stream) : base(stream) { _connection = connection; _buffer = new ChunkBuffer(); Data = ProcessBuffer; } private void ProcessBuffer(ArraySegment readBuffer) { lock (BufferLock) { _buffer.Add(readBuffer); while (_buffer.HasChunks) { string line = _buffer.ReadLine(); // No new lines in the buffer so stop processing if (line == null) { break; } SseEvent sseEvent; if (!SseEvent.TryParse(line, out sseEvent)) { continue; } _connection.Trace(TraceLevels.Messages, "SSE: OnMessage({0})", sseEvent); OnMessage(sseEvent); } } } private void OnMessage(SseEvent sseEvent) { if (Message != null) { Message(sseEvent); } } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/ServerSentEvents/SseEvent.cs0000644000175000017500000000257412204443213033735 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; namespace Microsoft.AspNet.SignalR.Client.Transports.ServerSentEvents { public class SseEvent { public SseEvent(EventType type, string data) { EventType = type; Data = data; } public EventType EventType { get; private set; } public string Data { get; private set; } public override string ToString() { return EventType + ": " + Data; } public static bool TryParse(string line, out SseEvent sseEvent) { sseEvent = null; if (line == null) { throw new ArgumentNullException("line"); } if (line.StartsWith("data:", StringComparison.OrdinalIgnoreCase)) { string data = line.Substring("data:".Length).Trim(); sseEvent = new SseEvent(EventType.Data, data); return true; } else if (line.StartsWith("id:", StringComparison.OrdinalIgnoreCase)) { string data = line.Substring("id:".Length).Trim(); sseEvent = new SseEvent(EventType.Id, data); return true; } return false; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/ServerSentEventsTransport.cs0000644000175000017500000002324312237701046034121 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Threading; using Microsoft.AspNet.SignalR.Client.Http; using Microsoft.AspNet.SignalR.Client.Infrastructure; using Microsoft.AspNet.SignalR.Client.Transports.ServerSentEvents; using Microsoft.AspNet.SignalR.Infrastructure; namespace Microsoft.AspNet.SignalR.Client.Transports { public class ServerSentEventsTransport : HttpBasedTransport { private IRequest _request; public ServerSentEventsTransport() : this(new DefaultHttpClient()) { } public ServerSentEventsTransport(IHttpClient httpClient) : base(httpClient, "serverSentEvents") { ReconnectDelay = TimeSpan.FromSeconds(2); ConnectionTimeout = TimeSpan.FromSeconds(5); } /// /// Indicates whether or not the transport supports keep alive /// public override bool SupportsKeepAlive { get { return true; } } /// /// Time allowed before failing the connect request. /// public TimeSpan ConnectionTimeout { get; set; } /// /// The time to wait after a connection drops to try reconnecting. /// public TimeSpan ReconnectDelay { get; set; } protected override void OnStart(IConnection connection, string data, CancellationToken disconnectToken, Action initializeCallback, Action errorCallback) { OpenConnection(connection, data, disconnectToken, initializeCallback, errorCallback); } private void Reconnect(IConnection connection, string data, CancellationToken disconnectToken) { // Wait for a bit before reconnecting TaskAsyncHelper.Delay(ReconnectDelay).Then(() => { // FIX: Race if Connection is stopped and completely restarted between checking the token and calling // connection.EnsureReconnecting() if (!disconnectToken.IsCancellationRequested && connection.EnsureReconnecting()) { // Now attempt a reconnect OpenConnection(connection, data, disconnectToken, initializeCallback: null, errorCallback: null); } }); } [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "We will refactor later.")] [SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "We will refactor later.")] private void OpenConnection(IConnection connection, string data, CancellationToken disconnectToken, Action initializeCallback, Action errorCallback) { // If we're reconnecting add /connect to the url bool reconnecting = initializeCallback == null; var callbackInvoker = new ThreadSafeInvoker(); var requestDisposer = new Disposer(); var url = connection.Url + (reconnecting ? "reconnect" : "connect") + GetReceiveQueryString(connection, data); connection.Trace(TraceLevels.Events, "SSE: GET {0}", url); HttpClient.Get(url, req => { _request = req; connection.PrepareRequest(_request); _request.Accept = "text/event-stream"; }, isLongRunning: true).ContinueWith(task => { if (task.IsFaulted) { Exception exception = task.Exception.Unwrap(); if (!ExceptionHelper.IsRequestAborted(exception)) { if (errorCallback != null) { callbackInvoker.Invoke((cb, ex) => cb(ex), errorCallback, exception); } else if (reconnecting) { // Only raise the error event if we failed to reconnect connection.OnError(exception); Reconnect(connection, data, disconnectToken); } } requestDisposer.Dispose(); } else { var response = task.Result; Stream stream = response.GetStream(); var eventSource = new EventSourceStreamReader(connection, stream); bool stop = false; var esCancellationRegistration = disconnectToken.SafeRegister(state => { stop = true; ((IRequest)state).Abort(); }, _request); eventSource.Opened = () => { // If we're not reconnecting, then we're starting the transport for the first time. Trigger callback only on first start. if (!reconnecting) { callbackInvoker.Invoke(initializeCallback); } else if (connection.ChangeState(ConnectionState.Reconnecting, ConnectionState.Connected)) { // Raise the reconnect event if the connection comes back up connection.OnReconnected(); } }; eventSource.Message = sseEvent => { if (sseEvent.EventType == EventType.Data) { if (sseEvent.Data.Equals("initialized", StringComparison.OrdinalIgnoreCase)) { return; } bool timedOut; bool disconnected; TransportHelper.ProcessResponse(connection, sseEvent.Data, out timedOut, out disconnected); if (disconnected) { stop = true; connection.Disconnect(); } } }; eventSource.Closed = exception => { if (exception != null) { // Check if the request is aborted bool isRequestAborted = ExceptionHelper.IsRequestAborted(exception); if (!isRequestAborted) { // Don't raise exceptions if the request was aborted (connection was stopped). connection.OnError(exception); } } requestDisposer.Dispose(); esCancellationRegistration.Dispose(); response.Dispose(); if (stop) { CompleteAbort(); } else if (TryCompleteAbort()) { // Abort() was called, so don't reconnect } else { Reconnect(connection, data, disconnectToken); } }; eventSource.Start(); } }); var requestCancellationRegistration = disconnectToken.SafeRegister(state => { if (state != null) { // This will no-op if the request is already finished. ((IRequest)state).Abort(); } if (errorCallback != null) { callbackInvoker.Invoke((cb, token) => { #if NET35 || WINDOWS_PHONE cb(new OperationCanceledException(Resources.Error_ConnectionCancelled)); #else cb(new OperationCanceledException(Resources.Error_ConnectionCancelled, token)); #endif }, errorCallback, disconnectToken); } }, _request); requestDisposer.Set(requestCancellationRegistration); if (errorCallback != null) { TaskAsyncHelper.Delay(ConnectionTimeout).Then(() => { callbackInvoker.Invoke((conn, cb) => { // Abort the request before cancelling _request.Abort(); // Connection timeout occurred cb(new TimeoutException()); }, connection, errorCallback); }); } } public override void LostConnection(IConnection connection) { if (_request != null) { _request.Abort(); } } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/TransportHelper.cs0000644000175000017500000001605612237701046032057 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Text; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Client.Http; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Microsoft.AspNet.SignalR.Client.Transports { public static class TransportHelper { public static Task GetNegotiationResponse(this IHttpClient httpClient, IConnection connection) { if (httpClient == null) { throw new ArgumentNullException("httpClient"); } if (connection == null) { throw new ArgumentNullException("connection"); } #if SILVERLIGHT || WINDOWS_PHONE string negotiateUrl = connection.Url + "negotiate?" + GetNoCacheUrlParam(); #else string negotiateUrl = connection.Url + "negotiate"; #endif negotiateUrl += AppendCustomQueryString(connection, negotiateUrl); return httpClient.Get(negotiateUrl, connection.PrepareRequest, isLongRunning: false) .Then(response => response.ReadAsString()) .Then(raw => { if (String.IsNullOrEmpty(raw)) { throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, Resources.Error_ServerNegotiationFailed)); } return JsonConvert.DeserializeObject(raw); }); } [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "This is called by internally")] public static string GetReceiveQueryString(IConnection connection, string data, string transport) { if (connection == null) { throw new ArgumentNullException("connection"); } // ?transport={0}&connectionToken={1}&messageId={2}&groups={3}&connectionData={4}{5} var qsBuilder = new StringBuilder(); qsBuilder.Append("?transport=" + transport) .Append("&connectionToken=" + Uri.EscapeDataString(connection.ConnectionToken)); if (connection.MessageId != null) { qsBuilder.Append("&messageId=" + Uri.EscapeDataString(connection.MessageId)); } if (connection.GroupsToken != null) { qsBuilder.Append("&groupsToken=" + Uri.EscapeDataString(connection.GroupsToken)); } if (data != null) { qsBuilder.Append("&connectionData=" + data); } string customQuery = connection.QueryString; if (!String.IsNullOrEmpty(customQuery)) { qsBuilder.Append("&").Append(customQuery); } #if SILVERLIGHT || WINDOWS_PHONE qsBuilder.Append("&").Append(GetNoCacheUrlParam()); #endif return qsBuilder.ToString(); } public static string AppendCustomQueryString(IConnection connection, string baseUrl) { if (connection == null) { throw new ArgumentNullException("connection"); } if (baseUrl == null) { baseUrl = ""; } string appender = "", customQuery = connection.QueryString, qs = ""; if (!String.IsNullOrEmpty(customQuery)) { char firstChar = customQuery[0]; // If the custom query string already starts with an ampersand or question mark // then we dont have to use any appender, it can be empty. if (firstChar != '?' && firstChar != '&') { appender = "?"; if (baseUrl.Contains(appender)) { appender = "&"; } } qs += appender + customQuery; } return qs; } [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "This is called internally.")] [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", Justification = "This is called internally.")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The client receives the exception in the OnError callback.")] public static void ProcessResponse(IConnection connection, string response, out bool timedOut, out bool disconnected) { if (connection == null) { throw new ArgumentNullException("connection"); } connection.UpdateLastKeepAlive(); timedOut = false; disconnected = false; if (String.IsNullOrEmpty(response)) { return; } try { var result = JValue.Parse(response); if (!result.HasValues) { return; } if (result["I"] != null) { connection.OnReceived(result); return; } timedOut = result.Value("T") == 1; disconnected = result.Value("D") == 1; if (disconnected) { return; } UpdateGroups(connection, groupsToken: result["G"]); var messages = result["M"] as JArray; if (messages != null) { foreach (JToken message in messages) { try { connection.OnReceived(message); } catch (Exception ex) { connection.OnError(ex); } } connection.MessageId = result["C"].Value(); } } catch (Exception ex) { connection.OnError(ex); } } private static void UpdateGroups(IConnection connection, JToken groupsToken) { if (groupsToken != null) { connection.GroupsToken = groupsToken.Value(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is used on Silverlight and Windows Phone")] private static string GetNoCacheUrlParam() { return "noCache=" + Guid.NewGuid().ToString(); } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/IClientTransport.cs0000644000175000017500000000140112204443213032144 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; namespace Microsoft.AspNet.SignalR.Client.Transports { public interface IClientTransport : IDisposable { string Name { get; } bool SupportsKeepAlive { get; } Task Negotiate(IConnection connection); Task Start(IConnection connection, string data, CancellationToken disconnectToken); Task Send(IConnection connection, string data); void Abort(IConnection connection, TimeSpan timeout); void LostConnection(IConnection connection); } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/LongPolling/0000755000175000017500000000000012311344240030600 5ustar00meebeymeebey00000000000000NegotiateInitializer.cs0000644000175000017500000000407112204443213035176 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/LongPollingusing System; using System.Threading; using Microsoft.AspNet.SignalR.Client.Infrastructure; namespace Microsoft.AspNet.SignalR.Client.Transports { internal class NegotiateInitializer { private readonly ThreadSafeInvoker _callbackInvoker; private readonly Action _initializeCallback; private readonly Action _errorCallback; private readonly TimeSpan _assumeSuccessAfter; public NegotiateInitializer(Action initializeCallback, Action errorCallback, TimeSpan assumeSuccessAfter) { _initializeCallback = initializeCallback; _errorCallback = errorCallback; _assumeSuccessAfter = assumeSuccessAfter; _callbackInvoker = new ThreadSafeInvoker(); // Set default initialized function Initialized += () => { }; } public event Action Initialized; public void Initialize() { TaskAsyncHelper.Delay(_assumeSuccessAfter).Then(() => { _callbackInvoker.Invoke(() => { Initialized(); _initializeCallback(); }); }); } public void Complete() { _callbackInvoker.Invoke(() => { Initialized(); _initializeCallback(); }); } public void Complete(Exception exception) { _callbackInvoker.Invoke((cb, ex) => { Initialized(); cb(ex); }, _errorCallback, exception); } public void Abort(CancellationToken disconnectToken) { _callbackInvoker.Invoke((cb, token) => { Initialized(); #if NET35 || WINDOWS_PHONE cb(new OperationCanceledException(Resources.Error_ConnectionCancelled)); #else cb(new OperationCanceledException(Resources.Error_ConnectionCancelled, token)); #endif }, _errorCallback, disconnectToken); } } } PollingRequestHandler.cs0000644000175000017500000001250112237701046035332 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/LongPolling// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Client.Http; using Microsoft.AspNet.SignalR.Infrastructure; namespace Microsoft.AspNet.SignalR.Client.Transports { public class PollingRequestHandler { private IHttpClient _httpClient; private IRequest _currentRequest; private int _running; private object _stopLock; public PollingRequestHandler(IHttpClient httpClient) { _httpClient = httpClient; _running = 0; _stopLock = new object(); // Set default events ResolveUrl = () => ""; PrepareRequest = _ => { }; OnMessage = _ => { }; OnError = _ => { }; OnPolling = () => { }; OnAfterPoll = _ => TaskAsyncHelper.Empty; OnAbort = _ => { }; } /// /// Used to generate the Url that is posted to for the poll. /// public Func ResolveUrl { get; set; } /// /// Allows modification of the IRequest parameter before using it in a poll. /// public event Action PrepareRequest; /// /// Sends the string based message to the callback. /// public event Action OnMessage; /// /// If the poll errors OnError gets triggered and passes the exception. /// public event Action OnError; /// /// Triggers when the polling request is in flight /// public event Action OnPolling; /// /// Triggers before a new polling request is attempted. /// Passes in an exception if the Poll errored, null otherwise. /// Expects the return as a task in order to allow modification of timing for subsequent polls. /// public Func OnAfterPoll { get; set; } /// /// Fired when the current poll request was aborted, passing in the soon to be aborted request. /// public event Action OnAbort; /// /// Starts the Polling Request Handler. /// public void Start() { if (Interlocked.Exchange(ref _running, 1) == 0) { Poll(); } } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flowed back to user.")] private void Poll() { // This is to ensure that we do not accidently fire off another poll after being told to stop lock (_stopLock) { // Only poll if we're running if (_running == 0) { return; } // A url is required string url = ResolveUrl(); _httpClient.Post(url, request => { PrepareRequest(request); _currentRequest = request; // This is called just prior to posting the request to ensure that any in-flight polling request // is always executed before an OnAfterPoll OnPolling(); }, isLongRunning: true) .ContinueWith(task => { var next = TaskAsyncHelper.Empty; Exception exception = null; if (task.IsFaulted) { exception = task.Exception.Unwrap(); OnError(exception); } else { try { next = task.Result.ReadAsString().Then(raw => OnMessage(raw)); } catch (Exception ex) { exception = ex; OnError(exception); } } next.Finally(state => { OnAfterPoll((Exception)state).Then(() => Poll()); }, exception); }); } } /// /// Fully stops the Polling Request Handlers. /// public void Stop() { lock (_stopLock) { if (Interlocked.Exchange(ref _running, 0) == 1) { Abort(); } } } /// /// Aborts the currently active polling request, does not stop the Polling Request Handler. /// public void Abort() { OnAbort(_currentRequest); if (_currentRequest != null) { // This will no-op if the request is already finished _currentRequest.Abort(); } } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/HttpBasedTransport.cs0000644000175000017500000002012612237701046032507 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Client.Http; using Microsoft.AspNet.SignalR.Infrastructure; using Newtonsoft.Json.Linq; namespace Microsoft.AspNet.SignalR.Client.Transports { public abstract class HttpBasedTransport : IClientTransport { // The send query string private const string _sendQueryString = "?transport={0}&connectionToken={1}{2}"; // The transport name private readonly string _transport; // Used to complete the synchronous call to Abort() private ManualResetEvent _abortResetEvent = new ManualResetEvent(initialState: false); // Used to indicate whether Abort() has been called private bool _startedAbort; // Used to ensure that Abort() runs effectively only once // The _abortLock subsumes the _disposeLock and can be held upwards of 30 seconds private readonly object _abortLock = new object(); // Used to ensure the _abortResetEvent.Set() isn't called after disposal private bool _disposed; // Used to make checking _disposed and calling _abortResetEvent.Set() thread safe private readonly object _disposeLock = new object(); private readonly IHttpClient _httpClient; protected HttpBasedTransport(IHttpClient httpClient, string transport) { _httpClient = httpClient; _transport = transport; } public string Name { get { return _transport; } } /// /// Indicates whether or not the transport supports keep alive /// public abstract bool SupportsKeepAlive { get; } protected IHttpClient HttpClient { get { return _httpClient; } } public Task Negotiate(IConnection connection) { return _httpClient.GetNegotiationResponse(connection); } public Task Start(IConnection connection, string data, CancellationToken disconnectToken) { var tcs = new TaskCompletionSource(); OnStart(connection, data, disconnectToken, () => tcs.TrySetResult(null), exception => tcs.TrySetException(exception)); return tcs.Task; } protected abstract void OnStart(IConnection connection, string data, CancellationToken disconnectToken, Action initializeCallback, Action errorCallback); public Task Send(IConnection connection, string data) { if (connection == null) { throw new ArgumentNullException("connection"); } string url = connection.Url + "send"; string customQueryString = String.IsNullOrEmpty(connection.QueryString) ? String.Empty : "&" + connection.QueryString; url += String.Format(CultureInfo.InvariantCulture, _sendQueryString, _transport, Uri.EscapeDataString(connection.ConnectionToken), customQueryString); var postData = new Dictionary { { "data", data } }; return _httpClient.Post(url, connection.PrepareRequest, postData, isLongRunning: false) .Then(response => response.ReadAsString()) .Then(raw => { connection.Trace(TraceLevels.Messages, "OnMessage({0})", raw); if (!String.IsNullOrEmpty(raw)) { connection.OnReceived(JObject.Parse(raw)); } }) .Catch(connection.OnError); } public void Abort(IConnection connection, TimeSpan timeout) { if (connection == null) { throw new ArgumentNullException("connection"); } // Abort should never complete before any of its previous calls lock (_abortLock) { if (_disposed) { throw new ObjectDisposedException(GetType().Name); } // Ensure that an abort request is only made once if (!_startedAbort) { _startedAbort = true; string url = connection.Url + "abort" + String.Format(CultureInfo.InvariantCulture, _sendQueryString, _transport, Uri.EscapeDataString(connection.ConnectionToken), null); url += TransportHelper.AppendCustomQueryString(connection, url); _httpClient.Post(url, connection.PrepareRequest, isLongRunning: false).Catch((ex, state) => { // If there's an error making an http request set the reset event ((HttpBasedTransport)state).CompleteAbort(); }, this); if (!_abortResetEvent.WaitOne(timeout)) { connection.Trace(TraceLevels.Events, "Abort never fired"); } } } } protected void CompleteAbort() { lock (_disposeLock) { if (!_disposed) { // Make any future calls to Abort() no-op // Abort might still run, but any ongoing aborts will immediately complete _startedAbort = true; // Ensure any ongoing calls to Abort() complete _abortResetEvent.Set(); } } } protected bool TryCompleteAbort() { // Make sure we don't Set a disposed ManualResetEvent lock (_disposeLock) { if (_disposed) { // Don't try to continue receiving messages if the transport is disposed return true; } else if (_startedAbort) { _abortResetEvent.Set(); return true; } else { return false; } } } protected string GetReceiveQueryString(IConnection connection, string data) { return TransportHelper.GetReceiveQueryString(connection, data, _transport); } public abstract void LostConnection(IConnection connection); public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing) { // Wait for any ongoing aborts to complete // In practice, any aborts should have finished by the time Dispose is called lock (_abortLock) lock (_disposeLock) { if (!_disposed) { _abortResetEvent.Dispose(); _disposed = true; } } } } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Transports/AutoTransport.cs0000644000175000017500000001162012204443213031531 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Client.Http; namespace Microsoft.AspNet.SignalR.Client.Transports { public class AutoTransport : IClientTransport { // Transport that's in use private IClientTransport _transport; private readonly IHttpClient _httpClient; private int _startIndex = 0; // List of transports in fallback order private readonly IList _transports; public AutoTransport(IHttpClient httpClient) { _httpClient = httpClient; _transports = new IClientTransport[] { #if NET45 new WebSocketTransport(httpClient), #endif new ServerSentEventsTransport(httpClient), new LongPollingTransport(httpClient) }; } public AutoTransport(IHttpClient httpClient, IList transports) { _httpClient = httpClient; _transports = transports; } /// /// Indicates whether or not the active transport supports keep alive /// public bool SupportsKeepAlive { get { return _transport != null ? _transport.SupportsKeepAlive : false; } } public string Name { get { if (_transport == null) { return null; } return _transport.Name; } } public Task Negotiate(IConnection connection) { var task = _httpClient.GetNegotiationResponse(connection); #if NET45 return task.Then(response => { if (!response.TryWebSockets) { _startIndex = 1; } return response; }); #else return task; #endif } public Task Start(IConnection connection, string data, CancellationToken disconnectToken) { var tcs = new TaskCompletionSource(); // Resolve the transport ResolveTransport(connection, data, disconnectToken, tcs, _startIndex); return tcs.Task; } private void ResolveTransport(IConnection connection, string data, CancellationToken disconnectToken, TaskCompletionSource tcs, int index) { // Pick the current transport IClientTransport transport = _transports[index]; transport.Start(connection, data, disconnectToken).ContinueWith(task => { if (task.IsFaulted) { // Make sure we observe the exception var ex = task.Exception.GetBaseException(); connection.Trace(TraceLevels.Events, "Auto: Failed to connect to using transport {0}. {1}", transport.Name, ex); // If that transport fails to initialize then fallback var next = index + 1; if (next < _transports.Count) { // Try the next transport ResolveTransport(connection, data, disconnectToken, tcs, next); } else { // If there's nothing else to try then just fail tcs.SetException(task.Exception); } } else { // Set the active transport _transport = transport; // Complete the process tcs.SetResult(null); } }, TaskContinuationOptions.ExecuteSynchronously); } public Task Send(IConnection connection, string data) { return _transport.Send(connection, data); } public void Abort(IConnection connection, TimeSpan timeout) { if (_transport != null) { _transport.Abort(connection, timeout); } } public void LostConnection(IConnection connection) { _transport.LostConnection(connection); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing) { if (_transport != null) { _transport.Dispose(); } } } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Http/0000755000175000017500000000000012311344240025114 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Http/IRequest.cs0000644000175000017500000000327212204443213027211 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System.Collections.Generic; using System.Collections.Specialized; using System.Net; #if (NET4 || NET45) using System.Security.Cryptography.X509Certificates; #endif namespace Microsoft.AspNet.SignalR.Client.Http { /// /// The http request /// public interface IRequest { /// /// The user agent for this request. /// string UserAgent { get; set; } /// /// The credentials for this request. /// ICredentials Credentials { get; set; } /// /// The cookies for this request. /// CookieContainer CookieContainer { get; set; } #if !SILVERLIGHT /// /// The proxy information for this request. /// IWebProxy Proxy { get; set; } #endif /// /// The accept header for this request. /// string Accept { get; set; } /// /// Aborts the request. /// void Abort(); /// /// Set Request Headers /// /// request headers void SetRequestHeaders(IDictionary headers); #if (NET4 || NET45) && !MONO /// /// Sets client certificates /// /// client certificates void AddClientCerts(X509CertificateCollection certificates); #endif } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Http/IHttpClient.cs0000644000175000017500000000340412237701046027643 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; namespace Microsoft.AspNet.SignalR.Client.Http { /// /// A client that can make http request. /// public interface IHttpClient { /// /// Makes an asynchronous http GET request to the specified url. /// /// The url to send the request to. /// A callback that initializes the request with default values. /// Indicates whether it is a long running request /// A . [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Performs a GET request")] Task Get(string url, Action prepareRequest, bool isLongRunning); /// /// Makes an asynchronous http POST request to the specified url. /// /// The url to send the request to. /// A callback that initializes the request with default values. /// form url encoded data. /// Indicates whether it is a long running request /// A . Task Post(string url, Action prepareRequest, IDictionary postData, bool isLongRunning); } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Http/HttpHelper.cs0000644000175000017500000001134412204443213027526 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Net; using System.Text; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Infrastructure; namespace Microsoft.AspNet.SignalR.Client.Http { internal static class HttpHelper { [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flowed back to the caller.")] public static Task GetHttpResponseAsync(this HttpWebRequest request) { try { return Task.Factory.FromAsync(request.BeginGetResponse, ar => (HttpWebResponse)request.EndGetResponse(ar), null); } catch (Exception ex) { return TaskAsyncHelper.FromError(ex); } } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flowed back to the caller.")] public static Task GetHttpRequestStreamAsync(this HttpWebRequest request) { try { return Task.Factory.FromAsync(request.BeginGetRequestStream, request.EndGetRequestStream, null); } catch (Exception ex) { return TaskAsyncHelper.FromError(ex); } } public static Task GetAsync(string url, Action requestPreparer) { HttpWebRequest request = CreateWebRequest(url); if (requestPreparer != null) { requestPreparer(request); } return request.GetHttpResponseAsync(); } public static Task PostAsync(string url, Action requestPreparer, IDictionary postData) { return PostInternal(url, requestPreparer, postData); } private static Task PostInternal(string url, Action requestPreparer, IDictionary postData) { HttpWebRequest request = CreateWebRequest(url); if (requestPreparer != null) { requestPreparer(request); } byte[] buffer = ProcessPostData(postData); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; #if !WINDOWS_PHONE && !SILVERLIGHT // Set the content length if the buffer is non-null request.ContentLength = buffer != null ? buffer.LongLength : 0; #endif if (buffer == null) { // If there's nothing to be written to the request then just get the response return request.GetHttpResponseAsync(); } // Write the post data to the request stream return request.GetHttpRequestStreamAsync() .Then(stream => stream.WriteAsync(buffer).Then(() => stream.Dispose())) .Then(() => request.GetHttpResponseAsync()); } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Text.StringBuilder.AppendFormat(System.String,System.Object[])", Justification = "This will never be localized.")] private static byte[] ProcessPostData(IDictionary postData) { if (postData == null || postData.Count == 0) { return null; } var sb = new StringBuilder(); foreach (var pair in postData) { if (sb.Length > 0) { sb.Append("&"); } if (String.IsNullOrEmpty(pair.Value)) { continue; } sb.AppendFormat("{0}={1}", pair.Key, UrlEncoder.UrlEncode(pair.Value)); } return Encoding.UTF8.GetBytes(sb.ToString()); } private static HttpWebRequest CreateWebRequest(string url) { HttpWebRequest request = null; #if WINDOWS_PHONE request = (HttpWebRequest)WebRequest.Create(url); request.AllowReadStreamBuffering = false; #elif SILVERLIGHT request = (HttpWebRequest)System.Net.Browser.WebRequestCreator.ClientHttp.Create(new Uri(url)); request.AllowReadStreamBuffering = false; #else request = (HttpWebRequest)WebRequest.Create(url); #endif return request; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Http/IResponseExtensions.cs0000644000175000017500000000223412204443213031434 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Text; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Client.Transports; namespace Microsoft.AspNet.SignalR.Client.Http { public static class IResponseExtensions { public static Task ReadAsString(this IResponse response) { if (response == null) { throw new ArgumentNullException("response"); } var stream = response.GetStream(); var reader = new AsyncStreamReader(stream); var result = new StringBuilder(); var resultTcs = new TaskCompletionSource(); reader.Data = buffer => { result.Append(Encoding.UTF8.GetString(buffer.Array, buffer.Offset, buffer.Count)); }; reader.Closed = exception => { response.Dispose(); resultTcs.SetResult(result.ToString()); }; reader.Start(); return resultTcs.Task; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Http/IHttpClientExtensions.cs0000644000175000017500000000162012237701046031721 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Threading.Tasks; namespace Microsoft.AspNet.SignalR.Client.Http { public static class IHttpClientExtensions { public static Task Post(this IHttpClient client, string url, Action prepareRequest, bool isLongRunning) { if (client == null) { throw new ArgumentNullException("client"); } if (url == null) { throw new ArgumentNullException("url"); } if (prepareRequest == null) { throw new ArgumentNullException("prepareRequest"); } return client.Post(url, prepareRequest, postData: null, isLongRunning: isLongRunning); } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Http/IResponse.cs0000644000175000017500000000124412204443213027354 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Diagnostics.CodeAnalysis; using System.IO; namespace Microsoft.AspNet.SignalR.Client.Http { /// /// The http response. /// public interface IResponse : IDisposable { /// /// Gets the steam that represents the response body. /// /// [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "This could be expensive.")] Stream GetStream(); } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Http/DefaultHttpClient.cs0000644000175000017500000000552712237701046031047 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections.Generic; using System.Threading.Tasks; namespace Microsoft.AspNet.SignalR.Client.Http { /// /// The default implementation. /// public class DefaultHttpClient : IHttpClient { #if (!WINDOWS_PHONE && !SILVERLIGHT) private readonly string _shortRunningGroup; private readonly string _longRunningGroup; public DefaultHttpClient() { string id = Guid.NewGuid().ToString(); _shortRunningGroup = "SignalR-short-running-" + id; _longRunningGroup = "SignalR-long-running-" + id; } #endif /// /// Makes an asynchronous http GET request to the specified url. /// /// The url to send the request to. /// A callback that initializes the request with default values. /// Indicates whether it is a long running request /// A . public Task Get(string url, Action prepareRequest, bool isLongRunning) { return HttpHelper.GetAsync(url, request => { #if (!WINDOWS_PHONE && !SILVERLIGHT) request.ConnectionGroupName = isLongRunning ? _longRunningGroup : _shortRunningGroup; #endif var req = new HttpWebRequestWrapper(request); prepareRequest(req); } ).Then(response => (IResponse)new HttpWebResponseWrapper(response)); } /// /// Makes an asynchronous http POST request to the specified url. /// /// The url to send the request to. /// A callback that initializes the request with default values. /// form url encoded data. /// Indicates whether it is a long running request /// A . public Task Post(string url, Action prepareRequest, IDictionary postData, bool isLongRunning) { return HttpHelper.PostAsync(url, request => { #if (!WINDOWS_PHONE && !SILVERLIGHT) request.ConnectionGroupName = isLongRunning ? _longRunningGroup : _shortRunningGroup; #endif var req = new HttpWebRequestWrapper(request); prepareRequest(req); }, postData).Then(response => (IResponse)new HttpWebResponseWrapper(response)); } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Http/HttpWebRequestWrapper.cs0000644000175000017500000001306612204443213031741 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections.Generic; using System.Globalization; using System.Net; #if (NET4 || NET45) using System.Security.Cryptography.X509Certificates; #endif namespace Microsoft.AspNet.SignalR.Client.Http { public class HttpWebRequestWrapper : IRequest { private readonly HttpWebRequest _request; private IDictionary> _restrictedHeadersSet = new Dictionary>() { { HttpRequestHeader.Accept.ToString(), (request, value) => { request.Accept = value; } }, { HttpRequestHeader.ContentType.ToString(), (request, value) => { request.ContentType = value; } }, { HttpRequestHeader.ContentLength.ToString(), (request, value) => { request.ContentLength = Int32.Parse(value, CultureInfo.CurrentCulture); } }, { HttpRequestHeader.UserAgent.ToString(), (request, value) => { request.UserAgent = value; } }, #if (!WINDOWS_PHONE && !SILVERLIGHT) { HttpRequestHeader.Connection.ToString(), (request, value) => { request.Connection = value; } }, #if !MONO { HttpRequestHeader.Date.ToString(), (request, value) => {request.Date = DateTime.Parse(value, CultureInfo.CurrentCulture); } }, #endif { HttpRequestHeader.Expect.ToString(), (request, value) => {request.Expect = value;} }, { HttpRequestHeader.Host.ToString(), (request, value) => {request.Host = value; } }, { HttpRequestHeader.IfModifiedSince.ToString(), (request, value) => {request.IfModifiedSince = DateTime.Parse(value, CultureInfo.CurrentCulture);} }, { HttpRequestHeader.Referer.ToString(), (request, value) => { request.Referer = value; } }, { HttpRequestHeader.TransferEncoding.ToString(), (request, value) => { request.TransferEncoding = value; } }, #endif }; public HttpWebRequestWrapper(HttpWebRequest request) { _request = request; } public string UserAgent { get { return _request.UserAgent; } set { _request.UserAgent = value; } } public ICredentials Credentials { get { return _request.Credentials; } set { _request.Credentials = value; } } public CookieContainer CookieContainer { get { return _request.CookieContainer; } set { _request.CookieContainer = value; } } public string Accept { get { return _request.Accept; } set { _request.Accept = value; } } #if !SILVERLIGHT public IWebProxy Proxy { get { return _request.Proxy; } set { _request.Proxy = value; } } #endif public void Abort() { _request.Abort(); } public void SetRequestHeaders(IDictionary headers) { if (headers == null) { throw new ArgumentNullException("headers"); } foreach (KeyValuePair headerEntry in headers) { if (!_restrictedHeadersSet.Keys.Contains(headerEntry.Key)) { #if (!WINDOWS_PHONE && !SILVERLIGHT) _request.Headers.Add(headerEntry.Key, headerEntry.Value); #endif } else { Action setHeaderAction; if (_restrictedHeadersSet.TryGetValue(headerEntry.Key, out setHeaderAction)) { setHeaderAction.Invoke(_request, headerEntry.Value); } } } } #if (NET4 || NET45) && !MONO public void AddClientCerts(X509CertificateCollection certificates) { if (certificates == null) { throw new ArgumentNullException("certificates"); } _request.ClientCertificates = certificates; } #endif } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Http/HttpWebResponseWrapper.cs0000644000175000017500000000154412204443213032105 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.IO; using System.Net; using System.Threading.Tasks; namespace Microsoft.AspNet.SignalR.Client.Http { public class HttpWebResponseWrapper : IResponse { private readonly HttpWebResponse _response; public HttpWebResponseWrapper(HttpWebResponse response) { _response = response; } public Stream GetStream() { return _response.GetResponseStream(); } protected virtual void Dispose(bool disposing) { if (disposing) { ((IDisposable)_response).Dispose(); } } public void Dispose() { Dispose(true); } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Microsoft.AspNet.SignalR.Client.csproj0000644000175000017500000001532012204443213033332 0ustar00meebeymeebey00000000000000 Debug AnyCPU 8.0.30703 2.0 {EB46B9C6-EE37-48F9-835E-E49580E40E0A} Library Properties Microsoft.AspNet.SignalR.Client Microsoft.AspNet.SignalR.Client 512 true ..\..\ true full false bin\Debug\ TRACE;DEBUG;CLIENT_NET4;NET4;MONO prompt 4 bin\Debug\Microsoft.AspNet.SignalR.Client.XML pdbonly true bin\Release\ TRACE;STABLE_VERSION prompt 4 bin\Release\Microsoft.AspNet.SignalR.Client.XML Properties\CommonAssemblyInfo.cs Properties\CommonVersionInfo.cs Infrastructure\CancellationTokenExtensions.cs Infrastructure\DisposableAction.cs Infrastructure\Disposer.cs Infrastructure\ExceptionsExtensions.cs Infrastructure\TaskAsyncHelper.cs True True Resources.resx ResXFileCodeGenerator Resources.Designer.cs Designer {A9AE40FF-1A21-414A-9FE7-3BE13644CC6D} Newtonsoft.Json smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/IConnection.cs0000644000175000017500000000366712204443213026751 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Net; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Client.Http; using Microsoft.AspNet.SignalR.Client.Transports; using Newtonsoft.Json; using Newtonsoft.Json.Linq; #if (NET4 || NET45) using System.Security.Cryptography.X509Certificates; #endif namespace Microsoft.AspNet.SignalR.Client { public interface IConnection { KeepAliveData KeepAliveData { get; set; } string MessageId { get; set; } string GroupsToken { get; set; } IDictionary Items { get; } string ConnectionId { get; } string ConnectionToken { get; } string Url { get; } string QueryString { get; } ConnectionState State { get; } IClientTransport Transport { get; } bool ChangeState(ConnectionState oldState, ConnectionState newState); IDictionary Headers { get; } ICredentials Credentials { get; set; } CookieContainer CookieContainer { get; set; } JsonSerializer JsonSerializer { get; } [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Stop", Justification = "Works in VB.NET.")] void Stop(); void Disconnect(); Task Send(string data); void OnReceived(JToken data); void OnError(Exception ex); void OnReconnecting(); void OnReconnected(); void OnConnectionSlow(); void PrepareRequest(IRequest request); void UpdateLastKeepAlive(); #if (NET4 || NET45) void AddClientCertificate(X509Certificate certificate); #endif void Trace(TraceLevels level, string format, params object[] args); } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/ObservableConnection.cs0000644000175000017500000000323012204443213030627 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Globalization; using Microsoft.AspNet.SignalR.Client.Infrastructure; using Microsoft.AspNet.SignalR.Infrastructure; namespace Microsoft.AspNet.SignalR.Client { public class ObservableConnection : IObservable { private readonly Connection _connection; private readonly Func _convert; public ObservableConnection(Connection connection, Func convert) { if (connection == null) { throw new ArgumentNullException("connection"); } if (convert == null) { throw new ArgumentNullException("convert"); } _convert = convert; _connection = connection; } public IDisposable Subscribe(IObserver observer) { Action received = data => { observer.OnNext(_convert(data)); }; Action closed = () => { observer.OnCompleted(); }; Action error = ex => { observer.OnError(ex); }; _connection.Received += received; _connection.Closed += closed; _connection.Error += error; return new DisposableAction(() => { _connection.Received -= received; _connection.Closed -= closed; _connection.Error -= error; }); } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Properties/0000755000175000017500000000000012311344240026331 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Properties/AssemblyInfo.cs0000644000175000017500000000043212204443213031253 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System.Reflection; [assembly: AssemblyTitle("Microsoft.AspNet.SignalR.Client")] [assembly: AssemblyDescription(".NET client for SignalR")] smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Resources.resx0000644000175000017500000001560612204443213027063 0ustar00meebeymeebey00000000000000 text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 The connection was stopped before it could be started. The connection has not been established. Request headers cannot be set after the connection has started. You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}. A HubProxy cannot be added after the connection has been started. Server negotiation failed. The Start method must be called before data can be sent. Url cannot contain query string directly. Pass query string values in using available overload. smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/StateChange.cs0000644000175000017500000000203612204443213026714 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. namespace Microsoft.AspNet.SignalR.Client { /// /// Represents a change in the connection state. /// public class StateChange { /// /// Creates a new stance of . /// /// The old state of the connection. /// The new state of the connection. public StateChange(ConnectionState oldState, ConnectionState newState) { OldState = oldState; NewState = newState; } /// /// Gets the old state of the connection. /// public ConnectionState OldState { get; private set; } /// /// Gets the new state of the connection. /// public ConnectionState NewState { get; private set; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Infrastructure/0000755000175000017500000000000012311344240027215 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Infrastructure/StreamExtensions.cs0000644000175000017500000000563012204443213033064 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Threading.Tasks; namespace Microsoft.AspNet.SignalR.Infrastructure { internal static class StreamExtensions { [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flowed back to the caller.")] public static Task ReadAsync(this Stream stream, byte[] buffer) { #if NETFX_CORE || NET45 return stream.ReadAsync(buffer, 0, buffer.Length); #else return FromAsync(cb => stream.BeginRead(buffer, 0, buffer.Length, cb, null), ar => stream.EndRead(ar)); #endif } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared class.")] public static Task WriteAsync(this Stream stream, byte[] buffer) { #if NETFX_CORE || NET45 return stream.WriteAsync(buffer, 0, buffer.Length); #else return FromAsync(cb => stream.BeginWrite(buffer, 0, buffer.Length, cb, null), WrapEndWrite(stream)); #endif } #if !(NETFX_CORE || NET45) private static Func WrapEndWrite(Stream stream) { return ar => { stream.EndWrite(ar); return null; }; } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flowed back to the caller.")] private static Task FromAsync(Func begin, Func end) { var tcs = new TaskCompletionSource(); try { var result = begin(ar => { if (!ar.CompletedSynchronously) { CompleteAsync(tcs, ar, end); } }); if (result.CompletedSynchronously) { CompleteAsync(tcs, result, end); } } catch (Exception ex) { tcs.TrySetException(ex); } return tcs.Task; } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flowed back to the caller.")] private static void CompleteAsync(TaskCompletionSource tcs, IAsyncResult ar, Func end) { try { tcs.TrySetResult(end(ar)); } catch (OperationCanceledException) { tcs.TrySetCanceled(); } catch (Exception ex) { tcs.TrySetException(ex); } } #endif } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Infrastructure/ThreadSafeInvoker.cs0000644000175000017500000000235012204443213033111 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Threading; namespace Microsoft.AspNet.SignalR.Client.Infrastructure { /// /// Allows for thread safe invocation of a delegate. /// internal class ThreadSafeInvoker { private int _invoked; public bool Invoke(Action action) { if (Interlocked.Exchange(ref _invoked, 1) == 0) { action(); return true; } return false; } public bool Invoke(Action action, T arg) { if (Interlocked.Exchange(ref _invoked, 1) == 0) { action(arg); return true; } return false; } public bool Invoke(Action action, T1 arg1, T2 arg2) { if (Interlocked.Exchange(ref _invoked, 1) == 0) { action(arg1, arg2); return true; } return false; } public bool Invoke() { return Invoke(() => { }); } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Infrastructure/ExceptionHelper.cs0000644000175000017500000000301712204443213032644 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Net; using Microsoft.AspNet.SignalR.Infrastructure; namespace Microsoft.AspNet.SignalR.Client.Infrastructure { internal static class ExceptionHelper { internal static bool IsRequestAborted(Exception exception) { exception = exception.Unwrap(); // Support an alternative way to propagate aborted requests if (exception is OperationCanceledException) { return true; } // There is a race in StreamExtensions where if the endMethod in ReadAsync is called before // the Stream is disposed, but executes after, Stream.EndRead will be called on a disposed object. // Since we call HttpWebRequest.Abort in several places while potentially reading the stream, // and we don't want to lock around HttpWebRequest.Abort and Stream.EndRead, we just swallow the // exception. // If the Stream is closed before the call to the endMethod, we expect an OperationCanceledException, // so this is a fairly rare race condition. if (exception is ObjectDisposedException) { return true; } var webException = exception as WebException; return (webException != null && webException.Status == WebExceptionStatus.RequestCanceled); } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Infrastructure/ErrorExtensions.cs0000644000175000017500000000615512204443213032725 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Net; using Microsoft.AspNet.SignalR.Infrastructure; namespace Microsoft.AspNet.SignalR.Client { public static class ErrorExtensions { /// /// Simplifies error recognition by unwrapping complex exceptions. /// /// The thrown exception. /// An unwrapped exception in the form of a SignalRError. [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "The IDisposable object is the return value.")] public static SignalRError GetError(this Exception ex) { ex = ex.Unwrap(); var wex = ex as WebException; var error = new SignalRError(ex); if (wex != null && wex.Response != null) { var response = wex.Response as HttpWebResponse; if (response != null) { error.SetResponse(response); error.StatusCode = response.StatusCode; Stream originStream = response.GetResponseStream(); if (originStream.CanRead) { // We need to copy the stream over and not consume it all on "ReadToEnd". If we consumed the entire stream GetError // would only be able to be called once per Exception, otherwise you get inconsistent ResponseBody results. Stream stream = Clone(originStream); // Consume our copied stream using (var sr = new StreamReader(stream)) { error.ResponseBody = sr.ReadToEnd(); } } } } return error; } [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "The return value of this private method is disposed in GetError.")] private static Stream Clone(Stream source) { var cloned = new MemoryStream(); #if NET35 // Copy up to 2048 bytes at a time byte[] buffer = new byte[2048]; // Maintains how many bytes were read int copiedBytes; // Read bytes and copy them into a buffer making sure not to trigger the dispose while ((copiedBytes = source.Read(buffer, 0, buffer.Length)) > 0) { // Write the copied bytes from the buffer into the cloned stream cloned.Write(buffer, 0, copiedBytes); } #else source.CopyTo(cloned); #endif // Move the stream pointers back to the original start locations if (source.CanSeek) { source.Seek(0, 0); } cloned.Seek(0, 0); return cloned; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Infrastructure/SignalRError.cs0000644000175000017500000000367712204443213032133 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Net; namespace Microsoft.AspNet.SignalR.Client { /// /// Represents errors that are thrown by the SignalR client /// public class SignalRError : IDisposable { private HttpWebResponse _response; /// /// Create custom SignalR based error. /// /// The exception to unwrap public SignalRError(Exception exception) { Exception = exception; } internal void SetResponse(HttpWebResponse response) { _response = response; } /// /// The status code of the error (if it was a WebException) /// public HttpStatusCode StatusCode { get; set; } /// /// The response body of the error, if it was a WebException and the response is readable /// public string ResponseBody { get; set; } /// /// The unwrapped underlying exception /// public Exception Exception { get; private set; } /// /// Allow a SignalRError to be directly written to an output stream /// /// Exception error public override string ToString() { return Exception.ToString(); } protected virtual void Dispose(bool disposing) { if (disposing) { if (_response != null) { _response.Close(); } } } /// /// Dispose of the response /// public void Dispose() { Dispose(true); } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Infrastructure/UrlEncoder.cs0000644000175000017500000001033112204443213031605 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Text; namespace Microsoft.AspNet.SignalR.Infrastructure { // Taken from System.Net.Http.Formatting.Internal.UrlEncoder.cs (http://aspnetwebstack.codeplex.com/) /// /// Helpers for encoding URI query components. /// internal static class UrlEncoder { // The implementation below is ported from WebUtility for use in .Net 4 public static string UrlEncode(string str) { if (str == null) return null; byte[] bytes = Encoding.UTF8.GetBytes(str); byte[] encodedBytes = UrlEncode(bytes, 0, bytes.Length, alwaysCreateNewReturnValue: false); return Encoding.UTF8.GetString(encodedBytes, 0, encodedBytes.Length); } #region UrlEncode implementation private static byte[] UrlEncode(byte[] bytes, int offset, int count, bool alwaysCreateNewReturnValue) { byte[] encoded = UrlEncode(bytes, offset, count); return (alwaysCreateNewReturnValue && (encoded != null) && (encoded == bytes)) ? (byte[])encoded.Clone() : encoded; } private static byte[] UrlEncode(byte[] bytes, int offset, int count) { if (!ValidateUrlEncodingParameters(bytes, offset, count)) { return null; } int cSpaces = 0; int cUnsafe = 0; // count them first for (int i = 0; i < count; i++) { char ch = (char)bytes[offset + i]; if (ch == ' ') cSpaces++; else if (!IsUrlSafeChar(ch)) cUnsafe++; } // nothing to expand? if (cSpaces == 0 && cUnsafe == 0) return bytes; // expand not 'safe' characters into %XX, spaces to +s byte[] expandedBytes = new byte[count + cUnsafe * 2]; int pos = 0; for (int i = 0; i < count; i++) { byte b = bytes[offset + i]; char ch = (char)b; if (IsUrlSafeChar(ch)) { expandedBytes[pos++] = b; } else if (ch == ' ') { expandedBytes[pos++] = (byte)'+'; } else { expandedBytes[pos++] = (byte)'%'; expandedBytes[pos++] = (byte)IntToHex((b >> 4) & 0xf); expandedBytes[pos++] = (byte)IntToHex(b & 0x0f); } } return expandedBytes; } #endregion #region Helper methods private static char IntToHex(int n) { if (n <= 9) return (char)(n + (int)'0'); else return (char)(n - 10 + (int)'a'); } // Set of safe chars, from RFC 1738.4 minus '+' private static bool IsUrlSafeChar(char ch) { if (ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' || ch >= '0' && ch <= '9') return true; switch (ch) { case '-': case '_': case '.': case '!': case '*': case '(': case ')': return true; } return false; } private static bool ValidateUrlEncodingParameters(byte[] bytes, int offset, int count) { if (bytes == null && count == 0) return false; if (bytes == null) { throw new ArgumentNullException("bytes"); } if (offset < 0 || offset > bytes.Length) { throw new ArgumentOutOfRangeException("offset"); } if (count < 0 || offset + count > bytes.Length) { throw new ArgumentOutOfRangeException("count"); } return true; } #endregion } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/NegotiationResponse.cs0000644000175000017500000000124212204443213030523 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System.Diagnostics; namespace Microsoft.AspNet.SignalR.Client { [DebuggerDisplay("{ConnectionId} {Url} -> {ProtocolVersion}")] public class NegotiationResponse { public string ConnectionId { get; set; } public string ConnectionToken { get; set; } public string Url { get; set; } public string ProtocolVersion { get; set; } public double DisconnectTimeout { get; set; } public bool TryWebSockets { get; set; } public double? KeepAliveTimeout { get; set; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Connection.cs0000644000175000017500000006517112204443213026636 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Net; using System.Reflection; using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Client.Http; using Microsoft.AspNet.SignalR.Client.Infrastructure; using Microsoft.AspNet.SignalR.Client.Transports; using Microsoft.AspNet.SignalR.Infrastructure; using Newtonsoft.Json; using Newtonsoft.Json.Linq; #if (NET4 || NET45) using System.Security.Cryptography.X509Certificates; #endif namespace Microsoft.AspNet.SignalR.Client { /// /// Provides client connections for SignalR services. /// [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable", Justification = "_disconnectCts is disposed on disconnect.")] public class Connection : IConnection { internal static readonly TimeSpan DefaultAbortTimeout = TimeSpan.FromSeconds(30); private static Version _assemblyVersion; private IClientTransport _transport; // Propagates notification that connection should be stopped. private CancellationTokenSource _disconnectCts; // The amount of time the client should attempt to reconnect before stopping. private TimeSpan _disconnectTimeout; // Provides a way to cancel the the timeout that stops a reconnect cycle private IDisposable _disconnectTimeoutOperation; // The default connection state is disconnected private ConnectionState _state; private KeepAliveData _keepAliveData; private Task _connectTask; private TextWriter _traceWriter; // Used to synchronize state changes private readonly object _stateLock = new object(); // Used to synchronize starting and stopping specifically private readonly object _startLock = new object(); // Used to ensure we don't write to the Trace TextWriter from multiple threads simultaneously private readonly object _traceLock = new object(); // Keeps track of when the last keep alive from the server was received private HeartbeatMonitor _monitor; //The json serializer for the connections private JsonSerializer _jsonSerializer = new JsonSerializer(); #if (NET4 || NET45) private readonly X509CertificateCollection certCollection = new X509CertificateCollection(); #endif /// /// Occurs when the has received data from the server. /// public event Action Received; /// /// Occurs when the has encountered an error. /// public event Action Error; /// /// Occurs when the is stopped. /// public event Action Closed; /// /// Occurs when the starts reconnecting after an error. /// public event Action Reconnecting; /// /// Occurs when the successfully reconnects after a timeout. /// public event Action Reconnected; /// /// Occurs when the state changes. /// public event Action StateChanged; /// /// Occurs when the is about to timeout /// public event Action ConnectionSlow; /// /// Initializes a new instance of the class. /// /// The url to connect to. public Connection(string url) : this(url, (string)null) { } /// /// Initializes a new instance of the class. /// /// The url to connect to. /// The query string data to pass to the server. public Connection(string url, IDictionary queryString) : this(url, CreateQueryString(queryString)) { } /// /// Initializes a new instance of the class. /// /// The url to connect to. /// The query string data to pass to the server. public Connection(string url, string queryString) { if (url == null) { throw new ArgumentNullException("url"); } if (url.Contains("?")) { throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, Resources.Error_UrlCantContainQueryStringDirectly), "url"); } if (!url.EndsWith("/", StringComparison.Ordinal)) { url += "/"; } Url = url; QueryString = queryString; _disconnectTimeoutOperation = DisposableAction.Empty; Items = new Dictionary(StringComparer.OrdinalIgnoreCase); State = ConnectionState.Disconnected; TraceLevel = TraceLevels.All; TraceWriter = new DebugTextWriter(); Headers = new HeaderDictionary(this); } /// /// Object to store the various keep alive timeout values /// KeepAliveData IConnection.KeepAliveData { get { return _keepAliveData; } set { _keepAliveData = value; } } public TraceLevels TraceLevel { get; set; } public TextWriter TraceWriter { get { return _traceWriter; } set { if (value == null) { throw new ArgumentNullException("value"); } _traceWriter = value; } } /// /// Gets or sets the serializer used by the connection /// public JsonSerializer JsonSerializer { get { return _jsonSerializer; } set { if (value == null) { throw new ArgumentNullException("value"); } _jsonSerializer = value; } } /// /// Gets or sets the cookies associated with the connection. /// public CookieContainer CookieContainer { get; set; } /// /// Gets or sets authentication information for the connection. /// public ICredentials Credentials { get; set; } /// /// Gets and sets headers for the requests /// public IDictionary Headers { get; private set; } #if !SILVERLIGHT /// /// Gets of sets proxy information for the connection. /// public IWebProxy Proxy { get; set; } #endif /// /// Gets the url for the connection. /// public string Url { get; private set; } /// /// Gets or sets the last message id for the connection. /// public string MessageId { get; set; } /// /// Gets or sets the connection id for the connection. /// public string ConnectionId { get; set; } /// /// Gets or sets the connection token for the connection. /// public string ConnectionToken { get; set; } /// /// Gets or sets the groups token for the connection. /// public string GroupsToken { get; set; } /// /// Gets a dictionary for storing state for a the connection. /// public IDictionary Items { get; private set; } /// /// Gets the querystring specified in the ctor. /// public string QueryString { get; private set; } public IClientTransport Transport { get { return _transport; } } /// /// Gets the current of the connection. /// public ConnectionState State { get { return _state; } private set { lock (_stateLock) { if (_state != value) { var stateChange = new StateChange(oldState: _state, newState: value); _state = value; if (StateChanged != null) { StateChanged(stateChange); } } } } } /// /// Starts the . /// /// A task that represents when the connection has started. public Task Start() { return Start(new DefaultHttpClient()); } /// /// Starts the . /// /// The http client /// A task that represents when the connection has started. [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "This is disposed on close")] public Task Start(IHttpClient httpClient) { // Pick the best transport supported by the client return Start(new AutoTransport(httpClient)); } /// /// Starts the . /// /// The transport to use. /// A task that represents when the connection has started. public Task Start(IClientTransport transport) { lock (_startLock) { _connectTask = TaskAsyncHelper.Empty; _disconnectCts = new CancellationTokenSource(); if (!ChangeState(ConnectionState.Disconnected, ConnectionState.Connecting)) { return _connectTask; } _monitor = new HeartbeatMonitor(this, _stateLock); _transport = transport; _connectTask = Negotiate(transport); } return _connectTask; } protected virtual string OnSending() { return null; } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is flowed back to the caller via the tcs.")] private Task Negotiate(IClientTransport transport) { return transport.Negotiate(this) .Then(negotiationResponse => { VerifyProtocolVersion(negotiationResponse.ProtocolVersion); ConnectionId = negotiationResponse.ConnectionId; ConnectionToken = negotiationResponse.ConnectionToken; _disconnectTimeout = TimeSpan.FromSeconds(negotiationResponse.DisconnectTimeout); // If we have a keep alive if (negotiationResponse.KeepAliveTimeout != null) { _keepAliveData = new KeepAliveData(TimeSpan.FromSeconds(negotiationResponse.KeepAliveTimeout.Value)); } var data = OnSending(); return StartTransport(data); }) .ContinueWithNotComplete(() => Disconnect()); } private Task StartTransport(string data) { return _transport.Start(this, data, _disconnectCts.Token) .RunSynchronously(() => { ChangeState(ConnectionState.Connecting, ConnectionState.Connected); if (_keepAliveData != null) { // Start the monitor to check for server activity _monitor.Start(); } }); } private bool ChangeState(ConnectionState oldState, ConnectionState newState) { return ((IConnection)this).ChangeState(oldState, newState); } bool IConnection.ChangeState(ConnectionState oldState, ConnectionState newState) { lock (_stateLock) { // If we're in the expected old state then change state and return true if (_state == oldState) { Trace(TraceLevels.StateChanges, "ChangeState({0}, {1})", oldState, newState); State = newState; return true; } } // Invalid transition return false; } private static void VerifyProtocolVersion(string versionString) { Version version; if (String.IsNullOrEmpty(versionString) || !TryParseVersion(versionString, out version) || !(version.Major == 1 && version.Minor == 2)) { throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, Resources.Error_IncompatibleProtocolVersion, "1.2", versionString ?? "null")); } } /// /// Stops the and sends an abort message to the server. /// public void Stop() { Stop(DefaultAbortTimeout); } /// /// Stops the and sends an abort message to the server. /// The timeout /// [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "We don't want to raise the Start exception on Stop.")] public void Stop(TimeSpan timeout) { lock (_startLock) { // Wait for the connection to connect if (_connectTask != null) { try { _connectTask.Wait(timeout); } catch (Exception ex) { Trace(TraceLevels.Events, "Error: {0}", ex.GetBaseException()); } } lock (_stateLock) { // Do nothing if the connection is offline if (State != ConnectionState.Disconnected) { string connectionId = ConnectionId; Trace(TraceLevels.Events, "Stop"); // Dispose the heart beat monitor so we don't fire notifications when waiting to abort _monitor.Dispose(); _transport.Abort(this, timeout); Disconnect(); _disconnectCts.Dispose(); if (_transport != null) { Trace(TraceLevels.Events, "Transport.Dispose({0})", connectionId); _transport.Dispose(); _transport = null; } } } } } /// /// Stops the without sending an abort message to the server. /// This function is called after we receive a disconnect message from the server. /// void IConnection.Disconnect() { Disconnect(); } private void Disconnect() { lock (_stateLock) { // Do nothing if the connection is offline if (State != ConnectionState.Disconnected) { // Change state before doing anything else in case something later in the method throws State = ConnectionState.Disconnected; Trace(TraceLevels.StateChanges, "Disconnect"); _disconnectTimeoutOperation.Dispose(); _disconnectCts.Cancel(); _monitor.Dispose(); Trace(TraceLevels.Events, "Closed"); // Clear the state for this connection ConnectionId = null; ConnectionToken = null; GroupsToken = null; MessageId = null; // TODO: Do we want to trigger Closed if we are connecting? if (Closed != null) { Closed(); } } } } /// /// Sends data asynchronously over the connection. /// /// The data to send. /// A task that represents when the data has been sent. public Task Send(string data) { if (State == ConnectionState.Disconnected) { throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, Resources.Error_StartMustBeCalledBeforeDataCanBeSent)); } if (State == ConnectionState.Connecting) { throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, Resources.Error_ConnectionHasNotBeenEstablished)); } return _transport.Send(this, data); } /// /// Sends an object that will be JSON serialized asynchronously over the connection. /// /// The value to serialize. /// A task that represents when the data has been sent. public Task Send(object value) { return Send(this.JsonSerializeObject(value)); } #if (NET4 || NET45) /// /// Adds a client certificate to the request /// /// Client Certificate public void AddClientCertificate(X509Certificate certificate) { lock (_stateLock) { if (State != ConnectionState.Disconnected) { throw new InvalidOperationException(Resources.Error_CertsCanOnlyBeAddedWhenDisconnected); } certCollection.Add(certificate); } } #endif public void Trace(TraceLevels level, string format, params object[] args) { lock (_traceLock) { if (TraceLevel.HasFlag(level)) { _traceWriter.WriteLine( DateTime.UtcNow.ToString("HH:mm:ss.fffffff", CultureInfo.InvariantCulture) + " - " + (ConnectionId ?? "null") + " - " + format, args); } } } [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "This is called by the transport layer")] void IConnection.OnReceived(JToken message) { OnMessageReceived(message); } [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "This is called by the transport layer")] protected virtual void OnMessageReceived(JToken message) { if (Received != null) { Received(message.ToString()); } } void IConnection.OnError(Exception error) { Trace(TraceLevels.Events, "OnError({0})", error); if (Error != null) { Error(error); } } void IConnection.OnReconnecting() { // Only allow the client to attempt to reconnect for a _disconnectTimout TimeSpan which is set by // the server during negotiation. // If the client tries to reconnect for longer the server will likely have deleted its ConnectionId // topic along with the contained disconnect message. _disconnectTimeoutOperation = SetTimeout(_disconnectTimeout, Disconnect); if (Reconnecting != null) { Reconnecting(); } } void IConnection.OnReconnected() { // Prevent the timeout set OnReconnecting from firing and stopping the connection if we have successfully // reconnected before the _disconnectTimeout delay. _disconnectTimeoutOperation.Dispose(); if (Reconnected != null) { Reconnected(); } ((IConnection)this).UpdateLastKeepAlive(); } void IConnection.OnConnectionSlow() { Trace(TraceLevels.Events, "OnConnectionSlow"); if (ConnectionSlow != null) { ConnectionSlow(); } } /// /// Sets LastKeepAlive to the current time /// void IConnection.UpdateLastKeepAlive() { if (_keepAliveData != null) { _keepAliveData.LastKeepAlive = DateTime.UtcNow; } } [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "This is called by the transport layer")] void IConnection.PrepareRequest(IRequest request) { #if WINDOWS_PHONE // http://msdn.microsoft.com/en-us/library/ff637320(VS.95).aspx request.UserAgent = CreateUserAgentString("SignalR.Client.WP7"); #else #if SILVERLIGHT // Useragent is not possible to set with Silverlight, not on the UserAgent property of the request nor in the Headers key/value in the request #else request.UserAgent = CreateUserAgentString("SignalR.Client"); #endif #endif if (Credentials != null) { request.Credentials = Credentials; } if (CookieContainer != null) { request.CookieContainer = CookieContainer; } #if !SILVERLIGHT if (Proxy != null) { request.Proxy = Proxy; } #endif request.SetRequestHeaders(Headers); #if (NET4 || NET45) && !MONO request.AddClientCerts(certCollection); #endif } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Can be called via other clients.")] private static string CreateUserAgentString(string client) { if (_assemblyVersion == null) { #if NETFX_CORE _assemblyVersion = new Version("1.1.0"); #else _assemblyVersion = new AssemblyName(typeof(Connection).Assembly.FullName).Version; #endif } #if NETFX_CORE return String.Format(CultureInfo.InvariantCulture, "{0}/{1} ({2})", client, _assemblyVersion, "Unknown OS"); #else return String.Format(CultureInfo.InvariantCulture, "{0}/{1} ({2})", client, _assemblyVersion, Environment.OSVersion); #endif } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The Version constructor can throw exceptions of many different types. Failure is indicated by returning false.")] private static bool TryParseVersion(string versionString, out Version version) { #if WINDOWS_PHONE || NET35 try { version = new Version(versionString); return true; } catch { version = null; return false; } #else return Version.TryParse(versionString, out version); #endif } private static string CreateQueryString(IDictionary queryString) { return String.Join("&", queryString.Select(kvp => kvp.Key + "=" + kvp.Value).ToArray()); } // TODO: Refactor into a helper class private static IDisposable SetTimeout(TimeSpan delay, Action operation) { var cancellableInvoker = new ThreadSafeInvoker(); TaskAsyncHelper.Delay(delay).Then(() => cancellableInvoker.Invoke(operation)); // Disposing this return value will cancel the operation if it has not already been invoked. return new DisposableAction(() => cancellableInvoker.Invoke()); } /// /// Default text writer /// private class DebugTextWriter : TextWriter { public DebugTextWriter() : base(CultureInfo.InvariantCulture) { } public override void WriteLine(string value) { Debug.WriteLine(value); } #if NETFX_CORE public override void Write(char value) { // This is wrong we don't call it Debug.WriteLine(value); } #endif public override Encoding Encoding { get { return Encoding.UTF8; } } } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/TraceLevels.cs0000644000175000017500000000037112204443213026737 0ustar00meebeymeebey00000000000000using System; namespace Microsoft.AspNet.SignalR.Client { [Flags] public enum TraceLevels { None = 0, Messages = 1, Events = 2, StateChanges = 4, All = Messages | Events | StateChanges } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/HeartBeatMonitor.cs0000644000175000017500000001140012204443213027730 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Threading; #if NETFX_CORE using Windows.System.Threading; #endif namespace Microsoft.AspNet.SignalR.Client { public class HeartbeatMonitor : IDisposable { #if !NETFX_CORE // Timer to determine when to notify the user and reconnect if required private Timer _timer; #else private ThreadPoolTimer _timer; #endif // Used to ensure that the Beat only executes when the connection is in the Connected state private readonly object _connectionStateLock; // Connection variable private readonly IConnection _connection; // To keep track of whether the user has been notified public bool HasBeenWarned { get; private set; } // To keep track of whether the client is already reconnecting public bool TimedOut { get; private set; } /// /// Initializes a new instance of the HeartBeatMonitor Class /// /// /// public HeartbeatMonitor(IConnection connection, object connectionStateLock) { _connection = connection; _connectionStateLock = connectionStateLock; } /// /// Updates LastKeepAlive and starts the timer /// public void Start() { _connection.UpdateLastKeepAlive(); HasBeenWarned = false; TimedOut = false; #if !NETFX_CORE _timer = new Timer(_ => Beat(), state: null, dueTime: _connection.KeepAliveData.CheckInterval, period: _connection.KeepAliveData.CheckInterval); #else _timer = ThreadPoolTimer.CreatePeriodicTimer((timer) => Beat(), period: _connection.KeepAliveData.CheckInterval); #endif } /// /// Callback function for the timer which determines if we need to notify the user or attempt to reconnect /// #if NETFX_CORE [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Timer is not implemented on WinRT")] #endif private void Beat() { TimeSpan timeElapsed = DateTime.UtcNow - _connection.KeepAliveData.LastKeepAlive; Beat(timeElapsed); } /// /// Logic to determine if we need to notify the user or attempt to reconnect /// /// public void Beat(TimeSpan timeElapsed) { lock (_connectionStateLock) { if (_connection.State == ConnectionState.Connected) { if (timeElapsed >= _connection.KeepAliveData.Timeout) { if (!TimedOut) { // Connection has been lost _connection.Trace(TraceLevels.Events, "Connection Timed-out : Transport Lost Connection"); TimedOut = true; _connection.Transport.LostConnection(_connection); } } else if (timeElapsed >= _connection.KeepAliveData.TimeoutWarning) { if (!HasBeenWarned) { // Inform user and set HasBeenWarned to true _connection.Trace(TraceLevels.Events, "Connection Timeout Warning : Notifying user"); HasBeenWarned = true; _connection.OnConnectionSlow(); } } else { HasBeenWarned = false; TimedOut = false; } } } } /// /// Dispose off the timer /// public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } /// /// Dispose off the timer /// /// protected virtual void Dispose(bool disposing) { if (disposing) { if (_timer != null) { #if !NETFX_CORE _timer.Dispose(); _timer = null; #else _timer.Cancel(); _timer = null; #endif } } } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Hubs/0000755000175000017500000000000012311344240025076 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Hubs/Hubservable.cs0000644000175000017500000000215512204443213027673 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using Newtonsoft.Json.Linq; using Microsoft.AspNet.SignalR.Client.Infrastructure; using Microsoft.AspNet.SignalR.Infrastructure; using System.Collections.Generic; namespace Microsoft.AspNet.SignalR.Client.Hubs { /// /// implementation of a hub event. /// public class Hubservable : IObservable> { private readonly string _eventName; private readonly IHubProxy _proxy; public Hubservable(IHubProxy proxy, string eventName) { _proxy = proxy; _eventName = eventName; } public IDisposable Subscribe(IObserver> observer) { var subscription = _proxy.Subscribe(_eventName); subscription.Received += observer.OnNext; return new DisposableAction(() => { subscription.Received -= observer.OnNext; }); } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Hubs/IHubConnection.cs0000644000175000017500000000050512204443213030275 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; namespace Microsoft.AspNet.SignalR.Client.Hubs { public interface IHubConnection : IConnection { string RegisterCallback(Action callback); } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Hubs/IHubProxy.cs0000644000175000017500000000355512204443213027327 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System.Threading.Tasks; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Microsoft.AspNet.SignalR.Client.Hubs { /// /// A client side proxy for a server side hub. /// public interface IHubProxy { /// /// Gets or sets state on the hub. /// /// The name of the field. /// The value of the field JToken this[string name] { get; set; } /// /// Executes a method on the server side hub asynchronously. /// /// The name of the method. /// The arguments /// A task that represents when invocation returned. Task Invoke(string method, params object[] args); /// /// Executes a method on the server side hub asynchronously. /// /// The type of result returned from the hub /// The name of the method. /// The arguments /// A task that represents when invocation returned. Task Invoke(string method, params object[] args); /// /// Registers an event for the hub. /// /// The name of the event /// A . Subscription Subscribe(string eventName); /// /// Gets the serializer used by the connection. /// JsonSerializer JsonSerializer { get; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Hubs/HubProxy.cs0000644000175000017500000001277712204443213027224 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Client; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Microsoft.AspNet.SignalR.Client.Hubs { public class HubProxy : IHubProxy { private readonly string _hubName; private readonly IHubConnection _connection; private readonly Dictionary _state = new Dictionary(StringComparer.OrdinalIgnoreCase); private readonly Dictionary _subscriptions = new Dictionary(StringComparer.OrdinalIgnoreCase); public HubProxy(IHubConnection connection, string hubName) { _connection = connection; _hubName = hubName; } public JToken this[string name] { get { lock (_state) { JToken value; _state.TryGetValue(name, out value); return value; } } set { lock (_state) { _state[name] = value; } } } public JsonSerializer JsonSerializer { get { return _connection.JsonSerializer; } } public Subscription Subscribe(string eventName) { if (eventName == null) { throw new ArgumentNullException("eventName"); } Subscription subscription; if (!_subscriptions.TryGetValue(eventName, out subscription)) { subscription = new Subscription(); _subscriptions.Add(eventName, subscription); } return subscription; } public Task Invoke(string method, params object[] args) { return Invoke(method, args); } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flown to the caller")] public Task Invoke(string method, params object[] args) { if (method == null) { throw new ArgumentNullException("method"); } if (args == null) { throw new ArgumentNullException("args"); } var tokenifiedArguments = new JToken[args.Length]; for (int i = 0; i < tokenifiedArguments.Length; i++) { tokenifiedArguments[i] = JToken.FromObject(args[i], JsonSerializer); } var tcs = new TaskCompletionSource(); var callbackId = _connection.RegisterCallback(result => { if (result != null) { if (result.Error != null) { tcs.TrySetUnwrappedException(new InvalidOperationException(result.Error)); } else { try { if (result.State != null) { foreach (var pair in result.State) { this[pair.Key] = pair.Value; } } if (result.Result != null) { tcs.TrySetResult(result.Result.ToObject(JsonSerializer)); } else { tcs.TrySetResult(default(T)); } } catch (Exception ex) { // If we failed to set the result for some reason or to update // state then just fail the tcs. tcs.TrySetUnwrappedException(ex); } } } else { tcs.TrySetCanceled(); } }); var hubData = new HubInvocation { Hub = _hubName, Method = method, Args = tokenifiedArguments, CallbackId = callbackId }; if (_state.Count != 0) { hubData.State = _state; } var value = _connection.JsonSerializeObject(hubData); _connection.Send(value).ContinueWith(task => { if (task.IsCanceled) { tcs.TrySetCanceled(); } else if (task.IsFaulted) { tcs.TrySetUnwrappedException(task.Exception); } }, TaskContinuationOptions.NotOnRanToCompletion); return tcs.Task; } public void InvokeEvent(string eventName, IList args) { Subscription subscription; if (_subscriptions.TryGetValue(eventName, out subscription)) { subscription.OnReceived(args); } } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Hubs/HubProxyExtensions.cs0000644000175000017500000003417512204443213031300 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections.Generic; using Microsoft.AspNet.SignalR.Client.Infrastructure; using Microsoft.AspNet.SignalR.Infrastructure; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Microsoft.AspNet.SignalR.Client.Hubs { /// /// Extensions to the . /// public static class HubProxyExtensions { /// /// Gets the value of a state variable. /// /// The type of the state variable /// The . /// The name of the state variable. /// The value of the state variable. public static T GetValue(this IHubProxy proxy, string name) { if (proxy == null) { throw new ArgumentNullException("proxy"); } if (String.IsNullOrEmpty(name)) { throw new ArgumentNullException("name"); } return Convert(proxy[name], proxy.JsonSerializer); } /// /// Registers for an event with the specified name and callback /// /// The . /// The name of the event. /// The callback /// An that represents this subscription. public static IDisposable On(this IHubProxy proxy, string eventName, Action onData) { if (proxy == null) { throw new ArgumentNullException("proxy"); } if (String.IsNullOrEmpty(eventName)) { throw new ArgumentNullException("eventName"); } if (onData == null) { throw new ArgumentNullException("onData"); } Subscription subscription = proxy.Subscribe(eventName); Action> handler = args => { onData(); }; subscription.Received += handler; return new DisposableAction(() => subscription.Received -= handler); } /// /// Registers for an event with the specified name and callback /// /// The . /// The name of the event. /// The callback /// An that represents this subscription. public static IDisposable On(this IHubProxy proxy, string eventName, Action onData) { if (proxy == null) { throw new ArgumentNullException("proxy"); } if (String.IsNullOrEmpty(eventName)) { throw new ArgumentNullException("eventName"); } if (onData == null) { throw new ArgumentNullException("onData"); } Subscription subscription = proxy.Subscribe(eventName); Action> handler = args => { onData(Convert(args[0], proxy.JsonSerializer)); }; subscription.Received += handler; return new DisposableAction(() => subscription.Received -= handler); } /// /// Registers for an event with the specified name and callback /// /// The . /// The name of the event. /// The callback /// An that represents this subscription. public static IDisposable On(this IHubProxy proxy, string eventName, Action onData) { if (proxy == null) { throw new ArgumentNullException("proxy"); } if (String.IsNullOrEmpty(eventName)) { throw new ArgumentNullException("eventName"); } if (onData == null) { throw new ArgumentNullException("onData"); } Subscription subscription = proxy.Subscribe(eventName); Action> handler = args => { onData(Convert(args[0], proxy.JsonSerializer), Convert(args[1], proxy.JsonSerializer)); }; subscription.Received += handler; return new DisposableAction(() => subscription.Received -= handler); } /// /// Registers for an event with the specified name and callback /// /// The . /// The name of the event. /// The callback /// An that represents this subscription. public static IDisposable On(this IHubProxy proxy, string eventName, Action onData) { if (proxy == null) { throw new ArgumentNullException("proxy"); } if (String.IsNullOrEmpty(eventName)) { throw new ArgumentNullException("eventName"); } if (onData == null) { throw new ArgumentNullException("onData"); } Subscription subscription = proxy.Subscribe(eventName); Action> handler = args => { onData(Convert(args[0], proxy.JsonSerializer), Convert(args[1], proxy.JsonSerializer), Convert(args[2], proxy.JsonSerializer)); }; subscription.Received += handler; return new DisposableAction(() => subscription.Received -= handler); } /// /// Registers for an event with the specified name and callback /// /// The . /// The name of the event. /// The callback /// An that represents this subscription. public static IDisposable On(this IHubProxy proxy, string eventName, Action onData) { if (proxy == null) { throw new ArgumentNullException("proxy"); } if (String.IsNullOrEmpty(eventName)) { throw new ArgumentNullException("eventName"); } if (onData == null) { throw new ArgumentNullException("onData"); } Subscription subscription = proxy.Subscribe(eventName); Action> handler = args => { onData(Convert(args[0], proxy.JsonSerializer), Convert(args[1], proxy.JsonSerializer), Convert(args[2], proxy.JsonSerializer), Convert(args[3], proxy.JsonSerializer)); }; subscription.Received += handler; return new DisposableAction(() => subscription.Received -= handler); } #if !WINDOWS_PHONE && !SILVERLIGHT && !NET35 /// /// Registers for an event with the specified name and callback /// /// The . /// The name of the event. /// The callback /// An that represents this subscription. public static IDisposable On(this IHubProxy proxy, string eventName, Action onData) { return On(proxy, eventName, onData); } /// /// Registers for an event with the specified name and callback /// /// The . /// The name of the event. /// The callback /// An that represents this subscription. public static IDisposable On(this IHubProxy proxy, string eventName, Action onData) { if (proxy == null) { throw new ArgumentNullException("proxy"); } if (String.IsNullOrEmpty(eventName)) { throw new ArgumentNullException("eventName"); } if (onData == null) { throw new ArgumentNullException("onData"); } Subscription subscription = proxy.Subscribe(eventName); Action> handler = args => { onData(Convert(args[0], proxy.JsonSerializer), Convert(args[1], proxy.JsonSerializer), Convert(args[2], proxy.JsonSerializer), Convert(args[3], proxy.JsonSerializer), Convert(args[4], proxy.JsonSerializer)); }; subscription.Received += handler; return new DisposableAction(() => subscription.Received -= handler); } /// /// Registers for an event with the specified name and callback /// /// The . /// The name of the event. /// The callback /// An that represents this subscription. public static IDisposable On(this IHubProxy proxy, string eventName, Action onData) { if (proxy == null) { throw new ArgumentNullException("proxy"); } if (String.IsNullOrEmpty(eventName)) { throw new ArgumentNullException("eventName"); } if (onData == null) { throw new ArgumentNullException("onData"); } Subscription subscription = proxy.Subscribe(eventName); Action> handler = args => { onData(Convert(args[0], proxy.JsonSerializer), Convert(args[1], proxy.JsonSerializer), Convert(args[2], proxy.JsonSerializer), Convert(args[3], proxy.JsonSerializer), Convert(args[4], proxy.JsonSerializer), Convert(args[5], proxy.JsonSerializer)); }; subscription.Received += handler; return new DisposableAction(() => subscription.Received -= handler); } /// /// Registers for an event with the specified name and callback /// /// The . /// The name of the event. /// The callback /// An that represents this subscription. public static IDisposable On(this IHubProxy proxy, string eventName, Action onData) { if (proxy == null) { throw new ArgumentNullException("proxy"); } if (String.IsNullOrEmpty(eventName)) { throw new ArgumentNullException("eventName"); } if (onData == null) { throw new ArgumentNullException("onData"); } Subscription subscription = proxy.Subscribe(eventName); Action> handler = args => { onData(Convert(args[0], proxy.JsonSerializer), Convert(args[1], proxy.JsonSerializer), Convert(args[2], proxy.JsonSerializer), Convert(args[3], proxy.JsonSerializer), Convert(args[4], proxy.JsonSerializer), Convert(args[5], proxy.JsonSerializer), Convert(args[6], proxy.JsonSerializer)); }; subscription.Received += handler; return new DisposableAction(() => subscription.Received -= handler); } /// /// Registers a event has an . /// /// The /// The name of the event. /// An . public static IObservable> Observe(this IHubProxy proxy, string eventName) { if (proxy == null) { throw new ArgumentNullException("proxy"); } if (String.IsNullOrEmpty(eventName)) { throw new ArgumentNullException("eventName"); } return new Hubservable(proxy, eventName); } #endif private static T Convert(JToken obj, JsonSerializer serializer) { if (obj == null) { return default(T); } return obj.ToObject(serializer); } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Hubs/HubResult.cs0000644000175000017500000000235012204443213027343 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Microsoft.AspNet.SignalR.Client.Hubs { /// /// Represents the result of a hub invocation. /// public class HubResult { /// /// The callback identifier /// [JsonProperty("I")] public string Id { get; set; } /// /// The return value of the hub /// [JsonProperty("R")] public JToken Result { get; set; } /// /// The error message returned from the hub invocation. /// [JsonProperty("E")] public string Error { get; set; } /// /// The caller state from this hub. /// [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Type is used for serialization.")] [JsonProperty("S")] public IDictionary State { get; set; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Hubs/HubRegistrationData.cs0000644000175000017500000000042512204443213031332 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. namespace Microsoft.AspNet.SignalR.Client.Hubs { public class HubRegistrationData { public string Name { get; set; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Hubs/HubConnection.cs0000644000175000017500000001540112204443213030165 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Microsoft.AspNet.SignalR.Client.Hubs { /// /// A for interacting with Hubs. /// public class HubConnection : Connection, IHubConnection { private readonly Dictionary _hubs = new Dictionary(StringComparer.OrdinalIgnoreCase); private readonly Dictionary> _callbacks = new Dictionary>(); private int _callbackId; /// /// Initializes a new instance of the class. /// /// The url to connect to. public HubConnection(string url) : this(url, useDefaultUrl: true) { } /// /// Initializes a new instance of the class. /// /// The url to connect to. /// Determines if the default "/signalr" path should be appended to the specified url. public HubConnection(string url, bool useDefaultUrl) : base(GetUrl(url, useDefaultUrl)) { } /// /// Initializes a new instance of the class. /// /// The url to connect to. /// The query string data to pass to the server. public HubConnection(string url, string queryString) : this(url, queryString, useDefaultUrl: true) { } /// /// Initializes a new instance of the class. /// /// The url to connect to. /// The query string data to pass to the server. /// Determines if the default "/signalr" path should be appended to the specified url. public HubConnection(string url, string queryString, bool useDefaultUrl) : base(GetUrl(url, useDefaultUrl), queryString) { } /// /// Initializes a new instance of the class. /// /// The url to connect to. /// The query string data to pass to the server. public HubConnection(string url, IDictionary queryString) : this(url, queryString, useDefaultUrl: true) { } /// /// Initializes a new instance of the class. /// /// The url to connect to. /// The query string data to pass to the server. /// Determines if the default "/signalr" path should be appended to the specified url. public HubConnection(string url, IDictionary queryString, bool useDefaultUrl) : base(GetUrl(url, useDefaultUrl), queryString) { } [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "")] protected override void OnMessageReceived(JToken message) { if (message["I"] != null) { var result = message.ToObject(JsonSerializer); Action callback; lock (_callbacks) { if (_callbacks.TryGetValue(result.Id, out callback)) { _callbacks.Remove(result.Id); } else { Debug.Assert(false, "Callback with id " + result.Id + " not found!"); } } if (callback != null) { callback(result); } } else { var invocation = message.ToObject(JsonSerializer); HubProxy hubProxy; if (_hubs.TryGetValue(invocation.Hub, out hubProxy)) { if (invocation.State != null) { foreach (var state in invocation.State) { hubProxy[state.Key] = state.Value; } } hubProxy.InvokeEvent(invocation.Method, invocation.Args); } base.OnMessageReceived(message); } } protected override string OnSending() { var data = _hubs.Select(p => new HubRegistrationData { Name = p.Key }); return this.JsonSerializeObject(data); } /// /// Creates an for the hub with the specified name. /// /// The name of the hub. /// A public IHubProxy CreateHubProxy(string hubName) { if (State != ConnectionState.Disconnected) { throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, Resources.Error_ProxiesCannotBeAddedConnectionStarted)); } HubProxy hubProxy; if (!_hubs.TryGetValue(hubName, out hubProxy)) { hubProxy = new HubProxy(this, hubName); _hubs[hubName] = hubProxy; } return hubProxy; } public string RegisterCallback(Action callback) { lock (_callbacks) { string id = _callbackId.ToString(CultureInfo.InvariantCulture); _callbacks[id] = callback; _callbackId++; return id; } } private static string GetUrl(string url, bool useDefaultUrl) { if (!url.EndsWith("/", StringComparison.Ordinal)) { url += "/"; } if (useDefaultUrl) { return url + "signalr"; } return url; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Hubs/Subscription.cs0000644000175000017500000000115012204443213030107 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections.Generic; using Newtonsoft.Json.Linq; namespace Microsoft.AspNet.SignalR.Client.Hubs { /// /// Represents a subscription to a hub method. /// public class Subscription { public event Action> Received; internal void OnReceived(IList data) { if (Received != null) { Received(data); } } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Hubs/HubInvocation.cs0000644000175000017500000000206312204443213030177 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Microsoft.AspNet.SignalR.Client.Hubs { public class HubInvocation { [JsonProperty("I")] public string CallbackId { get; set; } [JsonProperty("H")] public string Hub { get; set; } [JsonProperty("M")] public string Method { get; set; } [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "This type is used for serialization")] [JsonProperty("A")] public JToken[] Args { get; set; } [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "This type is used for serialization")] [JsonProperty("S", NullValueHandling = NullValueHandling.Ignore)] public Dictionary State { get; set; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/ConnectionExtensions.cs0000644000175000017500000000720112204443213030704 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Text; using Newtonsoft.Json; namespace Microsoft.AspNet.SignalR.Client { public static class ConnectionExtensions { public static T GetValue(this IConnection connection, string key) { if (connection == null) { throw new ArgumentNullException("connection"); } if (String.IsNullOrEmpty(key)) { throw new ArgumentNullException("key"); } lock (connection.Items) { object value; if (connection.Items.TryGetValue(key, out value)) { return (T)value; } } return default(T); } [SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "jsonWriter will not dispose the stringWriter")] public static string JsonSerializeObject(this IConnection connection, object value) { if (connection == null) { throw new ArgumentNullException("connection"); } var sb = new StringBuilder(0x100); using (var stringWriter = new StringWriter(sb, CultureInfo.InvariantCulture)) { using (var jsonWriter = new JsonTextWriter(stringWriter) { CloseOutput = false }) { jsonWriter.Formatting = connection.JsonSerializer.Formatting; connection.JsonSerializer.Serialize(jsonWriter, value); } return stringWriter.ToString(); } } [SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "jsonTextReader will not dispose the stringReader")] public static T JsonDeserializeObject(this IConnection connection, string jsonValue) { if (connection == null) { throw new ArgumentNullException("connection"); } using (var stringReader = new StringReader(jsonValue)) { using (var jsonTextReader = new JsonTextReader(stringReader) { CloseInput = false }) { return (T)connection.JsonSerializer.Deserialize(jsonTextReader, typeof(T)); } } } public static bool EnsureReconnecting(this IConnection connection) { if (connection == null) { throw new ArgumentNullException("connection"); } if (connection.ChangeState(ConnectionState.Connected, ConnectionState.Reconnecting)) { connection.OnReconnecting(); } return connection.State == ConnectionState.Reconnecting; } #if !WINDOWS_PHONE && !SILVERLIGHT && !NET35 public static IObservable AsObservable(this Connection connection) { return connection.AsObservable(value => value); } public static IObservable AsObservable(this Connection connection) { return connection.AsObservable(value => connection.JsonDeserializeObject(value)); } public static IObservable AsObservable(this Connection connection, Func selector) { return new ObservableConnection(connection, selector); } #endif } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/KeepAliveData.cs0000644000175000017500000000306312204443213027166 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; namespace Microsoft.AspNet.SignalR.Client { /// /// Class to store all the Keep Alive properties /// public class KeepAliveData { // Determines when we warn the developer that the connection may be lost private const double _keepAliveWarnAt = 2.0 / 3.0; public DateTime LastKeepAlive { get; set; } // Timeout to designate when to force the connection into reconnecting public TimeSpan Timeout { get; private set; } // Timeout to designate when to warn the developer that the connection may be dead or is hanging. public TimeSpan TimeoutWarning { get; private set; } // Frequency with which we check the keep alive. It must be short in order to not miss/pick up any changes public TimeSpan CheckInterval { get; private set; } public KeepAliveData(TimeSpan timeout) { Timeout = timeout; TimeoutWarning = TimeSpan.FromTicks((long)(Timeout.Ticks * _keepAliveWarnAt)); CheckInterval = TimeSpan.FromTicks((Timeout.Ticks - TimeoutWarning.Ticks) / 3); } public KeepAliveData(DateTime lastKeepAlive, TimeSpan timeout, TimeSpan timeoutWarning, TimeSpan checkInterval) { LastKeepAlive = lastKeepAlive; Timeout = timeout; TimeoutWarning = timeoutWarning; CheckInterval = checkInterval; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Resources.Designer.cs0000644000175000017500000001460412204443213030243 0ustar00meebeymeebey00000000000000//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.18033 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace Microsoft.AspNet.SignalR.Client { using System; using System.Reflection; /// /// A strongly-typed resource class, for looking up localized strings, etc. /// // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { #if NETFX_CORE var assembly = typeof(Resources).GetTypeInfo().Assembly; #else var assembly = typeof(Resources).Assembly; #endif global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.AspNet.SignalR.Client.Resources", assembly); resourceMan = temp; } return resourceMan; } } /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// /// Looks up a localized string similar to Client Certificates cannot be added after the connection has started.. /// internal static string Error_CertsCanOnlyBeAddedWhenDisconnected { get { return ResourceManager.GetString("Error_CertsCanOnlyBeAddedWhenDisconnected", resourceCulture); } } /// /// Looks up a localized string similar to The connection was stopped before it could be started.. /// internal static string Error_ConnectionCancelled { get { return ResourceManager.GetString("Error_ConnectionCancelled", resourceCulture); } } /// /// Looks up a localized string similar to The connection has not been established.. /// internal static string Error_ConnectionHasNotBeenEstablished { get { return ResourceManager.GetString("Error_ConnectionHasNotBeenEstablished", resourceCulture); } } /// /// Looks up a localized string similar to Request headers cannot be set after the connection has started.. /// internal static string Error_HeadersCanOnlyBeSetWhenDisconnected { get { return ResourceManager.GetString("Error_HeadersCanOnlyBeSetWhenDisconnected", resourceCulture); } } /// /// Looks up a localized string similar to You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.. /// internal static string Error_IncompatibleProtocolVersion { get { return ResourceManager.GetString("Error_IncompatibleProtocolVersion", resourceCulture); } } /// /// Looks up a localized string similar to A HubProxy cannot be added after the connection has been started.. /// internal static string Error_ProxiesCannotBeAddedConnectionStarted { get { return ResourceManager.GetString("Error_ProxiesCannotBeAddedConnectionStarted", resourceCulture); } } /// /// Looks up a localized string similar to Server negotiation failed.. /// internal static string Error_ServerNegotiationFailed { get { return ResourceManager.GetString("Error_ServerNegotiationFailed", resourceCulture); } } /// /// Looks up a localized string similar to The Start method must be called before data can be sent.. /// internal static string Error_StartMustBeCalledBeforeDataCanBeSent { get { return ResourceManager.GetString("Error_StartMustBeCalledBeforeDataCanBeSent", resourceCulture); } } /// /// Looks up a localized string similar to Url cannot contain query string directly. Pass query string values in using available overload.. /// internal static string Error_UrlCantContainQueryStringDirectly { get { return ResourceManager.GetString("Error_UrlCantContainQueryStringDirectly", resourceCulture); } } } } smuxi-0.11/lib/SignalR/src/Common/0000755000175000017500000000000012311344240017514 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Common/CommonVersionInfo.cs0000644000175000017500000000044112204443213023455 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System.Reflection; [assembly: AssemblyVersion("1.1.0")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.2")] smuxi-0.11/lib/SignalR/src/Common/CommonAssemblyInfo.cs0000644000175000017500000000143312204443213023611 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Reflection; using System.Resources; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyCompany("Microsoft Open Technologies, Inc.")] [assembly: AssemblyCopyright("© Microsoft Open Technologies, Inc. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyConfiguration("")] [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: NeutralResourcesLanguage("en-US")]smuxi-0.11/lib/SignalR/src/Common/Microsoft.AspNet.SignalR.targets0000644000175000017500000000334212204443213025606 0ustar00meebeymeebey00000000000000 $(ArtifactsDir)\$(MSBuildProjectName) $(ArtifactsDir)\$(MSBuildProjectName)\bin $(MSBuildThisFileDirectory)Microsoft.AspNet.SignalR.ruleset false 1591 true $(DefineConstants);CODE_ANALYSIS 11.0 $(DefineConstants);MONO $(DefineConstants);SIGNED true true $(KeyFile) GlobalSuppressions.cs smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Core/0000755000175000017500000000000012311344240023647 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Core/TaskAsyncHelper.cs0000644000175000017500000012311412204443213027241 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Reflection; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Infrastructure; namespace Microsoft.AspNet.SignalR { internal static class TaskAsyncHelper { private static readonly Task _emptyTask = MakeTask(null); private static readonly Task _trueTask = MakeTask(true); private static readonly Task _falseTask = MakeTask(false); private static Task MakeTask(T value) { return FromResult(value); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Empty { get { return _emptyTask; } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task True { get { return _trueTask; } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task False { get { return _falseTask; } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task OrEmpty(this Task task) { return task ?? Empty; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task OrEmpty(this Task task) { return task ?? TaskCache.Empty; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromAsync(Func beginMethod, Action endMethod, object state) { try { return Task.Factory.FromAsync(beginMethod, endMethod, state); } catch (Exception ex) { return TaskAsyncHelper.FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromAsync(Func beginMethod, Func endMethod, object state) { try { return Task.Factory.FromAsync(beginMethod, endMethod, state); } catch (Exception ex) { return TaskAsyncHelper.FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Series(Func[] tasks, object[] state) { Task prev = TaskAsyncHelper.Empty; Task finalTask = TaskAsyncHelper.Empty; for (int i = 0; i < tasks.Length; i++) { prev = finalTask; finalTask = prev.Then(tasks[i], state[i]); } return finalTask; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static TTask Catch(this TTask task) where TTask : Task { return Catch(task, ex => { }); } #if PERFCOUNTERS public static TTask Catch(this TTask task, params IPerformanceCounter[] counters) where TTask : Task { return Catch(task, _ => { if (counters == null) { return; } for (var i = 0; i < counters.Length; i++) { counters[i].Increment(); } }); } #endif [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static TTask Catch(this TTask task, Action handler, object state) where TTask : Task { if (task != null && task.Status != TaskStatus.RanToCompletion) { if (task.Status == TaskStatus.Faulted) { ExecuteOnFaulted(handler, state, task.Exception); } else { AttachFaultedContinuation(task, handler, state); } } return task; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] private static void AttachFaultedContinuation(TTask task, Action handler, object state) where TTask : Task { task.ContinueWith(innerTask => { ExecuteOnFaulted(handler, state, innerTask.Exception); }, TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] private static void ExecuteOnFaulted(Action handler, object state, AggregateException exception) { // observe Exception #if !WINDOWS_PHONE && !SILVERLIGHT && !NETFX_CORE Trace.TraceError("SignalR exception thrown by Task: {0}", exception); #endif handler(exception, state); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static TTask Catch(this TTask task, Action handler) where TTask : Task { return task.Catch((ex, state) => ((Action)state).Invoke(ex), handler); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task ContinueWithNotComplete(this Task task, Action action) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: try { action(); return task; } catch (Exception e) { return FromError(e); } case TaskStatus.RanToCompletion: return task; default: var tcs = new TaskCompletionSource(); task.ContinueWith(t => { if (t.IsFaulted || t.IsCanceled) { try { action(); if (t.IsFaulted) { tcs.TrySetUnwrappedException(t.Exception); } else { tcs.TrySetCanceled(); } } catch (Exception e) { tcs.TrySetException(e); } } else { tcs.TrySetResult(null); } }, TaskContinuationOptions.ExecuteSynchronously); return tcs.Task; } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static void ContinueWithNotComplete(this Task task, TaskCompletionSource tcs) { task.ContinueWith(t => { if (t.IsFaulted) { tcs.SetUnwrappedException(t.Exception); } else if (t.IsCanceled) { tcs.SetCanceled(); } }, TaskContinuationOptions.NotOnRanToCompletion); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static void ContinueWith(this Task task, TaskCompletionSource tcs) { task.ContinueWith(t => { if (t.IsFaulted) { tcs.TrySetUnwrappedException(t.Exception); } else if (t.IsCanceled) { tcs.TrySetCanceled(); } else { tcs.TrySetResult(null); } }, TaskContinuationOptions.ExecuteSynchronously); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static void ContinueWith(this Task task, TaskCompletionSource tcs) { task.ContinueWith(t => { if (t.IsFaulted) { tcs.TrySetUnwrappedException(t.Exception); } else if (t.IsCanceled) { tcs.TrySetCanceled(); } else { tcs.TrySetResult(t.Result); } }); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Return(this Task[] tasks) { return Then(tasks, () => { }); } // Then extesions [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Action successor) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor); default: return RunTask(task, successor); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor) { switch (task.Status) { case TaskStatus.Faulted: return FromError(task.Exception); case TaskStatus.Canceled: return Canceled(); case TaskStatus.RanToCompletion: return FromMethod(successor); default: return TaskRunners.RunTask(task, successor); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task[] tasks, Action successor) { if (tasks.Length == 0) { return FromMethod(successor); } var tcs = new TaskCompletionSource(); Task.Factory.ContinueWhenAll(tasks, completedTasks => { var faulted = completedTasks.FirstOrDefault(t => t.IsFaulted); if (faulted != null) { tcs.SetUnwrappedException(faulted.Exception); return; } var cancelled = completedTasks.FirstOrDefault(t => t.IsCanceled); if (cancelled != null) { tcs.SetCanceled(); return; } successor(); tcs.SetResult(null); }); return tcs.Task; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Action successor, T1 arg1) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, arg1); default: return GenericDelegates.ThenWithArgs(task, successor, arg1); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Action successor, T1 arg1, T2 arg2) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, arg1, arg2); default: return GenericDelegates.ThenWithArgs(task, successor, arg1, arg2); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor, T1 arg1) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, arg1); default: return GenericDelegates.ThenWithArgs(task, successor, arg1) .FastUnwrap(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor, T1 arg1, T2 arg2) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, arg1, arg2); default: return GenericDelegates.ThenWithArgs(task, successor, arg1, arg2) .FastUnwrap(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func> successor) { switch (task.Status) { case TaskStatus.Faulted: return FromError(task.Exception); case TaskStatus.Canceled: return Canceled(); case TaskStatus.RanToCompletion: return FromMethod(successor, task.Result); default: return TaskRunners>.RunTask(task, t => successor(t.Result)) .FastUnwrap(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor) { switch (task.Status) { case TaskStatus.Faulted: return FromError(task.Exception); case TaskStatus.Canceled: return Canceled(); case TaskStatus.RanToCompletion: return FromMethod(successor, task.Result); default: return TaskRunners.RunTask(task, t => successor(t.Result)); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor, T1 arg1) { switch (task.Status) { case TaskStatus.Faulted: return FromError(task.Exception); case TaskStatus.Canceled: return Canceled(); case TaskStatus.RanToCompletion: return FromMethod(successor, task.Result, arg1); default: return GenericDelegates.ThenWithArgs(task, successor, arg1); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor); default: return TaskRunners.RunTask(task, successor) .FastUnwrap(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func> successor) { switch (task.Status) { case TaskStatus.Faulted: return FromError(task.Exception); case TaskStatus.Canceled: return Canceled(); case TaskStatus.RanToCompletion: return FromMethod(successor); default: return TaskRunners>.RunTask(task, successor) .FastUnwrap(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Action successor) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, task.Result); default: return TaskRunners.RunTask(task, successor); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func successor) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, task.Result); default: return TaskRunners.RunTask(task, t => successor(t.Result)) .FastUnwrap(); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Then(this Task task, Func, T1, Task> successor, T1 arg1) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor, task, arg1); default: return GenericDelegates, T1, object>.ThenWithArgs(task, successor, arg1) .FastUnwrap(); } } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are flowed to the caller")] [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Finally(this Task task, Action next, object state) { try { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: next(state); return task; case TaskStatus.RanToCompletion: return FromMethod(next, state); default: return RunTaskSynchronously(task, next, state, onlyOnSuccess: false); } } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task RunSynchronously(this Task task, Action successor) { switch (task.Status) { case TaskStatus.Faulted: case TaskStatus.Canceled: return task; case TaskStatus.RanToCompletion: return FromMethod(successor); default: return RunTaskSynchronously(task, state => ((Action)state).Invoke(), successor); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task FastUnwrap(this Task task) { var innerTask = (task.Status == TaskStatus.RanToCompletion) ? task.Result : null; return innerTask ?? task.Unwrap(); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task FastUnwrap(this Task> task) { var innerTask = (task.Status == TaskStatus.RanToCompletion) ? task.Result : null; return innerTask ?? task.Unwrap(); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task Delay(TimeSpan timeOut) { #if NETFX_CORE return Task.Delay(timeOut); #else var tcs = new TaskCompletionSource(); var timer = new Timer(tcs.SetResult, null, timeOut, TimeSpan.FromMilliseconds(-1)); return tcs.Task.ContinueWith(_ => { timer.Dispose(); }, TaskContinuationOptions.ExecuteSynchronously); #endif } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Action func) { try { func(); return Empty; } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Action func, T1 arg) { try { func(arg); return Empty; } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Action func, T1 arg1, T2 arg2) { try { func(arg1, arg2); return Empty; } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func func) { try { return func(); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func> func) { try { return func(); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func func) { try { return FromResult(func()); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func func, T1 arg) { try { return func(arg); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func func, T1 arg1, T2 arg2) { try { return func(arg1, arg2); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func> func, T1 arg) { try { return func(arg); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func func, T1 arg) { try { return FromResult(func(arg)); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func> func, T1 arg1, T2 arg2) { try { return func(arg1, arg2); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] public static Task FromMethod(Func func, T1 arg1, T2 arg2) { try { return FromResult(func(arg1, arg2)); } catch (Exception ex) { return FromError(ex); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] public static Task FromResult(T value) { var tcs = new TaskCompletionSource(); tcs.SetResult(value); return tcs.Task; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] internal static Task FromError(Exception e) { return FromError(e); } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] internal static Task FromError(Exception e) { var tcs = new TaskCompletionSource(); tcs.SetUnwrappedException(e); return tcs.Task; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] internal static void SetUnwrappedException(this TaskCompletionSource tcs, Exception e) { var aggregateException = e as AggregateException; if (aggregateException != null) { tcs.SetException(aggregateException.InnerExceptions); } else { tcs.SetException(e); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] internal static bool TrySetUnwrappedException(this TaskCompletionSource tcs, Exception e) { var aggregateException = e as AggregateException; if (aggregateException != null) { return tcs.TrySetException(aggregateException.InnerExceptions); } else { return tcs.TrySetException(e); } } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] private static Task Canceled() { var tcs = new TaskCompletionSource(); tcs.SetCanceled(); return tcs.Task; } [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] private static Task Canceled() { var tcs = new TaskCompletionSource(); tcs.SetCanceled(); return tcs.Task; } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] private static Task RunTask(Task task, Action successor) { var tcs = new TaskCompletionSource(); task.ContinueWith(t => { if (t.IsFaulted) { tcs.SetUnwrappedException(t.Exception); } else if (t.IsCanceled) { tcs.SetCanceled(); } else { try { successor(); tcs.SetResult(null); } catch (Exception ex) { tcs.SetUnwrappedException(ex); } } }); return tcs.Task; } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is a shared file")] private static Task RunTaskSynchronously(Task task, Action next, object state, bool onlyOnSuccess = true) { var tcs = new TaskCompletionSource(); task.ContinueWith(t => { try { if (t.IsFaulted) { if (!onlyOnSuccess) { next(state); } tcs.SetUnwrappedException(t.Exception); } else if (t.IsCanceled) { if (!onlyOnSuccess) { next(state); } tcs.SetCanceled(); } else { next(state); tcs.SetResult(null); } } catch (Exception ex) { tcs.SetUnwrappedException(ex); } }, TaskContinuationOptions.ExecuteSynchronously); return tcs.Task; } private static class TaskRunners { [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] internal static Task RunTask(Task task, Action successor) { var tcs = new TaskCompletionSource(); task.ContinueWith(t => { if (t.IsFaulted) { tcs.SetUnwrappedException(t.Exception); } else if (t.IsCanceled) { tcs.SetCanceled(); } else { try { successor(t.Result); tcs.SetResult(null); } catch (Exception ex) { tcs.SetUnwrappedException(ex); } } }); return tcs.Task; } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] internal static Task RunTask(Task task, Func successor) { var tcs = new TaskCompletionSource(); task.ContinueWith(t => { if (t.IsFaulted) { tcs.SetUnwrappedException(t.Exception); } else if (t.IsCanceled) { tcs.SetCanceled(); } else { try { tcs.SetResult(successor()); } catch (Exception ex) { tcs.SetUnwrappedException(ex); } } }); return tcs.Task; } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions are set in a tcs")] internal static Task RunTask(Task task, Func, TResult> successor) { var tcs = new TaskCompletionSource(); task.ContinueWith(t => { if (task.IsFaulted) { tcs.SetUnwrappedException(t.Exception); } else if (task.IsCanceled) { tcs.SetCanceled(); } else { try { tcs.SetResult(successor(t)); } catch (Exception ex) { tcs.SetUnwrappedException(ex); } } }); return tcs.Task; } } private static class GenericDelegates { internal static Task ThenWithArgs(Task task, Action successor, T1 arg1) { return RunTask(task, () => successor(arg1)); } internal static Task ThenWithArgs(Task task, Action successor, T1 arg1, T2 arg2) { return RunTask(task, () => successor(arg1, arg2)); } internal static Task ThenWithArgs(Task task, Func successor, T1 arg1) { return TaskRunners.RunTask(task, () => successor(arg1)); } internal static Task ThenWithArgs(Task task, Func successor, T1 arg1, T2 arg2) { return TaskRunners.RunTask(task, () => successor(arg1, arg2)); } internal static Task ThenWithArgs(Task task, Func successor, T1 arg1) { return TaskRunners.RunTask(task, t => successor(t.Result, arg1)); } internal static Task ThenWithArgs(Task task, Func successor, T1 arg1) { return TaskRunners.RunTask(task, () => successor(arg1)); } internal static Task ThenWithArgs(Task task, Func successor, T1 arg1, T2 arg2) { return TaskRunners.RunTask(task, () => successor(arg1, arg2)); } internal static Task> ThenWithArgs(Task task, Func> successor, T1 arg1) { return TaskRunners>.RunTask(task, t => successor(t.Result, arg1)); } internal static Task> ThenWithArgs(Task task, Func, T1, Task> successor, T1 arg1) { return TaskRunners>.RunTask(task, t => successor(t, arg1)); } } private static class TaskCache { public static Task Empty = MakeTask(default(T)); } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Core/Infrastructure/0000755000175000017500000000000012311344240026667 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Core/Infrastructure/ExceptionsExtensions.cs0000644000175000017500000000136412204443213033424 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; namespace Microsoft.AspNet.SignalR.Infrastructure { internal static class ExceptionsExtensions { internal static Exception Unwrap(this Exception ex) { if (ex == null) { return null; } var next = ex.GetBaseException(); while (next.InnerException != null) { // On mono GetBaseException() doesn't seem to do anything // so just walk the inner exception chain. next = next.InnerException; } return next; } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Core/Infrastructure/DisposableAction.cs0000644000175000017500000000227512204443213032450 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Threading; using System.Diagnostics.CodeAnalysis; namespace Microsoft.AspNet.SignalR.Infrastructure { internal class DisposableAction : IDisposable { [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "The client projects use this.")] public static readonly DisposableAction Empty = new DisposableAction(() => { }); private Action _action; private readonly object _state; public DisposableAction(Action action) : this(state => ((Action)state).Invoke(), state: action) { } public DisposableAction(Action action, object state) { _action = action; _state = state; } protected virtual void Dispose(bool disposing) { if (disposing) { Interlocked.Exchange(ref _action, (state) => { }).Invoke(_state); } } public void Dispose() { Dispose(true); } } } smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Core/Infrastructure/Disposer.cs0000644000175000017500000000367012204443213031015 0ustar00meebeymeebey00000000000000// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Threading; namespace Microsoft.AspNet.SignalR.Infrastructure { /// /// Helper class to manage disposing a resource at an arbirtary time /// internal class Disposer : IDisposable { private static readonly object _disposedSentinel = new object(); private object _disposable; public void Set(IDisposable disposable) { if (disposable == null) { throw new ArgumentNullException("disposable"); } object originalFieldValue = Interlocked.CompareExchange(ref _disposable, disposable, null); if (originalFieldValue == null) { // this is the first call to Set() and Dispose() hasn't yet been called; do nothing } else if (originalFieldValue == _disposedSentinel) { // Dispose() has already been called, so we need to dispose of the object that was just added disposable.Dispose(); } else { #if !NET35 && !SILVERLIGHT && !NETFX_CORE // Set has been called multiple times, fail Debug.Fail("Multiple calls to Disposer.Set(IDisposable) without calling Disposer.Dispose()"); #endif } } protected virtual void Dispose(bool disposing) { if (disposing) { var disposable = Interlocked.Exchange(ref _disposable, _disposedSentinel) as IDisposable; if (disposable != null) { disposable.Dispose(); } } } public void Dispose() { Dispose(true); } } } CancellationTokenExtensions.cs0000644000175000017500000000600312204443213034614 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/SignalR/src/Microsoft.AspNet.SignalR.Core/Infrastructure// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System; using System.Threading; namespace Microsoft.AspNet.SignalR.Infrastructure { internal static class CancellationTokenExtensions { public static IDisposable SafeRegister(this CancellationToken cancellationToken, Action callback, object state) { var callbackWrapper = new CancellationCallbackWrapper(callback, state); // Ensure delegate continues to use the C# Compiler static delegate caching optimization. CancellationTokenRegistration registration = cancellationToken.Register(s => Cancel(s), callbackWrapper, useSynchronizationContext: false); var disposeCancellationState = new DiposeCancellationState(callbackWrapper, registration); // Ensure delegate continues to use the C# Compiler static delegate caching optimization. return new DisposableAction(s => Dispose(s), disposeCancellationState); } private static void Cancel(object state) { ((CancellationCallbackWrapper)state).TryInvoke(); } private static void Dispose(object state) { ((DiposeCancellationState)state).TryDispose(); } private class DiposeCancellationState { private readonly CancellationCallbackWrapper _callbackWrapper; private readonly CancellationTokenRegistration _registration; public DiposeCancellationState(CancellationCallbackWrapper callbackWrapper, CancellationTokenRegistration registration) { _callbackWrapper = callbackWrapper; _registration = registration; } public void TryDispose() { // This normally waits until the callback is finished invoked but we don't care if (_callbackWrapper.TrySetInvoked()) { // Bug #1549, .NET 4.0 has a bug where this throws if the CTS _registration.Dispose(); } } } private class CancellationCallbackWrapper { private readonly Action _callback; private readonly object _state; private int _callbackInvoked; public CancellationCallbackWrapper(Action callback, object state) { _callback = callback; _state = state; } public bool TrySetInvoked() { return Interlocked.Exchange(ref _callbackInvoked, 1) == 0; } public void TryInvoke() { if (TrySetInvoked()) { _callback(_state); } } } } } smuxi-0.11/lib/Newtonsoft.Json/0000755000175000017500000000000012311344237017222 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Newtonsoft.Json/Src/0000755000175000017500000000000012311344237017751 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/0000755000175000017500000000000012311344240023021 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Newtonsoft.Json.csproj0000644000175000017500000003204212253423361027331 0ustar00meebeymeebey00000000000000 Debug AnyCPU 9.0.30729 2.0 {A9AE40FF-1A21-414A-9FE7-3BE13644CC6D} Library Properties Newtonsoft.Json Newtonsoft.Json false 3.5 false publish\ true Disk false Foreground 7 Days false false true 0 1.0.0.%2a false true true full false bin\Debug\Net40\ DEBUG;TRACE;NET35 prompt 4 bin\Debug\Net40\Newtonsoft.Json.xml true Newtonsoft.Json.ruleset pdbonly true bin\Release\Net40\ TRACE prompt 4 bin\Release\Net40\Newtonsoft.Json.xml AllRules.ruleset 3.5 3.0 3.5 False .NET Framework 3.5 SP1 Client Profile false False .NET Framework 2.0 %28x86%29 true False .NET Framework 3.0 %28x86%29 false False .NET Framework 3.5 false False .NET Framework 3.5 SP1 false smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/DateTimeZoneHandling.cs0000644000175000017500000000410212253423361027351 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json { /// /// Specifies how to treat the time value when converting between string and . /// public enum DateTimeZoneHandling { /// /// Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. /// Local, /// /// Treat as a UTC. If the object represents a local time, it is converted to a UTC. /// Utc, /// /// Treat as a local time if a is being converted to a string. /// If a string is being converted to , convert to a local time if a time zone is specified. /// Unspecified, /// /// Time zone information should be preserved when converting. /// RoundtripKind } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonPosition.cs0000644000175000017500000000501712253423361026020 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections.Generic; using System.Text; namespace Newtonsoft.Json { internal enum JsonContainerType { None, Object, Array, Constructor } internal struct JsonPosition { internal JsonContainerType Type; internal int? Position; internal string PropertyName; internal void WriteTo(StringBuilder sb) { switch (Type) { case JsonContainerType.Object: if (PropertyName != null) { if (sb.Length > 0) sb.Append("."); sb.Append(PropertyName); } break; case JsonContainerType.Array: case JsonContainerType.Constructor: if (Position != null) { sb.Append("["); sb.Append(Position); sb.Append("]"); } break; } } internal bool InsideContainer() { switch (Type) { case JsonContainerType.Object: return (PropertyName != null); case JsonContainerType.Array: case JsonContainerType.Constructor: return (Position != null); } return false; } internal static string BuildPath(IEnumerable positions) { StringBuilder sb = new StringBuilder(); foreach (JsonPosition state in positions) { state.WriteTo(sb); } return sb.ToString(); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/0000755000175000017500000000000012253423361025003 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/BidirectionalDictionary.cs0000644000175000017500000000464112253423361032135 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; namespace Newtonsoft.Json.Utilities { internal class BidirectionalDictionary { private readonly IDictionary _firstToSecond; private readonly IDictionary _secondToFirst; public BidirectionalDictionary() : this(EqualityComparer.Default, EqualityComparer.Default) { } public BidirectionalDictionary(IEqualityComparer firstEqualityComparer, IEqualityComparer secondEqualityComparer) { _firstToSecond = new Dictionary(firstEqualityComparer); _secondToFirst = new Dictionary(secondEqualityComparer); } public void Add(TFirst first, TSecond second) { if (_firstToSecond.ContainsKey(first) || _secondToFirst.ContainsKey(second)) { throw new ArgumentException("Duplicate first or second"); } _firstToSecond.Add(first, second); _secondToFirst.Add(second, first); } public bool TryGetByFirst(TFirst first, out TSecond second) { return _firstToSecond.TryGetValue(first, out second); } public bool TryGetBySecond(TSecond second, out TFirst first) { return _secondToFirst.TryGetValue(second, out first); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/MiscellaneousUtils.cs0000644000175000017500000001323612253423361031163 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Reflection; using System.Text; using System.Globalization; namespace Newtonsoft.Json.Utilities { internal delegate T Creator(); internal static class MiscellaneousUtils { public static bool ValueEquals(object objA, object objB) { if (objA == null && objB == null) return true; if (objA != null && objB == null) return false; if (objA == null && objB != null) return false; // comparing an Int32 and Int64 both of the same value returns false // make types the same then compare if (objA.GetType() != objB.GetType()) { if (ConvertUtils.IsInteger(objA) && ConvertUtils.IsInteger(objB)) return Convert.ToDecimal(objA, CultureInfo.CurrentCulture).Equals(Convert.ToDecimal(objB, CultureInfo.CurrentCulture)); else if ((objA is double || objA is float || objA is decimal) && (objB is double || objB is float || objB is decimal)) return MathUtils.ApproxEquals(Convert.ToDouble(objA, CultureInfo.CurrentCulture), Convert.ToDouble(objB, CultureInfo.CurrentCulture)); else return false; } return objA.Equals(objB); } public static ArgumentOutOfRangeException CreateArgumentOutOfRangeException(string paramName, object actualValue, string message) { string newMessage = message + Environment.NewLine + @"Actual value was {0}.".FormatWith(CultureInfo.InvariantCulture, actualValue); return new ArgumentOutOfRangeException(paramName, newMessage); } public static bool TryAction(Creator creator, out T output) { ValidationUtils.ArgumentNotNull(creator, "creator"); try { output = creator(); return true; } catch { output = default(T); return false; } } public static string ToString(object value) { if (value == null) return "{null}"; return (value is string) ? @"""" + value.ToString() + @"""" : value.ToString(); } public static byte[] HexToBytes(string hex) { string fixedHex = hex.Replace("-", string.Empty); // array to put the result in byte[] bytes = new byte[fixedHex.Length / 2]; // variable to determine shift of high/low nibble int shift = 4; // offset of the current byte in the array int offset = 0; // loop the characters in the string foreach (char c in fixedHex) { // get character code in range 0-9, 17-22 // the % 32 handles lower case characters int b = (c - '0') % 32; // correction for a-f if (b > 9) b -= 7; // store nibble (4 bits) in byte array bytes[offset] |= (byte)(b << shift); // toggle the shift variable between 0 and 4 shift ^= 4; // move to next byte if (shift != 0) offset++; } return bytes; } public static string BytesToHex(byte[] bytes) { return BytesToHex(bytes, false); } public static string BytesToHex(byte[] bytes, bool removeDashes) { string hex = BitConverter.ToString(bytes); if (removeDashes) hex = hex.Replace("-", ""); return hex; } public static int ByteArrayCompare(byte[] a1, byte[] a2) { int lengthCompare = a1.Length.CompareTo(a2.Length); if (lengthCompare != 0) return lengthCompare; for (int i = 0; i < a1.Length; i++) { int valueCompare = a1[i].CompareTo(a2[i]); if (valueCompare != 0) return valueCompare; } return 0; } public static string GetPrefix(string qualifiedName) { string prefix; string localName; GetQualifiedNameParts(qualifiedName, out prefix, out localName); return prefix; } public static string GetLocalName(string qualifiedName) { string prefix; string localName; GetQualifiedNameParts(qualifiedName, out prefix, out localName); return localName; } public static void GetQualifiedNameParts(string qualifiedName, out string prefix, out string localName) { int colonPosition = qualifiedName.IndexOf(':'); if ((colonPosition == -1 || colonPosition == 0) || (qualifiedName.Length - 1) == colonPosition) { prefix = null; localName = qualifiedName; } else { prefix = qualifiedName.Substring(0, colonPosition); localName = qualifiedName.Substring(colonPosition + 1); } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/EnumValue.cs0000644000175000017500000000300112253423361027225 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json.Utilities { internal class EnumValue where T : struct { private readonly string _name; private readonly T _value; public string Name { get { return _name; } } public T Value { get { return _value; } } public EnumValue(string name, T value) { _name = name; _value = value; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs0000644000175000017500000000462512253423361031574 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(SILVERLIGHT || PORTABLE || NETFX_CORE) using System; using System.Reflection.Emit; using System.Reflection; namespace Newtonsoft.Json.Utilities { internal static class ILGeneratorExtensions { public static void PushInstance(this ILGenerator generator, Type type) { generator.Emit(OpCodes.Ldarg_0); if (type.IsValueType()) generator.Emit(OpCodes.Unbox, type); else generator.Emit(OpCodes.Castclass, type); } public static void BoxIfNeeded(this ILGenerator generator, Type type) { if (type.IsValueType()) generator.Emit(OpCodes.Box, type); else generator.Emit(OpCodes.Castclass, type); } public static void UnboxIfNeeded(this ILGenerator generator, Type type) { if (type.IsValueType()) generator.Emit(OpCodes.Unbox_Any, type); else generator.Emit(OpCodes.Castclass, type); } public static void CallMethod(this ILGenerator generator, MethodInfo methodInfo) { if (methodInfo.IsFinal || !methodInfo.IsVirtual) generator.Emit(OpCodes.Call, methodInfo); else generator.Emit(OpCodes.Callvirt, methodInfo); } public static void Return(this ILGenerator generator) { generator.Emit(OpCodes.Ret); } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicWrapper.cs0000644000175000017500000002024412253423361030261 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Reflection.Emit; using System.Resources; using System.Globalization; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Utilities { internal class DynamicWrapperBase { internal protected object UnderlyingObject; } internal static class DynamicWrapper { private static readonly object _lock = new object(); private static readonly WrapperDictionary _wrapperDictionary = new WrapperDictionary(); private static ModuleBuilder _moduleBuilder; private static ModuleBuilder ModuleBuilder { get { Init(); return _moduleBuilder; } } private static void Init() { if (_moduleBuilder == null) { lock (_lock) { if (_moduleBuilder == null) { AssemblyName assemblyName = new AssemblyName("Newtonsoft.Json.Dynamic"); assemblyName.KeyPair = new StrongNameKeyPair(GetStrongKey()); AssemblyBuilder assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); _moduleBuilder = assembly.DefineDynamicModule("Newtonsoft.Json.DynamicModule", false); } } } } private static byte[] GetStrongKey() { const string name = "Newtonsoft.Json.Dynamic.snk"; using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name)) { if (stream == null) throw new MissingManifestResourceException("Should have " + name + " as an embedded resource."); int length = (int)stream.Length; byte[] buffer = new byte[length]; stream.Read(buffer, 0, length); return buffer; } } public static Type GetWrapper(Type interfaceType, Type realObjectType) { Type wrapperType = _wrapperDictionary.GetType(interfaceType, realObjectType); if (wrapperType == null) { lock (_lock) { wrapperType = _wrapperDictionary.GetType(interfaceType, realObjectType); if (wrapperType == null) { wrapperType = GenerateWrapperType(interfaceType, realObjectType); _wrapperDictionary.SetType(interfaceType, realObjectType, wrapperType); } } } return wrapperType; } public static object GetUnderlyingObject(object wrapper) { DynamicWrapperBase wrapperBase = wrapper as DynamicWrapperBase; if (wrapperBase == null) throw new ArgumentException("Object is not a wrapper.", "wrapper"); return wrapperBase.UnderlyingObject; } private static Type GenerateWrapperType(Type interfaceType, Type underlyingType) { TypeBuilder wrapperBuilder = ModuleBuilder.DefineType( "{0}_{1}_Wrapper".FormatWith(CultureInfo.InvariantCulture, interfaceType.Name, underlyingType.Name), TypeAttributes.NotPublic | TypeAttributes.Sealed, typeof(DynamicWrapperBase), new[] { interfaceType }); WrapperMethodBuilder wrapperMethod = new WrapperMethodBuilder(underlyingType, wrapperBuilder); foreach (MethodInfo method in interfaceType.GetAllMethods()) { wrapperMethod.Generate(method); } return wrapperBuilder.CreateType(); } public static T CreateWrapper(object realObject) where T : class { var dynamicType = GetWrapper(typeof(T), realObject.GetType()); var dynamicWrapper = (DynamicWrapperBase)Activator.CreateInstance(dynamicType); dynamicWrapper.UnderlyingObject = realObject; return dynamicWrapper as T; } } internal class WrapperMethodBuilder { private readonly Type _realObjectType; private readonly TypeBuilder _wrapperBuilder; public WrapperMethodBuilder(Type realObjectType, TypeBuilder proxyBuilder) { _realObjectType = realObjectType; _wrapperBuilder = proxyBuilder; } public void Generate(MethodInfo newMethod) { if (newMethod.IsGenericMethod) newMethod = newMethod.GetGenericMethodDefinition(); FieldInfo srcField = typeof(DynamicWrapperBase).GetField("UnderlyingObject", BindingFlags.Instance | BindingFlags.NonPublic); var parameters = newMethod.GetParameters(); var parameterTypes = parameters.Select(parameter => parameter.ParameterType).ToArray(); MethodBuilder methodBuilder = _wrapperBuilder.DefineMethod( newMethod.Name, MethodAttributes.Public | MethodAttributes.Virtual, newMethod.ReturnType, parameterTypes); if (newMethod.IsGenericMethod) { methodBuilder.DefineGenericParameters( newMethod.GetGenericArguments().Select(arg => arg.Name).ToArray()); } ILGenerator ilGenerator = methodBuilder.GetILGenerator(); LoadUnderlyingObject(ilGenerator, srcField); PushParameters(parameters, ilGenerator); ExecuteMethod(newMethod, parameterTypes, ilGenerator); Return(ilGenerator); } private static void Return(ILGenerator ilGenerator) { ilGenerator.Emit(OpCodes.Ret); } private void ExecuteMethod(MethodBase newMethod, Type[] parameterTypes, ILGenerator ilGenerator) { MethodInfo srcMethod = GetMethod(newMethod, parameterTypes); if (srcMethod == null) throw new MissingMethodException("Unable to find method " + newMethod.Name + " on " + _realObjectType.FullName); ilGenerator.Emit(OpCodes.Call, srcMethod); } private MethodInfo GetMethod(MethodBase realMethod, Type[] parameterTypes) { if (realMethod.IsGenericMethod) return _realObjectType.GetGenericMethod(realMethod.Name, parameterTypes); return _realObjectType.GetMethod(realMethod.Name, parameterTypes); } private static void PushParameters(ICollection parameters, ILGenerator ilGenerator) { for (int i = 1; i < parameters.Count + 1; i++) ilGenerator.Emit(OpCodes.Ldarg, i); } private static void LoadUnderlyingObject(ILGenerator ilGenerator, FieldInfo srcField) { ilGenerator.Emit(OpCodes.Ldarg_0); ilGenerator.Emit(OpCodes.Ldfld, srcField); } } internal class WrapperDictionary { private readonly Dictionary _wrapperTypes = new Dictionary(); private static string GenerateKey(Type interfaceType, Type realObjectType) { return interfaceType.Name + "_" + realObjectType.Name; } public Type GetType(Type interfaceType, Type realObjectType) { string key = GenerateKey(interfaceType, realObjectType); if (_wrapperTypes.ContainsKey(key)) return _wrapperTypes[key]; return null; } public void SetType(Type interfaceType, Type realObjectType, Type wrapperType) { string key = GenerateKey(interfaceType, realObjectType); if (_wrapperTypes.ContainsKey(key)) _wrapperTypes[key] = wrapperType; else _wrapperTypes.Add(key, wrapperType); } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ValidationUtils.cs0000644000175000017500000000556712253423361030462 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Globalization; namespace Newtonsoft.Json.Utilities { internal static class ValidationUtils { public static void ArgumentNotNullOrEmpty(string value, string parameterName) { if (value == null) throw new ArgumentNullException(parameterName); if (value.Length == 0) throw new ArgumentException("'{0}' cannot be empty.".FormatWith(CultureInfo.InvariantCulture, parameterName), parameterName); } public static void ArgumentTypeIsEnum(Type enumType, string parameterName) { ArgumentNotNull(enumType, "enumType"); if (!enumType.IsEnum()) throw new ArgumentException("Type {0} is not an Enum.".FormatWith(CultureInfo.InvariantCulture, enumType), parameterName); } public static void ArgumentNotNullOrEmpty(ICollection collection, string parameterName) { ArgumentNotNullOrEmpty(collection, parameterName, "Collection '{0}' cannot be empty.".FormatWith(CultureInfo.InvariantCulture, parameterName)); } public static void ArgumentNotNullOrEmpty(ICollection collection, string parameterName, string message) { if (collection == null) throw new ArgumentNullException(parameterName); if (collection.Count == 0) throw new ArgumentException(message, parameterName); } public static void ArgumentNotNull(object value, string parameterName) { if (value == null) throw new ArgumentNullException(parameterName); } public static void ArgumentConditionTrue(bool condition, string parameterName, string message) { if (!condition) throw new ArgumentException(message, parameterName); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ReflectionDelegateFactory.cs0000644000175000017500000000532712253423361032416 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Reflection; using Newtonsoft.Json.Serialization; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #endif namespace Newtonsoft.Json.Utilities { internal abstract class ReflectionDelegateFactory { public Func CreateGet(MemberInfo memberInfo) { PropertyInfo propertyInfo = memberInfo as PropertyInfo; if (propertyInfo != null) return CreateGet(propertyInfo); FieldInfo fieldInfo = memberInfo as FieldInfo; if (fieldInfo != null) return CreateGet(fieldInfo); throw new Exception("Could not create getter for {0}.".FormatWith(CultureInfo.InvariantCulture, memberInfo)); } public Action CreateSet(MemberInfo memberInfo) { PropertyInfo propertyInfo = memberInfo as PropertyInfo; if (propertyInfo != null) return CreateSet(propertyInfo); FieldInfo fieldInfo = memberInfo as FieldInfo; if (fieldInfo != null) return CreateSet(fieldInfo); throw new Exception("Could not create setter for {0}.".FormatWith(CultureInfo.InvariantCulture, memberInfo)); } public abstract MethodCall CreateMethodCall(MethodBase method); public abstract Func CreateDefaultConstructor(Type type); public abstract Func CreateGet(PropertyInfo propertyInfo); public abstract Func CreateGet(FieldInfo fieldInfo); public abstract Action CreateSet(FieldInfo fieldInfo); public abstract Action CreateSet(PropertyInfo propertyInfo); } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ListWrapper.cs0000644000175000017500000001045312253423361027611 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections; using System.Collections.Generic; namespace Newtonsoft.Json.Utilities { internal interface IWrappedList : IList { object UnderlyingList { get; } } internal class ListWrapper : CollectionWrapper, IList, IWrappedList { private readonly IList _genericList; public ListWrapper(IList list) : base(list) { ValidationUtils.ArgumentNotNull(list, "list"); if (list is IList) _genericList = (IList) list; } public ListWrapper(IList list) : base(list) { ValidationUtils.ArgumentNotNull(list, "list"); _genericList = list; } public int IndexOf(T item) { if (_genericList != null) return _genericList.IndexOf(item); else return ((IList)this).IndexOf(item); } public void Insert(int index, T item) { if (_genericList != null) _genericList.Insert(index, item); else ((IList)this).Insert(index, item); } public void RemoveAt(int index) { if (_genericList != null) _genericList.RemoveAt(index); else ((IList)this).RemoveAt(index); } public T this[int index] { get { if (_genericList != null) return _genericList[index]; else return (T)((IList)this)[index]; } set { if (_genericList != null) _genericList[index] = value; else ((IList)this)[index] = value; } } public override void Add(T item) { if (_genericList != null) _genericList.Add(item); else base.Add(item); } public override void Clear() { if (_genericList != null) _genericList.Clear(); else base.Clear(); } public override bool Contains(T item) { if (_genericList != null) return _genericList.Contains(item); else return base.Contains(item); } public override void CopyTo(T[] array, int arrayIndex) { if (_genericList != null) _genericList.CopyTo(array, arrayIndex); else base.CopyTo(array, arrayIndex); } public override int Count { get { if (_genericList != null) return _genericList.Count; else return base.Count; } } public override bool IsReadOnly { get { if (_genericList != null) return _genericList.IsReadOnly; else return base.IsReadOnly; } } public override bool Remove(T item) { if (_genericList != null) { return _genericList.Remove(item); } else { bool contains = base.Contains(item); if (contains) base.Remove(item); return contains; } } public override IEnumerator GetEnumerator() { if (_genericList != null) return _genericList.GetEnumerator(); return base.GetEnumerator(); } public object UnderlyingList { get { if (_genericList != null) return _genericList; else return UnderlyingCollection; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/StringBuffer.cs0000644000175000017500000000543112253423361027735 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json.Utilities { /// /// Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. /// internal class StringBuffer { private char[] _buffer; private int _position; private static readonly char[] EmptyBuffer = new char[0]; public int Position { get { return _position; } set { _position = value; } } public StringBuffer() { _buffer = EmptyBuffer; } public StringBuffer(int initalSize) { _buffer = new char[initalSize]; } public void Append(char value) { // test if the buffer array is large enough to take the value if (_position == _buffer.Length) EnsureSize(1); // set value and increment poisition _buffer[_position++] = value; } public void Append(char[] buffer, int startIndex, int count) { if (_position + count >= _buffer.Length) EnsureSize(count); Array.Copy(buffer, startIndex, _buffer, _position, count); _position += count; } public void Clear() { _buffer = EmptyBuffer; _position = 0; } private void EnsureSize(int appendLength) { char[] newBuffer = new char[(_position + appendLength) * 2]; Array.Copy(_buffer, newBuffer, _position); _buffer = newBuffer; } public override string ToString() { return ToString(0, _position); } public string ToString(int start, int length) { // TODO: validation return new string(_buffer, start, length); } public char[] GetInternalBuffer() { return _buffer; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ThreadSafeStore.cs0000644000175000017500000000475512253423361030370 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #endif using Newtonsoft.Json.Serialization; namespace Newtonsoft.Json.Utilities { internal class ThreadSafeStore { private readonly object _lock = new object(); private Dictionary _store; private readonly Func _creator; public ThreadSafeStore(Func creator) { if (creator == null) throw new ArgumentNullException("creator"); _creator = creator; } public TValue Get(TKey key) { if (_store == null) return AddValue(key); TValue value; if (!_store.TryGetValue(key, out value)) return AddValue(key); return value; } private TValue AddValue(TKey key) { TValue value = _creator(key); lock (_lock) { if (_store == null) { _store = new Dictionary(); _store[key] = value; } else { // double check locking TValue checkValue; if (_store.TryGetValue(key, out checkValue)) return checkValue; Dictionary newStore = new Dictionary(_store); newStore[key] = value; _store = newStore; } return value; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs0000644000175000017500000010230512253423361030446 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Reflection; using System.Collections; using System.Globalization; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters; using System.Text; #if NETFX_CORE using IConvertible = Newtonsoft.Json.Utilities.Convertible; #endif #if NETFX_CORE || PORTABLE using ICustomAttributeProvider = Newtonsoft.Json.Utilities.CustomAttributeProvider; #endif #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif using Newtonsoft.Json.Serialization; namespace Newtonsoft.Json.Utilities { #if NETFX_CORE || PORTABLE internal enum MemberTypes { Property, Field, Event, Method, Other } internal class CustomAttributeProvider { private readonly object _underlyingObject; public CustomAttributeProvider(object o) { _underlyingObject = o; } public object UnderlyingObject { get { return _underlyingObject; } } } #endif #if NETFX_CORE internal enum TypeCode { Empty, Object, String, Char, Boolean, SByte, Int16, UInt16, Int32, Byte, UInt32, Int64, UInt64, Single, Double, DateTime, Decimal } [Flags] internal enum BindingFlags { Default = 0, IgnoreCase = 1, DeclaredOnly = 2, Instance = 4, Static = 8, Public = 16, NonPublic = 32, FlattenHierarchy = 64, InvokeMethod = 256, CreateInstance = 512, GetField = 1024, SetField = 2048, GetProperty = 4096, SetProperty = 8192, PutDispProperty = 16384, ExactBinding = 65536, PutRefDispProperty = 32768, SuppressChangeType = 131072, OptionalParamBinding = 262144, IgnoreReturn = 16777216 } #endif internal static class ReflectionUtils { public static readonly Type[] EmptyTypes; static ReflectionUtils() { #if !(NETFX_CORE || PORTABLE) EmptyTypes = Type.EmptyTypes; #else EmptyTypes = new Type[0]; #endif } public static ICustomAttributeProvider GetCustomAttributeProvider(this object o) { #if !(NETFX_CORE || PORTABLE) return (ICustomAttributeProvider)o; #else return new ICustomAttributeProvider(o); #endif } public static bool IsVirtual(this PropertyInfo propertyInfo) { ValidationUtils.ArgumentNotNull(propertyInfo, "propertyInfo"); MethodInfo m = propertyInfo.GetGetMethod(); if (m != null && m.IsVirtual) return true; m = propertyInfo.GetSetMethod(); if (m != null && m.IsVirtual) return true; return false; } public static Type GetObjectType(object v) { return (v != null) ? v.GetType() : null; } public static string GetTypeName(Type t, FormatterAssemblyStyle assemblyFormat) { return GetTypeName(t, assemblyFormat, null); } public static string GetTypeName(Type t, FormatterAssemblyStyle assemblyFormat, SerializationBinder binder) { string fullyQualifiedTypeName; #if !(NET20 || NET35) if (binder != null) { string assemblyName, typeName; binder.BindToName(t, out assemblyName, out typeName); fullyQualifiedTypeName = typeName + (assemblyName == null ? "" : ", " + assemblyName); } else { fullyQualifiedTypeName = t.AssemblyQualifiedName; } #else fullyQualifiedTypeName = t.AssemblyQualifiedName; #endif switch (assemblyFormat) { case FormatterAssemblyStyle.Simple: return RemoveAssemblyDetails(fullyQualifiedTypeName); case FormatterAssemblyStyle.Full: return fullyQualifiedTypeName; default: throw new ArgumentOutOfRangeException(); } } private static string RemoveAssemblyDetails(string fullyQualifiedTypeName) { StringBuilder builder = new StringBuilder(); // loop through the type name and filter out qualified assembly details from nested type names bool writingAssemblyName = false; bool skippingAssemblyDetails = false; for (int i = 0; i < fullyQualifiedTypeName.Length; i++) { char current = fullyQualifiedTypeName[i]; switch (current) { case '[': writingAssemblyName = false; skippingAssemblyDetails = false; builder.Append(current); break; case ']': writingAssemblyName = false; skippingAssemblyDetails = false; builder.Append(current); break; case ',': if (!writingAssemblyName) { writingAssemblyName = true; builder.Append(current); } else { skippingAssemblyDetails = true; } break; default: if (!skippingAssemblyDetails) builder.Append(current); break; } } return builder.ToString(); } public static bool IsInstantiatableType(Type t) { ValidationUtils.ArgumentNotNull(t, "t"); if (t.IsAbstract() || t.IsInterface() || t.IsArray || t.IsGenericTypeDefinition() || t == typeof(void)) return false; if (!HasDefaultConstructor(t)) return false; return true; } public static bool HasDefaultConstructor(Type t) { return HasDefaultConstructor(t, false); } public static bool HasDefaultConstructor(Type t, bool nonPublic) { ValidationUtils.ArgumentNotNull(t, "t"); if (t.IsValueType()) return true; return (GetDefaultConstructor(t, nonPublic) != null); } public static ConstructorInfo GetDefaultConstructor(Type t) { return GetDefaultConstructor(t, false); } public static ConstructorInfo GetDefaultConstructor(Type t, bool nonPublic) { BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Public; if (nonPublic) bindingFlags = bindingFlags | BindingFlags.NonPublic; return t.GetConstructors(bindingFlags).SingleOrDefault(c => !c.GetParameters().Any()); } public static bool IsNullable(Type t) { ValidationUtils.ArgumentNotNull(t, "t"); if (t.IsValueType()) return IsNullableType(t); return true; } public static bool IsNullableType(Type t) { ValidationUtils.ArgumentNotNull(t, "t"); return (t.IsGenericType() && t.GetGenericTypeDefinition() == typeof(Nullable<>)); } public static Type EnsureNotNullableType(Type t) { return (IsNullableType(t)) ? Nullable.GetUnderlyingType(t) : t; } public static bool ImplementsGenericDefinition(Type type, Type genericInterfaceDefinition) { Type implementingType; return ImplementsGenericDefinition(type, genericInterfaceDefinition, out implementingType); } public static bool ImplementsGenericDefinition(Type type, Type genericInterfaceDefinition, out Type implementingType) { ValidationUtils.ArgumentNotNull(type, "type"); ValidationUtils.ArgumentNotNull(genericInterfaceDefinition, "genericInterfaceDefinition"); if (!genericInterfaceDefinition.IsInterface() || !genericInterfaceDefinition.IsGenericTypeDefinition()) throw new ArgumentNullException("'{0}' is not a generic interface definition.".FormatWith(CultureInfo.InvariantCulture, genericInterfaceDefinition)); if (type.IsInterface()) { if (type.IsGenericType()) { Type interfaceDefinition = type.GetGenericTypeDefinition(); if (genericInterfaceDefinition == interfaceDefinition) { implementingType = type; return true; } } } foreach (Type i in type.GetInterfaces()) { if (i.IsGenericType()) { Type interfaceDefinition = i.GetGenericTypeDefinition(); if (genericInterfaceDefinition == interfaceDefinition) { implementingType = i; return true; } } } implementingType = null; return false; } public static bool InheritsGenericDefinition(Type type, Type genericClassDefinition) { Type implementingType; return InheritsGenericDefinition(type, genericClassDefinition, out implementingType); } public static bool InheritsGenericDefinition(Type type, Type genericClassDefinition, out Type implementingType) { ValidationUtils.ArgumentNotNull(type, "type"); ValidationUtils.ArgumentNotNull(genericClassDefinition, "genericClassDefinition"); if (!genericClassDefinition.IsClass() || !genericClassDefinition.IsGenericTypeDefinition()) throw new ArgumentNullException("'{0}' is not a generic class definition.".FormatWith(CultureInfo.InvariantCulture, genericClassDefinition)); return InheritsGenericDefinitionInternal(type, genericClassDefinition, out implementingType); } private static bool InheritsGenericDefinitionInternal(Type currentType, Type genericClassDefinition, out Type implementingType) { if (currentType.IsGenericType()) { Type currentGenericClassDefinition = currentType.GetGenericTypeDefinition(); if (genericClassDefinition == currentGenericClassDefinition) { implementingType = currentType; return true; } } if (currentType.BaseType() == null) { implementingType = null; return false; } return InheritsGenericDefinitionInternal(currentType.BaseType(), genericClassDefinition, out implementingType); } /// /// Gets the type of the typed collection's items. /// /// The type. /// The type of the typed collection's items. public static Type GetCollectionItemType(Type type) { ValidationUtils.ArgumentNotNull(type, "type"); Type genericListType; if (type.IsArray) { return type.GetElementType(); } else if (ImplementsGenericDefinition(type, typeof(IEnumerable<>), out genericListType)) { if (genericListType.IsGenericTypeDefinition()) throw new Exception("Type {0} is not a collection.".FormatWith(CultureInfo.InvariantCulture, type)); return genericListType.GetGenericArguments()[0]; } else if (typeof(IEnumerable).IsAssignableFrom(type)) { return null; } else { throw new Exception("Type {0} is not a collection.".FormatWith(CultureInfo.InvariantCulture, type)); } } public static void GetDictionaryKeyValueTypes(Type dictionaryType, out Type keyType, out Type valueType) { ValidationUtils.ArgumentNotNull(dictionaryType, "type"); Type genericDictionaryType; if (ImplementsGenericDefinition(dictionaryType, typeof(IDictionary<,>), out genericDictionaryType)) { if (genericDictionaryType.IsGenericTypeDefinition()) throw new Exception("Type {0} is not a dictionary.".FormatWith(CultureInfo.InvariantCulture, dictionaryType)); Type[] dictionaryGenericArguments = genericDictionaryType.GetGenericArguments(); keyType = dictionaryGenericArguments[0]; valueType = dictionaryGenericArguments[1]; return; } else if (typeof(IDictionary).IsAssignableFrom(dictionaryType)) { keyType = null; valueType = null; return; } else { throw new Exception("Type {0} is not a dictionary.".FormatWith(CultureInfo.InvariantCulture, dictionaryType)); } } public static Type GetDictionaryValueType(Type dictionaryType) { Type keyType; Type valueType; GetDictionaryKeyValueTypes(dictionaryType, out keyType, out valueType); return valueType; } public static Type GetDictionaryKeyType(Type dictionaryType) { Type keyType; Type valueType; GetDictionaryKeyValueTypes(dictionaryType, out keyType, out valueType); return keyType; } /// /// Gets the member's underlying type. /// /// The member. /// The underlying type of the member. public static Type GetMemberUnderlyingType(MemberInfo member) { ValidationUtils.ArgumentNotNull(member, "member"); switch (member.MemberType()) { case MemberTypes.Field: return ((FieldInfo)member).FieldType; case MemberTypes.Property: return ((PropertyInfo)member).PropertyType; case MemberTypes.Event: return ((EventInfo)member).EventHandlerType; default: throw new ArgumentException("MemberInfo must be of type FieldInfo, PropertyInfo or EventInfo", "member"); } } /// /// Determines whether the member is an indexed property. /// /// The member. /// /// true if the member is an indexed property; otherwise, false. /// public static bool IsIndexedProperty(MemberInfo member) { ValidationUtils.ArgumentNotNull(member, "member"); PropertyInfo propertyInfo = member as PropertyInfo; if (propertyInfo != null) return IsIndexedProperty(propertyInfo); else return false; } /// /// Determines whether the property is an indexed property. /// /// The property. /// /// true if the property is an indexed property; otherwise, false. /// public static bool IsIndexedProperty(PropertyInfo property) { ValidationUtils.ArgumentNotNull(property, "property"); return (property.GetIndexParameters().Length > 0); } /// /// Gets the member's value on the object. /// /// The member. /// The target object. /// The member's value on the object. public static object GetMemberValue(MemberInfo member, object target) { ValidationUtils.ArgumentNotNull(member, "member"); ValidationUtils.ArgumentNotNull(target, "target"); switch (member.MemberType()) { case MemberTypes.Field: return ((FieldInfo)member).GetValue(target); case MemberTypes.Property: try { return ((PropertyInfo)member).GetValue(target, null); } catch (TargetParameterCountException e) { throw new ArgumentException("MemberInfo '{0}' has index parameters".FormatWith(CultureInfo.InvariantCulture, member.Name), e); } default: throw new ArgumentException("MemberInfo '{0}' is not of type FieldInfo or PropertyInfo".FormatWith(CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, member.Name), "member"); } } /// /// Sets the member's value on the target object. /// /// The member. /// The target. /// The value. public static void SetMemberValue(MemberInfo member, object target, object value) { ValidationUtils.ArgumentNotNull(member, "member"); ValidationUtils.ArgumentNotNull(target, "target"); switch (member.MemberType()) { case MemberTypes.Field: ((FieldInfo)member).SetValue(target, value); break; case MemberTypes.Property: ((PropertyInfo)member).SetValue(target, value, null); break; default: throw new ArgumentException("MemberInfo '{0}' must be of type FieldInfo or PropertyInfo".FormatWith(CultureInfo.InvariantCulture, member.Name), "member"); } } /// /// Determines whether the specified MemberInfo can be read. /// /// The MemberInfo to determine whether can be read. /// /// if set to true then allow the member to be gotten non-publicly. /// /// true if the specified MemberInfo can be read; otherwise, false. /// public static bool CanReadMemberValue(MemberInfo member, bool nonPublic) { switch (member.MemberType()) { case MemberTypes.Field: FieldInfo fieldInfo = (FieldInfo)member; if (nonPublic) return true; else if (fieldInfo.IsPublic) return true; return false; case MemberTypes.Property: PropertyInfo propertyInfo = (PropertyInfo) member; if (!propertyInfo.CanRead) return false; if (nonPublic) return true; return (propertyInfo.GetGetMethod(nonPublic) != null); default: return false; } } /// /// Determines whether the specified MemberInfo can be set. /// /// The MemberInfo to determine whether can be set. /// if set to true then allow the member to be set non-publicly. /// if set to true then allow the member to be set if read-only. /// /// true if the specified MemberInfo can be set; otherwise, false. /// public static bool CanSetMemberValue(MemberInfo member, bool nonPublic, bool canSetReadOnly) { switch (member.MemberType()) { case MemberTypes.Field: FieldInfo fieldInfo = (FieldInfo)member; if (fieldInfo.IsInitOnly && !canSetReadOnly) return false; if (nonPublic) return true; else if (fieldInfo.IsPublic) return true; return false; case MemberTypes.Property: PropertyInfo propertyInfo = (PropertyInfo)member; if (!propertyInfo.CanWrite) return false; if (nonPublic) return true; return (propertyInfo.GetSetMethod(nonPublic) != null); default: return false; } } public static List GetFieldsAndProperties(Type type, BindingFlags bindingAttr) { List targetMembers = new List(); targetMembers.AddRange(GetFields(type, bindingAttr)); targetMembers.AddRange(GetProperties(type, bindingAttr)); // for some reason .NET returns multiple members when overriding a generic member on a base class // http://forums.msdn.microsoft.com/en-US/netfxbcl/thread/b5abbfee-e292-4a64-8907-4e3f0fb90cd9/ // filter members to only return the override on the topmost class // update: I think this is fixed in .NET 3.5 SP1 - leave this in for now... List distinctMembers = new List(targetMembers.Count); foreach (var groupedMember in targetMembers.GroupBy(m => m.Name)) { int count = groupedMember.Count(); IList members = groupedMember.ToList(); if (count == 1) { distinctMembers.Add(members.First()); } else { var resolvedMembers = members.Where(m => !IsOverridenGenericMember(m, bindingAttr) || m.Name == "Item"); distinctMembers.AddRange(resolvedMembers); } } return distinctMembers; } private static bool IsOverridenGenericMember(MemberInfo memberInfo, BindingFlags bindingAttr) { MemberTypes memberType = memberInfo.MemberType(); if (memberType != MemberTypes.Field && memberType != MemberTypes.Property) throw new ArgumentException("Member must be a field or property."); Type declaringType = memberInfo.DeclaringType; if (!declaringType.IsGenericType()) return false; Type genericTypeDefinition = declaringType.GetGenericTypeDefinition(); if (genericTypeDefinition == null) return false; MemberInfo[] members = genericTypeDefinition.GetMember(memberInfo.Name, bindingAttr); if (members.Length == 0) return false; Type memberUnderlyingType = GetMemberUnderlyingType(members[0]); if (!memberUnderlyingType.IsGenericParameter) return false; return true; } public static T GetAttribute(ICustomAttributeProvider attributeProvider) where T : Attribute { return GetAttribute(attributeProvider, true); } public static T GetAttribute(ICustomAttributeProvider attributeProvider, bool inherit) where T : Attribute { T[] attributes = GetAttributes(attributeProvider, inherit); return attributes.SingleOrDefault(); } #if !(NETFX_CORE) public static T[] GetAttributes(ICustomAttributeProvider attributeProvider, bool inherit) where T : Attribute { ValidationUtils.ArgumentNotNull(attributeProvider, "attributeProvider"); object provider; #if !PORTABLE provider = attributeProvider; #else provider = attributeProvider.UnderlyingObject; #endif // http://hyperthink.net/blog/getcustomattributes-gotcha/ // ICustomAttributeProvider doesn't do inheritance if (provider is Type) return (T[])((Type)provider).GetCustomAttributes(typeof(T), inherit); if (provider is Assembly) return (T[])Attribute.GetCustomAttributes((Assembly)provider, typeof(T)); if (provider is MemberInfo) return (T[])Attribute.GetCustomAttributes((MemberInfo)provider, typeof(T), inherit); #if !PORTABLE if (provider is Module) return (T[])Attribute.GetCustomAttributes((Module)provider, typeof(T), inherit); #endif if (provider is ParameterInfo) return (T[])Attribute.GetCustomAttributes((ParameterInfo)provider, typeof(T), inherit); #if !PORTABLE return (T[])attributeProvider.GetCustomAttributes(typeof(T), inherit); #else throw new Exception("Cannot get attributes from '{0}'.".FormatWith(CultureInfo.InvariantCulture, provider)); #endif } #else public static T[] GetAttributes(ICustomAttributeProvider attributeProvider, bool inherit) where T : Attribute { object provider = attributeProvider.UnderlyingObject; if (provider is Type) return ((Type)provider).GetTypeInfo().GetCustomAttributes(inherit).ToArray(); if (provider is Assembly) return ((Assembly)provider).GetCustomAttributes().ToArray(); if (provider is MemberInfo) return ((MemberInfo)provider).GetCustomAttributes(inherit).ToArray(); if (provider is Module) return ((Module)provider).GetCustomAttributes().ToArray(); if (provider is ParameterInfo) return ((ParameterInfo)provider).GetCustomAttributes(inherit).ToArray(); throw new Exception("Cannot get attributes from '{0}'.".FormatWith(CultureInfo.InvariantCulture, provider)); } #endif public static Type MakeGenericType(Type genericTypeDefinition, params Type[] innerTypes) { ValidationUtils.ArgumentNotNull(genericTypeDefinition, "genericTypeDefinition"); ValidationUtils.ArgumentNotNullOrEmpty(innerTypes, "innerTypes"); ValidationUtils.ArgumentConditionTrue(genericTypeDefinition.IsGenericTypeDefinition(), "genericTypeDefinition", "Type {0} is not a generic type definition.".FormatWith(CultureInfo.InvariantCulture, genericTypeDefinition)); return genericTypeDefinition.MakeGenericType(innerTypes); } public static object CreateGeneric(Type genericTypeDefinition, Type innerType, params object[] args) { return CreateGeneric(genericTypeDefinition, new [] { innerType }, args); } public static object CreateGeneric(Type genericTypeDefinition, IList innerTypes, params object[] args) { return CreateGeneric(genericTypeDefinition, innerTypes, (t, a) => CreateInstance(t, a.ToArray()), args); } public static object CreateGeneric(Type genericTypeDefinition, IList innerTypes, Func, object> instanceCreator, params object[] args) { ValidationUtils.ArgumentNotNull(genericTypeDefinition, "genericTypeDefinition"); ValidationUtils.ArgumentNotNullOrEmpty(innerTypes, "innerTypes"); ValidationUtils.ArgumentNotNull(instanceCreator, "createInstance"); Type specificType = MakeGenericType(genericTypeDefinition, innerTypes.ToArray()); return instanceCreator(specificType, args); } public static object CreateInstance(Type type, params object[] args) { ValidationUtils.ArgumentNotNull(type, "type"); #if !PocketPC return Activator.CreateInstance(type, args); #else // CF doesn't have a Activator.CreateInstance overload that takes args // lame if (type.IsValueType && CollectionUtils.IsNullOrEmpty(args)) return Activator.CreateInstance(type); ConstructorInfo[] constructors = type.GetConstructors(); ConstructorInfo match = constructors.Where(c => { ParameterInfo[] parameters = c.GetParameters(); if (parameters.Length != args.Length) return false; for (int i = 0; i < parameters.Length; i++) { ParameterInfo parameter = parameters[i]; object value = args[i]; if (!IsCompatibleValue(value, parameter.ParameterType)) return false; } return true; }).FirstOrDefault(); if (match == null) throw new Exception("Could not create '{0}' with given parameters.".FormatWith(CultureInfo.InvariantCulture, type)); return match.Invoke(args); #endif } public static void SplitFullyQualifiedTypeName(string fullyQualifiedTypeName, out string typeName, out string assemblyName) { int? assemblyDelimiterIndex = GetAssemblyDelimiterIndex(fullyQualifiedTypeName); if (assemblyDelimiterIndex != null) { typeName = fullyQualifiedTypeName.Substring(0, assemblyDelimiterIndex.Value).Trim(); assemblyName = fullyQualifiedTypeName.Substring(assemblyDelimiterIndex.Value + 1, fullyQualifiedTypeName.Length - assemblyDelimiterIndex.Value - 1).Trim(); } else { typeName = fullyQualifiedTypeName; assemblyName = null; } } private static int? GetAssemblyDelimiterIndex(string fullyQualifiedTypeName) { // we need to get the first comma following all surrounded in brackets because of generic types // e.g. System.Collections.Generic.Dictionary`2[[System.String, mscorlib,Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 int scope = 0; for (int i = 0; i < fullyQualifiedTypeName.Length; i++) { char current = fullyQualifiedTypeName[i]; switch (current) { case '[': scope++; break; case ']': scope--; break; case ',': if (scope == 0) return i; break; } } return null; } public static MemberInfo GetMemberInfoFromType(Type targetType, MemberInfo memberInfo) { const BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; switch (memberInfo.MemberType()) { case MemberTypes.Property: PropertyInfo propertyInfo = (PropertyInfo) memberInfo; Type[] types = propertyInfo.GetIndexParameters().Select(p => p.ParameterType).ToArray(); return targetType.GetProperty(propertyInfo.Name, bindingAttr, null, propertyInfo.PropertyType, types, null); default: return targetType.GetMember(memberInfo.Name, memberInfo.MemberType(), bindingAttr).SingleOrDefault(); } } public static IEnumerable GetFields(Type targetType, BindingFlags bindingAttr) { ValidationUtils.ArgumentNotNull(targetType, "targetType"); List fieldInfos = new List(targetType.GetFields(bindingAttr)); #if !NETFX_CORE // Type.GetFields doesn't return inherited private fields // manually find private fields from base class GetChildPrivateFields(fieldInfos, targetType, bindingAttr); #endif return fieldInfos.Cast(); } private static void GetChildPrivateFields(IList initialFields, Type targetType, BindingFlags bindingAttr) { // fix weirdness with private FieldInfos only being returned for the current Type // find base type fields and add them to result if ((bindingAttr & BindingFlags.NonPublic) != 0) { // modify flags to not search for public fields BindingFlags nonPublicBindingAttr = bindingAttr.RemoveFlag(BindingFlags.Public); while ((targetType = targetType.BaseType()) != null) { // filter out protected fields IEnumerable childPrivateFields = targetType.GetFields(nonPublicBindingAttr).Where(f => f.IsPrivate).Cast(); initialFields.AddRange(childPrivateFields); } } } public static IEnumerable GetProperties(Type targetType, BindingFlags bindingAttr) { ValidationUtils.ArgumentNotNull(targetType, "targetType"); List propertyInfos = new List(targetType.GetProperties(bindingAttr)); GetChildPrivateProperties(propertyInfos, targetType, bindingAttr); // a base class private getter/setter will be inaccessable unless the property was gotten from the base class for (int i = 0; i < propertyInfos.Count; i++) { PropertyInfo member = propertyInfos[i]; if (member.DeclaringType != targetType) { PropertyInfo declaredMember = (PropertyInfo)GetMemberInfoFromType(member.DeclaringType, member); propertyInfos[i] = declaredMember; } } return propertyInfos; } public static BindingFlags RemoveFlag(this BindingFlags bindingAttr, BindingFlags flag) { return ((bindingAttr & flag) == flag) ? bindingAttr ^ flag : bindingAttr; } private static void GetChildPrivateProperties(IList initialProperties, Type targetType, BindingFlags bindingAttr) { // fix weirdness with private PropertyInfos only being returned for the current Type // find base type properties and add them to result if ((bindingAttr & BindingFlags.NonPublic) != 0) { // modify flags to not search for public fields BindingFlags nonPublicBindingAttr = bindingAttr.RemoveFlag(BindingFlags.Public); while ((targetType = targetType.BaseType()) != null) { foreach (PropertyInfo propertyInfo in targetType.GetProperties(nonPublicBindingAttr)) { PropertyInfo nonPublicProperty = propertyInfo; // have to test on name rather than reference because instances are different // depending on the type that GetProperties was called on int index = initialProperties.IndexOf(p => p.Name == nonPublicProperty.Name); if (index == -1) { initialProperties.Add(nonPublicProperty); } else { // replace nonpublic properties for a child, but gotten from // the parent with the one from the child // the property gotten from the child will have access to private getter/setter initialProperties[index] = nonPublicProperty; } } } } } public static bool IsMethodOverridden(Type currentType, Type methodDeclaringType, string method) { bool isMethodOverriden = currentType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance) .Any(info => info.Name == method && // check that the method overrides the original on DynamicObjectProxy info.DeclaringType != methodDeclaringType // todo - find out whether there is a way to do this in winrt #if !NETFX_CORE && info.GetBaseDefinition().DeclaringType == methodDeclaringType #endif ); return isMethodOverriden; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/CollectionWrapper.cs0000644000175000017500000001533112253423361030771 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Collections.Generic; using System.Threading; using System.Globalization; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Utilities { internal interface IWrappedCollection : IList { object UnderlyingCollection { get; } } internal class CollectionWrapper : ICollection, IWrappedCollection { private readonly IList _list; private readonly ICollection _genericCollection; private object _syncRoot; public CollectionWrapper(IList list) { ValidationUtils.ArgumentNotNull(list, "list"); if (list is ICollection) _genericCollection = (ICollection)list; else _list = list; } public CollectionWrapper(ICollection list) { ValidationUtils.ArgumentNotNull(list, "list"); _genericCollection = list; } public virtual void Add(T item) { if (_genericCollection != null) _genericCollection.Add(item); else _list.Add(item); } public virtual void Clear() { if (_genericCollection != null) _genericCollection.Clear(); else _list.Clear(); } public virtual bool Contains(T item) { if (_genericCollection != null) return _genericCollection.Contains(item); else return _list.Contains(item); } public virtual void CopyTo(T[] array, int arrayIndex) { if (_genericCollection != null) _genericCollection.CopyTo(array, arrayIndex); else _list.CopyTo(array, arrayIndex); } public virtual int Count { get { if (_genericCollection != null) return _genericCollection.Count; else return _list.Count; } } public virtual bool IsReadOnly { get { if (_genericCollection != null) return _genericCollection.IsReadOnly; else return _list.IsReadOnly; } } public virtual bool Remove(T item) { if (_genericCollection != null) { return _genericCollection.Remove(item); } else { bool contains = _list.Contains(item); if (contains) _list.Remove(item); return contains; } } public virtual IEnumerator GetEnumerator() { if (_genericCollection != null) return _genericCollection.GetEnumerator(); return _list.Cast().GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { if (_genericCollection != null) return _genericCollection.GetEnumerator(); else return _list.GetEnumerator(); } int IList.Add(object value) { VerifyValueType(value); Add((T)value); return (Count - 1); } bool IList.Contains(object value) { if (IsCompatibleObject(value)) return Contains((T)value); return false; } int IList.IndexOf(object value) { if (_genericCollection != null) throw new InvalidOperationException("Wrapped ICollection does not support IndexOf."); if (IsCompatibleObject(value)) return _list.IndexOf((T)value); return -1; } void IList.RemoveAt(int index) { if (_genericCollection != null) throw new InvalidOperationException("Wrapped ICollection does not support RemoveAt."); _list.RemoveAt(index); } void IList.Insert(int index, object value) { if (_genericCollection != null) throw new InvalidOperationException("Wrapped ICollection does not support Insert."); VerifyValueType(value); _list.Insert(index, (T)value); } bool IList.IsFixedSize { get { if (_genericCollection != null) // ICollection only has IsReadOnly return _genericCollection.IsReadOnly; else return _list.IsFixedSize; } } void IList.Remove(object value) { if (IsCompatibleObject(value)) Remove((T)value); } object IList.this[int index] { get { if (_genericCollection != null) throw new InvalidOperationException("Wrapped ICollection does not support indexer."); return _list[index]; } set { if (_genericCollection != null) throw new InvalidOperationException("Wrapped ICollection does not support indexer."); VerifyValueType(value); _list[index] = (T)value; } } void ICollection.CopyTo(Array array, int arrayIndex) { CopyTo((T[])array, arrayIndex); } bool ICollection.IsSynchronized { get { return false; } } object ICollection.SyncRoot { get { if (_syncRoot == null) Interlocked.CompareExchange(ref _syncRoot, new object(), null); return _syncRoot; } } private static void VerifyValueType(object value) { if (!IsCompatibleObject(value)) throw new ArgumentException("The value '{0}' is not of type '{1}' and cannot be used in this generic collection.".FormatWith(CultureInfo.InvariantCulture, value, typeof(T)), "value"); } private static bool IsCompatibleObject(object value) { if (!(value is T) && (value != null || (typeof(T).IsValueType() && !ReflectionUtils.IsNullableType(typeof(T))))) return false; return true; } public object UnderlyingCollection { get { if (_genericCollection != null) return _genericCollection; else return _list; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/Base64Encoder.cs0000644000175000017500000000716112253423361027663 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.IO; namespace Newtonsoft.Json.Utilities { internal class Base64Encoder { private const int Base64LineSize = 76; private const int LineSizeInBytes = 57; private readonly char[] _charsLine = new char[Base64LineSize]; private readonly TextWriter _writer; private byte[] _leftOverBytes; private int _leftOverBytesCount; public Base64Encoder(TextWriter writer) { ValidationUtils.ArgumentNotNull(writer, "writer"); _writer = writer; } public void Encode(byte[] buffer, int index, int count) { if (buffer == null) throw new ArgumentNullException("buffer"); if (index < 0) throw new ArgumentOutOfRangeException("index"); if (count < 0) throw new ArgumentOutOfRangeException("count"); if (count > (buffer.Length - index)) throw new ArgumentOutOfRangeException("count"); if (_leftOverBytesCount > 0) { int leftOverBytesCount = _leftOverBytesCount; while (leftOverBytesCount < 3 && count > 0) { _leftOverBytes[leftOverBytesCount++] = buffer[index++]; count--; } if (count == 0 && leftOverBytesCount < 3) { _leftOverBytesCount = leftOverBytesCount; return; } int num2 = Convert.ToBase64CharArray(_leftOverBytes, 0, 3, _charsLine, 0); WriteChars(_charsLine, 0, num2); } _leftOverBytesCount = count % 3; if (_leftOverBytesCount > 0) { count -= _leftOverBytesCount; if (_leftOverBytes == null) { _leftOverBytes = new byte[3]; } for (int i = 0; i < _leftOverBytesCount; i++) { _leftOverBytes[i] = buffer[(index + count) + i]; } } int num4 = index + count; int length = LineSizeInBytes; while (index < num4) { if ((index + length) > num4) { length = num4 - index; } int num6 = Convert.ToBase64CharArray(buffer, index, length, _charsLine, 0); WriteChars(_charsLine, 0, num6); index += length; } } public void Flush() { if (_leftOverBytesCount > 0) { int count = Convert.ToBase64CharArray(_leftOverBytes, 0, _leftOverBytesCount, _charsLine, 0); WriteChars(_charsLine, 0, count); _leftOverBytesCount = 0; } } private void WriteChars(char[] chars, int index, int count) { _writer.Write(chars, index, count); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/CollectionUtils.cs0000644000175000017500000003245712253423361030461 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Reflection; using System.Text; using System.Collections; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif using System.Globalization; using Newtonsoft.Json.Serialization; namespace Newtonsoft.Json.Utilities { internal static class CollectionUtils { public static IEnumerable CastValid(this IEnumerable enumerable) { ValidationUtils.ArgumentNotNull(enumerable, "enumerable"); return enumerable.Cast().Where(o => o is T).Cast(); } /// /// Determines whether the collection is null or empty. /// /// The collection. /// /// true if the collection is null or empty; otherwise, false. /// public static bool IsNullOrEmpty(ICollection collection) { if (collection != null) { return (collection.Count == 0); } return true; } /// /// Adds the elements of the specified collection to the specified generic IList. /// /// The list to add to. /// The collection of elements to add. public static void AddRange(this IList initial, IEnumerable collection) { if (initial == null) throw new ArgumentNullException("initial"); if (collection == null) return; foreach (T value in collection) { initial.Add(value); } } public static void AddRange(this IList initial, IEnumerable collection) { ValidationUtils.ArgumentNotNull(initial, "initial"); ListWrapper wrapper = new ListWrapper(initial); wrapper.AddRange(collection.Cast()); } public static IList CreateGenericList(Type listType) { ValidationUtils.ArgumentNotNull(listType, "listType"); return (IList)ReflectionUtils.CreateGeneric(typeof(List<>), listType); } public static bool IsDictionaryType(Type type) { ValidationUtils.ArgumentNotNull(type, "type"); if (typeof(IDictionary).IsAssignableFrom(type)) return true; if (ReflectionUtils.ImplementsGenericDefinition(type, typeof (IDictionary<,>))) return true; return false; } public static IWrappedCollection CreateCollectionWrapper(object list) { ValidationUtils.ArgumentNotNull(list, "list"); Type collectionDefinition; if (ReflectionUtils.ImplementsGenericDefinition(list.GetType(), typeof(ICollection<>), out collectionDefinition)) { Type collectionItemType = ReflectionUtils.GetCollectionItemType(collectionDefinition); // Activator.CreateInstance throws AmbiguousMatchException. Manually invoke constructor Func, object> instanceCreator = (t, a) => { ConstructorInfo c = t.GetConstructor(new[] { collectionDefinition }); return c.Invoke(new[] { list }); }; return (IWrappedCollection)ReflectionUtils.CreateGeneric(typeof(CollectionWrapper<>), new[] { collectionItemType }, instanceCreator, list); } else if (list is IList) { return new CollectionWrapper((IList)list); } else { throw new ArgumentException("Can not create ListWrapper for type {0}.".FormatWith(CultureInfo.InvariantCulture, list.GetType()), "list"); } } public static IWrappedDictionary CreateDictionaryWrapper(object dictionary) { ValidationUtils.ArgumentNotNull(dictionary, "dictionary"); Type dictionaryDefinition; if (ReflectionUtils.ImplementsGenericDefinition(dictionary.GetType(), typeof(IDictionary<,>), out dictionaryDefinition)) { Type dictionaryKeyType = ReflectionUtils.GetDictionaryKeyType(dictionaryDefinition); Type dictionaryValueType = ReflectionUtils.GetDictionaryValueType(dictionaryDefinition); // Activator.CreateInstance throws AmbiguousMatchException. Manually invoke constructor Func, object> instanceCreator = (t, a) => { ConstructorInfo c = t.GetConstructor(new[] { dictionaryDefinition }); return c.Invoke(new[] { dictionary }); }; return (IWrappedDictionary)ReflectionUtils.CreateGeneric(typeof(DictionaryWrapper<,>), new[] { dictionaryKeyType, dictionaryValueType }, instanceCreator, dictionary); } else if (dictionary is IDictionary) { return new DictionaryWrapper((IDictionary)dictionary); } else { throw new ArgumentException("Can not create DictionaryWrapper for type {0}.".FormatWith(CultureInfo.InvariantCulture, dictionary.GetType()), "dictionary"); } } public static IList CreateList(Type listType, out bool isReadOnlyOrFixedSize) { ValidationUtils.ArgumentNotNull(listType, "listType"); IList list; Type collectionType; isReadOnlyOrFixedSize = false; if (listType.IsArray) { // have to use an arraylist when creating array // there is no way to know the size until it is finised list = new List(); isReadOnlyOrFixedSize = true; } else if (ReflectionUtils.InheritsGenericDefinition(listType, typeof(ReadOnlyCollection<>), out collectionType)) { Type readOnlyCollectionContentsType = collectionType.GetGenericArguments()[0]; Type genericEnumerable = ReflectionUtils.MakeGenericType(typeof(IEnumerable<>), readOnlyCollectionContentsType); bool suitableConstructor = false; foreach (ConstructorInfo constructor in listType.GetConstructors()) { IList parameters = constructor.GetParameters(); if (parameters.Count == 1) { if (genericEnumerable.IsAssignableFrom(parameters[0].ParameterType)) { suitableConstructor = true; break; } } } if (!suitableConstructor) throw new Exception("Read-only type {0} does not have a public constructor that takes a type that implements {1}.".FormatWith(CultureInfo.InvariantCulture, listType, genericEnumerable)); // can't add or modify a readonly list // use List and convert once populated list = CreateGenericList(readOnlyCollectionContentsType); isReadOnlyOrFixedSize = true; } else if (typeof(IList).IsAssignableFrom(listType)) { if (ReflectionUtils.IsInstantiatableType(listType)) list = (IList)Activator.CreateInstance(listType); else if (listType == typeof(IList)) list = new List(); else list = null; } else if (ReflectionUtils.ImplementsGenericDefinition(listType, typeof(ICollection<>))) { if (ReflectionUtils.IsInstantiatableType(listType)) list = CreateCollectionWrapper(Activator.CreateInstance(listType)); else list = null; } else { list = null; } if (list == null) throw new InvalidOperationException("Cannot create and populate list type {0}.".FormatWith(CultureInfo.InvariantCulture, listType)); return list; } public static Array ToArray(Array initial, Type type) { if (type == null) throw new ArgumentNullException("type"); Array destinationArray = Array.CreateInstance(type, initial.Length); Array.Copy(initial, 0, destinationArray, 0, initial.Length); return destinationArray; } public static bool AddDistinct(this IList list, T value) { return list.AddDistinct(value, EqualityComparer.Default); } public static bool AddDistinct(this IList list, T value, IEqualityComparer comparer) { if (list.ContainsValue(value, comparer)) return false; list.Add(value); return true; } // this is here because LINQ Bridge doesn't support Contains with IEqualityComparer public static bool ContainsValue(this IEnumerable source, TSource value, IEqualityComparer comparer) { if (comparer == null) comparer = EqualityComparer.Default; if (source == null) throw new ArgumentNullException("source"); foreach (TSource local in source) { if (comparer.Equals(local, value)) return true; } return false; } public static bool AddRangeDistinct(this IList list, IEnumerable values, IEqualityComparer comparer) { bool allAdded = true; foreach (T value in values) { if (!list.AddDistinct(value, comparer)) allAdded = false; } return allAdded; } public static int IndexOf(this IEnumerable collection, Func predicate) { int index = 0; foreach (T value in collection) { if (predicate(value)) return index; index++; } return -1; } /// /// Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. /// /// The type of the elements of source. /// A sequence in which to locate a value. /// The object to locate in the sequence /// An equality comparer to compare values. /// The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, 1. public static int IndexOf(this IEnumerable list, TSource value, IEqualityComparer comparer) { int index = 0; foreach (TSource item in list) { if (comparer.Equals(item, value)) { return index; } index++; } return -1; } private static IList GetDimensions(IList values) { IList dimensions = new List(); IList currentArray = values; while (true) { dimensions.Add(currentArray.Count); if (currentArray.Count == 0) break; object v = currentArray[0]; if (v is IList) currentArray = (IList)v; else break; } return dimensions; } private static void CopyFromJaggedToMultidimensionalArray(IList values, Array multidimensionalArray, int[] indices) { int dimension = indices.Length; if (dimension == multidimensionalArray.Rank) { multidimensionalArray.SetValue(JaggedArrayGetValue(values, indices), indices); return; } int dimensionLength = multidimensionalArray.GetLength(dimension); IList list = (IList)JaggedArrayGetValue(values, indices); int currentValuesLength = list.Count; if (currentValuesLength != dimensionLength) throw new Exception("Cannot deserialize non-cubical array as multidimensional array."); int[] newIndices = new int[dimension + 1]; for (int i = 0; i < dimension; i++) { newIndices[i] = indices[i]; } for (int i = 0; i < multidimensionalArray.GetLength(dimension); i++) { newIndices[dimension] = i; CopyFromJaggedToMultidimensionalArray(values, multidimensionalArray, newIndices); } } private static object JaggedArrayGetValue(IList values, int[] indices) { IList currentList = values; for (int i = 0; i < indices.Length; i++) { int index = indices[i]; if (i == indices.Length - 1) return currentList[index]; else currentList = (IList)currentList[index]; } return currentList; } public static Array ToMultidimensionalArray(IList values, Type type, int rank) { IList dimensions = GetDimensions(values); while (dimensions.Count < rank) { dimensions.Add(0); } Array multidimensionalArray = Array.CreateInstance(type, dimensions.ToArray()); CopyFromJaggedToMultidimensionalArray(values, multidimensionalArray, new int[0]); return multidimensionalArray; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/MethodCall.cs0000644000175000017500000000237312253423361027353 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json.Utilities { internal delegate TResult MethodCall(T target, params object[] args); }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DateTimeUtils.cs0000644000175000017500000000444712253423361030060 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Xml; using System.Globalization; namespace Newtonsoft.Json.Utilities { internal static class DateTimeUtils { public static string GetUtcOffsetText(this DateTime d) { TimeSpan utcOffset = d.GetUtcOffset(); return utcOffset.Hours.ToString("+00;-00", CultureInfo.InvariantCulture) + ":" + utcOffset.Minutes.ToString("00;00", CultureInfo.InvariantCulture); } public static TimeSpan GetUtcOffset(this DateTime d) { #if NET20 return TimeZone.CurrentTimeZone.GetUtcOffset(d); #else return TimeZoneInfo.Local.GetUtcOffset(d); #endif } #if !(NETFX_CORE || PORTABLE) public static XmlDateTimeSerializationMode ToSerializationMode(DateTimeKind kind) { switch (kind) { case DateTimeKind.Local: return XmlDateTimeSerializationMode.Local; case DateTimeKind.Unspecified: return XmlDateTimeSerializationMode.Unspecified; case DateTimeKind.Utc: return XmlDateTimeSerializationMode.Utc; default: throw MiscellaneousUtils.CreateArgumentOutOfRangeException("kind", kind, "Unexpected DateTimeKind value."); } } #endif } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/EnumValues.cs0000644000175000017500000000262412253423361027422 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections.ObjectModel; namespace Newtonsoft.Json.Utilities { internal class EnumValues : KeyedCollection> where T : struct { protected override string GetKeyForItem(EnumValue item) { return item.Name; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/StringReference.cs0000644000175000017500000000342612253423361030424 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json.Utilities { internal struct StringReference { private readonly char[] _chars; private readonly int _startIndex; private readonly int _length; public char[] Chars { get { return _chars; } } public int StartIndex { get { return _startIndex; } } public int Length { get { return _length; } } public StringReference(char[] chars, int startIndex, int length) { _chars = chars; _startIndex = startIndex; _length = length; } public override string ToString() { return new string(_chars, _startIndex, _length); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/EnumUtils.cs0000644000175000017500000001205212253423361027257 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Globalization; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif using System.Reflection; namespace Newtonsoft.Json.Utilities { internal static class EnumUtils { public static IList GetFlagsValues(T value) where T : struct { Type enumType = typeof(T); if (!enumType.IsDefined(typeof(FlagsAttribute), false)) throw new ArgumentException("Enum type {0} is not a set of flags.".FormatWith(CultureInfo.InvariantCulture, enumType)); Type underlyingType = Enum.GetUnderlyingType(value.GetType()); ulong num = Convert.ToUInt64(value, CultureInfo.InvariantCulture); EnumValues enumNameValues = GetNamesAndValues(); IList selectedFlagsValues = new List(); foreach (EnumValue enumNameValue in enumNameValues) { if ((num & enumNameValue.Value) == enumNameValue.Value && enumNameValue.Value != 0) selectedFlagsValues.Add((T)Convert.ChangeType(enumNameValue.Value, underlyingType, CultureInfo.CurrentCulture)); } if (selectedFlagsValues.Count == 0 && enumNameValues.SingleOrDefault(v => v.Value == 0) != null) selectedFlagsValues.Add(default(T)); return selectedFlagsValues; } /// /// Gets a dictionary of the names and values of an Enum type. /// /// public static EnumValues GetNamesAndValues() where T : struct { return GetNamesAndValues(typeof(T)); } /// /// Gets a dictionary of the names and values of an Enum type. /// /// The enum type to get names and values for. /// public static EnumValues GetNamesAndValues(Type enumType) where TUnderlyingType : struct { if (enumType == null) throw new ArgumentNullException("enumType"); ValidationUtils.ArgumentTypeIsEnum(enumType, "enumType"); IList enumValues = GetValues(enumType); IList enumNames = GetNames(enumType); EnumValues nameValues = new EnumValues(); for (int i = 0; i < enumValues.Count; i++) { try { nameValues.Add(new EnumValue(enumNames[i], (TUnderlyingType)Convert.ChangeType(enumValues[i], typeof(TUnderlyingType), CultureInfo.CurrentCulture))); } catch (OverflowException e) { throw new InvalidOperationException( string.Format(CultureInfo.InvariantCulture, "Value from enum with the underlying type of {0} cannot be added to dictionary with a value type of {1}. Value was too large: {2}", Enum.GetUnderlyingType(enumType), typeof(TUnderlyingType), Convert.ToUInt64(enumValues[i], CultureInfo.InvariantCulture)), e); } } return nameValues; } public static IList GetValues(Type enumType) { if (!enumType.IsEnum()) throw new ArgumentException("Type '" + enumType.Name + "' is not an enum."); List values = new List(); var fields = from field in enumType.GetFields() where field.IsLiteral select field; foreach (FieldInfo field in fields) { object value = field.GetValue(enumType); values.Add(value); } return values; } public static IList GetNames(Type enumType) { if (!enumType.IsEnum()) throw new ArgumentException("Type '" + enumType.Name + "' is not an enum."); List values = new List(); var fields = from field in enumType.GetFields() where field.IsLiteral select field; foreach (FieldInfo field in fields) { values.Add(field.Name); } return values; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/LateBoundReflectionDelegateFactory.cs0000644000175000017500000000607012253423361034210 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using Newtonsoft.Json.Serialization; using System.Reflection; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #endif namespace Newtonsoft.Json.Utilities { internal class LateBoundReflectionDelegateFactory : ReflectionDelegateFactory { private static readonly LateBoundReflectionDelegateFactory _instance = new LateBoundReflectionDelegateFactory(); internal static ReflectionDelegateFactory Instance { get { return _instance; } } public override MethodCall CreateMethodCall(MethodBase method) { ValidationUtils.ArgumentNotNull(method, "method"); ConstructorInfo c = method as ConstructorInfo; if (c != null) return (o, a) => c.Invoke(a); return (o, a) => method.Invoke(o, a); } public override Func CreateDefaultConstructor(Type type) { ValidationUtils.ArgumentNotNull(type, "type"); if (type.IsValueType()) return () => (T)ReflectionUtils.CreateInstance(type); ConstructorInfo constructorInfo = ReflectionUtils.GetDefaultConstructor(type, true); return () => (T)constructorInfo.Invoke(null); } public override Func CreateGet(PropertyInfo propertyInfo) { ValidationUtils.ArgumentNotNull(propertyInfo, "propertyInfo"); return o => propertyInfo.GetValue(o, null); } public override Func CreateGet(FieldInfo fieldInfo) { ValidationUtils.ArgumentNotNull(fieldInfo, "fieldInfo"); return o => fieldInfo.GetValue(o); } public override Action CreateSet(FieldInfo fieldInfo) { ValidationUtils.ArgumentNotNull(fieldInfo, "fieldInfo"); return (o, v) => fieldInfo.SetValue(o, v); } public override Action CreateSet(PropertyInfo propertyInfo) { ValidationUtils.ArgumentNotNull(propertyInfo, "propertyInfo"); return (o, v) => propertyInfo.SetValue(o, v, null); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicUtils.cs0000644000175000017500000002241712253423361027745 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) using System; using System.Collections.Generic; using System.Dynamic; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using System.Globalization; using Newtonsoft.Json.Serialization; namespace Newtonsoft.Json.Utilities { internal static class DynamicUtils { internal static class BinderWrapper { #if !SILVERLIGHT public const string CSharpAssemblyName = "Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; #else public const string CSharpAssemblyName = "Microsoft.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; #endif private const string BinderTypeName = "Microsoft.CSharp.RuntimeBinder.Binder, " + CSharpAssemblyName; private const string CSharpArgumentInfoTypeName = "Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo, " + CSharpAssemblyName; private const string CSharpArgumentInfoFlagsTypeName = "Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, " + CSharpAssemblyName; private const string CSharpBinderFlagsTypeName = "Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags, " + CSharpAssemblyName; private static object _getCSharpArgumentInfoArray; private static object _setCSharpArgumentInfoArray; private static MethodCall _getMemberCall; private static MethodCall _setMemberCall; private static bool _init; private static void Init() { if (!_init) { Type binderType = Type.GetType(BinderTypeName, false); if (binderType == null) throw new InvalidOperationException("Could not resolve type '{0}'. You may need to add a reference to Microsoft.CSharp.dll to work with dynamic types.".FormatWith(CultureInfo.InvariantCulture, BinderTypeName)); // None _getCSharpArgumentInfoArray = CreateSharpArgumentInfoArray(0); // None, Constant | UseCompileTimeType _setCSharpArgumentInfoArray = CreateSharpArgumentInfoArray(0, 3); CreateMemberCalls(); _init = true; } } private static object CreateSharpArgumentInfoArray(params int[] values) { Type csharpArgumentInfoType = Type.GetType(CSharpArgumentInfoTypeName); Type csharpArgumentInfoFlags = Type.GetType(CSharpArgumentInfoFlagsTypeName); Array a = Array.CreateInstance(csharpArgumentInfoType, values.Length); for (int i = 0; i < values.Length; i++) { MethodInfo createArgumentInfoMethod = csharpArgumentInfoType.GetMethod("Create", BindingFlags.Public | BindingFlags.Static, null, new[] { csharpArgumentInfoFlags, typeof(string) }, null); object arg = createArgumentInfoMethod.Invoke(null, new object[] { 0, null }); a.SetValue(arg, i); } return a; } private static void CreateMemberCalls() { Type csharpArgumentInfoType = Type.GetType(CSharpArgumentInfoTypeName); Type csharpBinderFlagsType = Type.GetType(CSharpBinderFlagsTypeName); Type binderType = Type.GetType(BinderTypeName); Type csharpArgumentInfoTypeEnumerableType = typeof(IEnumerable<>).MakeGenericType(csharpArgumentInfoType); MethodInfo getMemberMethod = binderType.GetMethod("GetMember", BindingFlags.Public | BindingFlags.Static, null, new[] { csharpBinderFlagsType, typeof(string), typeof(Type), csharpArgumentInfoTypeEnumerableType }, null); _getMemberCall = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall(getMemberMethod); MethodInfo setMemberMethod = binderType.GetMethod("SetMember", BindingFlags.Public | BindingFlags.Static, null, new[] { csharpBinderFlagsType, typeof(string), typeof(Type), csharpArgumentInfoTypeEnumerableType }, null); _setMemberCall = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall(setMemberMethod); } public static CallSiteBinder GetMember(string name, Type context) { Init(); return (CallSiteBinder)_getMemberCall(null, 0, name, context, _getCSharpArgumentInfoArray); } public static CallSiteBinder SetMember(string name, Type context) { Init(); return (CallSiteBinder)_setMemberCall(null, 0, name, context, _setCSharpArgumentInfoArray); } } public static bool TryGetMember(this IDynamicMetaObjectProvider dynamicProvider, string name, out object value) { ValidationUtils.ArgumentNotNull(dynamicProvider, "dynamicProvider"); GetMemberBinder getMemberBinder = (GetMemberBinder) BinderWrapper.GetMember(name, typeof (DynamicUtils)); CallSite> callSite = CallSite>.Create(new NoThrowGetBinderMember(getMemberBinder)); object result = callSite.Target(callSite, dynamicProvider); if (!ReferenceEquals(result, NoThrowExpressionVisitor.ErrorResult)) { value = result; return true; } else { value = null; return false; } } public static bool TrySetMember(this IDynamicMetaObjectProvider dynamicProvider, string name, object value) { ValidationUtils.ArgumentNotNull(dynamicProvider, "dynamicProvider"); SetMemberBinder binder = (SetMemberBinder)BinderWrapper.SetMember(name, typeof(DynamicUtils)); var setterSite = CallSite>.Create(new NoThrowSetBinderMember(binder)); object result = setterSite.Target(setterSite, dynamicProvider, value); return !ReferenceEquals(result, NoThrowExpressionVisitor.ErrorResult); } public static IEnumerable GetDynamicMemberNames(this IDynamicMetaObjectProvider dynamicProvider) { DynamicMetaObject metaObject = dynamicProvider.GetMetaObject(Expression.Constant(dynamicProvider)); return metaObject.GetDynamicMemberNames(); } internal class NoThrowGetBinderMember : GetMemberBinder { private readonly GetMemberBinder _innerBinder; public NoThrowGetBinderMember(GetMemberBinder innerBinder) : base(innerBinder.Name, innerBinder.IgnoreCase) { _innerBinder = innerBinder; } public override DynamicMetaObject FallbackGetMember(DynamicMetaObject target, DynamicMetaObject errorSuggestion) { DynamicMetaObject retMetaObject = _innerBinder.Bind(target, new DynamicMetaObject[] { }); NoThrowExpressionVisitor noThrowVisitor = new NoThrowExpressionVisitor(); Expression resultExpression = noThrowVisitor.Visit(retMetaObject.Expression); DynamicMetaObject finalMetaObject = new DynamicMetaObject(resultExpression, retMetaObject.Restrictions); return finalMetaObject; } } internal class NoThrowSetBinderMember : SetMemberBinder { private readonly SetMemberBinder _innerBinder; public NoThrowSetBinderMember(SetMemberBinder innerBinder) : base(innerBinder.Name, innerBinder.IgnoreCase) { _innerBinder = innerBinder; } public override DynamicMetaObject FallbackSetMember(DynamicMetaObject target, DynamicMetaObject value, DynamicMetaObject errorSuggestion) { DynamicMetaObject retMetaObject = _innerBinder.Bind(target, new DynamicMetaObject[] { value }); NoThrowExpressionVisitor noThrowVisitor = new NoThrowExpressionVisitor(); Expression resultExpression = noThrowVisitor.Visit(retMetaObject.Expression); DynamicMetaObject finalMetaObject = new DynamicMetaObject(resultExpression, retMetaObject.Restrictions); return finalMetaObject; } } internal class NoThrowExpressionVisitor : ExpressionVisitor { internal static readonly object ErrorResult = new object(); protected override Expression VisitConditional(ConditionalExpression node) { // if the result of a test is to throw an error, rewrite to result an error result value if (node.IfFalse.NodeType == ExpressionType.Throw) return Expression.Condition(node.Test, node.IfTrue, Expression.Constant(ErrorResult)); return base.VisitConditional(node); } } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/JavaScriptUtils.cs0000644000175000017500000001205612253423361030425 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Globalization; using System.IO; using System.Text; using System.Text.RegularExpressions; using System.Collections.Generic; namespace Newtonsoft.Json.Utilities { internal static class JavaScriptUtils { private const string EscapedUnicodeText = "!"; public static void WriteEscapedJavaScriptString(TextWriter writer, string s, char delimiter, bool appendDelimiters) { // leading delimiter if (appendDelimiters) writer.Write(delimiter); if (s != null) { char[] chars = null; char[] unicodeBuffer = null; int lastWritePosition = 0; for (int i = 0; i < s.Length; i++) { var c = s[i]; // don't escape standard text/numbers except '\' and the text delimiter if (c >= ' ' && c < 128 && c != '\\' && c != delimiter) continue; string escapedValue; switch (c) { case '\t': escapedValue = @"\t"; break; case '\n': escapedValue = @"\n"; break; case '\r': escapedValue = @"\r"; break; case '\f': escapedValue = @"\f"; break; case '\b': escapedValue = @"\b"; break; case '\\': escapedValue = @"\\"; break; case '\u0085': // Next Line escapedValue = @"\u0085"; break; case '\u2028': // Line Separator escapedValue = @"\u2028"; break; case '\u2029': // Paragraph Separator escapedValue = @"\u2029"; break; case '\'': // this charater is being used as the delimiter escapedValue = @"\'"; break; case '"': // this charater is being used as the delimiter escapedValue = "\\\""; break; default: if (c <= '\u001f') { if (unicodeBuffer == null) unicodeBuffer = new char[6]; StringUtils.ToCharAsUnicode(c, unicodeBuffer); // slightly hacky but it saves multiple conditions in if test escapedValue = EscapedUnicodeText; } else { escapedValue = null; } break; } if (escapedValue == null) continue; if (i > lastWritePosition) { if (chars == null) chars = s.ToCharArray(); // write unchanged chars before writing escaped text writer.Write(chars, lastWritePosition, i - lastWritePosition); } lastWritePosition = i + 1; if (!string.Equals(escapedValue, EscapedUnicodeText)) writer.Write(escapedValue); else writer.Write(unicodeBuffer); } if (lastWritePosition == 0) { // no escaped text, write entire string writer.Write(s); } else { if (chars == null) chars = s.ToCharArray(); // write remaining text writer.Write(chars, lastWritePosition, s.Length - lastWritePosition); } } // trailing delimiter if (appendDelimiters) writer.Write(delimiter); } public static string ToEscapedJavaScriptString(string value) { return ToEscapedJavaScriptString(value, '"', true); } public static string ToEscapedJavaScriptString(string value, char delimiter, bool appendDelimiters) { using (StringWriter w = StringUtils.CreateStringWriter(StringUtils.GetLength(value) ?? 16)) { WriteEscapedJavaScriptString(w, value, delimiter, appendDelimiters); return w.ToString(); } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/StringUtils.cs0000644000175000017500000001333412253423361027625 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Globalization; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif using Newtonsoft.Json.Serialization; namespace Newtonsoft.Json.Utilities { internal static class StringUtils { public const string CarriageReturnLineFeed = "\r\n"; public const string Empty = ""; public const char CarriageReturn = '\r'; public const char LineFeed = '\n'; public const char Tab = '\t'; public static string FormatWith(this string format, IFormatProvider provider, object arg0) { return format.FormatWith(provider, new[] { arg0 }); } public static string FormatWith(this string format, IFormatProvider provider, object arg0, object arg1) { return format.FormatWith(provider, new[] { arg0, arg1 }); } public static string FormatWith(this string format, IFormatProvider provider, object arg0, object arg1, object arg2) { return format.FormatWith(provider, new[] { arg0, arg1, arg2 }); } public static string FormatWith(this string format, IFormatProvider provider, params object[] args) { ValidationUtils.ArgumentNotNull(format, "format"); return string.Format(provider, format, args); } /// /// Determines whether the string is all white space. Empty string will return false. /// /// The string to test whether it is all white space. /// /// true if the string is all white space; otherwise, false. /// public static bool IsWhiteSpace(string s) { if (s == null) throw new ArgumentNullException("s"); if (s.Length == 0) return false; for (int i = 0; i < s.Length; i++) { if (!char.IsWhiteSpace(s[i])) return false; } return true; } /// /// Nulls an empty string. /// /// The string. /// Null if the string was null, otherwise the string unchanged. public static string NullEmptyString(string s) { return (string.IsNullOrEmpty(s)) ? null : s; } public static StringWriter CreateStringWriter(int capacity) { StringBuilder sb = new StringBuilder(capacity); StringWriter sw = new StringWriter(sb, CultureInfo.InvariantCulture); return sw; } public static int? GetLength(string value) { if (value == null) return null; else return value.Length; } public static void ToCharAsUnicode(char c, char[] buffer) { buffer[0] = '\\'; buffer[1] = 'u'; buffer[2] = MathUtils.IntToHex((c >> 12) & '\x000f'); buffer[3] = MathUtils.IntToHex((c >> 8) & '\x000f'); buffer[4] = MathUtils.IntToHex((c >> 4) & '\x000f'); buffer[5] = MathUtils.IntToHex(c & '\x000f'); } public static TSource ForgivingCaseSensitiveFind(this IEnumerable source, Func valueSelector, string testValue) { if (source == null) throw new ArgumentNullException("source"); if (valueSelector == null) throw new ArgumentNullException("valueSelector"); var caseInsensitiveResults = source.Where(s => string.Equals(valueSelector(s), testValue, StringComparison.OrdinalIgnoreCase)); if (caseInsensitiveResults.Count() <= 1) { return caseInsensitiveResults.SingleOrDefault(); } else { // multiple results returned. now filter using case sensitivity var caseSensitiveResults = source.Where(s => string.Equals(valueSelector(s), testValue, StringComparison.Ordinal)); return caseSensitiveResults.SingleOrDefault(); } } public static string ToCamelCase(string s) { if (string.IsNullOrEmpty(s)) return s; if (!char.IsUpper(s[0])) return s; string camelCase = null; #if !(NETFX_CORE || PORTABLE) camelCase = char.ToLower(s[0], CultureInfo.InvariantCulture).ToString(CultureInfo.InvariantCulture); #else camelCase = char.ToLower(s[0]).ToString(); #endif if (s.Length > 1) camelCase += s.Substring(1); return camelCase; } public static bool IsHighSurrogate(char c) { #if !(SILVERLIGHT || PORTABLE) return char.IsHighSurrogate(c); #else return (c >= 55296 && c <= 56319); #endif } public static bool IsLowSurrogate(char c) { #if !(SILVERLIGHT || PORTABLE) return char.IsLowSurrogate(c); #else return (c >= 56320 && c <= 57343); #endif } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/MathUtils.cs0000644000175000017500000000503512253423361027247 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Text; namespace Newtonsoft.Json.Utilities { internal class MathUtils { public static int IntLength(int i) { if (i < 0) throw new ArgumentOutOfRangeException(); if (i == 0) return 1; return (int)Math.Floor(Math.Log10(i)) + 1; } public static char IntToHex(int n) { if (n <= 9) return (char)(n + 48); return (char)((n - 10) + 97); } public static int? Min(int? val1, int? val2) { if (val1 == null) return val2; if (val2 == null) return val1; return Math.Min(val1.Value, val2.Value); } public static int? Max(int? val1, int? val2) { if (val1 == null) return val2; if (val2 == null) return val1; return Math.Max(val1.Value, val2.Value); } public static double? Max(double? val1, double? val2) { if (val1 == null) return val2; if (val2 == null) return val1; return Math.Max(val1.Value, val2.Value); } public static bool ApproxEquals(double d1, double d2) { const double epsilon = 2.2204460492503131E-16; if (d1 == d2) return true; double tolerance = ((Math.Abs(d1) + Math.Abs(d2)) + 10.0) * epsilon; double difference = d1 - d2; return (-tolerance < difference && tolerance > difference); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicProxy.cs0000644000175000017500000000635712253423361027773 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) using System; using System.Collections.Generic; using System.Dynamic; using System.Linq; using System.Linq.Expressions; using System.Text; namespace Newtonsoft.Json.Utilities { internal class DynamicProxy { public virtual IEnumerable GetDynamicMemberNames(T instance) { return new string[0]; } public virtual bool TryBinaryOperation(T instance, BinaryOperationBinder binder, object arg, out object result) { result = null; return false; } public virtual bool TryConvert(T instance, ConvertBinder binder, out object result) { result = null; return false; } public virtual bool TryCreateInstance(T instance, CreateInstanceBinder binder, object[] args, out object result) { result = null; return false; } public virtual bool TryDeleteIndex(T instance, DeleteIndexBinder binder, object[] indexes) { return false; } public virtual bool TryDeleteMember(T instance, DeleteMemberBinder binder) { return false; } public virtual bool TryGetIndex(T instance, GetIndexBinder binder, object[] indexes, out object result) { result = null; return false; } public virtual bool TryGetMember(T instance, GetMemberBinder binder, out object result) { result = null; return false; } public virtual bool TryInvoke(T instance, InvokeBinder binder, object[] args, out object result) { result = null; return false; } public virtual bool TryInvokeMember(T instance, InvokeMemberBinder binder, object[] args, out object result) { result = null; return false; } public virtual bool TrySetIndex(T instance, SetIndexBinder binder, object[] indexes, object value) { return false; } public virtual bool TrySetMember(T instance, SetMemberBinder binder, object value) { return false; } public virtual bool TryUnaryOperation(T instance, UnaryOperationBinder binder, out object result) { result = null; return false; } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicProxyMetaObject.cs0000644000175000017500000003644012253423361031725 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) using System; using System.Collections.Generic; using System.Dynamic; using System.Linq; using System.Linq.Expressions; using System.Reflection; namespace Newtonsoft.Json.Utilities { internal sealed class DynamicProxyMetaObject : DynamicMetaObject { private readonly DynamicProxy _proxy; private readonly bool _dontFallbackFirst; internal DynamicProxyMetaObject(Expression expression, T value, DynamicProxy proxy, bool dontFallbackFirst) : base(expression, BindingRestrictions.Empty, value) { _proxy = proxy; _dontFallbackFirst = dontFallbackFirst; } private new T Value { get { return (T)base.Value; } } private bool IsOverridden(string method) { return ReflectionUtils.IsMethodOverridden(_proxy.GetType(), typeof (DynamicProxy), method); } public override DynamicMetaObject BindGetMember(GetMemberBinder binder) { return IsOverridden("TryGetMember") ? CallMethodWithResult("TryGetMember", binder, NoArgs, e => binder.FallbackGetMember(this, e)) : base.BindGetMember(binder); } public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value) { return IsOverridden("TrySetMember") ? CallMethodReturnLast("TrySetMember", binder, GetArgs(value), e => binder.FallbackSetMember(this, value, e)) : base.BindSetMember(binder, value); } public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder) { return IsOverridden("TryDeleteMember") ? CallMethodNoResult("TryDeleteMember", binder, NoArgs, e => binder.FallbackDeleteMember(this, e)) : base.BindDeleteMember(binder); } public override DynamicMetaObject BindConvert(ConvertBinder binder) { return IsOverridden("TryConvert") ? CallMethodWithResult("TryConvert", binder, NoArgs, e => binder.FallbackConvert(this, e)) : base.BindConvert(binder); } public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args) { if (!IsOverridden("TryInvokeMember")) return base.BindInvokeMember(binder, args); // // Generate a tree like: // // { // object result; // TryInvokeMember(payload, out result) // ? result // : TryGetMember(payload, out result) // ? FallbackInvoke(result) // : fallbackResult // } // // Then it calls FallbackInvokeMember with this tree as the // "error", giving the language the option of using this // tree or doing .NET binding. // Fallback fallback = e => binder.FallbackInvokeMember(this, args, e); DynamicMetaObject call = BuildCallMethodWithResult( "TryInvokeMember", binder, GetArgArray(args), BuildCallMethodWithResult( "TryGetMember", new GetBinderAdapter(binder), NoArgs, fallback(null), e => binder.FallbackInvoke(e, args, null) ), null ); return _dontFallbackFirst ? call : fallback(call); } public override DynamicMetaObject BindCreateInstance(CreateInstanceBinder binder, DynamicMetaObject[] args) { return IsOverridden("TryCreateInstance") ? CallMethodWithResult("TryCreateInstance", binder, GetArgArray(args), e => binder.FallbackCreateInstance(this, args, e)) : base.BindCreateInstance(binder, args); } public override DynamicMetaObject BindInvoke(InvokeBinder binder, DynamicMetaObject[] args) { return IsOverridden("TryInvoke") ? CallMethodWithResult("TryInvoke", binder, GetArgArray(args), e => binder.FallbackInvoke(this, args, e)) : base.BindInvoke(binder, args); } public override DynamicMetaObject BindBinaryOperation(BinaryOperationBinder binder, DynamicMetaObject arg) { return IsOverridden("TryBinaryOperation") ? CallMethodWithResult("TryBinaryOperation", binder, GetArgs(arg), e => binder.FallbackBinaryOperation(this, arg, e)) : base.BindBinaryOperation(binder, arg); } public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder) { return IsOverridden("TryUnaryOperation") ? CallMethodWithResult("TryUnaryOperation", binder, NoArgs, e => binder.FallbackUnaryOperation(this, e)) : base.BindUnaryOperation(binder); } public override DynamicMetaObject BindGetIndex(GetIndexBinder binder, DynamicMetaObject[] indexes) { return IsOverridden("TryGetIndex") ? CallMethodWithResult("TryGetIndex", binder, GetArgArray(indexes), e => binder.FallbackGetIndex(this, indexes, e)) : base.BindGetIndex(binder, indexes); } public override DynamicMetaObject BindSetIndex(SetIndexBinder binder, DynamicMetaObject[] indexes, DynamicMetaObject value) { return IsOverridden("TrySetIndex") ? CallMethodReturnLast("TrySetIndex", binder, GetArgArray(indexes, value), e => binder.FallbackSetIndex(this, indexes, value, e)) : base.BindSetIndex(binder, indexes, value); } public override DynamicMetaObject BindDeleteIndex(DeleteIndexBinder binder, DynamicMetaObject[] indexes) { return IsOverridden("TryDeleteIndex") ? CallMethodNoResult("TryDeleteIndex", binder, GetArgArray(indexes), e => binder.FallbackDeleteIndex(this, indexes, e)) : base.BindDeleteIndex(binder, indexes); } private delegate DynamicMetaObject Fallback(DynamicMetaObject errorSuggestion); private readonly static Expression[] NoArgs = new Expression[0]; private static Expression[] GetArgs(params DynamicMetaObject[] args) { return args.Select(arg => Expression.Convert(arg.Expression, typeof(object))).ToArray(); } private static Expression[] GetArgArray(DynamicMetaObject[] args) { return new[] { Expression.NewArrayInit(typeof(object), GetArgs(args)) }; } private static Expression[] GetArgArray(DynamicMetaObject[] args, DynamicMetaObject value) { return new Expression[] { Expression.NewArrayInit(typeof(object), GetArgs(args)), Expression.Convert(value.Expression, typeof(object)) }; } private static ConstantExpression Constant(DynamicMetaObjectBinder binder) { Type t = binder.GetType(); while (!t.IsVisible()) t = t.BaseType(); return Expression.Constant(binder, t); } /// /// Helper method for generating a MetaObject which calls a /// specific method on Dynamic that returns a result /// private DynamicMetaObject CallMethodWithResult(string methodName, DynamicMetaObjectBinder binder, Expression[] args, Fallback fallback, Fallback fallbackInvoke = null) { // // First, call fallback to do default binding // This produces either an error or a call to a .NET member // DynamicMetaObject fallbackResult = fallback(null); DynamicMetaObject callDynamic = BuildCallMethodWithResult(methodName, binder, args, fallbackResult, fallbackInvoke); // // Now, call fallback again using our new MO as the error // When we do this, one of two things can happen: // 1. Binding will succeed, and it will ignore our call to // the dynamic method, OR // 2. Binding will fail, and it will use the MO we created // above. // return _dontFallbackFirst ? callDynamic : fallback(callDynamic); } private DynamicMetaObject BuildCallMethodWithResult(string methodName, DynamicMetaObjectBinder binder, Expression[] args, DynamicMetaObject fallbackResult, Fallback fallbackInvoke) { // // Build a new expression like: // { // object result; // TryGetMember(payload, out result) ? fallbackInvoke(result) : fallbackResult // } // ParameterExpression result = Expression.Parameter(typeof(object), null); IList callArgs = new List(); callArgs.Add(Expression.Convert(Expression, typeof(T))); callArgs.Add(Constant(binder)); callArgs.AddRange(args); callArgs.Add(result); DynamicMetaObject resultMetaObject = new DynamicMetaObject(result, BindingRestrictions.Empty); // Need to add a conversion if calling TryConvert if (binder.ReturnType != typeof (object)) { UnaryExpression convert = Expression.Convert(resultMetaObject.Expression, binder.ReturnType); // will always be a cast or unbox resultMetaObject = new DynamicMetaObject(convert, resultMetaObject.Restrictions); } if (fallbackInvoke != null) resultMetaObject = fallbackInvoke(resultMetaObject); DynamicMetaObject callDynamic = new DynamicMetaObject( Expression.Block( new[] {result}, Expression.Condition( Expression.Call( Expression.Constant(_proxy), typeof(DynamicProxy).GetMethod(methodName), callArgs ), resultMetaObject.Expression, fallbackResult.Expression, binder.ReturnType ) ), GetRestrictions().Merge(resultMetaObject.Restrictions).Merge(fallbackResult.Restrictions) ); return callDynamic; } /// /// Helper method for generating a MetaObject which calls a /// specific method on Dynamic, but uses one of the arguments for /// the result. /// private DynamicMetaObject CallMethodReturnLast(string methodName, DynamicMetaObjectBinder binder, Expression[] args, Fallback fallback) { // // First, call fallback to do default binding // This produces either an error or a call to a .NET member // DynamicMetaObject fallbackResult = fallback(null); // // Build a new expression like: // { // object result; // TrySetMember(payload, result = value) ? result : fallbackResult // } // ParameterExpression result = Expression.Parameter(typeof(object), null); IList callArgs = new List(); callArgs.Add(Expression.Convert(Expression, typeof (T))); callArgs.Add(Constant(binder)); callArgs.AddRange(args); callArgs[args.Length + 1] = Expression.Assign(result, callArgs[args.Length + 1]); DynamicMetaObject callDynamic = new DynamicMetaObject( Expression.Block( new[] { result }, Expression.Condition( Expression.Call( Expression.Constant(_proxy), typeof(DynamicProxy).GetMethod(methodName), callArgs ), result, fallbackResult.Expression, typeof(object) ) ), GetRestrictions().Merge(fallbackResult.Restrictions) ); // // Now, call fallback again using our new MO as the error // When we do this, one of two things can happen: // 1. Binding will succeed, and it will ignore our call to // the dynamic method, OR // 2. Binding will fail, and it will use the MO we created // above. // return _dontFallbackFirst ? callDynamic : fallback(callDynamic); } /// /// Helper method for generating a MetaObject which calls a /// specific method on Dynamic, but uses one of the arguments for /// the result. /// private DynamicMetaObject CallMethodNoResult(string methodName, DynamicMetaObjectBinder binder, Expression[] args, Fallback fallback) { // // First, call fallback to do default binding // This produces either an error or a call to a .NET member // DynamicMetaObject fallbackResult = fallback(null); IList callArgs = new List(); callArgs.Add(Expression.Convert(Expression, typeof(T))); callArgs.Add(Constant(binder)); callArgs.AddRange(args); // // Build a new expression like: // if (TryDeleteMember(payload)) { } else { fallbackResult } // DynamicMetaObject callDynamic = new DynamicMetaObject( Expression.Condition( Expression.Call( Expression.Constant(_proxy), typeof(DynamicProxy).GetMethod(methodName), callArgs ), Expression.Empty(), fallbackResult.Expression, typeof (void) ), GetRestrictions().Merge(fallbackResult.Restrictions) ); // // Now, call fallback again using our new MO as the error // When we do this, one of two things can happen: // 1. Binding will succeed, and it will ignore our call to // the dynamic method, OR // 2. Binding will fail, and it will use the MO we created // above. // return _dontFallbackFirst ? callDynamic : fallback(callDynamic); } /// /// Returns a Restrictions object which includes our current restrictions merged /// with a restriction limiting our type /// private BindingRestrictions GetRestrictions() { return (Value == null && HasValue) ? BindingRestrictions.GetInstanceRestriction(Expression, null) : BindingRestrictions.GetTypeRestriction(Expression, LimitType); } public override IEnumerable GetDynamicMemberNames() { return _proxy.GetDynamicMemberNames(Value); } // It is okay to throw NotSupported from this binder. This object // is only used by DynamicObject.GetMember--it is not expected to // (and cannot) implement binding semantics. It is just so the DO // can use the Name and IgnoreCase properties. private sealed class GetBinderAdapter : GetMemberBinder { internal GetBinderAdapter(InvokeMemberBinder binder) : base(binder.Name, binder.IgnoreCase) { } public override DynamicMetaObject FallbackGetMember(DynamicMetaObject target, DynamicMetaObject errorSuggestion) { throw new NotSupportedException(); } } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/TypeExtensions.cs0000644000175000017500000004160312253423361030337 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Reflection; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Utilities { internal static class TypeExtensions { #if NETFX_CORE private static BindingFlags DefaultFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance; public static MethodInfo GetGetMethod(this PropertyInfo propertyInfo) { return propertyInfo.GetGetMethod(false); } public static MethodInfo GetGetMethod(this PropertyInfo propertyInfo, bool nonPublic) { MethodInfo getMethod = propertyInfo.GetMethod; if (getMethod != null && (getMethod.IsPublic || nonPublic)) return getMethod; return null; } public static MethodInfo GetSetMethod(this PropertyInfo propertyInfo) { return propertyInfo.GetSetMethod(false); } public static MethodInfo GetSetMethod(this PropertyInfo propertyInfo, bool nonPublic) { MethodInfo setMethod = propertyInfo.SetMethod; if (setMethod != null && (setMethod.IsPublic || nonPublic)) return setMethod; return null; } public static bool IsSubclassOf(this Type type, Type c) { return type.GetTypeInfo().IsSubclassOf(c); } public static bool IsAssignableFrom(this Type type, Type c) { return type.GetTypeInfo().IsAssignableFrom(c.GetTypeInfo()); } #endif public static MemberTypes MemberType(this MemberInfo memberInfo) { #if !(NETFX_CORE || PORTABLE) return memberInfo.MemberType; #else if (memberInfo is PropertyInfo) return MemberTypes.Property; else if (memberInfo is FieldInfo) return MemberTypes.Field; else if (memberInfo is EventInfo) return MemberTypes.Event; else if (memberInfo is MethodInfo) return MemberTypes.Method; else return MemberTypes.Other; #endif } public static bool ContainsGenericParameters(this Type type) { #if !NETFX_CORE return type.ContainsGenericParameters; #else return type.GetTypeInfo().ContainsGenericParameters; #endif } public static bool IsInterface(this Type type) { #if !NETFX_CORE return type.IsInterface; #else return type.GetTypeInfo().IsInterface; #endif } public static bool IsGenericType(this Type type) { #if !NETFX_CORE return type.IsGenericType; #else return type.GetTypeInfo().IsGenericType; #endif } public static bool IsGenericTypeDefinition(this Type type) { #if !NETFX_CORE return type.IsGenericTypeDefinition; #else return type.GetTypeInfo().IsGenericTypeDefinition; #endif } public static Type BaseType(this Type type) { #if !NETFX_CORE return type.BaseType; #else return type.GetTypeInfo().BaseType; #endif } public static bool IsEnum(this Type type) { #if !NETFX_CORE return type.IsEnum; #else return type.GetTypeInfo().IsEnum; #endif } public static bool IsClass(this Type type) { #if !NETFX_CORE return type.IsClass; #else return type.GetTypeInfo().IsClass; #endif } public static bool IsSealed(this Type type) { #if !NETFX_CORE return type.IsSealed; #else return type.GetTypeInfo().IsSealed; #endif } #if PORTABLE public static PropertyInfo GetProperty(this Type type, string name, BindingFlags bindingFlags, object placeholder1, Type propertyType, IList indexParameters, object placeholder2) { IList propertyInfos = type.GetProperties(bindingFlags); return propertyInfos.Where(p => { if (name != null && name != p.Name) return false; if (propertyType != null && propertyType != p.PropertyType) return false; if (indexParameters != null) { if (!p.GetIndexParameters().Select(ip => ip.ParameterType).SequenceEqual(indexParameters)) return false; } return true; }).SingleOrDefault(); } public static IEnumerable GetMember(this Type type, string name, MemberTypes memberType, BindingFlags bindingFlags) { return type.GetMembers(bindingFlags).Where(m => { if (name != null && name != m.Name) return false; if (m.MemberType() != memberType) return false; return true; }); } #endif #if NETFX_CORE public static bool IsDefined(this Type type, Type attributeType, bool inherit) { return type.GetTypeInfo().CustomAttributes.Any(a => a.AttributeType == attributeType); } public static MethodInfo GetMethod(this Type type, string name) { return type.GetMethod(name, DefaultFlags); } public static MethodInfo GetMethod(this Type type, string name, BindingFlags bindingFlags) { return type.GetTypeInfo().GetDeclaredMethod(name); } public static MethodInfo GetMethod(this Type type, IList parameterTypes) { return type.GetMethod(null, parameterTypes); } public static MethodInfo GetMethod(this Type type, string name, IList parameterTypes) { return type.GetMethod(name, DefaultFlags, null, parameterTypes, null); } public static MethodInfo GetMethod(this Type type, string name, BindingFlags bindingFlags, object placeHolder1, IList parameterTypes, object placeHolder2) { return type.GetTypeInfo().DeclaredMethods.Where(m => { if (name != null && m.Name != name) return false; if (!TestAccessibility(m, bindingFlags)) return false; return m.GetParameters().Select(p => p.ParameterType).SequenceEqual(parameterTypes); }).SingleOrDefault(); } public static PropertyInfo GetProperty(this Type type, string name, BindingFlags bindingFlags, object placeholder1, Type propertyType, IList indexParameters, object placeholder2) { return type.GetTypeInfo().DeclaredProperties.Where(p => { if (name != null && name != p.Name) return false; if (propertyType != null && propertyType != p.PropertyType) return false; if (indexParameters != null) { if (!p.GetIndexParameters().Select(ip => ip.ParameterType).SequenceEqual(indexParameters)) return false; } return true; }).SingleOrDefault(); } public static IEnumerable GetMember(this Type type, string name, MemberTypes memberType, BindingFlags bindingFlags) { return type.GetTypeInfo().GetMembersRecursive().Where(m => { if (name != null && name != m.Name) return false; if (m.MemberType() != memberType) return false; if (!TestAccessibility(m, bindingFlags)) return false; return true; }); } public static IEnumerable GetConstructors(this Type type) { return type.GetConstructors(DefaultFlags); } public static IEnumerable GetConstructors(this Type type, BindingFlags bindingFlags) { return type.GetConstructors(bindingFlags, null); } private static IEnumerable GetConstructors(this Type type, BindingFlags bindingFlags, IList parameterTypes) { return type.GetTypeInfo().DeclaredConstructors.Where(c => { if (!TestAccessibility(c, bindingFlags)) return false; if (parameterTypes != null && !c.GetParameters().Select(p => p.ParameterType).SequenceEqual(parameterTypes)) return false; return true; }); } public static ConstructorInfo GetConstructor(this Type type, IList parameterTypes) { return type.GetConstructor(DefaultFlags, null, parameterTypes, null); } public static ConstructorInfo GetConstructor(this Type type, BindingFlags bindingFlags, object placeholder1, IList parameterTypes, object placeholder2) { return type.GetConstructors(bindingFlags, parameterTypes).SingleOrDefault(); } public static MemberInfo[] GetMember(this Type type, string member) { return type.GetMember(member, DefaultFlags); } public static MemberInfo[] GetMember(this Type type, string member, BindingFlags bindingFlags) { return type.GetTypeInfo().GetMembersRecursive().Where(m => m.Name == member && TestAccessibility(m, bindingFlags)).ToArray(); } public static MemberInfo GetField(this Type type, string member) { return type.GetField(member, DefaultFlags); } public static MemberInfo GetField(this Type type, string member, BindingFlags bindingFlags) { return type.GetTypeInfo().GetDeclaredField(member); } public static IEnumerable GetProperties(this Type type, BindingFlags bindingFlags) { return type.GetTypeInfo().GetPropertiesRecursive().Where(p => TestAccessibility(p, bindingFlags)); } private static IList GetMembersRecursive(this TypeInfo type) { TypeInfo t = type; IList members = new List(); while (t != null) { foreach (var member in t.DeclaredMembers) { if (!members.Any(p => p.Name == member.Name)) members.Add(member); } t = (t.BaseType != null) ? t.BaseType.GetTypeInfo() : null; } return members; } private static IList GetPropertiesRecursive(this TypeInfo type) { TypeInfo t = type; IList properties = new List(); while (t != null) { foreach (var member in t.DeclaredProperties) { if (!properties.Any(p => p.Name == member.Name)) properties.Add(member); } t = (t.BaseType != null) ? t.BaseType.GetTypeInfo() : null; } return properties; } private static IList GetFieldsRecursive(this TypeInfo type) { TypeInfo t = type; IList fields = new List(); while (t != null) { foreach (var member in t.DeclaredFields) { if (!fields.Any(p => p.Name == member.Name)) fields.Add(member); } t = (t.BaseType != null) ? t.BaseType.GetTypeInfo() : null; } return fields; } public static IEnumerable GetMethods(this Type type, BindingFlags bindingFlags) { return type.GetTypeInfo().DeclaredMethods; } public static PropertyInfo GetProperty(this Type type, string name) { return type.GetProperty(name, DefaultFlags); } public static PropertyInfo GetProperty(this Type type, string name, BindingFlags bindingFlags) { return type.GetTypeInfo().GetDeclaredProperty(name); } public static IEnumerable GetFields(this Type type) { return type.GetFields(DefaultFlags); } public static IEnumerable GetFields(this Type type, BindingFlags bindingFlags) { return type.GetTypeInfo().GetFieldsRecursive().Where(f => TestAccessibility(f, bindingFlags)).ToList(); } private static bool TestAccessibility(PropertyInfo member, BindingFlags bindingFlags) { if (member.GetMethod != null && TestAccessibility(member.GetMethod, bindingFlags)) return true; if (member.SetMethod != null && TestAccessibility(member.SetMethod, bindingFlags)) return true; return false; } private static bool TestAccessibility(MemberInfo member, BindingFlags bindingFlags) { if (member is FieldInfo) { return TestAccessibility((FieldInfo)member, bindingFlags); } else if (member is MethodBase) { return TestAccessibility((MethodBase)member, bindingFlags); } else if (member is PropertyInfo) { return TestAccessibility((PropertyInfo)member, bindingFlags); } throw new Exception("Unexpected member type."); } private static bool TestAccessibility(FieldInfo member, BindingFlags bindingFlags) { bool visibility = (member.IsPublic && bindingFlags.HasFlag(BindingFlags.Public)) || (!member.IsPublic && bindingFlags.HasFlag(BindingFlags.NonPublic)); bool instance = (member.IsStatic && bindingFlags.HasFlag(BindingFlags.Static)) || (!member.IsStatic && bindingFlags.HasFlag(BindingFlags.Instance)); return visibility && instance; } private static bool TestAccessibility(MethodBase member, BindingFlags bindingFlags) { bool visibility = (member.IsPublic && bindingFlags.HasFlag(BindingFlags.Public)) || (!member.IsPublic && bindingFlags.HasFlag(BindingFlags.NonPublic)); bool instance = (member.IsStatic && bindingFlags.HasFlag(BindingFlags.Static)) || (!member.IsStatic && bindingFlags.HasFlag(BindingFlags.Instance)); return visibility && instance; } public static Type[] GetGenericArguments(this Type type) { return type.GetTypeInfo().GenericTypeArguments; } public static IEnumerable GetInterfaces(this Type type) { return type.GetTypeInfo().ImplementedInterfaces; } public static IEnumerable GetMethods(this Type type) { return type.GetTypeInfo().DeclaredMethods; } #endif public static bool IsAbstract(this Type type) { #if !NETFX_CORE return type.IsAbstract; #else return type.GetTypeInfo().IsAbstract; #endif } public static bool IsVisible(this Type type) { #if !NETFX_CORE return type.IsVisible; #else return type.GetTypeInfo().IsVisible; #endif } public static bool IsValueType(this Type type) { #if !NETFX_CORE return type.IsValueType; #else return type.GetTypeInfo().IsValueType; #endif } public static bool AssignableToTypeName(this Type type, string fullTypeName, out Type match) { Type current = type; while (current != null) { if (string.Equals(current.FullName, fullTypeName, StringComparison.Ordinal)) { match = current; return true; } current = current.BaseType(); } foreach (Type i in type.GetInterfaces()) { if (string.Equals(i.Name, fullTypeName, StringComparison.Ordinal)) { match = type; return true; } } match = null; return false; } public static bool AssignableToTypeName(this Type type, string fullTypeName) { Type match; return type.AssignableToTypeName(fullTypeName, out match); } public static MethodInfo GetGenericMethod(this Type type, string name, params Type[] parameterTypes) { var methods = type.GetMethods().Where(method => method.Name == name); foreach (var method in methods) { if (method.HasParameters(parameterTypes)) return method; } return null; } public static bool HasParameters(this MethodInfo method, params Type[] parameterTypes) { var methodParameters = method.GetParameters().Select(parameter => parameter.ParameterType).ToArray(); if (methodParameters.Length != parameterTypes.Length) return false; for (int i = 0; i < methodParameters.Length; i++) if (methodParameters[i].ToString() != parameterTypes[i].ToString()) return false; return true; } public static IEnumerable GetAllInterfaces(this Type target) { foreach (var i in target.GetInterfaces()) { yield return i; foreach (var ci in i.GetInterfaces()) { yield return ci; } } } public static IEnumerable GetAllMethods(this Type target) { var allTypes = target.GetAllInterfaces().ToList(); allTypes.Add(target); return from type in allTypes from method in type.GetMethods() select method; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs0000644000175000017500000003763612253423361030012 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.ComponentModel; using Newtonsoft.Json.Serialization; using System.Reflection; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #endif #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) using System.Data.SqlTypes; #endif #if NETFX_CORE using IConvertible = Newtonsoft.Json.Utilities.Convertible; #endif namespace Newtonsoft.Json.Utilities { #if NETFX_CORE internal class Convertible { private object _underlyingValue; public Convertible(object o) { _underlyingValue = o; } public TypeCode GetTypeCode() { return ConvertUtils.GetTypeCode(_underlyingValue); } public bool ToBoolean(IFormatProvider provider) { return Convert.ToBoolean(_underlyingValue, provider); } public byte ToByte(IFormatProvider provider) { return Convert.ToByte(_underlyingValue, provider); } public char ToChar(IFormatProvider provider) { return Convert.ToChar(_underlyingValue, provider); } public DateTime ToDateTime(IFormatProvider provider) { return Convert.ToDateTime(_underlyingValue, provider); } public decimal ToDecimal(IFormatProvider provider) { return Convert.ToDecimal(_underlyingValue, provider); } public double ToDouble(IFormatProvider provider) { return Convert.ToDouble(_underlyingValue, provider); } public short ToInt16(IFormatProvider provider) { return Convert.ToInt16(_underlyingValue, provider); } public int ToInt32(IFormatProvider provider) { return Convert.ToInt32(_underlyingValue, provider); } public long ToInt64(IFormatProvider provider) { return Convert.ToInt64(_underlyingValue, provider); } public sbyte ToSByte(IFormatProvider provider) { return Convert.ToSByte(_underlyingValue, provider); } public float ToSingle(IFormatProvider provider) { return Convert.ToSingle(_underlyingValue, provider); } public string ToString(IFormatProvider provider) { return Convert.ToString(_underlyingValue, provider); } public object ToType(Type conversionType, IFormatProvider provider) { return Convert.ChangeType(_underlyingValue, conversionType, provider); } public ushort ToUInt16(IFormatProvider provider) { return Convert.ToUInt16(_underlyingValue, provider); } public uint ToUInt32(IFormatProvider provider) { return Convert.ToUInt32(_underlyingValue, provider); } public ulong ToUInt64(IFormatProvider provider) { return Convert.ToUInt64(_underlyingValue, provider); } } #endif internal static class ConvertUtils { public static TypeCode GetTypeCode(this IConvertible convertible) { #if !NETFX_CORE return convertible.GetTypeCode(); #else return GetTypeCode((object)convertible); #endif } public static TypeCode GetTypeCode(object o) { #if !(NETFX_CORE || PORTABLE) return System.Convert.GetTypeCode(o); #else return GetTypeCode(o.GetType()); #endif } public static TypeCode GetTypeCode(Type t) { #if !NETFX_CORE return Type.GetTypeCode(t); #else if (t == typeof(bool)) return TypeCode.Boolean; if (t == typeof(byte)) return TypeCode.Byte; if (t == typeof(char)) return TypeCode.Char; if (t == typeof(DateTime)) return TypeCode.DateTime; if (t == typeof(decimal)) return TypeCode.Decimal; if (t == typeof(double)) return TypeCode.Double; if (t == typeof(short)) return TypeCode.Int16; if (t == typeof(int)) return TypeCode.Int32; if (t == typeof(long)) return TypeCode.Int64; if (t == typeof(sbyte)) return TypeCode.SByte; if (t == typeof(float)) return TypeCode.Single; if (t == typeof(string)) return TypeCode.String; if (t == typeof(ushort)) return TypeCode.UInt16; if (t == typeof(uint)) return TypeCode.UInt32; if (t == typeof(ulong)) return TypeCode.UInt64; if (t.IsEnum()) return GetTypeCode(Enum.GetUnderlyingType(t)); return TypeCode.Object; #endif } public static IConvertible ToConvertible(object o) { #if !NETFX_CORE return o as IConvertible; #else if (!IsConvertible(o)) return null; return new IConvertible(o); #endif } public static bool IsConvertible(object o) { #if !NETFX_CORE return o is IConvertible; #else if (o == null) return false; return ( o is bool || o is byte || o is char || o is DateTime || o is decimal || o is double || o is short || o is int || o is long || o is sbyte || o is float || o is string || o is ushort || o is uint || o is ulong || o is Enum); #endif } public static bool IsConvertible(Type t) { #if !NETFX_CORE return typeof(IConvertible).IsAssignableFrom(t); #else return ( t == typeof(bool) || t == typeof(byte) || t == typeof(char) || t == typeof(DateTime) || t == typeof(decimal) || t == typeof(double) || t == typeof(short) || t == typeof(int) || t == typeof(long) || t == typeof(sbyte) || t == typeof(float) || t == typeof(string) || t == typeof(ushort) || t == typeof(uint) || t == typeof(ulong) || t.IsEnum()); #endif } internal struct TypeConvertKey : IEquatable { private readonly Type _initialType; private readonly Type _targetType; public Type InitialType { get { return _initialType; } } public Type TargetType { get { return _targetType; } } public TypeConvertKey(Type initialType, Type targetType) { _initialType = initialType; _targetType = targetType; } public override int GetHashCode() { return _initialType.GetHashCode() ^ _targetType.GetHashCode(); } public override bool Equals(object obj) { if (!(obj is TypeConvertKey)) return false; return Equals((TypeConvertKey)obj); } public bool Equals(TypeConvertKey other) { return (_initialType == other._initialType && _targetType == other._targetType); } } private static readonly ThreadSafeStore> CastConverters = new ThreadSafeStore>(CreateCastConverter); private static Func CreateCastConverter(TypeConvertKey t) { MethodInfo castMethodInfo = t.TargetType.GetMethod("op_Implicit", new[] { t.InitialType }); if (castMethodInfo == null) castMethodInfo = t.TargetType.GetMethod("op_Explicit", new[] { t.InitialType }); if (castMethodInfo == null) return null; MethodCall call = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall(castMethodInfo); return o => call(null, o); } #region Convert /// /// Converts the value to the specified type. /// /// The value to convert. /// The culture to use when converting. /// The type to convert the value to. /// The converted type. public static object Convert(object initialValue, CultureInfo culture, Type targetType) { if (initialValue == null) throw new ArgumentNullException("initialValue"); if (ReflectionUtils.IsNullableType(targetType)) targetType = Nullable.GetUnderlyingType(targetType); Type initialType = initialValue.GetType(); if (targetType == initialType) return initialValue; // use Convert.ChangeType if both types are IConvertible if (ConvertUtils.IsConvertible(initialValue) && ConvertUtils.IsConvertible(targetType)) { if (targetType.IsEnum()) { if (initialValue is string) return Enum.Parse(targetType, initialValue.ToString(), true); else if (IsInteger(initialValue)) return Enum.ToObject(targetType, initialValue); } return System.Convert.ChangeType(initialValue, targetType, culture); } if (initialValue is string && typeof(Type).IsAssignableFrom(targetType)) return Type.GetType((string) initialValue, true); if (targetType.IsInterface() || targetType.IsGenericTypeDefinition() || targetType.IsAbstract()) throw new ArgumentException("Target type {0} is not a value type or a non-abstract class.".FormatWith(CultureInfo.InvariantCulture, targetType), "targetType"); #if !PocketPC && !NET20 if (initialValue is DateTime && targetType == typeof(DateTimeOffset)) return new DateTimeOffset((DateTime)initialValue); #endif if (initialValue is string) { if (targetType == typeof (Guid)) return new Guid((string) initialValue); if (targetType == typeof (Uri)) return new Uri((string) initialValue, UriKind.RelativeOrAbsolute); if (targetType == typeof (TimeSpan)) #if !(NET35 || NET20 || SILVERLIGHT || PORTABLE) return TimeSpan.Parse((string) initialValue, CultureInfo.InvariantCulture); #else return TimeSpan.Parse((string)initialValue); #endif } #if !(NETFX_CORE || PORTABLE) // see if source or target types have a TypeConverter that converts between the two TypeConverter toConverter = GetConverter(initialType); if (toConverter != null && toConverter.CanConvertTo(targetType)) { #if !SILVERLIGHT return toConverter.ConvertTo(null, culture, initialValue, targetType); #else return toConverter.ConvertTo(initialValue, targetType); #endif } TypeConverter fromConverter = GetConverter(targetType); if (fromConverter != null && fromConverter.CanConvertFrom(initialType)) { #if !SILVERLIGHT return fromConverter.ConvertFrom(null, culture, initialValue); #else return fromConverter.ConvertFrom(initialValue); #endif } #endif #if !(NETFX_CORE || PORTABLE) // handle DBNull and INullable if (initialValue == DBNull.Value) { if (ReflectionUtils.IsNullable(targetType)) return EnsureTypeAssignable(null, initialType, targetType); throw new Exception("Can not convert null {0} into non-nullable {1}.".FormatWith(CultureInfo.InvariantCulture, initialType, targetType)); } #endif #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) if (initialValue is INullable) return EnsureTypeAssignable(ToValue((INullable)initialValue), initialType, targetType); #endif throw new InvalidOperationException("Can not convert from {0} to {1}.".FormatWith(CultureInfo.InvariantCulture, initialType, targetType)); } #endregion #region TryConvert /// /// Converts the value to the specified type. /// /// The value to convert. /// The culture to use when converting. /// The type to convert the value to. /// The converted value if the conversion was successful or the default value of T if it failed. /// /// true if initialValue was converted successfully; otherwise, false. /// public static bool TryConvert(object initialValue, CultureInfo culture, Type targetType, out object convertedValue) { return MiscellaneousUtils.TryAction(delegate { return Convert(initialValue, culture, targetType); }, out convertedValue); } #endregion #region ConvertOrCast /// /// Converts the value to the specified type. If the value is unable to be converted, the /// value is checked whether it assignable to the specified type. /// /// The value to convert. /// The culture to use when converting. /// The type to convert or cast the value to. /// /// The converted type. If conversion was unsuccessful, the initial value /// is returned if assignable to the target type. /// public static object ConvertOrCast(object initialValue, CultureInfo culture, Type targetType) { object convertedValue; if (targetType == typeof(object)) return initialValue; if (initialValue == null && ReflectionUtils.IsNullable(targetType)) return null; if (TryConvert(initialValue, culture, targetType, out convertedValue)) return convertedValue; return EnsureTypeAssignable(initialValue, ReflectionUtils.GetObjectType(initialValue), targetType); } #endregion private static object EnsureTypeAssignable(object value, Type initialType, Type targetType) { Type valueType = (value != null) ? value.GetType() : null; if (value != null) { if (targetType.IsAssignableFrom(valueType)) return value; Func castConverter = CastConverters.Get(new TypeConvertKey(valueType, targetType)); if (castConverter != null) return castConverter(value); } else { if (ReflectionUtils.IsNullable(targetType)) return null; } throw new ArgumentException("Could not cast or convert from {0} to {1}.".FormatWith(CultureInfo.InvariantCulture, (initialType != null) ? initialType.ToString() : "{null}", targetType)); } #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) public static object ToValue(INullable nullableValue) { if (nullableValue == null) return null; else if (nullableValue is SqlInt32) return ToValue((SqlInt32)nullableValue); else if (nullableValue is SqlInt64) return ToValue((SqlInt64)nullableValue); else if (nullableValue is SqlBoolean) return ToValue((SqlBoolean)nullableValue); else if (nullableValue is SqlString) return ToValue((SqlString)nullableValue); else if (nullableValue is SqlDateTime) return ToValue((SqlDateTime)nullableValue); throw new ArgumentException("Unsupported INullable type: {0}".FormatWith(CultureInfo.InvariantCulture, nullableValue.GetType())); } #endif #if !(NETFX_CORE || PORTABLE) internal static TypeConverter GetConverter(Type t) { return JsonTypeReflector.GetTypeConverter(t); } #endif public static bool IsInteger(object value) { switch (GetTypeCode(value)) { case TypeCode.SByte: case TypeCode.Byte: case TypeCode.Int16: case TypeCode.UInt16: case TypeCode.Int32: case TypeCode.UInt32: case TypeCode.Int64: case TypeCode.UInt64: return true; default: return false; } } } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/LinqBridge.cs0000644000175000017500000025334512253423361027366 0ustar00meebeymeebey00000000000000#if NET20 #region License, Terms and Author(s) // // LINQBridge // Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved. // // Author(s): // // Atif Aziz, http://www.raboof.com // // This library is free software; you can redistribute it and/or modify it // under the terms of the New BSD License, a copy of which should have // been delivered along with this distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #endregion using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using Newtonsoft.Json.Serialization; namespace Newtonsoft.Json.Utilities.LinqBridge { /// /// Provides a set of static (Shared in Visual Basic) methods for /// querying objects that implement . /// internal static partial class Enumerable { /// /// Returns the input typed as . /// public static IEnumerable AsEnumerable(IEnumerable source) { return source; } /// /// Returns an empty that has the /// specified type argument. /// public static IEnumerable Empty() { return Sequence.Empty; } /// /// Converts the elements of an to the /// specified type. /// public static IEnumerable Cast( this IEnumerable source) { CheckNotNull(source, "source"); return CastYield(source); } private static IEnumerable CastYield( IEnumerable source) { foreach (var item in source) yield return (TResult) item; } /// /// Filters the elements of an based on a specified type. /// public static IEnumerable OfType( this IEnumerable source) { CheckNotNull(source, "source"); return OfTypeYield(source); } private static IEnumerable OfTypeYield( IEnumerable source) { foreach (var item in source) if (item is TResult) yield return (TResult) item; } /// /// Generates a sequence of integral numbers within a specified range. /// /// The value of the first integer in the sequence. /// The number of sequential integers to generate. public static IEnumerable Range(int start, int count) { if (count < 0) throw new ArgumentOutOfRangeException("count", count, null); var end = (long) start + count; if (end - 1 >= int.MaxValue) throw new ArgumentOutOfRangeException("count", count, null); return RangeYield(start, end); } private static IEnumerable RangeYield(int start, long end) { for (var i = start; i < end; i++) yield return i; } /// /// Generates a sequence that contains one repeated value. /// public static IEnumerable Repeat(TResult element, int count) { if (count < 0) throw new ArgumentOutOfRangeException("count", count, null); return RepeatYield(element, count); } private static IEnumerable RepeatYield(TResult element, int count) { for (var i = 0; i < count; i++) yield return element; } /// /// Filters a sequence of values based on a predicate. /// public static IEnumerable Where( this IEnumerable source, Func predicate) { CheckNotNull(predicate, "predicate"); return source.Where((item, i) => predicate(item)); } /// /// Filters a sequence of values based on a predicate. /// Each element's index is used in the logic of the predicate function. /// public static IEnumerable Where( this IEnumerable source, Func predicate) { CheckNotNull(source, "source"); CheckNotNull(predicate, "predicate"); return WhereYield(source, predicate); } private static IEnumerable WhereYield( IEnumerable source, Func predicate) { var i = 0; foreach (var item in source) if (predicate(item, i++)) yield return item; } /// /// Projects each element of a sequence into a new form. /// public static IEnumerable Select( this IEnumerable source, Func selector) { CheckNotNull(selector, "selector"); return source.Select((item, i) => selector(item)); } /// /// Projects each element of a sequence into a new form by /// incorporating the element's index. /// public static IEnumerable Select( this IEnumerable source, Func selector) { CheckNotNull(source, "source"); CheckNotNull(selector, "selector"); return SelectYield(source, selector); } private static IEnumerable SelectYield( IEnumerable source, Func selector) { var i = 0; foreach (var item in source) yield return selector(item, i++); } /// /// Projects each element of a sequence to an /// and flattens the resulting sequences into one sequence. /// public static IEnumerable SelectMany( this IEnumerable source, Func> selector) { CheckNotNull(selector, "selector"); return source.SelectMany((item, i) => selector(item)); } /// /// Projects each element of a sequence to an , /// and flattens the resulting sequences into one sequence. The /// index of each source element is used in the projected form of /// that element. /// public static IEnumerable SelectMany( this IEnumerable source, Func> selector) { CheckNotNull(selector, "selector"); return source.SelectMany(selector, (item, subitem) => subitem); } /// /// Projects each element of a sequence to an , /// flattens the resulting sequences into one sequence, and invokes /// a result selector function on each element therein. /// public static IEnumerable SelectMany( this IEnumerable source, Func> collectionSelector, Func resultSelector) { CheckNotNull(collectionSelector, "collectionSelector"); return source.SelectMany((item, i) => collectionSelector(item), resultSelector); } /// /// Projects each element of a sequence to an , /// flattens the resulting sequences into one sequence, and invokes /// a result selector function on each element therein. The index of /// each source element is used in the intermediate projected form /// of that element. /// public static IEnumerable SelectMany( this IEnumerable source, Func> collectionSelector, Func resultSelector) { CheckNotNull(source, "source"); CheckNotNull(collectionSelector, "collectionSelector"); CheckNotNull(resultSelector, "resultSelector"); return SelectManyYield(source, collectionSelector, resultSelector); } private static IEnumerable SelectManyYield( this IEnumerable source, Func> collectionSelector, Func resultSelector) { var i = 0; foreach (var item in source) foreach (var subitem in collectionSelector(item, i++)) yield return resultSelector(item, subitem); } /// /// Returns elements from a sequence as long as a specified condition is true. /// public static IEnumerable TakeWhile( this IEnumerable source, Func predicate) { CheckNotNull(predicate, "predicate"); return source.TakeWhile((item, i) => predicate(item)); } /// /// Returns elements from a sequence as long as a specified condition is true. /// The element's index is used in the logic of the predicate function. /// public static IEnumerable TakeWhile( this IEnumerable source, Func predicate) { CheckNotNull(source, "source"); CheckNotNull(predicate, "predicate"); return TakeWhileYield(source, predicate); } private static IEnumerable TakeWhileYield( this IEnumerable source, Func predicate) { var i = 0; foreach (var item in source) if (predicate(item, i++)) yield return item; else break; } private static class Futures { public static readonly Func Default = () => default(T); public static readonly Func Undefined = () => { throw new InvalidOperationException(); }; } /// /// Base implementation of First operator. /// private static TSource FirstImpl( this IEnumerable source, Func empty) { CheckNotNull(source, "source"); Debug.Assert(empty != null); var list = source as IList; // optimized case for lists if (list != null) return list.Count > 0 ? list[0] : empty(); using (var e = source.GetEnumerator()) // fallback for enumeration return e.MoveNext() ? e.Current : empty(); } /// /// Returns the first element of a sequence. /// public static TSource First( this IEnumerable source) { return source.FirstImpl(Futures.Undefined); } /// /// Returns the first element in a sequence that satisfies a specified condition. /// public static TSource First( this IEnumerable source, Func predicate) { return First(source.Where(predicate)); } /// /// Returns the first element of a sequence, or a default value if /// the sequence contains no elements. /// public static TSource FirstOrDefault( this IEnumerable source) { return source.FirstImpl(Futures.Default); } /// /// Returns the first element of the sequence that satisfies a /// condition or a default value if no such element is found. /// public static TSource FirstOrDefault( this IEnumerable source, Func predicate) { return FirstOrDefault(source.Where(predicate)); } /// /// Base implementation of Last operator. /// private static TSource LastImpl( this IEnumerable source, Func empty) { CheckNotNull(source, "source"); var list = source as IList; // optimized case for lists if (list != null) return list.Count > 0 ? list[list.Count - 1] : empty(); using (var e = source.GetEnumerator()) { if (!e.MoveNext()) return empty(); var last = e.Current; while (e.MoveNext()) last = e.Current; return last; } } /// /// Returns the last element of a sequence. /// public static TSource Last( this IEnumerable source) { return source.LastImpl(Futures.Undefined); } /// /// Returns the last element of a sequence that satisfies a /// specified condition. /// public static TSource Last( this IEnumerable source, Func predicate) { return Last(source.Where(predicate)); } /// /// Returns the last element of a sequence, or a default value if /// the sequence contains no elements. /// public static TSource LastOrDefault( this IEnumerable source) { return source.LastImpl(Futures.Default); } /// /// Returns the last element of a sequence that satisfies a /// condition or a default value if no such element is found. /// public static TSource LastOrDefault( this IEnumerable source, Func predicate) { return LastOrDefault(source.Where(predicate)); } /// /// Base implementation of Single operator. /// private static TSource SingleImpl( this IEnumerable source, Func empty) { CheckNotNull(source, "source"); using (var e = source.GetEnumerator()) { if (e.MoveNext()) { var single = e.Current; if (!e.MoveNext()) return single; throw new InvalidOperationException(); } return empty(); } } /// /// Returns the only element of a sequence, and throws an exception /// if there is not exactly one element in the sequence. /// public static TSource Single( this IEnumerable source) { return source.SingleImpl(Futures.Undefined); } /// /// Returns the only element of a sequence that satisfies a /// specified condition, and throws an exception if more than one /// such element exists. /// public static TSource Single( this IEnumerable source, Func predicate) { return Single(source.Where(predicate)); } /// /// Returns the only element of a sequence, or a default value if /// the sequence is empty; this method throws an exception if there /// is more than one element in the sequence. /// public static TSource SingleOrDefault( this IEnumerable source) { return source.SingleImpl(Futures.Default); } /// /// Returns the only element of a sequence that satisfies a /// specified condition or a default value if no such element /// exists; this method throws an exception if more than one element /// satisfies the condition. /// public static TSource SingleOrDefault( this IEnumerable source, Func predicate) { return SingleOrDefault(source.Where(predicate)); } /// /// Returns the element at a specified index in a sequence. /// public static TSource ElementAt( this IEnumerable source, int index) { CheckNotNull(source, "source"); if (index < 0) throw new ArgumentOutOfRangeException("index", index, null); var list = source as IList; if (list != null) return list[index]; try { return source.SkipWhile((item, i) => i < index).First(); } catch (InvalidOperationException) // if thrown by First { throw new ArgumentOutOfRangeException("index", index, null); } } /// /// Returns the element at a specified index in a sequence or a /// default value if the index is out of range. /// public static TSource ElementAtOrDefault( this IEnumerable source, int index) { CheckNotNull(source, "source"); if (index < 0) return default(TSource); var list = source as IList; if (list != null) return index < list.Count ? list[index] : default(TSource); return source.SkipWhile((item, i) => i < index).FirstOrDefault(); } /// /// Inverts the order of the elements in a sequence. /// public static IEnumerable Reverse( this IEnumerable source) { CheckNotNull(source, "source"); return ReverseYield(source); } private static IEnumerable ReverseYield(IEnumerable source) { var stack = new Stack(); foreach (var item in source) stack.Push(item); foreach (var item in stack) yield return item; } /// /// Returns a specified number of contiguous elements from the start /// of a sequence. /// public static IEnumerable Take( this IEnumerable source, int count) { return source.Where((item, i) => i < count); } /// /// Bypasses a specified number of elements in a sequence and then /// returns the remaining elements. /// public static IEnumerable Skip( this IEnumerable source, int count) { return source.Where((item, i) => i >= count); } /// /// Bypasses elements in a sequence as long as a specified condition /// is true and then returns the remaining elements. /// public static IEnumerable SkipWhile( this IEnumerable source, Func predicate) { CheckNotNull(predicate, "predicate"); return source.SkipWhile((item, i) => predicate(item)); } /// /// Bypasses elements in a sequence as long as a specified condition /// is true and then returns the remaining elements. The element's /// index is used in the logic of the predicate function. /// public static IEnumerable SkipWhile( this IEnumerable source, Func predicate) { CheckNotNull(source, "source"); CheckNotNull(predicate, "predicate"); return SkipWhileYield(source, predicate); } private static IEnumerable SkipWhileYield( IEnumerable source, Func predicate) { using (var e = source.GetEnumerator()) { for (var i = 0;; i++) { if (!e.MoveNext()) yield break; if (!predicate(e.Current, i)) break; } do { yield return e.Current; } while (e.MoveNext()); } } /// /// Returns the number of elements in a sequence. /// public static int Count( this IEnumerable source) { CheckNotNull(source, "source"); var collection = source as ICollection; return collection != null ? collection.Count : source.Aggregate(0, (count, item) => checked(count + 1)); } /// /// Returns a number that represents how many elements in the /// specified sequence satisfy a condition. /// public static int Count( this IEnumerable source, Func predicate) { return Count(source.Where(predicate)); } /// /// Returns an that represents the total number /// of elements in a sequence. /// public static long LongCount( this IEnumerable source) { CheckNotNull(source, "source"); var array = source as Array; return array != null ? array.LongLength : source.Aggregate(0L, (count, item) => count + 1); } /// /// Returns an that represents how many elements /// in a sequence satisfy a condition. /// public static long LongCount( this IEnumerable source, Func predicate) { return LongCount(source.Where(predicate)); } /// /// Concatenates two sequences. /// public static IEnumerable Concat( this IEnumerable first, IEnumerable second) { CheckNotNull(first, "first"); CheckNotNull(second, "second"); return ConcatYield(first, second); } private static IEnumerable ConcatYield( IEnumerable first, IEnumerable second) { foreach (var item in first) yield return item; foreach (var item in second) yield return item; } /// /// Creates a from an . /// public static List ToList( this IEnumerable source) { CheckNotNull(source, "source"); return new List(source); } /// /// Creates an array from an . /// public static TSource[] ToArray( this IEnumerable source) { return source.ToList().ToArray(); } /// /// Returns distinct elements from a sequence by using the default /// equality comparer to compare values. /// public static IEnumerable Distinct( this IEnumerable source) { return Distinct(source, /* comparer */ null); } /// /// Returns distinct elements from a sequence by using a specified /// to compare values. /// public static IEnumerable Distinct( this IEnumerable source, IEqualityComparer comparer) { CheckNotNull(source, "source"); return DistinctYield(source, comparer); } private static IEnumerable DistinctYield( IEnumerable source, IEqualityComparer comparer) { var set = new Dictionary(comparer); var gotNull = false; foreach (var item in source) { if (item == null) { if (gotNull) continue; gotNull = true; } else { if (set.ContainsKey(item)) continue; set.Add(item, null); } yield return item; } } /// /// Creates a from an /// according to a specified key /// selector function. /// public static ILookup ToLookup( this IEnumerable source, Func keySelector) { return ToLookup(source, keySelector, e => e, /* comparer */ null); } /// /// Creates a from an /// according to a specified key /// selector function and a key comparer. /// public static ILookup ToLookup( this IEnumerable source, Func keySelector, IEqualityComparer comparer) { return ToLookup(source, keySelector, e => e, comparer); } /// /// Creates a from an /// according to specified key /// and element selector functions. /// public static ILookup ToLookup( this IEnumerable source, Func keySelector, Func elementSelector) { return ToLookup(source, keySelector, elementSelector, /* comparer */ null); } /// /// Creates a from an /// according to a specified key /// selector function, a comparer and an element selector function. /// public static ILookup ToLookup( this IEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer) { CheckNotNull(source, "source"); CheckNotNull(keySelector, "keySelector"); CheckNotNull(elementSelector, "elementSelector"); var lookup = new Lookup(comparer); foreach (var item in source) { var key = keySelector(item); var grouping = (Grouping) lookup.Find(key); if (grouping == null) { grouping = new Grouping(key); lookup.Add(grouping); } grouping.Add(elementSelector(item)); } return lookup; } /// /// Groups the elements of a sequence according to a specified key /// selector function. /// public static IEnumerable> GroupBy( this IEnumerable source, Func keySelector) { return GroupBy(source, keySelector, /* comparer */ null); } /// /// Groups the elements of a sequence according to a specified key /// selector function and compares the keys by using a specified /// comparer. /// public static IEnumerable> GroupBy( this IEnumerable source, Func keySelector, IEqualityComparer comparer) { return GroupBy(source, keySelector, e => e, comparer); } /// /// Groups the elements of a sequence according to a specified key /// selector function and projects the elements for each group by /// using a specified function. /// public static IEnumerable> GroupBy( this IEnumerable source, Func keySelector, Func elementSelector) { return GroupBy(source, keySelector, elementSelector, /* comparer */ null); } /// /// Groups the elements of a sequence according to a specified key /// selector function and creates a result value from each group and /// its key. /// public static IEnumerable> GroupBy( this IEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer) { CheckNotNull(source, "source"); CheckNotNull(keySelector, "keySelector"); CheckNotNull(elementSelector, "elementSelector"); return ToLookup(source, keySelector, elementSelector, comparer); } /// /// Groups the elements of a sequence according to a key selector /// function. The keys are compared by using a comparer and each /// group's elements are projected by using a specified function. /// public static IEnumerable GroupBy( this IEnumerable source, Func keySelector, Func, TResult> resultSelector) { return GroupBy(source, keySelector, resultSelector, /* comparer */ null); } /// /// Groups the elements of a sequence according to a specified key /// selector function and creates a result value from each group and /// its key. The elements of each group are projected by using a /// specified function. /// public static IEnumerable GroupBy( this IEnumerable source, Func keySelector, Func, TResult> resultSelector, IEqualityComparer comparer) { CheckNotNull(source, "source"); CheckNotNull(keySelector, "keySelector"); CheckNotNull(resultSelector, "resultSelector"); return ToLookup(source, keySelector, comparer).Select(g => resultSelector(g.Key, g)); } /// /// Groups the elements of a sequence according to a specified key /// selector function and creates a result value from each group and /// its key. The keys are compared by using a specified comparer. /// public static IEnumerable GroupBy( this IEnumerable source, Func keySelector, Func elementSelector, Func, TResult> resultSelector) { return GroupBy(source, keySelector, elementSelector, resultSelector, /* comparer */ null); } /// /// Groups the elements of a sequence according to a specified key /// selector function and creates a result value from each group and /// its key. Key values are compared by using a specified comparer, /// and the elements of each group are projected by using a /// specified function. /// public static IEnumerable GroupBy( this IEnumerable source, Func keySelector, Func elementSelector, Func, TResult> resultSelector, IEqualityComparer comparer) { CheckNotNull(source, "source"); CheckNotNull(keySelector, "keySelector"); CheckNotNull(elementSelector, "elementSelector"); CheckNotNull(resultSelector, "resultSelector"); return ToLookup(source, keySelector, elementSelector, comparer) .Select(g => resultSelector(g.Key, g)); } /// /// Applies an accumulator function over a sequence. /// public static TSource Aggregate( this IEnumerable source, Func func) { CheckNotNull(source, "source"); CheckNotNull(func, "func"); using (var e = source.GetEnumerator()) { if (!e.MoveNext()) throw new InvalidOperationException(); return e.Renumerable().Skip(1).Aggregate(e.Current, func); } } /// /// Applies an accumulator function over a sequence. The specified /// seed value is used as the initial accumulator value. /// public static TAccumulate Aggregate( this IEnumerable source, TAccumulate seed, Func func) { return Aggregate(source, seed, func, r => r); } /// /// Applies an accumulator function over a sequence. The specified /// seed value is used as the initial accumulator value, and the /// specified function is used to select the result value. /// public static TResult Aggregate( this IEnumerable source, TAccumulate seed, Func func, Func resultSelector) { CheckNotNull(source, "source"); CheckNotNull(func, "func"); CheckNotNull(resultSelector, "resultSelector"); var result = seed; foreach (var item in source) result = func(result, item); return resultSelector(result); } /// /// Produces the set union of two sequences by using the default /// equality comparer. /// public static IEnumerable Union( this IEnumerable first, IEnumerable second) { return Union(first, second, /* comparer */ null); } /// /// Produces the set union of two sequences by using a specified /// . /// public static IEnumerable Union( this IEnumerable first, IEnumerable second, IEqualityComparer comparer) { return first.Concat(second).Distinct(comparer); } /// /// Returns the elements of the specified sequence or the type /// parameter's default value in a singleton collection if the /// sequence is empty. /// public static IEnumerable DefaultIfEmpty( this IEnumerable source) { return source.DefaultIfEmpty(default(TSource)); } /// /// Returns the elements of the specified sequence or the specified /// value in a singleton collection if the sequence is empty. /// public static IEnumerable DefaultIfEmpty( this IEnumerable source, TSource defaultValue) { CheckNotNull(source, "source"); return DefaultIfEmptyYield(source, defaultValue); } private static IEnumerable DefaultIfEmptyYield( IEnumerable source, TSource defaultValue) { using (var e = source.GetEnumerator()) { if (!e.MoveNext()) yield return defaultValue; else do { yield return e.Current; } while (e.MoveNext()); } } /// /// Determines whether all elements of a sequence satisfy a condition. /// public static bool All( this IEnumerable source, Func predicate) { CheckNotNull(source, "source"); CheckNotNull(predicate, "predicate"); foreach (var item in source) if (!predicate(item)) return false; return true; } /// /// Determines whether a sequence contains any elements. /// public static bool Any( this IEnumerable source) { CheckNotNull(source, "source"); using (var e = source.GetEnumerator()) return e.MoveNext(); } /// /// Determines whether any element of a sequence satisfies a /// condition. /// public static bool Any( this IEnumerable source, Func predicate) { return source.Where(predicate).Any(); } /// /// Determines whether a sequence contains a specified element by /// using the default equality comparer. /// public static bool Contains( this IEnumerable source, TSource value) { return source.Contains(value, /* comparer */ null); } /// /// Determines whether a sequence contains a specified element by /// using a specified . /// public static bool Contains( this IEnumerable source, TSource value, IEqualityComparer comparer) { CheckNotNull(source, "source"); if (comparer == null) { var collection = source as ICollection; if (collection != null) return collection.Contains(value); } comparer = comparer ?? EqualityComparer.Default; return source.Any(item => comparer.Equals(item, value)); } /// /// Determines whether two sequences are equal by comparing the /// elements by using the default equality comparer for their type. /// public static bool SequenceEqual( this IEnumerable first, IEnumerable second) { return first.SequenceEqual(second, /* comparer */ null); } /// /// Determines whether two sequences are equal by comparing their /// elements by using a specified . /// public static bool SequenceEqual( this IEnumerable first, IEnumerable second, IEqualityComparer comparer) { CheckNotNull(first, "frist"); CheckNotNull(second, "second"); comparer = comparer ?? EqualityComparer.Default; using (IEnumerator lhs = first.GetEnumerator(), rhs = second.GetEnumerator()) { do { if (!lhs.MoveNext()) return !rhs.MoveNext(); if (!rhs.MoveNext()) return false; } while (comparer.Equals(lhs.Current, rhs.Current)); } return false; } /// /// Base implementation for Min/Max operator. /// private static TSource MinMaxImpl( this IEnumerable source, Func lesser) { CheckNotNull(source, "source"); Debug.Assert(lesser != null); return source.Aggregate((a, item) => lesser(a, item) ? a : item); } /// /// Base implementation for Min/Max operator for nullable types. /// private static TSource? MinMaxImpl( this IEnumerable source, TSource? seed, Func lesser) where TSource : struct { CheckNotNull(source, "source"); Debug.Assert(lesser != null); return source.Aggregate(seed, (a, item) => lesser(a, item) ? a : item); // == MinMaxImpl(Repeat(null, 1).Concat(source), lesser); } /// /// Returns the minimum value in a generic sequence. /// public static TSource Min( this IEnumerable source) { var comparer = Comparer.Default; return source.MinMaxImpl((x, y) => comparer.Compare(x, y) < 0); } /// /// Invokes a transform function on each element of a generic /// sequence and returns the minimum resulting value. /// public static TResult Min( this IEnumerable source, Func selector) { return source.Select(selector).Min(); } /// /// Returns the maximum value in a generic sequence. /// public static TSource Max( this IEnumerable source) { var comparer = Comparer.Default; return source.MinMaxImpl((x, y) => comparer.Compare(x, y) > 0); } /// /// Invokes a transform function on each element of a generic /// sequence and returns the maximum resulting value. /// public static TResult Max( this IEnumerable source, Func selector) { return source.Select(selector).Max(); } /// /// Makes an enumerator seen as enumerable once more. /// /// /// The supplied enumerator must have been started. The first element /// returned is the element the enumerator was on when passed in. /// DO NOT use this method if the caller must be a generator. It is /// mostly safe among aggregate operations. /// private static IEnumerable Renumerable(this IEnumerator e) { Debug.Assert(e != null); do { yield return e.Current; } while (e.MoveNext()); } /// /// Sorts the elements of a sequence in ascending order according to a key. /// public static IOrderedEnumerable OrderBy( this IEnumerable source, Func keySelector) { return source.OrderBy(keySelector, /* comparer */ null); } /// /// Sorts the elements of a sequence in ascending order by using a /// specified comparer. /// public static IOrderedEnumerable OrderBy( this IEnumerable source, Func keySelector, IComparer comparer) { CheckNotNull(source, "source"); CheckNotNull(keySelector, "keySelector"); return new OrderedEnumerable(source, keySelector, comparer, /* descending */ false); } /// /// Sorts the elements of a sequence in descending order according to a key. /// public static IOrderedEnumerable OrderByDescending( this IEnumerable source, Func keySelector) { return source.OrderByDescending(keySelector, /* comparer */ null); } /// /// Sorts the elements of a sequence in descending order by using a /// specified comparer. /// public static IOrderedEnumerable OrderByDescending( this IEnumerable source, Func keySelector, IComparer comparer) { CheckNotNull(source, "source"); CheckNotNull(source, "keySelector"); return new OrderedEnumerable(source, keySelector, comparer, /* descending */ true); } /// /// Performs a subsequent ordering of the elements in a sequence in /// ascending order according to a key. /// public static IOrderedEnumerable ThenBy( this IOrderedEnumerable source, Func keySelector) { return source.ThenBy(keySelector, /* comparer */ null); } /// /// Performs a subsequent ordering of the elements in a sequence in /// ascending order by using a specified comparer. /// public static IOrderedEnumerable ThenBy( this IOrderedEnumerable source, Func keySelector, IComparer comparer) { CheckNotNull(source, "source"); return source.CreateOrderedEnumerable(keySelector, comparer, /* descending */ false); } /// /// Performs a subsequent ordering of the elements in a sequence in /// descending order, according to a key. /// public static IOrderedEnumerable ThenByDescending( this IOrderedEnumerable source, Func keySelector) { return source.ThenByDescending(keySelector, /* comparer */ null); } /// /// Performs a subsequent ordering of the elements in a sequence in /// descending order by using a specified comparer. /// public static IOrderedEnumerable ThenByDescending( this IOrderedEnumerable source, Func keySelector, IComparer comparer) { CheckNotNull(source, "source"); return source.CreateOrderedEnumerable(keySelector, comparer, /* descending */ true); } /// /// Base implementation for Intersect and Except operators. /// private static IEnumerable IntersectExceptImpl( this IEnumerable first, IEnumerable second, IEqualityComparer comparer, bool flag) { CheckNotNull(first, "first"); CheckNotNull(second, "second"); var keys = new List(); var flags = new Dictionary(comparer); foreach (var item in first.Where(k => !flags.ContainsKey(k))) { flags.Add(item, !flag); keys.Add(item); } foreach (var item in second.Where(flags.ContainsKey)) flags[item] = flag; // // As per docs, "the marked elements are yielded in the order in // which they were collected. // return keys.Where(item => flags[item]); } /// /// Produces the set intersection of two sequences by using the /// default equality comparer to compare values. /// public static IEnumerable Intersect( this IEnumerable first, IEnumerable second) { return first.Intersect(second, /* comparer */ null); } /// /// Produces the set intersection of two sequences by using the /// specified to compare values. /// public static IEnumerable Intersect( this IEnumerable first, IEnumerable second, IEqualityComparer comparer) { return IntersectExceptImpl(first, second, comparer, /* flag */ true); } /// /// Produces the set difference of two sequences by using the /// default equality comparer to compare values. /// public static IEnumerable Except( this IEnumerable first, IEnumerable second) { return first.Except(second, /* comparer */ null); } /// /// Produces the set difference of two sequences by using the /// specified to compare values. /// public static IEnumerable Except( this IEnumerable first, IEnumerable second, IEqualityComparer comparer) { return IntersectExceptImpl(first, second, comparer, /* flag */ false); } /// /// Creates a from an /// according to a specified key /// selector function. /// public static Dictionary ToDictionary( this IEnumerable source, Func keySelector) { return source.ToDictionary(keySelector, /* comparer */ null); } /// /// Creates a from an /// according to a specified key /// selector function and key comparer. /// public static Dictionary ToDictionary( this IEnumerable source, Func keySelector, IEqualityComparer comparer) { return source.ToDictionary(keySelector, e => e); } /// /// Creates a from an /// according to specified key /// selector and element selector functions. /// public static Dictionary ToDictionary( this IEnumerable source, Func keySelector, Func elementSelector) { return source.ToDictionary(keySelector, elementSelector, /* comparer */ null); } /// /// Creates a from an /// according to a specified key /// selector function, a comparer, and an element selector function. /// public static Dictionary ToDictionary( this IEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer) { CheckNotNull(source, "source"); CheckNotNull(keySelector, "keySelector"); CheckNotNull(elementSelector, "elementSelector"); var dict = new Dictionary(comparer); foreach (var item in source) { // // ToDictionary is meant to throw ArgumentNullException if // keySelector produces a key that is null and // Argument exception if keySelector produces duplicate keys // for two elements. Incidentally, the doucmentation for // IDictionary.Add says that the Add method // throws the same exceptions under the same circumstances // so we don't need to do any additional checking or work // here and let the Add implementation do all the heavy // lifting. // dict.Add(keySelector(item), elementSelector(item)); } return dict; } /// /// Correlates the elements of two sequences based on matching keys. /// The default equality comparer is used to compare keys. /// public static IEnumerable Join( this IEnumerable outer, IEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func resultSelector) { return outer.Join(inner, outerKeySelector, innerKeySelector, resultSelector, /* comparer */ null); } /// /// Correlates the elements of two sequences based on matching keys. /// The default equality comparer is used to compare keys. A /// specified is used to compare keys. /// public static IEnumerable Join( this IEnumerable outer, IEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func resultSelector, IEqualityComparer comparer) { CheckNotNull(outer, "outer"); CheckNotNull(inner, "inner"); CheckNotNull(outerKeySelector, "outerKeySelector"); CheckNotNull(innerKeySelector, "innerKeySelector"); CheckNotNull(resultSelector, "resultSelector"); var lookup = inner.ToLookup(innerKeySelector, comparer); return from o in outer from i in lookup[outerKeySelector(o)] select resultSelector(o, i); } /// /// Correlates the elements of two sequences based on equality of /// keys and groups the results. The default equality comparer is /// used to compare keys. /// public static IEnumerable GroupJoin( this IEnumerable outer, IEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector) { return outer.GroupJoin(inner, outerKeySelector, innerKeySelector, resultSelector, /* comparer */ null); } /// /// Correlates the elements of two sequences based on equality of /// keys and groups the results. The default equality comparer is /// used to compare keys. A specified /// is used to compare keys. /// public static IEnumerable GroupJoin( this IEnumerable outer, IEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector, IEqualityComparer comparer) { CheckNotNull(outer, "outer"); CheckNotNull(inner, "inner"); CheckNotNull(outerKeySelector, "outerKeySelector"); CheckNotNull(innerKeySelector, "innerKeySelector"); CheckNotNull(resultSelector, "resultSelector"); var lookup = inner.ToLookup(innerKeySelector, comparer); return outer.Select(o => resultSelector(o, lookup[outerKeySelector(o)])); } [DebuggerStepThrough] private static void CheckNotNull(T value, string name) where T : class { if (value == null) throw new ArgumentNullException(name); } private static class Sequence { public static readonly IEnumerable Empty = new T[0]; } private sealed class Grouping : List, IGrouping { internal Grouping(K key) { Key = key; } public K Key { get; private set; } } } internal partial class Enumerable { /// /// Computes the sum of a sequence of nullable values. /// public static int Sum( this IEnumerable source) { CheckNotNull(source, "source"); int sum = 0; foreach (var num in source) sum = checked(sum + num); return sum; } /// /// Computes the sum of a sequence of nullable /// values that are obtained by invoking a transform function on /// each element of the input sequence. /// public static int Sum( this IEnumerable source, Func selector) { return source.Select(selector).Sum(); } /// /// Computes the average of a sequence of nullable values. /// public static double Average( this IEnumerable source) { CheckNotNull(source, "source"); long sum = 0; long count = 0; foreach (var num in source) checked { sum += (int) num; count++; } if (count == 0) throw new InvalidOperationException(); return (double) sum/count; } /// /// Computes the average of a sequence of nullable values /// that are obtained by invoking a transform function on each /// element of the input sequence. /// public static double Average( this IEnumerable source, Func selector) { return source.Select(selector).Average(); } /// /// Computes the sum of a sequence of values. /// public static int? Sum( this IEnumerable source) { CheckNotNull(source, "source"); int sum = 0; foreach (var num in source) sum = checked(sum + (num ?? 0)); return sum; } /// /// Computes the sum of a sequence of /// values that are obtained by invoking a transform function on /// each element of the input sequence. /// public static int? Sum( this IEnumerable source, Func selector) { return source.Select(selector).Sum(); } /// /// Computes the average of a sequence of values. /// public static double? Average( this IEnumerable source) { CheckNotNull(source, "source"); long sum = 0; long count = 0; foreach (var num in source.Where(n => n != null)) checked { sum += (int) num; count++; } if (count == 0) return null; return (double?) sum/count; } /// /// Computes the average of a sequence of values /// that are obtained by invoking a transform function on each /// element of the input sequence. /// public static double? Average( this IEnumerable source, Func selector) { return source.Select(selector).Average(); } /// /// Returns the minimum value in a sequence of nullable /// values. /// public static int? Min( this IEnumerable source) { CheckNotNull(source, "source"); return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x); } /// /// Invokes a transform function on each element of a sequence and /// returns the minimum nullable value. /// public static int? Min( this IEnumerable source, Func selector) { return source.Select(selector).Min(); } /// /// Returns the maximum value in a sequence of nullable /// values. /// public static int? Max( this IEnumerable source) { CheckNotNull(source, "source"); return MinMaxImpl(source.Where(x => x != null), null, (max, x) => x == null || (max != null && x.Value < max.Value)); } /// /// Invokes a transform function on each element of a sequence and /// returns the maximum nullable value. /// public static int? Max( this IEnumerable source, Func selector) { return source.Select(selector).Max(); } /// /// Computes the sum of a sequence of nullable values. /// public static long Sum( this IEnumerable source) { CheckNotNull(source, "source"); long sum = 0; foreach (var num in source) sum = checked(sum + num); return sum; } /// /// Computes the sum of a sequence of nullable /// values that are obtained by invoking a transform function on /// each element of the input sequence. /// public static long Sum( this IEnumerable source, Func selector) { return source.Select(selector).Sum(); } /// /// Computes the average of a sequence of nullable values. /// public static double Average( this IEnumerable source) { CheckNotNull(source, "source"); long sum = 0; long count = 0; foreach (var num in source) checked { sum += (long) num; count++; } if (count == 0) throw new InvalidOperationException(); return (double) sum/count; } /// /// Computes the average of a sequence of nullable values /// that are obtained by invoking a transform function on each /// element of the input sequence. /// public static double Average( this IEnumerable source, Func selector) { return source.Select(selector).Average(); } /// /// Computes the sum of a sequence of values. /// public static long? Sum( this IEnumerable source) { CheckNotNull(source, "source"); long sum = 0; foreach (var num in source) sum = checked(sum + (num ?? 0)); return sum; } /// /// Computes the sum of a sequence of /// values that are obtained by invoking a transform function on /// each element of the input sequence. /// public static long? Sum( this IEnumerable source, Func selector) { return source.Select(selector).Sum(); } /// /// Computes the average of a sequence of values. /// public static double? Average( this IEnumerable source) { CheckNotNull(source, "source"); long sum = 0; long count = 0; foreach (var num in source.Where(n => n != null)) checked { sum += (long) num; count++; } if (count == 0) return null; return (double?) sum/count; } /// /// Computes the average of a sequence of values /// that are obtained by invoking a transform function on each /// element of the input sequence. /// public static double? Average( this IEnumerable source, Func selector) { return source.Select(selector).Average(); } /// /// Returns the minimum value in a sequence of nullable /// values. /// public static long? Min( this IEnumerable source) { CheckNotNull(source, "source"); return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x); } /// /// Invokes a transform function on each element of a sequence and /// returns the minimum nullable value. /// public static long? Min( this IEnumerable source, Func selector) { return source.Select(selector).Min(); } /// /// Returns the maximum value in a sequence of nullable /// values. /// public static long? Max( this IEnumerable source) { CheckNotNull(source, "source"); return MinMaxImpl(source.Where(x => x != null), null, (max, x) => x == null || (max != null && x.Value < max.Value)); } /// /// Invokes a transform function on each element of a sequence and /// returns the maximum nullable value. /// public static long? Max( this IEnumerable source, Func selector) { return source.Select(selector).Max(); } /// /// Computes the sum of a sequence of nullable values. /// public static float Sum( this IEnumerable source) { CheckNotNull(source, "source"); float sum = 0; foreach (var num in source) sum = checked(sum + num); return sum; } /// /// Computes the sum of a sequence of nullable /// values that are obtained by invoking a transform function on /// each element of the input sequence. /// public static float Sum( this IEnumerable source, Func selector) { return source.Select(selector).Sum(); } /// /// Computes the average of a sequence of nullable values. /// public static float Average( this IEnumerable source) { CheckNotNull(source, "source"); float sum = 0; long count = 0; foreach (var num in source) checked { sum += (float) num; count++; } if (count == 0) throw new InvalidOperationException(); return (float) sum/count; } /// /// Computes the average of a sequence of nullable values /// that are obtained by invoking a transform function on each /// element of the input sequence. /// public static float Average( this IEnumerable source, Func selector) { return source.Select(selector).Average(); } /// /// Computes the sum of a sequence of values. /// public static float? Sum( this IEnumerable source) { CheckNotNull(source, "source"); float sum = 0; foreach (var num in source) sum = checked(sum + (num ?? 0)); return sum; } /// /// Computes the sum of a sequence of /// values that are obtained by invoking a transform function on /// each element of the input sequence. /// public static float? Sum( this IEnumerable source, Func selector) { return source.Select(selector).Sum(); } /// /// Computes the average of a sequence of values. /// public static float? Average( this IEnumerable source) { CheckNotNull(source, "source"); float sum = 0; long count = 0; foreach (var num in source.Where(n => n != null)) checked { sum += (float) num; count++; } if (count == 0) return null; return (float?) sum/count; } /// /// Computes the average of a sequence of values /// that are obtained by invoking a transform function on each /// element of the input sequence. /// public static float? Average( this IEnumerable source, Func selector) { return source.Select(selector).Average(); } /// /// Returns the minimum value in a sequence of nullable /// values. /// public static float? Min( this IEnumerable source) { CheckNotNull(source, "source"); return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x); } /// /// Invokes a transform function on each element of a sequence and /// returns the minimum nullable value. /// public static float? Min( this IEnumerable source, Func selector) { return source.Select(selector).Min(); } /// /// Returns the maximum value in a sequence of nullable /// values. /// public static float? Max( this IEnumerable source) { CheckNotNull(source, "source"); return MinMaxImpl(source.Where(x => x != null), null, (max, x) => x == null || (max != null && x.Value < max.Value)); } /// /// Invokes a transform function on each element of a sequence and /// returns the maximum nullable value. /// public static float? Max( this IEnumerable source, Func selector) { return source.Select(selector).Max(); } /// /// Computes the sum of a sequence of nullable values. /// public static double Sum( this IEnumerable source) { CheckNotNull(source, "source"); double sum = 0; foreach (var num in source) sum = checked(sum + num); return sum; } /// /// Computes the sum of a sequence of nullable /// values that are obtained by invoking a transform function on /// each element of the input sequence. /// public static double Sum( this IEnumerable source, Func selector) { return source.Select(selector).Sum(); } /// /// Computes the average of a sequence of nullable values. /// public static double Average( this IEnumerable source) { CheckNotNull(source, "source"); double sum = 0; long count = 0; foreach (var num in source) checked { sum += (double) num; count++; } if (count == 0) throw new InvalidOperationException(); return (double) sum/count; } /// /// Computes the average of a sequence of nullable values /// that are obtained by invoking a transform function on each /// element of the input sequence. /// public static double Average( this IEnumerable source, Func selector) { return source.Select(selector).Average(); } /// /// Computes the sum of a sequence of values. /// public static double? Sum( this IEnumerable source) { CheckNotNull(source, "source"); double sum = 0; foreach (var num in source) sum = checked(sum + (num ?? 0)); return sum; } /// /// Computes the sum of a sequence of /// values that are obtained by invoking a transform function on /// each element of the input sequence. /// public static double? Sum( this IEnumerable source, Func selector) { return source.Select(selector).Sum(); } /// /// Computes the average of a sequence of values. /// public static double? Average( this IEnumerable source) { CheckNotNull(source, "source"); double sum = 0; long count = 0; foreach (var num in source.Where(n => n != null)) checked { sum += (double) num; count++; } if (count == 0) return null; return (double?) sum/count; } /// /// Computes the average of a sequence of values /// that are obtained by invoking a transform function on each /// element of the input sequence. /// public static double? Average( this IEnumerable source, Func selector) { return source.Select(selector).Average(); } /// /// Returns the minimum value in a sequence of nullable /// values. /// public static double? Min( this IEnumerable source) { CheckNotNull(source, "source"); return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x); } /// /// Invokes a transform function on each element of a sequence and /// returns the minimum nullable value. /// public static double? Min( this IEnumerable source, Func selector) { return source.Select(selector).Min(); } /// /// Returns the maximum value in a sequence of nullable /// values. /// public static double? Max( this IEnumerable source) { CheckNotNull(source, "source"); return MinMaxImpl(source.Where(x => x != null), null, (max, x) => x == null || (max != null && x.Value < max.Value)); } /// /// Invokes a transform function on each element of a sequence and /// returns the maximum nullable value. /// public static double? Max( this IEnumerable source, Func selector) { return source.Select(selector).Max(); } /// /// Computes the sum of a sequence of nullable values. /// public static decimal Sum( this IEnumerable source) { CheckNotNull(source, "source"); decimal sum = 0; foreach (var num in source) sum = checked(sum + num); return sum; } /// /// Computes the sum of a sequence of nullable /// values that are obtained by invoking a transform function on /// each element of the input sequence. /// public static decimal Sum( this IEnumerable source, Func selector) { return source.Select(selector).Sum(); } /// /// Computes the average of a sequence of nullable values. /// public static decimal Average( this IEnumerable source) { CheckNotNull(source, "source"); decimal sum = 0; long count = 0; foreach (var num in source) checked { sum += (decimal) num; count++; } if (count == 0) throw new InvalidOperationException(); return (decimal) sum/count; } /// /// Computes the average of a sequence of nullable values /// that are obtained by invoking a transform function on each /// element of the input sequence. /// public static decimal Average( this IEnumerable source, Func selector) { return source.Select(selector).Average(); } /// /// Computes the sum of a sequence of values. /// public static decimal? Sum( this IEnumerable source) { CheckNotNull(source, "source"); decimal sum = 0; foreach (var num in source) sum = checked(sum + (num ?? 0)); return sum; } /// /// Computes the sum of a sequence of /// values that are obtained by invoking a transform function on /// each element of the input sequence. /// public static decimal? Sum( this IEnumerable source, Func selector) { return source.Select(selector).Sum(); } /// /// Computes the average of a sequence of values. /// public static decimal? Average( this IEnumerable source) { CheckNotNull(source, "source"); decimal sum = 0; long count = 0; foreach (var num in source.Where(n => n != null)) checked { sum += (decimal) num; count++; } if (count == 0) return null; return (decimal?) sum/count; } /// /// Computes the average of a sequence of values /// that are obtained by invoking a transform function on each /// element of the input sequence. /// public static decimal? Average( this IEnumerable source, Func selector) { return source.Select(selector).Average(); } /// /// Returns the minimum value in a sequence of nullable /// values. /// public static decimal? Min( this IEnumerable source) { CheckNotNull(source, "source"); return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x); } /// /// Invokes a transform function on each element of a sequence and /// returns the minimum nullable value. /// public static decimal? Min( this IEnumerable source, Func selector) { return source.Select(selector).Min(); } /// /// Returns the maximum value in a sequence of nullable /// values. /// public static decimal? Max( this IEnumerable source) { CheckNotNull(source, "source"); return MinMaxImpl(source.Where(x => x != null), null, (max, x) => x == null || (max != null && x.Value < max.Value)); } /// /// Invokes a transform function on each element of a sequence and /// returns the maximum nullable value. /// public static decimal? Max( this IEnumerable source, Func selector) { return source.Select(selector).Max(); } } /// /// Represents a collection of objects that have a common key. /// internal partial interface IGrouping : IEnumerable { /// /// Gets the key of the . /// TKey Key { get; } } /// /// Defines an indexer, size property, and Boolean search method for /// data structures that map keys to /// sequences of values. /// internal partial interface ILookup : IEnumerable> { bool Contains(TKey key); int Count { get; } IEnumerable this[TKey key] { get; } } /// /// Represents a sorted sequence. /// internal partial interface IOrderedEnumerable : IEnumerable { /// /// Performs a subsequent ordering on the elements of an /// according to a key. /// IOrderedEnumerable CreateOrderedEnumerable( Func keySelector, IComparer comparer, bool descending); } /// /// Represents a collection of keys each mapped to one or more values. /// internal sealed class Lookup : ILookup { private readonly Dictionary> _map; internal Lookup(IEqualityComparer comparer) { _map = new Dictionary>(comparer); } internal void Add(IGrouping item) { _map.Add(item.Key, item); } internal IEnumerable Find(TKey key) { IGrouping grouping; return _map.TryGetValue(key, out grouping) ? grouping : null; } /// /// Gets the number of key/value collection pairs in the . /// public int Count { get { return _map.Count; } } /// /// Gets the collection of values indexed by the specified key. /// public IEnumerable this[TKey key] { get { IGrouping result; return _map.TryGetValue(key, out result) ? result : Enumerable.Empty(); } } /// /// Determines whether a specified key is in the . /// public bool Contains(TKey key) { return _map.ContainsKey(key); } /// /// Applies a transform function to each key and its associated /// values and returns the results. /// public IEnumerable ApplyResultSelector( Func, TResult> resultSelector) { if (resultSelector == null) throw new ArgumentNullException("resultSelector"); foreach (var pair in _map) yield return resultSelector(pair.Key, pair.Value); } /// /// Returns a generic enumerator that iterates through the . /// public IEnumerator> GetEnumerator() { return _map.Values.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } internal sealed class OrderedEnumerable : IOrderedEnumerable { private readonly IEnumerable _source; private readonly List> _comparisons; public OrderedEnumerable(IEnumerable source, Func keySelector, IComparer comparer, bool descending) : this(source, null, keySelector, comparer, descending) { } private OrderedEnumerable(IEnumerable source, List> comparisons, Func keySelector, IComparer comparer, bool descending) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); _source = source; comparer = comparer ?? Comparer.Default; if (comparisons == null) comparisons = new List>( /* capacity */ 4); comparisons.Add((x, y) => (descending ? -1 : 1)*comparer.Compare(keySelector(x), keySelector(y))); _comparisons = comparisons; } public IOrderedEnumerable CreateOrderedEnumerable( Func keySelector, IComparer comparer, bool descending) { return new OrderedEnumerable(_source, _comparisons, keySelector, comparer, descending); } public IEnumerator GetEnumerator() { // // We sort using List.Sort, but docs say that it performs an // unstable sort. LINQ, on the other hand, says OrderBy performs // a stable sort. So convert the source sequence into a sequence // of tuples where the second element tags the position of the // element from the source sequence (First). The position is // then used as a tie breaker when all keys compare equal, // thus making the sort stable. // var list = _source.Select(new Func>(TagPosition)).ToList(); list.Sort((x, y) => { // // Compare keys from left to right. // var comparisons = _comparisons; for (var i = 0; i < comparisons.Count; i++) { var result = comparisons[i](x.First, y.First); if (result != 0) return result; } // // All keys compared equal so now break the tie by their // position in the original sequence, making the sort stable. // return x.Second.CompareTo(y.Second); }); return list.Select(new Func, T>(GetFirst)).GetEnumerator(); } /// /// See issue #11 /// for why this method is needed and cannot be expressed as a /// lambda at the call site. /// private static Tuple TagPosition(T e, int i) { return new Tuple(e, i); } /// /// See issue #11 /// for why this method is needed and cannot be expressed as a /// lambda at the call site. /// private static T GetFirst(Tuple pv) { return pv.First; } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } [Serializable] internal struct Tuple : IEquatable> { public TFirst First { get; private set; } public TSecond Second { get; private set; } public Tuple(TFirst first, TSecond second) : this() { First = first; Second = second; } public override bool Equals(object obj) { return obj != null && obj is Tuple && base.Equals((Tuple) obj); } public bool Equals(Tuple other) { return EqualityComparer.Default.Equals(other.First, First) && EqualityComparer.Default.Equals(other.Second, Second); } public override int GetHashCode() { var num = 0x7a2f0b42; num = (-1521134295*num) + EqualityComparer.Default.GetHashCode(First); return (-1521134295*num) + EqualityComparer.Default.GetHashCode(Second); } public override string ToString() { return string.Format(@"{{ First = {0}, Second = {1} }}", First, Second); } } } namespace Newtonsoft.Json.Serialization { public delegate TResult Func(); public delegate TResult Func(T a); public delegate TResult Func(T1 arg1, T2 arg2); public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3); public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4); public delegate void Action(); public delegate void Action(T1 arg1, T2 arg2); public delegate void Action(T1 arg1, T2 arg2, T3 arg3); public delegate void Action(T1 arg1, T2 arg2, T3 arg3, T4 arg4); } namespace System.Runtime.CompilerServices { /// /// This attribute allows us to define extension methods without /// requiring .NET Framework 3.5. For more information, see the section, /// Extension Methods in .NET Framework 2.0 Apps, /// of Basic Instincts: Extension Methods /// column in MSDN Magazine, /// issue Nov 2007. /// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)] internal sealed class ExtensionAttribute : Attribute { } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs0000644000175000017500000002056512253423361033724 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(SILVERLIGHT || PORTABLE || NETFX_CORE) using System; using System.Collections.Generic; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #endif using System.Reflection; using System.Reflection.Emit; using Newtonsoft.Json.Serialization; using System.Globalization; namespace Newtonsoft.Json.Utilities { internal class DynamicReflectionDelegateFactory : ReflectionDelegateFactory { public static DynamicReflectionDelegateFactory Instance = new DynamicReflectionDelegateFactory(); private static DynamicMethod CreateDynamicMethod(string name, Type returnType, Type[] parameterTypes, Type owner) { DynamicMethod dynamicMethod = !owner.IsInterface() ? new DynamicMethod(name, returnType, parameterTypes, owner, true) : new DynamicMethod(name, returnType, parameterTypes, owner.Module, true); return dynamicMethod; } public override MethodCall CreateMethodCall(MethodBase method) { DynamicMethod dynamicMethod = CreateDynamicMethod(method.ToString(), typeof(object), new[] { typeof(object), typeof(object[]) }, method.DeclaringType); ILGenerator generator = dynamicMethod.GetILGenerator(); GenerateCreateMethodCallIL(method, generator); return (MethodCall)dynamicMethod.CreateDelegate(typeof(MethodCall)); } private void GenerateCreateMethodCallIL(MethodBase method, ILGenerator generator) { ParameterInfo[] args = method.GetParameters(); Label argsOk = generator.DefineLabel(); generator.Emit(OpCodes.Ldarg_1); generator.Emit(OpCodes.Ldlen); generator.Emit(OpCodes.Ldc_I4, args.Length); generator.Emit(OpCodes.Beq, argsOk); generator.Emit(OpCodes.Newobj, typeof(TargetParameterCountException).GetConstructor(ReflectionUtils.EmptyTypes)); generator.Emit(OpCodes.Throw); generator.MarkLabel(argsOk); if (!method.IsConstructor && !method.IsStatic) generator.PushInstance(method.DeclaringType); for (int i = 0; i < args.Length; i++) { generator.Emit(OpCodes.Ldarg_1); generator.Emit(OpCodes.Ldc_I4, i); generator.Emit(OpCodes.Ldelem_Ref); generator.UnboxIfNeeded(args[i].ParameterType); } if (method.IsConstructor) generator.Emit(OpCodes.Newobj, (ConstructorInfo)method); else if (method.IsFinal || !method.IsVirtual) generator.CallMethod((MethodInfo)method); Type returnType = method.IsConstructor ? method.DeclaringType : ((MethodInfo)method).ReturnType; if (returnType != typeof(void)) generator.BoxIfNeeded(returnType); else generator.Emit(OpCodes.Ldnull); generator.Return(); } public override Func CreateDefaultConstructor(Type type) { DynamicMethod dynamicMethod = CreateDynamicMethod("Create" + type.FullName, typeof(T), ReflectionUtils.EmptyTypes, type); dynamicMethod.InitLocals = true; ILGenerator generator = dynamicMethod.GetILGenerator(); GenerateCreateDefaultConstructorIL(type, generator); return (Func)dynamicMethod.CreateDelegate(typeof(Func)); } private void GenerateCreateDefaultConstructorIL(Type type, ILGenerator generator) { if (type.IsValueType()) { generator.DeclareLocal(type); generator.Emit(OpCodes.Ldloc_0); generator.Emit(OpCodes.Box, type); } else { ConstructorInfo constructorInfo = type.GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, ReflectionUtils.EmptyTypes, null); if (constructorInfo == null) throw new ArgumentException("Could not get constructor for {0}.".FormatWith(CultureInfo.InvariantCulture, type)); generator.Emit(OpCodes.Newobj, constructorInfo); } generator.Return(); } public override Func CreateGet(PropertyInfo propertyInfo) { DynamicMethod dynamicMethod = CreateDynamicMethod("Get" + propertyInfo.Name, typeof(T), new[] { typeof(object) }, propertyInfo.DeclaringType); ILGenerator generator = dynamicMethod.GetILGenerator(); GenerateCreateGetPropertyIL(propertyInfo, generator); return (Func)dynamicMethod.CreateDelegate(typeof(Func)); } private void GenerateCreateGetPropertyIL(PropertyInfo propertyInfo, ILGenerator generator) { MethodInfo getMethod = propertyInfo.GetGetMethod(true); if (getMethod == null) throw new ArgumentException("Property '{0}' does not have a getter.".FormatWith(CultureInfo.InvariantCulture, propertyInfo.Name)); if (!getMethod.IsStatic) generator.PushInstance(propertyInfo.DeclaringType); generator.CallMethod(getMethod); generator.BoxIfNeeded(propertyInfo.PropertyType); generator.Return(); } public override Func CreateGet(FieldInfo fieldInfo) { DynamicMethod dynamicMethod = CreateDynamicMethod("Get" + fieldInfo.Name, typeof(T), new[] { typeof(object) }, fieldInfo.DeclaringType); ILGenerator generator = dynamicMethod.GetILGenerator(); GenerateCreateGetFieldIL(fieldInfo, generator); return (Func)dynamicMethod.CreateDelegate(typeof(Func)); } private void GenerateCreateGetFieldIL(FieldInfo fieldInfo, ILGenerator generator) { if (!fieldInfo.IsStatic) generator.PushInstance(fieldInfo.DeclaringType); generator.Emit(OpCodes.Ldfld, fieldInfo); generator.BoxIfNeeded(fieldInfo.FieldType); generator.Return(); } public override Action CreateSet(FieldInfo fieldInfo) { DynamicMethod dynamicMethod = CreateDynamicMethod("Set" + fieldInfo.Name, null, new[] { typeof(T), typeof(object) }, fieldInfo.DeclaringType); ILGenerator generator = dynamicMethod.GetILGenerator(); GenerateCreateSetFieldIL(fieldInfo, generator); return (Action)dynamicMethod.CreateDelegate(typeof(Action)); } internal static void GenerateCreateSetFieldIL(FieldInfo fieldInfo, ILGenerator generator) { if (!fieldInfo.IsStatic) generator.PushInstance(fieldInfo.DeclaringType); generator.Emit(OpCodes.Ldarg_1); generator.UnboxIfNeeded(fieldInfo.FieldType); generator.Emit(OpCodes.Stfld, fieldInfo); generator.Return(); } public override Action CreateSet(PropertyInfo propertyInfo) { DynamicMethod dynamicMethod = CreateDynamicMethod("Set" + propertyInfo.Name, null, new[] { typeof(T), typeof(object) }, propertyInfo.DeclaringType); ILGenerator generator = dynamicMethod.GetILGenerator(); GenerateCreateSetPropertyIL(propertyInfo, generator); return (Action)dynamicMethod.CreateDelegate(typeof(Action)); } internal static void GenerateCreateSetPropertyIL(PropertyInfo propertyInfo, ILGenerator generator) { MethodInfo setMethod = propertyInfo.GetSetMethod(true); if (!setMethod.IsStatic) generator.PushInstance(propertyInfo.DeclaringType); generator.Emit(OpCodes.Ldarg_1); generator.UnboxIfNeeded(propertyInfo.PropertyType); generator.CallMethod(setMethod); generator.Return(); } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs0000644000175000017500000002303012253423361030776 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Collections; using System.Threading; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Utilities { internal interface IWrappedDictionary : IDictionary { object UnderlyingDictionary { get; } } internal class DictionaryWrapper : IDictionary, IWrappedDictionary { private readonly IDictionary _dictionary; private readonly IDictionary _genericDictionary; private object _syncRoot; public DictionaryWrapper(IDictionary dictionary) { ValidationUtils.ArgumentNotNull(dictionary, "dictionary"); _dictionary = dictionary; } public DictionaryWrapper(IDictionary dictionary) { ValidationUtils.ArgumentNotNull(dictionary, "dictionary"); _genericDictionary = dictionary; } public void Add(TKey key, TValue value) { if (_dictionary != null) _dictionary.Add(key, value); else _genericDictionary.Add(key, value); } public bool ContainsKey(TKey key) { if (_dictionary != null) return _dictionary.Contains(key); else return _genericDictionary.ContainsKey(key); } public ICollection Keys { get { if (_dictionary != null) return _dictionary.Keys.Cast().ToList(); else return _genericDictionary.Keys; } } public bool Remove(TKey key) { if (_dictionary != null) { if (_dictionary.Contains(key)) { _dictionary.Remove(key); return true; } else { return false; } } return _genericDictionary.Remove(key); } public bool TryGetValue(TKey key, out TValue value) { if (_dictionary != null) { if (!_dictionary.Contains(key)) { value = default(TValue); return false; } else { value = (TValue)_dictionary[key]; return true; } } return _genericDictionary.TryGetValue(key, out value); } public ICollection Values { get { if (_dictionary != null) return _dictionary.Values.Cast().ToList(); else return _genericDictionary.Values; } } public TValue this[TKey key] { get { if (_dictionary != null) return (TValue)_dictionary[key]; return _genericDictionary[key]; } set { if (_dictionary != null) _dictionary[key] = value; else _genericDictionary[key] = value; } } public void Add(KeyValuePair item) { if (_dictionary != null) ((IList)_dictionary).Add(item); else _genericDictionary.Add(item); } public void Clear() { if (_dictionary != null) _dictionary.Clear(); else _genericDictionary.Clear(); } public bool Contains(KeyValuePair item) { if (_dictionary != null) return ((IList)_dictionary).Contains(item); else return _genericDictionary.Contains(item); } public void CopyTo(KeyValuePair[] array, int arrayIndex) { if (_dictionary != null) { foreach (DictionaryEntry item in _dictionary) { array[arrayIndex++] = new KeyValuePair((TKey)item.Key, (TValue)item.Value); } } else { _genericDictionary.CopyTo(array, arrayIndex); } } public int Count { get { if (_dictionary != null) return _dictionary.Count; else return _genericDictionary.Count; } } public bool IsReadOnly { get { if (_dictionary != null) return _dictionary.IsReadOnly; else return _genericDictionary.IsReadOnly; } } public bool Remove(KeyValuePair item) { if (_dictionary != null) { if (_dictionary.Contains(item.Key)) { object value = _dictionary[item.Key]; if (object.Equals(value, item.Value)) { _dictionary.Remove(item.Key); return true; } else { return false; } } else { return true; } } else { return _genericDictionary.Remove(item); } } public IEnumerator> GetEnumerator() { if (_dictionary != null) return _dictionary.Cast().Select(de => new KeyValuePair((TKey)de.Key, (TValue)de.Value)).GetEnumerator(); else return _genericDictionary.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } void IDictionary.Add(object key, object value) { if (_dictionary != null) _dictionary.Add(key, value); else _genericDictionary.Add((TKey)key, (TValue)value); } object IDictionary.this[object key] { get { if (_dictionary != null) return _dictionary[key]; else return _genericDictionary[(TKey)key]; } set { if (_dictionary != null) _dictionary[key] = value; else _genericDictionary[(TKey)key] = (TValue)value; } } private struct DictionaryEnumerator : IDictionaryEnumerator { private readonly IEnumerator> _e; public DictionaryEnumerator(IEnumerator> e) { ValidationUtils.ArgumentNotNull(e, "e"); _e = e; } public DictionaryEntry Entry { get { return (DictionaryEntry)Current; } } public object Key { get { return Entry.Key; } } public object Value { get { return Entry.Value; } } public object Current { get { return new DictionaryEntry(_e.Current.Key, _e.Current.Value); } } public bool MoveNext() { return _e.MoveNext(); } public void Reset() { _e.Reset(); } } IDictionaryEnumerator IDictionary.GetEnumerator() { if (_dictionary != null) return _dictionary.GetEnumerator(); else return new DictionaryEnumerator(_genericDictionary.GetEnumerator()); } bool IDictionary.Contains(object key) { if (_genericDictionary != null) return _genericDictionary.ContainsKey((TKey)key); else return _dictionary.Contains(key); } bool IDictionary.IsFixedSize { get { if (_genericDictionary != null) return false; else return _dictionary.IsFixedSize; } } ICollection IDictionary.Keys { get { if (_genericDictionary != null) return _genericDictionary.Keys.ToList(); else return _dictionary.Keys; } } public void Remove(object key) { if (_dictionary != null) _dictionary.Remove(key); else _genericDictionary.Remove((TKey)key); } ICollection IDictionary.Values { get { if (_genericDictionary != null) return _genericDictionary.Values.ToList(); else return _dictionary.Values; } } void ICollection.CopyTo(Array array, int index) { if (_dictionary != null) _dictionary.CopyTo(array, index); else _genericDictionary.CopyTo((KeyValuePair[])array, index); } bool ICollection.IsSynchronized { get { if (_dictionary != null) return _dictionary.IsSynchronized; else return false; } } object ICollection.SyncRoot { get { if (_syncRoot == null) Interlocked.CompareExchange(ref _syncRoot, new object(), null); return _syncRoot; } } public object UnderlyingDictionary { get { if (_dictionary != null) return _dictionary; else return _genericDictionary; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConverterAttribute.cs0000644000175000017500000000522312253423361030046 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using Newtonsoft.Json.Utilities; using System.Globalization; namespace Newtonsoft.Json { /// /// Instructs the to use the specified when serializing the member or class. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface | AttributeTargets.Enum | AttributeTargets.Parameter, AllowMultiple = false)] public sealed class JsonConverterAttribute : Attribute { private readonly Type _converterType; /// /// Gets the type of the converter. /// /// The type of the converter. public Type ConverterType { get { return _converterType; } } /// /// Initializes a new instance of the class. /// /// Type of the converter. public JsonConverterAttribute(Type converterType) { if (converterType == null) throw new ArgumentNullException("converterType"); _converterType = converterType; } internal static JsonConverter CreateJsonConverterInstance(Type converterType) { try { return (JsonConverter)Activator.CreateInstance(converterType); } catch (Exception ex) { throw new JsonException("Error creating {0}".FormatWith(CultureInfo.InvariantCulture, converterType), ex); } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConverter.cs0000644000175000017500000000710012253423361026156 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Text; using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Schema; namespace Newtonsoft.Json { /// /// Converts an object to and from JSON. /// public abstract class JsonConverter { /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public abstract void WriteJson(JsonWriter writer, object value, JsonSerializer serializer); /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public abstract object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer); /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public abstract bool CanConvert(Type objectType); /// /// Gets the of the JSON produced by the JsonConverter. /// /// The of the JSON produced by the JsonConverter. public virtual JsonSchema GetSchema() { return null; } /// /// Gets a value indicating whether this can read JSON. /// /// true if this can read JSON; otherwise, false. public virtual bool CanRead { get { return true; } } /// /// Gets a value indicating whether this can write JSON. /// /// true if this can write JSON; otherwise, false. public virtual bool CanWrite { get { return true; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonWriter.cs0000644000175000017500000011336212253423361025473 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.IO; using Newtonsoft.Json.Utilities; using System.Globalization; #if NETFX_CORE using IConvertible = Newtonsoft.Json.Utilities.Convertible; #endif #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json { /// /// Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. /// public abstract class JsonWriter : IDisposable { internal enum State { Start, Property, ObjectStart, Object, ArrayStart, Array, ConstructorStart, Constructor, Bytes, Closed, Error } // array that gives a new state based on the current state an the token being written private static readonly State[][] StateArray; internal static readonly State[][] StateArrayTempate = new[] { // Start PropertyName ObjectStart Object ArrayStart Array ConstructorStart Constructor Closed Error // /* None */new[]{ State.Error, State.Error, State.Error, State.Error, State.Error, State.Error, State.Error, State.Error, State.Error, State.Error }, /* StartObject */new[]{ State.ObjectStart, State.ObjectStart, State.Error, State.Error, State.ObjectStart, State.ObjectStart, State.ObjectStart, State.ObjectStart, State.Error, State.Error }, /* StartArray */new[]{ State.ArrayStart, State.ArrayStart, State.Error, State.Error, State.ArrayStart, State.ArrayStart, State.ArrayStart, State.ArrayStart, State.Error, State.Error }, /* StartConstructor */new[]{ State.ConstructorStart, State.ConstructorStart, State.Error, State.Error, State.ConstructorStart, State.ConstructorStart, State.ConstructorStart, State.ConstructorStart, State.Error, State.Error }, /* StartProperty */new[]{ State.Property, State.Error, State.Property, State.Property, State.Error, State.Error, State.Error, State.Error, State.Error, State.Error }, /* Comment */new[]{ State.Start, State.Property, State.ObjectStart, State.Object, State.ArrayStart, State.Array, State.Constructor, State.Constructor, State.Error, State.Error }, /* Raw */new[]{ State.Start, State.Property, State.ObjectStart, State.Object, State.ArrayStart, State.Array, State.Constructor, State.Constructor, State.Error, State.Error }, /* Value (this will be copied) */new[]{ State.Start, State.Object, State.Error, State.Error, State.Array, State.Array, State.Constructor, State.Constructor, State.Error, State.Error } }; internal static State[][] BuildStateArray() { var allStates = StateArrayTempate.ToList(); var errorStates = StateArrayTempate[0]; var valueStates = StateArrayTempate[7]; foreach (JsonToken valueToken in EnumUtils.GetValues(typeof(JsonToken))) { if (allStates.Count <= (int)valueToken) { switch (valueToken) { case JsonToken.Integer: case JsonToken.Float: case JsonToken.String: case JsonToken.Boolean: case JsonToken.Null: case JsonToken.Undefined: case JsonToken.Date: case JsonToken.Bytes: allStates.Add(valueStates); break; default: allStates.Add(errorStates); break; } } } return allStates.ToArray(); } static JsonWriter() { StateArray = BuildStateArray(); } private readonly List _stack; private JsonPosition _currentPosition; private State _currentState; private Formatting _formatting; /// /// Gets or sets a value indicating whether the underlying stream or /// should be closed when the writer is closed. /// /// /// true to close the underlying stream or when /// the writer is closed; otherwise false. The default is true. /// public bool CloseOutput { get; set; } /// /// Gets the top. /// /// The top. protected internal int Top { get { int depth = _stack.Count; if (Peek() != JsonContainerType.None) depth++; return depth; } } internal string ContainerPath { get { if (_currentPosition.Type == JsonContainerType.None) return string.Empty; IEnumerable positions = (_currentPosition.InsideContainer()) ? _stack : _stack.Concat(new[] { _currentPosition }); return JsonPosition.BuildPath(positions); } } /// /// Gets the state of the writer. /// public WriteState WriteState { get { switch (_currentState) { case State.Error: return WriteState.Error; case State.Closed: return WriteState.Closed; case State.Object: case State.ObjectStart: return WriteState.Object; case State.Array: case State.ArrayStart: return WriteState.Array; case State.Constructor: case State.ConstructorStart: return WriteState.Constructor; case State.Property: return WriteState.Property; case State.Start: return WriteState.Start; default: throw JsonWriterException.Create(this, "Invalid state: " + _currentState, null); } } } /// /// Gets the path of the writer. /// public string Path { get { if (_currentPosition.Type == JsonContainerType.None) return string.Empty; return JsonPosition.BuildPath(_stack.Concat(new[] { _currentPosition })); } } private DateFormatHandling _dateFormatHandling; private DateTimeZoneHandling _dateTimeZoneHandling; /// /// Indicates how JSON text output is formatted. /// public Formatting Formatting { get { return _formatting; } set { _formatting = value; } } /// /// Get or set how dates are written to JSON text. /// public DateFormatHandling DateFormatHandling { get { return _dateFormatHandling; } set { _dateFormatHandling = value; } } /// /// Get or set how time zones are handling when writing JSON. /// public DateTimeZoneHandling DateTimeZoneHandling { get { return _dateTimeZoneHandling; } set { _dateTimeZoneHandling = value; } } /// /// Creates an instance of the JsonWriter class. /// protected JsonWriter() { _stack = new List(4); _currentState = State.Start; _formatting = Formatting.None; _dateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind; CloseOutput = true; } private void UpdateScopeWithFinishedValue() { if (_currentPosition.Type == JsonContainerType.Array || _currentPosition.Type == JsonContainerType.Constructor) { if (_currentPosition.Position == null) _currentPosition.Position = 0; else _currentPosition.Position++; } } private void Push(JsonContainerType value) { UpdateScopeWithFinishedValue(); if (_currentPosition.Type == JsonContainerType.None) { _currentPosition.Type = value; } else { _stack.Add(_currentPosition); var state = new JsonPosition { Type = value }; _currentPosition = state; } } private JsonContainerType Pop() { JsonPosition oldPosition; if (_stack.Count > 0) { oldPosition = _currentPosition; _currentPosition = _stack[_stack.Count - 1]; _stack.RemoveAt(_stack.Count - 1); } else { oldPosition = _currentPosition; _currentPosition = new JsonPosition(); } return oldPosition.Type; } private JsonContainerType Peek() { return _currentPosition.Type; } /// /// Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. /// public abstract void Flush(); /// /// Closes this stream and the underlying stream. /// public virtual void Close() { AutoCompleteAll(); } /// /// Writes the beginning of a Json object. /// public virtual void WriteStartObject() { AutoComplete(JsonToken.StartObject); Push(JsonContainerType.Object); } /// /// Writes the end of a Json object. /// public virtual void WriteEndObject() { AutoCompleteClose(JsonToken.EndObject); } /// /// Writes the beginning of a Json array. /// public virtual void WriteStartArray() { AutoComplete(JsonToken.StartArray); Push(JsonContainerType.Array); } /// /// Writes the end of an array. /// public virtual void WriteEndArray() { AutoCompleteClose(JsonToken.EndArray); } /// /// Writes the start of a constructor with the given name. /// /// The name of the constructor. public virtual void WriteStartConstructor(string name) { AutoComplete(JsonToken.StartConstructor); Push(JsonContainerType.Constructor); } /// /// Writes the end constructor. /// public virtual void WriteEndConstructor() { AutoCompleteClose(JsonToken.EndConstructor); } /// /// Writes the property name of a name/value pair on a Json object. /// /// The name of the property. public virtual void WritePropertyName(string name) { _currentPosition.PropertyName = name; AutoComplete(JsonToken.PropertyName); } /// /// Writes the end of the current Json object or array. /// public virtual void WriteEnd() { WriteEnd(Peek()); } /// /// Writes the current token. /// /// The to read the token from. public void WriteToken(JsonReader reader) { ValidationUtils.ArgumentNotNull(reader, "reader"); int initialDepth; if (reader.TokenType == JsonToken.None) initialDepth = -1; else if (!IsStartToken(reader.TokenType)) initialDepth = reader.Depth + 1; else initialDepth = reader.Depth; WriteToken(reader, initialDepth); } internal void WriteToken(JsonReader reader, int initialDepth) { do { switch (reader.TokenType) { case JsonToken.None: // read to next break; case JsonToken.StartObject: WriteStartObject(); break; case JsonToken.StartArray: WriteStartArray(); break; case JsonToken.StartConstructor: string constructorName = reader.Value.ToString(); // write a JValue date when the constructor is for a date if (string.Equals(constructorName, "Date", StringComparison.Ordinal)) WriteConstructorDate(reader); else WriteStartConstructor(reader.Value.ToString()); break; case JsonToken.PropertyName: WritePropertyName(reader.Value.ToString()); break; case JsonToken.Comment: WriteComment(reader.Value.ToString()); break; case JsonToken.Integer: WriteValue(Convert.ToInt64(reader.Value, CultureInfo.InvariantCulture)); break; case JsonToken.Float: WriteValue(Convert.ToDouble(reader.Value, CultureInfo.InvariantCulture)); break; case JsonToken.String: WriteValue(reader.Value.ToString()); break; case JsonToken.Boolean: WriteValue(Convert.ToBoolean(reader.Value, CultureInfo.InvariantCulture)); break; case JsonToken.Null: WriteNull(); break; case JsonToken.Undefined: WriteUndefined(); break; case JsonToken.EndObject: WriteEndObject(); break; case JsonToken.EndArray: WriteEndArray(); break; case JsonToken.EndConstructor: WriteEndConstructor(); break; case JsonToken.Date: WriteValue((DateTime)reader.Value); break; case JsonToken.Raw: WriteRawValue((string)reader.Value); break; case JsonToken.Bytes: WriteValue((byte[])reader.Value); break; default: throw MiscellaneousUtils.CreateArgumentOutOfRangeException("TokenType", reader.TokenType, "Unexpected token type."); } } while ( // stop if we have reached the end of the token being read initialDepth - 1 < reader.Depth - (IsEndToken(reader.TokenType) ? 1 : 0) && reader.Read()); } private void WriteConstructorDate(JsonReader reader) { if (!reader.Read()) throw JsonWriterException.Create(this, "Unexpected end when reading date constructor.", null); if (reader.TokenType != JsonToken.Integer) throw JsonWriterException.Create(this, "Unexpected token when reading date constructor. Expected Integer, got " + reader.TokenType, null); long ticks = (long)reader.Value; DateTime date = JsonConvert.ConvertJavaScriptTicksToDateTime(ticks); if (!reader.Read()) throw JsonWriterException.Create(this, "Unexpected end when reading date constructor.", null); if (reader.TokenType != JsonToken.EndConstructor) throw JsonWriterException.Create(this, "Unexpected token when reading date constructor. Expected EndConstructor, got " + reader.TokenType, null); WriteValue(date); } private bool IsEndToken(JsonToken token) { switch (token) { case JsonToken.EndObject: case JsonToken.EndArray: case JsonToken.EndConstructor: return true; default: return false; } } private bool IsStartToken(JsonToken token) { switch (token) { case JsonToken.StartObject: case JsonToken.StartArray: case JsonToken.StartConstructor: return true; default: return false; } } private void WriteEnd(JsonContainerType type) { switch (type) { case JsonContainerType.Object: WriteEndObject(); break; case JsonContainerType.Array: WriteEndArray(); break; case JsonContainerType.Constructor: WriteEndConstructor(); break; default: throw JsonWriterException.Create(this, "Unexpected type when writing end: " + type, null); } } private void AutoCompleteAll() { while (Top > 0) { WriteEnd(); } } private JsonContainerType GetTypeForCloseToken(JsonToken token) { switch (token) { case JsonToken.EndObject: return JsonContainerType.Object; case JsonToken.EndArray: return JsonContainerType.Array; case JsonToken.EndConstructor: return JsonContainerType.Constructor; default: throw JsonWriterException.Create(this, "No type for token: " + token, null); } } private JsonToken GetCloseTokenForType(JsonContainerType type) { switch (type) { case JsonContainerType.Object: return JsonToken.EndObject; case JsonContainerType.Array: return JsonToken.EndArray; case JsonContainerType.Constructor: return JsonToken.EndConstructor; default: throw JsonWriterException.Create(this, "No close token for type: " + type, null); } } private void AutoCompleteClose(JsonToken tokenBeingClosed) { // write closing symbol and calculate new state int levelsToComplete = 0; JsonContainerType type = GetTypeForCloseToken(tokenBeingClosed); if (_currentPosition.Type == type) { levelsToComplete = 1; } else { int top = Top - 2; for (int i = top; i >= 0; i--) { int currentLevel = top - i; if (_stack[currentLevel].Type == type) { levelsToComplete = i + 2; break; } } } if (levelsToComplete == 0) throw JsonWriterException.Create(this, "No token to close.", null); for (int i = 0; i < levelsToComplete; i++) { JsonToken token = GetCloseTokenForType(Pop()); if (_currentState == State.Property) WriteNull(); if (_formatting == Formatting.Indented) { if (_currentState != State.ObjectStart && _currentState != State.ArrayStart) WriteIndent(); } WriteEnd(token); JsonContainerType currentLevelType = Peek(); switch (currentLevelType) { case JsonContainerType.Object: _currentState = State.Object; break; case JsonContainerType.Array: _currentState = State.Array; break; case JsonContainerType.Constructor: _currentState = State.Array; break; case JsonContainerType.None: _currentState = State.Start; break; default: throw JsonWriterException.Create(this, "Unknown JsonType: " + currentLevelType, null); } } } /// /// Writes the specified end token. /// /// The end token to write. protected virtual void WriteEnd(JsonToken token) { } /// /// Writes indent characters. /// protected virtual void WriteIndent() { } /// /// Writes the JSON value delimiter. /// protected virtual void WriteValueDelimiter() { } /// /// Writes an indent space. /// protected virtual void WriteIndentSpace() { } internal void AutoComplete(JsonToken tokenBeingWritten) { if (tokenBeingWritten != JsonToken.StartObject && tokenBeingWritten != JsonToken.StartArray && tokenBeingWritten != JsonToken.StartConstructor) UpdateScopeWithFinishedValue(); // gets new state based on the current state and what is being written State newState = StateArray[(int)tokenBeingWritten][(int)_currentState]; if (newState == State.Error) throw JsonWriterException.Create(this, "Token {0} in state {1} would result in an invalid JSON object.".FormatWith(CultureInfo.InvariantCulture, tokenBeingWritten.ToString(), _currentState.ToString()), null); if ((_currentState == State.Object || _currentState == State.Array || _currentState == State.Constructor) && tokenBeingWritten != JsonToken.Comment) { WriteValueDelimiter(); } else if (_currentState == State.Property) { if (_formatting == Formatting.Indented) WriteIndentSpace(); } if (_formatting == Formatting.Indented) { WriteState writeState = WriteState; // don't indent a property when it is the first token to be written (i.e. at the start) if ((tokenBeingWritten == JsonToken.PropertyName && writeState != WriteState.Start) || writeState == WriteState.Array || writeState == WriteState.Constructor) { WriteIndent(); } } _currentState = newState; } #region WriteValue methods /// /// Writes a null value. /// public virtual void WriteNull() { AutoComplete(JsonToken.Null); } /// /// Writes an undefined value. /// public virtual void WriteUndefined() { AutoComplete(JsonToken.Undefined); } /// /// Writes raw JSON without changing the writer's state. /// /// The raw JSON to write. public virtual void WriteRaw(string json) { } /// /// Writes raw JSON where a value is expected and updates the writer's state. /// /// The raw JSON to write. public virtual void WriteRawValue(string json) { // hack. want writer to change state as if a value had been written AutoComplete(JsonToken.Undefined); WriteRaw(json); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(string value) { AutoComplete(JsonToken.String); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(int value) { AutoComplete(JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public virtual void WriteValue(uint value) { AutoComplete(JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(long value) { AutoComplete(JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public virtual void WriteValue(ulong value) { AutoComplete(JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(float value) { AutoComplete(JsonToken.Float); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(double value) { AutoComplete(JsonToken.Float); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(bool value) { AutoComplete(JsonToken.Boolean); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(short value) { AutoComplete(JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public virtual void WriteValue(ushort value) { AutoComplete(JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(char value) { AutoComplete(JsonToken.String); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(byte value) { AutoComplete(JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public virtual void WriteValue(sbyte value) { AutoComplete(JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(decimal value) { AutoComplete(JsonToken.Float); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(DateTime value) { AutoComplete(JsonToken.Date); } #if !PocketPC && !NET20 /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(DateTimeOffset value) { AutoComplete(JsonToken.Date); } #endif /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(Guid value) { AutoComplete(JsonToken.String); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(TimeSpan value) { AutoComplete(JsonToken.String); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(int? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public virtual void WriteValue(uint? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(long? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public virtual void WriteValue(ulong? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(float? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(double? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(bool? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(short? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public virtual void WriteValue(ushort? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(char? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(byte? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public virtual void WriteValue(sbyte? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(decimal? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(DateTime? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } #if !PocketPC && !NET20 /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(DateTimeOffset? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } #endif /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(Guid? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(TimeSpan? value) { if (value == null) WriteNull(); else WriteValue(value.Value); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(byte[] value) { if (value == null) WriteNull(); else AutoComplete(JsonToken.Bytes); } /// /// Writes a value. /// /// The value to write. public virtual void WriteValue(Uri value) { if (value == null) WriteNull(); else AutoComplete(JsonToken.String); } /// /// Writes a value. /// An error will raised if the value cannot be written as a single JSON token. /// /// The value to write. public virtual void WriteValue(object value) { if (value == null) { WriteNull(); return; } else if (ConvertUtils.IsConvertible(value)) { IConvertible convertible = ConvertUtils.ToConvertible(value); switch (convertible.GetTypeCode()) { case TypeCode.String: WriteValue(convertible.ToString(CultureInfo.InvariantCulture)); return; case TypeCode.Char: WriteValue(convertible.ToChar(CultureInfo.InvariantCulture)); return; case TypeCode.Boolean: WriteValue(convertible.ToBoolean(CultureInfo.InvariantCulture)); return; case TypeCode.SByte: WriteValue(convertible.ToSByte(CultureInfo.InvariantCulture)); return; case TypeCode.Int16: WriteValue(convertible.ToInt16(CultureInfo.InvariantCulture)); return; case TypeCode.UInt16: WriteValue(convertible.ToUInt16(CultureInfo.InvariantCulture)); return; case TypeCode.Int32: WriteValue(convertible.ToInt32(CultureInfo.InvariantCulture)); return; case TypeCode.Byte: WriteValue(convertible.ToByte(CultureInfo.InvariantCulture)); return; case TypeCode.UInt32: WriteValue(convertible.ToUInt32(CultureInfo.InvariantCulture)); return; case TypeCode.Int64: WriteValue(convertible.ToInt64(CultureInfo.InvariantCulture)); return; case TypeCode.UInt64: WriteValue(convertible.ToUInt64(CultureInfo.InvariantCulture)); return; case TypeCode.Single: WriteValue(convertible.ToSingle(CultureInfo.InvariantCulture)); return; case TypeCode.Double: WriteValue(convertible.ToDouble(CultureInfo.InvariantCulture)); return; case TypeCode.DateTime: WriteValue(convertible.ToDateTime(CultureInfo.InvariantCulture)); return; case TypeCode.Decimal: WriteValue(convertible.ToDecimal(CultureInfo.InvariantCulture)); return; #if !(NETFX_CORE || PORTABLE) case TypeCode.DBNull: WriteNull(); return; #endif } } #if !PocketPC && !NET20 else if (value is DateTimeOffset) { WriteValue((DateTimeOffset)value); return; } #endif else if (value is byte[]) { WriteValue((byte[])value); return; } else if (value is Guid) { WriteValue((Guid)value); return; } else if (value is Uri) { WriteValue((Uri)value); return; } else if (value is TimeSpan) { WriteValue((TimeSpan)value); return; } throw JsonWriterException.Create(this, "Unsupported type: {0}. Use the JsonSerializer class to get the object's JSON representation.".FormatWith(CultureInfo.InvariantCulture, value.GetType()), null); } #endregion /// /// Writes out a comment /*...*/ containing the specified text. /// /// Text to place inside the comment. public virtual void WriteComment(string text) { AutoComplete(JsonToken.Comment); } /// /// Writes out the given white space. /// /// The string of white space characters. public virtual void WriteWhitespace(string ws) { if (ws != null) { if (!StringUtils.IsWhiteSpace(ws)) throw JsonWriterException.Create(this, "Only white space characters should be used.", null); } } void IDisposable.Dispose() { Dispose(true); } private void Dispose(bool disposing) { if (_currentState != State.Closed) Close(); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonTextWriter.cs0000644000175000017500000003576412253423361026351 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Globalization; using System.Text; using System.IO; using System.Xml; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json { /// /// Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. /// public class JsonTextWriter : JsonWriter { private readonly TextWriter _writer; private Base64Encoder _base64Encoder; private char _indentChar; private int _indentation; private char _quoteChar; private bool _quoteName; private Base64Encoder Base64Encoder { get { if (_base64Encoder == null) _base64Encoder = new Base64Encoder(_writer); return _base64Encoder; } } /// /// Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. /// public int Indentation { get { return _indentation; } set { if (value < 0) throw new ArgumentException("Indentation value must be greater than 0."); _indentation = value; } } /// /// Gets or sets which character to use to quote attribute values. /// public char QuoteChar { get { return _quoteChar; } set { if (value != '"' && value != '\'') throw new ArgumentException(@"Invalid JavaScript string quote character. Valid quote characters are ' and ""."); _quoteChar = value; } } /// /// Gets or sets which character to use for indenting when is set to Formatting.Indented. /// public char IndentChar { get { return _indentChar; } set { _indentChar = value; } } /// /// Gets or sets a value indicating whether object names will be surrounded with quotes. /// public bool QuoteName { get { return _quoteName; } set { _quoteName = value; } } /// /// Creates an instance of the JsonWriter class using the specified . /// /// The TextWriter to write to. public JsonTextWriter(TextWriter textWriter) { if (textWriter == null) throw new ArgumentNullException("textWriter"); _writer = textWriter; _quoteChar = '"'; _quoteName = true; _indentChar = ' '; _indentation = 2; } /// /// Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. /// public override void Flush() { _writer.Flush(); } /// /// Closes this stream and the underlying stream. /// public override void Close() { base.Close(); if (CloseOutput && _writer != null) #if !(NETFX_CORE || PORTABLE) _writer.Close(); #else _writer.Dispose(); #endif } /// /// Writes the beginning of a Json object. /// public override void WriteStartObject() { base.WriteStartObject(); _writer.Write("{"); } /// /// Writes the beginning of a Json array. /// public override void WriteStartArray() { base.WriteStartArray(); _writer.Write("["); } /// /// Writes the start of a constructor with the given name. /// /// The name of the constructor. public override void WriteStartConstructor(string name) { base.WriteStartConstructor(name); _writer.Write("new "); _writer.Write(name); _writer.Write("("); } /// /// Writes the specified end token. /// /// The end token to write. protected override void WriteEnd(JsonToken token) { switch (token) { case JsonToken.EndObject: _writer.Write("}"); break; case JsonToken.EndArray: _writer.Write("]"); break; case JsonToken.EndConstructor: _writer.Write(")"); break; default: throw JsonWriterException.Create(this, "Invalid JsonToken: " + token, null); } } /// /// Writes the property name of a name/value pair on a Json object. /// /// The name of the property. public override void WritePropertyName(string name) { base.WritePropertyName(name); JavaScriptUtils.WriteEscapedJavaScriptString(_writer, name, _quoteChar, _quoteName); _writer.Write(':'); } /// /// Writes indent characters. /// protected override void WriteIndent() { _writer.Write(Environment.NewLine); // levels of indentation multiplied by the indent count int currentIndentCount = Top*_indentation; while (currentIndentCount > 0) { // write up to a max of 10 characters at once to avoid creating too many new strings int writeCount = Math.Min(currentIndentCount, 10); _writer.Write(new string(_indentChar, writeCount)); currentIndentCount -= writeCount; } } /// /// Writes the JSON value delimiter. /// protected override void WriteValueDelimiter() { _writer.Write(','); } /// /// Writes an indent space. /// protected override void WriteIndentSpace() { _writer.Write(' '); } private void WriteValueInternal(string value, JsonToken token) { _writer.Write(value); } #region WriteValue methods /// /// Writes a null value. /// public override void WriteNull() { base.WriteNull(); WriteValueInternal(JsonConvert.Null, JsonToken.Null); } /// /// Writes an undefined value. /// public override void WriteUndefined() { base.WriteUndefined(); WriteValueInternal(JsonConvert.Undefined, JsonToken.Undefined); } /// /// Writes raw JSON. /// /// The raw JSON to write. public override void WriteRaw(string json) { base.WriteRaw(json); _writer.Write(json); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(string value) { base.WriteValue(value); if (value == null) WriteValueInternal(JsonConvert.Null, JsonToken.Null); else JavaScriptUtils.WriteEscapedJavaScriptString(_writer, value, _quoteChar, true); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(int value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public override void WriteValue(uint value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(long value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public override void WriteValue(ulong value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(float value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Float); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(double value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Float); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(bool value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Boolean); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(short value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public override void WriteValue(ushort value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(char value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(byte value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public override void WriteValue(sbyte value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(decimal value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.Float); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(DateTime value) { base.WriteValue(value); value = JsonConvert.EnsureDateTime(value, DateTimeZoneHandling); JsonConvert.WriteDateTimeString(_writer, value, DateFormatHandling); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(byte[] value) { base.WriteValue(value); if (value != null) { _writer.Write(_quoteChar); Base64Encoder.Encode(value, 0, value.Length); Base64Encoder.Flush(); _writer.Write(_quoteChar); } } #if !PocketPC && !NET20 /// /// Writes a value. /// /// The value to write. public override void WriteValue(DateTimeOffset value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value, DateFormatHandling), JsonToken.Date); } #endif /// /// Writes a value. /// /// The value to write. public override void WriteValue(Guid value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.String); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(TimeSpan value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.String); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(Uri value) { base.WriteValue(value); WriteValueInternal(JsonConvert.ToString(value), JsonToken.String); } #endregion /// /// Writes out a comment /*...*/ containing the specified text. /// /// Text to place inside the comment. public override void WriteComment(string text) { base.WriteComment(text); _writer.Write("/*"); _writer.Write(text); _writer.Write("*/"); } /// /// Writes out the given white space. /// /// The string of white space characters. public override void WriteWhitespace(string ws) { base.WriteWhitespace(ws); _writer.Write(ws); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/ReferenceLoopHandling.cs0000644000175000017500000000332512253423361027557 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Text; namespace Newtonsoft.Json { /// /// Specifies reference loop handling options for the . /// public enum ReferenceLoopHandling { /// /// Throw a when a loop is encountered. /// Error = 0, /// /// Ignore loop references and do not serialize. /// Ignore = 1, /// /// Serialize loop references. /// Serialize = 2 } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/0000755000175000017500000000000012253423361023731 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonWriter.cs0000644000175000017500000003445112253423361026365 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Text; using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Linq; using System.Globalization; namespace Newtonsoft.Json.Bson { /// /// Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. /// public class BsonWriter : JsonWriter { private readonly BsonBinaryWriter _writer; private BsonToken _root; private BsonToken _parent; private string _propertyName; /// /// Gets or sets the used when writing values to BSON. /// When set to no conversion will occur. /// /// The used when writing values to BSON. public DateTimeKind DateTimeKindHandling { get { return _writer.DateTimeKindHandling; } set { _writer.DateTimeKindHandling = value; } } /// /// Initializes a new instance of the class. /// /// The stream. public BsonWriter(Stream stream) { ValidationUtils.ArgumentNotNull(stream, "stream"); _writer = new BsonBinaryWriter(new BinaryWriter(stream)); } /// /// Initializes a new instance of the class. /// /// The writer. public BsonWriter(BinaryWriter writer) { ValidationUtils.ArgumentNotNull(writer, "writer"); _writer = new BsonBinaryWriter(writer); } /// /// Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. /// public override void Flush() { _writer.Flush(); } /// /// Writes the end. /// /// The token. protected override void WriteEnd(JsonToken token) { base.WriteEnd(token); RemoveParent(); if (Top == 0) { _writer.WriteToken(_root); } } /// /// Writes out a comment /*...*/ containing the specified text. /// /// Text to place inside the comment. public override void WriteComment(string text) { throw JsonWriterException.Create(this, "Cannot write JSON comment as BSON.", null); } /// /// Writes the start of a constructor with the given name. /// /// The name of the constructor. public override void WriteStartConstructor(string name) { throw JsonWriterException.Create(this, "Cannot write JSON constructor as BSON.", null); } /// /// Writes raw JSON. /// /// The raw JSON to write. public override void WriteRaw(string json) { throw JsonWriterException.Create(this, "Cannot write raw JSON as BSON.", null); } /// /// Writes raw JSON where a value is expected and updates the writer's state. /// /// The raw JSON to write. public override void WriteRawValue(string json) { throw JsonWriterException.Create(this, "Cannot write raw JSON as BSON.", null); } /// /// Writes the beginning of a Json array. /// public override void WriteStartArray() { base.WriteStartArray(); AddParent(new BsonArray()); } /// /// Writes the beginning of a Json object. /// public override void WriteStartObject() { base.WriteStartObject(); AddParent(new BsonObject()); } /// /// Writes the property name of a name/value pair on a Json object. /// /// The name of the property. public override void WritePropertyName(string name) { base.WritePropertyName(name); _propertyName = name; } /// /// Closes this stream and the underlying stream. /// public override void Close() { base.Close(); if (CloseOutput && _writer != null) _writer.Close(); } private void AddParent(BsonToken container) { AddToken(container); _parent = container; } private void RemoveParent() { _parent = _parent.Parent; } private void AddValue(object value, BsonType type) { AddToken(new BsonValue(value, type)); } internal void AddToken(BsonToken token) { if (_parent != null) { if (_parent is BsonObject) { ((BsonObject) _parent).Add(_propertyName, token); _propertyName = null; } else { ((BsonArray) _parent).Add(token); } } else { if (token.Type != BsonType.Object && token.Type != BsonType.Array) throw JsonWriterException.Create(this, "Error writing {0} value. BSON must start with an Object or Array.".FormatWith(CultureInfo.InvariantCulture, token.Type), null); _parent = token; _root = token; } } #region WriteValue methods /// /// Writes a null value. /// public override void WriteNull() { base.WriteNull(); AddValue(null, BsonType.Null); } /// /// Writes an undefined value. /// public override void WriteUndefined() { base.WriteUndefined(); AddValue(null, BsonType.Undefined); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(string value) { base.WriteValue(value); if (value == null) AddValue(null, BsonType.Null); else AddToken(new BsonString(value, true)); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(int value) { base.WriteValue(value); AddValue(value, BsonType.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public override void WriteValue(uint value) { if (value > int.MaxValue) throw JsonWriterException.Create(this, "Value is too large to fit in a signed 32 bit integer. BSON does not support unsigned values.", null); base.WriteValue(value); AddValue(value, BsonType.Integer); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(long value) { base.WriteValue(value); AddValue(value, BsonType.Long); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public override void WriteValue(ulong value) { if (value > long.MaxValue) throw JsonWriterException.Create(this, "Value is too large to fit in a signed 64 bit integer. BSON does not support unsigned values.", null); base.WriteValue(value); AddValue(value, BsonType.Long); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(float value) { base.WriteValue(value); AddValue(value, BsonType.Number); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(double value) { base.WriteValue(value); AddValue(value, BsonType.Number); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(bool value) { base.WriteValue(value); AddValue(value, BsonType.Boolean); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(short value) { base.WriteValue(value); AddValue(value, BsonType.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public override void WriteValue(ushort value) { base.WriteValue(value); AddValue(value, BsonType.Integer); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(char value) { base.WriteValue(value); string s = null; #if !(NETFX_CORE || PORTABLE) s = value.ToString(CultureInfo.InvariantCulture); #else s = value.ToString(); #endif AddToken(new BsonString(s, true)); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(byte value) { base.WriteValue(value); AddValue(value, BsonType.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public override void WriteValue(sbyte value) { base.WriteValue(value); AddValue(value, BsonType.Integer); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(decimal value) { base.WriteValue(value); AddValue(value, BsonType.Number); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(DateTime value) { base.WriteValue(value); value = JsonConvert.EnsureDateTime(value, DateTimeZoneHandling); AddValue(value, BsonType.Date); } #if !PocketPC && !NET20 /// /// Writes a value. /// /// The value to write. public override void WriteValue(DateTimeOffset value) { base.WriteValue(value); AddValue(value, BsonType.Date); } #endif /// /// Writes a value. /// /// The value to write. public override void WriteValue(byte[] value) { base.WriteValue(value); AddValue(value, BsonType.Binary); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(Guid value) { base.WriteValue(value); AddToken(new BsonString(value.ToString(), true)); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(TimeSpan value) { base.WriteValue(value); AddToken(new BsonString(value.ToString(), true)); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(Uri value) { base.WriteValue(value); AddToken(new BsonString(value.ToString(), true)); } #endregion /// /// Writes a value that represents a BSON object id. /// /// The Object ID value to write. public void WriteObjectId(byte[] value) { ValidationUtils.ArgumentNotNull(value, "value"); if (value.Length != 12) throw JsonWriterException.Create(this, "An object id must be 12 bytes", null); // hack to update the writer state AutoComplete(JsonToken.Undefined); AddValue(value, BsonType.Oid); } /// /// Writes a BSON regex. /// /// The regex pattern. /// The regex options. public void WriteRegex(string pattern, string options) { ValidationUtils.ArgumentNotNull(pattern, "pattern"); // hack to update the writer state AutoComplete(JsonToken.Undefined); AddToken(new BsonRegex(pattern, options)); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonObjectId.cs0000644000175000017500000000357612253423361026600 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Bson { /// /// Represents a BSON Oid (object id). /// public class BsonObjectId { /// /// Gets or sets the value of the Oid. /// /// The value of the Oid. public byte[] Value { get; private set; } /// /// Initializes a new instance of the class. /// /// The Oid value. public BsonObjectId(byte[] value) { ValidationUtils.ArgumentNotNull(value, "value"); if (value.Length != 12) throw new ArgumentException("An ObjectId must be 12 bytes", "value"); Value = value; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonReader.cs0000644000175000017500000006225212253423361026313 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Globalization; using System.Text; using System.IO; using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Linq; namespace Newtonsoft.Json.Bson { /// /// Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. /// public class BsonReader : JsonReader { private const int MaxCharBytesSize = 128; private static readonly byte[] SeqRange1 = new byte[] {0, 127}; // range of 1-byte sequence private static readonly byte[] SeqRange2 = new byte[] {194, 223}; // range of 2-byte sequence private static readonly byte[] SeqRange3 = new byte[] {224, 239}; // range of 3-byte sequence private static readonly byte[] SeqRange4 = new byte[] {240, 244}; // range of 4-byte sequence private readonly BinaryReader _reader; private readonly List _stack; private byte[] _byteBuffer; private char[] _charBuffer; private BsonType _currentElementType; private BsonReaderState _bsonReaderState; private ContainerContext _currentContext; private bool _readRootValueAsArray; private bool _jsonNet35BinaryCompatibility; private DateTimeKind _dateTimeKindHandling; private enum BsonReaderState { Normal, ReferenceStart, ReferenceRef, ReferenceId, CodeWScopeStart, CodeWScopeCode, CodeWScopeScope, CodeWScopeScopeObject, CodeWScopeScopeEnd } private class ContainerContext { public readonly BsonType Type; public int Length; public int Position; public ContainerContext(BsonType type) { Type = type; } } /// /// Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. /// /// /// true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. /// public bool JsonNet35BinaryCompatibility { get { return _jsonNet35BinaryCompatibility; } set { _jsonNet35BinaryCompatibility = value; } } /// /// Gets or sets a value indicating whether the root object will be read as a JSON array. /// /// /// true if the root object will be read as a JSON array; otherwise, false. /// public bool ReadRootValueAsArray { get { return _readRootValueAsArray; } set { _readRootValueAsArray = value; } } /// /// Gets or sets the used when reading values from BSON. /// /// The used when reading values from BSON. public DateTimeKind DateTimeKindHandling { get { return _dateTimeKindHandling; } set { _dateTimeKindHandling = value; } } /// /// Initializes a new instance of the class. /// /// The stream. public BsonReader(Stream stream) : this(stream, false, DateTimeKind.Local) { } /// /// Initializes a new instance of the class. /// /// The reader. public BsonReader(BinaryReader reader) : this(reader, false, DateTimeKind.Local) { } /// /// Initializes a new instance of the class. /// /// The stream. /// if set to true the root object will be read as a JSON array. /// The used when reading values from BSON. public BsonReader(Stream stream, bool readRootValueAsArray, DateTimeKind dateTimeKindHandling) { ValidationUtils.ArgumentNotNull(stream, "stream"); _reader = new BinaryReader(stream); _stack = new List(); _readRootValueAsArray = readRootValueAsArray; _dateTimeKindHandling = dateTimeKindHandling; } /// /// Initializes a new instance of the class. /// /// The reader. /// if set to true the root object will be read as a JSON array. /// The used when reading values from BSON. public BsonReader(BinaryReader reader, bool readRootValueAsArray, DateTimeKind dateTimeKindHandling) { ValidationUtils.ArgumentNotNull(reader, "reader"); _reader = reader; _stack = new List(); _readRootValueAsArray = readRootValueAsArray; _dateTimeKindHandling = dateTimeKindHandling; } private string ReadElement() { _currentElementType = ReadType(); string elementName = ReadString(); return elementName; } /// /// Reads the next JSON token from the stream as a . /// /// /// A or a null reference if the next JSON token is null. This method will return null at the end of an array. /// public override byte[] ReadAsBytes() { return ReadAsBytesInternal(); } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override decimal? ReadAsDecimal() { return ReadAsDecimalInternal(); } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override int? ReadAsInt32() { return ReadAsInt32Internal(); } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override string ReadAsString() { return ReadAsStringInternal(); } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override DateTime? ReadAsDateTime() { return ReadAsDateTimeInternal(); } #if !NET20 /// /// Reads the next JSON token from the stream as a . /// /// /// A . This method will return null at the end of an array. /// public override DateTimeOffset? ReadAsDateTimeOffset() { return ReadAsDateTimeOffsetInternal(); } #endif /// /// Reads the next JSON token from the stream. /// /// /// true if the next token was read successfully; false if there are no more tokens to read. /// public override bool Read() { _readType = Json.ReadType.Read; return ReadInternal(); } internal override bool ReadInternal() { try { bool success; switch (_bsonReaderState) { case BsonReaderState.Normal: success = ReadNormal(); break; case BsonReaderState.ReferenceStart: case BsonReaderState.ReferenceRef: case BsonReaderState.ReferenceId: success = ReadReference(); break; case BsonReaderState.CodeWScopeStart: case BsonReaderState.CodeWScopeCode: case BsonReaderState.CodeWScopeScope: case BsonReaderState.CodeWScopeScopeObject: case BsonReaderState.CodeWScopeScopeEnd: success = ReadCodeWScope(); break; default: throw JsonReaderException.Create(this, "Unexpected state: {0}".FormatWith(CultureInfo.InvariantCulture, _bsonReaderState)); } if (!success) { SetToken(JsonToken.None); return false; } return true; } catch (EndOfStreamException) { SetToken(JsonToken.None); return false; } } /// /// Changes the to Closed. /// public override void Close() { base.Close(); if (CloseInput && _reader != null) #if !(NETFX_CORE || PORTABLE) _reader.Close(); #else _reader.Dispose(); #endif } private bool ReadCodeWScope() { switch (_bsonReaderState) { case BsonReaderState.CodeWScopeStart: SetToken(JsonToken.PropertyName, "$code"); _bsonReaderState = BsonReaderState.CodeWScopeCode; return true; case BsonReaderState.CodeWScopeCode: // total CodeWScope size - not used ReadInt32(); SetToken(JsonToken.String, ReadLengthString()); _bsonReaderState = BsonReaderState.CodeWScopeScope; return true; case BsonReaderState.CodeWScopeScope: if (CurrentState == State.PostValue) { SetToken(JsonToken.PropertyName, "$scope"); return true; } else { SetToken(JsonToken.StartObject); _bsonReaderState = BsonReaderState.CodeWScopeScopeObject; ContainerContext newContext = new ContainerContext(BsonType.Object); PushContext(newContext); newContext.Length = ReadInt32(); return true; } case BsonReaderState.CodeWScopeScopeObject: bool result = ReadNormal(); if (result && TokenType == JsonToken.EndObject) _bsonReaderState = BsonReaderState.CodeWScopeScopeEnd; return result; case BsonReaderState.CodeWScopeScopeEnd: SetToken(JsonToken.EndObject); _bsonReaderState = BsonReaderState.Normal; return true; default: throw new ArgumentOutOfRangeException(); } } private bool ReadReference() { switch (CurrentState) { case State.ObjectStart: { SetToken(JsonToken.PropertyName, "$ref"); _bsonReaderState = BsonReaderState.ReferenceRef; return true; } case State.Property: { if (_bsonReaderState == BsonReaderState.ReferenceRef) { SetToken(JsonToken.String, ReadLengthString()); return true; } else if (_bsonReaderState == BsonReaderState.ReferenceId) { SetToken(JsonToken.Bytes, ReadBytes(12)); return true; } else { throw JsonReaderException.Create(this, "Unexpected state when reading BSON reference: " + _bsonReaderState); } } case State.PostValue: { if (_bsonReaderState == BsonReaderState.ReferenceRef) { SetToken(JsonToken.PropertyName, "$id"); _bsonReaderState = BsonReaderState.ReferenceId; return true; } else if (_bsonReaderState == BsonReaderState.ReferenceId) { SetToken(JsonToken.EndObject); _bsonReaderState = BsonReaderState.Normal; return true; } else { throw JsonReaderException.Create(this, "Unexpected state when reading BSON reference: " + _bsonReaderState); } } default: throw JsonReaderException.Create(this, "Unexpected state when reading BSON reference: " + CurrentState); } } private bool ReadNormal() { switch (CurrentState) { case State.Start: { JsonToken token = (!_readRootValueAsArray) ? JsonToken.StartObject : JsonToken.StartArray; BsonType type = (!_readRootValueAsArray) ? BsonType.Object : BsonType.Array; SetToken(token); ContainerContext newContext = new ContainerContext(type); PushContext(newContext); newContext.Length = ReadInt32(); return true; } case State.Complete: case State.Closed: return false; case State.Property: { ReadType(_currentElementType); return true; } case State.ObjectStart: case State.ArrayStart: case State.PostValue: ContainerContext context = _currentContext; if (context == null) return false; int lengthMinusEnd = context.Length - 1; if (context.Position < lengthMinusEnd) { if (context.Type == BsonType.Array) { ReadElement(); ReadType(_currentElementType); return true; } else { SetToken(JsonToken.PropertyName, ReadElement()); return true; } } else if (context.Position == lengthMinusEnd) { if (ReadByte() != 0) throw JsonReaderException.Create(this, "Unexpected end of object byte value."); PopContext(); if (_currentContext != null) MovePosition(context.Length); JsonToken endToken = (context.Type == BsonType.Object) ? JsonToken.EndObject : JsonToken.EndArray; SetToken(endToken); return true; } else { throw JsonReaderException.Create(this, "Read past end of current container context."); } case State.ConstructorStart: break; case State.Constructor: break; case State.Error: break; case State.Finished: break; default: throw new ArgumentOutOfRangeException(); } return false; } private void PopContext() { _stack.RemoveAt(_stack.Count - 1); if (_stack.Count == 0) _currentContext = null; else _currentContext = _stack[_stack.Count - 1]; } private void PushContext(ContainerContext newContext) { _stack.Add(newContext); _currentContext = newContext; } private byte ReadByte() { MovePosition(1); return _reader.ReadByte(); } private void ReadType(BsonType type) { switch (type) { case BsonType.Number: SetToken(JsonToken.Float, ReadDouble()); break; case BsonType.String: case BsonType.Symbol: SetToken(JsonToken.String, ReadLengthString()); break; case BsonType.Object: { SetToken(JsonToken.StartObject); ContainerContext newContext = new ContainerContext(BsonType.Object); PushContext(newContext); newContext.Length = ReadInt32(); break; } case BsonType.Array: { SetToken(JsonToken.StartArray); ContainerContext newContext = new ContainerContext(BsonType.Array); PushContext(newContext); newContext.Length = ReadInt32(); break; } case BsonType.Binary: SetToken(JsonToken.Bytes, ReadBinary()); break; case BsonType.Undefined: SetToken(JsonToken.Undefined); break; case BsonType.Oid: byte[] oid = ReadBytes(12); SetToken(JsonToken.Bytes, oid); break; case BsonType.Boolean: bool b = Convert.ToBoolean(ReadByte()); SetToken(JsonToken.Boolean, b); break; case BsonType.Date: long ticks = ReadInt64(); DateTime utcDateTime = JsonConvert.ConvertJavaScriptTicksToDateTime(ticks); DateTime dateTime; switch (DateTimeKindHandling) { case DateTimeKind.Unspecified: dateTime = DateTime.SpecifyKind(utcDateTime, DateTimeKind.Unspecified); break; case DateTimeKind.Local: dateTime = utcDateTime.ToLocalTime(); break; default: dateTime = utcDateTime; break; } SetToken(JsonToken.Date, dateTime); break; case BsonType.Null: SetToken(JsonToken.Null); break; case BsonType.Regex: string expression = ReadString(); string modifiers = ReadString(); string regex = @"/" + expression + @"/" + modifiers; SetToken(JsonToken.String, regex); break; case BsonType.Reference: SetToken(JsonToken.StartObject); _bsonReaderState = BsonReaderState.ReferenceStart; break; case BsonType.Code: SetToken(JsonToken.String, ReadLengthString()); break; case BsonType.CodeWScope: SetToken(JsonToken.StartObject); _bsonReaderState = BsonReaderState.CodeWScopeStart; break; case BsonType.Integer: SetToken(JsonToken.Integer, (long) ReadInt32()); break; case BsonType.TimeStamp: case BsonType.Long: SetToken(JsonToken.Integer, ReadInt64()); break; default: throw new ArgumentOutOfRangeException("type", "Unexpected BsonType value: " + type); } } private byte[] ReadBinary() { int dataLength = ReadInt32(); BsonBinaryType binaryType = (BsonBinaryType) ReadByte(); #pragma warning disable 612,618 // the old binary type has the data length repeated in the data for some reason if (binaryType == BsonBinaryType.Data && !_jsonNet35BinaryCompatibility) { dataLength = ReadInt32(); } #pragma warning restore 612,618 return ReadBytes(dataLength); } private string ReadString() { EnsureBuffers(); StringBuilder builder = null; int totalBytesRead = 0; // used in case of left over multibyte characters in the buffer int offset = 0; do { int count = offset; byte b; while (count < MaxCharBytesSize && (b = _reader.ReadByte()) > 0) { _byteBuffer[count++] = b; } int byteCount = count - offset; totalBytesRead += byteCount; if (count < MaxCharBytesSize && builder == null) { // pref optimization to avoid reading into a string builder // if string is smaller than the buffer then return it directly int length = Encoding.UTF8.GetChars(_byteBuffer, 0, byteCount, _charBuffer, 0); MovePosition(totalBytesRead + 1); return new string(_charBuffer, 0, length); } else { // calculate the index of the end of the last full character in the buffer int lastFullCharStop = GetLastFullCharStop(count - 1); int charCount = Encoding.UTF8.GetChars(_byteBuffer, 0, lastFullCharStop + 1, _charBuffer, 0); if (builder == null) builder = new StringBuilder(MaxCharBytesSize*2); builder.Append(_charBuffer, 0, charCount); if (lastFullCharStop < byteCount - 1) { offset = byteCount - lastFullCharStop - 1; // copy left over multi byte characters to beginning of buffer for next iteration Array.Copy(_byteBuffer, lastFullCharStop + 1, _byteBuffer, 0, offset); } else { // reached end of string if (count < MaxCharBytesSize) { MovePosition(totalBytesRead + 1); return builder.ToString(); } offset = 0; } } } while (true); } private string ReadLengthString() { int length = ReadInt32(); MovePosition(length); string s = GetString(length - 1); _reader.ReadByte(); return s; } private string GetString(int length) { if (length == 0) return string.Empty; EnsureBuffers(); StringBuilder builder = null; int totalBytesRead = 0; // used in case of left over multibyte characters in the buffer int offset = 0; do { int count = ((length - totalBytesRead) > MaxCharBytesSize - offset) ? MaxCharBytesSize - offset : length - totalBytesRead; int byteCount = _reader.Read(_byteBuffer, offset, count); if (byteCount == 0) throw new EndOfStreamException("Unable to read beyond the end of the stream."); totalBytesRead += byteCount; // Above, byteCount is how many bytes we read this time. // Below, byteCount is how many bytes are in the _byteBuffer. byteCount += offset; if (byteCount == length) { // pref optimization to avoid reading into a string builder // first iteration and all bytes read then return string directly int charCount = Encoding.UTF8.GetChars(_byteBuffer, 0, byteCount, _charBuffer, 0); return new string(_charBuffer, 0, charCount); } else { int lastFullCharStop = GetLastFullCharStop(byteCount - 1); if (builder == null) builder = new StringBuilder(length); int charCount = Encoding.UTF8.GetChars(_byteBuffer, 0, lastFullCharStop + 1, _charBuffer, 0); builder.Append(_charBuffer, 0, charCount); if (lastFullCharStop < byteCount - 1) { offset = byteCount - lastFullCharStop - 1; // copy left over multi byte characters to beginning of buffer for next iteration Array.Copy(_byteBuffer, lastFullCharStop + 1, _byteBuffer, 0, offset); } else { offset = 0; } } } while (totalBytesRead < length); return builder.ToString(); } private int GetLastFullCharStop(int start) { int lookbackPos = start; int bis = 0; while (lookbackPos >= 0) { bis = BytesInSequence(_byteBuffer[lookbackPos]); if (bis == 0) { lookbackPos--; continue; } else if (bis == 1) { break; } else { lookbackPos--; break; } } if (bis == start - lookbackPos) { //Full character. return start; } else { return lookbackPos; } } private int BytesInSequence(byte b) { if (b <= SeqRange1[1]) return 1; if (b >= SeqRange2[0] && b <= SeqRange2[1]) return 2; if (b >= SeqRange3[0] && b <= SeqRange3[1]) return 3; if (b >= SeqRange4[0] && b <= SeqRange4[1]) return 4; return 0; } private void EnsureBuffers() { if (_byteBuffer == null) { _byteBuffer = new byte[MaxCharBytesSize]; } if (_charBuffer == null) { int charBufferSize = Encoding.UTF8.GetMaxCharCount(MaxCharBytesSize); _charBuffer = new char[charBufferSize]; } } private double ReadDouble() { MovePosition(8); return _reader.ReadDouble(); } private int ReadInt32() { MovePosition(4); return _reader.ReadInt32(); } private long ReadInt64() { MovePosition(8); return _reader.ReadInt64(); } private BsonType ReadType() { MovePosition(1); return (BsonType) _reader.ReadSByte(); } private void MovePosition(int count) { _currentContext.Position += count; } private byte[] ReadBytes(int count) { MovePosition(count); return _reader.ReadBytes(count); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonType.cs0000644000175000017500000000303412253423361026023 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json.Bson { internal enum BsonType : sbyte { Number = 1, String = 2, Object = 3, Array = 4, Binary = 5, Undefined = 6, Oid = 7, Boolean = 8, Date = 9, Null = 10, Regex = 11, Reference = 12, Code = 13, Symbol = 14, CodeWScope = 15, Integer = 16, TimeStamp = 17, Long = 18, MinKey = -1, MaxKey = 127 } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonBinaryWriter.cs0000644000175000017500000002243312253423361027527 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.IO; using System.Text; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Bson { internal class BsonBinaryWriter { private static readonly Encoding Encoding = new UTF8Encoding(false); private readonly BinaryWriter _writer; private byte[] _largeByteBuffer; public DateTimeKind DateTimeKindHandling { get; set; } public BsonBinaryWriter(BinaryWriter writer) { DateTimeKindHandling = DateTimeKind.Utc; _writer = writer; } public void Flush() { _writer.Flush(); } public void Close() { #if !(NETFX_CORE || PORTABLE) _writer.Close(); #else _writer.Dispose(); #endif } public void WriteToken(BsonToken t) { CalculateSize(t); WriteTokenInternal(t); } private void WriteTokenInternal(BsonToken t) { switch (t.Type) { case BsonType.Object: { BsonObject value = (BsonObject)t; _writer.Write(value.CalculatedSize); foreach (BsonProperty property in value) { _writer.Write((sbyte)property.Value.Type); WriteString((string)property.Name.Value, property.Name.ByteCount, null); WriteTokenInternal(property.Value); } _writer.Write((byte)0); } break; case BsonType.Array: { BsonArray value = (BsonArray)t; _writer.Write(value.CalculatedSize); int index = 0; foreach (BsonToken c in value) { _writer.Write((sbyte)c.Type); WriteString(index.ToString(CultureInfo.InvariantCulture), MathUtils.IntLength(index), null); WriteTokenInternal(c); index++; } _writer.Write((byte)0); } break; case BsonType.Integer: { BsonValue value = (BsonValue)t; _writer.Write(Convert.ToInt32(value.Value, CultureInfo.InvariantCulture)); } break; case BsonType.Long: { BsonValue value = (BsonValue)t; _writer.Write(Convert.ToInt64(value.Value, CultureInfo.InvariantCulture)); } break; case BsonType.Number: { BsonValue value = (BsonValue)t; _writer.Write(Convert.ToDouble(value.Value, CultureInfo.InvariantCulture)); } break; case BsonType.String: { BsonString value = (BsonString)t; WriteString((string)value.Value, value.ByteCount, value.CalculatedSize - 4); } break; case BsonType.Boolean: { BsonValue value = (BsonValue)t; _writer.Write((bool)value.Value); } break; case BsonType.Null: case BsonType.Undefined: break; case BsonType.Date: { BsonValue value = (BsonValue)t; long ticks = 0; if (value.Value is DateTime) { DateTime dateTime = (DateTime)value.Value; if (DateTimeKindHandling == DateTimeKind.Utc) dateTime = dateTime.ToUniversalTime(); else if (DateTimeKindHandling == DateTimeKind.Local) dateTime = dateTime.ToLocalTime(); ticks = JsonConvert.ConvertDateTimeToJavaScriptTicks(dateTime, false); } #if !PocketPC && !NET20 else { DateTimeOffset dateTimeOffset = (DateTimeOffset)value.Value; ticks = JsonConvert.ConvertDateTimeToJavaScriptTicks(dateTimeOffset.UtcDateTime, dateTimeOffset.Offset); } #endif _writer.Write(ticks); } break; case BsonType.Binary: { BsonValue value = (BsonValue)t; byte[] data = (byte[])value.Value; _writer.Write(data.Length); _writer.Write((byte)BsonBinaryType.Binary); _writer.Write(data); } break; case BsonType.Oid: { BsonValue value = (BsonValue)t; byte[] data = (byte[])value.Value; _writer.Write(data); } break; case BsonType.Regex: { BsonRegex value = (BsonRegex)t; WriteString((string)value.Pattern.Value, value.Pattern.ByteCount, null); WriteString((string)value.Options.Value, value.Options.ByteCount, null); } break; default: throw new ArgumentOutOfRangeException("t", "Unexpected token when writing BSON: {0}".FormatWith(CultureInfo.InvariantCulture, t.Type)); } } private void WriteString(string s, int byteCount, int? calculatedlengthPrefix) { if (calculatedlengthPrefix != null) _writer.Write(calculatedlengthPrefix.Value); WriteUtf8Bytes(s, byteCount); _writer.Write((byte)0); } public void WriteUtf8Bytes(string s, int byteCount) { if (s != null) { if (_largeByteBuffer == null) { _largeByteBuffer = new byte[256]; } if (byteCount <= 256) { Encoding.GetBytes(s, 0, s.Length, _largeByteBuffer, 0); _writer.Write(_largeByteBuffer, 0, byteCount); } else { byte[] bytes = Encoding.GetBytes(s); _writer.Write(bytes); } } } private int CalculateSize(int stringByteCount) { return stringByteCount + 1; } private int CalculateSizeWithLength(int stringByteCount, bool includeSize) { int baseSize = (includeSize) ? 5 // size bytes + terminator : 1; // terminator return baseSize + stringByteCount; } private int CalculateSize(BsonToken t) { switch (t.Type) { case BsonType.Object: { BsonObject value = (BsonObject)t; int bases = 4; foreach (BsonProperty p in value) { int size = 1; size += CalculateSize(p.Name); size += CalculateSize(p.Value); bases += size; } bases += 1; value.CalculatedSize = bases; return bases; } case BsonType.Array: { BsonArray value = (BsonArray)t; int size = 4; int index = 0; foreach (BsonToken c in value) { size += 1; size += CalculateSize(MathUtils.IntLength(index)); size += CalculateSize(c); index++; } size += 1; value.CalculatedSize = size; return value.CalculatedSize; } case BsonType.Integer: return 4; case BsonType.Long: return 8; case BsonType.Number: return 8; case BsonType.String: { BsonString value = (BsonString)t; string s = (string)value.Value; value.ByteCount = (s != null) ? Encoding.GetByteCount(s) : 0; value.CalculatedSize = CalculateSizeWithLength(value.ByteCount, value.IncludeLength); return value.CalculatedSize; } case BsonType.Boolean: return 1; case BsonType.Null: case BsonType.Undefined: return 0; case BsonType.Date: return 8; case BsonType.Binary: { BsonValue value = (BsonValue)t; byte[] data = (byte[])value.Value; value.CalculatedSize = 4 + 1 + data.Length; return value.CalculatedSize; } case BsonType.Oid: return 12; case BsonType.Regex: { BsonRegex value = (BsonRegex)t; int size = 0; size += CalculateSize(value.Pattern); size += CalculateSize(value.Options); value.CalculatedSize = size; return value.CalculatedSize; } default: throw new ArgumentOutOfRangeException("t", "Unexpected token when writing BSON: {0}".FormatWith(CultureInfo.InvariantCulture, t.Type)); } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonToken.cs0000644000175000017500000000716712253423361026175 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections; using System.Collections.Generic; namespace Newtonsoft.Json.Bson { internal abstract class BsonToken { public abstract BsonType Type { get; } public BsonToken Parent { get; set; } public int CalculatedSize { get; set; } } internal class BsonObject : BsonToken, IEnumerable { private readonly List _children = new List(); public void Add(string name, BsonToken token) { _children.Add(new BsonProperty { Name = new BsonString(name, false), Value = token }); token.Parent = this; } public override BsonType Type { get { return BsonType.Object; } } public IEnumerator GetEnumerator() { return _children.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } internal class BsonArray : BsonToken, IEnumerable { private readonly List _children = new List(); public void Add(BsonToken token) { _children.Add(token); token.Parent = this; } public override BsonType Type { get { return BsonType.Array; } } public IEnumerator GetEnumerator() { return _children.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } internal class BsonValue : BsonToken { private readonly object _value; private readonly BsonType _type; public BsonValue(object value, BsonType type) { _value = value; _type = type; } public object Value { get { return _value; } } public override BsonType Type { get { return _type; } } } internal class BsonString : BsonValue { public int ByteCount { get; set; } public bool IncludeLength { get; set; } public BsonString(object value, bool includeLength) : base(value, BsonType.String) { IncludeLength = includeLength; } } internal class BsonRegex : BsonToken { public BsonString Pattern { get; set; } public BsonString Options { get; set; } public BsonRegex(string pattern, string options) { Pattern = new BsonString(pattern, false); Options = new BsonString(options, false); } public override BsonType Type { get { return BsonType.Regex; } } } internal class BsonProperty { public BsonString Name { get; set; } public BsonToken Value { get; set; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonBinaryType.cs0000644000175000017500000000266212253423361027176 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json.Bson { internal enum BsonBinaryType : byte { Binary = 0x00, Function = 0x01, [Obsolete("This type has been deprecated in the BSON specification. Use Binary instead.")] Data = 0x02, Uuid = 0x03, Md5 = 0x05, UserDefined = 0x80 } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/PreserveReferencesHandling.cs0000644000175000017500000000410412253423361030620 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Text; namespace Newtonsoft.Json { /// /// Specifies reference handling options for the . /// /// /// /// [Flags] public enum PreserveReferencesHandling { /// /// Do not preserve references when serializing types. /// None = 0, /// /// Preserve references when serializing into a JSON object structure. /// Objects = 1, /// /// Preserve references when serializing into a JSON array structure. /// Arrays = 2, /// /// Preserve references when serializing. /// All = Objects | Arrays } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/WriteState.cs0000644000175000017500000000435212253423361025456 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json { /// /// Specifies the state of the . /// public enum WriteState { /// /// An exception has been thrown, which has left the in an invalid state. /// You may call the method to put the in the Closed state. /// Any other method calls results in an being thrown. /// Error, /// /// The method has been called. /// Closed, /// /// An object is being written. /// Object, /// /// A array is being written. /// Array, /// /// A constructor is being written. /// Constructor, /// /// A property is being written. /// Property, /// /// A write method has not been called. /// Start } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/ObjectCreationHandling.cs0000644000175000017500000000314612253423361027723 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json { /// /// Specifies how object creation is handled by the . /// public enum ObjectCreationHandling { /// /// Reuse existing objects, create new objects when needed. /// Auto = 0, /// /// Only reuse existing objects. /// Reuse = 1, /// /// Always create new objects. /// Replace = 2 } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConvert.cs0000644000175000017500000013325212253423361025637 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.IO; using System.Globalization; #if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) using System.Threading.Tasks; #endif using Newtonsoft.Json.Utilities; using System.Xml; using Newtonsoft.Json.Converters; using System.Text; #if !NET20 && (!SILVERLIGHT || WINDOWS_PHONE) && !PORTABLE using System.Xml.Linq; #endif #if NETFX_CORE using IConvertible = Newtonsoft.Json.Utilities.Convertible; #endif namespace Newtonsoft.Json { /// /// Provides methods for converting between common language runtime types and JSON types. /// /// /// /// public static class JsonConvert { /// /// Represents JavaScript's boolean value true as a string. This field is read-only. /// public static readonly string True = "true"; /// /// Represents JavaScript's boolean value false as a string. This field is read-only. /// public static readonly string False = "false"; /// /// Represents JavaScript's null as a string. This field is read-only. /// public static readonly string Null = "null"; /// /// Represents JavaScript's undefined as a string. This field is read-only. /// public static readonly string Undefined = "undefined"; /// /// Represents JavaScript's positive infinity as a string. This field is read-only. /// public static readonly string PositiveInfinity = "Infinity"; /// /// Represents JavaScript's negative infinity as a string. This field is read-only. /// public static readonly string NegativeInfinity = "-Infinity"; /// /// Represents JavaScript's NaN as a string. This field is read-only. /// public static readonly string NaN = "NaN"; internal static readonly long InitialJavaScriptDateTicks = 621355968000000000; /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(DateTime value) { return ToString(value, DateFormatHandling.IsoDateFormat, DateTimeZoneHandling.RoundtripKind); } /// /// Converts the to its JSON string representation using the specified. /// /// The value to convert. /// The format the date will be converted to. /// The time zone handling when the date is converted to a string. /// A JSON string representation of the . public static string ToString(DateTime value, DateFormatHandling format, DateTimeZoneHandling timeZoneHandling) { DateTime updatedDateTime = EnsureDateTime(value, timeZoneHandling); using (StringWriter writer = StringUtils.CreateStringWriter(64)) { WriteDateTimeString(writer, updatedDateTime, updatedDateTime.GetUtcOffset(), updatedDateTime.Kind, format); return writer.ToString(); } } internal static DateTime EnsureDateTime(DateTime value, DateTimeZoneHandling timeZone) { switch (timeZone) { case DateTimeZoneHandling.Local: value = SwitchToLocalTime(value); break; case DateTimeZoneHandling.Utc: value = SwitchToUtcTime(value); break; case DateTimeZoneHandling.Unspecified: value = new DateTime(value.Ticks, DateTimeKind.Unspecified); break; case DateTimeZoneHandling.RoundtripKind: break; default: throw new ArgumentException("Invalid date time handling value."); } return value; } #if !PocketPC && !NET20 /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(DateTimeOffset value) { return ToString(value, DateFormatHandling.IsoDateFormat); } /// /// Converts the to its JSON string representation using the specified. /// /// The value to convert. /// The format the date will be converted to. /// A JSON string representation of the . public static string ToString(DateTimeOffset value, DateFormatHandling format) { using (StringWriter writer = StringUtils.CreateStringWriter(64)) { WriteDateTimeString(writer, (format == DateFormatHandling.IsoDateFormat) ? value.DateTime : value.UtcDateTime, value.Offset, DateTimeKind.Local, format); return writer.ToString(); } } #endif internal static void WriteDateTimeString(TextWriter writer, DateTime value, DateFormatHandling format) { WriteDateTimeString(writer, value, value.GetUtcOffset(), value.Kind, format); } internal static void WriteDateTimeString(TextWriter writer, DateTime value, TimeSpan offset, DateTimeKind kind, DateFormatHandling format) { if (format == DateFormatHandling.MicrosoftDateFormat) { long javaScriptTicks = ConvertDateTimeToJavaScriptTicks(value, offset); writer.Write(@"""\/Date("); writer.Write(javaScriptTicks); switch (kind) { case DateTimeKind.Unspecified: if (value != DateTime.MaxValue && value != DateTime.MinValue) WriteDateTimeOffset(writer, offset, format); break; case DateTimeKind.Local: WriteDateTimeOffset(writer, offset, format); break; } writer.Write(@")\/"""); } else { writer.Write(@""""); writer.Write(value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFF", CultureInfo.InvariantCulture)); switch (kind) { case DateTimeKind.Local: WriteDateTimeOffset(writer, offset, format); break; case DateTimeKind.Utc: writer.Write("Z"); break; } writer.Write(@""""); } } internal static void WriteDateTimeOffset(TextWriter writer, TimeSpan offset, DateFormatHandling format) { writer.Write((offset.Ticks >= 0L) ? "+" : "-"); int absHours = Math.Abs(offset.Hours); if (absHours < 10) writer.Write(0); writer.Write(absHours); if (format == DateFormatHandling.IsoDateFormat) writer.Write(':'); int absMinutes = Math.Abs(offset.Minutes); if (absMinutes < 10) writer.Write(0); writer.Write(absMinutes); } private static long ToUniversalTicks(DateTime dateTime) { if (dateTime.Kind == DateTimeKind.Utc) return dateTime.Ticks; return ToUniversalTicks(dateTime, dateTime.GetUtcOffset()); } private static long ToUniversalTicks(DateTime dateTime, TimeSpan offset) { // special case min and max value // they never have a timezone appended to avoid issues if (dateTime.Kind == DateTimeKind.Utc || dateTime == DateTime.MaxValue || dateTime == DateTime.MinValue) return dateTime.Ticks; long ticks = dateTime.Ticks - offset.Ticks; if (ticks > 3155378975999999999L) return 3155378975999999999L; if (ticks < 0L) return 0L; return ticks; } internal static long ConvertDateTimeToJavaScriptTicks(DateTime dateTime, TimeSpan offset) { long universialTicks = ToUniversalTicks(dateTime, offset); return UniversialTicksToJavaScriptTicks(universialTicks); } internal static long ConvertDateTimeToJavaScriptTicks(DateTime dateTime) { return ConvertDateTimeToJavaScriptTicks(dateTime, true); } internal static long ConvertDateTimeToJavaScriptTicks(DateTime dateTime, bool convertToUtc) { long ticks = (convertToUtc) ? ToUniversalTicks(dateTime) : dateTime.Ticks; return UniversialTicksToJavaScriptTicks(ticks); } private static long UniversialTicksToJavaScriptTicks(long universialTicks) { long javaScriptTicks = (universialTicks - InitialJavaScriptDateTicks)/10000; return javaScriptTicks; } internal static DateTime ConvertJavaScriptTicksToDateTime(long javaScriptTicks) { DateTime dateTime = new DateTime((javaScriptTicks*10000) + InitialJavaScriptDateTicks, DateTimeKind.Utc); return dateTime; } private static DateTime SwitchToLocalTime(DateTime value) { switch (value.Kind) { case DateTimeKind.Unspecified: return new DateTime(value.Ticks, DateTimeKind.Local); case DateTimeKind.Utc: return value.ToLocalTime(); case DateTimeKind.Local: return value; } return value; } private static DateTime SwitchToUtcTime(DateTime value) { switch (value.Kind) { case DateTimeKind.Unspecified: return new DateTime(value.Ticks, DateTimeKind.Utc); case DateTimeKind.Utc: return value; case DateTimeKind.Local: return value.ToUniversalTime(); } return value; } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(bool value) { return (value) ? True : False; } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(char value) { return ToString(char.ToString(value)); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(Enum value) { return value.ToString("D"); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(int value) { return value.ToString(null, CultureInfo.InvariantCulture); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(short value) { return value.ToString(null, CultureInfo.InvariantCulture); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . [CLSCompliant(false)] public static string ToString(ushort value) { return value.ToString(null, CultureInfo.InvariantCulture); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . [CLSCompliant(false)] public static string ToString(uint value) { return value.ToString(null, CultureInfo.InvariantCulture); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(long value) { return value.ToString(null, CultureInfo.InvariantCulture); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . [CLSCompliant(false)] public static string ToString(ulong value) { return value.ToString(null, CultureInfo.InvariantCulture); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(float value) { return EnsureDecimalPlace(value, value.ToString("R", CultureInfo.InvariantCulture)); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(double value) { return EnsureDecimalPlace(value, value.ToString("R", CultureInfo.InvariantCulture)); } private static string EnsureDecimalPlace(double value, string text) { if (double.IsNaN(value) || double.IsInfinity(value) || text.IndexOf('.') != -1 || text.IndexOf('E') != -1 || text.IndexOf('e') != -1) return text; return text + ".0"; } private static string EnsureDecimalPlace(string text) { if (text.IndexOf('.') != -1) return text; return text + ".0"; } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(byte value) { return value.ToString(null, CultureInfo.InvariantCulture); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . [CLSCompliant(false)] public static string ToString(sbyte value) { return value.ToString(null, CultureInfo.InvariantCulture); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(decimal value) { return EnsureDecimalPlace(value.ToString(null, CultureInfo.InvariantCulture)); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(Guid value) { string text = null; #if !(NETFX_CORE || PORTABLE) text = value.ToString("D", CultureInfo.InvariantCulture); #else text = value.ToString("D"); #endif return '"' + text + '"'; } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(TimeSpan value) { return '"' + value.ToString() + '"'; } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(Uri value) { if (value == null) return Null; return ToString(value.ToString()); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(string value) { return ToString(value, '"'); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// The string delimiter character. /// A JSON string representation of the . public static string ToString(string value, char delimter) { return JavaScriptUtils.ToEscapedJavaScriptString(value, delimter, true); } /// /// Converts the to its JSON string representation. /// /// The value to convert. /// A JSON string representation of the . public static string ToString(object value) { if (value == null) return Null; IConvertible convertible = ConvertUtils.ToConvertible(value); if (convertible != null) { switch (convertible.GetTypeCode()) { case TypeCode.String: return ToString(convertible.ToString(CultureInfo.InvariantCulture)); case TypeCode.Char: return ToString(convertible.ToChar(CultureInfo.InvariantCulture)); case TypeCode.Boolean: return ToString(convertible.ToBoolean(CultureInfo.InvariantCulture)); case TypeCode.SByte: return ToString(convertible.ToSByte(CultureInfo.InvariantCulture)); case TypeCode.Int16: return ToString(convertible.ToInt16(CultureInfo.InvariantCulture)); case TypeCode.UInt16: return ToString(convertible.ToUInt16(CultureInfo.InvariantCulture)); case TypeCode.Int32: return ToString(convertible.ToInt32(CultureInfo.InvariantCulture)); case TypeCode.Byte: return ToString(convertible.ToByte(CultureInfo.InvariantCulture)); case TypeCode.UInt32: return ToString(convertible.ToUInt32(CultureInfo.InvariantCulture)); case TypeCode.Int64: return ToString(convertible.ToInt64(CultureInfo.InvariantCulture)); case TypeCode.UInt64: return ToString(convertible.ToUInt64(CultureInfo.InvariantCulture)); case TypeCode.Single: return ToString(convertible.ToSingle(CultureInfo.InvariantCulture)); case TypeCode.Double: return ToString(convertible.ToDouble(CultureInfo.InvariantCulture)); case TypeCode.DateTime: return ToString(convertible.ToDateTime(CultureInfo.InvariantCulture)); case TypeCode.Decimal: return ToString(convertible.ToDecimal(CultureInfo.InvariantCulture)); #if !(NETFX_CORE || PORTABLE) case TypeCode.DBNull: return Null; #endif } } #if !PocketPC && !NET20 else if (value is DateTimeOffset) { return ToString((DateTimeOffset) value); } #endif else if (value is Guid) { return ToString((Guid) value); } else if (value is Uri) { return ToString((Uri) value); } else if (value is TimeSpan) { return ToString((TimeSpan) value); } throw new ArgumentException("Unsupported type: {0}. Use the JsonSerializer class to get the object's JSON representation.".FormatWith(CultureInfo.InvariantCulture, value.GetType())); } private static bool IsJsonPrimitiveTypeCode(TypeCode typeCode) { switch (typeCode) { case TypeCode.String: case TypeCode.Char: case TypeCode.Boolean: case TypeCode.SByte: case TypeCode.Int16: case TypeCode.UInt16: case TypeCode.Int32: case TypeCode.Byte: case TypeCode.UInt32: case TypeCode.Int64: case TypeCode.UInt64: case TypeCode.Single: case TypeCode.Double: case TypeCode.DateTime: case TypeCode.Decimal: #if !(NETFX_CORE || PORTABLE) case TypeCode.DBNull: #endif return true; default: return false; } } internal static bool IsJsonPrimitiveType(Type type) { if (ReflectionUtils.IsNullableType(type)) type = Nullable.GetUnderlyingType(type); #if !PocketPC && !NET20 if (type == typeof (DateTimeOffset)) return true; #endif if (type == typeof (byte[])) return true; if (type == typeof (Uri)) return true; if (type == typeof (TimeSpan)) return true; if (type == typeof (Guid)) return true; return IsJsonPrimitiveTypeCode(ConvertUtils.GetTypeCode(type)); } #region Serialize /// /// Serializes the specified object to a JSON string. /// /// The object to serialize. /// A JSON string representation of the object. public static string SerializeObject(object value) { return SerializeObject(value, Formatting.None, (JsonSerializerSettings) null); } /// /// Serializes the specified object to a JSON string. /// /// The object to serialize. /// Indicates how the output is formatted. /// /// A JSON string representation of the object. /// public static string SerializeObject(object value, Formatting formatting) { return SerializeObject(value, formatting, (JsonSerializerSettings) null); } /// /// Serializes the specified object to a JSON string using a collection of . /// /// The object to serialize. /// A collection converters used while serializing. /// A JSON string representation of the object. public static string SerializeObject(object value, params JsonConverter[] converters) { return SerializeObject(value, Formatting.None, converters); } /// /// Serializes the specified object to a JSON string using a collection of . /// /// The object to serialize. /// Indicates how the output is formatted. /// A collection converters used while serializing. /// A JSON string representation of the object. public static string SerializeObject(object value, Formatting formatting, params JsonConverter[] converters) { JsonSerializerSettings settings = (converters != null && converters.Length > 0) ? new JsonSerializerSettings {Converters = converters} : null; return SerializeObject(value, formatting, settings); } /// /// Serializes the specified object to a JSON string using a collection of . /// /// The object to serialize. /// The used to serialize the object. /// If this is null, default serialization settings will be is used. /// /// A JSON string representation of the object. /// public static string SerializeObject(object value, JsonSerializerSettings settings) { return SerializeObject(value, Formatting.None, settings); } /// /// Serializes the specified object to a JSON string using a collection of . /// /// The object to serialize. /// Indicates how the output is formatted. /// The used to serialize the object. /// If this is null, default serialization settings will be is used. /// /// A JSON string representation of the object. /// public static string SerializeObject(object value, Formatting formatting, JsonSerializerSettings settings) { JsonSerializer jsonSerializer = JsonSerializer.Create(settings); StringBuilder sb = new StringBuilder(256); StringWriter sw = new StringWriter(sb, CultureInfo.InvariantCulture); using (JsonTextWriter jsonWriter = new JsonTextWriter(sw)) { jsonWriter.Formatting = formatting; jsonSerializer.Serialize(jsonWriter, value); } return sw.ToString(); } #if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) /// /// Asynchronously serializes the specified object to a JSON string using a collection of . /// /// The object to serialize. /// /// A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. /// public static Task SerializeObjectAsync(object value) { return SerializeObjectAsync(value, Formatting.None, null); } /// /// Asynchronously serializes the specified object to a JSON string using a collection of . /// /// The object to serialize. /// Indicates how the output is formatted. /// /// A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. /// public static Task SerializeObjectAsync(object value, Formatting formatting) { return SerializeObjectAsync(value, formatting, null); } /// /// Asynchronously serializes the specified object to a JSON string using a collection of . /// /// The object to serialize. /// Indicates how the output is formatted. /// The used to serialize the object. /// If this is null, default serialization settings will be is used. /// /// A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. /// public static Task SerializeObjectAsync(object value, Formatting formatting, JsonSerializerSettings settings) { return Task.Factory.StartNew(() => SerializeObject(value, formatting, settings)); } #endif #endregion #region Deserialize /// /// Deserializes the JSON to a .NET object. /// /// The JSON to deserialize. /// The deserialized object from the Json string. public static object DeserializeObject(string value) { return DeserializeObject(value, null, (JsonSerializerSettings) null); } /// /// Deserializes the JSON to a .NET object. /// /// The JSON to deserialize. /// /// The used to deserialize the object. /// If this is null, default serialization settings will be is used. /// /// The deserialized object from the JSON string. public static object DeserializeObject(string value, JsonSerializerSettings settings) { return DeserializeObject(value, null, settings); } /// /// Deserializes the JSON to the specified .NET type. /// /// The JSON to deserialize. /// The of object being deserialized. /// The deserialized object from the Json string. public static object DeserializeObject(string value, Type type) { return DeserializeObject(value, type, (JsonSerializerSettings) null); } /// /// Deserializes the JSON to the specified .NET type. /// /// The type of the object to deserialize to. /// The JSON to deserialize. /// The deserialized object from the Json string. public static T DeserializeObject(string value) { return DeserializeObject(value, (JsonSerializerSettings) null); } /// /// Deserializes the JSON to the given anonymous type. /// /// /// The anonymous type to deserialize to. This can't be specified /// traditionally and must be infered from the anonymous type passed /// as a parameter. /// /// The JSON to deserialize. /// The anonymous type object. /// The deserialized anonymous type from the JSON string. public static T DeserializeAnonymousType(string value, T anonymousTypeObject) { return DeserializeObject(value); } /// /// Deserializes the JSON to the specified .NET type. /// /// The type of the object to deserialize to. /// The JSON to deserialize. /// Converters to use while deserializing. /// The deserialized object from the JSON string. public static T DeserializeObject(string value, params JsonConverter[] converters) { return (T) DeserializeObject(value, typeof (T), converters); } /// /// Deserializes the JSON to the specified .NET type. /// /// The type of the object to deserialize to. /// The object to deserialize. /// /// The used to deserialize the object. /// If this is null, default serialization settings will be is used. /// /// The deserialized object from the JSON string. public static T DeserializeObject(string value, JsonSerializerSettings settings) { return (T) DeserializeObject(value, typeof (T), settings); } /// /// Deserializes the JSON to the specified .NET type. /// /// The JSON to deserialize. /// The type of the object to deserialize. /// Converters to use while deserializing. /// The deserialized object from the JSON string. public static object DeserializeObject(string value, Type type, params JsonConverter[] converters) { JsonSerializerSettings settings = (converters != null && converters.Length > 0) ? new JsonSerializerSettings {Converters = converters} : null; return DeserializeObject(value, type, settings); } /// /// Deserializes the JSON to the specified .NET type. /// /// The JSON to deserialize. /// The type of the object to deserialize to. /// /// The used to deserialize the object. /// If this is null, default serialization settings will be is used. /// /// The deserialized object from the JSON string. public static object DeserializeObject(string value, Type type, JsonSerializerSettings settings) { ValidationUtils.ArgumentNotNull(value, "value"); StringReader sr = new StringReader(value); JsonSerializer jsonSerializer = JsonSerializer.Create(settings); // by default DeserializeObject should check for additional content if (!jsonSerializer.IsCheckAdditionalContentSet()) jsonSerializer.CheckAdditionalContent = true; return jsonSerializer.Deserialize(new JsonTextReader(sr), type); } #if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) /// /// Asynchronously deserializes the JSON to the specified .NET type. /// /// The type of the object to deserialize to. /// The JSON to deserialize. /// /// A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. /// public static Task DeserializeObjectAsync(string value) { return DeserializeObjectAsync(value, null); } /// /// Asynchronously deserializes the JSON to the specified .NET type. /// /// The type of the object to deserialize to. /// The JSON to deserialize. /// /// The used to deserialize the object. /// If this is null, default serialization settings will be is used. /// /// /// A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. /// public static Task DeserializeObjectAsync(string value, JsonSerializerSettings settings) { return Task.Factory.StartNew(() => DeserializeObject(value, settings)); } /// /// Asynchronously deserializes the JSON to the specified .NET type. /// /// The JSON to deserialize. /// /// A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. /// public static Task DeserializeObjectAsync(string value) { return DeserializeObjectAsync(value, null, null); } /// /// Asynchronously deserializes the JSON to the specified .NET type. /// /// The JSON to deserialize. /// The type of the object to deserialize to. /// /// The used to deserialize the object. /// If this is null, default serialization settings will be is used. /// /// /// A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. /// public static Task DeserializeObjectAsync(string value, Type type, JsonSerializerSettings settings) { return Task.Factory.StartNew(() => DeserializeObject(value, type, settings)); } #endif #endregion /// /// Populates the object with values from the JSON string. /// /// The JSON to populate values from. /// The target object to populate values onto. public static void PopulateObject(string value, object target) { PopulateObject(value, target, null); } /// /// Populates the object with values from the JSON string. /// /// The JSON to populate values from. /// The target object to populate values onto. /// /// The used to deserialize the object. /// If this is null, default serialization settings will be is used. /// public static void PopulateObject(string value, object target, JsonSerializerSettings settings) { StringReader sr = new StringReader(value); JsonSerializer jsonSerializer = JsonSerializer.Create(settings); using (JsonReader jsonReader = new JsonTextReader(sr)) { jsonSerializer.Populate(jsonReader, target); if (jsonReader.Read() && jsonReader.TokenType != JsonToken.Comment) throw new JsonSerializationException("Additional text found in JSON string after finishing deserializing object."); } } #if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) /// /// Asynchronously populates the object with values from the JSON string. /// /// The JSON to populate values from. /// The target object to populate values onto. /// /// The used to deserialize the object. /// If this is null, default serialization settings will be is used. /// /// /// A task that represents the asynchronous populate operation. /// public static Task PopulateObjectAsync(string value, object target, JsonSerializerSettings settings) { return Task.Factory.StartNew(() => PopulateObject(value, target, settings)); } #endif #if !(SILVERLIGHT || PORTABLE || NETFX_CORE) /// /// Serializes the XML node to a JSON string. /// /// The node to serialize. /// A JSON string of the XmlNode. public static string SerializeXmlNode(XmlNode node) { return SerializeXmlNode(node, Formatting.None); } /// /// Serializes the XML node to a JSON string. /// /// The node to serialize. /// Indicates how the output is formatted. /// A JSON string of the XmlNode. public static string SerializeXmlNode(XmlNode node, Formatting formatting) { XmlNodeConverter converter = new XmlNodeConverter(); return SerializeObject(node, formatting, converter); } /// /// Serializes the XML node to a JSON string. /// /// The node to serialize. /// Indicates how the output is formatted. /// Omits writing the root object. /// A JSON string of the XmlNode. public static string SerializeXmlNode(XmlNode node, Formatting formatting, bool omitRootObject) { XmlNodeConverter converter = new XmlNodeConverter {OmitRootObject = omitRootObject}; return SerializeObject(node, formatting, converter); } /// /// Deserializes the XmlNode from a JSON string. /// /// The JSON string. /// The deserialized XmlNode public static XmlDocument DeserializeXmlNode(string value) { return DeserializeXmlNode(value, null); } /// /// Deserializes the XmlNode from a JSON string nested in a root elment. /// /// The JSON string. /// The name of the root element to append when deserializing. /// The deserialized XmlNode public static XmlDocument DeserializeXmlNode(string value, string deserializeRootElementName) { return DeserializeXmlNode(value, deserializeRootElementName, false); } /// /// Deserializes the XmlNode from a JSON string nested in a root elment. /// /// The JSON string. /// The name of the root element to append when deserializing. /// /// A flag to indicate whether to write the Json.NET array attribute. /// This attribute helps preserve arrays when converting the written XML back to JSON. /// /// The deserialized XmlNode public static XmlDocument DeserializeXmlNode(string value, string deserializeRootElementName, bool writeArrayAttribute) { XmlNodeConverter converter = new XmlNodeConverter(); converter.DeserializeRootElementName = deserializeRootElementName; converter.WriteArrayAttribute = writeArrayAttribute; return (XmlDocument) DeserializeObject(value, typeof (XmlDocument), converter); } #endif #if !NET20 && (!(SILVERLIGHT || PORTABLE) || WINDOWS_PHONE) /// /// Serializes the to a JSON string. /// /// The node to convert to JSON. /// A JSON string of the XNode. public static string SerializeXNode(XObject node) { return SerializeXNode(node, Formatting.None); } /// /// Serializes the to a JSON string. /// /// The node to convert to JSON. /// Indicates how the output is formatted. /// A JSON string of the XNode. public static string SerializeXNode(XObject node, Formatting formatting) { return SerializeXNode(node, formatting, false); } /// /// Serializes the to a JSON string. /// /// The node to serialize. /// Indicates how the output is formatted. /// Omits writing the root object. /// A JSON string of the XNode. public static string SerializeXNode(XObject node, Formatting formatting, bool omitRootObject) { XmlNodeConverter converter = new XmlNodeConverter {OmitRootObject = omitRootObject}; return SerializeObject(node, formatting, converter); } /// /// Deserializes the from a JSON string. /// /// The JSON string. /// The deserialized XNode public static XDocument DeserializeXNode(string value) { return DeserializeXNode(value, null); } /// /// Deserializes the from a JSON string nested in a root elment. /// /// The JSON string. /// The name of the root element to append when deserializing. /// The deserialized XNode public static XDocument DeserializeXNode(string value, string deserializeRootElementName) { return DeserializeXNode(value, deserializeRootElementName, false); } /// /// Deserializes the from a JSON string nested in a root elment. /// /// The JSON string. /// The name of the root element to append when deserializing. /// /// A flag to indicate whether to write the Json.NET array attribute. /// This attribute helps preserve arrays when converting the written XML back to JSON. /// /// The deserialized XNode public static XDocument DeserializeXNode(string value, string deserializeRootElementName, bool writeArrayAttribute) { XmlNodeConverter converter = new XmlNodeConverter(); converter.DeserializeRootElementName = deserializeRootElementName; converter.WriteArrayAttribute = writeArrayAttribute; return (XDocument) DeserializeObject(value, typeof (XDocument), converter); } #endif } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonDictionaryAttribute.cs0000644000175000017500000000363012253423361030204 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json { /// /// Instructs the how to serialize the collection. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)] public sealed class JsonDictionaryAttribute : JsonContainerAttribute { /// /// Initializes a new instance of the class. /// public JsonDictionaryAttribute() { } /// /// Initializes a new instance of the class with the specified container Id. /// /// The container Id. public JsonDictionaryAttribute(string id) : base(id) { } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonArrayAttribute.cs0000644000175000017500000000521312253423361027154 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json { /// /// Instructs the how to serialize the collection. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)] public sealed class JsonArrayAttribute : JsonContainerAttribute { private bool _allowNullItems; /// /// Gets or sets a value indicating whether null items are allowed in the collection. /// /// true if null items are allowed in the collection; otherwise, false. public bool AllowNullItems { get { return _allowNullItems; } set { _allowNullItems = value; } } /// /// Initializes a new instance of the class. /// public JsonArrayAttribute() { } /// /// Initializes a new instance of the class with a flag indicating whether the array can contain null items /// /// A flag indicating whether the array can contain null items. public JsonArrayAttribute(bool allowNullItems) { _allowNullItems = allowNullItems; } /// /// Initializes a new instance of the class with the specified container Id. /// /// The container Id. public JsonArrayAttribute(string id) : base(id) { } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConstructorAttribute.cs0000644000175000017500000000271512253423361030427 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json { /// /// Instructs the to use the specified constructor when deserializing that object. /// [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false)] public sealed class JsonConstructorAttribute : Attribute { } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/DateFormatHandling.cs0000644000175000017500000000310012253423361027044 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json { /// /// Specifies how dates are formatted when writing JSON text. /// public enum DateFormatHandling { /// /// Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". /// IsoDateFormat, /// /// Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". /// MicrosoftDateFormat } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/SerializationBinder.cs0000644000175000017500000000263112253423361027322 0ustar00meebeymeebey00000000000000#if SILVERLIGHT || PocketPC || NETFX_CORE || PORTABLE using System; using System.Reflection; namespace Newtonsoft.Json { /// /// Allows users to control class loading and mandate what class to load. /// public abstract class SerializationBinder { /// /// When overridden in a derived class, controls the binding of a serialized object to a type. /// /// Specifies the name of the serialized object. /// Specifies the name of the serialized object /// The type of the object the formatter creates a new instance of. public abstract Type BindToType(string assemblyName, string typeName); /// /// When overridden in a derived class, controls the binding of a serialized object to a type. /// /// The type of the object the formatter creates a new instance of. /// Specifies the name of the serialized object. /// Specifies the name of the serialized object. public virtual void BindToName(Type serializedType, out string assemblyName, out string typeName) { assemblyName = null; typeName = null; } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Required.cs0000644000175000017500000000315412253423361025142 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json { /// /// Indicating whether a property is required. /// public enum Required { /// /// The property is not required. The default state. /// Default, /// /// The property must be defined in JSON but can be a null value. /// AllowNull, /// /// The property must be defined in JSON and cannot be a null value. /// Always } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/FormatterAssemblyStyle.cs0000644000175000017500000000147212253423361030047 0ustar00meebeymeebey00000000000000#if SILVERLIGHT || PocketPC || NETFX_CORE || PORTABLE namespace System.Runtime.Serialization.Formatters { /// /// Indicates the method that will be used during deserialization for locating and loading assemblies. /// public enum FormatterAssemblyStyle { /// /// In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the LoadWithPartialName method is used to load the assembly. /// Simple, /// /// In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The Load method of the Assembly class is used to load the assembly. /// Full } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/StreamingContext.cs0000644000175000017500000000263012253423361026656 0ustar00meebeymeebey00000000000000#if PocketPC #pragma warning disable 1591 // This class is... borrowed from .NET and Microsoft for a short time. // Hopefully Microsoft will add DateTimeOffset to the compact framework // or I will rewrite a striped down version of this file myself namespace System.Runtime.Serialization { public enum StreamingContextStates { All = 255, Clone = 64, CrossAppDomain = 128, CrossMachine = 2, CrossProcess = 1, File = 4, Other = 32, Persistence = 8, Remoting = 16 } public struct StreamingContext { internal object m_additionalContext; internal StreamingContextStates m_state; public StreamingContext(StreamingContextStates state) : this(state, null) { } public StreamingContext(StreamingContextStates state, object additional) { this.m_state = state; this.m_additionalContext = additional; } public object Context { get { return this.m_additionalContext; } } public override bool Equals(object obj) { return ((obj is StreamingContext) && ((((StreamingContext)obj).m_additionalContext == this.m_additionalContext) && (((StreamingContext)obj).m_state == this.m_state))); } public override int GetHashCode() { return (int)this.m_state; } public StreamingContextStates State { get { return this.m_state; } } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonSerializationException.cs0000644000175000017500000001032612253423361030707 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Runtime.Serialization; using System.Text; namespace Newtonsoft.Json { /// /// The exception thrown when an error occurs during Json serialization or deserialization. /// #if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE) [Serializable] #endif public class JsonSerializationException : JsonException { /// /// Initializes a new instance of the class. /// public JsonSerializationException() { } /// /// Initializes a new instance of the class /// with a specified error message. /// /// The error message that explains the reason for the exception. public JsonSerializationException(string message) : base(message) { } /// /// Initializes a new instance of the class /// with a specified error message and a reference to the inner exception that is the cause of this exception. /// /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. public JsonSerializationException(string message, Exception innerException) : base(message, innerException) { } #if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE) /// /// Initializes a new instance of the class. /// /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. /// The parameter is null. /// The class name is null or is zero (0). public JsonSerializationException(SerializationInfo info, StreamingContext context) : base(info, context) { } #endif internal static JsonSerializationException Create(JsonReader reader, string message) { return Create(reader, message, null); } internal static JsonSerializationException Create(JsonReader reader, string message, Exception ex) { return Create(reader as IJsonLineInfo, reader.Path, message, ex); } internal static JsonSerializationException Create(IJsonLineInfo lineInfo, string path, string message, Exception ex) { message = FormatExceptionMessage(lineInfo, path, message); return new JsonSerializationException(message, ex); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonValidatingReader.cs0000644000175000017500000006275012253423361027430 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Schema; using Newtonsoft.Json.Utilities; using System.Globalization; using System.Text.RegularExpressions; using System.IO; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json { /// /// Represents a reader that provides validation. /// public class JsonValidatingReader : JsonReader, IJsonLineInfo { private class SchemaScope { private readonly JTokenType _tokenType; private readonly IList _schemas; private readonly Dictionary _requiredProperties; public string CurrentPropertyName { get; set; } public int ArrayItemCount { get; set; } public IList Schemas { get { return _schemas; } } public Dictionary RequiredProperties { get { return _requiredProperties; } } public JTokenType TokenType { get { return _tokenType; } } public SchemaScope(JTokenType tokenType, IList schemas) { _tokenType = tokenType; _schemas = schemas; _requiredProperties = schemas.SelectMany(GetRequiredProperties).Distinct().ToDictionary(p => p, p => false); } private IEnumerable GetRequiredProperties(JsonSchemaModel schema) { if (schema == null || schema.Properties == null) return Enumerable.Empty(); return schema.Properties.Where(p => p.Value.Required).Select(p => p.Key); } } private readonly JsonReader _reader; private readonly Stack _stack; private JsonSchema _schema; private JsonSchemaModel _model; private SchemaScope _currentScope; /// /// Sets an event handler for receiving schema validation errors. /// public event ValidationEventHandler ValidationEventHandler; /// /// Gets the text value of the current Json token. /// /// public override object Value { get { return _reader.Value; } } /// /// Gets the depth of the current token in the JSON document. /// /// The depth of the current token in the JSON document. public override int Depth { get { return _reader.Depth; } } /// /// Gets the path of the current JSON token. /// public override string Path { get { return _reader.Path; } } /// /// Gets the quotation mark character used to enclose the value of a string. /// /// public override char QuoteChar { get { return _reader.QuoteChar; } protected internal set { } } /// /// Gets the type of the current Json token. /// /// public override JsonToken TokenType { get { return _reader.TokenType; } } /// /// Gets the Common Language Runtime (CLR) type for the current Json token. /// /// public override Type ValueType { get { return _reader.ValueType; } } private void Push(SchemaScope scope) { _stack.Push(scope); _currentScope = scope; } private SchemaScope Pop() { SchemaScope poppedScope = _stack.Pop(); _currentScope = (_stack.Count != 0) ? _stack.Peek() : null; return poppedScope; } private IEnumerable CurrentSchemas { get { return _currentScope.Schemas; } } private IEnumerable CurrentMemberSchemas { get { if (_currentScope == null) return new List(new [] { _model }); if (_currentScope.Schemas == null || _currentScope.Schemas.Count == 0) return Enumerable.Empty(); switch (_currentScope.TokenType) { case JTokenType.None: return _currentScope.Schemas; case JTokenType.Object: { if (_currentScope.CurrentPropertyName == null) throw new JsonReaderException("CurrentPropertyName has not been set on scope."); IList schemas = new List(); foreach (JsonSchemaModel schema in CurrentSchemas) { JsonSchemaModel propertySchema; if (schema.Properties != null && schema.Properties.TryGetValue(_currentScope.CurrentPropertyName, out propertySchema)) { schemas.Add(propertySchema); } if (schema.PatternProperties != null) { foreach (KeyValuePair patternProperty in schema.PatternProperties) { if (Regex.IsMatch(_currentScope.CurrentPropertyName, patternProperty.Key)) { schemas.Add(patternProperty.Value); } } } if (schemas.Count == 0 && schema.AllowAdditionalProperties && schema.AdditionalProperties != null) schemas.Add(schema.AdditionalProperties); } return schemas; } case JTokenType.Array: { IList schemas = new List(); foreach (JsonSchemaModel schema in CurrentSchemas) { if (!CollectionUtils.IsNullOrEmpty(schema.Items)) { if (schema.Items.Count == 1) { schemas.Add(schema.Items[0]); } else { if (schema.Items.Count > (_currentScope.ArrayItemCount - 1)) schemas.Add(schema.Items[_currentScope.ArrayItemCount - 1]); } } if (schema.AllowAdditionalProperties && schema.AdditionalProperties != null) schemas.Add(schema.AdditionalProperties); } return schemas; } case JTokenType.Constructor: return Enumerable.Empty(); default: throw new ArgumentOutOfRangeException("TokenType", "Unexpected token type: {0}".FormatWith(CultureInfo.InvariantCulture, _currentScope.TokenType)); } } } private void RaiseError(string message, JsonSchemaModel schema) { IJsonLineInfo lineInfo = this; string exceptionMessage = (lineInfo.HasLineInfo()) ? message + " Line {0}, position {1}.".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition) : message; OnValidationEvent(new JsonSchemaException(exceptionMessage, null, Path, lineInfo.LineNumber, lineInfo.LinePosition)); } private void OnValidationEvent(JsonSchemaException exception) { ValidationEventHandler handler = ValidationEventHandler; if (handler != null) handler(this, new ValidationEventArgs(exception)); else throw exception; } /// /// Initializes a new instance of the class that /// validates the content returned from the given . /// /// The to read from while validating. public JsonValidatingReader(JsonReader reader) { ValidationUtils.ArgumentNotNull(reader, "reader"); _reader = reader; _stack = new Stack(); } /// /// Gets or sets the schema. /// /// The schema. public JsonSchema Schema { get { return _schema; } set { if (TokenType != JsonToken.None) throw new InvalidOperationException("Cannot change schema while validating JSON."); _schema = value; _model = null; } } /// /// Gets the used to construct this . /// /// The specified in the constructor. public JsonReader Reader { get { return _reader; } } private void ValidateInEnumAndNotDisallowed(JsonSchemaModel schema) { if (schema == null) return; JToken value = new JValue(_reader.Value); if (schema.Enum != null) { StringWriter sw = new StringWriter(CultureInfo.InvariantCulture); value.WriteTo(new JsonTextWriter(sw)); if (!schema.Enum.ContainsValue(value, new JTokenEqualityComparer())) RaiseError("Value {0} is not defined in enum.".FormatWith(CultureInfo.InvariantCulture, sw.ToString()), schema); } JsonSchemaType? currentNodeType = GetCurrentNodeSchemaType(); if (currentNodeType != null) { if (JsonSchemaGenerator.HasFlag(schema.Disallow, currentNodeType.Value)) RaiseError("Type {0} is disallowed.".FormatWith(CultureInfo.InvariantCulture, currentNodeType), schema); } } private JsonSchemaType? GetCurrentNodeSchemaType() { switch (_reader.TokenType) { case JsonToken.StartObject: return JsonSchemaType.Object; case JsonToken.StartArray: return JsonSchemaType.Array; case JsonToken.Integer: return JsonSchemaType.Integer; case JsonToken.Float: return JsonSchemaType.Float; case JsonToken.String: return JsonSchemaType.String; case JsonToken.Boolean: return JsonSchemaType.Boolean; case JsonToken.Null: return JsonSchemaType.Null; default: return null; } } /// /// Reads the next JSON token from the stream as a . /// /// A . public override int? ReadAsInt32() { int? i = _reader.ReadAsInt32(); ValidateCurrentToken(); return i; } /// /// Reads the next JSON token from the stream as a . /// /// /// A or a null reference if the next JSON token is null. /// public override byte[] ReadAsBytes() { byte[] data = _reader.ReadAsBytes(); ValidateCurrentToken(); return data; } /// /// Reads the next JSON token from the stream as a . /// /// A . public override decimal? ReadAsDecimal() { decimal? d = _reader.ReadAsDecimal(); ValidateCurrentToken(); return d; } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override string ReadAsString() { string s = _reader.ReadAsString(); ValidateCurrentToken(); return s; } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override DateTime? ReadAsDateTime() { DateTime? dateTime = _reader.ReadAsDateTime(); ValidateCurrentToken(); return dateTime; } #if !NET20 /// /// Reads the next JSON token from the stream as a . /// /// A . public override DateTimeOffset? ReadAsDateTimeOffset() { DateTimeOffset? dateTimeOffset = _reader.ReadAsDateTimeOffset(); ValidateCurrentToken(); return dateTimeOffset; } #endif /// /// Reads the next JSON token from the stream. /// /// /// true if the next token was read successfully; false if there are no more tokens to read. /// public override bool Read() { if (!_reader.Read()) return false; if (_reader.TokenType == JsonToken.Comment) return true; ValidateCurrentToken(); return true; } private void ValidateCurrentToken() { // first time validate has been called. build model if (_model == null) { JsonSchemaModelBuilder builder = new JsonSchemaModelBuilder(); _model = builder.Build(_schema); } switch (_reader.TokenType) { case JsonToken.StartObject: ProcessValue(); IList objectSchemas = CurrentMemberSchemas.Where(ValidateObject).ToList(); Push(new SchemaScope(JTokenType.Object, objectSchemas)); break; case JsonToken.StartArray: ProcessValue(); IList arraySchemas = CurrentMemberSchemas.Where(ValidateArray).ToList(); Push(new SchemaScope(JTokenType.Array, arraySchemas)); break; case JsonToken.StartConstructor: Push(new SchemaScope(JTokenType.Constructor, null)); break; case JsonToken.PropertyName: foreach (JsonSchemaModel schema in CurrentSchemas) { ValidatePropertyName(schema); } break; case JsonToken.Raw: break; case JsonToken.Integer: ProcessValue(); foreach (JsonSchemaModel schema in CurrentMemberSchemas) { ValidateInteger(schema); } break; case JsonToken.Float: ProcessValue(); foreach (JsonSchemaModel schema in CurrentMemberSchemas) { ValidateFloat(schema); } break; case JsonToken.String: ProcessValue(); foreach (JsonSchemaModel schema in CurrentMemberSchemas) { ValidateString(schema); } break; case JsonToken.Boolean: ProcessValue(); foreach (JsonSchemaModel schema in CurrentMemberSchemas) { ValidateBoolean(schema); } break; case JsonToken.Null: ProcessValue(); foreach (JsonSchemaModel schema in CurrentMemberSchemas) { ValidateNull(schema); } break; case JsonToken.Undefined: break; case JsonToken.EndObject: foreach (JsonSchemaModel schema in CurrentSchemas) { ValidateEndObject(schema); } Pop(); break; case JsonToken.EndArray: foreach (JsonSchemaModel schema in CurrentSchemas) { ValidateEndArray(schema); } Pop(); break; case JsonToken.EndConstructor: Pop(); break; case JsonToken.Date: case JsonToken.Bytes: // these have no equivalent in JSON schema break; case JsonToken.None: // no content, do nothing break; default: throw new ArgumentOutOfRangeException(); } } private void ValidateEndObject(JsonSchemaModel schema) { if (schema == null) return; Dictionary requiredProperties = _currentScope.RequiredProperties; if (requiredProperties != null) { List unmatchedRequiredProperties = requiredProperties.Where(kv => !kv.Value).Select(kv => kv.Key).ToList(); if (unmatchedRequiredProperties.Count > 0) RaiseError("Required properties are missing from object: {0}.".FormatWith(CultureInfo.InvariantCulture, string.Join(", ", unmatchedRequiredProperties.ToArray())), schema); } } private void ValidateEndArray(JsonSchemaModel schema) { if (schema == null) return; int arrayItemCount = _currentScope.ArrayItemCount; if (schema.MaximumItems != null && arrayItemCount > schema.MaximumItems) RaiseError("Array item count {0} exceeds maximum count of {1}.".FormatWith(CultureInfo.InvariantCulture, arrayItemCount, schema.MaximumItems), schema); if (schema.MinimumItems != null && arrayItemCount < schema.MinimumItems) RaiseError("Array item count {0} is less than minimum count of {1}.".FormatWith(CultureInfo.InvariantCulture, arrayItemCount, schema.MinimumItems), schema); } private void ValidateNull(JsonSchemaModel schema) { if (schema == null) return; if (!TestType(schema, JsonSchemaType.Null)) return; ValidateInEnumAndNotDisallowed(schema); } private void ValidateBoolean(JsonSchemaModel schema) { if (schema == null) return; if (!TestType(schema, JsonSchemaType.Boolean)) return; ValidateInEnumAndNotDisallowed(schema); } private void ValidateString(JsonSchemaModel schema) { if (schema == null) return; if (!TestType(schema, JsonSchemaType.String)) return; ValidateInEnumAndNotDisallowed(schema); string value = _reader.Value.ToString(); if (schema.MaximumLength != null && value.Length > schema.MaximumLength) RaiseError("String '{0}' exceeds maximum length of {1}.".FormatWith(CultureInfo.InvariantCulture, value, schema.MaximumLength), schema); if (schema.MinimumLength != null && value.Length < schema.MinimumLength) RaiseError("String '{0}' is less than minimum length of {1}.".FormatWith(CultureInfo.InvariantCulture, value, schema.MinimumLength), schema); if (schema.Patterns != null) { foreach (string pattern in schema.Patterns) { if (!Regex.IsMatch(value, pattern)) RaiseError("String '{0}' does not match regex pattern '{1}'.".FormatWith(CultureInfo.InvariantCulture, value, pattern), schema); } } } private void ValidateInteger(JsonSchemaModel schema) { if (schema == null) return; if (!TestType(schema, JsonSchemaType.Integer)) return; ValidateInEnumAndNotDisallowed(schema); long value = Convert.ToInt64(_reader.Value, CultureInfo.InvariantCulture); if (schema.Maximum != null) { if (value > schema.Maximum) RaiseError("Integer {0} exceeds maximum value of {1}.".FormatWith(CultureInfo.InvariantCulture, value, schema.Maximum), schema); if (schema.ExclusiveMaximum && value == schema.Maximum) RaiseError("Integer {0} equals maximum value of {1} and exclusive maximum is true.".FormatWith(CultureInfo.InvariantCulture, value, schema.Maximum), schema); } if (schema.Minimum != null) { if (value < schema.Minimum) RaiseError("Integer {0} is less than minimum value of {1}.".FormatWith(CultureInfo.InvariantCulture, value, schema.Minimum), schema); if (schema.ExclusiveMinimum && value == schema.Minimum) RaiseError("Integer {0} equals minimum value of {1} and exclusive minimum is true.".FormatWith(CultureInfo.InvariantCulture, value, schema.Minimum), schema); } if (schema.DivisibleBy != null && !IsZero(value % schema.DivisibleBy.Value)) RaiseError("Integer {0} is not evenly divisible by {1}.".FormatWith(CultureInfo.InvariantCulture, JsonConvert.ToString(value), schema.DivisibleBy), schema); } private void ProcessValue() { if (_currentScope != null && _currentScope.TokenType == JTokenType.Array) { _currentScope.ArrayItemCount++; foreach (JsonSchemaModel currentSchema in CurrentSchemas) { if (currentSchema != null && currentSchema.Items != null && currentSchema.Items.Count > 1 && _currentScope.ArrayItemCount >= currentSchema.Items.Count) RaiseError("Index {0} has not been defined and the schema does not allow additional items.".FormatWith(CultureInfo.InvariantCulture, _currentScope.ArrayItemCount), currentSchema); } } } private void ValidateFloat(JsonSchemaModel schema) { if (schema == null) return; if (!TestType(schema, JsonSchemaType.Float)) return; ValidateInEnumAndNotDisallowed(schema); double value = Convert.ToDouble(_reader.Value, CultureInfo.InvariantCulture); if (schema.Maximum != null) { if (value > schema.Maximum) RaiseError("Float {0} exceeds maximum value of {1}.".FormatWith(CultureInfo.InvariantCulture, JsonConvert.ToString(value), schema.Maximum), schema); if (schema.ExclusiveMaximum && value == schema.Maximum) RaiseError("Float {0} equals maximum value of {1} and exclusive maximum is true.".FormatWith(CultureInfo.InvariantCulture, JsonConvert.ToString(value), schema.Maximum), schema); } if (schema.Minimum != null) { if (value < schema.Minimum) RaiseError("Float {0} is less than minimum value of {1}.".FormatWith(CultureInfo.InvariantCulture, JsonConvert.ToString(value), schema.Minimum), schema); if (schema.ExclusiveMinimum && value == schema.Minimum) RaiseError("Float {0} equals minimum value of {1} and exclusive minimum is true.".FormatWith(CultureInfo.InvariantCulture, JsonConvert.ToString(value), schema.Minimum), schema); } if (schema.DivisibleBy != null && !IsZero(value % schema.DivisibleBy.Value)) RaiseError("Float {0} is not evenly divisible by {1}.".FormatWith(CultureInfo.InvariantCulture, JsonConvert.ToString(value), schema.DivisibleBy), schema); } private static bool IsZero(double value) { const double epsilon = 2.2204460492503131e-016; return Math.Abs(value) < 10.0 * epsilon; } private void ValidatePropertyName(JsonSchemaModel schema) { if (schema == null) return; string propertyName = Convert.ToString(_reader.Value, CultureInfo.InvariantCulture); if (_currentScope.RequiredProperties.ContainsKey(propertyName)) _currentScope.RequiredProperties[propertyName] = true; if (!schema.AllowAdditionalProperties) { bool propertyDefinied = IsPropertyDefinied(schema, propertyName); if (!propertyDefinied) RaiseError("Property '{0}' has not been defined and the schema does not allow additional properties.".FormatWith(CultureInfo.InvariantCulture, propertyName), schema); } _currentScope.CurrentPropertyName = propertyName; } private bool IsPropertyDefinied(JsonSchemaModel schema, string propertyName) { if (schema.Properties != null && schema.Properties.ContainsKey(propertyName)) return true; if (schema.PatternProperties != null) { foreach (string pattern in schema.PatternProperties.Keys) { if (Regex.IsMatch(propertyName, pattern)) return true; } } return false; } private bool ValidateArray(JsonSchemaModel schema) { if (schema == null) return true; return (TestType(schema, JsonSchemaType.Array)); } private bool ValidateObject(JsonSchemaModel schema) { if (schema == null) return true; return (TestType(schema, JsonSchemaType.Object)); } private bool TestType(JsonSchemaModel currentSchema, JsonSchemaType currentType) { if (!JsonSchemaGenerator.HasFlag(currentSchema.Type, currentType)) { RaiseError("Invalid type. Expected {0} but got {1}.".FormatWith(CultureInfo.InvariantCulture, currentSchema.Type, currentType), currentSchema); return false; } return true; } bool IJsonLineInfo.HasLineInfo() { IJsonLineInfo lineInfo = _reader as IJsonLineInfo; return lineInfo != null && lineInfo.HasLineInfo(); } int IJsonLineInfo.LineNumber { get { IJsonLineInfo lineInfo = _reader as IJsonLineInfo; return (lineInfo != null) ? lineInfo.LineNumber : 0; } } int IJsonLineInfo.LinePosition { get { IJsonLineInfo lineInfo = _reader as IJsonLineInfo; return (lineInfo != null) ? lineInfo.LinePosition : 0; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/0000755000175000017500000000000012253423361025645 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/CachedAttributeGetter.cs0000644000175000017500000000334612253423361032410 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Reflection; using Newtonsoft.Json.Utilities; #if NETFX_CORE || PORTABLE using ICustomAttributeProvider = Newtonsoft.Json.Utilities.CustomAttributeProvider; #endif namespace Newtonsoft.Json.Serialization { internal static class CachedAttributeGetter where T : Attribute { private static readonly ThreadSafeStore TypeAttributeCache = new ThreadSafeStore(JsonTypeReflector.GetAttribute); public static T GetAttribute(ICustomAttributeProvider type) { return TypeAttributeCache.Get(type); } } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonLinqContract.cs0000644000175000017500000000327512253423361031436 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json.Serialization { /// /// Contract details for a used by the . /// public class JsonLinqContract : JsonContract { /// /// Initializes a new instance of the class. /// /// The underlying type for the contract. public JsonLinqContract(Type underlyingType) : base(underlyingType) { ContractType = JsonContractType.Linq; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs0000644000175000017500000020120212253423361033754 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) using System.ComponentModel; using System.Dynamic; #endif using System.Globalization; using System.Reflection; using System.Runtime.Serialization; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Utilities; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Serialization { internal class JsonSerializerInternalReader : JsonSerializerInternalBase { private JsonSerializerProxy _internalSerializer; #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) private JsonFormatterConverter _formatterConverter; #endif public JsonSerializerInternalReader(JsonSerializer serializer) : base(serializer) { } public void Populate(JsonReader reader, object target) { ValidationUtils.ArgumentNotNull(target, "target"); Type objectType = target.GetType(); JsonContract contract = Serializer.ContractResolver.ResolveContract(objectType); if (reader.TokenType == JsonToken.None) reader.Read(); if (reader.TokenType == JsonToken.StartArray) { if (contract.ContractType == JsonContractType.Array) PopulateList(CollectionUtils.CreateCollectionWrapper(target), reader, (JsonArrayContract) contract, null, null); else throw JsonSerializationException.Create(reader, "Cannot populate JSON array onto type '{0}'.".FormatWith(CultureInfo.InvariantCulture, objectType)); } else if (reader.TokenType == JsonToken.StartObject) { CheckedRead(reader); string id = null; if (reader.TokenType == JsonToken.PropertyName && string.Equals(reader.Value.ToString(), JsonTypeReflector.IdPropertyName, StringComparison.Ordinal)) { CheckedRead(reader); id = (reader.Value != null) ? reader.Value.ToString() : null; CheckedRead(reader); } if (contract.ContractType == JsonContractType.Dictionary) PopulateDictionary(CollectionUtils.CreateDictionaryWrapper(target), reader, (JsonDictionaryContract) contract, null, id); else if (contract.ContractType == JsonContractType.Object) PopulateObject(target, reader, (JsonObjectContract) contract, null, id); else throw JsonSerializationException.Create(reader, "Cannot populate JSON object onto type '{0}'.".FormatWith(CultureInfo.InvariantCulture, objectType)); } else { throw JsonSerializationException.Create(reader, "Unexpected initial token '{0}' when populating object. Expected JSON object or array.".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); } } private JsonContract GetContractSafe(Type type) { if (type == null) return null; return Serializer.ContractResolver.ResolveContract(type); } public object Deserialize(JsonReader reader, Type objectType, bool checkAdditionalContent) { if (reader == null) throw new ArgumentNullException("reader"); JsonContract contract = GetContractSafe(objectType); try { JsonConverter converter = GetConverter(contract, null, null, null); if (reader.TokenType == JsonToken.None && !ReadForType(reader, contract, converter != null)) { if (contract != null && !contract.IsNullable) throw JsonSerializationException.Create(reader, "No JSON content found and type '{0}' is not nullable.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)); return null; } object deserializedValue; if (converter != null && converter.CanRead) deserializedValue = converter.ReadJson(reader, objectType, null, GetInternalSerializer()); else deserializedValue = CreateValueInternal(reader, objectType, contract, null, null, null, null); if (checkAdditionalContent) { if (reader.Read() && reader.TokenType != JsonToken.Comment) throw new JsonSerializationException("Additional text found in JSON string after finishing deserializing object."); } return deserializedValue; } catch (Exception ex) { if (IsErrorHandled(null, contract, null, reader.Path, ex)) { HandleError(reader, false, 0); return null; } else { throw; } } } private JsonSerializerProxy GetInternalSerializer() { if (_internalSerializer == null) _internalSerializer = new JsonSerializerProxy(this); return _internalSerializer; } #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) private JsonFormatterConverter GetFormatterConverter() { if (_formatterConverter == null) _formatterConverter = new JsonFormatterConverter(GetInternalSerializer()); return _formatterConverter; } #endif private JToken CreateJToken(JsonReader reader, JsonContract contract) { ValidationUtils.ArgumentNotNull(reader, "reader"); if (contract != null && contract.UnderlyingType == typeof (JRaw)) { return JRaw.Create(reader); } else { JToken token; using (JTokenWriter writer = new JTokenWriter()) { writer.WriteToken(reader); token = writer.Token; } return token; } } private JToken CreateJObject(JsonReader reader) { ValidationUtils.ArgumentNotNull(reader, "reader"); // this is needed because we've already read inside the object, looking for special properties JToken token; using (JTokenWriter writer = new JTokenWriter()) { writer.WriteStartObject(); if (reader.TokenType == JsonToken.PropertyName) writer.WriteToken(reader, reader.Depth - 1); else writer.WriteEndObject(); token = writer.Token; } return token; } private object CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, object existingValue) { if (contract != null && contract.ContractType == JsonContractType.Linq) return CreateJToken(reader, contract); do { switch (reader.TokenType) { // populate a typed object or generic dictionary/array // depending upon whether an objectType was supplied case JsonToken.StartObject: return CreateObject(reader, objectType, contract, member, containerContract, containerMember, existingValue); case JsonToken.StartArray: return CreateList(reader, objectType, contract, member, existingValue, null); case JsonToken.Integer: case JsonToken.Float: case JsonToken.Boolean: case JsonToken.Date: case JsonToken.Bytes: return EnsureType(reader, reader.Value, CultureInfo.InvariantCulture, contract, objectType); case JsonToken.String: // convert empty string to null automatically for nullable types if (string.IsNullOrEmpty((string)reader.Value) && objectType != typeof(string) && objectType != typeof(object) && contract != null && contract.IsNullable) return null; // string that needs to be returned as a byte array should be base 64 decoded if (objectType == typeof (byte[])) return Convert.FromBase64String((string) reader.Value); return EnsureType(reader, reader.Value, CultureInfo.InvariantCulture, contract, objectType); case JsonToken.StartConstructor: string constructorName = reader.Value.ToString(); return EnsureType(reader, constructorName, CultureInfo.InvariantCulture, contract, objectType); case JsonToken.Null: case JsonToken.Undefined: #if !(NETFX_CORE || PORTABLE) if (objectType == typeof (DBNull)) return DBNull.Value; #endif return EnsureType(reader, reader.Value, CultureInfo.InvariantCulture, contract, objectType); case JsonToken.Raw: return new JRaw((string) reader.Value); case JsonToken.Comment: // ignore break; default: throw JsonSerializationException.Create(reader, "Unexpected token while deserializing object: " + reader.TokenType); } } while (reader.Read()); throw JsonSerializationException.Create(reader, "Unexpected end when deserializing object."); } internal string GetExpectedDescription(JsonContract contract) { switch (contract.ContractType) { case JsonContractType.Object: case JsonContractType.Dictionary: #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) case JsonContractType.Serializable: #endif #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) case JsonContractType.Dynamic: #endif return @"JSON object (e.g. {""name"":""value""})"; case JsonContractType.Array: return @"JSON array (e.g. [1,2,3])"; case JsonContractType.Primitive: return @"JSON primitive value (e.g. string, number, boolean, null)"; case JsonContractType.String: return @"JSON string value"; default: throw new ArgumentOutOfRangeException(); } } private JsonConverter GetConverter(JsonContract contract, JsonConverter memberConverter, JsonContainerContract containerContract, JsonProperty containerProperty) { JsonConverter converter = null; if (memberConverter != null) { // member attribute converter converter = memberConverter; } else if (containerProperty != null && containerProperty.ItemConverter != null) { converter = containerProperty.ItemConverter; } else if (containerContract != null && containerContract.ItemConverter != null) { converter = containerContract.ItemConverter; } else if (contract != null) { JsonConverter matchingConverter; if (contract.Converter != null) // class attribute converter converter = contract.Converter; else if ((matchingConverter = Serializer.GetMatchingConverter(contract.UnderlyingType)) != null) // passed in converters converter = matchingConverter; else if (contract.InternalConverter != null) // internally specified converter converter = contract.InternalConverter; } return converter; } private object CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, object existingValue) { CheckedRead(reader); string id; object newValue; if (ReadSpecialProperties(reader, ref objectType, ref contract, member, containerContract, containerMember, existingValue, out newValue, out id)) return newValue; if (!HasDefinedType(objectType)) return CreateJObject(reader); if (contract == null) throw JsonSerializationException.Create(reader, "Could not resolve type '{0}' to a JsonContract.".FormatWith(CultureInfo.InvariantCulture, objectType)); switch (contract.ContractType) { case JsonContractType.Object: bool createdFromNonDefaultConstructor = false; JsonObjectContract objectContract = (JsonObjectContract) contract; object targetObject; if (existingValue != null) targetObject = existingValue; else targetObject = CreateNewObject(reader, objectContract, member, containerMember, id, out createdFromNonDefaultConstructor); // don't populate if read from non-default constructor because the object has already been read if (createdFromNonDefaultConstructor) return targetObject; return PopulateObject(targetObject, reader, objectContract, member, id); case JsonContractType.Primitive: JsonPrimitiveContract primitiveContract = (JsonPrimitiveContract) contract; // if the content is inside $value then read past it if (reader.TokenType == JsonToken.PropertyName && string.Equals(reader.Value.ToString(), JsonTypeReflector.ValuePropertyName, StringComparison.Ordinal)) { CheckedRead(reader); object value = CreateValueInternal(reader, objectType, primitiveContract, member, null, null, existingValue); CheckedRead(reader); return value; } break; case JsonContractType.Dictionary: JsonDictionaryContract dictionaryContract = (JsonDictionaryContract) contract; object targetDictionary; if (existingValue != null) targetDictionary = existingValue; else targetDictionary = CreateNewDictionary(reader, dictionaryContract); return PopulateDictionary(dictionaryContract.CreateWrapper(targetDictionary), reader, dictionaryContract, member, id); #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) case JsonContractType.Dynamic: JsonDynamicContract dynamicContract = (JsonDynamicContract) contract; return CreateDynamic(reader, dynamicContract, member, id); #endif #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) case JsonContractType.Serializable: JsonISerializableContract serializableContract = (JsonISerializableContract) contract; return CreateISerializable(reader, serializableContract, id); #endif } throw JsonSerializationException.Create(reader, @"Cannot deserialize the current JSON object (e.g. {{""name"":""value""}}) into type '{0}' because the type requires a {1} to deserialize correctly. To fix this error either change the JSON to a {1} or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. ".FormatWith(CultureInfo.InvariantCulture, objectType, GetExpectedDescription(contract))); } private bool ReadSpecialProperties(JsonReader reader, ref Type objectType, ref JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, object existingValue, out object newValue, out string id) { id = null; newValue = null; if (reader.TokenType == JsonToken.PropertyName) { string propertyName = reader.Value.ToString(); if (propertyName.Length > 0 && propertyName[0] == '$') { // read 'special' properties // $type, $id, $ref, etc bool specialProperty; do { propertyName = reader.Value.ToString(); if (string.Equals(propertyName, JsonTypeReflector.RefPropertyName, StringComparison.Ordinal)) { CheckedRead(reader); if (reader.TokenType != JsonToken.String && reader.TokenType != JsonToken.Null) throw JsonSerializationException.Create(reader, "JSON reference {0} property must have a string or null value.".FormatWith(CultureInfo.InvariantCulture, JsonTypeReflector.RefPropertyName)); string reference = (reader.Value != null) ? reader.Value.ToString() : null; CheckedRead(reader); if (reference != null) { if (reader.TokenType == JsonToken.PropertyName) throw JsonSerializationException.Create(reader, "Additional content found in JSON reference object. A JSON reference object should only have a {0} property.".FormatWith(CultureInfo.InvariantCulture, JsonTypeReflector.RefPropertyName)); { newValue = Serializer.ReferenceResolver.ResolveReference(this, reference); return true; } } else { specialProperty = true; } } else if (string.Equals(propertyName, JsonTypeReflector.TypePropertyName, StringComparison.Ordinal)) { CheckedRead(reader); string qualifiedTypeName = reader.Value.ToString(); TypeNameHandling resolvedTypeNameHandling = ((member != null) ? member.TypeNameHandling : null) ?? ((containerContract != null) ? containerContract.ItemTypeNameHandling : null) ?? ((containerMember != null) ? containerMember.ItemTypeNameHandling : null) ?? Serializer.TypeNameHandling; if (resolvedTypeNameHandling != TypeNameHandling.None) { string typeName; string assemblyName; ReflectionUtils.SplitFullyQualifiedTypeName(qualifiedTypeName, out typeName, out assemblyName); Type specifiedType; try { specifiedType = Serializer.Binder.BindToType(assemblyName, typeName); } catch (Exception ex) { throw JsonSerializationException.Create(reader, "Error resolving type specified in JSON '{0}'.".FormatWith(CultureInfo.InvariantCulture, qualifiedTypeName), ex); } if (specifiedType == null) throw JsonSerializationException.Create(reader, "Type specified in JSON '{0}' was not resolved.".FormatWith(CultureInfo.InvariantCulture, qualifiedTypeName)); if (objectType != null #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) && objectType != typeof (IDynamicMetaObjectProvider) #endif && !objectType.IsAssignableFrom(specifiedType)) throw JsonSerializationException.Create(reader, "Type specified in JSON '{0}' is not compatible with '{1}'.".FormatWith(CultureInfo.InvariantCulture, specifiedType.AssemblyQualifiedName, objectType.AssemblyQualifiedName)); objectType = specifiedType; contract = GetContractSafe(specifiedType); } CheckedRead(reader); specialProperty = true; } else if (string.Equals(propertyName, JsonTypeReflector.IdPropertyName, StringComparison.Ordinal)) { CheckedRead(reader); id = (reader.Value != null) ? reader.Value.ToString() : null; CheckedRead(reader); specialProperty = true; } else if (string.Equals(propertyName, JsonTypeReflector.ArrayValuesPropertyName, StringComparison.Ordinal)) { CheckedRead(reader); object list = CreateList(reader, objectType, contract, member, existingValue, id); CheckedRead(reader); newValue = list; return true; } else { specialProperty = false; } } while (specialProperty && reader.TokenType == JsonToken.PropertyName); } } return false; } private JsonArrayContract EnsureArrayContract(JsonReader reader, Type objectType, JsonContract contract) { if (contract == null) throw JsonSerializationException.Create(reader, "Could not resolve type '{0}' to a JsonContract.".FormatWith(CultureInfo.InvariantCulture, objectType)); JsonArrayContract arrayContract = contract as JsonArrayContract; if (arrayContract == null) throw JsonSerializationException.Create(reader, @"Cannot deserialize the current JSON array (e.g. [1,2,3]) into type '{0}' because the type requires a {1} to deserialize correctly. To fix this error either change the JSON to a {1} or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array. ".FormatWith(CultureInfo.InvariantCulture, objectType, GetExpectedDescription(contract))); return arrayContract; } private void CheckedRead(JsonReader reader) { if (!reader.Read()) throw JsonSerializationException.Create(reader, "Unexpected end when deserializing object."); } private object CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, object existingValue, string id) { object value; if (HasDefinedType(objectType)) { JsonArrayContract arrayContract = EnsureArrayContract(reader, objectType, contract); if (existingValue == null) { bool isTemporaryListReference; IList list = CollectionUtils.CreateList(contract.CreatedType, out isTemporaryListReference); if (id != null && isTemporaryListReference) throw JsonSerializationException.Create(reader, "Cannot preserve reference to array or readonly list: {0}.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)); #if !PocketPC if (contract.OnSerializing != null && isTemporaryListReference) throw JsonSerializationException.Create(reader, "Cannot call OnSerializing on an array or readonly list: {0}.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)); #endif if (contract.OnError != null && isTemporaryListReference) throw JsonSerializationException.Create(reader, "Cannot call OnError on an array or readonly list: {0}.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)); if (!arrayContract.IsMultidimensionalArray) PopulateList(arrayContract.CreateWrapper(list), reader, arrayContract, member, id); else PopulateMultidimensionalArray(list, reader, arrayContract, member, id); // create readonly and fixed sized collections using the temporary list if (isTemporaryListReference) { if (arrayContract.IsMultidimensionalArray) { list = CollectionUtils.ToMultidimensionalArray(list, ReflectionUtils.GetCollectionItemType(contract.CreatedType), contract.CreatedType.GetArrayRank()); } else if (contract.CreatedType.IsArray) { list = CollectionUtils.ToArray(((List) list).ToArray(), ReflectionUtils.GetCollectionItemType(contract.CreatedType)); } else if (ReflectionUtils.InheritsGenericDefinition(contract.CreatedType, typeof(ReadOnlyCollection<>))) { list = (IList) ReflectionUtils.CreateInstance(contract.CreatedType, list); } } else if (list is IWrappedCollection) { return ((IWrappedCollection)list).UnderlyingCollection; } value = list; } else { value = PopulateList(arrayContract.CreateWrapper(existingValue), reader, arrayContract, member, id); } } else { value = CreateJToken(reader, contract); } return value; } private bool HasDefinedType(Type type) { return (type != null && type != typeof (object) && !typeof (JToken).IsSubclassOf(type) #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) && type != typeof (IDynamicMetaObjectProvider) #endif ); } private object EnsureType(JsonReader reader, object value, CultureInfo culture, JsonContract contract, Type targetType) { if (targetType == null) return value; Type valueType = ReflectionUtils.GetObjectType(value); // type of value and type of target don't match // attempt to convert value's type to target's type if (valueType != targetType) { try { if (value == null && contract.IsNullable) return null; if (contract.IsConvertable) { if (contract.NonNullableUnderlyingType.IsEnum()) { if (value is string) return Enum.Parse(contract.NonNullableUnderlyingType, value.ToString(), true); else if (ConvertUtils.IsInteger(value)) return Enum.ToObject(contract.NonNullableUnderlyingType, value); } return Convert.ChangeType(value, contract.NonNullableUnderlyingType, culture); } return ConvertUtils.ConvertOrCast(value, culture, contract.NonNullableUnderlyingType); } catch (Exception ex) { throw JsonSerializationException.Create(reader, "Error converting value {0} to type '{1}'.".FormatWith(CultureInfo.InvariantCulture, FormatValueForPrint(value), targetType), ex); } } return value; } private string FormatValueForPrint(object value) { if (value == null) return "{null}"; if (value is string) return @"""" + value + @""""; return value.ToString(); } private void SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, object target) { object currentValue; bool useExistingValue; JsonContract propertyContract; bool gottenCurrentValue; if (CalculatePropertyDetails(property, ref propertyConverter, containerContract, containerProperty, reader, target, out useExistingValue, out currentValue, out propertyContract, out gottenCurrentValue)) return; object value; if (propertyConverter != null && propertyConverter.CanRead) { if (!gottenCurrentValue && target != null && property.Readable) currentValue = property.ValueProvider.GetValue(target); value = propertyConverter.ReadJson(reader, property.PropertyType, currentValue, GetInternalSerializer()); } else { value = CreateValueInternal(reader, property.PropertyType, propertyContract, property, containerContract, containerProperty, (useExistingValue) ? currentValue : null); } // always set the value if useExistingValue is false, // otherwise also set it if CreateValue returns a new value compared to the currentValue // this could happen because of a JsonConverter against the type if ((!useExistingValue || value != currentValue) && ShouldSetPropertyValue(property, value)) { property.ValueProvider.SetValue(target, value); if (property.SetIsSpecified != null) property.SetIsSpecified(target, true); } } private bool CalculatePropertyDetails(JsonProperty property, ref JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, object target, out bool useExistingValue, out object currentValue, out JsonContract propertyContract, out bool gottenCurrentValue) { currentValue = null; useExistingValue = false; propertyContract = null; gottenCurrentValue = false; if (property.Ignored) { reader.Skip(); return true; } ObjectCreationHandling objectCreationHandling = property.ObjectCreationHandling.GetValueOrDefault(Serializer.ObjectCreationHandling); if ((objectCreationHandling == ObjectCreationHandling.Auto || objectCreationHandling == ObjectCreationHandling.Reuse) && (reader.TokenType == JsonToken.StartArray || reader.TokenType == JsonToken.StartObject) && property.Readable) { currentValue = property.ValueProvider.GetValue(target); gottenCurrentValue = true; useExistingValue = (currentValue != null && !property.PropertyType.IsArray && !ReflectionUtils.InheritsGenericDefinition(property.PropertyType, typeof (ReadOnlyCollection<>)) && !property.PropertyType.IsValueType()); } if (!property.Writable && !useExistingValue) { reader.Skip(); return true; } // test tokentype here because null might not be convertable to some types, e.g. ignoring null when applied to DateTime if (property.NullValueHandling.GetValueOrDefault(Serializer.NullValueHandling) == NullValueHandling.Ignore && reader.TokenType == JsonToken.Null) { reader.Skip(); return true; } // test tokentype here because default value might not be convertable to actual type, e.g. default of "" for DateTime if (HasFlag(property.DefaultValueHandling.GetValueOrDefault(Serializer.DefaultValueHandling), DefaultValueHandling.Ignore) && JsonReader.IsPrimitiveToken(reader.TokenType) && MiscellaneousUtils.ValueEquals(reader.Value, property.DefaultValue)) { reader.Skip(); return true; } if (property.PropertyContract == null) property.PropertyContract = GetContractSafe(property.PropertyType); if (currentValue == null) { propertyContract = property.PropertyContract; } else { propertyContract = GetContractSafe(currentValue.GetType()); if (propertyContract != property.PropertyContract) propertyConverter = GetConverter(propertyContract, property.MemberConverter, containerContract, containerProperty); } return false; } private bool HasFlag(DefaultValueHandling value, DefaultValueHandling flag) { return ((value & flag) == flag); } private bool ShouldSetPropertyValue(JsonProperty property, object value) { if (property.NullValueHandling.GetValueOrDefault(Serializer.NullValueHandling) == NullValueHandling.Ignore && value == null) return false; if (HasFlag(property.DefaultValueHandling.GetValueOrDefault(Serializer.DefaultValueHandling), DefaultValueHandling.Ignore) && MiscellaneousUtils.ValueEquals(value, property.DefaultValue)) return false; if (!property.Writable) return false; return true; } public object CreateNewDictionary(JsonReader reader, JsonDictionaryContract contract) { object dictionary; if (contract.DefaultCreator != null && (!contract.DefaultCreatorNonPublic || Serializer.ConstructorHandling == ConstructorHandling.AllowNonPublicDefaultConstructor)) dictionary = contract.DefaultCreator(); else throw JsonSerializationException.Create(reader, "Unable to find a default constructor to use for type {0}.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)); return dictionary; } private object PopulateDictionary(IWrappedDictionary wrappedDictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, string id) { object dictionary = wrappedDictionary.UnderlyingDictionary; if (id != null) Serializer.ReferenceResolver.AddReference(this, id, dictionary); contract.InvokeOnDeserializing(dictionary, Serializer.Context); int initialDepth = reader.Depth; if (contract.KeyContract == null) contract.KeyContract = GetContractSafe(contract.DictionaryKeyType); if (contract.ItemContract == null) contract.ItemContract = GetContractSafe(contract.DictionaryValueType); JsonConverter dictionaryValueConverter = contract.ItemConverter ?? GetConverter(contract.ItemContract, null, contract, containerProperty); bool finished = false; do { switch (reader.TokenType) { case JsonToken.PropertyName: object keyValue = reader.Value; try { try { keyValue = EnsureType(reader, keyValue, CultureInfo.InvariantCulture, contract.KeyContract, contract.DictionaryKeyType); } catch (Exception ex) { throw JsonSerializationException.Create(reader, "Could not convert string '{0}' to dictionary key type '{1}'. Create a TypeConverter to convert from the string to the key type object.".FormatWith(CultureInfo.InvariantCulture, reader.Value, contract.DictionaryKeyType), ex); } if (!ReadForType(reader, contract.ItemContract, dictionaryValueConverter != null)) throw JsonSerializationException.Create(reader, "Unexpected end when deserializing object."); object itemValue; if (dictionaryValueConverter != null && dictionaryValueConverter.CanRead) itemValue = dictionaryValueConverter.ReadJson(reader, contract.DictionaryValueType, null, GetInternalSerializer()); else itemValue = CreateValueInternal(reader, contract.DictionaryValueType, contract.ItemContract, null, contract, containerProperty, null); wrappedDictionary[keyValue] = itemValue; } catch (Exception ex) { if (IsErrorHandled(dictionary, contract, keyValue, reader.Path, ex)) HandleError(reader, true, initialDepth); else throw; } break; case JsonToken.Comment: break; case JsonToken.EndObject: finished = true; break; default: throw JsonSerializationException.Create(reader, "Unexpected token when deserializing object: " + reader.TokenType); } } while (!finished && reader.Read()); if (!finished) ThrowUnexpectedEndException(reader, contract, dictionary, "Unexpected end when deserializing object."); contract.InvokeOnDeserialized(dictionary, Serializer.Context); return dictionary; } private object PopulateMultidimensionalArray(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, string id) { int rank = contract.UnderlyingType.GetArrayRank(); if (id != null) Serializer.ReferenceResolver.AddReference(this, id, list); contract.InvokeOnDeserializing(list, Serializer.Context); JsonContract collectionItemContract = GetContractSafe(contract.CollectionItemType); JsonConverter collectionItemConverter = GetConverter(collectionItemContract, null, contract, containerProperty); int? previousErrorIndex = null; Stack listStack = new Stack(); listStack.Push(list); IList currentList = list; bool finished = false; do { int initialDepth = reader.Depth; if (listStack.Count == rank) { try { if (ReadForType(reader, collectionItemContract, collectionItemConverter != null)) { switch (reader.TokenType) { case JsonToken.EndArray: listStack.Pop(); currentList = listStack.Peek(); previousErrorIndex = null; break; case JsonToken.Comment: break; default: object value; if (collectionItemConverter != null && collectionItemConverter.CanRead) value = collectionItemConverter.ReadJson(reader, contract.CollectionItemType, null, GetInternalSerializer()); else value = CreateValueInternal(reader, contract.CollectionItemType, collectionItemContract, null, contract, containerProperty, null); currentList.Add(value); break; } } else { break; } } catch (Exception ex) { JsonPosition errorPosition = reader.GetPosition(initialDepth); if (IsErrorHandled(list, contract, errorPosition.Position, reader.Path, ex)) { HandleError(reader, true, initialDepth); if (previousErrorIndex != null && previousErrorIndex == errorPosition.Position) { // reader index has not moved since previous error handling // break out of reading array to prevent infinite loop throw JsonSerializationException.Create(reader, "Infinite loop detected from error handling.", ex); } else { previousErrorIndex = errorPosition.Position; } } else { throw; } } } else { if (reader.Read()) { switch (reader.TokenType) { case JsonToken.StartArray: IList newList = new List(); currentList.Add(newList); listStack.Push(newList); currentList = newList; break; case JsonToken.EndArray: listStack.Pop(); if (listStack.Count > 0) { currentList = listStack.Peek(); } else { finished = true; } break; case JsonToken.Comment: break; default: throw JsonSerializationException.Create(reader, "Unexpected token when deserializing multidimensional array: " + reader.TokenType); } } else { break; } } } while (!finished); if (!finished) ThrowUnexpectedEndException(reader, contract, list, "Unexpected end when deserializing array."); contract.InvokeOnDeserialized(list, Serializer.Context); return list; } private void ThrowUnexpectedEndException(JsonReader reader, JsonContract contract, object currentObject, string message) { try { throw JsonSerializationException.Create(reader, message); } catch (Exception ex) { if (IsErrorHandled(currentObject, contract, null, reader.Path, ex)) HandleError(reader, false, 0); else throw; } } private object PopulateList(IWrappedCollection wrappedList, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, string id) { object list = wrappedList.UnderlyingCollection; if (id != null) Serializer.ReferenceResolver.AddReference(this, id, list); // can't populate an existing array if (wrappedList.IsFixedSize) { reader.Skip(); return list; } contract.InvokeOnDeserializing(list, Serializer.Context); int initialDepth = reader.Depth; JsonContract collectionItemContract = GetContractSafe(contract.CollectionItemType); JsonConverter collectionItemConverter = GetConverter(collectionItemContract, null, contract, containerProperty); int? previousErrorIndex = null; bool finished = false; do { try { if (ReadForType(reader, collectionItemContract, collectionItemConverter != null)) { switch (reader.TokenType) { case JsonToken.EndArray: finished = true; break; case JsonToken.Comment: break; default: object value; if (collectionItemConverter != null && collectionItemConverter.CanRead) value = collectionItemConverter.ReadJson(reader, contract.CollectionItemType, null, GetInternalSerializer()); else value = CreateValueInternal(reader, contract.CollectionItemType, collectionItemContract, null, contract, containerProperty, null); wrappedList.Add(value); break; } } else { break; } } catch (Exception ex) { JsonPosition errorPosition = reader.GetPosition(initialDepth); if (IsErrorHandled(list, contract, errorPosition.Position, reader.Path, ex)) { HandleError(reader, true, initialDepth); if (previousErrorIndex != null && previousErrorIndex == errorPosition.Position) { // reader index has not moved since previous error handling // break out of reading array to prevent infinite loop throw JsonSerializationException.Create(reader, "Infinite loop detected from error handling.", ex); } else { previousErrorIndex = errorPosition.Position; } } else { throw; } } } while (!finished); if (!finished) ThrowUnexpectedEndException(reader, contract, list, "Unexpected end when deserializing array."); contract.InvokeOnDeserialized(list, Serializer.Context); return list; } #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) private object CreateISerializable(JsonReader reader, JsonISerializableContract contract, string id) { Type objectType = contract.UnderlyingType; if (!JsonTypeReflector.FullyTrusted) { throw JsonSerializationException.Create(reader, @"Type '{0}' implements ISerializable but cannot be deserialized using the ISerializable interface because the current application is not fully trusted and ISerializable can expose secure data. To fix this error either change the environment to be fully trusted, change the application to not deserialize the type, add JsonObjectAttribute to the type or change the JsonSerializer setting ContractResolver to use a new DefaultContractResolver with IgnoreSerializableInterface set to true. ".FormatWith(CultureInfo.InvariantCulture, objectType)); } SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, GetFormatterConverter()); bool finished = false; do { switch (reader.TokenType) { case JsonToken.PropertyName: string memberName = reader.Value.ToString(); if (!reader.Read()) throw JsonSerializationException.Create(reader, "Unexpected end when setting {0}'s value.".FormatWith(CultureInfo.InvariantCulture, memberName)); serializationInfo.AddValue(memberName, JToken.ReadFrom(reader)); break; case JsonToken.Comment: break; case JsonToken.EndObject: finished = true; break; default: throw JsonSerializationException.Create(reader, "Unexpected token when deserializing object: " + reader.TokenType); } } while (!finished && reader.Read()); if (!finished) ThrowUnexpectedEndException(reader, contract, serializationInfo, "Unexpected end when deserializing object."); if (contract.ISerializableCreator == null) throw JsonSerializationException.Create(reader, "ISerializable type '{0}' does not have a valid constructor. To correctly implement ISerializable a constructor that takes SerializationInfo and StreamingContext parameters should be present.".FormatWith(CultureInfo.InvariantCulture, objectType)); object createdObject = contract.ISerializableCreator(serializationInfo, Serializer.Context); if (id != null) Serializer.ReferenceResolver.AddReference(this, id, createdObject); // these are together because OnDeserializing takes an object but for an ISerializable the object is fully created in the constructor contract.InvokeOnDeserializing(createdObject, Serializer.Context); contract.InvokeOnDeserialized(createdObject, Serializer.Context); return createdObject; } #endif #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) private object CreateDynamic(JsonReader reader, JsonDynamicContract contract, JsonProperty member, string id) { IDynamicMetaObjectProvider newObject; if (contract.UnderlyingType.IsInterface() || contract.UnderlyingType.IsAbstract()) throw JsonSerializationException.Create(reader, "Could not create an instance of type {0}. Type is an interface or abstract class and cannot be instantated.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)); if (contract.DefaultCreator != null && (!contract.DefaultCreatorNonPublic || Serializer.ConstructorHandling == ConstructorHandling.AllowNonPublicDefaultConstructor)) newObject = (IDynamicMetaObjectProvider) contract.DefaultCreator(); else throw JsonSerializationException.Create(reader, "Unable to find a default constructor to use for type {0}.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)); if (id != null) Serializer.ReferenceResolver.AddReference(this, id, newObject); contract.InvokeOnDeserializing(newObject, Serializer.Context); int initialDepth = reader.Depth; bool finished = false; do { switch (reader.TokenType) { case JsonToken.PropertyName: string memberName = reader.Value.ToString(); try { if (!reader.Read()) throw JsonSerializationException.Create(reader, "Unexpected end when setting {0}'s value.".FormatWith(CultureInfo.InvariantCulture, memberName)); // first attempt to find a settable property, otherwise fall back to a dynamic set without type JsonProperty property = contract.Properties.GetClosestMatchProperty(memberName); if (property != null && property.Writable && !property.Ignored) { if (property.PropertyContract == null) property.PropertyContract = GetContractSafe(property.PropertyType); JsonConverter propertyConverter = GetConverter(property.PropertyContract, property.MemberConverter, null, null); SetPropertyValue(property, propertyConverter, null, member, reader, newObject); } else { Type t = (JsonReader.IsPrimitiveToken(reader.TokenType)) ? reader.ValueType : typeof (IDynamicMetaObjectProvider); JsonContract dynamicMemberContract = GetContractSafe(t); JsonConverter dynamicMemberConverter = GetConverter(dynamicMemberContract, null, null, member); object value; if (dynamicMemberConverter != null && dynamicMemberConverter.CanRead) value = dynamicMemberConverter.ReadJson(reader, t, null, GetInternalSerializer()); else value = CreateValueInternal(reader, t, dynamicMemberContract, null, null, member, null); newObject.TrySetMember(memberName, value); } } catch (Exception ex) { if (IsErrorHandled(newObject, contract, memberName, reader.Path, ex)) HandleError(reader, true, initialDepth); else throw; } break; case JsonToken.EndObject: finished = true; break; default: throw JsonSerializationException.Create(reader, "Unexpected token when deserializing object: " + reader.TokenType); } } while (!finished && reader.Read()); if (!finished) ThrowUnexpectedEndException(reader, contract, newObject, "Unexpected end when deserializing object."); contract.InvokeOnDeserialized(newObject, Serializer.Context); return newObject; } #endif private object CreateObjectFromNonDefaultConstructor(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ConstructorInfo constructorInfo, string id) { ValidationUtils.ArgumentNotNull(constructorInfo, "constructorInfo"); Type objectType = contract.UnderlyingType; IDictionary propertyValues = ResolvePropertyAndConstructorValues(contract, containerProperty, reader, objectType); IDictionary constructorParameters = constructorInfo.GetParameters().ToDictionary(p => p, p => (object) null); IDictionary remainingPropertyValues = new Dictionary(); foreach (KeyValuePair propertyValue in propertyValues) { ParameterInfo matchingConstructorParameter = constructorParameters.ForgivingCaseSensitiveFind(kv => kv.Key.Name, propertyValue.Key.UnderlyingName).Key; if (matchingConstructorParameter != null) constructorParameters[matchingConstructorParameter] = propertyValue.Value; else remainingPropertyValues.Add(propertyValue); } object createdObject = constructorInfo.Invoke(constructorParameters.Values.ToArray()); if (id != null) Serializer.ReferenceResolver.AddReference(this, id, createdObject); contract.InvokeOnDeserializing(createdObject, Serializer.Context); // go through unused values and set the newly created object's properties foreach (KeyValuePair remainingPropertyValue in remainingPropertyValues) { JsonProperty property = remainingPropertyValue.Key; object value = remainingPropertyValue.Value; if (ShouldSetPropertyValue(remainingPropertyValue.Key, remainingPropertyValue.Value)) { property.ValueProvider.SetValue(createdObject, value); } else if (!property.Writable && value != null) { // handle readonly collection/dictionary properties JsonContract propertyContract = Serializer.ContractResolver.ResolveContract(property.PropertyType); if (propertyContract.ContractType == JsonContractType.Array) { JsonArrayContract propertyArrayContract = (JsonArrayContract)propertyContract; object createdObjectCollection = property.ValueProvider.GetValue(createdObject); if (createdObjectCollection != null) { IWrappedCollection createdObjectCollectionWrapper = propertyArrayContract.CreateWrapper(createdObjectCollection); IWrappedCollection newValues = propertyArrayContract.CreateWrapper(value); foreach (object newValue in newValues) { createdObjectCollectionWrapper.Add(newValue); } } } else if (propertyContract.ContractType == JsonContractType.Dictionary) { JsonDictionaryContract jsonDictionaryContract = (JsonDictionaryContract)propertyContract; object createdObjectDictionary = property.ValueProvider.GetValue(createdObject); if (createdObjectDictionary != null) { IWrappedDictionary createdObjectDictionaryWrapper = jsonDictionaryContract.CreateWrapper(createdObjectDictionary); IWrappedDictionary newValues = jsonDictionaryContract.CreateWrapper(value); foreach (DictionaryEntry newValue in newValues) { createdObjectDictionaryWrapper.Add(newValue.Key, newValue.Value); } } } } } contract.InvokeOnDeserialized(createdObject, Serializer.Context); return createdObject; } private IDictionary ResolvePropertyAndConstructorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType) { IDictionary propertyValues = new Dictionary(); bool exit = false; do { switch (reader.TokenType) { case JsonToken.PropertyName: string memberName = reader.Value.ToString(); // attempt exact case match first // then try match ignoring case JsonProperty property = contract.ConstructorParameters.GetClosestMatchProperty(memberName) ?? contract.Properties.GetClosestMatchProperty(memberName); if (property != null) { if (property.PropertyContract == null) property.PropertyContract = GetContractSafe(property.PropertyType); JsonConverter propertyConverter = GetConverter(property.PropertyContract, property.MemberConverter, contract, containerProperty); if (!ReadForType(reader, property.PropertyContract, propertyConverter != null)) throw JsonSerializationException.Create(reader, "Unexpected end when setting {0}'s value.".FormatWith(CultureInfo.InvariantCulture, memberName)); if (!property.Ignored) { if (property.PropertyContract == null) property.PropertyContract = GetContractSafe(property.PropertyType); object propertyValue; if (propertyConverter != null && propertyConverter.CanRead) propertyValue = propertyConverter.ReadJson(reader, property.PropertyType, null, GetInternalSerializer()); else propertyValue = CreateValueInternal(reader, property.PropertyType, property.PropertyContract, property, contract, containerProperty, null); propertyValues[property] = propertyValue; } else { reader.Skip(); } } else { if (!reader.Read()) throw JsonSerializationException.Create(reader, "Unexpected end when setting {0}'s value.".FormatWith(CultureInfo.InvariantCulture, memberName)); if (Serializer.MissingMemberHandling == MissingMemberHandling.Error) throw JsonSerializationException.Create(reader, "Could not find member '{0}' on object of type '{1}'".FormatWith(CultureInfo.InvariantCulture, memberName, objectType.Name)); reader.Skip(); } break; case JsonToken.Comment: break; case JsonToken.EndObject: exit = true; break; default: throw JsonSerializationException.Create(reader, "Unexpected token when deserializing object: " + reader.TokenType); } } while (!exit && reader.Read()); return propertyValues; } private bool ReadForType(JsonReader reader, JsonContract contract, bool hasConverter) { // don't read properties with converters as a specific value // the value might be a string which will then get converted which will error if read as date for example if (hasConverter) return reader.Read(); ReadType t = (contract != null) ? contract.InternalReadType : ReadType.Read; switch (t) { case ReadType.Read: do { if (!reader.Read()) return false; } while (reader.TokenType == JsonToken.Comment); return true; case ReadType.ReadAsInt32: reader.ReadAsInt32(); break; case ReadType.ReadAsDecimal: reader.ReadAsDecimal(); break; case ReadType.ReadAsBytes: reader.ReadAsBytes(); break; case ReadType.ReadAsString: reader.ReadAsString(); break; case ReadType.ReadAsDateTime: reader.ReadAsDateTime(); break; #if !NET20 case ReadType.ReadAsDateTimeOffset: reader.ReadAsDateTimeOffset(); break; #endif default: throw new ArgumentOutOfRangeException(); } return (reader.TokenType != JsonToken.None); } public object CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, string id, out bool createdFromNonDefaultConstructor) { object newObject = null; if (objectContract.UnderlyingType.IsInterface() || objectContract.UnderlyingType.IsAbstract()) throw JsonSerializationException.Create(reader, "Could not create an instance of type {0}. Type is an interface or abstract class and cannot be instantated.".FormatWith(CultureInfo.InvariantCulture, objectContract.UnderlyingType)); if (objectContract.OverrideConstructor != null) { if (objectContract.OverrideConstructor.GetParameters().Length > 0) { createdFromNonDefaultConstructor = true; return CreateObjectFromNonDefaultConstructor(reader, objectContract, containerMember, objectContract.OverrideConstructor, id); } newObject = objectContract.OverrideConstructor.Invoke(null); } else if (objectContract.DefaultCreator != null && (!objectContract.DefaultCreatorNonPublic || Serializer.ConstructorHandling == ConstructorHandling.AllowNonPublicDefaultConstructor || objectContract.ParametrizedConstructor == null)) { // use the default constructor if it is... // public // non-public and the user has change constructor handling settings // non-public and there is no other constructor newObject = objectContract.DefaultCreator(); } else if (objectContract.ParametrizedConstructor != null) { createdFromNonDefaultConstructor = true; return CreateObjectFromNonDefaultConstructor(reader, objectContract, containerMember, objectContract.ParametrizedConstructor, id); } if (newObject == null) throw JsonSerializationException.Create(reader, "Unable to find a constructor to use for type {0}. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute.".FormatWith(CultureInfo.InvariantCulture, objectContract.UnderlyingType)); createdFromNonDefaultConstructor = false; return newObject; } private object PopulateObject(object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, string id) { contract.InvokeOnDeserializing(newObject, Serializer.Context); // only need to keep a track of properies presence if they are required or a value should be defaulted if missing Dictionary propertiesPresence = (contract.HasRequiredOrDefaultValueProperties || HasFlag(Serializer.DefaultValueHandling, DefaultValueHandling.Populate)) ? contract.Properties.ToDictionary(m => m, m => PropertyPresence.None) : null; if (id != null) Serializer.ReferenceResolver.AddReference(this, id, newObject); int initialDepth = reader.Depth; bool finished = false; do { switch (reader.TokenType) { case JsonToken.PropertyName: { string memberName = reader.Value.ToString(); try { // attempt exact case match first // then try match ignoring case JsonProperty property = contract.Properties.GetClosestMatchProperty(memberName); if (property == null) { if (Serializer.MissingMemberHandling == MissingMemberHandling.Error) throw JsonSerializationException.Create(reader, "Could not find member '{0}' on object of type '{1}'".FormatWith(CultureInfo.InvariantCulture, memberName, contract.UnderlyingType.Name)); reader.Skip(); continue; } if (property.PropertyContract == null) property.PropertyContract = GetContractSafe(property.PropertyType); JsonConverter propertyConverter = GetConverter(property.PropertyContract, property.MemberConverter, contract, member); if (!ReadForType(reader, property.PropertyContract, propertyConverter != null)) throw JsonSerializationException.Create(reader, "Unexpected end when setting {0}'s value.".FormatWith(CultureInfo.InvariantCulture, memberName)); SetPropertyPresence(reader, property, propertiesPresence); SetPropertyValue(property, propertyConverter, contract, member, reader, newObject); } catch (Exception ex) { if (IsErrorHandled(newObject, contract, memberName, reader.Path, ex)) HandleError(reader, true, initialDepth); else throw; } } break; case JsonToken.EndObject: finished = true; break; case JsonToken.Comment: // ignore break; default: throw JsonSerializationException.Create(reader, "Unexpected token when deserializing object: " + reader.TokenType); } } while (!finished && reader.Read()); if (!finished) ThrowUnexpectedEndException(reader, contract, newObject, "Unexpected end when deserializing object."); EndObject(newObject, reader, contract, initialDepth, propertiesPresence); contract.InvokeOnDeserialized(newObject, Serializer.Context); return newObject; } private void EndObject(object newObject, JsonReader reader, JsonObjectContract contract, int initialDepth, Dictionary propertiesPresence) { if (propertiesPresence != null) { foreach (KeyValuePair propertyPresence in propertiesPresence) { JsonProperty property = propertyPresence.Key; PropertyPresence presence = propertyPresence.Value; if (presence == PropertyPresence.None || presence == PropertyPresence.Null) { try { Required resolvedRequired = property._required ?? contract.ItemRequired ?? Required.Default; switch (presence) { case PropertyPresence.None: if (resolvedRequired == Required.AllowNull || resolvedRequired == Required.Always) throw JsonSerializationException.Create(reader, "Required property '{0}' not found in JSON.".FormatWith(CultureInfo.InvariantCulture, property.PropertyName)); if (property.PropertyContract == null) property.PropertyContract = GetContractSafe(property.PropertyType); if (HasFlag(property.DefaultValueHandling.GetValueOrDefault(Serializer.DefaultValueHandling), DefaultValueHandling.Populate) && property.Writable) property.ValueProvider.SetValue(newObject, EnsureType(reader, property.DefaultValue, CultureInfo.InvariantCulture, property.PropertyContract, property.PropertyType)); break; case PropertyPresence.Null: if (resolvedRequired == Required.Always) throw JsonSerializationException.Create(reader, "Required property '{0}' expects a value but got null.".FormatWith(CultureInfo.InvariantCulture, property.PropertyName)); break; } } catch (Exception ex) { if (IsErrorHandled(newObject, contract, property.PropertyName, reader.Path, ex)) HandleError(reader, true, initialDepth); else throw; } } } } } private void SetPropertyPresence(JsonReader reader, JsonProperty property, Dictionary requiredProperties) { if (property != null && requiredProperties != null) { requiredProperties[property] = (reader.TokenType == JsonToken.Null || reader.TokenType == JsonToken.Undefined) ? PropertyPresence.Null : PropertyPresence.Value; } } private void HandleError(JsonReader reader, bool readPastError, int initialDepth) { ClearErrorContext(); if (readPastError) { reader.Skip(); while (reader.Depth > (initialDepth + 1)) { if (!reader.Read()) break; } } } internal enum PropertyPresence { None, Null, Value } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonPrimitiveContract.cs0000644000175000017500000000331612253423361032477 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json.Serialization { /// /// Contract details for a used by the . /// public class JsonPrimitiveContract : JsonContract { /// /// Initializes a new instance of the class. /// /// The underlying type for the contract. public JsonPrimitiveContract(Type underlyingType) : base(underlyingType) { ContractType = JsonContractType.Primitive; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs0000644000175000017500000003537012253423361031625 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.ComponentModel; using System.Globalization; using System.Reflection; #if !(NETFX_CORE || PORTABLE) using System.Security.Permissions; #endif using Newtonsoft.Json.Utilities; #if NETFX_CORE || PORTABLE using ICustomAttributeProvider = Newtonsoft.Json.Utilities.CustomAttributeProvider; #endif #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif using System.Runtime.Serialization; namespace Newtonsoft.Json.Serialization { #if !SILVERLIGHT && !PocketPC && !NET20 && !NETFX_CORE internal interface IMetadataTypeAttribute { Type MetadataClassType { get; } } #endif internal static class JsonTypeReflector { public const string IdPropertyName = "$id"; public const string RefPropertyName = "$ref"; public const string TypePropertyName = "$type"; public const string ValuePropertyName = "$value"; public const string ArrayValuesPropertyName = "$values"; public const string ShouldSerializePrefix = "ShouldSerialize"; public const string SpecifiedPostfix = "Specified"; private static readonly ThreadSafeStore JsonConverterTypeCache = new ThreadSafeStore(GetJsonConverterTypeFromAttribute); #if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE) private static readonly ThreadSafeStore AssociatedMetadataTypesCache = new ThreadSafeStore(GetAssociateMetadataTypeFromAttribute); private const string MetadataTypeAttributeTypeName = "System.ComponentModel.DataAnnotations.MetadataTypeAttribute, System.ComponentModel.DataAnnotations, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; private static Type _cachedMetadataTypeAttributeType; #endif #if SILVERLIGHT private static readonly ThreadSafeStore TypeConverterTypeCache = new ThreadSafeStore(GetTypeConverterTypeFromAttribute); private static Type GetTypeConverterTypeFromAttribute(ICustomAttributeProvider attributeProvider) { TypeConverterAttribute converterAttribute = GetAttribute(attributeProvider); if (converterAttribute == null) return null; return Type.GetType(converterAttribute.ConverterTypeName); } private static Type GetTypeConverterType(ICustomAttributeProvider attributeProvider) { return TypeConverterTypeCache.Get(attributeProvider); } #endif public static JsonContainerAttribute GetJsonContainerAttribute(Type type) { return CachedAttributeGetter.GetAttribute(type.GetCustomAttributeProvider()); } public static JsonObjectAttribute GetJsonObjectAttribute(Type type) { return GetJsonContainerAttribute(type) as JsonObjectAttribute; } public static JsonArrayAttribute GetJsonArrayAttribute(Type type) { return GetJsonContainerAttribute(type) as JsonArrayAttribute; } public static JsonDictionaryAttribute GetJsonDictionaryAttribute(Type type) { return GetJsonContainerAttribute(type) as JsonDictionaryAttribute; } #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) public static SerializableAttribute GetSerializableAttribute(Type type) { return CachedAttributeGetter.GetAttribute(type.GetCustomAttributeProvider()); } #endif #if !PocketPC && !NET20 public static DataContractAttribute GetDataContractAttribute(Type type) { // DataContractAttribute does not have inheritance Type currentType = type; while (currentType != null) { DataContractAttribute result = CachedAttributeGetter.GetAttribute(currentType.GetCustomAttributeProvider()); if (result != null) return result; currentType = currentType.BaseType(); } return null; } public static DataMemberAttribute GetDataMemberAttribute(MemberInfo memberInfo) { // DataMemberAttribute does not have inheritance // can't override a field if (memberInfo.MemberType() == MemberTypes.Field) return CachedAttributeGetter.GetAttribute(memberInfo.GetCustomAttributeProvider()); // search property and then search base properties if nothing is returned and the property is virtual PropertyInfo propertyInfo = (PropertyInfo)memberInfo; DataMemberAttribute result = CachedAttributeGetter.GetAttribute(propertyInfo.GetCustomAttributeProvider()); if (result == null) { if (propertyInfo.IsVirtual()) { Type currentType = propertyInfo.DeclaringType; while (result == null && currentType != null) { PropertyInfo baseProperty = (PropertyInfo)ReflectionUtils.GetMemberInfoFromType(currentType, propertyInfo); if (baseProperty != null && baseProperty.IsVirtual()) result = CachedAttributeGetter.GetAttribute(baseProperty.GetCustomAttributeProvider()); currentType = currentType.BaseType(); } } } return result; } #endif public static MemberSerialization GetObjectMemberSerialization(Type objectType, bool ignoreSerializableAttribute) { JsonObjectAttribute objectAttribute = GetJsonObjectAttribute(objectType); if (objectAttribute != null) return objectAttribute.MemberSerialization; #if !PocketPC && !NET20 DataContractAttribute dataContractAttribute = GetDataContractAttribute(objectType); if (dataContractAttribute != null) return MemberSerialization.OptIn; #endif #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) if (!ignoreSerializableAttribute) { SerializableAttribute serializableAttribute = GetSerializableAttribute(objectType); if (serializableAttribute != null) return MemberSerialization.Fields; } #endif // the default return MemberSerialization.OptOut; } private static Type GetJsonConverterType(ICustomAttributeProvider attributeProvider) { return JsonConverterTypeCache.Get(attributeProvider); } private static Type GetJsonConverterTypeFromAttribute(ICustomAttributeProvider attributeProvider) { JsonConverterAttribute converterAttribute = GetAttribute(attributeProvider); return (converterAttribute != null) ? converterAttribute.ConverterType : null; } public static JsonConverter GetJsonConverter(ICustomAttributeProvider attributeProvider, Type targetConvertedType) { object provider = null; #if !(NETFX_CORE || PORTABLE) provider = attributeProvider as MemberInfo; #else provider = attributeProvider.UnderlyingObject; #endif Type converterType = GetJsonConverterType(attributeProvider); if (converterType != null) { JsonConverter memberConverter = JsonConverterAttribute.CreateJsonConverterInstance(converterType); return memberConverter; } return null; } #if !(NETFX_CORE || PORTABLE) #if !PocketPC public static TypeConverter GetTypeConverter(Type type) { #if !SILVERLIGHT return TypeDescriptor.GetConverter(type); #else Type converterType = GetTypeConverterType(type); if (converterType != null) return (TypeConverter)ReflectionUtils.CreateInstance(converterType); return null; #endif #endif } #endif #if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE) private static Type GetAssociatedMetadataType(Type type) { return AssociatedMetadataTypesCache.Get(type); } private static Type GetAssociateMetadataTypeFromAttribute(Type type) { Type metadataTypeAttributeType = GetMetadataTypeAttributeType(); if (metadataTypeAttributeType == null) return null; object attribute = type.GetCustomAttributes(metadataTypeAttributeType, true).SingleOrDefault(); if (attribute == null) return null; IMetadataTypeAttribute metadataTypeAttribute = (DynamicCodeGeneration) ? DynamicWrapper.CreateWrapper(attribute) : new LateBoundMetadataTypeAttribute(attribute); return metadataTypeAttribute.MetadataClassType; } private static Type GetMetadataTypeAttributeType() { // always attempt to get the metadata type attribute type // the assembly may have been loaded since last time if (_cachedMetadataTypeAttributeType == null) { Type metadataTypeAttributeType = Type.GetType(MetadataTypeAttributeTypeName); if (metadataTypeAttributeType != null) _cachedMetadataTypeAttributeType = metadataTypeAttributeType; else return null; } return _cachedMetadataTypeAttributeType; } #endif private static T GetAttribute(Type type) where T : Attribute { T attribute; #if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE) Type metadataType = GetAssociatedMetadataType(type); if (metadataType != null) { attribute = ReflectionUtils.GetAttribute(metadataType, true); if (attribute != null) return attribute; } #endif attribute = ReflectionUtils.GetAttribute(type.GetCustomAttributeProvider(), true); if (attribute != null) return attribute; foreach (Type typeInterface in type.GetInterfaces()) { attribute = ReflectionUtils.GetAttribute(typeInterface.GetCustomAttributeProvider(), true); if (attribute != null) return attribute; } return null; } private static T GetAttribute(MemberInfo memberInfo) where T : Attribute { T attribute; #if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE) Type metadataType = GetAssociatedMetadataType(memberInfo.DeclaringType); if (metadataType != null) { MemberInfo metadataTypeMemberInfo = ReflectionUtils.GetMemberInfoFromType(metadataType, memberInfo); if (metadataTypeMemberInfo != null) { attribute = ReflectionUtils.GetAttribute(metadataTypeMemberInfo, true); if (attribute != null) return attribute; } } #endif attribute = ReflectionUtils.GetAttribute(memberInfo.GetCustomAttributeProvider(), true); if (attribute != null) return attribute; if (memberInfo.DeclaringType != null) { foreach (Type typeInterface in memberInfo.DeclaringType.GetInterfaces()) { MemberInfo interfaceTypeMemberInfo = ReflectionUtils.GetMemberInfoFromType(typeInterface, memberInfo); if (interfaceTypeMemberInfo != null) { attribute = ReflectionUtils.GetAttribute(interfaceTypeMemberInfo.GetCustomAttributeProvider(), true); if (attribute != null) return attribute; } } } return null; } public static T GetAttribute(ICustomAttributeProvider attributeProvider) where T : Attribute { object provider = null; #if !(NETFX_CORE || PORTABLE) provider = attributeProvider; #else provider = attributeProvider.UnderlyingObject; #endif Type type = provider as Type; if (type != null) return GetAttribute(type); MemberInfo memberInfo = provider as MemberInfo; if (memberInfo != null) return GetAttribute(memberInfo); return ReflectionUtils.GetAttribute(attributeProvider, true); } private static bool? _dynamicCodeGeneration; private static bool? _fullyTrusted; #if DEBUG internal static void SetFullyTrusted(bool fullyTrusted) { _fullyTrusted = fullyTrusted; } internal static void SetDynamicCodeGeneration(bool dynamicCodeGeneration) { _dynamicCodeGeneration = dynamicCodeGeneration; } #endif public static bool DynamicCodeGeneration { get { if (_dynamicCodeGeneration == null) { #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) try { new ReflectionPermission(ReflectionPermissionFlag.MemberAccess).Demand(); new ReflectionPermission(ReflectionPermissionFlag.RestrictedMemberAccess).Demand(); new SecurityPermission(SecurityPermissionFlag.SkipVerification).Demand(); new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand(); new SecurityPermission(PermissionState.Unrestricted).Demand(); _dynamicCodeGeneration = true; } catch (Exception) { _dynamicCodeGeneration = false; } #else _dynamicCodeGeneration = false; #endif } return _dynamicCodeGeneration.Value; } } public static bool FullyTrusted { get { if (_fullyTrusted == null) { #if (NETFX_CORE || SILVERLIGHT || PORTABLE) _fullyTrusted = false; #elif !(NET20 || NET35) AppDomain appDomain = AppDomain.CurrentDomain; _fullyTrusted = appDomain.IsHomogenous && appDomain.IsFullyTrusted; #else try { new SecurityPermission(PermissionState.Unrestricted).Demand(); _fullyTrusted = true; } catch (Exception) { _fullyTrusted = false; } #endif } return _fullyTrusted.Value; } } public static ReflectionDelegateFactory ReflectionDelegateFactory { get { #if !(SILVERLIGHT || PORTABLE || NETFX_CORE) if (DynamicCodeGeneration) return DynamicReflectionDelegateFactory.Instance; #endif return LateBoundReflectionDelegateFactory.Instance; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ReflectionValueProvider.cs0000644000175000017500000000563112253423361033003 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Reflection; using Newtonsoft.Json.Utilities; using System.Globalization; namespace Newtonsoft.Json.Serialization { /// /// Get and set values for a using reflection. /// public class ReflectionValueProvider : IValueProvider { private readonly MemberInfo _memberInfo; /// /// Initializes a new instance of the class. /// /// The member info. public ReflectionValueProvider(MemberInfo memberInfo) { ValidationUtils.ArgumentNotNull(memberInfo, "memberInfo"); _memberInfo = memberInfo; } /// /// Sets the value. /// /// The target to set the value on. /// The value to set on the target. public void SetValue(object target, object value) { try { ReflectionUtils.SetMemberValue(_memberInfo, target, value); } catch (Exception ex) { throw new JsonSerializationException("Error setting value to '{0}' on '{1}'.".FormatWith(CultureInfo.InvariantCulture, _memberInfo.Name, target.GetType()), ex); } } /// /// Gets the value. /// /// The target to get the value from. /// The value. public object GetValue(object target) { try { return ReflectionUtils.GetMemberValue(_memberInfo, target); } catch (Exception ex) { throw new JsonSerializationException("Error getting value from '{0}' on '{1}'.".FormatWith(CultureInfo.InvariantCulture, _memberInfo.Name, target.GetType()), ex); } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonContainerContract.cs0000644000175000017500000001011412253423361032443 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Reflection; using Newtonsoft.Json.Utilities; using System.Collections; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Serialization { /// /// Contract details for a used by the . /// public class JsonContainerContract : JsonContract { private JsonContract _itemContract; private JsonContract _finalItemContract; // will be null for containers that don't have an item type (e.g. IList) or for complex objects internal JsonContract ItemContract { get { return _itemContract; } set { _itemContract = value; if (_itemContract != null) { _finalItemContract = (_itemContract.UnderlyingType.IsSealed()) ? _itemContract : null; } else { _finalItemContract = null; } } } // the final (i.e. can't be inherited from like a sealed class or valuetype) item contract internal JsonContract FinalItemContract { get { return _finalItemContract; } } /// /// Gets or sets the default collection items . /// /// The converter. public JsonConverter ItemConverter { get; set; } /// /// Gets or sets a value indicating whether the collection items preserve object references. /// /// true if collection items preserve object references; otherwise, false. public bool? ItemIsReference { get; set; } /// /// Gets or sets the collection item reference loop handling. /// /// The reference loop handling. public ReferenceLoopHandling? ItemReferenceLoopHandling { get; set; } /// /// Gets or sets the collection item type name handling. /// /// The type name handling. public TypeNameHandling? ItemTypeNameHandling { get; set; } /// /// Initializes a new instance of the class. /// /// The underlying type for the contract. internal JsonContainerContract(Type underlyingType) : base(underlyingType) { JsonContainerAttribute jsonContainerAttribute = JsonTypeReflector.GetJsonContainerAttribute(underlyingType); if (jsonContainerAttribute != null) { if (jsonContainerAttribute.ItemConverterType != null) ItemConverter = JsonConverterAttribute.CreateJsonConverterInstance(jsonContainerAttribute.ItemConverterType); ItemIsReference = jsonContainerAttribute._itemIsReference; ItemReferenceLoopHandling = jsonContainerAttribute._itemReferenceLoopHandling; ItemTypeNameHandling = jsonContainerAttribute._itemTypeNameHandling; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonStringContract.cs0000644000175000017500000000331312253423361031772 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json.Serialization { /// /// Contract details for a used by the . /// public class JsonStringContract : JsonPrimitiveContract { /// /// Initializes a new instance of the class. /// /// The underlying type for the contract. public JsonStringContract(Type underlyingType) : base(underlyingType) { ContractType = JsonContractType.String; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonObjectContract.cs0000644000175000017500000001154412253423361031737 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Reflection; using System.Runtime.Serialization; using System.Security; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Serialization { /// /// Contract details for a used by the . /// public class JsonObjectContract : JsonContainerContract { /// /// Gets or sets the object member serialization. /// /// The member object serialization. public MemberSerialization MemberSerialization { get; set; } /// /// Gets or sets a value that indicates whether the object's properties are required. /// /// /// A value indicating whether the object's properties are required. /// public Required? ItemRequired { get; set; } /// /// Gets the object's properties. /// /// The object's properties. public JsonPropertyCollection Properties { get; private set; } /// /// Gets the constructor parameters required for any non-default constructor /// public JsonPropertyCollection ConstructorParameters { get; private set; } /// /// Gets or sets the override constructor used to create the object. /// This is set when a constructor is marked up using the /// JsonConstructor attribute. /// /// The override constructor. public ConstructorInfo OverrideConstructor { get; set; } /// /// Gets or sets the parametrized constructor used to create the object. /// /// The parametrized constructor. public ConstructorInfo ParametrizedConstructor { get; set; } private bool? _hasRequiredOrDefaultValueProperties; internal bool HasRequiredOrDefaultValueProperties { get { if (_hasRequiredOrDefaultValueProperties == null) { _hasRequiredOrDefaultValueProperties = false; if (ItemRequired.GetValueOrDefault(Required.Default) != Required.Default) { _hasRequiredOrDefaultValueProperties = true; } else { foreach (JsonProperty property in Properties) { if (property.Required != Required.Default || ((property.DefaultValueHandling & DefaultValueHandling.Populate) == DefaultValueHandling.Populate) && property.Writable) { _hasRequiredOrDefaultValueProperties = true; break; } } } } return _hasRequiredOrDefaultValueProperties.Value; } } /// /// Initializes a new instance of the class. /// /// The underlying type for the contract. public JsonObjectContract(Type underlyingType) : base(underlyingType) { ContractType = JsonContractType.Object; Properties = new JsonPropertyCollection(UnderlyingType); ConstructorParameters = new JsonPropertyCollection(UnderlyingType); } #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NET20 || NET35) [SecuritySafeCritical] #endif internal object GetUninitializedObject() { // we should never get here if the environment is not fully trusted, check just in case if (!JsonTypeReflector.FullyTrusted) throw new JsonException("Insufficient permissions. Creating an uninitialized '{0}' type requires full trust.".FormatWith(CultureInfo.InvariantCulture, NonNullableUnderlyingType)); return FormatterServices.GetUninitializedObject(NonNullableUnderlyingType); } #endif } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/LateBoundMetadataTypeAttribute.cs0000644000175000017500000000371712253423361034250 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !SILVERLIGHT && !PocketPC && !NET20 && !NETFX_CORE using System; using System.Collections.Generic; using System.Linq; using System.Text; using Newtonsoft.Json.Utilities; using System.Reflection; namespace Newtonsoft.Json.Serialization { internal class LateBoundMetadataTypeAttribute : IMetadataTypeAttribute { private static PropertyInfo _metadataClassTypeProperty; private readonly object _attribute; public LateBoundMetadataTypeAttribute(object attribute) { _attribute = attribute; } public Type MetadataClassType { get { if (_metadataClassTypeProperty == null) _metadataClassTypeProperty = _attribute.GetType().GetProperty("MetadataClassType"); return (Type)ReflectionUtils.GetMemberValue(_metadataClassTypeProperty, _attribute); } } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DefaultReferenceResolver.cs0000644000175000017500000000537512253423361033133 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using Newtonsoft.Json.Utilities; using System.Globalization; namespace Newtonsoft.Json.Serialization { internal class DefaultReferenceResolver : IReferenceResolver { private int _referenceCount; private BidirectionalDictionary GetMappings(object context) { JsonSerializerInternalBase internalSerializer; if (context is JsonSerializerInternalBase) internalSerializer = (JsonSerializerInternalBase) context; else if (context is JsonSerializerProxy) internalSerializer = ((JsonSerializerProxy) context).GetInternalSerializer(); else throw new JsonException("The DefaultReferenceResolver can only be used internally."); return internalSerializer.DefaultReferenceMappings; } public object ResolveReference(object context, string reference) { object value; GetMappings(context).TryGetByFirst(reference, out value); return value; } public string GetReference(object context, object value) { var mappings = GetMappings(context); string reference; if (!mappings.TryGetBySecond(value, out reference)) { _referenceCount++; reference = _referenceCount.ToString(CultureInfo.InvariantCulture); mappings.Add(reference, value); } return reference; } public void AddReference(object context, string reference, object value) { GetMappings(context).Add(reference, value); } public bool IsReferenced(object context, object value) { string reference; return GetMappings(context).TryGetBySecond(value, out reference); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/OnErrorAttribute.cs0000644000175000017500000000271012253423361031446 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json.Serialization { /// /// When applied to a method, specifies that the method is called when an error occurs serializing an object. /// [AttributeUsage(AttributeTargets.Method, Inherited = false)] public sealed class OnErrorAttribute : Attribute { } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ObjectConstructor.cs0000644000175000017500000000260712253423361031655 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json.Serialization { /// /// Represents a method that constructs an object. /// /// The object type to create. public delegate object ObjectConstructor(params object[] args); }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DynamicValueProvider.cs0000644000175000017500000001002612253423361032267 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(SILVERLIGHT || PORTABLE || NETFX_CORE) using System; using System.Collections.Generic; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #endif using System.Text; using System.Reflection; using Newtonsoft.Json.Utilities; using System.Globalization; namespace Newtonsoft.Json.Serialization { /// /// Get and set values for a using dynamic methods. /// public class DynamicValueProvider : IValueProvider { private readonly MemberInfo _memberInfo; private Func _getter; private Action _setter; /// /// Initializes a new instance of the class. /// /// The member info. public DynamicValueProvider(MemberInfo memberInfo) { ValidationUtils.ArgumentNotNull(memberInfo, "memberInfo"); _memberInfo = memberInfo; } /// /// Sets the value. /// /// The target to set the value on. /// The value to set on the target. public void SetValue(object target, object value) { try { if (_setter == null) _setter = DynamicReflectionDelegateFactory.Instance.CreateSet(_memberInfo); #if DEBUG // dynamic method doesn't check whether the type is 'legal' to set // add this check for unit tests if (value == null) { if (!ReflectionUtils.IsNullable(ReflectionUtils.GetMemberUnderlyingType(_memberInfo))) throw new JsonSerializationException("Incompatible value. Cannot set {0} to null.".FormatWith(CultureInfo.InvariantCulture, _memberInfo)); } else if (!ReflectionUtils.GetMemberUnderlyingType(_memberInfo).IsAssignableFrom(value.GetType())) { throw new JsonSerializationException("Incompatible value. Cannot set {0} to type {1}.".FormatWith(CultureInfo.InvariantCulture, _memberInfo, value.GetType())); } #endif _setter(target, value); } catch (Exception ex) { throw new JsonSerializationException("Error setting value to '{0}' on '{1}'.".FormatWith(CultureInfo.InvariantCulture, _memberInfo.Name, target.GetType()), ex); } } /// /// Gets the value. /// /// The target to get the value from. /// The value. public object GetValue(object target) { try { if (_getter == null) _getter = DynamicReflectionDelegateFactory.Instance.CreateGet(_memberInfo); return _getter(target); } catch (Exception ex) { throw new JsonSerializationException("Error getting value from '{0}' on '{1}'.".FormatWith(CultureInfo.InvariantCulture, _memberInfo.Name, target.GetType()), ex); } } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs0000644000175000017500000007501712253423361034043 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) using System.Dynamic; #endif using System.Globalization; using System.Security; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Utilities; using System.Runtime.Serialization; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Serialization { internal class JsonSerializerInternalWriter : JsonSerializerInternalBase { private readonly List _serializeStack = new List(); private JsonSerializerProxy _internalSerializer; public JsonSerializerInternalWriter(JsonSerializer serializer) : base(serializer) { } public void Serialize(JsonWriter jsonWriter, object value) { if (jsonWriter == null) throw new ArgumentNullException("jsonWriter"); SerializeValue(jsonWriter, value, GetContractSafe(value), null, null, null); } private JsonSerializerProxy GetInternalSerializer() { if (_internalSerializer == null) _internalSerializer = new JsonSerializerProxy(this); return _internalSerializer; } private JsonContract GetContractSafe(object value) { if (value == null) return null; return Serializer.ContractResolver.ResolveContract(value.GetType()); } private void SerializePrimitive(JsonWriter writer, object value, JsonPrimitiveContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty) { if (contract.UnderlyingType == typeof (byte[])) { bool includeTypeDetails = ShouldWriteType(TypeNameHandling.Objects, contract, member, containerContract, containerProperty); if (includeTypeDetails) { writer.WriteStartObject(); WriteTypeProperty(writer, contract.CreatedType); writer.WritePropertyName(JsonTypeReflector.ValuePropertyName); writer.WriteValue(value); writer.WriteEndObject(); return; } } writer.WriteValue(value); } private void SerializeValue(JsonWriter writer, object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty) { if (value == null) { writer.WriteNull(); return; } JsonConverter converter; if ((((converter = (member != null) ? member.Converter : null) != null) || ((converter = (containerProperty != null) ? containerProperty.ItemConverter : null) != null) || ((converter = (containerContract != null) ? containerContract.ItemConverter : null) != null) || ((converter = valueContract.Converter) != null) || ((converter = Serializer.GetMatchingConverter(valueContract.UnderlyingType)) != null) || ((converter = valueContract.InternalConverter) != null)) && converter.CanWrite) { SerializeConvertable(writer, converter, value, valueContract, containerContract, containerProperty); return; } switch (valueContract.ContractType) { case JsonContractType.Object: SerializeObject(writer, value, (JsonObjectContract)valueContract, member, containerContract, containerProperty); break; case JsonContractType.Array: JsonArrayContract arrayContract = (JsonArrayContract) valueContract; if (!arrayContract.IsMultidimensionalArray) SerializeList(writer, arrayContract.CreateWrapper(value), arrayContract, member, containerContract, containerProperty); else SerializeMultidimensionalArray(writer, (Array)value, arrayContract, member, containerContract, containerProperty); break; case JsonContractType.Primitive: SerializePrimitive(writer, value, (JsonPrimitiveContract)valueContract, member, containerContract, containerProperty); break; case JsonContractType.String: SerializeString(writer, value, (JsonStringContract)valueContract); break; case JsonContractType.Dictionary: JsonDictionaryContract dictionaryContract = (JsonDictionaryContract) valueContract; SerializeDictionary(writer, dictionaryContract.CreateWrapper(value), dictionaryContract, member, containerContract, containerProperty); break; #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) case JsonContractType.Dynamic: SerializeDynamic(writer, (IDynamicMetaObjectProvider)value, (JsonDynamicContract)valueContract, member, containerContract, containerProperty); break; #endif #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) case JsonContractType.Serializable: SerializeISerializable(writer, (ISerializable)value, (JsonISerializableContract)valueContract, member, containerContract, containerProperty); break; #endif case JsonContractType.Linq: ((JToken) value).WriteTo(writer, (Serializer.Converters != null) ? Serializer.Converters.ToArray() : null); break; } } private bool? ResolveIsReference(JsonContract contract, JsonProperty property, JsonContainerContract collectionContract, JsonProperty containerProperty) { bool? isReference = null; // value could be coming from a dictionary or array and not have a property if (property != null) isReference = property.IsReference; if (isReference == null && containerProperty != null) isReference = containerProperty.ItemIsReference; if (isReference == null && collectionContract != null) isReference = collectionContract.ItemIsReference; if (isReference == null) isReference = contract.IsReference; return isReference; } private bool ShouldWriteReference(object value, JsonProperty property, JsonContract valueContract, JsonContainerContract collectionContract, JsonProperty containerProperty) { if (value == null) return false; if (valueContract.ContractType == JsonContractType.Primitive || valueContract.ContractType == JsonContractType.String) return false; bool? isReference = ResolveIsReference(valueContract, property, collectionContract, containerProperty); if (isReference == null) { if (valueContract.ContractType == JsonContractType.Array) isReference = HasFlag(Serializer.PreserveReferencesHandling, PreserveReferencesHandling.Arrays); else isReference = HasFlag(Serializer.PreserveReferencesHandling, PreserveReferencesHandling.Objects); } if (!isReference.Value) return false; return Serializer.ReferenceResolver.IsReferenced(this, value); } private bool ShouldWriteProperty(object memberValue, JsonProperty property) { if (property.NullValueHandling.GetValueOrDefault(Serializer.NullValueHandling) == NullValueHandling.Ignore && memberValue == null) return false; if (HasFlag(property.DefaultValueHandling.GetValueOrDefault(Serializer.DefaultValueHandling), DefaultValueHandling.Ignore) && MiscellaneousUtils.ValueEquals(memberValue, property.DefaultValue)) return false; return true; } private bool CheckForCircularReference(JsonWriter writer, object value, JsonProperty property, JsonContract contract, JsonContainerContract containerContract, JsonProperty containerProperty) { if (value == null || contract.ContractType == JsonContractType.Primitive || contract.ContractType == JsonContractType.String) return true; ReferenceLoopHandling? referenceLoopHandling = null; if (property != null) referenceLoopHandling = property.ReferenceLoopHandling; if (referenceLoopHandling == null && containerProperty != null) referenceLoopHandling = containerProperty.ItemReferenceLoopHandling; if (referenceLoopHandling == null && containerContract != null) referenceLoopHandling = containerContract.ItemReferenceLoopHandling; if (_serializeStack.IndexOf(value) != -1) { switch (referenceLoopHandling.GetValueOrDefault(Serializer.ReferenceLoopHandling)) { case ReferenceLoopHandling.Error: string message = "Self referencing loop detected"; if (property != null) message += " for property '{0}'".FormatWith(CultureInfo.InvariantCulture, property.PropertyName); message += " with type '{0}'.".FormatWith(CultureInfo.InvariantCulture, value.GetType()); throw JsonSerializationException.Create(null, writer.ContainerPath, message, null); case ReferenceLoopHandling.Ignore: return false; case ReferenceLoopHandling.Serialize: return true; default: throw new InvalidOperationException("Unexpected ReferenceLoopHandling value: '{0}'".FormatWith(CultureInfo.InvariantCulture, Serializer.ReferenceLoopHandling)); } } return true; } private void WriteReference(JsonWriter writer, object value) { writer.WriteStartObject(); writer.WritePropertyName(JsonTypeReflector.RefPropertyName); writer.WriteValue(Serializer.ReferenceResolver.GetReference(this, value)); writer.WriteEndObject(); } internal static bool TryConvertToString(object value, Type type, out string s) { #if !(PocketPC || NETFX_CORE || PORTABLE) TypeConverter converter = ConvertUtils.GetConverter(type); // use the objectType's TypeConverter if it has one and can convert to a string if (converter != null #if !SILVERLIGHT && !(converter is ComponentConverter) #endif && converter.GetType() != typeof(TypeConverter)) { if (converter.CanConvertTo(typeof(string))) { #if !SILVERLIGHT s = converter.ConvertToInvariantString(value); #else s = converter.ConvertToString(value); #endif return true; } } #endif #if SILVERLIGHT || PocketPC || NETFX_CORE if (value is Guid || value is Uri || value is TimeSpan) { s = value.ToString(); return true; } #endif if (value is Type) { s = ((Type)value).AssemblyQualifiedName; return true; } s = null; return false; } private void SerializeString(JsonWriter writer, object value, JsonStringContract contract) { contract.InvokeOnSerializing(value, Serializer.Context); string s; TryConvertToString(value, contract.UnderlyingType, out s); writer.WriteValue(s); contract.InvokeOnSerialized(value, Serializer.Context); } private void SerializeObject(JsonWriter writer, object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) { contract.InvokeOnSerializing(value, Serializer.Context); _serializeStack.Add(value); WriteObjectStart(writer, value, contract, member, collectionContract, containerProperty); int initialDepth = writer.Top; foreach (JsonProperty property in contract.Properties) { try { object memberValue; JsonContract memberContract; if (!CalculatePropertyValues(writer, value, contract, member, property, out memberContract, out memberValue)) continue; writer.WritePropertyName(property.PropertyName); SerializeValue(writer, memberValue, memberContract, property, contract, member); } catch (Exception ex) { if (IsErrorHandled(value, contract, property.PropertyName, writer.ContainerPath, ex)) HandleError(writer, initialDepth); else throw; } } writer.WriteEndObject(); _serializeStack.RemoveAt(_serializeStack.Count - 1); contract.InvokeOnSerialized(value, Serializer.Context); } private bool CalculatePropertyValues(JsonWriter writer, object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, out JsonContract memberContract, out object memberValue) { if (!property.Ignored && property.Readable && ShouldSerialize(property, value) && IsSpecified(property, value)) { if (property.PropertyContract == null) property.PropertyContract = Serializer.ContractResolver.ResolveContract(property.PropertyType); memberValue = property.ValueProvider.GetValue(value); memberContract = (property.PropertyContract.UnderlyingType.IsSealed()) ? property.PropertyContract : GetContractSafe(memberValue); if (ShouldWriteProperty(memberValue, property)) { if (ShouldWriteReference(memberValue, property, memberContract, contract, member)) { writer.WritePropertyName(property.PropertyName); WriteReference(writer, memberValue); return false; } if (!CheckForCircularReference(writer, memberValue, property, memberContract, contract, member)) return false; if (memberValue == null) { JsonObjectContract objectContract = contract as JsonObjectContract; Required resolvedRequired = property._required ?? ((objectContract != null) ? objectContract.ItemRequired : null) ?? Required.Default; if (resolvedRequired == Required.Always) throw JsonSerializationException.Create(null, writer.ContainerPath, "Cannot write a null value for property '{0}'. Property requires a value.".FormatWith(CultureInfo.InvariantCulture, property.PropertyName), null); } return true; } } memberContract = null; memberValue = null; return false; } private void WriteObjectStart(JsonWriter writer, object value, JsonContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) { writer.WriteStartObject(); bool isReference = ResolveIsReference(contract, member, collectionContract, containerProperty) ?? HasFlag(Serializer.PreserveReferencesHandling, PreserveReferencesHandling.Objects); if (isReference) { writer.WritePropertyName(JsonTypeReflector.IdPropertyName); writer.WriteValue(Serializer.ReferenceResolver.GetReference(this, value)); } if (ShouldWriteType(TypeNameHandling.Objects, contract, member, collectionContract, containerProperty)) { WriteTypeProperty(writer, contract.UnderlyingType); } } private void WriteTypeProperty(JsonWriter writer, Type type) { writer.WritePropertyName(JsonTypeReflector.TypePropertyName); writer.WriteValue(ReflectionUtils.GetTypeName(type, Serializer.TypeNameAssemblyFormat, Serializer.Binder)); } private bool HasFlag(DefaultValueHandling value, DefaultValueHandling flag) { return ((value & flag) == flag); } private bool HasFlag(PreserveReferencesHandling value, PreserveReferencesHandling flag) { return ((value & flag) == flag); } private bool HasFlag(TypeNameHandling value, TypeNameHandling flag) { return ((value & flag) == flag); } private void SerializeConvertable(JsonWriter writer, JsonConverter converter, object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty) { if (ShouldWriteReference(value, null, contract, collectionContract, containerProperty)) { WriteReference(writer, value); } else { if (!CheckForCircularReference(writer, value, null, contract, collectionContract, containerProperty)) return; _serializeStack.Add(value); converter.WriteJson(writer, value, GetInternalSerializer()); _serializeStack.RemoveAt(_serializeStack.Count - 1); } } private void SerializeList(JsonWriter writer, IWrappedCollection values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) { contract.InvokeOnSerializing(values.UnderlyingCollection, Serializer.Context); _serializeStack.Add(values.UnderlyingCollection); bool hasWrittenMetadataObject = WriteStartArray(writer, values.UnderlyingCollection, contract, member, collectionContract, containerProperty); writer.WriteStartArray(); int initialDepth = writer.Top; int index = 0; // note that an error in the IEnumerable won't be caught foreach (object value in values) { try { JsonContract valueContract = contract.FinalItemContract ?? GetContractSafe(value); if (ShouldWriteReference(value, null, valueContract, contract, member)) { WriteReference(writer, value); } else { if (CheckForCircularReference(writer, value, null, valueContract, contract, member)) { SerializeValue(writer, value, valueContract, null, contract, member); } } } catch (Exception ex) { if (IsErrorHandled(values.UnderlyingCollection, contract, index, writer.ContainerPath, ex)) HandleError(writer, initialDepth); else throw; } finally { index++; } } writer.WriteEndArray(); if (hasWrittenMetadataObject) writer.WriteEndObject(); _serializeStack.RemoveAt(_serializeStack.Count - 1); contract.InvokeOnSerialized(values.UnderlyingCollection, Serializer.Context); } private void SerializeMultidimensionalArray(JsonWriter writer, Array values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) { contract.InvokeOnSerializing(values, Serializer.Context); _serializeStack.Add(values); bool hasWrittenMetadataObject = WriteStartArray(writer, values, contract, member, collectionContract, containerProperty); SerializeMultidimensionalArray(writer, values, contract, member, writer.Top, new int[0]); if (hasWrittenMetadataObject) writer.WriteEndObject(); _serializeStack.RemoveAt(_serializeStack.Count - 1); contract.InvokeOnSerialized(values, Serializer.Context); } private void SerializeMultidimensionalArray(JsonWriter writer, Array values, JsonArrayContract contract, JsonProperty member, int initialDepth, int[] indices) { int dimension = indices.Length; int[] newIndices = new int[dimension + 1]; for (int i = 0; i < dimension; i++) { newIndices[i] = indices[i]; } writer.WriteStartArray(); for (int i = 0; i < values.GetLength(dimension); i++) { newIndices[dimension] = i; bool isTopLevel = (newIndices.Length == values.Rank); if (isTopLevel) { object value = values.GetValue(newIndices); try { JsonContract valueContract = contract.FinalItemContract ?? GetContractSafe(value); if (ShouldWriteReference(value, null, valueContract, contract, member)) { WriteReference(writer, value); } else { if (CheckForCircularReference(writer, value, null, valueContract, contract, member)) { SerializeValue(writer, value, valueContract, null, contract, member); } } } catch (Exception ex) { if (IsErrorHandled(values, contract, i, writer.ContainerPath, ex)) HandleError(writer, initialDepth + 1); else throw; } } else { SerializeMultidimensionalArray(writer, values, contract, member, initialDepth + 1, newIndices); } } writer.WriteEndArray(); } private bool WriteStartArray(JsonWriter writer, object values, JsonArrayContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty) { bool isReference = ResolveIsReference(contract, member, containerContract, containerProperty) ?? HasFlag(Serializer.PreserveReferencesHandling, PreserveReferencesHandling.Arrays); bool includeTypeDetails = ShouldWriteType(TypeNameHandling.Arrays, contract, member, containerContract, containerProperty); bool writeMetadataObject = isReference || includeTypeDetails; if (writeMetadataObject) { writer.WriteStartObject(); if (isReference) { writer.WritePropertyName(JsonTypeReflector.IdPropertyName); writer.WriteValue(Serializer.ReferenceResolver.GetReference(this, values)); } if (includeTypeDetails) { WriteTypeProperty(writer, values.GetType()); } writer.WritePropertyName(JsonTypeReflector.ArrayValuesPropertyName); } if (contract.ItemContract == null) contract.ItemContract = Serializer.ContractResolver.ResolveContract(contract.CollectionItemType ?? typeof (object)); return writeMetadataObject; } #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NET20 || NET35) [SecuritySafeCritical] #endif private void SerializeISerializable(JsonWriter writer, ISerializable value, JsonISerializableContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) { if (!JsonTypeReflector.FullyTrusted) { throw JsonSerializationException.Create(null, writer.ContainerPath, @"Type '{0}' implements ISerializable but cannot be serialized using the ISerializable interface because the current application is not fully trusted and ISerializable can expose secure data. To fix this error either change the environment to be fully trusted, change the application to not deserialize the type, add JsonObjectAttribute to the type or change the JsonSerializer setting ContractResolver to use a new DefaultContractResolver with IgnoreSerializableInterface set to true.".FormatWith(CultureInfo.InvariantCulture, value.GetType()), null); } contract.InvokeOnSerializing(value, Serializer.Context); _serializeStack.Add(value); WriteObjectStart(writer, value, contract, member, collectionContract, containerProperty); SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, new FormatterConverter()); value.GetObjectData(serializationInfo, Serializer.Context); foreach (SerializationEntry serializationEntry in serializationInfo) { writer.WritePropertyName(serializationEntry.Name); SerializeValue(writer, serializationEntry.Value, GetContractSafe(serializationEntry.Value), null, null, member); } writer.WriteEndObject(); _serializeStack.RemoveAt(_serializeStack.Count - 1); contract.InvokeOnSerialized(value, Serializer.Context); } #endif #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) private void SerializeDynamic(JsonWriter writer, IDynamicMetaObjectProvider value, JsonDynamicContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) { contract.InvokeOnSerializing(value, Serializer.Context); _serializeStack.Add(value); WriteObjectStart(writer, value, contract, member, collectionContract, containerProperty); int initialDepth = writer.Top; foreach (JsonProperty property in contract.Properties) { // only write non-dynamic properties that have an explicit attribute if (property.HasMemberAttribute) { try { object memberValue; JsonContract memberContract; if (!CalculatePropertyValues(writer, value, contract, member, property, out memberContract, out memberValue)) continue; writer.WritePropertyName(property.PropertyName); SerializeValue(writer, memberValue, memberContract, property, contract, member); } catch (Exception ex) { if (IsErrorHandled(value, contract, property.PropertyName, writer.ContainerPath, ex)) HandleError(writer, initialDepth); else throw; } } } foreach (string memberName in value.GetDynamicMemberNames()) { object memberValue; if (value.TryGetMember(memberName, out memberValue)) { try { string resolvedPropertyName = (contract.PropertyNameResolver != null) ? contract.PropertyNameResolver(memberName) : memberName; writer.WritePropertyName(resolvedPropertyName); SerializeValue(writer, memberValue, GetContractSafe(memberValue), null, null, member); } catch (Exception ex) { if (IsErrorHandled(value, contract, memberName, writer.ContainerPath, ex)) HandleError(writer, initialDepth); else throw; } } } writer.WriteEndObject(); _serializeStack.RemoveAt(_serializeStack.Count - 1); contract.InvokeOnSerialized(value, Serializer.Context); } #endif private bool ShouldWriteType(TypeNameHandling typeNameHandlingFlag, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty) { TypeNameHandling resolvedTypeNameHandling = ((member != null) ? member.TypeNameHandling : null) ?? ((containerProperty != null) ? containerProperty.ItemTypeNameHandling : null) ?? ((containerContract != null) ? containerContract.ItemTypeNameHandling : null) ?? Serializer.TypeNameHandling; if (HasFlag(resolvedTypeNameHandling, typeNameHandlingFlag)) return true; // instance type and the property's type's contract default type are different (no need to put the type in JSON because the type will be created by default) if (HasFlag(resolvedTypeNameHandling, TypeNameHandling.Auto)) { if (member != null) { if (contract.UnderlyingType != member.PropertyContract.CreatedType) return true; } else if (containerContract != null && containerContract.ItemContract != null) { if (contract.UnderlyingType != containerContract.ItemContract.CreatedType) return true; } } return false; } private void SerializeDictionary(JsonWriter writer, IWrappedDictionary values, JsonDictionaryContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) { contract.InvokeOnSerializing(values.UnderlyingDictionary, Serializer.Context); _serializeStack.Add(values.UnderlyingDictionary); WriteObjectStart(writer, values.UnderlyingDictionary, contract, member, collectionContract, containerProperty); if (contract.ItemContract == null) contract.ItemContract = Serializer.ContractResolver.ResolveContract(contract.DictionaryValueType ?? typeof(object)); int initialDepth = writer.Top; // Mono Unity 3.0 fix IWrappedDictionary d = values; foreach (DictionaryEntry entry in d) { string propertyName = GetPropertyName(entry); propertyName = (contract.PropertyNameResolver != null) ? contract.PropertyNameResolver(propertyName) : propertyName; try { object value = entry.Value; JsonContract valueContract = contract.FinalItemContract ?? GetContractSafe(value); if (ShouldWriteReference(value, null, valueContract, contract, member)) { writer.WritePropertyName(propertyName); WriteReference(writer, value); } else { if (!CheckForCircularReference(writer, value, null, valueContract, contract, member)) continue; writer.WritePropertyName(propertyName); SerializeValue(writer, value, valueContract, null, contract, member); } } catch (Exception ex) { if (IsErrorHandled(values.UnderlyingDictionary, contract, propertyName, writer.ContainerPath, ex)) HandleError(writer, initialDepth); else throw; } } writer.WriteEndObject(); _serializeStack.RemoveAt(_serializeStack.Count - 1); contract.InvokeOnSerialized(values.UnderlyingDictionary, Serializer.Context); } private string GetPropertyName(DictionaryEntry entry) { string propertyName; if (ConvertUtils.IsConvertible(entry.Key)) return Convert.ToString(entry.Key, CultureInfo.InvariantCulture); else if (TryConvertToString(entry.Key, entry.Key.GetType(), out propertyName)) return propertyName; else return entry.Key.ToString(); } private void HandleError(JsonWriter writer, int initialDepth) { ClearErrorContext(); if (writer.WriteState == WriteState.Property) writer.WriteNull(); while (writer.Top > initialDepth) { writer.WriteEnd(); } } private bool ShouldSerialize(JsonProperty property, object target) { if (property.ShouldSerialize == null) return true; return property.ShouldSerialize(target); } private bool IsSpecified(JsonProperty property, object target) { if (property.GetIsSpecified == null) return true; return property.GetIsSpecified(target); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/IContractResolver.cs0000644000175000017500000000404412253423361031606 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json.Serialization { /// /// Used by to resolves a for a given . /// /// /// /// /// public interface IContractResolver { /// /// Resolves the contract for a given type. /// /// The type to resolve a contract for. /// The contract for a given type. JsonContract ResolveContract(Type type); } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalBase.cs0000644000175000017500000000752112253423361033434 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Net; using System.Runtime.CompilerServices; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Serialization { internal abstract class JsonSerializerInternalBase { private class ReferenceEqualsEqualityComparer : IEqualityComparer { bool IEqualityComparer.Equals(object x, object y) { return ReferenceEquals(x, y); } int IEqualityComparer.GetHashCode(object obj) { #if !(NETFX_CORE || PORTABLE) // put objects in a bucket based on their reference return RuntimeHelpers.GetHashCode(obj); #else // put all objects in the same bucket so ReferenceEquals is called on all return -1; #endif } } private ErrorContext _currentErrorContext; private BidirectionalDictionary _mappings; internal readonly JsonSerializer Serializer; protected JsonSerializerInternalBase(JsonSerializer serializer) { ValidationUtils.ArgumentNotNull(serializer, "serializer"); Serializer = serializer; } internal BidirectionalDictionary DefaultReferenceMappings { get { // override equality comparer for object key dictionary // object will be modified as it deserializes and might have mutable hashcode if (_mappings == null) _mappings = new BidirectionalDictionary( EqualityComparer.Default, new ReferenceEqualsEqualityComparer()); return _mappings; } } protected ErrorContext GetErrorContext(object currentObject, object member, string path, Exception error) { if (_currentErrorContext == null) _currentErrorContext = new ErrorContext(currentObject, member, path, error); if (_currentErrorContext.Error != error) throw new InvalidOperationException("Current error context error is different to requested error."); return _currentErrorContext; } protected void ClearErrorContext() { if (_currentErrorContext == null) throw new InvalidOperationException("Could not clear error context. Error context is already null."); _currentErrorContext = null; } protected bool IsErrorHandled(object currentObject, JsonContract contract, object keyValue, string path, Exception ex) { ErrorContext errorContext = GetErrorContext(currentObject, keyValue, path, ex); if (contract != null) contract.InvokeOnError(currentObject, Serializer.Context, errorContext); if (!errorContext.Handled) Serializer.OnError(new ErrorEventArgs(currentObject, errorContext)); return errorContext.Handled; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ErrorEventArgs.cs0000644000175000017500000000415312253423361031107 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json.Serialization { /// /// Provides data for the Error event. /// public class ErrorEventArgs : EventArgs { /// /// Gets the current object the error event is being raised against. /// /// The current object the error event is being raised against. public object CurrentObject { get; private set; } /// /// Gets the error context. /// /// The error context. public ErrorContext ErrorContext { get; private set; } /// /// Initializes a new instance of the class. /// /// The current object. /// The error context. public ErrorEventArgs(object currentObject, ErrorContext errorContext) { CurrentObject = currentObject; ErrorContext = errorContext; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonISerializableContract.cs0000644000175000017500000000377212253423361033254 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) using System; namespace Newtonsoft.Json.Serialization { /// /// Contract details for a used by the . /// public class JsonISerializableContract : JsonContract { /// /// Gets or sets the ISerializable object constructor. /// /// The ISerializable object constructor. public ObjectConstructor ISerializableCreator { get; set; } /// /// Initializes a new instance of the class. /// /// The underlying type for the contract. public JsonISerializableContract(Type underlyingType) : base(underlyingType) { ContractType = JsonContractType.Serializable; } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonArrayContract.cs0000644000175000017500000001335112253423361031605 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Reflection; using Newtonsoft.Json.Utilities; using System.Collections; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Serialization { /// /// Contract details for a used by the . /// public class JsonArrayContract : JsonContainerContract { /// /// Gets the of the collection items. /// /// The of the collection items. public Type CollectionItemType { get; private set; } /// /// Gets a value indicating whether the collection type is a multidimensional array. /// /// true if the collection type is a multidimensional array; otherwise, false. public bool IsMultidimensionalArray { get; private set; } private readonly bool _isCollectionItemTypeNullableType; private readonly Type _genericCollectionDefinitionType; private Type _genericWrapperType; private MethodCall _genericWrapperCreator; /// /// Initializes a new instance of the class. /// /// The underlying type for the contract. public JsonArrayContract(Type underlyingType) : base(underlyingType) { ContractType = JsonContractType.Array; if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(ICollection<>), out _genericCollectionDefinitionType)) { CollectionItemType = _genericCollectionDefinitionType.GetGenericArguments()[0]; } else if (underlyingType.IsGenericType() && underlyingType.GetGenericTypeDefinition() == typeof(IEnumerable<>)) { _genericCollectionDefinitionType = typeof (IEnumerable<>); CollectionItemType = underlyingType.GetGenericArguments()[0]; } else { CollectionItemType = ReflectionUtils.GetCollectionItemType(UnderlyingType); } if (CollectionItemType != null) _isCollectionItemTypeNullableType = ReflectionUtils.IsNullableType(CollectionItemType); if (IsTypeGenericCollectionInterface(UnderlyingType)) { CreatedType = ReflectionUtils.MakeGenericType(typeof(List<>), CollectionItemType); } IsMultidimensionalArray = (UnderlyingType.IsArray && UnderlyingType.GetArrayRank() > 1); } internal IWrappedCollection CreateWrapper(object list) { if ((list is IList && (CollectionItemType == null || !_isCollectionItemTypeNullableType)) || UnderlyingType.IsArray) return new CollectionWrapper((IList)list); if (_genericCollectionDefinitionType != null) { EnsureGenericWrapperCreator(); return (IWrappedCollection) _genericWrapperCreator(null, list); } else { IList values = ((IEnumerable) list).Cast().ToList(); if (CollectionItemType != null) { Array array = Array.CreateInstance(CollectionItemType, values.Count); for (int i = 0; i < values.Count; i++) { array.SetValue(values[i], i); } values = array; } return new CollectionWrapper(values); } } private void EnsureGenericWrapperCreator() { if (_genericWrapperCreator == null) { _genericWrapperType = ReflectionUtils.MakeGenericType(typeof (CollectionWrapper<>), CollectionItemType); Type constructorArgument; if (ReflectionUtils.InheritsGenericDefinition(_genericCollectionDefinitionType, typeof(List<>)) || _genericCollectionDefinitionType.GetGenericTypeDefinition() == typeof(IEnumerable<>)) constructorArgument = ReflectionUtils.MakeGenericType(typeof(ICollection<>), CollectionItemType); else constructorArgument = _genericCollectionDefinitionType; ConstructorInfo genericWrapperConstructor = _genericWrapperType.GetConstructor(new[] { constructorArgument }); _genericWrapperCreator = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall(genericWrapperConstructor); } } private bool IsTypeGenericCollectionInterface(Type type) { if (!type.IsGenericType()) return false; Type genericDefinition = type.GetGenericTypeDefinition(); return (genericDefinition == typeof(IList<>) || genericDefinition == typeof(ICollection<>) || genericDefinition == typeof(IEnumerable<>)); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/IValueProvider.cs0000644000175000017500000000335412253423361031101 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json.Serialization { /// /// Provides methods to get and set values. /// public interface IValueProvider { /// /// Sets the value. /// /// The target to set the value on. /// The value to set on the target. void SetValue(object target, object value); /// /// Gets the value. /// /// The target to get the value from. /// The value. object GetValue(object target); } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonDictionaryContract.cs0000644000175000017500000001146312253423361032636 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Reflection; using Newtonsoft.Json.Utilities; using System.Collections; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #endif namespace Newtonsoft.Json.Serialization { /// /// Contract details for a used by the . /// public class JsonDictionaryContract : JsonContainerContract { /// /// Gets or sets the property name resolver. /// /// The property name resolver. public Func PropertyNameResolver { get; set; } /// /// Gets the of the dictionary keys. /// /// The of the dictionary keys. public Type DictionaryKeyType { get; private set; } /// /// Gets the of the dictionary values. /// /// The of the dictionary values. public Type DictionaryValueType { get; private set; } internal JsonContract KeyContract { get; set; } private readonly bool _isDictionaryValueTypeNullableType; private readonly Type _genericCollectionDefinitionType; private Type _genericWrapperType; private MethodCall _genericWrapperCreator; /// /// Initializes a new instance of the class. /// /// The underlying type for the contract. public JsonDictionaryContract(Type underlyingType) : base(underlyingType) { ContractType = JsonContractType.Dictionary; Type keyType; Type valueType; if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IDictionary<,>), out _genericCollectionDefinitionType)) { keyType = _genericCollectionDefinitionType.GetGenericArguments()[0]; valueType = _genericCollectionDefinitionType.GetGenericArguments()[1]; } else { ReflectionUtils.GetDictionaryKeyValueTypes(UnderlyingType, out keyType, out valueType); } DictionaryKeyType = keyType; DictionaryValueType = valueType; if (DictionaryValueType != null) _isDictionaryValueTypeNullableType = ReflectionUtils.IsNullableType(DictionaryValueType); if (IsTypeGenericDictionaryInterface(UnderlyingType)) { CreatedType = ReflectionUtils.MakeGenericType(typeof(Dictionary<,>), keyType, valueType); } else if (UnderlyingType == typeof(IDictionary)) { CreatedType = typeof (Dictionary); } } internal IWrappedDictionary CreateWrapper(object dictionary) { if (dictionary is IDictionary && (DictionaryValueType == null || !_isDictionaryValueTypeNullableType)) return new DictionaryWrapper((IDictionary)dictionary); if (_genericWrapperCreator == null) { _genericWrapperType = ReflectionUtils.MakeGenericType(typeof(DictionaryWrapper<,>), DictionaryKeyType, DictionaryValueType); ConstructorInfo genericWrapperConstructor = _genericWrapperType.GetConstructor(new[] { _genericCollectionDefinitionType }); _genericWrapperCreator = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall(genericWrapperConstructor); } return (IWrappedDictionary)_genericWrapperCreator(null, dictionary); } private bool IsTypeGenericDictionaryInterface(Type type) { if (!type.IsGenericType()) return false; Type genericDefinition = type.GetGenericTypeDefinition(); return (genericDefinition == typeof(IDictionary<,>)); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs0000644000175000017500000000756212253423361032673 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) using System; using System.Globalization; using System.Runtime.Serialization; using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Linq; namespace Newtonsoft.Json.Serialization { internal class JsonFormatterConverter : IFormatterConverter { private readonly JsonSerializer _serializer; public JsonFormatterConverter(JsonSerializer serializer) { ValidationUtils.ArgumentNotNull(serializer, "serializer"); _serializer = serializer; } private T GetTokenValue(object value) { ValidationUtils.ArgumentNotNull(value, "value"); JValue v = (JValue)value; return (T)System.Convert.ChangeType(v.Value, typeof(T), CultureInfo.InvariantCulture); } public object Convert(object value, Type type) { ValidationUtils.ArgumentNotNull(value, "value"); JToken token = value as JToken; if (token == null) throw new ArgumentException("Value is not a JToken.", "value"); return _serializer.Deserialize(token.CreateReader(), type); } public object Convert(object value, TypeCode typeCode) { ValidationUtils.ArgumentNotNull(value, "value"); if (value is JValue) value = ((JValue) value).Value; return System.Convert.ChangeType(value, typeCode, CultureInfo.InvariantCulture); } public bool ToBoolean(object value) { return GetTokenValue(value); } public byte ToByte(object value) { return GetTokenValue(value); } public char ToChar(object value) { return GetTokenValue(value); } public DateTime ToDateTime(object value) { return GetTokenValue(value); } public decimal ToDecimal(object value) { return GetTokenValue(value); } public double ToDouble(object value) { return GetTokenValue(value); } public short ToInt16(object value) { return GetTokenValue(value); } public int ToInt32(object value) { return GetTokenValue(value); } public long ToInt64(object value) { return GetTokenValue(value); } public sbyte ToSByte(object value) { return GetTokenValue(value); } public float ToSingle(object value) { return GetTokenValue(value); } public string ToString(object value) { return GetTokenValue(value); } public ushort ToUInt16(object value) { return GetTokenValue(value); } public uint ToUInt32(object value) { return GetTokenValue(value); } public ulong ToUInt64(object value) { return GetTokenValue(value); } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonDynamicContract.cs0000644000175000017500000000451312253423361032113 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) using System; using System.Collections.Generic; using System.Reflection; using Newtonsoft.Json.Utilities; using System.Collections; namespace Newtonsoft.Json.Serialization { /// /// Contract details for a used by the . /// public class JsonDynamicContract : JsonContainerContract { /// /// Gets the object's properties. /// /// The object's properties. public JsonPropertyCollection Properties { get; private set; } /// /// Gets or sets the property name resolver. /// /// The property name resolver. public Func PropertyNameResolver { get; set; } /// /// Initializes a new instance of the class. /// /// The underlying type for the contract. public JsonDynamicContract(Type underlyingType) : base(underlyingType) { ContractType = JsonContractType.Dynamic; Properties = new JsonPropertyCollection(UnderlyingType); } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs0000644000175000017500000001245112253423361033445 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Runtime.Serialization; using System.Reflection; using System.Globalization; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Serialization { /// /// The default serialization binder used when resolving and loading classes from type names. /// public class DefaultSerializationBinder : SerializationBinder { internal static readonly DefaultSerializationBinder Instance = new DefaultSerializationBinder(); private readonly ThreadSafeStore _typeCache = new ThreadSafeStore(GetTypeFromTypeNameKey); private static Type GetTypeFromTypeNameKey(TypeNameKey typeNameKey) { string assemblyName = typeNameKey.AssemblyName; string typeName = typeNameKey.TypeName; if (assemblyName != null) { Assembly assembly; #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) // look, I don't like using obsolete methods as much as you do but this is the only way // Assembly.Load won't check the GAC for a partial name #pragma warning disable 618,612 assembly = Assembly.LoadWithPartialName(assemblyName); #pragma warning restore 618,612 #elif NETFX_CORE assembly = Assembly.Load(new AssemblyName(assemblyName)); #else assembly = Assembly.Load(assemblyName); #endif if (assembly == null) throw new JsonSerializationException("Could not load assembly '{0}'.".FormatWith(CultureInfo.InvariantCulture, assemblyName)); Type type = assembly.GetType(typeName); if (type == null) throw new JsonSerializationException("Could not find type '{0}' in assembly '{1}'.".FormatWith(CultureInfo.InvariantCulture, typeName, assembly.FullName)); return type; } else { return Type.GetType(typeName); } } internal struct TypeNameKey : IEquatable { internal readonly string AssemblyName; internal readonly string TypeName; public TypeNameKey(string assemblyName, string typeName) { AssemblyName = assemblyName; TypeName = typeName; } public override int GetHashCode() { return ((AssemblyName != null) ? AssemblyName.GetHashCode() : 0) ^ ((TypeName != null) ? TypeName.GetHashCode() : 0); } public override bool Equals(object obj) { if (!(obj is TypeNameKey)) return false; return Equals((TypeNameKey)obj); } public bool Equals(TypeNameKey other) { return (AssemblyName == other.AssemblyName && TypeName == other.TypeName); } } /// /// When overridden in a derived class, controls the binding of a serialized object to a type. /// /// Specifies the name of the serialized object. /// Specifies the name of the serialized object. /// /// The type of the object the formatter creates a new instance of. /// public override Type BindToType(string assemblyName, string typeName) { return _typeCache.Get(new TypeNameKey(assemblyName, typeName)); } #if !(NET35 || NET20) /// /// When overridden in a derived class, controls the binding of a serialized object to a type. /// /// The type of the object the formatter creates a new instance of. /// Specifies the name of the serialized object. /// Specifies the name of the serialized object. public override void BindToName(Type serializedType, out string assemblyName, out string typeName) { #if NETFX_CORE assemblyName = serializedType.GetTypeInfo().Assembly.FullName; typeName = serializedType.FullName; #elif !SILVERLIGHT assemblyName = serializedType.Assembly.FullName; typeName = serializedType.FullName; #else assemblyName = null; typeName = serializedType.AssemblyQualifiedName; #endif } #endif } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonProperty.cs0000644000175000017500000002024412253423361030654 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #endif namespace Newtonsoft.Json.Serialization { /// /// Maps a JSON property to a .NET member or constructor parameter. /// public class JsonProperty { internal Required? _required; // use to cache contract during deserialization internal JsonContract PropertyContract { get; set; } /// /// Gets or sets the name of the property. /// /// The name of the property. public string PropertyName { get; set; } /// /// Gets or sets the type that declared this property. /// /// The type that declared this property. public Type DeclaringType { get; set; } /// /// Gets or sets the order of serialization and deserialization of a member. /// /// The numeric order of serialization or deserialization. public int? Order { get; set; } /// /// Gets or sets the name of the underlying member or parameter. /// /// The name of the underlying member or parameter. public string UnderlyingName { get; set; } /// /// Gets the that will get and set the during serialization. /// /// The that will get and set the during serialization. public IValueProvider ValueProvider { get; set; } /// /// Gets or sets the type of the property. /// /// The type of the property. public Type PropertyType { get; set; } /// /// Gets or sets the for the property. /// If set this converter takes presidence over the contract converter for the property type. /// /// The converter. public JsonConverter Converter { get; set; } /// /// Gets the member converter. /// /// The member converter. public JsonConverter MemberConverter { get; set; } /// /// Gets a value indicating whether this is ignored. /// /// true if ignored; otherwise, false. public bool Ignored { get; set; } /// /// Gets a value indicating whether this is readable. /// /// true if readable; otherwise, false. public bool Readable { get; set; } /// /// Gets a value indicating whether this is writable. /// /// true if writable; otherwise, false. public bool Writable { get; set; } /// /// Gets a value indicating whether this has a member attribute. /// /// true if has a member attribute; otherwise, false. public bool HasMemberAttribute { get; set; } /// /// Gets the default value. /// /// The default value. public object DefaultValue { get; set; } /// /// Gets a value indicating whether this is required. /// /// A value indicating whether this is required. public Required Required { get { return _required ?? Required.Default; } set { _required = value; } } /// /// Gets a value indicating whether this property preserves object references. /// /// /// true if this instance is reference; otherwise, false. /// public bool? IsReference { get; set; } /// /// Gets the property null value handling. /// /// The null value handling. public NullValueHandling? NullValueHandling { get; set; } /// /// Gets the property default value handling. /// /// The default value handling. public DefaultValueHandling? DefaultValueHandling { get; set; } /// /// Gets the property reference loop handling. /// /// The reference loop handling. public ReferenceLoopHandling? ReferenceLoopHandling { get; set; } /// /// Gets the property object creation handling. /// /// The object creation handling. public ObjectCreationHandling? ObjectCreationHandling { get; set; } /// /// Gets or sets the type name handling. /// /// The type name handling. public TypeNameHandling? TypeNameHandling { get; set; } /// /// Gets or sets a predicate used to determine whether the property should be serialize. /// /// A predicate used to determine whether the property should be serialize. public Predicate ShouldSerialize { get; set; } /// /// Gets or sets a predicate used to determine whether the property should be serialized. /// /// A predicate used to determine whether the property should be serialized. public Predicate GetIsSpecified { get; set; } /// /// Gets or sets an action used to set whether the property has been deserialized. /// /// An action used to set whether the property has been deserialized. public Action SetIsSpecified { get; set; } /// /// Returns a that represents this instance. /// /// /// A that represents this instance. /// public override string ToString() { return PropertyName; } /// /// Gets or sets the converter used when serializing the property's collection items. /// /// The collection's items converter. public JsonConverter ItemConverter { get; set; } /// /// Gets or sets whether this property's collection items are serialized as a reference. /// /// Whether this property's collection items are serialized as a reference. public bool? ItemIsReference { get; set; } /// /// Gets or sets the the type name handling used when serializing the property's collection items. /// /// The collection's items type name handling. public TypeNameHandling? ItemTypeNameHandling { get; set; } /// /// Gets or sets the the reference loop handling used when serializing the property's collection items. /// /// The collection's items reference loop handling. public ReferenceLoopHandling? ItemReferenceLoopHandling { get; set; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ErrorContext.cs0000644000175000017500000000500312253423361030630 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json.Serialization { /// /// Provides information surrounding an error. /// public class ErrorContext { internal ErrorContext(object originalObject, object member, string path, Exception error) { OriginalObject = originalObject; Member = member; Error = error; Path = path; } /// /// Gets or sets the error. /// /// The error. public Exception Error { get; private set; } /// /// Gets the original object that caused the error. /// /// The original object that caused the error. public object OriginalObject { get; private set; } /// /// Gets the member that caused the error. /// /// The member that caused the error. public object Member { get; private set; } /// /// Gets the path of the JSON location where the error occurred. /// /// The path of the JSON location where the error occurred. public string Path { get; private set; } /// /// Gets or sets a value indicating whether this is handled. /// /// true if handled; otherwise, false. public bool Handled { get; set; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonContract.cs0000644000175000017500000001620212253423361030604 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Reflection; using System.Runtime.Serialization; using Newtonsoft.Json.Utilities; #if NETFX_CORE using IConvertible = Newtonsoft.Json.Utilities.Convertible; #endif namespace Newtonsoft.Json.Serialization { internal enum JsonContractType { None, Object, Array, Primitive, String, Dictionary, #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) Dynamic, #endif #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) Serializable, #endif Linq } /// /// Contract details for a used by the . /// public abstract class JsonContract { internal bool IsNullable; internal bool IsConvertable; internal Type NonNullableUnderlyingType; internal ReadType InternalReadType; internal JsonContractType ContractType; /// /// Gets the underlying type for the contract. /// /// The underlying type for the contract. public Type UnderlyingType { get; private set; } /// /// Gets or sets the type created during deserialization. /// /// The type created during deserialization. public Type CreatedType { get; set; } /// /// Gets or sets whether this type contract is serialized as a reference. /// /// Whether this type contract is serialized as a reference. public bool? IsReference { get; set; } /// /// Gets or sets the default for this contract. /// /// The converter. public JsonConverter Converter { get; set; } // internally specified JsonConverter's to override default behavour // checked for after passed in converters and attribute specified converters internal JsonConverter InternalConverter { get; set; } #if !PocketPC /// /// Gets or sets the method called immediately after deserialization of the object. /// /// The method called immediately after deserialization of the object. public MethodInfo OnDeserialized { get; set; } /// /// Gets or sets the method called during deserialization of the object. /// /// The method called during deserialization of the object. public MethodInfo OnDeserializing { get; set; } /// /// Gets or sets the method called after serialization of the object graph. /// /// The method called after serialization of the object graph. public MethodInfo OnSerialized { get; set; } /// /// Gets or sets the method called before serialization of the object. /// /// The method called before serialization of the object. public MethodInfo OnSerializing { get; set; } #endif /// /// Gets or sets the default creator method used to create the object. /// /// The default creator method used to create the object. public Func DefaultCreator { get; set; } /// /// Gets or sets a value indicating whether the default creator is non public. /// /// true if the default object creator is non-public; otherwise, false. public bool DefaultCreatorNonPublic { get; set; } /// /// Gets or sets the method called when an error is thrown during the serialization of the object. /// /// The method called when an error is thrown during the serialization of the object. public MethodInfo OnError { get; set; } internal void InvokeOnSerializing(object o, StreamingContext context) { #if !PocketPC if (OnSerializing != null) OnSerializing.Invoke(o, new object[] {context}); #endif } internal void InvokeOnSerialized(object o, StreamingContext context) { #if !PocketPC if (OnSerialized != null) OnSerialized.Invoke(o, new object[] {context}); #endif } internal void InvokeOnDeserializing(object o, StreamingContext context) { #if !PocketPC if (OnDeserializing != null) OnDeserializing.Invoke(o, new object[] {context}); #endif } internal void InvokeOnDeserialized(object o, StreamingContext context) { #if !PocketPC if (OnDeserialized != null) OnDeserialized.Invoke(o, new object[] {context}); #endif } internal void InvokeOnError(object o, StreamingContext context, ErrorContext errorContext) { if (OnError != null) OnError.Invoke(o, new object[] {context, errorContext}); } internal JsonContract(Type underlyingType) { ValidationUtils.ArgumentNotNull(underlyingType, "underlyingType"); UnderlyingType = underlyingType; IsNullable = ReflectionUtils.IsNullable(underlyingType); NonNullableUnderlyingType = (IsNullable && ReflectionUtils.IsNullableType(underlyingType)) ? Nullable.GetUnderlyingType(underlyingType) : underlyingType; CreatedType = NonNullableUnderlyingType; IsConvertable = ConvertUtils.IsConvertible(NonNullableUnderlyingType); if (NonNullableUnderlyingType == typeof(byte[])) { InternalReadType = ReadType.ReadAsBytes; } else if (NonNullableUnderlyingType == typeof(int)) { InternalReadType = ReadType.ReadAsInt32; } else if (NonNullableUnderlyingType == typeof(decimal)) { InternalReadType = ReadType.ReadAsDecimal; } else if (NonNullableUnderlyingType == typeof(string)) { InternalReadType = ReadType.ReadAsString; } else if (NonNullableUnderlyingType == typeof(DateTime)) { InternalReadType = ReadType.ReadAsDateTime; } #if !NET20 else if (NonNullableUnderlyingType == typeof(DateTimeOffset)) { InternalReadType = ReadType.ReadAsDateTimeOffset; } #endif else { InternalReadType = ReadType.Read; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs0000644000175000017500000013075212253423361033010 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; #if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE) using System.Collections.Concurrent; #endif using System.Collections.Generic; using System.ComponentModel; #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) using System.Dynamic; #endif using System.Globalization; using System.Reflection; using System.Runtime.Serialization; #if !(NETFX_CORE || PORTABLE) using System.Security.Permissions; #endif using System.Xml.Serialization; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Linq; using System.Runtime.CompilerServices; #if NETFX_CORE || PORTABLE using ICustomAttributeProvider = Newtonsoft.Json.Utilities.CustomAttributeProvider; #endif #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Serialization { internal struct ResolverContractKey : IEquatable { private readonly Type _resolverType; private readonly Type _contractType; public ResolverContractKey(Type resolverType, Type contractType) { _resolverType = resolverType; _contractType = contractType; } public override int GetHashCode() { return _resolverType.GetHashCode() ^ _contractType.GetHashCode(); } public override bool Equals(object obj) { if (!(obj is ResolverContractKey)) return false; return Equals((ResolverContractKey)obj); } public bool Equals(ResolverContractKey other) { return (_resolverType == other._resolverType && _contractType == other._contractType); } } /// /// Used by to resolves a for a given . /// public class DefaultContractResolver : IContractResolver { private static readonly IContractResolver _instance = new DefaultContractResolver(true); internal static IContractResolver Instance { get { return _instance; } } private static readonly IList BuiltInConverters = new List { #if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE) new EntityKeyMemberConverter(), #endif #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) new ExpandoObjectConverter(), #endif #if (!(SILVERLIGHT || PORTABLE) || WINDOWS_PHONE) new XmlNodeConverter(), #endif #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) new BinaryConverter(), new DataSetConverter(), new DataTableConverter(), #endif new KeyValuePairConverter(), new BsonObjectIdConverter() }; private static Dictionary _sharedContractCache; private static readonly object _typeContractCacheLock = new object(); private Dictionary _instanceContractCache; private readonly bool _sharedCache; /// /// Gets a value indicating whether members are being get and set using dynamic code generation. /// This value is determined by the runtime permissions available. /// /// /// true if using dynamic code generation; otherwise, false. /// public bool DynamicCodeGeneration { get { return JsonTypeReflector.DynamicCodeGeneration; } } #if !NETFX_CORE /// /// Gets or sets the default members search flags. /// /// The default members search flags. public BindingFlags DefaultMembersSearchFlags { get; set; } #else private BindingFlags DefaultMembersSearchFlags = BindingFlags.Instance | BindingFlags.Public; #endif /// /// Gets or sets a value indicating whether compiler generated members should be serialized. /// /// /// true if serialized compiler generated members; otherwise, false. /// public bool SerializeCompilerGeneratedMembers { get; set; } #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) /// /// Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. /// /// /// true if the interface will be ignored when serializing and deserializing types; otherwise, false. /// public bool IgnoreSerializableInterface { get; set; } /// /// Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. /// /// /// true if the attribute will be ignored when serializing and deserializing types; otherwise, false. /// public bool IgnoreSerializableAttribute { get; set; } #endif /// /// Initializes a new instance of the class. /// public DefaultContractResolver() : this(false) { } /// /// Initializes a new instance of the class. /// /// /// If set to true the will use a cached shared with other resolvers of the same type. /// Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected /// behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly /// recommended to reuse instances with the . /// public DefaultContractResolver(bool shareCache) { #if !NETFX_CORE DefaultMembersSearchFlags = BindingFlags.Public | BindingFlags.Instance; #endif #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) IgnoreSerializableAttribute = true; #endif _sharedCache = shareCache; } private Dictionary GetCache() { if (_sharedCache) return _sharedContractCache; else return _instanceContractCache; } private void UpdateCache(Dictionary cache) { if (_sharedCache) _sharedContractCache = cache; else _instanceContractCache = cache; } /// /// Resolves the contract for a given type. /// /// The type to resolve a contract for. /// The contract for a given type. public virtual JsonContract ResolveContract(Type type) { if (type == null) throw new ArgumentNullException("type"); JsonContract contract; ResolverContractKey key = new ResolverContractKey(GetType(), type); Dictionary cache = GetCache(); if (cache == null || !cache.TryGetValue(key, out contract)) { contract = CreateContract(type); // avoid the possibility of modifying the cache dictionary while another thread is accessing it lock (_typeContractCacheLock) { cache = GetCache(); Dictionary updatedCache = (cache != null) ? new Dictionary(cache) : new Dictionary(); updatedCache[key] = contract; UpdateCache(updatedCache); } } return contract; } /// /// Gets the serializable members for the type. /// /// The type to get serializable members for. /// The serializable members for the type. protected virtual List GetSerializableMembers(Type objectType) { bool ignoreSerializableAttribute; #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) ignoreSerializableAttribute = IgnoreSerializableAttribute; #else ignoreSerializableAttribute = true; #endif MemberSerialization memberSerialization = JsonTypeReflector.GetObjectMemberSerialization(objectType, ignoreSerializableAttribute); List allMembers = ReflectionUtils.GetFieldsAndProperties(objectType, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static) .Where(m => !ReflectionUtils.IsIndexedProperty(m)).ToList(); List serializableMembers = new List(); if (memberSerialization != MemberSerialization.Fields) { #if !PocketPC && !NET20 DataContractAttribute dataContractAttribute = JsonTypeReflector.GetDataContractAttribute(objectType); #endif List defaultMembers = ReflectionUtils.GetFieldsAndProperties(objectType, DefaultMembersSearchFlags) .Where(m => !ReflectionUtils.IsIndexedProperty(m)).ToList(); foreach (MemberInfo member in allMembers) { // exclude members that are compiler generated if set if (SerializeCompilerGeneratedMembers || !member.IsDefined(typeof (CompilerGeneratedAttribute), true)) { if (defaultMembers.Contains(member)) { // add all members that are found by default member search serializableMembers.Add(member); } else { // add members that are explicitly marked with JsonProperty/DataMember attribute // or are a field if serializing just fields if (JsonTypeReflector.GetAttribute(member.GetCustomAttributeProvider()) != null) serializableMembers.Add(member); #if !PocketPC && !NET20 else if (dataContractAttribute != null && JsonTypeReflector.GetAttribute(member.GetCustomAttributeProvider()) != null) serializableMembers.Add(member); #endif else if (memberSerialization == MemberSerialization.Fields && member.MemberType() == MemberTypes.Field) serializableMembers.Add(member); } } } #if !PocketPC && !SILVERLIGHT && !NET20 Type match; // don't include EntityKey on entities objects... this is a bit hacky if (objectType.AssignableToTypeName("System.Data.Objects.DataClasses.EntityObject", out match)) serializableMembers = serializableMembers.Where(ShouldSerializeEntityMember).ToList(); #endif } else { // serialize all fields foreach (MemberInfo member in allMembers) { if (member.MemberType() == MemberTypes.Field) serializableMembers.Add(member); } } return serializableMembers; } #if !PocketPC && !SILVERLIGHT && !NET20 private bool ShouldSerializeEntityMember(MemberInfo memberInfo) { PropertyInfo propertyInfo = memberInfo as PropertyInfo; if (propertyInfo != null) { if (propertyInfo.PropertyType.IsGenericType() && propertyInfo.PropertyType.GetGenericTypeDefinition().FullName == "System.Data.Objects.DataClasses.EntityReference`1") return false; } return true; } #endif /// /// Creates a for the given type. /// /// Type of the object. /// A for the given type. protected virtual JsonObjectContract CreateObjectContract(Type objectType) { JsonObjectContract contract = new JsonObjectContract(objectType); InitializeContract(contract); bool ignoreSerializableAttribute; #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) ignoreSerializableAttribute = IgnoreSerializableAttribute; #else ignoreSerializableAttribute = true; #endif contract.MemberSerialization = JsonTypeReflector.GetObjectMemberSerialization(contract.NonNullableUnderlyingType, ignoreSerializableAttribute); contract.Properties.AddRange(CreateProperties(contract.NonNullableUnderlyingType, contract.MemberSerialization)); JsonObjectAttribute attribute = JsonTypeReflector.GetJsonObjectAttribute(contract.NonNullableUnderlyingType); if (attribute != null) contract.ItemRequired = attribute._itemRequired; // check if a JsonConstructorAttribute has been defined and use that if (contract.NonNullableUnderlyingType.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Any(c => c.IsDefined(typeof(JsonConstructorAttribute), true))) { ConstructorInfo constructor = GetAttributeConstructor(contract.NonNullableUnderlyingType); if (constructor != null) { contract.OverrideConstructor = constructor; contract.ConstructorParameters.AddRange(CreateConstructorParameters(constructor, contract.Properties)); } } else if (contract.MemberSerialization == MemberSerialization.Fields) { #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) // mimic DataContractSerializer behaviour when populating fields by overriding default creator to create an uninitialized object // note that this is only possible when the application is fully trusted so fall back to using the default constructor (if available) in partial trust if (JsonTypeReflector.FullyTrusted) contract.DefaultCreator = contract.GetUninitializedObject; #endif } else if (contract.DefaultCreator == null || contract.DefaultCreatorNonPublic) { ConstructorInfo constructor = GetParametrizedConstructor(contract.NonNullableUnderlyingType); if (constructor != null) { contract.ParametrizedConstructor = constructor; contract.ConstructorParameters.AddRange(CreateConstructorParameters(constructor, contract.Properties)); } } return contract; } private ConstructorInfo GetAttributeConstructor(Type objectType) { IList markedConstructors = objectType.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Where(c => c.IsDefined(typeof(JsonConstructorAttribute), true)).ToList(); if (markedConstructors.Count > 1) throw new JsonException("Multiple constructors with the JsonConstructorAttribute."); else if (markedConstructors.Count == 1) return markedConstructors[0]; return null; } private ConstructorInfo GetParametrizedConstructor(Type objectType) { IList constructors = objectType.GetConstructors(BindingFlags.Public | BindingFlags.Instance).ToList(); if (constructors.Count == 1) return constructors[0]; else return null; } /// /// Creates the constructor parameters. /// /// The constructor to create properties for. /// The type's member properties. /// Properties for the given . protected virtual IList CreateConstructorParameters(ConstructorInfo constructor, JsonPropertyCollection memberProperties) { var constructorParameters = constructor.GetParameters(); JsonPropertyCollection parameterCollection = new JsonPropertyCollection(constructor.DeclaringType); foreach (ParameterInfo parameterInfo in constructorParameters) { JsonProperty matchingMemberProperty = memberProperties.GetClosestMatchProperty(parameterInfo.Name); // type must match as well as name if (matchingMemberProperty != null && matchingMemberProperty.PropertyType != parameterInfo.ParameterType) matchingMemberProperty = null; JsonProperty property = CreatePropertyFromConstructorParameter(matchingMemberProperty, parameterInfo); if (property != null) { parameterCollection.AddProperty(property); } } return parameterCollection; } /// /// Creates a for the given . /// /// The matching member property. /// The constructor parameter. /// A created for the given . protected virtual JsonProperty CreatePropertyFromConstructorParameter(JsonProperty matchingMemberProperty, ParameterInfo parameterInfo) { JsonProperty property = new JsonProperty(); property.PropertyType = parameterInfo.ParameterType; bool allowNonPublicAccess; SetPropertySettingsFromAttributes(property, parameterInfo.GetCustomAttributeProvider(), parameterInfo.Name, parameterInfo.Member.DeclaringType, MemberSerialization.OptOut, out allowNonPublicAccess); property.Readable = false; property.Writable = true; // "inherit" values from matching member property if unset on parameter if (matchingMemberProperty != null) { property.PropertyName = (property.PropertyName != parameterInfo.Name) ? property.PropertyName : matchingMemberProperty.PropertyName; property.Converter = property.Converter ?? matchingMemberProperty.Converter; property.MemberConverter = property.MemberConverter ?? matchingMemberProperty.MemberConverter; property.DefaultValue = property.DefaultValue ?? matchingMemberProperty.DefaultValue; property._required = property._required ?? matchingMemberProperty._required; property.IsReference = property.IsReference ?? matchingMemberProperty.IsReference; property.NullValueHandling = property.NullValueHandling ?? matchingMemberProperty.NullValueHandling; property.DefaultValueHandling = property.DefaultValueHandling ?? matchingMemberProperty.DefaultValueHandling; property.ReferenceLoopHandling = property.ReferenceLoopHandling ?? matchingMemberProperty.ReferenceLoopHandling; property.ObjectCreationHandling = property.ObjectCreationHandling ?? matchingMemberProperty.ObjectCreationHandling; property.TypeNameHandling = property.TypeNameHandling ?? matchingMemberProperty.TypeNameHandling; } return property; } /// /// Resolves the default for the contract. /// /// Type of the object. /// The contract's default . protected virtual JsonConverter ResolveContractConverter(Type objectType) { return JsonTypeReflector.GetJsonConverter(objectType.GetCustomAttributeProvider(), objectType); } private Func GetDefaultCreator(Type createdType) { return JsonTypeReflector.ReflectionDelegateFactory.CreateDefaultConstructor(createdType); } #if !PocketPC && !NET20 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Portability", "CA1903:UseOnlyApiFromTargetedFramework", MessageId = "System.Runtime.Serialization.DataContractAttribute.#get_IsReference()")] #endif private void InitializeContract(JsonContract contract) { JsonContainerAttribute containerAttribute = JsonTypeReflector.GetJsonContainerAttribute(contract.NonNullableUnderlyingType); if (containerAttribute != null) { contract.IsReference = containerAttribute._isReference; } #if !PocketPC && !NET20 else { DataContractAttribute dataContractAttribute = JsonTypeReflector.GetDataContractAttribute(contract.NonNullableUnderlyingType); // doesn't have a null value if (dataContractAttribute != null && dataContractAttribute.IsReference) contract.IsReference = true; } #endif contract.Converter = ResolveContractConverter(contract.NonNullableUnderlyingType); // then see whether object is compadible with any of the built in converters contract.InternalConverter = JsonSerializer.GetMatchingConverter(BuiltInConverters, contract.NonNullableUnderlyingType); if (ReflectionUtils.HasDefaultConstructor(contract.CreatedType, true) || contract.CreatedType.IsValueType()) { contract.DefaultCreator = GetDefaultCreator(contract.CreatedType); contract.DefaultCreatorNonPublic = (!contract.CreatedType.IsValueType() && ReflectionUtils.GetDefaultConstructor(contract.CreatedType) == null); } ResolveCallbackMethods(contract, contract.NonNullableUnderlyingType); } private void ResolveCallbackMethods(JsonContract contract, Type t) { if (t.BaseType() != null) ResolveCallbackMethods(contract, t.BaseType()); MethodInfo onSerializing; MethodInfo onSerialized; MethodInfo onDeserializing; MethodInfo onDeserialized; MethodInfo onError; GetCallbackMethodsForType(t, out onSerializing, out onSerialized, out onDeserializing, out onDeserialized, out onError); if (onSerializing != null) { #if NETFX_CORE if (!t.IsGenericType() || (t.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>))) contract.OnSerializing = onSerializing; #else contract.OnSerializing = onSerializing; #endif } if (onSerialized != null) contract.OnSerialized = onSerialized; if (onDeserializing != null) contract.OnDeserializing = onDeserializing; if (onDeserialized != null) { // ConcurrentDictionary throws an error here so don't use its OnDeserialized - http://json.codeplex.com/discussions/257093 #if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE) if (!t.IsGenericType() || (t.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>))) contract.OnDeserialized = onDeserialized; #else contract.OnDeserialized = onDeserialized; #endif } if (onError != null) contract.OnError = onError; } private void GetCallbackMethodsForType(Type type, out MethodInfo onSerializing, out MethodInfo onSerialized, out MethodInfo onDeserializing, out MethodInfo onDeserialized, out MethodInfo onError) { onSerializing = null; onSerialized = null; onDeserializing = null; onDeserialized = null; onError = null; foreach (MethodInfo method in type.GetMethods(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) { // compact framework errors when getting parameters for a generic method // lame, but generic methods should not be callbacks anyway if (method.ContainsGenericParameters) continue; Type prevAttributeType = null; ParameterInfo[] parameters = method.GetParameters(); if (IsValidCallback(method, parameters, typeof(OnSerializingAttribute), onSerializing, ref prevAttributeType)) { onSerializing = method; } if (IsValidCallback(method, parameters, typeof(OnSerializedAttribute), onSerialized, ref prevAttributeType)) { onSerialized = method; } if (IsValidCallback(method, parameters, typeof(OnDeserializingAttribute), onDeserializing, ref prevAttributeType)) { onDeserializing = method; } if (IsValidCallback(method, parameters, typeof(OnDeserializedAttribute), onDeserialized, ref prevAttributeType)) { onDeserialized = method; } if (IsValidCallback(method, parameters, typeof(OnErrorAttribute), onError, ref prevAttributeType)) { onError = method; } } } /// /// Creates a for the given type. /// /// Type of the object. /// A for the given type. protected virtual JsonDictionaryContract CreateDictionaryContract(Type objectType) { JsonDictionaryContract contract = new JsonDictionaryContract(objectType); InitializeContract(contract); contract.PropertyNameResolver = ResolvePropertyName; return contract; } /// /// Creates a for the given type. /// /// Type of the object. /// A for the given type. protected virtual JsonArrayContract CreateArrayContract(Type objectType) { JsonArrayContract contract = new JsonArrayContract(objectType); InitializeContract(contract); return contract; } /// /// Creates a for the given type. /// /// Type of the object. /// A for the given type. protected virtual JsonPrimitiveContract CreatePrimitiveContract(Type objectType) { JsonPrimitiveContract contract = new JsonPrimitiveContract(objectType); InitializeContract(contract); return contract; } /// /// Creates a for the given type. /// /// Type of the object. /// A for the given type. protected virtual JsonLinqContract CreateLinqContract(Type objectType) { JsonLinqContract contract = new JsonLinqContract(objectType); InitializeContract(contract); return contract; } #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) /// /// Creates a for the given type. /// /// Type of the object. /// A for the given type. protected virtual JsonISerializableContract CreateISerializableContract(Type objectType) { JsonISerializableContract contract = new JsonISerializableContract(objectType); InitializeContract(contract); ConstructorInfo constructorInfo = contract.NonNullableUnderlyingType.GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, new[] { typeof(SerializationInfo), typeof(StreamingContext) }, null); if (constructorInfo != null) { MethodCall methodCall = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall(constructorInfo); contract.ISerializableCreator = (args => methodCall(null, args)); } return contract; } #endif #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) /// /// Creates a for the given type. /// /// Type of the object. /// A for the given type. protected virtual JsonDynamicContract CreateDynamicContract(Type objectType) { JsonDynamicContract contract = new JsonDynamicContract(objectType); InitializeContract(contract); contract.PropertyNameResolver = ResolvePropertyName; contract.Properties.AddRange(CreateProperties(objectType, MemberSerialization.OptOut)); return contract; } #endif /// /// Creates a for the given type. /// /// Type of the object. /// A for the given type. protected virtual JsonStringContract CreateStringContract(Type objectType) { JsonStringContract contract = new JsonStringContract(objectType); InitializeContract(contract); return contract; } /// /// Determines which contract type is created for the given type. /// /// Type of the object. /// A for the given type. protected virtual JsonContract CreateContract(Type objectType) { Type t = ReflectionUtils.EnsureNotNullableType(objectType); if (JsonConvert.IsJsonPrimitiveType(t)) return CreatePrimitiveContract(objectType); if (JsonTypeReflector.GetJsonObjectAttribute(t) != null) return CreateObjectContract(objectType); if (JsonTypeReflector.GetJsonArrayAttribute(t) != null) return CreateArrayContract(objectType); if (JsonTypeReflector.GetJsonDictionaryAttribute(t) != null) return CreateDictionaryContract(objectType); if (t == typeof(JToken) || t.IsSubclassOf(typeof(JToken))) return CreateLinqContract(objectType); if (CollectionUtils.IsDictionaryType(t)) return CreateDictionaryContract(objectType); if (typeof(IEnumerable).IsAssignableFrom(t)) return CreateArrayContract(objectType); if (CanConvertToString(t)) return CreateStringContract(objectType); #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) if (!IgnoreSerializableInterface && typeof(ISerializable).IsAssignableFrom(t)) return CreateISerializableContract(objectType); #endif #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) if (typeof(IDynamicMetaObjectProvider).IsAssignableFrom(t)) return CreateDynamicContract(objectType); #endif return CreateObjectContract(objectType); } internal static bool CanConvertToString(Type type) { #if !(NETFX_CORE || PORTABLE) TypeConverter converter = ConvertUtils.GetConverter(type); // use the objectType's TypeConverter if it has one and can convert to a string if (converter != null #if !SILVERLIGHT && !(converter is ComponentConverter) && !(converter is ReferenceConverter) #endif && converter.GetType() != typeof(TypeConverter)) { if (converter.CanConvertTo(typeof(string))) return true; } #endif if (type == typeof(Type) || type.IsSubclassOf(typeof(Type))) return true; #if SILVERLIGHT || PocketPC if (type == typeof(Guid) || type == typeof(Uri) || type == typeof(TimeSpan)) return true; #endif return false; } private static bool IsValidCallback(MethodInfo method, ParameterInfo[] parameters, Type attributeType, MethodInfo currentCallback, ref Type prevAttributeType) { if (!method.IsDefined(attributeType, false)) return false; if (currentCallback != null) throw new JsonException("Invalid attribute. Both '{0}' and '{1}' in type '{2}' have '{3}'.".FormatWith(CultureInfo.InvariantCulture, method, currentCallback, GetClrTypeFullName(method.DeclaringType), attributeType)); if (prevAttributeType != null) throw new JsonException("Invalid Callback. Method '{3}' in type '{2}' has both '{0}' and '{1}'.".FormatWith(CultureInfo.InvariantCulture, prevAttributeType, attributeType, GetClrTypeFullName(method.DeclaringType), method)); if (method.IsVirtual) throw new JsonException("Virtual Method '{0}' of type '{1}' cannot be marked with '{2}' attribute.".FormatWith(CultureInfo.InvariantCulture, method, GetClrTypeFullName(method.DeclaringType), attributeType)); if (method.ReturnType != typeof(void)) throw new JsonException("Serialization Callback '{1}' in type '{0}' must return void.".FormatWith(CultureInfo.InvariantCulture, GetClrTypeFullName(method.DeclaringType), method)); if (attributeType == typeof(OnErrorAttribute)) { if (parameters == null || parameters.Length != 2 || parameters[0].ParameterType != typeof(StreamingContext) || parameters[1].ParameterType != typeof(ErrorContext)) throw new JsonException("Serialization Error Callback '{1}' in type '{0}' must have two parameters of type '{2}' and '{3}'.".FormatWith(CultureInfo.InvariantCulture, GetClrTypeFullName(method.DeclaringType), method, typeof(StreamingContext), typeof(ErrorContext))); } else { if (parameters == null || parameters.Length != 1 || parameters[0].ParameterType != typeof(StreamingContext)) throw new JsonException("Serialization Callback '{1}' in type '{0}' must have a single parameter of type '{2}'.".FormatWith(CultureInfo.InvariantCulture, GetClrTypeFullName(method.DeclaringType), method, typeof(StreamingContext))); } prevAttributeType = attributeType; return true; } internal static string GetClrTypeFullName(Type type) { if (type.IsGenericTypeDefinition() || !type.ContainsGenericParameters()) return type.FullName; return string.Format(CultureInfo.InvariantCulture, "{0}.{1}", new object[] { type.Namespace, type.Name }); } /// /// Creates properties for the given . /// /// The type to create properties for. /// /// The member serialization mode for the type. /// Properties for the given . protected virtual IList CreateProperties(Type type, MemberSerialization memberSerialization) { List members = GetSerializableMembers(type); if (members == null) throw new JsonSerializationException("Null collection of seralizable members returned."); JsonPropertyCollection properties = new JsonPropertyCollection(type); foreach (MemberInfo member in members) { JsonProperty property = CreateProperty(member, memberSerialization); if (property != null) properties.AddProperty(property); } IList orderedProperties = properties.OrderBy(p => p.Order ?? -1).ToList(); return orderedProperties; } /// /// Creates the used by the serializer to get and set values from a member. /// /// The member. /// The used by the serializer to get and set values from a member. protected virtual IValueProvider CreateMemberValueProvider(MemberInfo member) { // warning - this method use to cause errors with Intellitrace. Retest in VS Ultimate after changes IValueProvider valueProvider; #if !(SILVERLIGHT || PORTABLE || NETFX_CORE) if (DynamicCodeGeneration) valueProvider = new DynamicValueProvider(member); else valueProvider = new ReflectionValueProvider(member); #else valueProvider = new ReflectionValueProvider(member); #endif return valueProvider; } /// /// Creates a for the given . /// /// The member's parent . /// The member to create a for. /// A created for the given . protected virtual JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) { JsonProperty property = new JsonProperty(); property.PropertyType = ReflectionUtils.GetMemberUnderlyingType(member); property.DeclaringType = member.DeclaringType; property.ValueProvider = CreateMemberValueProvider(member); bool allowNonPublicAccess; SetPropertySettingsFromAttributes(property, member.GetCustomAttributeProvider(), member.Name, member.DeclaringType, memberSerialization, out allowNonPublicAccess); if (memberSerialization != MemberSerialization.Fields) { property.Readable = ReflectionUtils.CanReadMemberValue(member, allowNonPublicAccess); property.Writable = ReflectionUtils.CanSetMemberValue(member, allowNonPublicAccess, property.HasMemberAttribute); } else { // write to readonly fields property.Readable = true; property.Writable = true; } property.ShouldSerialize = CreateShouldSerializeTest(member); SetIsSpecifiedActions(property, member, allowNonPublicAccess); return property; } private void SetPropertySettingsFromAttributes(JsonProperty property, ICustomAttributeProvider attributeProvider, string name, Type declaringType, MemberSerialization memberSerialization, out bool allowNonPublicAccess) { #if !PocketPC && !NET20 DataContractAttribute dataContractAttribute = JsonTypeReflector.GetDataContractAttribute(declaringType); MemberInfo memberInfo = null; #if !(NETFX_CORE || PORTABLE) memberInfo = attributeProvider as MemberInfo; #else memberInfo = attributeProvider.UnderlyingObject as MemberInfo; #endif DataMemberAttribute dataMemberAttribute; if (dataContractAttribute != null && memberInfo != null) dataMemberAttribute = JsonTypeReflector.GetDataMemberAttribute((MemberInfo) memberInfo); else dataMemberAttribute = null; #endif JsonPropertyAttribute propertyAttribute = JsonTypeReflector.GetAttribute(attributeProvider); if (propertyAttribute != null) property.HasMemberAttribute = true; string mappedName; if (propertyAttribute != null && propertyAttribute.PropertyName != null) mappedName = propertyAttribute.PropertyName; #if !PocketPC && !NET20 else if (dataMemberAttribute != null && dataMemberAttribute.Name != null) mappedName = dataMemberAttribute.Name; #endif else mappedName = name; property.PropertyName = ResolvePropertyName(mappedName); property.UnderlyingName = name; bool hasMemberAttribute = false; if (propertyAttribute != null) { property._required = propertyAttribute._required; property.Order = propertyAttribute._order; hasMemberAttribute = true; } #if !PocketPC && !NET20 else if (dataMemberAttribute != null) { property._required = (dataMemberAttribute.IsRequired) ? Required.AllowNull : Required.Default; property.Order = (dataMemberAttribute.Order != -1) ? (int?) dataMemberAttribute.Order : null; hasMemberAttribute = true; } #endif bool hasJsonIgnoreAttribute = JsonTypeReflector.GetAttribute(attributeProvider) != null #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) || JsonTypeReflector.GetAttribute(attributeProvider) != null #endif ; if (memberSerialization != MemberSerialization.OptIn) { bool hasIgnoreDataMemberAttribute = false; #if !(NET20 || NET35) hasIgnoreDataMemberAttribute = (JsonTypeReflector.GetAttribute(attributeProvider) != null); #endif // ignored if it has JsonIgnore or NonSerialized or IgnoreDataMember attributes property.Ignored = (hasJsonIgnoreAttribute || hasIgnoreDataMemberAttribute); } else { // ignored if it has JsonIgnore/NonSerialized or does not have DataMember or JsonProperty attributes property.Ignored = (hasJsonIgnoreAttribute || !hasMemberAttribute); } // resolve converter for property // the class type might have a converter but the property converter takes presidence property.Converter = JsonTypeReflector.GetJsonConverter(attributeProvider, property.PropertyType); property.MemberConverter = JsonTypeReflector.GetJsonConverter(attributeProvider, property.PropertyType); DefaultValueAttribute defaultValueAttribute = JsonTypeReflector.GetAttribute(attributeProvider); property.DefaultValue = (defaultValueAttribute != null) ? defaultValueAttribute.Value : null; property.NullValueHandling = (propertyAttribute != null) ? propertyAttribute._nullValueHandling : null; property.DefaultValueHandling = (propertyAttribute != null) ? propertyAttribute._defaultValueHandling : null; property.ReferenceLoopHandling = (propertyAttribute != null) ? propertyAttribute._referenceLoopHandling : null; property.ObjectCreationHandling = (propertyAttribute != null) ? propertyAttribute._objectCreationHandling : null; property.TypeNameHandling = (propertyAttribute != null) ? propertyAttribute._typeNameHandling : null; property.IsReference = (propertyAttribute != null) ? propertyAttribute._isReference : null; property.ItemIsReference = (propertyAttribute != null) ? propertyAttribute._itemIsReference : null; property.ItemConverter = (propertyAttribute != null && propertyAttribute.ItemConverterType != null) ? JsonConverterAttribute.CreateJsonConverterInstance(propertyAttribute.ItemConverterType) : null; property.ItemReferenceLoopHandling = (propertyAttribute != null) ? propertyAttribute._itemReferenceLoopHandling : null; property.ItemTypeNameHandling = (propertyAttribute != null) ? propertyAttribute._itemTypeNameHandling : null; allowNonPublicAccess = false; if ((DefaultMembersSearchFlags & BindingFlags.NonPublic) == BindingFlags.NonPublic) allowNonPublicAccess = true; if (propertyAttribute != null) allowNonPublicAccess = true; if (memberSerialization == MemberSerialization.Fields) allowNonPublicAccess = true; #if !PocketPC && !NET20 if (dataMemberAttribute != null) { allowNonPublicAccess = true; property.HasMemberAttribute = true; } #endif } private Predicate CreateShouldSerializeTest(MemberInfo member) { MethodInfo shouldSerializeMethod = member.DeclaringType.GetMethod(JsonTypeReflector.ShouldSerializePrefix + member.Name, ReflectionUtils.EmptyTypes); if (shouldSerializeMethod == null || shouldSerializeMethod.ReturnType != typeof(bool)) return null; MethodCall shouldSerializeCall = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall(shouldSerializeMethod); return o => (bool)shouldSerializeCall(o); } private void SetIsSpecifiedActions(JsonProperty property, MemberInfo member, bool allowNonPublicAccess) { MemberInfo specifiedMember = member.DeclaringType.GetProperty(member.Name + JsonTypeReflector.SpecifiedPostfix); if (specifiedMember == null) specifiedMember = member.DeclaringType.GetField(member.Name + JsonTypeReflector.SpecifiedPostfix); if (specifiedMember == null || ReflectionUtils.GetMemberUnderlyingType(specifiedMember) != typeof(bool)) { return; } Func specifiedPropertyGet = JsonTypeReflector.ReflectionDelegateFactory.CreateGet(specifiedMember); property.GetIsSpecified = o => (bool)specifiedPropertyGet(o); if (ReflectionUtils.CanSetMemberValue(specifiedMember, allowNonPublicAccess, false)) property.SetIsSpecified = JsonTypeReflector.ReflectionDelegateFactory.CreateSet(specifiedMember); } /// /// Resolves the name of the property. /// /// Name of the property. /// Name of the property. protected internal virtual string ResolvePropertyName(string propertyName) { return propertyName; } /// /// Gets the resolved name of the property. /// /// Name of the property. /// Name of the property. public string GetResolvedPropertyName(string propertyName) { // this is a new method rather than changing the visibility of ResolvePropertyName to avoid // a breaking change for anyone who has overidden the method return ResolvePropertyName(propertyName); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonPropertyCollection.cs0000644000175000017500000001272312253423361032673 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Text; using System.Collections.ObjectModel; using Newtonsoft.Json.Utilities; using System.Globalization; namespace Newtonsoft.Json.Serialization { /// /// A collection of objects. /// public class JsonPropertyCollection : KeyedCollection { private readonly Type _type; /// /// Initializes a new instance of the class. /// /// The type. public JsonPropertyCollection(Type type) : base(StringComparer.Ordinal) { ValidationUtils.ArgumentNotNull(type, "type"); _type = type; } /// /// When implemented in a derived class, extracts the key from the specified element. /// /// The element from which to extract the key. /// The key for the specified element. protected override string GetKeyForItem(JsonProperty item) { return item.PropertyName; } /// /// Adds a object. /// /// The property to add to the collection. public void AddProperty(JsonProperty property) { if (Contains(property.PropertyName)) { // don't overwrite existing property with ignored property if (property.Ignored) return; JsonProperty existingProperty = this[property.PropertyName]; bool duplicateProperty = true; if (existingProperty.Ignored) { // remove ignored property so it can be replaced in collection Remove(existingProperty); duplicateProperty = false; } if (property.DeclaringType != null && existingProperty.DeclaringType != null) { if (property.DeclaringType.IsSubclassOf(existingProperty.DeclaringType)) { // current property is on a derived class and hides the existing Remove(existingProperty); duplicateProperty = false; } if (existingProperty.DeclaringType.IsSubclassOf(property.DeclaringType)) { // current property is hidden by the existing so don't add it return; } } if (duplicateProperty) throw new JsonSerializationException("A member with the name '{0}' already exists on '{1}'. Use the JsonPropertyAttribute to specify another name.".FormatWith(CultureInfo.InvariantCulture, property.PropertyName, _type)); } Add(property); } /// /// Gets the closest matching object. /// First attempts to get an exact case match of propertyName and then /// a case insensitive match. /// /// Name of the property. /// A matching property if found. public JsonProperty GetClosestMatchProperty(string propertyName) { JsonProperty property = GetProperty(propertyName, StringComparison.Ordinal); if (property == null) property = GetProperty(propertyName, StringComparison.OrdinalIgnoreCase); return property; } private bool TryGetValue(string key, out JsonProperty item) { if (Dictionary == null) { item = default(JsonProperty); return false; } return Dictionary.TryGetValue(key, out item); } /// /// Gets a property by property name. /// /// The name of the property to get. /// Type property name string comparison. /// A matching property if found. public JsonProperty GetProperty(string propertyName, StringComparison comparisonType) { // KeyedCollection has an ordinal comparer if (comparisonType == StringComparison.Ordinal) { JsonProperty property; if (TryGetValue(propertyName, out property)) return property; return null; } foreach (JsonProperty property in this) { if (string.Equals(propertyName, property.PropertyName, comparisonType)) { return property; } } return null; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/IReferenceResolver.cs0000644000175000017500000000535212253423361031732 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json.Serialization { /// /// Used to resolve references when serializing and deserializing JSON by the . /// public interface IReferenceResolver { /// /// Resolves a reference to its object. /// /// The serialization context. /// The reference to resolve. /// The object that object ResolveReference(object context, string reference); /// /// Gets the reference for the sepecified object. /// /// The serialization context. /// The object to get a reference for. /// The reference to the object. string GetReference(object context, object value); /// /// Determines whether the specified object is referenced. /// /// The serialization context. /// The object to test for a reference. /// /// true if the specified object is referenced; otherwise, false. /// bool IsReferenced(object context, object value); /// /// Adds a reference to the specified object. /// /// The serialization context. /// The reference. /// The object to reference. void AddReference(object context, string reference, object value); } }CamelCasePropertyNamesContractResolver.cs0000644000175000017500000000403712253423361035707 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Globalization; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Serialization { /// /// Resolves member mappings for a type, camel casing property names. /// public class CamelCasePropertyNamesContractResolver : DefaultContractResolver { /// /// Initializes a new instance of the class. /// public CamelCasePropertyNamesContractResolver() : base(true) { } /// /// Resolves the name of the property. /// /// Name of the property. /// The property name camel cased. protected internal override string ResolvePropertyName(string propertyName) { // lower case the first letter of the passed in name return StringUtils.ToCamelCase(propertyName); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerProxy.cs0000644000175000017500000001523512253423361032207 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Runtime.Serialization.Formatters; using Newtonsoft.Json.Utilities; using System.Runtime.Serialization; namespace Newtonsoft.Json.Serialization { internal class JsonSerializerProxy : JsonSerializer { private readonly JsonSerializerInternalReader _serializerReader; private readonly JsonSerializerInternalWriter _serializerWriter; private readonly JsonSerializer _serializer; public override event EventHandler Error { add { _serializer.Error += value; } remove { _serializer.Error -= value; } } public override IReferenceResolver ReferenceResolver { get { return _serializer.ReferenceResolver; } set { _serializer.ReferenceResolver = value; } } public override JsonConverterCollection Converters { get { return _serializer.Converters; } } public override DefaultValueHandling DefaultValueHandling { get { return _serializer.DefaultValueHandling; } set { _serializer.DefaultValueHandling = value; } } public override IContractResolver ContractResolver { get { return _serializer.ContractResolver; } set { _serializer.ContractResolver = value; } } public override MissingMemberHandling MissingMemberHandling { get { return _serializer.MissingMemberHandling; } set { _serializer.MissingMemberHandling = value; } } public override NullValueHandling NullValueHandling { get { return _serializer.NullValueHandling; } set { _serializer.NullValueHandling = value; } } public override ObjectCreationHandling ObjectCreationHandling { get { return _serializer.ObjectCreationHandling; } set { _serializer.ObjectCreationHandling = value; } } public override ReferenceLoopHandling ReferenceLoopHandling { get { return _serializer.ReferenceLoopHandling; } set { _serializer.ReferenceLoopHandling = value; } } public override PreserveReferencesHandling PreserveReferencesHandling { get { return _serializer.PreserveReferencesHandling; } set { _serializer.PreserveReferencesHandling = value; } } public override TypeNameHandling TypeNameHandling { get { return _serializer.TypeNameHandling; } set { _serializer.TypeNameHandling = value; } } public override FormatterAssemblyStyle TypeNameAssemblyFormat { get { return _serializer.TypeNameAssemblyFormat; } set { _serializer.TypeNameAssemblyFormat = value; } } public override ConstructorHandling ConstructorHandling { get { return _serializer.ConstructorHandling; } set { _serializer.ConstructorHandling = value; } } public override SerializationBinder Binder { get { return _serializer.Binder; } set { _serializer.Binder = value; } } public override StreamingContext Context { get { return _serializer.Context; } set { _serializer.Context = value; } } public override Formatting Formatting { get { return _serializer.Formatting; } set { _serializer.Formatting = value; } } public override DateFormatHandling DateFormatHandling { get { return _serializer.DateFormatHandling; } set { _serializer.DateFormatHandling = value; } } public override DateTimeZoneHandling DateTimeZoneHandling { get { return _serializer.DateTimeZoneHandling; } set { _serializer.DateTimeZoneHandling = value; } } public override DateParseHandling DateParseHandling { get { return _serializer.DateParseHandling; } set { _serializer.DateParseHandling = value; } } public override CultureInfo Culture { get { return _serializer.Culture; } set { _serializer.Culture = value; } } public override int? MaxDepth { get { return _serializer.MaxDepth; } set { _serializer.MaxDepth = value; } } public override bool CheckAdditionalContent { get { return _serializer.CheckAdditionalContent; } set { _serializer.CheckAdditionalContent = value; } } internal JsonSerializerInternalBase GetInternalSerializer() { if (_serializerReader != null) return _serializerReader; else return _serializerWriter; } public JsonSerializerProxy(JsonSerializerInternalReader serializerReader) { ValidationUtils.ArgumentNotNull(serializerReader, "serializerReader"); _serializerReader = serializerReader; _serializer = serializerReader.Serializer; } public JsonSerializerProxy(JsonSerializerInternalWriter serializerWriter) { ValidationUtils.ArgumentNotNull(serializerWriter, "serializerWriter"); _serializerWriter = serializerWriter; _serializer = serializerWriter.Serializer; } internal override object DeserializeInternal(JsonReader reader, Type objectType) { if (_serializerReader != null) return _serializerReader.Deserialize(reader, objectType, false); else return _serializer.Deserialize(reader, objectType); } internal override void PopulateInternal(JsonReader reader, object target) { if (_serializerReader != null) _serializerReader.Populate(reader, target); else _serializer.Populate(reader, target); } internal override void SerializeInternal(JsonWriter jsonWriter, object value) { if (_serializerWriter != null) _serializerWriter.Serialize(jsonWriter, value); else _serializer.Serialize(jsonWriter, value); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonReader.cs0000644000175000017500000006205212253423361025420 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.IO; using System.Globalization; using Newtonsoft.Json.Utilities; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json { /// /// Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. /// public abstract class JsonReader : IDisposable { /// /// Specifies the state of the reader. /// protected internal enum State { /// /// The Read method has not been called. /// Start, /// /// The end of the file has been reached successfully. /// Complete, /// /// Reader is at a property. /// Property, /// /// Reader is at the start of an object. /// ObjectStart, /// /// Reader is in an object. /// Object, /// /// Reader is at the start of an array. /// ArrayStart, /// /// Reader is in an array. /// Array, /// /// The Close method has been called. /// Closed, /// /// Reader has just read a value. /// PostValue, /// /// Reader is at the start of a constructor. /// ConstructorStart, /// /// Reader in a constructor. /// Constructor, /// /// An error occurred that prevents the read operation from continuing. /// Error, /// /// The end of the file has been reached successfully. /// Finished } // current Token data private JsonToken _tokenType; private object _value; private char _quoteChar; internal State _currentState; internal ReadType _readType; private JsonPosition _currentPosition; private CultureInfo _culture; private DateTimeZoneHandling _dateTimeZoneHandling; private int? _maxDepth; private bool _hasExceededMaxDepth; internal DateParseHandling _dateParseHandling; private readonly List _stack; /// /// Gets the current reader state. /// /// The current reader state. protected State CurrentState { get { return _currentState; } } /// /// Gets or sets a value indicating whether the underlying stream or /// should be closed when the reader is closed. /// /// /// true to close the underlying stream or when /// the reader is closed; otherwise false. The default is true. /// public bool CloseInput { get; set; } /// /// Gets the quotation mark character used to enclose the value of a string. /// public virtual char QuoteChar { get { return _quoteChar; } protected internal set { _quoteChar = value; } } /// /// Get or set how time zones are handling when reading JSON. /// public DateTimeZoneHandling DateTimeZoneHandling { get { return _dateTimeZoneHandling; } set { _dateTimeZoneHandling = value; } } /// /// Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. /// public DateParseHandling DateParseHandling { get { return _dateParseHandling; } set { _dateParseHandling = value; } } /// /// Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . /// public int? MaxDepth { get { return _maxDepth; } set { if (value <= 0) throw new ArgumentException("Value must be positive.", "value"); _maxDepth = value; } } /// /// Gets the type of the current JSON token. /// public virtual JsonToken TokenType { get { return _tokenType; } } /// /// Gets the text value of the current JSON token. /// public virtual object Value { get { return _value; } } /// /// Gets The Common Language Runtime (CLR) type for the current JSON token. /// public virtual Type ValueType { get { return (_value != null) ? _value.GetType() : null; } } /// /// Gets the depth of the current token in the JSON document. /// /// The depth of the current token in the JSON document. public virtual int Depth { get { int depth = _stack.Count; if (IsStartToken(TokenType) || _currentPosition.Type == JsonContainerType.None) return depth; else return depth + 1; } } /// /// Gets the path of the current JSON token. /// public virtual string Path { get { if (_currentPosition.Type == JsonContainerType.None) return string.Empty; return JsonPosition.BuildPath(_stack.Concat(new[] { _currentPosition })); } } /// /// Gets or sets the culture used when reading JSON. Defaults to . /// public CultureInfo Culture { get { return _culture ?? CultureInfo.InvariantCulture; } set { _culture = value; } } internal JsonPosition GetPosition(int depth) { if (depth < _stack.Count) return _stack[depth]; return _currentPosition; } /// /// Initializes a new instance of the class with the specified . /// protected JsonReader() { _currentState = State.Start; _stack = new List(4); _dateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind; _dateParseHandling = DateParseHandling.DateTime; CloseInput = true; } private void Push(JsonContainerType value) { UpdateScopeWithFinishedValue(); if (_currentPosition.Type == JsonContainerType.None) { _currentPosition.Type = value; } else { _stack.Add(_currentPosition); JsonPosition state = new JsonPosition { Type = value }; _currentPosition = state; // this is a little hacky because Depth increases when first property/value is written but only testing here is faster/simpler if (_maxDepth != null && Depth + 1 > _maxDepth && !_hasExceededMaxDepth) { _hasExceededMaxDepth = true; throw JsonReaderException.Create(this, "The reader's MaxDepth of {0} has been exceeded.".FormatWith(CultureInfo.InvariantCulture, _maxDepth)); } } } private JsonContainerType Pop() { JsonPosition oldPosition; if (_stack.Count > 0) { oldPosition = _currentPosition; _currentPosition = _stack[_stack.Count - 1]; _stack.RemoveAt(_stack.Count - 1); } else { oldPosition = _currentPosition; _currentPosition = new JsonPosition(); } if (_maxDepth != null && Depth <= _maxDepth) _hasExceededMaxDepth = false; return oldPosition.Type; } private JsonContainerType Peek() { return _currentPosition.Type; } /// /// Reads the next JSON token from the stream. /// /// true if the next token was read successfully; false if there are no more tokens to read. public abstract bool Read(); /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public abstract int? ReadAsInt32(); /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public abstract string ReadAsString(); /// /// Reads the next JSON token from the stream as a . /// /// A or a null reference if the next JSON token is null. This method will return null at the end of an array. public abstract byte[] ReadAsBytes(); /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public abstract decimal? ReadAsDecimal(); /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public abstract DateTime? ReadAsDateTime(); #if !NET20 /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public abstract DateTimeOffset? ReadAsDateTimeOffset(); #endif internal virtual bool ReadInternal() { throw new NotImplementedException(); } #if !NET20 internal DateTimeOffset? ReadAsDateTimeOffsetInternal() { _readType = ReadType.ReadAsDateTimeOffset; do { if (!ReadInternal()) { SetToken(JsonToken.None); return null; } } while (TokenType == JsonToken.Comment); if (TokenType == JsonToken.Date) { if (Value is DateTime) SetToken(JsonToken.Date, new DateTimeOffset((DateTime)Value)); return (DateTimeOffset)Value; } if (TokenType == JsonToken.Null) return null; DateTimeOffset dt; if (TokenType == JsonToken.String) { if (DateTimeOffset.TryParse((string)Value, Culture, DateTimeStyles.RoundtripKind, out dt)) { SetToken(JsonToken.Date, dt); return dt; } else { throw JsonReaderException.Create(this, "Could not convert string to DateTimeOffset: {0}.".FormatWith(CultureInfo.InvariantCulture, Value)); } } if (TokenType == JsonToken.EndArray) return null; throw JsonReaderException.Create(this, "Error reading date. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType)); } #endif internal byte[] ReadAsBytesInternal() { _readType = ReadType.ReadAsBytes; do { if (!ReadInternal()) { SetToken(JsonToken.None); return null; } } while (TokenType == JsonToken.Comment); if (IsWrappedInTypeObject()) { byte[] data = ReadAsBytes(); ReadInternal(); SetToken(JsonToken.Bytes, data); return data; } // attempt to convert possible base 64 string to bytes if (TokenType == JsonToken.String) { string s = (string)Value; byte[] data = (s.Length == 0) ? new byte[0] : Convert.FromBase64String(s); SetToken(JsonToken.Bytes, data); } if (TokenType == JsonToken.Null) return null; if (TokenType == JsonToken.Bytes) return (byte[])Value; if (TokenType == JsonToken.StartArray) { List data = new List(); while (ReadInternal()) { switch (TokenType) { case JsonToken.Integer: data.Add(Convert.ToByte(Value, CultureInfo.InvariantCulture)); break; case JsonToken.EndArray: byte[] d = data.ToArray(); SetToken(JsonToken.Bytes, d); return d; case JsonToken.Comment: // skip break; default: throw JsonReaderException.Create(this, "Unexpected token when reading bytes: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType)); } } throw JsonReaderException.Create(this, "Unexpected end when reading bytes."); } if (TokenType == JsonToken.EndArray) return null; throw JsonReaderException.Create(this, "Error reading bytes. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType)); } internal decimal? ReadAsDecimalInternal() { _readType = ReadType.ReadAsDecimal; do { if (!ReadInternal()) { SetToken(JsonToken.None); return null; } } while (TokenType == JsonToken.Comment); if (TokenType == JsonToken.Integer || TokenType == JsonToken.Float) { if (!(Value is decimal)) SetToken(JsonToken.Float, Convert.ToDecimal(Value, CultureInfo.InvariantCulture)); return (decimal)Value; } if (TokenType == JsonToken.Null) return null; decimal d; if (TokenType == JsonToken.String) { if (decimal.TryParse((string)Value, NumberStyles.Number, Culture, out d)) { SetToken(JsonToken.Float, d); return d; } else { throw JsonReaderException.Create(this, "Could not convert string to decimal: {0}.".FormatWith(CultureInfo.InvariantCulture, Value)); } } if (TokenType == JsonToken.EndArray) return null; throw JsonReaderException.Create(this, "Error reading decimal. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType)); } internal int? ReadAsInt32Internal() { _readType = ReadType.ReadAsInt32; do { if (!ReadInternal()) { SetToken(JsonToken.None); return null; } } while (TokenType == JsonToken.Comment); if (TokenType == JsonToken.Integer || TokenType == JsonToken.Float) { if (!(Value is int)) SetToken(JsonToken.Integer, Convert.ToInt32(Value, CultureInfo.InvariantCulture)); return (int)Value; } if (TokenType == JsonToken.Null) return null; int i; if (TokenType == JsonToken.String) { if (int.TryParse((string)Value, NumberStyles.Integer, Culture, out i)) { SetToken(JsonToken.Integer, i); return i; } else { throw JsonReaderException.Create(this, "Could not convert string to integer: {0}.".FormatWith(CultureInfo.InvariantCulture, Value)); } } if (TokenType == JsonToken.EndArray) return null; throw JsonReaderException.Create(this, "Error reading integer. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType)); } internal string ReadAsStringInternal() { _readType = ReadType.ReadAsString; do { if (!ReadInternal()) { SetToken(JsonToken.None); return null; } } while (TokenType == JsonToken.Comment); if (TokenType == JsonToken.String) return (string)Value; if (TokenType == JsonToken.Null) return null; if (IsPrimitiveToken(TokenType)) { if (Value != null) { string s; if (ConvertUtils.IsConvertible(Value)) s = ConvertUtils.ToConvertible(Value).ToString(Culture); else if (Value is IFormattable) s = ((IFormattable)Value).ToString(null, Culture); else s = Value.ToString(); SetToken(JsonToken.String, s); return s; } } if (TokenType == JsonToken.EndArray) return null; throw JsonReaderException.Create(this, "Error reading string. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType)); } internal DateTime? ReadAsDateTimeInternal() { _readType = ReadType.ReadAsDateTime; do { if (!ReadInternal()) { SetToken(JsonToken.None); return null; } } while (TokenType == JsonToken.Comment); if (TokenType == JsonToken.Date) return (DateTime)Value; if (TokenType == JsonToken.Null) return null; DateTime dt; if (TokenType == JsonToken.String) { string s = (string)Value; if (string.IsNullOrEmpty(s)) { SetToken(JsonToken.Null); return null; } if (DateTime.TryParse(s, Culture, DateTimeStyles.RoundtripKind, out dt)) { dt = JsonConvert.EnsureDateTime(dt, DateTimeZoneHandling); SetToken(JsonToken.Date, dt); return dt; } else { throw JsonReaderException.Create(this, "Could not convert string to DateTime: {0}.".FormatWith(CultureInfo.InvariantCulture, Value)); } } if (TokenType == JsonToken.EndArray) return null; throw JsonReaderException.Create(this, "Error reading date. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType)); } private bool IsWrappedInTypeObject() { _readType = ReadType.Read; if (TokenType == JsonToken.StartObject) { if (!ReadInternal()) throw JsonReaderException.Create(this, "Unexpected end when reading bytes."); if (Value.ToString() == "$type") { ReadInternal(); if (Value != null && Value.ToString().StartsWith("System.Byte[]")) { ReadInternal(); if (Value.ToString() == "$value") { return true; } } } throw JsonReaderException.Create(this, "Error reading bytes. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, JsonToken.StartObject)); } return false; } /// /// Skips the children of the current token. /// public void Skip() { if (TokenType == JsonToken.PropertyName) Read(); if (IsStartToken(TokenType)) { int depth = Depth; while (Read() && (depth < Depth)) { } } } /// /// Sets the current token. /// /// The new token. protected void SetToken(JsonToken newToken) { SetToken(newToken, null); } /// /// Sets the current token and value. /// /// The new token. /// The value. protected void SetToken(JsonToken newToken, object value) { _tokenType = newToken; _value = value; switch (newToken) { case JsonToken.StartObject: _currentState = State.ObjectStart; Push(JsonContainerType.Object); break; case JsonToken.StartArray: _currentState = State.ArrayStart; Push(JsonContainerType.Array); break; case JsonToken.StartConstructor: _currentState = State.ConstructorStart; Push(JsonContainerType.Constructor); break; case JsonToken.EndObject: ValidateEnd(JsonToken.EndObject); break; case JsonToken.EndArray: ValidateEnd(JsonToken.EndArray); break; case JsonToken.EndConstructor: ValidateEnd(JsonToken.EndConstructor); break; case JsonToken.PropertyName: _currentState = State.Property; _currentPosition.PropertyName = (string) value; break; case JsonToken.Undefined: case JsonToken.Integer: case JsonToken.Float: case JsonToken.Boolean: case JsonToken.Null: case JsonToken.Date: case JsonToken.String: case JsonToken.Raw: case JsonToken.Bytes: _currentState = (Peek() != JsonContainerType.None) ? State.PostValue : State.Finished; UpdateScopeWithFinishedValue(); break; } } private void UpdateScopeWithFinishedValue() { if (_currentPosition.Type == JsonContainerType.Array || _currentPosition.Type == JsonContainerType.Constructor) { if (_currentPosition.Position == null) _currentPosition.Position = 0; else _currentPosition.Position++; } } private void ValidateEnd(JsonToken endToken) { JsonContainerType currentObject = Pop(); if (GetTypeForCloseToken(endToken) != currentObject) throw JsonReaderException.Create(this, "JsonToken {0} is not valid for closing JsonType {1}.".FormatWith(CultureInfo.InvariantCulture, endToken, currentObject)); _currentState = (Peek() != JsonContainerType.None) ? State.PostValue : State.Finished; } /// /// Sets the state based on current token type. /// protected void SetStateBasedOnCurrent() { JsonContainerType currentObject = Peek(); switch (currentObject) { case JsonContainerType.Object: _currentState = State.Object; break; case JsonContainerType.Array: _currentState = State.Array; break; case JsonContainerType.Constructor: _currentState = State.Constructor; break; case JsonContainerType.None: _currentState = State.Finished; break; default: throw JsonReaderException.Create(this, "While setting the reader state back to current object an unexpected JsonType was encountered: {0}".FormatWith(CultureInfo.InvariantCulture, currentObject)); } } internal static bool IsPrimitiveToken(JsonToken token) { switch (token) { case JsonToken.Integer: case JsonToken.Float: case JsonToken.String: case JsonToken.Boolean: case JsonToken.Undefined: case JsonToken.Null: case JsonToken.Date: case JsonToken.Bytes: return true; default: return false; } } internal static bool IsStartToken(JsonToken token) { switch (token) { case JsonToken.StartObject: case JsonToken.StartArray: case JsonToken.StartConstructor: return true; default: return false; } } private JsonContainerType GetTypeForCloseToken(JsonToken token) { switch (token) { case JsonToken.EndObject: return JsonContainerType.Object; case JsonToken.EndArray: return JsonContainerType.Array; case JsonToken.EndConstructor: return JsonContainerType.Constructor; default: throw JsonReaderException.Create(this, "Not a valid close JsonToken: {0}".FormatWith(CultureInfo.InvariantCulture, token)); } } /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// void IDisposable.Dispose() { Dispose(true); } /// /// Releases unmanaged and - optionally - managed resources /// /// true to release both managed and unmanaged resources; false to release only unmanaged resources. protected virtual void Dispose(bool disposing) { if (_currentState != State.Closed && disposing) Close(); } /// /// Changes the to Closed. /// public virtual void Close() { _currentState = State.Closed; _tokenType = JsonToken.None; _value = null; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonIgnoreAttribute.cs0000644000175000017500000000302612253423361027321 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Text; namespace Newtonsoft.Json { /// /// Instructs the not to serialize the public field or public read/write property value. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] public sealed class JsonIgnoreAttribute : Attribute { } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/MissingMemberHandling.cs0000644000175000017500000000325412253423361027571 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Text; namespace Newtonsoft.Json { /// /// Specifies missing member handling options for the . /// public enum MissingMemberHandling { /// /// Ignore a missing member and do not attempt to deserialize it. /// Ignore = 0, /// /// Throw a when a missing member is encountered during deserialization. /// Error = 1 } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/IJsonLineInfo.cs0000644000175000017500000000405112253423361026025 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json { /// /// Provides an interface to enable a class to return line and position information. /// public interface IJsonLineInfo { /// /// Gets a value indicating whether the class can return line information. /// /// /// true if LineNumber and LinePosition can be provided; otherwise, false. /// bool HasLineInfo(); /// /// Gets the current line number. /// /// The current line number or 0 if no line information is available (for example, HasLineInfo returns false). int LineNumber { get; } /// /// Gets the current line position. /// /// The current line position or 0 if no line information is available (for example, HasLineInfo returns false). int LinePosition { get; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/NullValueHandling.cs0000644000175000017500000000373712253423361026745 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json { /// /// Specifies null value handling options for the . /// /// /// /// /// public enum NullValueHandling { /// /// Include null values when serializing and deserializing objects. /// Include = 0, /// /// Ignore null values when serializing and deserializing objects. /// Ignore = 1 } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonWriterException.cs0000644000175000017500000001045012253423361027344 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Runtime.Serialization; using System.Text; namespace Newtonsoft.Json { /// /// The exception thrown when an error occurs while reading Json text. /// #if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE) [Serializable] #endif public class JsonWriterException : JsonException { /// /// Gets the path to the JSON where the error occurred. /// /// The path to the JSON where the error occurred. public string Path { get; private set; } /// /// Initializes a new instance of the class. /// public JsonWriterException() { } /// /// Initializes a new instance of the class /// with a specified error message. /// /// The error message that explains the reason for the exception. public JsonWriterException(string message) : base(message) { } /// /// Initializes a new instance of the class /// with a specified error message and a reference to the inner exception that is the cause of this exception. /// /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. public JsonWriterException(string message, Exception innerException) : base(message, innerException) { } #if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE) /// /// Initializes a new instance of the class. /// /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. /// The parameter is null. /// The class name is null or is zero (0). public JsonWriterException(SerializationInfo info, StreamingContext context) : base(info, context) { } #endif internal JsonWriterException(string message, Exception innerException, string path) : base(message, innerException) { Path = path; } internal static JsonWriterException Create(JsonWriter writer, string message, Exception ex) { return Create(writer.ContainerPath, message, ex); } internal static JsonWriterException Create(string path, string message, Exception ex) { message = FormatExceptionMessage(null, path, message); return new JsonWriterException(message, ex, path); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Properties/0000755000175000017500000000000012253423361025164 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs0000644000175000017500000001011712253423361030106 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. #if WINDOWS_PHONE [assembly: AssemblyTitle("Json.NET Windows Phone")] #elif SILVERLIGHT [assembly: AssemblyTitle("Json.NET Silverlight")] #elif PocketPC [assembly: AssemblyTitle("Json.NET Compact")] #elif PORTABLE [assembly: AssemblyTitle("Json.NET Portable")] #elif NETFX_CORE [assembly: AssemblyTitle("Json.NET Metro")] [assembly: SecurityTransparent] #elif NET20 [assembly: AssemblyTitle("Json.NET .NET 2.0")] [assembly: AllowPartiallyTrustedCallers] #elif NET35 [assembly: AssemblyTitle("Json.NET .NET 3.5")] [assembly: AllowPartiallyTrustedCallers] #else [assembly: AssemblyTitle("Json.NET")] [assembly: AllowPartiallyTrustedCallers] #endif #if !SIGNED [assembly: InternalsVisibleTo("Newtonsoft.Json.Tests")] #else [assembly: InternalsVisibleTo("Newtonsoft.Json.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f561df277c6c0b497d629032b410cdcf286e537c054724f7ffa0164345f62b3e642029d7a80cc351918955328c4adc8a048823ef90b0cf38ea7db0d729caf2b633c3babe08b0310198c1081995c19029bc675193744eab9d7345b8a67258ec17d112cebdbbb2a281487dceeafb9d83aa930f32103fbe1d2911425bc5744002c7")] #endif [assembly: InternalsVisibleTo("Newtonsoft.Json.Dynamic, PublicKey=0024000004800000940000000602000000240000525341310004000001000100cbd8d53b9d7de30f1f1278f636ec462cf9c254991291e66ebb157a885638a517887633b898ccbcf0d5c5ff7be85a6abe9e765d0ac7cd33c68dac67e7e64530e8222101109f154ab14a941c490ac155cd1d4fcba0fabb49016b4ef28593b015cab5937da31172f03f67d09edda404b88a60023f062ae71d0b2e4438b74cc11dc9")] [assembly: AssemblyDescription("Json.NET is a popular high-performance JSON framework for .NET")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Newtonsoft")] [assembly: AssemblyProduct("Json.NET")] [assembly: AssemblyCopyright("Copyright James Newton-King 2008")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] #if !PORTABLE // Setting ComVisible to false makes the types in this assembly not visible // to COM componenets. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9ca358aa-317b-4925-8ada-4a29e943a363")] #endif // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("4.5.0.0")] #if !PocketPC [assembly: AssemblyFileVersion("4.5.8.15205")] #endif [assembly: CLSCompliant(true)] smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/0000755000175000017500000000000012253423361024230 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaException.cs0000644000175000017500000001064112253423361030472 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Runtime.Serialization; namespace Newtonsoft.Json.Schema { /// /// Returns detailed information about the schema exception. /// #if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE) [Serializable] #endif public class JsonSchemaException : JsonException { /// /// Gets the line number indicating where the error occurred. /// /// The line number indicating where the error occurred. public int LineNumber { get; private set; } /// /// Gets the line position indicating where the error occurred. /// /// The line position indicating where the error occurred. public int LinePosition { get; private set; } /// /// Gets the path to the JSON where the error occurred. /// /// The path to the JSON where the error occurred. public string Path { get; private set; } /// /// Initializes a new instance of the class. /// public JsonSchemaException() { } /// /// Initializes a new instance of the class /// with a specified error message. /// /// The error message that explains the reason for the exception. public JsonSchemaException(string message) : base(message) { } /// /// Initializes a new instance of the class /// with a specified error message and a reference to the inner exception that is the cause of this exception. /// /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. public JsonSchemaException(string message, Exception innerException) : base(message, innerException) { } #if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE) /// /// Initializes a new instance of the class. /// /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. /// The parameter is null. /// The class name is null or is zero (0). public JsonSchemaException(SerializationInfo info, StreamingContext context) : base(info, context) { } #endif internal JsonSchemaException(string message, Exception innerException, string path, int lineNumber, int linePosition) : base(message, innerException) { Path = path; LineNumber = lineNumber; LinePosition = linePosition; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaModel.cs0000644000175000017500000001040512253423361027572 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections.Generic; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Schema { internal class JsonSchemaModel { public bool Required { get; set; } public JsonSchemaType Type { get; set; } public int? MinimumLength { get; set; } public int? MaximumLength { get; set; } public double? DivisibleBy { get; set; } public double? Minimum { get; set; } public double? Maximum { get; set; } public bool ExclusiveMinimum { get; set; } public bool ExclusiveMaximum { get; set; } public int? MinimumItems { get; set; } public int? MaximumItems { get; set; } public IList Patterns { get; set; } public IList Items { get; set; } public IDictionary Properties { get; set; } public IDictionary PatternProperties { get; set; } public JsonSchemaModel AdditionalProperties { get; set; } public bool AllowAdditionalProperties { get; set; } public IList Enum { get; set; } public JsonSchemaType Disallow { get; set; } public JsonSchemaModel() { Type = JsonSchemaType.Any; AllowAdditionalProperties = true; Required = false; } public static JsonSchemaModel Create(IList schemata) { JsonSchemaModel model = new JsonSchemaModel(); foreach (JsonSchema schema in schemata) { Combine(model, schema); } return model; } private static void Combine(JsonSchemaModel model, JsonSchema schema) { // Version 3 of the Draft JSON Schema has the default value of Not Required model.Required = model.Required || (schema.Required ?? false); model.Type = model.Type & (schema.Type ?? JsonSchemaType.Any); model.MinimumLength = MathUtils.Max(model.MinimumLength, schema.MinimumLength); model.MaximumLength = MathUtils.Min(model.MaximumLength, schema.MaximumLength); // not sure what is the best way to combine divisibleBy model.DivisibleBy = MathUtils.Max(model.DivisibleBy, schema.DivisibleBy); model.Minimum = MathUtils.Max(model.Minimum, schema.Minimum); model.Maximum = MathUtils.Max(model.Maximum, schema.Maximum); model.ExclusiveMinimum = model.ExclusiveMinimum || (schema.ExclusiveMinimum ?? false); model.ExclusiveMaximum = model.ExclusiveMaximum || (schema.ExclusiveMaximum ?? false); model.MinimumItems = MathUtils.Max(model.MinimumItems, schema.MinimumItems); model.MaximumItems = MathUtils.Min(model.MaximumItems, schema.MaximumItems); model.AllowAdditionalProperties = model.AllowAdditionalProperties && schema.AllowAdditionalProperties; if (schema.Enum != null) { if (model.Enum == null) model.Enum = new List(); model.Enum.AddRangeDistinct(schema.Enum, new JTokenEqualityComparer()); } model.Disallow = model.Disallow | (schema.Disallow ?? JsonSchemaType.None); if (schema.Pattern != null) { if (model.Patterns == null) model.Patterns = new List(); model.Patterns.AddDistinct(schema.Pattern); } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaConstants.cs0000644000175000017500000000722712253423361030516 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections.Generic; namespace Newtonsoft.Json.Schema { internal static class JsonSchemaConstants { public const string TypePropertyName = "type"; public const string PropertiesPropertyName = "properties"; public const string ItemsPropertyName = "items"; public const string RequiredPropertyName = "required"; public const string PatternPropertiesPropertyName = "patternProperties"; public const string AdditionalPropertiesPropertyName = "additionalProperties"; public const string RequiresPropertyName = "requires"; public const string IdentityPropertyName = "identity"; public const string MinimumPropertyName = "minimum"; public const string MaximumPropertyName = "maximum"; public const string ExclusiveMinimumPropertyName = "exclusiveMinimum"; public const string ExclusiveMaximumPropertyName = "exclusiveMaximum"; public const string MinimumItemsPropertyName = "minItems"; public const string MaximumItemsPropertyName = "maxItems"; public const string PatternPropertyName = "pattern"; public const string MaximumLengthPropertyName = "maxLength"; public const string MinimumLengthPropertyName = "minLength"; public const string EnumPropertyName = "enum"; public const string OptionsPropertyName = "options"; public const string ReadOnlyPropertyName = "readonly"; public const string TitlePropertyName = "title"; public const string DescriptionPropertyName = "description"; public const string FormatPropertyName = "format"; public const string DefaultPropertyName = "default"; public const string TransientPropertyName = "transient"; public const string DivisibleByPropertyName = "divisibleBy"; public const string HiddenPropertyName = "hidden"; public const string DisallowPropertyName = "disallow"; public const string ExtendsPropertyName = "extends"; public const string IdPropertyName = "id"; public const string OptionValuePropertyName = "value"; public const string OptionLabelPropertyName = "label"; public const string ReferencePropertyName = "$ref"; public static readonly IDictionary JsonSchemaTypeMapping = new Dictionary { {"string", JsonSchemaType.String}, {"object", JsonSchemaType.Object}, {"integer", JsonSchemaType.Integer}, {"number", JsonSchemaType.Float}, {"null", JsonSchemaType.Null}, {"boolean", JsonSchemaType.Boolean}, {"array", JsonSchemaType.Array}, {"any", JsonSchemaType.Any} }; } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs0000644000175000017500000004041312253423361030462 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.ComponentModel; using System.Collections.Generic; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Serialization; #if NETFX_CORE using IConvertible = Newtonsoft.Json.Utilities.Convertible; #endif #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Schema { /// /// Generates a from a specified . /// public class JsonSchemaGenerator { /// /// Gets or sets how undefined schemas are handled by the serializer. /// public UndefinedSchemaIdHandling UndefinedSchemaIdHandling { get; set; } private IContractResolver _contractResolver; /// /// Gets or sets the contract resolver. /// /// The contract resolver. public IContractResolver ContractResolver { get { if (_contractResolver == null) return DefaultContractResolver.Instance; return _contractResolver; } set { _contractResolver = value; } } private class TypeSchema { public Type Type { get; private set; } public JsonSchema Schema { get; private set;} public TypeSchema(Type type, JsonSchema schema) { ValidationUtils.ArgumentNotNull(type, "type"); ValidationUtils.ArgumentNotNull(schema, "schema"); Type = type; Schema = schema; } } private JsonSchemaResolver _resolver; private readonly IList _stack = new List(); private JsonSchema _currentSchema; private JsonSchema CurrentSchema { get { return _currentSchema; } } private void Push(TypeSchema typeSchema) { _currentSchema = typeSchema.Schema; _stack.Add(typeSchema); _resolver.LoadedSchemas.Add(typeSchema.Schema); } private TypeSchema Pop() { TypeSchema popped = _stack[_stack.Count - 1]; _stack.RemoveAt(_stack.Count - 1); TypeSchema newValue = _stack.LastOrDefault(); if (newValue != null) { _currentSchema = newValue.Schema; } else { _currentSchema = null; } return popped; } /// /// Generate a from the specified type. /// /// The type to generate a from. /// A generated from the specified type. public JsonSchema Generate(Type type) { return Generate(type, new JsonSchemaResolver(), false); } /// /// Generate a from the specified type. /// /// The type to generate a from. /// The used to resolve schema references. /// A generated from the specified type. public JsonSchema Generate(Type type, JsonSchemaResolver resolver) { return Generate(type, resolver, false); } /// /// Generate a from the specified type. /// /// The type to generate a from. /// Specify whether the generated root will be nullable. /// A generated from the specified type. public JsonSchema Generate(Type type, bool rootSchemaNullable) { return Generate(type, new JsonSchemaResolver(), rootSchemaNullable); } /// /// Generate a from the specified type. /// /// The type to generate a from. /// The used to resolve schema references. /// Specify whether the generated root will be nullable. /// A generated from the specified type. public JsonSchema Generate(Type type, JsonSchemaResolver resolver, bool rootSchemaNullable) { ValidationUtils.ArgumentNotNull(type, "type"); ValidationUtils.ArgumentNotNull(resolver, "resolver"); _resolver = resolver; return GenerateInternal(type, (!rootSchemaNullable) ? Required.Always : Required.Default, false); } private string GetTitle(Type type) { JsonContainerAttribute containerAttribute = JsonTypeReflector.GetJsonContainerAttribute(type); if (containerAttribute != null && !string.IsNullOrEmpty(containerAttribute.Title)) return containerAttribute.Title; return null; } private string GetDescription(Type type) { JsonContainerAttribute containerAttribute = JsonTypeReflector.GetJsonContainerAttribute(type); if (containerAttribute != null && !string.IsNullOrEmpty(containerAttribute.Description)) return containerAttribute.Description; #if !(NETFX_CORE || PORTABLE) DescriptionAttribute descriptionAttribute = ReflectionUtils.GetAttribute(type); if (descriptionAttribute != null) return descriptionAttribute.Description; #endif return null; } private string GetTypeId(Type type, bool explicitOnly) { JsonContainerAttribute containerAttribute = JsonTypeReflector.GetJsonContainerAttribute(type); if (containerAttribute != null && !string.IsNullOrEmpty(containerAttribute.Id)) return containerAttribute.Id; if (explicitOnly) return null; switch (UndefinedSchemaIdHandling) { case UndefinedSchemaIdHandling.UseTypeName: return type.FullName; case UndefinedSchemaIdHandling.UseAssemblyQualifiedName: return type.AssemblyQualifiedName; default: return null; } } private JsonSchema GenerateInternal(Type type, Required valueRequired, bool required) { ValidationUtils.ArgumentNotNull(type, "type"); string resolvedId = GetTypeId(type, false); string explicitId = GetTypeId(type, true); if (!string.IsNullOrEmpty(resolvedId)) { JsonSchema resolvedSchema = _resolver.GetSchema(resolvedId); if (resolvedSchema != null) { // resolved schema is not null but referencing member allows nulls // change resolved schema to allow nulls. hacky but what are ya gonna do? if (valueRequired != Required.Always && !HasFlag(resolvedSchema.Type, JsonSchemaType.Null)) resolvedSchema.Type |= JsonSchemaType.Null; if (required && resolvedSchema.Required != true) resolvedSchema.Required = true; return resolvedSchema; } } // test for unresolved circular reference if (_stack.Any(tc => tc.Type == type)) { throw new JsonException("Unresolved circular reference for type '{0}'. Explicitly define an Id for the type using a JsonObject/JsonArray attribute or automatically generate a type Id using the UndefinedSchemaIdHandling property.".FormatWith(CultureInfo.InvariantCulture, type)); } JsonContract contract = ContractResolver.ResolveContract(type); JsonConverter converter; if ((converter = contract.Converter) != null || (converter = contract.InternalConverter) != null) { JsonSchema converterSchema = converter.GetSchema(); if (converterSchema != null) return converterSchema; } Push(new TypeSchema(type, new JsonSchema())); if (explicitId != null) CurrentSchema.Id = explicitId; if (required) CurrentSchema.Required = true; CurrentSchema.Title = GetTitle(type); CurrentSchema.Description = GetDescription(type); if (converter != null) { // todo: Add GetSchema to JsonConverter and use here? CurrentSchema.Type = JsonSchemaType.Any; } else { switch (contract.ContractType) { case JsonContractType.Object: CurrentSchema.Type = AddNullType(JsonSchemaType.Object, valueRequired); CurrentSchema.Id = GetTypeId(type, false); GenerateObjectSchema(type, (JsonObjectContract) contract); break; case JsonContractType.Array: CurrentSchema.Type = AddNullType(JsonSchemaType.Array, valueRequired); CurrentSchema.Id = GetTypeId(type, false); JsonArrayAttribute arrayAttribute = JsonTypeReflector.GetJsonContainerAttribute(type) as JsonArrayAttribute; bool allowNullItem = (arrayAttribute == null || arrayAttribute.AllowNullItems); Type collectionItemType = ReflectionUtils.GetCollectionItemType(type); if (collectionItemType != null) { CurrentSchema.Items = new List(); CurrentSchema.Items.Add(GenerateInternal(collectionItemType, (!allowNullItem) ? Required.Always : Required.Default, false)); } break; case JsonContractType.Primitive: CurrentSchema.Type = GetJsonSchemaType(type, valueRequired); if (CurrentSchema.Type == JsonSchemaType.Integer && type.IsEnum() && !type.IsDefined(typeof (FlagsAttribute), true)) { CurrentSchema.Enum = new List(); CurrentSchema.Options = new Dictionary(); EnumValues enumValues = EnumUtils.GetNamesAndValues(type); foreach (EnumValue enumValue in enumValues) { JToken value = JToken.FromObject(enumValue.Value); CurrentSchema.Enum.Add(value); CurrentSchema.Options.Add(value, enumValue.Name); } } break; case JsonContractType.String: JsonSchemaType schemaType = (!ReflectionUtils.IsNullable(contract.UnderlyingType)) ? JsonSchemaType.String : AddNullType(JsonSchemaType.String, valueRequired); CurrentSchema.Type = schemaType; break; case JsonContractType.Dictionary: CurrentSchema.Type = AddNullType(JsonSchemaType.Object, valueRequired); Type keyType; Type valueType; ReflectionUtils.GetDictionaryKeyValueTypes(type, out keyType, out valueType); if (keyType != null) { // can be converted to a string if (ConvertUtils.IsConvertible(keyType)) { CurrentSchema.AdditionalProperties = GenerateInternal(valueType, Required.Default, false); } } break; #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) case JsonContractType.Serializable: CurrentSchema.Type = AddNullType(JsonSchemaType.Object, valueRequired); CurrentSchema.Id = GetTypeId(type, false); GenerateISerializableContract(type, (JsonISerializableContract) contract); break; #endif #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) case JsonContractType.Dynamic: #endif case JsonContractType.Linq: CurrentSchema.Type = JsonSchemaType.Any; break; default: throw new JsonException("Unexpected contract type: {0}".FormatWith(CultureInfo.InvariantCulture, contract)); } } return Pop().Schema; } private JsonSchemaType AddNullType(JsonSchemaType type, Required valueRequired) { if (valueRequired != Required.Always) return type | JsonSchemaType.Null; return type; } private bool HasFlag(DefaultValueHandling value, DefaultValueHandling flag) { return ((value & flag) == flag); } private void GenerateObjectSchema(Type type, JsonObjectContract contract) { CurrentSchema.Properties = new Dictionary(); foreach (JsonProperty property in contract.Properties) { if (!property.Ignored) { bool optional = property.NullValueHandling == NullValueHandling.Ignore || HasFlag(property.DefaultValueHandling.GetValueOrDefault(), DefaultValueHandling.Ignore) || property.ShouldSerialize != null || property.GetIsSpecified != null; JsonSchema propertySchema = GenerateInternal(property.PropertyType, property.Required, !optional); if (property.DefaultValue != null) propertySchema.Default = JToken.FromObject(property.DefaultValue); CurrentSchema.Properties.Add(property.PropertyName, propertySchema); } } if (type.IsSealed()) CurrentSchema.AllowAdditionalProperties = false; } #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) private void GenerateISerializableContract(Type type, JsonISerializableContract contract) { CurrentSchema.AllowAdditionalProperties = true; } #endif internal static bool HasFlag(JsonSchemaType? value, JsonSchemaType flag) { // default value is Any if (value == null) return true; bool match = ((value & flag) == flag); if (match) return true; // integer is a subset of float if (value == JsonSchemaType.Float && flag == JsonSchemaType.Integer) return true; return false; } private JsonSchemaType GetJsonSchemaType(Type type, Required valueRequired) { JsonSchemaType schemaType = JsonSchemaType.None; if (valueRequired != Required.Always && ReflectionUtils.IsNullable(type)) { schemaType = JsonSchemaType.Null; if (ReflectionUtils.IsNullableType(type)) type = Nullable.GetUnderlyingType(type); } TypeCode typeCode = ConvertUtils.GetTypeCode(type); switch (typeCode) { case TypeCode.Empty: case TypeCode.Object: return schemaType | JsonSchemaType.String; #if !(NETFX_CORE || PORTABLE) case TypeCode.DBNull: return schemaType | JsonSchemaType.Null; #endif case TypeCode.Boolean: return schemaType | JsonSchemaType.Boolean; case TypeCode.Char: return schemaType | JsonSchemaType.String; case TypeCode.SByte: case TypeCode.Byte: case TypeCode.Int16: case TypeCode.UInt16: case TypeCode.Int32: case TypeCode.UInt32: case TypeCode.Int64: case TypeCode.UInt64: return schemaType | JsonSchemaType.Integer; case TypeCode.Single: case TypeCode.Double: case TypeCode.Decimal: return schemaType | JsonSchemaType.Float; // convert to string? case TypeCode.DateTime: return schemaType | JsonSchemaType.String; case TypeCode.String: return schemaType | JsonSchemaType.String; default: throw new JsonException("Unexpected type code '{0}' for type '{1}'.".FormatWith(CultureInfo.InvariantCulture, typeCode, type)); } } } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaType.cs0000644000175000017500000000402412253423361027453 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json.Schema { /// /// The value types allowed by the . /// [Flags] public enum JsonSchemaType { /// /// No type specified. /// None = 0, /// /// String type. /// String = 1, /// /// Float type. /// Float = 2, /// /// Integer type. /// Integer = 4, /// /// Boolean type. /// Boolean = 8, /// /// Object type. /// Object = 16, /// /// Array type. /// Array = 32, /// /// Null type. /// Null = 64, /// /// Any type. /// Any = String | Float | Integer | Boolean | Object | Array | Null } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/ValidationEventArgs.cs0000644000175000017500000000452212253423361030473 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Schema { /// /// Returns detailed information related to the . /// public class ValidationEventArgs : EventArgs { private readonly JsonSchemaException _ex; internal ValidationEventArgs(JsonSchemaException ex) { ValidationUtils.ArgumentNotNull(ex, "ex"); _ex = ex; } /// /// Gets the associated with the validation error. /// /// The JsonSchemaException associated with the validation error. public JsonSchemaException Exception { get { return _ex; } } /// /// Gets the path of the JSON location where the validation error occurred. /// /// The path of the JSON location where the validation error occurred. public string Path { get { return _ex.Path; } } /// /// Gets the text description corresponding to the validation error. /// /// The text description. public string Message { get { return _ex.Message; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaBuilder.cs0000644000175000017500000003652012253423361030126 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif using System.Globalization; using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Linq; namespace Newtonsoft.Json.Schema { internal class JsonSchemaBuilder { private JsonReader _reader; private readonly IList _stack; private readonly JsonSchemaResolver _resolver; private JsonSchema _currentSchema; private void Push(JsonSchema value) { _currentSchema = value; _stack.Add(value); _resolver.LoadedSchemas.Add(value); } private JsonSchema Pop() { JsonSchema poppedSchema = _currentSchema; _stack.RemoveAt(_stack.Count - 1); _currentSchema = _stack.LastOrDefault(); return poppedSchema; } private JsonSchema CurrentSchema { get { return _currentSchema; } } public JsonSchemaBuilder(JsonSchemaResolver resolver) { _stack = new List(); _resolver = resolver; } internal JsonSchema Parse(JsonReader reader) { _reader = reader; if (reader.TokenType == JsonToken.None) _reader.Read(); return BuildSchema(); } private JsonSchema BuildSchema() { if (_reader.TokenType != JsonToken.StartObject) throw JsonReaderException.Create(_reader, "Expected StartObject while parsing schema object, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType)); _reader.Read(); // empty schema object if (_reader.TokenType == JsonToken.EndObject) { Push(new JsonSchema()); return Pop(); } string propertyName = Convert.ToString(_reader.Value, CultureInfo.InvariantCulture); _reader.Read(); // schema reference if (propertyName == JsonSchemaConstants.ReferencePropertyName) { string id = (string)_reader.Value; // skip to the end of the current object while (_reader.Read() && _reader.TokenType != JsonToken.EndObject) { if (_reader.TokenType == JsonToken.StartObject) throw JsonReaderException.Create(_reader, "Found StartObject within the schema reference with the Id '{0}'".FormatWith(CultureInfo.InvariantCulture, id)); } JsonSchema referencedSchema = _resolver.GetSchema(id); if (referencedSchema == null) throw new JsonException("Could not resolve schema reference for Id '{0}'.".FormatWith(CultureInfo.InvariantCulture, id)); return referencedSchema; } // regular ol' schema object Push(new JsonSchema()); ProcessSchemaProperty(propertyName); while (_reader.Read() && _reader.TokenType != JsonToken.EndObject) { propertyName = Convert.ToString(_reader.Value, CultureInfo.InvariantCulture); _reader.Read(); ProcessSchemaProperty(propertyName); } return Pop(); } private void ProcessSchemaProperty(string propertyName) { switch (propertyName) { case JsonSchemaConstants.TypePropertyName: CurrentSchema.Type = ProcessType(); break; case JsonSchemaConstants.IdPropertyName: CurrentSchema.Id = (string) _reader.Value; break; case JsonSchemaConstants.TitlePropertyName: CurrentSchema.Title = (string) _reader.Value; break; case JsonSchemaConstants.DescriptionPropertyName: CurrentSchema.Description = (string)_reader.Value; break; case JsonSchemaConstants.PropertiesPropertyName: ProcessProperties(); break; case JsonSchemaConstants.ItemsPropertyName: ProcessItems(); break; case JsonSchemaConstants.AdditionalPropertiesPropertyName: ProcessAdditionalProperties(); break; case JsonSchemaConstants.PatternPropertiesPropertyName: ProcessPatternProperties(); break; case JsonSchemaConstants.RequiredPropertyName: CurrentSchema.Required = (bool)_reader.Value; break; case JsonSchemaConstants.RequiresPropertyName: CurrentSchema.Requires = (string) _reader.Value; break; case JsonSchemaConstants.IdentityPropertyName: ProcessIdentity(); break; case JsonSchemaConstants.MinimumPropertyName: CurrentSchema.Minimum = Convert.ToDouble(_reader.Value, CultureInfo.InvariantCulture); break; case JsonSchemaConstants.MaximumPropertyName: CurrentSchema.Maximum = Convert.ToDouble(_reader.Value, CultureInfo.InvariantCulture); break; case JsonSchemaConstants.ExclusiveMinimumPropertyName: CurrentSchema.ExclusiveMinimum = (bool)_reader.Value; break; case JsonSchemaConstants.ExclusiveMaximumPropertyName: CurrentSchema.ExclusiveMaximum = (bool)_reader.Value; break; case JsonSchemaConstants.MaximumLengthPropertyName: CurrentSchema.MaximumLength = Convert.ToInt32(_reader.Value, CultureInfo.InvariantCulture); break; case JsonSchemaConstants.MinimumLengthPropertyName: CurrentSchema.MinimumLength = Convert.ToInt32(_reader.Value, CultureInfo.InvariantCulture); break; case JsonSchemaConstants.MaximumItemsPropertyName: CurrentSchema.MaximumItems = Convert.ToInt32(_reader.Value, CultureInfo.InvariantCulture); break; case JsonSchemaConstants.MinimumItemsPropertyName: CurrentSchema.MinimumItems = Convert.ToInt32(_reader.Value, CultureInfo.InvariantCulture); break; case JsonSchemaConstants.DivisibleByPropertyName: CurrentSchema.DivisibleBy = Convert.ToDouble(_reader.Value, CultureInfo.InvariantCulture); break; case JsonSchemaConstants.DisallowPropertyName: CurrentSchema.Disallow = ProcessType(); break; case JsonSchemaConstants.DefaultPropertyName: ProcessDefault(); break; case JsonSchemaConstants.HiddenPropertyName: CurrentSchema.Hidden = (bool) _reader.Value; break; case JsonSchemaConstants.ReadOnlyPropertyName: CurrentSchema.ReadOnly = (bool) _reader.Value; break; case JsonSchemaConstants.FormatPropertyName: CurrentSchema.Format = (string) _reader.Value; break; case JsonSchemaConstants.PatternPropertyName: CurrentSchema.Pattern = (string) _reader.Value; break; case JsonSchemaConstants.OptionsPropertyName: ProcessOptions(); break; case JsonSchemaConstants.EnumPropertyName: ProcessEnum(); break; case JsonSchemaConstants.ExtendsPropertyName: ProcessExtends(); break; default: _reader.Skip(); break; } } private void ProcessExtends() { CurrentSchema.Extends = BuildSchema(); } private void ProcessEnum() { if (_reader.TokenType != JsonToken.StartArray) throw JsonReaderException.Create(_reader, "Expected StartArray token while parsing enum values, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType)); CurrentSchema.Enum = new List(); while (_reader.Read() && _reader.TokenType != JsonToken.EndArray) { JToken value = JToken.ReadFrom(_reader); CurrentSchema.Enum.Add(value); } } private void ProcessOptions() { CurrentSchema.Options = new Dictionary(new JTokenEqualityComparer()); switch (_reader.TokenType) { case JsonToken.StartArray: while (_reader.Read() && _reader.TokenType != JsonToken.EndArray) { if (_reader.TokenType != JsonToken.StartObject) throw JsonReaderException.Create(_reader, "Expect object token, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType)); string label = null; JToken value = null; while (_reader.Read() && _reader.TokenType != JsonToken.EndObject) { string propertyName = Convert.ToString(_reader.Value, CultureInfo.InvariantCulture); _reader.Read(); switch (propertyName) { case JsonSchemaConstants.OptionValuePropertyName: value = JToken.ReadFrom(_reader); break; case JsonSchemaConstants.OptionLabelPropertyName: label = (string) _reader.Value; break; default: throw JsonReaderException.Create(_reader, "Unexpected property in JSON schema option: {0}.".FormatWith(CultureInfo.InvariantCulture, propertyName)); } } if (value == null) throw new JsonException("No value specified for JSON schema option."); if (CurrentSchema.Options.ContainsKey(value)) throw new JsonException("Duplicate value in JSON schema option collection: {0}".FormatWith(CultureInfo.InvariantCulture, value)); CurrentSchema.Options.Add(value, label); } break; default: throw JsonReaderException.Create(_reader, "Expected array token, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType)); } } private void ProcessDefault() { CurrentSchema.Default = JToken.ReadFrom(_reader); } private void ProcessIdentity() { CurrentSchema.Identity = new List(); switch (_reader.TokenType) { case JsonToken.String: CurrentSchema.Identity.Add(_reader.Value.ToString()); break; case JsonToken.StartArray: while (_reader.Read() && _reader.TokenType != JsonToken.EndArray) { if (_reader.TokenType != JsonToken.String) throw JsonReaderException.Create(_reader, "Exception JSON property name string token, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType)); CurrentSchema.Identity.Add(_reader.Value.ToString()); } break; default: throw JsonReaderException.Create(_reader, "Expected array or JSON property name string token, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType)); } } private void ProcessAdditionalProperties() { if (_reader.TokenType == JsonToken.Boolean) CurrentSchema.AllowAdditionalProperties = (bool)_reader.Value; else CurrentSchema.AdditionalProperties = BuildSchema(); } private void ProcessPatternProperties() { Dictionary patternProperties = new Dictionary(); if (_reader.TokenType != JsonToken.StartObject) throw JsonReaderException.Create(_reader, "Expected StartObject token."); while (_reader.Read() && _reader.TokenType != JsonToken.EndObject) { string propertyName = Convert.ToString(_reader.Value, CultureInfo.InvariantCulture); _reader.Read(); if (patternProperties.ContainsKey(propertyName)) throw new JsonException("Property {0} has already been defined in schema.".FormatWith(CultureInfo.InvariantCulture, propertyName)); patternProperties.Add(propertyName, BuildSchema()); } CurrentSchema.PatternProperties = patternProperties; } private void ProcessItems() { CurrentSchema.Items = new List(); switch (_reader.TokenType) { case JsonToken.StartObject: CurrentSchema.Items.Add(BuildSchema()); break; case JsonToken.StartArray: while (_reader.Read() && _reader.TokenType != JsonToken.EndArray) { CurrentSchema.Items.Add(BuildSchema()); } break; default: throw JsonReaderException.Create(_reader, "Expected array or JSON schema object token, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType)); } } private void ProcessProperties() { IDictionary properties = new Dictionary(); if (_reader.TokenType != JsonToken.StartObject) throw JsonReaderException.Create(_reader, "Expected StartObject token while parsing schema properties, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType)); while (_reader.Read() && _reader.TokenType != JsonToken.EndObject) { string propertyName = Convert.ToString(_reader.Value, CultureInfo.InvariantCulture); _reader.Read(); if (properties.ContainsKey(propertyName)) throw new JsonException("Property {0} has already been defined in schema.".FormatWith(CultureInfo.InvariantCulture, propertyName)); properties.Add(propertyName, BuildSchema()); } CurrentSchema.Properties = properties; } private JsonSchemaType? ProcessType() { switch (_reader.TokenType) { case JsonToken.String: return MapType(_reader.Value.ToString()); case JsonToken.StartArray: // ensure type is in blank state before ORing values JsonSchemaType? type = JsonSchemaType.None; while (_reader.Read() && _reader.TokenType != JsonToken.EndArray) { if (_reader.TokenType != JsonToken.String) throw JsonReaderException.Create(_reader, "Exception JSON schema type string token, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType)); type = type | MapType(_reader.Value.ToString()); } return type; default: throw JsonReaderException.Create(_reader, "Expected array or JSON schema type string token, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType)); } } internal static JsonSchemaType MapType(string type) { JsonSchemaType mappedType; if (!JsonSchemaConstants.JsonSchemaTypeMapping.TryGetValue(type, out mappedType)) throw new JsonException("Invalid JSON schema type: {0}".FormatWith(CultureInfo.InvariantCulture, type)); return mappedType; } internal static string MapType(JsonSchemaType type) { return JsonSchemaConstants.JsonSchemaTypeMapping.Single(kv => kv.Value == type).Key; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchema.cs0000644000175000017500000002557512253423361026627 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.IO; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Utilities; using System.Globalization; namespace Newtonsoft.Json.Schema { /// /// An in-memory representation of a JSON Schema. /// public class JsonSchema { /// /// Gets or sets the id. /// public string Id { get; set; } /// /// Gets or sets the title. /// public string Title { get; set; } /// /// Gets or sets whether the object is required. /// public bool? Required { get; set; } /// /// Gets or sets whether the object is read only. /// public bool? ReadOnly { get; set; } /// /// Gets or sets whether the object is visible to users. /// public bool? Hidden { get; set; } /// /// Gets or sets whether the object is transient. /// public bool? Transient { get; set; } /// /// Gets or sets the description of the object. /// public string Description { get; set; } /// /// Gets or sets the types of values allowed by the object. /// /// The type. public JsonSchemaType? Type { get; set; } /// /// Gets or sets the pattern. /// /// The pattern. public string Pattern { get; set; } /// /// Gets or sets the minimum length. /// /// The minimum length. public int? MinimumLength { get; set; } /// /// Gets or sets the maximum length. /// /// The maximum length. public int? MaximumLength { get; set; } /// /// Gets or sets a number that the value should be divisble by. /// /// A number that the value should be divisble by. public double? DivisibleBy { get; set; } /// /// Gets or sets the minimum. /// /// The minimum. public double? Minimum { get; set; } /// /// Gets or sets the maximum. /// /// The maximum. public double? Maximum { get; set; } /// /// Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. /// /// A flag indicating whether the value can not equal the number defined by the "minimum" attribute. public bool? ExclusiveMinimum { get; set; } /// /// Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. /// /// A flag indicating whether the value can not equal the number defined by the "maximum" attribute. public bool? ExclusiveMaximum { get; set; } /// /// Gets or sets the minimum number of items. /// /// The minimum number of items. public int? MinimumItems { get; set; } /// /// Gets or sets the maximum number of items. /// /// The maximum number of items. public int? MaximumItems { get; set; } /// /// Gets or sets the of items. /// /// The of items. public IList Items { get; set; } /// /// Gets or sets the of properties. /// /// The of properties. public IDictionary Properties { get; set; } /// /// Gets or sets the of additional properties. /// /// The of additional properties. public JsonSchema AdditionalProperties { get; set; } /// /// Gets or sets the pattern properties. /// /// The pattern properties. public IDictionary PatternProperties { get; set; } /// /// Gets or sets a value indicating whether additional properties are allowed. /// /// /// true if additional properties are allowed; otherwise, false. /// public bool AllowAdditionalProperties { get; set; } /// /// Gets or sets the required property if this property is present. /// /// The required property if this property is present. public string Requires { get; set; } /// /// Gets or sets the identity. /// /// The identity. public IList Identity { get; set; } /// /// Gets or sets the a collection of valid enum values allowed. /// /// A collection of valid enum values allowed. public IList Enum { get; set; } /// /// Gets or sets a collection of options. /// /// A collection of options. public IDictionary Options { get; set; } /// /// Gets or sets disallowed types. /// /// The disallow types. public JsonSchemaType? Disallow { get; set; } /// /// Gets or sets the default value. /// /// The default value. public JToken Default { get; set; } /// /// Gets or sets the extend . /// /// The extended . public JsonSchema Extends { get; set; } /// /// Gets or sets the format. /// /// The format. public string Format { get; set; } private readonly string _internalId = Guid.NewGuid().ToString("N"); internal string InternalId { get { return _internalId; } } /// /// Initializes a new instance of the class. /// public JsonSchema() { AllowAdditionalProperties = true; } /// /// Reads a from the specified . /// /// The containing the JSON Schema to read. /// The object representing the JSON Schema. public static JsonSchema Read(JsonReader reader) { return Read(reader, new JsonSchemaResolver()); } /// /// Reads a from the specified . /// /// The containing the JSON Schema to read. /// The to use when resolving schema references. /// The object representing the JSON Schema. public static JsonSchema Read(JsonReader reader, JsonSchemaResolver resolver) { ValidationUtils.ArgumentNotNull(reader, "reader"); ValidationUtils.ArgumentNotNull(resolver, "resolver"); JsonSchemaBuilder builder = new JsonSchemaBuilder(resolver); return builder.Parse(reader); } /// /// Load a from a string that contains schema JSON. /// /// A that contains JSON. /// A populated from the string that contains JSON. public static JsonSchema Parse(string json) { return Parse(json, new JsonSchemaResolver()); } /// /// Parses the specified json. /// /// The json. /// The resolver. /// A populated from the string that contains JSON. public static JsonSchema Parse(string json, JsonSchemaResolver resolver) { ValidationUtils.ArgumentNotNull(json, "json"); JsonReader reader = new JsonTextReader(new StringReader(json)); return Read(reader, resolver); } /// /// Writes this schema to a . /// /// A into which this method will write. public void WriteTo(JsonWriter writer) { WriteTo(writer, new JsonSchemaResolver()); } /// /// Writes this schema to a using the specified . /// /// A into which this method will write. /// The resolver used. public void WriteTo(JsonWriter writer, JsonSchemaResolver resolver) { ValidationUtils.ArgumentNotNull(writer, "writer"); ValidationUtils.ArgumentNotNull(resolver, "resolver"); JsonSchemaWriter schemaWriter = new JsonSchemaWriter(writer, resolver); schemaWriter.WriteSchema(this); } /// /// Returns a that represents the current . /// /// /// A that represents the current . /// public override string ToString() { StringWriter writer = new StringWriter(CultureInfo.InvariantCulture); JsonTextWriter jsonWriter = new JsonTextWriter(writer); jsonWriter.Formatting = Formatting.Indented; WriteTo(jsonWriter); return writer.ToString(); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaNodeCollection.cs0000644000175000017500000000261212253423361031434 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections.ObjectModel; namespace Newtonsoft.Json.Schema { internal class JsonSchemaNodeCollection : KeyedCollection { protected override string GetKeyForItem(JsonSchemaNode item) { return item.Id; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaModelBuilder.cs0000644000175000017500000001277212253423361031112 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections.Generic; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Schema { internal class JsonSchemaModelBuilder { private JsonSchemaNodeCollection _nodes = new JsonSchemaNodeCollection(); private Dictionary _nodeModels = new Dictionary(); private JsonSchemaNode _node ; public JsonSchemaModel Build(JsonSchema schema) { _nodes = new JsonSchemaNodeCollection(); _node = AddSchema(null, schema); _nodeModels = new Dictionary(); JsonSchemaModel model = BuildNodeModel(_node); return model; } public JsonSchemaNode AddSchema(JsonSchemaNode existingNode, JsonSchema schema) { string newId; if (existingNode != null) { if (existingNode.Schemas.Contains(schema)) return existingNode; newId = JsonSchemaNode.GetId(existingNode.Schemas.Union(new[] { schema })); } else { newId = JsonSchemaNode.GetId(new[] { schema }); } if (_nodes.Contains(newId)) return _nodes[newId]; JsonSchemaNode currentNode = (existingNode != null) ? existingNode.Combine(schema) : new JsonSchemaNode(schema); _nodes.Add(currentNode); AddProperties(schema.Properties, currentNode.Properties); AddProperties(schema.PatternProperties, currentNode.PatternProperties); if (schema.Items != null) { for (int i = 0; i < schema.Items.Count; i++) { AddItem(currentNode, i, schema.Items[i]); } } if (schema.AdditionalProperties != null) AddAdditionalProperties(currentNode, schema.AdditionalProperties); if (schema.Extends != null) currentNode = AddSchema(currentNode, schema.Extends); return currentNode; } public void AddProperties(IDictionary source, IDictionary target) { if (source != null) { foreach (KeyValuePair property in source) { AddProperty(target, property.Key, property.Value); } } } public void AddProperty(IDictionary target, string propertyName, JsonSchema schema) { JsonSchemaNode propertyNode; target.TryGetValue(propertyName, out propertyNode); target[propertyName] = AddSchema(propertyNode, schema); } public void AddItem(JsonSchemaNode parentNode, int index, JsonSchema schema) { JsonSchemaNode existingItemNode = (parentNode.Items.Count > index) ? parentNode.Items[index] : null; JsonSchemaNode newItemNode = AddSchema(existingItemNode, schema); if (!(parentNode.Items.Count > index)) { parentNode.Items.Add(newItemNode); } else { parentNode.Items[index] = newItemNode; } } public void AddAdditionalProperties(JsonSchemaNode parentNode, JsonSchema schema) { parentNode.AdditionalProperties = AddSchema(parentNode.AdditionalProperties, schema); } private JsonSchemaModel BuildNodeModel(JsonSchemaNode node) { JsonSchemaModel model; if (_nodeModels.TryGetValue(node, out model)) return model; model = JsonSchemaModel.Create(node.Schemas); _nodeModels[node] = model; foreach (KeyValuePair property in node.Properties) { if (model.Properties == null) model.Properties = new Dictionary(); model.Properties[property.Key] = BuildNodeModel(property.Value); } foreach (KeyValuePair property in node.PatternProperties) { if (model.PatternProperties == null) model.PatternProperties = new Dictionary(); model.PatternProperties[property.Key] = BuildNodeModel(property.Value); } foreach (JsonSchemaNode t in node.Items) { if (model.Items == null) model.Items = new List(); model.Items.Add(BuildNodeModel(t)); } if (node.AdditionalProperties != null) model.AdditionalProperties = BuildNodeModel(node.AdditionalProperties); return model; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaWriter.cs0000644000175000017500000002043612253423361030013 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections.Generic; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Utilities; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Schema { internal class JsonSchemaWriter { private readonly JsonWriter _writer; private readonly JsonSchemaResolver _resolver; public JsonSchemaWriter(JsonWriter writer, JsonSchemaResolver resolver) { ValidationUtils.ArgumentNotNull(writer, "writer"); _writer = writer; _resolver = resolver; } private void ReferenceOrWriteSchema(JsonSchema schema) { if (schema.Id != null && _resolver.GetSchema(schema.Id) != null) { _writer.WriteStartObject(); _writer.WritePropertyName(JsonSchemaConstants.ReferencePropertyName); _writer.WriteValue(schema.Id); _writer.WriteEndObject(); } else { WriteSchema(schema); } } public void WriteSchema(JsonSchema schema) { ValidationUtils.ArgumentNotNull(schema, "schema"); if (!_resolver.LoadedSchemas.Contains(schema)) _resolver.LoadedSchemas.Add(schema); _writer.WriteStartObject(); WritePropertyIfNotNull(_writer, JsonSchemaConstants.IdPropertyName, schema.Id); WritePropertyIfNotNull(_writer, JsonSchemaConstants.TitlePropertyName, schema.Title); WritePropertyIfNotNull(_writer, JsonSchemaConstants.DescriptionPropertyName, schema.Description); WritePropertyIfNotNull(_writer, JsonSchemaConstants.RequiredPropertyName, schema.Required); WritePropertyIfNotNull(_writer, JsonSchemaConstants.ReadOnlyPropertyName, schema.ReadOnly); WritePropertyIfNotNull(_writer, JsonSchemaConstants.HiddenPropertyName, schema.Hidden); WritePropertyIfNotNull(_writer, JsonSchemaConstants.TransientPropertyName, schema.Transient); if (schema.Type != null) WriteType(JsonSchemaConstants.TypePropertyName, _writer, schema.Type.Value); if (!schema.AllowAdditionalProperties) { _writer.WritePropertyName(JsonSchemaConstants.AdditionalPropertiesPropertyName); _writer.WriteValue(schema.AllowAdditionalProperties); } else { if (schema.AdditionalProperties != null) { _writer.WritePropertyName(JsonSchemaConstants.AdditionalPropertiesPropertyName); ReferenceOrWriteSchema(schema.AdditionalProperties); } } WriteSchemaDictionaryIfNotNull(_writer, JsonSchemaConstants.PropertiesPropertyName, schema.Properties); WriteSchemaDictionaryIfNotNull(_writer, JsonSchemaConstants.PatternPropertiesPropertyName, schema.PatternProperties); WriteItems(schema); WritePropertyIfNotNull(_writer, JsonSchemaConstants.MinimumPropertyName, schema.Minimum); WritePropertyIfNotNull(_writer, JsonSchemaConstants.MaximumPropertyName, schema.Maximum); WritePropertyIfNotNull(_writer, JsonSchemaConstants.ExclusiveMinimumPropertyName, schema.ExclusiveMinimum); WritePropertyIfNotNull(_writer, JsonSchemaConstants.ExclusiveMaximumPropertyName, schema.ExclusiveMaximum); WritePropertyIfNotNull(_writer, JsonSchemaConstants.MinimumLengthPropertyName, schema.MinimumLength); WritePropertyIfNotNull(_writer, JsonSchemaConstants.MaximumLengthPropertyName, schema.MaximumLength); WritePropertyIfNotNull(_writer, JsonSchemaConstants.MinimumItemsPropertyName, schema.MinimumItems); WritePropertyIfNotNull(_writer, JsonSchemaConstants.MaximumItemsPropertyName, schema.MaximumItems); WritePropertyIfNotNull(_writer, JsonSchemaConstants.DivisibleByPropertyName, schema.DivisibleBy); WritePropertyIfNotNull(_writer, JsonSchemaConstants.FormatPropertyName, schema.Format); WritePropertyIfNotNull(_writer, JsonSchemaConstants.PatternPropertyName, schema.Pattern); if (schema.Enum != null) { _writer.WritePropertyName(JsonSchemaConstants.EnumPropertyName); _writer.WriteStartArray(); foreach (JToken token in schema.Enum) { token.WriteTo(_writer); } _writer.WriteEndArray(); } if (schema.Default != null) { _writer.WritePropertyName(JsonSchemaConstants.DefaultPropertyName); schema.Default.WriteTo(_writer); } if (schema.Options != null) { _writer.WritePropertyName(JsonSchemaConstants.OptionsPropertyName); _writer.WriteStartArray(); foreach (KeyValuePair option in schema.Options) { _writer.WriteStartObject(); _writer.WritePropertyName(JsonSchemaConstants.OptionValuePropertyName); option.Key.WriteTo(_writer); if (option.Value != null) { _writer.WritePropertyName(JsonSchemaConstants.OptionLabelPropertyName); _writer.WriteValue(option.Value); } _writer.WriteEndObject(); } _writer.WriteEndArray(); } if (schema.Disallow != null) WriteType(JsonSchemaConstants.DisallowPropertyName, _writer, schema.Disallow.Value); if (schema.Extends != null) { _writer.WritePropertyName(JsonSchemaConstants.ExtendsPropertyName); ReferenceOrWriteSchema(schema.Extends); } _writer.WriteEndObject(); } private void WriteSchemaDictionaryIfNotNull(JsonWriter writer, string propertyName, IDictionary properties) { if (properties != null) { writer.WritePropertyName(propertyName); writer.WriteStartObject(); foreach (KeyValuePair property in properties) { writer.WritePropertyName(property.Key); ReferenceOrWriteSchema(property.Value); } writer.WriteEndObject(); } } private void WriteItems(JsonSchema schema) { if (CollectionUtils.IsNullOrEmpty(schema.Items)) return; _writer.WritePropertyName(JsonSchemaConstants.ItemsPropertyName); if (schema.Items.Count == 1) { ReferenceOrWriteSchema(schema.Items[0]); return; } _writer.WriteStartArray(); foreach (JsonSchema itemSchema in schema.Items) { ReferenceOrWriteSchema(itemSchema); } _writer.WriteEndArray(); } private void WriteType(string propertyName, JsonWriter writer, JsonSchemaType type) { IList types; if (System.Enum.IsDefined(typeof(JsonSchemaType), type)) types = new List { type }; else types = EnumUtils.GetFlagsValues(type).Where(v => v != JsonSchemaType.None).ToList(); if (types.Count == 0) return; writer.WritePropertyName(propertyName); if (types.Count == 1) { writer.WriteValue(JsonSchemaBuilder.MapType(types[0])); return; } writer.WriteStartArray(); foreach (JsonSchemaType jsonSchemaType in types) { writer.WriteValue(JsonSchemaBuilder.MapType(jsonSchemaType)); } writer.WriteEndArray(); } private void WritePropertyIfNotNull(JsonWriter writer, string propertyName, object value) { if (value != null) { writer.WritePropertyName(propertyName); writer.WriteValue(value); } } } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaNode.cs0000644000175000017500000000556412253423361027431 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Collections.ObjectModel; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Schema { internal class JsonSchemaNode { public string Id { get; private set; } public ReadOnlyCollection Schemas { get; private set; } public Dictionary Properties { get; private set; } public Dictionary PatternProperties { get; private set; } public List Items { get; private set; } public JsonSchemaNode AdditionalProperties { get; set; } public JsonSchemaNode(JsonSchema schema) { Schemas = new ReadOnlyCollection(new []{ schema }); Properties = new Dictionary(); PatternProperties = new Dictionary(); Items = new List(); Id = GetId(Schemas); } private JsonSchemaNode(JsonSchemaNode source, JsonSchema schema) { Schemas = new ReadOnlyCollection(source.Schemas.Union(new[] { schema }).ToList()); Properties = new Dictionary(source.Properties); PatternProperties = new Dictionary(source.PatternProperties); Items = new List(source.Items); AdditionalProperties = source.AdditionalProperties; Id = GetId(Schemas); } public JsonSchemaNode Combine(JsonSchema schema) { return new JsonSchemaNode(this, schema); } public static string GetId(IEnumerable schemata) { return string.Join("-", schemata.Select(s => s.InternalId).OrderBy(id => id, StringComparer.Ordinal).ToArray()); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaResolver.cs0000644000175000017500000000424412253423361030337 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections.Generic; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Schema { /// /// Resolves from an id. /// public class JsonSchemaResolver { /// /// Gets or sets the loaded schemas. /// /// The loaded schemas. public IList LoadedSchemas { get; protected set; } /// /// Initializes a new instance of the class. /// public JsonSchemaResolver() { LoadedSchemas = new List(); } /// /// Gets a for the specified id. /// /// The id. /// A for the specified id. public virtual JsonSchema GetSchema(string id) { JsonSchema schema = LoadedSchemas.SingleOrDefault(s => s.Id == id); return schema; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/UndefinedSchemaIdHandling.cs0000644000175000017500000000324012253423361031522 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json.Schema { /// /// Specifies undefined schema Id handling options for the . /// public enum UndefinedSchemaIdHandling { /// /// Do not infer a schema Id. /// None = 0, /// /// Use the .NET type name as the schema Id. /// UseTypeName = 1, /// /// Use the assembly qualified .NET type name as the schema Id. /// UseAssemblyQualifiedName = 2, } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/Extensions.cs0000644000175000017500000000764212253423361026727 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections.Generic; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Schema { /// /// Contains the JSON schema extension methods. /// public static class Extensions { /// /// Determines whether the is valid. /// /// The source to test. /// The schema to test with. /// /// true if the specified is valid; otherwise, false. /// public static bool IsValid(this JToken source, JsonSchema schema) { bool valid = true; source.Validate(schema, (sender, args) => { valid = false; }); return valid; } /// /// Determines whether the is valid. /// /// The source to test. /// The schema to test with. /// When this method returns, contains any error messages generated while validating. /// /// true if the specified is valid; otherwise, false. /// public static bool IsValid(this JToken source, JsonSchema schema, out IList errorMessages) { IList errors = new List(); source.Validate(schema, (sender, args) => errors.Add(args.Message)); errorMessages = errors; return (errorMessages.Count == 0); } /// /// Validates the specified . /// /// The source to test. /// The schema to test with. public static void Validate(this JToken source, JsonSchema schema) { source.Validate(schema, null); } /// /// Validates the specified . /// /// The source to test. /// The schema to test with. /// The validation event handler. public static void Validate(this JToken source, JsonSchema schema, ValidationEventHandler validationEventHandler) { ValidationUtils.ArgumentNotNull(source, "source"); ValidationUtils.ArgumentNotNull(schema, "schema"); using (JsonValidatingReader reader = new JsonValidatingReader(source.CreateReader())) { reader.Schema = schema; if (validationEventHandler != null) reader.ValidationEventHandler += validationEventHandler; while (reader.Read()) { } } } } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/ValidationEventHandler.cs0000644000175000017500000000263412253423361031156 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json.Schema { /// /// Represents the callback method that will handle JSON schema validation events and the . /// public delegate void ValidationEventHandler(object sender, ValidationEventArgs e); }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonTextReader.cs0000644000175000017500000013153412253423361026267 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; using System.IO; using System.Xml; using System.Globalization; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json { internal enum ReadType { Read, ReadAsInt32, ReadAsBytes, ReadAsString, ReadAsDecimal, ReadAsDateTime, #if !NET20 ReadAsDateTimeOffset #endif } /// /// Represents a reader that provides fast, non-cached, forward-only access to JSON text data. /// public class JsonTextReader : JsonReader, IJsonLineInfo { private const char UnicodeReplacementChar = '\uFFFD'; private readonly TextReader _reader; private char[] _chars; private int _charsUsed; private int _charPos; private int _lineStartPos; private int _lineNumber; private bool _isEndOfFile; private StringBuffer _buffer; private StringReference _stringReference; /// /// Initializes a new instance of the class with the specified . /// /// The TextReader containing the XML data to read. public JsonTextReader(TextReader reader) { if (reader == null) throw new ArgumentNullException("reader"); _reader = reader; _lineNumber = 1; _chars = new char[4097]; } internal void SetCharBuffer(char[] chars) { _chars = chars; } private StringBuffer GetBuffer() { if (_buffer == null) { _buffer = new StringBuffer(4096); } else { _buffer.Position = 0; } return _buffer; } private void OnNewLine(int pos) { _lineNumber++; _lineStartPos = pos - 1; } private void ParseString(char quote) { _charPos++; ShiftBufferIfNeeded(); ReadStringIntoBuffer(quote); if (_readType == ReadType.ReadAsBytes) { byte[] data; if (_stringReference.Length == 0) { data = new byte[0]; } else { data = Convert.FromBase64CharArray(_stringReference.Chars, _stringReference.StartIndex, _stringReference.Length); } SetToken(JsonToken.Bytes, data); } else if (_readType == ReadType.ReadAsString) { string text = _stringReference.ToString(); SetToken(JsonToken.String, text); QuoteChar = quote; } else { string text = _stringReference.ToString(); if (_dateParseHandling != DateParseHandling.None) { if (text.Length > 0) { if (text[0] == '/') { if (text.StartsWith("/Date(", StringComparison.Ordinal) && text.EndsWith(")/", StringComparison.Ordinal)) { ParseDateMicrosoft(text); return; } } else if (char.IsDigit(text[0]) && text.Length >= 19 && text.Length <= 40) { if (ParseDateIso(text)) return; } } } SetToken(JsonToken.String, text); QuoteChar = quote; } } private bool ParseDateIso(string text) { const string isoDateFormat = "yyyy-MM-ddTHH:mm:ss.FFFFFFFK"; #if !NET20 if (_readType == ReadType.ReadAsDateTimeOffset || (_readType == ReadType.Read && _dateParseHandling == DateParseHandling.DateTimeOffset)) { DateTimeOffset dateTimeOffset; if (DateTimeOffset.TryParseExact(text, isoDateFormat, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out dateTimeOffset)) { SetToken(JsonToken.Date, dateTimeOffset); return true; } } else #endif { DateTime dateTime; if (DateTime.TryParseExact(text, isoDateFormat, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out dateTime)) { dateTime = JsonConvert.EnsureDateTime(dateTime, DateTimeZoneHandling); SetToken(JsonToken.Date, dateTime); return true; } } return false; } private void ParseDateMicrosoft(string text) { string value = text.Substring(6, text.Length - 8); DateTimeKind kind = DateTimeKind.Utc; int index = value.IndexOf('+', 1); if (index == -1) index = value.IndexOf('-', 1); TimeSpan offset = TimeSpan.Zero; if (index != -1) { kind = DateTimeKind.Local; offset = ReadOffset(value.Substring(index)); value = value.Substring(0, index); } long javaScriptTicks = long.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture); DateTime utcDateTime = JsonConvert.ConvertJavaScriptTicksToDateTime(javaScriptTicks); #if !NET20 if (_readType == ReadType.ReadAsDateTimeOffset || (_readType == ReadType.Read && _dateParseHandling == DateParseHandling.DateTimeOffset)) { SetToken(JsonToken.Date, new DateTimeOffset(utcDateTime.Add(offset).Ticks, offset)); } else #endif { DateTime dateTime; switch (kind) { case DateTimeKind.Unspecified: dateTime = DateTime.SpecifyKind(utcDateTime.ToLocalTime(), DateTimeKind.Unspecified); break; case DateTimeKind.Local: dateTime = utcDateTime.ToLocalTime(); break; default: dateTime = utcDateTime; break; } dateTime = JsonConvert.EnsureDateTime(dateTime, DateTimeZoneHandling); SetToken(JsonToken.Date, dateTime); } } private static void BlockCopyChars(char[] src, int srcOffset, char[] dst, int dstOffset, int count) { const int charByteCount = 2; Buffer.BlockCopy(src, srcOffset * charByteCount, dst, dstOffset * charByteCount, count * charByteCount); } private void ShiftBufferIfNeeded() { // once in the last 10% of the buffer shift the remainling content to the start to avoid // unnessesarly increasing the buffer size when reading numbers/strings int length = _chars.Length; if (length - _charPos <= length * 0.1) { int count = _charsUsed - _charPos; if (count > 0) BlockCopyChars(_chars, _charPos, _chars, 0, count); _lineStartPos -= _charPos; _charPos = 0; _charsUsed = count; _chars[_charsUsed] = '\0'; } } private int ReadData(bool append) { return ReadData(append, 0); } private int ReadData(bool append, int charsRequired) { if (_isEndOfFile) return 0; // char buffer is full if (_charsUsed + charsRequired >= _chars.Length - 1) { if (append) { // copy to new array either double the size of the current or big enough to fit required content int newArrayLength = Math.Max(_chars.Length * 2, _charsUsed + charsRequired + 1); // increase the size of the buffer char[] dst = new char[newArrayLength]; BlockCopyChars(_chars, 0, dst, 0, _chars.Length); _chars = dst; } else { int remainingCharCount = _charsUsed - _charPos; if (remainingCharCount + charsRequired + 1 >= _chars.Length) { // the remaining count plus the required is bigger than the current buffer size char[] dst = new char[remainingCharCount + charsRequired + 1]; if (remainingCharCount > 0) BlockCopyChars(_chars, _charPos, dst, 0, remainingCharCount); _chars = dst; } else { // copy any remaining data to the beginning of the buffer if needed and reset positions if (remainingCharCount > 0) BlockCopyChars(_chars, _charPos, _chars, 0, remainingCharCount); } _lineStartPos -= _charPos; _charPos = 0; _charsUsed = remainingCharCount; } } int attemptCharReadCount = _chars.Length - _charsUsed - 1; int charsRead = _reader.Read(_chars, _charsUsed, attemptCharReadCount); _charsUsed += charsRead; if (charsRead == 0) _isEndOfFile = true; _chars[_charsUsed] = '\0'; return charsRead; } private bool EnsureChars(int relativePosition, bool append) { if (_charPos + relativePosition >= _charsUsed) return ReadChars(relativePosition, append); return true; } private bool ReadChars(int relativePosition, bool append) { if (_isEndOfFile) return false; int charsRequired = _charPos + relativePosition - _charsUsed + 1; int totalCharsRead = 0; // it is possible that the TextReader doesn't return all data at once // repeat read until the required text is returned or the reader is out of content do { int charsRead = ReadData(append, charsRequired - totalCharsRead); // no more content if (charsRead == 0) break; totalCharsRead += charsRead; } while (totalCharsRead < charsRequired); if (totalCharsRead < charsRequired) return false; return true; } private static TimeSpan ReadOffset(string offsetText) { bool negative = (offsetText[0] == '-'); int hours = int.Parse(offsetText.Substring(1, 2), NumberStyles.Integer, CultureInfo.InvariantCulture); int minutes = 0; if (offsetText.Length >= 5) minutes = int.Parse(offsetText.Substring(3, 2), NumberStyles.Integer, CultureInfo.InvariantCulture); TimeSpan offset = TimeSpan.FromHours(hours) + TimeSpan.FromMinutes(minutes); if (negative) offset = offset.Negate(); return offset; } /// /// Reads the next JSON token from the stream. /// /// /// true if the next token was read successfully; false if there are no more tokens to read. /// [DebuggerStepThrough] public override bool Read() { _readType = ReadType.Read; if (!ReadInternal()) { SetToken(JsonToken.None); return false; } return true; } /// /// Reads the next JSON token from the stream as a . /// /// /// A or a null reference if the next JSON token is null. This method will return null at the end of an array. /// public override byte[] ReadAsBytes() { return ReadAsBytesInternal(); } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override decimal? ReadAsDecimal() { return ReadAsDecimalInternal(); } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override int? ReadAsInt32() { return ReadAsInt32Internal(); } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override string ReadAsString() { return ReadAsStringInternal(); } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override DateTime? ReadAsDateTime() { return ReadAsDateTimeInternal(); } #if !NET20 /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override DateTimeOffset? ReadAsDateTimeOffset() { return ReadAsDateTimeOffsetInternal(); } #endif internal override bool ReadInternal() { while (true) { switch (_currentState) { case State.Start: case State.Property: case State.Array: case State.ArrayStart: case State.Constructor: case State.ConstructorStart: return ParseValue(); case State.Complete: break; case State.Object: case State.ObjectStart: return ParseObject(); case State.PostValue: // returns true if it hits // end of object or array if (ParsePostValue()) return true; break; case State.Finished: if (EnsureChars(0, false)) { EatWhitespace(false); if (_isEndOfFile) { return false; } if (_chars[_charPos] == '/') { ParseComment(); return true; } else { throw JsonReaderException.Create(this, "Additional text encountered after finished reading JSON content: {0}.".FormatWith(CultureInfo.InvariantCulture, _chars[_charPos])); } } return false; case State.Closed: break; case State.Error: break; default: throw JsonReaderException.Create(this, "Unexpected state: {0}.".FormatWith(CultureInfo.InvariantCulture, CurrentState)); } } } private void ReadStringIntoBuffer(char quote) { int charPos = _charPos; int initialPosition = _charPos; int lastWritePosition = _charPos; StringBuffer buffer = null; while (true) { switch (_chars[charPos++]) { case '\0': if (_charsUsed == charPos - 1) { charPos--; if (ReadData(true) == 0) { _charPos = charPos; throw JsonReaderException.Create(this, "Unterminated string. Expected delimiter: {0}.".FormatWith(CultureInfo.InvariantCulture, quote)); } } break; case '\\': _charPos = charPos; if (!EnsureChars(0, true)) { _charPos = charPos; throw JsonReaderException.Create(this, "Unterminated string. Expected delimiter: {0}.".FormatWith(CultureInfo.InvariantCulture, quote)); } // start of escape sequence int escapeStartPos = charPos - 1; char currentChar = _chars[charPos]; char writeChar; switch (currentChar) { case 'b': charPos++; writeChar = '\b'; break; case 't': charPos++; writeChar = '\t'; break; case 'n': charPos++; writeChar = '\n'; break; case 'f': charPos++; writeChar = '\f'; break; case 'r': charPos++; writeChar = '\r'; break; case '\\': charPos++; writeChar = '\\'; break; case '"': case '\'': case '/': writeChar = currentChar; charPos++; break; case 'u': charPos++; _charPos = charPos; writeChar = ParseUnicode(); if (StringUtils.IsLowSurrogate(writeChar)) { // low surrogate with no preceding high surrogate; this char is replaced writeChar = UnicodeReplacementChar; } else if (StringUtils.IsHighSurrogate(writeChar)) { bool anotherHighSurrogate; // loop for handling situations where there are multiple consecutive high surrogates do { anotherHighSurrogate = false; // potential start of a surrogate pair if (EnsureChars(2, true) && _chars[_charPos] == '\\' && _chars[_charPos + 1] == 'u') { char highSurrogate = writeChar; _charPos += 2; writeChar = ParseUnicode(); if (StringUtils.IsLowSurrogate(writeChar)) { // a valid surrogate pair! } else if (StringUtils.IsHighSurrogate(writeChar)) { // another high surrogate; replace current and start check over highSurrogate = UnicodeReplacementChar; anotherHighSurrogate = true; } else { // high surrogate not followed by low surrogate; original char is replaced highSurrogate = UnicodeReplacementChar; } if (buffer == null) buffer = GetBuffer(); WriteCharToBuffer(buffer, highSurrogate, lastWritePosition, escapeStartPos); lastWritePosition = _charPos; } else { // there are not enough remaining chars for the low surrogate or is not follow by unicode sequence // replace high surrogate and continue on as usual writeChar = UnicodeReplacementChar; } } while (anotherHighSurrogate); } charPos = _charPos; break; default: charPos++; _charPos = charPos; throw JsonReaderException.Create(this, "Bad JSON escape sequence: {0}.".FormatWith(CultureInfo.InvariantCulture, @"\" + currentChar)); } if (buffer == null) buffer = GetBuffer(); WriteCharToBuffer(buffer, writeChar, lastWritePosition, escapeStartPos); lastWritePosition = charPos; break; case StringUtils.CarriageReturn: _charPos = charPos - 1; ProcessCarriageReturn(true); charPos = _charPos; break; case StringUtils.LineFeed: _charPos = charPos - 1; ProcessLineFeed(); charPos = _charPos; break; case '"': case '\'': if (_chars[charPos - 1] == quote) { charPos--; if (initialPosition == lastWritePosition) { _stringReference = new StringReference(_chars, initialPosition, charPos - initialPosition); } else { if (buffer == null) buffer = GetBuffer(); if (charPos > lastWritePosition) buffer.Append(_chars, lastWritePosition, charPos - lastWritePosition); _stringReference = new StringReference(buffer.GetInternalBuffer(), 0, buffer.Position); } charPos++; _charPos = charPos; return; } break; } } } private void WriteCharToBuffer(StringBuffer buffer, char writeChar, int lastWritePosition, int writeToPosition) { if (writeToPosition > lastWritePosition) { buffer.Append(_chars, lastWritePosition, writeToPosition - lastWritePosition); } buffer.Append(writeChar); } private char ParseUnicode() { char writeChar; if (EnsureChars(4, true)) { string hexValues = new string(_chars, _charPos, 4); char hexChar = Convert.ToChar(int.Parse(hexValues, NumberStyles.HexNumber, NumberFormatInfo.InvariantInfo)); writeChar = hexChar; _charPos += 4; } else { throw JsonReaderException.Create(this, "Unexpected end while parsing unicode character."); } return writeChar; } private void ReadNumberIntoBuffer() { int charPos = _charPos; while (true) { switch (_chars[charPos++]) { case '\0': if (_charsUsed == charPos - 1) { charPos--; _charPos = charPos; if (ReadData(true) == 0) return; } break; case '-': case '+': case 'a': case 'A': case 'b': case 'B': case 'c': case 'C': case 'd': case 'D': case 'e': case 'E': case 'f': case 'F': case 'x': case 'X': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: _charPos = charPos - 1; return; } } } private void ClearRecentString() { if (_buffer != null) _buffer.Position = 0; _stringReference = new StringReference(); } private bool ParsePostValue() { while (true) { char currentChar = _chars[_charPos]; switch (currentChar) { case '\0': if (_charsUsed == _charPos) { if (ReadData(false) == 0) { _currentState = State.Finished; return false; } } else { _charPos++; } break; case '}': _charPos++; SetToken(JsonToken.EndObject); return true; case ']': _charPos++; SetToken(JsonToken.EndArray); return true; case ')': _charPos++; SetToken(JsonToken.EndConstructor); return true; case '/': ParseComment(); return true; case ',': _charPos++; // finished parsing SetStateBasedOnCurrent(); return false; case ' ': case StringUtils.Tab: // eat _charPos++; break; case StringUtils.CarriageReturn: ProcessCarriageReturn(false); break; case StringUtils.LineFeed: ProcessLineFeed(); break; default: if (char.IsWhiteSpace(currentChar)) { // eat _charPos++; } else { throw JsonReaderException.Create(this, "After parsing a value an unexpected character was encountered: {0}.".FormatWith(CultureInfo.InvariantCulture, currentChar)); } break; } } } private bool ParseObject() { while (true) { char currentChar = _chars[_charPos]; switch (currentChar) { case '\0': if (_charsUsed == _charPos) { if (ReadData(false) == 0) return false; } else { _charPos++; } break; case '}': SetToken(JsonToken.EndObject); _charPos++; return true; case '/': ParseComment(); return true; case StringUtils.CarriageReturn: ProcessCarriageReturn(false); break; case StringUtils.LineFeed: ProcessLineFeed(); break; case ' ': case StringUtils.Tab: // eat _charPos++; break; default: if (char.IsWhiteSpace(currentChar)) { // eat _charPos++; } else { return ParseProperty(); } break; } } } private bool ParseProperty() { char firstChar = _chars[_charPos]; char quoteChar; if (firstChar == '"' || firstChar == '\'') { _charPos++; quoteChar = firstChar; ShiftBufferIfNeeded(); ReadStringIntoBuffer(quoteChar); } else if (ValidIdentifierChar(firstChar)) { quoteChar = '\0'; ShiftBufferIfNeeded(); ParseUnquotedProperty(); } else { throw JsonReaderException.Create(this, "Invalid property identifier character: {0}.".FormatWith(CultureInfo.InvariantCulture, _chars[_charPos])); } string propertyName = _stringReference.ToString(); EatWhitespace(false); if (_chars[_charPos] != ':') throw JsonReaderException.Create(this, "Invalid character after parsing property name. Expected ':' but got: {0}.".FormatWith(CultureInfo.InvariantCulture, _chars[_charPos])); _charPos++; SetToken(JsonToken.PropertyName, propertyName); QuoteChar = quoteChar; ClearRecentString(); return true; } private bool ValidIdentifierChar(char value) { return (char.IsLetterOrDigit(value) || value == '_' || value == '$'); } private void ParseUnquotedProperty() { int initialPosition = _charPos; // parse unquoted property name until whitespace or colon while (true) { switch (_chars[_charPos]) { case '\0': if (_charsUsed == _charPos) { if (ReadData(true) == 0) throw JsonReaderException.Create(this, "Unexpected end while parsing unquoted property name."); break; } _stringReference = new StringReference(_chars, initialPosition, _charPos - initialPosition); return; default: char currentChar = _chars[_charPos]; if (ValidIdentifierChar(currentChar)) { _charPos++; break; } else if (char.IsWhiteSpace(currentChar) || currentChar == ':') { _stringReference = new StringReference(_chars, initialPosition, _charPos - initialPosition); return; } throw JsonReaderException.Create(this, "Invalid JavaScript property identifier character: {0}.".FormatWith(CultureInfo.InvariantCulture, currentChar)); } } } private bool ParseValue() { while (true) { char currentChar = _chars[_charPos]; switch (currentChar) { case '\0': if (_charsUsed == _charPos) { if (ReadData(false) == 0) return false; } else { _charPos++; } break; case '"': case '\'': ParseString(currentChar); return true; case 't': ParseTrue(); return true; case 'f': ParseFalse(); return true; case 'n': if (EnsureChars(1, true)) { char next = _chars[_charPos + 1]; if (next == 'u') ParseNull(); else if (next == 'e') ParseConstructor(); else throw JsonReaderException.Create(this, "Unexpected character encountered while parsing value: {0}.".FormatWith(CultureInfo.InvariantCulture, _chars[_charPos])); } else { throw JsonReaderException.Create(this, "Unexpected end."); } return true; case 'N': ParseNumberNaN(); return true; case 'I': ParseNumberPositiveInfinity(); return true; case '-': if (EnsureChars(1, true) && _chars[_charPos + 1] == 'I') ParseNumberNegativeInfinity(); else ParseNumber(); return true; case '/': ParseComment(); return true; case 'u': ParseUndefined(); return true; case '{': _charPos++; SetToken(JsonToken.StartObject); return true; case '[': _charPos++; SetToken(JsonToken.StartArray); return true; case ']': _charPos++; SetToken(JsonToken.EndArray); return true; case ',': // don't increment position, the next call to read will handle comma // this is done to handle multiple empty comma values SetToken(JsonToken.Undefined); return true; case ')': _charPos++; SetToken(JsonToken.EndConstructor); return true; case StringUtils.CarriageReturn: ProcessCarriageReturn(false); break; case StringUtils.LineFeed: ProcessLineFeed(); break; case ' ': case StringUtils.Tab: // eat _charPos++; break; default: if (char.IsWhiteSpace(currentChar)) { // eat _charPos++; break; } else if (char.IsNumber(currentChar) || currentChar == '-' || currentChar == '.') { ParseNumber(); return true; } else { throw JsonReaderException.Create(this, "Unexpected character encountered while parsing value: {0}.".FormatWith(CultureInfo.InvariantCulture, currentChar)); } } } } private void ProcessLineFeed() { _charPos++; OnNewLine(_charPos); } private void ProcessCarriageReturn(bool append) { _charPos++; if (EnsureChars(1, append) && _chars[_charPos] == StringUtils.LineFeed) _charPos++; OnNewLine(_charPos); } private bool EatWhitespace(bool oneOrMore) { bool finished = false; bool ateWhitespace = false; while (!finished) { char currentChar = _chars[_charPos]; switch (currentChar) { case '\0': if (_charsUsed == _charPos) { if (ReadData(false) == 0) finished = true; } else { _charPos++; } break; case StringUtils.CarriageReturn: ProcessCarriageReturn(false); break; case StringUtils.LineFeed: ProcessLineFeed(); break; default: if (currentChar == ' ' || char.IsWhiteSpace(currentChar)) { ateWhitespace = true; _charPos++; } else { finished = true; } break; } } return (!oneOrMore || ateWhitespace); } private void ParseConstructor() { if (MatchValueWithTrailingSeperator("new")) { EatWhitespace(false); int initialPosition = _charPos; int endPosition; while (true) { char currentChar = _chars[_charPos]; if (currentChar == '\0') { if (_charsUsed == _charPos) { if (ReadData(true) == 0) throw JsonReaderException.Create(this, "Unexpected end while parsing constructor."); } else { endPosition = _charPos; _charPos++; break; } } else if (char.IsLetterOrDigit(currentChar)) { _charPos++; } else if (currentChar == StringUtils.CarriageReturn) { endPosition = _charPos; ProcessCarriageReturn(true); break; } else if (currentChar == StringUtils.LineFeed) { endPosition = _charPos; ProcessLineFeed(); break; } else if (char.IsWhiteSpace(currentChar)) { endPosition = _charPos; _charPos++; break; } else if (currentChar == '(') { endPosition = _charPos; break; } else { throw JsonReaderException.Create(this, "Unexpected character while parsing constructor: {0}.".FormatWith(CultureInfo.InvariantCulture, currentChar)); } } _stringReference = new StringReference(_chars, initialPosition, endPosition - initialPosition); string constructorName = _stringReference.ToString(); EatWhitespace(false); if (_chars[_charPos] != '(') throw JsonReaderException.Create(this, "Unexpected character while parsing constructor: {0}.".FormatWith(CultureInfo.InvariantCulture, _chars[_charPos])); _charPos++; ClearRecentString(); SetToken(JsonToken.StartConstructor, constructorName); } } private void ParseNumber() { ShiftBufferIfNeeded(); char firstChar = _chars[_charPos]; int initialPosition = _charPos; ReadNumberIntoBuffer(); _stringReference = new StringReference(_chars, initialPosition, _charPos - initialPosition); object numberValue; JsonToken numberType; bool singleDigit = (char.IsDigit(firstChar) && _stringReference.Length == 1); bool nonBase10 = (firstChar == '0' && _stringReference.Length > 1 && _stringReference.Chars[_stringReference.StartIndex + 1] != '.' && _stringReference.Chars[_stringReference.StartIndex + 1] != 'e' && _stringReference.Chars[_stringReference.StartIndex + 1] != 'E'); if (_readType == ReadType.ReadAsInt32) { if (singleDigit) { // digit char values start at 48 numberValue = firstChar - 48; } else if (nonBase10) { string number = _stringReference.ToString(); // decimal.Parse doesn't support parsing hexadecimal values int integer = number.StartsWith("0x", StringComparison.OrdinalIgnoreCase) ? Convert.ToInt32(number, 16) : Convert.ToInt32(number, 8); numberValue = integer; } else { string number = _stringReference.ToString(); numberValue = Convert.ToInt32(number, CultureInfo.InvariantCulture); } numberType = JsonToken.Integer; } else if (_readType == ReadType.ReadAsDecimal) { if (singleDigit) { // digit char values start at 48 numberValue = (decimal)firstChar - 48; } else if (nonBase10) { string number = _stringReference.ToString(); // decimal.Parse doesn't support parsing hexadecimal values long integer = number.StartsWith("0x", StringComparison.OrdinalIgnoreCase) ? Convert.ToInt64(number, 16) : Convert.ToInt64(number, 8); numberValue = Convert.ToDecimal(integer); } else { string number = _stringReference.ToString(); numberValue = decimal.Parse(number, NumberStyles.Number | NumberStyles.AllowExponent, CultureInfo.InvariantCulture); } numberType = JsonToken.Float; } else { if (singleDigit) { // digit char values start at 48 numberValue = (long)firstChar - 48; numberType = JsonToken.Integer; } else if (nonBase10) { string number = _stringReference.ToString(); numberValue = number.StartsWith("0x", StringComparison.OrdinalIgnoreCase) ? Convert.ToInt64(number, 16) : Convert.ToInt64(number, 8); numberType = JsonToken.Integer; } else { string number = _stringReference.ToString(); // it's faster to do 3 indexof with single characters than an indexofany if (number.IndexOf('.') != -1 || number.IndexOf('E') != -1 || number.IndexOf('e') != -1) { numberValue = Convert.ToDouble(number, CultureInfo.InvariantCulture); numberType = JsonToken.Float; } else { try { numberValue = Convert.ToInt64(number, CultureInfo.InvariantCulture); } catch (OverflowException ex) { throw JsonReaderException.Create((JsonReader)this, "JSON integer {0} is too large or small for an Int64.".FormatWith(CultureInfo.InvariantCulture, number), ex); } numberType = JsonToken.Integer; } } } ClearRecentString(); SetToken(numberType, numberValue); } private void ParseComment() { // should have already parsed / character before reaching this method _charPos++; if (!EnsureChars(1, false) || _chars[_charPos] != '*') throw JsonReaderException.Create(this, "Error parsing comment. Expected: *, got {0}.".FormatWith(CultureInfo.InvariantCulture, _chars[_charPos])); else _charPos++; int initialPosition = _charPos; bool commentFinished = false; while (!commentFinished) { switch (_chars[_charPos]) { case '\0': if (_charsUsed == _charPos) { if (ReadData(true) == 0) throw JsonReaderException.Create(this, "Unexpected end while parsing comment."); } else { _charPos++; } break; case '*': _charPos++; if (EnsureChars(0, true)) { if (_chars[_charPos] == '/') { _stringReference = new StringReference(_chars, initialPosition, _charPos - initialPosition - 1); _charPos++; commentFinished = true; } } break; case StringUtils.CarriageReturn: ProcessCarriageReturn(true); break; case StringUtils.LineFeed: ProcessLineFeed(); break; default: _charPos++; break; } } SetToken(JsonToken.Comment, _stringReference.ToString()); ClearRecentString(); } private bool MatchValue(string value) { if (!EnsureChars(value.Length - 1, true)) return false; for (int i = 0; i < value.Length; i++) { if (_chars[_charPos + i] != value[i]) { return false; } } _charPos += value.Length; return true; } private bool MatchValueWithTrailingSeperator(string value) { // will match value and then move to the next character, checking that it is a seperator character bool match = MatchValue(value); if (!match) return false; if (!EnsureChars(0, false)) return true; return IsSeperator(_chars[_charPos]) || _chars[_charPos] == '\0'; } private bool IsSeperator(char c) { switch (c) { case '}': case ']': case ',': return true; case '/': // check next character to see if start of a comment if (!EnsureChars(1, false)) return false; return (_chars[_charPos + 1] == '*'); case ')': if (CurrentState == State.Constructor || CurrentState == State.ConstructorStart) return true; break; case ' ': case StringUtils.Tab: case StringUtils.LineFeed: case StringUtils.CarriageReturn: return true; default: if (char.IsWhiteSpace(c)) return true; break; } return false; } private void ParseTrue() { // check characters equal 'true' // and that it is followed by either a seperator character // or the text ends if (MatchValueWithTrailingSeperator(JsonConvert.True)) { SetToken(JsonToken.Boolean, true); } else { throw JsonReaderException.Create(this, "Error parsing boolean value."); } } private void ParseNull() { if (MatchValueWithTrailingSeperator(JsonConvert.Null)) { SetToken(JsonToken.Null); } else { throw JsonReaderException.Create(this, "Error parsing null value."); } } private void ParseUndefined() { if (MatchValueWithTrailingSeperator(JsonConvert.Undefined)) { SetToken(JsonToken.Undefined); } else { throw JsonReaderException.Create(this, "Error parsing undefined value."); } } private void ParseFalse() { if (MatchValueWithTrailingSeperator(JsonConvert.False)) { SetToken(JsonToken.Boolean, false); } else { throw JsonReaderException.Create(this, "Error parsing boolean value."); } } private void ParseNumberNegativeInfinity() { if (MatchValueWithTrailingSeperator(JsonConvert.NegativeInfinity)) { SetToken(JsonToken.Float, double.NegativeInfinity); } else { throw JsonReaderException.Create(this, "Error parsing negative infinity value."); } } private void ParseNumberPositiveInfinity() { if (MatchValueWithTrailingSeperator(JsonConvert.PositiveInfinity)) { SetToken(JsonToken.Float, double.PositiveInfinity); } else { throw JsonReaderException.Create(this, "Error parsing positive infinity value."); } } private void ParseNumberNaN() { if (MatchValueWithTrailingSeperator(JsonConvert.NaN)) { SetToken(JsonToken.Float, double.NaN); } else { throw JsonReaderException.Create(this, "Error parsing NaN value."); } } /// /// Changes the state to closed. /// public override void Close() { base.Close(); if (CloseInput && _reader != null) #if !(NETFX_CORE || PORTABLE) _reader.Close(); #else _reader.Dispose(); #endif if (_buffer != null) _buffer.Clear(); } /// /// Gets a value indicating whether the class can return line information. /// /// /// true if LineNumber and LinePosition can be provided; otherwise, false. /// public bool HasLineInfo() { return true; } /// /// Gets the current line number. /// /// /// The current line number or 0 if no line information is available (for example, HasLineInfo returns false). /// public int LineNumber { get { if (CurrentState == State.Start && LinePosition == 0) return 0; return _lineNumber; } } /// /// Gets the current line position. /// /// /// The current line position or 0 if no line information is available (for example, HasLineInfo returns false). /// public int LinePosition { get { return _charPos - _lineStartPos; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/MemberSerialization.cs0000644000175000017500000000456012253423361027331 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Runtime.Serialization; using Newtonsoft.Json.Serialization; namespace Newtonsoft.Json { /// /// Specifies the member serialization options for the . /// public enum MemberSerialization { /// /// All public members are serialized by default. Members can be excluded using or . /// This is the default member serialization mode. /// OptOut, /// /// Only members must be marked with or are serialized. /// This member serialization mode can also be set by marking the class with . /// OptIn, /// /// All public and private fields are serialized. Members can be excluded using or . /// This member serialization mode can also be set by marking the class with /// and setting IgnoreSerializableAttribute on to false. /// Fields } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonObjectAttribute.cs0000644000175000017500000000623112253423361027305 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json { /// /// Instructs the how to serialize the object. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, AllowMultiple = false)] public sealed class JsonObjectAttribute : JsonContainerAttribute { private MemberSerialization _memberSerialization = MemberSerialization.OptOut; // yuck. can't set nullable properties on an attribute in C# // have to use this approach to get an unset default state internal Required? _itemRequired; /// /// Gets or sets the member serialization. /// /// The member serialization. public MemberSerialization MemberSerialization { get { return _memberSerialization; } set { _memberSerialization = value; } } /// /// Gets or sets a value that indicates whether the object's properties are required. /// /// /// A value indicating whether the object's properties are required. /// public Required ItemRequired { get { return _itemRequired ?? default(Required); } set { _itemRequired = value; } } /// /// Initializes a new instance of the class. /// public JsonObjectAttribute() { } /// /// Initializes a new instance of the class with the specified member serialization. /// /// The member serialization. public JsonObjectAttribute(MemberSerialization memberSerialization) { MemberSerialization = memberSerialization; } /// /// Initializes a new instance of the class with the specified container Id. /// /// The container Id. public JsonObjectAttribute(string id) : base(id) { } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/DefaultValueHandling.cs0000644000175000017500000000532112253423361027406 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json { /// /// Specifies default value handling options for the . /// /// /// /// /// [Flags] public enum DefaultValueHandling { /// /// Include members where the member value is the same as the member's default value when serializing objects. /// Included members are written to JSON. Has no effect when deserializing. /// Include = 0, /// /// Ignore members where the member value is the same as the member's default value when serializing objects /// so that is is not written to JSON, and ignores setting members when the JSON value equals the member's default value. /// Ignore = 1, /// /// Members with a default value but no JSON will be set to their default value when deserializing. /// Populate = 2, /// /// Ignore members where the member value is the same as the member's default value when serializing objects /// and sets members to their default value when deserializing. /// IgnoreAndPopulate = Ignore | Populate } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonSerializerSettings.cs0000644000175000017500000002405512253423361030051 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Globalization; using System.Runtime.Serialization.Formatters; using Newtonsoft.Json.Serialization; using System.Runtime.Serialization; namespace Newtonsoft.Json { /// /// Specifies the settings on a object. /// public class JsonSerializerSettings { internal const ReferenceLoopHandling DefaultReferenceLoopHandling = ReferenceLoopHandling.Error; internal const MissingMemberHandling DefaultMissingMemberHandling = MissingMemberHandling.Ignore; internal const NullValueHandling DefaultNullValueHandling = NullValueHandling.Include; internal const DefaultValueHandling DefaultDefaultValueHandling = DefaultValueHandling.Include; internal const ObjectCreationHandling DefaultObjectCreationHandling = ObjectCreationHandling.Auto; internal const PreserveReferencesHandling DefaultPreserveReferencesHandling = PreserveReferencesHandling.None; internal const ConstructorHandling DefaultConstructorHandling = ConstructorHandling.Default; internal const TypeNameHandling DefaultTypeNameHandling = TypeNameHandling.None; internal const FormatterAssemblyStyle DefaultTypeNameAssemblyFormat = FormatterAssemblyStyle.Simple; internal static readonly StreamingContext DefaultContext; internal const Formatting DefaultFormatting = Formatting.None; internal const DateFormatHandling DefaultDateFormatHandling = DateFormatHandling.IsoDateFormat; internal const DateTimeZoneHandling DefaultDateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind; internal const DateParseHandling DefaultDateParseHandling = DateParseHandling.DateTime; internal static readonly CultureInfo DefaultCulture; internal const bool DefaultCheckAdditionalContent = false; internal Formatting? _formatting; internal DateFormatHandling? _dateFormatHandling; internal DateTimeZoneHandling? _dateTimeZoneHandling; internal DateParseHandling? _dateParseHandling; internal CultureInfo _culture; internal bool? _checkAdditionalContent; internal int? _maxDepth; internal bool _maxDepthSet; /// /// Gets or sets how reference loops (e.g. a class referencing itself) is handled. /// /// Reference loop handling. public ReferenceLoopHandling ReferenceLoopHandling { get; set; } /// /// Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. /// /// Missing member handling. public MissingMemberHandling MissingMemberHandling { get; set; } /// /// Gets or sets how objects are created during deserialization. /// /// The object creation handling. public ObjectCreationHandling ObjectCreationHandling { get; set; } /// /// Gets or sets how null values are handled during serialization and deserialization. /// /// Null value handling. public NullValueHandling NullValueHandling { get; set; } /// /// Gets or sets how null default are handled during serialization and deserialization. /// /// The default value handling. public DefaultValueHandling DefaultValueHandling { get; set; } /// /// Gets or sets a collection that will be used during serialization. /// /// The converters. public IList Converters { get; set; } /// /// Gets or sets how object references are preserved by the serializer. /// /// The preserve references handling. public PreserveReferencesHandling PreserveReferencesHandling { get; set; } /// /// Gets or sets how type name writing and reading is handled by the serializer. /// /// The type name handling. public TypeNameHandling TypeNameHandling { get; set; } /// /// Gets or sets how a type name assembly is written and resolved by the serializer. /// /// The type name assembly format. public FormatterAssemblyStyle TypeNameAssemblyFormat { get; set; } /// /// Gets or sets how constructors are used during deserialization. /// /// The constructor handling. public ConstructorHandling ConstructorHandling { get; set; } /// /// Gets or sets the contract resolver used by the serializer when /// serializing .NET objects to JSON and vice versa. /// /// The contract resolver. public IContractResolver ContractResolver { get; set; } /// /// Gets or sets the used by the serializer when resolving references. /// /// The reference resolver. public IReferenceResolver ReferenceResolver { get; set; } /// /// Gets or sets the used by the serializer when resolving type names. /// /// The binder. public SerializationBinder Binder { get; set; } /// /// Gets or sets the error handler called during serialization and deserialization. /// /// The error handler called during serialization and deserialization. public EventHandler Error { get; set; } /// /// Gets or sets the used by the serializer when invoking serialization callback methods. /// /// The context. public StreamingContext Context { get; set; } /// /// Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . /// public int? MaxDepth { get { return _maxDepth; } set { if (value <= 0) throw new ArgumentException("Value must be positive.", "value"); _maxDepth = value; _maxDepthSet = true; } } /// /// Indicates how JSON text output is formatted. /// public Formatting Formatting { get { return _formatting ?? DefaultFormatting; } set { _formatting = value; } } /// /// Get or set how dates are written to JSON text. /// public DateFormatHandling DateFormatHandling { get { return _dateFormatHandling ?? DefaultDateFormatHandling; } set { _dateFormatHandling = value; } } /// /// Get or set how time zones are handling during serialization and deserialization. /// public DateTimeZoneHandling DateTimeZoneHandling { get { return _dateTimeZoneHandling ?? DefaultDateTimeZoneHandling; } set { _dateTimeZoneHandling = value; } } /// /// Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. /// public DateParseHandling DateParseHandling { get { return _dateParseHandling ?? DefaultDateParseHandling; } set { _dateParseHandling = value; } } /// /// Gets or sets the culture used when reading JSON. Defaults to . /// public CultureInfo Culture { get { return _culture ?? DefaultCulture; } set { _culture = value; } } /// /// Gets a value indicating whether there will be a check for additional content after deserializing an object. /// /// /// true if there will be a check for additional content after deserializing an object; otherwise, false. /// public bool CheckAdditionalContent { get { return _checkAdditionalContent ?? DefaultCheckAdditionalContent; } set { _checkAdditionalContent = value; } } static JsonSerializerSettings() { DefaultContext = new StreamingContext(); DefaultCulture = CultureInfo.InvariantCulture; } /// /// Initializes a new instance of the class. /// public JsonSerializerSettings() { ReferenceLoopHandling = DefaultReferenceLoopHandling; MissingMemberHandling = DefaultMissingMemberHandling; ObjectCreationHandling = DefaultObjectCreationHandling; NullValueHandling = DefaultNullValueHandling; DefaultValueHandling = DefaultDefaultValueHandling; PreserveReferencesHandling = DefaultPreserveReferencesHandling; TypeNameHandling = DefaultTypeNameHandling; TypeNameAssemblyFormat = DefaultTypeNameAssemblyFormat; Context = DefaultContext; Converters = new List(); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConverterCollection.cs0000644000175000017500000000266212253423361030202 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Text; using System.Collections.ObjectModel; namespace Newtonsoft.Json { /// /// Represents a collection of . /// public class JsonConverterCollection : Collection { } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Dynamic.snk0000644000175000017500000000112411655552510025133 0ustar00meebeymeebey00000000000000$RSA2;}x6F,TnzV8v3̼{Zjv] 3ƍgE0"!JJI UOˠIkN򅓰ʵ}r?gОݤ`?* .D8L$de4kBz T&M:=w؞|㹎:'$Bev#c H:FQMs_GxpjMLJETAMVdnn؅'㻢a$xy|{2k\F,ڧzwo|JЩ/( %N7sj_JTkB.ջ:7mFiGb7 =QB`SO*t{/=j3F[TVzJ|HZIf3RXnڣy$`&+}AʃGФULo 0y>]b@OhG{3lįsG)ePՆC乑q`"Oh{l)J /// Instructs the to always serialize the member with the specified name. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false)] public sealed class JsonPropertyAttribute : Attribute { // yuck. can't set nullable properties on an attribute in C# // have to use this approach to get an unset default state internal NullValueHandling? _nullValueHandling; internal DefaultValueHandling? _defaultValueHandling; internal ReferenceLoopHandling? _referenceLoopHandling; internal ObjectCreationHandling? _objectCreationHandling; internal TypeNameHandling? _typeNameHandling; internal bool? _isReference; internal int? _order; internal Required? _required; internal bool? _itemIsReference; internal ReferenceLoopHandling? _itemReferenceLoopHandling; internal TypeNameHandling? _itemTypeNameHandling; /// /// Gets or sets the converter used when serializing the property's collection items. /// /// The collection's items converter. public Type ItemConverterType { get; set; } /// /// Gets or sets the null value handling used when serializing this property. /// /// The null value handling. public NullValueHandling NullValueHandling { get { return _nullValueHandling ?? default(NullValueHandling); } set { _nullValueHandling = value; } } /// /// Gets or sets the default value handling used when serializing this property. /// /// The default value handling. public DefaultValueHandling DefaultValueHandling { get { return _defaultValueHandling ?? default(DefaultValueHandling); } set { _defaultValueHandling = value; } } /// /// Gets or sets the reference loop handling used when serializing this property. /// /// The reference loop handling. public ReferenceLoopHandling ReferenceLoopHandling { get { return _referenceLoopHandling ?? default(ReferenceLoopHandling); } set { _referenceLoopHandling = value; } } /// /// Gets or sets the object creation handling used when deserializing this property. /// /// The object creation handling. public ObjectCreationHandling ObjectCreationHandling { get { return _objectCreationHandling ?? default(ObjectCreationHandling); } set { _objectCreationHandling = value; } } /// /// Gets or sets the type name handling used when serializing this property. /// /// The type name handling. public TypeNameHandling TypeNameHandling { get { return _typeNameHandling ?? default(TypeNameHandling); } set { _typeNameHandling = value; } } /// /// Gets or sets whether this property's value is serialized as a reference. /// /// Whether this property's value is serialized as a reference. public bool IsReference { get { return _isReference ?? default(bool); } set { _isReference = value; } } /// /// Gets or sets the order of serialization and deserialization of a member. /// /// The numeric order of serialization or deserialization. public int Order { get { return _order ?? default(int); } set { _order = value; } } /// /// Gets or sets a value indicating whether this property is required. /// /// /// A value indicating whether this property is required. /// public Required Required { get { return _required ?? Required.Default; } set { _required = value; } } /// /// Gets or sets the name of the property. /// /// The name of the property. public string PropertyName { get; set; } /// /// Gets or sets the the reference loop handling used when serializing the property's collection items. /// /// The collection's items reference loop handling. public ReferenceLoopHandling ItemReferenceLoopHandling { get { return _itemReferenceLoopHandling ?? default(ReferenceLoopHandling); } set { _itemReferenceLoopHandling = value; } } /// /// Gets or sets the the type name handling used when serializing the property's collection items. /// /// The collection's items type name handling. public TypeNameHandling ItemTypeNameHandling { get { return _itemTypeNameHandling ?? default(TypeNameHandling); } set { _itemTypeNameHandling = value; } } /// /// Gets or sets whether this property's collection items are serialized as a reference. /// /// Whether this property's collection items are serialized as a reference. public bool ItemIsReference { get { return _itemIsReference ?? default(bool); } set { _itemIsReference = value; } } /// /// Initializes a new instance of the class. /// public JsonPropertyAttribute() { } /// /// Initializes a new instance of the class with the specified name. /// /// Name of the property. public JsonPropertyAttribute(string propertyName) { PropertyName = propertyName; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Formatting.cs0000644000175000017500000000314412253423361025473 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json { /// /// Specifies formatting options for the . /// public enum Formatting { /// /// No special formatting is applied. This is the default. /// None, /// /// Causes child objects to be indented according to the and settings. /// Indented } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/DateParseHandling.cs0000644000175000017500000000356412253423361026704 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json { /// /// Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. /// public enum DateParseHandling { /// /// Date formatted strings are not parsed to a date type and are read as strings. /// None, /// /// Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . /// DateTime, #if !NET20 /// /// Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . /// DateTimeOffset #endif } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/0000755000175000017500000000000012253423361025162 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/KeyValuePairConverter.cs0000644000175000017500000001207012253423361031742 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Utilities; using System.Reflection; namespace Newtonsoft.Json.Converters { /// /// Converts a to and from JSON. /// public class KeyValuePairConverter : JsonConverter { private const string KeyName = "Key"; private const string ValueName = "Value"; /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { Type t = value.GetType(); PropertyInfo keyProperty = t.GetProperty(KeyName); PropertyInfo valueProperty = t.GetProperty(ValueName); DefaultContractResolver resolver = serializer.ContractResolver as DefaultContractResolver; writer.WriteStartObject(); writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(KeyName) : KeyName); serializer.Serialize(writer, ReflectionUtils.GetMemberValue(keyProperty, value)); writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(ValueName) : ValueName); serializer.Serialize(writer, ReflectionUtils.GetMemberValue(valueProperty, value)); writer.WriteEndObject(); } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { bool isNullable = ReflectionUtils.IsNullableType(objectType); if (reader.TokenType == JsonToken.Null) { if (!isNullable) throw JsonSerializationException.Create(reader, "Cannot convert null value to KeyValuePair."); return null; } Type t = (isNullable) ? Nullable.GetUnderlyingType(objectType) : objectType; IList genericArguments = t.GetGenericArguments(); Type keyType = genericArguments[0]; Type valueType = genericArguments[1]; object key = null; object value = null; reader.Read(); while (reader.TokenType == JsonToken.PropertyName) { string propertyName = reader.Value.ToString(); if (string.Equals(propertyName, KeyName, StringComparison.OrdinalIgnoreCase)) { reader.Read(); key = serializer.Deserialize(reader, keyType); } else if (string.Equals(propertyName, ValueName, StringComparison.OrdinalIgnoreCase)) { reader.Read(); value = serializer.Deserialize(reader, valueType); } else { reader.Skip(); } reader.Read(); } return ReflectionUtils.CreateInstance(t, key, value); } /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { Type t = (ReflectionUtils.IsNullableType(objectType)) ? Nullable.GetUnderlyingType(objectType) : objectType; if (t.IsValueType() && t.IsGenericType()) return (t.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)); return false; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/EntityKeyMemberConverter.cs0000644000175000017500000001201512253423361032455 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE) using System; using Newtonsoft.Json.Serialization; using System.Globalization; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Converters { internal interface IEntityKeyMember { string Key { get; set; } object Value { get; set; } } /// /// Converts an Entity Framework EntityKey to and from JSON. /// public class EntityKeyMemberConverter : JsonConverter { private const string EntityKeyMemberFullTypeName = "System.Data.EntityKeyMember"; /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { IEntityKeyMember entityKeyMember = DynamicWrapper.CreateWrapper(value); Type keyType = (entityKeyMember.Value != null) ? entityKeyMember.Value.GetType() : null; writer.WriteStartObject(); writer.WritePropertyName("Key"); writer.WriteValue(entityKeyMember.Key); writer.WritePropertyName("Type"); writer.WriteValue((keyType != null) ? keyType.FullName : null); writer.WritePropertyName("Value"); if (keyType != null) { string valueJson; if (JsonSerializerInternalWriter.TryConvertToString(entityKeyMember.Value, keyType, out valueJson)) writer.WriteValue(valueJson); else writer.WriteValue(entityKeyMember.Value); } else { writer.WriteNull(); } writer.WriteEndObject(); } private static void ReadAndAssertProperty(JsonReader reader, string propertyName) { ReadAndAssert(reader); if (reader.TokenType != JsonToken.PropertyName || reader.Value.ToString() != propertyName) throw new JsonSerializationException("Expected JSON property '{0}'.".FormatWith(CultureInfo.InvariantCulture, propertyName)); } private static void ReadAndAssert(JsonReader reader) { if (!reader.Read()) throw new JsonSerializationException("Unexpected end."); } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { IEntityKeyMember entityKeyMember = DynamicWrapper.CreateWrapper(Activator.CreateInstance(objectType)); ReadAndAssertProperty(reader, "Key"); ReadAndAssert(reader); entityKeyMember.Key = reader.Value.ToString(); ReadAndAssertProperty(reader, "Type"); ReadAndAssert(reader); string type = reader.Value.ToString(); Type t = Type.GetType(type); ReadAndAssertProperty(reader, "Value"); ReadAndAssert(reader); entityKeyMember.Value = serializer.Deserialize(reader, t); ReadAndAssert(reader); return DynamicWrapper.GetUnderlyingObject(entityKeyMember); } /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { return (objectType.AssignableToTypeName(EntityKeyMemberFullTypeName)); } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/VersionConverter.cs0000644000175000017500000000742312253423361031034 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Converters { /// /// Converts a to and from a string (e.g. "1.2.3.4"). /// public class VersionConverter : JsonConverter { /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { if (value == null) { writer.WriteNull(); } else if (value is Version) { writer.WriteValue(value.ToString()); } else { throw new JsonSerializationException("Expected Version object value"); } } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing property value of the JSON that is being converted. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType == JsonToken.Null) { return null; } else { if (reader.TokenType == JsonToken.String) { try { Version v = new Version((string) reader.Value); return v; } catch (Exception ex) { throw JsonSerializationException.Create(reader, "Error parsing version string: {0}".FormatWith(CultureInfo.InvariantCulture, reader.Value), ex); } } else { throw JsonSerializationException.Create(reader, "Unexpected token or value when parsing version. Token: {0}, Value: {1}".FormatWith(CultureInfo.InvariantCulture, reader.TokenType, reader.Value)); } } } /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { return objectType == typeof (Version); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/RegexConverter.cs0000644000175000017500000001333112253423361030454 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Text.RegularExpressions; using Newtonsoft.Json.Bson; using System.Globalization; namespace Newtonsoft.Json.Converters { /// /// Converts a to and from JSON and BSON. /// public class RegexConverter : JsonConverter { /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { Regex regex = (Regex) value; BsonWriter bsonWriter = writer as BsonWriter; if (bsonWriter != null) WriteBson(bsonWriter, regex); else WriteJson(writer, regex); } private bool HasFlag(RegexOptions options, RegexOptions flag) { return ((options & flag) == flag); } private void WriteBson(BsonWriter writer, Regex regex) { // Regular expression - The first cstring is the regex pattern, the second // is the regex options string. Options are identified by characters, which // must be stored in alphabetical order. Valid options are 'i' for case // insensitive matching, 'm' for multiline matching, 'x' for verbose mode, // 'l' to make \w, \W, etc. locale dependent, 's' for dotall mode // ('.' matches everything), and 'u' to make \w, \W, etc. match unicode. string options = null; if (HasFlag(regex.Options, RegexOptions.IgnoreCase)) options += "i"; if (HasFlag(regex.Options, RegexOptions.Multiline)) options += "m"; if (HasFlag(regex.Options, RegexOptions.Singleline)) options += "s"; options += "u"; if (HasFlag(regex.Options, RegexOptions.ExplicitCapture)) options += "x"; writer.WriteRegex(regex.ToString(), options); } private void WriteJson(JsonWriter writer, Regex regex) { writer.WriteStartObject(); writer.WritePropertyName("Pattern"); writer.WriteValue(regex.ToString()); writer.WritePropertyName("Options"); writer.WriteValue(regex.Options); writer.WriteEndObject(); } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { BsonReader bsonReader = reader as BsonReader; if (bsonReader != null) return ReadBson(bsonReader); else return ReadJson(reader); } private object ReadBson(BsonReader reader) { string regexText = (string)reader.Value; int patternOptionDelimiterIndex = regexText.LastIndexOf('/'); string patternText = regexText.Substring(1, patternOptionDelimiterIndex - 1); string optionsText = regexText.Substring(patternOptionDelimiterIndex + 1); RegexOptions options = RegexOptions.None; foreach (char c in optionsText) { switch (c) { case 'i': options |= RegexOptions.IgnoreCase; break; case 'm': options |= RegexOptions.Multiline; break; case 's': options |= RegexOptions.Singleline; break; case 'x': options |= RegexOptions.ExplicitCapture; break; } } return new Regex(patternText, options); } private Regex ReadJson(JsonReader reader) { reader.Read(); reader.Read(); string pattern = (string)reader.Value; reader.Read(); reader.Read(); int options = Convert.ToInt32(reader.Value, CultureInfo.InvariantCulture); reader.Read(); return new Regex(pattern, (RegexOptions) options); } /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { return (objectType == typeof (Regex)); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/ExpandoObjectConverter.cs0000644000175000017500000001246112253423361032132 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) using System; using System.Collections.Generic; using System.Dynamic; using System.Globalization; using System.Linq; using System.Text; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Converters { /// /// Converts an ExpandoObject to and from JSON. /// public class ExpandoObjectConverter : JsonConverter { /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { // can write is set to false } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { return ReadValue(reader); } private object ReadValue(JsonReader reader) { while (reader.TokenType == JsonToken.Comment) { if (!reader.Read()) throw JsonSerializationException.Create(reader, "Unexpected end when reading ExpandoObject."); } switch (reader.TokenType) { case JsonToken.StartObject: return ReadObject(reader); case JsonToken.StartArray: return ReadList(reader); default: if (JsonReader.IsPrimitiveToken(reader.TokenType)) return reader.Value; throw JsonSerializationException.Create(reader, "Unexpected token when converting ExpandoObject: {0}".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); } } private object ReadList(JsonReader reader) { IList list = new List(); while (reader.Read()) { switch (reader.TokenType) { case JsonToken.Comment: break; default: object v = ReadValue(reader); list.Add(v); break; case JsonToken.EndArray: return list; } } throw JsonSerializationException.Create(reader, "Unexpected end when reading ExpandoObject."); } private object ReadObject(JsonReader reader) { IDictionary expandoObject = new ExpandoObject(); while (reader.Read()) { switch (reader.TokenType) { case JsonToken.PropertyName: string propertyName = reader.Value.ToString(); if (!reader.Read()) throw JsonSerializationException.Create(reader, "Unexpected end when reading ExpandoObject."); object v = ReadValue(reader); expandoObject[propertyName] = v; break; case JsonToken.Comment: break; case JsonToken.EndObject: return expandoObject; } } throw JsonSerializationException.Create(reader, "Unexpected end when reading ExpandoObject."); } /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { return (objectType == typeof (ExpandoObject)); } /// /// Gets a value indicating whether this can write JSON. /// /// /// true if this can write JSON; otherwise, false. /// public override bool CanWrite { get { return false; } } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/StringEnumConverter.cs0000644000175000017500000001564612253423361031510 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Globalization; using System.Reflection; using System.Runtime.Serialization; using Newtonsoft.Json.Utilities; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Converters { /// /// Converts an to and from its name string value. /// public class StringEnumConverter : JsonConverter { private readonly Dictionary> _enumMemberNamesPerType = new Dictionary>(); /// /// Gets or sets a value indicating whether the written enum text should be camel case. /// /// true if the written enum text will be camel case; otherwise, false. public bool CamelCaseText { get; set; } /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { if (value == null) { writer.WriteNull(); return; } Enum e = (Enum)value; string enumName = e.ToString("G"); if (char.IsNumber(enumName[0]) || enumName[0] == '-') { writer.WriteValue(value); } else { BidirectionalDictionary map = GetEnumNameMap(e.GetType()); string resolvedEnumName; map.TryGetByFirst(enumName, out resolvedEnumName); resolvedEnumName = resolvedEnumName ?? enumName; if (CamelCaseText) { string[] names = resolvedEnumName.Split(',').Select(item => StringUtils.ToCamelCase(item.Trim())).ToArray(); resolvedEnumName = string.Join(", ", names); } writer.WriteValue(resolvedEnumName); } } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { Type t = (ReflectionUtils.IsNullableType(objectType)) ? Nullable.GetUnderlyingType(objectType) : objectType; if (reader.TokenType == JsonToken.Null) { if (!ReflectionUtils.IsNullableType(objectType)) throw JsonSerializationException.Create(reader, "Cannot convert null value to {0}.".FormatWith(CultureInfo.InvariantCulture, objectType)); return null; } if (reader.TokenType == JsonToken.String) { var map = GetEnumNameMap(t); string resolvedEnumName; map.TryGetBySecond(reader.Value.ToString(), out resolvedEnumName); resolvedEnumName = resolvedEnumName ?? reader.Value.ToString(); return Enum.Parse(t, resolvedEnumName, true); } if (reader.TokenType == JsonToken.Integer) return ConvertUtils.ConvertOrCast(reader.Value, CultureInfo.InvariantCulture, t); throw JsonSerializationException.Create(reader, "Unexpected token when parsing enum. Expected String or Integer, got {0}.".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); } /// /// A cached representation of the Enum string representation to respect per Enum field name. /// /// The type of the Enum. /// A map of enum field name to either the field name, or the configured enum member name (). private BidirectionalDictionary GetEnumNameMap(Type t) { BidirectionalDictionary map; if (!_enumMemberNamesPerType.TryGetValue(t, out map)) { lock (_enumMemberNamesPerType) { if (_enumMemberNamesPerType.TryGetValue(t, out map)) return map; map = new BidirectionalDictionary( StringComparer.OrdinalIgnoreCase, StringComparer.OrdinalIgnoreCase); foreach (FieldInfo f in t.GetFields()) { string n1 = f.Name; string n2; #if !NET20 n2 = f.GetCustomAttributes(typeof (EnumMemberAttribute), true) .Cast() .Select(a => a.Value) .SingleOrDefault() ?? f.Name; #else n2 = f.Name; #endif string s; if (map.TryGetBySecond(n2, out s)) { throw new InvalidOperationException("Enum name '{0}' already exists on enum '{1}'." .FormatWith(CultureInfo.InvariantCulture, n2, t.Name)); } map.Add(n1, n2); } _enumMemberNamesPerType[t] = map; } } return map; } /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { Type t = (ReflectionUtils.IsNullableType(objectType)) ? Nullable.GetUnderlyingType(objectType) : objectType; return t.IsEnum(); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/IsoDateTimeConverter.cs0000644000175000017500000001457012253423361031557 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Converters { /// /// Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). /// public class IsoDateTimeConverter : DateTimeConverterBase { private const string DefaultDateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"; private DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind; private string _dateTimeFormat; private CultureInfo _culture; /// /// Gets or sets the date time styles used when converting a date to and from JSON. /// /// The date time styles used when converting a date to and from JSON. public DateTimeStyles DateTimeStyles { get { return _dateTimeStyles; } set { _dateTimeStyles = value; } } /// /// Gets or sets the date time format used when converting a date to and from JSON. /// /// The date time format used when converting a date to and from JSON. public string DateTimeFormat { get { return _dateTimeFormat ?? string.Empty; } set { _dateTimeFormat = StringUtils.NullEmptyString(value); } } /// /// Gets or sets the culture used when converting a date to and from JSON. /// /// The culture used when converting a date to and from JSON. public CultureInfo Culture { get { return _culture ?? CultureInfo.CurrentCulture; } set { _culture = value; } } /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { string text; if (value is DateTime) { DateTime dateTime = (DateTime)value; if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal || (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal) dateTime = dateTime.ToUniversalTime(); text = dateTime.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture); } #if !PocketPC && !NET20 else if (value is DateTimeOffset) { DateTimeOffset dateTimeOffset = (DateTimeOffset)value; if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal || (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal) dateTimeOffset = dateTimeOffset.ToUniversalTime(); text = dateTimeOffset.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture); } #endif else { throw new JsonSerializationException("Unexpected value when converting date. Expected DateTime or DateTimeOffset, got {0}.".FormatWith(CultureInfo.InvariantCulture, ReflectionUtils.GetObjectType(value))); } writer.WriteValue(text); } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { bool nullable = ReflectionUtils.IsNullableType(objectType); Type t = (nullable) ? Nullable.GetUnderlyingType(objectType) : objectType; if (reader.TokenType == JsonToken.Null) { if (!ReflectionUtils.IsNullableType(objectType)) throw JsonSerializationException.Create(reader, "Cannot convert null value to {0}.".FormatWith(CultureInfo.InvariantCulture, objectType)); return null; } if (reader.TokenType == JsonToken.Date) { #if !PocketPC && !NET20 if (t == typeof(DateTimeOffset)) return new DateTimeOffset((DateTime)reader.Value); #endif return reader.Value; } if (reader.TokenType != JsonToken.String) throw JsonSerializationException.Create(reader, "Unexpected token parsing date. Expected String, got {0}.".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); string dateText = reader.Value.ToString(); if (string.IsNullOrEmpty(dateText) && nullable) return null; #if !PocketPC && !NET20 if (t == typeof(DateTimeOffset)) { if (!string.IsNullOrEmpty(_dateTimeFormat)) return DateTimeOffset.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles); else return DateTimeOffset.Parse(dateText, Culture, _dateTimeStyles); } #endif if (!string.IsNullOrEmpty(_dateTimeFormat)) return DateTime.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles); else return DateTime.Parse(dateText, Culture, _dateTimeStyles); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/XmlNodeConverter.cs0000644000175000017500000013467112253423361030763 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if (!(SILVERLIGHT || PORTABLE) || WINDOWS_PHONE) using System; using System.Collections.Generic; using System.Globalization; using System.Xml; #if !NET20 using System.Xml.Linq; #endif using Newtonsoft.Json.Utilities; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Converters { #region XmlNodeWrappers #if !SILVERLIGHT && !NETFX_CORE internal class XmlDocumentWrapper : XmlNodeWrapper, IXmlDocument { private readonly XmlDocument _document; public XmlDocumentWrapper(XmlDocument document) : base(document) { _document = document; } public IXmlNode CreateComment(string data) { return new XmlNodeWrapper(_document.CreateComment(data)); } public IXmlNode CreateTextNode(string text) { return new XmlNodeWrapper(_document.CreateTextNode(text)); } public IXmlNode CreateCDataSection(string data) { return new XmlNodeWrapper(_document.CreateCDataSection(data)); } public IXmlNode CreateWhitespace(string text) { return new XmlNodeWrapper(_document.CreateWhitespace(text)); } public IXmlNode CreateSignificantWhitespace(string text) { return new XmlNodeWrapper(_document.CreateSignificantWhitespace(text)); } public IXmlNode CreateXmlDeclaration(string version, string encoding, string standalone) { return new XmlNodeWrapper(_document.CreateXmlDeclaration(version, encoding, standalone)); } public IXmlNode CreateProcessingInstruction(string target, string data) { return new XmlNodeWrapper(_document.CreateProcessingInstruction(target, data)); } public IXmlElement CreateElement(string elementName) { return new XmlElementWrapper(_document.CreateElement(elementName)); } public IXmlElement CreateElement(string qualifiedName, string namespaceUri) { return new XmlElementWrapper(_document.CreateElement(qualifiedName, namespaceUri)); } public IXmlNode CreateAttribute(string name, string value) { XmlNodeWrapper attribute = new XmlNodeWrapper(_document.CreateAttribute(name)); attribute.Value = value; return attribute; } public IXmlNode CreateAttribute(string qualifiedName, string namespaceUri, string value) { XmlNodeWrapper attribute = new XmlNodeWrapper(_document.CreateAttribute(qualifiedName, namespaceUri)); attribute.Value = value; return attribute; } public IXmlElement DocumentElement { get { if (_document.DocumentElement == null) return null; return new XmlElementWrapper(_document.DocumentElement); } } } internal class XmlElementWrapper : XmlNodeWrapper, IXmlElement { private readonly XmlElement _element; public XmlElementWrapper(XmlElement element) : base(element) { _element = element; } public void SetAttributeNode(IXmlNode attribute) { XmlNodeWrapper xmlAttributeWrapper = (XmlNodeWrapper)attribute; _element.SetAttributeNode((XmlAttribute) xmlAttributeWrapper.WrappedNode); } public string GetPrefixOfNamespace(string namespaceUri) { return _element.GetPrefixOfNamespace(namespaceUri); } } internal class XmlDeclarationWrapper : XmlNodeWrapper, IXmlDeclaration { private readonly XmlDeclaration _declaration; public XmlDeclarationWrapper(XmlDeclaration declaration) : base(declaration) { _declaration = declaration; } public string Version { get { return _declaration.Version; } } public string Encoding { get { return _declaration.Encoding; } set { _declaration.Encoding = value; } } public string Standalone { get { return _declaration.Standalone; } set { _declaration.Standalone = value; } } } internal class XmlNodeWrapper : IXmlNode { private readonly XmlNode _node; public XmlNodeWrapper(XmlNode node) { _node = node; } public object WrappedNode { get { return _node; } } public XmlNodeType NodeType { get { return _node.NodeType; } } public string Name { get { return _node.Name; } } public string LocalName { get { return _node.LocalName; } } public IList ChildNodes { get { return _node.ChildNodes.Cast().Select(n => WrapNode(n)).ToList(); } } private IXmlNode WrapNode(XmlNode node) { switch (node.NodeType) { case XmlNodeType.Element: return new XmlElementWrapper((XmlElement) node); case XmlNodeType.XmlDeclaration: return new XmlDeclarationWrapper((XmlDeclaration) node); default: return new XmlNodeWrapper(node); } } public IList Attributes { get { if (_node.Attributes == null) return null; return _node.Attributes.Cast().Select(a => WrapNode(a)).ToList(); } } public IXmlNode ParentNode { get { XmlNode node = (_node is XmlAttribute) ? ((XmlAttribute) _node).OwnerElement : _node.ParentNode; if (node == null) return null; return WrapNode(node); } } public string Value { get { return _node.Value; } set { _node.Value = value; } } public IXmlNode AppendChild(IXmlNode newChild) { XmlNodeWrapper xmlNodeWrapper = (XmlNodeWrapper) newChild; _node.AppendChild(xmlNodeWrapper._node); return newChild; } public string Prefix { get { return _node.Prefix; } } public string NamespaceUri { get { return _node.NamespaceURI; } } } #endif #endregion #region Interfaces internal interface IXmlDocument : IXmlNode { IXmlNode CreateComment(string text); IXmlNode CreateTextNode(string text); IXmlNode CreateCDataSection(string data); IXmlNode CreateWhitespace(string text); IXmlNode CreateSignificantWhitespace(string text); IXmlNode CreateXmlDeclaration(string version, string encoding, string standalone); IXmlNode CreateProcessingInstruction(string target, string data); IXmlElement CreateElement(string elementName); IXmlElement CreateElement(string qualifiedName, string namespaceUri); IXmlNode CreateAttribute(string name, string value); IXmlNode CreateAttribute(string qualifiedName, string namespaceUri, string value); IXmlElement DocumentElement { get; } } internal interface IXmlDeclaration : IXmlNode { string Version { get; } string Encoding { get; set; } string Standalone { get; set; } } internal interface IXmlElement : IXmlNode { void SetAttributeNode(IXmlNode attribute); string GetPrefixOfNamespace(string namespaceUri); } internal interface IXmlNode { XmlNodeType NodeType { get; } string LocalName { get; } IList ChildNodes { get; } IList Attributes { get; } IXmlNode ParentNode { get; } string Value { get; set; } IXmlNode AppendChild(IXmlNode newChild); string NamespaceUri { get; } object WrappedNode { get; } } #endregion #region XNodeWrappers #if !NET20 internal class XDeclarationWrapper : XObjectWrapper, IXmlDeclaration { internal XDeclaration Declaration { get; private set; } public XDeclarationWrapper(XDeclaration declaration) : base(null) { Declaration = declaration; } public override XmlNodeType NodeType { get { return XmlNodeType.XmlDeclaration; } } public string Version { get { return Declaration.Version; } } public string Encoding { get { return Declaration.Encoding; } set { Declaration.Encoding = value; } } public string Standalone { get { return Declaration.Standalone; } set { Declaration.Standalone = value; } } } internal class XDocumentWrapper : XContainerWrapper, IXmlDocument { private XDocument Document { get { return (XDocument)WrappedNode; } } public XDocumentWrapper(XDocument document) : base(document) { } public override IList ChildNodes { get { IList childNodes = base.ChildNodes; if (Document.Declaration != null) childNodes.Insert(0, new XDeclarationWrapper(Document.Declaration)); return childNodes; } } public IXmlNode CreateComment(string text) { return new XObjectWrapper(new XComment(text)); } public IXmlNode CreateTextNode(string text) { return new XObjectWrapper(new XText(text)); } public IXmlNode CreateCDataSection(string data) { return new XObjectWrapper(new XCData(data)); } public IXmlNode CreateWhitespace(string text) { return new XObjectWrapper(new XText(text)); } public IXmlNode CreateSignificantWhitespace(string text) { return new XObjectWrapper(new XText(text)); } public IXmlNode CreateXmlDeclaration(string version, string encoding, string standalone) { return new XDeclarationWrapper(new XDeclaration(version, encoding, standalone)); } public IXmlNode CreateProcessingInstruction(string target, string data) { return new XProcessingInstructionWrapper(new XProcessingInstruction(target, data)); } public IXmlElement CreateElement(string elementName) { return new XElementWrapper(new XElement(elementName)); } public IXmlElement CreateElement(string qualifiedName, string namespaceUri) { string localName = MiscellaneousUtils.GetLocalName(qualifiedName); return new XElementWrapper(new XElement(XName.Get(localName, namespaceUri))); } public IXmlNode CreateAttribute(string name, string value) { return new XAttributeWrapper(new XAttribute(name, value)); } public IXmlNode CreateAttribute(string qualifiedName, string namespaceUri, string value) { string localName = MiscellaneousUtils.GetLocalName(qualifiedName); return new XAttributeWrapper(new XAttribute(XName.Get(localName, namespaceUri), value)); } public IXmlElement DocumentElement { get { if (Document.Root == null) return null; return new XElementWrapper(Document.Root); } } public override IXmlNode AppendChild(IXmlNode newChild) { XDeclarationWrapper declarationWrapper = newChild as XDeclarationWrapper; if (declarationWrapper != null) { Document.Declaration = declarationWrapper.Declaration; return declarationWrapper; } else { return base.AppendChild(newChild); } } } internal class XTextWrapper : XObjectWrapper { private XText Text { get { return (XText)WrappedNode; } } public XTextWrapper(XText text) : base(text) { } public override string Value { get { return Text.Value; } set { Text.Value = value; } } public override IXmlNode ParentNode { get { if (Text.Parent == null) return null; return XContainerWrapper.WrapNode(Text.Parent); } } } internal class XCommentWrapper : XObjectWrapper { private XComment Text { get { return (XComment)WrappedNode; } } public XCommentWrapper(XComment text) : base(text) { } public override string Value { get { return Text.Value; } set { Text.Value = value; } } public override IXmlNode ParentNode { get { if (Text.Parent == null) return null; return XContainerWrapper.WrapNode(Text.Parent); } } } internal class XProcessingInstructionWrapper : XObjectWrapper { private XProcessingInstruction ProcessingInstruction { get { return (XProcessingInstruction)WrappedNode; } } public XProcessingInstructionWrapper(XProcessingInstruction processingInstruction) : base(processingInstruction) { } public override string LocalName { get { return ProcessingInstruction.Target; } } public override string Value { get { return ProcessingInstruction.Data; } set { ProcessingInstruction.Data = value; } } } internal class XContainerWrapper : XObjectWrapper { private XContainer Container { get { return (XContainer)WrappedNode; } } public XContainerWrapper(XContainer container) : base(container) { } public override IList ChildNodes { get { return Container.Nodes().Select(n => WrapNode(n)).ToList(); } } public override IXmlNode ParentNode { get { if (Container.Parent == null) return null; return WrapNode(Container.Parent); } } internal static IXmlNode WrapNode(XObject node) { if (node is XDocument) return new XDocumentWrapper((XDocument)node); else if (node is XElement) return new XElementWrapper((XElement)node); else if (node is XContainer) return new XContainerWrapper((XContainer)node); else if (node is XProcessingInstruction) return new XProcessingInstructionWrapper((XProcessingInstruction)node); else if (node is XText) return new XTextWrapper((XText)node); else if (node is XComment) return new XCommentWrapper((XComment)node); else if (node is XAttribute) return new XAttributeWrapper((XAttribute) node); else return new XObjectWrapper(node); } public override IXmlNode AppendChild(IXmlNode newChild) { Container.Add(newChild.WrappedNode); return newChild; } } internal class XObjectWrapper : IXmlNode { private readonly XObject _xmlObject; public XObjectWrapper(XObject xmlObject) { _xmlObject = xmlObject; } public object WrappedNode { get { return _xmlObject; } } public virtual XmlNodeType NodeType { get { return _xmlObject.NodeType; } } public virtual string LocalName { get { return null; } } public virtual IList ChildNodes { get { return new List(); } } public virtual IList Attributes { get { return null; } } public virtual IXmlNode ParentNode { get { return null; } } public virtual string Value { get { return null; } set { throw new InvalidOperationException(); } } public virtual IXmlNode AppendChild(IXmlNode newChild) { throw new InvalidOperationException(); } public virtual string NamespaceUri { get { return null; } } } internal class XAttributeWrapper : XObjectWrapper { private XAttribute Attribute { get { return (XAttribute)WrappedNode; } } public XAttributeWrapper(XAttribute attribute) : base(attribute) { } public override string Value { get { return Attribute.Value; } set { Attribute.Value = value; } } public override string LocalName { get { return Attribute.Name.LocalName; } } public override string NamespaceUri { get { return Attribute.Name.NamespaceName; } } public override IXmlNode ParentNode { get { if (Attribute.Parent == null) return null; return XContainerWrapper.WrapNode(Attribute.Parent); } } } internal class XElementWrapper : XContainerWrapper, IXmlElement { private XElement Element { get { return (XElement) WrappedNode; } } public XElementWrapper(XElement element) : base(element) { } public void SetAttributeNode(IXmlNode attribute) { XObjectWrapper wrapper = (XObjectWrapper)attribute; Element.Add(wrapper.WrappedNode); } public override IList Attributes { get { return Element.Attributes().Select(a => new XAttributeWrapper(a)).Cast().ToList(); } } public override string Value { get { return Element.Value; } set { Element.Value = value; } } public override string LocalName { get { return Element.Name.LocalName; } } public override string NamespaceUri { get { return Element.Name.NamespaceName; } } public string GetPrefixOfNamespace(string namespaceUri) { return Element.GetPrefixOfNamespace(namespaceUri); } } #endif #endregion /// /// Converts XML to and from JSON. /// public class XmlNodeConverter : JsonConverter { private const string TextName = "#text"; private const string CommentName = "#comment"; private const string CDataName = "#cdata-section"; private const string WhitespaceName = "#whitespace"; private const string SignificantWhitespaceName = "#significant-whitespace"; private const string DeclarationName = "?xml"; private const string JsonNamespaceUri = "http://james.newtonking.com/projects/json"; /// /// Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. /// /// The name of the deserialize root element. public string DeserializeRootElementName { get; set; } /// /// Gets or sets a flag to indicate whether to write the Json.NET array attribute. /// This attribute helps preserve arrays when converting the written XML back to JSON. /// /// true if the array attibute is written to the XML; otherwise, false. public bool WriteArrayAttribute { get; set; } /// /// Gets or sets a value indicating whether to write the root JSON object. /// /// true if the JSON root object is omitted; otherwise, false. public bool OmitRootObject { get; set; } #region Writing /// /// Writes the JSON representation of the object. /// /// The to write to. /// The calling serializer. /// The value. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { IXmlNode node = WrapXml(value); XmlNamespaceManager manager = new XmlNamespaceManager(new NameTable()); PushParentNamespaces(node, manager); if (!OmitRootObject) writer.WriteStartObject(); SerializeNode(writer, node, manager, !OmitRootObject); if (!OmitRootObject) writer.WriteEndObject(); } private IXmlNode WrapXml(object value) { #if !NET20 if (value is XObject) return XContainerWrapper.WrapNode((XObject)value); #endif #if !(SILVERLIGHT || NETFX_CORE) if (value is XmlNode) return new XmlNodeWrapper((XmlNode)value); #endif throw new ArgumentException("Value must be an XML object.", "value"); } private void PushParentNamespaces(IXmlNode node, XmlNamespaceManager manager) { List parentElements = null; IXmlNode parent = node; while ((parent = parent.ParentNode) != null) { if (parent.NodeType == XmlNodeType.Element) { if (parentElements == null) parentElements = new List(); parentElements.Add(parent); } } if (parentElements != null) { parentElements.Reverse(); foreach (IXmlNode parentElement in parentElements) { manager.PushScope(); foreach (IXmlNode attribute in parentElement.Attributes) { if (attribute.NamespaceUri == "http://www.w3.org/2000/xmlns/" && attribute.LocalName != "xmlns") manager.AddNamespace(attribute.LocalName, attribute.Value); } } } } private string ResolveFullName(IXmlNode node, XmlNamespaceManager manager) { string prefix = (node.NamespaceUri == null || (node.LocalName == "xmlns" && node.NamespaceUri == "http://www.w3.org/2000/xmlns/")) ? null : manager.LookupPrefix(node.NamespaceUri); if (!string.IsNullOrEmpty(prefix)) return prefix + ":" + node.LocalName; else return node.LocalName; } private string GetPropertyName(IXmlNode node, XmlNamespaceManager manager) { switch (node.NodeType) { case XmlNodeType.Attribute: if (node.NamespaceUri == JsonNamespaceUri) return "$" + node.LocalName; else return "@" + ResolveFullName(node, manager); case XmlNodeType.CDATA: return CDataName; case XmlNodeType.Comment: return CommentName; case XmlNodeType.Element: return ResolveFullName(node, manager); case XmlNodeType.ProcessingInstruction: return "?" + ResolveFullName(node, manager); case XmlNodeType.XmlDeclaration: return DeclarationName; case XmlNodeType.SignificantWhitespace: return SignificantWhitespaceName; case XmlNodeType.Text: return TextName; case XmlNodeType.Whitespace: return WhitespaceName; default: throw new JsonSerializationException("Unexpected XmlNodeType when getting node name: " + node.NodeType); } } private bool IsArray(IXmlNode node) { IXmlNode jsonArrayAttribute = (node.Attributes != null) ? node.Attributes.SingleOrDefault(a => a.LocalName == "Array" && a.NamespaceUri == JsonNamespaceUri) : null; return (jsonArrayAttribute != null && XmlConvert.ToBoolean(jsonArrayAttribute.Value)); } private void SerializeGroupedNodes(JsonWriter writer, IXmlNode node, XmlNamespaceManager manager, bool writePropertyName) { // group nodes together by name Dictionary> nodesGroupedByName = new Dictionary>(); for (int i = 0; i < node.ChildNodes.Count; i++) { IXmlNode childNode = node.ChildNodes[i]; string nodeName = GetPropertyName(childNode, manager); List nodes; if (!nodesGroupedByName.TryGetValue(nodeName, out nodes)) { nodes = new List(); nodesGroupedByName.Add(nodeName, nodes); } nodes.Add(childNode); } // loop through grouped nodes. write single name instances as normal, // write multiple names together in an array foreach (KeyValuePair> nodeNameGroup in nodesGroupedByName) { List groupedNodes = nodeNameGroup.Value; bool writeArray; if (groupedNodes.Count == 1) { writeArray = IsArray(groupedNodes[0]); } else { writeArray = true; } if (!writeArray) { SerializeNode(writer, groupedNodes[0], manager, writePropertyName); } else { string elementNames = nodeNameGroup.Key; if (writePropertyName) writer.WritePropertyName(elementNames); writer.WriteStartArray(); for (int i = 0; i < groupedNodes.Count; i++) { SerializeNode(writer, groupedNodes[i], manager, false); } writer.WriteEndArray(); } } } private void SerializeNode(JsonWriter writer, IXmlNode node, XmlNamespaceManager manager, bool writePropertyName) { switch (node.NodeType) { case XmlNodeType.Document: case XmlNodeType.DocumentFragment: SerializeGroupedNodes(writer, node, manager, writePropertyName); break; case XmlNodeType.Element: if (IsArray(node) && node.ChildNodes.All(n => n.LocalName == node.LocalName) && node.ChildNodes.Count > 0) { SerializeGroupedNodes(writer, node, manager, false); } else { foreach (IXmlNode attribute in node.Attributes) { if (attribute.NamespaceUri == "http://www.w3.org/2000/xmlns/") { string prefix = (attribute.LocalName != "xmlns") ? attribute.LocalName : string.Empty; manager.AddNamespace(prefix, attribute.Value); } } if (writePropertyName) writer.WritePropertyName(GetPropertyName(node, manager)); if (!ValueAttributes(node.Attributes).Any() && node.ChildNodes.Count == 1 && node.ChildNodes[0].NodeType == XmlNodeType.Text) { // write elements with a single text child as a name value pair writer.WriteValue(node.ChildNodes[0].Value); } else if (node.ChildNodes.Count == 0 && CollectionUtils.IsNullOrEmpty(node.Attributes)) { // empty element writer.WriteNull(); } else { writer.WriteStartObject(); for (int i = 0; i < node.Attributes.Count; i++) { SerializeNode(writer, node.Attributes[i], manager, true); } SerializeGroupedNodes(writer, node, manager, true); writer.WriteEndObject(); } } break; case XmlNodeType.Comment: if (writePropertyName) writer.WriteComment(node.Value); break; case XmlNodeType.Attribute: case XmlNodeType.Text: case XmlNodeType.CDATA: case XmlNodeType.ProcessingInstruction: case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: if (node.NamespaceUri == "http://www.w3.org/2000/xmlns/" && node.Value == JsonNamespaceUri) return; if (node.NamespaceUri == JsonNamespaceUri) { if (node.LocalName == "Array") return; } if (writePropertyName) writer.WritePropertyName(GetPropertyName(node, manager)); writer.WriteValue(node.Value); break; case XmlNodeType.XmlDeclaration: IXmlDeclaration declaration = (IXmlDeclaration)node; writer.WritePropertyName(GetPropertyName(node, manager)); writer.WriteStartObject(); if (!string.IsNullOrEmpty(declaration.Version)) { writer.WritePropertyName("@version"); writer.WriteValue(declaration.Version); } if (!string.IsNullOrEmpty(declaration.Encoding)) { writer.WritePropertyName("@encoding"); writer.WriteValue(declaration.Encoding); } if (!string.IsNullOrEmpty(declaration.Standalone)) { writer.WritePropertyName("@standalone"); writer.WriteValue(declaration.Standalone); } writer.WriteEndObject(); break; default: throw new JsonSerializationException("Unexpected XmlNodeType when serializing nodes: " + node.NodeType); } } #endregion #region Reading /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { XmlNamespaceManager manager = new XmlNamespaceManager(new NameTable()); IXmlDocument document = null; IXmlNode rootNode = null; #if !NET20 if (typeof(XObject).IsAssignableFrom(objectType)) { if (objectType != typeof (XDocument) && objectType != typeof (XElement)) throw new JsonSerializationException("XmlNodeConverter only supports deserializing XDocument or XElement."); XDocument d = new XDocument(); document = new XDocumentWrapper(d); rootNode = document; } #endif #if !(SILVERLIGHT || NETFX_CORE) if (typeof(XmlNode).IsAssignableFrom(objectType)) { if (objectType != typeof (XmlDocument)) throw new JsonSerializationException("XmlNodeConverter only supports deserializing XmlDocuments"); XmlDocument d = new XmlDocument(); document = new XmlDocumentWrapper(d); rootNode = document; } #endif if (document == null || rootNode == null) throw new JsonSerializationException("Unexpected type when converting XML: " + objectType); if (reader.TokenType != JsonToken.StartObject) throw new JsonSerializationException("XmlNodeConverter can only convert JSON that begins with an object."); if (!string.IsNullOrEmpty(DeserializeRootElementName)) { //rootNode = document.CreateElement(DeserializeRootElementName); //document.AppendChild(rootNode); ReadElement(reader, document, rootNode, DeserializeRootElementName, manager); } else { reader.Read(); DeserializeNode(reader, document, manager, rootNode); } #if !NET20 if (objectType == typeof(XElement)) { XElement element = (XElement)document.DocumentElement.WrappedNode; element.Remove(); return element; } #endif return document.WrappedNode; } private void DeserializeValue(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode) { switch (propertyName) { case TextName: currentNode.AppendChild(document.CreateTextNode(reader.Value.ToString())); break; case CDataName: currentNode.AppendChild(document.CreateCDataSection(reader.Value.ToString())); break; case WhitespaceName: currentNode.AppendChild(document.CreateWhitespace(reader.Value.ToString())); break; case SignificantWhitespaceName: currentNode.AppendChild(document.CreateSignificantWhitespace(reader.Value.ToString())); break; default: // processing instructions and the xml declaration start with ? if (!string.IsNullOrEmpty(propertyName) && propertyName[0] == '?') { CreateInstruction(reader, document, currentNode, propertyName); } else { if (reader.TokenType == JsonToken.StartArray) { // handle nested arrays ReadArrayElements(reader, document, propertyName, currentNode, manager); return; } // have to wait until attributes have been parsed before creating element // attributes may contain namespace info used by the element ReadElement(reader, document, currentNode, propertyName, manager); } break; } } private void ReadElement(JsonReader reader, IXmlDocument document, IXmlNode currentNode, string propertyName, XmlNamespaceManager manager) { if (string.IsNullOrEmpty(propertyName)) throw new JsonSerializationException("XmlNodeConverter cannot convert JSON with an empty property name to XML."); Dictionary attributeNameValues = ReadAttributeElements(reader, manager); string elementPrefix = MiscellaneousUtils.GetPrefix(propertyName); if (propertyName.StartsWith("@")) { var attributeName = propertyName.Substring(1); var attributeValue = reader.Value.ToString(); var attributePrefix = MiscellaneousUtils.GetPrefix(attributeName); var attribute = (!string.IsNullOrEmpty(attributePrefix)) ? document.CreateAttribute(attributeName, manager.LookupNamespace(attributePrefix), attributeValue) : document.CreateAttribute(attributeName, attributeValue); ((IXmlElement)currentNode).SetAttributeNode(attribute); } else { IXmlElement element = CreateElement(propertyName, document, elementPrefix, manager); currentNode.AppendChild(element); // add attributes to newly created element foreach (KeyValuePair nameValue in attributeNameValues) { string attributePrefix = MiscellaneousUtils.GetPrefix(nameValue.Key); IXmlNode attribute = (!string.IsNullOrEmpty(attributePrefix)) ? document.CreateAttribute(nameValue.Key, manager.LookupNamespace(attributePrefix), nameValue.Value) : document.CreateAttribute(nameValue.Key, nameValue.Value); element.SetAttributeNode(attribute); } if (reader.TokenType == JsonToken.String || reader.TokenType == JsonToken.Integer || reader.TokenType == JsonToken.Float || reader.TokenType == JsonToken.Boolean || reader.TokenType == JsonToken.Date) { element.AppendChild(document.CreateTextNode(ConvertTokenToXmlValue(reader))); } else if (reader.TokenType == JsonToken.Null) { // empty element. do nothing } else { // finished element will have no children to deserialize if (reader.TokenType != JsonToken.EndObject) { manager.PushScope(); DeserializeNode(reader, document, manager, element); manager.PopScope(); } } } } private string ConvertTokenToXmlValue(JsonReader reader) { if (reader.TokenType == JsonToken.String) { return reader.Value.ToString(); } else if (reader.TokenType == JsonToken.Integer) { return XmlConvert.ToString(Convert.ToInt64(reader.Value, CultureInfo.InvariantCulture)); } else if (reader.TokenType == JsonToken.Float) { return XmlConvert.ToString(Convert.ToDouble(reader.Value, CultureInfo.InvariantCulture)); } else if (reader.TokenType == JsonToken.Boolean) { return XmlConvert.ToString(Convert.ToBoolean(reader.Value, CultureInfo.InvariantCulture)); } else if (reader.TokenType == JsonToken.Date) { DateTime d = Convert.ToDateTime(reader.Value, CultureInfo.InvariantCulture); #if !NETFX_CORE return XmlConvert.ToString(d, DateTimeUtils.ToSerializationMode(d.Kind)); #else return XmlConvert.ToString(d); #endif } else if (reader.TokenType == JsonToken.Null) { return null; } else { throw JsonSerializationException.Create(reader, "Cannot get an XML string value from token type '{0}'.".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); } } private void ReadArrayElements(JsonReader reader, IXmlDocument document, string propertyName, IXmlNode currentNode, XmlNamespaceManager manager) { string elementPrefix = MiscellaneousUtils.GetPrefix(propertyName); IXmlElement nestedArrayElement = CreateElement(propertyName, document, elementPrefix, manager); currentNode.AppendChild(nestedArrayElement); int count = 0; while (reader.Read() && reader.TokenType != JsonToken.EndArray) { DeserializeValue(reader, document, manager, propertyName, nestedArrayElement); count++; } if (WriteArrayAttribute) { AddJsonArrayAttribute(nestedArrayElement, document); } if (count == 1 && WriteArrayAttribute) { IXmlElement arrayElement = nestedArrayElement.ChildNodes.CastValid().Single(n => n.LocalName == propertyName); AddJsonArrayAttribute(arrayElement, document); } } private void AddJsonArrayAttribute(IXmlElement element, IXmlDocument document) { element.SetAttributeNode(document.CreateAttribute("json:Array", JsonNamespaceUri, "true")); #if !NET20 // linq to xml doesn't automatically include prefixes via the namespace manager if (element is XElementWrapper) { if (element.GetPrefixOfNamespace(JsonNamespaceUri) == null) { element.SetAttributeNode(document.CreateAttribute("xmlns:json", "http://www.w3.org/2000/xmlns/", JsonNamespaceUri)); } } #endif } private Dictionary ReadAttributeElements(JsonReader reader, XmlNamespaceManager manager) { Dictionary attributeNameValues = new Dictionary(); bool finishedAttributes = false; bool finishedElement = false; // a string token means the element only has a single text child if (reader.TokenType != JsonToken.String && reader.TokenType != JsonToken.Null && reader.TokenType != JsonToken.Boolean && reader.TokenType != JsonToken.Integer && reader.TokenType != JsonToken.Float && reader.TokenType != JsonToken.Date && reader.TokenType != JsonToken.StartConstructor) { // read properties until first non-attribute is encountered while (!finishedAttributes && !finishedElement && reader.Read()) { switch (reader.TokenType) { case JsonToken.PropertyName: string attributeName = reader.Value.ToString(); if (!string.IsNullOrEmpty(attributeName)) { char firstChar = attributeName[0]; string attributeValue; switch (firstChar) { case '@': attributeName = attributeName.Substring(1); reader.Read(); attributeValue = ConvertTokenToXmlValue(reader); attributeNameValues.Add(attributeName, attributeValue); string namespacePrefix; if (IsNamespaceAttribute(attributeName, out namespacePrefix)) { manager.AddNamespace(namespacePrefix, attributeValue); } break; case '$': attributeName = attributeName.Substring(1); reader.Read(); attributeValue = reader.Value.ToString(); // check that JsonNamespaceUri is in scope // if it isn't then add it to document and namespace manager string jsonPrefix = manager.LookupPrefix(JsonNamespaceUri); if (jsonPrefix == null) { // ensure that the prefix used is free int? i = null; while (manager.LookupNamespace("json" + i) != null) { i = i.GetValueOrDefault() + 1; } jsonPrefix = "json" + i; attributeNameValues.Add("xmlns:" + jsonPrefix, JsonNamespaceUri); manager.AddNamespace(jsonPrefix, JsonNamespaceUri); } attributeNameValues.Add(jsonPrefix + ":" + attributeName, attributeValue); break; default: finishedAttributes = true; break; } } else { finishedAttributes = true; } break; case JsonToken.EndObject: finishedElement = true; break; default: throw new JsonSerializationException("Unexpected JsonToken: " + reader.TokenType); } } } return attributeNameValues; } private void CreateInstruction(JsonReader reader, IXmlDocument document, IXmlNode currentNode, string propertyName) { if (propertyName == DeclarationName) { string version = null; string encoding = null; string standalone = null; while (reader.Read() && reader.TokenType != JsonToken.EndObject) { switch (reader.Value.ToString()) { case "@version": reader.Read(); version = reader.Value.ToString(); break; case "@encoding": reader.Read(); encoding = reader.Value.ToString(); break; case "@standalone": reader.Read(); standalone = reader.Value.ToString(); break; default: throw new JsonSerializationException("Unexpected property name encountered while deserializing XmlDeclaration: " + reader.Value); } } IXmlNode declaration = document.CreateXmlDeclaration(version, encoding, standalone); currentNode.AppendChild(declaration); } else { IXmlNode instruction = document.CreateProcessingInstruction(propertyName.Substring(1), reader.Value.ToString()); currentNode.AppendChild(instruction); } } private IXmlElement CreateElement(string elementName, IXmlDocument document, string elementPrefix, XmlNamespaceManager manager) { string ns = string.IsNullOrEmpty(elementPrefix) ? manager.DefaultNamespace : manager.LookupNamespace(elementPrefix); IXmlElement element = (!string.IsNullOrEmpty(ns)) ? document.CreateElement(elementName, ns) : document.CreateElement(elementName); return element; } private void DeserializeNode(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, IXmlNode currentNode) { do { switch (reader.TokenType) { case JsonToken.PropertyName: if (currentNode.NodeType == XmlNodeType.Document && document.DocumentElement != null) throw new JsonSerializationException("JSON root object has multiple properties. The root object must have a single property in order to create a valid XML document. Consider specifing a DeserializeRootElementName."); string propertyName = reader.Value.ToString(); reader.Read(); if (reader.TokenType == JsonToken.StartArray) { int count = 0; while (reader.Read() && reader.TokenType != JsonToken.EndArray) { DeserializeValue(reader, document, manager, propertyName, currentNode); count++; } if (count == 1 && WriteArrayAttribute) { IXmlElement arrayElement = currentNode.ChildNodes.CastValid().Single(n => n.LocalName == propertyName); AddJsonArrayAttribute(arrayElement, document); } } else { DeserializeValue(reader, document, manager, propertyName, currentNode); } break; case JsonToken.StartConstructor: string constructorName = reader.Value.ToString(); while (reader.Read() && reader.TokenType != JsonToken.EndConstructor) { DeserializeValue(reader, document, manager, constructorName, currentNode); } break; case JsonToken.Comment: currentNode.AppendChild(document.CreateComment((string)reader.Value)); break; case JsonToken.EndObject: case JsonToken.EndArray: return; default: throw new JsonSerializationException("Unexpected JsonToken when deserializing node: " + reader.TokenType); } } while (reader.TokenType == JsonToken.PropertyName || reader.Read()); // don't read if current token is a property. token was already read when parsing element attributes } /// /// Checks if the attributeName is a namespace attribute. /// /// Attribute name to test. /// The attribute name prefix if it has one, otherwise an empty string. /// True if attribute name is for a namespace attribute, otherwise false. private bool IsNamespaceAttribute(string attributeName, out string prefix) { if (attributeName.StartsWith("xmlns", StringComparison.Ordinal)) { if (attributeName.Length == 5) { prefix = string.Empty; return true; } else if (attributeName[5] == ':') { prefix = attributeName.Substring(6, attributeName.Length - 6); return true; } } prefix = null; return false; } private IEnumerable ValueAttributes(IEnumerable c) { return c.Where(a => a.NamespaceUri != JsonNamespaceUri); } #endregion /// /// Determines whether this instance can convert the specified value type. /// /// Type of the value. /// /// true if this instance can convert the specified value type; otherwise, false. /// public override bool CanConvert(Type valueType) { #if !NET20 if (typeof(XObject).IsAssignableFrom(valueType)) return true; #endif #if !(SILVERLIGHT || NETFX_CORE) if (typeof(XmlNode).IsAssignableFrom(valueType)) return true; #endif return false; } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/BinaryConverter.cs0000644000175000017500000001371712253423361030636 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) using System; using System.Data.SqlTypes; using System.Globalization; using Newtonsoft.Json.Utilities; using System.Collections.Generic; namespace Newtonsoft.Json.Converters { #if !NET20 internal interface IBinary { byte[] ToArray(); } #endif /// /// Converts a binary value to and from a base 64 string value. /// public class BinaryConverter : JsonConverter { #if !NET20 private const string BinaryTypeName = "System.Data.Linq.Binary"; #endif /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { if (value == null) { writer.WriteNull(); return; } byte[] data = GetByteArray(value); writer.WriteValue(data); } private byte[] GetByteArray(object value) { #if !(NET20) if (value.GetType().AssignableToTypeName(BinaryTypeName)) { IBinary binary = DynamicWrapper.CreateWrapper(value); return binary.ToArray(); } #endif if (value is SqlBinary) return ((SqlBinary) value).Value; throw new JsonSerializationException("Unexpected value type when writing binary: {0}".FormatWith(CultureInfo.InvariantCulture, value.GetType())); } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { Type t = (ReflectionUtils.IsNullableType(objectType)) ? Nullable.GetUnderlyingType(objectType) : objectType; if (reader.TokenType == JsonToken.Null) { if (!ReflectionUtils.IsNullable(objectType)) throw JsonSerializationException.Create(reader, "Cannot convert null value to {0}.".FormatWith(CultureInfo.InvariantCulture, objectType)); return null; } byte[] data; if (reader.TokenType == JsonToken.StartArray) { data = ReadByteArray(reader); } else if (reader.TokenType == JsonToken.String) { // current token is already at base64 string // unable to call ReadAsBytes so do it the old fashion way string encodedData = reader.Value.ToString(); data = Convert.FromBase64String(encodedData); } else { throw JsonSerializationException.Create(reader, "Unexpected token parsing binary. Expected String or StartArray, got {0}.".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); } #if !NET20 if (t.AssignableToTypeName(BinaryTypeName)) return Activator.CreateInstance(t, data); #endif if (t == typeof(SqlBinary)) return new SqlBinary(data); throw JsonSerializationException.Create(reader, "Unexpected object type when writing binary: {0}".FormatWith(CultureInfo.InvariantCulture, objectType)); } private byte[] ReadByteArray(JsonReader reader) { List byteList = new List(); while (reader.Read()) { switch (reader.TokenType) { case JsonToken.Integer: byteList.Add(Convert.ToByte(reader.Value, CultureInfo.InvariantCulture)); break; case JsonToken.EndArray: return byteList.ToArray(); case JsonToken.Comment: // skip break; default: throw JsonSerializationException.Create(reader, "Unexpected token when reading bytes: {0}".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); } } throw JsonSerializationException.Create(reader, "Unexpected end when reading bytes."); } /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { #if !NET20 if (objectType.AssignableToTypeName(BinaryTypeName)) return true; #endif if (objectType == typeof(SqlBinary) || objectType == typeof(SqlBinary?)) return true; return false; } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/DataTableConverter.cs0000644000175000017500000001171112253423361031223 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) using System; using System.Data; using Newtonsoft.Json.Serialization; namespace Newtonsoft.Json.Converters { /// /// Converts a to and from JSON. /// public class DataTableConverter : JsonConverter { /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { DataTable table = (DataTable)value; DefaultContractResolver resolver = serializer.ContractResolver as DefaultContractResolver; writer.WriteStartArray(); foreach (DataRow row in table.Rows) { writer.WriteStartObject(); foreach (DataColumn column in row.Table.Columns) { if (serializer.NullValueHandling == NullValueHandling.Ignore && (row[column] == null || row[column] == DBNull.Value)) continue; writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(column.ColumnName) : column.ColumnName); serializer.Serialize(writer, row[column]); } writer.WriteEndObject(); } writer.WriteEndArray(); } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { DataTable dt; if (reader.TokenType == JsonToken.PropertyName) { dt = new DataTable((string)reader.Value); reader.Read(); } else { dt = new DataTable(); } reader.Read(); while (reader.TokenType == JsonToken.StartObject) { DataRow dr = dt.NewRow(); reader.Read(); while (reader.TokenType == JsonToken.PropertyName) { string columnName = (string)reader.Value; reader.Read(); if (!dt.Columns.Contains(columnName)) { Type columnType = GetColumnDataType(reader.TokenType); dt.Columns.Add(new DataColumn(columnName, columnType)); } dr[columnName] = reader.Value ?? DBNull.Value; reader.Read(); } dr.EndEdit(); dt.Rows.Add(dr); reader.Read(); } return dt; } private static Type GetColumnDataType(JsonToken tokenType) { switch (tokenType) { case JsonToken.Integer: return typeof (long); case JsonToken.Float: return typeof (double); case JsonToken.String: case JsonToken.Null: case JsonToken.Undefined: return typeof (string); case JsonToken.Boolean: return typeof (bool); case JsonToken.Date: return typeof (DateTime); default: throw new ArgumentOutOfRangeException(); } } /// /// Determines whether this instance can convert the specified value type. /// /// Type of the value. /// /// true if this instance can convert the specified value type; otherwise, false. /// public override bool CanConvert(Type valueType) { return (valueType == typeof(DataTable)); } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/JavaScriptDateTimeConverter.cs0000644000175000017500000001121312253423361033062 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Converters { /// /// Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). /// public class JavaScriptDateTimeConverter : DateTimeConverterBase { /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { long ticks; if (value is DateTime) { DateTime dateTime = (DateTime)value; DateTime utcDateTime = dateTime.ToUniversalTime(); ticks = JsonConvert.ConvertDateTimeToJavaScriptTicks(utcDateTime); } #if !PocketPC && !NET20 else if (value is DateTimeOffset) { DateTimeOffset dateTimeOffset = (DateTimeOffset)value; DateTimeOffset utcDateTimeOffset = dateTimeOffset.ToUniversalTime(); ticks = JsonConvert.ConvertDateTimeToJavaScriptTicks(utcDateTimeOffset.UtcDateTime); } #endif else { throw new JsonSerializationException("Expected date object value."); } writer.WriteStartConstructor("Date"); writer.WriteValue(ticks); writer.WriteEndConstructor(); } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing property value of the JSON that is being converted. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { Type t = (ReflectionUtils.IsNullableType(objectType)) ? Nullable.GetUnderlyingType(objectType) : objectType; if (reader.TokenType == JsonToken.Null) { if (!ReflectionUtils.IsNullable(objectType)) throw JsonSerializationException.Create(reader, "Cannot convert null value to {0}.".FormatWith(CultureInfo.InvariantCulture, objectType)); return null; } if (reader.TokenType != JsonToken.StartConstructor || !string.Equals(reader.Value.ToString(), "Date", StringComparison.Ordinal)) throw JsonSerializationException.Create(reader, "Unexpected token or value when parsing date. Token: {0}, Value: {1}".FormatWith(CultureInfo.InvariantCulture, reader.TokenType, reader.Value)); reader.Read(); if (reader.TokenType != JsonToken.Integer) throw JsonSerializationException.Create(reader, "Unexpected token parsing date. Expected Integer, got {0}.".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); long ticks = (long)reader.Value; DateTime d = JsonConvert.ConvertJavaScriptTicksToDateTime(ticks); reader.Read(); if (reader.TokenType != JsonToken.EndConstructor) throw JsonSerializationException.Create(reader, "Unexpected token parsing date. Expected EndConstructor, got {0}.".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); #if !PocketPC && !NET20 if (t == typeof(DateTimeOffset)) return new DateTimeOffset(d); #endif return d; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/BsonObjectIdConverter.cs0000644000175000017500000000647112253423361031716 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using Newtonsoft.Json.Bson; using System.Globalization; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Converters { /// /// Converts a to and from JSON and BSON. /// public class BsonObjectIdConverter : JsonConverter { /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { BsonObjectId objectId = (BsonObjectId) value; BsonWriter bsonWriter = writer as BsonWriter; if (bsonWriter != null) { bsonWriter.WriteObjectId(objectId.Value); } else { writer.WriteValue(objectId.Value); } } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType != JsonToken.Bytes) throw new JsonSerializationException("Expected Bytes but got {0}.".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); byte[] value = (byte[])reader.Value; return new BsonObjectId(value); } /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { return (objectType == typeof (BsonObjectId)); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/DateTimeConverterBase.cs0000644000175000017500000000377112253423361031700 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json.Converters { /// /// Provides a base class for converting a to and from JSON. /// public abstract class DateTimeConverterBase : JsonConverter { /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { if (objectType == typeof(DateTime) || objectType == typeof(DateTime?)) return true; #if !PocketPC && !NET20 if (objectType == typeof(DateTimeOffset) || objectType == typeof(DateTimeOffset?)) return true; #endif return false; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/CustomCreationConverter.cs0000644000175000017500000000732612253423361032350 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Converters { /// /// Create a custom object /// /// The object type to convert. public abstract class CustomCreationConverter : JsonConverter { /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { throw new NotSupportedException("CustomCreationConverter should only be used while deserializing."); } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType == JsonToken.Null) return null; T value = Create(objectType); if (value == null) throw new JsonSerializationException("No object created."); serializer.Populate(reader, value); return value; } /// /// Creates an object which will then be populated by the serializer. /// /// Type of the object. /// The created object. public abstract T Create(Type objectType); /// /// Determines whether this instance can convert the specified object type. /// /// Type of the object. /// /// true if this instance can convert the specified object type; otherwise, false. /// public override bool CanConvert(Type objectType) { return typeof (T).IsAssignableFrom(objectType); } /// /// Gets a value indicating whether this can write JSON. /// /// /// true if this can write JSON; otherwise, false. /// public override bool CanWrite { get { return false; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/DataSetConverter.cs0000644000175000017500000000721212253423361030730 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) using System; using System.Data; using Newtonsoft.Json.Serialization; namespace Newtonsoft.Json.Converters { /// /// Converts a to and from JSON. /// public class DataSetConverter : JsonConverter { /// /// Writes the JSON representation of the object. /// /// The to write to. /// The value. /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { DataSet dataSet = (DataSet)value; DefaultContractResolver resolver = serializer.ContractResolver as DefaultContractResolver; DataTableConverter converter = new DataTableConverter(); writer.WriteStartObject(); foreach (DataTable table in dataSet.Tables) { writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(table.TableName) : table.TableName); converter.WriteJson(writer, table, serializer); } writer.WriteEndObject(); } /// /// Reads the JSON representation of the object. /// /// The to read from. /// Type of the object. /// The existing value of object being read. /// The calling serializer. /// The object value. public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { DataSet ds = new DataSet(); DataTableConverter converter = new DataTableConverter(); reader.Read(); while (reader.TokenType == JsonToken.PropertyName) { DataTable dt = (DataTable)converter.ReadJson(reader, typeof (DataTable), null, serializer); ds.Tables.Add(dt); reader.Read(); } return ds; } /// /// Determines whether this instance can convert the specified value type. /// /// Type of the value. /// /// true if this instance can convert the specified value type; otherwise, false. /// public override bool CanConvert(Type valueType) { return (valueType == typeof(DataSet)); } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/TypeNameHandling.cs0000644000175000017500000000377212253423361026557 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json { /// /// Specifies type name handling options for the . /// [Flags] public enum TypeNameHandling { /// /// Do not include the .NET type name when serializing types. /// None = 0, /// /// Include the .NET type name when serializing into a JSON object structure. /// Objects = 1, /// /// Include the .NET type name when serializing into a JSON array structure. /// Arrays = 2, /// /// Always include the .NET type name when serializing. /// All = Objects | Arrays, /// /// Include the .NET type name when the type of the object being serialized is not the same as its declared type. /// Auto = 4 } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonSerializer.cs0000644000175000017500000005731612253423361026336 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Runtime.Serialization.Formatters; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Utilities; using System.Runtime.Serialization; using ErrorEventArgs=Newtonsoft.Json.Serialization.ErrorEventArgs; namespace Newtonsoft.Json { /// /// Serializes and deserializes objects into and from the JSON format. /// The enables you to control how objects are encoded into JSON. /// public class JsonSerializer { #region Properties private TypeNameHandling _typeNameHandling; private FormatterAssemblyStyle _typeNameAssemblyFormat; private PreserveReferencesHandling _preserveReferencesHandling; private ReferenceLoopHandling _referenceLoopHandling; private MissingMemberHandling _missingMemberHandling; private ObjectCreationHandling _objectCreationHandling; private NullValueHandling _nullValueHandling; private DefaultValueHandling _defaultValueHandling; private ConstructorHandling _constructorHandling; private JsonConverterCollection _converters; private IContractResolver _contractResolver; private IReferenceResolver _referenceResolver; private SerializationBinder _binder; private StreamingContext _context; private Formatting? _formatting; private DateFormatHandling? _dateFormatHandling; private DateTimeZoneHandling? _dateTimeZoneHandling; private DateParseHandling? _dateParseHandling; private CultureInfo _culture; private int? _maxDepth; private bool _maxDepthSet; private bool? _checkAdditionalContent; /// /// Occurs when the errors during serialization and deserialization. /// public virtual event EventHandler Error; /// /// Gets or sets the used by the serializer when resolving references. /// public virtual IReferenceResolver ReferenceResolver { get { if (_referenceResolver == null) _referenceResolver = new DefaultReferenceResolver(); return _referenceResolver; } set { if (value == null) throw new ArgumentNullException("value", "Reference resolver cannot be null."); _referenceResolver = value; } } /// /// Gets or sets the used by the serializer when resolving type names. /// public virtual SerializationBinder Binder { get { return _binder; } set { if (value == null) throw new ArgumentNullException("value", "Serialization binder cannot be null."); _binder = value; } } /// /// Gets or sets how type name writing and reading is handled by the serializer. /// public virtual TypeNameHandling TypeNameHandling { get { return _typeNameHandling; } set { if (value < TypeNameHandling.None || value > TypeNameHandling.Auto) throw new ArgumentOutOfRangeException("value"); _typeNameHandling = value; } } /// /// Gets or sets how a type name assembly is written and resolved by the serializer. /// /// The type name assembly format. public virtual FormatterAssemblyStyle TypeNameAssemblyFormat { get { return _typeNameAssemblyFormat; } set { if (value < FormatterAssemblyStyle.Simple || value > FormatterAssemblyStyle.Full) throw new ArgumentOutOfRangeException("value"); _typeNameAssemblyFormat = value; } } /// /// Gets or sets how object references are preserved by the serializer. /// public virtual PreserveReferencesHandling PreserveReferencesHandling { get { return _preserveReferencesHandling; } set { if (value < PreserveReferencesHandling.None || value > PreserveReferencesHandling.All) throw new ArgumentOutOfRangeException("value"); _preserveReferencesHandling = value; } } /// /// Get or set how reference loops (e.g. a class referencing itself) is handled. /// public virtual ReferenceLoopHandling ReferenceLoopHandling { get { return _referenceLoopHandling; } set { if (value < ReferenceLoopHandling.Error || value > ReferenceLoopHandling.Serialize) throw new ArgumentOutOfRangeException("value"); _referenceLoopHandling = value; } } /// /// Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. /// public virtual MissingMemberHandling MissingMemberHandling { get { return _missingMemberHandling; } set { if (value < MissingMemberHandling.Ignore || value > MissingMemberHandling.Error) throw new ArgumentOutOfRangeException("value"); _missingMemberHandling = value; } } /// /// Get or set how null values are handled during serialization and deserialization. /// public virtual NullValueHandling NullValueHandling { get { return _nullValueHandling; } set { if (value < NullValueHandling.Include || value > NullValueHandling.Ignore) throw new ArgumentOutOfRangeException("value"); _nullValueHandling = value; } } /// /// Get or set how null default are handled during serialization and deserialization. /// public virtual DefaultValueHandling DefaultValueHandling { get { return _defaultValueHandling; } set { if (value < DefaultValueHandling.Include || value > DefaultValueHandling.IgnoreAndPopulate) throw new ArgumentOutOfRangeException("value"); _defaultValueHandling = value; } } /// /// Gets or sets how objects are created during deserialization. /// /// The object creation handling. public virtual ObjectCreationHandling ObjectCreationHandling { get { return _objectCreationHandling; } set { if (value < ObjectCreationHandling.Auto || value > ObjectCreationHandling.Replace) throw new ArgumentOutOfRangeException("value"); _objectCreationHandling = value; } } /// /// Gets or sets how constructors are used during deserialization. /// /// The constructor handling. public virtual ConstructorHandling ConstructorHandling { get { return _constructorHandling; } set { if (value < ConstructorHandling.Default || value > ConstructorHandling.AllowNonPublicDefaultConstructor) throw new ArgumentOutOfRangeException("value"); _constructorHandling = value; } } /// /// Gets a collection that will be used during serialization. /// /// Collection that will be used during serialization. public virtual JsonConverterCollection Converters { get { if (_converters == null) _converters = new JsonConverterCollection(); return _converters; } } /// /// Gets or sets the contract resolver used by the serializer when /// serializing .NET objects to JSON and vice versa. /// public virtual IContractResolver ContractResolver { get { if (_contractResolver == null) _contractResolver = DefaultContractResolver.Instance; return _contractResolver; } set { _contractResolver = value; } } /// /// Gets or sets the used by the serializer when invoking serialization callback methods. /// /// The context. public virtual StreamingContext Context { get { return _context; } set { _context = value; } } /// /// Indicates how JSON text output is formatted. /// public virtual Formatting Formatting { get { return _formatting ?? JsonSerializerSettings.DefaultFormatting; } set { _formatting = value; } } /// /// Get or set how dates are written to JSON text. /// public virtual DateFormatHandling DateFormatHandling { get { return _dateFormatHandling ?? JsonSerializerSettings.DefaultDateFormatHandling; } set { _dateFormatHandling = value; } } /// /// Get or set how time zones are handling during serialization and deserialization. /// public virtual DateTimeZoneHandling DateTimeZoneHandling { get { return _dateTimeZoneHandling ?? JsonSerializerSettings.DefaultDateTimeZoneHandling; } set { _dateTimeZoneHandling = value; } } /// /// Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. /// public virtual DateParseHandling DateParseHandling { get { return _dateParseHandling ?? JsonSerializerSettings.DefaultDateParseHandling; } set { _dateParseHandling = value; } } /// /// Gets or sets the culture used when reading JSON. Defaults to . /// public virtual CultureInfo Culture { get { return _culture ?? JsonSerializerSettings.DefaultCulture; } set { _culture = value; } } /// /// Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . /// public virtual int? MaxDepth { get { return _maxDepth; } set { if (value <= 0) throw new ArgumentException("Value must be positive.", "value"); _maxDepth = value; _maxDepthSet = true; } } /// /// Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. /// /// /// true if there will be a check for additional JSON content after deserializing an object; otherwise, false. /// public virtual bool CheckAdditionalContent { get { return _checkAdditionalContent ?? JsonSerializerSettings.DefaultCheckAdditionalContent; } set { _checkAdditionalContent = value; } } internal bool IsCheckAdditionalContentSet() { return (_checkAdditionalContent != null); } #endregion /// /// Initializes a new instance of the class. /// public JsonSerializer() { _referenceLoopHandling = JsonSerializerSettings.DefaultReferenceLoopHandling; _missingMemberHandling = JsonSerializerSettings.DefaultMissingMemberHandling; _nullValueHandling = JsonSerializerSettings.DefaultNullValueHandling; _defaultValueHandling = JsonSerializerSettings.DefaultDefaultValueHandling; _objectCreationHandling = JsonSerializerSettings.DefaultObjectCreationHandling; _preserveReferencesHandling = JsonSerializerSettings.DefaultPreserveReferencesHandling; _constructorHandling = JsonSerializerSettings.DefaultConstructorHandling; _typeNameHandling = JsonSerializerSettings.DefaultTypeNameHandling; _context = JsonSerializerSettings.DefaultContext; _binder = DefaultSerializationBinder.Instance; } /// /// Creates a new instance using the specified . /// /// The settings to be applied to the . /// A new instance using the specified . public static JsonSerializer Create(JsonSerializerSettings settings) { JsonSerializer jsonSerializer = new JsonSerializer(); if (settings != null) { if (!CollectionUtils.IsNullOrEmpty(settings.Converters)) jsonSerializer.Converters.AddRange(settings.Converters); // serializer specific jsonSerializer.TypeNameHandling = settings.TypeNameHandling; jsonSerializer.TypeNameAssemblyFormat = settings.TypeNameAssemblyFormat; jsonSerializer.PreserveReferencesHandling = settings.PreserveReferencesHandling; jsonSerializer.ReferenceLoopHandling = settings.ReferenceLoopHandling; jsonSerializer.MissingMemberHandling = settings.MissingMemberHandling; jsonSerializer.ObjectCreationHandling = settings.ObjectCreationHandling; jsonSerializer.NullValueHandling = settings.NullValueHandling; jsonSerializer.DefaultValueHandling = settings.DefaultValueHandling; jsonSerializer.ConstructorHandling = settings.ConstructorHandling; jsonSerializer.Context = settings.Context; jsonSerializer._checkAdditionalContent = settings._checkAdditionalContent; // reader/writer specific // unset values won't override reader/writer set values jsonSerializer._formatting = settings._formatting; jsonSerializer._dateFormatHandling = settings._dateFormatHandling; jsonSerializer._dateTimeZoneHandling = settings._dateTimeZoneHandling; jsonSerializer._dateParseHandling = settings._dateParseHandling; jsonSerializer._culture = settings._culture; jsonSerializer._maxDepth = settings._maxDepth; jsonSerializer._maxDepthSet = settings._maxDepthSet; if (settings.Error != null) jsonSerializer.Error += settings.Error; if (settings.ContractResolver != null) jsonSerializer.ContractResolver = settings.ContractResolver; if (settings.ReferenceResolver != null) jsonSerializer.ReferenceResolver = settings.ReferenceResolver; if (settings.Binder != null) jsonSerializer.Binder = settings.Binder; } return jsonSerializer; } /// /// Populates the JSON values onto the target object. /// /// The that contains the JSON structure to reader values from. /// The target object to populate values onto. public void Populate(TextReader reader, object target) { Populate(new JsonTextReader(reader), target); } /// /// Populates the JSON values onto the target object. /// /// The that contains the JSON structure to reader values from. /// The target object to populate values onto. public void Populate(JsonReader reader, object target) { PopulateInternal(reader, target); } internal virtual void PopulateInternal(JsonReader reader, object target) { ValidationUtils.ArgumentNotNull(reader, "reader"); ValidationUtils.ArgumentNotNull(target, "target"); JsonSerializerInternalReader serializerReader = new JsonSerializerInternalReader(this); serializerReader.Populate(reader, target); } /// /// Deserializes the Json structure contained by the specified . /// /// The that contains the JSON structure to deserialize. /// The being deserialized. public object Deserialize(JsonReader reader) { return Deserialize(reader, null); } /// /// Deserializes the Json structure contained by the specified /// into an instance of the specified type. /// /// The containing the object. /// The of object being deserialized. /// The instance of being deserialized. public object Deserialize(TextReader reader, Type objectType) { return Deserialize(new JsonTextReader(reader), objectType); } /// /// Deserializes the Json structure contained by the specified /// into an instance of the specified type. /// /// The containing the object. /// The type of the object to deserialize. /// The instance of being deserialized. public T Deserialize(JsonReader reader) { return (T)Deserialize(reader, typeof(T)); } /// /// Deserializes the Json structure contained by the specified /// into an instance of the specified type. /// /// The containing the object. /// The of object being deserialized. /// The instance of being deserialized. public object Deserialize(JsonReader reader, Type objectType) { return DeserializeInternal(reader, objectType); } internal virtual object DeserializeInternal(JsonReader reader, Type objectType) { ValidationUtils.ArgumentNotNull(reader, "reader"); // set serialization options onto reader CultureInfo previousCulture = null; if (_culture != null && reader.Culture != _culture) { previousCulture = reader.Culture; reader.Culture = _culture; } DateTimeZoneHandling? previousDateTimeZoneHandling = null; if (_dateTimeZoneHandling != null && reader.DateTimeZoneHandling != _dateTimeZoneHandling) { previousDateTimeZoneHandling = reader.DateTimeZoneHandling; reader.DateTimeZoneHandling = _dateTimeZoneHandling.Value; } DateParseHandling? previousDateParseHandling = null; if (_dateParseHandling != null && reader.DateTimeZoneHandling != _dateTimeZoneHandling) { previousDateParseHandling = reader.DateParseHandling; reader.DateParseHandling = _dateParseHandling.Value; } int? previousMaxDepth = null; if (_maxDepthSet && reader.MaxDepth != _maxDepth) { previousMaxDepth = reader.MaxDepth; reader.MaxDepth = _maxDepth; } JsonSerializerInternalReader serializerReader = new JsonSerializerInternalReader(this); object value = serializerReader.Deserialize(reader, objectType, CheckAdditionalContent); // reset reader back to previous options if (previousCulture != null) reader.Culture = previousCulture; if (previousDateTimeZoneHandling != null) reader.DateTimeZoneHandling = previousDateTimeZoneHandling.Value; if (previousDateParseHandling != null) reader.DateParseHandling = previousDateParseHandling.Value; if (_maxDepthSet) reader.MaxDepth = previousMaxDepth; return value; } /// /// Serializes the specified and writes the Json structure /// to a Stream using the specified . /// /// The used to write the Json structure. /// The to serialize. public void Serialize(TextWriter textWriter, object value) { Serialize(new JsonTextWriter(textWriter), value); } /// /// Serializes the specified and writes the Json structure /// to a Stream using the specified . /// /// The used to write the Json structure. /// The to serialize. public void Serialize(JsonWriter jsonWriter, object value) { SerializeInternal(jsonWriter, value); } internal virtual void SerializeInternal(JsonWriter jsonWriter, object value) { ValidationUtils.ArgumentNotNull(jsonWriter, "jsonWriter"); // set serialization options onto writer Formatting? previousFormatting = null; if (_formatting != null && jsonWriter.Formatting != _formatting) { previousFormatting = jsonWriter.Formatting; jsonWriter.Formatting = _formatting.Value; } DateFormatHandling? previousDateFormatHandling = null; if (_dateFormatHandling != null && jsonWriter.DateFormatHandling != _dateFormatHandling) { previousDateFormatHandling = jsonWriter.DateFormatHandling; jsonWriter.DateFormatHandling = _dateFormatHandling.Value; } DateTimeZoneHandling? previousDateTimeZoneHandling = null; if (_dateTimeZoneHandling != null && jsonWriter.DateTimeZoneHandling != _dateTimeZoneHandling) { previousDateTimeZoneHandling = jsonWriter.DateTimeZoneHandling; jsonWriter.DateTimeZoneHandling = _dateTimeZoneHandling.Value; } JsonSerializerInternalWriter serializerWriter = new JsonSerializerInternalWriter(this); serializerWriter.Serialize(jsonWriter, value); // reset writer back to previous options if (previousFormatting != null) jsonWriter.Formatting = previousFormatting.Value; if (previousDateFormatHandling != null) jsonWriter.DateFormatHandling = previousDateFormatHandling.Value; if (previousDateTimeZoneHandling != null) jsonWriter.DateTimeZoneHandling = previousDateTimeZoneHandling.Value; } internal JsonConverter GetMatchingConverter(Type type) { return GetMatchingConverter(_converters, type); } internal static JsonConverter GetMatchingConverter(IList converters, Type objectType) { #if DEBUG ValidationUtils.ArgumentNotNull(objectType, "objectType"); #endif if (converters != null) { for (int i = 0; i < converters.Count; i++) { JsonConverter converter = converters[i]; if (converter.CanConvert(objectType)) return converter; } } return null; } internal void OnError(ErrorEventArgs e) { EventHandler error = Error; if (error != null) error(this, e); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonException.cs0000644000175000017500000001037412253423361026154 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Globalization; using System.Runtime.Serialization; using System.Text; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json { /// /// The exception thrown when an error occurs during Json serialization or deserialization. /// #if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE) [Serializable] #endif public class JsonException : Exception { /// /// Initializes a new instance of the class. /// public JsonException() { } /// /// Initializes a new instance of the class /// with a specified error message. /// /// The error message that explains the reason for the exception. public JsonException(string message) : base(message) { } /// /// Initializes a new instance of the class /// with a specified error message and a reference to the inner exception that is the cause of this exception. /// /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. public JsonException(string message, Exception innerException) : base(message, innerException) { } #if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE) /// /// Initializes a new instance of the class. /// /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. /// The parameter is null. /// The class name is null or is zero (0). public JsonException(SerializationInfo info, StreamingContext context) : base(info, context) { } #endif internal static string FormatExceptionMessage(IJsonLineInfo lineInfo, string path, string message) { // don't add a fullstop and space when message ends with a new line if (!message.EndsWith(Environment.NewLine)) { message = message.Trim(); if (!message.EndsWith(".")) message += "."; message += " "; } message += "Path '{0}'".FormatWith(CultureInfo.InvariantCulture, path); if (lineInfo != null && lineInfo.HasLineInfo()) message += ", line {0}, position {1}".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition); message += "."; return message; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonToken.cs0000644000175000017500000000536412253423361025301 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Text; namespace Newtonsoft.Json { /// /// Specifies the type of Json token. /// public enum JsonToken { /// /// This is returned by the if a method has not been called. /// None, /// /// An object start token. /// StartObject, /// /// An array start token. /// StartArray, /// /// A constructor start token. /// StartConstructor, /// /// An object property name. /// PropertyName, /// /// A comment. /// Comment, /// /// Raw JSON. /// Raw, /// /// An integer. /// Integer, /// /// A float. /// Float, /// /// A string. /// String, /// /// A boolean. /// Boolean, /// /// A null token. /// Null, /// /// An undefined token. /// Undefined, /// /// An object end token. /// EndObject, /// /// An array end token. /// EndArray, /// /// A constructor end token. /// EndConstructor, /// /// A Date. /// Date, /// /// Byte data. /// Bytes } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/ConstructorHandling.cs0000644000175000017500000000336412253423361027357 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json { /// /// Specifies how constructors are used when initializing objects during deserialization by the . /// public enum ConstructorHandling { /// /// First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. /// Default = 0, /// /// Json.NET will use a non-public default constructor before falling back to a paramatized constructor. /// AllowNonPublicDefaultConstructor = 1 } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/0000755000175000017500000000000012253423361023733 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JArray.cs0000644000175000017500000003055712253423361025464 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using Newtonsoft.Json.Utilities; using System.IO; using System.Globalization; namespace Newtonsoft.Json.Linq { /// /// Represents a JSON array. /// /// /// /// public class JArray : JContainer, IList { private readonly IList _values = new List(); /// /// Gets the container's children tokens. /// /// The container's children tokens. protected override IList ChildrenTokens { get { return _values; } } /// /// Gets the node type for this . /// /// The type. public override JTokenType Type { get { return JTokenType.Array; } } /// /// Initializes a new instance of the class. /// public JArray() { } /// /// Initializes a new instance of the class from another object. /// /// A object to copy from. public JArray(JArray other) : base(other) { } /// /// Initializes a new instance of the class with the specified content. /// /// The contents of the array. public JArray(params object[] content) : this((object)content) { } /// /// Initializes a new instance of the class with the specified content. /// /// The contents of the array. public JArray(object content) { Add(content); } internal override bool DeepEquals(JToken node) { JArray t = node as JArray; return (t != null && ContentsEqual(t)); } internal override JToken CloneToken() { return new JArray(this); } /// /// Loads an from a . /// /// A that will be read for the content of the . /// A that contains the JSON that was read from the specified . public static new JArray Load(JsonReader reader) { if (reader.TokenType == JsonToken.None) { if (!reader.Read()) throw JsonReaderException.Create(reader, "Error reading JArray from JsonReader."); } while (reader.TokenType == JsonToken.Comment) { reader.Read(); } if (reader.TokenType != JsonToken.StartArray) throw JsonReaderException.Create(reader, "Error reading JArray from JsonReader. Current JsonReader item is not an array: {0}".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); JArray a = new JArray(); a.SetLineInfo(reader as IJsonLineInfo); a.ReadTokenFrom(reader); return a; } /// /// Load a from a string that contains JSON. /// /// A that contains JSON. /// A populated from the string that contains JSON. /// /// /// public static new JArray Parse(string json) { JsonReader reader = new JsonTextReader(new StringReader(json)); JArray a = Load(reader); if (reader.Read() && reader.TokenType != JsonToken.Comment) throw JsonReaderException.Create(reader, "Additional text found in JSON string after parsing content."); return a; } /// /// Creates a from an object. /// /// The object that will be used to create . /// A with the values of the specified object public static new JArray FromObject(object o) { return FromObject(o, new JsonSerializer()); } /// /// Creates a from an object. /// /// The object that will be used to create . /// The that will be used to read the object. /// A with the values of the specified object public static new JArray FromObject(object o, JsonSerializer jsonSerializer) { JToken token = FromObjectInternal(o, jsonSerializer); if (token.Type != JTokenType.Array) throw new ArgumentException("Object serialized to {0}. JArray instance expected.".FormatWith(CultureInfo.InvariantCulture, token.Type)); return (JArray)token; } /// /// Writes this token to a . /// /// A into which this method will write. /// A collection of which will be used when writing the token. public override void WriteTo(JsonWriter writer, params JsonConverter[] converters) { writer.WriteStartArray(); foreach (JToken token in ChildrenTokens) { token.WriteTo(writer, converters); } writer.WriteEndArray(); } /// /// Gets the with the specified key. /// /// The with the specified key. public override JToken this[object key] { get { ValidationUtils.ArgumentNotNull(key, "o"); if (!(key is int)) throw new ArgumentException("Accessed JArray values with invalid key value: {0}. Array position index expected.".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.ToString(key))); return GetItem((int)key); } set { ValidationUtils.ArgumentNotNull(key, "o"); if (!(key is int)) throw new ArgumentException("Set JArray values with invalid key value: {0}. Array position index expected.".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.ToString(key))); SetItem((int)key, value); } } /// /// Gets or sets the at the specified index. /// /// public JToken this[int index] { get { return GetItem(index); } set { SetItem(index, value); } } #region IList Members /// /// Determines the index of a specific item in the . /// /// The object to locate in the . /// /// The index of if found in the list; otherwise, -1. /// public int IndexOf(JToken item) { return IndexOfItem(item); } /// /// Inserts an item to the at the specified index. /// /// The zero-based index at which should be inserted. /// The object to insert into the . /// /// is not a valid index in the . /// The is read-only. public void Insert(int index, JToken item) { InsertItem(index, item, false); } /// /// Removes the item at the specified index. /// /// The zero-based index of the item to remove. /// /// is not a valid index in the . /// The is read-only. public void RemoveAt(int index) { RemoveItemAt(index); } #endregion #region ICollection Members /// /// Adds an item to the . /// /// The object to add to the . /// The is read-only. public void Add(JToken item) { Add((object)item); } /// /// Removes all items from the . /// /// The is read-only. public void Clear() { ClearItems(); } /// /// Determines whether the contains a specific value. /// /// The object to locate in the . /// /// true if is found in the ; otherwise, false. /// public bool Contains(JToken item) { return ContainsItem(item); } void ICollection.CopyTo(JToken[] array, int arrayIndex) { CopyItemsTo(array, arrayIndex); } bool ICollection.IsReadOnly { get { return false; } } /// /// Removes the first occurrence of a specific object from the . /// /// The object to remove from the . /// /// true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . /// /// The is read-only. public bool Remove(JToken item) { return RemoveItem(item); } #endregion internal override int GetDeepHashCode() { return ContentsHashCode(); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/IJEnumerable.cs0000644000175000017500000000325612253423361026572 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections.Generic; namespace Newtonsoft.Json.Linq { /// /// Represents a collection of objects. /// /// The type of token public interface IJEnumerable< #if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) out #endif T> : IEnumerable where T : JToken { /// /// Gets the with the specified key. /// /// IJEnumerable this[object key] { get; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JPath.cs0000644000175000017500000001435712253423361025302 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Globalization; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Linq { internal class JPath { private readonly string _expression; public List Parts { get; private set; } private int _currentIndex; public JPath(string expression) { ValidationUtils.ArgumentNotNull(expression, "expression"); _expression = expression; Parts = new List(); ParseMain(); } private void ParseMain() { int currentPartStartIndex = _currentIndex; bool followingIndexer = false; while (_currentIndex < _expression.Length) { char currentChar = _expression[_currentIndex]; switch (currentChar) { case '[': case '(': if (_currentIndex > currentPartStartIndex) { string member = _expression.Substring(currentPartStartIndex, _currentIndex - currentPartStartIndex); Parts.Add(member); } ParseIndexer(currentChar); currentPartStartIndex = _currentIndex + 1; followingIndexer = true; break; case ']': case ')': throw new JsonException("Unexpected character while parsing path: " + currentChar); case '.': if (_currentIndex > currentPartStartIndex) { string member = _expression.Substring(currentPartStartIndex, _currentIndex - currentPartStartIndex); Parts.Add(member); } currentPartStartIndex = _currentIndex + 1; followingIndexer = false; break; default: if (followingIndexer) throw new JsonException("Unexpected character following indexer: " + currentChar); break; } _currentIndex++; } if (_currentIndex > currentPartStartIndex) { string member = _expression.Substring(currentPartStartIndex, _currentIndex - currentPartStartIndex); Parts.Add(member); } } private void ParseIndexer(char indexerOpenChar) { _currentIndex++; char indexerCloseChar = (indexerOpenChar == '[') ? ']' : ')'; int indexerStart = _currentIndex; int indexerLength = 0; bool indexerClosed = false; while (_currentIndex < _expression.Length) { char currentCharacter = _expression[_currentIndex]; if (char.IsDigit(currentCharacter)) { indexerLength++; } else if (currentCharacter == indexerCloseChar) { indexerClosed = true; break; } else { throw new JsonException("Unexpected character while parsing path indexer: " + currentCharacter); } _currentIndex++; } if (!indexerClosed) throw new JsonException("Path ended with open indexer. Expected " + indexerCloseChar); if (indexerLength == 0) throw new JsonException("Empty path indexer."); string indexer = _expression.Substring(indexerStart, indexerLength); Parts.Add(Convert.ToInt32(indexer, CultureInfo.InvariantCulture)); } internal JToken Evaluate(JToken root, bool errorWhenNoMatch) { JToken current = root; foreach (object part in Parts) { string propertyName = part as string; if (propertyName != null) { JObject o = current as JObject; if (o != null) { current = o[propertyName]; if (current == null && errorWhenNoMatch) throw new JsonException("Property '{0}' does not exist on JObject.".FormatWith(CultureInfo.InvariantCulture, propertyName)); } else { if (errorWhenNoMatch) throw new JsonException("Property '{0}' not valid on {1}.".FormatWith(CultureInfo.InvariantCulture, propertyName, current.GetType().Name)); return null; } } else { int index = (int) part; JArray a = current as JArray; JConstructor c = current as JConstructor; if (a != null) { if (a.Count <= index) { if (errorWhenNoMatch) throw new IndexOutOfRangeException("Index {0} outside the bounds of JArray.".FormatWith(CultureInfo.InvariantCulture, index)); return null; } current = a[index]; } else if (c != null) { if (c.Count <= index) { if (errorWhenNoMatch) throw new IndexOutOfRangeException("Index {0} outside the bounds of JConstructor.".FormatWith(CultureInfo.InvariantCulture, index)); return null; } current = c[index]; } else { if (errorWhenNoMatch) throw new JsonException("Index {0} not valid on {1}.".FormatWith(CultureInfo.InvariantCulture, index, current.GetType().Name)); return null; } } } return current; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JValue.cs0000644000175000017500000006403512253423361025460 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using Newtonsoft.Json.Utilities; using System.Globalization; #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) using System.Dynamic; using System.Linq.Expressions; #endif namespace Newtonsoft.Json.Linq { /// /// Represents a value in JSON (string, integer, date, etc). /// public class JValue : JToken, IEquatable, IFormattable, IComparable, IComparable { private JTokenType _valueType; private object _value; internal JValue(object value, JTokenType type) { _value = value; _valueType = type; } /// /// Initializes a new instance of the class from another object. /// /// A object to copy from. public JValue(JValue other) : this(other.Value, other.Type) { } /// /// Initializes a new instance of the class with the given value. /// /// The value. public JValue(long value) : this(value, JTokenType.Integer) { } /// /// Initializes a new instance of the class with the given value. /// /// The value. [CLSCompliant(false)] public JValue(ulong value) : this(value, JTokenType.Integer) { } /// /// Initializes a new instance of the class with the given value. /// /// The value. public JValue(double value) : this(value, JTokenType.Float) { } /// /// Initializes a new instance of the class with the given value. /// /// The value. public JValue(float value) : this(value, JTokenType.Float) { } /// /// Initializes a new instance of the class with the given value. /// /// The value. public JValue(DateTime value) : this(value, JTokenType.Date) { } /// /// Initializes a new instance of the class with the given value. /// /// The value. public JValue(bool value) : this(value, JTokenType.Boolean) { } /// /// Initializes a new instance of the class with the given value. /// /// The value. public JValue(string value) : this(value, JTokenType.String) { } /// /// Initializes a new instance of the class with the given value. /// /// The value. public JValue(Guid value) : this(value, JTokenType.String) { } /// /// Initializes a new instance of the class with the given value. /// /// The value. public JValue(Uri value) : this(value, JTokenType.String) { } /// /// Initializes a new instance of the class with the given value. /// /// The value. public JValue(TimeSpan value) : this(value, JTokenType.String) { } /// /// Initializes a new instance of the class with the given value. /// /// The value. public JValue(object value) : this(value, GetValueType(null, value)) { } internal override bool DeepEquals(JToken node) { JValue other = node as JValue; if (other == null) return false; if (other == this) return true; return ValuesEquals(this, other); } /// /// Gets a value indicating whether this token has childen tokens. /// /// /// true if this token has child values; otherwise, false. /// public override bool HasValues { get { return false; } } private static int Compare(JTokenType valueType, object objA, object objB) { if (objA == null && objB == null) return 0; if (objA != null && objB == null) return 1; if (objA == null && objB != null) return -1; switch (valueType) { case JTokenType.Integer: if (objA is ulong || objB is ulong || objA is decimal || objB is decimal) return Convert.ToDecimal(objA, CultureInfo.InvariantCulture).CompareTo(Convert.ToDecimal(objB, CultureInfo.InvariantCulture)); else if (objA is float || objB is float || objA is double || objB is double) return CompareFloat(objA, objB); else return Convert.ToInt64(objA, CultureInfo.InvariantCulture).CompareTo(Convert.ToInt64(objB, CultureInfo.InvariantCulture)); case JTokenType.Float: return CompareFloat(objA, objB); case JTokenType.Comment: case JTokenType.String: case JTokenType.Raw: string s1 = Convert.ToString(objA, CultureInfo.InvariantCulture); string s2 = Convert.ToString(objB, CultureInfo.InvariantCulture); return string.CompareOrdinal(s1, s2); case JTokenType.Boolean: bool b1 = Convert.ToBoolean(objA, CultureInfo.InvariantCulture); bool b2 = Convert.ToBoolean(objB, CultureInfo.InvariantCulture); return b1.CompareTo(b2); case JTokenType.Date: #if !NET20 if (objA is DateTime) { #endif DateTime date1 = Convert.ToDateTime(objA, CultureInfo.InvariantCulture); DateTime date2 = Convert.ToDateTime(objB, CultureInfo.InvariantCulture); return date1.CompareTo(date2); #if !NET20 } else { if (!(objB is DateTimeOffset)) throw new ArgumentException("Object must be of type DateTimeOffset."); DateTimeOffset date1 = (DateTimeOffset) objA; DateTimeOffset date2 = (DateTimeOffset) objB; return date1.CompareTo(date2); } #endif case JTokenType.Bytes: if (!(objB is byte[])) throw new ArgumentException("Object must be of type byte[]."); byte[] bytes1 = objA as byte[]; byte[] bytes2 = objB as byte[]; if (bytes1 == null) return -1; if (bytes2 == null) return 1; return MiscellaneousUtils.ByteArrayCompare(bytes1, bytes2); case JTokenType.Guid: if (!(objB is Guid)) throw new ArgumentException("Object must be of type Guid."); Guid guid1 = (Guid) objA; Guid guid2 = (Guid) objB; return guid1.CompareTo(guid2); case JTokenType.Uri: if (!(objB is Uri)) throw new ArgumentException("Object must be of type Uri."); Uri uri1 = (Uri)objA; Uri uri2 = (Uri)objB; return Comparer.Default.Compare(uri1.ToString(), uri2.ToString()); case JTokenType.TimeSpan: if (!(objB is TimeSpan)) throw new ArgumentException("Object must be of type TimeSpan."); TimeSpan ts1 = (TimeSpan)objA; TimeSpan ts2 = (TimeSpan)objB; return ts1.CompareTo(ts2); default: throw MiscellaneousUtils.CreateArgumentOutOfRangeException("valueType", valueType, "Unexpected value type: {0}".FormatWith(CultureInfo.InvariantCulture, valueType)); } } private static int CompareFloat(object objA, object objB) { double d1 = Convert.ToDouble(objA, CultureInfo.InvariantCulture); double d2 = Convert.ToDouble(objB, CultureInfo.InvariantCulture); // take into account possible floating point errors if (MathUtils.ApproxEquals(d1, d2)) return 0; return d1.CompareTo(d2); } #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) private static bool Operation(ExpressionType operation, object objA, object objB, out object result) { if (objA is string || objB is string) { if (operation == ExpressionType.Add || operation == ExpressionType.AddAssign) { result = ((objA != null) ? objA.ToString() : null) + ((objB != null) ? objB.ToString() : null); return true; } } if (objA is ulong || objB is ulong || objA is decimal || objB is decimal) { if (objA == null || objB == null) { result = null; return true; } decimal d1 = Convert.ToDecimal(objA, CultureInfo.InvariantCulture); decimal d2 = Convert.ToDecimal(objB, CultureInfo.InvariantCulture); switch (operation) { case ExpressionType.Add: case ExpressionType.AddAssign: result = d1 + d2; return true; case ExpressionType.Subtract: case ExpressionType.SubtractAssign: result = d1 - d2; return true; case ExpressionType.Multiply: case ExpressionType.MultiplyAssign: result = d1 * d2; return true; case ExpressionType.Divide: case ExpressionType.DivideAssign: result = d1 / d2; return true; } } else if (objA is float || objB is float || objA is double || objB is double) { if (objA == null || objB == null) { result = null; return true; } double d1 = Convert.ToDouble(objA, CultureInfo.InvariantCulture); double d2 = Convert.ToDouble(objB, CultureInfo.InvariantCulture); switch (operation) { case ExpressionType.Add: case ExpressionType.AddAssign: result = d1 + d2; return true; case ExpressionType.Subtract: case ExpressionType.SubtractAssign: result = d1 - d2; return true; case ExpressionType.Multiply: case ExpressionType.MultiplyAssign: result = d1 * d2; return true; case ExpressionType.Divide: case ExpressionType.DivideAssign: result = d1 / d2; return true; } } else if (objA is int || objA is uint || objA is long || objA is short || objA is ushort || objA is sbyte || objA is byte || objB is int || objB is uint || objB is long || objB is short || objB is ushort || objB is sbyte || objB is byte) { if (objA == null || objB == null) { result = null; return true; } long l1 = Convert.ToInt64(objA, CultureInfo.InvariantCulture); long l2 = Convert.ToInt64(objB, CultureInfo.InvariantCulture); switch (operation) { case ExpressionType.Add: case ExpressionType.AddAssign: result = l1 + l2; return true; case ExpressionType.Subtract: case ExpressionType.SubtractAssign: result = l1 - l2; return true; case ExpressionType.Multiply: case ExpressionType.MultiplyAssign: result = l1 * l2; return true; case ExpressionType.Divide: case ExpressionType.DivideAssign: result = l1 / l2; return true; } } result = null; return false; } #endif internal override JToken CloneToken() { return new JValue(this); } /// /// Creates a comment with the given value. /// /// The value. /// A comment with the given value. public static JValue CreateComment(string value) { return new JValue(value, JTokenType.Comment); } /// /// Creates a string with the given value. /// /// The value. /// A string with the given value. public static JValue CreateString(string value) { return new JValue(value, JTokenType.String); } private static JTokenType GetValueType(JTokenType? current, object value) { if (value == null) return JTokenType.Null; #if !(NETFX_CORE || PORTABLE) else if (value == DBNull.Value) return JTokenType.Null; #endif else if (value is string) return GetStringValueType(current); else if (value is long || value is int || value is short || value is sbyte || value is ulong || value is uint || value is ushort || value is byte) return JTokenType.Integer; else if (value is Enum) return JTokenType.Integer; else if (value is double || value is float || value is decimal) return JTokenType.Float; else if (value is DateTime) return JTokenType.Date; #if !PocketPC && !NET20 else if (value is DateTimeOffset) return JTokenType.Date; #endif else if (value is byte[]) return JTokenType.Bytes; else if (value is bool) return JTokenType.Boolean; else if (value is Guid) return JTokenType.Guid; else if (value is Uri) return JTokenType.Uri; else if (value is TimeSpan) return JTokenType.TimeSpan; throw new ArgumentException("Could not determine JSON object type for type {0}.".FormatWith(CultureInfo.InvariantCulture, value.GetType())); } private static JTokenType GetStringValueType(JTokenType? current) { if (current == null) return JTokenType.String; switch (current.Value) { case JTokenType.Comment: case JTokenType.String: case JTokenType.Raw: return current.Value; default: return JTokenType.String; } } /// /// Gets the node type for this . /// /// The type. public override JTokenType Type { get { return _valueType; } } /// /// Gets or sets the underlying token value. /// /// The underlying token value. public object Value { get { return _value; } set { Type currentType = (_value != null) ? _value.GetType() : null; Type newType = (value != null) ? value.GetType() : null; if (currentType != newType) _valueType = GetValueType(_valueType, value); _value = value; } } /// /// Writes this token to a . /// /// A into which this method will write. /// A collection of which will be used when writing the token. public override void WriteTo(JsonWriter writer, params JsonConverter[] converters) { switch (_valueType) { case JTokenType.Comment: writer.WriteComment(_value.ToString()); return; case JTokenType.Raw: writer.WriteRawValue((_value != null) ? _value.ToString() : null); return; case JTokenType.Null: writer.WriteNull(); return; case JTokenType.Undefined: writer.WriteUndefined(); return; } JsonConverter matchingConverter; if (_value != null && ((matchingConverter = JsonSerializer.GetMatchingConverter(converters, _value.GetType())) != null)) { matchingConverter.WriteJson(writer, _value, new JsonSerializer()); return; } switch (_valueType) { case JTokenType.Integer: writer.WriteValue(Convert.ToInt64(_value, CultureInfo.InvariantCulture)); return; case JTokenType.Float: if (_value is float) writer.WriteValue(_value); else writer.WriteValue(Convert.ToDouble(_value, CultureInfo.InvariantCulture)); return; case JTokenType.String: writer.WriteValue((_value != null) ? _value.ToString() : null); return; case JTokenType.Boolean: writer.WriteValue(Convert.ToBoolean(_value, CultureInfo.InvariantCulture)); return; case JTokenType.Date: #if !PocketPC && !NET20 if (_value is DateTimeOffset) writer.WriteValue((DateTimeOffset)_value); else #endif writer.WriteValue(Convert.ToDateTime(_value, CultureInfo.InvariantCulture)); return; case JTokenType.Bytes: writer.WriteValue((byte[])_value); return; case JTokenType.Guid: case JTokenType.Uri: case JTokenType.TimeSpan: writer.WriteValue((_value != null) ? _value.ToString() : null); return; } throw MiscellaneousUtils.CreateArgumentOutOfRangeException("TokenType", _valueType, "Unexpected token type."); } internal override int GetDeepHashCode() { int valueHashCode = (_value != null) ? _value.GetHashCode() : 0; return _valueType.GetHashCode() ^ valueHashCode; } private static bool ValuesEquals(JValue v1, JValue v2) { return (v1 == v2 || (v1._valueType == v2._valueType && Compare(v1._valueType, v1._value, v2._value) == 0)); } /// /// Indicates whether the current object is equal to another object of the same type. /// /// /// true if the current object is equal to the parameter; otherwise, false. /// /// An object to compare with this object. public bool Equals(JValue other) { if (other == null) return false; return ValuesEquals(this, other); } /// /// Determines whether the specified is equal to the current . /// /// The to compare with the current . /// /// true if the specified is equal to the current ; otherwise, false. /// /// /// The parameter is null. /// public override bool Equals(object obj) { if (obj == null) return false; JValue otherValue = obj as JValue; if (otherValue != null) return Equals(otherValue); return base.Equals(obj); } /// /// Serves as a hash function for a particular type. /// /// /// A hash code for the current . /// public override int GetHashCode() { if (_value == null) return 0; return _value.GetHashCode(); } /// /// Returns a that represents this instance. /// /// /// A that represents this instance. /// public override string ToString() { if (_value == null) return string.Empty; return _value.ToString(); } /// /// Returns a that represents this instance. /// /// The format. /// /// A that represents this instance. /// public string ToString(string format) { return ToString(format, CultureInfo.CurrentCulture); } /// /// Returns a that represents this instance. /// /// The format provider. /// /// A that represents this instance. /// public string ToString(IFormatProvider formatProvider) { return ToString(null, formatProvider); } /// /// Returns a that represents this instance. /// /// The format. /// The format provider. /// /// A that represents this instance. /// public string ToString(string format, IFormatProvider formatProvider) { if (_value == null) return string.Empty; IFormattable formattable = _value as IFormattable; if (formattable != null) return formattable.ToString(format, formatProvider); else return _value.ToString(); } #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) /// /// Returns the responsible for binding operations performed on this object. /// /// The expression tree representation of the runtime value. /// /// The to bind this object. /// protected override DynamicMetaObject GetMetaObject(Expression parameter) { return new DynamicProxyMetaObject(parameter, this, new JValueDynamicProxy(), true); } private class JValueDynamicProxy : DynamicProxy { public override bool TryConvert(JValue instance, ConvertBinder binder, out object result) { if (binder.Type == typeof(JValue)) { result = instance; return true; } object value = instance.Value; if (value == null) { result = null; return ReflectionUtils.IsNullable(binder.Type); } result = ConvertUtils.Convert(instance.Value, CultureInfo.InvariantCulture, binder.Type); return true; } public override bool TryBinaryOperation(JValue instance, BinaryOperationBinder binder, object arg, out object result) { object compareValue = (arg is JValue) ? ((JValue) arg).Value : arg; switch (binder.Operation) { case ExpressionType.Equal: result = (Compare(instance.Type, instance.Value, compareValue) == 0); return true; case ExpressionType.NotEqual: result = (Compare(instance.Type, instance.Value, compareValue) != 0); return true; case ExpressionType.GreaterThan: result = (Compare(instance.Type, instance.Value, compareValue) > 0); return true; case ExpressionType.GreaterThanOrEqual: result = (Compare(instance.Type, instance.Value, compareValue) >= 0); return true; case ExpressionType.LessThan: result = (Compare(instance.Type, instance.Value, compareValue) < 0); return true; case ExpressionType.LessThanOrEqual: result = (Compare(instance.Type, instance.Value, compareValue) <= 0); return true; case ExpressionType.Add: case ExpressionType.AddAssign: case ExpressionType.Subtract: case ExpressionType.SubtractAssign: case ExpressionType.Multiply: case ExpressionType.MultiplyAssign: case ExpressionType.Divide: case ExpressionType.DivideAssign: if (Operation(binder.Operation, instance.Value, compareValue, out result)) { result = new JValue(result); return true; } break; } result = null; return false; } } #endif int IComparable.CompareTo(object obj) { if (obj == null) return 1; object otherValue = (obj is JValue) ? ((JValue) obj).Value : obj; return Compare(_valueType, _value, otherValue); } /// /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. /// /// An object to compare with this instance. /// /// A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: /// Value /// Meaning /// Less than zero /// This instance is less than . /// Zero /// This instance is equal to . /// Greater than zero /// This instance is greater than . /// /// /// is not the same type as this instance. /// public int CompareTo(JValue obj) { if (obj == null) return 1; return Compare(_valueType, _value, obj._value); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JObject.cs0000644000175000017500000006146512253423361025616 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Collections.ObjectModel; #if !PORTABLE using System.Collections.Specialized; #endif using System.ComponentModel; #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) using System.Dynamic; using System.Linq.Expressions; #endif using System.IO; using Newtonsoft.Json.Utilities; using System.Globalization; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Linq { /// /// Represents a JSON object. /// /// /// /// public class JObject : JContainer, IDictionary, INotifyPropertyChanged #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) , ICustomTypeDescriptor #endif #if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE) , INotifyPropertyChanging #endif { private readonly JPropertyKeyedCollection _properties = new JPropertyKeyedCollection(); /// /// Gets the container's children tokens. /// /// The container's children tokens. protected override IList ChildrenTokens { get { return _properties; } } /// /// Occurs when a property value changes. /// public event PropertyChangedEventHandler PropertyChanged; #if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE) /// /// Occurs when a property value is changing. /// public event PropertyChangingEventHandler PropertyChanging; #endif /// /// Initializes a new instance of the class. /// public JObject() { } /// /// Initializes a new instance of the class from another object. /// /// A object to copy from. public JObject(JObject other) : base(other) { } /// /// Initializes a new instance of the class with the specified content. /// /// The contents of the object. public JObject(params object[] content) : this((object)content) { } /// /// Initializes a new instance of the class with the specified content. /// /// The contents of the object. public JObject(object content) { Add(content); } internal override bool DeepEquals(JToken node) { JObject t = node as JObject; if (t == null) return false; return _properties.Compare(t._properties); } internal override void InsertItem(int index, JToken item, bool skipParentCheck) { // don't add comments to JObject, no name to reference comment by if (item != null && item.Type == JTokenType.Comment) return; base.InsertItem(index, item, skipParentCheck); } internal override void ValidateToken(JToken o, JToken existing) { ValidationUtils.ArgumentNotNull(o, "o"); if (o.Type != JTokenType.Property) throw new ArgumentException("Can not add {0} to {1}.".FormatWith(CultureInfo.InvariantCulture, o.GetType(), GetType())); JProperty newProperty = (JProperty) o; if (existing != null) { JProperty existingProperty = (JProperty) existing; if (newProperty.Name == existingProperty.Name) return; } if (_properties.TryGetValue(newProperty.Name, out existing)) throw new ArgumentException("Can not add property {0} to {1}. Property with the same name already exists on object.".FormatWith(CultureInfo.InvariantCulture, newProperty.Name, GetType())); } internal void InternalPropertyChanged(JProperty childProperty) { OnPropertyChanged(childProperty.Name); #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, IndexOfItem(childProperty))); #endif #if SILVERLIGHT || !(NET20 || NET35 || PORTABLE) OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, childProperty, childProperty, IndexOfItem(childProperty))); #endif } internal void InternalPropertyChanging(JProperty childProperty) { #if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE) OnPropertyChanging(childProperty.Name); #endif } internal override JToken CloneToken() { return new JObject(this); } /// /// Gets the node type for this . /// /// The type. public override JTokenType Type { get { return JTokenType.Object; } } /// /// Gets an of this object's properties. /// /// An of this object's properties. public IEnumerable Properties() { return ChildrenTokens.Cast(); } /// /// Gets a the specified name. /// /// The property name. /// A with the specified name or null. public JProperty Property(string name) { if (name == null) return null; JToken property; _properties.TryGetValue(name, out property); return (JProperty)property; } /// /// Gets an of this object's property values. /// /// An of this object's property values. public JEnumerable PropertyValues() { return new JEnumerable(Properties().Select(p => p.Value)); } /// /// Gets the with the specified key. /// /// The with the specified key. public override JToken this[object key] { get { ValidationUtils.ArgumentNotNull(key, "o"); string propertyName = key as string; if (propertyName == null) throw new ArgumentException("Accessed JObject values with invalid key value: {0}. Object property name expected.".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.ToString(key))); return this[propertyName]; } set { ValidationUtils.ArgumentNotNull(key, "o"); string propertyName = key as string; if (propertyName == null) throw new ArgumentException("Set JObject values with invalid key value: {0}. Object property name expected.".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.ToString(key))); this[propertyName] = value; } } /// /// Gets or sets the with the specified property name. /// /// public JToken this[string propertyName] { get { ValidationUtils.ArgumentNotNull(propertyName, "propertyName"); JProperty property = Property(propertyName); return (property != null) ? property.Value : null; } set { JProperty property = Property(propertyName); if (property != null) { property.Value = value; } else { #if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE) OnPropertyChanging(propertyName); #endif Add(new JProperty(propertyName, value)); OnPropertyChanged(propertyName); } } } /// /// Loads an from a . /// /// A that will be read for the content of the . /// A that contains the JSON that was read from the specified . public static new JObject Load(JsonReader reader) { ValidationUtils.ArgumentNotNull(reader, "reader"); if (reader.TokenType == JsonToken.None) { if (!reader.Read()) throw JsonReaderException.Create(reader, "Error reading JObject from JsonReader."); } while (reader.TokenType == JsonToken.Comment) { reader.Read(); } if (reader.TokenType != JsonToken.StartObject) { throw JsonReaderException.Create(reader, "Error reading JObject from JsonReader. Current JsonReader item is not an object: {0}".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); } JObject o = new JObject(); o.SetLineInfo(reader as IJsonLineInfo); o.ReadTokenFrom(reader); return o; } /// /// Load a from a string that contains JSON. /// /// A that contains JSON. /// A populated from the string that contains JSON. /// /// /// public static new JObject Parse(string json) { JsonReader reader = new JsonTextReader(new StringReader(json)); JObject o = Load(reader); if (reader.Read() && reader.TokenType != JsonToken.Comment) throw JsonReaderException.Create(reader, "Additional text found in JSON string after parsing content."); return o; } /// /// Creates a from an object. /// /// The object that will be used to create . /// A with the values of the specified object public static new JObject FromObject(object o) { return FromObject(o, new JsonSerializer()); } /// /// Creates a from an object. /// /// The object that will be used to create . /// The that will be used to read the object. /// A with the values of the specified object public static new JObject FromObject(object o, JsonSerializer jsonSerializer) { JToken token = FromObjectInternal(o, jsonSerializer); if (token != null && token.Type != JTokenType.Object) throw new ArgumentException("Object serialized to {0}. JObject instance expected.".FormatWith(CultureInfo.InvariantCulture, token.Type)); return (JObject)token; } /// /// Writes this token to a . /// /// A into which this method will write. /// A collection of which will be used when writing the token. public override void WriteTo(JsonWriter writer, params JsonConverter[] converters) { writer.WriteStartObject(); foreach (JProperty property in ChildrenTokens) { property.WriteTo(writer, converters); } writer.WriteEndObject(); } #region IDictionary Members /// /// Adds the specified property name. /// /// Name of the property. /// The value. public void Add(string propertyName, JToken value) { Add(new JProperty(propertyName, value)); } bool IDictionary.ContainsKey(string key) { return _properties.Contains(key); } ICollection IDictionary.Keys { // todo: make order the collection returned match JObject order get { return _properties.Keys; } } /// /// Removes the property with the specified name. /// /// Name of the property. /// true if item was successfully removed; otherwise, false. public bool Remove(string propertyName) { JProperty property = Property(propertyName); if (property == null) return false; property.Remove(); return true; } /// /// Tries the get value. /// /// Name of the property. /// The value. /// true if a value was successfully retrieved; otherwise, false. public bool TryGetValue(string propertyName, out JToken value) { JProperty property = Property(propertyName); if (property == null) { value = null; return false; } value = property.Value; return true; } ICollection IDictionary.Values { get { // todo: need to wrap _properties.Values with a collection to get the JProperty value throw new NotImplementedException(); } } #endregion #region ICollection> Members void ICollection>.Add(KeyValuePair item) { Add(new JProperty(item.Key, item.Value)); } void ICollection>.Clear() { RemoveAll(); } bool ICollection>.Contains(KeyValuePair item) { JProperty property = Property(item.Key); if (property == null) return false; return (property.Value == item.Value); } void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) { if (array == null) throw new ArgumentNullException("array"); if (arrayIndex < 0) throw new ArgumentOutOfRangeException("arrayIndex", "arrayIndex is less than 0."); if (arrayIndex >= array.Length) throw new ArgumentException("arrayIndex is equal to or greater than the length of array."); if (Count > array.Length - arrayIndex) throw new ArgumentException("The number of elements in the source JObject is greater than the available space from arrayIndex to the end of the destination array."); int index = 0; foreach (JProperty property in ChildrenTokens) { array[arrayIndex + index] = new KeyValuePair(property.Name, property.Value); index++; } } bool ICollection>.IsReadOnly { get { return false; } } bool ICollection>.Remove(KeyValuePair item) { if (!((ICollection>)this).Contains(item)) return false; ((IDictionary)this).Remove(item.Key); return true; } #endregion internal override int GetDeepHashCode() { return ContentsHashCode(); } /// /// Returns an enumerator that iterates through the collection. /// /// /// A that can be used to iterate through the collection. /// public IEnumerator> GetEnumerator() { foreach (JProperty property in ChildrenTokens) { yield return new KeyValuePair(property.Name, property.Value); } } /// /// Raises the event with the provided arguments. /// /// Name of the property. protected virtual void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } #if !(SILVERLIGHT || NETFX_CORE || PORTABLE || NET20) /// /// Raises the event with the provided arguments. /// /// Name of the property. protected virtual void OnPropertyChanging(string propertyName) { if (PropertyChanging != null) PropertyChanging(this, new PropertyChangingEventArgs(propertyName)); } #endif #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) // include custom type descriptor on JObject rather than use a provider because the properties are specific to a type #region ICustomTypeDescriptor /// /// Returns the properties for this instance of a component. /// /// /// A that represents the properties for this component instance. /// PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties() { return ((ICustomTypeDescriptor) this).GetProperties(null); } private static Type GetTokenPropertyType(JToken token) { if (token is JValue) { JValue v = (JValue)token; return (v.Value != null) ? v.Value.GetType() : typeof(object); } return token.GetType(); } /// /// Returns the properties for this instance of a component using the attribute array as a filter. /// /// An array of type that is used as a filter. /// /// A that represents the filtered properties for this component instance. /// PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) { PropertyDescriptorCollection descriptors = new PropertyDescriptorCollection(null); foreach (KeyValuePair propertyValue in this) { descriptors.Add(new JPropertyDescriptor(propertyValue.Key, GetTokenPropertyType(propertyValue.Value))); } return descriptors; } /// /// Returns a collection of custom attributes for this instance of a component. /// /// /// An containing the attributes for this object. /// AttributeCollection ICustomTypeDescriptor.GetAttributes() { return AttributeCollection.Empty; } /// /// Returns the class name of this instance of a component. /// /// /// The class name of the object, or null if the class does not have a name. /// string ICustomTypeDescriptor.GetClassName() { return null; } /// /// Returns the name of this instance of a component. /// /// /// The name of the object, or null if the object does not have a name. /// string ICustomTypeDescriptor.GetComponentName() { return null; } /// /// Returns a type converter for this instance of a component. /// /// /// A that is the converter for this object, or null if there is no for this object. /// TypeConverter ICustomTypeDescriptor.GetConverter() { return new TypeConverter(); } /// /// Returns the default event for this instance of a component. /// /// /// An that represents the default event for this object, or null if this object does not have events. /// EventDescriptor ICustomTypeDescriptor.GetDefaultEvent() { return null; } /// /// Returns the default property for this instance of a component. /// /// /// A that represents the default property for this object, or null if this object does not have properties. /// PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty() { return null; } /// /// Returns an editor of the specified type for this instance of a component. /// /// A that represents the editor for this object. /// /// An of the specified type that is the editor for this object, or null if the editor cannot be found. /// object ICustomTypeDescriptor.GetEditor(Type editorBaseType) { return null; } /// /// Returns the events for this instance of a component using the specified attribute array as a filter. /// /// An array of type that is used as a filter. /// /// An that represents the filtered events for this component instance. /// EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes) { return EventDescriptorCollection.Empty; } /// /// Returns the events for this instance of a component. /// /// /// An that represents the events for this component instance. /// EventDescriptorCollection ICustomTypeDescriptor.GetEvents() { return EventDescriptorCollection.Empty; } /// /// Returns an object that contains the property described by the specified property descriptor. /// /// A that represents the property whose owner is to be found. /// /// An that represents the owner of the specified property. /// object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd) { return null; } #endregion #endif #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) /// /// Returns the responsible for binding operations performed on this object. /// /// The expression tree representation of the runtime value. /// /// The to bind this object. /// protected override DynamicMetaObject GetMetaObject(Expression parameter) { return new DynamicProxyMetaObject(parameter, this, new JObjectDynamicProxy(), true); } private class JObjectDynamicProxy : DynamicProxy { public override bool TryGetMember(JObject instance, GetMemberBinder binder, out object result) { // result can be null result = instance[binder.Name]; return true; } public override bool TrySetMember(JObject instance, SetMemberBinder binder, object value) { JToken v = value as JToken; // this can throw an error if value isn't a valid for a JValue if (v == null) v = new JValue(value); instance[binder.Name] = v; return true; } public override IEnumerable GetDynamicMemberNames(JObject instance) { return instance.Properties().Select(p => p.Name); } } #endif } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JPropertyDescriptor.cs0000644000175000017500000001377412253423361030273 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) using System; using System.ComponentModel; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Linq { /// /// Represents a view of a . /// public class JPropertyDescriptor : PropertyDescriptor { private readonly Type _propertyType; /// /// Initializes a new instance of the class. /// /// The name. /// Type of the property. public JPropertyDescriptor(string name, Type propertyType) : base(name, null) { ValidationUtils.ArgumentNotNull(name, "name"); ValidationUtils.ArgumentNotNull(propertyType, "propertyType"); _propertyType = propertyType; } private static JObject CastInstance(object instance) { return (JObject)instance; } /// /// When overridden in a derived class, returns whether resetting an object changes its value. /// /// /// true if resetting the component changes its value; otherwise, false. /// /// The component to test for reset capability. /// public override bool CanResetValue(object component) { return false; } /// /// When overridden in a derived class, gets the current value of the property on a component. /// /// /// The value of a property for a given component. /// /// The component with the property for which to retrieve the value. /// public override object GetValue(object component) { JToken token = CastInstance(component)[Name]; return token; } /// /// When overridden in a derived class, resets the value for this property of the component to the default value. /// /// The component with the property value that is to be reset to the default value. /// public override void ResetValue(object component) { } /// /// When overridden in a derived class, sets the value of the component to a different value. /// /// The component with the property value that is to be set. /// The new value. /// public override void SetValue(object component, object value) { JToken token = (value is JToken) ? (JToken) value : new JValue(value); CastInstance(component)[Name] = token; } /// /// When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. /// /// /// true if the property should be persisted; otherwise, false. /// /// The component with the property to be examined for persistence. /// public override bool ShouldSerializeValue(object component) { return false; } /// /// When overridden in a derived class, gets the type of the component this property is bound to. /// /// /// A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. /// public override Type ComponentType { get { return typeof(JObject); } } /// /// When overridden in a derived class, gets a value indicating whether this property is read-only. /// /// /// true if the property is read-only; otherwise, false. /// public override bool IsReadOnly { get { return false; } } /// /// When overridden in a derived class, gets the type of the property. /// /// /// A that represents the type of the property. /// public override Type PropertyType { get { return _propertyType; } } /// /// Gets the hash code for the name of the member. /// /// /// /// The hash code for the name of the member. /// protected override int NameHashCode { get { // override property to fix up an error in its documentation int nameHashCode = base.NameHashCode; return nameHashCode; } } } } #endifsmuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenReader.cs0000644000175000017500000002214112253423361026577 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Linq { /// /// Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. /// public class JTokenReader : JsonReader, IJsonLineInfo { private readonly JToken _root; private JToken _parent; private JToken _current; /// /// Initializes a new instance of the class. /// /// The token to read from. public JTokenReader(JToken token) { ValidationUtils.ArgumentNotNull(token, "token"); _root = token; _current = token; } /// /// Reads the next JSON token from the stream as a . /// /// /// A or a null reference if the next JSON token is null. This method will return null at the end of an array. /// public override byte[] ReadAsBytes() { return ReadAsBytesInternal(); } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override decimal? ReadAsDecimal() { return ReadAsDecimalInternal(); } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override int? ReadAsInt32() { return ReadAsInt32Internal(); } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override string ReadAsString() { return ReadAsStringInternal(); } /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override DateTime? ReadAsDateTime() { return ReadAsDateTimeInternal(); } #if !NET20 /// /// Reads the next JSON token from the stream as a . /// /// A . This method will return null at the end of an array. public override DateTimeOffset? ReadAsDateTimeOffset() { return ReadAsDateTimeOffsetInternal(); } #endif internal override bool ReadInternal() { if (CurrentState != State.Start) { JContainer container = _current as JContainer; if (container != null && _parent != container) return ReadInto(container); else return ReadOver(_current); } SetToken(_current); return true; } /// /// Reads the next JSON token from the stream. /// /// /// true if the next token was read successfully; false if there are no more tokens to read. /// public override bool Read() { _readType = ReadType.Read; return ReadInternal(); } private bool ReadOver(JToken t) { if (t == _root) return ReadToEnd(); JToken next = t.Next; if ((next == null || next == t) || t == t.Parent.Last) { if (t.Parent == null) return ReadToEnd(); return SetEnd(t.Parent); } else { _current = next; SetToken(_current); return true; } } private bool ReadToEnd() { SetToken(JsonToken.None); return false; } private bool IsEndElement { get { return (_current == _parent); } } private JsonToken? GetEndToken(JContainer c) { switch (c.Type) { case JTokenType.Object: return JsonToken.EndObject; case JTokenType.Array: return JsonToken.EndArray; case JTokenType.Constructor: return JsonToken.EndConstructor; case JTokenType.Property: return null; default: throw MiscellaneousUtils.CreateArgumentOutOfRangeException("Type", c.Type, "Unexpected JContainer type."); } } private bool ReadInto(JContainer c) { JToken firstChild = c.First; if (firstChild == null) { return SetEnd(c); } else { SetToken(firstChild); _current = firstChild; _parent = c; return true; } } private bool SetEnd(JContainer c) { JsonToken? endToken = GetEndToken(c); if (endToken != null) { SetToken(endToken.Value); _current = c; _parent = c; return true; } else { return ReadOver(c); } } private void SetToken(JToken token) { switch (token.Type) { case JTokenType.Object: SetToken(JsonToken.StartObject); break; case JTokenType.Array: SetToken(JsonToken.StartArray); break; case JTokenType.Constructor: SetToken(JsonToken.StartConstructor); break; case JTokenType.Property: SetToken(JsonToken.PropertyName, ((JProperty)token).Name); break; case JTokenType.Comment: SetToken(JsonToken.Comment, ((JValue)token).Value); break; case JTokenType.Integer: SetToken(JsonToken.Integer, ((JValue)token).Value); break; case JTokenType.Float: SetToken(JsonToken.Float, ((JValue)token).Value); break; case JTokenType.String: SetToken(JsonToken.String, ((JValue)token).Value); break; case JTokenType.Boolean: SetToken(JsonToken.Boolean, ((JValue)token).Value); break; case JTokenType.Null: SetToken(JsonToken.Null, ((JValue)token).Value); break; case JTokenType.Undefined: SetToken(JsonToken.Undefined, ((JValue)token).Value); break; case JTokenType.Date: SetToken(JsonToken.Date, ((JValue)token).Value); break; case JTokenType.Raw: SetToken(JsonToken.Raw, ((JValue)token).Value); break; case JTokenType.Bytes: SetToken(JsonToken.Bytes, ((JValue)token).Value); break; case JTokenType.Guid: SetToken(JsonToken.String, SafeToString(((JValue)token).Value)); break; case JTokenType.Uri: SetToken(JsonToken.String, SafeToString(((JValue)token).Value)); break; case JTokenType.TimeSpan: SetToken(JsonToken.String, SafeToString(((JValue)token).Value)); break; default: throw MiscellaneousUtils.CreateArgumentOutOfRangeException("Type", token.Type, "Unexpected JTokenType."); } } private string SafeToString(object value) { return (value != null) ? value.ToString() : null; } bool IJsonLineInfo.HasLineInfo() { if (CurrentState == State.Start) return false; IJsonLineInfo info = IsEndElement ? null : _current; return (info != null && info.HasLineInfo()); } int IJsonLineInfo.LineNumber { get { if (CurrentState == State.Start) return 0; IJsonLineInfo info = IsEndElement ? null : _current; if (info != null) return info.LineNumber; return 0; } } int IJsonLineInfo.LinePosition { get { if (CurrentState == State.Start) return 0; IJsonLineInfo info = IsEndElement ? null : _current; if (info != null) return info.LinePosition; return 0; } } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenWriter.cs0000644000175000017500000002742612253423361026664 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Linq { /// /// Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. /// public class JTokenWriter : JsonWriter { private JContainer _token; private JContainer _parent; // used when writer is writing single value and the value has no containing parent private JValue _value; /// /// Gets the token being writen. /// /// The token being writen. public JToken Token { get { if (_token != null) return _token; return _value; } } /// /// Initializes a new instance of the class writing to the given . /// /// The container being written to. public JTokenWriter(JContainer container) { ValidationUtils.ArgumentNotNull(container, "container"); _token = container; _parent = container; } /// /// Initializes a new instance of the class. /// public JTokenWriter() { } /// /// Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. /// public override void Flush() { } /// /// Closes this stream and the underlying stream. /// public override void Close() { base.Close(); } /// /// Writes the beginning of a Json object. /// public override void WriteStartObject() { base.WriteStartObject(); AddParent(new JObject()); } private void AddParent(JContainer container) { if (_parent == null) _token = container; else _parent.AddAndSkipParentCheck(container); _parent = container; } private void RemoveParent() { _parent = _parent.Parent; if (_parent != null && _parent.Type == JTokenType.Property) _parent = _parent.Parent; } /// /// Writes the beginning of a Json array. /// public override void WriteStartArray() { base.WriteStartArray(); AddParent(new JArray()); } /// /// Writes the start of a constructor with the given name. /// /// The name of the constructor. public override void WriteStartConstructor(string name) { base.WriteStartConstructor(name); AddParent(new JConstructor(name)); } /// /// Writes the end. /// /// The token. protected override void WriteEnd(JsonToken token) { RemoveParent(); } /// /// Writes the property name of a name/value pair on a Json object. /// /// The name of the property. public override void WritePropertyName(string name) { base.WritePropertyName(name); AddParent(new JProperty(name)); } private void AddValue(object value, JsonToken token) { AddValue(new JValue(value), token); } internal void AddValue(JValue value, JsonToken token) { if (_parent != null) { _parent.Add(value); if (_parent.Type == JTokenType.Property) _parent = _parent.Parent; } else { _value = value; } } #region WriteValue methods /// /// Writes a null value. /// public override void WriteNull() { base.WriteNull(); AddValue(null, JsonToken.Null); } /// /// Writes an undefined value. /// public override void WriteUndefined() { base.WriteUndefined(); AddValue(null, JsonToken.Undefined); } /// /// Writes raw JSON. /// /// The raw JSON to write. public override void WriteRaw(string json) { base.WriteRaw(json); AddValue(new JRaw(json), JsonToken.Raw); } /// /// Writes out a comment /*...*/ containing the specified text. /// /// Text to place inside the comment. public override void WriteComment(string text) { base.WriteComment(text); AddValue(JValue.CreateComment(text), JsonToken.Comment); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(string value) { base.WriteValue(value); AddValue(value ?? string.Empty, JsonToken.String); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(int value) { base.WriteValue(value); AddValue(value, JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public override void WriteValue(uint value) { base.WriteValue(value); AddValue(value, JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(long value) { base.WriteValue(value); AddValue(value, JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public override void WriteValue(ulong value) { base.WriteValue(value); AddValue(value, JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(float value) { base.WriteValue(value); AddValue(value, JsonToken.Float); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(double value) { base.WriteValue(value); AddValue(value, JsonToken.Float); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(bool value) { base.WriteValue(value); AddValue(value, JsonToken.Boolean); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(short value) { base.WriteValue(value); AddValue(value, JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public override void WriteValue(ushort value) { base.WriteValue(value); AddValue(value, JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(char value) { base.WriteValue(value); string s = null; #if !(NETFX_CORE || PORTABLE) s = value.ToString(CultureInfo.InvariantCulture); #else s = value.ToString(); #endif AddValue(s, JsonToken.String); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(byte value) { base.WriteValue(value); AddValue(value, JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. [CLSCompliant(false)] public override void WriteValue(sbyte value) { base.WriteValue(value); AddValue(value, JsonToken.Integer); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(decimal value) { base.WriteValue(value); AddValue(value, JsonToken.Float); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(DateTime value) { base.WriteValue(value); value = JsonConvert.EnsureDateTime(value, DateTimeZoneHandling); AddValue(value, JsonToken.Date); } #if !PocketPC && !NET20 /// /// Writes a value. /// /// The value to write. public override void WriteValue(DateTimeOffset value) { base.WriteValue(value); AddValue(value, JsonToken.Date); } #endif /// /// Writes a value. /// /// The value to write. public override void WriteValue(byte[] value) { base.WriteValue(value); AddValue(value, JsonToken.Bytes); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(TimeSpan value) { base.WriteValue(value); AddValue(value, JsonToken.String); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(Guid value) { base.WriteValue(value); AddValue(value, JsonToken.String); } /// /// Writes a value. /// /// The value to write. public override void WriteValue(Uri value) { base.WriteValue(value); AddValue(value, JsonToken.String); } #endregion } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenType.cs0000644000175000017500000000510712253423361026321 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json.Linq { /// /// Specifies the type of token. /// public enum JTokenType { /// /// No token type has been set. /// None, /// /// A JSON object. /// Object, /// /// A JSON array. /// Array, /// /// A JSON constructor. /// Constructor, /// /// A JSON object property. /// Property, /// /// A comment. /// Comment, /// /// An integer value. /// Integer, /// /// A float value. /// Float, /// /// A string value. /// String, /// /// A boolean value. /// Boolean, /// /// A null value. /// Null, /// /// An undefined value. /// Undefined, /// /// A date value. /// Date, /// /// A raw JSON value. /// Raw, /// /// A collection of bytes value. /// Bytes, /// /// A Guid value. /// Guid, /// /// A Uri value. /// Uri, /// /// A TimeSpan value. /// TimeSpan } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JToken.cs0000644000175000017500000014452112253423361025463 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) using System.Dynamic; using System.Linq.Expressions; #endif using System.IO; using Newtonsoft.Json.Utilities; using System.Diagnostics; using System.Globalization; using System.Collections; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Linq { /// /// Represents an abstract JSON token. /// public abstract class JToken : IJEnumerable, IJsonLineInfo #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) , ICloneable #endif #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) , IDynamicMetaObjectProvider #endif { private JContainer _parent; private JToken _previous; private JToken _next; private static JTokenEqualityComparer _equalityComparer; private int? _lineNumber; private int? _linePosition; /// /// Gets a comparer that can compare two tokens for value equality. /// /// A that can compare two nodes for value equality. public static JTokenEqualityComparer EqualityComparer { get { if (_equalityComparer == null) _equalityComparer = new JTokenEqualityComparer(); return _equalityComparer; } } /// /// Gets or sets the parent. /// /// The parent. public JContainer Parent { [DebuggerStepThrough] get { return _parent; } internal set { _parent = value; } } /// /// Gets the root of this . /// /// The root of this . public JToken Root { get { JContainer parent = Parent; if (parent == null) return this; while (parent.Parent != null) { parent = parent.Parent; } return parent; } } internal abstract JToken CloneToken(); internal abstract bool DeepEquals(JToken node); /// /// Gets the node type for this . /// /// The type. public abstract JTokenType Type { get; } /// /// Gets a value indicating whether this token has childen tokens. /// /// /// true if this token has child values; otherwise, false. /// public abstract bool HasValues { get; } /// /// Compares the values of two tokens, including the values of all descendant tokens. /// /// The first to compare. /// The second to compare. /// true if the tokens are equal; otherwise false. public static bool DeepEquals(JToken t1, JToken t2) { return (t1 == t2 || (t1 != null && t2 != null && t1.DeepEquals(t2))); } /// /// Gets the next sibling token of this node. /// /// The that contains the next sibling token. public JToken Next { get { return _next; } internal set { _next = value; } } /// /// Gets the previous sibling token of this node. /// /// The that contains the previous sibling token. public JToken Previous { get { return _previous; } internal set { _previous = value; } } internal JToken() { } /// /// Adds the specified content immediately after this token. /// /// A content object that contains simple content or a collection of content objects to be added after this token. public void AddAfterSelf(object content) { if (_parent == null) throw new InvalidOperationException("The parent is missing."); int index = _parent.IndexOfItem(this); _parent.AddInternal(index + 1, content, false); } /// /// Adds the specified content immediately before this token. /// /// A content object that contains simple content or a collection of content objects to be added before this token. public void AddBeforeSelf(object content) { if (_parent == null) throw new InvalidOperationException("The parent is missing."); int index = _parent.IndexOfItem(this); _parent.AddInternal(index, content, false); } /// /// Returns a collection of the ancestor tokens of this token. /// /// A collection of the ancestor tokens of this token. public IEnumerable Ancestors() { for (JToken parent = Parent; parent != null; parent = parent.Parent) { yield return parent; } } /// /// Returns a collection of the sibling tokens after this token, in document order. /// /// A collection of the sibling tokens after this tokens, in document order. public IEnumerable AfterSelf() { if (Parent == null) yield break; for (JToken o = Next; o != null; o = o.Next) { yield return o; } } /// /// Returns a collection of the sibling tokens before this token, in document order. /// /// A collection of the sibling tokens before this token, in document order. public IEnumerable BeforeSelf() { for (JToken o = Parent.First; o != this; o = o.Next) { yield return o; } } /// /// Gets the with the specified key. /// /// The with the specified key. public virtual JToken this[object key] { get { throw new InvalidOperationException("Cannot access child value on {0}.".FormatWith(CultureInfo.InvariantCulture, GetType())); } set { throw new InvalidOperationException("Cannot set child value on {0}.".FormatWith(CultureInfo.InvariantCulture, GetType())); } } /// /// Gets the with the specified key converted to the specified type. /// /// The type to convert the token to. /// The token key. /// The converted token value. public virtual T Value(object key) { JToken token = this[key]; return Extensions.Convert(token); } /// /// Get the first child token of this token. /// /// A containing the first child token of the . public virtual JToken First { get { throw new InvalidOperationException("Cannot access child value on {0}.".FormatWith(CultureInfo.InvariantCulture, GetType())); } } /// /// Get the last child token of this token. /// /// A containing the last child token of the . public virtual JToken Last { get { throw new InvalidOperationException("Cannot access child value on {0}.".FormatWith(CultureInfo.InvariantCulture, GetType())); } } /// /// Returns a collection of the child tokens of this token, in document order. /// /// An of containing the child tokens of this , in document order. public virtual JEnumerable Children() { return JEnumerable.Empty; } /// /// Returns a collection of the child tokens of this token, in document order, filtered by the specified type. /// /// The type to filter the child tokens on. /// A containing the child tokens of this , in document order. public JEnumerable Children() where T : JToken { return new JEnumerable(Children().OfType()); } /// /// Returns a collection of the child values of this token, in document order. /// /// The type to convert the values to. /// A containing the child values of this , in document order. public virtual IEnumerable Values() { throw new InvalidOperationException("Cannot access child value on {0}.".FormatWith(CultureInfo.InvariantCulture, GetType())); } /// /// Removes this token from its parent. /// public void Remove() { if (_parent == null) throw new InvalidOperationException("The parent is missing."); _parent.RemoveItem(this); } /// /// Replaces this token with the specified token. /// /// The value. public void Replace(JToken value) { if (_parent == null) throw new InvalidOperationException("The parent is missing."); _parent.ReplaceItem(this, value); } /// /// Writes this token to a . /// /// A into which this method will write. /// A collection of which will be used when writing the token. public abstract void WriteTo(JsonWriter writer, params JsonConverter[] converters); /// /// Returns the indented JSON for this token. /// /// /// The indented JSON for this token. /// public override string ToString() { return ToString(Formatting.Indented); } /// /// Returns the JSON for this token using the given formatting and converters. /// /// Indicates how the output is formatted. /// A collection of which will be used when writing the token. /// The JSON for this token using the given formatting and converters. public string ToString(Formatting formatting, params JsonConverter[] converters) { using (StringWriter sw = new StringWriter(CultureInfo.InvariantCulture)) { JsonTextWriter jw = new JsonTextWriter(sw); jw.Formatting = formatting; WriteTo(jw, converters); return sw.ToString(); } } private static JValue EnsureValue(JToken value) { if (value == null) throw new ArgumentNullException("value"); if (value is JProperty) value = ((JProperty)value).Value; JValue v = value as JValue; return v; } private static string GetType(JToken token) { ValidationUtils.ArgumentNotNull(token, "token"); if (token is JProperty) token = ((JProperty)token).Value; return token.Type.ToString(); } private static bool IsNullable(JToken o) { return (o.Type == JTokenType.Undefined || o.Type == JTokenType.Null); } private static bool ValidateFloat(JToken o, bool nullable) { return (o.Type == JTokenType.Float || o.Type == JTokenType.Integer || (nullable && IsNullable(o))); } private static bool ValidateInteger(JToken o, bool nullable) { return (o.Type == JTokenType.Integer || (nullable && IsNullable(o))); } private static bool ValidateDate(JToken o, bool nullable) { return (o.Type == JTokenType.Date || (nullable && IsNullable(o))); } private static bool ValidateBoolean(JToken o, bool nullable) { return (o.Type == JTokenType.Boolean || (nullable && IsNullable(o))); } private static bool ValidateString(JToken o) { return (o.Type == JTokenType.String || o.Type == JTokenType.Comment || o.Type == JTokenType.Raw || IsNullable(o)); } private static bool ValidateBytes(JToken o) { return (o.Type == JTokenType.Bytes || IsNullable(o)); } #region Cast from operators /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator bool(JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateBoolean(v, false)) throw new ArgumentException("Can not convert {0} to Boolean.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return Convert.ToBoolean(v.Value, CultureInfo.InvariantCulture); } #if !PocketPC && !NET20 /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator DateTimeOffset(JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateDate(v, false)) throw new ArgumentException("Can not convert {0} to DateTimeOffset.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (DateTimeOffset)v.Value; } #endif /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator bool?(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateBoolean(v, true)) throw new ArgumentException("Can not convert {0} to Boolean.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (v.Value != null) ? (bool?)Convert.ToBoolean(v.Value, CultureInfo.InvariantCulture) : null; } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator long(JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateInteger(v, false)) throw new ArgumentException("Can not convert {0} to Int64.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return Convert.ToInt64(v.Value, CultureInfo.InvariantCulture); } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator DateTime?(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateDate(v, true)) throw new ArgumentException("Can not convert {0} to DateTime.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (v.Value != null) ? (DateTime?)Convert.ToDateTime(v.Value, CultureInfo.InvariantCulture) : null; } #if !PocketPC && !NET20 /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator DateTimeOffset?(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateDate(v, true)) throw new ArgumentException("Can not convert {0} to DateTimeOffset.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (DateTimeOffset?)v.Value; } #endif /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator decimal?(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateFloat(v, true)) throw new ArgumentException("Can not convert {0} to Decimal.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (v.Value != null) ? (decimal?)Convert.ToDecimal(v.Value, CultureInfo.InvariantCulture) : null; } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator double?(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateFloat(v, true)) throw new ArgumentException("Can not convert {0} to Double.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (double?)v.Value; } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator int(JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateInteger(v, false)) throw new ArgumentException("Can not convert {0} to Int32.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return Convert.ToInt32(v.Value, CultureInfo.InvariantCulture); } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator short(JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateInteger(v, false)) throw new ArgumentException("Can not convert {0} to Int16.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return Convert.ToInt16(v.Value, CultureInfo.InvariantCulture); } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. [CLSCompliant(false)] public static explicit operator ushort(JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateInteger(v, false)) throw new ArgumentException("Can not convert {0} to UInt16.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return Convert.ToUInt16(v.Value, CultureInfo.InvariantCulture); } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator int?(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateInteger(v, true)) throw new ArgumentException("Can not convert {0} to Int32.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (v.Value != null) ? (int?)Convert.ToInt32(v.Value, CultureInfo.InvariantCulture) : null; } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator short?(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateInteger(v, true)) throw new ArgumentException("Can not convert {0} to Int16.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (v.Value != null) ? (short?)Convert.ToInt16(v.Value, CultureInfo.InvariantCulture) : null; } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. [CLSCompliant(false)] public static explicit operator ushort?(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateInteger(v, true)) throw new ArgumentException("Can not convert {0} to UInt16.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (v.Value != null) ? (ushort?)Convert.ToInt16(v.Value, CultureInfo.InvariantCulture) : null; } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator DateTime(JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateDate(v, false)) throw new ArgumentException("Can not convert {0} to DateTime.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return Convert.ToDateTime(v.Value, CultureInfo.InvariantCulture); } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator long?(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateInteger(v, true)) throw new ArgumentException("Can not convert {0} to Int64.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (v.Value != null) ? (long?)Convert.ToInt64(v.Value, CultureInfo.InvariantCulture) : null; } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator float?(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateFloat(v, true)) throw new ArgumentException("Can not convert {0} to Single.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (v.Value != null) ? (float?)Convert.ToSingle(v.Value, CultureInfo.InvariantCulture) : null; } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator decimal(JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateFloat(v, false)) throw new ArgumentException("Can not convert {0} to Decimal.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return Convert.ToDecimal(v.Value, CultureInfo.InvariantCulture); } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. [CLSCompliant(false)] public static explicit operator uint?(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateInteger(v, true)) throw new ArgumentException("Can not convert {0} to UInt32.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (v.Value != null) ? (uint?)Convert.ToUInt32(v.Value, CultureInfo.InvariantCulture) : null; } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. [CLSCompliant(false)] public static explicit operator ulong?(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateInteger(v, true)) throw new ArgumentException("Can not convert {0} to UInt64.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (v.Value != null) ? (ulong?)Convert.ToUInt64(v.Value, CultureInfo.InvariantCulture) : null; } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator double(JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateFloat(v, false)) throw new ArgumentException("Can not convert {0} to Double.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return Convert.ToDouble(v.Value, CultureInfo.InvariantCulture); } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator float(JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateFloat(v, false)) throw new ArgumentException("Can not convert {0} to Single.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return Convert.ToSingle(v.Value, CultureInfo.InvariantCulture); } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator string(JToken value) { if (value == null) return null; JValue v = EnsureValue(value); if (v == null || !ValidateString(v)) throw new ArgumentException("Can not convert {0} to String.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (v.Value != null) ? Convert.ToString(v.Value, CultureInfo.InvariantCulture) : null; } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. [CLSCompliant(false)] public static explicit operator uint(JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateInteger(v, false)) throw new ArgumentException("Can not convert {0} to UInt32.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return Convert.ToUInt32(v.Value, CultureInfo.InvariantCulture); } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. [CLSCompliant(false)] public static explicit operator ulong(JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateInteger(v, false)) throw new ArgumentException("Can not convert {0} to UInt64.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return Convert.ToUInt64(v.Value, CultureInfo.InvariantCulture); } /// /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. public static explicit operator byte[](JToken value) { JValue v = EnsureValue(value); if (v == null || !ValidateBytes(v)) throw new ArgumentException("Can not convert {0} to byte array.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); return (byte[])v.Value; } #endregion #region Cast to operators /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(bool value) { return new JValue(value); } #if !PocketPC && !NET20 /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(DateTimeOffset value) { return new JValue(value); } #endif /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(bool? value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(long value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(DateTime? value) { return new JValue(value); } #if !PocketPC && !NET20 /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(DateTimeOffset? value) { return new JValue(value); } #endif /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(decimal? value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(double? value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. [CLSCompliant(false)] public static implicit operator JToken(short value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. [CLSCompliant(false)] public static implicit operator JToken(ushort value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(int value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(int? value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(DateTime value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(long? value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(float? value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(decimal value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. [CLSCompliant(false)] public static implicit operator JToken(short? value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. [CLSCompliant(false)] public static implicit operator JToken(ushort? value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. [CLSCompliant(false)] public static implicit operator JToken(uint? value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. [CLSCompliant(false)] public static implicit operator JToken(ulong? value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(double value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(float value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(string value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. [CLSCompliant(false)] public static implicit operator JToken(uint value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. [CLSCompliant(false)] public static implicit operator JToken(ulong value) { return new JValue(value); } /// /// Performs an implicit conversion from to . /// /// The value to create a from. /// The initialized with the specified value. public static implicit operator JToken(byte[] value) { return new JValue(value); } #endregion IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return Children().GetEnumerator(); } internal abstract int GetDeepHashCode(); IJEnumerable IJEnumerable.this[object key] { get { return this[key]; } } /// /// Creates an for this token. /// /// An that can be used to read this token and its descendants. public JsonReader CreateReader() { return new JTokenReader(this); } internal static JToken FromObjectInternal(object o, JsonSerializer jsonSerializer) { ValidationUtils.ArgumentNotNull(o, "o"); ValidationUtils.ArgumentNotNull(jsonSerializer, "jsonSerializer"); JToken token; using (JTokenWriter jsonWriter = new JTokenWriter()) { jsonSerializer.Serialize(jsonWriter, o); token = jsonWriter.Token; } return token; } /// /// Creates a from an object. /// /// The object that will be used to create . /// A with the value of the specified object public static JToken FromObject(object o) { return FromObjectInternal(o, new JsonSerializer()); } /// /// Creates a from an object using the specified . /// /// The object that will be used to create . /// The that will be used when reading the object. /// A with the value of the specified object public static JToken FromObject(object o, JsonSerializer jsonSerializer) { return FromObjectInternal(o, jsonSerializer); } /// /// Creates the specified .NET type from the . /// /// The object type that the token will be deserialized to. /// The new object created from the JSON value. public T ToObject() { return ToObject(new JsonSerializer()); } /// /// Creates the specified .NET type from the using the specified . /// /// The object type that the token will be deserialized to. /// The that will be used when creating the object. /// The new object created from the JSON value. public T ToObject(JsonSerializer jsonSerializer) { ValidationUtils.ArgumentNotNull(jsonSerializer, "jsonSerializer"); using (JTokenReader jsonReader = new JTokenReader(this)) { return jsonSerializer.Deserialize(jsonReader); } } /// /// Creates a from a . /// /// An positioned at the token to read into this . /// /// An that contains the token and its descendant tokens /// that were read from the reader. The runtime type of the token is determined /// by the token type of the first token encountered in the reader. /// public static JToken ReadFrom(JsonReader reader) { ValidationUtils.ArgumentNotNull(reader, "reader"); if (reader.TokenType == JsonToken.None) { if (!reader.Read()) throw JsonReaderException.Create(reader, "Error reading JToken from JsonReader."); } if (reader.TokenType == JsonToken.StartObject) return JObject.Load(reader); if (reader.TokenType == JsonToken.StartArray) return JArray.Load(reader); if (reader.TokenType == JsonToken.PropertyName) return JProperty.Load(reader); if (reader.TokenType == JsonToken.StartConstructor) return JConstructor.Load(reader); if (!JsonReader.IsStartToken(reader.TokenType)) return new JValue(reader.Value); throw JsonReaderException.Create(reader, "Error reading JToken from JsonReader. Unexpected token: {0}".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); } /// /// Load a from a string that contains JSON. /// /// A that contains JSON. /// A populated from the string that contains JSON. public static JToken Parse(string json) { JsonReader reader = new JsonTextReader(new StringReader(json)); JToken t = Load(reader); if (reader.Read() && reader.TokenType != JsonToken.Comment) throw JsonReaderException.Create(reader, "Additional text found in JSON string after parsing content."); return t; } /// /// Creates a from a . /// /// An positioned at the token to read into this . /// /// An that contains the token and its descendant tokens /// that were read from the reader. The runtime type of the token is determined /// by the token type of the first token encountered in the reader. /// public static JToken Load(JsonReader reader) { return ReadFrom(reader); } internal void SetLineInfo(IJsonLineInfo lineInfo) { if (lineInfo == null || !lineInfo.HasLineInfo()) return; SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition); } internal void SetLineInfo(int lineNumber, int linePosition) { _lineNumber = lineNumber; _linePosition = linePosition; } bool IJsonLineInfo.HasLineInfo() { return (_lineNumber != null && _linePosition != null); } int IJsonLineInfo.LineNumber { get { return _lineNumber ?? 0; } } int IJsonLineInfo.LinePosition { get { return _linePosition ?? 0; } } /// /// Selects the token that matches the object path. /// /// /// The object path from the current to the /// to be returned. This must be a string of property names or array indexes separated /// by periods, such as Tables[0].DefaultView[0].Price in C# or /// Tables(0).DefaultView(0).Price in Visual Basic. /// /// The that matches the object path or a null reference if no matching token is found. public JToken SelectToken(string path) { return SelectToken(path, false); } /// /// Selects the token that matches the object path. /// /// /// The object path from the current to the /// to be returned. This must be a string of property names or array indexes separated /// by periods, such as Tables[0].DefaultView[0].Price in C# or /// Tables(0).DefaultView(0).Price in Visual Basic. /// /// A flag to indicate whether an error should be thrown if no token is found. /// The that matches the object path. public JToken SelectToken(string path, bool errorWhenNoMatch) { JPath p = new JPath(path); return p.Evaluate(this, errorWhenNoMatch); } #if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE) /// /// Returns the responsible for binding operations performed on this object. /// /// The expression tree representation of the runtime value. /// /// The to bind this object. /// protected virtual DynamicMetaObject GetMetaObject(Expression parameter) { return new DynamicProxyMetaObject(parameter, this, new DynamicProxy(), true); } /// /// Returns the responsible for binding operations performed on this object. /// /// The expression tree representation of the runtime value. /// /// The to bind this object. /// DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject(Expression parameter) { return GetMetaObject(parameter); } #endif #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) object ICloneable.Clone() { return DeepClone(); } #endif /// /// Creates a new instance of the . All child tokens are recursively cloned. /// /// A new instance of the . public JToken DeepClone() { return CloneToken(); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JEnumerable.cs0000644000175000017500000000773612253423361026470 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections.Generic; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif using Newtonsoft.Json.Utilities; using System.Collections; namespace Newtonsoft.Json.Linq { /// /// Represents a collection of objects. /// /// The type of token public struct JEnumerable : IJEnumerable where T : JToken { /// /// An empty collection of objects. /// public static readonly JEnumerable Empty = new JEnumerable(Enumerable.Empty()); private readonly IEnumerable _enumerable; /// /// Initializes a new instance of the struct. /// /// The enumerable. public JEnumerable(IEnumerable enumerable) { ValidationUtils.ArgumentNotNull(enumerable, "enumerable"); _enumerable = enumerable; } /// /// Returns an enumerator that iterates through the collection. /// /// /// A that can be used to iterate through the collection. /// public IEnumerator GetEnumerator() { return _enumerable.GetEnumerator(); } /// /// Returns an enumerator that iterates through a collection. /// /// /// An object that can be used to iterate through the collection. /// IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } /// /// Gets the with the specified key. /// /// public IJEnumerable this[object key] { get { return new JEnumerable(Extensions.Values(_enumerable, key)); } } /// /// Determines whether the specified is equal to this instance. /// /// The to compare with this instance. /// /// true if the specified is equal to this instance; otherwise, false. /// public override bool Equals(object obj) { if (obj is JEnumerable) return _enumerable.Equals(((JEnumerable)obj)._enumerable); return false; } /// /// Returns a hash code for this instance. /// /// /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// public override int GetHashCode() { return _enumerable.GetHashCode(); } } } smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JProperty.cs0000644000175000017500000001666412253423361026235 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using Newtonsoft.Json.Utilities; using System.Diagnostics; using System.Globalization; namespace Newtonsoft.Json.Linq { /// /// Represents a JSON property. /// public class JProperty : JContainer { private readonly List _content = new List(); private readonly string _name; /// /// Gets the container's children tokens. /// /// The container's children tokens. protected override IList ChildrenTokens { get { return _content; } } /// /// Gets the property name. /// /// The property name. public string Name { [DebuggerStepThrough] get { return _name; } } /// /// Gets or sets the property value. /// /// The property value. public JToken Value { [DebuggerStepThrough] get { return (ChildrenTokens.Count > 0) ? ChildrenTokens[0] : null; } set { CheckReentrancy(); JToken newValue = value ?? new JValue((object) null); if (ChildrenTokens.Count == 0) { InsertItem(0, newValue, false); } else { SetItem(0, newValue); } } } /// /// Initializes a new instance of the class from another object. /// /// A object to copy from. public JProperty(JProperty other) : base(other) { _name = other.Name; } internal override JToken GetItem(int index) { if (index != 0) throw new ArgumentOutOfRangeException(); return Value; } internal override void SetItem(int index, JToken item) { if (index != 0) throw new ArgumentOutOfRangeException(); if (IsTokenUnchanged(Value, item)) return; if (Parent != null) ((JObject)Parent).InternalPropertyChanging(this); base.SetItem(0, item); if (Parent != null) ((JObject)Parent).InternalPropertyChanged(this); } internal override bool RemoveItem(JToken item) { throw new JsonException("Cannot add or remove items from {0}.".FormatWith(CultureInfo.InvariantCulture, typeof(JProperty))); } internal override void RemoveItemAt(int index) { throw new JsonException("Cannot add or remove items from {0}.".FormatWith(CultureInfo.InvariantCulture, typeof(JProperty))); } internal override void InsertItem(int index, JToken item, bool skipParentCheck) { if (Value != null) throw new JsonException("{0} cannot have multiple values.".FormatWith(CultureInfo.InvariantCulture, typeof(JProperty))); base.InsertItem(0, item, false); } internal override bool ContainsItem(JToken item) { return (Value == item); } internal override void ClearItems() { throw new JsonException("Cannot add or remove items from {0}.".FormatWith(CultureInfo.InvariantCulture, typeof(JProperty))); } internal override bool DeepEquals(JToken node) { JProperty t = node as JProperty; return (t != null && _name == t.Name && ContentsEqual(t)); } internal override JToken CloneToken() { return new JProperty(this); } /// /// Gets the node type for this . /// /// The type. public override JTokenType Type { [DebuggerStepThrough] get { return JTokenType.Property; } } internal JProperty(string name) { // called from JTokenWriter ValidationUtils.ArgumentNotNull(name, "name"); _name = name; } /// /// Initializes a new instance of the class. /// /// The property name. /// The property content. public JProperty(string name, params object[] content) : this(name, (object)content) { } /// /// Initializes a new instance of the class. /// /// The property name. /// The property content. public JProperty(string name, object content) { ValidationUtils.ArgumentNotNull(name, "name"); _name = name; Value = IsMultiContent(content) ? new JArray(content) : CreateFromContent(content); } /// /// Writes this token to a . /// /// A into which this method will write. /// A collection of which will be used when writing the token. public override void WriteTo(JsonWriter writer, params JsonConverter[] converters) { writer.WritePropertyName(_name); Value.WriteTo(writer, converters); } internal override int GetDeepHashCode() { return _name.GetHashCode() ^ ((Value != null) ? Value.GetDeepHashCode() : 0); } /// /// Loads an from a . /// /// A that will be read for the content of the . /// A that contains the JSON that was read from the specified . public static new JProperty Load(JsonReader reader) { if (reader.TokenType == JsonToken.None) { if (!reader.Read()) throw JsonReaderException.Create(reader, "Error reading JProperty from JsonReader."); } while (reader.TokenType == JsonToken.Comment) { reader.Read(); } if (reader.TokenType != JsonToken.PropertyName) throw JsonReaderException.Create(reader, "Error reading JProperty from JsonReader. Current JsonReader item is not a property: {0}".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); JProperty p = new JProperty((string)reader.Value); p.SetLineInfo(reader as IJsonLineInfo); p.ReadTokenFrom(reader); return p; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JContainer.cs0000644000175000017500000006357512253423361026336 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; #if !PORTABLE using System.Collections.Specialized; #endif using System.Threading; using Newtonsoft.Json.Utilities; using System.Collections; using System.Globalization; using System.ComponentModel; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Linq { /// /// Represents a token that can contain other tokens. /// public abstract class JContainer : JToken, IList #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) , ITypedList, IBindingList #elif !PORTABLE , INotifyCollectionChanged #endif , IList #if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE) , INotifyCollectionChanged #endif { #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) /// /// Occurs when the list changes or an item in the list changes. /// public event ListChangedEventHandler ListChanged; /// /// Occurs before an item is added to the collection. /// public event AddingNewEventHandler AddingNew; #endif #if SILVERLIGHT || !(NET20 || NET35 || PORTABLE) /// /// Occurs when the items list of the collection has changed, or the collection is reset. /// public event NotifyCollectionChangedEventHandler CollectionChanged; #endif /// /// Gets the container's children tokens. /// /// The container's children tokens. protected abstract IList ChildrenTokens { get; } private object _syncRoot; private bool _busy; internal JContainer() { } internal JContainer(JContainer other) { ValidationUtils.ArgumentNotNull(other, "c"); foreach (JToken child in other) { Add(child); } } internal void CheckReentrancy() { if (_busy) throw new InvalidOperationException("Cannot change {0} during a collection change event.".FormatWith(CultureInfo.InvariantCulture, GetType())); } #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) /// /// Raises the event. /// /// The instance containing the event data. protected virtual void OnAddingNew(AddingNewEventArgs e) { AddingNewEventHandler handler = AddingNew; if (handler != null) handler(this, e); } /// /// Raises the event. /// /// The instance containing the event data. protected virtual void OnListChanged(ListChangedEventArgs e) { ListChangedEventHandler handler = ListChanged; if (handler != null) { _busy = true; try { handler(this, e); } finally { _busy = false; } } } #endif #if SILVERLIGHT || !(NET20 || NET35 || PORTABLE) /// /// Raises the event. /// /// The instance containing the event data. protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { NotifyCollectionChangedEventHandler handler = CollectionChanged; if (handler != null) { _busy = true; try { handler(this, e); } finally { _busy = false; } } } #endif /// /// Gets a value indicating whether this token has childen tokens. /// /// /// true if this token has child values; otherwise, false. /// public override bool HasValues { get { return ChildrenTokens.Count > 0; } } internal bool ContentsEqual(JContainer container) { if (container == this) return true; IList t1 = ChildrenTokens; IList t2 = container.ChildrenTokens; if (t1.Count != t2.Count) return false; for (int i = 0; i < t1.Count; i++) { if (!t1[i].DeepEquals(t2[i])) return false; } return true; } /// /// Get the first child token of this token. /// /// /// A containing the first child token of the . /// public override JToken First { get { return ChildrenTokens.FirstOrDefault(); } } /// /// Get the last child token of this token. /// /// /// A containing the last child token of the . /// public override JToken Last { get { return ChildrenTokens.LastOrDefault(); } } /// /// Returns a collection of the child tokens of this token, in document order. /// /// /// An of containing the child tokens of this , in document order. /// public override JEnumerable Children() { return new JEnumerable(ChildrenTokens); } /// /// Returns a collection of the child values of this token, in document order. /// /// The type to convert the values to. /// /// A containing the child values of this , in document order. /// public override IEnumerable Values() { return ChildrenTokens.Convert(); } /// /// Returns a collection of the descendant tokens for this token in document order. /// /// An containing the descendant tokens of the . public IEnumerable Descendants() { foreach (JToken o in ChildrenTokens) { yield return o; JContainer c = o as JContainer; if (c != null) { foreach (JToken d in c.Descendants()) { yield return d; } } } } internal bool IsMultiContent(object content) { return (content is IEnumerable && !(content is string) && !(content is JToken) && !(content is byte[])); } internal JToken EnsureParentToken(JToken item, bool skipParentCheck) { if (item == null) return new JValue((object) null); if (skipParentCheck) return item; // to avoid a token having multiple parents or creating a recursive loop, create a copy if... // the item already has a parent // the item is being added to itself // the item is being added to the root parent of itself if (item.Parent != null || item == this || (item.HasValues && Root == item)) item = item.CloneToken(); return item; } private class JTokenReferenceEqualityComparer : IEqualityComparer { public static readonly JTokenReferenceEqualityComparer Instance = new JTokenReferenceEqualityComparer(); public bool Equals(JToken x, JToken y) { return ReferenceEquals(x, y); } public int GetHashCode(JToken obj) { if (obj == null) return 0; return obj.GetHashCode(); } } internal int IndexOfItem(JToken item) { return ChildrenTokens.IndexOf(item, JTokenReferenceEqualityComparer.Instance); } internal virtual void InsertItem(int index, JToken item, bool skipParentCheck) { if (index > ChildrenTokens.Count) throw new ArgumentOutOfRangeException("index", "Index must be within the bounds of the List."); CheckReentrancy(); item = EnsureParentToken(item, skipParentCheck); JToken previous = (index == 0) ? null : ChildrenTokens[index - 1]; // haven't inserted new token yet so next token is still at the inserting index JToken next = (index == ChildrenTokens.Count) ? null : ChildrenTokens[index]; ValidateToken(item, null); item.Parent = this; item.Previous = previous; if (previous != null) previous.Next = item; item.Next = next; if (next != null) next.Previous = item; ChildrenTokens.Insert(index, item); #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) if (ListChanged != null) OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index)); #endif #if SILVERLIGHT || !(NET20 || NET35 || PORTABLE) if (CollectionChanged != null) OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index)); #endif } internal virtual void RemoveItemAt(int index) { if (index < 0) throw new ArgumentOutOfRangeException("index", "Index is less than 0."); if (index >= ChildrenTokens.Count) throw new ArgumentOutOfRangeException("index", "Index is equal to or greater than Count."); CheckReentrancy(); JToken item = ChildrenTokens[index]; JToken previous = (index == 0) ? null : ChildrenTokens[index - 1]; JToken next = (index == ChildrenTokens.Count - 1) ? null : ChildrenTokens[index + 1]; if (previous != null) previous.Next = next; if (next != null) next.Previous = previous; item.Parent = null; item.Previous = null; item.Next = null; ChildrenTokens.RemoveAt(index); #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index)); #endif #if SILVERLIGHT || !(NET20 || NET35 || PORTABLE) OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item, index)); #endif } internal virtual bool RemoveItem(JToken item) { int index = IndexOfItem(item); if (index >= 0) { RemoveItemAt(index); return true; } return false; } internal virtual JToken GetItem(int index) { return ChildrenTokens[index]; } internal virtual void SetItem(int index, JToken item) { if (index < 0) throw new ArgumentOutOfRangeException("index", "Index is less than 0."); if (index >= ChildrenTokens.Count) throw new ArgumentOutOfRangeException("index", "Index is equal to or greater than Count."); JToken existing = ChildrenTokens[index]; if (IsTokenUnchanged(existing, item)) return; CheckReentrancy(); item = EnsureParentToken(item, false); ValidateToken(item, existing); JToken previous = (index == 0) ? null : ChildrenTokens[index - 1]; JToken next = (index == ChildrenTokens.Count - 1) ? null : ChildrenTokens[index + 1]; item.Parent = this; item.Previous = previous; if (previous != null) previous.Next = item; item.Next = next; if (next != null) next.Previous = item; ChildrenTokens[index] = item; existing.Parent = null; existing.Previous = null; existing.Next = null; #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index)); #endif #if SILVERLIGHT || !(NET20 || NET35 || PORTABLE) OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, item, existing, index)); #endif } internal virtual void ClearItems() { CheckReentrancy(); foreach (JToken item in ChildrenTokens) { item.Parent = null; item.Previous = null; item.Next = null; } ChildrenTokens.Clear(); #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1)); #endif #if SILVERLIGHT || !(NET20 || NET35 || PORTABLE) OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); #endif } internal virtual void ReplaceItem(JToken existing, JToken replacement) { if (existing == null || existing.Parent != this) return; int index = IndexOfItem(existing); SetItem(index, replacement); } internal virtual bool ContainsItem(JToken item) { return (IndexOfItem(item) != -1); } internal virtual void CopyItemsTo(Array array, int arrayIndex) { if (array == null) throw new ArgumentNullException("array"); if (arrayIndex < 0) throw new ArgumentOutOfRangeException("arrayIndex", "arrayIndex is less than 0."); if (arrayIndex >= array.Length) throw new ArgumentException("arrayIndex is equal to or greater than the length of array."); if (Count > array.Length - arrayIndex) throw new ArgumentException("The number of elements in the source JObject is greater than the available space from arrayIndex to the end of the destination array."); int index = 0; foreach (JToken token in ChildrenTokens) { array.SetValue(token, arrayIndex + index); index++; } } internal static bool IsTokenUnchanged(JToken currentValue, JToken newValue) { JValue v1 = currentValue as JValue; if (v1 != null) { // null will get turned into a JValue of type null if (v1.Type == JTokenType.Null && newValue == null) return true; return v1.Equals(newValue); } return false; } internal virtual void ValidateToken(JToken o, JToken existing) { ValidationUtils.ArgumentNotNull(o, "o"); if (o.Type == JTokenType.Property) throw new ArgumentException("Can not add {0} to {1}.".FormatWith(CultureInfo.InvariantCulture, o.GetType(), GetType())); } /// /// Adds the specified content as children of this . /// /// The content to be added. public virtual void Add(object content) { AddInternal(ChildrenTokens.Count, content, false); } internal void AddAndSkipParentCheck(JToken token) { AddInternal(ChildrenTokens.Count, token, true); } /// /// Adds the specified content as the first children of this . /// /// The content to be added. public void AddFirst(object content) { AddInternal(0, content, false); } internal void AddInternal(int index, object content, bool skipParentCheck) { if (IsMultiContent(content)) { IEnumerable enumerable = (IEnumerable)content; int multiIndex = index; foreach (object c in enumerable) { AddInternal(multiIndex, c, skipParentCheck); multiIndex++; } } else { JToken item = CreateFromContent(content); InsertItem(index, item, skipParentCheck); } } internal JToken CreateFromContent(object content) { if (content is JToken) return (JToken)content; return new JValue(content); } /// /// Creates an that can be used to add tokens to the . /// /// An that is ready to have content written to it. public JsonWriter CreateWriter() { return new JTokenWriter(this); } /// /// Replaces the children nodes of this token with the specified content. /// /// The content. public void ReplaceAll(object content) { ClearItems(); Add(content); } /// /// Removes the child nodes from this token. /// public void RemoveAll() { ClearItems(); } internal void ReadTokenFrom(JsonReader reader) { int startDepth = reader.Depth; if (!reader.Read()) throw JsonReaderException.Create(reader, "Error reading {0} from JsonReader.".FormatWith(CultureInfo.InvariantCulture, GetType().Name)); ReadContentFrom(reader); int endDepth = reader.Depth; if (endDepth > startDepth) throw JsonReaderException.Create(reader, "Unexpected end of content while loading {0}.".FormatWith(CultureInfo.InvariantCulture, GetType().Name)); } internal void ReadContentFrom(JsonReader r) { ValidationUtils.ArgumentNotNull(r, "r"); IJsonLineInfo lineInfo = r as IJsonLineInfo; JContainer parent = this; do { if (parent is JProperty && ((JProperty)parent).Value != null) { if (parent == this) return; parent = parent.Parent; } switch (r.TokenType) { case JsonToken.None: // new reader. move to actual content break; case JsonToken.StartArray: JArray a = new JArray(); a.SetLineInfo(lineInfo); parent.Add(a); parent = a; break; case JsonToken.EndArray: if (parent == this) return; parent = parent.Parent; break; case JsonToken.StartObject: JObject o = new JObject(); o.SetLineInfo(lineInfo); parent.Add(o); parent = o; break; case JsonToken.EndObject: if (parent == this) return; parent = parent.Parent; break; case JsonToken.StartConstructor: JConstructor constructor = new JConstructor(r.Value.ToString()); constructor.SetLineInfo(constructor); parent.Add(constructor); parent = constructor; break; case JsonToken.EndConstructor: if (parent == this) return; parent = parent.Parent; break; case JsonToken.String: case JsonToken.Integer: case JsonToken.Float: case JsonToken.Date: case JsonToken.Boolean: case JsonToken.Bytes: JValue v = new JValue(r.Value); v.SetLineInfo(lineInfo); parent.Add(v); break; case JsonToken.Comment: v = JValue.CreateComment(r.Value.ToString()); v.SetLineInfo(lineInfo); parent.Add(v); break; case JsonToken.Null: v = new JValue(null, JTokenType.Null); v.SetLineInfo(lineInfo); parent.Add(v); break; case JsonToken.Undefined: v = new JValue(null, JTokenType.Undefined); v.SetLineInfo(lineInfo); parent.Add(v); break; case JsonToken.PropertyName: string propertyName = r.Value.ToString(); JProperty property = new JProperty(propertyName); property.SetLineInfo(lineInfo); JObject parentObject = (JObject) parent; // handle multiple properties with the same name in JSON JProperty existingPropertyWithName = parentObject.Property(propertyName); if (existingPropertyWithName == null) parent.Add(property); else existingPropertyWithName.Replace(property); parent = property; break; default: throw new InvalidOperationException("The JsonReader should not be on a token of type {0}.".FormatWith(CultureInfo.InvariantCulture, r.TokenType)); } } while (r.Read()); } internal int ContentsHashCode() { int hashCode = 0; foreach (JToken item in ChildrenTokens) { hashCode ^= item.GetDeepHashCode(); } return hashCode; } #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) string ITypedList.GetListName(PropertyDescriptor[] listAccessors) { return string.Empty; } PropertyDescriptorCollection ITypedList.GetItemProperties(PropertyDescriptor[] listAccessors) { ICustomTypeDescriptor d = First as ICustomTypeDescriptor; if (d != null) return d.GetProperties(); return null; } #endif #region IList Members int IList.IndexOf(JToken item) { return IndexOfItem(item); } void IList.Insert(int index, JToken item) { InsertItem(index, item, false); } void IList.RemoveAt(int index) { RemoveItemAt(index); } JToken IList.this[int index] { get { return GetItem(index); } set { SetItem(index, value); } } #endregion #region ICollection Members void ICollection.Add(JToken item) { Add(item); } void ICollection.Clear() { ClearItems(); } bool ICollection.Contains(JToken item) { return ContainsItem(item); } void ICollection.CopyTo(JToken[] array, int arrayIndex) { CopyItemsTo(array, arrayIndex); } bool ICollection.IsReadOnly { get { return false; } } bool ICollection.Remove(JToken item) { return RemoveItem(item); } #endregion private JToken EnsureValue(object value) { if (value == null) return null; if (value is JToken) return (JToken) value; throw new ArgumentException("Argument is not a JToken."); } #region IList Members int IList.Add(object value) { Add(EnsureValue(value)); return Count - 1; } void IList.Clear() { ClearItems(); } bool IList.Contains(object value) { return ContainsItem(EnsureValue(value)); } int IList.IndexOf(object value) { return IndexOfItem(EnsureValue(value)); } void IList.Insert(int index, object value) { InsertItem(index, EnsureValue(value), false); } bool IList.IsFixedSize { get { return false; } } bool IList.IsReadOnly { get { return false; } } void IList.Remove(object value) { RemoveItem(EnsureValue(value)); } void IList.RemoveAt(int index) { RemoveItemAt(index); } object IList.this[int index] { get { return GetItem(index); } set { SetItem(index, EnsureValue(value)); } } #endregion #region ICollection Members void ICollection.CopyTo(Array array, int index) { CopyItemsTo(array, index); } /// /// Gets the count of child JSON tokens. /// /// The count of child JSON tokens public int Count { get { return ChildrenTokens.Count; } } bool ICollection.IsSynchronized { get { return false; } } object ICollection.SyncRoot { get { if (_syncRoot == null) Interlocked.CompareExchange(ref _syncRoot, new object(), null); return _syncRoot; } } #endregion #region IBindingList Members #if !(SILVERLIGHT || NETFX_CORE || PORTABLE) void IBindingList.AddIndex(PropertyDescriptor property) { } object IBindingList.AddNew() { AddingNewEventArgs args = new AddingNewEventArgs(); OnAddingNew(args); if (args.NewObject == null) throw new JsonException("Could not determine new value to add to '{0}'.".FormatWith(CultureInfo.InvariantCulture, GetType())); if (!(args.NewObject is JToken)) throw new JsonException("New item to be added to collection must be compatible with {0}.".FormatWith(CultureInfo.InvariantCulture, typeof(JToken))); JToken newItem = (JToken)args.NewObject; Add(newItem); return newItem; } bool IBindingList.AllowEdit { get { return true; } } bool IBindingList.AllowNew { get { return true; } } bool IBindingList.AllowRemove { get { return true; } } void IBindingList.ApplySort(PropertyDescriptor property, ListSortDirection direction) { throw new NotSupportedException(); } int IBindingList.Find(PropertyDescriptor property, object key) { throw new NotSupportedException(); } bool IBindingList.IsSorted { get { return false; } } void IBindingList.RemoveIndex(PropertyDescriptor property) { } void IBindingList.RemoveSort() { throw new NotSupportedException(); } ListSortDirection IBindingList.SortDirection { get { return ListSortDirection.Ascending; } } PropertyDescriptor IBindingList.SortProperty { get { return null; } } bool IBindingList.SupportsChangeNotification { get { return true; } } bool IBindingList.SupportsSearching { get { return false; } } bool IBindingList.SupportsSorting { get { return false; } } #endif #endregion } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JRaw.cs0000644000175000017500000000475612253423361025141 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Globalization; using System.IO; namespace Newtonsoft.Json.Linq { /// /// Represents a raw JSON string. /// public class JRaw : JValue { /// /// Initializes a new instance of the class from another object. /// /// A object to copy from. public JRaw(JRaw other) : base(other) { } /// /// Initializes a new instance of the class. /// /// The raw json. public JRaw(object rawJson) : base(rawJson, JTokenType.Raw) { } /// /// Creates an instance of with the content of the reader's current token. /// /// The reader. /// An instance of with the content of the reader's current token. public static JRaw Create(JsonReader reader) { using (StringWriter sw = new StringWriter(CultureInfo.InvariantCulture)) using (JsonTextWriter jsonWriter = new JsonTextWriter(sw)) { jsonWriter.WriteToken(reader); return new JRaw(sw.ToString()); } } internal override JToken CloneToken() { return new JRaw(this); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenEqualityComparer.cs0000644000175000017500000000456412253423361030674 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections.Generic; namespace Newtonsoft.Json.Linq { /// /// Compares tokens to determine whether they are equal. /// public class JTokenEqualityComparer : IEqualityComparer { /// /// Determines whether the specified objects are equal. /// /// The first object of type to compare. /// The second object of type to compare. /// /// true if the specified objects are equal; otherwise, false. /// public bool Equals(JToken x, JToken y) { return JToken.DeepEquals(x, y); } /// /// Returns a hash code for the specified object. /// /// The for which a hash code is to be returned. /// A hash code for the specified object. /// The type of is a reference type and is null. public int GetHashCode(JToken obj) { if (obj == null) return 0; return obj.GetDeepHashCode(); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/Extensions.cs0000644000175000017500000003106612253423361026427 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using Newtonsoft.Json.Utilities; using System.Globalization; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif namespace Newtonsoft.Json.Linq { /// /// Contains the LINQ to JSON extension methods. /// public static class Extensions { /// /// Returns a collection of tokens that contains the ancestors of every token in the source collection. /// /// The type of the objects in source, constrained to . /// An of that contains the source collection. /// An of that contains the ancestors of every node in the source collection. public static IJEnumerable Ancestors(this IEnumerable source) where T : JToken { ValidationUtils.ArgumentNotNull(source, "source"); return source.SelectMany(j => j.Ancestors()).AsJEnumerable(); } //TODO //public static IEnumerable AncestorsAndSelf(this IEnumerable source) where T : JObject //{ // ValidationUtils.ArgumentNotNull(source, "source"); // return source.SelectMany(j => j.AncestorsAndSelf()); //} /// /// Returns a collection of tokens that contains the descendants of every token in the source collection. /// /// The type of the objects in source, constrained to . /// An of that contains the source collection. /// An of that contains the descendants of every node in the source collection. public static IJEnumerable Descendants(this IEnumerable source) where T : JContainer { ValidationUtils.ArgumentNotNull(source, "source"); return source.SelectMany(j => j.Descendants()).AsJEnumerable(); } //TODO //public static IEnumerable DescendantsAndSelf(this IEnumerable source) where T : JContainer //{ // ValidationUtils.ArgumentNotNull(source, "source"); // return source.SelectMany(j => j.DescendantsAndSelf()); //} /// /// Returns a collection of child properties of every object in the source collection. /// /// An of that contains the source collection. /// An of that contains the properties of every object in the source collection. public static IJEnumerable Properties(this IEnumerable source) { ValidationUtils.ArgumentNotNull(source, "source"); return source.SelectMany(d => d.Properties()).AsJEnumerable(); } /// /// Returns a collection of child values of every object in the source collection with the given key. /// /// An of that contains the source collection. /// The token key. /// An of that contains the values of every node in the source collection with the given key. public static IJEnumerable Values(this IEnumerable source, object key) { return Values(source, key).AsJEnumerable(); } /// /// Returns a collection of child values of every object in the source collection. /// /// An of that contains the source collection. /// An of that contains the values of every node in the source collection. public static IJEnumerable Values(this IEnumerable source) { return source.Values(null); } /// /// Returns a collection of converted child values of every object in the source collection with the given key. /// /// The type to convert the values to. /// An of that contains the source collection. /// The token key. /// An that contains the converted values of every node in the source collection with the given key. public static IEnumerable Values(this IEnumerable source, object key) { return Values(source, key); } /// /// Returns a collection of converted child values of every object in the source collection. /// /// The type to convert the values to. /// An of that contains the source collection. /// An that contains the converted values of every node in the source collection. public static IEnumerable Values(this IEnumerable source) { return Values(source, null); } /// /// Converts the value. /// /// The type to convert the value to. /// A cast as a of . /// A converted value. public static U Value(this IEnumerable value) { return value.Value(); } /// /// Converts the value. /// /// The source collection type. /// The type to convert the value to. /// A cast as a of . /// A converted value. public static U Value(this IEnumerable value) where T : JToken { ValidationUtils.ArgumentNotNull(value, "source"); JToken token = value as JToken; if (token == null) throw new ArgumentException("Source value must be a JToken."); return token.Convert(); } internal static IEnumerable Values(this IEnumerable source, object key) where T : JToken { ValidationUtils.ArgumentNotNull(source, "source"); foreach (JToken token in source) { if (key == null) { if (token is JValue) { yield return Convert((JValue)token); } else { foreach (JToken t in token.Children()) { yield return t.Convert(); } } } else { JToken value = token[key]; if (value != null) yield return value.Convert(); } } yield break; } //TODO //public static IEnumerable InDocumentOrder(this IEnumerable source) where T : JObject; //public static IEnumerable Children(this IEnumerable source) where T : JToken //{ // ValidationUtils.ArgumentNotNull(source, "source"); // return source.SelectMany(c => c.Children()); //} /// /// Returns a collection of child tokens of every array in the source collection. /// /// The source collection type. /// An of that contains the source collection. /// An of that contains the values of every node in the source collection. public static IJEnumerable Children(this IEnumerable source) where T : JToken { return Children(source).AsJEnumerable(); } /// /// Returns a collection of converted child tokens of every array in the source collection. /// /// An of that contains the source collection. /// The type to convert the values to. /// The source collection type. /// An that contains the converted values of every node in the source collection. public static IEnumerable Children(this IEnumerable source) where T : JToken { ValidationUtils.ArgumentNotNull(source, "source"); return source.SelectMany(c => c.Children()).Convert(); } internal static IEnumerable Convert(this IEnumerable source) where T : JToken { ValidationUtils.ArgumentNotNull(source, "source"); foreach (T token in source) { yield return Convert(token); } } internal static U Convert(this T token) where T : JToken { if (token == null) return default(U); if (token is U // don't want to cast JValue to its interfaces, want to get the internal value && typeof(U) != typeof(IComparable) && typeof(U) != typeof(IFormattable)) { // HACK return (U)(object)token; } else { JValue value = token as JValue; if (value == null) throw new InvalidCastException("Cannot cast {0} to {1}.".FormatWith(CultureInfo.InvariantCulture, token.GetType(), typeof(T))); if (value.Value is U) return (U)value.Value; Type targetType = typeof(U); if (ReflectionUtils.IsNullableType(targetType)) { if (value.Value == null) return default(U); targetType = Nullable.GetUnderlyingType(targetType); } return (U)System.Convert.ChangeType(value.Value, targetType, CultureInfo.InvariantCulture); } } //TODO //public static void Remove(this IEnumerable source) where T : JContainer; /// /// Returns the input typed as . /// /// An of that contains the source collection. /// The input typed as . public static IJEnumerable AsJEnumerable(this IEnumerable source) { return source.AsJEnumerable(); } /// /// Returns the input typed as . /// /// The source collection type. /// An of that contains the source collection. /// The input typed as . public static IJEnumerable AsJEnumerable(this IEnumerable source) where T : JToken { if (source == null) return null; else if (source is IJEnumerable) return (IJEnumerable)source; else return new JEnumerable(source); } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JPropertyKeyedCollection.cs0000644000175000017500000001270012253423361031216 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Collections.ObjectModel; namespace Newtonsoft.Json.Linq { internal class JPropertyKeyedCollection : Collection { private static readonly IEqualityComparer Comparer = StringComparer.Ordinal; private Dictionary _dictionary; private void AddKey(string key, JToken item) { EnsureDictionary(); _dictionary[key] = item; } protected void ChangeItemKey(JToken item, string newKey) { if (!ContainsItem(item)) throw new ArgumentException("The specified item does not exist in this KeyedCollection."); string keyForItem = GetKeyForItem(item); if (!Comparer.Equals(keyForItem, newKey)) { if (newKey != null) AddKey(newKey, item); if (keyForItem != null) RemoveKey(keyForItem); } } protected override void ClearItems() { base.ClearItems(); if (_dictionary != null) _dictionary.Clear(); } public bool Contains(string key) { if (key == null) throw new ArgumentNullException("key"); if (_dictionary != null) return _dictionary.ContainsKey(key); return false; } private bool ContainsItem(JToken item) { if (_dictionary == null) return false; string key = GetKeyForItem(item); JToken value; return _dictionary.TryGetValue(key, out value); } private void EnsureDictionary() { if (_dictionary == null) _dictionary = new Dictionary(Comparer); } private string GetKeyForItem(JToken item) { return ((JProperty)item).Name; } protected override void InsertItem(int index, JToken item) { AddKey(GetKeyForItem(item), item); base.InsertItem(index, item); } public bool Remove(string key) { if (key == null) throw new ArgumentNullException("key"); if (_dictionary != null) return _dictionary.ContainsKey(key) && Remove(_dictionary[key]); return false; } protected override void RemoveItem(int index) { string keyForItem = GetKeyForItem(Items[index]); RemoveKey(keyForItem); base.RemoveItem(index); } private void RemoveKey(string key) { if (_dictionary != null) _dictionary.Remove(key); } protected override void SetItem(int index, JToken item) { string keyForItem = GetKeyForItem(item); string keyAtIndex = GetKeyForItem(Items[index]); if (Comparer.Equals(keyAtIndex, keyForItem)) { if (_dictionary != null) _dictionary[keyForItem] = item; } else { AddKey(keyForItem, item); if (keyAtIndex != null) RemoveKey(keyAtIndex); } base.SetItem(index, item); } public JToken this[string key] { get { if (key == null) throw new ArgumentNullException("key"); if (_dictionary != null) return _dictionary[key]; throw new KeyNotFoundException(); } } public bool TryGetValue(string key, out JToken value) { if (_dictionary == null) { value = null; return false; } return _dictionary.TryGetValue(key, out value); } public ICollection Keys { get { EnsureDictionary(); return _dictionary.Keys; } } public ICollection Values { get { EnsureDictionary(); return _dictionary.Values; } } public bool Compare(JPropertyKeyedCollection other) { if (this == other) return true; // dictionaries in JavaScript aren't ordered // ignore order when comparing properties Dictionary d1 = _dictionary; Dictionary d2 = other._dictionary; if (d1.Count != d2.Count) return false; foreach (KeyValuePair keyAndProperty in d1) { JToken secondValue; if (!d2.TryGetValue(keyAndProperty.Key, out secondValue)) return false; JProperty p1 = (JProperty)keyAndProperty.Value; JProperty p2 = (JProperty)secondValue; if (!p1.Value.DeepEquals(p2.Value)) return false; } return true; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JConstructor.cs0000644000175000017500000001530512253423361026725 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using Newtonsoft.Json.Utilities; using System.Globalization; namespace Newtonsoft.Json.Linq { /// /// Represents a JSON constructor. /// public class JConstructor : JContainer { private string _name; private readonly IList _values = new List(); /// /// Gets the container's children tokens. /// /// The container's children tokens. protected override IList ChildrenTokens { get { return _values; } } /// /// Gets or sets the name of this constructor. /// /// The constructor name. public string Name { get { return _name; } set { _name = value; } } /// /// Gets the node type for this . /// /// The type. public override JTokenType Type { get { return JTokenType.Constructor; } } /// /// Initializes a new instance of the class. /// public JConstructor() { } /// /// Initializes a new instance of the class from another object. /// /// A object to copy from. public JConstructor(JConstructor other) : base(other) { _name = other.Name; } /// /// Initializes a new instance of the class with the specified name and content. /// /// The constructor name. /// The contents of the constructor. public JConstructor(string name, params object[] content) : this(name, (object)content) { } /// /// Initializes a new instance of the class with the specified name and content. /// /// The constructor name. /// The contents of the constructor. public JConstructor(string name, object content) : this(name) { Add(content); } /// /// Initializes a new instance of the class with the specified name. /// /// The constructor name. public JConstructor(string name) { ValidationUtils.ArgumentNotNullOrEmpty(name, "name"); _name = name; } internal override bool DeepEquals(JToken node) { JConstructor c = node as JConstructor; return (c != null && _name == c.Name && ContentsEqual(c)); } internal override JToken CloneToken() { return new JConstructor(this); } /// /// Writes this token to a . /// /// A into which this method will write. /// A collection of which will be used when writing the token. public override void WriteTo(JsonWriter writer, params JsonConverter[] converters) { writer.WriteStartConstructor(_name); foreach (JToken token in Children()) { token.WriteTo(writer, converters); } writer.WriteEndConstructor(); } /// /// Gets the with the specified key. /// /// The with the specified key. public override JToken this[object key] { get { ValidationUtils.ArgumentNotNull(key, "o"); if (!(key is int)) throw new ArgumentException("Accessed JConstructor values with invalid key value: {0}. Argument position index expected.".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.ToString(key))); return GetItem((int)key); } set { ValidationUtils.ArgumentNotNull(key, "o"); if (!(key is int)) throw new ArgumentException("Set JConstructor values with invalid key value: {0}. Argument position index expected.".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.ToString(key))); SetItem((int)key, value); } } internal override int GetDeepHashCode() { return _name.GetHashCode() ^ ContentsHashCode(); } /// /// Loads an from a . /// /// A that will be read for the content of the . /// A that contains the JSON that was read from the specified . public static new JConstructor Load(JsonReader reader) { if (reader.TokenType == JsonToken.None) { if (!reader.Read()) throw JsonReaderException.Create(reader, "Error reading JConstructor from JsonReader."); } while (reader.TokenType == JsonToken.Comment) { reader.Read(); } if (reader.TokenType != JsonToken.StartConstructor) throw JsonReaderException.Create(reader, "Error reading JConstructor from JsonReader. Current JsonReader item is not a constructor: {0}".FormatWith(CultureInfo.InvariantCulture, reader.TokenType)); JConstructor c = new JConstructor((string)reader.Value); c.SetLineInfo(reader as IJsonLineInfo); c.ReadTokenFrom(reader); return c; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonContainerAttribute.cs0000644000175000017500000001050512253423361030020 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json { /// /// Instructs the how to serialize the object. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)] public abstract class JsonContainerAttribute : Attribute { /// /// Gets or sets the id. /// /// The id. public string Id { get; set; } /// /// Gets or sets the title. /// /// The title. public string Title { get; set; } /// /// Gets or sets the description. /// /// The description. public string Description { get; set; } /// /// Gets the collection's items converter. /// /// The collection's items converter. public Type ItemConverterType { get; set; } // yuck. can't set nullable properties on an attribute in C# // have to use this approach to get an unset default state internal bool? _isReference; internal bool? _itemIsReference; internal ReferenceLoopHandling? _itemReferenceLoopHandling; internal TypeNameHandling? _itemTypeNameHandling; /// /// Gets or sets a value that indicates whether to preserve object references. /// /// /// true to keep object reference; otherwise, false. The default is false. /// public bool IsReference { get { return _isReference ?? default(bool); } set { _isReference = value; } } /// /// Gets or sets a value that indicates whether to preserve collection's items references. /// /// /// true to keep collection's items object references; otherwise, false. The default is false. /// public bool ItemIsReference { get { return _itemIsReference ?? default(bool); } set { _itemIsReference = value; } } /// /// Gets or sets the reference loop handling used when serializing the collection's items. /// /// The reference loop handling. public ReferenceLoopHandling ItemReferenceLoopHandling { get { return _itemReferenceLoopHandling ?? default(ReferenceLoopHandling); } set { _itemReferenceLoopHandling = value; } } /// /// Gets or sets the type name handling used when serializing the collection's items. /// /// The type name handling. public TypeNameHandling ItemTypeNameHandling { get { return _itemTypeNameHandling ?? default(TypeNameHandling); } set { _itemTypeNameHandling = value; } } /// /// Initializes a new instance of the class. /// protected JsonContainerAttribute() { } /// /// Initializes a new instance of the class with the specified container Id. /// /// The container Id. protected JsonContainerAttribute(string id) { Id = id; } } }smuxi-0.11/lib/Newtonsoft.Json/Src/Newtonsoft.Json/JsonReaderException.cs0000644000175000017500000001251612253423361027277 0ustar00meebeymeebey00000000000000#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Runtime.Serialization; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json { /// /// The exception thrown when an error occurs while reading Json text. /// #if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE) [Serializable] #endif public class JsonReaderException : JsonException { /// /// Gets the line number indicating where the error occurred. /// /// The line number indicating where the error occurred. public int LineNumber { get; private set; } /// /// Gets the line position indicating where the error occurred. /// /// The line position indicating where the error occurred. public int LinePosition { get; private set; } /// /// Gets the path to the JSON where the error occurred. /// /// The path to the JSON where the error occurred. public string Path { get; private set; } /// /// Initializes a new instance of the class. /// public JsonReaderException() { } /// /// Initializes a new instance of the class /// with a specified error message. /// /// The error message that explains the reason for the exception. public JsonReaderException(string message) : base(message) { } /// /// Initializes a new instance of the class /// with a specified error message and a reference to the inner exception that is the cause of this exception. /// /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. public JsonReaderException(string message, Exception innerException) : base(message, innerException) { } #if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE) /// /// Initializes a new instance of the class. /// /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. /// The parameter is null. /// The class name is null or is zero (0). public JsonReaderException(SerializationInfo info, StreamingContext context) : base(info, context) { } #endif internal JsonReaderException(string message, Exception innerException, string path, int lineNumber, int linePosition) : base(message, innerException) { Path = path; LineNumber = lineNumber; LinePosition = linePosition; } internal static JsonReaderException Create(JsonReader reader, string message) { return Create(reader, message, null); } internal static JsonReaderException Create(JsonReader reader, string message, Exception ex) { return Create(reader as IJsonLineInfo, reader.Path, message, ex); } internal static JsonReaderException Create(IJsonLineInfo lineInfo, string path, string message, Exception ex) { message = FormatExceptionMessage(lineInfo, path, message); int lineNumber; int linePosition; if (lineInfo != null && lineInfo.HasLineInfo()) { lineNumber = lineInfo.LineNumber; linePosition = lineInfo.LinePosition; } else { lineNumber = 0; linePosition = 0; } return new JsonReaderException(message, ex, path, lineNumber, linePosition); } } } smuxi-0.11/lib/StarkSoftProxy/0000755000175000017500000000000012311344240017120 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/StarkSoftProxy/StarkSoftProxy.csproj0000644000175000017500000000405712204443216023336 0ustar00meebeymeebey00000000000000 Debug AnyCPU 10.0.0 2.0 {3F8CF2C1-EA37-444F-8693-A3A00B1131D2} Library StarkSoftProxy StarkSoftProxy true full false bin\Debug DEBUG; prompt 4 false none false bin\Release prompt 4 false smuxi-0.11/lib/StarkSoftProxy/HttpProxyClient.cs0000644000175000017500000004343512254365454022620 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Text; using System.Net.Sockets; using System.Threading; using System.Globalization; using System.ComponentModel; namespace Starksoft.Net.Proxy { /// /// HTTP connection proxy class. This class implements the HTTP standard proxy protocol. /// /// You can use this class to set up a connection to an HTTP proxy server. Calling the /// CreateConnection() method initiates the proxy connection and returns a standard /// System.Net.Socks.TcpClient object that can be used as normal. The proxy plumbing /// is all handled for you. /// /// /// /// /// public class HttpProxyClient : IProxyClient { private string _proxyHost; private int _proxyPort; private HttpResponseCodes _respCode; private string _respText; private TcpClient _tcpClient; private const int HTTP_PROXY_DEFAULT_PORT = 8080; private const string HTTP_PROXY_CONNECT_CMD = "CONNECT {0}:{1} HTTP/1.0\r\nHost: {0}:{1}\r\n\r\n"; private const int WAIT_FOR_DATA_INTERVAL = 50; // 50 ms private const int WAIT_FOR_DATA_TIMEOUT = 15000; // 15 seconds private const string PROXY_NAME = "HTTP"; private enum HttpResponseCodes { None = 0, Continue = 100, SwitchingProtocols = 101, OK = 200, Created = 201, Accepted = 202, NonAuthoritiveInformation = 203, NoContent = 204, ResetContent = 205, PartialContent = 206, MultipleChoices = 300, MovedPermanetly = 301, Found = 302, SeeOther = 303, NotModified = 304, UserProxy = 305, TemporaryRedirect = 307, BadRequest = 400, Unauthorized = 401, PaymentRequired = 402, Forbidden = 403, NotFound = 404, MethodNotAllowed = 405, NotAcceptable = 406, ProxyAuthenticantionRequired = 407, RequestTimeout = 408, Conflict = 409, Gone = 410, PreconditionFailed = 411, RequestEntityTooLarge = 413, RequestURITooLong = 414, UnsupportedMediaType = 415, RequestedRangeNotSatisfied = 416, ExpectationFailed = 417, InternalServerError = 500, NotImplemented = 501, BadGateway = 502, ServiceUnavailable = 503, GatewayTimeout = 504, HTTPVersionNotSupported = 505 } /// /// Constructor. /// public HttpProxyClient() { } /// /// Creates a HTTP proxy client object using the supplied TcpClient object connection. /// /// A TcpClient connection object. public HttpProxyClient(TcpClient tcpClient) { if (tcpClient == null) throw new ArgumentNullException("tcpClient"); _tcpClient = tcpClient; } /// /// Constructor. The default HTTP proxy port 8080 is used. /// /// Host name or IP address of the proxy. public HttpProxyClient(string proxyHost) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); _proxyHost = proxyHost; _proxyPort = HTTP_PROXY_DEFAULT_PORT; } /// /// Constructor. /// /// Host name or IP address of the proxy server. /// Port number for the proxy server. public HttpProxyClient(string proxyHost, int proxyPort) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); _proxyHost = proxyHost; _proxyPort = proxyPort; } /// /// Gets or sets host name or IP address of the proxy server. /// public string ProxyHost { get { return _proxyHost; } set { _proxyHost = value; } } /// /// Gets or sets port number for the proxy server. /// public int ProxyPort { get { return _proxyPort; } set { _proxyPort = value; } } /// /// Gets String representing the name of the proxy. /// /// This property will always return the value 'HTTP' public string ProxyName { get { return PROXY_NAME; } } /// /// Gets or sets the TcpClient object. /// This property can be set prior to executing CreateConnection to use an existing TcpClient connection. /// public TcpClient TcpClient { get { return _tcpClient; } set { _tcpClient = value; } } /// /// Creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public TcpClient CreateConnection(string destinationHost, int destinationPort) { try { // if we have no connection, create one if (_tcpClient == null) { if (String.IsNullOrEmpty(_proxyHost)) throw new ProxyException("ProxyHost property must contain a value."); if (_proxyPort <= 0 || _proxyPort > 65535) throw new ProxyException("ProxyPort value must be greater than zero and less than 65535"); // create new tcp client object to the proxy server _tcpClient = new TcpClient(); // attempt to open the connection _tcpClient.Connect(_proxyHost, _proxyPort); } // send connection command to proxy host for the specified destination host and port SendConnectionCommand(destinationHost, destinationPort); // return the open proxied tcp client object to the caller for normal use return _tcpClient; } catch (SocketException ex) { throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "Connection to proxy host {0} on port {1} failed.", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient)), ex); } } private void SendConnectionCommand(string host, int port) { NetworkStream stream = _tcpClient.GetStream(); // PROXY SERVER REQUEST // ======================================================================= //CONNECT starksoft.com:443 HTTP/1.0 //HOST starksoft.com:443 //[... other HTTP header lines ending with if required]> // // Last Empty Line string connectCmd = String.Format(CultureInfo.InvariantCulture, HTTP_PROXY_CONNECT_CMD, host, port.ToString(CultureInfo.InvariantCulture)); byte[] request = ASCIIEncoding.ASCII.GetBytes(connectCmd); // send the connect request stream.Write(request, 0, request.Length); // wait for the proxy server to respond WaitForData(stream); // PROXY SERVER RESPONSE // ======================================================================= //HTTP/1.0 200 Connection Established //[.... other HTTP header lines ending with .. //ignore all of them] // // Last Empty Line // create an byte response array byte[] response = new byte[_tcpClient.ReceiveBufferSize]; StringBuilder sbuilder = new StringBuilder(); int bytes = 0; long total = 0; do { bytes = stream.Read(response, 0, _tcpClient.ReceiveBufferSize); total += bytes; sbuilder.Append(System.Text.ASCIIEncoding.UTF8.GetString(response, 0, bytes)); } while (stream.DataAvailable); ParseResponse(sbuilder.ToString()); // evaluate the reply code for an error condition if (_respCode != HttpResponseCodes.OK) HandleProxyCommandError(host, port); } private void HandleProxyCommandError(string host, int port) { string msg; switch (_respCode) { case HttpResponseCodes.None: msg = String.Format(CultureInfo.InvariantCulture, "Proxy destination {0} on port {1} failed to return a recognized HTTP response code. Server response: {2}", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient), _respText); break; case HttpResponseCodes.BadGateway: //HTTP/1.1 502 Proxy Error (The specified Secure Sockets Layer (SSL) port is not allowed. ISA Server is not configured to allow SSL requests from this port. Most Web browsers use port 443 for SSL requests.) msg = String.Format(CultureInfo.InvariantCulture, "Proxy destination {0} on port {1} responded with a 502 code - Bad Gateway. If you are connecting to a Microsoft ISA destination please refer to knowledge based article Q283284 for more information. Server response: {2}", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient), _respText); break; default: msg = String.Format(CultureInfo.InvariantCulture, "Proxy destination {0} on port {1} responded with a {2} code - {3}", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient), ((int)_respCode).ToString(CultureInfo.InvariantCulture), _respText); break; } // throw a new application exception throw new ProxyException(msg); } private void WaitForData(NetworkStream stream) { int sleepTime = 0; while (!stream.DataAvailable) { Thread.Sleep(WAIT_FOR_DATA_INTERVAL); sleepTime += WAIT_FOR_DATA_INTERVAL; if (sleepTime > WAIT_FOR_DATA_TIMEOUT) throw new ProxyException(String.Format("A timeout while waiting for the proxy server at {0} on port {1} to respond.", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient) )); } } private void ParseResponse(string response) { string[] data = null; // get rid of the LF character if it exists and then split the string on all CR data = response.Replace('\n', ' ').Split('\r'); ParseCodeAndText(data[0]); } private void ParseCodeAndText(string line) { int begin = 0; int end = 0; string val = null; if (line.IndexOf("HTTP") == -1) throw new ProxyException(String.Format("No HTTP response received from proxy destination. Server response: {0}.", line)); begin = line.IndexOf(" ") + 1; end = line.IndexOf(" ", begin); val = line.Substring(begin, end - begin); Int32 code = 0; if (!Int32.TryParse(val, out code)) throw new ProxyException(String.Format("An invalid response code was received from proxy destination. Server response: {0}.", line)); _respCode = (HttpResponseCodes)code; _respText = line.Substring(end + 1).Trim(); } #region "Async Methods" private BackgroundWorker _asyncWorker; private Exception _asyncException; bool _asyncCancelled; /// /// Gets a value indicating whether an asynchronous operation is running. /// /// Returns true if an asynchronous operation is running; otherwise, false. /// public bool IsBusy { get { return _asyncWorker == null ? false : _asyncWorker.IsBusy; } } /// /// Gets a value indicating whether an asynchronous operation is cancelled. /// /// Returns true if an asynchronous operation is cancelled; otherwise, false. /// public bool IsAsyncCancelled { get { return _asyncCancelled; } } /// /// Cancels any asychronous operation that is currently active. /// public void CancelAsync() { if (_asyncWorker != null && !_asyncWorker.CancellationPending && _asyncWorker.IsBusy) { _asyncCancelled = true; _asyncWorker.CancelAsync(); } } private void CreateAsyncWorker() { if (_asyncWorker != null) _asyncWorker.Dispose(); _asyncException = null; _asyncWorker = null; _asyncCancelled = false; _asyncWorker = new BackgroundWorker(); } /// /// Event handler for CreateConnectionAsync method completed. /// public event EventHandler CreateConnectionAsyncCompleted; /// /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public void CreateConnectionAsync(string destinationHost, int destinationPort) { if (_asyncWorker != null && _asyncWorker.IsBusy) throw new InvalidOperationException("The HttpProxy object is already busy executing another asynchronous operation. You can only execute one asychronous method at a time."); CreateAsyncWorker(); _asyncWorker.WorkerSupportsCancellation = true; _asyncWorker.DoWork += new DoWorkEventHandler(CreateConnectionAsync_DoWork); _asyncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CreateConnectionAsync_RunWorkerCompleted); Object[] args = new Object[2]; args[0] = destinationHost; args[1] = destinationPort; _asyncWorker.RunWorkerAsync(args); } private void CreateConnectionAsync_DoWork(object sender, DoWorkEventArgs e) { try { Object[] args = (Object[])e.Argument; e.Result = CreateConnection((string)args[0], (int)args[1]); } catch (Exception ex) { _asyncException = ex; } } private void CreateConnectionAsync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (CreateConnectionAsyncCompleted != null) CreateConnectionAsyncCompleted(this, new CreateConnectionAsyncCompletedEventArgs(_asyncException, _asyncCancelled, (TcpClient)e.Result)); } #endregion } } smuxi-0.11/lib/StarkSoftProxy/Socks4ProxyClient.cs0000644000175000017500000006030612204443216023027 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Text; using System.Net; using System.Net.Sockets; using System.Globalization; using System.IO; using System.Threading; using System.ComponentModel; namespace Starksoft.Net.Proxy { /// /// Socks4 connection proxy class. This class implements the Socks4 standard proxy protocol. /// /// /// This class implements the Socks4 proxy protocol standard for TCP communciations. /// public class Socks4ProxyClient : IProxyClient { private const int WAIT_FOR_DATA_INTERVAL = 50; // 50 ms private const int WAIT_FOR_DATA_TIMEOUT = 15000; // 15 seconds private const string PROXY_NAME = "SOCKS4"; private TcpClient _tcpClient; private string _proxyHost; private int _proxyPort; private string _proxyUserId; /// /// Default Socks4 proxy port. /// internal const int SOCKS_PROXY_DEFAULT_PORT = 1080; /// /// Socks4 version number. /// internal const byte SOCKS4_VERSION_NUMBER = 4; /// /// Socks4 connection command value. /// internal const byte SOCKS4_CMD_CONNECT = 0x01; /// /// Socks4 bind command value. /// internal const byte SOCKS4_CMD_BIND = 0x02; /// /// Socks4 reply request grant response value. /// internal const byte SOCKS4_CMD_REPLY_REQUEST_GRANTED = 90; /// /// Socks4 reply request rejected or failed response value. /// internal const byte SOCKS4_CMD_REPLY_REQUEST_REJECTED_OR_FAILED = 91; /// /// Socks4 reply request rejected becauase the proxy server can not connect to the IDENTD server value. /// internal const byte SOCKS4_CMD_REPLY_REQUEST_REJECTED_CANNOT_CONNECT_TO_IDENTD = 92; /// /// Socks4 reply request rejected because of a different IDENTD server. /// internal const byte SOCKS4_CMD_REPLY_REQUEST_REJECTED_DIFFERENT_IDENTD = 93; /// /// Create a Socks4 proxy client object. The default proxy port 1080 is used. /// public Socks4ProxyClient() { } /// /// Creates a Socks4 proxy client object using the supplied TcpClient object connection. /// /// A TcpClient connection object. public Socks4ProxyClient(TcpClient tcpClient) { if (tcpClient == null) throw new ArgumentNullException("tcpClient"); _tcpClient = tcpClient; } /// /// Create a Socks4 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. /// Proxy user identification information. public Socks4ProxyClient(string proxyHost, string proxyUserId) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyUserId == null) throw new ArgumentNullException("proxyUserId"); _proxyHost = proxyHost; _proxyPort = SOCKS_PROXY_DEFAULT_PORT; _proxyUserId = proxyUserId; } /// /// Create a Socks4 proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. /// Proxy user identification information. public Socks4ProxyClient(string proxyHost, int proxyPort, string proxyUserId) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); if (proxyUserId == null) throw new ArgumentNullException("proxyUserId"); _proxyHost = proxyHost; _proxyPort = proxyPort; _proxyUserId = proxyUserId; } /// /// Create a Socks4 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. public Socks4ProxyClient(string proxyHost) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); _proxyHost = proxyHost; _proxyPort = SOCKS_PROXY_DEFAULT_PORT; } /// /// Create a Socks4 proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. public Socks4ProxyClient(string proxyHost, int proxyPort) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); _proxyHost = proxyHost; _proxyPort = proxyPort; } /// /// Gets or sets host name or IP address of the proxy server. /// public string ProxyHost { get { return _proxyHost; } set { _proxyHost = value; } } /// /// Gets or sets port used to connect to proxy server. /// public int ProxyPort { get { return _proxyPort; } set { _proxyPort = value; } } /// /// Gets String representing the name of the proxy. /// /// This property will always return the value 'SOCKS4' virtual public string ProxyName { get { return PROXY_NAME; } } /// /// Gets or sets proxy user identification information. /// public string ProxyUserId { get { return _proxyUserId; } set { _proxyUserId = value; } } /// /// Gets or sets the TcpClient object. /// This property can be set prior to executing CreateConnection to use an existing TcpClient connection. /// public TcpClient TcpClient { get { return _tcpClient; } set { _tcpClient = value; } } /// /// Creates a TCP connection to the destination host through the proxy server /// host. /// /// Destination host name or IP address of the destination server. /// Port number to connect to on the destination server. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public TcpClient CreateConnection(string destinationHost, int destinationPort) { if (String.IsNullOrEmpty(destinationHost)) throw new ArgumentNullException("destinationHost"); if (destinationPort <= 0 || destinationPort > 65535) throw new ArgumentOutOfRangeException("destinationPort", "port must be greater than zero and less than 65535"); try { // if we have no connection, create one if (_tcpClient == null) { if (String.IsNullOrEmpty(_proxyHost)) throw new ProxyException("ProxyHost property must contain a value."); if (_proxyPort <= 0 || _proxyPort > 65535) throw new ProxyException("ProxyPort value must be greater than zero and less than 65535"); // create new tcp client object to the proxy server _tcpClient = new TcpClient(); // attempt to open the connection _tcpClient.Connect(_proxyHost, _proxyPort); } // send connection command to proxy host for the specified destination host and port SendCommand(_tcpClient.GetStream(), SOCKS4_CMD_CONNECT, destinationHost, destinationPort, _proxyUserId); // return the open proxied tcp client object to the caller for normal use return _tcpClient; } catch (Exception ex) { throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "Connection to proxy host {0} on port {1} failed.", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient)), ex); } } /// /// Sends a command to the proxy server. /// /// Proxy server data stream. /// Proxy byte command to execute. /// Destination host name or IP address. /// Destination port number /// IDENTD user ID value. internal virtual void SendCommand(NetworkStream proxy, byte command, string destinationHost, int destinationPort, string userId) { // PROXY SERVER REQUEST // The client connects to the SOCKS server and sends a CONNECT request when // it wants to establish a connection to an application server. The client // includes in the request packet the IP address and the port number of the // destination host, and userid, in the following format. // // +----+----+----+----+----+----+----+----+----+----+....+----+ // | VN | CD | DSTPORT | DSTIP | USERID |NULL| // +----+----+----+----+----+----+----+----+----+----+....+----+ // # of bytes: 1 1 2 4 variable 1 // // VN is the SOCKS protocol version number and should be 4. CD is the // SOCKS command code and should be 1 for CONNECT request. NULL is a byte // of all zero bits. // userId needs to be a zero length string so that the GetBytes method // works properly if (userId == null) userId = ""; byte[] destIp = GetIPAddressBytes(destinationHost); byte[] destPort = GetDestinationPortBytes(destinationPort); byte[] userIdBytes = ASCIIEncoding.ASCII.GetBytes(userId); byte[] request = new byte[9 + userIdBytes.Length]; // set the bits on the request byte array request[0] = SOCKS4_VERSION_NUMBER; request[1] = command; destPort.CopyTo(request, 2); destIp.CopyTo(request, 4); userIdBytes.CopyTo(request, 8); request[8 + userIdBytes.Length] = 0x00; // null (byte with all zeros) terminator for userId // send the connect request proxy.Write(request, 0, request.Length); // wait for the proxy server to respond WaitForData(proxy); // PROXY SERVER RESPONSE // The SOCKS server checks to see whether such a request should be granted // based on any combination of source IP address, destination IP address, // destination port number, the userid, and information it may obtain by // consulting IDENT, cf. RFC 1413. If the request is granted, the SOCKS // server makes a connection to the specified port of the destination host. // A reply packet is sent to the client when this connection is established, // or when the request is rejected or the operation fails. // // +----+----+----+----+----+----+----+----+ // | VN | CD | DSTPORT | DSTIP | // +----+----+----+----+----+----+----+----+ // # of bytes: 1 1 2 4 // // VN is the version of the reply code and should be 0. CD is the result // code with one of the following values: // // 90: request granted // 91: request rejected or failed // 92: request rejected becuase SOCKS server cannot connect to // identd on the client // 93: request rejected because the client program and identd // report different user-ids // // The remaining fields are ignored. // // The SOCKS server closes its connection immediately after notifying // the client of a failed or rejected request. For a successful request, // the SOCKS server gets ready to relay traffic on both directions. This // enables the client to do I/O on its connection as if it were directly // connected to the application server. // create an 8 byte response array byte[] response = new byte[8]; // read the resonse from the network stream proxy.Read(response, 0, 8); // evaluate the reply code for an error condition if (response[1] != SOCKS4_CMD_REPLY_REQUEST_GRANTED) HandleProxyCommandError(response, destinationHost, destinationPort); } /// /// Translate the host name or IP address to a byte array. /// /// Host name or IP address. /// Byte array representing IP address in bytes. internal byte[] GetIPAddressBytes(string destinationHost) { IPAddress ipAddr = null; // if the address doesn't parse then try to resolve with dns if (!IPAddress.TryParse(destinationHost, out ipAddr)) { try { ipAddr = Dns.GetHostEntry(destinationHost).AddressList[0]; } catch (Exception ex) { throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "A error occurred while attempting to DNS resolve the host name {0}.", destinationHost), ex); } } // return address bytes return ipAddr.GetAddressBytes(); } /// /// Translate the destination port value to a byte array. /// /// Destination port. /// Byte array representing an 16 bit port number as two bytes. internal byte[] GetDestinationPortBytes(int value) { byte[] array = new byte[2]; array[0] = Convert.ToByte(value / 256); array[1] = Convert.ToByte(value % 256); return array; } /// /// Receive a byte array from the proxy server and determine and handle and errors that may have occurred. /// /// Proxy server command response as a byte array. /// Destination host. /// Destination port number. internal void HandleProxyCommandError(byte[] response, string destinationHost, int destinationPort) { if (response == null) throw new ArgumentNullException("response"); // extract the reply code byte replyCode = response[1]; // extract the ip v4 address (4 bytes) byte[] ipBytes = new byte[4]; for (int i = 0; i < 4; i++) ipBytes[i] = response[i + 4]; // convert the ip address to an IPAddress object IPAddress ipAddr = new IPAddress(ipBytes); // extract the port number big endian (2 bytes) byte[] portBytes = new byte[2]; portBytes[0] = response[3]; portBytes[1] = response[2]; Int16 port = BitConverter.ToInt16(portBytes, 0); // translate the reply code error number to human readable text string proxyErrorText; switch (replyCode) { case SOCKS4_CMD_REPLY_REQUEST_REJECTED_OR_FAILED: proxyErrorText = "connection request was rejected or failed"; break; case SOCKS4_CMD_REPLY_REQUEST_REJECTED_CANNOT_CONNECT_TO_IDENTD: proxyErrorText = "connection request was rejected because SOCKS destination cannot connect to identd on the client"; break; case SOCKS4_CMD_REPLY_REQUEST_REJECTED_DIFFERENT_IDENTD: proxyErrorText = "connection request rejected because the client program and identd report different user-ids"; break; default: proxyErrorText = String.Format(CultureInfo.InvariantCulture, "proxy client received an unknown reply with the code value '{0}' from the proxy destination", replyCode.ToString(CultureInfo.InvariantCulture)); break; } // build the exeception message string string exceptionMsg = String.Format(CultureInfo.InvariantCulture, "The {0} concerning destination host {1} port number {2}. The destination reported the host as {3} port {4}.", proxyErrorText, destinationHost, destinationPort, ipAddr.ToString(), port.ToString(CultureInfo.InvariantCulture)); // throw a new application exception throw new ProxyException(exceptionMsg); } internal void WaitForData(NetworkStream stream) { int sleepTime = 0; while (!stream.DataAvailable) { Thread.Sleep(WAIT_FOR_DATA_INTERVAL); sleepTime += WAIT_FOR_DATA_INTERVAL; if (sleepTime > WAIT_FOR_DATA_TIMEOUT) throw new ProxyException("A timeout while waiting for the proxy destination to respond."); } } #region "Async Methods" private BackgroundWorker _asyncWorker; private Exception _asyncException; bool _asyncCancelled; /// /// Gets a value indicating whether an asynchronous operation is running. /// /// Returns true if an asynchronous operation is running; otherwise, false. /// public bool IsBusy { get { return _asyncWorker == null ? false : _asyncWorker.IsBusy; } } /// /// Gets a value indicating whether an asynchronous operation is cancelled. /// /// Returns true if an asynchronous operation is cancelled; otherwise, false. /// public bool IsAsyncCancelled { get { return _asyncCancelled; } } /// /// Cancels any asychronous operation that is currently active. /// public void CancelAsync() { if (_asyncWorker != null && !_asyncWorker.CancellationPending && _asyncWorker.IsBusy) { _asyncCancelled = true; _asyncWorker.CancelAsync(); } } private void CreateAsyncWorker() { if (_asyncWorker != null) _asyncWorker.Dispose(); _asyncException = null; _asyncWorker = null; _asyncCancelled = false; _asyncWorker = new BackgroundWorker(); } /// /// Event handler for CreateConnectionAsync method completed. /// public event EventHandler CreateConnectionAsyncCompleted; /// /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port /// using the supplied open TcpClient object with an open connection to proxy server. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns TcpClient object that can be used normally to communicate /// with the destination server. /// /// /// This instructs the proxy server to make a pass through connection to the specified destination host on the specified /// port. /// public void CreateConnectionAsync(string destinationHost, int destinationPort) { if (_asyncWorker != null && _asyncWorker.IsBusy) throw new InvalidOperationException("The Socks4/4a object is already busy executing another asynchronous operation. You can only execute one asychronous method at a time."); CreateAsyncWorker(); _asyncWorker.WorkerSupportsCancellation = true; _asyncWorker.DoWork += new DoWorkEventHandler(CreateConnectionAsync_DoWork); _asyncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CreateConnectionAsync_RunWorkerCompleted); Object[] args = new Object[2]; args[0] = destinationHost; args[1] = destinationPort; _asyncWorker.RunWorkerAsync(args); } private void CreateConnectionAsync_DoWork(object sender, DoWorkEventArgs e) { try { Object[] args = (Object[])e.Argument; e.Result = CreateConnection((string)args[0], (int)args[1]); } catch (Exception ex) { _asyncException = ex; } } private void CreateConnectionAsync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (CreateConnectionAsyncCompleted != null) CreateConnectionAsyncCompleted(this, new CreateConnectionAsyncCompletedEventArgs(_asyncException, _asyncCancelled, (TcpClient)e.Result)); } #endregion } } smuxi-0.11/lib/StarkSoftProxy/EventArgs/0000755000175000017500000000000012204443216021022 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/StarkSoftProxy/EventArgs/CreateConnectionAsyncCompletedEventArgs.cs0000644000175000017500000000446712204443216031261 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Net.Sockets; using System.ComponentModel; namespace Starksoft.Net.Proxy { /// /// Event arguments class for the EncryptAsyncCompleted event. /// public class CreateConnectionAsyncCompletedEventArgs : AsyncCompletedEventArgs { private TcpClient _proxyConnection; /// /// Constructor. /// /// Exception information generated by the event. /// Cancelled event flag. This flag is set to true if the event was cancelled. /// Proxy Connection. The initialized and open TcpClient proxy connection. public CreateConnectionAsyncCompletedEventArgs(Exception error, bool cancelled, TcpClient proxyConnection) : base(error, cancelled, null) { _proxyConnection = proxyConnection; } /// /// The proxy connection. /// public TcpClient ProxyConnection { get { return _proxyConnection; } } } } smuxi-0.11/lib/StarkSoftProxy/Socks5ProxyClient.cs0000644000175000017500000007701512204443216023035 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Text; using System.Net; using System.Net.Sockets; using System.Globalization; using System.ComponentModel; namespace Starksoft.Net.Proxy { /// /// Socks5 connection proxy class. This class implements the Socks5 standard proxy protocol. /// /// /// This implementation supports TCP proxy connections with a Socks v5 server. /// public class Socks5ProxyClient : IProxyClient { private string _proxyHost; private int _proxyPort; private string _proxyUserName; private string _proxyPassword; private SocksAuthentication _proxyAuthMethod; private TcpClient _tcpClient; private const string PROXY_NAME = "SOCKS5"; private const int SOCKS5_DEFAULT_PORT = 1080; private const byte SOCKS5_VERSION_NUMBER = 5; private const byte SOCKS5_RESERVED = 0x00; private const byte SOCKS5_AUTH_NUMBER_OF_AUTH_METHODS_SUPPORTED = 2; private const byte SOCKS5_AUTH_METHOD_NO_AUTHENTICATION_REQUIRED = 0x00; private const byte SOCKS5_AUTH_METHOD_GSSAPI = 0x01; private const byte SOCKS5_AUTH_METHOD_USERNAME_PASSWORD = 0x02; private const byte SOCKS5_AUTH_METHOD_IANA_ASSIGNED_RANGE_BEGIN = 0x03; private const byte SOCKS5_AUTH_METHOD_IANA_ASSIGNED_RANGE_END = 0x7f; private const byte SOCKS5_AUTH_METHOD_RESERVED_RANGE_BEGIN = 0x80; private const byte SOCKS5_AUTH_METHOD_RESERVED_RANGE_END = 0xfe; private const byte SOCKS5_AUTH_METHOD_REPLY_NO_ACCEPTABLE_METHODS = 0xff; private const byte SOCKS5_CMD_CONNECT = 0x01; private const byte SOCKS5_CMD_BIND = 0x02; private const byte SOCKS5_CMD_UDP_ASSOCIATE = 0x03; private const byte SOCKS5_CMD_REPLY_SUCCEEDED = 0x00; private const byte SOCKS5_CMD_REPLY_GENERAL_SOCKS_SERVER_FAILURE = 0x01; private const byte SOCKS5_CMD_REPLY_CONNECTION_NOT_ALLOWED_BY_RULESET = 0x02; private const byte SOCKS5_CMD_REPLY_NETWORK_UNREACHABLE = 0x03; private const byte SOCKS5_CMD_REPLY_HOST_UNREACHABLE = 0x04; private const byte SOCKS5_CMD_REPLY_CONNECTION_REFUSED = 0x05; private const byte SOCKS5_CMD_REPLY_TTL_EXPIRED = 0x06; private const byte SOCKS5_CMD_REPLY_COMMAND_NOT_SUPPORTED = 0x07; private const byte SOCKS5_CMD_REPLY_ADDRESS_TYPE_NOT_SUPPORTED = 0x08; private const byte SOCKS5_ADDRTYPE_IPV4 = 0x01; private const byte SOCKS5_ADDRTYPE_DOMAIN_NAME = 0x03; private const byte SOCKS5_ADDRTYPE_IPV6 = 0x04; /// /// Authentication itemType. /// private enum SocksAuthentication { /// /// No authentication used. /// None, /// /// Username and password authentication. /// UsernamePassword } /// /// Create a Socks5 proxy client object. /// public Socks5ProxyClient() { } /// /// Creates a Socks5 proxy client object using the supplied TcpClient object connection. /// /// A TcpClient connection object. public Socks5ProxyClient(TcpClient tcpClient) { if (tcpClient == null) throw new ArgumentNullException("tcpClient"); _tcpClient = tcpClient; } /// /// Create a Socks5 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. public Socks5ProxyClient(string proxyHost) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); _proxyHost = proxyHost; _proxyPort = SOCKS5_DEFAULT_PORT; } /// /// Create a Socks5 proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. public Socks5ProxyClient(string proxyHost, int proxyPort) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); _proxyHost = proxyHost; _proxyPort = proxyPort; } /// /// Create a Socks5 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. /// Proxy authentication user name. /// Proxy authentication password. public Socks5ProxyClient(string proxyHost, string proxyUserName, string proxyPassword) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyUserName == null) throw new ArgumentNullException("proxyUserName"); if (proxyPassword == null) throw new ArgumentNullException("proxyPassword"); _proxyHost = proxyHost; _proxyPort = SOCKS5_DEFAULT_PORT; _proxyUserName = proxyUserName; _proxyPassword = proxyPassword; } /// /// Create a Socks5 proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. /// Proxy authentication user name. /// Proxy authentication password. public Socks5ProxyClient(string proxyHost, int proxyPort, string proxyUserName, string proxyPassword) { if (String.IsNullOrEmpty(proxyHost)) throw new ArgumentNullException("proxyHost"); if (proxyPort <= 0 || proxyPort > 65535) throw new ArgumentOutOfRangeException("proxyPort", "port must be greater than zero and less than 65535"); if (proxyUserName == null) throw new ArgumentNullException("proxyUserName"); if (proxyPassword == null) throw new ArgumentNullException("proxyPassword"); _proxyHost = proxyHost; _proxyPort = proxyPort; _proxyUserName = proxyUserName; _proxyPassword = proxyPassword; } /// /// Gets or sets host name or IP address of the proxy server. /// public string ProxyHost { get { return _proxyHost; } set { _proxyHost = value; } } /// /// Gets or sets port used to connect to proxy server. /// public int ProxyPort { get { return _proxyPort; } set { _proxyPort = value; } } /// /// Gets String representing the name of the proxy. /// /// This property will always return the value 'SOCKS5' public string ProxyName { get { return PROXY_NAME; } } /// /// Gets or sets proxy authentication user name. /// public string ProxyUserName { get { return _proxyUserName; } set { _proxyUserName = value; } } /// /// Gets or sets proxy authentication password. /// public string ProxyPassword { get { return _proxyPassword; } set { _proxyPassword = value; } } /// /// Gets or sets the TcpClient object. /// This property can be set prior to executing CreateConnection to use an existing TcpClient connection. /// public TcpClient TcpClient { get { return _tcpClient; } set { _tcpClient = value; } } /// /// Creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address of the destination server. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public TcpClient CreateConnection(string destinationHost, int destinationPort) { if (String.IsNullOrEmpty(destinationHost)) throw new ArgumentNullException("destinationHost"); if (destinationPort <= 0 || destinationPort > 65535) throw new ArgumentOutOfRangeException("destinationPort", "port must be greater than zero and less than 65535"); try { // if we have no connection, create one if (_tcpClient == null) { if (String.IsNullOrEmpty(_proxyHost)) throw new ProxyException("ProxyHost property must contain a value."); if (_proxyPort <= 0 || _proxyPort > 65535) throw new ProxyException("ProxyPort value must be greater than zero and less than 65535"); // create new tcp client object to the proxy server _tcpClient = new TcpClient(); // attempt to open the connection _tcpClient.Connect(_proxyHost, _proxyPort); } // determine which authentication method the client would like to use DetermineClientAuthMethod(); // negotiate which authentication methods are supported / accepted by the server NegotiateServerAuthMethod(); // send a connect command to the proxy server for destination host and port SendCommand(SOCKS5_CMD_CONNECT, destinationHost, destinationPort); // return the open proxied tcp client object to the caller for normal use return _tcpClient; } catch (Exception ex) { throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "Connection to proxy host {0} on port {1} failed.", Utils.GetHost(_tcpClient), Utils.GetPort(_tcpClient)), ex); } } private void DetermineClientAuthMethod() { // set the authentication itemType used based on values inputed by the user if (_proxyUserName != null && _proxyPassword != null) _proxyAuthMethod = SocksAuthentication.UsernamePassword; else _proxyAuthMethod = SocksAuthentication.None; } private void NegotiateServerAuthMethod() { // get a reference to the network stream NetworkStream stream = _tcpClient.GetStream(); // SERVER AUTHENTICATION REQUEST // The client connects to the server, and sends a version // identifier/method selection message: // // +----+----------+----------+ // |VER | NMETHODS | METHODS | // +----+----------+----------+ // | 1 | 1 | 1 to 255 | // +----+----------+----------+ byte[] authRequest = new byte[4]; authRequest[0] = SOCKS5_VERSION_NUMBER; authRequest[1] = SOCKS5_AUTH_NUMBER_OF_AUTH_METHODS_SUPPORTED; authRequest[2] = SOCKS5_AUTH_METHOD_NO_AUTHENTICATION_REQUIRED; authRequest[3] = SOCKS5_AUTH_METHOD_USERNAME_PASSWORD; // send the request to the server specifying authentication types supported by the client. stream.Write(authRequest, 0, authRequest.Length); // SERVER AUTHENTICATION RESPONSE // The server selects from one of the methods given in METHODS, and // sends a METHOD selection message: // // +----+--------+ // |VER | METHOD | // +----+--------+ // | 1 | 1 | // +----+--------+ // // If the selected METHOD is X'FF', none of the methods listed by the // client are acceptable, and the client MUST close the connection. // // The values currently defined for METHOD are: // * X'00' NO AUTHENTICATION REQUIRED // * X'01' GSSAPI // * X'02' USERNAME/PASSWORD // * X'03' to X'7F' IANA ASSIGNED // * X'80' to X'FE' RESERVED FOR PRIVATE METHODS // * X'FF' NO ACCEPTABLE METHODS // receive the server response byte[] response = new byte[2]; stream.Read(response, 0, response.Length); // the first byte contains the socks version number (e.g. 5) // the second byte contains the auth method acceptable to the proxy server byte acceptedAuthMethod = response[1]; // if the server does not accept any of our supported authenication methods then throw an error if (acceptedAuthMethod == SOCKS5_AUTH_METHOD_REPLY_NO_ACCEPTABLE_METHODS) { _tcpClient.Close(); throw new ProxyException("The proxy destination does not accept the supported proxy client authentication methods."); } // if the server accepts a username and password authentication and none is provided by the user then throw an error if (acceptedAuthMethod == SOCKS5_AUTH_METHOD_USERNAME_PASSWORD && _proxyAuthMethod == SocksAuthentication.None) { _tcpClient.Close(); throw new ProxyException("The proxy destination requires a username and password for authentication."); } if (acceptedAuthMethod == SOCKS5_AUTH_METHOD_USERNAME_PASSWORD) { // USERNAME / PASSWORD SERVER REQUEST // Once the SOCKS V5 server has started, and the client has selected the // Username/Password Authentication protocol, the Username/Password // subnegotiation begins. This begins with the client producing a // Username/Password request: // // +----+------+----------+------+----------+ // |VER | ULEN | UNAME | PLEN | PASSWD | // +----+------+----------+------+----------+ // | 1 | 1 | 1 to 255 | 1 | 1 to 255 | // +----+------+----------+------+----------+ byte[] credentials = new byte[_proxyUserName.Length + _proxyPassword.Length + 3]; credentials[0] = 1; credentials[1] = (byte)_proxyUserName.Length; Array.Copy(ASCIIEncoding.ASCII.GetBytes(_proxyUserName), 0, credentials, 2, _proxyUserName.Length); credentials[_proxyUserName.Length + 2] = (byte)_proxyPassword.Length; Array.Copy(ASCIIEncoding.ASCII.GetBytes(_proxyPassword), 0, credentials, _proxyUserName.Length + 3, _proxyPassword.Length); // USERNAME / PASSWORD SERVER RESPONSE // The server verifies the supplied UNAME and PASSWD, and sends the // following response: // // +----+--------+ // |VER | STATUS | // +----+--------+ // | 1 | 1 | // +----+--------+ // // A STATUS field of X'00' indicates success. If the server returns a // `failure' (STATUS value other than X'00') status, it MUST close the // connection. stream.Write(credentials, 0, credentials.Length); byte[] crResponse = new byte[2]; stream.Read(crResponse, 0, crResponse.Length); if (crResponse[1] != 0) { _tcpClient.Close(); throw new ProxyException("Proxy authentification failure!"); } } } private byte GetDestAddressType(string host) { IPAddress ipAddr = null; bool result = IPAddress.TryParse(host, out ipAddr); if (!result) return SOCKS5_ADDRTYPE_DOMAIN_NAME; switch (ipAddr.AddressFamily) { case AddressFamily.InterNetwork: return SOCKS5_ADDRTYPE_IPV4; case AddressFamily.InterNetworkV6: return SOCKS5_ADDRTYPE_IPV6; default: throw new ProxyException(String.Format(CultureInfo.InvariantCulture, "The host addess {0} of type '{1}' is not a supported address type. The supported types are InterNetwork and InterNetworkV6.", host, Enum.GetName(typeof(AddressFamily), ipAddr.AddressFamily))); } } private byte[] GetDestAddressBytes(byte addressType, string host) { switch (addressType) { case SOCKS5_ADDRTYPE_IPV4: case SOCKS5_ADDRTYPE_IPV6: return IPAddress.Parse(host).GetAddressBytes(); case SOCKS5_ADDRTYPE_DOMAIN_NAME: // create a byte array to hold the host name bytes plus one byte to store the length byte[] bytes = new byte[host.Length + 1]; // if the address field contains a fully-qualified domain name. The first // octet of the address field contains the number of octets of name that // follow, there is no terminating NUL octet. bytes[0] = Convert.ToByte(host.Length); Encoding.ASCII.GetBytes(host).CopyTo(bytes, 1); return bytes; default: return null; } } private byte[] GetDestPortBytes(int value) { byte[] array = new byte[2]; array[0] = Convert.ToByte(value / 256); array[1] = Convert.ToByte(value % 256); return array; } private void SendCommand(byte command, string destinationHost, int destinationPort) { NetworkStream stream = _tcpClient.GetStream(); byte addressType = GetDestAddressType(destinationHost); byte[] destAddr = GetDestAddressBytes(addressType, destinationHost); byte[] destPort = GetDestPortBytes(destinationPort); // The connection request is made up of 6 bytes plus the // length of the variable address byte array // // +----+-----+-------+------+----------+----------+ // |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT | // +----+-----+-------+------+----------+----------+ // | 1 | 1 | X'00' | 1 | Variable | 2 | // +----+-----+-------+------+----------+----------+ // // * VER protocol version: X'05' // * CMD // * CONNECT X'01' // * BIND X'02' // * UDP ASSOCIATE X'03' // * RSV RESERVED // * ATYP address itemType of following address // * IP V4 address: X'01' // * DOMAINNAME: X'03' // * IP V6 address: X'04' // * DST.ADDR desired destination address // * DST.PORT desired destination port in network octet order byte[] request = new byte[4 + destAddr.Length + 2]; request[0] = SOCKS5_VERSION_NUMBER; request[1] = command; request[2] = SOCKS5_RESERVED; request[3] = addressType; destAddr.CopyTo(request, 4); destPort.CopyTo(request, 4 + destAddr.Length); // send connect request. stream.Write(request, 0, request.Length); // PROXY SERVER RESPONSE // +----+-----+-------+------+----------+----------+ // |VER | REP | RSV | ATYP | BND.ADDR | BND.PORT | // +----+-----+-------+------+----------+----------+ // | 1 | 1 | X'00' | 1 | Variable | 2 | // +----+-----+-------+------+----------+----------+ // // * VER protocol version: X'05' // * REP Reply field: // * X'00' succeeded // * X'01' general SOCKS server failure // * X'02' connection not allowed by ruleset // * X'03' Network unreachable // * X'04' Host unreachable // * X'05' Connection refused // * X'06' TTL expired // * X'07' Command not supported // * X'08' Address itemType not supported // * X'09' to X'FF' unassigned //* RSV RESERVED //* ATYP address itemType of following address byte[] response = new byte[255]; // read proxy server response var responseSize = stream.Read(response, 0, response.Length); byte replyCode = response[1]; // evaluate the reply code for an error condition if (responseSize < 2 || replyCode != SOCKS5_CMD_REPLY_SUCCEEDED) HandleProxyCommandError(response, destinationHost, destinationPort ); } private void HandleProxyCommandError(byte[] response, string destinationHost, int destinationPort) { string proxyErrorText; byte replyCode = response[1]; byte addrType = response[3]; string addr = ""; Int16 port = 0; switch (addrType) { case SOCKS5_ADDRTYPE_DOMAIN_NAME: int addrLen = Convert.ToInt32(response[4]); byte[] addrBytes = new byte[addrLen]; for (int i = 0; i < addrLen; i++) addrBytes[i] = response[i + 5]; addr = System.Text.ASCIIEncoding.ASCII.GetString(addrBytes); byte[] portBytesDomain = new byte[2]; portBytesDomain[0] = response[6 + addrLen]; portBytesDomain[1] = response[5 + addrLen]; port = BitConverter.ToInt16(portBytesDomain, 0); break; case SOCKS5_ADDRTYPE_IPV4: byte[] ipv4Bytes = new byte[4]; for (int i = 0; i < 4; i++) ipv4Bytes[i] = response[i + 4]; IPAddress ipv4 = new IPAddress(ipv4Bytes); addr = ipv4.ToString(); byte[] portBytesIpv4 = new byte[2]; portBytesIpv4[0] = response[9]; portBytesIpv4[1] = response[8]; port = BitConverter.ToInt16(portBytesIpv4, 0); break; case SOCKS5_ADDRTYPE_IPV6: byte[] ipv6Bytes = new byte[16]; for (int i = 0; i < 16; i++) ipv6Bytes[i] = response[i + 4]; IPAddress ipv6 = new IPAddress(ipv6Bytes); addr = ipv6.ToString(); byte[] portBytesIpv6 = new byte[2]; portBytesIpv6[0] = response[21]; portBytesIpv6[1] = response[20]; port = BitConverter.ToInt16(portBytesIpv6, 0); break; } switch (replyCode) { case SOCKS5_CMD_REPLY_GENERAL_SOCKS_SERVER_FAILURE: proxyErrorText = "a general socks destination failure occurred"; break; case SOCKS5_CMD_REPLY_CONNECTION_NOT_ALLOWED_BY_RULESET: proxyErrorText = "the connection is not allowed by proxy destination rule set"; break; case SOCKS5_CMD_REPLY_NETWORK_UNREACHABLE: proxyErrorText = "the network was unreachable"; break; case SOCKS5_CMD_REPLY_HOST_UNREACHABLE: proxyErrorText = "the host was unreachable"; break; case SOCKS5_CMD_REPLY_CONNECTION_REFUSED: proxyErrorText = "the connection was refused by the remote network"; break; case SOCKS5_CMD_REPLY_TTL_EXPIRED: proxyErrorText = "the time to live (TTL) has expired"; break; case SOCKS5_CMD_REPLY_COMMAND_NOT_SUPPORTED: proxyErrorText = "the command issued by the proxy client is not supported by the proxy destination"; break; case SOCKS5_CMD_REPLY_ADDRESS_TYPE_NOT_SUPPORTED: proxyErrorText = "the address type specified is not supported"; break; default: proxyErrorText = String.Format(CultureInfo.InvariantCulture, "that an unknown reply with the code value '{0}' was received by the destination", replyCode.ToString(CultureInfo.InvariantCulture)); break; } string exceptionMsg = String.Format(CultureInfo.InvariantCulture, "The {0} concerning destination host {1} port number {2}. The destination reported the host as {3} port {4}.", proxyErrorText, destinationHost, destinationPort, addr, port.ToString(CultureInfo.InvariantCulture)); throw new ProxyException(exceptionMsg); } #region "Async Methods" private BackgroundWorker _asyncWorker; private Exception _asyncException; bool _asyncCancelled; /// /// Gets a value indicating whether an asynchronous operation is running. /// /// Returns true if an asynchronous operation is running; otherwise, false. /// public bool IsBusy { get { return _asyncWorker == null ? false : _asyncWorker.IsBusy; } } /// /// Gets a value indicating whether an asynchronous operation is cancelled. /// /// Returns true if an asynchronous operation is cancelled; otherwise, false. /// public bool IsAsyncCancelled { get { return _asyncCancelled; } } /// /// Cancels any asychronous operation that is currently active. /// public void CancelAsync() { if (_asyncWorker != null && !_asyncWorker.CancellationPending && _asyncWorker.IsBusy) { _asyncCancelled = true; _asyncWorker.CancelAsync(); } } private void CreateAsyncWorker() { if (_asyncWorker != null) _asyncWorker.Dispose(); _asyncException = null; _asyncWorker = null; _asyncCancelled = false; _asyncWorker = new BackgroundWorker(); } /// /// Event handler for CreateConnectionAsync method completed. /// public event EventHandler CreateConnectionAsyncCompleted; /// /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns TcpClient object that can be used normally to communicate /// with the destination server. /// /// /// This method instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// public void CreateConnectionAsync(string destinationHost, int destinationPort) { if (_asyncWorker != null && _asyncWorker.IsBusy) throw new InvalidOperationException("The Socks4 object is already busy executing another asynchronous operation. You can only execute one asychronous method at a time."); CreateAsyncWorker(); _asyncWorker.WorkerSupportsCancellation = true; _asyncWorker.DoWork += new DoWorkEventHandler(CreateConnectionAsync_DoWork); _asyncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CreateConnectionAsync_RunWorkerCompleted); Object[] args = new Object[2]; args[0] = destinationHost; args[1] = destinationPort; _asyncWorker.RunWorkerAsync(args); } private void CreateConnectionAsync_DoWork(object sender, DoWorkEventArgs e) { try { Object[] args = (Object[])e.Argument; e.Result = CreateConnection((string)args[0], (int)args[1]); } catch (Exception ex) { _asyncException = ex; } } private void CreateConnectionAsync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (CreateConnectionAsyncCompleted != null) CreateConnectionAsyncCompleted(this, new CreateConnectionAsyncCompletedEventArgs(_asyncException, _asyncCancelled, (TcpClient)e.Result)); } #endregion } } smuxi-0.11/lib/StarkSoftProxy/Exceptions/0000755000175000017500000000000012204443216021245 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/StarkSoftProxy/Exceptions/ProxyException.cs0000644000175000017500000000475012204443216024602 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Runtime.Serialization; namespace Starksoft.Net.Proxy { /// /// This exception is thrown when a general, unexpected proxy error. /// [Serializable()] public class ProxyException : Exception { /// /// Constructor. /// public ProxyException() { } /// /// Constructor. /// /// Exception message text. public ProxyException(string message) : base(message) { } /// /// Constructor. /// /// Exception message text. /// The inner exception object. public ProxyException(string message, Exception innerException) : base(message, innerException) { } /// /// Constructor. /// /// Serialization information. /// Stream context information. protected ProxyException(SerializationInfo info, StreamingContext context) : base(info, context) { } } }smuxi-0.11/lib/StarkSoftProxy/IProxyClient.cs0000644000175000017500000000771512204443216022056 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Collections.Generic; using System.Text; using System.Net.Sockets; namespace Starksoft.Net.Proxy { /// /// Proxy client interface. This is the interface that all proxy clients must implement. /// public interface IProxyClient { /// /// Event handler for CreateConnectionAsync method completed. /// event EventHandler CreateConnectionAsyncCompleted; /// /// Gets or sets proxy host name or IP address. /// string ProxyHost { get; set; } /// /// Gets or sets proxy port number. /// int ProxyPort { get; set; } /// /// Gets String representing the name of the proxy. /// string ProxyName { get; } /// /// Gets or set the TcpClient object if one was specified in the constructor. /// TcpClient TcpClient { get; set; } /// /// Creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// TcpClient CreateConnection(string destinationHost, int destinationPort); /// /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port. /// /// Destination host name or IP address. /// Port number to connect to on the destination host. /// /// Returns an open TcpClient object that can be used normally to communicate /// with the destination server /// /// /// This method creates a connection to the proxy server and instructs the proxy server /// to make a pass through connection to the specified destination host on the specified /// port. /// void CreateConnectionAsync(string destinationHost, int destinationPort); } } smuxi-0.11/lib/StarkSoftProxy/Utils.cs0000644000175000017500000000174512204443216020562 0ustar00meebeymeebey00000000000000using System; using System.Text; using System.Globalization; using System.Net.Sockets; namespace Starksoft.Net.Proxy { internal static class Utils { internal static string GetHost(TcpClient client) { if (client == null) throw new ArgumentNullException("client"); string host = ""; try { host = ((System.Net.IPEndPoint)client.Client.RemoteEndPoint).Address.ToString(); } catch { }; return host; } internal static string GetPort(TcpClient client) { if (client == null) throw new ArgumentNullException("client"); string port = ""; try { port = ((System.Net.IPEndPoint)client.Client.RemoteEndPoint).Port.ToString(CultureInfo.InvariantCulture); } catch { }; return port; } } } smuxi-0.11/lib/StarkSoftProxy/Socks4aProxyClient.cs0000644000175000017500000002571212204443216023172 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Text; using System.Net; using System.Net.Sockets; using System.IO; namespace Starksoft.Net.Proxy { /// /// Socks4a connection proxy class. This class implements the Socks4a standard proxy protocol /// which is an extension of the Socks4 protocol /// /// /// In Socks version 4A if the client cannot resolve the destination host's domain name /// to find its IP address the server will attempt to resolve it. /// public class Socks4aProxyClient : Socks4ProxyClient { private const string PROXY_NAME = "SOCKS4a"; /// /// Default constructor. /// public Socks4aProxyClient() : base() { } /// /// Creates a Socks4 proxy client object using the supplied TcpClient object connection. /// /// An open TcpClient object with an established connection. public Socks4aProxyClient(TcpClient tcpClient) : base(tcpClient) { } /// /// Create a Socks4a proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. /// Proxy user identification information for an IDENTD server. public Socks4aProxyClient(string proxyHost, string proxyUserId) : base(proxyHost, proxyUserId) { } /// /// Create a Socks4a proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. /// Proxy user identification information. public Socks4aProxyClient(string proxyHost, int proxyPort, string proxyUserId) : base(proxyHost, proxyPort, proxyUserId) { } /// /// Create a Socks4 proxy client object. The default proxy port 1080 is used. /// /// Host name or IP address of the proxy server. public Socks4aProxyClient(string proxyHost) : base(proxyHost) { } /// /// Create a Socks4a proxy client object. /// /// Host name or IP address of the proxy server. /// Port used to connect to proxy server. public Socks4aProxyClient(string proxyHost, int proxyPort) : base(proxyHost, proxyPort) { } /// /// Gets String representing the name of the proxy. /// /// This property will always return the value 'SOCKS4a' public override string ProxyName { get { return PROXY_NAME; } } /// /// Sends a command to the proxy server. /// /// Proxy server data stream. /// Proxy byte command to execute. /// Destination host name or IP address. /// Destination port number /// IDENTD user ID value. /// /// This method override the SendCommand message in the Sock4ProxyClient object. The override adds support for the /// Socks4a extensions which allow the proxy client to optionally command the proxy server to resolve the /// destination host IP address. /// internal override void SendCommand(NetworkStream proxy, byte command, string destinationHost, int destinationPort, string userId) { // PROXY SERVER REQUEST //Please read SOCKS4.protocol first for an description of the version 4 //protocol. This extension is intended to allow the use of SOCKS on hosts //which are not capable of resolving all domain names. // //In version 4, the client sends the following packet to the SOCKS server //to request a CONNECT or a BIND operation: // // +----+----+----+----+----+----+----+----+----+----+....+----+ // | VN | CD | DSTPORT | DSTIP | USERID |NULL| // +----+----+----+----+----+----+----+----+----+----+....+----+ // # of bytes: 1 1 2 4 variable 1 // //VN is the SOCKS protocol version number and should be 4. CD is the //SOCKS command code and should be 1 for CONNECT or 2 for BIND. NULL //is a byte of all zero bits. // //For version 4A, if the client cannot resolve the destination host's //domain name to find its IP address, it should set the first three bytes //of DSTIP to NULL and the last byte to a non-zero value. (This corresponds //to IP address 0.0.0.x, with x nonzero. As decreed by IANA -- The //Internet Assigned Numbers Authority -- such an address is inadmissible //as a destination IP address and thus should never occur if the client //can resolve the domain name.) Following the NULL byte terminating //USERID, the client must sends the destination domain name and termiantes //it with another NULL byte. This is used for both CONNECT and BIND requests. // //A server using protocol 4A must check the DSTIP in the request packet. //If it represent address 0.0.0.x with nonzero x, the server must read //in the domain name that the client sends in the packet. The server //should resolve the domain name and make connection to the destination //host if it can. // //SOCKSified sockd may pass domain names that it cannot resolve to //the next-hop SOCKS server. // userId needs to be a zero length string so that the GetBytes method // works properly if (userId == null) userId = ""; byte[] destIp = {0,0,0,1}; // build the invalid ip address as specified in the 4a protocol byte[] destPort = GetDestinationPortBytes(destinationPort); byte[] userIdBytes = ASCIIEncoding.ASCII.GetBytes(userId); byte[] hostBytes = ASCIIEncoding.ASCII.GetBytes(destinationHost); byte[] request = new byte[10 + userIdBytes.Length + hostBytes.Length]; // set the bits on the request byte array request[0] = SOCKS4_VERSION_NUMBER; request[1] = command; destPort.CopyTo(request, 2); destIp.CopyTo(request, 4); userIdBytes.CopyTo(request, 8); // copy the userid to the request byte array request[8 + userIdBytes.Length] = 0x00; // null (byte with all zeros) terminator for userId hostBytes.CopyTo(request, 9 + userIdBytes.Length); // copy the host name to the request byte array request[9 + userIdBytes.Length + hostBytes.Length] = 0x00; // null (byte with all zeros) terminator for userId // send the connect request proxy.Write(request, 0, request.Length); // wait for the proxy server to send a response base.WaitForData(proxy); // PROXY SERVER RESPONSE // The SOCKS server checks to see whether such a request should be granted // based on any combination of source IP address, destination IP address, // destination port number, the userid, and information it may obtain by // consulting IDENT, cf. RFC 1413. If the request is granted, the SOCKS // server makes a connection to the specified port of the destination host. // A reply packet is sent to the client when this connection is established, // or when the request is rejected or the operation fails. // // +----+----+----+----+----+----+----+----+ // | VN | CD | DSTPORT | DSTIP | // +----+----+----+----+----+----+----+----+ // # of bytes: 1 1 2 4 // // VN is the version of the reply code and should be 0. CD is the result // code with one of the following values: // // 90: request granted // 91: request rejected or failed // 92: request rejected becuase SOCKS server cannot connect to // identd on the client // 93: request rejected because the client program and identd // report different user-ids // // The remaining fields are ignored. // // The SOCKS server closes its connection immediately after notifying // the client of a failed or rejected request. For a successful request, // the SOCKS server gets ready to relay traffic on both directions. This // enables the client to do I/O on its connection as if it were directly // connected to the application server. // create an 8 byte response array byte[] response = new byte[8]; // read the resonse from the network stream proxy.Read(response, 0, 8); // evaluate the reply code for an error condition if (response[1] != SOCKS4_CMD_REPLY_REQUEST_GRANTED) HandleProxyCommandError(response, destinationHost, destinationPort); } } } smuxi-0.11/lib/StarkSoftProxy/ProxyClientFactory.cs0000644000175000017500000002113412204443216023264 0ustar00meebeymeebey00000000000000/* * Authors: Benton Stark * * Copyright (c) 2007-2009 Starksoft, LLC (http://www.starksoft.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ using System; using System.Collections.Generic; using System.Text; using System.Net.Sockets; namespace Starksoft.Net.Proxy { /// /// The type of proxy. /// public enum ProxyType { /// /// No Proxy specified. Note this option will cause an exception to be thrown if used to create a proxy object by the factory. /// None, /// /// HTTP Proxy /// Http, /// /// SOCKS v4 Proxy /// Socks4, /// /// SOCKS v4a Proxy /// Socks4a, /// /// SOCKS v5 Proxy /// Socks5 } /// /// Factory class for creating new proxy client objects. /// /// /// /// // create an instance of the client proxy factory /// ProxyClientFactory factory = new ProxyClientFactory(); /// /// // use the proxy client factory to generically specify the type of proxy to create /// // the proxy factory method CreateProxyClient returns an IProxyClient object /// IProxyClient proxy = factory.CreateProxyClient(ProxyType.Http, "localhost", 6588); /// /// // create a connection through the proxy to www.starksoft.com over port 80 /// System.Net.Sockets.TcpClient tcpClient = proxy.CreateConnection("www.starksoft.com", 80); /// /// public class ProxyClientFactory { /// /// Factory method for creating new proxy client objects. /// /// The type of proxy client to create. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type) { if (type == ProxyType.None) throw new ArgumentOutOfRangeException("type"); switch (type) { case ProxyType.Http: return new HttpProxyClient(); case ProxyType.Socks4: return new Socks4ProxyClient(); case ProxyType.Socks4a: return new Socks4aProxyClient(); case ProxyType.Socks5: return new Socks5ProxyClient(); default: throw new ProxyException(String.Format("Unknown proxy type {0}.", type.ToString())); } } /// /// Factory method for creating new proxy client objects using an existing TcpClient connection object. /// /// The type of proxy client to create. /// Open TcpClient object. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type, TcpClient tcpClient) { if (type == ProxyType.None) throw new ArgumentOutOfRangeException("type"); switch (type) { case ProxyType.Http: return new HttpProxyClient(tcpClient); case ProxyType.Socks4: return new Socks4ProxyClient(tcpClient); case ProxyType.Socks4a: return new Socks4aProxyClient(tcpClient); case ProxyType.Socks5: return new Socks5ProxyClient(tcpClient); default: throw new ProxyException(String.Format("Unknown proxy type {0}.", type.ToString())); } } /// /// Factory method for creating new proxy client objects. /// /// The type of proxy client to create. /// The proxy host or IP address. /// The proxy port number. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type, string proxyHost, int proxyPort) { if (type == ProxyType.None) throw new ArgumentOutOfRangeException("type"); switch (type) { case ProxyType.Http: return new HttpProxyClient(proxyHost, proxyPort); case ProxyType.Socks4: return new Socks4ProxyClient(proxyHost, proxyPort); case ProxyType.Socks4a: return new Socks4aProxyClient(proxyHost, proxyPort); case ProxyType.Socks5: return new Socks5ProxyClient(proxyHost, proxyPort); default: throw new ProxyException(String.Format("Unknown proxy type {0}.", type.ToString())); } } /// /// Factory method for creating new proxy client objects. /// /// The type of proxy client to create. /// The proxy host or IP address. /// The proxy port number. /// The proxy username. This parameter is only used by Socks4 and Socks5 proxy objects. /// The proxy user password. This parameter is only used Socks5 proxy objects. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword) { if (type == ProxyType.None) throw new ArgumentOutOfRangeException("type"); switch (type) { case ProxyType.Http: return new HttpProxyClient(proxyHost, proxyPort); case ProxyType.Socks4: return new Socks4ProxyClient(proxyHost, proxyPort, proxyUsername); case ProxyType.Socks4a: return new Socks4aProxyClient(proxyHost, proxyPort, proxyUsername); case ProxyType.Socks5: return new Socks5ProxyClient(proxyHost, proxyPort, proxyUsername, proxyPassword); default: throw new ProxyException(String.Format("Unknown proxy type {0}.", type.ToString())); } } /// /// Factory method for creating new proxy client objects. /// /// The type of proxy client to create. /// Open TcpClient object. /// The proxy host or IP address. /// The proxy port number. /// The proxy username. This parameter is only used by Socks4 and Socks5 proxy objects. /// The proxy user password. This parameter is only used Socks5 proxy objects. /// Proxy client object. public IProxyClient CreateProxyClient(ProxyType type, TcpClient tcpClient, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword) { IProxyClient c = CreateProxyClient(type, proxyHost, proxyPort, proxyUsername, proxyPassword); c.TcpClient = tcpClient; return c; } } } smuxi-0.11/lib/ServiceStack/0000755000175000017500000000000012311344237016532 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/0000755000175000017500000000000012311344237017321 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/0000755000175000017500000000000012311344240023130 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/0000755000175000017500000000000012146506550025057 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/ClientFactory.cs0000644000175000017500000000221412146506550030153 0ustar00meebeymeebey00000000000000using System; using ServiceStack.Common; using ServiceStack.Service; using ServiceStack.ServiceClient.Web; namespace ServiceStack.Messaging { public static class ClientFactory { public static IOneWayClient Create(string endpointUrl) { if (endpointUrl.IsNullOrEmpty() || !endpointUrl.StartsWith("http")) return null; if (endpointUrl.IndexOf("format=") == -1 || endpointUrl.IndexOf("format=json") >= 0) return new JsonServiceClient(endpointUrl); if (endpointUrl.IndexOf("format=xml") >= 0) return new XmlServiceClient(endpointUrl); if (endpointUrl.IndexOf("format=jsv") >= 0) return new JsvServiceClient(endpointUrl); if (endpointUrl.IndexOf("format=soap11") >= 0) return new Soap11ServiceClient(endpointUrl); if (endpointUrl.IndexOf("format=soap12") >= 0) return new Soap12ServiceClient(endpointUrl); throw new NotImplementedException("could not find service client for " + endpointUrl); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/IMessageHandlerFactory.cs0000644000175000017500000000035612146506550031735 0ustar00meebeymeebey00000000000000namespace ServiceStack.Messaging { /// /// Encapsulates creating a new message handler /// public interface IMessageHandlerFactory { IMessageHandler CreateMessageHandler(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/IMessageHandlerDisposer.cs0000644000175000017500000000025212146506550032111 0ustar00meebeymeebey00000000000000namespace ServiceStack.Messaging { public interface IMessageHandlerDisposer { void DisposeMessageHandler(IMessageHandler messageHandler); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/TransientMessageServiceBase.cs0000644000175000017500000001063512146506550033003 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ServiceStack.Messaging { public abstract class TransientMessageServiceBase : IMessageService, IMessageHandlerDisposer { private bool isRunning; public const int DefaultRetryCount = 2; //Will be a total of 3 attempts public int RetryCount { get; protected set; } public TimeSpan? RequestTimeOut { get; protected set; } public int PoolSize { get; protected set; } //use later public abstract IMessageFactory MessageFactory { get; } protected TransientMessageServiceBase() : this(DefaultRetryCount, null) { } protected TransientMessageServiceBase(int retryAttempts, TimeSpan? requestTimeOut) { this.RetryCount = retryAttempts; this.RequestTimeOut = requestTimeOut; } private readonly Dictionary handlerMap = new Dictionary(); private IMessageHandler[] messageHandlers; public void RegisterHandler(Func, object> processMessageFn) { RegisterHandler(processMessageFn, null); } public void RegisterHandler(Func, object> processMessageFn, Action, Exception> processExceptionEx) { if (handlerMap.ContainsKey(typeof(T))) { throw new ArgumentException("Message handler has already been registered for type: " + typeof(T).Name); } handlerMap[typeof(T)] = CreateMessageHandlerFactory(processMessageFn, processExceptionEx); } public IMessageHandlerStats GetStats() { var total = new MessageHandlerStats("All Handlers"); messageHandlers.ToList().ForEach(x => total.Add(x.GetStats())); return total; } public string GetStatus() { return isRunning ? "Started" : "Stopped"; } public string GetStatsDescription() { var sb = new StringBuilder("#MQ HOST STATS:\n"); sb.AppendLine("==============="); foreach (var messageHandler in messageHandlers) { sb.AppendLine(messageHandler.GetStats().ToString()); sb.AppendLine("---------------"); } return sb.ToString(); } protected IMessageHandlerFactory CreateMessageHandlerFactory( Func, object> processMessageFn, Action, Exception> processExceptionEx) { return new MessageHandlerFactory(this, processMessageFn, processExceptionEx) { RetryCount = RetryCount, }; } public virtual void Start() { if (isRunning) return; isRunning = true; this.messageHandlers = this.handlerMap.Values.ToList().ConvertAll( x => x.CreateMessageHandler()).ToArray(); using (var mqClient = MessageFactory.CreateMessageQueueClient()) { foreach (var handler in messageHandlers) { handler.Process(mqClient); } } this.Stop(); } public virtual void Stop() { isRunning = false; messageHandlers = null; } public virtual void Dispose() { Stop(); } public virtual void DisposeMessageHandler(IMessageHandler messageHandler) { lock (messageHandlers) { if (!isRunning) return; var allHandlersAreDisposed = true; for (var i = 0; i < messageHandlers.Length; i++) { if (messageHandlers[i] == messageHandler) { messageHandlers[i] = null; } allHandlersAreDisposed = allHandlersAreDisposed && messageHandlers[i] == null; } if (allHandlersAreDisposed) { Stop(); } } } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/MessageHandler.cs0000644000175000017500000002041512146506550030272 0ustar00meebeymeebey00000000000000using System; using System.Text; using ServiceStack.Common; using ServiceStack.Logging; using ServiceStack.Service; using ServiceStack.ServiceClient.Web; using ServiceStack.Text; using StringExtensions = ServiceStack.Common.StringExtensions; namespace ServiceStack.Messaging { /// /// Processes all messages in a Normal and Priority Queue. /// Expects to be called in 1 thread. i.e. Non Thread-Safe. /// /// public class MessageHandler : IMessageHandler, IDisposable { private static readonly ILog Log = LogManager.GetLogger(typeof(MessageHandler)); public const int DefaultRetryCount = 2; //Will be a total of 3 attempts private readonly IMessageService messageService; private readonly Func, object> processMessageFn; private readonly Action, Exception> processInExceptionFn; public Func ReplyClientFactory { get; set; } private readonly int retryCount; public int TotalMessagesProcessed { get; private set; } public int TotalMessagesFailed { get; private set; } public int TotalRetries { get; private set; } public int TotalNormalMessagesReceived { get; private set; } public int TotalPriorityMessagesReceived { get; private set; } public int TotalOutMessagesReceived { get; private set; } public string[] ProcessQueueNames { get; set; } public MessageHandler(IMessageService messageService, Func, object> processMessageFn) : this(messageService, processMessageFn, null, DefaultRetryCount) {} private IMessageQueueClient MqClient { get; set; } public MessageHandler(IMessageService messageService, Func, object> processMessageFn, Action, Exception> processInExceptionFn, int retryCount) { if (messageService == null) throw new ArgumentNullException("messageService"); if (processMessageFn == null) throw new ArgumentNullException("processMessageFn"); this.messageService = messageService; this.processMessageFn = processMessageFn; this.processInExceptionFn = processInExceptionFn ?? DefaultInExceptionHandler; this.retryCount = retryCount; this.ReplyClientFactory = ClientFactory.Create; this.ProcessQueueNames = new[] { QueueNames.Priority, QueueNames.In }; } public Type MessageType { get { return typeof(T); } } public void Process(IMessageQueueClient mqClient) { foreach (var processQueueName in ProcessQueueNames) { ProcessQueue(mqClient, processQueueName); } } public int ProcessQueue(IMessageQueueClient mqClient, string queueName, Func doNext = null) { var msgsProcessed = 0; try { byte[] messageBytes; while ((messageBytes = mqClient.GetAsync(queueName)) != null) { var message = messageBytes.ToMessage(); ProcessMessage(mqClient, message); this.TotalNormalMessagesReceived++; msgsProcessed++; if (doNext != null && !doNext()) return msgsProcessed; } } catch (Exception ex) { var lastEx = ex; Log.Error("Error serializing message from mq server: " + lastEx.Message, ex); } return msgsProcessed; } public IMessageHandlerStats GetStats() { return new MessageHandlerStats(typeof(T).Name, TotalMessagesProcessed, TotalMessagesFailed, TotalRetries, TotalNormalMessagesReceived, TotalPriorityMessagesReceived); } private void DefaultInExceptionHandler(IMessage message, Exception ex) { Log.Error("Message exception handler threw an error", ex); if (!(ex is UnRetryableMessagingException)) { if (message.RetryAttempts < retryCount) { message.RetryAttempts++; this.TotalRetries++; message.Error = new MessagingException(ex.Message, ex).ToMessageError(); MqClient.Publish(QueueNames.In, message.ToBytes()); return; } } MqClient.Publish(QueueNames.Dlq, message.ToBytes()); } public void ProcessMessage(IMessageQueueClient mqClient, Message message) { this.MqClient = mqClient; try { var response = processMessageFn(message); var responseEx = response as Exception; if (responseEx != null) throw responseEx; this.TotalMessagesProcessed++; //If there's no response publish the request message to its OutQ if (response == null) { var messageOptions = (MessageOption)message.Options; if (messageOptions.Has(MessageOption.NotifyOneWay)) { mqClient.Notify(QueueNames.Out, message.ToBytes()); } } else { //If there is a response send it to the typed response OutQ var mqReplyTo = message.ReplyTo; if (mqReplyTo == null) { var responseType = response.GetType(); #if __MonoCS__ // work around Mono 2.6.7 compiler bug: // System.Type.IsUserType' is inaccessible due to its protection level if (!StringExtensions.IsUserType(responseType)) return; #else if (!responseType.IsUserType()) return; #endif mqReplyTo = new QueueNames(responseType).In; } var replyClient = ReplyClientFactory(mqReplyTo); if (replyClient != null) { try { replyClient.SendOneWay(mqReplyTo, response); return; } catch (Exception ex) { Log.Error("Could not send response to '{0}' with client '{1}'" .Fmt(mqReplyTo, replyClient.GetType().Name), ex); var responseType = response.GetType(); #if __MonoCS__ if (!StringExtensions.IsUserType(responseType)) return; #else if (!responseType.IsUserType()) return; #endif mqReplyTo = new QueueNames(responseType).In; } } //Otherwise send to our trusty response Queue (inc if replyClient fails) var responseMessage = MessageFactory.Create(response); responseMessage.ReplyId = message.Id; mqClient.Publish(mqReplyTo, responseMessage.ToBytes()); } } catch (Exception ex) { try { TotalMessagesFailed++; processInExceptionFn(message, ex); } catch (Exception exHandlerEx) { Log.Error("Message exception handler threw an error", exHandlerEx); } } } public void Dispose() { var shouldDispose = messageService as IMessageHandlerDisposer; if (shouldDispose != null) shouldDispose.DisposeMessageHandler(this); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/IMessageHandler.cs0000644000175000017500000000231012146506550030375 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Messaging { /// /// Single threaded message handler that can process all messages /// of a particular message type. /// public interface IMessageHandler { /// /// The type of the message this handler processes /// Type MessageType { get; } /// /// Process all messages pending /// /// void Process(IMessageQueueClient mqClient); /// /// Process messages from a single queue. /// /// /// The queue to process /// A predicate on whether to continue processing the next message if any /// int ProcessQueue(IMessageQueueClient mqClient, string queueName, Func doNext = null); /// /// Get Current Stats for this Message Handler /// /// IMessageHandlerStats GetStats(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/InMemoryTransientMessageService.cs0000644000175000017500000000210312146506550033657 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT using System; using System.Collections; namespace ServiceStack.Messaging { public class InMemoryTransientMessageService : TransientMessageServiceBase { internal InMemoryTransientMessageFactory Factory { get; set; } public InMemoryTransientMessageService() : this(null) { } public InMemoryTransientMessageService(InMemoryTransientMessageFactory factory) { this.Factory = factory ?? new InMemoryTransientMessageFactory(this); this.Factory.MqFactory.MessageReceived += factory_MessageReceived; } void factory_MessageReceived(object sender, EventArgs e) { //var Factory = (MessageQueueClientFactory) sender; this.Start(); } public override IMessageFactory MessageFactory { get { return Factory; } } public MessageQueueClientFactory MessageQueueFactory { get { return Factory.MqFactory; } } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/MessageExtensions.cs0000644000175000017500000000576212146506550031064 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Reflection; using System.Threading; using ServiceStack.Text; namespace ServiceStack.Messaging { public static class MessageExtensions { public static string ToString(byte[] bytes) { #if !SILVERLIGHT return System.Text.Encoding.UTF8.GetString(bytes); #else return System.Text.Encoding.UTF8.GetString(bytes, 0, bytes.Length); #endif } private static Dictionary ToMessageFnCache = new Dictionary(); internal static ToMessageDelegate GetToMessageFn(Type type) { ToMessageDelegate toMessageFn; ToMessageFnCache.TryGetValue(type, out toMessageFn); if (toMessageFn != null) return toMessageFn; var genericType = typeof(MessageExtensions<>).MakeGenericType(type); var mi = genericType.GetMethod("ConvertToMessage", BindingFlags.Public | BindingFlags.Static); toMessageFn = (ToMessageDelegate)Delegate.CreateDelegate(typeof(ToMessageDelegate), mi); Dictionary snapshot, newCache; do { snapshot = ToMessageFnCache; newCache = new Dictionary(ToMessageFnCache); newCache[type] = toMessageFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref ToMessageFnCache, newCache, snapshot), snapshot)); return toMessageFn; } public static IMessage ToMessage(this byte[] bytes, Type ofType) { var msgFn = GetToMessageFn(ofType); var msg = msgFn(bytes); return msg; } public static Message ToMessage(this byte[] bytes) { var messageText = ToString(bytes); return JsonSerializer.DeserializeFromString>(messageText); } public static byte[] ToBytes(this IMessage message) { var serializedMessage = JsonSerializer.SerializeToString((object)message); return System.Text.Encoding.UTF8.GetBytes(serializedMessage); } public static byte[] ToBytes(this IMessage message) { var serializedMessage = JsonSerializer.SerializeToString(message); return System.Text.Encoding.UTF8.GetBytes(serializedMessage); } public static string ToInQueueName(this IMessage message) { return message.Priority > 0 ? QueueNames.Priority : QueueNames.In; } } internal delegate IMessage ToMessageDelegate(object param); internal static class MessageExtensions { public static IMessage ConvertToMessage(object oBytes) { var bytes = (byte[]) oBytes; return bytes.ToMessage(); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/InMemoryTransientMessageFactory.cs0000644000175000017500000000427412146506550033701 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT using System; using ServiceStack.Logging; namespace ServiceStack.Messaging { public class InMemoryTransientMessageFactory : IMessageFactory { private static readonly ILog Log = LogManager.GetLogger(typeof(InMemoryTransientMessageFactory)); private readonly InMemoryTransientMessageService transientMessageService; internal MessageQueueClientFactory MqFactory { get; set; } public InMemoryTransientMessageFactory() : this(null) { } public InMemoryTransientMessageFactory(InMemoryTransientMessageService transientMessageService) { this.transientMessageService = transientMessageService ?? new InMemoryTransientMessageService(); this.MqFactory = new MessageQueueClientFactory(); } public IMessageProducer CreateMessageProducer() { return new InMemoryMessageProducer(this); } public IMessageQueueClient CreateMessageQueueClient() { return new InMemoryMessageQueueClient(MqFactory); } public IMessageService CreateMessageService() { return transientMessageService; } public void Dispose() { Log.DebugFormat("Disposing InMemoryTransientMessageFactory..."); } internal class InMemoryMessageProducer : IMessageProducer { private readonly InMemoryTransientMessageFactory parent; public InMemoryMessageProducer(InMemoryTransientMessageFactory parent) { this.parent = parent; } public void Publish(T messageBody) { Publish((IMessage)new Message(messageBody)); } public void Publish(IMessage message) { this.parent.transientMessageService.MessageQueueFactory.PublishMessage(QueueNames.In, message); } public void Dispose() { Log.DebugFormat("Disposing InMemoryMessageProducer..."); } } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/MessageHandlerFactory.cs0000644000175000017500000000437612146506550031632 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Messaging { public class MessageHandlerFactory : IMessageHandlerFactory { public const int DefaultRetryCount = 2; //Will be a total of 3 attempts private readonly IMessageService messageService; public Func RequestFilter { get; set; } public Func ResponseFilter { get; set; } private readonly Func, object> processMessageFn; private readonly Action, Exception> processExceptionFn; public int RetryCount { get; set; } public MessageHandlerFactory(IMessageService messageService, Func, object> processMessageFn) : this(messageService, processMessageFn, null) { } public MessageHandlerFactory(IMessageService messageService, Func, object> processMessageFn, Action, Exception> processExceptionEx) { if (messageService == null) throw new ArgumentNullException("messageService"); if (processMessageFn == null) throw new ArgumentNullException("processMessageFn"); this.messageService = messageService; this.processMessageFn = processMessageFn; this.processExceptionFn = processExceptionEx; this.RetryCount = DefaultRetryCount; } public IMessageHandler CreateMessageHandler() { if (this.RequestFilter == null && this.ResponseFilter == null) { return new MessageHandler(messageService, processMessageFn, processExceptionFn, this.RetryCount); } return new MessageHandler(messageService, msg => { if (this.RequestFilter != null) msg = (IMessage) this.RequestFilter(msg); var result = this.processMessageFn(msg); if (this.ResponseFilter != null) result = this.ResponseFilter(result); return result; }, processExceptionFn, this.RetryCount); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/Rcon/0000755000175000017500000000000012146506550025760 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/Rcon/Server.cs0000644000175000017500000002515312146506550027563 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT using System; using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Linq; using System.Threading; using System.Text; using ServiceStack.Messaging; namespace ServiceStack.Messaging.Rcon { /// /// Hosting services via a binary-safe TCP-based protocol. /// public class Server : IMessageService { private readonly Dictionary handlerMap = new Dictionary(); private Dictionary messageHandlers = new Dictionary(); Socket _listener = null; IPEndPoint _localEndpoint = null; public Server(IPEndPoint localEndpoint) { _localEndpoint = localEndpoint; } #region IMessageService Members /// /// Factory to create consumers and producers that work with this service /// public IMessageFactory MessageFactory { get; private set; } /// /// Register DTOs and hanlders the MQ Host will process /// /// /// public void RegisterHandler(Func, object> processMessageFn) { RegisterHandler(processMessageFn, null); } public void RegisterHandler(Func, object> processMessageFn, Action, Exception> processExceptionEx) { if (handlerMap.ContainsKey(typeof(T))) { throw new ArgumentException("Message handler has already been registered for type: " + typeof(T).Name); } handlerMap[typeof(T)] = CreateMessageHandlerFactory(processMessageFn, processExceptionEx); } protected IMessageHandlerFactory CreateMessageHandlerFactory(Func, object> processMessageFn, Action, Exception> processExceptionEx) { return new MessageHandlerFactory(this, processMessageFn, processExceptionEx); } public IMessageHandlerStats GetStats() { return null; } /// /// Get Total Current Stats for all Message Handlers /// /// public string GetStatus() { return null; } /// /// Get a Stats dump /// /// public string GetStatsDescription() { return null; } /// /// Start the MQ Host. Stops the server and restarts if already started. /// public void Start() { if (this.messageHandlers.Count == 0) { foreach (var kvp in this.handlerMap) { this.messageHandlers[kvp.Key] = kvp.Value.CreateMessageHandler(); } } Stop(); _listener = new Socket(_localEndpoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp); _listener.Bind(_localEndpoint); _listener.Listen(60); var acceptArgs = new SocketAsyncEventArgs(); acceptArgs.Completed += new EventHandler(acceptArgs_Completed); if (!_listener.AcceptAsync(acceptArgs)) { ProcessAccept(_listener, acceptArgs); } } /// /// Stop the MQ Host if not already stopped. /// public void Stop() { if (_listener != null) { _listener.Close(); _listener = null; } } #endregion public void Dispose() { if (_listener != null) { try { _listener.Shutdown(SocketShutdown.Send); _listener.Close(); } catch (Exception) { } } } public void Notify(string queueName, byte[] message, Socket client, uint sequenceID) { var words = new byte[][] { Encoding.UTF8.GetBytes("notify"), Encoding.UTF8.GetBytes(queueName), message }; var sendToClient = PacketCodec.EncodePacket(false, true, sequenceID, words); Send(sendToClient, client); } public void Publish(string queueName, byte[] message, Socket client, uint sequenceID) { var words = new byte[][] { Encoding.UTF8.GetBytes("publish"), Encoding.UTF8.GetBytes(queueName), message }; var sendToClient = PacketCodec.EncodePacket(false, true, sequenceID, words); Send(sendToClient, client); } void acceptArgs_Completed(object sender, SocketAsyncEventArgs e) { ProcessAccept((Socket)sender, e); } void ProcessAccept(Socket serverSock, SocketAsyncEventArgs e) { var newSocket = e.AcceptSocket; var readEventArgs = new SocketAsyncEventArgs(); var state = new ClientSocketState(); readEventArgs.UserToken = state; readEventArgs.SetBuffer(state.Header, 0, state.Header.Length); readEventArgs.Completed += new EventHandler(readEventArgs_Completed); if (!newSocket.ReceiveAsync(readEventArgs)) { ProcessReceive(newSocket, readEventArgs); } e.AcceptSocket = null; serverSock.AcceptAsync(e); } void readEventArgs_Completed(object sender, SocketAsyncEventArgs e) { ProcessReceive((Socket)sender, e); } void ProcessReceive(Socket readingSock, SocketAsyncEventArgs e) { var userToken = (ClientSocketState)e.UserToken; if (e.BytesTransferred > 0 && e.SocketError == SocketError.Success) { if (!userToken.ReadHeader) { // if we've filled the buffer we can decode the header if (e.Offset + e.BytesTransferred == userToken.Header.Length) { userToken.ReadHeader = true; userToken.MessageLength = BitConverter.ToUInt32(userToken.Header, 4); userToken.CompleteMessage = new byte[userToken.MessageLength]; for (int i = 0; i < userToken.Header.Length; i++) { userToken.CompleteMessage[i] = userToken.Header[i]; } e.SetBuffer(userToken.CompleteMessage, userToken.Header.Length, userToken.CompleteMessage.Length - userToken.Header.Length); if (!readingSock.ReceiveAsync(e)) { ProcessReceive(readingSock, e); } } else { if (!readingSock.ReceiveAsync(e)) { ProcessReceive(readingSock, e); } } } else { if (e.Offset + e.BytesTransferred == userToken.MessageLength) { // copy buffer var fullPacket = userToken.CompleteMessage; // reset state userToken.ReadHeader = false; userToken.MessageLength = 0; // process the message ThreadPool.QueueUserWorkItem(delegate { ProcessPacket(fullPacket, readingSock, userToken); }); // start listening for more packets e.SetBuffer(userToken.Header, 0, userToken.Header.Length); if (!readingSock.ReceiveAsync(e)) { ProcessReceive(readingSock, e); } } else { if (!readingSock.ReceiveAsync(e)) { ProcessReceive(readingSock, e); } } } } else { // socket disconnected ClientDisconnected(readingSock); } } /// /// Processes a received packet. /// /// The packet. void ProcessPacket(byte[] packet, Socket client, ClientSocketState userToken) { var packetObj = PacketCodec.DecodePacket(packet); #if !SILVERLIGHT var type = Type.GetType(Encoding.UTF8.GetString(packetObj.Words[0])); #else var bytes = packetObj.Words[0]; var type = Type.GetType(Encoding.UTF8.GetString(bytes, 0, bytes.Length)); #endif if (messageHandlers.ContainsKey(type)) { messageHandlers[type].Process(new ProcessingClient(packetObj, client, this)); } } void Send(byte[] data, Socket client) { var sendEventArgs = new SocketAsyncEventArgs(); sendEventArgs.Completed += new EventHandler(sendEventArgs_Completed); sendEventArgs.SetBuffer(data, 0, data.Length); client.SendAsync(sendEventArgs); } void sendEventArgs_Completed(object sender, SocketAsyncEventArgs e) { ProcessSend((Socket)sender, e); } void ProcessSend(Socket sock, SocketAsyncEventArgs e) { if (e.SocketError != SocketError.Success) { ClientDisconnected(sock); } } void ClientDisconnected(Socket sock) { if (sock != null) { try { sock.Shutdown(SocketShutdown.Send); } catch (Exception) { } try { sock.Close(); } catch (Exception) { } } } } public class ClientSocketState { public byte[] Header = new byte[8]; public byte[] CompleteMessage = new byte[0]; public bool ReadHeader = false; public uint MessageLength = 0; } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/Rcon/PacketProcessingClient.cs0000644000175000017500000000644012146506550032716 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT using System; using System.Collections.Generic; using ServiceStack.Messaging; using System.Net.Sockets; using System.Text; namespace ServiceStack.Messaging.Rcon { /// /// Processing client used to interface with ServiceStack and allow a message to be processed. /// Not an actual client. /// internal class ProcessingClient : IMessageQueueClient { Packet thePacket; Socket theClient; Server theServer; bool givenPacket = false; public ProcessingClient(Packet packet, Socket client, Server server) { thePacket = packet; theClient = client; theServer = server; } public void Publish(T messageBody) { if (typeof(IMessage).IsAssignableFrom(typeof(T))) Publish((IMessage)messageBody); else Publish(new Message(messageBody)); } public void Publish(IMessage message) { var messageBytes = message.ToBytes(); Publish(new QueueNames(message.Body.GetType()).In, messageBytes); } public void Publish(IMessage message) { var messageBytes = message.ToBytes(); Publish(message.ToInQueueName(), messageBytes); } /// /// Publish the specified message into the durable queue @queueName /// /// /// public void Publish(string queueName, byte[] messageBytes) { theServer.Publish(queueName, messageBytes, theClient, thePacket.Sequence); } /// /// Publish the specified message into the transient queue @queueName /// /// /// public void Notify(string queueName, byte[] messageBytes) { theServer.Notify(queueName, messageBytes, theClient, thePacket.Sequence); } /// /// Synchronous blocking get. /// /// /// /// public byte[] Get(string queueName, TimeSpan? timeOut) { if (givenPacket) return null; var ret = thePacket.Words[1]; givenPacket = true; return ret; } /// /// Non blocking get message /// /// /// public byte[] GetAsync(string queueName) { return Get(queueName, TimeSpan.MinValue); } /// /// Blocking wait for notifications on any of the supplied channels /// /// /// public string WaitForNotifyOnAny(params string[] channelNames) { return null; } public void Dispose() { } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/Rcon/Packet.cs0000644000175000017500000000137612146506550027525 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ServiceStack.Messaging.Rcon { internal class Packet { /// /// True if the packet originated on the server. /// public bool FromServer { get; internal set; } /// /// True if the packet is a response from a sent packet. /// public bool IsResponse { get; internal set; } /// /// Sequence identifier. Unique to the connection. /// public uint Sequence { get; internal set; } /// /// Words. /// public byte[][] Words { get; internal set; } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/Rcon/PacketCodec.cs0000644000175000017500000001167712146506550030470 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ServiceStack.Messaging.Rcon { /// /// Contains methods required for encoding and decoding rcon packets. /// internal class PacketCodec { /// /// Decodes a packet. /// /// The packet. /// A packet object. internal static Packet DecodePacket(byte[] packet) { var header = DecodeHeader(packet); var words = DecodeWords(packet); bool fromServer = false; if (header[0] > 0) fromServer = true; bool isResponse = false; if (header[1] > 0) isResponse = true; uint idNumber = 0; if (header[2] > 0) idNumber = header[2]; return new Packet() { FromServer = fromServer, IsResponse = isResponse, Sequence = idNumber, Words = words }; } /// /// Decodes the packet header. /// /// /// private static uint[] DecodeHeader(byte[] packet) { var x = BitConverter.ToUInt32(packet, 0); return new uint[] { x & 0x80000000, x & 0x40000000, x & 0x3FFFFFFF }; } /// /// Decodes words in a packet. /// /// /// private static byte[][] DecodeWords(byte[] packet) { var wordCount = BitConverter.ToUInt32(packet, 8); var words = new byte[wordCount][]; var wordIndex = 0; int offset = 12; for (int i = 0; i < wordCount; i++) { var wordLen = BitConverter.ToInt32(packet, offset); var word = new byte[wordLen]; for (int j = 0; j < wordLen; j++) { word[j] = packet[offset + 4 + j]; } words[wordIndex++] = word; offset += 5 + wordLen; } return words; } /// /// Encodes a packet for transmission to the server. /// /// /// /// /// /// internal static byte[] EncodePacket(bool fromServer, bool isResponse, uint id, byte[][] words) { /* * Packet format: * 0 - 3 = header * 4 - 7 = size of packet * 8 -11 = number of words * 12+ = words * * Word format: * 0 - 3 = word length * 4 - n = word * n+1 = null (0x0) */ var encodedHeader = EncodeHeader(fromServer, isResponse, id); var encodedWordCount = BitConverter.GetBytes((uint)words.Length); var encodedWords = EncodeWords(words); var encodedPacketSize = BitConverter.GetBytes((uint)(encodedHeader.Length + encodedWordCount.Length + encodedWords.Length + 4)); // +4 for the packet size indicator var packet = new List(); packet.AddRange(encodedHeader); packet.AddRange(encodedPacketSize); packet.AddRange(encodedWordCount); packet.AddRange(encodedWords); return packet.ToArray(); } /// /// Encodes a packet header. /// /// /// /// /// private static byte[] EncodeHeader(bool fromServer, bool isResponse, uint id) { uint header = id & 0x3FFFFFFF; if (fromServer) header += 0x80000000; if (isResponse) header += 0x40000000; return BitConverter.GetBytes(header); } /// /// Encodes words. /// /// /// private static byte[] EncodeWords(byte[][] words) { var wordPacket = new List(); foreach (var word in words) { var encodedWord = new List(); encodedWord.AddRange(word); encodedWord.Add(0); var encodedLength = BitConverter.GetBytes((uint)word.Length); wordPacket.AddRange(encodedLength); wordPacket.AddRange(encodedWord); } return wordPacket.ToArray(); } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/Rcon/Client.cs0000644000175000017500000002331012146506550027524 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Net.Sockets; using System.Threading; namespace ServiceStack.Messaging.Rcon { /// /// Base rcon class. /// public class Client { #region Delegates /// /// Event delegate when disconnected from the server. /// /// public delegate void OnDisconnectedHandler(Client rcon); /// /// Delegate for async callbacks. /// /// /// public delegate void AsyncCallback(Client rcon, byte[] response); #endregion #region Events /// /// Disconnected event. /// public event OnDisconnectedHandler OnDisconnected; #endregion #region Fields /// /// Rcon connection socket. Always set to null when not connected. /// Socket _sock = null; /// /// Unique ID for each message. /// uint _sequenceID = 1; /// /// Registered callbacks. /// Dictionary _registeredCallbacks = new Dictionary(); #endregion #region Methods /// /// Create a new instance of rcon. /// /// Endpoint to connect to, usually the game server with query port. public Client(IPEndPoint rconEndpoint) { Endpoint = rconEndpoint; Connected = false; } /// /// Attempts to connect to the game server for rcon operations. /// /// True if connection established, false otherwise. public virtual bool Connect() { if (Connected) Disconnect(); Connected = false; _sequenceID = 1; try { _sock = new Socket(Endpoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp); _sock.Connect(Endpoint); var readEventArgs = new SocketAsyncEventArgs(); var state = new ClientSocketState(); readEventArgs.UserToken = state; readEventArgs.SetBuffer(state.Header, 0, state.Header.Length); readEventArgs.Completed += new EventHandler(readEventArgs_Completed); if (!_sock.ReceiveAsync(readEventArgs)) { ProcessReceive(_sock, readEventArgs); } Connected = true; return true; } catch (Exception ex) { LastException = ex; } Disconnect(); return false; } void readEventArgs_Completed(object sender, SocketAsyncEventArgs e) { ProcessReceive((Socket)sender, e); } void ProcessReceive(Socket readingSock, SocketAsyncEventArgs e) { var userToken = (ClientSocketState)e.UserToken; if (e.BytesTransferred > 0 && e.SocketError == SocketError.Success) { if (!userToken.ReadHeader) { // if we've filled the buffer we can decode the header if (e.Offset + e.BytesTransferred == userToken.Header.Length) { userToken.ReadHeader = true; userToken.MessageLength = BitConverter.ToUInt32(userToken.Header, 4); userToken.CompleteMessage = new byte[userToken.MessageLength]; for (int i = 0; i < userToken.Header.Length; i++) { userToken.CompleteMessage[i] = userToken.Header[i]; } e.SetBuffer(userToken.CompleteMessage, userToken.Header.Length, userToken.CompleteMessage.Length - userToken.Header.Length); if (!readingSock.ReceiveAsync(e)) { ProcessReceive(readingSock, e); } } else { if (!readingSock.ReceiveAsync(e)) { ProcessReceive(readingSock, e); } } } else { if (e.Offset + e.BytesTransferred == userToken.MessageLength) { // copy buffer var fullPacket = userToken.CompleteMessage; // reset state userToken.ReadHeader = false; userToken.MessageLength = 0; // process the message ProcessPacket(fullPacket, userToken); // start listening for more packets e.SetBuffer(userToken.Header, 0, userToken.Header.Length); if (!readingSock.ReceiveAsync(e)) { ProcessReceive(readingSock, e); } } else { if (!readingSock.ReceiveAsync(e)) { ProcessReceive(readingSock, e); } } } } else { // socket disconnected Disconnect(); } } /// /// Processes a received packet. /// /// The packet. void ProcessPacket(byte[] packet, ClientSocketState userToken) { var packetObj = PacketCodec.DecodePacket(packet); if (_registeredCallbacks.ContainsKey(packetObj.Sequence)) { var callback = _registeredCallbacks[packetObj.Sequence]; _registeredCallbacks.Remove(packetObj.Sequence); if (packetObj.Words.Length < 3) { callback(this, null); } else { callback(this, packetObj.Words[2]); } } } /// /// Disconnects from rcon. /// public virtual void Disconnect() { Connected = false; _sequenceID = 1; if (_sock != null) { if (OnDisconnected != null) OnDisconnected(this); // these exceptions aren't really anything to worry about try { _sock.Close(); } catch (Exception) { } _sock = null; } } public void Call(T request, AsyncCallback callback) { _registeredCallbacks[_sequenceID] = callback; IMessage message = new Message(request); InternalSend(new byte[][]{ Encoding.UTF8.GetBytes(request.GetType().AssemblyQualifiedName), message.ToBytes() }); } /// /// Sends message to the server. /// /// Words to send. protected virtual void InternalSend(byte[][] words) { if (!Connected) { LastException = new NotConnectedException(); throw LastException; } var packet = PacketCodec.EncodePacket(false, false, _sequenceID++, words); try { var sendEventArgs = new SocketAsyncEventArgs(); sendEventArgs.Completed += new EventHandler(sendEventArgs_Completed); sendEventArgs.SetBuffer(packet, 0, packet.Length); _sock.SendAsync(sendEventArgs); } catch (Exception ex) { Disconnect(); LastException = ex; throw LastException; } } void sendEventArgs_Completed(object sender, SocketAsyncEventArgs e) { ProcessSend((Socket)sender, e); } void ProcessSend(Socket sock, SocketAsyncEventArgs e) { if (e.SocketError != SocketError.Success) { Disconnect(); } } #endregion #region Properties /// /// Game server endpoint. /// public IPEndPoint Endpoint { get; protected set; } /// /// Last exception that occured during operation. /// public Exception LastException { get; protected set; } /// /// Connected? /// public bool Connected { get; protected set; } /// /// Gets the next unique ID to be used for transmisson. Read this before sending to pair responses to sent messages. /// public uint SequenceID { get { return _sequenceID; } } #endregion } /// /// Exception thrown when attempting to send on a non-connected service client. /// public class NotConnectedException : Exception { } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/InMemoryMessageQueueClient.cs0000644000175000017500000000261112146506550032616 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Messaging { public class InMemoryMessageQueueClient : IMessageQueueClient { private readonly MessageQueueClientFactory factory; public InMemoryMessageQueueClient(MessageQueueClientFactory factory) { this.factory = factory; } public void Publish(T messageBody) { factory.PublishMessage(QueueNames.In, new Message(messageBody)); } public void Publish(IMessage message) { factory.PublishMessage(QueueNames.In, message); } public void Publish(string queueName, byte[] messageBytes) { factory.PublishMessage(queueName, messageBytes); } public void Notify(string queueName, byte[] messageBytes) { factory.PublishMessage(queueName, messageBytes); } public byte[] GetAsync(string queueName) { return factory.GetMessageAsync(queueName); } public string WaitForNotifyOnAny(params string[] channelNames) { throw new NotImplementedException(); } public byte[] Get(string queueName, TimeSpan? timeOut) { throw new NotImplementedException(); } public void Dispose() { } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Messaging/MessageQueueClientFactory.cs0000644000175000017500000000365112146506550032473 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.Messaging { public class MessageQueueClientFactory : IMessageQueueClientFactory { public IMessageQueueClient CreateMessageQueueClient() { return new InMemoryMessageQueueClient(this); } readonly object syncLock = new object(); public event EventHandler MessageReceived; void InvokeMessageReceived(EventArgs e) { var received = MessageReceived; if (received != null) received(this, e); } private readonly Dictionary> queueMessageBytesMap = new Dictionary>(); public void PublishMessage(string queueName, IMessage message) { PublishMessage(queueName, message.ToBytes()); } public void PublishMessage(string queueName, byte[] messageBytes) { lock (syncLock) { Queue bytesQueue; if (!queueMessageBytesMap.TryGetValue(queueName, out bytesQueue)) { bytesQueue = new Queue(); queueMessageBytesMap[queueName] = bytesQueue; } bytesQueue.Enqueue(messageBytes); } InvokeMessageReceived(new EventArgs()); } public byte[] GetMessageAsync(string queueName) { lock (syncLock) { Queue bytesQueue; if (!queueMessageBytesMap.TryGetValue(queueName, out bytesQueue)) { return null; } var messageBytes = bytesQueue.Dequeue(); return messageBytes; } } public void Dispose() { } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/RequestContextExtensions.cs0000644000175000017500000000203512146506550030546 0ustar00meebeymeebey00000000000000using ServiceStack.ServiceHost; namespace ServiceStack.Common { public static class RequestContextExtensions { /// /// Store an entry in the IHttpRequest.Items Dictionary /// public static void SetItem(this IRequestContext requestContext, string key, object value) { if (requestContext == null) return; var httpReq = requestContext.Get(); if (httpReq != null) httpReq.Items[key] = value; } /// /// Get an entry from the IHttpRequest.Items Dictionary /// public static object GetItem(this IRequestContext requestContext, string key) { if (requestContext == null) return null; object value = null; var httpReq = requestContext.Get(); if (httpReq != null) httpReq.Items.TryGetValue(key, out value); return value; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/0000755000175000017500000000000012146506550023657 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/HttpError.cs0000644000175000017500000000736312146506550026150 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Net; using ServiceStack.ServiceHost; using ServiceStack.ServiceInterface.ServiceModel; namespace ServiceStack.Common.Web { public class HttpError : Exception, IHttpError { public HttpError() : this(null) {} public HttpError(string message) : this(HttpStatusCode.InternalServerError, message) {} public HttpError(HttpStatusCode statusCode, string errorCode) : this(statusCode, errorCode, null) { } public HttpError(int statusCode, string errorCode) : this(statusCode, errorCode, null) { } public HttpError(object responseDto, HttpStatusCode statusCode, string errorCode, string errorMessage) : this(statusCode, errorCode, errorMessage) { this.Response = responseDto; } public HttpError(object responseDto, int statusCode, string errorCode, string errorMessage) : this(statusCode, errorCode, errorMessage) { this.Response = responseDto; } public HttpError(HttpStatusCode statusCode, string errorCode, string errorMessage) : this((int)statusCode, errorCode, errorMessage){} public HttpError(int statusCode, string errorCode, string errorMessage) : base(errorMessage ?? errorCode) { this.ErrorCode = errorCode; this.Status = statusCode; this.Headers = new Dictionary(); this.StatusDescription = errorCode; } public HttpError(HttpStatusCode statusCode, Exception innerException) : this(innerException.Message, innerException) { this.StatusCode = statusCode; } public HttpError(string message, Exception innerException) : base(message, innerException) { if (innerException != null) { this.ErrorCode = innerException.GetType().Name; } this.Headers = new Dictionary(); } public string ErrorCode { get; set; } public string ContentType { get; set; } public Dictionary Headers { get; set; } public int Status { get; set; } public HttpStatusCode StatusCode { get { return (HttpStatusCode)Status; } set { Status = (int)value; } } public string StatusDescription { get; set; } public object Response { get; set; } public IContentTypeWriter ResponseFilter { get; set; } public IRequestContext RequestContext { get; set; } public IDictionary Options { get { return this.Headers; } } public ResponseStatus ResponseStatus { get { return this.Response.ToResponseStatus(); } } public List GetFieldErrors() { var responseStatus = ResponseStatus; if (responseStatus != null) return responseStatus.Errors ?? new List(); return new List(); } public static Exception NotFound(string message) { return new HttpError(HttpStatusCode.NotFound, message); } public static Exception Unauthorized(string message) { return new HttpError(HttpStatusCode.Unauthorized, message); } public static Exception Conflict(string message) { return new HttpError(HttpStatusCode.Conflict, message); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/HttpResultExtensions.cs0000644000175000017500000000550212146506550030406 0ustar00meebeymeebey00000000000000using System; using ServiceStack.Common.Utils; using ServiceStack.ServiceHost; using ServiceStack.ServiceInterface.ServiceModel; namespace ServiceStack.Common.Web { public static class HttpResultExtensions { /// /// Shortcut to get the ResponseDTO whether it's bare or inside a IHttpResult /// /// /// public static object ToDto(this object response) { if (response == null) return null; var httpResult = response as IHttpResult; return httpResult != null ? httpResult.Response : response; } /// /// Alias of ToDto /// public static object ToResponseDto(this object response) { return ToDto(response); } /// /// Shortcut to get the ResponseDTO whether it's bare or inside a IHttpResult /// /// /// TResponse if found; otherwise null public static TResponse ToDto(this object response) where TResponse : class { if (response == null) return default(TResponse); var httpResult = response as IHttpResult; return (httpResult != null ? httpResult.Response : response) as TResponse; } /// /// Alias of ToDto /// public static TResponse ToResponseDto(this object response) where TResponse : class { return ToDto(response); } /// /// Shortcut to get the ResponseStatus whether it's bare or inside a IHttpResult /// /// /// public static ResponseStatus ToResponseStatus(this object response) { if (response == null) return null; var hasResponseStatus = response as IHasResponseStatus; if (hasResponseStatus != null) return hasResponseStatus.ResponseStatus; var propertyInfo = response.GetType().GetProperty("ResponseStatus"); if (propertyInfo == null) return null; return ReflectionUtils.GetProperty(response, propertyInfo) as ResponseStatus; } /// /// Whether the response is an IHttpError or Exception /// /// /// public static bool IsErrorResponse(this object response) { return response != null && (response is IHttpError || response is Exception); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/CompressedFileResult.cs0000644000175000017500000000356212146506550030317 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.IO; using ServiceStack.Common.Extensions; using ServiceStack.Configuration; using ServiceStack.Service; using ServiceStack.ServiceHost; using ServiceStack.Text; namespace ServiceStack.Common.Web { public class CompressedFileResult : IStreamWriter, IHasOptions { public const int Adler32ChecksumLength = 4; public const string DefaultContentType = MimeTypes.Xml; public string FilePath { get; private set; } public Dictionary Headers { get; private set; } public IDictionary Options { get { return this.Headers; } } public CompressedFileResult(string filePath) : this(filePath, CompressionTypes.Deflate) { } public CompressedFileResult(string filePath, string compressionType) : this(filePath, compressionType, DefaultContentType) { } public CompressedFileResult(string filePath, string compressionType, string contentMimeType) { if (!CompressionTypes.IsValid(compressionType)) { throw new ArgumentException("Must be either 'deflate' or 'gzip'", compressionType); } this.FilePath = filePath; this.Headers = new Dictionary { { HttpHeaders.ContentType, contentMimeType }, { HttpHeaders.ContentEncoding, compressionType }, }; } public void WriteTo(Stream responseStream) { using (var fs = new FileStream(this.FilePath, FileMode.Open, FileAccess.Read)) { fs.Position = Adler32ChecksumLength; fs.WriteTo(responseStream); responseStream.Flush(); } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/ContentType.cs0000644000175000017500000001362612146506550026472 0ustar00meebeymeebey00000000000000using System; using ServiceStack.ServiceHost; using ServiceStack.Text; namespace ServiceStack.Common.Web { public static class ContentType { public const string Utf8Suffix = "; charset=utf-8"; public const string HeaderContentType = "Content-Type"; public const string FormUrlEncoded = "application/x-www-form-urlencoded"; public const string MultiPartFormData = "multipart/form-data"; public const string Html = "text/html"; public const string JsonReport = "text/jsonreport"; public const string Xml = "application/xml"; public const string XmlText = "text/xml"; public const string Soap11 = " text/xml; charset=utf-8"; public const string Soap12 = " application/soap+xml"; public const string Json = "application/json"; public const string JsonText = "text/json"; public const string JavaScript = "application/javascript"; public const string Jsv = "application/jsv"; public const string JsvText = "text/jsv"; public const string Csv = "text/csv"; public const string Yaml = "application/yaml"; public const string YamlText = "text/yaml"; public const string PlainText = "text/plain"; public const string MarkdownText = "text/markdown"; public const string ProtoBuf = "application/x-protobuf"; public const string MsgPack = "application/x-msgpack"; public const string Bson = "application/bson"; public const string Binary = "application/octet-stream"; public static EndpointAttributes GetEndpointAttributes(string contentType) { if (contentType == null) return EndpointAttributes.None; var realContentType = GetRealContentType(contentType); switch (realContentType) { case Json: case JsonText: return EndpointAttributes.Json; case Xml: case XmlText: return EndpointAttributes.Xml; case Html: return EndpointAttributes.Html; case Jsv: case JsvText: return EndpointAttributes.Jsv; case Yaml: case YamlText: return EndpointAttributes.Yaml; case Csv: return EndpointAttributes.Csv; case Soap11: return EndpointAttributes.Soap11; case Soap12: return EndpointAttributes.Soap12; } return EndpointAttributes.None; } public static string GetRealContentType(string contentType) { return contentType == null ? null : contentType.Split(';')[0].Trim(); } public static bool MatchesContentType(this string contentType, string matchesContentType) { return GetRealContentType(contentType) == GetRealContentType(matchesContentType); } public static bool IsBinary(this string contentType) { var realContentType = GetRealContentType(contentType); switch (realContentType) { case ProtoBuf: case MsgPack: case Binary: case Bson: return true; } var primaryType = realContentType.SplitOnFirst('/')[0]; switch (primaryType) { case "image": case "audio": case "video": return true; } return false; } public static Feature GetFeature(string contentType) { if (contentType == null) return Feature.None; var realContentType = GetRealContentType(contentType); switch (realContentType) { case Json: case JsonText: return Feature.Json; case Xml: case XmlText: return Feature.Xml; case Html: return Feature.Html; case Jsv: case JsvText: return Feature.Jsv; case Csv: return Feature.Csv; case Soap11: return Feature.Soap11; case Soap12: return Feature.Soap12; } return Feature.None; } public static string GetContentFormat(EndpointType endpointType) { return endpointType.ToString().ToLower(); } public static string GetContentFormat(string contentType) { if (contentType == null) return contentType; var parts = contentType.Split('/'); return parts[parts.Length - 1]; } public static string ToContentFormat(this string contentType) { return GetContentFormat(contentType); } public static string GetContentType(EndpointType endpointType) { switch (endpointType) { case EndpointType.Soap11: case EndpointType.Soap12: case EndpointType.Xml: return Xml; case EndpointType.Json: return Json; case EndpointType.Jsv: return JsvText; case EndpointType.ProtoBuf: return ProtoBuf; default: return null; } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/HttpResponseFilter.cs0000644000175000017500000003105512146506550030016 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.IO; using System.Text; using ServiceStack.ServiceHost; using ServiceStack.ServiceModel.Serialization; using ServiceStack.Text; namespace ServiceStack.Common.Web { public class HttpResponseFilter : IContentTypeFilter { private static readonly UTF8Encoding UTF8EncodingWithoutBom = new UTF8Encoding(false); public static HttpResponseFilter Instance = new HttpResponseFilter(); public Dictionary ContentTypeSerializers = new Dictionary(); public Dictionary ContentTypeResponseSerializers = new Dictionary(); public Dictionary ContentTypeDeserializers = new Dictionary(); public HttpResponseFilter() { this.ContentTypeFormats = new Dictionary(); } public void ClearCustomFilters() { this.ContentTypeFormats = new Dictionary(); this.ContentTypeSerializers = new Dictionary(); this.ContentTypeDeserializers = new Dictionary(); } public Dictionary ContentTypeFormats { get; set; } public void Register(string contentType, StreamSerializerDelegate streamSerializer, StreamDeserializerDelegate streamDeserializer) { if (contentType.IsNullOrEmpty()) throw new ArgumentNullException("contentType"); var parts = contentType.Split('/'); var format = parts[parts.Length - 1]; this.ContentTypeFormats[format] = contentType; SetContentTypeSerializer(contentType, streamSerializer); SetContentTypeDeserializer(contentType, streamDeserializer); } public void Register(string contentType, ResponseSerializerDelegate responseSerializer, StreamDeserializerDelegate streamDeserializer) { if (contentType.IsNullOrEmpty()) throw new ArgumentNullException("contentType"); var parts = contentType.Split('/'); var format = parts[parts.Length - 1]; this.ContentTypeFormats[format] = contentType; this.ContentTypeResponseSerializers[contentType] = responseSerializer; SetContentTypeDeserializer(contentType, streamDeserializer); } public void SetContentTypeSerializer(string contentType, StreamSerializerDelegate streamSerializer) { this.ContentTypeSerializers[contentType] = streamSerializer; } public void SetContentTypeDeserializer(string contentType, StreamDeserializerDelegate streamDeserializer) { this.ContentTypeDeserializers[contentType] = streamDeserializer; } public string Serialize(string contentType, object response) { switch (contentType) { case ContentType.Xml: return XmlSerializer.SerializeToString(response); case ContentType.Json: return JsonDataContractSerializer.Instance.SerializeToString(response); case ContentType.Jsv: return TypeSerializer.SerializeToString(response); default: throw new NotSupportedException("ContentType not supported: " + contentType); } } public byte[] SerializeToBytes(IRequestContext requestContext, object response) { var contentType = requestContext.ResponseContentType; StreamSerializerDelegate responseStreamWriter; if (this.ContentTypeSerializers.TryGetValue(contentType, out responseStreamWriter) || this.ContentTypeSerializers.TryGetValue(ContentType.GetRealContentType(contentType), out responseStreamWriter)) { using (var ms = new MemoryStream()) { responseStreamWriter(requestContext, response, ms); ms.Position = 0; return ms.ToArray(); } } ResponseSerializerDelegate responseWriter; if (this.ContentTypeResponseSerializers.TryGetValue(contentType, out responseWriter) || this.ContentTypeResponseSerializers.TryGetValue(ContentType.GetRealContentType(contentType), out responseWriter)) { using (var ms = new MemoryStream()) { var httpRes = new HttpResponseStreamWrapper(ms); responseWriter(requestContext, response, httpRes); ms.Position = 0; return ms.ToArray(); } } var contentTypeAttr = ContentType.GetEndpointAttributes(contentType); switch (contentTypeAttr) { case EndpointAttributes.Xml: return XmlSerializer.SerializeToString(response).ToUtf8Bytes(); case EndpointAttributes.Json: return JsonDataContractSerializer.Instance.SerializeToString(response).ToUtf8Bytes(); case EndpointAttributes.Jsv: return TypeSerializer.SerializeToString(response).ToUtf8Bytes(); } throw new NotSupportedException("ContentType not supported: " + contentType); } public string SerializeToString(IRequestContext requestContext, object response) { var contentType = requestContext.ResponseContentType; StreamSerializerDelegate responseStreamWriter; if (this.ContentTypeSerializers.TryGetValue(contentType, out responseStreamWriter) || this.ContentTypeSerializers.TryGetValue(ContentType.GetRealContentType(contentType), out responseStreamWriter)) { using (var ms = new MemoryStream()) { responseStreamWriter(requestContext, response, ms); ms.Position = 0; var result = new StreamReader(ms, UTF8EncodingWithoutBom).ReadToEnd(); return result; } } ResponseSerializerDelegate responseWriter; if (this.ContentTypeResponseSerializers.TryGetValue(contentType, out responseWriter) || this.ContentTypeResponseSerializers.TryGetValue(ContentType.GetRealContentType(contentType), out responseWriter)) { using (var ms = new MemoryStream()) { var httpRes = new HttpResponseStreamWrapper(ms); responseWriter(requestContext, response, httpRes); ms.Position = 0; var result = new StreamReader(ms, UTF8EncodingWithoutBom).ReadToEnd(); return result; } } var contentTypeAttr = ContentType.GetEndpointAttributes(contentType); switch (contentTypeAttr) { case EndpointAttributes.Xml: return XmlSerializer.SerializeToString(response); case EndpointAttributes.Json: return JsonDataContractSerializer.Instance.SerializeToString(response); case EndpointAttributes.Jsv: return TypeSerializer.SerializeToString(response); } throw new NotSupportedException("ContentType not supported: " + contentType); } public void SerializeToStream(IRequestContext requestContext, object response, Stream responseStream) { var contentType = requestContext.ResponseContentType; var serializer = GetResponseSerializer(contentType); if (serializer == null) throw new NotSupportedException("ContentType not supported: " + contentType); var httpRes = new HttpResponseStreamWrapper(responseStream); serializer(requestContext, response, httpRes); } public void SerializeToResponse(IRequestContext requestContext, object response, IHttpResponse httpResponse) { var contentType = requestContext.ResponseContentType; var serializer = GetResponseSerializer(contentType); if (serializer == null) throw new NotSupportedException("ContentType not supported: " + contentType); serializer(requestContext, response, httpResponse); } public ResponseSerializerDelegate GetResponseSerializer(string contentType) { ResponseSerializerDelegate responseWriter; if (this.ContentTypeResponseSerializers.TryGetValue(contentType, out responseWriter)|| this.ContentTypeResponseSerializers.TryGetValue(ContentType.GetRealContentType(contentType), out responseWriter)) { return responseWriter; } var serializer = GetStreamSerializer(contentType); if (serializer == null) return null; return (httpReq, dto, httpRes) => serializer(httpReq, dto, httpRes.OutputStream); } public StreamSerializerDelegate GetStreamSerializer(string contentType) { StreamSerializerDelegate responseWriter; if (this.ContentTypeSerializers.TryGetValue(contentType, out responseWriter)|| this.ContentTypeSerializers.TryGetValue(ContentType.GetRealContentType(contentType), out responseWriter)) { return responseWriter; } var contentTypeAttr = ContentType.GetEndpointAttributes(contentType); switch (contentTypeAttr) { case EndpointAttributes.Xml: return (r, o, s) => XmlSerializer.SerializeToStream(o, s); case EndpointAttributes.Json: return (r, o, s) => JsonDataContractSerializer.Instance.SerializeToStream(o, s); case EndpointAttributes.Jsv: return (r, o, s) => TypeSerializer.SerializeToStream(o, s); } return null; } public object DeserializeFromString(string contentType, Type type, string request) { var contentTypeAttr = ContentType.GetEndpointAttributes(contentType); switch (contentTypeAttr) { case EndpointAttributes.Xml: return XmlSerializer.DeserializeFromString(request, type); case EndpointAttributes.Json: return JsonDataContractDeserializer.Instance.DeserializeFromString(request, type); case EndpointAttributes.Jsv: return TypeSerializer.DeserializeFromString(request, type); default: throw new NotSupportedException("ContentType not supported: " + contentType); } } public object DeserializeFromStream(string contentType, Type type, Stream fromStream) { var deserializer = GetStreamDeserializer(contentType); if (deserializer == null) throw new NotSupportedException("ContentType not supported: " + contentType); return deserializer(type, fromStream); } public StreamDeserializerDelegate GetStreamDeserializer(string contentType) { StreamDeserializerDelegate streamReader; var realContentType = contentType.Split(';')[0].Trim(); if (this.ContentTypeDeserializers.TryGetValue(realContentType, out streamReader)) { return streamReader; } var contentTypeAttr = ContentType.GetEndpointAttributes(contentType); switch (contentTypeAttr) { case EndpointAttributes.Xml: return XmlSerializer.DeserializeFromStream; case EndpointAttributes.Json: return JsonDataContractDeserializer.Instance.DeserializeFromStream; case EndpointAttributes.Jsv: return TypeSerializer.DeserializeFromStream; } return null; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/EndpointType.cs0000644000175000017500000000032012146506550026623 0ustar00meebeymeebey00000000000000namespace ServiceStack.Common.Web { public enum EndpointType { None, Xml, Json, Jsv, Csv, ProtoBuf, Soap11, Soap12, } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/SerializationContext.cs0000644000175000017500000000316612146506550030376 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Net; using ServiceStack.ServiceHost; namespace ServiceStack.Common.Web { public class SerializationContext : IRequestContext { public SerializationContext(string contentType) { this.ResponseContentType = this.ContentType = contentType; } public T Get() where T : class { return default(T); } public string GetHeader(string headerName) { return null; } public string IpAddress { get { throw new NotImplementedException(); } } public IDictionary Cookies { get { return new Dictionary(); } } public EndpointAttributes EndpointAttributes { get { return EndpointAttributes.None; } } public IRequestAttributes RequestAttributes { get { throw new NotImplementedException(); } } public string ContentType { get; set; } public string ResponseContentType { get; set; } public string CompressionType { get; set; } public string AbsoluteUri { get { throw new NotImplementedException(); } } public string PathInfo { get { throw new NotImplementedException(); } } public IFile[] Files { get { return new IFile[0]; } } public void Dispose() { } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/HttpResponseStreamWrapper.cs0000644000175000017500000000335512146506550031367 0ustar00meebeymeebey00000000000000using System.Collections.Generic; using System.IO; using System.Text; using ServiceStack.Common.Utils; using ServiceStack.ServiceHost; namespace ServiceStack.Common.Web { public class HttpResponseStreamWrapper : IHttpResponse { private static readonly UTF8Encoding UTF8EncodingWithoutBom = new UTF8Encoding(false); public HttpResponseStreamWrapper(Stream stream) { this.OutputStream = stream; this.Headers = new Dictionary(); } public Dictionary Headers { get; set; } public object OriginalResponse { get { return null; } } public int StatusCode { set; private get; } public string StatusDescription { set; private get; } public string ContentType { get; set; } public ICookies Cookies { get; set; } public void AddHeader(string name, string value) { this.Headers[name] = value; } public void Redirect(string url) { this.Headers[HttpHeaders.Location] = url; } public Stream OutputStream { get; private set; } public void Write(string text) { var bytes = UTF8EncodingWithoutBom.GetBytes(text); OutputStream.Write(bytes, 0, bytes.Length); } public void Close() { if (IsClosed) return; OutputStream.Close(); IsClosed = true; } public void End() { Close(); } public void Flush() { OutputStream.Flush(); } public bool IsClosed { get; private set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/EndPoint.cs0000644000175000017500000000045512146506550025732 0ustar00meebeymeebey00000000000000namespace ServiceStack.Common.Web { public class EndPoint { public string Host { get; private set; } public int Port { get; private set; } public EndPoint(string host, int port) { Host = host; Port = port; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/CompressionTypes.cs0000644000175000017500000000233712146506550027541 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Common.Web { public static class CompressionTypes { public static readonly string[] AllCompressionTypes = new[] { Deflate, GZip }; public const string Default = Deflate; public const string Deflate = "deflate"; public const string GZip = "gzip"; public static bool IsValid(string compressionType) { return compressionType == Deflate || compressionType == GZip; } public static void AssertIsValid(string compressionType) { if (!IsValid(compressionType)) { throw new NotSupportedException(compressionType + " is not a supported compression type. Valid types: gzip, deflate."); } } public static string GetExtension(string compressionType) { switch (compressionType) { case Deflate: case GZip: return "." + compressionType; default: throw new NotSupportedException( "Unknown compressionType: " + compressionType); } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/HttpResult.cs0000644000175000017500000001757112146506550026337 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT using System; using System.Collections.Generic; using System.IO; using System.Net; using ServiceStack.Service; using ServiceStack.ServiceHost; using ServiceStack.Text; namespace ServiceStack.Common.Web { public class HttpResult : IHttpResult, IStreamWriter { public HttpResult() : this((object)null, null) { } public HttpResult(object response) : this(response, null) { } public HttpResult(object response, string contentType) : this(response, contentType, HttpStatusCode.OK) { } public HttpResult(HttpStatusCode statusCode, string statusDescription) : this() { StatusCode = statusCode; StatusDescription = statusDescription; } public HttpResult(object response, HttpStatusCode statusCode) : this(response, null, statusCode) { } public HttpResult(object response, string contentType, HttpStatusCode statusCode) { this.Headers = new Dictionary(); this.ResponseFilter = HttpResponseFilter.Instance; this.Response = response; this.ContentType = contentType; this.StatusCode = statusCode; } public HttpResult(FileInfo fileResponse) : this(fileResponse, false, MimeTypes.GetMimeType(fileResponse.Name)) { } public HttpResult(FileInfo fileResponse, bool asAttachment) : this(fileResponse, asAttachment, MimeTypes.GetMimeType(fileResponse.Name)) { } public HttpResult(FileInfo fileResponse, bool asAttachment, string contentType) : this(null, contentType, HttpStatusCode.OK) { this.FileInfo = fileResponse; if (!asAttachment) return; var headerValue = "attachment; " + "filename=\"" + fileResponse.Name + "\"; " + "size=" + fileResponse.Length + "; " + "creation-date=" + fileResponse.CreationTimeUtc.ToString("R").Replace(",", "") + "; " + "modification-date=" + fileResponse.LastWriteTimeUtc.ToString("R").Replace(",", "") + "; " + "read-date=" + fileResponse.LastAccessTimeUtc.ToString("R").Replace(",", ""); this.Headers = new Dictionary { { HttpHeaders.ContentDisposition, headerValue }, }; } public HttpResult(Stream responseStream, string contentType) : this(null, contentType, HttpStatusCode.OK) { this.ResponseStream = responseStream; } public HttpResult(string responseText, string contentType) : this(null, contentType, HttpStatusCode.OK) { this.ResponseText = responseText; } public string ResponseText { get; private set; } public Stream ResponseStream { get; private set; } public FileInfo FileInfo { get; private set; } public string ContentType { get; set; } public Dictionary Headers { get; private set; } public DateTime LastModified { set { this.Headers[HttpHeaders.LastModified] = value.ToUniversalTime().ToString("r"); } } public string Location { set { if (StatusCode == HttpStatusCode.OK) StatusCode = HttpStatusCode.Redirect; this.Headers[HttpHeaders.Location] = value; } } public void SetPermanentCookie(string name, string value) { SetCookie(name, value, DateTime.UtcNow.AddYears(20), null); } public void SetPermanentCookie(string name, string value, string path) { SetCookie(name, value, DateTime.UtcNow.AddYears(20), path); } public void SetSessionCookie(string name, string value) { SetSessionCookie(name, value, null); } public void SetSessionCookie(string name, string value, string path) { path = path ?? "/"; this.Headers[HttpHeaders.SetCookie] = string.Format("{0}={1};path=" + path, name, value); } public void SetCookie(string name, string value, TimeSpan expiresIn, string path) { var expiresAt = DateTime.UtcNow.Add(expiresIn); SetCookie(name, value, expiresAt, path); } public void SetCookie(string name, string value, DateTime expiresAt, string path) { path = path ?? "/"; var cookie = string.Format("{0}={1};expires={2};path={3}", name, value, expiresAt.ToString("R"), path); this.Headers[HttpHeaders.SetCookie] = cookie; } public void DeleteCookie(string name) { var cookie = string.Format("{0}=;expires={1};path=/", name, DateTime.UtcNow.AddDays(-1).ToString("R")); this.Headers[HttpHeaders.SetCookie] = cookie; } public IDictionary Options { get { return this.Headers; } } public int Status { get; set; } public HttpStatusCode StatusCode { get { return (HttpStatusCode) Status; } set { Status = (int) value; } } public string StatusDescription { get; set; } public object Response { get; set; } public IContentTypeWriter ResponseFilter { get; set; } public IRequestContext RequestContext { get; set; } public string View { get; set; } public string Template { get; set; } public void WriteTo(Stream responseStream) { if (this.FileInfo != null) { using (var fs = this.FileInfo.OpenRead()) { fs.WriteTo(responseStream); responseStream.Flush(); } return; } if (this.ResponseStream != null) { this.ResponseStream.WriteTo(responseStream); responseStream.Flush(); try { this.ResponseStream.Dispose(); } catch { /*ignore*/ } return; } if (this.ResponseText != null) { var bytes = System.Text.Encoding.UTF8.GetBytes(this.ResponseText); responseStream.Write(bytes, 0, bytes.Length); responseStream.Flush(); return; } if (this.ResponseFilter == null) throw new ArgumentNullException("ResponseFilter"); if (this.RequestContext == null) throw new ArgumentNullException("RequestContext"); var bytesResponse = this.Response as byte[]; if (bytesResponse != null) { responseStream.Write(bytesResponse, 0, bytesResponse.Length); return; } if (View != null) RequestContext.SetItem("View", View); if (Template != null) RequestContext.SetItem("Template", Template); ResponseFilter.SerializeToStream(this.RequestContext, this.Response, responseStream); } public static HttpResult Status201Created(object response, string newLocationUri) { return new HttpResult(response) { StatusCode = HttpStatusCode.Created, Headers = { { HttpHeaders.Location, newLocationUri }, } }; } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/CompressedResult.cs0000644000175000017500000000450012146506550027510 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.IO; using System.Net; using ServiceStack.Service; using ServiceStack.ServiceHost; namespace ServiceStack.Common.Web { public class CompressedResult : IStreamWriter, IHttpResult { public const int Adler32ChecksumLength = 4; public const string DefaultContentType = MimeTypes.Xml; public byte[] Contents { get; private set; } public string ContentType { get; set; } public Dictionary Headers { get; private set; } public int Status { get; set; } public HttpStatusCode StatusCode { get { return (HttpStatusCode)Status; } set { Status = (int)value; } } public string StatusDescription { get; set; } public object Response { get { return this.Contents; } set { throw new NotImplementedException(); } } public IContentTypeWriter ResponseFilter { get; set; } public IRequestContext RequestContext { get; set; } public IDictionary Options { get { return this.Headers; } } public CompressedResult(byte[] contents) : this(contents, CompressionTypes.Deflate) { } public CompressedResult(byte[] contents, string compressionType) : this(contents, compressionType, DefaultContentType) { } public CompressedResult(byte[] contents, string compressionType, string contentMimeType) { if (!CompressionTypes.IsValid(compressionType)) { throw new ArgumentException("Must be either 'deflate' or 'gzip'", compressionType); } this.StatusCode = HttpStatusCode.OK; this.ContentType = contentMimeType; this.Contents = contents; this.Headers = new Dictionary { { HttpHeaders.ContentEncoding, compressionType }, }; } public void WriteTo(Stream responseStream) { responseStream.Write(this.Contents, 0, this.Contents.Length); //stream.Write(this.Contents, Adler32ChecksumLength, this.Contents.Length - Adler32ChecksumLength); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/HttpMethods.cs0000644000175000017500000000225412146506550026454 0ustar00meebeymeebey00000000000000using System; using ServiceStack.ServiceHost; namespace ServiceStack.Common.Web { public static class HttpMethods { public const string Get = "GET"; public const string Put = "PUT"; public const string Post = "POST"; public const string Delete = "DELETE"; public const string Head = "HEAD"; public const string Options = "OPTIONS"; public const string Patch = "PATCH"; public static EndpointAttributes GetEndpointAttribute(string httpMethod) { switch (httpMethod.ToUpper()) { case Get: return EndpointAttributes.HttpGet; case Put: return EndpointAttributes.HttpPut; case Post: return EndpointAttributes.HttpPost; case Delete: return EndpointAttributes.HttpDelete; case Patch: return EndpointAttributes.HttpPatch; case Head: return EndpointAttributes.HttpHead; } return EndpointAttributes.None; } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/HttpHeaders.cs0000644000175000017500000000320412146506550026420 0ustar00meebeymeebey00000000000000namespace ServiceStack.Common.Web { public static class HttpHeaders { public const string XParamOverridePrefix = "X-Param-Override-"; public const string XHttpMethodOverride = "X-Http-Method-Override"; public const string XUserAuthId = "X-UAId"; public const string XForwardedFor = "X-Forwarded-For"; public const string XRealIp = "X-Real-IP"; public const string Referer = "Referer"; public const string CacheControl = "Cache-Control"; public const string IfModifiedSince = "If-Modified-Since"; public const string LastModified = "Last-Modified"; public const string Accept = "Accept"; public const string AcceptEncoding = "Accept-Encoding"; public const string ContentType = "Content-Type"; public const string ContentEncoding = "Content-Encoding"; public const string ContentLength = "Content-Length"; public const string ContentDisposition = "Content-Disposition"; public const string Location = "Location"; public const string SetCookie = "Set-Cookie"; public const string ETag = "ETag"; public const string Authorization = "Authorization"; public const string WwwAuthenticate = "WWW-Authenticate"; public const string AllowOrigin = "Access-Control-Allow-Origin"; public const string AllowMethods = "Access-Control-Allow-Methods"; public const string AllowHeaders = "Access-Control-Allow-Headers"; public const string AllowCredentials = "Access-Control-Allow-Credentials"; } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Web/MimeTypes.cs0000644000175000017500000000636112146506550026130 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.Common.Web { public static class MimeTypes { public static Dictionary ExtensionMimeTypes = new Dictionary(); public const string Html = "text/html"; public const string Xml = "text/xml"; public const string Json = "text/json"; public const string Jsv = "text/jsv"; public const string Csv = "text/csv"; public const string ProtoBuf = "application/x-protobuf"; public const string JavaScript = "text/javascript"; public static string GetExtension(string mimeType) { switch (mimeType) { case ProtoBuf: return ".pbuf"; } var parts = mimeType.Split('/'); if (parts.Length == 1) return "." + parts[0]; if (parts.Length == 2) return "." + parts[1]; throw new NotSupportedException("Unknown mimeType: " + mimeType); } public static string GetMimeType(string fileNameOrExt) { fileNameOrExt.ThrowIfNullOrEmpty(); var parts = fileNameOrExt.Split('.'); var fileExt = parts[parts.Length - 1]; string mimeType; if (ExtensionMimeTypes.TryGetValue(fileExt, out mimeType)) { return mimeType; } switch (fileExt) { case "jpeg": case "gif": case "png": case "tiff": case "bmp": return "image/" + fileExt; case "jpg": return "image/jpeg"; case "tif": return "image/tiff"; case "htm": case "html": case "shtml": return "text/html"; case "js": return "text/javascript"; case "csv": case "css": case "sgml": return "text/" + fileExt; case "txt": return "text/plain"; case "wav": return "audio/wav"; case "mp3": return "audio/mpeg3"; case "mid": return "audio/midi"; case "qt": case "mov": return "video/quicktime"; case "mpg": return "video/mpeg"; case "avi": return "video/" + fileExt; case "rtf": return "application/" + fileExt; case "xls": return "application/x-excel"; case "doc": return "application/msword"; case "ppt": return "application/powerpoint"; case "gz": case "tgz": return "application/x-compressed"; default: return "application/" + fileExt; } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Expressions/0000755000175000017500000000000012146506550025464 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Expressions/DelegateFactory.cs0000644000175000017500000000523612146506550031063 0ustar00meebeymeebey00000000000000using System; using System.Linq; using System.Linq.Expressions; using System.Reflection; namespace ServiceStack.Common.Expressions { public static class DelegateFactory { /* * MethodInfo method = typeof(String).GetMethod("StartsWith", new[] { typeof(string) }); LateBoundMethod callback = DelegateFactory.Create(method); string foo = "this is a test"; bool result = (bool) callback(foo, new[] { "this" }); result.ShouldBeTrue(); */ public delegate object LateBoundMethod(object target, object[] arguments); public static LateBoundMethod Create(MethodInfo method) { ParameterExpression instanceParameter = Expression.Parameter(typeof(object), "target"); ParameterExpression argumentsParameter = Expression.Parameter(typeof(object[]), "arguments"); MethodCallExpression call = Expression.Call( Expression.Convert(instanceParameter, method.DeclaringType), method, CreateParameterExpressions(method, argumentsParameter)); Expression lambda = Expression.Lambda( Expression.Convert(call, typeof(object)), instanceParameter, argumentsParameter); return lambda.Compile(); } private static Expression[] CreateParameterExpressions(MethodInfo method, Expression argumentsParameter) { return method.GetParameters().Select((parameter, index) => Expression.Convert( Expression.ArrayIndex(argumentsParameter, Expression.Constant(index)), parameter.ParameterType)).ToArray(); } public delegate void LateBoundVoid(object target, object[] arguments); public static LateBoundVoid CreateVoid(MethodInfo method) { ParameterExpression instanceParameter = Expression.Parameter(typeof(object), "target"); ParameterExpression argumentsParameter = Expression.Parameter(typeof(object[]), "arguments"); MethodCallExpression call = Expression.Call( Expression.Convert(instanceParameter, method.DeclaringType), method, CreateParameterExpressions(method, argumentsParameter)); var lambda = Expression.Lambda( Expression.Convert(call, method.ReturnParameter.ParameterType), instanceParameter, argumentsParameter); return lambda.Compile(); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Support/0000755000175000017500000000000012146506550024616 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Support/InMemoryLogFactory.cs0000644000175000017500000001365212146506550030705 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Text; using ServiceStack.Logging; namespace ServiceStack.Common.Support { /// /// Note: InMemoryLog keeps all logs in memory, so don't use it long running exceptions /// /// Returns a thread-safe InMemoryLog which you can use while *TESTING* /// to provide a detailed analysis of your logs. /// public class InMemoryLogFactory : ILogFactory { public ILog GetLogger(Type type) { return new InMemoryLog(type.Name); } public ILog GetLogger(string typeName) { return new InMemoryLog(typeName); } } public class InMemoryLog : ILog { private readonly object syncLock = new object(); public string LoggerName { get; private set; } public StringBuilder CombinedLog { get; private set; } public List DebugEntries { get; set; } public List DebugExceptions { get; set; } public List InfoEntries { get; set; } public List InfoExceptions { get; set; } public List WarnEntries { get; set; } public List WarnExceptions { get; set; } public List ErrorEntries { get; set; } public List ErrorExceptions { get; set; } public List FatalEntries { get; set; } public List FatalExceptions { get; set; } public InMemoryLog(string loggerName) { this.LoggerName = loggerName; this.CombinedLog = new StringBuilder(); this.DebugEntries = new List(); this.DebugExceptions = new List(); this.InfoEntries = new List(); this.InfoExceptions = new List(); this.WarnEntries = new List(); this.WarnExceptions = new List(); this.ErrorEntries = new List(); this.ErrorExceptions = new List(); this.FatalEntries = new List(); this.FatalExceptions = new List(); } public bool HasExceptions { get { return this.DebugExceptions.Count > 0 || this.InfoExceptions.Count > 0 || this.WarnExceptions.Count > 0 || this.ErrorExceptions.Count > 0 || this.FatalExceptions.Count > 0; } } private void AppendToLog(ICollection logEntries, string format, params object[] args) { if (format == null) return; AppendToLog(logEntries, string.Format(format, args)); } private void AppendToLog(ICollection logEntries, object message) { if (message == null) return; AppendToLog(logEntries, message.ToString()); } private void AppendToLog( ICollection logEntries, ICollection logExceptions, object message, Exception ex) { if (ex != null) { lock (syncLock) { logExceptions.Add(ex); } } if (message == null) return; AppendToLog(logEntries, message.ToString()); } private void AppendToLog(ICollection logEntries, string message) { lock (this) { logEntries.Add(message); CombinedLog.AppendLine(message); } } public void Debug(object message) { AppendToLog(DebugEntries, message); } public void Debug(object message, Exception exception) { AppendToLog(DebugEntries, DebugExceptions, message, exception); } public void DebugFormat(string format, params object[] args) { AppendToLog(DebugEntries, format, args); } public void Error(object message) { AppendToLog(ErrorEntries, message); } public void Error(object message, Exception exception) { AppendToLog(ErrorEntries, ErrorExceptions, message, exception); } public void ErrorFormat(string format, params object[] args) { AppendToLog(ErrorEntries, format, args); } public void Fatal(object message) { AppendToLog(FatalEntries, message); } public void Fatal(object message, Exception exception) { AppendToLog(FatalEntries, FatalExceptions, message, exception); } public void FatalFormat(string format, params object[] args) { AppendToLog(FatalEntries, format, args); } public void Info(object message) { AppendToLog(InfoEntries, message); } public void Info(object message, Exception exception) { AppendToLog(InfoEntries, InfoExceptions, message, exception); } public void InfoFormat(string format, params object[] args) { AppendToLog(InfoEntries, format, args); } public void Warn(object message) { AppendToLog(WarnEntries, message); } public void Warn(object message, Exception exception) { AppendToLog(WarnEntries, WarnExceptions, message, exception); } public void WarnFormat(string format, params object[] args) { AppendToLog(WarnEntries, format, args); } public bool IsDebugEnabled { get { return true; } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Support/PropertyInvoker.cs0000644000175000017500000000476412146506550030342 0ustar00meebeymeebey00000000000000using System; using System.Linq.Expressions; using System.Reflection; namespace ServiceStack.Common.Support { public delegate void PropertySetterDelegate(object instance, object value); public delegate object PropertyGetterDelegate(object instance); public static class PropertyInvoker { public static PropertySetterDelegate GetPropertySetterFn(this PropertyInfo propertyInfo) { var propertySetMethod = propertyInfo.GetSetMethod(); if (propertySetMethod == null) return null; #if MONOTOUCH || SILVERLIGHT || XBOX return (o, convertedValue) => { propertySetMethod.Invoke(o, new[] { convertedValue }); return; }; #else var instance = Expression.Parameter(typeof(object), "i"); var argument = Expression.Parameter(typeof(object), "a"); var instanceParam = Expression.Convert(instance, propertyInfo.DeclaringType); var valueParam = Expression.Convert(argument, propertyInfo.PropertyType); var setterCall = Expression.Call(instanceParam, propertyInfo.GetSetMethod(), valueParam); return Expression.Lambda(setterCall, instance, argument).Compile(); #endif } public static PropertyGetterDelegate GetPropertyGetterFn(this PropertyInfo propertyInfo) { var getMethodInfo = propertyInfo.GetGetMethod(); if (getMethodInfo == null) return null; #if MONOTOUCH || SILVERLIGHT || XBOX return o => propertyInfo.GetGetMethod().Invoke(o, new object[] { }); #else try { var oInstanceParam = Expression.Parameter(typeof(object), "oInstanceParam"); var instanceParam = Expression.Convert(oInstanceParam, propertyInfo.DeclaringType); var exprCallPropertyGetFn = Expression.Call(instanceParam, getMethodInfo); var oExprCallPropertyGetFn = Expression.Convert(exprCallPropertyGetFn, typeof(object)); var propertyGetFn = Expression.Lambda ( oExprCallPropertyGetFn, oInstanceParam ).Compile(); return propertyGetFn; } catch (Exception ex) { Console.Write(ex.Message); throw; } #endif } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Support/AdapterBase.cs0000644000175000017500000000402712146506550027323 0ustar00meebeymeebey00000000000000using System; using ServiceStack.Logging; namespace ServiceStack.Common.Support { /// /// Common functionality when creating adapters /// public abstract class AdapterBase { protected abstract ILog Log { get; } /// /// Executes the specified expression. /// /// /// The action. /// protected T Execute(Func action) { DateTime before = DateTime.Now; this.Log.DebugFormat("Executing action '{0}'", action.Method.Name); try { T result = action(); TimeSpan timeTaken = DateTime.Now - before; this.Log.DebugFormat("Action '{0}' executed. Took {1} ms.", action.Method.Name, timeTaken.TotalMilliseconds); return result; } catch (Exception ex) { this.Log.ErrorFormat("There was an error executing Action '{0}'. Message: {1}", action.Method.Name, ex.Message); throw; } } /// /// Executes the specified action (for void methods). /// /// The action. protected void Execute(Action action) { DateTime before = DateTime.Now; this.Log.DebugFormat("Executing action '{0}'", action.Method.Name); try { action(); TimeSpan timeTaken = DateTime.Now - before; this.Log.DebugFormat("Action '{0}' executed. Took {1} ms.", action.Method.Name, timeTaken.TotalMilliseconds); } catch (Exception ex) { this.Log.ErrorFormat("There was an error executing Action '{0}'. Message: {1}", action.Method.Name, ex.Message); throw; } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Support/NetDeflateProvider.cs0000644000175000017500000000213712146506550030676 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System; using System.IO; using System.IO.Compression; using System.Text; using ServiceStack.CacheAccess; using ServiceStack.Text; namespace ServiceStack.Common.Support { public class NetDeflateProvider : IDeflateProvider { public byte[] Deflate(string text) { var buffer = Encoding.UTF8.GetBytes(text); using(var ms = new MemoryStream()) using (var zipStream = new DeflateStream(ms, CompressionMode.Compress)) { zipStream.Write(buffer, 0, buffer.Length); zipStream.Close(); return ms.ToArray(); } } public string Inflate(byte[] gzBuffer) { using (var compressedStream = new MemoryStream(gzBuffer)) using (var zipStream = new DeflateStream(compressedStream, CompressionMode.Decompress)) { var utf8Bytes = zipStream.ReadFully(); return Encoding.UTF8.GetString(utf8Bytes); } } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Support/LogicFacadeBase.cs0000644000175000017500000001057712146506550030073 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using ServiceStack.DesignPatterns.Command; using ServiceStack.Logging; using ServiceStack.LogicFacade; namespace ServiceStack.Common.Support { public abstract class LogicFacadeBase : ILogicFacade { private readonly ILog log = LogManager.GetLogger(typeof(LogicFacadeBase)); internal class InitialisationContext : IInitContext { private readonly LogicFacadeBase logicFacade; /// /// Gets or sets the object that has been initialized only. /// public object InitialisedObject { get; set; } /// /// Determines whether this context is initialise only or not /// internal readonly InitOptions initOptions; /// /// Constructs a new InitialiseOnlyContext /// internal InitialisationContext(LogicFacadeBase logicFacade, InitOptions options) { this.logicFacade = logicFacade; this.initOptions = options; } /// /// Call to remove this current context and reveal the previous context (if any). /// public virtual void Dispose() { this.logicFacade.contexts.Pop(); } } /// /// Gets the current context (or null if none). /// private InitialisationContext CurrentContext { get { //TODO: check if '|| this.contexts.Count == 0)' is intended as it was throwing an exception if (this.contexts == null || this.contexts.Count == 0) { return null; } return this.contexts.Peek(); } } [ThreadStatic] internal Stack contexts; /// /// Checks if the current context is set to "initialize only". /// public bool IsCurrentlyInitializeOnly { get { return this.CurrentContext != null && ((int)(this.CurrentContext.initOptions & InitOptions.InitialiseOnly) != 0); } } public IInitContext AcquireInitContext(InitOptions initOptions) { if (this.contexts == null) { this.contexts = new Stack(); } var context = new InitialisationContext(this, initOptions); this.contexts.Push(context); return context; } /// /// Executes the specified action. /// /// /// The action. /// protected T Execute(ICommand action) { try { DateTime before = DateTime.Now; this.log.DebugFormat("Executing action '{0}'", action.GetType().Name); Init(action); if (this.CurrentContext != null) { this.CurrentContext.InitialisedObject = action; } if (this.IsCurrentlyInitializeOnly) { this.log.DebugFormat("Action '{0}' not executed (InitializedOnlyContext).", action.GetType().Name); return default(T); } else { T result = action.Execute(); TimeSpan timeTaken = DateTime.Now - before; this.log.DebugFormat("Action '{0}' executed. Took {1} ms.", action.GetType().Name, timeTaken.TotalMilliseconds); return result; } } catch (Exception ex) { log.ErrorFormat("Error executing action", ex); throw; } } protected abstract void Init(ICommand action); public virtual void Dispose() { } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Support/CommandResultsHandler.cs0000644000175000017500000000141212146506550031401 0ustar00meebeymeebey00000000000000using System.Collections.Generic; using System.Threading; using ServiceStack.DesignPatterns.Command; namespace ServiceStack.Common.Support { public class CommandResultsHandler : ICommandExec { private readonly List results; private readonly ICommandList command; private readonly AutoResetEvent waitHandle; public CommandResultsHandler(List results, ICommandList command, AutoResetEvent waitHandle) { this.results = results; this.command = command; this.waitHandle = waitHandle; } public bool Execute() { results.AddRange(command.Execute()); waitHandle.Set(); return true; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Support/CommandExecsHandler.cs0000644000175000017500000000114712146506550031014 0ustar00meebeymeebey00000000000000using System.Threading; using ServiceStack.DesignPatterns.Command; namespace ServiceStack.Common.Support { public class CommandExecsHandler : ICommandExec { private readonly ICommandExec command; private readonly AutoResetEvent waitHandle; public CommandExecsHandler(ICommandExec command, AutoResetEvent waitHandle) { this.command = command; this.waitHandle = waitHandle; } public bool Execute() { command.Execute(); waitHandle.Set(); return true; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Support/ActionExecHandler.cs0000644000175000017500000000113112146506550030461 0ustar00meebeymeebey00000000000000using System; using System.Threading; using ServiceStack.DesignPatterns.Command; namespace ServiceStack.Common.Support { public class ActionExecHandler : ICommandExec { private readonly Action action; private readonly AutoResetEvent waitHandle; public ActionExecHandler(Action action, AutoResetEvent waitHandle) { this.action = action; this.waitHandle = waitHandle; } public bool Execute() { action(); waitHandle.Set(); return true; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Support/AssignmentDefinition.cs0000644000175000017500000001307612146506550031275 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using ServiceStack.Common.Utils; using ServiceStack.Logging; using ServiceStack.Net30.Collections.Concurrent; using ServiceStack.Text; namespace ServiceStack.Common.Support { public class AssignmentDefinition { private static readonly ILog Log = LogManager.GetLogger(typeof(AssignmentDefinition)); private ConcurrentDictionary PropertySetters = new ConcurrentDictionary(); private ConcurrentDictionary PropertyGetters = new ConcurrentDictionary(); public AssignmentDefinition() { this.PropertyInfoMap = new Dictionary(); this.FieldInfoMap = new Dictionary(); } public Type FromType { get; set; } public Type ToType { get; set; } //from => to public Dictionary PropertyInfoMap { get; set; } public Dictionary FieldInfoMap { get; set; } public void AddMatch(PropertyInfo fromPropertyInfo, PropertyInfo toPropertyInfo) { this.PropertyInfoMap[fromPropertyInfo] = toPropertyInfo; } public void AddMatch(FieldInfo fromFieldInfo, FieldInfo toFieldInfo) { this.FieldInfoMap[fromFieldInfo] = toFieldInfo; } public void PopulateFromPropertiesWithAttribute(object to, object from, Type attributeType) { var hasAttributePredicate = (Func) (x => x.GetCustomAttributes(attributeType, true).Length > 0); Populate(to, from, hasAttributePredicate, null); } public void PopulateWithNonDefaultValues(object to, object from) { var nonDefaultPredicate = (Func) (x => x != null && !Equals( x, ReflectionUtils.GetDefaultValue(x.GetType()) ) ); Populate(to, from, null, nonDefaultPredicate); } public void Populate(object to, object from) { Populate(to, from, null, null); } public void Populate(object to, object from, Func propertyInfoPredicate, Func valuePredicate) { foreach (var propertyEntry in PropertyInfoMap) { var fromPropertyInfo = propertyEntry.Key; var toPropertyInfo = propertyEntry.Value; if (propertyInfoPredicate != null) { if (!propertyInfoPredicate(fromPropertyInfo)) continue; } try { var getterFn = PropertyGetters.GetOrAdd(fromPropertyInfo.Name, fromPropertyInfo.GetPropertyGetterFn()); var fromValue = getterFn(from); if (valuePredicate != null) { if (!valuePredicate(fromValue)) continue; } if (fromPropertyInfo.PropertyType != toPropertyInfo.PropertyType) { if (fromPropertyInfo.PropertyType == typeof(string)) { fromValue = TypeSerializer.DeserializeFromString((string)fromValue, toPropertyInfo.PropertyType); } else if (toPropertyInfo.PropertyType == typeof(string)) { fromValue = TypeSerializer.SerializeToString(fromValue); } else { var listResult = TranslateListWithElements.TryTranslateToGenericICollection( fromPropertyInfo.PropertyType, toPropertyInfo.PropertyType, fromValue); if (listResult != null) { fromValue = listResult; } } } var setterFn = PropertySetters.GetOrAdd(toPropertyInfo.Name, toPropertyInfo.GetPropertySetterFn()); setterFn(to, fromValue); } catch (Exception ex) { Log.Warn(string.Format("Error trying to set properties {0}.{1} > {2}.{3}", FromType.FullName, fromPropertyInfo.Name, ToType.FullName, toPropertyInfo.Name), ex); } } foreach (var fieldEntry in FieldInfoMap) { var fromFieldInfo = fieldEntry.Key; var toFieldInfo = fieldEntry.Value; try { var fromValue = fromFieldInfo.GetValue(from); toFieldInfo.SetValue(to, fromValue); } catch (Exception ex) { Log.Warn(string.Format("Error trying to set fields {0}.{1} > {2}.{3}", FromType.FullName, fromFieldInfo.Name, ToType.FullName, toFieldInfo.Name), ex); } } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Support/NetGZipProvider.cs0000644000175000017500000000212612146506550030201 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System; using System.IO; using System.IO.Compression; using System.Text; using ServiceStack.CacheAccess; using ServiceStack.Text; namespace ServiceStack.Common.Support { public class NetGZipProvider : IGZipProvider { public byte[] GZip(string text) { var buffer = Encoding.UTF8.GetBytes(text); using (var ms = new MemoryStream()) using (var zipStream = new GZipStream(ms, CompressionMode.Compress)) { zipStream.Write(buffer, 0, buffer.Length); zipStream.Close(); return ms.ToArray(); } } public string GUnzip(byte[] gzBuffer) { using (var compressedStream = new MemoryStream(gzBuffer)) using (var zipStream = new GZipStream(compressedStream, CompressionMode.Decompress)) { var utf8Bytes = zipStream.ReadFully(); return Encoding.UTF8.GetString(utf8Bytes); } } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/DisposableExtensions.cs0000644000175000017500000000237312146506550027643 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using ServiceStack.Logging; namespace ServiceStack.Common { public static class DisposableExtensions { public static void Dispose(this IEnumerable resources, ILog log) { foreach (var disposable in resources) { try { disposable.Dispose(); } catch (Exception ex) { if (log != null) { log.Error(string.Format("Error disposing of '{0}'", disposable.GetType().FullName), ex); } } } } public static void Dispose(this IEnumerable resources) { Dispose(resources, null); } public static void Dispose(params IDisposable[] disposables) { Dispose(disposables, null); } public static void Run(this T disposable, Action runActionThenDispose) where T : IDisposable { using (disposable) { runActionThenDispose(disposable); } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/StreamExtensions.cs0000644000175000017500000000602612146506550027010 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !XBOX using System; using System.IO; using System.Text; using ServiceStack.CacheAccess; using ServiceStack.Common.Support; using ServiceStack.Common.Web; using ServiceStack.Text; namespace ServiceStack.Common { public static class StreamExtensions { #if !MONOTOUCH /// /// Compresses the specified text using the default compression method: Deflate /// /// The text. /// Type of the compression. /// public static byte[] Compress(this string text, string compressionType) { if (compressionType == CompressionTypes.Deflate) return Deflate(text); if (compressionType == CompressionTypes.GZip) return GZip(text); throw new NotSupportedException(compressionType); } public static IDeflateProvider DeflateProvider = new NetDeflateProvider(); public static IGZipProvider GZipProvider = new NetGZipProvider(); /// /// Decompresses the specified gz buffer using the default compression method: Inflate /// /// The gz buffer. /// Type of the compression. /// public static string Decompress(this byte[] gzBuffer, string compressionType) { if (compressionType == CompressionTypes.Deflate) return Inflate(gzBuffer); if (compressionType == CompressionTypes.GZip) return GUnzip(gzBuffer); throw new NotSupportedException(compressionType); } public static byte[] Deflate(this string text) { return DeflateProvider.Deflate(text); } public static string Inflate(this byte[] gzBuffer) { return DeflateProvider.Inflate(gzBuffer); } public static byte[] GZip(this string text) { return GZipProvider.GZip(text); } public static string GUnzip(this byte[] gzBuffer) { return GZipProvider.GUnzip(gzBuffer); } #endif public static string ToUtf8String(this Stream stream) { if (stream == null) throw new ArgumentNullException("stream"); using (var reader = new StreamReader(stream, Encoding.UTF8)) { return reader.ReadToEnd(); } } public static byte[] ToBytes(this Stream stream) { if (stream == null) throw new ArgumentNullException("stream"); return stream.ReadFully(); } public static void Write(this Stream stream, string text) { var bytes = Encoding.ASCII.GetBytes(text); stream.Write(bytes, 0, bytes.Length); } } } #endif smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ByteArrayExtensions.cs0000644000175000017500000000075612146506550027463 0ustar00meebeymeebey00000000000000namespace ServiceStack.Common { public static class ByteArrayExtensions { public static bool AreEqual(this byte[] b1, byte[] b2) { if (b1 == b2) return true; if (b1 == null || b2 == null) return false; if (b1.Length != b2.Length) return false; for (var i = 0; i < b1.Length; i++) { if (b1[i] != b2[i]) return false; } return true; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/AssertExtensions.cs0000644000175000017500000000412612146506550027015 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; namespace ServiceStack.Common { public static class AssertExtensions { public static void ThrowOnFirstNull(params object[] objs) { foreach (var obj in objs) { ThrowIfNull(obj); } } public static void ThrowIfNull(this object obj) { ThrowIfNull(obj, null); } public static void ThrowIfNull(this object obj, string varName) { if (obj == null) throw new ArgumentNullException(varName ?? "object"); } public static void ThrowIfNullOrEmpty(this string strValue) { ThrowIfNullOrEmpty(strValue, null); } public static void ThrowIfNullOrEmpty(this string strValue, string varName) { if (string.IsNullOrEmpty(strValue)) throw new ArgumentNullException(varName ?? "string"); } public static void ThrowIfNullOrEmpty(this ICollection collection) { ThrowIfNullOrEmpty(collection, null); } public static void ThrowIfNullOrEmpty(this ICollection collection, string varName) { var fieldName = varName ?? "collection"; if (collection == null) throw new ArgumentNullException(fieldName); if (collection.Count == 0) throw new ArgumentException(fieldName + " is empty"); } public static void ThrowIfNullOrEmpty(this ICollection collection) { ThrowIfNullOrEmpty(collection, null); } public static void ThrowIfNullOrEmpty(this ICollection collection, string varName) { var fieldName = varName ?? "collection"; if (collection == null) throw new ArgumentNullException(fieldName); if (collection.Count == 0) throw new ArgumentException(fieldName + " is empty"); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/0000755000175000017500000000000012146506550025523 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Support/0000755000175000017500000000000012146506550027177 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Support/XmlSerializableWrapper.cs0000644000175000017500000000760212146506550034163 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System; using System.Runtime.Serialization; using System.Xml; using System.Xml.Serialization; namespace ServiceStack.ServiceModel.Support { public sealed class XmlSerializerWrapper : XmlObjectSerializer { System.Xml.Serialization.XmlSerializer serializer; string defaultNS; readonly Type objectType; public XmlSerializerWrapper(Type type) : this(type, null, null) { } public XmlSerializerWrapper(Type type, string name, string ns) { this.objectType = type; if (!String.IsNullOrEmpty(ns)) { this.defaultNS = ns; this.serializer = new System.Xml.Serialization.XmlSerializer(type, ns); } else { this.defaultNS = GetNamespace(type); this.serializer = new System.Xml.Serialization.XmlSerializer(type); } } public override bool IsStartObject(XmlDictionaryReader reader) { throw new NotImplementedException(); } public override object ReadObject(XmlDictionaryReader reader, bool verifyObjectName) { throw new NotImplementedException(); } public override void WriteEndObject(XmlDictionaryWriter writer) { throw new NotImplementedException(); } public override void WriteObjectContent(XmlDictionaryWriter writer, object graph) { throw new NotImplementedException(); } public override void WriteStartObject(XmlDictionaryWriter writer, object graph) { throw new NotImplementedException(); } public override void WriteObject(XmlDictionaryWriter writer, object graph) { this.serializer.Serialize(writer, graph); } public override object ReadObject(XmlDictionaryReader reader) { string readersNS; readersNS = (String.IsNullOrEmpty(reader.NamespaceURI)) ? "" : reader.NamespaceURI; if (String.Compare(this.defaultNS, readersNS) != 0) { this.serializer = new System.Xml.Serialization.XmlSerializer(this.objectType, readersNS); this.defaultNS = readersNS; } return (this.serializer.Deserialize(reader)); } /// /// Gets the namespace from an attribute marked on the type's definition /// /// /// Namespace of type public static string GetNamespace(Type type) { Attribute[] attrs = (Attribute[])type.GetCustomAttributes(typeof(DataContractAttribute), true); if (attrs.Length > 0) { DataContractAttribute dcAttr = (DataContractAttribute)attrs[0]; return dcAttr.Namespace; } attrs = (Attribute[])type.GetCustomAttributes(typeof(XmlRootAttribute), true); if (attrs.Length > 0) { XmlRootAttribute xmlAttr = (XmlRootAttribute)attrs[0]; return xmlAttr.Namespace; } attrs = (Attribute[])type.GetCustomAttributes(typeof(XmlTypeAttribute), true); if (attrs.Length > 0) { XmlTypeAttribute xmlAttr = (XmlTypeAttribute)attrs[0]; return xmlAttr.Namespace; } attrs = (Attribute[])type.GetCustomAttributes(typeof(XmlElementAttribute), true); if (attrs.Length > 0) { XmlElementAttribute xmlAttr = (XmlElementAttribute)attrs[0]; return xmlAttr.Namespace; } return null; } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Validation/0000755000175000017500000000000012146506550027615 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Validation/ValidationErrorResult.cs0000644000175000017500000000723512146506550034456 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using ServiceStack.Common.Extensions; namespace ServiceStack.Validation { /// /// Encapsulates a validation result. /// public class ValidationErrorResult { public static ValidationErrorResult Success { get { return new ValidationErrorResult(); } } /// /// Gets or sets the success code. /// /// The success code. public string SuccessCode { get; protected set; } /// /// Gets or sets the error code. /// /// The error code. public string ErrorCode { get; set; } /// /// Gets or sets the success message. /// /// The success message. public string SuccessMessage { get; set; } /// /// Gets or sets the error message. /// /// The error message. public string ErrorMessage { get; set; } public virtual string Message { get { return Errors.Count > 0 ? ErrorMessage : SuccessMessage; } } /// /// The errors generated by the validation. /// public IList Errors { get; protected set; } /// /// Returns True if the validation was successful (errors list is empty). /// public virtual bool IsValid { get { return this.Errors.Count == 0; } } /// /// Constructs a new ValidationResult /// public ValidationErrorResult() : this(new List()) { } /// /// Constructs a new ValidationResult /// /// A list of validation results public ValidationErrorResult(IList errors) : this(errors, null, null) { } /// /// Initializes a new instance of the class. /// /// The errors. /// The success code. /// The error code. public ValidationErrorResult(IList errors, string successCode, string errorCode) { this.Errors = errors ?? new List(); if (successCode != null) { this.SuccessCode = successCode; this.SuccessMessage = successCode.SplitCamelCase(); } if (errorCode != null) { this.ErrorCode = errorCode; } else { if (this.Errors.Count > 0) { this.ErrorCode = this.Errors[0].ErrorCode; this.ErrorMessage = this.Errors[0].ErrorMessage; } } if (this.ErrorMessage == null && this.ErrorCode != null) { this.ErrorMessage = this.ErrorCode.ToEnglish(); } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Validation/ValidationError.cs0000644000175000017500000001235212146506550033253 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Text; using ServiceStack.Common.Extensions; namespace ServiceStack.Validation { /// /// The exception which is thrown when a validation error occured. /// This validation is serialized in a extra clean and human-readable way by ServiceStack. /// public class ValidationError : ArgumentException { private readonly string errorCode; public string ErrorMessage { get; private set; } public ValidationError(string errorCode) : this(errorCode, errorCode.SplitCamelCase()) { } public ValidationError(ValidationErrorResult validationResult) : base(validationResult.ErrorMessage) { this.errorCode = validationResult.ErrorCode; this.ErrorMessage = validationResult.ErrorMessage; this.Violations = validationResult.Errors; } public ValidationError(ValidationErrorField validationError) : this(validationError.ErrorCode, validationError.ErrorMessage) { this.Violations.Add(validationError); } public ValidationError(string errorCode, string errorMessage) : base(errorMessage) { this.errorCode = errorCode; this.ErrorMessage = errorMessage; this.Violations = new List(); } /// /// Returns the first error code /// /// The error code. public string ErrorCode { get { return this.errorCode; } } public override string Message { get { //If there is only 1 validation error than we just show the error message if (this.Violations.Count == 0) return this.ErrorMessage; if (this.Violations.Count == 1) return this.ErrorMessage ?? this.Violations[0].ErrorMessage; var sb = new StringBuilder(this.ErrorMessage).AppendLine(); foreach (var error in this.Violations) { if (!string.IsNullOrEmpty(error.ErrorMessage)) { var fieldLabel = error.FieldName != null ? string.Format(" [{0}]", error.FieldName) : null; sb.AppendFormat("\n - {0}{1}", error.ErrorMessage, fieldLabel); } else { var fieldLabel = error.FieldName != null ? ": " + error.FieldName : null; sb.AppendFormat("\n - {0}{1}", error.ErrorCode, fieldLabel); } } return sb.ToString(); } } public IList Violations { get; private set; } /// /// Used if we need to serialize this exception to XML /// /// public string ToXml() { var sb = new StringBuilder(); sb.Append(""); foreach (ValidationErrorField error in this.Violations) { sb.Append("") .AppendFormat("{0}", error.ErrorCode) .AppendFormat("{0}", error.FieldName) .AppendFormat("{0}", error.ErrorMessage) .Append(""); } sb.Append(""); return sb.ToString(); } public static ValidationError CreateException(Enum errorCode) { return new ValidationError(errorCode.ToString()); } public static ValidationError CreateException(Enum errorCode, string errorMessage) { return new ValidationError(errorCode.ToString(), errorMessage); } public static ValidationError CreateException(Enum errorCode, string errorMessage, string fieldName) { return CreateException(errorCode.ToString(), errorMessage, fieldName); } public static ValidationError CreateException(string errorCode) { return new ValidationError(errorCode); } public static ValidationError CreateException(string errorCode, string errorMessage) { return new ValidationError(errorCode, errorMessage); } public static ValidationError CreateException(string errorCode, string errorMessage, string fieldName) { var error = new ValidationErrorField(errorCode, fieldName, errorMessage); return new ValidationError(new ValidationErrorResult(new List { error })); } public static ValidationError CreateException(ValidationErrorField error) { return new ValidationError(error); } public static void ThrowIfNotValid(ValidationErrorResult validationResult) { if (!validationResult.IsValid) { throw new ValidationError(validationResult); } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Validation/ValidationErrorField.cs0000644000175000017500000000227112146506550034216 0ustar00meebeymeebey00000000000000using System; using ServiceStack.Common.Extensions; namespace ServiceStack.Validation { public class ValidationErrorField { public ValidationErrorField(string errorCode, string fieldName) : this(errorCode, fieldName, null) {} public ValidationErrorField(string errorCode) : this(errorCode, null, null) { } public ValidationErrorField(Enum errorCode) : this(errorCode.ToString(), null, null) { } public ValidationErrorField(Enum errorCode, string fieldName) : this(errorCode.ToString(), fieldName, null) { } public ValidationErrorField(Enum errorCode, string fieldName, string errorMessage) : this(errorCode.ToString(), fieldName, errorMessage) { } public ValidationErrorField(string errorCode, string fieldName, string errorMessage) { this.ErrorCode = errorCode; this.FieldName = fieldName; this.ErrorMessage = errorMessage ?? errorCode.ToEnglish(); } public string ErrorCode { get; set; } public string ErrorMessage { get; set; } public string FieldName { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Serialization/0000755000175000017500000000000012146506550030340 5ustar00meebeymeebey00000000000000XmlSerializableDeserializer.cs0000644000175000017500000000463612146506550036253 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Serialization#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System; using System.IO; using System.Text; using System.Xml; using System.Runtime.Serialization; using ServiceStack.DesignPatterns.Serialization; namespace ServiceStack.ServiceModel.Serialization { public class XmlSerializableDeserializer : IStringDeserializer { public static XmlSerializableDeserializer Instance = new XmlSerializableDeserializer(); public To Parse(string xml) { var type = typeof(To); return (To)Parse(xml, type); } public object Parse(string xml, Type type) { try { var bytes = Encoding.UTF8.GetBytes(xml); using (var reader = XmlDictionaryReader.CreateTextReader(bytes, new XmlDictionaryReaderQuotas())) { var serializer = new System.Xml.Serialization.XmlSerializer(type); return serializer.Deserialize(reader); } } catch (Exception ex) { throw new SerializationException(string.Format("Error serializing object of type {0}", type.FullName), ex); } } public To Parse(TextReader from) { var type = typeof(To); try { using (from) { var serializer = new System.Xml.Serialization.XmlSerializer(type); return (To)serializer.Deserialize(from); } } catch (Exception ex) { throw new SerializationException(string.Format("Error serializing object of type {0}", type.FullName), ex); } } public To Parse(Stream from) { var type = typeof(To); try { using (var reader = XmlDictionaryReader.CreateTextReader(from, new XmlDictionaryReaderQuotas())) { var serializer = new System.Xml.Serialization.XmlSerializer(type); return (To)serializer.Deserialize(reader); } } catch (Exception ex) { throw new SerializationException(string.Format("Error serializing object of type {0}", type.FullName), ex); } } } } #endif JsonDataContractSerializer.cs0000644000175000017500000000464612146506550036055 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Serializationusing System; using System.IO; using System.Runtime.Serialization; using ServiceStack.DesignPatterns.Serialization; using ServiceStack.Text; namespace ServiceStack.ServiceModel.Serialization { public class JsonDataContractSerializer { public static JsonDataContractSerializer Instance = new JsonDataContractSerializer(); public ITextSerializer TextSerializer { get; set; } public static void UseSerializer(ITextSerializer textSerializer) { Instance.TextSerializer = textSerializer; JsonDataContractDeserializer.Instance.TextSerializer = textSerializer; } public bool UseBcl { get; set; } public string SerializeToString(T obj) { if (TextSerializer != null) return TextSerializer.SerializeToString(obj); #if !SILVERLIGHT && !MONOTOUCH && !XBOX if (!UseBcl) return JsonSerializer.SerializeToString(obj); if (obj == null) return null; var type = obj.GetType(); try { using (var ms = new MemoryStream()) { var serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(type); serializer.WriteObject(ms, obj); ms.Position = 0; using (var sr = new StreamReader(ms)) { return sr.ReadToEnd(); } } } catch (Exception ex) { throw new SerializationException("JsonDataContractSerializer: Error converting type: " + ex.Message, ex); } #else return JsonSerializer.SerializeToString(obj); #endif } public void SerializeToStream(T obj, Stream stream) { if (TextSerializer != null) { TextSerializer.SerializeToStream(obj, stream); } #if !SILVERLIGHT && !MONOTOUCH && !XBOX else if (UseBcl) { var serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(obj.GetType()); serializer.WriteObject(stream, obj); } #endif else { JsonSerializer.SerializeToStream(obj, stream); } } } } XmlSerializableSerializer.cs0000644000175000017500000000260712146506550035736 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Serialization#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System; using System.IO; using System.Runtime.Serialization; using System.Text; using System.Xml; using ServiceStack.DesignPatterns.Serialization; using ServiceStack.ServiceModel.Support; namespace ServiceStack.ServiceModel.Serialization { public class XmlSerializableSerializer : IStringSerializer { public static XmlSerializableSerializer Instance = new XmlSerializableSerializer(); public string Parse(XmlDto from) { try { using (var ms = new MemoryStream()) { using (XmlWriter xw = new XmlTextWriter(ms, Encoding.UTF8)) { var ser = new XmlSerializerWrapper(from.GetType()); ser.WriteObject(xw, from); xw.Flush(); ms.Seek(0, SeekOrigin.Begin); using (var reader = new StreamReader(ms)) { return reader.ReadToEnd(); } } } } catch (Exception ex) { throw new SerializationException(string.Format("Error serializing object of type {0}", from.GetType().FullName), ex); } } } } #endifKeyValueDataContractDeserializer.cs0000644000175000017500000000274312146506550037176 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Serialization#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System; using System.Collections.Generic; using System.Collections.Specialized; namespace ServiceStack.ServiceModel.Serialization { public class KeyValueDataContractDeserializer { public static KeyValueDataContractDeserializer Instance = new KeyValueDataContractDeserializer(); public object Parse(NameValueCollection nameValues, Type returnType) { return Parse(nameValues.ToDictionary(), returnType); } readonly Dictionary typeStringMapSerializerMap = new Dictionary(); public object Parse(IDictionary keyValuePairs, Type returnType) { StringMapTypeDeserializer stringMapTypeDeserializer; lock (typeStringMapSerializerMap) { if (!typeStringMapSerializerMap.TryGetValue(returnType, out stringMapTypeDeserializer)) { stringMapTypeDeserializer = new StringMapTypeDeserializer(returnType); typeStringMapSerializerMap.Add(returnType, stringMapTypeDeserializer); } } return stringMapTypeDeserializer.CreateFromMap(keyValuePairs); } public To Parse(IDictionary keyValuePairs) { return (To)Parse(keyValuePairs, typeof(To)); } } } #endifStringMapTypeDeserializer.cs0000644000175000017500000001141712146506550035725 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Serializationusing System; using System.Collections.Generic; using System.Runtime.Serialization; using ServiceStack.Common; using ServiceStack.Common.Utils; using ServiceStack.Logging; using ServiceStack.Text; using ServiceStack.Text.Common; using ServiceStack.Text.Jsv; namespace ServiceStack.ServiceModel.Serialization { /// /// Serializer cache of delegates required to create a type from a string map (e.g. for REST urls) /// public class StringMapTypeDeserializer { private static readonly ILog Log = LogManager.GetLogger(typeof(StringMapTypeDeserializer)); internal class PropertySerializerEntry { public PropertySerializerEntry(SetPropertyDelegate propertySetFn, ParseStringDelegate propertyParseStringFn) { PropertySetFn = propertySetFn; PropertyParseStringFn = propertyParseStringFn; } public SetPropertyDelegate PropertySetFn; public ParseStringDelegate PropertyParseStringFn; public Type PropertyType; } private readonly Type type; private readonly Dictionary propertySetterMap = new Dictionary(StringComparer.InvariantCultureIgnoreCase); public StringMapTypeDeserializer(Type type) { this.type = type; if (type.IsOrHasGenericInterfaceTypeOf(typeof(IEnumerable<>))) return; foreach (var propertyInfo in type.GetProperties()) { var propertySetFn = JsvDeserializeType.GetSetPropertyMethod(type, propertyInfo); var propertyType = propertyInfo.PropertyType; var propertyParseStringFn = JsvReader.GetParseFn(propertyType); var propertySerializer = new PropertySerializerEntry(propertySetFn, propertyParseStringFn) { PropertyType = propertyType }; var attr = propertyInfo.FirstAttribute(); if (attr != null && attr.Name != null) { propertySetterMap[attr.Name] = propertySerializer; } propertySetterMap[propertyInfo.Name] = propertySerializer; } } public object PopulateFromMap(object instance, IDictionary keyValuePairs) { string propertyName = null; string propertyTextValue = null; PropertySerializerEntry propertySerializerEntry = null; try { if (instance == null) instance = ReflectionUtils.CreateInstance(type); foreach (var pair in keyValuePairs) { propertyName = pair.Key; propertyTextValue = pair.Value; if (!propertySetterMap.TryGetValue(propertyName, out propertySerializerEntry)) { if (propertyName != "format" && propertyName != "callback" && propertyName != "debug") { Log.WarnFormat("Property '{0}' does not exist on type '{1}'", propertyName, type.FullName); } continue; } var value = propertySerializerEntry.PropertyParseStringFn(propertyTextValue); if (value == null) { Log.WarnFormat("Could not create instance on '{0}' for property '{1}' with text value '{2}'", instance, propertyName, propertyTextValue); continue; } propertySerializerEntry.PropertySetFn(instance, value); } return instance; } catch (Exception ex) { var serializationException = new SerializationException("KeyValueDataContractDeserializer: Error converting to type: " + ex.Message, ex); if (propertyName != null) { serializationException.Data.Add("propertyName", propertyName); } if (propertyTextValue != null) { serializationException.Data.Add("propertyValueString", propertyTextValue); } if (propertySerializerEntry != null && propertySerializerEntry.PropertyType != null) { serializationException.Data.Add("propertyType", propertySerializerEntry.PropertyType); } throw serializationException; } } public object CreateFromMap(IDictionary keyValuePairs) { return PopulateFromMap(null, keyValuePairs); } } }DataContractSerializer.cs0000644000175000017500000000637512146506550035224 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Serializationusing System; using System.IO; using System.Runtime.Serialization; using System.Text; using System.Xml; using ServiceStack.DesignPatterns.Serialization; #if !SILVERLIGHT && !MONOTOUCH && !XBOX using System.IO.Compression; #endif namespace ServiceStack.ServiceModel.Serialization { public class DataContractSerializer : IStringSerializer { private static readonly Encoding Encoding = Encoding.UTF8;// new UTF8Encoding(true); public static DataContractSerializer Instance = new DataContractSerializer(); public string Parse(XmlDto from, bool indentXml) { try { using (var ms = new MemoryStream()) { var serializer = new System.Runtime.Serialization.DataContractSerializer(from.GetType()); #if !SILVERLIGHT && !MONOTOUCH && !XBOX using (var xw = new XmlTextWriter(ms, Encoding)) { if (indentXml) { xw.Formatting = Formatting.Indented; } serializer.WriteObject(xw, from); xw.Flush(); #else serializer.WriteObject(ms, from); #endif ms.Seek(0, SeekOrigin.Begin); using (var reader = new StreamReader(ms)) { return reader.ReadToEnd(); } #if !SILVERLIGHT && !MONOTOUCH && !XBOX } #endif } } catch (Exception ex) { throw new SerializationException(string.Format("Error serializing object of type {0}", from.GetType().FullName), ex); } } public string Parse(XmlDto from) { return Parse(from, false); } public void SerializeToStream(object obj, Stream stream) { #if !SILVERLIGHT && !MONOTOUCH && !XBOX using (var xw = new XmlTextWriter(stream, Encoding)) { var serializer = new System.Runtime.Serialization.DataContractSerializer(obj.GetType()); serializer.WriteObject(xw, obj); } #else var serializer = new System.Runtime.Serialization.DataContractSerializer(obj.GetType()); serializer.WriteObject(stream, obj); #endif } #if !SILVERLIGHT && !MONOTOUCH && !XBOX public void CompressToStream(XmlDto from, Stream stream) { using (var deflateStream = new DeflateStream(stream, CompressionMode.Compress)) using (var xw = new XmlTextWriter(deflateStream, Encoding)) { var serializer = new System.Runtime.Serialization.DataContractSerializer(from.GetType()); serializer.WriteObject(xw, from); xw.Flush(); } } public byte[] Compress(XmlDto from) { using (var ms = new MemoryStream()) { CompressToStream(from, ms); return ms.ToArray(); } } #endif } } JsonDataContractDeserializer.cs0000644000175000017500000000577412146506550036371 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Serializationusing System; using System.IO; using System.Runtime.Serialization; using System.Text; using ServiceStack.DesignPatterns.Serialization; using ServiceStack.Text; namespace ServiceStack.ServiceModel.Serialization { public class JsonDataContractDeserializer { public static JsonDataContractDeserializer Instance = new JsonDataContractDeserializer(); public ITextSerializer TextSerializer { get; set; } public bool UseBcl { get; set; } public object DeserializeFromString(string json, Type returnType) { if (TextSerializer != null) return TextSerializer.DeserializeFromString(json, returnType); #if !SILVERLIGHT && !MONOTOUCH && !XBOX if (!UseBcl) return JsonSerializer.DeserializeFromString(json, returnType); try { using (var ms = new MemoryStream()) { var bytes = Encoding.UTF8.GetBytes(json); ms.Write(bytes, 0, bytes.Length); ms.Position = 0; var serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(returnType); return serializer.ReadObject(ms); } } catch (Exception ex) { throw new SerializationException("JsonDataContractDeserializer: Error converting to type: " + ex.Message, ex); } #else return JsonSerializer.DeserializeFromString(json, returnType); #endif } public T DeserializeFromString(string json) { if (TextSerializer != null) return TextSerializer.DeserializeFromString(json); if (UseBcl) return (T)DeserializeFromString(json, typeof(T)); return JsonSerializer.DeserializeFromString(json); } public T DeserializeFromStream(Stream stream) { if (TextSerializer != null) return TextSerializer.DeserializeFromStream(stream); #if !SILVERLIGHT && !MONOTOUCH && !XBOX if (UseBcl) { var serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(T)); return (T)serializer.ReadObject(stream); } #endif return JsonSerializer.DeserializeFromStream(stream); } public object DeserializeFromStream(Type type, Stream stream) { if (TextSerializer != null) return TextSerializer.DeserializeFromStream(type, stream); #if !SILVERLIGHT && !MONOTOUCH && !XBOX if (UseBcl) { var serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(type); return serializer.ReadObject(stream); } #endif return JsonSerializer.DeserializeFromStream(type, stream); } } } DataContractDeserializer.cs0000644000175000017500000000447612146506550035535 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/Serializationusing System; using System.IO; using System.Text; using System.Runtime.Serialization; using System.Xml; using ServiceStack.DesignPatterns.Serialization; namespace ServiceStack.ServiceModel.Serialization { public class DataContractDeserializer : IStringDeserializer { /// /// Default MaxStringContentLength is 8k, and throws an exception when reached /// #if !SILVERLIGHT && !MONOTOUCH && !XBOX private readonly XmlDictionaryReaderQuotas quotas; #endif public static DataContractDeserializer Instance = new DataContractDeserializer( #if !SILVERLIGHT && !MONOTOUCH && !XBOX new XmlDictionaryReaderQuotas { MaxStringContentLength = 1024 * 1024, } #endif ); public DataContractDeserializer( #if !SILVERLIGHT && !MONOTOUCH && !XBOX XmlDictionaryReaderQuotas quotas=null #endif ) { #if !SILVERLIGHT && !MONOTOUCH && !XBOX this.quotas = quotas; #endif } public object Parse(string xml, Type type) { try { var bytes = Encoding.UTF8.GetBytes(xml); #if MONOTOUCH using (var reader = XmlDictionaryReader.CreateTextReader(bytes, null)) #elif SILVERLIGHT using (var reader = XmlDictionaryReader.CreateTextReader(bytes, XmlDictionaryReaderQuotas.Max)) #else using (var reader = XmlDictionaryReader.CreateTextReader(bytes, this.quotas)) #endif { var serializer = new System.Runtime.Serialization.DataContractSerializer(type); return serializer.ReadObject(reader); } } catch (Exception ex) { throw new SerializationException("DeserializeDataContract: Error converting type: " + ex.Message, ex); } } public T Parse(string xml) { var type = typeof(T); return (T)Parse(xml, type); } public T DeserializeFromStream(Stream stream) { var serializer = new System.Runtime.Serialization.DataContractSerializer(typeof(T)); return (T)serializer.ReadObject(stream); } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/XLinqExtensions.cs0000644000175000017500000002415512146506550031174 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX // // ServiceStack: Useful extensions to simplify parsing xml with XLinq // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2012 ServiceStack // // Licensed under the new BSD license. // using System; using System.Collections.Generic; using System.Xml; using System.Xml.Linq; namespace ServiceStack.ServiceModel { public static class XLinqExtensions { public static string GetString(this XElement el, string name) { return el == null ? null : GetElementValueOrDefault(el, name, x => x.Value); } public static string GetStringAttributeOrDefault(this XElement element, string name) { var attr = AnyAttribute(element, name); return attr == null ? null : GetAttributeValueOrDefault(attr, name, x => x.Value); } public static bool GetBool(this XElement el, string name) { AssertElementHasValue(el, name); return (bool)GetElement(el, name); } public static bool GetBoolOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (bool)x); } public static bool? GetNullableBool(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (bool?)childEl; } public static int GetInt(this XElement el, string name) { AssertElementHasValue(el, name); return (int)GetElement(el, name); } public static int GetIntOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (int)x); } public static int? GetNullableInt(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (int?)childEl; } public static long GetLong(this XElement el, string name) { AssertElementHasValue(el, name); return (long)GetElement(el, name); } public static long GetLongOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (long)x); } public static long? GetNullableLong(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (long?)childEl; } public static decimal GetDecimal(this XElement el, string name) { AssertElementHasValue(el, name); return (decimal)GetElement(el, name); } public static decimal GetDecimalOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (decimal)x); } public static decimal? GetNullableDecimal(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (decimal?)childEl; } public static DateTime GetDateTime(this XElement el, string name) { AssertElementHasValue(el, name); return (DateTime)GetElement(el, name); } public static DateTime GetDateTimeOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (DateTime)x); } public static DateTime? GetNullableDateTime(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (DateTime?)childEl; } public static TimeSpan GetTimeSpan(this XElement el, string name) { AssertElementHasValue(el, name); return (TimeSpan)GetElement(el, name); } public static TimeSpan GetTimeSpanOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (TimeSpan)x); } public static TimeSpan? GetNullableTimeSpan(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (TimeSpan?)childEl; } public static Guid GetGuid(this XElement el, string name) { AssertElementHasValue(el, name); return (Guid)GetElement(el, name); } public static Guid GetGuidOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (Guid)x); } public static Guid? GetNullableGuid(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (Guid?)childEl; } public static T GetElementValueOrDefault(this XElement element, string name, Func converter) { if (converter == null) { throw new ArgumentNullException("converter"); } var el = GetElement(element, name); return el == null || string.IsNullOrEmpty(el.Value) ? default(T) : converter(el); } public static XElement GetElement(this XElement element, string name) { if (element == null) { throw new ArgumentNullException("element"); } if (name == null) { throw new ArgumentNullException("name"); } return element.AnyElement(name); } public static T GetAttributeValueOrDefault(this XAttribute attr, string name, Func converter) { if (converter == null) { throw new ArgumentNullException("converter"); } return attr == null || string.IsNullOrEmpty(attr.Value) ? default(T) : converter(attr); } public static void AssertExactlyOneResult(this XElement queryListItems, string referenceNumber, string formType) { int count = Convert.ToInt32(queryListItems.AnyAttribute("ItemCount").Value); if (count == 0) throw new InvalidOperationException(string.Format("There is no {0} for with a deal reference number {1}", formType, referenceNumber)); if (count > 1) throw new InvalidOperationException( string.Format("There are more than one {0}s with deal reference number {1}", formType, referenceNumber)); } public static void AssertElementHasValue(this XElement element, string name) { if (element == null) { throw new ArgumentNullException("element"); } if (name == null) { throw new ArgumentNullException("name"); } var childEl = element.AnyElement(name); if (childEl == null || string.IsNullOrEmpty(childEl.Value)) { throw new ArgumentNullException(name, string.Format("{0} is required", name)); } } public static List GetValues(this IEnumerable els) { var values = new List(); foreach (var el in els) { values.Add(el.Value); } return values; } public static XAttribute AnyAttribute(this XElement element, string name) { if (element == null) return null; foreach (var attribute in element.Attributes()) { if (attribute.Name.LocalName == name) { return attribute; } } return null; } public static IEnumerable AllElements(this XElement element, string name) { var els = new List(); if (element == null) return els; foreach (var node in element.Nodes()) { if (node.NodeType != XmlNodeType.Element) continue; var childEl = (XElement)node; if (childEl.Name.LocalName == name) { els.Add(childEl); } } return els; } public static XElement AnyElement(this XElement element, string name) { if (element == null) return null; foreach (var node in element.Nodes()) { if (node.NodeType != XmlNodeType.Element) continue; var childEl = (XElement)node; if (childEl.Name.LocalName == name) { return childEl; } } return null; } public static XElement AnyElement(this IEnumerable elements, string name) { foreach (var element in elements) { if (element.Name.LocalName == name) { return element; } } return null; } public static IEnumerable AllElements(this IEnumerable elements, string name) { var els = new List(); foreach (var element in elements) { els.AddRange(AllElements(element, name)); } return els; } public static XElement FirstElement(this XElement element) { if (element.FirstNode.NodeType == XmlNodeType.Element) { return (XElement)element.FirstNode; } return null; } } } #endif smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceModel/DictionaryExtensions.cs0000644000175000017500000000270712146506550032245 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System.Collections.Generic; using System.Collections.Specialized; namespace ServiceStack.ServiceModel { public static class DictionaryExtensions { public static Dictionary ToDictionary(this NameValueCollection nameValues) { if (nameValues == null) return new Dictionary(); var map = new Dictionary(); foreach (var key in nameValues.AllKeys) { if (key == null) { //occurs when no value is specified, e.g. 'path/to/page?debug' //throw new ArgumentNullException("key", "nameValues: " + nameValues); continue; } var values = nameValues.GetValues(key); if (values != null && values.Length > 0) { map[key] = values[0]; } } return map; } public static NameValueCollection ToNameValueCollection(this Dictionary map) { if (map == null) return new NameValueCollection(); var nameValues = new NameValueCollection(); foreach (var item in map) { nameValues.Add(item.Key, item.Value); } return nameValues; } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/EnumerableExtensions.cs0000644000175000017500000000646412146506550027642 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.Common { public static class EnumerableExtensions { public static bool IsEmpty(this ICollection collection) { return collection == null || collection.Count == 0; } public static HashSet ToHashSet(this IEnumerable items) { return new HashSet(items); } public static List SafeConvertAll(this IEnumerable items, Func converter) { return items == null ? new List() : Extensions.EnumerableExtensions.ConvertAll(items, converter); } public static List ToObjects(this IEnumerable items) { var to = new List(); foreach (var item in items) { to.Add(item); } return to; } public static string FirstNonDefaultOrEmpty(this IEnumerable values) { foreach (var value in values) { if (!string.IsNullOrEmpty(value)) return value; } return null; } public static T FirstNonDefault(this IEnumerable values) { foreach (var value in values) { if (!Equals(value, default(T))) return value; } return default(T); } public static bool EquivalentTo(this IEnumerable thisList, IEnumerable otherList) { if (thisList == null || otherList == null) return thisList == otherList; var otherEnum = otherList.GetEnumerator(); foreach (var item in thisList) { if (!otherEnum.MoveNext()) return false; var thisIsDefault = Equals(item, default(T)); var otherIsDefault = Equals(otherEnum.Current, default(T)); if (thisIsDefault || otherIsDefault) { return thisIsDefault && otherIsDefault; } if (!item.Equals(otherEnum.Current)) return false; } var hasNoMoreLeftAsWell = !otherEnum.MoveNext(); return hasNoMoreLeftAsWell; } public static IEnumerable BatchesOf(this IEnumerable sequence, int batchSize) { var batch = new List(batchSize); foreach (var item in sequence) { batch.Add(item); if (batch.Count >= batchSize) { yield return batch.ToArray(); batch.Clear(); } } if (batch.Count > 0) { yield return batch.ToArray(); batch.Clear(); } } public static Dictionary ToSafeDictionary(this IEnumerable list, Func expr) { var map = new Dictionary(); if (list != null) { foreach (var item in list) { map[expr(item)] = item; } } return map; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ActionExecExtensions.cs0000644000175000017500000000630112146506550027573 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Linq; using System.Threading; using ServiceStack.Common.Support; namespace ServiceStack.Common { public static class ActionExecExtensions { public static void ExecAllAndWait(this ICollection actions, TimeSpan timeout) { var waitHandles = new WaitHandle[actions.Count]; var i = 0; foreach (var action in actions) { waitHandles[i++] = action.BeginInvoke(null, null).AsyncWaitHandle; } WaitAll(waitHandles, timeout); } public static List ExecAsync(this IEnumerable actions) { var waitHandles = new List(); foreach (var action in actions) { var waitHandle = new AutoResetEvent(false); waitHandles.Add(waitHandle); var commandExecsHandler = new ActionExecHandler(action, waitHandle); ThreadPool.QueueUserWorkItem(x => ((ActionExecHandler)x).Execute(), commandExecsHandler); } return waitHandles; } public static bool WaitAll(this List waitHandles, int timeoutMs) { return WaitAll(waitHandles.ToArray(), timeoutMs); } public static bool WaitAll(this ICollection waitHandles, int timeoutMs) { return WaitAll(waitHandles.ToArray(), timeoutMs); } public static bool WaitAll(this ICollection waitHandles, TimeSpan timeout) { return WaitAll(waitHandles.ToArray(), (int)timeout.TotalMilliseconds); } #if !SILVERLIGHT && !MONOTOUCH && !XBOX public static bool WaitAll(this List asyncResults, TimeSpan timeout) { var waitHandles = asyncResults.ConvertAll(x => x.AsyncWaitHandle); return WaitAll(waitHandles.ToArray(), (int)timeout.TotalMilliseconds); } public static bool WaitAll(WaitHandle[] waitHandles, TimeSpan timeout) { return WaitAll(waitHandles, (int)timeout.TotalMilliseconds); } public static bool WaitAll(WaitHandle[] waitHandles, int timeOutMs) { // throws an exception if there are no wait handles if (waitHandles == null) throw new ArgumentNullException("waitHandles"); if (waitHandles.Length == 0) return true; if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA) { // WaitAll for multiple handles on an STA thread is not supported. // CurrentThread is ApartmentState.STA when run under unit tests var successfullyComplete = true; foreach (var waitHandle in waitHandles) { successfullyComplete = successfullyComplete && waitHandle.WaitOne(timeOutMs, false); } return successfullyComplete; } return WaitHandle.WaitAll(waitHandles, timeOutMs, false); } #endif } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Model.cs0000644000175000017500000000114212146506550024527 0ustar00meebeymeebey00000000000000using ServiceStack.Common.Utils; namespace ServiceStack { public static class Model { public static object ToId(this T entity) { return entity.GetId(); } public static string ToUrn(object id) { return IdUtils.CreateUrn(id); } public static string ToUrn(this T entity) { return entity.CreateUrn(); } public static string ToSafePathCacheKey(string idValue) { return IdUtils.CreateCacheKeyPath(idValue); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ReflectionExtensions.cs0000644000175000017500000001640612146506550027652 0ustar00meebeymeebey00000000000000using System; using System.Diagnostics; using System.Linq; using System.Reflection; using ServiceStack.Common.Utils; namespace ServiceStack.Common { public static class ReflectionExtensions { public static To PopulateWith(this To to, From from) { return ReflectionUtils.PopulateObject(to, from); } public static To PopulateWithNonDefaultValues(this To to, From from) { return ReflectionUtils.PopulateWithNonDefaultValues(to, from); } public static To PopulateFromPropertiesWithAttribute(this To to, From from) { return ReflectionUtils.PopulateFromPropertiesWithAttribute(to, from, typeof(TAttr)); } public static T TranslateTo(this object from) where T : new() { var to = new T(); return to.PopulateWith(from); } public static TAttribute FirstAttribute(this Type type) { return type.FirstAttribute(true); } public static TAttribute FirstAttribute(this Type type, bool inherit) { var attrs = type.GetCustomAttributes(typeof(TAttribute), inherit); return (TAttribute)(attrs.Length > 0 ? attrs[0] : null); } public static TAttribute FirstAttribute(this PropertyInfo propertyInfo) { return propertyInfo.FirstAttribute(true); } public static TAttribute FirstAttribute(this PropertyInfo propertyInfo, bool inherit) { var attrs = propertyInfo.GetCustomAttributes(typeof(TAttribute), inherit); return (TAttribute)(attrs.Length > 0 ? attrs[0] : null); } public static bool IsGenericType(this Type type) { while (type != null) { if (type.IsGenericType) return true; type = type.BaseType; } return false; } public static Type FirstGenericTypeDefinition(this Type type) { while (type != null) { if (type.IsGenericType) return type.GetGenericTypeDefinition(); type = type.BaseType; } return null; } public static bool IsDynamic(this Assembly assembly) { #if MONOTOUCH return false; #else try { var isDyanmic = assembly is System.Reflection.Emit.AssemblyBuilder || string.IsNullOrEmpty(assembly.Location); return isDyanmic; } catch (NotSupportedException) { //Ignore assembly.Location not supported in a dynamic assembly. return true; } #endif } public static bool IsDebugBuild(this Assembly assembly) { return assembly.GetCustomAttributes(false) .OfType() .Select(attr => attr.IsJITTrackingEnabled) .FirstOrDefault(); } } } #if FALSE && DOTNET35 //Efficient POCO Translator from: http://www.yoda.arachsys.com/csharp/miscutil/ using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; namespace MiscUtil.Reflection { /// /// Generic class which copies to its target type from a source /// type specified in the Copy method. The types are specified /// separately to take advantage of type inference on generic /// method arguments. /// public static class PropertyCopy where TTarget : class, new() { /// /// Copies all readable properties from the source to a new instance /// of TTarget. /// public static TTarget CopyFrom(TSource source) where TSource : class { return PropertyCopier.Copy(source); } /// /// Static class to efficiently store the compiled delegate which can /// do the copying. We need a bit of work to ensure that exceptions are /// appropriately propagated, as the exception is generated at type initialization /// time, but we wish it to be thrown as an ArgumentException. /// private static class PropertyCopier where TSource : class { private static readonly Func copier; private static readonly Exception initializationException; internal static TTarget Copy(TSource source) { if (initializationException != null) { throw initializationException; } if (source == null) { throw new ArgumentNullException("source"); } return copier(source); } static PropertyCopier() { try { copier = BuildCopier(); initializationException = null; } catch (Exception e) { copier = null; initializationException = e; } } private static Func BuildCopier() { ParameterExpression sourceParameter = Expression.Parameter(typeof(TSource), "source"); var bindings = new List(); foreach (PropertyInfo sourceProperty in typeof(TSource).GetProperties()) { if (!sourceProperty.CanRead) { continue; } PropertyInfo targetProperty = typeof(TTarget).GetProperty(sourceProperty.Name); if (targetProperty == null) { throw new ArgumentException("Property " + sourceProperty.Name + " is not present and accessible in " + typeof(TTarget).FullName); } if (!targetProperty.CanWrite) { throw new ArgumentException("Property " + sourceProperty.Name + " is not writable in " + typeof(TTarget).FullName); } if (!targetProperty.PropertyType.IsAssignableFrom(sourceProperty.PropertyType)) { throw new ArgumentException("Property " + sourceProperty.Name + " has an incompatible type in " + typeof(TTarget).FullName); } bindings.Add(Expression.Bind(targetProperty, Expression.Property(sourceParameter, sourceProperty))); } Expression initializer = Expression.MemberInit(Expression.New(typeof(TTarget)), bindings); return Expression.Lambda>(initializer, sourceParameter).Compile(); } } } } #endif smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/IntExtensions.cs0000644000175000017500000000371412146506550026310 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.Common { public static class IntExtensions { public static IEnumerable Times(this int times) { for (var i=0; i < times; i++) { yield return i; } } public static void Times(this int times, Action actionFn) { for (var i = 0; i < times; i++) { actionFn(i); } } public static void Times(this int times, Action actionFn) { for (var i = 0; i < times; i++) { actionFn(); } } public static List TimesAsync(this int times, Action actionFn) { var asyncResults = new List(times); for (var i = 0; i < times; i++) { asyncResults.Add(actionFn.BeginInvoke(i, null, null)); } return asyncResults; } public static List TimesAsync(this int times, Action actionFn) { var asyncResults = new List(times); for (var i = 0; i < times; i++) { asyncResults.Add(actionFn.BeginInvoke(null, null)); } return asyncResults; } public static List Times(this int times, Func actionFn) { var list = new List(); for (var i=0; i < times; i++) { list.Add(actionFn()); } return list; } public static List Times(this int times, Func actionFn) { var list = new List(); for (var i=0; i < times; i++) { list.Add(actionFn(i)); } return list; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ExecExtensions.cs0000644000175000017500000001052412146506550026437 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using ServiceStack.Logging; namespace ServiceStack.Common { public static class ExecExtensions { public static void LogError(Type declaringType, string clientMethodName, Exception ex) { var log = LogManager.GetLogger(declaringType); log.Error(string.Format("'{0}' threw an error on {1}: {2}", declaringType.FullName, clientMethodName, ex.Message), ex); } public static void ExecAll(this IEnumerable instances, Action action) { foreach (var instance in instances) { try { action(instance); } catch (Exception ex) { LogError(instance.GetType(), action.GetType().Name, ex); } } } public static void ExecAllWithFirstOut(this IEnumerable instances, Func action, ref TReturn firstResult) { foreach (var instance in instances) { try { var result = action(instance); if (!Equals(firstResult, default(TReturn))) { firstResult = result; } } catch (Exception ex) { LogError(instance.GetType(), action.GetType().Name, ex); } } } public static TReturn ExecReturnFirstWithResult(this IEnumerable instances, Func action) { foreach (var instance in instances) { try { var result = action(instance); if (!Equals(result, default(TReturn))) { return result; } } catch (Exception ex) { LogError(instance.GetType(), action.GetType().Name, ex); } } return default(TReturn); } public static void RetryUntilTrue(Func action, TimeSpan? timeOut) { var i = 0; var firstAttempt = DateTime.Now; while (timeOut == null || DateTime.Now - firstAttempt < timeOut.Value) { i++; if (action()) { return; } SleepBackOffMultiplier(i); } throw new TimeoutException(string.Format("Exceeded timeout of {0}", timeOut.Value)); } public static void RetryOnException(Action action, TimeSpan? timeOut) { var i = 0; Exception lastEx = null; var firstAttempt = DateTime.Now; while (timeOut == null || DateTime.Now - firstAttempt < timeOut.Value) { i++; try { action(); return; } catch (Exception ex) { lastEx = ex; SleepBackOffMultiplier(i); } } throw new TimeoutException(string.Format("Exceeded timeout of {0}", timeOut.Value), lastEx); } public static void RetryOnException(Action action, int maxRetries) { for (var i = 0; i < maxRetries; i++) { try { action(); break; } catch { if (i == maxRetries - 1) throw; SleepBackOffMultiplier(i); } } } private static void SleepBackOffMultiplier(int i) { //exponential/random retry back-off. var rand = new Random(Guid.NewGuid().GetHashCode()); var nextTry = rand.Next( (int)Math.Pow(i, 2), (int)Math.Pow(i + 1, 2) + 1); Thread.Sleep(nextTry); } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/EnumExtensions.cs0000644000175000017500000000610312146506550026455 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Reflection; namespace ServiceStack.Common { public static class EnumExtensions { /// /// Gets the textual description of the enum if it has one. e.g. /// /// /// enum UserColors /// { /// [Description("Bright Red")] /// BrightRed /// } /// UserColors.BrightRed.ToDescription(); /// /// /// /// public static string ToDescription(this Enum @enum) { var type = @enum.GetType(); var memInfo = type.GetMember(@enum.ToString()); if (memInfo != null && memInfo.Length > 0) { var attrs = memInfo[0].GetCustomAttributes( typeof(DescriptionAttribute), false); if (attrs != null && attrs.Length > 0) return ((DescriptionAttribute)attrs[0]).Description; } return @enum.ToString(); } public static List ToList(this Enum @enum) { #if !SILVERLIGHT4 return new List(Enum.GetNames(@enum.GetType())); #else return @enum.GetType().GetFields(BindingFlags.Static | BindingFlags.Public).Select(fi => fi.Name).ToList(); #endif } public static bool Has(this Enum type, T value) { try { return (((int)(object)type & (int)(object)value) == (int)(object)value); } catch { return false; } } public static bool Is(this Enum type, T value) { try { return (int)(object)type == (int)(object)value; } catch { return false; } } public static T Add(this Enum type, T value) { try { return (T)(object)(((int)(object)type | (int)(object)value)); } catch (Exception ex) { throw new ArgumentException( string.Format( "Could not append value from enumerated type '{0}'.", typeof(T).Name ), ex); } } public static T Remove(this Enum type, T value) { try { return (T)(object)(((int)(object)type & ~(int)(object)value)); } catch (Exception ex) { throw new ArgumentException( string.Format( "Could not remove value from enumerated type '{0}'.", typeof(T).Name ), ex); } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/0000755000175000017500000000000012146506550026415 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/ISyncReply.cs0000644000175000017500000000060212146506550031003 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System.ServiceModel; using System.ServiceModel.Channels; namespace ServiceStack.ServiceClient.Web { [ServiceContract(Namespace = "http://services.servicestack.net/")] public interface ISyncReply { [OperationContract(Action = "*", ReplyAction = "*")] Message Send(Message requestMsg); } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/WebServiceException.cs0000644000175000017500000000706512146506550032671 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using ServiceStack.Common.Utils; using ServiceStack.ServiceInterface.ServiceModel; using ServiceStack.Text; namespace ServiceStack.ServiceClient.Web { public class WebServiceException : Exception { public WebServiceException() { } public WebServiceException(string message) : base(message) { } public WebServiceException(string message, Exception innerException) : base(message, innerException) { } public int StatusCode { get; set; } public string StatusDescription { get; set; } public object ResponseDto { get; set; } public string ResponseBody { get; set; } private string errorCode; private void ParseResponseDto() { if (ResponseDto == null) { errorCode = StatusDescription; return; } var jsv = TypeSerializer.SerializeToString(ResponseDto); var map = TypeSerializer.DeserializeFromString>(jsv); map = new Dictionary(map, StringComparer.InvariantCultureIgnoreCase); string responseStatus; if (!map.TryGetValue("ResponseStatus", out responseStatus)) return; var rsMap = TypeSerializer.DeserializeFromString>(responseStatus); if (rsMap == null) return; rsMap = new Dictionary(rsMap, StringComparer.InvariantCultureIgnoreCase); rsMap.TryGetValue("ErrorCode", out errorCode); rsMap.TryGetValue("Message", out errorMessage); rsMap.TryGetValue("StackTrace", out serverStackTrace); } public string ErrorCode { get { if (errorCode == null) { ParseResponseDto(); } return errorCode; } } private string errorMessage; public string ErrorMessage { get { if (errorMessage == null) { ParseResponseDto(); } return errorMessage; } } private string serverStackTrace; public string ServerStackTrace { get { if (serverStackTrace == null) { ParseResponseDto(); } return serverStackTrace; } } public ResponseStatus ResponseStatus { get { if (this.ResponseDto == null) return null; var hasResponseStatus = this.ResponseDto as IHasResponseStatus; if (hasResponseStatus != null) return hasResponseStatus.ResponseStatus; var propertyInfo = this.ResponseDto.GetType().GetProperty("ResponseStatus"); if (propertyInfo == null) return null; return ReflectionUtils.GetProperty(this.ResponseDto, propertyInfo) as ResponseStatus; } } public List GetFieldErrors() { var responseStatus = ResponseStatus; if (responseStatus != null) return responseStatus.Errors ?? new List(); return new List(); } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/JsvRestClientAsync.cs0000644000175000017500000000545012146506550032505 0ustar00meebeymeebey00000000000000using System; using System.IO; using ServiceStack.Service; using ServiceStack.ServiceHost; using ServiceStack.Text; namespace ServiceStack.ServiceClient.Web { public class JsvRestClientAsync : IRestClientAsync { public const string ContentType = "application/jsv"; public JsvRestClientAsync(string baseUri) : this() { this.BaseUri = baseUri.WithTrailingSlash(); } public JsvRestClientAsync() { this.client = new AsyncServiceClient { ContentType = ContentType, StreamSerializer = SerializeToStream, StreamDeserializer = TypeSerializer.DeserializeFromStream }; } public TimeSpan? Timeout { get { return this.client.Timeout; } set { this.client.Timeout = value; } } private static void SerializeToStream(IRequestContext requestContext, object dto, Stream stream) { TypeSerializer.SerializeToStream(dto, stream); } private readonly AsyncServiceClient client; public string BaseUri { get; set; } public void SetCredentials(string userName, string password) { this.client.SetCredentials(userName, password); } private string GetUrl(string relativeOrAbsoluteUrl) { return relativeOrAbsoluteUrl.StartsWith("http:") || relativeOrAbsoluteUrl.StartsWith("https:") ? relativeOrAbsoluteUrl : this.BaseUri + relativeOrAbsoluteUrl; } public void GetAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { this.client.SendAsync(HttpMethod.Get, GetUrl(relativeOrAbsoluteUrl), null, onSuccess, onError); } public void DeleteAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { this.client.SendAsync(HttpMethod.Delete, GetUrl(relativeOrAbsoluteUrl), null, onSuccess, onError); } public void PostAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { this.client.SendAsync(HttpMethod.Post, GetUrl(relativeOrAbsoluteUrl), request, onSuccess, onError); } public void PutAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { this.client.SendAsync(HttpMethod.Put, GetUrl(relativeOrAbsoluteUrl), request, onSuccess, onError); } public void Dispose() {} } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/IDuplex.cs0000644000175000017500000000064612146506550030324 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System.ServiceModel; using System.ServiceModel.Channels; namespace ServiceStack.ServiceClient.Web { [ServiceContract(Namespace = "http://services.servicestack.net/", CallbackContract = typeof(IDuplexCallback))] public interface IDuplex { [OperationContract(Action = "*", ReplyAction = "*")] void BeginSend(Message msg); } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/AsyncServiceClient.cs0000644000175000017500000005076212146506550032513 0ustar00meebeymeebey00000000000000using System; using System.IO; using System.Net; using System.Text; using System.Threading; using ServiceStack.Logging; using ServiceStack.ServiceHost; using ServiceStack.Text; using ServiceStack.Common.Web; namespace ServiceStack.ServiceClient.Web { /** * Need to provide async request options * http://msdn.microsoft.com/en-us/library/86wf6409(VS.71).aspx */ public class AsyncServiceClient { private static readonly ILog Log = LogManager.GetLogger(typeof(AsyncServiceClient)); private static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(60); private HttpWebRequest _webRequest = null; /// /// The request filter is called before any request. /// This request filter is executed globally. /// public static Action HttpWebRequestFilter { get; set; } /// /// The response action is called once the server response is available. /// It will allow you to access raw response information. /// This response action is executed globally. /// Note that you should NOT consume the response stream as this is handled by ServiceStack /// public static Action HttpWebResponseFilter { get; set; } /// /// Called before request resend, when the initial request required authentication /// public Action OnAuthenticationRequired { get; set; } const int BufferSize = 4096; public ICredentials Credentials { get; set; } public bool StoreCookies { get; set; } public CookieContainer CookieContainer { get; set; } /// /// The request filter is called before any request. /// This request filter only works with the instance where it was set (not global). /// public Action LocalHttpWebRequestFilter { get; set; } /// /// The response action is called once the server response is available. /// It will allow you to access raw response information. /// Note that you should NOT consume the response stream as this is handled by ServiceStack /// public Action LocalHttpWebResponseFilter { get; set; } public string BaseUri { get; set; } internal class RequestState : IDisposable { private bool _timedOut; // Pass the correct error back even on Async Calls public RequestState() { BufferRead = new byte[BufferSize]; TextData = new StringBuilder(); BytesData = new MemoryStream(BufferSize); WebRequest = null; ResponseStream = null; } public string HttpMethod; public string Url; public StringBuilder TextData; public MemoryStream BytesData; public byte[] BufferRead; public object Request; public HttpWebRequest WebRequest; public HttpWebResponse WebResponse; public Stream ResponseStream; public int Completed; public int RequestCount; public Timer Timer; public Action OnSuccess; public Action OnError; #if SILVERLIGHT public bool HandleCallbackOnUIThread { get; set; } #endif public void HandleSuccess(TResponse response) { if (this.OnSuccess == null) return; #if SILVERLIGHT if (this.HandleCallbackOnUIThread) System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() => this.OnSuccess(response)); else this.OnSuccess(response); #else this.OnSuccess(response); #endif } public void HandleError(TResponse response, Exception ex) { if (this.OnError == null) return; Exception toReturn = ex; if (_timedOut) { #if SILVERLIGHT WebException we = new WebException("The request timed out", ex, WebExceptionStatus.RequestCanceled, null); #else WebException we = new WebException("The request timed out", ex, WebExceptionStatus.Timeout, null); #endif toReturn = we; } #if SILVERLIGHT if (this.HandleCallbackOnUIThread) System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() => this.OnError(response, toReturn)); else this.OnError(response, toReturn); #else OnError(response, toReturn); #endif } public void StartTimer(TimeSpan timeOut) { this.Timer = new Timer(this.TimedOut, this, (int)timeOut.TotalMilliseconds, System.Threading.Timeout.Infinite); } public void TimedOut(object state) { if (Interlocked.Increment(ref Completed) == 1) { if (this.WebRequest != null) { _timedOut = true; this.WebRequest.Abort(); } } this.Timer.Change(System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite); this.Timer.Dispose(); this.Dispose(); } public void Dispose() { if (this.BytesData == null) return; this.BytesData.Dispose(); this.BytesData = null; } } public bool DisableAutoCompression { get; set; } public string UserName { get; set; } public string Password { get; set; } public void SetCredentials(string userName, string password) { this.UserName = userName; this.Password = password; } public TimeSpan? Timeout { get; set; } public string ContentType { get; set; } public StreamSerializerDelegate StreamSerializer { get; set; } public StreamDeserializerDelegate StreamDeserializer { get; set; } #if SILVERLIGHT public bool HandleCallbackOnUIThread { get; set; } public bool UseBrowserHttpHandling { get; set; } public bool ShareCookiesWithBrowser { get; set; } #endif public void SendAsync(string httpMethod, string absoluteUrl, object request, Action onSuccess, Action onError) { SendWebRequest(httpMethod, absoluteUrl, request, onSuccess, onError); } public void CancelAsync() { if (_webRequest != null) { // Request will be nulled after it throws an exception on its async methods // See - http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.abort _webRequest.Abort(); } } #if !SILVERLIGHT internal static void AllowAutoCompression(HttpWebRequest webRequest) { webRequest.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate"); webRequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; } #endif private RequestState SendWebRequest(string httpMethod, string absoluteUrl, object request, Action onSuccess, Action onError) { if (httpMethod == null) throw new ArgumentNullException("httpMethod"); var requestUri = absoluteUrl; var httpGetOrDelete = (httpMethod == "GET" || httpMethod == "DELETE"); var hasQueryString = request != null && httpGetOrDelete; if (hasQueryString) { var queryString = QueryStringSerializer.SerializeToString(request); if (!string.IsNullOrEmpty(queryString)) { requestUri += "?" + queryString; } } #if SILVERLIGHT var creator = this.UseBrowserHttpHandling ? System.Net.Browser.WebRequestCreator.BrowserHttp : System.Net.Browser.WebRequestCreator.ClientHttp; var webRequest = (HttpWebRequest) creator.Create(new Uri(requestUri)); if (StoreCookies && !UseBrowserHttpHandling) { if (ShareCookiesWithBrowser) { if (CookieContainer == null) CookieContainer = new CookieContainer(); CookieContainer.SetCookies(new Uri(BaseUri), System.Windows.Browser.HtmlPage.Document.Cookies); } webRequest.CookieContainer = CookieContainer; } #else _webRequest = (HttpWebRequest)WebRequest.Create(requestUri); if (StoreCookies) { _webRequest.CookieContainer = CookieContainer; } #endif #if !SILVERLIGHT if (!DisableAutoCompression) { _webRequest.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate"); _webRequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; } #endif var requestState = new RequestState { HttpMethod = httpMethod, Url = requestUri, #if SILVERLIGHT WebRequest = webRequest, #else WebRequest = _webRequest, #endif Request = request, OnSuccess = onSuccess, OnError = onError, #if SILVERLIGHT HandleCallbackOnUIThread = HandleCallbackOnUIThread, #endif }; requestState.StartTimer(this.Timeout.GetValueOrDefault(DefaultTimeout)); #if SILVERLIGHT SendWebRequestAsync(httpMethod, request, requestState, webRequest); #else SendWebRequestAsync(httpMethod, request, requestState, _webRequest); #endif return requestState; } private void SendWebRequestAsync(string httpMethod, object request, RequestState requestState, HttpWebRequest webRequest) { var httpGetOrDelete = (httpMethod == "GET" || httpMethod == "DELETE"); webRequest.Accept = string.Format("{0}, */*", ContentType); #if !SILVERLIGHT webRequest.Method = httpMethod; #else //Methods others than GET and POST are only supported by Client request creator, see //http://msdn.microsoft.com/en-us/library/cc838250(v=vs.95).aspx if (this.UseBrowserHttpHandling && httpMethod != "GET" && httpMethod != "POST") { webRequest.Method = "POST"; webRequest.Headers[HttpHeaders.XHttpMethodOverride] = httpMethod; } else { webRequest.Method = httpMethod; } #endif if (this.Credentials != null) { webRequest.Credentials = this.Credentials; } ApplyWebRequestFilters(webRequest); try { if (!httpGetOrDelete && request != null) { webRequest.ContentType = ContentType; webRequest.BeginGetRequestStream(RequestCallback, requestState); } else { requestState.WebRequest.BeginGetResponse(ResponseCallback, requestState); } } catch (Exception ex) { // BeginGetRequestStream can throw if request was aborted HandleResponseError(ex, requestState); } } private void RequestCallback(IAsyncResult asyncResult) { var requestState = (RequestState)asyncResult.AsyncState; try { var req = requestState.WebRequest; var postStream = req.EndGetRequestStream(asyncResult); StreamSerializer(null, requestState.Request, postStream); postStream.Close(); requestState.WebRequest.BeginGetResponse(ResponseCallback, requestState); } catch (Exception ex) { HandleResponseError(ex, requestState); } } private void ResponseCallback(IAsyncResult asyncResult) { var requestState = (RequestState)asyncResult.AsyncState; try { var webRequest = requestState.WebRequest; requestState.WebResponse = (HttpWebResponse)webRequest.EndGetResponse(asyncResult); ApplyWebResponseFilters(requestState.WebResponse); // Read the response into a Stream object. var responseStream = requestState.WebResponse.GetResponseStream(); requestState.ResponseStream = responseStream; responseStream.BeginRead(requestState.BufferRead, 0, BufferSize, ReadCallBack, requestState); return; } catch (Exception ex) { var firstCall = Interlocked.Increment(ref requestState.RequestCount) == 1; if (firstCall && WebRequestUtils.ShouldAuthenticate(ex, this.UserName, this.Password)) { try { requestState.WebRequest = (HttpWebRequest)WebRequest.Create(requestState.Url); requestState.WebRequest.AddBasicAuth(this.UserName, this.Password); if (OnAuthenticationRequired != null) { OnAuthenticationRequired(requestState.WebRequest); } SendWebRequestAsync( requestState.HttpMethod, requestState.Request, requestState, requestState.WebRequest); } catch (Exception /*subEx*/) { HandleResponseError(ex, requestState); } return; } HandleResponseError(ex, requestState); } } private void ReadCallBack(IAsyncResult asyncResult) { var requestState = (RequestState)asyncResult.AsyncState; try { var responseStream = requestState.ResponseStream; int read = responseStream.EndRead(asyncResult); if (read > 0) { requestState.BytesData.Write(requestState.BufferRead, 0, read); responseStream.BeginRead( requestState.BufferRead, 0, BufferSize, ReadCallBack, requestState); return; } Interlocked.Increment(ref requestState.Completed); var response = default(T); try { requestState.BytesData.Position = 0; using (var reader = requestState.BytesData) { response = (T)this.StreamDeserializer(typeof(T), reader); } #if SILVERLIGHT if (this.StoreCookies && this.ShareCookiesWithBrowser && !this.UseBrowserHttpHandling) { // browser cookies must be set on the ui thread System.Windows.Deployment.Current.Dispatcher.BeginInvoke( () => { var cookieHeader = this.CookieContainer.GetCookieHeader(new Uri(BaseUri)); System.Windows.Browser.HtmlPage.Document.Cookies = cookieHeader; }); } #endif requestState.HandleSuccess(response); } catch (Exception ex) { Log.Debug(string.Format("Error Reading Response Error: {0}", ex.Message), ex); requestState.HandleError(default(T), ex); } finally { responseStream.Close(); _webRequest = null; } } catch (Exception ex) { HandleResponseError(ex, requestState); } } private void HandleResponseError(Exception exception, RequestState requestState) { var webEx = exception as WebException; if (webEx != null #if !SILVERLIGHT && webEx.Status == WebExceptionStatus.ProtocolError #endif ) { var errorResponse = ((HttpWebResponse)webEx.Response); Log.Error(webEx); Log.DebugFormat("Status Code : {0}", errorResponse.StatusCode); Log.DebugFormat("Status Description : {0}", errorResponse.StatusDescription); var serviceEx = new WebServiceException(errorResponse.StatusDescription) { StatusCode = (int)errorResponse.StatusCode, }; try { using (var stream = errorResponse.GetResponseStream()) { //Uncomment to Debug exceptions: //var strResponse = new StreamReader(stream).ReadToEnd(); //Console.WriteLine("Response: " + strResponse); //stream.Position = 0; serviceEx.ResponseDto = this.StreamDeserializer(typeof(TResponse), stream); requestState.HandleError((TResponse)serviceEx.ResponseDto, serviceEx); } } catch (Exception innerEx) { // Oh, well, we tried Log.Debug(string.Format("WebException Reading Response Error: {0}", innerEx.Message), innerEx); requestState.HandleError(default(TResponse), new WebServiceException(errorResponse.StatusDescription, innerEx) { StatusCode = (int)errorResponse.StatusCode, }); } return; } var authEx = exception as AuthenticationException; if (authEx != null) { var customEx = WebRequestUtils.CreateCustomException(requestState.Url, authEx); Log.Debug(string.Format("AuthenticationException: {0}", customEx.Message), customEx); requestState.HandleError(default(TResponse), authEx); } Log.Debug(string.Format("Exception Reading Response Error: {0}", exception.Message), exception); requestState.HandleError(default(TResponse), exception); _webRequest = null; } private void ApplyWebResponseFilters(WebResponse webResponse) { if (!(webResponse is HttpWebResponse)) return; if (HttpWebResponseFilter != null) HttpWebResponseFilter((HttpWebResponse)webResponse); if (LocalHttpWebResponseFilter != null) LocalHttpWebResponseFilter((HttpWebResponse)webResponse); } private void ApplyWebRequestFilters(HttpWebRequest client) { if (LocalHttpWebRequestFilter != null) LocalHttpWebRequestFilter(client); if (HttpWebRequestFilter != null) HttpWebRequestFilter(client); } public void Dispose() { } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/XmlRestClientAsync.cs0000644000175000017500000000547112146506550032506 0ustar00meebeymeebey00000000000000using System; using System.IO; using ServiceStack.Service; using ServiceStack.ServiceHost; using ServiceStack.Text; namespace ServiceStack.ServiceClient.Web { public class XmlRestClientAsync : IRestClientAsync { public const string ContentType = "application/xml"; public XmlRestClientAsync(string baseUri) : this() { this.BaseUri = baseUri.WithTrailingSlash(); } public XmlRestClientAsync() { this.client = new AsyncServiceClient { ContentType = ContentType, StreamSerializer = SerializeToStream, StreamDeserializer = XmlSerializer.DeserializeFromStream }; } public TimeSpan? Timeout { get { return this.client.Timeout; } set { this.client.Timeout = value; } } private static void SerializeToStream(IRequestContext requestContext, object dto, Stream stream) { XmlSerializer.SerializeToStream(dto, stream); } private readonly AsyncServiceClient client; public string BaseUri { get; set; } public void SetCredentials(string userName, string password) { this.client.SetCredentials(userName, password); } private string GetUrl(string relativeOrAbsoluteUrl) { return relativeOrAbsoluteUrl.StartsWith("http:") || relativeOrAbsoluteUrl.StartsWith("https:") ? relativeOrAbsoluteUrl : this.BaseUri + relativeOrAbsoluteUrl; } public void GetAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { this.client.SendAsync(HttpMethod.Get, GetUrl(relativeOrAbsoluteUrl), null, onSuccess, onError); } public void DeleteAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { this.client.SendAsync(HttpMethod.Delete, GetUrl(relativeOrAbsoluteUrl), null, onSuccess, onError); } public void PostAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { this.client.SendAsync(HttpMethod.Post, GetUrl(relativeOrAbsoluteUrl), request, onSuccess, onError); } public void PutAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { this.client.SendAsync(HttpMethod.Put, GetUrl(relativeOrAbsoluteUrl), request, onSuccess, onError); } public void Dispose() { } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/Soap11ServiceClient.cs0000644000175000017500000001050212146506550032466 0ustar00meebeymeebey00000000000000using System; using System.IO; using ServiceStack.Service; namespace ServiceStack.ServiceClient.Web { #if SILVERLIGHT || MONOTOUCH || XBOX public class Soap11ServiceClient : IServiceClient { public Soap11ServiceClient(string uri) { throw new NotImplementedException(); } public void Dispose() { throw new NotImplementedException(); } public void SetCredentials(string userName, string password) { throw new NotImplementedException(); } public void GetAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void DeleteAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void PostAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void PutAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void SendAsync(object request, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void SendOneWay(object request) { throw new NotImplementedException(); } public void SendOneWay(string relativeOrAbsoluteUrl, object request) { throw new NotImplementedException(); } public TResponse Send(object request) { throw new NotImplementedException(); } public TResponse PostFile(string relativeOrAbsoluteUrl, FileInfo fileToUpload, string mimeType) { throw new NotImplementedException(); } public TResponse PostFile(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, string mimeType) { throw new NotImplementedException(); } public TResponse PostFileWithRequest(string relativeOrAbsoluteUrl, FileInfo fileToUpload, object request) { throw new NotImplementedException(); } public TResponse PostFileWithRequest(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, object request) { throw new NotImplementedException(); } } #else using ServiceStack.Service; using System.ServiceModel; using System.ServiceModel.Channels; using ServiceStack.Text; public class Soap11ServiceClient : WcfServiceClient { private BasicHttpBinding binding; public Soap11ServiceClient(string uri) { this.Uri = uri.WithTrailingSlash() + "Soap11"; } private Binding BasicHttpBinding { get { if (this.binding == null) { this.binding = new BasicHttpBinding { MaxReceivedMessageSize = int.MaxValue, HostNameComparisonMode = HostNameComparisonMode.StrongWildcard }; } return this.binding; } } protected override Binding Binding { get { return this.BasicHttpBinding; } } protected override MessageVersion MessageVersion { get { return this.BasicHttpBinding.MessageVersion; } } public override void SetProxy(Uri proxyAddress) { var basicBinding = (BasicHttpBinding)Binding; basicBinding.ProxyAddress = proxyAddress; basicBinding.UseDefaultWebProxy = false; basicBinding.BypassProxyOnLocal = false; return; } } #endif }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/ServiceClientBase.cs0000644000175000017500000007646312146506550032316 0ustar00meebeymeebey00000000000000using System; using System.IO; using System.Net; #if !(MONOTOUCH || SILVERLIGHT) using System.Web; #endif using ServiceStack.Common; using ServiceStack.Common.Web; using ServiceStack.Logging; using ServiceStack.Service; using ServiceStack.ServiceHost; using ServiceStack.Text; namespace ServiceStack.ServiceClient.Web { /** * Need to provide async request options * http://msdn.microsoft.com/en-us/library/86wf6409(VS.71).aspx */ public abstract class ServiceClientBase #if !SILVERLIGHT : IServiceClient, IRestClient #else : IServiceClient #endif { private static readonly ILog log = LogManager.GetLogger(typeof(ServiceClientBase)); /// /// The request filter is called before any request. /// This request filter is executed globally. /// private static Action httpWebRequestFilter; public static Action HttpWebRequestFilter { get { return httpWebRequestFilter; } set { httpWebRequestFilter = value; AsyncServiceClient.HttpWebRequestFilter = value; } } /// /// The response action is called once the server response is available. /// It will allow you to access raw response information. /// This response action is executed globally. /// Note that you should NOT consume the response stream as this is handled by ServiceStack /// private static Action httpWebResponseFilter; public static Action HttpWebResponseFilter { get { return httpWebResponseFilter; } set { httpWebResponseFilter = value; AsyncServiceClient.HttpWebResponseFilter = value; } } public const string DefaultHttpMethod = "POST"; readonly AsyncServiceClient asyncClient; protected ServiceClientBase() { this.HttpMethod = DefaultHttpMethod; this.CookieContainer = new CookieContainer(); asyncClient = new AsyncServiceClient { ContentType = ContentType, StreamSerializer = SerializeToStream, StreamDeserializer = StreamDeserializer, CookieContainer = this.CookieContainer, UserName = this.UserName, Password = this.Password, LocalHttpWebRequestFilter = this.LocalHttpWebRequestFilter, LocalHttpWebResponseFilter = this.LocalHttpWebResponseFilter }; this.StoreCookies = true; //leave #if SILVERLIGHT asyncClient.HandleCallbackOnUIThread = this.HandleCallbackOnUIThread = true; asyncClient.UseBrowserHttpHandling = this.UseBrowserHttpHandling = false; asyncClient.ShareCookiesWithBrowser = this.ShareCookiesWithBrowser = true; #endif } protected ServiceClientBase(string syncReplyBaseUri, string asyncOneWayBaseUri) : this() { this.SyncReplyBaseUri = syncReplyBaseUri; this.AsyncOneWayBaseUri = asyncOneWayBaseUri; } /// /// Sets all baseUri properties, using the Format property for the SyncReplyBaseUri and AsyncOneWayBaseUri /// /// Base URI of the service public void SetBaseUri(string baseUri) { this.BaseUri = baseUri; this.asyncClient.BaseUri = baseUri; this.SyncReplyBaseUri = baseUri.WithTrailingSlash() + Format + "/syncreply/"; this.AsyncOneWayBaseUri = baseUri.WithTrailingSlash() + Format + "/asynconeway/"; } /// /// Sets all baseUri properties allowing for a temporary override of the Format property /// /// Base URI of the service /// Override of the Format property for the service //Marked obsolete on 4/11/2012 [Obsolete("Please call the SetBaseUri(string baseUri) method, which uses the specific implementation's Format property.")] public void SetBaseUri(string baseUri, string format) { this.BaseUri = baseUri; this.asyncClient.BaseUri = baseUri; this.SyncReplyBaseUri = baseUri.WithTrailingSlash() + format + "/syncreply/"; this.AsyncOneWayBaseUri = baseUri.WithTrailingSlash() + format + "/asynconeway/"; } private bool _disableAutoCompression; /// /// Whether to Accept Gzip,Deflate Content-Encoding and to auto decompress responses /// public bool DisableAutoCompression { get { return _disableAutoCompression; } set { _disableAutoCompression = value; asyncClient.DisableAutoCompression = value; } } private string _username; /// /// The user name for basic authentication /// public string UserName { get { return _username; } set { _username = value; asyncClient.UserName = value; } } private string _password; /// /// The password for basic authentication /// public string Password { get { return _password; } set { _password = value; asyncClient.Password = value; } } /// /// Sets the username and the password for basic authentication. /// public void SetCredentials(string userName, string password) { this.UserName = userName; this.Password = password; } public string BaseUri { get; set; } public abstract string Format { get; } public string SyncReplyBaseUri { get; set; } public string AsyncOneWayBaseUri { get; set; } private TimeSpan? timeout; public TimeSpan? Timeout { get { return this.timeout; } set { this.timeout = value; this.asyncClient.Timeout = value; } } public abstract string ContentType { get; } public string HttpMethod { get; set; } #if !SILVERLIGHT public IWebProxy Proxy { get; set; } #endif #if SILVERLIGHT private bool handleCallbackOnUiThread; public bool HandleCallbackOnUIThread { get { return this.handleCallbackOnUiThread; } set { asyncClient.HandleCallbackOnUIThread = this.handleCallbackOnUiThread = value; } } private bool useBrowserHttpHandling; public bool UseBrowserHttpHandling { get { return this.useBrowserHttpHandling; } set { asyncClient.UseBrowserHttpHandling = this.useBrowserHttpHandling = value; } } private bool shareCookiesWithBrowser; public bool ShareCookiesWithBrowser { get { return this.shareCookiesWithBrowser; } set { asyncClient.ShareCookiesWithBrowser = this.shareCookiesWithBrowser = value; } } #endif private ICredentials credentials; /// /// Gets or sets authentication information for the request. /// Warning: It's recommened to use and for basic auth. /// This property is only used for IIS level authentication. /// public ICredentials Credentials { set { this.credentials = value; this.asyncClient.Credentials = value; } } /// /// Determines if the basic auth header should be sent with every request. /// By default, the basic auth header is only sent when "401 Unauthorized" is returned. /// public bool AlwaysSendBasicAuthHeader { get; set; } /// /// Specifies if cookies should be stored /// private bool storeCookies; public bool StoreCookies { get { return storeCookies; } set { asyncClient.StoreCookies = storeCookies = value; } } public CookieContainer CookieContainer { get; set; } /// /// Called before request resend, when the initial request required authentication /// private Action onAuthenticationRequired { get; set; } public Action OnAuthenticationRequired { get { return onAuthenticationRequired; } set { onAuthenticationRequired = value; asyncClient.OnAuthenticationRequired = value; } } /// /// The request filter is called before any request. /// This request filter only works with the instance where it was set (not global). /// private Action localHttpWebRequestFilter { get; set; } public Action LocalHttpWebRequestFilter { get { return localHttpWebRequestFilter; } set { localHttpWebRequestFilter = value; asyncClient.LocalHttpWebRequestFilter = value; } } /// /// The response action is called once the server response is available. /// It will allow you to access raw response information. /// Note that you should NOT consume the response stream as this is handled by ServiceStack /// private Action localHttpWebResponseFilter { get; set; } public Action LocalHttpWebResponseFilter { get { return localHttpWebResponseFilter; } set { localHttpWebResponseFilter = value; asyncClient.LocalHttpWebResponseFilter = value; } } public abstract void SerializeToStream(IRequestContext requestContext, object request, Stream stream); public abstract T DeserializeFromStream(Stream stream); public abstract StreamDeserializerDelegate StreamDeserializer { get; } #if !SILVERLIGHT public virtual TResponse Send(object request) { var requestUri = this.SyncReplyBaseUri.WithTrailingSlash() + request.GetType().Name; var client = SendRequest(requestUri, request); try { var webResponse = client.GetResponse(); return HandleResponse(webResponse); } catch (Exception ex) { TResponse response; if (!HandleResponseException(ex, requestUri, () => SendRequest(Web.HttpMethod.Post, requestUri, request), c => c.GetResponse(), out response)) { throw; } return response; } } private bool HandleResponseException(Exception ex, string requestUri, Func createWebRequest, Func getResponse, out TResponse response) { try { if (WebRequestUtils.ShouldAuthenticate(ex, this.UserName, this.Password)) { var client = createWebRequest(); client.AddBasicAuth(this.UserName, this.Password); if (OnAuthenticationRequired != null) { OnAuthenticationRequired(client); } var webResponse = getResponse(client); response = HandleResponse(webResponse); return true; } } catch (Exception subEx) { // Since we are effectively re-executing the call, // the new exception should be shown to the caller rather // than the old one. // The new exception is either this one or the one thrown // by the following method. HandleResponseException(subEx, requestUri); throw; } // If this doesn't throw, the calling method // should rethrow the original exception upon // return value of false. HandleResponseException(ex, requestUri); response = default(TResponse); return false; } private void HandleResponseException(Exception ex, string requestUri) { var webEx = ex as WebException; if (webEx != null && webEx.Status == WebExceptionStatus.ProtocolError) { var errorResponse = ((HttpWebResponse)webEx.Response); log.Error(webEx); log.DebugFormat("Status Code : {0}", errorResponse.StatusCode); log.DebugFormat("Status Description : {0}", errorResponse.StatusDescription); var serviceEx = new WebServiceException(errorResponse.StatusDescription) { StatusCode = (int)errorResponse.StatusCode, StatusDescription = errorResponse.StatusDescription, }; try { if (errorResponse.ContentType.MatchesContentType(ContentType)) { using (var stream = errorResponse.GetResponseStream()) { serviceEx.ResponseDto = DeserializeFromStream(stream); } } else { serviceEx.ResponseBody = errorResponse.GetResponseStream().ReadFully().FromUtf8Bytes(); } } catch (Exception innerEx) { // Oh, well, we tried throw new WebServiceException(errorResponse.StatusDescription, innerEx) { StatusCode = (int)errorResponse.StatusCode, StatusDescription = errorResponse.StatusDescription, }; } //Escape deserialize exception handling and throw here throw serviceEx; } var authEx = ex as AuthenticationException; if (authEx != null) { throw WebRequestUtils.CreateCustomException(requestUri, authEx); } } private WebRequest SendRequest(string requestUri, object request) { return SendRequest(HttpMethod ?? DefaultHttpMethod, requestUri, request); } private WebRequest SendRequest(string httpMethod, string requestUri, object request) { return PrepareWebRequest(httpMethod, requestUri, request, client => { using (var requestStream = client.GetRequestStream()) { SerializeToStream(null, request, requestStream); } }); } private WebRequest PrepareWebRequest(string httpMethod, string requestUri, object request, Action sendRequestAction) { if (httpMethod == null) throw new ArgumentNullException("httpMethod"); if (httpMethod == Web.HttpMethod.Get && request != null) { var queryString = QueryStringSerializer.SerializeToString(request); if (!string.IsNullOrEmpty(queryString)) { requestUri += "?" + queryString; } } var client = (HttpWebRequest)WebRequest.Create(requestUri); try { client.Accept = ContentType; client.Method = httpMethod; if (Proxy != null) client.Proxy = Proxy; if (this.Timeout.HasValue) client.Timeout = (int)this.Timeout.Value.TotalMilliseconds; if (this.credentials != null) client.Credentials = this.credentials; if (this.AlwaysSendBasicAuthHeader) client.AddBasicAuth(this.UserName, this.Password); if (!DisableAutoCompression) { client.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate"); client.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; } if (StoreCookies) { client.CookieContainer = CookieContainer; } ApplyWebRequestFilters(client); if (httpMethod != Web.HttpMethod.Get && httpMethod != Web.HttpMethod.Delete) { client.ContentType = ContentType; if (sendRequestAction != null) sendRequestAction(client); } } catch (AuthenticationException ex) { throw WebRequestUtils.CreateCustomException(requestUri, ex) ?? ex; } return client; } private void ApplyWebResponseFilters(WebResponse webResponse) { if (!(webResponse is HttpWebResponse)) return; if (HttpWebResponseFilter != null) HttpWebResponseFilter((HttpWebResponse)webResponse); if (LocalHttpWebResponseFilter != null) LocalHttpWebResponseFilter((HttpWebResponse)webResponse); } private void ApplyWebRequestFilters(HttpWebRequest client) { if (LocalHttpWebRequestFilter != null) LocalHttpWebRequestFilter(client); if (HttpWebRequestFilter != null) HttpWebRequestFilter(client); } #else private void SendRequest(string requestUri, object request, Action callback) { var isHttpGet = HttpMethod != null && HttpMethod.ToUpper() == "GET"; if (isHttpGet) { var queryString = QueryStringSerializer.SerializeToString(request); if (!string.IsNullOrEmpty(queryString)) { requestUri += "?" + queryString; } } SendRequest(HttpMethod ?? DefaultHttpMethod, requestUri, request, callback); } private void SendRequest(string httpMethod, string requestUri, object request, Action callback) { if (httpMethod == null) throw new ArgumentNullException("httpMethod"); var client = (HttpWebRequest)WebRequest.Create(requestUri); try { client.Accept = ContentType; client.Method = httpMethod; if (this.credentials != null) client.Credentials = this.credentials; if (this.AlwaysSendBasicAuthHeader) client.AddBasicAuth(this.UserName, this.Password); if (StoreCookies) { client.CookieContainer = CookieContainer; } if (this.LocalHttpWebRequestFilter != null) LocalHttpWebRequestFilter(client); if (HttpWebRequestFilter != null) HttpWebRequestFilter(client); if (httpMethod != Web.HttpMethod.Get && httpMethod != Web.HttpMethod.Delete) { client.ContentType = ContentType; client.BeginGetRequestStream(delegate(IAsyncResult target) { var webReq = (HttpWebRequest)target.AsyncState; var requestStream = webReq.EndGetRequestStream(target); SerializeToStream(null, request, requestStream); callback(client); }, null); } } catch (AuthenticationException ex) { throw WebRequestUtils.CreateCustomException(requestUri, ex) ?? ex; } } #endif private string GetUrl(string relativeOrAbsoluteUrl) { return relativeOrAbsoluteUrl.StartsWith("http:") || relativeOrAbsoluteUrl.StartsWith("https:") ? relativeOrAbsoluteUrl : this.BaseUri.CombineWith(relativeOrAbsoluteUrl); } #if !SILVERLIGHT private byte[] DownloadBytes(string requestUri, object request) { var webRequest = SendRequest(requestUri, request); using (var response = webRequest.GetResponse()) { ApplyWebResponseFilters(response); using (var stream = response.GetResponseStream()) return stream.ReadFully(); } } #else private void DownloadBytes(string requestUri, object request, Action callback = null) { SendRequest(requestUri, request, webRequest => webRequest.BeginGetResponse(delegate(IAsyncResult result) { var webReq = (HttpWebRequest)result.AsyncState; var response = (HttpWebResponse)webReq.EndGetResponse(result); using (var stream = response.GetResponseStream()) { var bytes = stream.ReadFully(); if (callback != null) { callback(bytes); } } }, null)); } #endif public virtual void SendOneWay(object request) { var requestUri = this.AsyncOneWayBaseUri.WithTrailingSlash() + request.GetType().Name; DownloadBytes(requestUri, request); } public virtual void SendOneWay(string relativeOrAbsoluteUrl, object request) { var requestUri = GetUrl(relativeOrAbsoluteUrl); DownloadBytes(requestUri, request); } public virtual void SendAsync(object request, Action onSuccess, Action onError) { var requestUri = this.SyncReplyBaseUri.WithTrailingSlash() + request.GetType().Name; asyncClient.SendAsync(Web.HttpMethod.Post, requestUri, request, onSuccess, onError); } public virtual void GetAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { asyncClient.SendAsync(Web.HttpMethod.Get, GetUrl(relativeOrAbsoluteUrl), null, onSuccess, onError); } public virtual void DeleteAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { asyncClient.SendAsync(Web.HttpMethod.Delete, GetUrl(relativeOrAbsoluteUrl), null, onSuccess, onError); } public virtual void PostAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { asyncClient.SendAsync(Web.HttpMethod.Post, GetUrl(relativeOrAbsoluteUrl), request, onSuccess, onError); } public virtual void PutAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { asyncClient.SendAsync(Web.HttpMethod.Put, GetUrl(relativeOrAbsoluteUrl), request, onSuccess, onError); } public virtual void CancelAsync() { asyncClient.CancelAsync(); } #if !SILVERLIGHT public virtual TResponse Send(string httpMethod, string relativeOrAbsoluteUrl, object request) { var requestUri = GetUrl(relativeOrAbsoluteUrl); var client = SendRequest(httpMethod, requestUri, request); try { var webResponse = client.GetResponse(); return HandleResponse(webResponse); } catch (Exception ex) { TResponse response; if (!HandleResponseException(ex, requestUri, () => SendRequest(httpMethod, requestUri, request), c => c.GetResponse(), out response)) { throw; } return response; } } public virtual TResponse Get(string relativeOrAbsoluteUrl) { return Send(Web.HttpMethod.Get, relativeOrAbsoluteUrl, null); } public virtual TResponse Delete(string relativeOrAbsoluteUrl) { return Send(Web.HttpMethod.Delete, relativeOrAbsoluteUrl, null); } public virtual TResponse Post(string relativeOrAbsoluteUrl, object request) { return Send(Web.HttpMethod.Post, relativeOrAbsoluteUrl, request); } public virtual TResponse Put(string relativeOrAbsoluteUrl, object request) { return Send(Web.HttpMethod.Put, relativeOrAbsoluteUrl, request); } public virtual TResponse Patch(string relativeOrAbsoluteUrl, object request) { return Send(Web.HttpMethod.Patch, relativeOrAbsoluteUrl, request); } public virtual TResponse PostFileWithRequest(string relativeOrAbsoluteUrl, FileInfo fileToUpload, object request) { return PostFileWithRequest(relativeOrAbsoluteUrl, fileToUpload.OpenRead(), fileToUpload.Name, request); } public virtual TResponse PostFileWithRequest(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, object request) { var requestUri = GetUrl(relativeOrAbsoluteUrl); var currentStreamPosition = fileToUpload.Position; Func createWebRequest = () => { var webRequest = PrepareWebRequest(Web.HttpMethod.Post, requestUri, null, null); var queryString = QueryStringSerializer.SerializeToString(request); #if !MONOTOUCH var nameValueCollection = HttpUtility.ParseQueryString(queryString); #endif var boundary = DateTime.Now.Ticks.ToString(); webRequest.ContentType = "multipart/form-data; boundary=" + boundary; boundary = "--" + boundary; var newLine = Environment.NewLine; using (var outputStream = webRequest.GetRequestStream()) { #if !MONOTOUCH foreach (var key in nameValueCollection.AllKeys) { outputStream.Write(boundary + newLine); outputStream.Write("Content-Disposition: form-data;name=\"{0}\"{1}{2}".FormatWith(key, newLine, newLine)); outputStream.Write(nameValueCollection[key] + newLine); } #endif outputStream.Write(boundary + newLine); outputStream.Write("Content-Disposition: form-data;name=\"{0}\";filename=\"{1}\"{2}{3}".FormatWith("upload", fileName, newLine, newLine)); var buffer = new byte[4096]; int byteCount; while ((byteCount = fileToUpload.Read(buffer, 0, 4096)) > 0) { outputStream.Write(buffer, 0, byteCount); } outputStream.Write(newLine); outputStream.Write(boundary + "--"); } return webRequest; }; try { var webRequest = createWebRequest(); var webResponse = webRequest.GetResponse(); return HandleResponse(webResponse); } catch (Exception ex) { TResponse response; // restore original position before retry fileToUpload.Seek(currentStreamPosition, SeekOrigin.Begin); if (!HandleResponseException(ex, requestUri, createWebRequest, c => c.GetResponse(), out response)) { throw; } return response; } } public virtual TResponse PostFile(string relativeOrAbsoluteUrl, FileInfo fileToUpload, string mimeType) { return PostFile(relativeOrAbsoluteUrl, fileToUpload.OpenRead(), fileToUpload.Name, mimeType); } public virtual TResponse PostFile(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, string mimeType) { var currentStreamPosition = fileToUpload.Position; var requestUri = GetUrl(relativeOrAbsoluteUrl); Func createWebRequest = () => PrepareWebRequest(Web.HttpMethod.Post, requestUri, null, null); try { var webRequest = createWebRequest(); webRequest.UploadFile(fileToUpload, fileName, mimeType); var webResponse = webRequest.GetResponse(); return HandleResponse(webResponse); } catch (Exception ex) { TResponse response; // restore original position before retry fileToUpload.Seek(currentStreamPosition, SeekOrigin.Begin); if (!HandleResponseException(ex, requestUri, createWebRequest, c => { c.UploadFile(fileToUpload, fileName, mimeType); return c.GetResponse(); }, out response)) { throw; } return response; } } private TResponse HandleResponse(WebResponse webResponse) { ApplyWebResponseFilters(webResponse); using (var responseStream = webResponse.GetResponseStream()) { var response = DeserializeFromStream(responseStream); return response; } } #endif public void Dispose() { } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/HttpMethod.cs0000644000175000017500000000063612146506550031031 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceClient.Web { public static class HttpMethod { public const string Get = "GET"; public const string Post = "POST"; public const string Put = "PUT"; public const string Delete = "DELETE"; public const string Options = "OPTIONS"; public const string Head = "HEAD"; public const string Patch = "PATCH"; } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/WebRequestUtils.cs0000644000175000017500000000345112146506550032056 0ustar00meebeymeebey00000000000000using System; using System.Net; using System.Text; using ServiceStack.Common.Web; namespace ServiceStack.ServiceClient.Web { public class AuthenticationException : Exception { public AuthenticationException() { } public AuthenticationException(string message) : base(message) { } public AuthenticationException(string message, Exception innerException) : base(message, innerException) { } } internal static class WebRequestUtils { internal static AuthenticationException CreateCustomException(string uri, AuthenticationException ex) { if (uri.StartsWith("https")) { return new AuthenticationException( string.Format("Invalid remote SSL certificate, overide with: \nServicePointManager.ServerCertificateValidationCallback += ((sender, certificate, chain, sslPolicyErrors) => isValidPolicy);"), ex); } return null; } internal static bool ShouldAuthenticate(Exception ex, string userName, string password) { var webEx = ex as WebException; return (webEx != null && webEx.Response != null && ((HttpWebResponse) webEx.Response).StatusCode == HttpStatusCode.Unauthorized && !string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(password)); } internal static void AddBasicAuth(this WebRequest client, string userName, string password) { client.Headers[HttpHeaders.Authorization] = "basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(userName + ":" + password)); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/WebRequestExtensions.cs0000644000175000017500000001750412146506550033121 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT using System; using System.IO; using System.Net; using System.Text; using ServiceStack.Common; using ServiceStack.Common.Web; using ServiceStack.Text; namespace ServiceStack.ServiceClient.Web { public static class WebRequestExtensions { public static string DownloadJsonFromUrl(this string url) { return url.DownloadUrl(ContentType.Json); } public static string DownloadXmlFromUrl(this string url) { return url.DownloadUrl(ContentType.Xml); } public static string DownloadCsvFromUrl(this string url) { return url.DownloadUrl(ContentType.Csv); } public static string DownloadUrl(this string url, string acceptContentType) { var webReq = (HttpWebRequest)WebRequest.Create(url); webReq.Accept = acceptContentType; using (var webRes = webReq.GetResponse()) return DownloadText(webRes); } public static string DownloadUrl(this string url) { var webReq = WebRequest.Create(url); using (var webRes = webReq.GetResponse()) return DownloadText(webRes); } public static byte[] DownloadBinaryFromUrl(this string url) { var webReq = WebRequest.Create(url); using (var webRes = webReq.GetResponse()) return DownloadBinary(webRes); } public static string PostJsonToUrl(this string url, string data) { return SendToUrl(url, HttpMethod.Post, Encoding.UTF8.GetBytes(data), ContentType.Json, ContentType.Json); } public static string PostJsonToUrl(this string url, object data) { return SendToUrl(url, HttpMethod.Post, Encoding.UTF8.GetBytes(data.ToJson()), ContentType.Json, ContentType.Json); } public static string PostToUrl(this string url, string data, string requestContentType = null, string acceptContentType = null) { return SendToUrl(url, HttpMethod.Post, Encoding.UTF8.GetBytes(data), requestContentType, acceptContentType); } public static string PutToUrl(this string url, string data, string requestContentType = null, string acceptContentType = null) { return SendToUrl(url, HttpMethod.Put, Encoding.UTF8.GetBytes(data), requestContentType, acceptContentType); } public static string PostToUrl(this string url, byte[] data, string requestContentType = null, string acceptContentType = null) { return SendToUrl(url, HttpMethod.Post, data, requestContentType, acceptContentType); } public static string PutToUrl(this string url, byte[] data, string requestContentType = null, string acceptContentType = null) { return SendToUrl(url, HttpMethod.Put, data, requestContentType, acceptContentType); } private static string SendToUrl(string url, string httpMethod, byte[] data, string requestContentType = null, string acceptContentType = null) { var webReq = (HttpWebRequest) WebRequest.Create(url); webReq.Method = httpMethod; if (requestContentType != null) webReq.ContentType = requestContentType; if (acceptContentType != null) webReq.Accept = acceptContentType; try { using (var req = webReq.GetRequestStream()) req.Write(data, 0, data.Length); } catch (Exception ex) { Console.WriteLine("Error sending Request: " + ex); throw; } try { using (var webRes = webReq.GetResponse()) return DownloadText(webRes); } catch (Exception ex) { Console.WriteLine("Error reading Response: " + ex); throw; } } public static string DownloadAsString(this string url) { var webReq = WebRequest.Create(url); using (var webRes = webReq.GetResponse()) return DownloadText(webRes); } public static string DownloadText(this WebResponse webRes) { using (var stream = webRes.GetResponseStream()) using (var reader = new StreamReader(stream)) { return reader.ReadToEnd(); } } public static byte[] DownloadBinary(this WebResponse webRes) { using (var stream = webRes.GetResponseStream()) { return stream.ReadFully(); } } public static HttpWebResponse GetErrorResponse(this string url) { try { var webReq = WebRequest.Create(url); var webRes = webReq.GetResponse(); var strRes = webRes.DownloadText(); Console.WriteLine("Expected error, got: " + strRes); return null; } catch (WebException webEx) { return (HttpWebResponse)webEx.Response; } } public static WebResponse UploadFile(this WebRequest webRequest, FileInfo uploadFileInfo, string uploadFileMimeType) { using (var fileStream = uploadFileInfo.OpenRead()) { var fileName = uploadFileInfo.Name; webRequest.UploadFile(fileStream, fileName, uploadFileMimeType); } return webRequest.GetResponse(); } public static void UploadFile(this WebRequest webRequest, Stream fileStream, string fileName, string mimeType) { var httpReq = (HttpWebRequest)webRequest; httpReq.UserAgent = Env.ServerUserAgent; httpReq.Method = "POST"; httpReq.AllowAutoRedirect = false; httpReq.KeepAlive = false; var boundary = "----------------------------" + DateTime.Now.Ticks.ToString("x"); httpReq.ContentType = "multipart/form-data; boundary=" + boundary; var boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n"); var headerTemplate = "\r\n--" + boundary + "\r\nContent-Disposition: form-data; name=\"file\"; filename=\"{0}\"\r\nContent-Type: {1}\r\n\r\n"; var header = string.Format(headerTemplate, fileName, mimeType); var headerbytes = System.Text.Encoding.ASCII.GetBytes(header); httpReq.ContentLength = fileStream.Length + headerbytes.Length + boundarybytes.Length; using (Stream outputStream = httpReq.GetRequestStream()) { outputStream.Write(headerbytes, 0, headerbytes.Length); byte[] buffer = new byte[4096]; int byteCount; while ((byteCount = fileStream.Read(buffer, 0, 4096)) > 0) { outputStream.Write(buffer, 0, byteCount); } outputStream.Write(boundarybytes, 0, boundarybytes.Length); outputStream.Close(); } } public static void UploadFile(this WebRequest webRequest, Stream fileStream, string fileName) { fileName.ThrowIfNull("fileName"); var mimeType = MimeTypes.GetMimeType(fileName); if (mimeType == null) throw new ArgumentException("Mime-type not found for file: " + fileName); UploadFile(webRequest, fileStream, fileName, mimeType); } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/IDuplexCallback.cs0000644000175000017500000000061212146506550031732 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System.ServiceModel; using System.ServiceModel.Channels; namespace ServiceStack.ServiceClient.Web { [ServiceContract(Namespace = "http://services.servicestack.net/")] public interface IDuplexCallback { [OperationContract(Action = "*", ReplyAction = "*")] void OnMessageReceived(Message msg); } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/IOneWay.cs0000644000175000017500000000060012146506550030253 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System.ServiceModel; using System.ServiceModel.Channels; namespace ServiceStack.ServiceClient.Web { [ServiceContract(Namespace = "http://services.servicestack.net/")] public interface IOneWay { [OperationContract(Action = "*", IsOneWay = true)] void SendOneWay(Message requestMsg); } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/Soap12ServiceClient.cs0000644000175000017500000001135012146506550032471 0ustar00meebeymeebey00000000000000using System; using System.IO; using ServiceStack.Service; using System.Net; namespace ServiceStack.ServiceClient.Web { #if SILVERLIGHT || MONOTOUCH || XBOX || ANDROID public class Soap12ServiceClient : IServiceClient { public Soap12ServiceClient(string uri) { throw new NotImplementedException(); } public void Dispose() { throw new NotImplementedException(); } public void SetCredentials(string userName, string password) { throw new NotImplementedException(); } public void GetAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void DeleteAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void PostAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void PutAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void SendAsync(object request, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void SendOneWay(object request) { throw new NotImplementedException(); } public void SendOneWay(string relativeOrAbsoluteUrl, object request) { throw new NotImplementedException(); } public TResponse Send(object request) { throw new NotImplementedException(); } public TResponse PostFile(string relativeOrAbsoluteUrl, FileInfo fileToUpload, string mimeType) { throw new NotImplementedException(); } public TResponse PostFile(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, string mimeType) { throw new NotImplementedException(); } public TResponse PostFileWithRequest(string relativeOrAbsoluteUrl, FileInfo fileToUpload, object request) { throw new NotImplementedException(); } public TResponse PostFileWithRequest(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, object request) { throw new NotImplementedException(); } } #else using System.ServiceModel; using System.ServiceModel.Channels; using ServiceStack.Text; using ServiceStack.Service; public class Soap12ServiceClient : WcfServiceClient { public Soap12ServiceClient(string uri) { this.Uri = uri.WithTrailingSlash() + "Soap12"; this.StoreCookies = true; } private WSHttpBinding binding; private Binding WsHttpBinding { get { if (this.binding == null) { this.binding = new WSHttpBinding { MaxReceivedMessageSize = int.MaxValue, HostNameComparisonMode = HostNameComparisonMode.StrongWildcard, MaxBufferPoolSize = 524288, }; this.binding.Security.Mode = SecurityMode.None; // CCB Custom // Yes, you need this to manage cookies yourself. Seems counterintutive, but set to true, // it only means that the framework will manage cookie propagation for the same call, which is // not what we want. if (StoreCookies) this.binding.AllowCookies = false; } return this.binding; } } protected override Binding Binding { get { return this.WsHttpBinding; } } protected override MessageVersion MessageVersion { get { return MessageVersion.Default; } } public override void SetProxy(Uri proxyAddress) { var wsHttpBinding = (WSHttpBinding)Binding; wsHttpBinding.ProxyAddress = proxyAddress; wsHttpBinding.UseDefaultWebProxy = false; wsHttpBinding.BypassProxyOnLocal = false; return; } } #endif } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/AuthDtos.cs0000644000175000017500000000153112146506550030477 0ustar00meebeymeebey00000000000000using ServiceStack.ServiceInterface.ServiceModel; namespace ServiceStack.Common.ServiceClient.Web { //Copy from ServiceStack.ServiceInterface.Auth to avoid deps public class Auth { public string provider { get; set; } public string State { get; set; } public string oauth_token { get; set; } public string oauth_verifier { get; set; } public string UserName { get; set; } public string Password { get; set; } public bool? RememberMe { get; set; } } public class AuthResponse { public AuthResponse() { this.ResponseStatus = new ResponseStatus(); } public string SessionId { get; set; } public string UserName { get; set; } public ResponseStatus ResponseStatus { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/XmlServiceClient.cs0000644000175000017500000000253312146506550032167 0ustar00meebeymeebey00000000000000using System.IO; using ServiceStack.ServiceHost; using ServiceStack.ServiceModel.Serialization; using ServiceStack.Text; using System; namespace ServiceStack.ServiceClient.Web { public class XmlServiceClient : ServiceClientBase { public override string Format { get { return "xml"; } } public XmlServiceClient() { } public XmlServiceClient(string baseUri) { SetBaseUri(baseUri); } public XmlServiceClient(string syncReplyBaseUri, string asyncOneWayBaseUri) : base(syncReplyBaseUri, asyncOneWayBaseUri) {} public override string ContentType { get { return String.Format("application/{0}", Format); } } public override void SerializeToStream(IRequestContext requestContext, object request, Stream stream) { DataContractSerializer.Instance.SerializeToStream(request, stream); } public override T DeserializeFromStream(Stream stream) { return DataContractDeserializer.Instance.DeserializeFromStream(stream); } public override StreamDeserializerDelegate StreamDeserializer { get { return XmlSerializer.DeserializeFromStream; } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/IWcfServiceClient.cs0000644000175000017500000000126412146506550032257 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System; using System.ServiceModel.Channels; using ServiceStack.Service; using System.Xml; namespace ServiceStack.ServiceClient.Web { public interface IWcfServiceClient : IServiceClient { string Uri { get; set; } void SetProxy(Uri proxyAddress); Message Send(object request); Message Send(object request, string action); Message Send(XmlReader reader, string action); Message Send(Message message); void SendOneWay(object request, string action); void SendOneWay(XmlReader reader, string action); void SendOneWay(Message message); } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/JsonServiceClient.cs0000644000175000017500000000257712146506550032350 0ustar00meebeymeebey00000000000000using System; using System.IO; using ServiceStack.ServiceHost; using ServiceStack.ServiceModel.Serialization; using ServiceStack.Text; namespace ServiceStack.ServiceClient.Web { public class JsonServiceClient : ServiceClientBase { public override string Format { get { return "json"; } } public JsonServiceClient() { } public JsonServiceClient(string baseUri) { SetBaseUri(baseUri); } public JsonServiceClient(string syncReplyBaseUri, string asyncOneWayBaseUri) : base(syncReplyBaseUri, asyncOneWayBaseUri) { } public override string ContentType { get { return String.Format("application/{0}", Format); } } public override void SerializeToStream(IRequestContext requestContext, object request, Stream stream) { JsonDataContractSerializer.Instance.SerializeToStream(request, stream); } public override T DeserializeFromStream(Stream stream) { return JsonDataContractDeserializer.Instance.DeserializeFromStream(stream); } public override StreamDeserializerDelegate StreamDeserializer { get { return JsonSerializer.DeserializeFromStream; } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/GenericProxy.cs0000644000175000017500000000220512146506550031361 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System.ServiceModel; using System.ServiceModel.Description; namespace ServiceStack.ServiceClient.Web { /// /// Generic Proxy for service calls. /// /// The service Contract public class GenericProxy : ClientBase where T : class { public GenericProxy() : base() { Initialize(); } public GenericProxy(string endpoint) : base(endpoint) { Initialize(); } public GenericProxy(ServiceEndpoint endpoint) : base(endpoint.Binding, endpoint.Address) { Initialize(); } public void Initialize() { //this.Endpoint.Behaviors.Add(new ServiceEndpointBehaviour()); } /// /// Returns the transparent proxy for the service call /// public T Proxy { get { return base.Channel; } } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/JsonRestClientAsync.cs0000644000175000017500000000553012146506550032653 0ustar00meebeymeebey00000000000000using System; using System.IO; using System.Threading; using ServiceStack.Service; using ServiceStack.ServiceHost; using ServiceStack.Text; namespace ServiceStack.ServiceClient.Web { public class JsonRestClientAsync : IRestClientAsync { public const string ContentType = "application/json"; public JsonRestClientAsync(string baseUri) : this() { this.BaseUri = baseUri.WithTrailingSlash(); } public JsonRestClientAsync() { this.client = new AsyncServiceClient { ContentType = ContentType, StreamSerializer = SerializeToStream, StreamDeserializer = JsonSerializer.DeserializeFromStream }; } public TimeSpan? Timeout { get { return this.client.Timeout; } set { this.client.Timeout = value; } } private static void SerializeToStream(IRequestContext requestContext, object dto, Stream stream) { JsonSerializer.SerializeToStream(dto, stream); } private readonly AsyncServiceClient client; public string BaseUri { get; set; } public void SetCredentials(string userName, string password) { this.client.SetCredentials(userName, password); } private string GetUrl(string relativeOrAbsoluteUrl) { return relativeOrAbsoluteUrl.StartsWith("http:") || relativeOrAbsoluteUrl.StartsWith("https:") ? relativeOrAbsoluteUrl : this.BaseUri + relativeOrAbsoluteUrl; } public void GetAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { this.client.SendAsync(HttpMethod.Get, GetUrl(relativeOrAbsoluteUrl), null, onSuccess, onError); } public void DeleteAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { this.client.SendAsync(HttpMethod.Delete, GetUrl(relativeOrAbsoluteUrl), null, onSuccess, onError); } public void PostAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { this.client.SendAsync(HttpMethod.Post, GetUrl(relativeOrAbsoluteUrl), request, onSuccess, onError); } public void PutAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { this.client.SendAsync(HttpMethod.Put, GetUrl(relativeOrAbsoluteUrl), request, onSuccess, onError); } public void Dispose() { } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/XLinqExtensions.cs0000644000175000017500000002166012146506550032064 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX // // ServiceStack: Useful extensions to simplify parsing xml with XLinq // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of reddis and ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Xml; using System.Xml.Linq; namespace ServiceStack.ServiceModel.Extensions { public static class XLinqExtensions { public static string GetString(this XElement el, string name) { return el == null ? null : GetElementValueOrDefault(el, name, x => x.Value); } public static bool GetBool(this XElement el, string name) { AssertElementHasValue(el, name); return (bool)GetElement(el, name); } public static bool GetBoolOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (bool)x); } public static bool? GetNullableBool(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (bool?)childEl; } public static int GetInt(this XElement el, string name) { AssertElementHasValue(el, name); return (int)GetElement(el, name); } public static int GetIntOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (int) x); } public static int? GetNullableInt(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (int?) childEl; } public static long GetLong(this XElement el, string name) { AssertElementHasValue(el, name); return (long)GetElement(el, name); } public static long GetLongOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (long)x); } public static long? GetNullableLong(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (long?)childEl; } public static decimal GetDecimal(this XElement el, string name) { AssertElementHasValue(el, name); return (decimal)GetElement(el, name); } public static decimal GetDecimalOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (decimal)x); } public static decimal? GetNullableDecimal(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (decimal?)childEl; } public static DateTime GetDateTime(this XElement el, string name) { AssertElementHasValue(el, name); return (DateTime)GetElement(el, name); } public static DateTime GetDateTimeOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (DateTime)x); } public static DateTime? GetNullableDateTime(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (DateTime?)childEl; } public static TimeSpan GetTimeSpan(this XElement el, string name) { AssertElementHasValue(el, name); return (TimeSpan)GetElement(el, name); } public static TimeSpan GetTimeSpanOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (TimeSpan)x); } public static TimeSpan? GetNullableTimeSpan(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (TimeSpan?)childEl; } public static Guid GetGuid(this XElement el, string name) { AssertElementHasValue(el, name); return (Guid)GetElement(el, name); } public static Guid GetGuidOrDefault(this XElement el, string name) { return GetElementValueOrDefault(el, name, x => (Guid)x); } public static Guid? GetNullableGuid(this XElement el, string name) { var childEl = GetElement(el, name); return childEl == null || string.IsNullOrEmpty(childEl.Value) ? null : (Guid?)childEl; } public static T GetElementValueOrDefault(this XElement element, string name, Func converter) { if (converter == null) { throw new ArgumentNullException("converter"); } var el = GetElement(element, name); return el == null || string.IsNullOrEmpty(el.Value) ? default(T) : converter(el); } public static XElement GetElement(this XElement element, string name) { if (element == null) { throw new ArgumentNullException("element"); } if (name == null) { throw new ArgumentNullException("name"); } return element.AnyElement(name); } public static void AssertElementHasValue(this XElement element, string name) { if (element == null) { throw new ArgumentNullException("element"); } if (name == null) { throw new ArgumentNullException("name"); } var childEl = element.AnyElement(name); if (childEl == null || string.IsNullOrEmpty(childEl.Value)) { throw new ArgumentNullException(name, string.Format("{0} is required", name)); } } public static List GetValues(this IEnumerable els) { var values = new List(); foreach (var el in els) { values.Add(el.Value); } return values; } public static XAttribute AnyAttribute(this XElement element, string name) { if (element == null) return null; foreach (var attribute in element.Attributes()) { if (attribute.Name.LocalName == name) { return attribute; } } return null; } public static IEnumerable AllElements(this XElement element, string name) { var els = new List(); if (element == null) return els; foreach (var node in element.Nodes()) { if (node.NodeType != XmlNodeType.Element) continue; var childEl = (XElement)node; if (childEl.Name.LocalName == name) { els.Add(childEl); } } return els; } public static XElement AnyElement(this XElement element, string name) { if (element == null) return null; foreach (var node in element.Nodes()) { if (node.NodeType != XmlNodeType.Element) continue; var childEl = (XElement)node; if (childEl.Name.LocalName == name) { return childEl; } } return null; } public static XElement AnyElement(this IEnumerable elements, string name) { foreach (var element in elements) { if (element.Name.LocalName == name) { return element; } } return null; } public static IEnumerable AllElements(this IEnumerable elements, string name) { var els = new List(); foreach (var element in elements) { els.AddRange(AllElements(element, name)); } return els; } public static XElement FirstElement(this XElement element) { if (element.FirstNode.NodeType == XmlNodeType.Element) { return (XElement) element.FirstNode; } return null; } } } #endif smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/DictionaryExtensions.cs0000644000175000017500000000175712146506550033143 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System.Collections.Generic; using System.Collections.Specialized; namespace ServiceStack.ServiceModel.Extensions { public static class DictionaryExtensions { public static Dictionary ToDictionary(this NameValueCollection nameValues) { var map = new Dictionary(); foreach (var key in nameValues.AllKeys) { if (key == null) { //occurs when no value is specified, e.g. 'path/to/page?debug' //throw new ArgumentNullException("key", "nameValues: " + nameValues); continue; } var values = nameValues.GetValues(key); if (values != null && values.Length > 0) { map[key] = values[0]; } } return map; } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/JsvServiceClient.cs0000644000175000017500000000272512146506550032174 0ustar00meebeymeebey00000000000000using System; using System.IO; using ServiceStack.ServiceHost; using ServiceStack.Text; namespace ServiceStack.ServiceClient.Web { public class JsvServiceClient : ServiceClientBase { public override string Format { get { return "jsv"; } } public JsvServiceClient() { } public JsvServiceClient(string baseUri) { SetBaseUri(baseUri); } public JsvServiceClient(string syncReplyBaseUri, string asyncOneWayBaseUri) : base(syncReplyBaseUri, asyncOneWayBaseUri) { } public override string ContentType { get { return String.Format("application/{0}", Format); } } public override void SerializeToStream(IRequestContext requestContext, object request, Stream stream) { using (var writer = new StreamWriter(stream)) { TypeSerializer.SerializeToWriter(request, writer); } } public override T DeserializeFromStream(Stream stream) { using (var reader = new StreamReader(stream)) { return TypeSerializer.DeserializeFromReader(reader); } } public override StreamDeserializerDelegate StreamDeserializer { get { return TypeSerializer.DeserializeFromStream; } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/WcfServiceClient.cs0000644000175000017500000003402512146506550032147 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System; using System.IO; using System.Net; using System.Xml; using System.ServiceModel; using System.ServiceModel.Channels; using System.ServiceModel.Description; using System.ServiceModel.Dispatcher; using ServiceStack.Common.Utils; using ServiceStack.ServiceInterface.ServiceModel; namespace ServiceStack.ServiceClient.Web { /// /// Adds the singleton instance of to an endpoint on the client. /// /// /// Based on http://megakemp.wordpress.com/2009/02/06/managing-shared-cookies-in-wcf/ /// public class CookieManagerEndpointBehavior : IEndpointBehavior { public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters) { return; } /// /// Adds the singleton of the class to the client endpoint's message inspectors. /// /// The endpoint that is to be customized. /// The client runtime to be customized. public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) { var cm = CookieManagerMessageInspector.Instance; cm.Uri = endpoint.ListenUri.AbsoluteUri; clientRuntime.MessageInspectors.Add(cm); } public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) { return; } public void Validate(ServiceEndpoint endpoint) { return; } } /// /// Maintains a copy of the cookies contained in the incoming HTTP response received from any service /// and appends it to all outgoing HTTP requests. /// /// /// This class effectively allows to send any received HTTP cookies to different services, /// reproducing the same functionality available in ASMX Web Services proxies with the class. /// Based on http://megakemp.wordpress.com/2009/02/06/managing-shared-cookies-in-wcf/ /// public class CookieManagerMessageInspector : IClientMessageInspector { private static CookieManagerMessageInspector instance; private CookieContainer cookieContainer; public string Uri { get; set; } /// /// Initializes a new instance of the class. /// public CookieManagerMessageInspector() { cookieContainer = new CookieContainer(); Uri = "http://tempuri.org"; } public CookieManagerMessageInspector(string uri) { cookieContainer = new CookieContainer(); Uri = uri; } /// /// Gets the singleton instance. /// public static CookieManagerMessageInspector Instance { get { if (instance == null) { instance = new CookieManagerMessageInspector(); } return instance; } } /// /// Inspects a message after a reply message is received but prior to passing it back to the client application. /// /// The message to be transformed into types and handed back to the client application. /// Correlation state data. public void AfterReceiveReply(ref Message reply, object correlationState) { HttpResponseMessageProperty httpResponse = reply.Properties[HttpResponseMessageProperty.Name] as HttpResponseMessageProperty; if (httpResponse != null) { string cookie = httpResponse.Headers[HttpResponseHeader.SetCookie]; if (!string.IsNullOrEmpty(cookie)) { cookieContainer.SetCookies(new System.Uri(Uri), cookie); } } } /// /// Inspects a message before a request message is sent to a service. /// /// The message to be sent to the service. /// The client object channel. /// /// Null since no message correlation is used. /// public object BeforeSendRequest(ref Message request, IClientChannel channel) { HttpRequestMessageProperty httpRequest; // The HTTP request object is made available in the outgoing message only when // the Visual Studio Debugger is attacched to the running process if (!request.Properties.ContainsKey(HttpRequestMessageProperty.Name)) { request.Properties.Add(HttpRequestMessageProperty.Name, new HttpRequestMessageProperty()); } httpRequest = (HttpRequestMessageProperty)request.Properties[HttpRequestMessageProperty.Name]; httpRequest.Headers.Add(HttpRequestHeader.Cookie, cookieContainer.GetCookieHeader(new System.Uri(Uri))); return null; } } public abstract class WcfServiceClient : IWcfServiceClient { const string XPATH_SOAP_FAULT = "/s:Fault"; const string XPATH_SOAP_FAULT_REASON = "/s:Fault/s:Reason"; const string NAMESPACE_SOAP = "http://www.w3.org/2003/05/soap-envelope"; const string NAMESPACE_SOAP_ALIAS = "s"; public string Uri { get; set; } public abstract void SetProxy(Uri proxyAddress); protected abstract MessageVersion MessageVersion { get; } protected abstract Binding Binding { get; } /// /// Specifies if cookies should be stored /// // CCB Custom public bool StoreCookies { get; set; } public WcfServiceClient() { // CCB Custom this.StoreCookies = true; } private static XmlNamespaceManager GetNamespaceManager(XmlDocument doc) { var nsmgr = new XmlNamespaceManager(doc.NameTable); nsmgr.AddNamespace(NAMESPACE_SOAP_ALIAS, NAMESPACE_SOAP); return nsmgr; } private static Exception CreateException(Exception e, XmlReader reader) { var doc = new XmlDocument(); doc.Load(reader); var node = doc.SelectSingleNode(XPATH_SOAP_FAULT, GetNamespaceManager(doc)); if (node != null) { string errMsg = null; var nodeReason = doc.SelectSingleNode(XPATH_SOAP_FAULT_REASON, GetNamespaceManager(doc)); if (nodeReason != null) { errMsg = nodeReason.FirstChild.InnerXml; } return new Exception(string.Format("SOAP FAULT '{0}': {1}", errMsg, node.InnerXml), e); } return e; } private ServiceEndpoint SyncReply { get { var contract = new ContractDescription("ServiceStack.ServiceClient.Web.ISyncReply", "http://services.servicestack.net/"); var addr = new EndpointAddress(Uri); var endpoint = new ServiceEndpoint(contract, Binding, addr); return endpoint; } } public Message Send(object request) { return Send(request, request.GetType().Name); } public Message Send(object request, string action) { return Send(Message.CreateMessage(MessageVersion, action, request)); } public Message Send(XmlReader reader, string action) { return Send(Message.CreateMessage(MessageVersion, action, reader)); } public Message Send(Message message) { using (var client = new GenericProxy(SyncReply)) { // CCB Custom...add behavior to propagate cookies across SOAP method calls if (StoreCookies) client.ChannelFactory.Endpoint.Behaviors.Add(new CookieManagerEndpointBehavior()); var response = client.Proxy.Send(message); return response; } } public static T GetBody(Message message) { var buffer = message.CreateBufferedCopy(int.MaxValue); try { return buffer.CreateMessage().GetBody(); } catch (Exception ex) { throw CreateException(ex, buffer.CreateMessage().GetReaderAtBodyContents()); } } public T Send(object request) { try { var responseMsg = Send(request); var response = responseMsg.GetBody(); var responseStatus = GetResponseStatus(response); if (responseStatus != null && !string.IsNullOrEmpty(responseStatus.ErrorCode)) { throw new WebServiceException(responseStatus.Message, null) { StatusCode = 500, ResponseDto = response, StatusDescription = responseStatus.Message, }; } return response; } catch (WebServiceException webEx) { throw; } catch (Exception ex) { var webEx = ex as WebException ?? ex.InnerException as WebException; if (webEx == null) { throw new WebServiceException(ex.Message, ex) { StatusCode = 500, }; } var httpEx = webEx.Response as HttpWebResponse; throw new WebServiceException(webEx.Message, webEx) { StatusCode = httpEx != null ? (int)httpEx.StatusCode : 500 }; } } public ResponseStatus GetResponseStatus(object response) { if (response == null) return null; var hasResponseStatus = response as IHasResponseStatus; if (hasResponseStatus != null) return hasResponseStatus.ResponseStatus; var propertyInfo = response.GetType().GetProperty("ResponseStatus"); if (propertyInfo == null) return null; return ReflectionUtils.GetProperty(response, propertyInfo) as ResponseStatus; } public TResponse PostFile(string relativeOrAbsoluteUrl, FileInfo fileToUpload, string mimeType) { throw new NotImplementedException(); } public TResponse PostFile(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, string mimeType) { throw new NotImplementedException(); } public void SendOneWay(object request) { SendOneWay(request, request.GetType().Name); } public void SendOneWay(string relativeOrAbsoluteUrl, object request) { SendOneWay(Message.CreateMessage(MessageVersion, relativeOrAbsoluteUrl, request)); } public void SendOneWay(object request, string action) { SendOneWay(Message.CreateMessage(MessageVersion, action, request)); } public void SendOneWay(XmlReader reader, string action) { SendOneWay(Message.CreateMessage(MessageVersion, action, reader)); } public void SendOneWay(Message message) { using (var client = new GenericProxy(SyncReply)) { client.Proxy.SendOneWay(message); } } public void SendAsync(object request, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void SetCredentials(string userName, string password) { throw new NotImplementedException(); } public void GetAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void DeleteAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void PostAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void PutAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError) { throw new NotImplementedException(); } public void Dispose() { } public TResponse PostFileWithRequest(string relativeOrAbsoluteUrl, FileInfo fileToUpload, object request) { throw new NotImplementedException(); } public TResponse PostFileWithRequest(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, object request) { throw new NotImplementedException(); } } } #endif smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/DirectoryInfoExtensions.cs0000644000175000017500000000264412146506550030337 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT using System.Collections.Generic; using System.IO; namespace ServiceStack.Common { public static class DirectoryInfoExtensions { public static IEnumerable GetMatchingFiles(this DirectoryInfo rootDirPath, string fileSearchPattern) { return GetMatchingFiles(rootDirPath.FullName, fileSearchPattern); } public static IEnumerable GetMatchingFiles(string rootDirPath, string fileSearchPattern) { var pending = new Queue(); pending.Enqueue(rootDirPath); string[] paths; while (pending.Count > 0) { rootDirPath = pending.Dequeue(); paths = Directory.GetFiles(rootDirPath, fileSearchPattern); foreach (var filePath in paths) { yield return filePath; } paths = Directory.GetDirectories(rootDirPath); foreach (var dirPath in paths) { var dirAttrs = File.GetAttributes(dirPath); var isRecurseSymLink = (dirAttrs & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint; if (!isRecurseSymLink) { pending.Enqueue(dirPath); } } } } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Properties/0000755000175000017500000000000012146506550025276 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Properties/AssemblyInfo.cs0000644000175000017500000000311412146506550030217 0ustar00meebeymeebey00000000000000using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ServiceStack.Common")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ServiceStack")] [assembly: AssemblyProduct("ServiceStack.Common")] [assembly: AssemblyCopyright("Copyright © ServiceStack 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("3871f659-64fb-4dfb-a49f-17dc2f8a47e2")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.9.8.0")] // CCB Custom [assembly: ContractNamespace("http://schemas.servicestack.net/types", ClrNamespace = "ServiceStack.Common.ServiceClient.Web")]smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Reflection/0000755000175000017500000000000012146506550025234 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Reflection/StaticAccessors.cs0000644000175000017500000001460512146506550030666 0ustar00meebeymeebey00000000000000using System; using System.Reflection; namespace ServiceStack.Common.Reflection { #if MONOTOUCH || SILVERLIGHT public static class StaticAccessors { } #else using System.Linq.Expressions; public static class StaticAccessors { public static Func GetValueGetter(Type type, PropertyInfo propertyInfo) { if (type != propertyInfo.DeclaringType) { throw new ArgumentException(); } var instance = Expression.Parameter(typeof(object), "i"); var convertInstance = Expression.TypeAs(instance, propertyInfo.DeclaringType); var property = Expression.Property(convertInstance, propertyInfo); var convertProperty = Expression.TypeAs(property, typeof(object)); return Expression.Lambda>(convertProperty, instance).Compile(); } public static Func GetValueGetter(this PropertyInfo propertyInfo) { if (typeof(T) != propertyInfo.DeclaringType) { throw new ArgumentException(); } var instance = Expression.Parameter(propertyInfo.DeclaringType, "i"); var property = Expression.Property(instance, propertyInfo); var convert = Expression.TypeAs(property, typeof(object)); return Expression.Lambda>(convert, instance).Compile(); } public static Action GetValueSetter(this PropertyInfo propertyInfo) { if (typeof(T) != propertyInfo.DeclaringType) { throw new ArgumentException(); } var instance = Expression.Parameter(propertyInfo.DeclaringType, "i"); var argument = Expression.Parameter(typeof(object), "a"); var setterCall = Expression.Call( instance, propertyInfo.GetSetMethod(), Expression.Convert(argument, propertyInfo.PropertyType)); return Expression.Lambda> ( setterCall, instance, argument ).Compile(); } } #endif public static class StaticAccessors { /// /// Func to get the Strongly-typed field /// public static Func TypedGetPropertyFn(PropertyInfo pi) { var mi = pi.GetGetMethod(); return (Func)Delegate.CreateDelegate(typeof(Func), mi); } /// /// Required to cast the return ValueType to an object for caching /// public static Func ValueUnTypedGetPropertyFn(PropertyInfo pi) { var typedPropertyFn = TypedGetPropertyFn(pi); return x => typedPropertyFn(x); } public static Func ValueUnTypedGetPropertyTypeFn(PropertyInfo pi) { var mi = typeof(StaticAccessors).GetMethod("TypedGetPropertyFn"); var genericMi = mi.MakeGenericMethod(pi.PropertyType); var typedGetPropertyFn = (Delegate)genericMi.Invoke(null, new[] { pi }); #if MONOTOUCH || SILVERLIGHT return x => typedGetPropertyFn.Method.Invoke(x, new object[] { }); #else var typedMi = typedGetPropertyFn.Method; var paramFunc = Expression.Parameter(typeof(object), "oFunc"); var expr = Expression.Lambda> ( Expression.Convert( Expression.Call( Expression.Convert(paramFunc, typedMi.DeclaringType), typedMi ), typeof(object) ), paramFunc ); return expr.Compile(); #endif } public static Func UnTypedGetPropertyFn(PropertyInfo pi) { var typedPropertyFn = TypedGetPropertyFn(pi); return x => typedPropertyFn((TEntity)x); } /// /// Func to set the Strongly-typed field /// public static Action TypedSetPropertyFn(PropertyInfo pi) { var mi = pi.GetSetMethod(); return (Action)Delegate.CreateDelegate(typeof(Action), mi); } /// /// Required to cast the ValueType to an object for caching /// public static Action ValueUnTypedSetPropertyFn(PropertyInfo pi) { var typedPropertyFn = TypedSetPropertyFn(pi); return (x, y) => typedPropertyFn(x, (TId)y); } public static Action ValueUnTypedSetPropertyTypeFn(PropertyInfo pi) { var mi = typeof(StaticAccessors).GetMethod("TypedSetPropertyFn"); var genericMi = mi.MakeGenericMethod(pi.PropertyType); var typedSetPropertyFn = (Delegate)genericMi.Invoke(null, new[] { pi }); #if MONOTOUCH || SILVERLIGHT return (x, y) => typedSetPropertyFn.Method.Invoke(x, new[] { y }); #else var typedMi = typedSetPropertyFn.Method; var paramFunc = Expression.Parameter(typeof(object), "oFunc"); var paramValue = Expression.Parameter(typeof(object), "oValue"); var expr = Expression.Lambda>( Expression.Call( Expression.Convert(paramFunc, typedMi.DeclaringType), typedMi, Expression.Convert(paramValue, pi.PropertyType) ), paramFunc, paramValue ); return expr.Compile(); #endif } /// /// Required to cast the ValueType to an object for caching /// public static Action UnTypedSetPropertyFn(PropertyInfo pi) { var typedPropertyFn = TypedSetPropertyFn(pi); return (x, y) => typedPropertyFn((TEntity)x, (TId)y); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Reflection/PropertyAccessor.cs0000644000175000017500000000744012146506550031077 0ustar00meebeymeebey00000000000000using System; using System.Reflection; namespace ServiceStack.Common.Reflection { public static class PropertyAccessor { public static Func GetPropertyFn(string propertyName) { return new PropertyAccessor(propertyName).GetPropertyFn(); } //public static Func GetPropertyFnByType(Type type, string propertyName) //{ // var mi = typeof(PropertyAccessor).GetMethod("GetPropertyFn"); // var genericMi = mi.MakeGenericMethod(type); // var getPropertyFn = genericMi.Invoke(null, new object[] { propertyName }); // return (Func)getPropertyFn; //} public static Action SetPropertyFn(string propertyName) { return new PropertyAccessor(propertyName).SetPropertyFn(); } //public static Action SetPropertyFnByType(Type type, string propertyName) //{ // var mi = typeof(PropertyAccessor).GetMethod("SetPropertyFn"); // var genericMi = mi.MakeGenericMethod(type); // var setPropertyFn = genericMi.Invoke(null, new object[] { propertyName }); // return (Action)setPropertyFn; //} } public class PropertyAccessor { readonly PropertyInfo pi; public string Name { get; set; } public Type PropertyType { get; set; } private readonly Func getPropertyFn; private readonly Action setPropertyFn; public PropertyAccessor(string propertyName) { this.pi = typeof(TEntity).GetProperty(propertyName); this.Name = propertyName; this.PropertyType = pi.PropertyType; getPropertyFn = StaticAccessors.ValueUnTypedGetPropertyTypeFn(pi); setPropertyFn = StaticAccessors.ValueUnTypedSetPropertyTypeFn(pi); } public Func GetPropertyFn() { return getPropertyFn; } public Action SetPropertyFn() { return setPropertyFn; } /// /// Func to get the Strongly-typed field /// public Func TypedGetPropertyFn() { return StaticAccessors.TypedGetPropertyFn(pi); } /// /// Required to cast the return ValueType to an object for caching /// public Func ValueTypedGetPropertyFn() { return StaticAccessors.ValueUnTypedGetPropertyFn(pi); } public Func UnTypedGetPropertyFn() { return StaticAccessors.UnTypedGetPropertyFn(pi); } /// /// Func to set the Strongly-typed field /// public Action TypedSetPropertyFn() { return StaticAccessors.TypedSetPropertyFn(pi); } /// /// Required to cast the ValueType to an object for caching /// public Action ValueTypesSetPropertyFn() { return StaticAccessors.ValueUnTypedSetPropertyFn(pi); } /// /// Required to cast the ValueType to an object for caching /// public Action UnTypedSetPropertyFn() { return StaticAccessors.UnTypedSetPropertyFn(pi); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Net30/0000755000175000017500000000000012146506550024033 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Net30/ConcurrentQueue.cs0000644000175000017500000001615212146506550027516 0ustar00meebeymeebey00000000000000// IConcurrentCollection.cs // // Copyright (c) 2008 Jérémie "Garuma" Laval // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // using System; using System.Threading; using System.Collections; using System.Collections.Generic; using ServiceStack.Net30.Collections.Concurrent; namespace ServiceStack.Common.Net30 { public interface IProducerConsumerCollection : IEnumerable, ICollection, IEnumerable { bool TryAdd(T item); bool TryTake(out T item); T[] ToArray(); void CopyTo(T[] array, int index); } [System.Diagnostics.DebuggerDisplay ("Count={Count}")] public class ConcurrentQueue : IProducerConsumerCollection, IEnumerable, ICollection, IEnumerable { class Node { public T Value; public Node Next; } Node head = new Node (); Node tail; int count; class NodeObjectPool : ObjectPool { protected override Node Creator () { return new Node (); } } static readonly NodeObjectPool pool = new NodeObjectPool (); static Node ZeroOut (Node node) { node.Value = default(T); node.Next = null; return node; } public ConcurrentQueue () { tail = head; } public ConcurrentQueue (IEnumerable collection): this() { foreach (T item in collection) Enqueue (item); } public void Enqueue (T item) { Node node = pool.Take (); node.Value = item; Node oldTail = null; Node oldNext = null; bool update = false; while (!update) { oldTail = tail; oldNext = oldTail.Next; // Did tail was already updated ? if (tail == oldTail) { if (oldNext == null) { // The place is for us update = Interlocked.CompareExchange (ref tail.Next, node, null) == null; } else { // another Thread already used the place so give him a hand by putting tail where it should be Interlocked.CompareExchange (ref tail, oldNext, oldTail); } } } // At this point we added correctly our node, now we have to update tail. If it fails then it will be done by another thread Interlocked.CompareExchange (ref tail, node, oldTail); Interlocked.Increment (ref count); } bool IProducerConsumerCollection.TryAdd (T item) { Enqueue (item); return true; } public bool TryDequeue (out T result) { result = default (T); bool advanced = false; while (!advanced) { Node oldHead = head; Node oldTail = tail; Node oldNext = oldHead.Next; if (oldHead == head) { // Empty case ? if (oldHead == oldTail) { // This should be false then if (oldNext != null) { // If not then the linked list is mal formed, update tail Interlocked.CompareExchange (ref tail, oldNext, oldTail); } result = default (T); return false; } else { result = oldNext.Value; advanced = Interlocked.CompareExchange (ref head, oldNext, oldHead) == oldHead; if (advanced) pool.Release (ZeroOut (oldHead)); } } } Interlocked.Decrement (ref count); return true; } public bool TryPeek (out T result) { if (IsEmpty) { result = default (T); return false; } Node first = head.Next; result = first.Value; return true; } internal void Clear () { count = 0; tail = head = new Node (); } IEnumerator IEnumerable.GetEnumerator () { return (IEnumerator)InternalGetEnumerator (); } public IEnumerator GetEnumerator () { return InternalGetEnumerator (); } IEnumerator InternalGetEnumerator () { Node my_head = head; while ((my_head = my_head.Next) != null) { yield return my_head.Value; } } void ICollection.CopyTo (Array array, int index) { T[] dest = array as T[]; if (dest == null) return; CopyTo (dest, index); } public void CopyTo (T[] array, int index) { IEnumerator e = InternalGetEnumerator (); int i = index; while (e.MoveNext ()) { array [i++] = e.Current; } } public T[] ToArray () { T[] dest = new T [count]; CopyTo (dest, 0); return dest; } bool ICollection.IsSynchronized { get { return true; } } bool IProducerConsumerCollection.TryTake (out T item) { return TryDequeue (out item); } object syncRoot = new object(); object ICollection.SyncRoot { get { return syncRoot; } } public int Count { get { return count; } } public bool IsEmpty { get { return count == 0; } } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Net30/ConcurrentDictionary.cs0000644000175000017500000003240512146506550030536 0ustar00meebeymeebey00000000000000// ConcurrentDictionary.cs // // Copyright (c) 2009 Jérémie "Garuma" Laval // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // #if !NET_4_0 using System; using System.Threading; using System.Collections; using System.Collections.Generic; using System.Runtime.Serialization; using System.Diagnostics; namespace ServiceStack.Net30.Collections.Concurrent { public class ConcurrentDictionary : IDictionary, ICollection>, IEnumerable>, IDictionary, ICollection, IEnumerable { IEqualityComparer comparer; SplitOrderedList> internalDictionary; public ConcurrentDictionary () : this (EqualityComparer.Default) { } public ConcurrentDictionary (IEnumerable> collection) : this (collection, EqualityComparer.Default) { } public ConcurrentDictionary (IEqualityComparer comparer) { this.comparer = comparer; this.internalDictionary = new SplitOrderedList> (comparer); } public ConcurrentDictionary (IEnumerable> collection, IEqualityComparer comparer) : this (comparer) { foreach (KeyValuePair pair in collection) Add (pair.Key, pair.Value); } // Parameters unused public ConcurrentDictionary (int concurrencyLevel, int capacity) : this (EqualityComparer.Default) { } public ConcurrentDictionary (int concurrencyLevel, IEnumerable> collection, IEqualityComparer comparer) : this (collection, comparer) { } // Parameters unused public ConcurrentDictionary (int concurrencyLevel, int capacity, IEqualityComparer comparer) : this (comparer) { } void Add (TKey key, TValue value) { while (!TryAdd (key, value)); } void IDictionary.Add (TKey key, TValue value) { Add (key, value); } public bool TryAdd (TKey key, TValue value) { return internalDictionary.Insert (Hash (key), key, Make (key, value)); } void ICollection>.Add (KeyValuePair pair) { Add (pair.Key, pair.Value); } public TValue AddOrUpdate (TKey key, Func addValueFactory, Func updateValueFactory) { return internalDictionary.InsertOrUpdate (Hash (key), key, () => Make (key, addValueFactory (key)), (e) => Make (key, updateValueFactory (key, e.Value))).Value; } public TValue AddOrUpdate (TKey key, TValue addValue, Func updateValueFactory) { return AddOrUpdate (key, (_) => addValue, updateValueFactory); } TValue AddOrUpdate (TKey key, TValue addValue, TValue updateValue) { return internalDictionary.InsertOrUpdate (Hash (key), key, Make (key, addValue), Make (key, updateValue)).Value; } TValue GetValue (TKey key) { TValue temp; if (!TryGetValue (key, out temp)) throw new KeyNotFoundException (key.ToString ()); return temp; } public bool TryGetValue (TKey key, out TValue value) { KeyValuePair pair; bool result = internalDictionary.Find (Hash (key), key, out pair); value = pair.Value; return result; } public bool TryUpdate (TKey key, TValue newValue, TValue comparisonValue) { return internalDictionary.CompareExchange (Hash (key), key, Make (key, newValue), (e) => e.Value.Equals (comparisonValue)); } public TValue this[TKey key] { get { return GetValue (key); } set { AddOrUpdate (key, value, value); } } public TValue GetOrAdd (TKey key, Func valueFactory) { return internalDictionary.InsertOrGet (Hash (key), key, Make (key, default(TValue)), () => Make (key, valueFactory (key))).Value; } public TValue GetOrAdd (TKey key, TValue value) { return internalDictionary.InsertOrGet (Hash (key), key, Make (key, value), null).Value; } public bool TryRemove (TKey key, out TValue value) { KeyValuePair data; bool result = internalDictionary.Delete (Hash (key), key, out data); value = data.Value; return result; } bool Remove (TKey key) { TValue dummy; return TryRemove (key, out dummy); } bool IDictionary.Remove (TKey key) { return Remove (key); } bool ICollection>.Remove (KeyValuePair pair) { return Remove (pair.Key); } public bool ContainsKey (TKey key) { KeyValuePair dummy; return internalDictionary.Find (Hash (key), key, out dummy); } bool IDictionary.Contains (object key) { if (!(key is TKey)) return false; return ContainsKey ((TKey)key); } void IDictionary.Remove (object key) { if (!(key is TKey)) return; Remove ((TKey)key); } object IDictionary.this [object key] { get { if (!(key is TKey)) throw new ArgumentException ("key isn't of correct type", "key"); return this[(TKey)key]; } set { if (!(key is TKey) || !(value is TValue)) throw new ArgumentException ("key or value aren't of correct type"); this[(TKey)key] = (TValue)value; } } void IDictionary.Add (object key, object value) { if (!(key is TKey) || !(value is TValue)) throw new ArgumentException ("key or value aren't of correct type"); Add ((TKey)key, (TValue)value); } bool ICollection>.Contains (KeyValuePair pair) { return ContainsKey (pair.Key); } public KeyValuePair[] ToArray () { // This is most certainly not optimum but there is // not a lot of possibilities return new List> (this).ToArray (); } public void Clear() { // Pronk internalDictionary = new SplitOrderedList> (comparer); } public int Count { get { return internalDictionary.Count; } } public bool IsEmpty { get { return Count == 0; } } bool ICollection>.IsReadOnly { get { return false; } } bool IDictionary.IsReadOnly { get { return false; } } public ICollection Keys { get { return GetPart ((kvp) => kvp.Key); } } public ICollection Values { get { return GetPart ((kvp) => kvp.Value); } } ICollection IDictionary.Keys { get { return (ICollection)Keys; } } ICollection IDictionary.Values { get { return (ICollection)Values; } } ICollection GetPart (Func, T> extractor) { List temp = new List (); foreach (KeyValuePair kvp in this) temp.Add (extractor (kvp)); return temp.AsReadOnly (); } void ICollection.CopyTo (Array array, int startIndex) { KeyValuePair[] arr = array as KeyValuePair[]; if (arr == null) return; CopyTo (arr, startIndex, Count); } void CopyTo (KeyValuePair[] array, int startIndex) { CopyTo (array, startIndex, Count); } void ICollection>.CopyTo (KeyValuePair[] array, int startIndex) { CopyTo (array, startIndex); } void CopyTo (KeyValuePair[] array, int startIndex, int num) { foreach (var kvp in this) { array [startIndex++] = kvp; if (--num <= 0) return; } } public IEnumerator> GetEnumerator () { return GetEnumeratorInternal (); } IEnumerator IEnumerable.GetEnumerator () { return (IEnumerator)GetEnumeratorInternal (); } IEnumerator> GetEnumeratorInternal () { return internalDictionary.GetEnumerator (); } IDictionaryEnumerator IDictionary.GetEnumerator () { return new ConcurrentDictionaryEnumerator (GetEnumeratorInternal ()); } class ConcurrentDictionaryEnumerator : IDictionaryEnumerator { IEnumerator> internalEnum; public ConcurrentDictionaryEnumerator (IEnumerator> internalEnum) { this.internalEnum = internalEnum; } public bool MoveNext () { return internalEnum.MoveNext (); } public void Reset () { internalEnum.Reset (); } public object Current { get { return Entry; } } public DictionaryEntry Entry { get { KeyValuePair current = internalEnum.Current; return new DictionaryEntry (current.Key, current.Value); } } public object Key { get { return internalEnum.Current.Key; } } public object Value { get { return internalEnum.Current.Value; } } } object ICollection.SyncRoot { get { return this; } } bool IDictionary.IsFixedSize { get { return false; } } bool ICollection.IsSynchronized { get { return true; } } static KeyValuePair Make (U key, V value) { return new KeyValuePair (key, value); } uint Hash (TKey key) { return (uint)comparer.GetHashCode (key); } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Net30/ObjectPool.cs0000644000175000017500000000577312146506550026436 0ustar00meebeymeebey00000000000000// ObjectPool.cs // // Copyright (c) 2011 Novell // // Authors: // Jérémie "garuma" Laval // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // #if !NET_4_0 using System; using System.Threading; using System.Collections; using System.Collections.Generic; using System.Runtime.Serialization; namespace ServiceStack.Net30.Collections.Concurrent { internal abstract class ObjectPool where T : class { const int capacity = 20; const int bit = 0x8000000; readonly T[] buffer; int addIndex; int removeIndex; public ObjectPool () { buffer = new T[capacity]; for (int i = 0; i < capacity; i++) buffer[i] = Creator (); addIndex = capacity - 1; } protected abstract T Creator (); public T Take () { if ((addIndex & ~bit) - 1 == removeIndex) return Creator (); int i; T result; int tries = 3; do { i = removeIndex; if ((addIndex & ~bit) - 1 == i || tries == 0) return Creator (); result = buffer[i % capacity]; } while (Interlocked.CompareExchange (ref removeIndex, i + 1, i) != i && --tries > -1); return result; } public void Release (T obj) { if (obj == null || addIndex - removeIndex >= capacity - 1) return; int i; int tries = 3; do { do { i = addIndex; } while ((i & bit) > 0); if (i - removeIndex >= capacity - 1) return; } while (Interlocked.CompareExchange (ref addIndex, i + 1 + bit, i) != i && --tries > 0); buffer[i % capacity] = obj; addIndex = addIndex - bit; } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Net30/SplitOrderedList.cs0000644000175000017500000004475312146506550027633 0ustar00meebeymeebey00000000000000// SplitOrderedList.cs // // Copyright (c) 2010 Jérémie "Garuma" Laval // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // #if !NET_4_0 using System; using System.Threading; using System.Collections; using System.Collections.Generic; using System.Runtime.Serialization; namespace ServiceStack.Net30.Collections.Concurrent { internal class SplitOrderedList { class Node { public bool Marked; public ulong Key; public TKey SubKey; public T Data; public Node Next; public Node Init (ulong key, TKey subKey, T data) { this.Key = key; this.SubKey = subKey; this.Data = data; this.Marked = false; this.Next = null; return this; } // Used to create dummy node public Node Init (ulong key) { this.Key = key; this.Data = default (T); this.Next = null; this.Marked = false; this.SubKey = default (TKey); return this; } // Used to create marked node public Node Init (Node wrapped) { this.Marked = true; this.Next = wrapped; this.Key = 0; this.Data = default (T); this.SubKey = default (TKey); return this; } } class NodeObjectPool : ObjectPool { protected override Node Creator () { return new Node (); } } static readonly NodeObjectPool pool = new NodeObjectPool (); const int MaxLoad = 5; const uint BucketSize = 512; Node head; Node tail; Node[] buckets = new Node [BucketSize]; int count; int size = 2; SimpleRwLock slim = new SimpleRwLock (); readonly IEqualityComparer comparer; public SplitOrderedList (IEqualityComparer comparer) { this.comparer = comparer; head = new Node ().Init (0); tail = new Node ().Init (ulong.MaxValue); head.Next = tail; SetBucket (0, head); } public int Count { get { return count; } } public T InsertOrUpdate (uint key, TKey subKey, Func addGetter, Func updateGetter) { Node current; bool result = InsertInternal (key, subKey, default (T), addGetter, out current); if (result) return current.Data; // FIXME: this should have a CAS-like behavior return current.Data = updateGetter (current.Data); } public T InsertOrUpdate (uint key, TKey subKey, T addValue, T updateValue) { Node current; if (InsertInternal (key, subKey, addValue, null, out current)) return current.Data; // FIXME: this should have a CAS-like behavior return current.Data = updateValue; } public bool Insert (uint key, TKey subKey, T data) { Node current; return InsertInternal (key, subKey, data, null, out current); } public T InsertOrGet (uint key, TKey subKey, T data, Func dataCreator) { Node current; InsertInternal (key, subKey, data, dataCreator, out current); return current.Data; } bool InsertInternal (uint key, TKey subKey, T data, Func dataCreator, out Node current) { Node node = pool.Take ().Init (ComputeRegularKey (key), subKey, data); uint b = key % (uint)size; Node bucket; if ((bucket = GetBucket (b)) == null) bucket = InitializeBucket (b); if (!ListInsert (node, bucket, out current, dataCreator)) return false; int csize = size; if (Interlocked.Increment (ref count) / csize > MaxLoad && (csize & 0x40000000) == 0) Interlocked.CompareExchange (ref size, 2 * csize, csize); current = node; return true; } public bool Find (uint key, TKey subKey, out T data) { Node node; uint b = key % (uint)size; data = default (T); Node bucket; if ((bucket = GetBucket (b)) == null) bucket = InitializeBucket (b); if (!ListFind (ComputeRegularKey (key), subKey, bucket, out node)) return false; data = node.Data; return !node.Marked; } public bool CompareExchange (uint key, TKey subKey, T data, Func check) { Node node; uint b = key % (uint)size; Node bucket; if ((bucket = GetBucket (b)) == null) bucket = InitializeBucket (b); if (!ListFind (ComputeRegularKey (key), subKey, bucket, out node)) return false; if (!check (node.Data)) return false; node.Data = data; return true; } public bool Delete (uint key, TKey subKey, out T data) { uint b = key % (uint)size; Node bucket; if ((bucket = GetBucket (b)) == null) bucket = InitializeBucket (b); if (!ListDelete (bucket, ComputeRegularKey (key), subKey, out data)) return false; Interlocked.Decrement (ref count); return true; } public IEnumerator GetEnumerator () { Node node = head.Next; while (node != tail) { while (node.Marked || (node.Key & 1) == 0) { node = node.Next; if (node == tail) yield break; } yield return node.Data; node = node.Next; } } Node InitializeBucket (uint b) { Node current; uint parent = GetParent (b); Node bucket; if ((bucket = GetBucket (parent)) == null) bucket = InitializeBucket (parent); Node dummy = pool.Take ().Init (ComputeDummyKey (b)); if (!ListInsert (dummy, bucket, out current, null)) return current; return SetBucket (b, dummy); } // Turn v's MSB off static uint GetParent (uint v) { uint t, tt; // Find MSB position in v var pos = (tt = v >> 16) > 0 ? (t = tt >> 8) > 0 ? 24 + logTable[t] : 16 + logTable[tt] : (t = v >> 8) > 0 ? 8 + logTable[t] : logTable[v]; return (uint)(v & ~(1 << pos)); } // Reverse integer bits and make sure LSB is set static ulong ComputeRegularKey (uint key) { return ComputeDummyKey (key) | 1; } // Reverse integer bits static ulong ComputeDummyKey (uint key) { return ((ulong)(((uint)reverseTable[key & 0xff] << 24) | ((uint)reverseTable[(key >> 8) & 0xff] << 16) | ((uint)reverseTable[(key >> 16) & 0xff] << 8) | ((uint)reverseTable[(key >> 24) & 0xff]))) << 1; } // Bucket storage is abstracted in a simple two-layer tree to avoid too much memory resize Node GetBucket (uint index) { if (index >= buckets.Length) return null; return buckets[index]; } Node SetBucket (uint index, Node node) { try { slim.EnterReadLock (); CheckSegment (index, true); Interlocked.CompareExchange (ref buckets[index], node, null); return buckets[index]; } finally { slim.ExitReadLock (); } } // When we run out of space for bucket storage, we use a lock-based array resize void CheckSegment (uint segment, bool readLockTaken) { if (segment < buckets.Length) return; if (readLockTaken) slim.ExitReadLock (); try { slim.EnterWriteLock (); while (segment >= buckets.Length) Array.Resize (ref buckets, buckets.Length * 2); } finally { slim.ExitWriteLock (); } if (readLockTaken) slim.EnterReadLock (); } Node ListSearch (ulong key, TKey subKey, ref Node left, Node h) { Node leftNodeNext = null, rightNode = null; do { Node t = h; Node tNext = t.Next; do { if (!tNext.Marked) { left = t; leftNodeNext = tNext; } t = tNext.Marked ? tNext.Next : tNext; if (t == tail) break; tNext = t.Next; } while (tNext.Marked || t.Key < key || (tNext.Key == key && !comparer.Equals (subKey, t.SubKey))); rightNode = t; if (leftNodeNext == rightNode) { if (rightNode != tail && rightNode.Next.Marked) continue; else return rightNode; } if (Interlocked.CompareExchange (ref left.Next, rightNode, leftNodeNext) == leftNodeNext) { pool.Release (leftNodeNext); if (rightNode != tail && rightNode.Next.Marked) continue; else return rightNode; } } while (true); } bool ListDelete (Node startPoint, ulong key, TKey subKey, out T data) { Node rightNode = null, rightNodeNext = null, leftNode = null; data = default (T); Node markedNode = null; do { rightNode = ListSearch (key, subKey, ref leftNode, startPoint); if (rightNode == tail || rightNode.Key != key) return false; data = rightNode.Data; rightNodeNext = rightNode.Next; if (!rightNodeNext.Marked) { if (markedNode == null) markedNode = pool.Take (); markedNode.Init (rightNodeNext); if (Interlocked.CompareExchange (ref rightNode.Next, markedNode, rightNodeNext) == rightNodeNext) break; } } while (true); if (Interlocked.CompareExchange (ref leftNode.Next, rightNodeNext, rightNode) != rightNode) ListSearch (rightNode.Key, subKey, ref leftNode, startPoint); else pool.Release (rightNode); return true; } bool ListInsert (Node newNode, Node startPoint, out Node current, Func dataCreator) { ulong key = newNode.Key; Node rightNode = null, leftNode = null; do { rightNode = current = ListSearch (key, newNode.SubKey, ref leftNode, startPoint); if (rightNode != tail && rightNode.Key == key && comparer.Equals (newNode.SubKey, rightNode.SubKey)) return false; newNode.Next = rightNode; if (dataCreator != null) newNode.Data = dataCreator (); if (Interlocked.CompareExchange (ref leftNode.Next, newNode, rightNode) == rightNode) return true; } while (true); } bool ListFind (ulong key, TKey subKey, Node startPoint, out Node data) { Node rightNode = null, leftNode = null; data = null; rightNode = ListSearch (key, subKey, ref leftNode, startPoint); data = rightNode; return rightNode != tail && rightNode.Key == key; } static readonly byte[] reverseTable = { 0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240, 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248, 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244, 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252, 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242, 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250, 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246, 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254, 1, 129, 65, 193, 33, 161, 97, 225, 17, 145, 81, 209, 49, 177, 113, 241, 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249, 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85, 213, 53, 181, 117, 245, 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253, 3, 131, 67, 195, 35, 163, 99, 227, 19, 147, 83, 211, 51, 179, 115, 243, 11, 139, 75, 203, 43, 171, 107, 235, 27, 155, 91, 219, 59, 187, 123, 251, 7, 135, 71, 199, 39, 167, 103, 231, 23, 151, 87, 215, 55, 183, 119, 247, 15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255 }; static readonly byte[] logTable = { 0xFF, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; struct SimpleRwLock { const int RwWait = 1; const int RwWrite = 2; const int RwRead = 4; int rwlock; public void EnterReadLock () { SpinWait sw = new SpinWait (); do { while ((rwlock & (RwWrite | RwWait)) > 0) sw.SpinOnce (); if ((Interlocked.Add (ref rwlock, RwRead) & (RwWait | RwWait)) == 0) return; Interlocked.Add (ref rwlock, -RwRead); } while (true); } public void ExitReadLock () { Interlocked.Add (ref rwlock, -RwRead); } public void EnterWriteLock () { SpinWait sw = new SpinWait (); do { int state = rwlock; if (state < RwWrite) { if (Interlocked.CompareExchange (ref rwlock, RwWrite, state) == state) return; state = rwlock; } // We register our interest in taking the Write lock (if upgradeable it's already done) while ((state & RwWait) == 0 && Interlocked.CompareExchange (ref rwlock, state | RwWait, state) != state) state = rwlock; // Before falling to sleep while (rwlock > RwWait) sw.SpinOnce (); } while (true); } public void ExitWriteLock () { Interlocked.Add (ref rwlock, -RwWrite); } } } #if !NET_4_0 internal struct SpinWait { // The number of step until SpinOnce yield on multicore machine const int step = 10; const int maxTime = 200; static readonly bool isSingleCpu = (Environment.ProcessorCount == 1); int ntime; public void SpinOnce () { ntime += 1; if (isSingleCpu) { // On a single-CPU system, spinning does no good Thread.Sleep (0); } else { if (ntime % step == 0) Thread.Sleep (0); else // Multi-CPU system might be hyper-threaded, let other thread run Thread.SpinWait (Math.Min (ntime, maxTime) << 1); } } } #endif } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Net30/Tuple.cs0000644000175000017500000002364012146506550025460 0ustar00meebeymeebey00000000000000#region (c)2009 Lokad - New BSD license // Copyright (c) Lokad 2009 // Company: http://www.lokad.com // This code is released under the terms of the new BSD licence #endregion #if !NET_4_0 && !SILVERLIGHT && !MONOTOUCH && !XBOX using System; using System.Collections.Generic; using System.Diagnostics; namespace ServiceStack.Net30 { public static class SystemUtil { internal static int GetHashCode(params object[] args) { unchecked { int result = 0; foreach (var o in args) { result = (result * 397) ^ (o != null ? o.GetHashCode() : 0); } return result; } } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] public sealed class ImmutableAttribute : Attribute { } /// /// Helper extensions for tuples /// public static class ExtendTuple { public static Triple Append(this Tuple tuple, T3 item) { return Tuple.From(tuple.Item1, tuple.Item2, item); } public static Quad Append(this Tuple tuple, T4 item) { return Tuple.From(tuple.Item1, tuple.Item2, tuple.Item3, item); } public static void AddTuple(this ICollection> collection, T1 first, T2 second) { collection.Add(Tuple.From(first, second)); } public static void AddTuple(this ICollection> collection, T1 first, T2 second) { collection.Add(Tuple.From(first, second)); } public static void AddTuple(this ICollection> collection, T1 first, T2 second, T3 third) { collection.Add(Tuple.From(first, second, third)); } public static void AddTuple(this ICollection> collection, T1 first, T2 second, T3 third, T4 fourth) { collection.Add(Tuple.From(first, second, third, fourth)); } } [Serializable] [Immutable] public sealed class Pair : Tuple { public Pair(TKey first, TValue second) : base(first, second) {} public TKey Key { get { return Item1; } } public TValue Value { get { return Item2; } } } [Serializable] [Immutable] public sealed class Quad : Tuple { public Quad(T1 first, T2 second, T3 third, T4 fourth) : base(first, second, third, fourth) { } } [Serializable] [Immutable] public sealed class Triple : Tuple { public Triple(T1 first, T2 second, T3 third) : base(first, second, third) { } } [Serializable] [Immutable] [DebuggerDisplay("({Item1},{Item2})")] public class Tuple : IEquatable> { readonly T1 _item1; public T1 Item1 { get { return _item1; } } readonly T2 _item2; public T2 Item2 { get { return _item2; } } public Tuple(T1 first, T2 second) { _item1 = first; _item2 = second; } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) throw new NullReferenceException("obj is null"); if (ReferenceEquals(this, obj)) return true; if (!(obj is Tuple)) return false; return Equals((Tuple)obj); } public override string ToString() { return string.Format("({0},{1})", Item1, Item2); } public bool Equals(Tuple obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; return Equals(obj.Item1, Item1) && Equals(obj.Item2, Item2); } public override int GetHashCode() { return SystemUtil.GetHashCode(Item1, Item2); } public static bool operator ==(Tuple left, Tuple right) { return Equals(left, right); } public static bool operator !=(Tuple left, Tuple right) { return !Equals(left, right); } } [Serializable] [DebuggerDisplay("({Item1},{Item2},{Item3})")] public class Tuple : IEquatable> { readonly T1 _item1; public T1 Item1 { get { return _item1; } } readonly T2 _item2; public T2 Item2 { get { return _item2; } } readonly T3 _item3; public T3 Item3 { get { return _item3; } } public Tuple(T1 first, T2 second, T3 third) { _item1 = first; _item2 = second; _item3 = third; } public override string ToString() { return string.Format("({0},{1},{2})", Item1, Item2, Item3); } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) throw new NullReferenceException("obj is null"); if (ReferenceEquals(this, obj)) return true; if (!(obj is Tuple)) return false; return Equals((Tuple)obj); } public bool Equals(Tuple obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; return Equals(obj.Item1, Item1) && Equals(obj.Item2, Item2) && Equals(obj.Item3, Item3); } public override int GetHashCode() { return SystemUtil.GetHashCode(Item1, Item2, Item3); } public static bool operator ==(Tuple left, Tuple right) { return Equals(left, right); } public static bool operator !=(Tuple left, Tuple right) { return !Equals(left, right); } } [Serializable] [DebuggerDisplay("({Item1},{Item2},{Item3},{Item4})")] [Immutable] public class Tuple : IEquatable> { readonly T1 _item1; public T1 Item1 { get { return _item1; } } readonly T2 _item2; public T2 Item2 { get { return _item2; } } readonly T3 _item3; public T3 Item3 { get { return _item3; } } readonly T4 _item4; public T4 Item4 { get { return _item4; } } public Tuple(T1 first, T2 second, T3 third, T4 fourth) { _item1 = first; _item2 = second; _item3 = third; _item4 = fourth; } public override string ToString() { return string.Format("({0},{1},{2},{3})", Item1, Item2, Item3, Item4); } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) throw new NullReferenceException("obj is null"); if (ReferenceEquals(this, obj)) return true; if (!(obj is Tuple)) return false; return Equals((Tuple)obj); } public bool Equals(Tuple obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; return Equals(obj.Item1, Item1) && Equals(obj.Item2, Item2) && Equals(obj.Item3, Item3) && Equals(obj.Item4, Item4); } public override int GetHashCode() { return SystemUtil.GetHashCode(Item1, Item2, Item3, Item4); } public static bool operator ==(Tuple left, Tuple right) { return Equals(left, right); } public static bool operator !=(Tuple left, Tuple right) { return !Equals(left, right); } } public static class Tuple { public static Pair From(T1 first, T2 second) { return new Pair(first, second); } public static Tuple Create(T1 first, T2 second) { return new Pair(first, second); } public static Triple From(T1 first, T2 second, T3 third) { return new Triple(first, second, third); } public static Tuple Create(T1 first, T2 second, T3 third) { return new Triple(first, second, third); } public static Quad From(T1 first, T2 second, T3 third, T4 fourth) { return new Quad(first, second, third, fourth); } public static Tuple Create(T1 first, T2 second, T3 third, T4 fourth) { return new Quad(first, second, third, fourth); } } } #endif smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ModelConfig.cs0000644000175000017500000000037012146506550025657 0ustar00meebeymeebey00000000000000using System; using ServiceStack.Common.Utils; namespace ServiceStack { public class ModelConfig { public static void Id(Func getIdFn) { IdUtils.CanGetId = getIdFn; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/UrnId.cs0000644000175000017500000001071112146506550024512 0ustar00meebeymeebey00000000000000using System; using System.Text; namespace ServiceStack.Common { /// /// Creates a Unified Resource Name (URN) with the following formats: /// /// - urn:{TypeName}:{IdFieldValue} e.g. urn:UserSession:1 /// - urn:{TypeName}:{IdFieldName}:{IdFieldValue} e.g. urn:UserSession:UserId:1 /// /// public class UrnId { private const char FieldSeperator = ':'; private const char FieldPartsSeperator = '/'; public string TypeName { get; private set; } public string IdFieldValue { get; private set; } public string IdFieldName { get; private set; } const int HasNoIdFieldName = 3; const int HasIdFieldName = 4; private UrnId() { } public static UrnId Parse(string urnId) { var urnParts = urnId.Split(FieldSeperator); if (urnParts.Length == HasNoIdFieldName) { return new UrnId { TypeName = urnParts[1], IdFieldValue = urnParts[2] }; } if (urnParts.Length == HasIdFieldName) { return new UrnId { TypeName = urnParts[1], IdFieldName = urnParts[2], IdFieldValue = urnParts[3] }; } throw new ArgumentException("Cannot parse invalid urn: '{0}'", urnId); } public static string Create(string objectTypeName, string idFieldValue) { if (objectTypeName.Contains(FieldSeperator.ToString())) { throw new ArgumentException("objectTypeName cannot have the illegal characters: ':'", "objectTypeName"); } if (idFieldValue.Contains(FieldSeperator.ToString())) { throw new ArgumentException("idFieldValue cannot have the illegal characters: ':'", "idFieldValue"); } return string.Format("urn:{0}:{1}", objectTypeName, idFieldValue); } public static string CreateWithParts(string objectTypeName, params string[] keyParts) { if (objectTypeName.Contains(FieldSeperator.ToString())) { throw new ArgumentException("objectTypeName cannot have the illegal characters: ':'", "objectTypeName"); } var sb = new StringBuilder(); foreach (var keyPart in keyParts) { if (sb.Length > 0) sb.Append(FieldPartsSeperator); sb.Append(keyPart); } return string.Format("urn:{0}:{1}", objectTypeName, sb); } public static string CreateWithParts(params string[] keyParts) { return CreateWithParts(typeof(T).Name, keyParts); } public static string Create(string idFieldValue) { return Create(typeof(T), idFieldValue); } public static string Create(Type objectType, string idFieldValue) { if (idFieldValue.Contains(FieldSeperator.ToString())) { throw new ArgumentException("idFieldValue cannot have the illegal characters: ':'", "idFieldValue"); } return string.Format("urn:{0}:{1}", objectType.Name, idFieldValue); } public static string Create(string idFieldName, string idFieldValue) { return Create(typeof (T), idFieldName, idFieldValue); } public static string Create(Type objectType, string idFieldName, string idFieldValue) { if (idFieldValue.Contains(FieldSeperator.ToString())) { throw new ArgumentException("idFieldValue cannot have the illegal characters: ':'", "idFieldValue"); } if (idFieldName.Contains(FieldSeperator.ToString())) { throw new ArgumentException("idFieldName cannot have the illegal characters: ':'", "idFieldName"); } return string.Format("urn:{0}:{1}:{2}", objectType.Name, idFieldName, idFieldValue); } public static string GetStringId(string urn) { return Parse(urn).IdFieldValue; } public static Guid GetGuidId(string urn) { return new Guid(Parse(urn).IdFieldValue); } public static long GetLongId(string urn) { return long.Parse(Parse(urn).IdFieldValue); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/TypeExtensions.cs0000644000175000017500000000240712146506550026475 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Reflection; namespace ServiceStack.Common { public static class TypeExtensions { private static readonly Dictionary> TypePropertyNamesMap = new Dictionary>(); public static List GetPropertyNames(this Type type) { lock (TypePropertyNamesMap) { List propertyNames; if (!TypePropertyNamesMap.TryGetValue(type, out propertyNames)) { propertyNames = Extensions.EnumerableExtensions.ConvertAll(type.GetProperties(), x => x.Name); TypePropertyNamesMap[type] = propertyNames; } return propertyNames; } } public static List ToAttributes(this Type type) where T : Attribute { return type.GetCustomAttributes(typeof(T), true).SafeConvertAll(x => (T)x); } #if !SILVERLIGHT public static string GetAssemblyPath(this Type source) { var assemblyUri = new Uri(source.Assembly.EscapedCodeBase); return assemblyUri.LocalPath; } #endif } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/ServiceStack.Common.csproj0000644000175000017500000004362612146506550030214 0ustar00meebeymeebey00000000000000 Debug AnyCPU 9.0.30729 2.0 {982416DB-C143-4028-A0C3-CF41892D18D3} Library Properties ServiceStack.Common ServiceStack.Common 512 3.5 publish\ true Disk false Foreground 7 Days false false true 0 1.0.0.%2a false false true True full False bin\Debug\ DEBUG;TRACE prompt 4 AllRules.ruleset pdbonly True bin\Release\ TRACE prompt 4 AllRules.ruleset bin\Release\ServiceStack.Common.XML True bin\MonoTouch\ DEBUG;TRACE full AnyCPU prompt 4 False AllRules.ruleset True bin\MonoTouch\ TRACE;DEBUG;MONOTOUCH full AnyCPU prompt 4 False AllRules.ruleset Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code False .NET Framework 3.5 SP1 Client Profile false False .NET Framework 3.5 SP1 true False Windows Installer 3.1 true {579B3FDB-CDAD-44E1-8417-885C38E49A0E} ServiceStack.Text {42E1C8C0-A163-44CC-92B1-8F416F2C0B01} ServiceStack.Interfaces smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/StringExtensions.cs0000644000175000017500000001362412146506550027025 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Globalization; using System.Text; using System.Text.RegularExpressions; using ServiceStack.Common.Utils; using ServiceStack.Text; using ServiceStack.Text.Common; namespace ServiceStack.Common { public static class StringExtensions { static readonly Regex RegexSplitCamelCase = new Regex("([A-Z]|[0-9]+)", #if !SILVERLIGHT && !MONOTOUCH && !XBOX RegexOptions.Compiled #else RegexOptions.None #endif ); public static T ToEnum(this string value) { return (T)Enum.Parse(typeof(T), value, true); } public static T ToEnumOrDefault(this string value, T defaultValue) { if (String.IsNullOrEmpty(value)) return defaultValue; return (T)Enum.Parse(typeof(T), value, true); } public static string SplitCamelCase(this string value) { return RegexSplitCamelCase.Replace(value, " $1").TrimStart(); } public static string ToEnglish(this string camelCase) { var ucWords = camelCase.SplitCamelCase().ToLower(); return ucWords[0].ToString(CultureInfo.InvariantCulture).ToUpper() + ucWords.Substring(1); } public static bool IsEmpty(this string value) { return String.IsNullOrEmpty(value); } public static bool IsNullOrEmpty(this string value) { return String.IsNullOrEmpty(value); } public static bool EqualsIgnoreCase(this string value, string other) { return String.Equals(value, other, StringComparison.CurrentCultureIgnoreCase); } public static string ReplaceFirst(this string haystack, string needle, string replacement) { var pos = haystack.IndexOf(needle); if (pos < 0) return haystack; return haystack.Substring(0, pos) + replacement + haystack.Substring(pos + needle.Length); } public static string ReplaceAll(this string haystack, string needle, string replacement) { int pos; // Avoid a possible infinite loop if (needle == replacement) return haystack; while ((pos = haystack.IndexOf(needle)) > 0) { haystack = haystack.Substring(0, pos) + replacement + haystack.Substring(pos + needle.Length); } return haystack; } public static bool ContainsAny(this string text, params string[] testMatches) { foreach (var testMatch in testMatches) { if (text.Contains(testMatch)) return true; } return false; } private static readonly Regex InvalidVarCharsRegEx = new Regex(@"[^A-Za-z0-9]", #if !SILVERLIGHT && !MONOTOUCH && !XBOX RegexOptions.Compiled #else RegexOptions.None #endif ); public static string SafeVarName(this string text) { if (String.IsNullOrEmpty(text)) return null; return InvalidVarCharsRegEx.Replace(text, "_"); } public static string Join(this List items) { return String.Join(JsWriter.ItemSeperatorString, items.ToArray()); } public static string Join(this List items, string delimeter) { return String.Join(delimeter, items.ToArray()); } public static string CombineWith(this string path, params string[] thesePaths) { if (thesePaths.Length == 1 && thesePaths[0] == null) return path; return PathUtils.CombinePaths(new StringBuilder(path.TrimEnd('/','\\')), thesePaths); } public static string ToParentPath(this string path) { var pos = path.LastIndexOf('/'); if (pos == -1) return "/"; var parentPath = path.Substring(0, pos); return parentPath; } public static string RemoveCharFlags(this string text, bool[] charFlags) { if (text == null) return null; var copy = text.ToCharArray(); var nonWsPos = 0; for (var i = 0; i < text.Length; i++) { var @char = text[i]; if (@char < charFlags.Length && charFlags[@char]) continue; copy[nonWsPos++] = @char; } return new String(copy, 0, nonWsPos); } public static string ToNullIfEmpty(this string text) { return String.IsNullOrEmpty(text) ? null : text; } private static char[] SystemTypeChars = new[] { '<', '>', '+' }; public static bool IsUserType(this Type type) { return type.IsClass && type.Namespace != null && !type.Namespace.StartsWith("System.") && type.Name.IndexOfAny(SystemTypeChars) == -1; } public static bool IsInt(this string text) { if (string.IsNullOrEmpty(text)) return false; int ret; return int.TryParse(text, out ret); } public static int ToInt(this string text) { return int.Parse(text); } public static int ToInt(this string text, int defaultValue) { int ret; return int.TryParse(text, out ret) ? ret : defaultValue; } public static long ToInt64(this string text) { return long.Parse(text); } public static long ToInt64(this string text, long defaultValue) { long ret; return long.TryParse(text, out ret) ? ret : defaultValue; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/HostContext.cs0000644000175000017500000000171312146506550025755 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Web; namespace ServiceStack.Common { public class HostContext { public static HostContext Instance = new HostContext(); [ThreadStatic] public static IDictionary items; public virtual IDictionary Items { get { return items ?? (HttpContext.Current != null ? HttpContext.Current.Items : items = new Dictionary()); } set { items = value; } } public T GetOrCreate(Func createFn) { if (Items.Contains(typeof(T).Name)) return (T)Items[typeof(T).Name]; return (T) (Items[typeof(T).Name] = createFn()); } public void EndRequest() { items = null; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Utils/0000755000175000017500000000000012146506550024242 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Utils/IdUtils.cs0000644000175000017500000001102612146506550026146 0ustar00meebeymeebey00000000000000using System; using System.IO; using ServiceStack.Common.Reflection; using ServiceStack.DesignPatterns.Model; namespace ServiceStack.Common.Utils { public static class IdUtils { internal static Func CanGetId; static IdUtils() { #if !SILVERLIGHT && !MONOTOUCH && !XBOX var hasIdInterfaces = typeof(T).FindInterfaces( (t, critera) => t.IsGenericType && t.GetGenericTypeDefinition() == typeof(IHasId<>), null); if (hasIdInterfaces.Length > 0) { CanGetId = HasId.GetId; return; } #endif if (typeof(T).IsClass && typeof(T).GetProperty(IdUtils.IdField) != null && typeof(T).GetProperty(IdUtils.IdField).GetGetMethod() != null) { CanGetId = HasPropertyId.GetId; } else { CanGetId = x => x.GetHashCode(); } } public static object GetId(T entity) { return CanGetId(entity); } } internal static class HasPropertyId { private static readonly Func GetIdFn; static HasPropertyId() { var pi = typeof(TEntity).GetProperty(IdUtils.IdField); GetIdFn = StaticAccessors.ValueUnTypedGetPropertyTypeFn(pi); } public static object GetId(TEntity entity) { return GetIdFn(entity); } } internal static class HasId { private static readonly Func GetIdFn; static HasId() { #if MONOTOUCH || SILVERLIGHT GetIdFn = HasPropertyId.GetId; #else var hasIdInterfaces = typeof(TEntity).FindInterfaces( (t, critera) => t.IsGenericType && t.GetGenericTypeDefinition() == typeof(IHasId<>), null); var genericArg = hasIdInterfaces[0].GetGenericArguments()[0]; var genericType = typeof(HasIdGetter<,>).MakeGenericType(typeof(TEntity), genericArg); var oInstanceParam = System.Linq.Expressions.Expression.Parameter(typeof(TEntity), "oInstanceParam"); var exprCallStaticMethod = System.Linq.Expressions.Expression.Call ( genericType, "GetId", new Type[0], oInstanceParam ); GetIdFn = System.Linq.Expressions.Expression.Lambda> ( exprCallStaticMethod, oInstanceParam ).Compile(); #endif } public static object GetId(TEntity entity) { return GetIdFn(entity); } } internal class HasIdGetter where TEntity : IHasId { public static object GetId(TEntity entity) { return entity.Id; } } public static class IdUtils { public const string IdField = "Id"; public static object GetObjectId(this object entity) { return entity.GetType().GetProperty(IdField).GetGetMethod().Invoke(entity, new object[0]); } public static object GetId(this T entity) { return IdUtils.GetId(entity); } public static string CreateUrn(object id) { return string.Format("urn:{0}:{1}", typeof(T).Name.ToLower(), id); } public static string CreateUrn(Type type, object id) { return string.Format("urn:{0}:{1}", type.Name.ToLower(), id); } public static string CreateUrn(this T entity) { var id = GetId(entity); return string.Format("urn:{0}:{1}", typeof(T).Name.ToLower(), id); } public static string CreateCacheKeyPath(string idValue) { if (idValue.Length < 4) { idValue = idValue.PadLeft(4, '0'); } idValue = idValue.Replace(" ", "-"); var rootDir = typeof(T).Name; var dir1 = idValue.Substring(0, 2); var dir2 = idValue.Substring(2, 2); var path = string.Format("{1}{0}{2}{0}{3}{0}{4}", Path.DirectorySeparatorChar, rootDir, dir1, dir2, idValue); return path; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Utils/ReflectionUtils.cs0000644000175000017500000003711412146506550027712 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Reflection.Emit; using ServiceStack.Common.Support; using ServiceStack.Logging; using ServiceStack.Net30.Collections.Concurrent; namespace ServiceStack.Common.Utils { public class ReflectionUtils { public static readonly ILog Log = LogManager.GetLogger(typeof(ReflectionUtils)); /// /// Populate an object with Example data. /// /// /// public static object PopulateObject(object obj) { if (obj == null) return null; return PopulateObjectInternal(obj, new Dictionary(20)); } /// /// Populates the object with example data. /// /// /// Tracks how deeply nested we are /// private static object PopulateObjectInternal(object obj, Dictionary recursionInfo) { if (obj == null) return null; if (obj is string) return obj; // prevents it from dropping into the char[] Chars property. Sheesh var members = obj.GetType().GetMembers(BindingFlags.Public | BindingFlags.Instance); foreach (var info in members) { var fieldInfo = info as FieldInfo; var propertyInfo = info as PropertyInfo; if (fieldInfo != null || propertyInfo != null) { var memberType = fieldInfo != null ? fieldInfo.FieldType : propertyInfo.PropertyType; var value = CreateDefaultValue(memberType, recursionInfo); SetValue(fieldInfo, propertyInfo, obj, value); } } return obj; } private static readonly Dictionary DefaultValueTypes = new Dictionary(); public static object GetDefaultValue(Type type) { if (!type.IsValueType) return null; object defaultValue; lock (DefaultValueTypes) { if (!DefaultValueTypes.TryGetValue(type, out defaultValue)) { defaultValue = Activator.CreateInstance(type); DefaultValueTypes[type] = defaultValue; } } return defaultValue; } private static readonly ConcurrentDictionary AssignmentDefinitionCache = new ConcurrentDictionary(); public static AssignmentDefinition GetAssignmentDefinition(Type toType, Type fromType) { var cacheKey = toType.FullName + "<" + fromType.FullName; return AssignmentDefinitionCache.GetOrAdd(cacheKey, delegate { var definition = new AssignmentDefinition { ToType = toType, FromType = fromType, }; var members = fromType.GetMembers(BindingFlags.Public | BindingFlags.Instance); foreach (var info in members) { var fromPropertyInfo = info as PropertyInfo; if (fromPropertyInfo != null) { var toPropertyInfo = GetPropertyInfo(toType, fromPropertyInfo.Name); if (toPropertyInfo == null) continue; if (!fromPropertyInfo.CanRead) continue; if (!toPropertyInfo.CanWrite) continue; definition.AddMatch(fromPropertyInfo, toPropertyInfo); } var fromFieldInfo = info as FieldInfo; if (fromFieldInfo != null) { var toFieldInfo = GetFieldInfo(toType, fromFieldInfo.Name); if (toFieldInfo == null) continue; definition.AddMatch(fromFieldInfo, toFieldInfo); } } return definition; }); } public static To PopulateObject(To to, From from) { if (Equals(to, default(To)) || Equals(from, default(From))) return default(To); var assignmentDefinition = GetAssignmentDefinition(to.GetType(), from.GetType()); assignmentDefinition.Populate(to, from); return to; } public static To PopulateWithNonDefaultValues(To to, From from) { if (Equals(to, default(To)) || Equals(from, default(From))) return default(To); var assignmentDefinition = GetAssignmentDefinition(to.GetType(), from.GetType()); assignmentDefinition.PopulateWithNonDefaultValues(to, from); return to; } public static To PopulateFromPropertiesWithAttribute(To to, From from, Type attributeType) { if (Equals(to, default(To)) || Equals(from, default(From))) return default(To); var assignmentDefinition = GetAssignmentDefinition(to.GetType(), from.GetType()); assignmentDefinition.PopulateFromPropertiesWithAttribute(to, from, attributeType); return to; } public static void SetProperty(object obj, PropertyInfo propertyInfo, object value) { if (!propertyInfo.CanWrite) { Log.WarnFormat("Attempted to set read only property '{0}'", propertyInfo.Name); return; } var propertySetMetodInfo = propertyInfo.GetSetMethod(); if (propertySetMetodInfo != null) { propertySetMetodInfo.Invoke(obj, new[] { value }); } } public static object GetProperty(object obj, PropertyInfo propertyInfo) { if (propertyInfo == null || !propertyInfo.CanRead) return null; var getMethod = propertyInfo.GetGetMethod(); return getMethod != null ? getMethod.Invoke(obj, new object[0]) : null; } public static void SetValue(FieldInfo fieldInfo, PropertyInfo propertyInfo, object obj, object value) { try { if (IsUnsettableValue(fieldInfo, propertyInfo)) return; if (fieldInfo != null && !fieldInfo.IsLiteral) { fieldInfo.SetValue(obj, value); } else { SetProperty(obj, propertyInfo, value); } } catch (Exception ex) { var name = (fieldInfo != null) ? fieldInfo.Name : propertyInfo.Name; Log.DebugFormat("Could not set member: {0}. Error: {1}", name, ex.Message); } } public static bool IsUnsettableValue(FieldInfo fieldInfo, PropertyInfo propertyInfo) { if (propertyInfo != null && propertyInfo.ReflectedType != null) { // Properties on non-user defined classes should not be set // Currently we define those properties as properties declared on // types defined in mscorlib if (propertyInfo.DeclaringType.Assembly == typeof(object).Assembly) { return true; } } return false; } public static object[] CreateDefaultValues(IEnumerable types, Dictionary recursionInfo) { var values = new List(); foreach (var type in types) { values.Add(CreateDefaultValue(type, recursionInfo)); } return values.ToArray(); } private const int MaxRecursionLevelForDefaultValues = 2; // do not nest a single type more than this deep. public static object CreateDefaultValue(Type type, Dictionary recursionInfo) { if (type == typeof(string)) { return type.Name; } if (type.IsEnum) { #if SILVERLIGHT4 return Enum.ToObject(type, 0); #else return Enum.GetValues(type).GetValue(0); #endif } // If we have hit our recursion limit for this type, then return null int recurseLevel; // will get set to 0 if TryGetValue() fails recursionInfo.TryGetValue(type, out recurseLevel); if (recurseLevel > MaxRecursionLevelForDefaultValues) return null; recursionInfo[type] = recurseLevel + 1; // increase recursion level for this type try // use a try/finally block to make sure we decrease the recursion level for this type no matter which code path we take, { //when using KeyValuePair, TKey must be non-default to stuff in a Dictionary if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) { var genericTypes = type.GetGenericArguments(); var valueType = Activator.CreateInstance(type, CreateDefaultValue(genericTypes[0], recursionInfo), CreateDefaultValue(genericTypes[1], recursionInfo)); return PopulateObjectInternal(valueType, recursionInfo); } if (type.IsValueType) { return Activator.CreateInstance(type); } if (type.IsArray) { return PopulateArray(type, recursionInfo); } var constructorInfo = type.GetConstructor(Type.EmptyTypes); var hasEmptyConstructor = constructorInfo != null; if (hasEmptyConstructor) { var value = constructorInfo.Invoke(new object[0]); #if !SILVERLIGHT && !MONOTOUCH && !XBOX Type[] interfaces = type.FindInterfaces((t, critera) => t.IsGenericType && t.GetGenericTypeDefinition() == typeof(ICollection<>) , null); bool isGenericCollection = interfaces.Length > 0; if (isGenericCollection) { SetGenericCollection(interfaces[0], value, recursionInfo); } #endif //when the object might have nested properties such as enums with non-0 values, etc return PopulateObjectInternal(value, recursionInfo); } return null; } finally { recursionInfo[type] = recurseLevel; } } public static void SetGenericCollection(Type realisedListType, object genericObj, Dictionary recursionInfo) { var args = realisedListType.GetGenericArguments(); if (args.Length != 1) { Log.ErrorFormat("Found a generic list that does not take one generic argument: {0}", realisedListType); return; } var methodInfo = realisedListType.GetMethod("Add"); if (methodInfo != null) { var argValues = CreateDefaultValues(args, recursionInfo); methodInfo.Invoke(genericObj, argValues); } } public static Array PopulateArray(Type type, Dictionary recursionInfo) { var elementType = type.GetElementType(); var objArray = Array.CreateInstance(elementType, 1); var objElementType = CreateDefaultValue(elementType, recursionInfo); objArray.SetValue(objElementType, 0); return objArray; } //TODO: replace with InAssignableFrom public static bool CanCast(Type toType, Type fromType) { if (toType.IsInterface) { var interfaceList = fromType.GetInterfaces().ToList(); if (interfaceList.Contains(toType)) return true; } else { Type baseType = fromType; bool areSameTypes; do { areSameTypes = baseType == toType; } while (!areSameTypes && (baseType = fromType.BaseType) != null); if (areSameTypes) return true; } return false; } public static MemberInfo GetMemberInfo(Type fromType, string memberName) { var baseType = fromType; do { var members = baseType.GetMembers(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); foreach (var memberInfo in members) { if (memberInfo.Name == memberName) return memberInfo; } } while ((baseType = baseType.BaseType) != null); return null; } public static FieldInfo GetFieldInfo(Type fromType, string fieldName) { var baseType = fromType; do { var fieldInfos = baseType.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); foreach (var fieldInfo in fieldInfos) { if (fieldInfo.Name == fieldName) return fieldInfo; } } while ((baseType = baseType.BaseType) != null); return null; } public static PropertyInfo GetPropertyInfo(Type fromType, string propertyName) { var baseType = fromType; do { var propertyInfos = baseType.GetProperties(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); foreach (var propertyInfo in propertyInfos) { if (propertyInfo.Name == propertyName) return propertyInfo; } } while ((baseType = baseType.BaseType) != null); return null; } public static IEnumerable> GetPropertyAttributes(Type fromType) where T : Attribute { var attributeType = typeof(T); var baseType = fromType; do { var propertyInfos = baseType.GetProperties(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); foreach (var propertyInfo in propertyInfos) { var attributes = propertyInfo.GetCustomAttributes(attributeType, true); foreach (T attribute in attributes) { yield return new KeyValuePair(propertyInfo, attribute); } } } while ((baseType = baseType.BaseType) != null); } public static object CreateInstance(Type type) { return Text.ReflectionExtensions.CreateInstance(type); } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Utils/PerfUtils.cs0000644000175000017500000000132012146506550026502 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System; using System.Diagnostics; namespace ServiceStack.Common.Utils { public static class PerfUtils { public static TimeSpan ToTimeSpan(this long fromTicks) { return TimeSpan.FromSeconds(fromTicks * 1d / Stopwatch.Frequency); } public static long Measure(long iterations, Action action) { GC.Collect(); var begin = Stopwatch.GetTimestamp(); for (var i = 0; i < iterations; i++) { action(); } var end = Stopwatch.GetTimestamp(); return (end - begin); } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Utils/FuncUtils.cs0000644000175000017500000000237312146506550026512 0ustar00meebeymeebey00000000000000using System; using ServiceStack.Logging; namespace ServiceStack.Common.Utils { public static class FuncUtils { private static readonly ILog Log = LogManager.GetLogger(typeof(FuncUtils)); /// /// Invokes the action provided and returns true if no excpetion was thrown. /// Otherwise logs the exception and returns false if an exception was thrown. /// /// The action. /// public static bool TryExec(Action action) { try { action(); return true; } catch (Exception ex) { Log.Error(ex.Message, ex); } return false; } public static T TryExec(Func func) { return TryExec(func, default(T)); } public static T TryExec(Func func, T defaultValue) { try { return func(); } catch (Exception ex) { Log.Error(ex.Message, ex); } return default(T); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Utils/AssertUtils.cs0000644000175000017500000000212312146506550027051 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.Common.Utils { public static class AssertUtils { public static void AreNotNull(params T[] fields) where T : class { foreach (var field in fields) { if (field == null) { throw new ArgumentNullException(typeof(T).Name); } } } /// /// Asserts that the supplied arguments are not null. /// /// AssertUtils.AreNotNull(new Dictionary{ {"name",null} }); /// will throw new ArgumentNullException("name"); /// /// The field map. public static void AreNotNull(IDictionary fieldMap) { foreach (var pair in fieldMap) { if (pair.Value == null) { throw new ArgumentNullException(pair.Key); } } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Utils/CommandsUtils.cs0000644000175000017500000000724612146506550027364 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Threading; using ServiceStack.Common.Support; using ServiceStack.DesignPatterns.Command; namespace ServiceStack.Common.Utils { public class CommandsUtils { public static List ExecuteAsyncCommandList(TimeSpan timeout, params ICommandList[] commands) { return ExecuteAsyncCommandList(timeout, commands); } public static List ExecuteAsyncCommandList(TimeSpan timeout, IEnumerable> commands) { var results = new List(); var waitHandles = new List(); foreach (ICommandList command in commands) { var waitHandle = new AutoResetEvent(false); waitHandles.Add(waitHandle); var commandResultsHandler = new CommandResultsHandler(results, command, waitHandle); ThreadPool.QueueUserWorkItem(ExecuteCommandList, commandResultsHandler); } WaitAll(waitHandles.ToArray(), timeout); return results; } public static void WaitAll(WaitHandle[] waitHandles, TimeSpan timeout) { // throws an exception if there are no wait handles if (waitHandles != null && waitHandles.Length > 0) { #if !SILVERLIGHT && !MONOTOUCH && !XBOX if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA) { // WaitAll for multiple handles on an STA thread is not supported. // CurrentThread is ApartmentState.STA when run under unit tests foreach (WaitHandle waitHandle in waitHandles) { waitHandle.WaitOne(timeout, false); } } else { if (!WaitHandle.WaitAll(waitHandles, timeout, false)) { throw new TimeoutException(); } } #else if (!WaitHandle.WaitAll(waitHandles, timeout)) { throw new TimeoutException(); } #endif } } private static void ExecuteCommandList(object state) { var handler = (ICommandExec)state; handler.Execute(); } private static void ExecuteCommandExec(object state) { var command = (ICommandExec)state; command.Execute(); } public static void ExecuteAsyncCommandExec(TimeSpan timeout, IEnumerable commands) { foreach (ICommandExec command in commands) { ThreadPool.QueueUserWorkItem(ExecuteCommandExec, command); } } /// /// Provide the an option for the callee to block until all commands are executed /// /// /// public static List ExecuteAsyncCommandExec(IEnumerable commands) { var waitHandles = new List(); foreach (var command in commands) { var waitHandle = new AutoResetEvent(false); waitHandles.Add(waitHandle); var commandExecsHandler = new CommandExecsHandler(command, waitHandle); ThreadPool.QueueUserWorkItem(ExecuteCommandList, commandExecsHandler); } return waitHandles; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Utils/PathUtils.cs0000644000175000017500000000620012146506550026504 0ustar00meebeymeebey00000000000000using System; using System.IO; using System.Text; namespace ServiceStack.Common.Utils { public static class PathUtils { public static string MapAbsolutePath(string relativePath, string appendPartialPathModifier) { #if !SILVERLIGHT if (relativePath.StartsWith("~")) { var assemblyDirectoryPath = Path.GetDirectoryName(new Uri(typeof(PathUtils).Assembly.EscapedCodeBase).LocalPath); // Escape the assembly bin directory to the hostname directory var hostDirectoryPath = appendPartialPathModifier != null ? assemblyDirectoryPath + appendPartialPathModifier : assemblyDirectoryPath; return Path.GetFullPath(relativePath.Replace("~", hostDirectoryPath)); } #endif return relativePath; } /// /// Maps the path of a file in the context of a VS project /// /// the relative path /// the absolute path /// Assumes static content is two directories above the /bin/ directory, /// eg. in a unit test scenario the assembly would be in /bin/Debug/. public static string MapProjectPath(this string relativePath) { var mapPath = MapAbsolutePath(relativePath, string.Format("{0}..{0}..", Path.DirectorySeparatorChar)); return mapPath; } /// /// Maps the path of a file in a self-hosted scenario /// /// the relative path /// the absolute path /// Assumes static content is copied to /bin/ folder with the assemblies public static string MapAbsolutePath(this string relativePath) { var mapPath = MapAbsolutePath(relativePath, null); return mapPath; } /// /// Maps the path of a file in an Asp.Net hosted scenario /// /// the relative path /// the absolute path /// Assumes static content is in the parent folder of the /bin/ directory public static string MapHostAbsolutePath(this string relativePath) { var mapPath = MapAbsolutePath(relativePath, string.Format("{0}..", Path.DirectorySeparatorChar)); return mapPath; } internal static string CombinePaths(StringBuilder sb, params string[] paths) { foreach (var path in paths) { if (sb.Length > 0) sb.Append("/"); sb.Append(path.TrimStart('/', '\\')); } return sb.ToString(); } public static string CombinePaths(params string[] paths) { return CombinePaths(new StringBuilder(), paths); } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/DictionaryExtensions.cs0000644000175000017500000000356312146506550027665 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using ServiceStack.Common.Extensions; namespace ServiceStack.Common { public static class DictionaryExtensions { public static TValue GetValueOrDefault(this Dictionary dictionary, TKey key) { return dictionary.ContainsKey(key) ? dictionary[key] : default(TValue); } public static void ForEach(this Dictionary dictionary, Action onEachFn) { foreach (var entry in dictionary) { onEachFn(entry.Key, entry.Value); } } public static bool EquivalentTo(this IDictionary thisMap, IDictionary otherMap) { if (thisMap == null || otherMap == null) return thisMap == otherMap; if (thisMap.Count != otherMap.Count) return false; foreach (var entry in thisMap) { V otherValue; if (!otherMap.TryGetValue(entry.Key, out otherValue)) return false; if (!Equals(entry.Value, otherValue)) return false; } return true; } public static List ConvertAll(IDictionary map, Func createFn) { var list = new List(); map.ForEach((kvp) => list.Add(createFn(kvp.Key, kvp.Value))); return list; } public static V GetOrAdd(this Dictionary map, K key, Func createFn) { //simulate ConcurrentDictionary.GetOrAdd lock (map) { V val; if (!map.TryGetValue(key, out val)) map[key] = val = createFn(key); return val; } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Extensions/0000755000175000017500000000000012146506550025301 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Extensions/ITranslatorExtensions.cs0000644000175000017500000000115012146506550032147 0ustar00meebeymeebey00000000000000using System.Collections.Generic; using ServiceStack.DesignPatterns.Translator; namespace ServiceStack.Common.Extensions { public static class TranslatorExtensions { // Methods public static List ParseAll(this ITranslator translator, IEnumerable from) { var list = new List(); if (from != null) { foreach (var local in from) { list.Add(translator.Parse(local)); } } return list; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Extensions/CollectionExtensions.cs0000644000175000017500000000126312146506550032005 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; using Proxy = ServiceStack.Common; namespace ServiceStack.Common.Extensions { public static class CollectionExtensions { public static bool IsEmpty(this ICollection collection) { return collection == null || collection.Count == 0; } public static List ConvertAll(this ICollection items, Func converter) { var list = new List(); foreach (var item in items) { list.Add(converter(item)); } return list; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Extensions/ByteArrayExtensions.cs0000644000175000017500000000044512146506550031615 0ustar00meebeymeebey00000000000000using Proxy = ServiceStack.Common.ByteArrayExtensions; namespace ServiceStack.Common.Extensions { public static class ByteArrayExtensions { public static bool AreEqual(this byte[] b1, byte[] b2) { return Proxy.AreEqual(b1, b2); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Extensions/AssertExtensions.cs0000644000175000017500000000311712146506550031153 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; using Proxy = ServiceStack.Common.AssertExtensions; namespace ServiceStack.Common.Extensions { public static class AssertExtensions { public static void ThrowOnFirstNull(params object[] objs) { Proxy.ThrowOnFirstNull(objs); } public static void ThrowIfNull(this object obj) { Proxy.ThrowIfNull(obj); } public static void ThrowIfNull(this object obj, string varName) { Proxy.ThrowIfNull(obj, varName); } public static void ThrowIfNullOrEmpty(this string strValue) { Proxy.ThrowIfNullOrEmpty(strValue); } public static void ThrowIfNullOrEmpty(this string strValue, string varName) { Proxy.ThrowIfNullOrEmpty(strValue, varName); } public static void ThrowIfNullOrEmpty(this ICollection collection) { Proxy.ThrowIfNullOrEmpty(collection); } public static void ThrowIfNullOrEmpty(this ICollection collection, string varName) { Proxy.ThrowIfNullOrEmpty(collection, varName); } public static void ThrowIfNullOrEmpty(this ICollection collection) { Proxy.ThrowIfNullOrEmpty(collection); } public static void ThrowIfNullOrEmpty(this ICollection collection, string varName) { Proxy.ThrowIfNullOrEmpty(collection, varName); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Extensions/EnumerableExtensions.cs0000644000175000017500000000722312146506550031773 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; using Proxy = ServiceStack.Common.EnumerableExtensions; namespace ServiceStack.Common.Extensions { /// /// These extensions have a potential to conflict with the LINQ extensions methods so /// leaving the implmentation in the 'Extensions' sub-namespace to force explicit opt-in /// public static class EnumerableExtensions { public static void ForEach(this IEnumerable values, Action action) { foreach (var value in values) { action(value); } } public static List ConvertAll(this IEnumerable items, Func converter) { var list = new List(); foreach (var item in items) { list.Add(converter(item)); } return list; } public static object First(this IEnumerable items) { foreach (var item in items) { return item; } return null; } public static List ToList(this IEnumerable items) { var list = new List(); foreach (var item in items) { list.Add((To)item); } return list; } public static List ConvertAll(this IEnumerable items, Func converter) { var list = new List(); foreach (var item in items) { list.Add(converter(item)); } return list; } public static HashSet ToHashSet(this IEnumerable items) { return Proxy.ToHashSet(items); } public static List SafeConvertAll(this IEnumerable items, Func converter) { return Proxy.SafeConvertAll(items, converter); } public static List ToObjects(this IEnumerable items) { var to = new List(); foreach (var item in items) { to.Add(item); } return to; } public static string FirstNonDefaultOrEmpty(this IEnumerable values) { foreach (var value in values) { if (!string.IsNullOrEmpty(value)) return value; } return null; } public static T FirstNonDefault(this IEnumerable values) { foreach (var value in values) { if (!Equals(value, default(T))) return value; } return default(T); } public static bool EquivalentTo(this IEnumerable thisList, IEnumerable otherList) { if (thisList == null || otherList == null) return thisList == otherList; var otherEnum = otherList.GetEnumerator(); foreach (var item in thisList) { if (!otherEnum.MoveNext()) return false; var thisIsDefault = Equals(item, default(T)); var otherIsDefault = Equals(otherEnum.Current, default(T)); if (thisIsDefault || otherIsDefault) { return thisIsDefault && otherIsDefault; } if (!item.Equals(otherEnum.Current)) return false; } var hasNoMoreLeftAsWell = !otherEnum.MoveNext(); return hasNoMoreLeftAsWell; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Extensions/ActionExecExtensions.cs0000644000175000017500000000313412146506550031733 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Threading; using Proxy = ServiceStack.Common.ActionExecExtensions; namespace ServiceStack.Common.Extensions { public static class ExtensionsProxy { public static void ExecAllAndWait(this ICollection actions, TimeSpan timeout) { Proxy.ExecAllAndWait(actions, timeout); } public static List ExecAsync(this IEnumerable actions) { return Proxy.ExecAsync(actions); } public static bool WaitAll(this List waitHandles, int timeoutMs) { return Proxy.WaitAll(waitHandles, timeoutMs); } public static bool WaitAll(this ICollection waitHandles, int timeoutMs) { return Proxy.WaitAll(waitHandles, timeoutMs); } public static bool WaitAll(this ICollection waitHandles, TimeSpan timeout) { return Proxy.WaitAll(waitHandles, timeout); } #if !SILVERLIGHT && !MONOTOUCH && !XBOX public static bool WaitAll(this List asyncResults, TimeSpan timeout) { return Proxy.WaitAll(asyncResults, timeout); } #endif public static bool WaitAll(WaitHandle[] waitHandles, TimeSpan timeout) { return Proxy.WaitAll(waitHandles, timeout); } public static bool WaitAll(WaitHandle[] waitHandles, int timeOutMs) { return Proxy.WaitAll(waitHandles, timeOutMs); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Extensions/ReflectionExtensions.cs0000644000175000017500000000361112146506550032003 0ustar00meebeymeebey00000000000000using System; using System.Reflection; using Proxy = ServiceStack.Common.ReflectionExtensions; namespace ServiceStack.Common.Extensions { public static class ReflectionExtensions { public static To PopulateWith(this To to, From from) { return Proxy.PopulateWith(to, from); } public static To PopulateWithNonDefaultValues(this To to, From from) { return Proxy.PopulateWithNonDefaultValues(to, from); } public static To PopulateFromPropertiesWithAttribute(this To to, From from) { return Proxy.PopulateFromPropertiesWithAttribute(to, from); } public static T TranslateTo(this object from) where T : new() { return Proxy.TranslateTo(from); } public static TAttribute FirstAttribute(this Type type) { return Proxy.FirstAttribute(type); } public static TAttribute FirstAttribute(this Type type, bool inherit) { return Proxy.FirstAttribute(type, inherit); } public static TAttribute FirstAttribute(this PropertyInfo propertyInfo) { return Proxy.FirstAttribute(propertyInfo); } public static TAttribute FirstAttribute(this PropertyInfo propertyInfo, bool inherit) { return Proxy.FirstAttribute(propertyInfo, inherit); } public static bool IsGenericType(this Type type) { return Proxy.IsGenericType(type); } public static Type FirstGenericTypeDefinition(this Type type) { return Proxy.FirstGenericTypeDefinition(type); } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Extensions/IntExtensions.cs0000644000175000017500000000232412146506550030443 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using Proxy = ServiceStack.Common.IntExtensions; namespace ServiceStack.Common.Extensions { public static class IntExtensions { public static IEnumerable Times(this int times) { return Proxy.Times(times); } public static void Times(this int times, Action actionFn) { Proxy.Times(times, actionFn); } public static void Times(this int times, Action actionFn) { Proxy.Times(times, actionFn); } public static List TimesAsync(this int times, Action actionFn) { return Proxy.TimesAsync(times, actionFn); } public static List TimesAsync(this int times, Action actionFn) { return Proxy.TimesAsync(times, actionFn); } public static List Times(this int times, Func actionFn) { return Proxy.Times(times, actionFn); } public static List Times(this int times, Func actionFn) { return Proxy.Times(times, actionFn); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Extensions/StringExtensions.cs0000644000175000017500000000604412146506550031162 0ustar00meebeymeebey00000000000000using System.Collections.Generic; using Proxy = ServiceStack.Common.StringExtensions; namespace ServiceStack.Common.Extensions { public static class StringExtensions { public static T ToEnum(this string value) { return Proxy.ToEnum(value); } public static T ToEnumOrDefault(this string value, T defaultValue) { return Proxy.ToEnumOrDefault(value, defaultValue); } public static string SplitCamelCase(this string value) { return Proxy.SplitCamelCase(value); } public static string ToEnglish(this string camelCase) { return Proxy.ToEnglish(camelCase); } public static bool IsEmpty(this string value) { return Proxy.IsEmpty(value); } public static bool IsNullOrEmpty(this string value) { return Proxy.IsNullOrEmpty(value); } public static bool EqualsIgnoreCase(this string value, string other) { return Proxy.EqualsIgnoreCase(value, other); } public static string ReplaceFirst(this string haystack, string needle, string replacement) { return Proxy.ReplaceFirst(haystack, needle, replacement); } public static string ReplaceAll(this string haystack, string needle, string replacement) { return Proxy.ReplaceAll(haystack, needle, replacement); } public static bool ContainsAny(this string text, params string[] testMatches) { return Proxy.ContainsAny(text, testMatches); } public static string SafeVarName(this string text) { return Proxy.SafeVarName(text); } public static string Join(this List items) { return Proxy.Join(items); } public static string Join(this List items, string delimeter) { return Proxy.Join(items, delimeter); } public static bool Glob(this string value, string pattern) { int pos; for (pos = 0; pattern.Length != pos; pos++) { switch (pattern[pos]) { case '?': break; case '*': for (int i = value.Length; i >= pos; i--) { if (Glob(value.Substring(i), pattern.Substring(pos + 1))) return true; } return false; default: if (value.Length == pos || char.ToUpper(pattern[pos]) != char.ToUpper(value[pos])) { return false; } break; } } return value.Length == pos; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/Extensions/DictionaryExtensions.cs0000644000175000017500000000173212146506550032020 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using Proxy = ServiceStack.Common.DictionaryExtensions; namespace ServiceStack.Common.Extensions { public static class DictionaryExtensions { public static TValue GetValueOrDefault(this Dictionary dictionary, TKey key) { return Proxy.GetValueOrDefault(dictionary, key); } public static void ForEach(this Dictionary dictionary, Action onEachFn) { Proxy.ForEach(dictionary, onEachFn); } public static bool EquivalentTo(this IDictionary thisMap, IDictionary otherMap) { return Proxy.EquivalentTo(thisMap, otherMap); } public static List ConvertAll(IDictionary map, Func createFn) { return Proxy.ConvertAll(map, createFn); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Common/IPAddressExtensions.cs0000644000175000017500000001450012146506550027367 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; using ServiceStack.Logging; namespace ServiceStack.Common.Extensions { /// /// Useful IPAddressExtensions from: /// http://blogs.msdn.com/knom/archive/2008/12/31/ip-address-calculations-with-c-subnetmasks-networks.aspx /// /// public static class IPAddressExtensions { public static IPAddress GetBroadcastAddress(this IPAddress address, IPAddress subnetMask) { var ipAdressBytes = address.GetAddressBytes(); var subnetMaskBytes = subnetMask.GetAddressBytes(); if (ipAdressBytes.Length != subnetMaskBytes.Length) throw new ArgumentException("Lengths of IP address and subnet mask do not match."); var broadcastAddress = new byte[ipAdressBytes.Length]; for (var i = 0; i < broadcastAddress.Length; i++) { broadcastAddress[i] = (byte)(ipAdressBytes[i] | (subnetMaskBytes[i] ^ 255)); } return new IPAddress(broadcastAddress); } public static IPAddress GetNetworkAddress(this IPAddress address, IPAddress subnetMask) { var ipAdressBytes = address.GetAddressBytes(); var subnetMaskBytes = subnetMask.GetAddressBytes(); return new IPAddress(GetNetworkAddressBytes(ipAdressBytes, subnetMaskBytes)); } public static byte[] GetNetworkAddressBytes(byte[] ipAdressBytes, byte[] subnetMaskBytes) { if (ipAdressBytes.Length != subnetMaskBytes.Length) throw new ArgumentException("Lengths of IP address and subnet mask do not match."); var broadcastAddress = new byte[ipAdressBytes.Length]; for (var i = 0; i < broadcastAddress.Length; i++) { broadcastAddress[i] = (byte)(ipAdressBytes[i] & (subnetMaskBytes[i])); } return broadcastAddress; } public static bool IsInSameIpv6Subnet(this IPAddress address2, IPAddress address) { if (address2.AddressFamily != AddressFamily.InterNetworkV6 || address.AddressFamily != AddressFamily.InterNetworkV6) { throw new ArgumentException("Both IPAddress must be IPV6 addresses"); } var address1Bytes = address.GetAddressBytes(); var address2Bytes = address2.GetAddressBytes(); return IsInSameIpv6Subnet(address1Bytes, address2Bytes); } public static bool IsInSameIpv6Subnet(this byte[] address1Bytes, byte[] address2Bytes) { if (address1Bytes.Length != address2Bytes.Length) throw new ArgumentException("Lengths of IP addresses do not match."); for (var i = 0; i < 8; i++) { if (address1Bytes[i] != address2Bytes[i]) { return false; } } return true; } public static bool IsInSameIpv4Subnet(this IPAddress address2, IPAddress address, IPAddress subnetMask) { if (address2.AddressFamily != AddressFamily.InterNetwork || address.AddressFamily != AddressFamily.InterNetwork) { throw new ArgumentException("Both IPAddress must be IPV4 addresses"); } var network1 = address.GetNetworkAddress(subnetMask); var network2 = address2.GetNetworkAddress(subnetMask); return network1.Equals(network2); } public static bool IsInSameIpv4Subnet(this byte[] address1Bytes, byte[] address2Bytes, byte[] subnetMaskBytes) { if (address1Bytes.Length != address2Bytes.Length) throw new ArgumentException("Lengths of IP addresses do not match."); var network1Bytes = GetNetworkAddressBytes(address1Bytes, subnetMaskBytes); var network2Bytes = GetNetworkAddressBytes(address2Bytes, subnetMaskBytes); return network1Bytes.AreEqual(network2Bytes); } /// /// Gets the ipv4 addresses from all Network Interfaces that have Subnet masks. /// /// public static Dictionary GetAllNetworkInterfaceIpv4Addresses() { var map = new Dictionary(); try { #if !SILVERLIGHT foreach (var ni in NetworkInterface.GetAllNetworkInterfaces()) { foreach (var uipi in ni.GetIPProperties().UnicastAddresses) { if (uipi.Address.AddressFamily != AddressFamily.InterNetwork) continue; if (uipi.IPv4Mask == null) continue; //ignore 127.0.0.1 map[uipi.Address] = uipi.IPv4Mask; } } #endif } catch /*(NotImplementedException ex)*/ { //log.Warn("MONO does not support NetworkInterface.GetAllNetworkInterfaces(). Could not detect local ip subnets.", ex); } return map; } /// /// Gets the ipv6 addresses from all Network Interfaces. /// /// public static List GetAllNetworkInterfaceIpv6Addresses() { var list = new List(); try { #if !SILVERLIGHT foreach (var ni in NetworkInterface.GetAllNetworkInterfaces()) { foreach (var uipi in ni.GetIPProperties().UnicastAddresses) { if (uipi.Address.AddressFamily != AddressFamily.InterNetworkV6) continue; list.Add(uipi.Address); } } #endif } catch /*(NotImplementedException ex)*/ { //log.Warn("MONO does not support NetworkInterface.GetAllNetworkInterfaces(). Could not detect local ip subnets.", ex); } return list; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/0000755000175000017500000000000012311344240023763 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/0000755000175000017500000000000012146506551025713 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/IMessageQueueClient.cs0000644000175000017500000000235412146506551032107 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Messaging { public interface IMessageQueueClient : IMessageProducer { /// /// Publish the specified message into the durable queue @queueName /// /// /// void Publish(string queueName, byte[] messageBytes); /// /// Publish the specified message into the transient queue @queueName /// /// /// void Notify(string queueName, byte[] messageBytes); /// /// Synchronous blocking get. /// /// /// /// byte[] Get(string queueName, TimeSpan? timeOut); /// /// Non blocking get message /// /// /// byte[] GetAsync(string queueName); /// /// Blocking wait for notifications on any of the supplied channels /// /// /// string WaitForNotifyOnAny(params string[] channelNames); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/UnRetryableMessagingException.cs0000644000175000017500000000143512146506551034216 0ustar00meebeymeebey00000000000000using System; using System.Runtime.Serialization; namespace ServiceStack.Messaging { /// /// For messaging exceptions that should by-pass the messaging service's configured /// retry attempts and store the message straight into the DLQ /// public class UnRetryableMessagingException : MessagingException { public UnRetryableMessagingException() { } public UnRetryableMessagingException(string message) : base(message) { } public UnRetryableMessagingException(string message, Exception innerException) : base(message, innerException) { } #if !SILVERLIGHT && !MONOTOUCH && !XBOX protected UnRetryableMessagingException(SerializationInfo info, StreamingContext context) : base(info, context) { } #endif } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/IMessageFactory.cs0000644000175000017500000000025412146506551031270 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Messaging { public interface IMessageFactory : IMessageQueueClientFactory { IMessageProducer CreateMessageProducer(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/QueueNames.cs0000644000175000017500000000405312146506551030314 0ustar00meebeymeebey00000000000000using System; using System.Text; namespace ServiceStack.Messaging { /// /// Util static generic class to create unique queue names for types /// /// public static class QueueNames { static QueueNames() { var utf8 = new UTF8Encoding(false); Priority = "mq:" + typeof(T).Name + ".priorityq"; PriorityBytes = utf8.GetBytes(Priority); In = "mq:" + typeof(T).Name + ".inq"; InBytes = utf8.GetBytes(In); Out = "mq:" + typeof(T).Name + ".outq"; OutBytes = utf8.GetBytes(Out); Dlq = "mq:" + typeof(T).Name + ".dlq"; DlqBytes = utf8.GetBytes(Dlq); } public static string Priority { get; private set; } public static byte[] PriorityBytes { get; private set; } public static string In { get; private set; } public static byte[] InBytes { get; private set; } public static string Out { get; private set; } public static byte[] OutBytes { get; private set; } public static string Dlq { get; private set; } public static byte[] DlqBytes { get; private set; } } /// /// Util class to create unique queue names for runtime types /// public class QueueNames { public static string TopicIn = "mq:topic:in"; public static string TopicOut = "mq:topic:out"; public static string QueuePrefix = ""; public static void SetQueuePrefix(string prefix) { TopicIn = prefix + "mq:topic:in"; TopicOut = prefix + "mq:topic:out"; QueuePrefix = prefix; } private readonly Type messageType; public QueueNames(Type messageType) { this.messageType = messageType; } public string Priority { get { return QueuePrefix + "mq:" + messageType.Name + ".priorityq"; } } public string In { get { return QueuePrefix + "mq:" + messageType.Name + ".inq"; } } public string Out { get { return QueuePrefix + "mq:" + messageType.Name + ".outq"; } } public string Dlq { get { return QueuePrefix + "mq:" + messageType.Name + ".dlq"; } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/IMessageProducer.cs0000644000175000017500000000037612146506551031451 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Text; namespace ServiceStack.Messaging { public interface IMessageProducer : IDisposable { void Publish(T messageBody); void Publish(IMessage message); } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/MessageHandlerStats.cs0000644000175000017500000000474012146506551032150 0ustar00meebeymeebey00000000000000using System.Text; namespace ServiceStack.Messaging { public interface IMessageHandlerStats { string Name { get; } int TotalMessagesProcessed { get; } int TotalMessagesFailed { get; } int TotalRetries { get; } int TotalNormalMessagesReceived { get; } int TotalPriorityMessagesReceived { get; } void Add(IMessageHandlerStats stats); } public class MessageHandlerStats : IMessageHandlerStats { public MessageHandlerStats(string name) { Name = name; } public MessageHandlerStats(string name, int totalMessagesProcessed, int totalMessagesFailed, int totalRetries, int totalNormalMessagesReceived, int totalPriorityMessagesReceived) { Name = name; TotalMessagesProcessed = totalMessagesProcessed; TotalMessagesFailed = totalMessagesFailed; TotalRetries = totalRetries; TotalNormalMessagesReceived = totalNormalMessagesReceived; TotalPriorityMessagesReceived = totalPriorityMessagesReceived; } public string Name { get; private set; } public int TotalMessagesProcessed { get; private set; } public int TotalMessagesFailed { get; private set; } public int TotalRetries { get; private set; } public int TotalNormalMessagesReceived { get; private set; } public int TotalPriorityMessagesReceived { get; private set; } public virtual void Add(IMessageHandlerStats stats) { TotalMessagesProcessed += stats.TotalMessagesProcessed; TotalMessagesFailed += stats.TotalMessagesFailed; TotalRetries += stats.TotalRetries; TotalNormalMessagesReceived += stats.TotalNormalMessagesReceived; TotalPriorityMessagesReceived += stats.TotalPriorityMessagesReceived; } public override string ToString() { var sb = new StringBuilder("Stats for " + Name); sb.AppendLine("\n---------------"); sb.AppendFormat("\nTotalNormalMessagesReceived: {0}", TotalNormalMessagesReceived); sb.AppendFormat("\nTotalPriorityMessagesReceived: {0}", TotalPriorityMessagesReceived); sb.AppendFormat("\nTotalProcessed: {0}", TotalMessagesProcessed); sb.AppendFormat("\nTotalRetries: {0}", TotalRetries); sb.AppendFormat("\nTotalFailed: {0}", TotalMessagesFailed); return sb.ToString(); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/IMessage.cs0000644000175000017500000000104612146506551027740 0ustar00meebeymeebey00000000000000using System; using ServiceStack.DataAnnotations; using ServiceStack.DesignPatterns.Model; namespace ServiceStack.Messaging { public interface IMessage : IHasId { DateTime CreatedDate { get; } long Priority { get; set; } int RetryAttempts { get; set; } Guid? ReplyId { get; set; } string ReplyTo { get; set; } int Options { get; set; } MessageError Error { get; set; } object Body { get; set; } } public interface IMessage : IMessage { T GetBody(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/IMessageService.cs0000644000175000017500000000343312146506551031263 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Messaging { /// /// Simple definition of an MQ Host /// public interface IMessageService : IDisposable { /// /// Factory to create consumers and producers that work with this service /// IMessageFactory MessageFactory { get; } /// /// Register DTOs and hanlders the MQ Host will process /// /// /// void RegisterHandler(Func, object> processMessageFn); /// /// Register DTOs and hanlders the MQ Host will process /// /// /// /// void RegisterHandler(Func, object> processMessageFn, Action, Exception> processExceptionEx); /// /// Get Total Current Stats for all Message Handlers /// /// IMessageHandlerStats GetStats(); /// /// Get the status of the service. Potential Statuses: Disposed, Stopped, Stopping, Starting, Started /// /// string GetStatus(); /// /// Get a Stats dump /// /// string GetStatsDescription(); /// /// Start the MQ Host if not already started. /// void Start(); /// /// Stop the MQ Host if not already stopped. /// void Stop(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/MessageError.cs0000644000175000017500000000044312146506551030641 0ustar00meebeymeebey00000000000000namespace ServiceStack.Messaging { /// /// An Error Message Type that can be easily serialized /// public class MessageError { public string ErrorCode { get; set; } public string Message { get; set; } public string StackTrace { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/MessageOption.cs0000644000175000017500000000027512146506551031023 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Messaging { [Flags] public enum MessageOption : int { None = 0, All = int.MaxValue, NotifyOneWay = 1 << 0, } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/IMessageQueueClientFactory.cs0000644000175000017500000000026112146506551033432 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Messaging { public interface IMessageQueueClientFactory : IDisposable { IMessageQueueClient CreateMessageQueueClient(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/MessageFactory.cs0000644000175000017500000000423112146506551031156 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Reflection; using ServiceStack.DataAnnotations; namespace ServiceStack.Messaging { internal delegate IMessage MessageFactoryDelegate(object body); public static class MessageFactory { static readonly Dictionary CacheFn = new Dictionary(); public static IMessage Create(object response) { if (response == null) return null; var type = response.GetType(); MessageFactoryDelegate factoryFn; lock (CacheFn) CacheFn.TryGetValue(type, out factoryFn); if (factoryFn != null) return factoryFn(response); var genericMessageType = typeof(Message<>).MakeGenericType(type); var mi = genericMessageType.GetMethod("Create", BindingFlags.Public | BindingFlags.Static); factoryFn = (MessageFactoryDelegate) Delegate.CreateDelegate( typeof (MessageFactoryDelegate), mi); lock (CacheFn) CacheFn[type] = factoryFn; return factoryFn(response); } } public class Message : IMessage { public Guid Id { get; set; } public DateTime CreatedDate { get; set; } public long Priority { get; set; } public int RetryAttempts { get; set; } public Guid? ReplyId { get; set; } public string ReplyTo { get; set; } public int Options { get; set; } public MessageError Error { get; set; } public object Body { get; set; } } /// /// Basic implementation of IMessage[T] /// /// public class Message : Message, IMessage { public Message() { this.Id = Guid.NewGuid(); this.CreatedDate = DateTime.UtcNow; this.Options = (int) MessageOption.NotifyOneWay; } public Message(T body) : this() { Body = body; } public static IMessage Create(object oBody) { return new Message((T) oBody); } public T GetBody() { return (T)Body; } public override string ToString() { return string.Format("CreatedDate={0}, Id={1}, Type={2}, Retry={3}", this.CreatedDate, this.Id.ToString("N"), typeof(T).Name, this.RetryAttempts); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Messaging/MessagingException.cs0000644000175000017500000000156312146506551032043 0ustar00meebeymeebey00000000000000using System; using System.Runtime.Serialization; namespace ServiceStack.Messaging { /// /// Base Exception for all ServiceStack.Messaging exceptions /// public class MessagingException : Exception { public MessagingException() { } public MessagingException(string message) : base(message) { } public MessagingException(string message, Exception innerException) : base(message, innerException) { } #if !SILVERLIGHT && !MONOTOUCH && !XBOX protected MessagingException(SerializationInfo info, StreamingContext context) : base(info, context) { } #endif public virtual MessageError ToMessageError() { return new MessageError { ErrorCode = GetType().Name, Message = this.Message, StackTrace = this.ToString(), //Also includes inner exception }; } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/LogicFacade/0000755000175000017500000000000012146506551026117 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/LogicFacade/IInitContext.cs0000644000175000017500000000023612146506551031030 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.LogicFacade { public interface IInitContext : IDisposable { object InitialisedObject { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/LogicFacade/IOperationContext.cs0000644000175000017500000000035212146506551032064 0ustar00meebeymeebey00000000000000using System; using ServiceStack.ServiceHost; namespace ServiceStack.LogicFacade { public interface IOperationContext : IDisposable { IApplicationContext Application { get; } IRequestContext Request { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/LogicFacade/IServiceModelFinder.cs0000644000175000017500000000044512146506551032273 0ustar00meebeymeebey00000000000000using System; using System.Reflection; namespace ServiceStack.LogicFacade { /// /// The same functionality is on IServiceResolver /// [Obsolete] public interface IServiceModelFinder { Type FindTypeByOperation(string operationName, int? version); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/LogicFacade/ILogicFacade.cs0000644000175000017500000000025012146506551030675 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.LogicFacade { public interface ILogicFacade : IDisposable { IInitContext AcquireInitContext(InitOptions options); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/LogicFacade/IApplicationContext.cs0000644000175000017500000000045512146506551032373 0ustar00meebeymeebey00000000000000using ServiceStack.CacheAccess; using ServiceStack.Configuration; namespace ServiceStack.LogicFacade { public interface IApplicationContext { IFactoryProvider Factory { get; } T Get() where T : class; ICacheClient Cache { get; } IResourceManager Resources { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/LogicFacade/IXmlRequest.cs0000644000175000017500000000014612146506551030671 0ustar00meebeymeebey00000000000000namespace ServiceStack.LogicFacade { public interface IXmlRequest { string Xml { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/LogicFacade/InitOptions.cs0000644000175000017500000000021012146506551030716 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.LogicFacade { [Flags] public enum InitOptions { None = 0, InitialiseOnly = 1 } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/0000755000175000017500000000000012146506550026122 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/ICacheManager.cs0000644000175000017500000000046712146506550031067 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.CacheAccess { public interface ICacheManager : ICacheClearable, IHasCacheClient { T Resolve(string cacheKey, Func createCacheFn) where T : class; T Resolve(string cacheKey, TimeSpan expireIn, Func createCacheFn) where T : class; } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/ICacheClient.cs0000644000175000017500000001075512146506550030734 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.CacheAccess { /// /// A common interface implementation that is implemeneted by most cache providers /// public interface ICacheClient : IDisposable { /// /// Removes the specified item from the cache. /// /// The identifier for the item to delete. /// /// true if the item was successfully removed from the cache; false otherwise. /// bool Remove(string key); /// /// Removes the cache for all the keys provided. /// /// The keys. void RemoveAll(IEnumerable keys); /// /// Retrieves the specified item from the cache. /// /// /// The identifier for the item to retrieve. /// /// The retrieved item, or null if the key was not found. /// T Get(string key); /// /// Increments the value of the specified key by the given amount. /// The operation is atomic and happens on the server. /// A non existent value at key starts at 0 /// /// The identifier for the item to increment. /// The amount by which the client wants to increase the item. /// /// The new value of the item or -1 if not found. /// /// The item must be inserted into the cache before it can be changed. The item must be inserted as a . The operation only works with values, so -1 always indicates that the item was not found. long Increment(string key, uint amount); /// /// Increments the value of the specified key by the given amount. /// The operation is atomic and happens on the server. /// A non existent value at key starts at 0 /// /// The identifier for the item to increment. /// The amount by which the client wants to decrease the item. /// /// The new value of the item or -1 if not found. /// /// The item must be inserted into the cache before it can be changed. The item must be inserted as a . The operation only works with values, so -1 always indicates that the item was not found. long Decrement(string key, uint amount); /// /// Adds a new item into the cache at the specified cache key only if the cache is empty. /// /// The key used to reference the item. /// The object to be inserted into the cache. /// /// true if the item was successfully stored in the cache; false otherwise. /// /// The item does not expire unless it is removed due memory pressure. bool Add(string key, T value); /// /// Sets an item into the cache at the cache key specified regardless if it already exists or not. /// bool Set(string key, T value); /// /// Replaces the item at the cachekey specified only if an items exists at the location already. /// bool Replace(string key, T value); bool Add(string key, T value, DateTime expiresAt); bool Set(string key, T value, DateTime expiresAt); bool Replace(string key, T value, DateTime expiresAt); bool Add(string key, T value, TimeSpan expiresIn); bool Set(string key, T value, TimeSpan expiresIn); bool Replace(string key, T value, TimeSpan expiresIn); /// /// Invalidates all data on the cache. /// void FlushAll(); /// Retrieves multiple items from the cache. /// The default value of T is set for all keys that do not exist. /// /// The list of identifiers for the items to retrieve. /// /// a Dictionary holding all items indexed by their key. /// IDictionary GetAll(IEnumerable keys); /// /// Sets multiple items to the cache. /// /// /// The values. void SetAll(IDictionary values); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/ICacheHasContentType.cs0000644000175000017500000000016712146506550032422 0ustar00meebeymeebey00000000000000namespace ServiceStack.CacheAccess { public interface ICacheHasContentType { string ContentType { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/IDeflateProvider.cs0000644000175000017500000000023612146506550031642 0ustar00meebeymeebey00000000000000namespace ServiceStack.CacheAccess { public interface IDeflateProvider { byte[] Deflate(string text); string Inflate(byte[] gzBuffer); } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/IPersistenceProviderCache.cs0000644000175000017500000000136612146506550033513 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; namespace ServiceStack.CacheAccess { public interface IPersistenceProviderCache { TEntity GetById(object entityId) where TEntity : class, new(); List GetByIds(ICollection entityIds) where TEntity : class, new(); void SetCache(TEntity entity) where TEntity : class, new(); void Store(TEntity entity) where TEntity : class, new(); void StoreAll(params TEntity[] entities) where TEntity : class, new(); void ClearAll(ICollection entityIds) where TEntity : class, new(); void Clear(params object[] entityIds) where TEntity : class, new(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/ISessionFactory.cs0000644000175000017500000000134112146506550031534 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using ServiceStack.ServiceHost; namespace ServiceStack.CacheAccess { /// /// Retrieves a User Session /// public interface ISessionFactory { /// /// Gets the session for this request, creates one if it doesn't exist. /// /// /// /// ISession GetOrCreateSession(IHttpRequest httpReq, IHttpResponse httpRes); /// /// Gets the session for this request, creates one if it doesn't exist. /// Only for ASP.NET apps. Uses the HttpContext.Current singleton. /// ISession GetOrCreateSession(); } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/IHasCacheClient.cs0000644000175000017500000000017012146506550031356 0ustar00meebeymeebey00000000000000namespace ServiceStack.CacheAccess { public interface IHasCacheClient { ICacheClient CacheClient { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/ICacheTextManagerFactory.cs0000644000175000017500000000021612146506550033254 0ustar00meebeymeebey00000000000000namespace ServiceStack.CacheAccess { public interface ICacheTextManagerFactory { ICacheTextManager Resolve(string contentType); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/ICacheTextManager.cs0000644000175000017500000000056012146506550031726 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.CacheAccess { public interface ICacheTextManager : IHasCacheClient, ICacheClearable { string ContentType { get; } string ResolveText(string cacheKey, Func createCacheFn) where T : class; string ResolveText(string cacheKey, TimeSpan expiresIn, Func createCacheFn) where T : class; } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/ICacheClearable.cs0000644000175000017500000000032212146506550031355 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace ServiceStack.CacheAccess { public interface ICacheClearable { void Clear(IEnumerable cacheKeys); void Clear(params string[] cacheKeys); } }ICompressableCacheTextManagerFactory.cs0000644000175000017500000000024612146506550035540 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccessnamespace ServiceStack.CacheAccess { public interface ICompressableCacheTextManagerFactory { ICompressableCacheTextManager Resolve(string contentType); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/ISession.cs0000644000175000017500000000131312146506550030203 0ustar00meebeymeebey00000000000000namespace ServiceStack.CacheAccess { /// /// A Users Session /// public interface ISession { /// /// Store any object at key /// /// /// object this[string key] { get; set; } /// /// Set a typed value at key /// /// /// /// void Set(string key, T value); /// /// Get a typed value at key /// /// /// /// T Get(string key); } }IPersistenceProviderCacheFactory.cs0000644000175000017500000000043312146506550034756 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccessusing ServiceStack.DataAccess; namespace ServiceStack.CacheAccess { public interface IPersistenceProviderCacheFactory { IPersistenceProviderCache Create(IPersistenceProviderManager providerManager); IPersistenceProviderCache Create(string conntectionString); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/IGZipProvider.cs0000644000175000017500000000022312146506550031143 0ustar00meebeymeebey00000000000000namespace ServiceStack.CacheAccess { public interface IGZipProvider { byte[] GZip(string text); string GUnzip(byte[] gzBuffer); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/ICompressableCacheTextManager.cs0000644000175000017500000000043112146506550034263 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.CacheAccess { public interface ICompressableCacheTextManager : IHasCacheClient, ICacheHasContentType, ICacheClearable { object Resolve(string compressionType, string cacheKey, Func createCacheFn) where T : class; } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/CacheAccess/IMemcachedClient.cs0000644000175000017500000001122512146506550031570 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.CacheAccess { /// /// A light interface over a cache client. /// This interface was inspired by Enyim.Caching.MemcachedClient /// /// Only the methods that are intended to be used are required, if you require /// extra functionality you can uncomment the unused methods below as they have been /// implemented in DdnMemcachedClient /// public interface IMemcachedClient : IDisposable { /// /// Removes the specified item from the cache. /// /// The identifier for the item to delete. /// /// true if the item was successfully removed from the cache; false otherwise. /// bool Remove(string key); /// /// Removes the cache for all the keys provided. /// /// The keys. void RemoveAll(IEnumerable keys); /// /// Retrieves the specified item from the cache. /// /// The identifier for the item to retrieve. /// /// The retrieved item, or null if the key was not found. /// object Get(string key); object Get(string key, out ulong lastModifiedValue); /// /// Increments the value of the specified key by the given amount. The operation is atomic and happens on the server. /// /// The identifier for the item to increment. /// The amount by which the client wants to increase the item. /// /// The new value of the item or -1 if not found. /// /// The item must be inserted into the cache before it can be changed. The item must be inserted as a . The operation only works with values, so -1 always indicates that the item was not found. long Increment(string key, uint amount); /// /// Increments the value of the specified key by the given amount. The operation is atomic and happens on the server. /// /// The identifier for the item to increment. /// The amount by which the client wants to decrease the item. /// /// The new value of the item or -1 if not found. /// /// The item must be inserted into the cache before it can be changed. The item must be inserted as a . The operation only works with values, so -1 always indicates that the item was not found. long Decrement(string key, uint amount); /// /// Inserts an item into the cache with a cache key to reference its location. /// /// The key used to reference the item. /// The object to be inserted into the cache. /// /// true if the item was successfully stored in the cache; false otherwise. /// /// The item does not expire unless it is removed due memory pressure. bool Add(string key, object value); bool Set(string key, object value); bool Replace(string key, object value); /// /// Inserts an item into the cache with a cache key to reference its location. /// /// The key used to reference the item. /// The object to be inserted into the cache. /// The time when the item is invalidated in the cache. /// true if the item was successfully stored in the cache; false otherwise. bool Add(string key, object value, DateTime expiresAt); bool Set(string key, object value, DateTime expiresAt); bool Replace(string key, object value, DateTime expiresAt); /// /// Removes all data from the cache. /// void FlushAll(); /// /// Retrieves multiple items from the cache. /// /// The list of identifiers for the items to retrieve. /// /// a Dictionary holding all items indexed by their key. /// IDictionary GetAll(IEnumerable keys); bool CheckAndSet(string key, object value, ulong lastModifiedValue); bool CheckAndSet(string key, object value, ulong lastModifiedValue, DateTime expiresAt); IDictionary GetAll(IEnumerable keys, out IDictionary lastModifiedValues); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/0000755000175000017500000000000012146506551025044 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Pipeline/0000755000175000017500000000000012146506551026611 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Pipeline/IRedisPipeline.cs0000644000175000017500000000031412146506551032003 0ustar00meebeymeebey00000000000000namespace ServiceStack.Redis.Pipeline { /// /// Interface to redis pipeline /// public interface IRedisPipeline : IRedisPipelineShared, IRedisQueueableOperation { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Pipeline/IRedisPipelineShared.cs0000644000175000017500000000044312146506551033135 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Redis.Pipeline { /// /// Pipeline interface shared by typed and non-typed pipelines /// public interface IRedisPipelineShared : IDisposable, IRedisQueueCompletableOperation { void Flush(); bool Replay(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Pipeline/IRedisQueueableOperation.cs0000644000175000017500000000526412146506551034040 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.Redis.Pipeline { /// /// interface to operation that can queue commands /// public interface IRedisQueueableOperation { void QueueCommand(Action command); void QueueCommand(Action command, Action onSuccessCallback); void QueueCommand(Action command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func command); void QueueCommand(Func command, Action onSuccessCallback); void QueueCommand(Func command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func command); void QueueCommand(Func command, Action onSuccessCallback); void QueueCommand(Func command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func command); void QueueCommand(Func command, Action onSuccessCallback); void QueueCommand(Func command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func command); void QueueCommand(Func command, Action onSuccessCallback); void QueueCommand(Func command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func command); void QueueCommand(Func command, Action onSuccessCallback); void QueueCommand(Func command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func command); void QueueCommand(Func command, Action onSuccessCallback); void QueueCommand(Func command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func command); void QueueCommand(Func command, Action onSuccessCallback); void QueueCommand(Func command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func> command); void QueueCommand(Func> command, Action> onSuccessCallback); void QueueCommand(Func> command, Action> onSuccessCallback, Action onErrorCallback); } }IRedisQueueCompletableOperation.cs0000644000175000017500000000145312146506551035301 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Pipelineusing System; using System.Collections.Generic; namespace ServiceStack.Redis.Pipeline { /// /// Interface to operations that allow queued commands to be completed /// public interface IRedisQueueCompletableOperation { void CompleteVoidQueuedCommand(Action voidReadCommand); void CompleteIntQueuedCommand(Func intReadCommand); void CompleteLongQueuedCommand(Func longReadCommand); void CompleteBytesQueuedCommand(Func bytesReadCommand); void CompleteMultiBytesQueuedCommand(Func multiBytesReadCommand); void CompleteStringQueuedCommand(Func stringReadCommand); void CompleteMultiStringQueuedCommand(Func> multiStringReadCommand); void CompleteDoubleQueuedCommand(Func doubleReadCommand); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/IRedisSortedSet.cs0000644000175000017500000000253712146506551030416 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System.Collections.Generic; using ServiceStack.DesignPatterns.Model; namespace ServiceStack.Redis { public interface IRedisSortedSet : ICollection, IHasStringId { List GetAll(); List GetRange(int startingRank, int endingRank); List GetRangeByScore(string fromStringScore, string toStringScore); List GetRangeByScore(string fromStringScore, string toStringScore, int? skip, int? take); List GetRangeByScore(double fromScore, double toScore); List GetRangeByScore(double fromScore, double toScore, int? skip, int? take); void RemoveRange(int fromRank, int toRank); void RemoveRangeByScore(double fromScore, double toScore); void StoreFromIntersect(params IRedisSortedSet[] ofSets); void StoreFromUnion(params IRedisSortedSet[] ofSets); int GetItemIndex(string value); double GetItemScore(string value); void IncrementItemScore(string value, double incrementByScore); string PopItemWithHighestScore(); string PopItemWithLowestScore(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/IRedisClientCacheManager.cs0000644000175000017500000000227412146506551032135 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System; using ServiceStack.CacheAccess; namespace ServiceStack.Redis { public interface IRedisClientCacheManager : IDisposable { /// /// Returns a Read/Write client (The default) using the hosts defined in ReadWriteHosts /// /// IRedisClient GetClient(); /// /// Returns a ReadOnly client using the hosts defined in ReadOnlyHosts. /// /// IRedisClient GetReadOnlyClient(); /// /// Returns a Read/Write ICacheClient (The default) using the hosts defined in ReadWriteHosts /// /// ICacheClient GetCacheClient(); /// /// Returns a ReadOnly ICacheClient using the hosts defined in ReadOnlyHosts. /// /// ICacheClient GetReadOnlyCacheClient(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/SortOptions.cs0000644000175000017500000000052512146506551027700 0ustar00meebeymeebey00000000000000namespace ServiceStack.Redis { public class SortOptions { public string SortPattern { get; set; } public int? Skip { get; set; } public int? Take { get; set; } public string GetPattern { get; set; } public bool SortAlpha { get; set; } public bool SortDesc { get; set; } public string StoreAtKey { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Generic/0000755000175000017500000000000012146506551026420 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Generic/IRedisTypedPipeline.cs0000644000175000017500000000043312146506551032622 0ustar00meebeymeebey00000000000000using ServiceStack.Redis.Pipeline; namespace ServiceStack.Redis.Generic { /// /// Interface to redis typed pipeline /// public interface IRedisTypedPipeline : IRedisPipelineShared, IRedisTypedQueueableOperation { } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Generic/IRedisTypedClient.cs0000644000175000017500000002330612146506551032277 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System; using System.Collections.Generic; using ServiceStack.DataAccess; using ServiceStack.DesignPatterns.Model; namespace ServiceStack.Redis.Generic { public interface IRedisTypedClient : IBasicPersistenceProvider { IHasNamed> Lists { get; set; } IHasNamed> Sets { get; set; } IHasNamed> SortedSets { get; set; } IRedisHash GetHash(string hashId); IRedisTypedTransaction CreateTransaction(); IRedisTypedPipeline CreatePipeline(); IRedisClient RedisClient { get; } IDisposable AcquireLock(); IDisposable AcquireLock(TimeSpan timeOut); int Db { get; set; } List GetAllKeys(); IRedisSet TypeIdsSet { get; } T this[string key] { get; set; } string SequenceKey { get; set; } void SetSequence(int value); long GetNextSequence(); long GetNextSequence(int incrBy); RedisKeyType GetEntryType(string key); string GetRandomKey(); void SetEntry(string key, T value); void SetEntry(string key, T value, TimeSpan expireIn); bool SetEntryIfNotExists(string key, T value); T GetValue(string key); T GetAndSetValue(string key, T value); bool ContainsKey(string key); bool RemoveEntry(string key); bool RemoveEntry(params string[] args); bool RemoveEntry(params IHasStringId[] entities); long IncrementValue(string key); long IncrementValueBy(string key, int count); long DecrementValue(string key); long DecrementValueBy(string key, int count); bool ExpireIn(object id, TimeSpan expiresAt); bool ExpireAt(object id, DateTime dateTime); bool ExpireEntryIn(string key, TimeSpan expiresAt); bool ExpireEntryAt(string key, DateTime dateTime); TimeSpan GetTimeToLive(string key); void Save(); void SaveAsync(); void FlushDb(); void FlushAll(); T[] SearchKeys(string pattern); List GetValues(List keys); List GetSortedEntryValues(IRedisSet fromSet, int startingFrom, int endingAt); void StoreAsHash(T entity); T GetFromHash(object id); //Set operations HashSet GetAllItemsFromSet(IRedisSet fromSet); void AddItemToSet(IRedisSet toSet, T item); void RemoveItemFromSet(IRedisSet fromSet, T item); T PopItemFromSet(IRedisSet fromSet); void MoveBetweenSets(IRedisSet fromSet, IRedisSet toSet, T item); int GetSetCount(IRedisSet set); bool SetContainsItem(IRedisSet set, T item); HashSet GetIntersectFromSets(params IRedisSet[] sets); void StoreIntersectFromSets(IRedisSet intoSet, params IRedisSet[] sets); HashSet GetUnionFromSets(params IRedisSet[] sets); void StoreUnionFromSets(IRedisSet intoSet, params IRedisSet[] sets); HashSet GetDifferencesFromSet(IRedisSet fromSet, params IRedisSet[] withSets); void StoreDifferencesFromSet(IRedisSet intoSet, IRedisSet fromSet, params IRedisSet[] withSets); T GetRandomItemFromSet(IRedisSet fromSet); //List operations List GetAllItemsFromList(IRedisList fromList); List GetRangeFromList(IRedisList fromList, int startingFrom, int endingAt); List SortList(IRedisList fromList, int startingFrom, int endingAt); void AddItemToList(IRedisList fromList, T value); void PrependItemToList(IRedisList fromList, T value); T RemoveStartFromList(IRedisList fromList); T BlockingRemoveStartFromList(IRedisList fromList, TimeSpan? timeOut); T RemoveEndFromList(IRedisList fromList); void RemoveAllFromList(IRedisList fromList); void TrimList(IRedisList fromList, int keepStartingFrom, int keepEndingAt); int RemoveItemFromList(IRedisList fromList, T value); int RemoveItemFromList(IRedisList fromList, T value, int noOfMatches); int GetListCount(IRedisList fromList); T GetItemFromList(IRedisList fromList, int listIndex); void SetItemInList(IRedisList toList, int listIndex, T value); //Queue operations void EnqueueItemOnList(IRedisList fromList, T item); T DequeueItemFromList(IRedisList fromList); T BlockingDequeueItemFromList(IRedisList fromList, TimeSpan? timeOut); //Stack operations void PushItemToList(IRedisList fromList, T item); T PopItemFromList(IRedisList fromList); T BlockingPopItemFromList(IRedisList fromList, TimeSpan? timeOut); T PopAndPushItemBetweenLists(IRedisList fromList, IRedisList toList); //Sorted Set operations void AddItemToSortedSet(IRedisSortedSet toSet, T value); void AddItemToSortedSet(IRedisSortedSet toSet, T value, double score); bool RemoveItemFromSortedSet(IRedisSortedSet fromSet, T value); T PopItemWithLowestScoreFromSortedSet(IRedisSortedSet fromSet); T PopItemWithHighestScoreFromSortedSet(IRedisSortedSet fromSet); bool SortedSetContainsItem(IRedisSortedSet set, T value); double IncrementItemInSortedSet(IRedisSortedSet set, T value, double incrementBy); int GetItemIndexInSortedSet(IRedisSortedSet set, T value); int GetItemIndexInSortedSetDesc(IRedisSortedSet set, T value); List GetAllItemsFromSortedSet(IRedisSortedSet set); List GetAllItemsFromSortedSetDesc(IRedisSortedSet set); List GetRangeFromSortedSet(IRedisSortedSet set, int fromRank, int toRank); List GetRangeFromSortedSetDesc(IRedisSortedSet set, int fromRank, int toRank); IDictionary GetAllWithScoresFromSortedSet(IRedisSortedSet set); IDictionary GetRangeWithScoresFromSortedSet(IRedisSortedSet set, int fromRank, int toRank); IDictionary GetRangeWithScoresFromSortedSetDesc(IRedisSortedSet set, int fromRank, int toRank); List GetRangeFromSortedSetByLowestScore(IRedisSortedSet set, string fromStringScore, string toStringScore); List GetRangeFromSortedSetByLowestScore(IRedisSortedSet set, string fromStringScore, string toStringScore, int? skip, int? take); List GetRangeFromSortedSetByLowestScore(IRedisSortedSet set, double fromScore, double toScore); List GetRangeFromSortedSetByLowestScore(IRedisSortedSet set, double fromScore, double toScore, int? skip, int? take); IDictionary GetRangeWithScoresFromSortedSetByLowestScore(IRedisSortedSet set, string fromStringScore, string toStringScore); IDictionary GetRangeWithScoresFromSortedSetByLowestScore(IRedisSortedSet set, string fromStringScore, string toStringScore, int? skip, int? take); IDictionary GetRangeWithScoresFromSortedSetByLowestScore(IRedisSortedSet set, double fromScore, double toScore); IDictionary GetRangeWithScoresFromSortedSetByLowestScore(IRedisSortedSet set, double fromScore, double toScore, int? skip, int? take); List GetRangeFromSortedSetByHighestScore(IRedisSortedSet set, string fromStringScore, string toStringScore); List GetRangeFromSortedSetByHighestScore(IRedisSortedSet set, string fromStringScore, string toStringScore, int? skip, int? take); List GetRangeFromSortedSetByHighestScore(IRedisSortedSet set, double fromScore, double toScore); List GetRangeFromSortedSetByHighestScore(IRedisSortedSet set, double fromScore, double toScore, int? skip, int? take); IDictionary GetRangeWithScoresFromSortedSetByHighestScore(IRedisSortedSet set, string fromStringScore, string toStringScore); IDictionary GetRangeWithScoresFromSortedSetByHighestScore(IRedisSortedSet set, string fromStringScore, string toStringScore, int? skip, int? take); IDictionary GetRangeWithScoresFromSortedSetByHighestScore(IRedisSortedSet set, double fromScore, double toScore); IDictionary GetRangeWithScoresFromSortedSetByHighestScore(IRedisSortedSet set, double fromScore, double toScore, int? skip, int? take); int RemoveRangeFromSortedSet(IRedisSortedSet set, int minRank, int maxRank); int RemoveRangeFromSortedSetByScore(IRedisSortedSet set, double fromScore, double toScore); int GetSortedSetCount(IRedisSortedSet set); double GetItemScoreInSortedSet(IRedisSortedSet set, T value); int StoreIntersectFromSortedSets(IRedisSortedSet intoSetId, params IRedisSortedSet[] setIds); int StoreUnionFromSortedSets(IRedisSortedSet intoSetId, params IRedisSortedSet[] setIds); //Hash operations bool HashContainsEntry(IRedisHash hash, TKey key); bool SetEntryInHash(IRedisHash hash, TKey key, T value); bool SetEntryInHashIfNotExists(IRedisHash hash, TKey key, T value); void SetRangeInHash(IRedisHash hash, IEnumerable> keyValuePairs); T GetValueFromHash(IRedisHash hash, TKey key); bool RemoveEntryFromHash(IRedisHash hash, TKey key); int GetHashCount(IRedisHash hash); List GetHashKeys(IRedisHash hash); List GetHashValues(IRedisHash hash); Dictionary GetAllEntriesFromHash(IRedisHash hash); //Useful common app-logic void StoreRelatedEntities(object parentId, List children); void StoreRelatedEntities(object parentId, params TChild[] children); void DeleteRelatedEntities(object parentId); void DeleteRelatedEntity(object parentId, object childId); List GetRelatedEntities(object parentId); int GetRelatedEntitiesCount(object parentId); void AddToRecentsList(T value); List GetLatestFromRecentsList(int skip, int take); List GetEarliestFromRecentsList(int skip, int take); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Generic/IRedisSet.Generic.cs0000644000175000017500000000165212146506551032161 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System.Collections.Generic; using ServiceStack.DesignPatterns.Model; namespace ServiceStack.Redis.Generic { public interface IRedisSet : ICollection, IHasStringId { List Sort(int startingFrom, int endingAt); HashSet GetAll(); T PopRandomItem(); T GetRandomItem(); void MoveTo(T item, IRedisSet toSet); void PopulateWithIntersectOf(params IRedisSet[] sets); void PopulateWithUnionOf(params IRedisSet[] sets); void GetDifferences(params IRedisSet[] withSets); void PopulateWithDifferencesOf(IRedisSet fromSet, params IRedisSet[] withSets); } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Generic/IRedisSortedSet.Generic.cs0000644000175000017500000000254212146506551033341 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System.Collections.Generic; using ServiceStack.DesignPatterns.Model; namespace ServiceStack.Redis.Generic { public interface IRedisSortedSet : ICollection, IHasStringId { T PopItemWithHighestScore(); T PopItemWithLowestScore(); double IncrementItem(T item, double incrementBy); int IndexOf(T item); int IndexOfDescending(T item); List GetAll(); List GetAllDescending(); List GetRange(int fromRank, int toRank); List GetRangeByLowestScore(double fromScore, double toScore); List GetRangeByLowestScore(double fromScore, double toScore, int? skip, int? take); List GetRangeByHighestScore(double fromScore, double toScore); List GetRangeByHighestScore(double fromScore, double toScore, int? skip, int? take); int RemoveRange(int minRank, int maxRank); int RemoveRangeByScore(double fromScore, double toScore); double GetItemScore(T item); int PopulateWithIntersectOf(params IRedisSortedSet[] setIds); int PopulateWithUnionOf(params IRedisSortedSet[] setIds); } }IRedisTypedQueueableOperation.cs0000644000175000017500000000661512146506551034577 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Genericusing System; using System.Collections.Generic; namespace ServiceStack.Redis.Generic { /// /// interface to queueable operation using typed redis client /// /// public interface IRedisTypedQueueableOperation { void QueueCommand(Action> command); void QueueCommand(Action> command, Action onSuccessCallback); void QueueCommand(Action> command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func, int> command); void QueueCommand(Func, int> command, Action onSuccessCallback); void QueueCommand(Func, int> command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func, long> command); void QueueCommand(Func, long> command, Action onSuccessCallback); void QueueCommand(Func, long> command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func, bool> command); void QueueCommand(Func, bool> command, Action onSuccessCallback); void QueueCommand(Func, bool> command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func, double> command); void QueueCommand(Func, double> command, Action onSuccessCallback); void QueueCommand(Func, double> command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func, byte[]> command); void QueueCommand(Func, byte[]> command, Action onSuccessCallback); void QueueCommand(Func, byte[]> command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func, string> command); void QueueCommand(Func, string> command, Action onSuccessCallback); void QueueCommand(Func, string> command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func, T> command); void QueueCommand(Func, T> command, Action onSuccessCallback); void QueueCommand(Func, T> command, Action onSuccessCallback, Action onErrorCallback); void QueueCommand(Func, List> command); void QueueCommand(Func, List> command, Action> onSuccessCallback); void QueueCommand(Func, List> command, Action> onSuccessCallback, Action onErrorCallback); void QueueCommand(Func, List> command); void QueueCommand(Func, List> command, Action> onSuccessCallback); void QueueCommand(Func, List> command, Action> onSuccessCallback, Action onErrorCallback); } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Generic/IRedisTransaction.cs0000644000175000017500000000120012146506551032325 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System; namespace ServiceStack.Redis.Generic { /// /// Redis transaction for typed client /// /// public interface IRedisTypedTransaction: IRedisTypedQueueableOperation, IDisposable { bool Commit(); void Rollback(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Generic/IRedisHash.Generic.cs0000644000175000017500000000107712146506551032312 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System.Collections.Generic; using ServiceStack.DesignPatterns.Model; namespace ServiceStack.Redis.Generic { public interface IRedisHash : IDictionary, IHasStringId { Dictionary GetAll(); } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/Generic/IRedisList.Generic.cs0000644000175000017500000000242612146506551032341 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System; using System.Collections.Generic; using ServiceStack.DesignPatterns.Model; namespace ServiceStack.Redis.Generic { /// /// Wrap the common redis list operations under a IList[string] interface. /// public interface IRedisList : IList, IHasStringId { List GetAll(); List GetRange(int startingFrom, int endingAt); List GetRangeFromSortedList(int startingFrom, int endingAt); void RemoveAll(); void Trim(int keepStartingFrom, int keepEndingAt); int RemoveValue(T value); int RemoveValue(T value, int noOfMatches); void AddRange(IEnumerable values); void Append(T value); void Prepend(T value); T RemoveStart(); T BlockingRemoveStart(TimeSpan? timeOut); T RemoveEnd(); void Enqueue(T value); T Dequeue(); T BlockingDequeue(TimeSpan? timeOut); void Push(T value); T Pop(); T BlockingPop(TimeSpan? timeOut); T PopAndPush(IRedisList toList); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/IRedisHash.cs0000644000175000017500000000057012146506551027360 0ustar00meebeymeebey00000000000000using System.Collections.Generic; using ServiceStack.DesignPatterns.Model; namespace ServiceStack.Redis { public interface IRedisHash : IDictionary, IHasStringId { bool AddIfNotExists(KeyValuePair item); void AddRange(IEnumerable> items); int IncrementValue(string key, int incrementBy); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/IRedisSubscription.cs0000644000175000017500000000233112146506551031156 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Redis { public interface IRedisSubscription : IDisposable { /// /// The number of active subscriptions this client has /// int SubscriptionCount { get; } /// /// Registered handler called after client *Subscribes* to each new channel /// Action OnSubscribe { get; set; } /// /// Registered handler called when each message is received /// Action OnMessage { get; set; } /// /// Registered handler called when each channel is unsubscribed /// Action OnUnSubscribe { get; set; } /// /// Subscribe to channels by name /// /// void SubscribeToChannels(params string[] channels); /// /// Subscribe to channels matching the supplied patterns /// /// void SubscribeToChannelsMatching(params string[] patterns); void UnSubscribeFromAllChannels(); void UnSubscribeFromChannels(params string[] channels); void UnSubscribeFromChannelsMatching(params string[] patterns); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/IRedisClientsManager.cs0000644000175000017500000000226512146506551031374 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System; using ServiceStack.CacheAccess; namespace ServiceStack.Redis { public interface IRedisClientsManager : IDisposable { /// /// Returns a Read/Write client (The default) using the hosts defined in ReadWriteHosts /// /// IRedisClient GetClient(); /// /// Returns a ReadOnly client using the hosts defined in ReadOnlyHosts. /// /// IRedisClient GetReadOnlyClient(); /// /// Returns a Read/Write ICacheClient (The default) using the hosts defined in ReadWriteHosts /// /// ICacheClient GetCacheClient(); /// /// Returns a ReadOnly ICacheClient using the hosts defined in ReadOnlyHosts. /// /// ICacheClient GetReadOnlyCacheClient(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/IRedisList.cs0000644000175000017500000000231012146506551027402 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System; using System.Collections.Generic; using ServiceStack.DesignPatterns.Model; namespace ServiceStack.Redis { public interface IRedisList : IList, IHasStringId { List GetAll(); List GetRange(int startingFrom, int endingAt); List GetRangeFromSortedList(int startingFrom, int endingAt); void RemoveAll(); void Trim(int keepStartingFrom, int keepEndingAt); int RemoveValue(string value); int RemoveValue(string value, int noOfMatches); void Prepend(string value); void Append(string value); string RemoveStart(); string BlockingRemoveStart(TimeSpan? timeOut); string RemoveEnd(); void Enqueue(string value); string Dequeue(); string BlockingDequeue(TimeSpan? timeOut); void Push(string value); string Pop(); string BlockingPop(TimeSpan? timeOut); string PopAndPush(IRedisList toList); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/IRedisSet.cs0000644000175000017500000000200312146506551027221 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System.Collections.Generic; using ServiceStack.DesignPatterns.Model; namespace ServiceStack.Redis { public interface IRedisSet : ICollection, IHasStringId { List GetRangeFromSortedSet(int startingFrom, int endingAt); HashSet GetAll(); string Pop(); void Move(string value, IRedisSet toSet); HashSet Intersect(params IRedisSet[] withSets); void StoreIntersect(params IRedisSet[] withSets); HashSet Union(params IRedisSet[] withSets); void StoreUnion(params IRedisSet[] withSets); HashSet Diff(IRedisSet[] withSets); void StoreDiff(IRedisSet fromSet, params IRedisSet[] withSets); string GetRandomEntry(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/IRedisNativeClient.cs0000644000175000017500000001737312146506551031073 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/ServiceStackRedis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System; using System.Collections.Generic; namespace ServiceStack.Redis { public interface IRedisNativeClient : IDisposable { //Redis utility operations Dictionary Info { get; } int Db { get; set; } int DbSize { get; } DateTime LastSave { get; } void Save(); void BgSave(); void Shutdown(); void BgRewriteAof(); void Quit(); void FlushDb(); void FlushAll(); bool Ping(); string Echo(string text); void SlaveOf(string hostname, int port); void SlaveOfNoOne(); byte[][] ConfigGet(string pattern); void ConfigSet(string item, byte[] value); void ConfigResetStat(); byte[][] Time(); void DebugSegfault(); byte[] Dump(string key); byte[] Restore(string key, long expireMs, byte[] dumpValue); void Migrate(string host, int port, int destinationDb, long timeoutMs); bool Move(string key, int db); int ObjectIdleTime(string key); //Common key-value Redis operations byte[][] Keys(string pattern); int Exists(string key); int StrLen(string key); void Set(string key, byte[] value); void SetEx(string key, int expireInSeconds, byte[] value); bool Persist(string key); void PSetEx(string key, long expireInMs, byte[] value); int SetNX(string key, byte[] value); void MSet(byte[][] keys, byte[][] values); void MSet(string[] keys, byte[][] values); bool MSetNx(byte[][] keys, byte[][] values); bool MSetNx(string[] keys, byte[][] values); byte[] Get(string key); byte[] GetSet(string key, byte[] value); byte[][] MGet(params byte[][] keys); byte[][] MGet(params string[] keys); int Del(string key); int Del(params string[] keys); long Incr(string key); long IncrBy(string key, int incrBy); double IncrByFloat(string key, double incrBy); long Decr(string key); long DecrBy(string key, int decrBy); int Append(string key, byte[] value); [Obsolete("Was renamed to GetRange in 2.4")] byte[] Substr(string key, int fromIndex, int toIndex); byte[] GetRange(string key, int fromIndex, int toIndex); int SetRange(string key, int offset, byte[] value); int GetBit(string key, int offset); int SetBit(string key, int offset, int value); string RandomKey(); void Rename(string oldKeyname, string newKeyname); bool RenameNx(string oldKeyname, string newKeyname); bool Expire(string key, int seconds); bool PExpire(string key, long ttlMs); bool ExpireAt(string key, long unixTime); bool PExpireAt(string key, long unixTimeMs); int Ttl(string key); long PTtl(string key); //Redis Sort operation (works on lists, sets or hashes) byte[][] Sort(string listOrSetId, SortOptions sortOptions); //Redis List operations byte[][] LRange(string listId, int startingFrom, int endingAt); int RPush(string listId, byte[] value); int RPushX(string listId, byte[] value); int LPush(string listId, byte[] value); int LPushX(string listId, byte[] value); void LTrim(string listId, int keepStartingFrom, int keepEndingAt); int LRem(string listId, int removeNoOfMatches, byte[] value); int LLen(string listId); byte[] LIndex(string listId, int listIndex); void LSet(string listId, int listIndex, byte[] value); byte[] LPop(string listId); byte[] RPop(string listId); byte[][] BLPop(string listId, int timeOutSecs); byte[][] BLPop(string[] listIds, int timeOutSecs); byte[] BLPopValue(string listId, int timeOutSecs); byte[][] BLPopValue(string[] listIds, int timeOutSecs); byte[][] BRPop(string listId, int timeOutSecs); byte[][] BRPop(string[] listIds, int timeOutSecs); byte[] RPopLPush(string fromListId, string toListId); byte[] BRPopValue(string listId, int timeOutSecs); byte[][] BRPopValue(string[] listIds, int timeOutSecs); //Redis Set operations byte[][] SMembers(string setId); int SAdd(string setId, byte[] value); int SRem(string setId, byte[] value); byte[] SPop(string setId); void SMove(string fromSetId, string toSetId, byte[] value); int SCard(string setId); int SIsMember(string setId, byte[] value); byte[][] SInter(params string[] setIds); void SInterStore(string intoSetId, params string[] setIds); byte[][] SUnion(params string[] setIds); void SUnionStore(string intoSetId, params string[] setIds); byte[][] SDiff(string fromSetId, params string[] withSetIds); void SDiffStore(string intoSetId, string fromSetId, params string[] withSetIds); byte[] SRandMember(string setId); //Redis Sorted Set operations int ZAdd(string setId, double score, byte[] value); int ZAdd(string setId, long score, byte[] value); int ZRem(string setId, byte[] value); double ZIncrBy(string setId, double incrBy, byte[] value); double ZIncrBy(string setId, long incrBy, byte[] value); int ZRank(string setId, byte[] value); int ZRevRank(string setId, byte[] value); byte[][] ZRange(string setId, int min, int max); byte[][] ZRangeWithScores(string setId, int min, int max); byte[][] ZRevRange(string setId, int min, int max); byte[][] ZRevRangeWithScores(string setId, int min, int max); byte[][] ZRangeByScore(string setId, double min, double max, int? skip, int? take); byte[][] ZRangeByScore(string setId, long min, long max, int? skip, int? take); byte[][] ZRangeByScoreWithScores(string setId, double min, double max, int? skip, int? take); byte[][] ZRangeByScoreWithScores(string setId, long min, long max, int? skip, int? take); byte[][] ZRevRangeByScore(string setId, double min, double max, int? skip, int? take); byte[][] ZRevRangeByScore(string setId, long min, long max, int? skip, int? take); byte[][] ZRevRangeByScoreWithScores(string setId, double min, double max, int? skip, int? take); byte[][] ZRevRangeByScoreWithScores(string setId, long min, long max, int? skip, int? take); int ZRemRangeByRank(string setId, int min, int max); int ZRemRangeByScore(string setId, double fromScore, double toScore); int ZRemRangeByScore(string setId, long fromScore, long toScore); int ZCard(string setId); double ZScore(string setId, byte[] value); int ZUnionStore(string intoSetId, params string[] setIds); int ZInterStore(string intoSetId, params string[] setIds); //Redis Hash operations int HSet(string hashId, byte[] key, byte[] value); void HMSet(string hashId, byte[][] keys, byte[][] values); int HSetNX(string hashId, byte[] key, byte[] value); int HIncrby(string hashId, byte[] key, int incrementBy); double HIncrbyFloat(string hashId, byte[] key, double incrementBy); byte[] HGet(string hashId, byte[] key); byte[][] HMGet(string hashId, params byte[][] keys); int HDel(string hashId, byte[] key); int HExists(string hashId, byte[] key); int HLen(string hashId); byte[][] HKeys(string hashId); byte[][] HVals(string hashId); byte[][] HGetAll(string hashId); //Redis Pub/Sub operations void Watch(params string[] keys); void UnWatch(); int Publish(string toChannel, byte[] message); byte[][] Subscribe(params string[] toChannels); byte[][] UnSubscribe(params string[] toChannels); byte[][] PSubscribe(params string[] toChannelsMatchingPatterns); byte[][] PUnSubscribe(params string[] toChannelsMatchingPatterns); byte[][] ReceiveMessages(); int EvalInt(string body, int numberKeysInArgs, params byte[][] keys); string EvalStr(string body, int numberKeysInArgs, params byte[][] keys); byte[][] Eval(string body, int numberKeysInArgs, params byte[][] keys); byte[][] ScriptExists(params byte[][] sha1Refs); void ScriptFlush(); void ScriptKill(); byte[] ScriptLoad(string body); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/IRedisClient.cs0000644000175000017500000003125312146506551027715 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/ServiceStackRedis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System; using System.Collections.Generic; using ServiceStack.CacheAccess; using ServiceStack.DataAccess; using ServiceStack.DesignPatterns.Model; using ServiceStack.Redis.Generic; using ServiceStack.Redis.Pipeline; namespace ServiceStack.Redis { public interface IRedisClient : IBasicPersistenceProvider, ICacheClient { //Basic Redis Connection operations int Db { get; set; } int DbSize { get; } Dictionary Info { get; } DateTime LastSave { get; } string Host { get; } int Port { get; } int ConnectTimeout { get; set; } int RetryTimeout { get; set; } int RetryCount { get; set; } int SendTimeout { get; set; } string Password { get; set; } bool HadExceptions { get; } void Save(); void SaveAsync(); void Shutdown(); void RewriteAppendOnlyFileAsync(); void FlushDb(); //Basic Redis Connection Info string this[string key] { get; set; } List GetAllKeys(); void SetEntry(string key, string value); void SetEntry(string key, string value, TimeSpan expireIn); bool SetEntryIfNotExists(string key, string value); void SetAll(IEnumerable keys, IEnumerable values); void SetAll(Dictionary map); string GetValue(string key); string GetAndSetEntry(string key, string value); List GetValues(List keys); List GetValues(List keys); Dictionary GetValuesMap(List keys); Dictionary GetValuesMap(List keys); int AppendToValue(string key, string value); void RenameKey(string fromName, string toName); string GetSubstring(string key, int fromIndex, int toIndex); //store POCOs as hash T GetFromHash(object id); void StoreAsHash(T entity); object StoreObject(object entity); bool ContainsKey(string key); bool RemoveEntry(params string[] args); long IncrementValue(string key); long IncrementValueBy(string key, int count); long DecrementValue(string key); long DecrementValueBy(string key, int count); List SearchKeys(string pattern); RedisKeyType GetEntryType(string key); string GetRandomKey(); bool ExpireEntryIn(string key, TimeSpan expireIn); bool ExpireEntryAt(string key, DateTime expireAt); TimeSpan GetTimeToLive(string key); List GetSortedEntryValues(string key, int startingFrom, int endingAt); //Store entities without registering entity ids void WriteAll(IEnumerable entities); /// /// Returns a high-level typed client API /// Shorter Alias is As<T>(); /// /// IRedisTypedClient GetTypedClient(); /// /// Returns a high-level typed client API /// /// IRedisTypedClient As(); IHasNamed Lists { get; set; } IHasNamed Sets { get; set; } IHasNamed SortedSets { get; set; } IHasNamed Hashes { get; set; } IRedisTransaction CreateTransaction(); IRedisPipeline CreatePipeline(); IDisposable AcquireLock(string key); IDisposable AcquireLock(string key, TimeSpan timeOut); #region Redis pubsub void Watch(params string[] keys); void UnWatch(); IRedisSubscription CreateSubscription(); int PublishMessage(string toChannel, string message); #endregion #region Set operations HashSet GetAllItemsFromSet(string setId); void AddItemToSet(string setId, string item); void AddRangeToSet(string setId, List items); void RemoveItemFromSet(string setId, string item); string PopItemFromSet(string setId); void MoveBetweenSets(string fromSetId, string toSetId, string item); int GetSetCount(string setId); bool SetContainsItem(string setId, string item); HashSet GetIntersectFromSets(params string[] setIds); void StoreIntersectFromSets(string intoSetId, params string[] setIds); HashSet GetUnionFromSets(params string[] setIds); void StoreUnionFromSets(string intoSetId, params string[] setIds); HashSet GetDifferencesFromSet(string fromSetId, params string[] withSetIds); void StoreDifferencesFromSet(string intoSetId, string fromSetId, params string[] withSetIds); string GetRandomItemFromSet(string setId); #endregion #region List operations List GetAllItemsFromList(string listId); List GetRangeFromList(string listId, int startingFrom, int endingAt); List GetRangeFromSortedList(string listId, int startingFrom, int endingAt); List GetSortedItemsFromList(string listId, SortOptions sortOptions); void AddItemToList(string listId, string value); void AddRangeToList(string listId, List values); void PrependItemToList(string listId, string value); void PrependRangeToList(string listId, List values); void RemoveAllFromList(string listId); string RemoveStartFromList(string listId); string BlockingRemoveStartFromList(string listId, TimeSpan? timeOut); ItemRef BlockingRemoveStartFromLists(string []listIds, TimeSpan? timeOut); string RemoveEndFromList(string listId); void TrimList(string listId, int keepStartingFrom, int keepEndingAt); int RemoveItemFromList(string listId, string value); int RemoveItemFromList(string listId, string value, int noOfMatches); int GetListCount(string listId); string GetItemFromList(string listId, int listIndex); void SetItemInList(string listId, int listIndex, string value); //Queue operations void EnqueueItemOnList(string listId, string value); string DequeueItemFromList(string listId); string BlockingDequeueItemFromList(string listId, TimeSpan? timeOut); ItemRef BlockingDequeueItemFromLists(string []listIds, TimeSpan? timeOut); //Stack operations void PushItemToList(string listId, string value); string PopItemFromList(string listId); string BlockingPopItemFromList(string listId, TimeSpan? timeOut); ItemRef BlockingPopItemFromLists(string []listIds, TimeSpan? timeOut); string PopAndPushItemBetweenLists(string fromListId, string toListId); #endregion #region Sorted Set operations bool AddItemToSortedSet(string setId, string value); bool AddItemToSortedSet(string setId, string value, double score); bool AddRangeToSortedSet(string setId, List values, double score); bool AddRangeToSortedSet(string setId, List values, long score); bool RemoveItemFromSortedSet(string setId, string value); string PopItemWithLowestScoreFromSortedSet(string setId); string PopItemWithHighestScoreFromSortedSet(string setId); bool SortedSetContainsItem(string setId, string value); double IncrementItemInSortedSet(string setId, string value, double incrementBy); double IncrementItemInSortedSet(string setId, string value, long incrementBy); int GetItemIndexInSortedSet(string setId, string value); int GetItemIndexInSortedSetDesc(string setId, string value); List GetAllItemsFromSortedSet(string setId); List GetAllItemsFromSortedSetDesc(string setId); List GetRangeFromSortedSet(string setId, int fromRank, int toRank); List GetRangeFromSortedSetDesc(string setId, int fromRank, int toRank); IDictionary GetAllWithScoresFromSortedSet(string setId); IDictionary GetRangeWithScoresFromSortedSet(string setId, int fromRank, int toRank); IDictionary GetRangeWithScoresFromSortedSetDesc(string setId, int fromRank, int toRank); List GetRangeFromSortedSetByLowestScore(string setId, string fromStringScore, string toStringScore); List GetRangeFromSortedSetByLowestScore(string setId, string fromStringScore, string toStringScore, int? skip, int? take); List GetRangeFromSortedSetByLowestScore(string setId, double fromScore, double toScore); List GetRangeFromSortedSetByLowestScore(string setId, long fromScore, long toScore); List GetRangeFromSortedSetByLowestScore(string setId, double fromScore, double toScore, int? skip, int? take); List GetRangeFromSortedSetByLowestScore(string setId, long fromScore, long toScore, int? skip, int? take); IDictionary GetRangeWithScoresFromSortedSetByLowestScore(string setId, string fromStringScore, string toStringScore); IDictionary GetRangeWithScoresFromSortedSetByLowestScore(string setId, string fromStringScore, string toStringScore, int? skip, int? take); IDictionary GetRangeWithScoresFromSortedSetByLowestScore(string setId, double fromScore, double toScore); IDictionary GetRangeWithScoresFromSortedSetByLowestScore(string setId, long fromScore, long toScore); IDictionary GetRangeWithScoresFromSortedSetByLowestScore(string setId, double fromScore, double toScore, int? skip, int? take); IDictionary GetRangeWithScoresFromSortedSetByLowestScore(string setId, long fromScore, long toScore, int? skip, int? take); List GetRangeFromSortedSetByHighestScore(string setId, string fromStringScore, string toStringScore); List GetRangeFromSortedSetByHighestScore(string setId, string fromStringScore, string toStringScore, int? skip, int? take); List GetRangeFromSortedSetByHighestScore(string setId, double fromScore, double toScore); List GetRangeFromSortedSetByHighestScore(string setId, long fromScore, long toScore); List GetRangeFromSortedSetByHighestScore(string setId, double fromScore, double toScore, int? skip, int? take); List GetRangeFromSortedSetByHighestScore(string setId, long fromScore, long toScore, int? skip, int? take); IDictionary GetRangeWithScoresFromSortedSetByHighestScore(string setId, string fromStringScore, string toStringScore); IDictionary GetRangeWithScoresFromSortedSetByHighestScore(string setId, string fromStringScore, string toStringScore, int? skip, int? take); IDictionary GetRangeWithScoresFromSortedSetByHighestScore(string setId, double fromScore, double toScore); IDictionary GetRangeWithScoresFromSortedSetByHighestScore(string setId, long fromScore, long toScore); IDictionary GetRangeWithScoresFromSortedSetByHighestScore(string setId, double fromScore, double toScore, int? skip, int? take); IDictionary GetRangeWithScoresFromSortedSetByHighestScore(string setId, long fromScore, long toScore, int? skip, int? take); int RemoveRangeFromSortedSet(string setId, int minRank, int maxRank); int RemoveRangeFromSortedSetByScore(string setId, double fromScore, double toScore); int RemoveRangeFromSortedSetByScore(string setId, long fromScore, long toScore); int GetSortedSetCount(string setId); int GetSortedSetCount(string setId, string fromStringScore, string toStringScore); int GetSortedSetCount(string setId, long fromScore, long toScore); int GetSortedSetCount(string setId, double fromScore, double toScore); double GetItemScoreInSortedSet(string setId, string value); int StoreIntersectFromSortedSets(string intoSetId, params string[] setIds); int StoreUnionFromSortedSets(string intoSetId, params string[] setIds); #endregion #region Hash operations bool HashContainsEntry(string hashId, string key); bool SetEntryInHash(string hashId, string key, string value); bool SetEntryInHashIfNotExists(string hashId, string key, string value); void SetRangeInHash(string hashId, IEnumerable> keyValuePairs); int IncrementValueInHash(string hashId, string key, int incrementBy); string GetValueFromHash(string hashId, string key); List GetValuesFromHash(string hashId, params string[] keys); bool RemoveEntryFromHash(string hashId, string key); int GetHashCount(string hashId); List GetHashKeys(string hashId); List GetHashValues(string hashId); Dictionary GetAllEntriesFromHash(string hashId); #endregion #region Eval/Lua operations string GetEvalStr(string body, int numOfArgs, params string[] args); int GetEvalInt(string body, int numOfArgs, params string[] args); List GetEvalMultiData(string body, int numOfArgs, params string[] args); #endregion } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/IRedisTransaction.cs0000644000175000017500000000117712146506551030766 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // using System; using ServiceStack.Redis.Pipeline; namespace ServiceStack.Redis { /// /// Interface to redis transaction /// public interface IRedisTransaction : IRedisTransactionBase, IRedisQueueableOperation, IDisposable { bool Commit(); void Rollback(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/ItemRef.cs0000644000175000017500000000022512146506551026725 0ustar00meebeymeebey00000000000000namespace ServiceStack.Redis { public class ItemRef { public string Id { get; set; } public string Item { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/IRedisTransactionBase.cs0000644000175000017500000000042512146506551031554 0ustar00meebeymeebey00000000000000using ServiceStack.Redis.Pipeline; namespace ServiceStack.Redis { /// /// Base transaction interface, shared by typed and non-typed transactions /// public interface IRedisTransactionBase : IRedisPipelineShared { } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Redis/RedisKeyType.cs0000644000175000017500000000070112146506551027752 0ustar00meebeymeebey00000000000000// // https://github.com/mythz/ServiceStack.Redis // ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2010 Liquidbit Ltd. // // Licensed under the same terms of Redis and ServiceStack: new BSD license. // namespace ServiceStack.Redis { public enum RedisKeyType { None, String, List, Set, SortedSet, Hash } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/0000755000175000017500000000000012146506550025770 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/IPersistenceProviderManager.cs0000644000175000017500000000037212146506550033724 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.DataAccess { /// /// Manages a connection to a persistance provider /// public interface IPersistenceProviderManager : IDisposable { IPersistenceProvider GetProvider(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/IQueryableByComparer.cs0000644000175000017500000000027012146506550032344 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace ServiceStack.DataAccess { public interface IQueryableByComparer { IList Query(IComparer comparer); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/IQueryablePersistenceProvider.cs0000644000175000017500000000042712146506550034304 0ustar00meebeymeebey00000000000000using System.Collections.Generic; using ServiceStack.DataAccess.Criteria; namespace ServiceStack.DataAccess { public interface IQueryablePersistenceProvider : IPersistenceProvider, IQueryable { IList GetAll(ICriteria criteria) where T : class, new(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/Criteria/0000755000175000017500000000000012146506550027532 5ustar00meebeymeebey00000000000000IOrderDescendingCriteria.cs0000644000175000017500000000022712146506550034636 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/Criterianamespace ServiceStack.DataAccess.Criteria { public interface IOrderDescendingCriteria : ICriteria { string OrderedDescendingBy { get; } } }IOrderAscendingCriteria.cs0000644000175000017500000000022512146506550034464 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/Criterianamespace ServiceStack.DataAccess.Criteria { public interface IOrderAscendingCriteria : ICriteria { string OrderedAscendingBy { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/Criteria/ICriteria.cs0000644000175000017500000000012512146506550031732 0ustar00meebeymeebey00000000000000namespace ServiceStack.DataAccess.Criteria { public interface ICriteria { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/Criteria/PagingCriteria.cs0000644000175000017500000000053712146506550032756 0ustar00meebeymeebey00000000000000namespace ServiceStack.DataAccess.Criteria { public class PagingCriteria : IPagingCriteria { public uint ResultOffset { get; private set; } public uint ResultLimit { get; private set; } public PagingCriteria(uint resultOffset, uint resultLimit) { this.ResultOffset = resultOffset; this.ResultLimit = resultLimit; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/Criteria/IPagingCriteria.cs0000644000175000017500000000024212146506550033060 0ustar00meebeymeebey00000000000000namespace ServiceStack.DataAccess.Criteria { public interface IPagingCriteria : ICriteria { uint ResultOffset { get; } uint ResultLimit { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/DataAccessException.cs0000644000175000017500000000106312146506550032171 0ustar00meebeymeebey00000000000000using System; using System.Runtime.Serialization; namespace ServiceStack.DataAccess { public class DataAccessException : Exception { public DataAccessException() { } public DataAccessException(string message) : base(message) { } public DataAccessException(string message, Exception innerException) : base(message, innerException) { } #if !SILVERLIGHT && !MONOTOUCH && !XBOX protected DataAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { } #endif } }IPersistenceProviderManagerFactory.cs0000644000175000017500000000026412146506550035175 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccessnamespace ServiceStack.DataAccess { public interface IPersistenceProviderManagerFactory { IPersistenceProviderManager CreateProviderManager(string connectionString); } }IBasicPersistenceProvider.Generic.cs0000644000175000017500000000114712146506550034670 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccessusing System; using System.Collections; using System.Collections.Generic; namespace ServiceStack.DataAccess { /// /// For providers that want a cleaner API with a little more perf /// /// public interface IBasicPersistenceProvider : IDisposable { T GetById(object id); IList GetByIds(IEnumerable ids); IList GetAll(); T Store(T entity); void StoreAll(IEnumerable entities); void Delete(T entity); void DeleteById(object id); void DeleteByIds(IEnumerable ids); void DeleteAll(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/IQueryableByPredicate.cs0000644000175000017500000000030512146506550032473 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.DataAccess { public interface IQueryableByPredicate { IList Query(Predicate match); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/IQueryable.cs0000644000175000017500000000070312146506550030361 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace ServiceStack.DataAccess { public interface IQueryable : IQueryableByExample, IQueryableByPredicate, IQueryableByComparer { //IList Query(); //IList Query(Type extent); //IList Query(Predicate match, IComparer comparer); //IList Query(Predicate match, Comparison comparison); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/IBasicPersistenceProvider.cs0000644000175000017500000000131412146506550033370 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; namespace ServiceStack.DataAccess { public interface IBasicPersistenceProvider : IDisposable { T GetById(object id) where T : class, new(); IList GetByIds(ICollection ids) where T : class, new(); T Store(T entity) where T : class, new(); void StoreAll(IEnumerable entities) where TEntity : class, new(); void Delete(T entity) where T : class, new(); void DeleteById(object id) where T : class, new(); void DeleteByIds(ICollection ids) where T : class, new(); void DeleteAll() where TEntity : class, new(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/ITransactionContext.cs0000644000175000017500000000026012146506550032260 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.DataAccess { public interface ITransactionContext : IDisposable { bool Commit(); bool Rollback(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/IQueryableByExample.cs0000644000175000017500000000026512146506550032173 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace ServiceStack.DataAccess { public interface IQueryableByExample { IList QueryByExample(object template); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/IResultSet.cs0000644000175000017500000000031412146506550030360 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace ServiceStack.DataAccess { public interface IResultSet { long Offset { get; } long TotalCount { get; } IEnumerable Results { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/IAggregatable.cs0000644000175000017500000000047112146506550030777 0ustar00meebeymeebey00000000000000namespace ServiceStack.DataAccess { public interface IAggregatable { double GetAvg(T entity, string fieldName); long GetCount(T entity, string fieldName); T GetMin(T entity, string fieldName); T GetMax(T entity, string fieldName); long GetSum(T entity, string fieldName); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/IPersistenceProvider.cs0000644000175000017500000000146012146506550032430 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; namespace ServiceStack.DataAccess { public interface IPersistenceProvider : IBasicPersistenceProvider, IDisposable { IList GetAll() where T : class, new(); IList GetAllOrderedBy(string fieldName, bool sortAsc) where T : class, new(); T FindByValue(string name, object value) where T : class, new(); IList FindAllByValue(string name, object value) where T : class, new(); IList FindByValues(string name, ICollection values) where T : class, new(); void Flush(); IList StoreAll(IList entities) where T : class, new(); void DeleteAll(IList entities) where T : class, new(); ITransactionContext BeginTransaction(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAccess/IHasDbConnection.cs0000644000175000017500000000030412146506550031426 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX using System.Data; namespace ServiceStack.DataAccess { public interface IHasDbConnection { IDbConnection DbConnection { get; } } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/0000755000175000017500000000000012146506550026727 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Command/0000755000175000017500000000000012146506550030305 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Command/ICommandVoid.cs0000644000175000017500000000017712146506550033152 0ustar00meebeymeebey00000000000000 namespace ServiceStack.DesignPatterns.Command { public interface ICommandVoid { void Execute(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Command/ICommand.cs0000644000175000017500000000021312146506550032317 0ustar00meebeymeebey00000000000000namespace ServiceStack.DesignPatterns.Command { public interface ICommand { ReturnType Execute(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Command/ICommandList.cs0000644000175000017500000000024012146506550033153 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace ServiceStack.DesignPatterns.Command { public interface ICommandList : ICommand> { } }ICommandIEnumerable.cs0000644000175000017500000000025612146506550034360 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Commandusing System.Collections.Generic; namespace ServiceStack.DesignPatterns.Command { public interface ICommandIEnumerable : ICommand> { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Command/ICommandExec.cs0000644000175000017500000000016512146506550033132 0ustar00meebeymeebey00000000000000namespace ServiceStack.DesignPatterns.Command { public interface ICommandExec : ICommand { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Command/ICommandIList.cs0000644000175000017500000000023012146506550033263 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace ServiceStack.DesignPatterns.Command { public interface ICommandIList : IList { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Model/0000755000175000017500000000000012146506550027767 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Model/IHasUserId.cs0000644000175000017500000000020012146506550032246 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.DesignPatterns.Model { public interface IHasUserId { Guid UserId { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Model/IHasId.cs0000644000175000017500000000014712146506550031421 0ustar00meebeymeebey00000000000000namespace ServiceStack.DesignPatterns.Model { public interface IHasId { T Id { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Model/IHasGuidId.cs0000644000175000017500000000016712146506550032234 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.DesignPatterns.Model { public interface IHasGuidId : IHasId { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Model/IHasNamedCollection.cs0000644000175000017500000000024412146506550034123 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace ServiceStack.DesignPatterns.Model { public interface IHasNamedCollection : IHasNamed> { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Model/IHasStringId.cs0000644000175000017500000000017512146506550032611 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.DesignPatterns.Model { public interface IHasStringId : IHasId { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Model/IHasNamedList.cs0000644000175000017500000000024712146506550032746 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.DesignPatterns.Model { public interface IHasNamedList : IHasNamed> { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Model/IHasNamed.cs0000644000175000017500000000020012146506550032077 0ustar00meebeymeebey00000000000000namespace ServiceStack.DesignPatterns.Model { public interface IHasNamed { T this[string listId] { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Model/IHasUserSession.cs0000644000175000017500000000024212146506550033343 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.DesignPatterns.Model { public interface IHasUserSession { Guid UserId { get; } Guid SessionId { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Model/IHasIntId.cs0000644000175000017500000000014412146506550032071 0ustar00meebeymeebey00000000000000namespace ServiceStack.DesignPatterns.Model { public interface IHasIntId : IHasId { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Model/IHasLongId.cs0000644000175000017500000000014612146506550032240 0ustar00meebeymeebey00000000000000namespace ServiceStack.DesignPatterns.Model { public interface IHasLongId : IHasId { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Serialization/0000755000175000017500000000000012146506550031544 5ustar00meebeymeebey00000000000000ITextSerializer.cs0000644000175000017500000000067012146506550035106 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Serializationusing System; using System.IO; namespace ServiceStack.DesignPatterns.Serialization { public interface ITextSerializer { object DeserializeFromString(string json, Type returnType); T DeserializeFromString(string json); T DeserializeFromStream(Stream stream); object DeserializeFromStream(Type type, Stream stream); string SerializeToString(T obj); void SerializeToStream(T obj, Stream stream); } }IStringSerializer.cs0000644000175000017500000000021212146506550035420 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Serializationnamespace ServiceStack.DesignPatterns.Serialization { public interface IStringSerializer { string Parse(TFrom from); } }IStringDeserializer.cs0000644000175000017500000000035112146506550035735 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Serializationusing System; namespace ServiceStack.DesignPatterns.Serialization { public interface IStringDeserializer { To Parse(string serializedText); object Parse(string serializedText, Type type); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Translator/0000755000175000017500000000000012146506550031060 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DesignPatterns/Translator/ITranslator.cs0000644000175000017500000000021612146506550033650 0ustar00meebeymeebey00000000000000namespace ServiceStack.DesignPatterns.Translator { public interface ITranslator { To Parse(From from); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Configuration/0000755000175000017500000000000012146506550026604 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Configuration/IContainerAdapter.cs0000644000175000017500000000074412146506550032474 0ustar00meebeymeebey00000000000000namespace ServiceStack.Configuration { /// /// Allow delegation of dependencies to other IOC's /// public interface IContainerAdapter { /// /// Resolve Property Dependency /// /// /// T TryResolve(); /// /// Resolve Constructor Dependency /// /// /// T Resolve(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Configuration/IFactoryProvider.cs0000644000175000017500000000044412146506550032370 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Configuration { public interface IFactoryProvider : IContainerAdapter, IDisposable { void Register(T provider); T Resolve(string name); T ResolveOptional(string name, T defaultValue); T Create(string name); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Configuration/ITypeFactory.cs0000644000175000017500000000021012146506550031506 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Configuration { public interface ITypeFactory { object CreateInstance(Type type); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Configuration/IRelease.cs0000644000175000017500000000020212146506550030616 0ustar00meebeymeebey00000000000000namespace ServiceStack.Configuration { public interface IRelease { void Release(object instance); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Configuration/IResourceManager.cs0000644000175000017500000000045512146506550032332 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace ServiceStack.Configuration { public interface IResourceManager { string GetString(string name); IList GetList(string key); IDictionary GetDictionary(string key); T Get(string name, T defaultValue); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Service/0000755000175000017500000000000012146506551025376 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Service/IRestClient.cs0000644000175000017500000000105312146506551030111 0ustar00meebeymeebey00000000000000using System.IO; namespace ServiceStack.Service { public interface IRestClient { TResponse Get(string relativeOrAbsoluteUrl); TResponse Delete(string relativeOrAbsoluteUrl); TResponse Post(string relativeOrAbsoluteUrl, object request); TResponse Put(string relativeOrAbsoluteUrl, object request); TResponse Patch(string relativeOrAbsoluteUrl, object request); TResponse PostFile(string relativeOrAbsoluteUrl, FileInfo fileToUpload, string mimeType); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Service/IRestClientAsync.cs0000644000175000017500000000133112146506551031106 0ustar00meebeymeebey00000000000000using System; using System.IO; namespace ServiceStack.Service { public interface IRestClientAsync : IDisposable { void SetCredentials(string userName, string password); void GetAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError); void DeleteAsync(string relativeOrAbsoluteUrl, Action onSuccess, Action onError); void PostAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError); void PutAsync(string relativeOrAbsoluteUrl, object request, Action onSuccess, Action onError); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Service/IOneWayClient.cs0000644000175000017500000000031412146506551030375 0ustar00meebeymeebey00000000000000namespace ServiceStack.Service { public interface IOneWayClient { void SendOneWay(object request); void SendOneWay(string relativeOrAbsoluteUrl, object request); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Service/IStreamWriter.cs0000644000175000017500000000021112146506551030460 0ustar00meebeymeebey00000000000000using System.IO; namespace ServiceStack.Service { public interface IStreamWriter { void WriteTo(Stream responseStream); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Service/IServiceClient.cs0000644000175000017500000000026212146506551030575 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Service { public interface IServiceClient : IServiceClientAsync, IOneWayClient #if !SILVERLIGHT , IReplyClient #endif { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Service/IReplyClient.cs0000644000175000017500000000141612146506551030272 0ustar00meebeymeebey00000000000000using System.IO; namespace ServiceStack.Service { public interface IReplyClient { /// /// Sends the specified request. /// /// The request. /// TResponse Send(object request); TResponse PostFile(string relativeOrAbsoluteUrl, FileInfo fileToUpload, string mimeType); TResponse PostFile(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, string mimeType); TResponse PostFileWithRequest(string relativeOrAbsoluteUrl, FileInfo fileToUpload, object request); TResponse PostFileWithRequest(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, object request); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Service/IServiceClientAsync.cs0000644000175000017500000000035012146506551031571 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Service { public interface IServiceClientAsync : IRestClientAsync { void SendAsync(object request, Action onSuccess, Action onError); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Service/IResponseStatus.cs0000644000175000017500000000033212146506551031036 0ustar00meebeymeebey00000000000000namespace ServiceStack.Service { public interface IResponseStatus { string ErrorCode { get; set; } string ErrorMessage { get; set; } string StackTrace { get; set; } bool IsSuccess { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Service/IResponseBase.cs0000644000175000017500000000042412146506551030427 0ustar00meebeymeebey00000000000000using System; using System.Runtime.Serialization; namespace ServiceStack.Service { public interface IResponseBase { int Version { get; set; } TResponseStatus ResponseStatus { get; set; } TData ResponseData { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAnnotations/0000755000175000017500000000000012146506550027064 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAnnotations/ReferencesAttribute.cs0000644000175000017500000000053312146506550033361 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.DataAnnotations { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class | AttributeTargets.Struct)] public class ReferencesAttribute : Attribute { public Type Type { get; set; } public ReferencesAttribute(Type type) { this.Type = type; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAnnotations/DefaultAttribute.cs0000644000175000017500000000125112146506550032662 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.DataAnnotations { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] public class DefaultAttribute : Attribute { public int IntValue { get; set; } public double DoubleValue { get; set; } public Type DefaultType { get; set; } public string DefaultValue { get; set; } public DefaultAttribute(int intValue) { this.IntValue = intValue; } public DefaultAttribute(double doubleValue) { this.DoubleValue = doubleValue; } public DefaultAttribute(Type defaultType, string defaultValue) { this.DefaultValue = defaultValue; this.DefaultType = defaultType; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAnnotations/CompositeIndexAttribute.cs0000644000175000017500000000126312146506550034233 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.DataAnnotations { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)] public class CompositeIndexAttribute : Attribute { public CompositeIndexAttribute() { this.FieldNames = new List(); } public CompositeIndexAttribute(params string[] fieldNames) { this.FieldNames = new List(fieldNames); } public CompositeIndexAttribute(bool unique, params string[] fieldNames) { this.Unique = unique; this.FieldNames = new List(fieldNames); } public List FieldNames { get; set; } public bool Unique { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAnnotations/IndexAttribute.cs0000644000175000017500000000057312146506550032353 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.DataAnnotations { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class | AttributeTargets.Struct)] public class IndexAttribute : Attribute { public IndexAttribute() { } public IndexAttribute(bool unique) { Unique = unique; } public bool Unique { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAnnotations/AliasAttribute.cs0000644000175000017500000000052512146506550032332 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.DataAnnotations { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class | AttributeTargets.Struct)] public class AliasAttribute : Attribute { public string Name { get; set; } public AliasAttribute(string name) { this.Name = name; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/DataAnnotations/AutoIncrementAttribute.cs0000644000175000017500000000027612146506550034061 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.DataAnnotations { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] public class AutoIncrementAttribute : Attribute { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Properties/0000755000175000017500000000000012146506551026132 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Properties/AssemblyInfo.cs0000644000175000017500000000311512146506551031054 0ustar00meebeymeebey00000000000000using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ServiceStack.Interfaces")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ServiceStack")] [assembly: AssemblyProduct("ServiceStack.Interfaces")] [assembly: AssemblyCopyright("Copyright © ServiceStack 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("d13ebd2a-6589-453d-bf31-4c744a59e993")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.9.8.0")] [assembly: ContractNamespace("http://schemas.servicestack.net/types", ClrNamespace = "ServiceStack.ServiceInterface.ServiceModel")] smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceStack.Interfaces.csproj0000644000175000017500000006046712146506551031705 0ustar00meebeymeebey00000000000000 Debug AnyCPU 9.0.30729 2.0 {42E1C8C0-A163-44CC-92B1-8F416F2C0B01} Library Properties ServiceStack ServiceStack.Interfaces 512 3.5 publish\ true Disk false Foreground 7 Days false false true 0 1.0.0.%2a false false true True full False bin\Debug\ DEBUG;TRACE prompt 4 AllRules.ruleset True pdbonly True bin\Release\ TRACE prompt 4 AllRules.ruleset bin\Release\ServiceStack.Interfaces.XML bin\MONOTOUCH\ TRACE bin\Release\ServiceStack.Interfaces.XML True pdbonly AnyCPU bin\Release\ServiceStack.Interfaces.dll.CodeAnalysisLog.xml true GlobalSuppressions.cs prompt AllRules.ruleset ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets false ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules 4 Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code False .NET Framework 3.5 SP1 Client Profile false False .NET Framework 3.5 SP1 true False Windows Installer 3.1 true smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/SearchIndex/0000755000175000017500000000000012146506551026173 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/SearchIndex/FullTextIndexFieldAttribute.cs0000644000175000017500000000162312146506551034113 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Text; using ServiceStack.SearchIndex; namespace ServiceStack.SearchIndex { public class FullTextIndexFieldAttribute : Attribute { public FullTextIndexAttribute FieldAttributes { get; private set; } public string MemberPath { get; set; } public FullTextIndexFieldAttribute() :this(FullTextIndexAttribute.StoreUncompressed | FullTextIndexAttribute.IndexTokenized) {} public FullTextIndexFieldAttribute(FullTextIndexAttribute fieldAttributes) { this.FieldAttributes = fieldAttributes; } public FullTextIndexFieldAttribute(FullTextIndexAttribute fieldAttributes, string memberPath) : this(fieldAttributes) { this.MemberPath = memberPath; } public FullTextIndexFieldAttribute(string memberTypePropertyName) : this() { this.MemberPath = memberTypePropertyName; } } }FullTextIndexDocumentAttribute.cs0000644000175000017500000000046212146506551034567 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/SearchIndexusing System; namespace ServiceStack.SearchIndex { public class FullTextIndexDocumentAttribute : Attribute { public Type ForType { get; set; } public FullTextIndexDocumentAttribute() {} public FullTextIndexDocumentAttribute(Type forType) { this.ForType = forType; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/SearchIndex/FullTextIndexAttribute.cs0000644000175000017500000000045212146506551033146 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.SearchIndex { [Flags] public enum FullTextIndexAttribute { IsDefault = 1, IsKey = 2, NoIndex = 4, IndexTokenized = 8, IndexUnTokenized = 16, //IndexNoNorms, NoStore = 32, StoreCompressed = 64, StoreUncompressed = 128, } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceInterface.ServiceModel/0000755000175000017500000000000012146506551031577 5ustar00meebeymeebey00000000000000ResponseStatus.cs0000644000175000017500000000440512146506551035054 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceInterface.ServiceModel/* // $Id: ResponseStatus.cs 11037 2010-02-03 12:36:14Z Demis Bellot $ // // Revision : $Revision: 11037 $ // Modified Date : $LastChangedDate: 2010-02-03 12:36:14 +0000 (Wed, 03 Feb 2010) $ // Modified By : $LastChangedBy: Demis Bellot $ // // (c) Copyright 2010 Liquidbit Ltd */ using System.Collections.Generic; using System.Runtime.Serialization; namespace ServiceStack.ServiceInterface.ServiceModel { /// /// Common ResponseStatus class that should be present on all response DTO's /// [DataContract] public class ResponseStatus { /// /// Initializes a new instance of the class. /// /// A response status without an errorcode == success /// public ResponseStatus() { } /// /// Initializes a new instance of the class. /// /// A response status with an errorcode == failure /// public ResponseStatus(string errorCode) { this.ErrorCode = errorCode; } /// /// Initializes a new instance of the class. /// /// A response status with an errorcode == failure /// public ResponseStatus(string errorCode, string message) : this(errorCode) { this.Message = message; } /// /// Holds the custom ErrorCode enum if provided in ValidationException /// otherwise will hold the name of the Exception type, e.g. typeof(Exception).Name /// /// A value of non-null means the service encountered an error while processing the request. /// [DataMember] public string ErrorCode { get; set; } /// /// A human friendly error message /// [DataMember] public string Message { get; set; } /// /// /// [DataMember] public string StackTrace { get; set; } /// /// For multiple detailed validation errors. /// Can hold a specific error message for each named field. /// [DataMember] public List Errors { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceInterface.ServiceModel/IHasAction.cs0000644000175000017500000000017212146506551034110 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceInterface.ServiceModel { public interface IHasAction { string Action { get; } } }ICacheByEtag.cs0000644000175000017500000000017212146506551034257 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceInterface.ServiceModelnamespace ServiceStack.ServiceInterface.ServiceModel { public interface ICacheByEtag { string Etag { get; } } }ResponseError.cs0000644000175000017500000000141412146506551034657 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceInterface.ServiceModel/* // $Id: ResponseError.cs 11037 2010-02-03 12:36:14Z Demis Bellot $ // // Revision : $Revision: 11037 $ // Modified Date : $LastChangedDate: 2010-02-03 12:36:14 +0000 (Wed, 03 Feb 2010) $ // Modified By : $LastChangedBy: Demis Bellot $ // // (c) Copyright 2010 Liquidbit Ltd */ using System.Runtime.Serialization; namespace ServiceStack.ServiceInterface.ServiceModel { /// /// Error information pertaining to a particular named field. /// Used for returning multiple field validation errors.s /// [DataContract] public class ResponseError { [DataMember] public string ErrorCode { get; set; } [DataMember] public string FieldName { get; set; } [DataMember] public string Message { get; set; } } }CollectionTypes.cs0000644000175000017500000000507112146506551035172 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceInterface.ServiceModelusing System; using System.Collections.Generic; using System.Runtime.Serialization; namespace ServiceStack.ServiceInterface.ServiceModel { /* * Useful collection DTO's that provide pretty Xml output for collection types, e.g. * * ArrayOfIntId Ids { get; set; } * ... => * * * 1 * 2 * 3 * */ [CollectionDataContract(ItemName = "String")] public partial class ArrayOfString : List { public ArrayOfString() { } public ArrayOfString(IEnumerable collection) : base(collection) { } public ArrayOfString(params string[] args) : base(args) { } } [CollectionDataContract(ItemName = "Id")] public partial class ArrayOfStringId : List { public ArrayOfStringId() { } public ArrayOfStringId(IEnumerable collection) : base(collection) { } public ArrayOfStringId(params string[] args) : base(args) { } } [CollectionDataContract(ItemName = "Guid")] public partial class ArrayOfGuid : List { public ArrayOfGuid() { } public ArrayOfGuid(IEnumerable collection) : base(collection) { } public ArrayOfGuid(params Guid[] args) : base(args) { } } [CollectionDataContract(ItemName = "Id")] public partial class ArrayOfGuidId : List { public ArrayOfGuidId() { } public ArrayOfGuidId(IEnumerable collection) : base(collection) { } public ArrayOfGuidId(params Guid[] args) : base(args) { } } [CollectionDataContract(ItemName = "Long")] public partial class ArrayOfLong : List { public ArrayOfLong() { } public ArrayOfLong(IEnumerable collection) : base(collection) { } public ArrayOfLong(params long[] args) : base(args) { } } [CollectionDataContract(ItemName = "Id")] public partial class ArrayOfLongId : List { public ArrayOfLongId() { } public ArrayOfLongId(IEnumerable collection) : base(collection) { } public ArrayOfLongId(params long[] args) : base(args) { } } [CollectionDataContract(ItemName = "Int")] public partial class ArrayOfInt : List { public ArrayOfInt() { } public ArrayOfInt(IEnumerable collection) : base(collection) { } public ArrayOfInt(params int[] args) : base(args) { } } [CollectionDataContract(ItemName = "Id")] public partial class ArrayOfIntId : List { public ArrayOfIntId () { } public ArrayOfIntId(IEnumerable collection) : base(collection) { } public ArrayOfIntId(params int[] args) : base(args) { } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceInterface.ServiceModel/Property.cs0000644000175000017500000000071612146506551033756 0ustar00meebeymeebey00000000000000using System.Collections.Generic; using System.Runtime.Serialization; namespace ServiceStack.ServiceInterface.ServiceModel { [DataContract] public class Property { public string Name { get; set; } public string Value { get; set; } } [CollectionDataContract(ItemName = "Property")] public class Properties : List { public Properties() { } public Properties(IEnumerable collection) : base(collection) { } } }IHasResponseStatus.cs0000644000175000017500000000037512146506551035623 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceInterface.ServiceModelnamespace ServiceStack.ServiceInterface.ServiceModel { /// /// Contract indication that the Response DTO has a ResponseStatus /// public interface IHasResponseStatus { ResponseStatus ResponseStatus { get; set; } } }ICacheByDateModified.cs0000644000175000017500000000023612146506551035716 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceInterface.ServiceModelusing System; namespace ServiceStack.ServiceInterface.ServiceModel { public interface ICacheByDateModified { DateTime? LastModified { get; } } }RequestLogEntry.cs0000644000175000017500000000201212146506551035156 0ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceInterface.ServiceModelusing System; using System.Collections.Generic; namespace ServiceStack.ServiceInterface.ServiceModel { /// /// A log entry added by the IRequestLogger /// public class RequestLogEntry { public long Id { get; set; } public DateTime DateTime { get; set; } public string HttpMethod { get; set; } public string AbsoluteUri { get; set; } public string PathInfo { get; set; } public object RequestDto { get; set; } public string UserAuthId { get; set; } public string SessionId { get; set; } public string IpAddress { get; set; } public string ForwardedFor { get; set; } public string Referer { get; set; } public Dictionary Headers { get; set; } public Dictionary FormData { get; set; } public Dictionary Items { get; set; } public object Session { get; set; } public object ResponseDto { get; set; } public object ErrorResponse { get; set; } public TimeSpan RequestDuration { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/0000755000175000017500000000000012146506550025363 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/Support/0000755000175000017500000000000012146506550027037 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/Support/Logging/0000755000175000017500000000000012146506551030426 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/Support/Logging/TestLogFactory.cs0000644000175000017500000000070212146506551033665 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Logging.Support.Logging { /// /// Creates a test Logger, that stores all log messages in a member list /// public class TestLogFactory : ILogFactory { public ILog GetLogger(Type type) { return new TestLogger(type); } public ILog GetLogger(string typeName) { return new TestLogger(typeName); } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/Support/Logging/TestLogger.cs0000644000175000017500000001035712146506551033042 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.Logging.Support.Logging { /// /// Tests logger which stores all log messages in a member list which can be examined later /// /// Made public so its testable /// public class TestLogger : ILog { /// /// Initializes a new instance of the class. /// /// The type. public TestLogger(string type) { } /// /// Initializes a new instance of the class. /// /// The type. public TestLogger(Type type) { } public enum Levels { DEBUG, ERROR, FATAL, INFO, WARN, }; static private List> _logs = new List>(); static public IList> GetLogs() { return _logs; } #region ILog Members public bool IsDebugEnabled { get { return true; } } /// /// Logs the specified message. /// /// The message. /// The exception. private static void Log(Levels level, object message, Exception exception) { string msg = message == null ? string.Empty : message.ToString(); if(exception != null) { msg += ", Exception: " + exception.Message; } _logs.Add(new KeyValuePair(level, msg)); } /// /// Logs the format. /// /// The message. /// The args. private static void LogFormat(Levels level, object message, params object[] args) { string msg = message == null ? string.Empty : message.ToString(); _logs.Add(new KeyValuePair(level, string.Format(msg, args))); } /// /// Logs the specified message. /// /// The message. private static void Log(Levels level, object message) { string msg = message == null ? string.Empty : message.ToString(); _logs.Add(new KeyValuePair(level, msg)); } public void Debug(object message, Exception exception) { Log(Levels.DEBUG, message, exception); } public void Debug(object message) { Log(Levels.DEBUG, message); } public void DebugFormat(string format, params object[] args) { LogFormat(Levels.DEBUG, format, args); } public void Error(object message, Exception exception) { Log(Levels.ERROR, message, exception); } public void Error(object message) { Log(Levels.ERROR, message); } public void ErrorFormat(string format, params object[] args) { LogFormat(Levels.ERROR, format, args); } public void Fatal(object message, Exception exception) { Log(Levels.FATAL, message, exception); } public void Fatal(object message) { Log(Levels.FATAL, message); } public void FatalFormat(string format, params object[] args) { LogFormat(Levels.FATAL, format, args); } public void Info(object message, Exception exception) { Log(Levels.INFO, message, exception); } public void Info(object message) { Log(Levels.INFO, message); } public void InfoFormat(string format, params object[] args) { LogFormat(Levels.INFO, format, args); } public void Warn(object message, Exception exception) { Log(Levels.WARN, message, exception); } public void Warn(object message) { Log(Levels.WARN, message); } public void WarnFormat(string format, params object[] args) { LogFormat(Levels.WARN, format, args); } #endregion } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/Support/Logging/NullDebugLogger.cs0000644000175000017500000000520312146506550033775 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Logging.Support.Logging { /// /// Default logger is to System.Diagnostics.Debug.Print /// /// Made public so its testable /// public class NullDebugLogger : ILog { /// /// Initializes a new instance of the class. /// /// The type. public NullDebugLogger(string type) { } /// /// Initializes a new instance of the class. /// /// The type. public NullDebugLogger(Type type) { } #region ILog Members /// /// Logs the specified message. /// /// The message. /// The exception. private static void Log(object message, Exception exception) { } /// /// Logs the format. /// /// The message. /// The args. private static void LogFormat(object message, params object[] args) { } /// /// Logs the specified message. /// /// The message. private static void Log(object message) { } public void Debug(object message, Exception exception) { } public bool IsDebugEnabled { get { return true; } } public void Debug(object message) { } public void DebugFormat(string format, params object[] args) { } public void Error(object message, Exception exception) { } public void Error(object message) { } public void ErrorFormat(string format, params object[] args) { } public void Fatal(object message, Exception exception) { } public void Fatal(object message) { } public void FatalFormat(string format, params object[] args) { } public void Info(object message, Exception exception) { } public void Info(object message) { } public void InfoFormat(string format, params object[] args) { } public void Warn(object message, Exception exception) { } public void Warn(object message) { } public void WarnFormat(string format, params object[] args) { } #endregion } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/Support/Logging/ConsoleLogger.cs0000644000175000017500000001014212146506550033514 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Logging.Support.Logging { /// /// Default logger is to Console.WriteLine /// /// Made public so its testable /// public class ConsoleLogger : ILog { const string DEBUG = "DEBUG: "; const string ERROR = "ERROR: "; const string FATAL = "FATAL: "; const string INFO = "INFO: "; const string WARN = "WARN: "; /// /// Initializes a new instance of the class. /// /// The type. public ConsoleLogger(string type) { } /// /// Initializes a new instance of the class. /// /// The type. public ConsoleLogger(Type type) { } #region ILog Members public bool IsDebugEnabled { get { return true; } } /// /// Logs the specified message. /// /// The message. /// The exception. private static void Log(object message, Exception exception) { string msg = message == null ? string.Empty : message.ToString(); if (exception != null) { msg += ", Exception: " + exception.Message; } Console.WriteLine(msg); } /// /// Logs the format. /// /// The message. /// The args. private static void LogFormat(object message, params object[] args) { string msg = message == null ? string.Empty : message.ToString(); Console.WriteLine(msg, args); } /// /// Logs the specified message. /// /// The message. private static void Log(object message) { string msg = message == null ? string.Empty : message.ToString(); Console.WriteLine(msg); } public void Debug(object message, Exception exception) { Log(DEBUG + message, exception); } public void Debug(object message) { Log(DEBUG + message); } public void DebugFormat(string format, params object[] args) { LogFormat(DEBUG + format, args); } public void Error(object message, Exception exception) { Log(ERROR + message, exception); } public void Error(object message) { Log(ERROR + message); } public void ErrorFormat(string format, params object[] args) { LogFormat(ERROR + format, args); } public void Fatal(object message, Exception exception) { Log(FATAL + message, exception); } public void Fatal(object message) { Log(FATAL + message); } public void FatalFormat(string format, params object[] args) { LogFormat(FATAL + format, args); } public void Info(object message, Exception exception) { Log(INFO + message, exception); } public void Info(object message) { Log(INFO + message); } public void InfoFormat(string format, params object[] args) { LogFormat(INFO + format, args); } public void Warn(object message, Exception exception) { Log(WARN + message, exception); } public void Warn(object message) { Log(WARN + message); } public void WarnFormat(string format, params object[] args) { LogFormat(WARN + format, args); } #endregion } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/Support/Logging/NullLogFactory.cs0000644000175000017500000000100412146506550033653 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Logging.Support.Logging { /// /// Creates a Debug Logger, that logs all messages to: System.Diagnostics.Debug /// /// Made public so its testable /// public class NullLogFactory : ILogFactory { public ILog GetLogger(Type type) { return new NullDebugLogger(type); } public ILog GetLogger(string typeName) { return new NullDebugLogger(typeName); } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/Support/Logging/DebugLogger.cs0000644000175000017500000001023012146506550033136 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Logging.Support.Logging { /// /// Default logger is to System.Diagnostics.Debug.WriteLine /// /// Made public so its testable /// public class DebugLogger : ILog { const string DEBUG = "DEBUG: "; const string ERROR = "ERROR: "; const string FATAL = "FATAL: "; const string INFO = "INFO: "; const string WARN = "WARN: "; /// /// Initializes a new instance of the class. /// /// The type. public DebugLogger(string type) { } /// /// Initializes a new instance of the class. /// /// The type. public DebugLogger(Type type) { } #region ILog Members /// /// Logs the specified message. /// /// The message. /// The exception. private static void Log(object message, Exception exception) { string msg = message == null ? string.Empty : message.ToString(); if (exception != null) { msg += ", Exception: " + exception.Message; } System.Diagnostics.Debug.WriteLine(msg); } /// /// Logs the format. /// /// The message. /// The args. private static void LogFormat(object message, params object[] args) { string msg = message == null ? string.Empty : message.ToString(); System.Diagnostics.Debug.WriteLine(string.Format(msg, args)); } /// /// Logs the specified message. /// /// The message. private static void Log(object message) { string msg = message == null ? string.Empty : message.ToString(); System.Diagnostics.Debug.WriteLine(msg); } public void Debug(object message, Exception exception) { Log(DEBUG + message, exception); } public bool IsDebugEnabled { get { return true; } } public void Debug(object message) { Log(DEBUG + message); } public void DebugFormat(string format, params object[] args) { LogFormat(DEBUG + format, args); } public void Error(object message, Exception exception) { Log(ERROR + message, exception); } public void Error(object message) { Log(ERROR + message); } public void ErrorFormat(string format, params object[] args) { LogFormat(ERROR + format, args); } public void Fatal(object message, Exception exception) { Log(FATAL + message, exception); } public void Fatal(object message) { Log(FATAL + message); } public void FatalFormat(string format, params object[] args) { LogFormat(FATAL + format, args); } public void Info(object message, Exception exception) { Log(INFO + message, exception); } public void Info(object message) { Log(INFO + message); } public void InfoFormat(string format, params object[] args) { LogFormat(INFO + format, args); } public void Warn(object message, Exception exception) { Log(WARN + message, exception); } public void Warn(object message) { Log(WARN + message); } public void WarnFormat(string format, params object[] args) { LogFormat(WARN + format, args); } #endregion } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/Support/Logging/DebugLogFactory.cs0000644000175000017500000000102212146506550033767 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Logging.Support.Logging { /// /// Creates a Debug Logger, that logs all messages to: System.Diagnostics.Debug /// /// Made public so its testable /// public class DebugLogFactory : ILogFactory { public ILog GetLogger(Type type) { return new DebugLogger(type); } public ILog GetLogger(string typeName) { return new DebugLogger(typeName); } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/Support/Logging/ConsoleLogFactory.cs0000644000175000017500000000101412146506550034344 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Logging.Support.Logging { /// /// Creates a Debug Logger, that logs all messages to: System.Diagnostics.Debug /// /// Made public so its testable /// public class ConsoleLogFactory : ILogFactory { public ILog GetLogger(Type type) { return new ConsoleLogger(type); } public ILog GetLogger(string typeName) { return new ConsoleLogger(typeName); } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/ILog.cs0000644000175000017500000000764312146506550026556 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Logging { /// /// Logs a message in a running application /// public interface ILog { /// /// Gets or sets a value indicating whether this instance is debug enabled. /// /// /// true if this instance is debug enabled; otherwise, false. /// bool IsDebugEnabled { get; } /// /// Logs a Debug message. /// /// The message. void Debug(object message); /// /// Logs a Debug message and exception. /// /// The message. /// The exception. void Debug(object message, Exception exception); /// /// Logs a Debug format message. /// /// The format. /// The args. void DebugFormat(string format, params object[] args); /// /// Logs a Error message. /// /// The message. void Error(object message); /// /// Logs a Error message and exception. /// /// The message. /// The exception. void Error(object message, Exception exception); /// /// Logs a Error format message. /// /// The format. /// The args. void ErrorFormat(string format, params object[] args); /// /// Logs a Fatal message. /// /// The message. void Fatal(object message); /// /// Logs a Fatal message and exception. /// /// The message. /// The exception. void Fatal(object message, Exception exception); /// /// Logs a Error format message. /// /// The format. /// The args. void FatalFormat(string format, params object[] args); /// /// Logs an Info message and exception. /// /// The message. void Info(object message); /// /// Logs an Info message and exception. /// /// The message. /// The exception. void Info(object message, Exception exception); /// /// Logs an Info format message. /// /// The format. /// The args. void InfoFormat(string format, params object[] args); /// /// Logs a Warning message. /// /// The message. void Warn(object message); /// /// Logs a Warning message and exception. /// /// The message. /// The exception. void Warn(object message, Exception exception); /// /// Logs a Warning format message. /// /// The format. /// The args. void WarnFormat(string format, params object[] args); } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/ILogFactory.cs0000644000175000017500000000112412146506550030072 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Logging { /// /// Factory to create ILog instances /// public interface ILogFactory { /// /// Gets the logger. /// /// The type. /// ILog GetLogger(Type type); /// /// Gets the logger. /// /// Name of the type. /// ILog GetLogger(string typeName); } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Logging/LogManager.cs0000644000175000017500000000275112146506550027733 0ustar00meebeymeebey00000000000000using System; using ServiceStack.Logging.Support.Logging; namespace ServiceStack.Logging { /// /// Logging API for this library. You can inject your own implementation otherwise /// will use the DebugLogFactory to write to System.Diagnostics.Debug /// public class LogManager { private static ILogFactory logFactory; /// /// Gets or sets the log factory. /// Use this to override the factory that is used to create loggers /// /// The log factory. public static ILogFactory LogFactory { get { if (logFactory == null) { return new DebugLogFactory(); } return logFactory; } set { logFactory = value; } } /// /// Gets the logger. /// /// The type. /// public static ILog GetLogger(Type type) { return LogFactory.GetLogger(type); } /// /// Gets the logger. /// /// Name of the type. /// public static ILog GetLogger(string typeName) { return LogFactory.GetLogger(typeName); } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/0000755000175000017500000000000012146506551026234 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IExpirable.cs0000644000175000017500000000023112146506551030603 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.WebHost.Endpoints.Support.Markdown { public interface IExpirable { DateTime? LastModified { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IHttpRequest.cs0000644000175000017500000000426112146506551031167 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !XBOX using System; using System.Collections.Generic; using System.Collections.Specialized; using System.IO; using System.Net; namespace ServiceStack.ServiceHost { /// /// A thin wrapper around ASP.NET or HttpListener's HttpRequest /// public interface IHttpRequest : IResolver { /// /// The underlying ASP.NET or HttpListener HttpRequest /// object OriginalRequest { get; } /// /// The name of the service being called (e.g. Request DTO Name) /// string OperationName { get; } /// /// The request ContentType /// string ContentType { get; } string HttpMethod { get; } string UserAgent { get; } IDictionary Cookies { get; } /// /// The expected Response ContentType for this request /// string ResponseContentType { get; set; } /// /// Attach any data to this request that all filters and services can access. /// Dictionary Items { get; } NameValueCollection Headers { get; } NameValueCollection QueryString { get; } NameValueCollection FormData { get; } /// /// The entire string contents of Request.InputStream /// /// string GetRawBody(); string RawUrl { get; } string AbsoluteUri { get; } /// /// The Remote Ip as reported by Request.UserHostAddress /// string UserHostAddress { get; } /// /// The Remote Ip as reported by X-Forwarded-For, X-Real-IP or Request.UserHostAddress /// string RemoteIp { get; } /// /// e.g. is https or not /// bool IsSecureConnection { get; } string[] AcceptTypes { get; } string PathInfo { get; } Stream InputStream { get; } long ContentLength { get; } /// /// Access to the multi-part/formdata files posted on this request /// IFile[] Files { get; } string ApplicationFilePath { get; } } } #endif smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRestDeleteService.cs0000644000175000017500000000056212146506551032260 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceHost { /// /// If the Service also implements this interface, /// IRestDeleteService.Delete() will be used instead of IService.Execute() for /// EndpointAttributes.HttpDelete requests /// /// public interface IRestDeleteService { object Delete(T request); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRequestContext.cs0000644000175000017500000000120212146506551031664 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Net; namespace ServiceStack.ServiceHost { public interface IRequestContext : IDisposable { T Get() where T : class; string IpAddress { get; } string GetHeader(string headerName); IDictionary Cookies { get; } EndpointAttributes EndpointAttributes { get; } IRequestAttributes RequestAttributes { get; } string ContentType { get; } string ResponseContentType { get; } string CompressionType { get; } string AbsoluteUri { get; } string PathInfo { get; } IFile[] Files { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/ICookies.cs0000644000175000017500000000047712146506551030300 0ustar00meebeymeebey00000000000000using System; using System.Net; namespace ServiceStack.ServiceHost { public interface ICookies { void DeleteCookie(string cookieName); void AddCookie(Cookie cookie); void AddPermanentCookie(string cookieName, string cookieValue); void AddSessionCookie(string cookieName, string cookieValue); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRestService.cs0000644000175000017500000000052112146506551031130 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceHost { /// /// Utility interface that implements all Rest operations /// /// public interface IRestService : IRestGetService, IRestPostService, IRestPutService, IRestDeleteService, IRestPatchService { } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/RouteAttribute.cs0000644000175000017500000001061612146506551031551 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ServiceStack.ServiceHost { /// /// Used to decorate Request DTO's to associate a RESTful request /// path mapping with a service. Multiple attributes can be applied to /// each request DTO, to map multiple paths to the service. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] public class RouteAttribute : Attribute { /// /// Initializes an instance of the class. /// /// /// The path template to map to the request. See /// RouteAttribute.Path /// for details on the correct format. /// public RouteAttribute(string path) : this(path, null) { } /// /// Initializes an instance of the class. /// /// /// The path template to map to the request. See /// RouteAttribute.Path /// for details on the correct format. /// /// A comma-delimited list of HTTP verbs supported by the /// service. If unspecified, all verbs are assumed to be supported. public RouteAttribute(string path, string verbs) { Path = path; Verbs = verbs; } /// /// Gets or sets the path template to be mapped to the request. /// /// /// A value providing the path mapped to /// the request. Never . /// /// /// Some examples of valid paths are: /// /// /// "/Inventory" /// "/Inventory/{Category}/{ItemId}" /// "/Inventory/{ItemPath*}" /// /// /// Variables are specified within "{}" /// brackets. Each variable in the path is mapped to the same-named property /// on the request DTO. At runtime, ServiceStack will parse the /// request URL, extract the variable values, instantiate the request DTO, /// and assign the variable values into the corresponding request properties, /// prior to passing the request DTO to the service object for processing. /// /// It is not necessary to specify all request properties as /// variables in the path. For unspecified properties, callers may provide /// values in the query string. For example: the URL /// "http://services/Inventory?Category=Books&ItemId=12345" causes the same /// request DTO to be processed as "http://services/Inventory/Books/12345", /// provided that the paths "/Inventory" (which supports the first URL) and /// "/Inventory/{Category}/{ItemId}" (which supports the second URL) /// are both mapped to the request DTO. /// /// Please note that while it is possible to specify property values /// in the query string, it is generally considered to be less RESTful and /// less desirable than to specify them as variables in the path. Using the /// query string to specify property values may also interfere with HTTP /// caching. /// /// The final variable in the path may contain a "*" suffix /// to grab all remaining segments in the path portion of the request URL and assign /// them to a single property on the request DTO. /// For example, if the path "/Inventory/{ItemPath*}" is mapped to the request DTO, /// then the request URL "http://services/Inventory/Books/12345" will result /// in a request DTO whose ItemPath property contains "Books/12345". /// You may only specify one such variable in the path, and it must be positioned at /// the end of the path. /// public string Path { get; set; } /// /// Gets or sets a comma-delimited list of HTTP verbs supported by the service, such as /// "GET,PUT,POST,DELETE". /// /// /// A providing a comma-delimited list of HTTP verbs supported /// by the service, or empty if all verbs are supported. /// public string Verbs { get; set; } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRequiresHttpRequest.cs0000644000175000017500000000034312146506551032704 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ServiceStack.ServiceHost { public interface IRequiresHttpRequest { IHttpRequest HttpRequest { get; set; } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IContentTypeReader.cs0000644000175000017500000000101712146506551032272 0ustar00meebeymeebey00000000000000using System; using System.IO; namespace ServiceStack.ServiceHost { public interface IContentTypeReader { object DeserializeFromString(string contentType, Type type, string request); object DeserializeFromStream(string contentType, Type type, Stream requestStream); StreamDeserializerDelegate GetStreamDeserializer(string contentType); } public delegate object TextDeserializerDelegate(Type type, string dto); public delegate object StreamDeserializerDelegate(Type type, Stream fromStream); }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRestPath.cs0000644000175000017500000000042212146506551030424 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.ServiceHost { public interface IRestPath { Type RequestType { get; } object CreateRequest(string pathInfo, Dictionary queryStringAndFormData, object fromInstance); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRequiresRequestContext.cs0000644000175000017500000000035712146506551033416 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceHost { /// /// Implement on services that need access to the RequestContext /// public interface IRequiresRequestContext { IRequestContext RequestContext { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IService.cs0000644000175000017500000000046612146506551030302 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceHost { /// /// Base interface all webservices need to implement. /// For simplicity this is the only interface you need to implement /// /// public interface IService { object Execute(T request); } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRestPutService.cs0000644000175000017500000000054312146506551031625 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceHost { /// /// If the Service also implements this interface, /// IRestPutService.Put() will be used instead of IService.Execute() for /// EndpointAttributes.HttpPut requests /// /// public interface IRestPutService { object Put(T request); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IContentTypeWriter.cs0000644000175000017500000000152712146506551032352 0ustar00meebeymeebey00000000000000using System.IO; namespace ServiceStack.ServiceHost { public interface IContentTypeWriter { byte[] SerializeToBytes(IRequestContext requestContext, object response); string SerializeToString(IRequestContext requestContext, object response); void SerializeToStream(IRequestContext requestContext, object response, Stream toStream); void SerializeToResponse(IRequestContext requestContext, object response, IHttpResponse httpRes); ResponseSerializerDelegate GetResponseSerializer(string contentType); } public delegate string TextSerializerDelegate(object dto); public delegate void StreamSerializerDelegate(IRequestContext requestContext, object dto, Stream outputStream); public delegate void ResponseSerializerDelegate(IRequestContext requestContext, object dto, IHttpResponse httpRes); }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IHasRequestFilter.cs0000644000175000017500000000216712146506551032134 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX namespace ServiceStack.ServiceHost { /// /// This interface can be implemented by an attribute /// which adds an request filter for the specific request DTO the attribute marked. /// public interface IHasRequestFilter { /// /// Order in which Request Filters are executed. /// <0 Executed before global request filters /// >0 Executed after global request filters /// int Priority { get; } /// /// The request filter is executed before the service. /// /// The http request wrapper /// The http response wrapper /// The request DTO void RequestFilter(IHttpRequest req, IHttpResponse res, object requestDto); /// /// A new shallow copy of this filter is used on every request. /// /// IHasRequestFilter Copy(); } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IHasOptions.cs0000644000175000017500000000024412146506551030763 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace ServiceStack.ServiceHost { public interface IHasOptions { IDictionary Options { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRestGetService.cs0000644000175000017500000000054312146506551031574 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceHost { /// /// If the Service also implements this interface, /// IRestGetService.Get() will be used instead of IService.Execute() for /// EndpointAttributes.HttpGet requests /// /// public interface IRestGetService { object Get(T request); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IHasResponseFilter.cs0000644000175000017500000000205712146506551032300 0ustar00meebeymeebey00000000000000#if !SILVERLIGHT && !MONOTOUCH && !XBOX namespace ServiceStack.ServiceHost { /// /// This interface can be implemented by an attribute /// which adds an response filter for the specific response DTO the attribute marked. /// public interface IHasResponseFilter { /// /// Order in which Response Filters are executed. /// <0 Executed before global response filters /// >0 Executed after global response filters /// int Priority { get; } /// /// The response filter is executed after the service /// /// The http request wrapper /// The http response wrapper void ResponseFilter(IHttpRequest req, IHttpResponse res, object response); /// /// A new shallow copy of this filter is used on every request. /// /// IHasResponseFilter Copy(); } } #endifsmuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IHttpResult.cs0000644000175000017500000000212012146506551031005 0ustar00meebeymeebey00000000000000using System.Collections.Generic; using System.Net; namespace ServiceStack.ServiceHost { public interface IHttpResult : IHasOptions { /// /// The HTTP Response Status /// int Status { get; set; } /// /// The HTTP Response Status Code /// HttpStatusCode StatusCode { get; set; } /// /// The HTTP Status Description /// string StatusDescription { get; set; } /// /// The HTTP Response ContentType /// string ContentType { get; set; } /// /// Additional HTTP Headers /// Dictionary Headers { get; } /// /// Response DTO /// object Response { get; set; } /// /// if not provided, get's injected by ServiceStack /// IContentTypeWriter ResponseFilter { get; set; } /// /// Holds the request call context /// IRequestContext RequestContext { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IServiceController.cs0000644000175000017500000000245412146506551032345 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.ServiceHost { /// /// Responsible for executing the operation within the specified context. /// /// The operation types. public interface IServiceController { /// /// Returns a list of operation types available in this service /// /// The operation types. IList OperationTypes { get; } /// /// Returns a list of ALL operation types available in this service /// /// The operation types. IList AllOperationTypes { get; } /// /// Returns the first matching RestPath /// /// /// /// IRestPath GetRestPathForRequest(string httpMethod, string pathInfo); /// /// Allow the registration of custom routes /// IServiceRoutes Routes { get; } /// /// Executes the DTO request under the supplied requestContext. /// /// /// /// object Execute(object request, IRequestContext requestContext); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IResolver.cs0000644000175000017500000000037712146506551030504 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceHost { public interface IResolver { /// /// Resolve a dependency from the AppHost's IOC /// /// /// T TryResolve(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/EndpointAttributes.cs0000644000175000017500000000250412146506551032413 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.ServiceHost { [Flags] public enum EndpointAttributes { None = 0, All = AllNetworkAccessTypes | AllSecurityModes | AllHttpMethods | AllCallStyles | AllEndpointTypes, AllNetworkAccessTypes = External | Localhost | LocalSubnet, AllSecurityModes = Secure | InSecure, AllHttpMethods = HttpHead | HttpGet | HttpPost | HttpPut | HttpDelete, AllCallStyles = AsyncOneWay | SyncReply, AllEndpointTypes = Soap11 | Soap12 | Xml | Json | Jsv | ProtoBuf | Csv, InternalNetworkAccess = Localhost | LocalSubnet, //Whether it came from an Internal or External address Localhost = 1 << 0, LocalSubnet = 1 << 1, External = 1 << 2, //Called over a secure or insecure channel Secure = 1 << 3, InSecure = 1 << 4, //HTTP request type HttpHead = 1 << 5, HttpGet = 1 << 6, HttpPost = 1 << 7, HttpPut = 1 << 8, HttpDelete = 1 << 9, HttpPatch = 1 << 10, //Future 11,12 //Call Styles AsyncOneWay = 1 << 13, SyncReply = 1 << 14, //Different endpoints Soap11 = 1 << 15, Soap12 = 1 << 16, //POX Xml = 1 << 17, //Javascript Json = 1 << 18, //Jsv i.e. TypeSerializer Jsv = 1 << 19, //e.g. protobuf-net ProtoBuf = 1 << 20, //e.g. text/csv Csv = 1 << 21, Html = 1 << 22, Yaml = 1 << 23, } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IAsyncService.cs0000644000175000017500000000056512146506551031300 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceHost { /// /// If the Service also implements this interface, /// IAsyncService.ExecuteAsync() will be used instead of IService.Execute() for /// EndpointAttributes.AsyncOneWay requests /// /// public interface IAsyncService { object ExecuteAsync(T request); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/Feature.cs0000644000175000017500000000077312146506551030165 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.ServiceHost { [Flags] public enum Feature : int { None = 0, All = int.MaxValue, Soap = Soap11 | Soap12, Json = 1 << 0, Xml = 1 << 1, Jsv = 1 << 2, Soap11 = 1 << 3, Soap12 = 1 << 4, Csv = 1 << 5, Html = 1 << 6, CustomFormat = 1 << 7, Metadata = 1 << 8, Markdown = 1 << 9, Razor = 1 << 10, ProtoBuf = 1 << 11, } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRestPatchService.cs0000644000175000017500000000055312146506551032115 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceHost { /// /// If the Service also implements this interface, /// IRestPutService.Patch() will be used instead of IService.Execute() for /// EndpointAttributes.HttpPatch requests /// /// public interface IRestPatchService { object Patch(T request); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IFile.cs0000644000175000017500000000032612146506551027554 0ustar00meebeymeebey00000000000000using System.IO; namespace ServiceStack.ServiceHost { public interface IFile { string FileName { get; } long ContentLength { get; } string ContentType { get; } Stream InputStream { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IHttpResponse.cs0000644000175000017500000000252712146506551031340 0ustar00meebeymeebey00000000000000using System.IO; namespace ServiceStack.ServiceHost { /// /// A thin wrapper around ASP.NET or HttpListener's HttpResponse /// public interface IHttpResponse { /// /// The underlying ASP.NET or HttpListener HttpResponse /// object OriginalResponse { get; } int StatusCode { set; } string StatusDescription { set; } string ContentType { get; set; } ICookies Cookies { get; } void AddHeader(string name, string value); void Redirect(string url); Stream OutputStream { get; } void Write(string text); /// /// Signal that this response has been handled and no more processing should be done. /// When used in a request or response filter, no more filters or processing is done on this request. /// void Close(); /// /// Calls Response.End() on ASP.NET HttpResponse otherwise is an alias for Close(). /// Useful when you want to prevent ASP.NET to provide it's own custom error page. /// void End(); /// /// Response.Flush() and OutputStream.Flush() seem to have different behaviour in ASP.NET /// void Flush(); /// /// Gets a value indicating whether this instance is closed. /// bool IsClosed { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/ServiceAttribute.cs0000644000175000017500000000706612146506551032060 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.ServiceHost { /// /// Used to decorate Request DTO's to alter the behaviour of a service. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] public class ServiceAttribute : Attribute { /// /// Sets a single access restriction /// /// The restrict access to. public EndpointAttributes RestrictAccessTo { get { return this.RestrictAccessToScenarios.Length == 0 ? EndpointAttributes.All : this.RestrictAccessToScenarios[0]; } set { this.RestrictAccessToScenarios = new[] { value }; } } /// /// Set multiple access scenarios /// /// The restrict access to scenarios. public EndpointAttributes[] RestrictAccessToScenarios { get; private set; } public int? Version { get; set; } public ServiceAttribute() { this.RestrictAccessToScenarios = new EndpointAttributes[0]; } public ServiceAttribute(params EndpointAttributes[] restrictAccessToScenarios) : this() { if (restrictAccessToScenarios.Length == 0) { this.RestrictAccessTo = EndpointAttributes.All; return; } var scenarios = new List(); foreach (var restrictAccessToScenario in restrictAccessToScenarios) { var restrictAccessTo = EndpointAttributes.None; //Network access if (!HasAnyRestrictionsOf(restrictAccessToScenario, EndpointAttributes.AllNetworkAccessTypes)) { restrictAccessTo |= EndpointAttributes.AllNetworkAccessTypes; } else { restrictAccessTo |= (restrictAccessToScenario & EndpointAttributes.AllNetworkAccessTypes); } //Security if (!HasAnyRestrictionsOf(restrictAccessToScenario, EndpointAttributes.AllSecurityModes)) { restrictAccessTo |= EndpointAttributes.AllSecurityModes; } else { restrictAccessTo |= (restrictAccessToScenario & EndpointAttributes.AllSecurityModes); } //Http Method if (!HasAnyRestrictionsOf(restrictAccessToScenario, EndpointAttributes.AllHttpMethods)) { restrictAccessTo |= EndpointAttributes.AllHttpMethods; } else { restrictAccessTo |= (restrictAccessToScenario & EndpointAttributes.AllHttpMethods); } //Call style if (!HasAnyRestrictionsOf(restrictAccessToScenario, EndpointAttributes.AllCallStyles)) { restrictAccessTo |= EndpointAttributes.AllCallStyles; } else { restrictAccessTo |= (restrictAccessToScenario & EndpointAttributes.AllCallStyles); } //Endpoint if (!HasAnyRestrictionsOf(restrictAccessToScenario, EndpointAttributes.AllEndpointTypes)) { restrictAccessTo |= EndpointAttributes.AllEndpointTypes; } else { restrictAccessTo |= (restrictAccessToScenario & EndpointAttributes.AllEndpointTypes); } scenarios.Add(restrictAccessTo); } this.RestrictAccessToScenarios = scenarios.ToArray(); } static bool HasAnyRestrictionsOf(EndpointAttributes allRestrictions, EndpointAttributes restrictions) { return (allRestrictions & restrictions) != 0; } public ServiceAttribute(int version, params EndpointAttributes[] restrictAccessScenarios) : this(restrictAccessScenarios) { this.Version = version; } public bool HasNoAccessRestrictions { get { return this.RestrictAccessTo == EndpointAttributes.All; } } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRestPostService.cs0000644000175000017500000000055012146506551032000 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceHost { /// /// If the Service also implements this interface, /// IRestPostService.Post() will be used instead of IService.Execute() for /// EndpointAttributes.HttpPost requests /// /// public interface IRestPostService { object Post(T request); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRequestAttributes.cs0000644000175000017500000000024612146506551032375 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.ServiceHost { public interface IRequestAttributes { bool AcceptsGzip { get; } bool AcceptsDeflate { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRequiresRequestStream.cs0000644000175000017500000000051412146506551033220 0ustar00meebeymeebey00000000000000using System.IO; namespace ServiceStack.ServiceHost { /// /// Implement on Request DTOs that need access to the raw Request Stream /// public interface IRequiresRequestStream { /// /// The raw Http Request Input Stream /// Stream RequestStream { get; set; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/RestServiceAttribute.cs0000644000175000017500000000324112146506551032705 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.ServiceHost { /// /// Used to decorate Request DTO's to associate a RESTful request /// path mapping with a service. Multiple attributes can be applied to /// each request DTO, to map multiple paths to the service. /// [Obsolete("Use [Route] instead of [RestService].")] [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] public class RestServiceAttribute : RouteAttribute { /// /// Initializes an instance of the class. /// /// /// The path template to map to the request. See /// RestServiceAttribute.Path /// for details on the correct format. /// public RestServiceAttribute(string path) : base(path, null) { } /// /// Initializes an instance of the class. /// /// /// The path template to map to the request. See /// RestServiceAttribute.Path /// for details on the correct format. /// /// A comma-delimited list of HTTP verbs supported by the /// service. If unspecified, all verbs are assumed to be supported. public RestServiceAttribute(string path, string verbs) : base(path, verbs) { } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IContentTypeFilter.cs0000644000175000017500000000102312146506551032312 0ustar00meebeymeebey00000000000000using System.Collections.Generic; namespace ServiceStack.ServiceHost { public interface IContentTypeFilter : IContentTypeWriter, IContentTypeReader { Dictionary ContentTypeFormats { get; } void Register(string contentType, StreamSerializerDelegate streamSerializer, StreamDeserializerDelegate streamDeserializer); void Register(string contentType, ResponseSerializerDelegate responseSerializer, StreamDeserializerDelegate streamDeserializer); void ClearCustomFilters(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IServiceRoutes.cs0000644000175000017500000000467412146506551031511 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceHost { /// /// Allow the registration of user-defined routes for services /// public interface IServiceRoutes { /// /// Maps the specified REST path to the specified request DTO. /// /// The type of request DTO to map /// the path to. /// The path to map the request DTO to. /// See RestServiceAttribute.Path /// for details on the correct format. /// The same instance; /// never . IServiceRoutes Add(string restPath); /// /// Maps the specified REST path to the specified request DTO, and /// specifies the HTTP verbs supported by the path. /// /// The type of request DTO to map /// the path to. /// The path to map the request DTO to. /// See RestServiceAttribute.Path /// for details on the correct format. /// /// The comma-delimited list of HTTP verbs supported by the path, /// such as "GET,PUT,DELETE". Specify empty or /// to indicate that all verbs are supported. /// /// The same instance; /// never . IServiceRoutes Add(string restPath, string verbs); /// /// Maps the specified REST path to the specified request DTO, /// specifies the HTTP verbs supported by the path, and indicates /// the default MIME type of the returned response. /// /// /// The type of request DTO to map the path to. /// /// The path to map the request DTO to. /// See RestServiceAttribute.Path /// for details on the correct format. /// /// The comma-delimited list of HTTP verbs supported by the path, /// such as "GET,PUT,DELETE". /// /// The same instance; /// never . IServiceRoutes Add(System.Type requestType, string restPath, string verbs); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IHttpError.cs0000644000175000017500000000022412146506551030623 0ustar00meebeymeebey00000000000000namespace ServiceStack.ServiceHost { public interface IHttpError : IHttpResult { string Message { get; } string ErrorCode { get; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/ServiceHost/IRequestLogger.cs0000644000175000017500000000322112146506551031462 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using ServiceStack.ServiceInterface.ServiceModel; namespace ServiceStack.ServiceHost { /// /// Log every service request /// public interface IRequestLogger { /// /// Turn On/Off Session Tracking /// bool EnableSessionTracking { get; set; } /// /// Turn On/Off Tracking of Responses /// bool EnableResponseTracking { get; set; } /// /// Turn On/Off Tracking of Exceptions /// bool EnableErrorTracking { get; set; } /// /// Limit access to /requestlogs service to role /// string[] RequiredRoles { get; set; } /// /// Don't log requests of these types. /// Type[] ExcludeRequestDtoTypes { get; set; } /// /// Don't log request bodys for services with sensitive information. /// By default Auth and Registration requests are hidden. /// Type[] HideRequestBodyForRequestDtoTypes { get; set; } /// /// Log a request /// /// The RequestContext /// Request DTO /// Response DTO or Exception /// How long did the Request take void Log(IRequestContext requestContext, object requestDto, object response, TimeSpan elapsed); /// /// View the most recent logs /// /// /// List GetLatestLogs(int? take); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/OrmLite/0000755000175000017500000000000012146506551025351 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/OrmLite/DbConnectionFactory.cs0000644000175000017500000000124312146506551031575 0ustar00meebeymeebey00000000000000using System; using System.Data; namespace ServiceStack.OrmLite { public class DbConnectionFactory : IDbConnectionFactory { private readonly Func connectionFactoryFn; public DbConnectionFactory(Func connectionFactoryFn) { this.connectionFactoryFn = connectionFactoryFn; } public IDbConnection OpenDbConnection() { var dbConn = CreateDbConnection(); dbConn.Open(); return dbConn; } public IDbConnection CreateDbConnection() { return connectionFactoryFn(); } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/OrmLite/IDbConnectionFactory.cs0000644000175000017500000000031612146506551031706 0ustar00meebeymeebey00000000000000using System.Data; namespace ServiceStack.OrmLite { public interface IDbConnectionFactory { IDbConnection OpenDbConnection(); IDbConnection CreateDbConnection(); } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Translators/0000755000175000017500000000000012146506551026312 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Translators/TranslateMemberAttribute.cs0000644000175000017500000000064612146506551033620 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Translators { /// /// This changes the default behaviour for the /// [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] public class TranslateMemberAttribute : Attribute { public string PropertyName { get; set; } public TranslateMemberAttribute(string toPropertyName) { this.PropertyName = toPropertyName; } } }smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Translators/TranslateAttribute.cs0000644000175000017500000000255412146506551032470 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Text; namespace ServiceStack.Translators { /// /// This instructs the generator tool to generate translator methods for the types supplied. /// A {TypeName}.generated.cs partial class will be generated that contains the methods required /// to generate to and from that type. /// [AttributeUsage(AttributeTargets.Class)] public class TranslateAttribute : Attribute { public string SourceMethodPrefix { get; set; } public string TargetMethodPrefix { get; set; } public Type SourceType { get; set; } public Type TargetType { get; set; } public TranslateAttribute(Type targetType) : this(null, targetType) {} public TranslateAttribute(string sourceExtensionPrefix, Type targetType, string targetExtensionPrefix) : this(null, sourceExtensionPrefix, targetType, targetExtensionPrefix) { } protected TranslateAttribute(Type sourceType, Type targetType) { this.SourceType = sourceType; this.TargetType = targetType; } protected TranslateAttribute(Type sourceType, string sourceExtensionPrefix, Type targetType, string targetExtensionPrefix) { this.SourceType = sourceType; this.SourceMethodPrefix = sourceExtensionPrefix; this.TargetType = targetType; this.TargetMethodPrefix = targetExtensionPrefix; } } } smuxi-0.11/lib/ServiceStack/src/ServiceStack.Interfaces/Translators/TranslateExtensionAttribute.cs0000644000175000017500000000164412146506551034364 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Translators { /// /// This instructs the generator tool to generate translator extension methods for the types supplied. /// A {TypeName}.generated.cs static class will be generated that contains the extension methods required /// to generate to and from that type. /// /// The source type is what the type the attribute is decorated on which can only be resolved at runtime. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public class TranslateExtensionAttribute : TranslateAttribute { public TranslateExtensionAttribute(Type sourceType, Type targetType) : base(sourceType, targetType) {} public TranslateExtensionAttribute(Type sourceType, string sourceExtensionPrefix, Type targetType, string targetExtensionPrefix) :base(sourceType, sourceExtensionPrefix, targetType, targetExtensionPrefix) {} } } smuxi-0.11/lib/Makefile.in0000644000175000017500000012052312311344230016205 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgappdir)" DATA = $(pkgapp_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ /p:Configuration=Debug \ /p:SignAssembly=false /p:WarningLevel=0 /p:Warn=0 \ /p:OutputPath=$(abspath $(OUTPUT_DIR)) \ /p:BaseIntermediateOutputPath=$(abspath $(OBJECT_DIR))/ \ /p:IntermediateOutputPath=$(abspath $(OBJECT_DIR))/ \ /p:DocumentationFile= XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ SUBDIRS = $(MESSAGINGMENU_SHARP_SUBDIR) @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@MESSAGINGMENU_SHARP_SUBDIR = messagingmenu-sharp # HACK: override DIST_SUBDIRS so distcheck/distclean works on systems without # libmessaging-menu-dev installed @WITH_MESSAGINGMENU_SHARP_INCLUDED_FALSE@DIST_SUBDIRS = $(SUBDIRS) OUTPUT_DIR = $(top_builddir)/bin/$(PROFILE) OBJECT_DIR = $(OUTPUT_DIR)/obj SOURCE_PATTERNS = *.cs */*.cs */*/*.cs */*/*/*.cs */*/*/*/*.cs */*/*/*/*/*.cs SERVICESTACK_TEXT_SUBDIR = ServiceStack.Text SERVICESTACK_TEXT_SRCDIR = $(srcdir)/$(SERVICESTACK_TEXT_SUBDIR)/src/ServiceStack.Text SERVICESTACK_TEXT_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(SERVICESTACK_TEXT_SRCDIR)/$(pattern))) SERVICESTACK_TEXT_EXTRA_FILES = $(SERVICESTACK_TEXT_BUILD_FILE) SERVICESTACK_TEXT_ASSEMBLY_NAME = ServiceStack.Text.dll SERVICESTACK_TEXT_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(SERVICESTACK_TEXT_ASSEMBLY_NAME) SERVICESTACK_TEXT_BUILD_FILE = $(SERVICESTACK_TEXT_SRCDIR)/ServiceStack.Text.csproj SERVICESTACK_TEXT_XBUILD_FLAGS = $(XBUILD_FLAGS) SERVICESTACK_SUBDIR = ServiceStack SERVICESTACK_SRCDIR = $(srcdir)/$(SERVICESTACK_SUBDIR) SERVICESTACK_INTERFACES_SRCDIR = $(srcdir)/$(SERVICESTACK_SUBDIR)/src/ServiceStack.Interfaces SERVICESTACK_INTERFACES_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(SERVICESTACK_INTERFACES_SRCDIR)/$(pattern))) SERVICESTACK_INTERFACES_EXTRA_FILES = $(SERVICESTACK_INTERFACES_BUILD_FILE) SERVICESTACK_INTERFACES_ASSEMBLY_NAME = ServiceStack.Interfaces.dll SERVICESTACK_INTERFACES_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(SERVICESTACK_INTERFACES_ASSEMBLY_NAME) SERVICESTACK_INTERFACES_BUILD_FILE = $(SERVICESTACK_INTERFACES_SRCDIR)/ServiceStack.Interfaces.csproj SERVICESTACK_INTERFACES_XBUILD_FLAGS = $(XBUILD_FLAGS) SERVICESTACK_COMMON_SRCDIR = $(srcdir)/$(SERVICESTACK_SUBDIR)/src/ServiceStack.Common SERVICESTACK_COMMON_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(SERVICESTACK_COMMON_SRCDIR)/$(pattern))) SERVICESTACK_COMMON_EXTRA_FILES = $(SERVICESTACK_COMMON_BUILD_FILE) SERVICESTACK_COMMON_ASSEMBLY_NAME = ServiceStack.Common.dll SERVICESTACK_COMMON_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(SERVICESTACK_COMMON_ASSEMBLY_NAME) SERVICESTACK_COMMON_BUILD_FILE = $(SERVICESTACK_COMMON_SRCDIR)/ServiceStack.Common.csproj SERVICESTACK_COMMON_XBUILD_FLAGS = $(XBUILD_FLAGS) /property:DefineConstants="MONOTOUCH" EXTRA_SERVICESTACK_LIBS = \ $(SERVICESTACK_TEXT_ASSEMBLY_TARGET) $(SERVICESTACK_TEXT_ASSEMBLY_TARGET).mdb \ $(SERVICESTACK_INTERFACES_ASSEMBLY_TARGET) $(SERVICESTACK_INTERFACES_ASSEMBLY_TARGET).mdb \ $(SERVICESTACK_COMMON_ASSEMBLY_TARGET) $(SERVICESTACK_COMMON_ASSEMBLY_TARGET).mdb JSON_SUBDIR = Newtonsoft.Json JSON_SRCDIR = $(srcdir)/$(JSON_SUBDIR)/Src/Newtonsoft.Json JSON_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(JSON_SRCDIR)/$(pattern))) JSON_EXTRA_FILES = \ $(JSON_BUILD_FILE) \ $(JSON_SRCDIR)/Dynamic.snk JSON_CLEAN_FILES = $(OBJECT_DIR)/Newtonsoft.Json.Dynamic.snk JSON_ASSEMBLY_NAME = Newtonsoft.Json.dll JSON_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(JSON_ASSEMBLY_NAME) JSON_BUILD_FILE = $(JSON_SRCDIR)/Newtonsoft.Json.csproj JSON_XBUILD_FLAGS = $(XBUILD_FLAGS) TWITTERIZER_SUBDIR = Twitterizer TWITTERIZER_SRCDIR = $(srcdir)/$(TWITTERIZER_SUBDIR)/Twitterizer2 TWITTERIZER_SOURCE_FILES = $(foreach pattern, ../*.cs $(SOURCE_PATTERNS), $(wildcard $(TWITTERIZER_SRCDIR)/$(pattern))) TWITTERIZER_EXTRA_FILES = \ $(TWITTERIZER_BUILD_FILE) \ $(TWITTERIZER_SRCDIR)/Twitterizer2.snk \ $(TWITTERIZER_SRCDIR)/../CommonAssemblyInfo.cs \ $(TWITTERIZER_SRCDIR)/../GettingStarted.txt \ $(TWITTERIZER_SRCDIR)/../Json.NET.license.txt \ $(TWITTERIZER_SRCDIR)/../Twitterizer2.license.txt TWITTERIZER_CLEAN_FILES = \ $(OUTPUT_DIR)/.license.txt \ $(OUTPUT_DIR)/Twitterizer2.license.txt \ $(OUTPUT_DIR)/Json.NET.license.txt \ $(OUTPUT_DIR)/GettingStarted.txt TWITTERIZER_ASSEMBLY_NAME = Twitterizer2.dll TWITTERIZER_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(TWITTERIZER_ASSEMBLY_NAME) TWITTERIZER_BUILD_FILE = $(TWITTERIZER_SRCDIR)/Twitterizer2.csproj TWITTERIZER_XBUILD_FLAGS = $(XBUILD_FLAGS) /p:PostBuildEvent= JABBER_NET_SUBDIR = agsxmpp/agsxmpp JABBER_NET_SRCDIR = $(srcdir)/$(JABBER_NET_SUBDIR) JABBER_NET_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(JABBER_NET_SRCDIR)/$(pattern))) JABBER_NET_EXTRA_FILES = $(JABBER_NET_SRCDIR)/agsxmpp.csproj JABBER_NET_CLEAN_FILES = $(wildcard $(OBJECT_DIR)/*.bmp) JABBER_NET_ASSEMBLY_NAME = agsxmpp.dll JABBER_NET_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(JABBER_NET_ASSEMBLY_NAME) JABBER_NET_BUILD_FILE = $(JABBER_NET_SRCDIR)/agsxmpp.csproj JABBER_NET_XBUILD_FLAGS = $(XBUILD_FLAGS) /property:DefineConstants="TRACE,DEBUG,SSL,STRINGPREP,MONO" STARKSOFTPROXY_SUBDIR = StarkSoftProxy STARKSOFTPROXY_SRCDIR = $(srcdir)/$(STARKSOFTPROXY_SUBDIR) STARKSOFTPROXY_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(STARKSOFTPROXY_SRCDIR)/$(pattern))) STARKSOFTPROXY_EXTRA_FILES = $(STARKSOFTPROXY_SRCDIR)/StarkSoftProxy.csproj STARKSOFTPROXY_CLEAN_FILES = STARKSOFTPROXY_ASSEMBLY_NAME = StarkSoftProxy.dll STARKSOFTPROXY_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(STARKSOFTPROXY_ASSEMBLY_NAME) STARKSOFTPROXY_BUILD_FILE = $(STARKSOFTPROXY_SRCDIR)/StarkSoftProxy.csproj STARKSOFTPROXY_XBUILD_FLAGS = $(XBUILD_FLAGS) SMARTIRC4NET_SUBDIR = SmartIrc4net SMARTIRC4NET_SRCDIR = $(srcdir)/$(SMARTIRC4NET_SUBDIR) SMARTIRC4NET_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(SMARTIRC4NET_SRCDIR)/$(pattern))) SMARTIRC4NET_EXTRA_FILES = $(SMARTIRC4NET_SRCDIR)/SmartIrc4net.csproj SMARTIRC4NET_CLEAN_FILES = SMARTIRC4NET_ASSEMBLY_NAME = Meebey.SmartIrc4net.dll SMARTIRC4NET_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(SMARTIRC4NET_ASSEMBLY_NAME) SMARTIRC4NET_BUILD_FILE = $(SMARTIRC4NET_SRCDIR)/SmartIrc4net.csproj SMARTIRC4NET_XBUILD_FLAGS = $(XBUILD_FLAGS) DB4O_SUBDIR = db4o-net DB4O_SRCDIR = $(srcdir)/$(DB4O_SUBDIR)/Db4objects.Db4o DB4O_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(DB4O_SRCDIR)/$(pattern))) DB4O_EXTRA_FILES = $(DB4O_BUILD_FILE) DB4O_ASSEMBLY_NAME = Db4objects.Db4o.dll DB4O_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(DB4O_ASSEMBLY_NAME) DB4O_BUILD_FILE = $(DB4O_SRCDIR)/Db4objects.Db4o-2008.csproj DB4O_XBUILD_FLAGS = $(XBUILD_FLAGS) /property:DefineConstants="NET_3_5,MONO,EMBEDDED" #DB4O_INSTR_SRCDIR = $(srcdir)/$(DB4O_SUBDIR)/Db4objects.Db4o.Instrumentation #DB4O_INSTR_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(DB4O_INSTR_SRCDIR)/$(pattern))) #DB4O_INSTR_ASSEMBLY_NAME = Db4objects.Db4o.Instrumentation.dll #DB4O_INSTR_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(DB4O_INSTR_ASSEMBLY_NAME) #DB4O_INSTR_BUILD_FILE = $(DB4O_INSTR_SRCDIR)/Db4objects.Db4o.Instrumentation-2008.csproj #DB4O_INSTR_XBUILD_FLAGS = $(DB4O_XBUILD_FLAGS) #DB4O_NQ_SRCDIR = $(srcdir)/$(DB4O_SUBDIR)/Db4objects.Db4o.NativeQueries #DB4O_NQ_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(DB4O_NQ_SRCDIR)/$(pattern))) #DB4O_NQ_ASSEMBLY_NAME = Db4objects.Db4o.NativeQueries.dll #DB4O_NQ_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(DB4O_NQ_ASSEMBLY_NAME) #DB4O_NQ_BUILD_FILE = $(DB4O_NQ_SRCDIR)/Db4objects.Db4o.NativeQueries-2008.csproj #DB4O_NQ_XBUILD_FLAGS = $(DB4O_XBUILD_FLAGS) SIGNALR_CLIENT_SUBDIR = SignalR SIGNALR_CLIENT_SRCDIR = $(srcdir)/$(SIGNALR_CLIENT_SUBDIR)/src/Microsoft.AspNet.SignalR.Client SIGNALR_CLIENT_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(SIGNALR_CLIENT_SRCDIR)/$(pattern))) \ $(foreach file, ../Common/CommonAssemblyInfo.cs ../Common/CommonVersionInfo.cs ../Microsoft.AspNet.SignalR.Core/Infrastructure/CancellationTokenExtensions.cs ../Microsoft.AspNet.SignalR.Core/Infrastructure/DisposableAction.cs ../Microsoft.AspNet.SignalR.Core/Infrastructure/Disposer.cs ../Microsoft.AspNet.SignalR.Core/Infrastructure/ExceptionsExtensions.cs ../Microsoft.AspNet.SignalR.Core/TaskAsyncHelper.cs, $(SIGNALR_CLIENT_SRCDIR)/$(file)) SIGNALR_CLIENT_EXTRA_FILES = \ $(SIGNALR_CLIENT_BUILD_FILE) \ $(SIGNALR_CLIENT_SRCDIR)/Resources.resx \ $(SIGNALR_CLIENT_SRCDIR)/../Common/Microsoft.AspNet.SignalR.targets #SIGNALR_CLIENT_CLEAN_FILES = $(OBJECT_DIR)/Newtonsoft.Json.Dynamic.snk SIGNALR_CLIENT_ASSEMBLY_NAME = Microsoft.AspNet.SignalR.Client.dll SIGNALR_CLIENT_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(SIGNALR_CLIENT_ASSEMBLY_NAME) SIGNALR_CLIENT_BUILD_FILE = $(SIGNALR_CLIENT_SRCDIR)/Microsoft.AspNet.SignalR.Client.csproj SIGNALR_CLIENT_XBUILD_FLAGS = $(XBUILD_FLAGS) /property:DefineConstants="MONO" JABBR_CLIENT_SUBDIR = JabbR JABBR_CLIENT_SRCDIR = $(srcdir)/$(JABBR_CLIENT_SUBDIR)/JabbR.Client JABBR_CLIENT_SOURCE_FILES = $(foreach pattern, $(SOURCE_PATTERNS), $(wildcard $(JABBR_CLIENT_SRCDIR)/$(pattern))) JABBR_CLIENT_EXTRA_FILES = \ $(JABBR_CLIENT_BUILD_FILE) \ $(JABBR_CLIENT_SRCDIR)/../JabbR/Models/ClientMessage.cs \ $(JABBR_CLIENT_SRCDIR)/../JabbR/Models/ClientNotification.cs #JABBR_CLIENT_CLEAN_FILES = $(OBJECT_DIR)/Newtonsoft.Json.Dynamic.snk JABBR_CLIENT_ASSEMBLY_NAME = JabbR.Client.dll JABBR_CLIENT_ASSEMBLY_TARGET = $(OUTPUT_DIR)/$(JABBR_CLIENT_ASSEMBLY_NAME) JABBR_CLIENT_BUILD_FILE = $(JABBR_CLIENT_SRCDIR)/JabbR.Client.csproj JABBR_CLIENT_XBUILD_FLAGS = $(XBUILD_FLAGS) @ENABLE_ENGINE_JABBR_TRUE@EXTRA_JSON_LIBS = \ @ENABLE_ENGINE_JABBR_TRUE@ $(JSON_ASSEMBLY_TARGET) $(JSON_ASSEMBLY_TARGET).mdb # magic automake variables @ENABLE_ENGINE_TWITTER_TRUE@EXTRA_JSON_LIBS = \ @ENABLE_ENGINE_TWITTER_TRUE@ $(JSON_ASSEMBLY_TARGET) $(JSON_ASSEMBLY_TARGET).mdb @ENABLE_ENGINE_TWITTER_TRUE@EXTRA_TWITTER_LIBS = \ @ENABLE_ENGINE_TWITTER_TRUE@ $(TWITTERIZER_ASSEMBLY_TARGET) $(TWITTERIZER_ASSEMBLY_TARGET).mdb @ENABLE_ENGINE_XMPP_TRUE@EXTRA_XMPP_LIBS = \ @ENABLE_ENGINE_XMPP_TRUE@ $(JABBER_NET_ASSEMBLY_TARGET) $(JABBER_NET_ASSEMBLY_TARGET).mdb @ENABLE_ENGINE_JABBR_TRUE@EXTRA_JABBR_LIBS = \ @ENABLE_ENGINE_JABBR_TRUE@ $(SIGNALR_CLIENT_ASSEMBLY_TARGET) $(SIGNALR_CLIENT_ASSEMBLY_TARGET).mdb \ @ENABLE_ENGINE_JABBR_TRUE@ $(JABBR_CLIENT_ASSEMBLY_TARGET) $(JABBR_CLIENT_ASSEMBLY_TARGET).mdb @ENABLE_ENGINE_IRC_TRUE@EXTRA_IRC_LIBS = \ @ENABLE_ENGINE_IRC_TRUE@ $(SMARTIRC4NET_ASSEMBLY_TARGET) $(SMARTIRC4NET_ASSEMBLY_TARGET).mdb EXTRA_PROXY_LIBS = \ $(STARKSOFTPROXY_ASSEMBLY_TARGET) $(STARKSOFTPROXY_ASSEMBLY_TARGET).mdb @BUNDLE_DB4O_TRUE@EXTRA_DB4O_LIBS = \ @BUNDLE_DB4O_TRUE@ $(DB4O_ASSEMBLY_TARGET) $(DB4O_ASSEMBLY_TARGET).mdb # $(DB4O_INSTR_ASSEMBLY_TARGET) $(DB4O_INSTR_ASSEMBLY_TARGET).mdb \ # $(DB4O_NQ_ASSEMBLY_TARGET) $(DB4O_NQ_ASSEMBLY_TARGET).mdb pkgappdir = $(pkglibdir) pkgapp_DATA = \ $(EXTRA_SERVICESTACK_LIBS) \ $(EXTRA_JSON_LIBS) \ $(EXTRA_TWITTER_LIBS) \ $(EXTRA_XMPP_LIBS) \ $(EXTRA_DB4O_LIBS) \ $(EXTRA_IRC_LIBS) \ $(EXTRA_PROXY_LIBS) \ $(EXTRA_JABBR_LIBS) EXTRA_DIST = \ $(SERVICESTACK_TEXT_SRCDIR) $(SERVICESTACK_TEXT_EXTRA_FILES) \ $(SERVICESTACK_INTERFACES_SRCDIR) $(SERVICESTACK_INTERFACES_EXTRA_FILES) \ $(SERVICESTACK_COMMON_SRCDIR) $(SERVICESTACK_COMMON_EXTRA_FILES) \ $(JSON_SRCDIR) $(JSON_EXTRA_FILES) \ $(TWITTERIZER_SRCDIR) $(TWITTERIZER_EXTRA_FILES) \ $(JABBER_NET_SRCDIR) $(JABBER_NET_EXTRA_FILES) \ $(DB4O_SRCDIR) $(DB4O_EXTRA_FILES) \ $(STARKSOFTPROXY_SRCDIR) $(STARKSOFTPROXY_EXTRA_FILES) \ $(SMARTIRC4NET_SRCDIR) $(SMARTIRC4NET_EXTRA_FILES) \ $(SIGNALR_CLIENT_SOURCE_FILES) $(SIGNALR_CLIENT_EXTRA_FILES) \ $(JABBR_CLIENT_SOURCE_FILES) $(JABBR_CLIENT_EXTRA_FILES) # $(SERVICESTACK_TEXT_SOURCE_FILES) $(SERVICESTACK_TEXT_BUILD_FILE) \ # $(SERVICESTACK_INTERFACES_SOURCE_FILES) $(SERVICESTACK_INTERFACES_BUILD_FILE) \ # $(SERVICESTACK_COMMON_SOURCE_FILES) $(SERVICESTACK_COMMON_BUILD_FILE) \ # $(JSON_SOURCE_FILES) $(JSON_BUILD_FILE) $(JSON_SRCDIR)/Dynamic.snk \ # $(TWITTERIZER_SOURCE_FILES) $(TWITTERIZER_EXTRA_FILES) $(TWITTERIZER_BUILD_FILE) \ # $(JABBER_NET_SOURCE_FILES) $(JABBER_NET_EXTRA_FILES) $(JABBER_NET_BUILD_FILE) \ # $(DB4O_SOURCE_FILES) $(DB4O_BUILD_FILE) \ # $(DB4O_INSTR_SOURCE_FILES) $(DB4O_INSTR_BUILD_FILE) \ # $(DB4O_NQ_SOURCE_FILES) $(DB4O_NQ_BUILD_FILE) CLEANFILES = \ $(JSON_CLEAN_FILES) \ $(JABBER_NET_CLEAN_FILES) \ $(TWITTERIZER_CLEAN_FILES) \ $(SIGNALR_CLIENT_CLEAN_FILES) \ $(SMARTIRC4NET_CLEAN_FILES) \ $(STARKSOFTPROXY_CLEAN_FILES) \ $(JABBR_CLIENT_CLEAN_FILES) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgappDATA: $(pkgapp_DATA) @$(NORMAL_INSTALL) @list='$(pkgapp_DATA)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgappdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgappdir)" || exit $$?; \ done uninstall-pkgappDATA: @$(NORMAL_UNINSTALL) @list='$(pkgapp_DATA)'; test -n "$(pkgappdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgappdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgappDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgappDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool clean-local \ cscopelist-am ctags ctags-am distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkgappDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-pkgappDATA # end of magic $(SERVICESTACK_TEXT_ASSEMBLY_TARGET) $(SERVICESTACK_TEXT_ASSEMBLY_TARGET).mdb: $(SERVICESTACK_TEXT_BUILD_FILE) $(SERVICESTACK_TEXT_SOURCE_FILES) $(XBUILD) $(SERVICESTACK_TEXT_XBUILD_FLAGS) $(SERVICESTACK_TEXT_BUILD_FILE) $(SERVICESTACK_INTERFACES_ASSEMBLY_TARGET) $(SERVICESTACK_INTERFACES_ASSEMBLY_TARGET).mdb: $(SERVICESTACK_INTERFACES_BUILD_FILE) $(SERVICESTACK_INTERFACES_SOURCE_FILES) $(XBUILD) $(SERVICESTACK_INTERFACES_XBUILD_FLAGS) $(SERVICESTACK_INTERFACES_BUILD_FILE) $(SERVICESTACK_COMMON_ASSEMBLY_TARGET) $(SERVICESTACK_COMMON_ASSEMBLY_TARGET).mdb: $(SERVICESTACK_TEXT_ASSEMBLY_TARGET) $(SERVICESTACK_COMMON_BUILD_FILE) $(SERVICESTACK_COMMON_SOURCE_FILES) $(XBUILD) $(SERVICESTACK_COMMON_XBUILD_FLAGS) $(SERVICESTACK_COMMON_BUILD_FILE) $(JSON_ASSEMBLY_TARGET) $(JSON_ASSEMBLY_TARGET).mdb: $(JSON_BUILD_FILE) $(JSON_SOURCE_FILES) $(XBUILD) $(JSON_XBUILD_FLAGS) $(JSON_BUILD_FILE) $(TWITTERIZER_ASSEMBLY_TARGET) $(TWITTERIZER_ASSEMBLY_TARGET).mdb: $(TWITTERIZER_BUILD_FILE) $(TWITTERIZER_SOURCE_FILES) $(XBUILD) $(TWITTERIZER_XBUILD_FLAGS) $(TWITTERIZER_BUILD_FILE) $(JABBER_NET_ASSEMBLY_TARGET) $(JABBER_NET_ASSEMBLY_TARGET).mdb: $(JABBER_NET_BUILD_FILE) $(JABBER_NET_SOURCE_FILES) $(XBUILD) $(JABBER_NET_XBUILD_FLAGS) $(JABBER_NET_BUILD_FILE) $(SMARTIRC4NET_ASSEMBLY_TARGET) $(SMARTIRC4NET_ASSEMBLY_TARGET).mdb: $(SMARTIRC4NET_BUILD_FILE) $(SMARTIRC4NET_SOURCE_FILES) $(XBUILD) $(SMARTIRC4NET_XBUILD_FLAGS) $(SMARTIRC4NET_BUILD_FILE) $(STARKSOFTPROXY_ASSEMBLY_TARGET) $(STARKSOFTPROXY_ASSEMBLY_TARGET).mdb: $(STARKSOFTPROXY_BUILD_FILE) $(STARKSOFTPROXY_SOURCE_FILES) $(XBUILD) $(STARKSOFTPROXY_XBUILD_FLAGS) $(STARKSOFTPROXY_BUILD_FILE) $(DB4O_ASSEMBLY_TARGET) $(DB4O_ASSEMBLY_TARGET).mdb: $(DB4O_BUILD_FILE) $(DB4O_SOURCE_FILES) $(XBUILD) $(DB4O_XBUILD_FLAGS) $(DB4O_BUILD_FILE) #$(DB4O_INSTR_ASSEMBLY_TARGET) $(DB4O_INSTR_ASSEMBLY_TARGET).mdb: $(DB4O_INSTR_BUILD_FILE) $(DB4O_INSTR_SOURCE_FILES) # $(XBUILD) $(DB4O_INSTR_XBUILD_FLAGS) $(DB4O_INSTR_BUILD_FILE) #$(DB4O_NQ_ASSEMBLY_TARGET) $(DB4O_NQ_ASSEMBLY_TARGET).mdb: $(DB4O_NQ_BUILD_FILE) $(DB4O_NQ_SOURCE_FILES) # $(XBUILD) $(DB4O_NQ_XBUILD_FLAGS) $(DB4O_NQ_BUILD_FILE) $(SIGNALR_CLIENT_ASSEMBLY_TARGET) $(SIGNALR_CLIENT_ASSEMBLY_TARGET).mdb: $(SIGNALR_CLIENT_BUILD_FILE) $(SIGNALR_CLIENT_SOURCE_FILES) $(XBUILD) $(SIGNALR_CLIENT_XBUILD_FLAGS) $(SIGNALR_CLIENT_BUILD_FILE) $(JABBR_CLIENT_ASSEMBLY_TARGET) $(JABBR_CLIENT_ASSEMBLY_TARGET).mdb: $(JABBR_CLIENT_BUILD_FILE) $(JABBR_CLIENT_SOURCE_FILES) $(XBUILD) $(JABBR_CLIENT_XBUILD_FLAGS) $(JABBR_CLIENT_BUILD_FILE) clean-local: $(XBUILD) $(SERVICESTACK_TEXT_XBUILD_FLAGS) /t:Clean $(SERVICESTACK_TEXT_BUILD_FILE) $(XBUILD) $(SERVICESTACK_INTERFACES_XBUILD_FLAGS) /t:Clean $(SERVICESTACK_INTERFACES_BUILD_FILE) $(XBUILD) $(SERVICESTACK_COMMON_XBUILD_FLAGS) /t:Clean $(SERVICESTACK_COMMON_BUILD_FILE) @ENABLE_ENGINE_IRC_TRUE@ $(XBUILD) $(SMARTIRC4NET_XBUILD_FLAGS) /t:Clean $(SMARTIRC4NET_BUILD_FILE) $(XBUILD) $(STARKSOFTPROXY_XBUILD_FLAGS) /t:Clean $(STARKSOFTPROXY_BUILD_FILE) @ENABLE_ENGINE_TWITTER_TRUE@ $(XBUILD) $(JSON_XBUILD_FLAGS) /t:Clean $(JSON_BUILD_FILE) @ENABLE_ENGINE_TWITTER_TRUE@ $(XBUILD) $(TWITTERIZER_XBUILD_FLAGS) /t:Clean $(TWITTERIZER_BUILD_FILE) @ENABLE_ENGINE_XMPP_TRUE@ $(XBUILD) $(JABBER_NET_XBUILD_FLAGS) /t:Clean $(JABBER_NET_BUILD_FILE) @ENABLE_ENGINE_JABBR_TRUE@ $(XBUILD) $(JSON_XBUILD_FLAGS) /t:Clean $(JSON_BUILD_FILE) @ENABLE_ENGINE_JABBR_TRUE@ $(XBUILD) $(SIGNALR_CLIENT_XBUILD_FLAGS) /t:Clean $(SIGNALR_CLIENT_BUILD_FILE) @ENABLE_ENGINE_JABBR_TRUE@ $(XBUILD) $(JABBR_CLIENT_XBUILD_FLAGS) /t:Clean $(JABBR_CLIENT_BUILD_FILE) @BUNDLE_DB4O_TRUE@ $(XBUILD) $(DB4O_XBUILD_FLAGS) /t:Clean $(DB4O_BUILD_FILE) # $(XBUILD) $(DB4O_INSTR_XBUILD_FLAGS) /t:Clean $(DB4O_INSTR_BUILD_FILE) # $(XBUILD) $(DB4O_NQ_XBUILD_FLAGS) /t:Clean $(DB4O_NQ_BUILD_FILE) distdir: $(DISTFILES) $(DIST_SUBDIRS) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @for DISTFILE in $(DISTFILES); do \ if [ -d "$$DISTFILE" ]; then \ mkdir -p $(distdir)/$(srcdir)/$$DISTFILE; \ rsync -a \ --prune-empty-dirs \ --include='*/' \ --include='*.cs' \ --exclude='*' \ $$DISTFILE/ $(distdir)/$(srcdir)/$$DISTFILE; \ else \ DISTFILES="$$DISTFILES $$DISTFILE"; \ fi \ done; \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list="$$DISTFILES"; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -z "$$file"; then continue; fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/lib/ServiceStack.Text/0000755000175000017500000000000012311344237017455 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack.Text/src/0000755000175000017500000000000012311344237020244 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/0000755000175000017500000000000012311344240023547 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Jsv/0000755000175000017500000000000012146506553024326 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Jsv/JsvReader.Generic.cs0000644000175000017500000000444512146506553030124 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Reflection; using System.Threading; using ServiceStack.Text.Common; namespace ServiceStack.Text.Jsv { public static class JsvReader { internal static readonly JsReader Instance = new JsReader(); private static Dictionary ParseFnCache = new Dictionary(); public static ParseStringDelegate GetParseFn(Type type) { ParseFactoryDelegate parseFactoryFn; ParseFnCache.TryGetValue(type, out parseFactoryFn); if (parseFactoryFn != null) return parseFactoryFn(); var genericType = typeof(JsvReader<>).MakeGenericType(type); var mi = genericType.GetMethod("GetParseFn", BindingFlags.Public | BindingFlags.Static); parseFactoryFn = (ParseFactoryDelegate)Delegate.CreateDelegate(typeof(ParseFactoryDelegate), mi); Dictionary snapshot, newCache; do { snapshot = ParseFnCache; newCache = new Dictionary(ParseFnCache); newCache[type] = parseFactoryFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref ParseFnCache, newCache, snapshot), snapshot)); return parseFactoryFn(); } } public static class JsvReader { private static readonly ParseStringDelegate ReadFn; static JsvReader() { ReadFn = JsvReader.Instance.GetParseFn(); } public static ParseStringDelegate GetParseFn() { return ReadFn ?? Parse; } public static object Parse(string value) { if (ReadFn == null) { if (typeof(T).IsInterface) { throw new NotSupportedException("Can not deserialize interface type: " + typeof(T).Name); } } return value == null ? null : ReadFn(value); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Jsv/JsvDeserializeType.cs0000644000175000017500000000051612146506553030444 0ustar00meebeymeebey00000000000000using System; using System.Reflection; using ServiceStack.Text.Common; namespace ServiceStack.Text.Jsv { public static class JsvDeserializeType { public static SetPropertyDelegate GetSetPropertyMethod(Type type, PropertyInfo propertyInfo) { return TypeAccessor.GetSetPropertyMethod(type, propertyInfo); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Jsv/JsvSerializer.Generic.cs0000644000175000017500000000416312146506553031030 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Threading; using ServiceStack.Text.Common; namespace ServiceStack.Text.Jsv { public class JsvSerializer { Dictionary DeserializerCache = new Dictionary(); public T DeserializeFromString(string value, Type type) { ParseStringDelegate parseFn; if (DeserializerCache.TryGetValue(type, out parseFn)) return (T)parseFn(value); var genericType = typeof(T).MakeGenericType(type); var mi = genericType.GetMethod("DeserializeFromString", new[] { typeof(string) }); parseFn = (ParseStringDelegate)Delegate.CreateDelegate(typeof(ParseStringDelegate), mi); Dictionary snapshot, newCache; do { snapshot = DeserializerCache; newCache = new Dictionary(DeserializerCache); newCache[type] = parseFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref DeserializerCache, newCache, snapshot), snapshot)); return (T)parseFn(value); } public T DeserializeFromString(string value) { if (typeof(T) == typeof(string)) return (T)(object)value; return (T)JsvReader.Parse(value); } public void SerializeToWriter(T value, TextWriter writer) { JsvWriter.WriteObject(writer, value); } public string SerializeToString(T value) { if (value == null) return null; if (value is string) return value as string; var sb = new StringBuilder(); using (var writer = new StringWriter(sb)) { JsvWriter.WriteObject(writer, value); } return sb.ToString(); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Jsv/JsvWriter.Generic.cs0000644000175000017500000000565412146506553030201 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Threading; using ServiceStack.Text.Common; namespace ServiceStack.Text.Jsv { internal static class JsvWriter { public static readonly JsWriter Instance = new JsWriter(); private static Dictionary WriteFnCache = new Dictionary(); public static WriteObjectDelegate GetWriteFn(Type type) { try { WriteObjectDelegate writeFn; if (WriteFnCache.TryGetValue(type, out writeFn)) return writeFn; var genericType = typeof(JsvWriter<>).MakeGenericType(type); var mi = genericType.GetMethod("WriteFn", BindingFlags.Public | BindingFlags.Static); var writeFactoryFn = (Func)Delegate.CreateDelegate(typeof(Func), mi); writeFn = writeFactoryFn(); Dictionary snapshot, newCache; do { snapshot = WriteFnCache; newCache = new Dictionary(WriteFnCache); newCache[type] = writeFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref WriteFnCache, newCache, snapshot), snapshot)); return writeFn; } catch (Exception ex) { Tracer.Instance.WriteError(ex); throw; } } public static void WriteLateBoundObject(TextWriter writer, object value) { if (value == null) return; var writeFn = GetWriteFn(value.GetType()); var prevState = JsState.IsWritingDynamic; JsState.IsWritingDynamic = true; writeFn(writer, value); JsState.IsWritingDynamic = prevState; } public static WriteObjectDelegate GetValueTypeToStringMethod(Type type) { return Instance.GetValueTypeToStringMethod(type); } } /// /// Implement the serializer using a more static approach /// /// internal static class JsvWriter { private static readonly WriteObjectDelegate CacheFn; public static WriteObjectDelegate WriteFn() { return CacheFn ?? WriteObject; } static JsvWriter() { CacheFn = typeof(T) == typeof(object) ? JsvWriter.WriteLateBoundObject : JsvWriter.Instance.GetWriteFn(); } public static void WriteObject(TextWriter writer, object value) { CacheFn(writer, value); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Jsv/JsvTypeSerializer.cs0000644000175000017500000002320112146506553030311 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Globalization; using System.IO; using ServiceStack.Text.Common; using ServiceStack.Text.Json; namespace ServiceStack.Text.Jsv { internal class JsvTypeSerializer : ITypeSerializer { public static ITypeSerializer Instance = new JsvTypeSerializer(); public string TypeAttrInObject { get { return "{__type:"; } } public WriteObjectDelegate GetWriteFn() { return JsvWriter.WriteFn(); } public WriteObjectDelegate GetWriteFn(Type type) { return JsvWriter.GetWriteFn(type); } static readonly TypeInfo DefaultTypeInfo = new TypeInfo { EncodeMapKey = false }; public TypeInfo GetTypeInfo(Type type) { return DefaultTypeInfo; } public void WriteRawString(TextWriter writer, string value) { writer.Write(value.ToCsvField()); } public void WritePropertyName(TextWriter writer, string value) { writer.Write(value); } public void WriteBuiltIn(TextWriter writer, object value) { writer.Write(value); } public void WriteObjectString(TextWriter writer, object value) { if (value != null) { writer.Write(value.ToString().ToCsvField()); } } public void WriteException(TextWriter writer, object value) { writer.Write(((Exception)value).Message.ToCsvField()); } public void WriteString(TextWriter writer, string value) { writer.Write(value.ToCsvField()); } public void WriteDateTime(TextWriter writer, object oDateTime) { writer.Write(DateTimeSerializer.ToShortestXsdDateTimeString((DateTime)oDateTime)); } public void WriteNullableDateTime(TextWriter writer, object dateTime) { if (dateTime == null) return; writer.Write(DateTimeSerializer.ToShortestXsdDateTimeString((DateTime)dateTime)); } public void WriteGuid(TextWriter writer, object oValue) { writer.Write(((Guid)oValue).ToString("N")); } public void WriteNullableGuid(TextWriter writer, object oValue) { if (oValue == null) return; writer.Write(((Guid)oValue).ToString("N")); } public void WriteBytes(TextWriter writer, object oByteValue) { if (oByteValue == null) return; writer.Write(Convert.ToBase64String((byte[])oByteValue)); } public void WriteChar(TextWriter writer, object charValue) { if (charValue == null) return; writer.Write((char)charValue); } public void WriteByte(TextWriter writer, object byteValue) { if (byteValue == null) return; writer.Write((byte)byteValue); } public void WriteInt16(TextWriter writer, object intValue) { if (intValue == null) return; writer.Write((short)intValue); } public void WriteUInt16(TextWriter writer, object intValue) { if (intValue == null) return; writer.Write((ushort)intValue); } public void WriteInt32(TextWriter writer, object intValue) { if (intValue == null) return; writer.Write((int)intValue); } public void WriteUInt32(TextWriter writer, object uintValue) { if (uintValue == null) return; writer.Write((uint)uintValue); } public void WriteUInt64(TextWriter writer, object ulongValue) { if (ulongValue == null) return; writer.Write((ulong)ulongValue); } public void WriteInt64(TextWriter writer, object longValue) { if (longValue == null) return; writer.Write((long)longValue); } public void WriteBool(TextWriter writer, object boolValue) { if (boolValue == null) return; writer.Write((bool)boolValue); } public void WriteFloat(TextWriter writer, object floatValue) { if (floatValue == null) return; var floatVal = (float)floatValue; if (Equals(floatVal, float.MaxValue) || Equals(floatVal, float.MinValue)) writer.Write(floatVal.ToString("r", CultureInfo.InvariantCulture)); else writer.Write(floatVal.ToString(CultureInfo.InvariantCulture)); } public void WriteDouble(TextWriter writer, object doubleValue) { if (doubleValue == null) return; var doubleVal = (double)doubleValue; if (Equals(doubleVal, double.MaxValue) || Equals(doubleVal, double.MinValue)) writer.Write(doubleVal.ToString("r", CultureInfo.InvariantCulture)); else writer.Write(doubleVal.ToString(CultureInfo.InvariantCulture)); } public void WriteDecimal(TextWriter writer, object decimalValue) { if (decimalValue == null) return; writer.Write(((decimal)decimalValue).ToString(CultureInfo.InvariantCulture)); } public void WriteEnum(TextWriter writer, object enumValue) { if (enumValue == null) return; writer.Write(enumValue.ToString()); } public void WriteEnumFlags(TextWriter writer, object enumFlagValue) { if (enumFlagValue == null) return; var intVal = (int)enumFlagValue; writer.Write(intVal); } public void WriteLinqBinary(TextWriter writer, object linqBinaryValue) { #if !MONOTOUCH && !SILVERLIGHT && !XBOX WriteRawString(writer, Convert.ToBase64String(((System.Data.Linq.Binary)linqBinaryValue).ToArray())); #endif } public object EncodeMapKey(object value) { return value; } public ParseStringDelegate GetParseFn() { return JsvReader.Instance.GetParseFn(); } public ParseStringDelegate GetParseFn(Type type) { return JsvReader.GetParseFn(type); } public string ParseRawString(string value) { return value; } public string ParseString(string value) { return value.FromCsvField(); } public string EatTypeValue(string value, ref int i) { return EatValue(value, ref i); } public bool EatMapStartChar(string value, ref int i) { var success = value[i] == JsWriter.MapStartChar; if (success) i++; return success; } public string EatMapKey(string value, ref int i) { var tokenStartPos = i; var valueLength = value.Length; var valueChar = value[tokenStartPos]; switch (valueChar) { case JsWriter.QuoteChar: while (++i < valueLength) { valueChar = value[i]; if (valueChar != JsWriter.QuoteChar) continue; var isLiteralQuote = i + 1 < valueLength && value[i + 1] == JsWriter.QuoteChar; i++; //skip quote if (!isLiteralQuote) break; } return value.Substring(tokenStartPos, i - tokenStartPos); //Is Type/Map, i.e. {...} case JsWriter.MapStartChar: var endsToEat = 1; var withinQuotes = false; while (++i < valueLength && endsToEat > 0) { valueChar = value[i]; if (valueChar == JsWriter.QuoteChar) withinQuotes = !withinQuotes; if (withinQuotes) continue; if (valueChar == JsWriter.MapStartChar) endsToEat++; if (valueChar == JsWriter.MapEndChar) endsToEat--; } return value.Substring(tokenStartPos, i - tokenStartPos); } while (value[++i] != JsWriter.MapKeySeperator) { } return value.Substring(tokenStartPos, i - tokenStartPos); } public bool EatMapKeySeperator(string value, ref int i) { return value[i++] == JsWriter.MapKeySeperator; } public bool EatItemSeperatorOrMapEndChar(string value, ref int i) { if (i == value.Length) return false; var success = value[i] == JsWriter.ItemSeperator || value[i] == JsWriter.MapEndChar; i++; return success; } public string EatValue(string value, ref int i) { var tokenStartPos = i; var valueLength = value.Length; if (i == valueLength) return null; var valueChar = value[i]; var withinQuotes = false; var endsToEat = 1; switch (valueChar) { //If we are at the end, return. case JsWriter.ItemSeperator: case JsWriter.MapEndChar: return null; //Is Within Quotes, i.e. "..." case JsWriter.QuoteChar: while (++i < valueLength) { valueChar = value[i]; if (valueChar != JsWriter.QuoteChar) continue; var isLiteralQuote = i + 1 < valueLength && value[i + 1] == JsWriter.QuoteChar; i++; //skip quote if (!isLiteralQuote) break; } return value.Substring(tokenStartPos, i - tokenStartPos).FromCsvField(); //Is Type/Map, i.e. {...} case JsWriter.MapStartChar: while (++i < valueLength && endsToEat > 0) { valueChar = value[i]; if (valueChar == JsWriter.QuoteChar) withinQuotes = !withinQuotes; if (withinQuotes) continue; if (valueChar == JsWriter.MapStartChar) endsToEat++; if (valueChar == JsWriter.MapEndChar) endsToEat--; } return value.Substring(tokenStartPos, i - tokenStartPos); //Is List, i.e. [...] case JsWriter.ListStartChar: while (++i < valueLength && endsToEat > 0) { valueChar = value[i]; if (valueChar == JsWriter.QuoteChar) withinQuotes = !withinQuotes; if (withinQuotes) continue; if (valueChar == JsWriter.ListStartChar) endsToEat++; if (valueChar == JsWriter.ListEndChar) endsToEat--; } return value.Substring(tokenStartPos, i - tokenStartPos); } //Is Value while (++i < valueLength) { valueChar = value[i]; if (valueChar == JsWriter.ItemSeperator || valueChar == JsWriter.MapEndChar) { break; } } return value.Substring(tokenStartPos, i - tokenStartPos); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/ServiceStack.Text.csproj0000644000175000017500000002465712146506553030335 0ustar00meebeymeebey00000000000000 Debug AnyCPU 9.0.30729 2.0 {579B3FDB-CDAD-44E1-8417-885C38E49A0E} Library Properties ServiceStack.Text ServiceStack.Text 512 3.5 publish\ true Disk false Foreground 7 Days false false true 0 1.0.0.%2a false false true true full false bin\Debug\ DEBUG;TRACE prompt 4 AllRules.ruleset pdbonly true bin\Release\ TRACE prompt 4 AllRules.ruleset bin\Release\ServiceStack.Text.XML pdbonly true bin\MonoTouch MONOTOUCH;TRACE prompt 4 AllRules.ruleset Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code False .NET Framework 3.5 SP1 Client Profile false False .NET Framework 3.5 SP1 true False Windows Installer 3.1 true smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/TextExtensions.cs0000644000175000017500000000344512146506553027125 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Text; using ServiceStack.Text.Common; namespace ServiceStack.Text { public static class TextExtensions { public static string ToCsvField(this string text) { return string.IsNullOrEmpty(text) || !JsWriter.HasAnyEscapeChars(text) ? text : string.Concat ( JsWriter.QuoteString, text.Replace(JsWriter.QuoteString, TypeSerializer.DoubleQuoteString), JsWriter.QuoteString ); } public static string FromCsvField(this string text) { const int startingQuotePos = 1; const int endingQuotePos = 2; return string.IsNullOrEmpty(text) || text[0] != JsWriter.QuoteChar ? text : text.Substring(startingQuotePos, text.Length - endingQuotePos) .Replace(TypeSerializer.DoubleQuoteString, JsWriter.QuoteString); } public static List FromCsvFields(this IEnumerable texts) { var safeTexts = new List(); foreach (var text in texts) { safeTexts.Add(FromCsvField(text)); } return safeTexts; } public static string[] FromCsvFields(params string[] texts) { var textsLen = texts.Length; var safeTexts = new string[textsLen]; for (var i = 0; i < textsLen; i++) { safeTexts[i] = FromCsvField(texts[i]); } return safeTexts; } public static string SerializeToString(this T value) { return JsonSerializer.SerializeToString(value); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Support/0000755000175000017500000000000012146506553025240 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Support/AssemblyTypeDefinition.cs0000644000175000017500000000124512146506553032223 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Common.Support { internal class AssemblyTypeDefinition { private const char TypeDefinitionSeperator = ','; private const int TypeNameIndex = 0; private const int AssemblyNameIndex = 1; public AssemblyTypeDefinition(string typeDefinition) { if (string.IsNullOrEmpty(typeDefinition)) { throw new ArgumentNullException(); } var parts = typeDefinition.Split(TypeDefinitionSeperator); TypeName = parts[TypeNameIndex].Trim(); AssemblyName = (parts.Length > AssemblyNameIndex) ? parts[AssemblyNameIndex].Trim() : null; } public string TypeName { get; set; } public string AssemblyName { get; set; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Support/DoubleConverter.cs0000644000175000017500000001422612146506553030676 0ustar00meebeymeebey00000000000000namespace ServiceStack.Text.Support { using System; using System.Globalization; /// /// A class to allow the conversion of doubles to string representations of /// their exact decimal values. The implementation aims for readability over /// efficiency. /// /// Courtesy of @JonSkeet /// http://www.yoda.arachsys.com/csharp/DoubleConverter.cs /// public class DoubleConverter { /// /// Converts the given double to a string representation of its /// exact decimal value. /// /// The double to convert. /// A string representation of the double's exact decimal value. public static string ToExactString(double d) { #if XBOX return BitConverter.ToString( BitConverter.GetBytes( d ) ) ; #else if (double.IsPositiveInfinity(d)) return "+Infinity"; if (double.IsNegativeInfinity(d)) return "-Infinity"; if (double.IsNaN(d)) return "NaN"; // Translate the double into sign, exponent and mantissa. long bits = BitConverter.DoubleToInt64Bits(d); // Note that the shift is sign-extended, hence the test against -1 not 1 bool negative = (bits < 0); int exponent = (int)((bits >> 52) & 0x7ffL); long mantissa = bits & 0xfffffffffffffL; // Subnormal numbers; exponent is effectively one higher, // but there's no extra normalisation bit in the mantissa if (exponent == 0) { exponent++; } // Normal numbers; leave exponent as it is but add extra // bit to the front of the mantissa else { mantissa = mantissa | (1L << 52); } // Bias the exponent. It's actually biased by 1023, but we're // treating the mantissa as m.0 rather than 0.m, so we need // to subtract another 52 from it. exponent -= 1075; if (mantissa == 0) { return "0"; } /* Normalize */ while ((mantissa & 1) == 0) { /* i.e., Mantissa is even */ mantissa >>= 1; exponent++; } /// Construct a new decimal expansion with the mantissa ArbitraryDecimal ad = new ArbitraryDecimal(mantissa); // If the exponent is less than 0, we need to repeatedly // divide by 2 - which is the equivalent of multiplying // by 5 and dividing by 10. if (exponent < 0) { for (int i = 0; i < -exponent; i++) ad.MultiplyBy(5); ad.Shift(-exponent); } // Otherwise, we need to repeatedly multiply by 2 else { for (int i = 0; i < exponent; i++) ad.MultiplyBy(2); } // Finally, return the string with an appropriate sign if (negative) return "-" + ad.ToString(); else return ad.ToString(); #endif } /// Private class used for manipulating class ArbitraryDecimal { /// Digits in the decimal expansion, one byte per digit byte[] digits; /// /// How many digits are *after* the decimal point /// int decimalPoint = 0; /// /// Constructs an arbitrary decimal expansion from the given long. /// The long must not be negative. /// internal ArbitraryDecimal(long x) { string tmp = x.ToString(CultureInfo.InvariantCulture); digits = new byte[tmp.Length]; for (int i = 0; i < tmp.Length; i++) digits[i] = (byte)(tmp[i] - '0'); Normalize(); } /// /// Multiplies the current expansion by the given amount, which should /// only be 2 or 5. /// internal void MultiplyBy(int amount) { byte[] result = new byte[digits.Length + 1]; for (int i = digits.Length - 1; i >= 0; i--) { int resultDigit = digits[i] * amount + result[i + 1]; result[i] = (byte)(resultDigit / 10); result[i + 1] = (byte)(resultDigit % 10); } if (result[0] != 0) { digits = result; } else { Array.Copy(result, 1, digits, 0, digits.Length); } Normalize(); } /// /// Shifts the decimal point; a negative value makes /// the decimal expansion bigger (as fewer digits come after the /// decimal place) and a positive value makes the decimal /// expansion smaller. /// internal void Shift(int amount) { decimalPoint += amount; } /// /// Removes leading/trailing zeroes from the expansion. /// internal void Normalize() { int first; for (first = 0; first < digits.Length; first++) if (digits[first] != 0) break; int last; for (last = digits.Length - 1; last >= 0; last--) if (digits[last] != 0) break; if (first == 0 && last == digits.Length - 1) return; byte[] tmp = new byte[last - first + 1]; for (int i = 0; i < tmp.Length; i++) tmp[i] = digits[i + first]; decimalPoint -= digits.Length - (last + 1); digits = tmp; } /// /// Converts the value to a proper decimal string representation. /// public override String ToString() { char[] digitString = new char[digits.Length]; for (int i = 0; i < digits.Length; i++) digitString[i] = (char)(digits[i] + '0'); // Simplest case - nothing after the decimal point, // and last real digit is non-zero, eg value=35 if (decimalPoint == 0) { return new string(digitString); } // Fairly simple case - nothing after the decimal // point, but some 0s to add, eg value=350 if (decimalPoint < 0) { return new string(digitString) + new string('0', -decimalPoint); } // Nothing before the decimal point, eg 0.035 if (decimalPoint >= digitString.Length) { return "0." + new string('0', (decimalPoint - digitString.Length)) + new string(digitString); } // Most complicated case - part of the string comes // before the decimal point, part comes after it, // eg 3.5 return new string(digitString, 0, digitString.Length - decimalPoint) + "." + new string(digitString, digitString.Length - decimalPoint, decimalPoint); } } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Support/TypePair.cs0000644000175000017500000000226112146506553027325 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; namespace ServiceStack.Text.Support { public class TypePair { public Type[] Args1 { get; set; } public Type[] Arg2 { get; set; } public TypePair(Type[] arg1, Type[] arg2) { Args1 = arg1; Arg2 = arg2; } public bool Equals(TypePair other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.Args1, Args1) && Equals(other.Arg2, Arg2); } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; if (obj.GetType() != typeof (TypePair)) return false; return Equals((TypePair) obj); } public override int GetHashCode() { unchecked { return ((Args1 != null ? Args1.GetHashCode() : 0)*397) ^ (Arg2 != null ? Arg2.GetHashCode() : 0); } } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/0000755000175000017500000000000012146506553025014 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/DeserializeDictionary.cs0000644000175000017500000001465412146506553031643 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Reflection; using System.Runtime.Serialization; using System.Text; using System.Threading; using ServiceStack.Text.Json; namespace ServiceStack.Text.Common { internal static class DeserializeDictionary where TSerializer : ITypeSerializer { private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); const int KeyIndex = 0; const int ValueIndex = 1; public static ParseStringDelegate GetParseMethod(Type type) { var mapInterface = type.GetTypeWithGenericInterfaceOf(typeof(IDictionary<,>)); if (mapInterface == null) throw new ArgumentException(string.Format("Type {0} is not of type IDictionary<,>", type.FullName)); //optimized access for regularly used types if (type == typeof(Dictionary)) { return ParseStringDictionary; } var dictionaryArgs = mapInterface.GetGenericArguments(); var keyTypeParseMethod = Serializer.GetParseFn(dictionaryArgs[KeyIndex]); if (keyTypeParseMethod == null) return null; var valueTypeParseMethod = Serializer.GetParseFn(dictionaryArgs[ValueIndex]); if (valueTypeParseMethod == null) return null; var createMapType = type.HasAnyTypeDefinitionsOf(typeof(Dictionary<,>), typeof(IDictionary<,>)) ? null : type; return value => ParseDictionaryType(value, createMapType, dictionaryArgs, keyTypeParseMethod, valueTypeParseMethod); } public static Dictionary ParseStringDictionary(string value) { var index = VerifyAndGetStartIndex(value, typeof(Dictionary)); var result = new Dictionary(); if (value == JsWriter.EmptyMap) return result; var valueLength = value.Length; while (index < valueLength) { var keyValue = Serializer.EatMapKey(value, ref index); Serializer.EatMapKeySeperator(value, ref index); var elementValue = Serializer.EatValue(value, ref index); var mapKey = keyValue; var mapValue = elementValue; result[mapKey] = mapValue; Serializer.EatItemSeperatorOrMapEndChar(value, ref index); } return result; } public static IDictionary ParseDictionary( string value, Type createMapType, ParseStringDelegate parseKeyFn, ParseStringDelegate parseValueFn) { if (value == null) return null; var tryToParseItemsAsDictionaries = JsConfig.ConvertObjectTypesIntoStringDictionary && typeof(TValue) == typeof(object); var index = VerifyAndGetStartIndex(value, createMapType); var to = (createMapType == null) ? new Dictionary() : (IDictionary)ReflectionExtensions.CreateInstance(createMapType); if (value == JsWriter.EmptyMap) return to; var valueLength = value.Length; while (index < valueLength) { var keyValue = Serializer.EatMapKey(value, ref index); Serializer.EatMapKeySeperator(value, ref index); var elementValue = Serializer.EatValue(value, ref index); var mapKey = (TKey)parseKeyFn(keyValue); var mapValue = (TValue)parseValueFn(elementValue); if (tryToParseItemsAsDictionaries) { var mapValueString = mapValue as string; var tryParseValueAsDictionary = JsonUtils.IsJsObject(mapValueString); if (tryParseValueAsDictionary) { var tmpMap = ParseDictionary(mapValueString, createMapType, parseKeyFn, parseValueFn); to[mapKey] = (tmpMap != null && tmpMap.Count > 0) ? (TValue)tmpMap : to[mapKey] = mapValue; } else { to[mapKey] = mapValue; } } else { to[mapKey] = mapValue; } Serializer.EatItemSeperatorOrMapEndChar(value, ref index); } return to; } private static int VerifyAndGetStartIndex(string value, Type createMapType) { var index = 0; if (!Serializer.EatMapStartChar(value, ref index)) { //Don't throw ex because some KeyValueDataContractDeserializer don't have '{}' Tracer.Instance.WriteDebug("WARN: Map definitions should start with a '{0}', expecting serialized type '{1}', got string starting with: {2}", JsWriter.MapStartChar, createMapType != null ? createMapType.Name : "Dictionary<,>", value.Substring(0, value.Length < 50 ? value.Length : 50)); } return index; } private static Dictionary ParseDelegateCache = new Dictionary(); private delegate object ParseDictionaryDelegate(string value, Type createMapType, ParseStringDelegate keyParseFn, ParseStringDelegate valueParseFn); public static object ParseDictionaryType(string value, Type createMapType, Type[] argTypes, ParseStringDelegate keyParseFn, ParseStringDelegate valueParseFn) { ParseDictionaryDelegate parseDelegate; var key = GetTypesKey(argTypes); if (ParseDelegateCache.TryGetValue(key, out parseDelegate)) return parseDelegate(value, createMapType, keyParseFn, valueParseFn); var mi = typeof(DeserializeDictionary).GetMethod("ParseDictionary", BindingFlags.Static | BindingFlags.Public); var genericMi = mi.MakeGenericMethod(argTypes); parseDelegate = (ParseDictionaryDelegate)Delegate.CreateDelegate(typeof(ParseDictionaryDelegate), genericMi); Dictionary snapshot, newCache; do { snapshot = ParseDelegateCache; newCache = new Dictionary(ParseDelegateCache); newCache[key] = parseDelegate; } while (!ReferenceEquals( Interlocked.CompareExchange(ref ParseDelegateCache, newCache, snapshot), snapshot)); return parseDelegate(value, createMapType, keyParseFn, valueParseFn); } private static string GetTypesKey(params Type[] types) { var sb = new StringBuilder(256); foreach (var type in types) { if (sb.Length > 0) sb.Append(">"); sb.Append(type.FullName); } return sb.ToString(); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/JsReader.cs0000644000175000017500000000625012146506553027045 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; namespace ServiceStack.Text.Common { internal class JsReader where TSerializer : ITypeSerializer { private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); public ParseStringDelegate GetParseFn() { var type = Nullable.GetUnderlyingType(typeof(T)) ?? typeof(T); if (type.IsEnum) { return x => Enum.Parse(type, x, true); } if (type == typeof(string)) return Serializer.ParseString; if (type == typeof(object)) return DeserializeType.ObjectStringToType; var specialParseFn = ParseUtils.GetSpecialParseMethod(type); if (specialParseFn != null) return specialParseFn; if (type.IsEnum) return x => Enum.Parse(type, x, true); if (type.IsArray) { return DeserializeArray.Parse; } var builtInMethod = DeserializeBuiltin.Parse; if (builtInMethod != null) return value => builtInMethod(Serializer.ParseRawString(value)); if (JsConfig.SerializeFn != null) return value => JsConfig.ParseFn(Serializer.ParseRawString(value)); if (type.IsGenericType()) { if (type.IsOrHasGenericInterfaceTypeOf(typeof(IList<>))) return DeserializeList.Parse; if (type.IsOrHasGenericInterfaceTypeOf(typeof(IDictionary<,>))) return DeserializeDictionary.GetParseMethod(type); if (type.IsOrHasGenericInterfaceTypeOf(typeof(ICollection<>))) return DeserializeCollection.GetParseMethod(type); if (type.HasAnyTypeDefinitionsOf(typeof(Queue<>)) || type.HasAnyTypeDefinitionsOf(typeof(Stack<>))) return DeserializeSpecializedCollections.Parse; if (type.IsOrHasGenericInterfaceTypeOf(typeof(IEnumerable<>))) return DeserializeEnumerable.Parse; } var isCollection = typeof(T).IsOrHasGenericInterfaceTypeOf(typeof(ICollection)); if (isCollection) { var isDictionary = typeof(T).IsAssignableFrom(typeof(IDictionary)) || typeof(T).HasInterface(typeof(IDictionary)); if (isDictionary) { return DeserializeDictionary.GetParseMethod(type); } return DeserializeEnumerable.Parse; } var isEnumerable = typeof(T).IsAssignableFrom(typeof(IEnumerable)) || typeof(T).HasInterface(typeof(IEnumerable)); if (isEnumerable) { var parseFn = DeserializeSpecializedCollections.Parse; if (parseFn != null) return parseFn; } if (type.IsValueType) { var staticParseMethod = StaticParseMethod.Parse; if (staticParseMethod != null) return value => staticParseMethod(Serializer.ParseRawString(value)); } var typeConstructor = DeserializeType.GetParseMethod(TypeConfig.GetState()); if (typeConstructor != null) return typeConstructor; var stringConstructor = DeserializeTypeUtils.GetParseMethod(type); if (stringConstructor != null) return stringConstructor; return DeserializeType.ParseAbstractType; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/DeserializeType.cs0000644000175000017500000001762412146506553030457 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // #if !XBOX && !MONOTOUCH && !SILVERLIGHT using System.Reflection.Emit; #endif using System; using System.Collections.Generic; using System.Reflection; using System.Runtime.Serialization; using System.Linq; namespace ServiceStack.Text.Common { internal static class DeserializeType where TSerializer : ITypeSerializer { private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); private static readonly string TypeAttrInObject = Serializer.TypeAttrInObject; public static ParseStringDelegate GetParseMethod(TypeConfig typeConfig) { var type = typeConfig.Type; if (!type.IsClass || type.IsAbstract || type.IsInterface) return null; var propertyInfos = type.GetSerializableProperties(); if (propertyInfos.Length == 0) { var emptyCtorFn = ReflectionExtensions.GetConstructorMethodToCache(type); return value => emptyCtorFn(); } var map = new Dictionary(StringComparer.OrdinalIgnoreCase); var isDataContract = type.GetCustomAttributes(typeof(DataContractAttribute), false).Any(); foreach (var propertyInfo in propertyInfos) { var propertyName = propertyInfo.Name; if (isDataContract) { var dcsDataMember = propertyInfo.GetCustomAttributes(typeof(DataMemberAttribute), false).FirstOrDefault() as DataMemberAttribute; if (dcsDataMember != null && dcsDataMember.Name != null) { propertyName = dcsDataMember.Name; } } map[propertyName] = TypeAccessor.Create(Serializer, typeConfig, propertyInfo); } var ctorFn = ReflectionExtensions.GetConstructorMethodToCache(type); return typeof(TSerializer) == typeof(Json.JsonTypeSerializer) ? (ParseStringDelegate)(value => DeserializeTypeRefJson.StringToType(type, value, ctorFn, map)) : value => DeserializeTypeRefJsv.StringToType(type, value, ctorFn, map); } public static object ObjectStringToType(string strType) { var type = ExtractType(strType); if (type != null) { var parseFn = Serializer.GetParseFn(type); var propertyValue = parseFn(strType); return propertyValue; } return strType; } public static Type ExtractType(string strType) { if (strType != null && strType.Length > TypeAttrInObject.Length && strType.Substring(0, TypeAttrInObject.Length) == TypeAttrInObject) { var propIndex = TypeAttrInObject.Length; var typeName = Serializer.EatValue(strType, ref propIndex); var type = AssemblyUtils.FindType(typeName); if (type == null) Tracer.Instance.WriteWarning("Could not find type: " + typeName); return type; } return null; } public static object ParseAbstractType(string value) { if (typeof(T).IsAbstract) { if (string.IsNullOrEmpty(value)) return null; var concreteType = ExtractType(value); if (concreteType != null) { return Serializer.GetParseFn(concreteType)(value); } Tracer.Instance.WriteWarning( "Could not deserialize Abstract Type with unknown concrete type: " + typeof(T).FullName); } return null; } } internal class TypeAccessor { internal ParseStringDelegate GetProperty; internal SetPropertyDelegate SetProperty; public static Type ExtractType(ITypeSerializer Serializer, string strType) { var TypeAttrInObject = Serializer.TypeAttrInObject; if (strType != null && strType.Length > TypeAttrInObject.Length && strType.Substring(0, TypeAttrInObject.Length) == TypeAttrInObject) { var propIndex = TypeAttrInObject.Length; var typeName = Serializer.EatValue(strType, ref propIndex); var type = AssemblyUtils.FindType(typeName); if (type == null) Tracer.Instance.WriteWarning("Could not find type: " + typeName); return type; } return null; } public static TypeAccessor Create(ITypeSerializer serializer, TypeConfig typeConfig, PropertyInfo propertyInfo) { return new TypeAccessor { GetProperty = serializer.GetParseFn(propertyInfo.PropertyType), SetProperty = GetSetPropertyMethod(typeConfig, propertyInfo), }; } private static SetPropertyDelegate GetSetPropertyMethod(TypeConfig typeConfig, PropertyInfo propertyInfo) { if (!propertyInfo.CanWrite && !typeConfig.EnableAnonymousFieldSetterses) return null; FieldInfo fieldInfo = null; if (!propertyInfo.CanWrite) { //TODO: What string comparison is used in SST? var fieldName = string.Format("<{0}>i__Field", propertyInfo.Name); var fieldInfos = typeConfig.Type.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetField); foreach (var f in fieldInfos) { if (f.IsInitOnly && f.FieldType == propertyInfo.PropertyType && f.Name == fieldName) { fieldInfo = f; break; } } if (fieldInfo == null) return null; } #if SILVERLIGHT || MONOTOUCH || XBOX if (propertyInfo.CanWrite) { var setMethodInfo = propertyInfo.GetSetMethod(true); return (instance, value) => setMethodInfo.Invoke(instance, new[] { value }); } if (fieldInfo == null) return null; return (instance, value) => fieldInfo.SetValue(instance, value); #else return propertyInfo.CanWrite ? CreateIlPropertySetter(propertyInfo) : CreateIlFieldSetter(fieldInfo); #endif } #if !SILVERLIGHT && !MONOTOUCH && !XBOX private static SetPropertyDelegate CreateIlPropertySetter(PropertyInfo propertyInfo) { var propSetMethod = propertyInfo.GetSetMethod(true); if (propSetMethod == null) return null; var setter = CreateDynamicSetMethod(propertyInfo); var generator = setter.GetILGenerator(); generator.Emit(OpCodes.Ldarg_0); generator.Emit(OpCodes.Castclass, propertyInfo.DeclaringType); generator.Emit(OpCodes.Ldarg_1); generator.Emit(propertyInfo.PropertyType.IsClass ? OpCodes.Castclass : OpCodes.Unbox_Any, propertyInfo.PropertyType); generator.EmitCall(OpCodes.Callvirt, propSetMethod, (Type[])null); generator.Emit(OpCodes.Ret); return (SetPropertyDelegate)setter.CreateDelegate(typeof(SetPropertyDelegate)); } private static SetPropertyDelegate CreateIlFieldSetter(FieldInfo fieldInfo) { var setter = CreateDynamicSetMethod(fieldInfo); var generator = setter.GetILGenerator(); generator.Emit(OpCodes.Ldarg_0); generator.Emit(OpCodes.Castclass, fieldInfo.DeclaringType); generator.Emit(OpCodes.Ldarg_1); generator.Emit(fieldInfo.FieldType.IsClass ? OpCodes.Castclass : OpCodes.Unbox_Any, fieldInfo.FieldType); generator.Emit(OpCodes.Stfld, fieldInfo); generator.Emit(OpCodes.Ret); return (SetPropertyDelegate)setter.CreateDelegate(typeof(SetPropertyDelegate)); } private static DynamicMethod CreateDynamicSetMethod(MemberInfo memberInfo) { var args = new[] { typeof(object), typeof(object) }; var name = string.Format("_{0}{1}_", "Set", memberInfo.Name); var returnType = typeof(void); return !memberInfo.DeclaringType.IsInterface ? new DynamicMethod(name, returnType, args, memberInfo.DeclaringType, true) : new DynamicMethod(name, returnType, args, memberInfo.Module, true); } #endif internal static SetPropertyDelegate GetSetPropertyMethod(Type type, PropertyInfo propertyInfo) { if (!propertyInfo.CanWrite) return null; #if SILVERLIGHT || MONOTOUCH || XBOX var setMethodInfo = propertyInfo.GetSetMethod(true); return (instance, value) => setMethodInfo.Invoke(instance, new[] { value }); #else return CreateIlPropertySetter(propertyInfo); #endif } } } smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/WriteType.cs0000644000175000017500000001622112146506553027301 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.IO; using System.Threading; using ServiceStack.Text.Json; using ServiceStack.Text.Reflection; using System.Linq; using System.Runtime.Serialization; namespace ServiceStack.Text.Common { internal static class WriteType where TSerializer : ITypeSerializer { private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); private static readonly WriteObjectDelegate CacheFn; internal static TypePropertyWriter[] PropertyWriters; private static WriteObjectDelegate WriteTypeInfo; static WriteType() { CacheFn = Init() ? GetWriteFn() : WriteEmptyType; if (typeof(T).IsAbstract) { WriteTypeInfo = TypeInfoWriter; if (!typeof(T).IsInterface) { CacheFn = WriteAbstractProperties; } } } public static void TypeInfoWriter(TextWriter writer, object obj) { DidWriteTypeInfo(writer, obj); } private static bool DidWriteTypeInfo(TextWriter writer, object obj) { if (obj == null || JsConfig.ExcludeTypeInfo || JsConfig.ExcludeTypeInfo) return false; Serializer.WriteRawString(writer, JsWriter.TypeAttr); writer.Write(JsWriter.MapKeySeperator); Serializer.WriteRawString(writer, obj.GetType().ToTypeString()); return true; } public static WriteObjectDelegate Write { get { return CacheFn; } } private static WriteObjectDelegate GetWriteFn() { return WriteProperties; } private static bool Init() { if (!typeof(T).IsClass && !typeof(T).IsInterface) return false; var propertyInfos = TypeConfig.Properties; if (propertyInfos.Length == 0 && !JsState.IsWritingDynamic) { return typeof(T).IsDto(); } var propertyNamesLength = propertyInfos.Length; PropertyWriters = new TypePropertyWriter[propertyNamesLength]; // NOTE: very limited support for DataContractSerialization (DCS) // NOT supporting Serializable // support for DCS is intended for (re)Name of properties and Ignore by NOT having a DataMember present var isDataContract = typeof(T).GetCustomAttributes(typeof(DataContractAttribute), false).Any(); for (var i = 0; i < propertyNamesLength; i++) { var propertyInfo = propertyInfos[i]; string propertyName, propertyNameCLSFriendly; if (isDataContract) { var dcsDataMember = propertyInfo.GetCustomAttributes(typeof(DataMemberAttribute), false).FirstOrDefault() as DataMemberAttribute; if (dcsDataMember == null) continue; propertyName = dcsDataMember.Name ?? propertyInfo.Name; propertyNameCLSFriendly = dcsDataMember.Name ?? propertyName.ToCamelCase(); } else { propertyName = propertyInfo.Name; propertyNameCLSFriendly = propertyName.ToCamelCase(); } var propertyType = propertyInfo.PropertyType; var suppressDefaultValue = propertyType.IsValueType && JsConfig.HasSerializeFn.Contains(propertyType) ? ReflectionExtensions.GetDefaultValue(propertyType) : null; PropertyWriters[i] = new TypePropertyWriter ( propertyName, propertyNameCLSFriendly, propertyInfo.GetValueGetter(), Serializer.GetWriteFn(propertyType), suppressDefaultValue ); } return true; } internal struct TypePropertyWriter { internal string PropertyName { get { return (JsConfig.EmitCamelCaseNames) ? propertyNameCLSFriendly : propertyName; } } internal readonly string propertyName; internal readonly string propertyNameCLSFriendly; internal readonly Func GetterFn; internal readonly WriteObjectDelegate WriteFn; internal readonly object DefaultValue; public TypePropertyWriter(string propertyName, string propertyNameCLSFriendly, Func getterFn, WriteObjectDelegate writeFn, object defaultValue) { this.propertyName = propertyName; this.propertyNameCLSFriendly = propertyNameCLSFriendly; this.GetterFn = getterFn; this.WriteFn = writeFn; this.DefaultValue = defaultValue; } } public static void WriteEmptyType(TextWriter writer, object value) { writer.Write(JsWriter.EmptyMap); } public static void WriteAbstractProperties(TextWriter writer, object value) { if (value == null) { writer.Write(JsWriter.EmptyMap); return; } var valueType = value.GetType(); if (valueType.IsAbstract) { WriteProperties(writer, value); return; } var writeFn = Serializer.GetWriteFn(valueType); if (!JsConfig.ExcludeTypeInfo) JsState.IsWritingDynamic = true; writeFn(writer, value); if (!JsConfig.ExcludeTypeInfo) JsState.IsWritingDynamic = false; } public static void WriteProperties(TextWriter writer, object value) { if (typeof(TSerializer) == typeof(JsonTypeSerializer) && JsState.WritingKeyCount > 0) writer.Write(JsWriter.QuoteChar); writer.Write(JsWriter.MapStartChar); var i = 0; if (WriteTypeInfo != null || JsState.IsWritingDynamic) { if (DidWriteTypeInfo(writer, value)) i++; } if (PropertyWriters != null) { var len = PropertyWriters.Length; for (int index = 0; index < len; index++) { var propertyWriter = PropertyWriters[index]; var propertyValue = value != null ? propertyWriter.GetterFn((T)value) : null; if ((propertyValue == null || (propertyWriter.DefaultValue != null && propertyWriter.DefaultValue.Equals(propertyValue))) && !JsConfig.IncludeNullValues) continue; if (i++ > 0) writer.Write(JsWriter.ItemSeperator); Serializer.WritePropertyName(writer, propertyWriter.PropertyName); writer.Write(JsWriter.MapKeySeperator); if (typeof (TSerializer) == typeof (JsonTypeSerializer)) JsState.IsWritingValue = true; propertyWriter.WriteFn(writer, propertyValue); if (typeof(TSerializer) == typeof(JsonTypeSerializer)) JsState.IsWritingValue = false; } } writer.Write(JsWriter.MapEndChar); if (typeof(TSerializer) == typeof(JsonTypeSerializer) && JsState.WritingKeyCount > 0) writer.Write(JsWriter.QuoteChar); } public static void WriteQueryString(TextWriter writer, object value) { var i = 0; foreach (var propertyWriter in PropertyWriters) { var propertyValue = propertyWriter.GetterFn((T)value); if (propertyValue == null) continue; var propertyValueString = propertyValue as string; if (propertyValueString != null) { propertyValue = propertyValueString.UrlEncode(); } if (i++ > 0) writer.Write('&'); Serializer.WritePropertyName(writer, propertyWriter.PropertyName); writer.Write('='); propertyWriter.WriteFn(writer, propertyValue); } } } } smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/DeserializeSpecializedCollections.cs0000644000175000017500000001421012146506553034155 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Reflection; namespace ServiceStack.Text.Common { internal static class DeserializeSpecializedCollections where TSerializer : ITypeSerializer { private readonly static ParseStringDelegate CacheFn; static DeserializeSpecializedCollections() { CacheFn = GetParseFn(); } public static ParseStringDelegate Parse { get { return CacheFn; } } public static ParseStringDelegate GetParseFn() { if (typeof(T).HasAnyTypeDefinitionsOf(typeof(Queue<>))) { if (typeof(T) == typeof(Queue)) return ParseStringQueue; if (typeof(T) == typeof(Queue)) return ParseIntQueue; return GetGenericQueueParseFn(); } if (typeof(T).HasAnyTypeDefinitionsOf(typeof(Stack<>))) { if (typeof(T) == typeof(Stack)) return ParseStringStack; if (typeof(T) == typeof(Stack)) return ParseIntStack; return GetGenericStackParseFn(); } #if !SILVERLIGHT if (typeof(T) == typeof(StringCollection)) { return ParseStringCollection; } #endif return GetGenericEnumerableParseFn(); } public static Queue ParseStringQueue(string value) { var parse = (IEnumerable)DeserializeList, TSerializer>.Parse(value); return new Queue(parse); } public static Queue ParseIntQueue(string value) { var parse = (IEnumerable)DeserializeList, TSerializer>.Parse(value); return new Queue(parse); } #if !SILVERLIGHT public static StringCollection ParseStringCollection(string value) where TSerializer : ITypeSerializer { if ((value = DeserializeListWithElements.StripList(value)) == null) return null; return value == String.Empty ? new StringCollection() : ToStringCollection(DeserializeListWithElements.ParseStringList(value)); } public static StringCollection ToStringCollection(List items) { var to = new StringCollection(); foreach (var item in items) { to.Add(item); } return to; } #endif internal static ParseStringDelegate GetGenericQueueParseFn() { var enumerableInterface = typeof(T).GetTypeWithGenericInterfaceOf(typeof(IEnumerable<>)); var elementType = enumerableInterface.GetGenericArguments()[0]; var genericType = typeof(SpecializedQueueElements<>).MakeGenericType(elementType); var mi = genericType.GetMethod("ConvertToQueue", BindingFlags.Static | BindingFlags.Public); var convertToQueue = (ConvertObjectDelegate)Delegate.CreateDelegate(typeof(ConvertObjectDelegate), mi); var parseFn = DeserializeEnumerable.GetParseFn(); return x => convertToQueue(parseFn(x)); } public static Stack ParseStringStack(string value) { var parse = (IEnumerable)DeserializeList, TSerializer>.Parse(value); return new Stack(parse); } public static Stack ParseIntStack(string value) { var parse = (IEnumerable)DeserializeList, TSerializer>.Parse(value); return new Stack(parse); } internal static ParseStringDelegate GetGenericStackParseFn() { var enumerableInterface = typeof(T).GetTypeWithGenericInterfaceOf(typeof(IEnumerable<>)); var elementType = enumerableInterface.GetGenericArguments()[0]; var genericType = typeof(SpecializedQueueElements<>).MakeGenericType(elementType); var mi = genericType.GetMethod("ConvertToStack", BindingFlags.Static | BindingFlags.Public); var convertToQueue = (ConvertObjectDelegate)Delegate.CreateDelegate(typeof(ConvertObjectDelegate), mi); var parseFn = DeserializeEnumerable.GetParseFn(); return x => convertToQueue(parseFn(x)); } public static ParseStringDelegate GetGenericEnumerableParseFn() { var enumerableInterface = typeof(T).GetTypeWithGenericInterfaceOf(typeof(IEnumerable<>)); var elementType = enumerableInterface.GetGenericArguments()[0]; var genericType = typeof(SpecializedEnumerableElements<,>).MakeGenericType(typeof(T), elementType); var fi = genericType.GetField("ConvertFn", BindingFlags.Static | BindingFlags.Public); var convertFn = fi.GetValue(null) as ConvertObjectDelegate; if (convertFn == null) return null; var parseFn = DeserializeEnumerable.GetParseFn(); return x => convertFn(parseFn(x)); } } internal class SpecializedQueueElements { public static Queue ConvertToQueue(object enumerable) { if (enumerable == null) return null; return new Queue((IEnumerable)enumerable); } public static Stack ConvertToStack(object enumerable) { if (enumerable == null) return null; return new Stack((IEnumerable)enumerable); } } internal class SpecializedEnumerableElements { public static ConvertObjectDelegate ConvertFn; static SpecializedEnumerableElements() { foreach (var ctorInfo in typeof(TCollection).GetConstructors()) { var ctorParams = ctorInfo.GetParameters(); if (ctorParams.Length != 1) continue; var ctorParam = ctorParams[0]; if (typeof(IEnumerable).IsAssignableFrom(ctorParam.ParameterType) || ctorParam.ParameterType.IsOrHasGenericInterfaceTypeOf(typeof(IEnumerable<>))) { ConvertFn = fromObject => { var to = Activator.CreateInstance(typeof(TCollection), fromObject); return to; }; return; } } if (typeof(TCollection).IsOrHasGenericInterfaceTypeOf(typeof(ICollection<>))) { ConvertFn = ConvertFromCollection; } } public static object Convert(object enumerable) { return ConvertFn(enumerable); } public static object ConvertFromCollection(object enumerable) { var to = (ICollection)typeof(TCollection).CreateInstance(); var from = (IEnumerable)enumerable; foreach (var item in from) { to.Add(item); } return to; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/JsDelegates.cs0000644000175000017500000000221412146506553027534 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.IO; namespace ServiceStack.Text.Common { internal delegate void WriteListDelegate(TextWriter writer, object oList, WriteObjectDelegate toStringFn); internal delegate void WriteGenericListDelegate(TextWriter writer, IList list, WriteObjectDelegate toStringFn); internal delegate void WriteDelegate(TextWriter writer, object value); internal delegate ParseStringDelegate ParseFactoryDelegate(); internal delegate void WriteObjectDelegate(TextWriter writer, object obj); public delegate void SetPropertyDelegate(object instance, object propertyValue); public delegate object ParseStringDelegate(string stringValue); public delegate object ConvertObjectDelegate(object fromObject); public delegate object ConvertInstanceDelegate(object obj, Type type); } smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/DeserializeTypeUtils.cs0000644000175000017500000000225612146506553031473 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Reflection; namespace ServiceStack.Text.Common { public class DeserializeTypeUtils { public static ParseStringDelegate GetParseMethod(Type type) { var typeConstructor = GetTypeStringConstructor(type); if (typeConstructor != null) { return value => typeConstructor.Invoke(new object[] { value }); } return null; } /// /// Get the type(string) constructor if exists /// /// The type. /// public static ConstructorInfo GetTypeStringConstructor(Type type) { foreach (var ci in type.GetConstructors()) { var paramInfos = ci.GetParameters(); var matchFound = (paramInfos.Length == 1 && paramInfos[0].ParameterType == typeof(string)); if (matchFound) { return ci; } } return null; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/DeserializeTypeRef.cs0000644000175000017500000000654712146506553031116 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Runtime.Serialization; namespace ServiceStack.Text.Common { internal static class DeserializeTypeRef { internal static SerializationException CreateSerializationError(Type type, string strType) { return new SerializationException(String.Format( "Type definitions should start with a '{0}', expecting serialized type '{1}', got string starting with: {2}", JsWriter.MapStartChar, type.Name, strType.Substring(0, strType.Length < 50 ? strType.Length : 50))); } /* The old Reference generic implementation internal static object StringToType( ITypeSerializer Serializer, Type type, string strType, EmptyCtorDelegate ctorFn, Dictionary typeAccessorMap) { var index = 0; if (strType == null) return null; if (!Serializer.EatMapStartChar(strType, ref index)) throw DeserializeTypeRef.CreateSerializationError(type, strType); if (strType == JsWriter.EmptyMap) return ctorFn(); object instance = null; var strTypeLength = strType.Length; while (index < strTypeLength) { var propertyName = Serializer.EatMapKey(strType, ref index); Serializer.EatMapKeySeperator(strType, ref index); var propertyValueStr = Serializer.EatValue(strType, ref index); var possibleTypeInfo = propertyValueStr != null && propertyValueStr.Length > 1 && propertyValueStr[0] == '_'; if (possibleTypeInfo && propertyName == JsWriter.TypeAttr) { var typeName = Serializer.ParseString(propertyValueStr); instance = ReflectionExtensions.CreateInstance(typeName); if (instance == null) { Tracer.Instance.WriteWarning("Could not find type: " + propertyValueStr); } else { //If __type info doesn't match, ignore it. if (!type.IsInstanceOfType(instance)) instance = null; } Serializer.EatItemSeperatorOrMapEndChar(strType, ref index); continue; } if (instance == null) instance = ctorFn(); TypeAccessor typeAccessor; typeAccessorMap.TryGetValue(propertyName, out typeAccessor); var propType = possibleTypeInfo ? TypeAccessor.ExtractType(Serializer, propertyValueStr) : null; if (propType != null) { try { if (typeAccessor != null) { var parseFn = Serializer.GetParseFn(propType); var propertyValue = parseFn(propertyValueStr); typeAccessor.SetProperty(instance, propertyValue); } Serializer.EatItemSeperatorOrMapEndChar(strType, ref index); continue; } catch { Tracer.Instance.WriteWarning("WARN: failed to set dynamic property {0} with: {1}", propertyName, propertyValueStr); } } if (typeAccessor != null && typeAccessor.GetProperty != null && typeAccessor.SetProperty != null) { try { var propertyValue = typeAccessor.GetProperty(propertyValueStr); typeAccessor.SetProperty(instance, propertyValue); } catch { Tracer.Instance.WriteWarning("WARN: failed to set property {0} with: {1}", propertyName, propertyValueStr); } } Serializer.EatItemSeperatorOrMapEndChar(strType, ref index); } return instance; } */ } //The same class above but JSON-specific to enable inlining in this hot class. }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/WriteLists.cs0000644000175000017500000003766612146506553027476 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Threading; namespace ServiceStack.Text.Common { internal static class WriteListsOfElements where TSerializer : ITypeSerializer { private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); static Dictionary ListCacheFns = new Dictionary(); public static WriteObjectDelegate GetListWriteFn(Type elementType) { WriteObjectDelegate writeFn; if (ListCacheFns.TryGetValue(elementType, out writeFn)) return writeFn; var genericType = typeof(WriteListsOfElements<,>).MakeGenericType(elementType, typeof(TSerializer)); var mi = genericType.GetMethod("WriteList", BindingFlags.Static | BindingFlags.Public); writeFn = (WriteObjectDelegate)Delegate.CreateDelegate(typeof(WriteObjectDelegate), mi); Dictionary snapshot, newCache; do { snapshot = ListCacheFns; newCache = new Dictionary(ListCacheFns); newCache[elementType] = writeFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref ListCacheFns, newCache, snapshot), snapshot)); return writeFn; } static Dictionary IListCacheFns = new Dictionary(); public static WriteObjectDelegate GetIListWriteFn(Type elementType) { WriteObjectDelegate writeFn; if (IListCacheFns.TryGetValue(elementType, out writeFn)) return writeFn; var genericType = typeof(WriteListsOfElements<,>).MakeGenericType(elementType, typeof(TSerializer)); var mi = genericType.GetMethod("WriteIList", BindingFlags.Static | BindingFlags.Public); writeFn = (WriteObjectDelegate)Delegate.CreateDelegate(typeof(WriteObjectDelegate), mi); Dictionary snapshot, newCache; do { snapshot = IListCacheFns; newCache = new Dictionary(IListCacheFns); newCache[elementType] = writeFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref IListCacheFns, newCache, snapshot), snapshot)); return writeFn; } static Dictionary CacheFns = new Dictionary(); public static WriteObjectDelegate GetGenericWriteArray(Type elementType) { WriteObjectDelegate writeFn; if (CacheFns.TryGetValue(elementType, out writeFn)) return writeFn; var genericType = typeof(WriteListsOfElements<,>).MakeGenericType(elementType, typeof(TSerializer)); var mi = genericType.GetMethod("WriteArray", BindingFlags.Static | BindingFlags.Public); writeFn = (WriteObjectDelegate)Delegate.CreateDelegate(typeof(WriteObjectDelegate), mi); Dictionary snapshot, newCache; do { snapshot = CacheFns; newCache = new Dictionary(CacheFns); newCache[elementType] = writeFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref CacheFns, newCache, snapshot), snapshot)); return writeFn; } static Dictionary EnumerableCacheFns = new Dictionary(); public static WriteObjectDelegate GetGenericWriteEnumerable(Type elementType) { WriteObjectDelegate writeFn; if (EnumerableCacheFns.TryGetValue(elementType, out writeFn)) return writeFn; var genericType = typeof(WriteListsOfElements<,>).MakeGenericType(elementType, typeof(TSerializer)); var mi = genericType.GetMethod("WriteEnumerable", BindingFlags.Static | BindingFlags.Public); writeFn = (WriteObjectDelegate)Delegate.CreateDelegate(typeof(WriteObjectDelegate), mi); Dictionary snapshot, newCache; do { snapshot = EnumerableCacheFns; newCache = new Dictionary(EnumerableCacheFns); newCache[elementType] = writeFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref EnumerableCacheFns, newCache, snapshot), snapshot)); return writeFn; } static Dictionary ListValueTypeCacheFns = new Dictionary(); public static WriteObjectDelegate GetWriteListValueType(Type elementType) { WriteObjectDelegate writeFn; if (ListValueTypeCacheFns.TryGetValue(elementType, out writeFn)) return writeFn; var genericType = typeof(WriteListsOfElements<,>).MakeGenericType(elementType, typeof(TSerializer)); var mi = genericType.GetMethod("WriteListValueType", BindingFlags.Static | BindingFlags.Public); writeFn = (WriteObjectDelegate)Delegate.CreateDelegate(typeof(WriteObjectDelegate), mi); Dictionary snapshot, newCache; do { snapshot = ListValueTypeCacheFns; newCache = new Dictionary(ListValueTypeCacheFns); newCache[elementType] = writeFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref ListValueTypeCacheFns, newCache, snapshot), snapshot)); return writeFn; } static Dictionary IListValueTypeCacheFns = new Dictionary(); public static WriteObjectDelegate GetWriteIListValueType(Type elementType) { WriteObjectDelegate writeFn; if (IListValueTypeCacheFns.TryGetValue(elementType, out writeFn)) return writeFn; var genericType = typeof(WriteListsOfElements<,>).MakeGenericType(elementType, typeof(TSerializer)); var mi = genericType.GetMethod("WriteIListValueType", BindingFlags.Static | BindingFlags.Public); writeFn = (WriteObjectDelegate)Delegate.CreateDelegate(typeof(WriteObjectDelegate), mi); Dictionary snapshot, newCache; do { snapshot = IListValueTypeCacheFns; newCache = new Dictionary(IListValueTypeCacheFns); newCache[elementType] = writeFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref IListValueTypeCacheFns, newCache, snapshot), snapshot)); return writeFn; } public static void WriteIEnumerable(TextWriter writer, object oValueCollection) { WriteObjectDelegate toStringFn = null; writer.Write(JsWriter.ListStartChar); var valueCollection = (IEnumerable)oValueCollection; var ranOnce = false; foreach (var valueItem in valueCollection) { if (toStringFn == null) toStringFn = Serializer.GetWriteFn(valueItem.GetType()); JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); toStringFn(writer, valueItem); } writer.Write(JsWriter.ListEndChar); } } internal static class WriteListsOfElements where TSerializer : ITypeSerializer { private static readonly WriteObjectDelegate ElementWriteFn; static WriteListsOfElements() { ElementWriteFn = JsWriter.GetTypeSerializer().GetWriteFn(); } public static void WriteList(TextWriter writer, object oList) { if (oList == null) return; WriteGenericIList(writer, (IList)oList); } public static void WriteGenericList(TextWriter writer, List list) { writer.Write(JsWriter.ListStartChar); var ranOnce = false; var listLength = list.Count; for (var i = 0; i < listLength; i++) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); ElementWriteFn(writer, list[i]); } writer.Write(JsWriter.ListEndChar); } public static void WriteListValueType(TextWriter writer, object list) { WriteGenericListValueType(writer, (List)list); } public static void WriteGenericListValueType(TextWriter writer, List list) { if (list == null) return; //AOT writer.Write(JsWriter.ListStartChar); var ranOnce = false; var listLength = list.Count; for (var i = 0; i < listLength; i++) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); ElementWriteFn(writer, list[i]); } writer.Write(JsWriter.ListEndChar); } public static void WriteIList(TextWriter writer, object oList) { if (oList == null) return; WriteGenericIList(writer, (IList)oList); } public static void WriteGenericIList(TextWriter writer, IList list) { writer.Write(JsWriter.ListStartChar); var ranOnce = false; var listLength = list.Count; try { for (var i = 0; i < listLength; i++) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); ElementWriteFn(writer, list[i]); } } catch (Exception ex) { Tracer.Instance.WriteError(ex); throw; } writer.Write(JsWriter.ListEndChar); } public static void WriteIListValueType(TextWriter writer, object list) { WriteGenericIListValueType(writer, (IList)list); } public static void WriteGenericIListValueType(TextWriter writer, IList list) { if (list == null) return; //AOT writer.Write(JsWriter.ListStartChar); var ranOnce = false; var listLength = list.Count; for (var i = 0; i < listLength; i++) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); ElementWriteFn(writer, list[i]); } writer.Write(JsWriter.ListEndChar); } public static void WriteArray(TextWriter writer, object oArrayValue) { if (oArrayValue == null) return; WriteGenericArray(writer, (T[])oArrayValue); } public static void WriteGenericArrayValueType(TextWriter writer, object oArray) { writer.Write(JsWriter.ListStartChar); var array = (T[])oArray; var ranOnce = false; var arrayLength = array.Length; for (var i = 0; i < arrayLength; i++) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); ElementWriteFn(writer, array[i]); } writer.Write(JsWriter.ListEndChar); } public static void WriteGenericArray(TextWriter writer, T[] array) { writer.Write(JsWriter.ListStartChar); var ranOnce = false; var arrayLength = array.Length; for (var i = 0; i < arrayLength; i++) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); ElementWriteFn(writer, array[i]); } writer.Write(JsWriter.ListEndChar); } public static void WriteEnumerable(TextWriter writer, object oEnumerable) { if (oEnumerable == null) return; WriteGenericEnumerable(writer, (IEnumerable)oEnumerable); } public static void WriteGenericEnumerable(TextWriter writer, IEnumerable enumerable) { writer.Write(JsWriter.ListStartChar); var ranOnce = false; foreach (var value in enumerable) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); ElementWriteFn(writer, value); } writer.Write(JsWriter.ListEndChar); } public static void WriteGenericEnumerableValueType(TextWriter writer, IEnumerable enumerable) { writer.Write(JsWriter.ListStartChar); var ranOnce = false; foreach (var value in enumerable) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); ElementWriteFn(writer, value); } writer.Write(JsWriter.ListEndChar); } } internal static class WriteLists { public static void WriteListString(ITypeSerializer serializer, TextWriter writer, object list) { WriteListString(serializer, writer, (List)list); } public static void WriteListString(ITypeSerializer serializer, TextWriter writer, List list) { writer.Write(JsWriter.ListStartChar); var ranOnce = false; list.ForEach(x => { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); serializer.WriteString(writer, x); }); writer.Write(JsWriter.ListEndChar); } public static void WriteIListString(ITypeSerializer serializer, TextWriter writer, object list) { WriteIListString(serializer, writer, (IList)list); } public static void WriteIListString(ITypeSerializer serializer, TextWriter writer, IList list) { writer.Write(JsWriter.ListStartChar); var ranOnce = false; var listLength = list.Count; for (var i = 0; i < listLength; i++) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); serializer.WriteString(writer, list[i]); } writer.Write(JsWriter.ListEndChar); } public static void WriteBytes(ITypeSerializer serializer, TextWriter writer, object byteValue) { if (byteValue == null) return; serializer.WriteBytes(writer, byteValue); } public static void WriteStringArray(ITypeSerializer serializer, TextWriter writer, object oList) { writer.Write(JsWriter.ListStartChar); var list = (string[])oList; var ranOnce = false; var listLength = list.Length; for (var i = 0; i < listLength; i++) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); serializer.WriteString(writer, list[i]); } writer.Write(JsWriter.ListEndChar); } } internal static class WriteLists where TSerializer : ITypeSerializer { private static readonly WriteObjectDelegate CacheFn; private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); static WriteLists() { CacheFn = GetWriteFn(); } public static WriteObjectDelegate Write { get { return CacheFn; } } public static WriteObjectDelegate GetWriteFn() { var type = typeof(T); var listInterface = type.GetTypeWithGenericTypeDefinitionOf(typeof(IList<>)); if (listInterface == null) throw new ArgumentException(string.Format("Type {0} is not of type IList<>", type.FullName)); //optimized access for regularly used types if (type == typeof(List)) return (w, x) => WriteLists.WriteListString(Serializer, w, x); if (type == typeof(IList)) return (w, x) => WriteLists.WriteIListString(Serializer, w, x); if (type == typeof(List)) return WriteListsOfElements.WriteListValueType; if (type == typeof(IList)) return WriteListsOfElements.WriteIListValueType; if (type == typeof(List)) return WriteListsOfElements.WriteListValueType; if (type == typeof(IList)) return WriteListsOfElements.WriteIListValueType; var elementType = listInterface.GetGenericArguments()[0]; var isGenericList = typeof(T).IsGenericType && typeof(T).GetGenericTypeDefinition() == typeof(List<>); if (elementType.IsValueType && JsWriter.ShouldUseDefaultToStringMethod(elementType)) { if (isGenericList) return WriteListsOfElements.GetWriteListValueType(elementType); return WriteListsOfElements.GetWriteIListValueType(elementType); } return isGenericList ? WriteListsOfElements.GetListWriteFn(elementType) : WriteListsOfElements.GetIListWriteFn(elementType); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/JsState.cs0000644000175000017500000000047512146506553026726 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Text.Common { internal static class JsState { //Exposing field for perf [ThreadStatic] internal static int WritingKeyCount = 0; [ThreadStatic] internal static bool IsWritingValue = false; [ThreadStatic] internal static bool IsWritingDynamic = false; } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/ParseUtils.cs0000644000175000017500000000256712146506553027450 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Reflection; namespace ServiceStack.Text.Common { internal static class ParseUtils { public static object NullValueType(Type type) { return ReflectionExtensions.GetDefaultValue(type); } public static object ParseObject(string value) { return value; } public static object ParseEnum(Type type, string value) { return Enum.Parse(type, value, false); } public static ParseStringDelegate GetSpecialParseMethod(Type type) { if (type == typeof(Uri)) return x => new Uri(x.FromCsvField()); //Warning: typeof(object).IsInstanceOfType(typeof(Type)) == True?? if (type.IsInstanceOfType(typeof(Type))) return ParseType; if (type == typeof(Exception)) return x => new Exception(x); if (type.IsInstanceOf(typeof(Exception))) return DeserializeTypeUtils.GetParseMethod(type); return null; } public static Type ParseType(string assemblyQualifiedName) { return Type.GetType(assemblyQualifiedName.FromCsvField()); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/JsWriter.cs0000644000175000017500000002662312146506553027125 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Collections.Generic; using System.IO; using ServiceStack.Text.Json; using ServiceStack.Text.Jsv; namespace ServiceStack.Text.Common { public static class JsWriter { public const string TypeAttr = "__type"; public const char MapStartChar = '{'; public const char MapKeySeperator = ':'; public const char ItemSeperator = ','; public const char MapEndChar = '}'; public const string MapNullValue = "\"\""; public const string EmptyMap = "{}"; public const char ListStartChar = '['; public const char ListEndChar = ']'; public const char ReturnChar = '\r'; public const char LineFeedChar = '\n'; public const char QuoteChar = '"'; public const string QuoteString = "\""; public const string EscapedQuoteString = "\\\""; public const string ItemSeperatorString = ","; public const string MapKeySeperatorString = ":"; public static readonly char[] CsvChars = new[] { ItemSeperator, QuoteChar }; public static readonly char[] EscapeChars = new[] { QuoteChar, MapKeySeperator, ItemSeperator, MapStartChar, MapEndChar, ListStartChar, ListEndChar, ReturnChar, LineFeedChar }; private const int LengthFromLargestChar = '}' + 1; private static readonly bool[] EscapeCharFlags = new bool[LengthFromLargestChar]; static JsWriter() { foreach (var escapeChar in EscapeChars) { EscapeCharFlags[escapeChar] = true; } var loadConfig = JsConfig.IncludeNullValues; } public static void WriteDynamic(Action callback) { JsState.IsWritingDynamic = true; try { callback(); } finally { JsState.IsWritingDynamic = false; } } /// /// micro optimizations: using flags instead of value.IndexOfAny(EscapeChars) /// /// /// public static bool HasAnyEscapeChars(string value) { var len = value.Length; for (var i = 0; i < len; i++) { var c = value[i]; if (c >= LengthFromLargestChar || !EscapeCharFlags[c]) continue; return true; } return false; } internal static void WriteItemSeperatorIfRanOnce(TextWriter writer, ref bool ranOnce) { if (ranOnce) writer.Write(ItemSeperator); else ranOnce = true; foreach (var escapeChar in EscapeChars) { EscapeCharFlags[escapeChar] = true; } } internal static bool ShouldUseDefaultToStringMethod(Type type) { return type == typeof(byte) || type == typeof(byte?) || type == typeof(short) || type == typeof(short?) || type == typeof(ushort) || type == typeof(ushort?) || type == typeof(int) || type == typeof(int?) || type == typeof(uint) || type == typeof(uint?) || type == typeof(long) || type == typeof(long?) || type == typeof(ulong) || type == typeof(ulong?) || type == typeof(bool) || type == typeof(bool?) || type == typeof(DateTime) || type == typeof(DateTime?) || type == typeof(Guid) || type == typeof(Guid?) || type == typeof(float) || type == typeof(float?) || type == typeof(double) || type == typeof(double?) || type == typeof(decimal) || type == typeof(decimal?); } internal static ITypeSerializer GetTypeSerializer() { if (typeof(TSerializer) == typeof(JsvTypeSerializer)) return JsvTypeSerializer.Instance; if (typeof(TSerializer) == typeof(JsonTypeSerializer)) return JsonTypeSerializer.Instance; throw new NotSupportedException(typeof(TSerializer).Name); } } internal class JsWriter where TSerializer : ITypeSerializer { private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); public JsWriter() { this.SpecialTypes = new Dictionary { { typeof(Uri), Serializer.WriteObjectString }, { typeof(Type), WriteType }, { typeof(Exception), Serializer.WriteException }, #if !MONOTOUCH && !SILVERLIGHT && !XBOX { typeof(System.Data.Linq.Binary), Serializer.WriteLinqBinary }, #endif }; } public WriteObjectDelegate GetValueTypeToStringMethod(Type type) { if (type == typeof(char) || type == typeof(char?)) return Serializer.WriteChar; if (type == typeof(int) || type == typeof(int?)) return Serializer.WriteInt32; if (type == typeof(long) || type == typeof(long?)) return Serializer.WriteInt64; if (type == typeof(ulong) || type == typeof(ulong?)) return Serializer.WriteUInt64; if (type == typeof(uint) || type == typeof(uint?)) return Serializer.WriteUInt32; if (type == typeof(byte) || type == typeof(byte?)) return Serializer.WriteByte; if (type == typeof(short) || type == typeof(short?)) return Serializer.WriteInt16; if (type == typeof(ushort) || type == typeof(ushort?)) return Serializer.WriteUInt16; if (type == typeof(bool) || type == typeof(bool?)) return Serializer.WriteBool; if (type == typeof(DateTime)) return Serializer.WriteDateTime; if (type == typeof(DateTime?)) return Serializer.WriteNullableDateTime; if (type == typeof(Guid)) return Serializer.WriteGuid; if (type == typeof(Guid?)) return Serializer.WriteNullableGuid; if (type == typeof(float) || type == typeof(float?)) return Serializer.WriteFloat; if (type == typeof(double) || type == typeof(double?)) return Serializer.WriteDouble; if (type == typeof(decimal) || type == typeof(decimal?)) return Serializer.WriteDecimal; if (type.IsEnum || type.UnderlyingSystemType.IsEnum) return type.GetCustomAttributes(typeof(FlagsAttribute), false).Length > 0 ? (WriteObjectDelegate)Serializer.WriteEnumFlags : Serializer.WriteEnum; return Serializer.WriteObjectString; } internal WriteObjectDelegate GetWriteFn() { if (typeof(T) == typeof(string)) { return Serializer.WriteObjectString; } if (typeof(T).IsValueType) { return JsConfig.SerializeFn != null ? JsConfig.WriteFn : GetValueTypeToStringMethod(typeof(T)); } var specialWriteFn = GetSpecialWriteFn(typeof(T)); if (specialWriteFn != null) { return specialWriteFn; } if (typeof(T).IsArray) { if (typeof(T) == typeof(byte[])) return (w, x) => WriteLists.WriteBytes(Serializer, w, x); if (typeof(T) == typeof(string[])) return (w, x) => WriteLists.WriteStringArray(Serializer, w, x); if (typeof(T) == typeof(int[])) return WriteListsOfElements.WriteGenericArrayValueType; if (typeof(T) == typeof(long[])) return WriteListsOfElements.WriteGenericArrayValueType; var elementType = typeof(T).GetElementType(); var writeFn = WriteListsOfElements.GetGenericWriteArray(elementType); return writeFn; } if (typeof(T).IsGenericType()) { if (typeof(T).IsOrHasGenericInterfaceTypeOf(typeof(IList<>))) return WriteLists.Write; var mapInterface = typeof(T).GetTypeWithGenericTypeDefinitionOf(typeof(IDictionary<,>)); if (mapInterface != null) { var mapTypeArgs = mapInterface.GetGenericArguments(); var writeFn = WriteDictionary.GetWriteGenericDictionary( mapTypeArgs[0], mapTypeArgs[1]); var keyWriteFn = Serializer.GetWriteFn(mapTypeArgs[0]); var valueWriteFn = Serializer.GetWriteFn(mapTypeArgs[1]); return (w, x) => writeFn(w, x, keyWriteFn, valueWriteFn); } var enumerableInterface = typeof(T).GetTypeWithGenericTypeDefinitionOf(typeof(IEnumerable<>)); if (enumerableInterface != null) { var elementType = enumerableInterface.GetGenericArguments()[0]; var writeFn = WriteListsOfElements.GetGenericWriteEnumerable(elementType); return writeFn; } } var isCollection = typeof(T).IsOrHasGenericInterfaceTypeOf(typeof(ICollection)); if (isCollection) { var isDictionary = typeof(T).IsAssignableFrom(typeof(IDictionary)) || typeof(T).HasInterface(typeof(IDictionary)); if (isDictionary) { return WriteDictionary.WriteIDictionary; } return WriteListsOfElements.WriteIEnumerable; } var isEnumerable = typeof(T).IsAssignableFrom(typeof(IEnumerable)) || typeof(T).HasInterface(typeof(IEnumerable)); if (isEnumerable) { return WriteListsOfElements.WriteIEnumerable; } if (typeof(T).IsClass || typeof(T).IsInterface) { var typeToStringMethod = WriteType.Write; if (typeToStringMethod != null) { return typeToStringMethod; } } return Serializer.WriteBuiltIn; } public Dictionary SpecialTypes; public WriteObjectDelegate GetSpecialWriteFn(Type type) { WriteObjectDelegate writeFn = null; if (SpecialTypes.TryGetValue(type, out writeFn)) return writeFn; if (type.IsInstanceOfType(typeof(Type))) return WriteType; if (type.IsInstanceOf(typeof(Exception))) return Serializer.WriteException; return null; } public void WriteType(TextWriter writer, object value) { Serializer.WriteRawString(writer, ((Type)value).ToTypeString()); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/DeserializeTypeRefJson.cs0000644000175000017500000001115712146506553031741 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using ServiceStack.Text.Json; namespace ServiceStack.Text.Common { internal static class DeserializeTypeRefJson { private static readonly JsonTypeSerializer Serializer = (JsonTypeSerializer)JsonTypeSerializer.Instance; internal static object StringToType( Type type, string strType, EmptyCtorDelegate ctorFn, Dictionary typeAccessorMap) { var index = 0; if (strType == null) return null; //if (!Serializer.EatMapStartChar(strType, ref index)) for (; index < strType.Length; index++) { var c = strType[index]; if (c >= JsonTypeSerializer.WhiteSpaceFlags.Length || !JsonTypeSerializer.WhiteSpaceFlags[c]) break; } //Whitespace inline if (strType[index++] != JsWriter.MapStartChar) throw DeserializeTypeRef.CreateSerializationError(type, strType); if (strType == JsWriter.EmptyMap) return ctorFn(); object instance = null; var strTypeLength = strType.Length; while (index < strTypeLength) { var propertyName = JsonTypeSerializer.ParseJsonString(strType, ref index); //Serializer.EatMapKeySeperator(strType, ref index); for (; index < strType.Length; index++) { var c = strType[index]; if (c >= JsonTypeSerializer.WhiteSpaceFlags.Length || !JsonTypeSerializer.WhiteSpaceFlags[c]) break; } //Whitespace inline if (strType.Length != index) index++; var propertyValueStr = Serializer.EatValue(strType, ref index); var possibleTypeInfo = propertyValueStr != null && propertyValueStr.Length > 1 && propertyValueStr[0] == '_'; if (possibleTypeInfo && propertyName == JsWriter.TypeAttr) { var typeName = Serializer.ParseString(propertyValueStr); instance = ReflectionExtensions.CreateInstance(typeName); if (instance == null) { Tracer.Instance.WriteWarning("Could not find type: " + propertyValueStr); } else { //If __type info doesn't match, ignore it. if (!type.IsInstanceOfType(instance)) instance = null; } Serializer.EatItemSeperatorOrMapEndChar(strType, ref index); continue; } if (instance == null) instance = ctorFn(); TypeAccessor typeAccessor; typeAccessorMap.TryGetValue(propertyName, out typeAccessor); var propType = possibleTypeInfo ? TypeAccessor.ExtractType(Serializer, propertyValueStr) : null; if (propType != null) { try { if (typeAccessor != null) { //var parseFn = Serializer.GetParseFn(propType); var parseFn = JsonReader.GetParseFn(propType); var propertyValue = parseFn(propertyValueStr); typeAccessor.SetProperty(instance, propertyValue); } //Serializer.EatItemSeperatorOrMapEndChar(strType, ref index); for (; index < strType.Length; index++) { var c = strType[index]; if (c >= JsonTypeSerializer.WhiteSpaceFlags.Length || !JsonTypeSerializer.WhiteSpaceFlags[c]) break; } //Whitespace inline if (index != strType.Length) { var success = strType[index] == JsWriter.ItemSeperator || strType[index] == JsWriter.MapEndChar; index++; if (success) for (; index < strType.Length; index++) { var c = strType[index]; if (c >= JsonTypeSerializer.WhiteSpaceFlags.Length || !JsonTypeSerializer.WhiteSpaceFlags[c]) break; } //Whitespace inline } continue; } catch { Tracer.Instance.WriteWarning("WARN: failed to set dynamic property {0} with: {1}", propertyName, propertyValueStr); } } if (typeAccessor != null && typeAccessor.GetProperty != null && typeAccessor.SetProperty != null) { try { var propertyValue = typeAccessor.GetProperty(propertyValueStr); typeAccessor.SetProperty(instance, propertyValue); } catch { Tracer.Instance.WriteWarning("WARN: failed to set property {0} with: {1}", propertyName, propertyValueStr); } } //Serializer.EatItemSeperatorOrMapEndChar(strType, ref index); for (; index < strType.Length; index++) { var c = strType[index]; if (c >= JsonTypeSerializer.WhiteSpaceFlags.Length || !JsonTypeSerializer.WhiteSpaceFlags[c]) break; } //Whitespace inline if (index != strType.Length) { var success = strType[index] == JsWriter.ItemSeperator || strType[index] == JsWriter.MapEndChar; index++; if (success) for (; index < strType.Length; index++) { var c = strType[index]; if (c >= JsonTypeSerializer.WhiteSpaceFlags.Length || !JsonTypeSerializer.WhiteSpaceFlags[c]) break; } //Whitespace inline } } return instance; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/StaticParseMethod.cs0000644000175000017500000000307712146506553030735 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Reflection; namespace ServiceStack.Text.Common { internal delegate object ParseDelegate(string value); public static class StaticParseMethod { const string ParseMethod = "Parse"; private static readonly ParseStringDelegate CacheFn; public static ParseStringDelegate Parse { get { return CacheFn; } } static StaticParseMethod() { CacheFn = GetParseFn(); } public static ParseStringDelegate GetParseFn() { // Get the static Parse(string) method on the type supplied var parseMethodInfo = typeof(T).GetMethod( ParseMethod, BindingFlags.Public | BindingFlags.Static, null, new[] { typeof(string) }, null); if (parseMethodInfo == null) return null; ParseDelegate parseDelegate; try { parseDelegate = (ParseDelegate)Delegate.CreateDelegate(typeof(ParseDelegate), parseMethodInfo); } catch ( ArgumentException ) { //Try wrapping strongly-typed return with wrapper fn. var typedParseDelegate = (Func)Delegate.CreateDelegate(typeof(Func), parseMethodInfo); parseDelegate = x => typedParseDelegate(x); } if (parseDelegate != null) return value => parseDelegate(value.FromCsvField()); return null; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/DeserializeListWithElements.cs0000644000175000017500000001754712146506553033006 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Reflection; using System.Threading; namespace ServiceStack.Text.Common { internal static class DeserializeListWithElements where TSerializer : ITypeSerializer { internal static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); private static Dictionary ParseDelegateCache = new Dictionary(); private delegate object ParseListDelegate(string value, Type createListType, ParseStringDelegate parseFn); public static Func GetListTypeParseFn( Type createListType, Type elementType, ParseStringDelegate parseFn) { ParseListDelegate parseDelegate; if (ParseDelegateCache.TryGetValue(elementType, out parseDelegate)) return parseDelegate.Invoke; var genericType = typeof(DeserializeListWithElements<,>).MakeGenericType(elementType, typeof(TSerializer)); var mi = genericType.GetMethod("ParseGenericList", BindingFlags.Static | BindingFlags.Public); parseDelegate = (ParseListDelegate)Delegate.CreateDelegate(typeof(ParseListDelegate), mi); Dictionary snapshot, newCache; do { snapshot = ParseDelegateCache; newCache = new Dictionary(ParseDelegateCache); newCache[elementType] = parseDelegate; } while (!ReferenceEquals( Interlocked.CompareExchange(ref ParseDelegateCache, newCache, snapshot), snapshot)); return parseDelegate.Invoke; } internal static string StripList(string value) { if (string.IsNullOrEmpty(value)) return null; const int startQuotePos = 1; const int endQuotePos = 2; return value[0] == JsWriter.ListStartChar ? value.Substring(startQuotePos, value.Length - endQuotePos) : value; } public static List ParseStringList(string value) { if ((value = StripList(value)) == null) return null; if (value == string.Empty) return new List(); var to = new List(); var valueLength = value.Length; var i = 0; while (i < valueLength) { var elementValue = Serializer.EatValue(value, ref i); var listValue = elementValue; to.Add(listValue); Serializer.EatItemSeperatorOrMapEndChar(value, ref i); } return to; } public static List ParseIntList(string value) { if ((value = StripList(value)) == null) return null; if (value == string.Empty) return new List(); var intParts = value.Split(JsWriter.ItemSeperator); var intValues = new List(intParts.Length); foreach (var intPart in intParts) { intValues.Add(int.Parse(intPart)); } return intValues; } } internal static class DeserializeListWithElements where TSerializer : ITypeSerializer { private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); public static ICollection ParseGenericList(string value, Type createListType, ParseStringDelegate parseFn) { if ((value = DeserializeListWithElements.StripList(value)) == null) return null; var isReadOnly = createListType != null && (createListType.IsGenericType && createListType.GetGenericTypeDefinition() == typeof(ReadOnlyCollection<>)); var to = (createListType == null || isReadOnly) ? new List() : (ICollection)createListType.CreateInstance(); if (value == string.Empty) return to; if (!string.IsNullOrEmpty(value)) { if (value[0] == JsWriter.MapStartChar) { var i = 0; do { var itemValue = Serializer.EatTypeValue(value, ref i); to.Add((T)parseFn(itemValue)); } while (++i < value.Length); } else { var valueLength = value.Length; var i = 0; while (i < valueLength) { var elementValue = Serializer.EatValue(value, ref i); var listValue = elementValue; to.Add((T)parseFn(listValue)); Serializer.EatItemSeperatorOrMapEndChar(value, ref i); } } } //TODO: 8-10-2011 -- this CreateInstance call should probably be moved over to ReflectionExtensions, //but not sure how you'd like to go about caching constructors with parameters -- I would probably build a NewExpression, .Compile to a LambdaExpression and cache return isReadOnly ? (ICollection)Activator.CreateInstance(createListType, to) : to; } } internal static class DeserializeList where TSerializer : ITypeSerializer { private readonly static ParseStringDelegate CacheFn; static DeserializeList() { CacheFn = GetParseFn(); } public static ParseStringDelegate Parse { get { return CacheFn; } } public static ParseStringDelegate GetParseFn() { var listInterface = typeof(T).GetTypeWithGenericInterfaceOf(typeof(IList<>)); if (listInterface == null) throw new ArgumentException(string.Format("Type {0} is not of type IList<>", typeof(T).FullName)); //optimized access for regularly used types if (typeof(T) == typeof(List)) return DeserializeListWithElements.ParseStringList; if (typeof(T) == typeof(List)) return DeserializeListWithElements.ParseIntList; var elementType = listInterface.GetGenericArguments()[0]; var supportedTypeParseMethod = DeserializeListWithElements.Serializer.GetParseFn(elementType); if (supportedTypeParseMethod != null) { var createListType = typeof(T).HasAnyTypeDefinitionsOf(typeof(List<>), typeof(IList<>)) ? null : typeof(T); var parseFn = DeserializeListWithElements.GetListTypeParseFn(createListType, elementType, supportedTypeParseMethod); return value => parseFn(value, createListType, supportedTypeParseMethod); } return null; } } internal static class DeserializeEnumerable where TSerializer : ITypeSerializer { private readonly static ParseStringDelegate CacheFn; static DeserializeEnumerable() { CacheFn = GetParseFn(); } public static ParseStringDelegate Parse { get { return CacheFn; } } public static ParseStringDelegate GetParseFn() { var enumerableInterface = typeof(T).GetTypeWithGenericInterfaceOf(typeof(IEnumerable<>)); if (enumerableInterface == null) throw new ArgumentException(string.Format("Type {0} is not of type IEnumerable<>", typeof(T).FullName)); //optimized access for regularly used types if (typeof(T) == typeof(IEnumerable)) return DeserializeListWithElements.ParseStringList; if (typeof(T) == typeof(IEnumerable)) return DeserializeListWithElements.ParseIntList; var elementType = enumerableInterface.GetGenericArguments()[0]; var supportedTypeParseMethod = DeserializeListWithElements.Serializer.GetParseFn(elementType); if (supportedTypeParseMethod != null) { const Type createListTypeWithNull = null; //Use conversions outside this class. see: Queue var parseFn = DeserializeListWithElements.GetListTypeParseFn( createListTypeWithNull, elementType, supportedTypeParseMethod); return value => parseFn(value, createListTypeWithNull, supportedTypeParseMethod); } return null; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/DeserializeBuiltin.cs0000644000175000017500000001024612146506553031135 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Globalization; namespace ServiceStack.Text.Common { public static class DeserializeBuiltin { private static readonly ParseStringDelegate CachedParseFn; static DeserializeBuiltin() { CachedParseFn = GetParseFn(); } public static ParseStringDelegate Parse { get { return CachedParseFn; } } private static ParseStringDelegate GetParseFn() { //Note the generic typeof(T) is faster than using var type = typeof(T) if (typeof(T) == typeof(bool)) return value => bool.Parse(value); if (typeof(T) == typeof(byte)) return value => byte.Parse(value); if (typeof(T) == typeof(sbyte)) return value => sbyte.Parse(value); if (typeof(T) == typeof(short)) return value => short.Parse(value); if (typeof(T) == typeof(int)) return value => int.Parse(value); if (typeof(T) == typeof(long)) return value => long.Parse(value); if (typeof(T) == typeof(float)) return value => float.Parse(value, CultureInfo.InvariantCulture); if (typeof(T) == typeof(double)) return value => double.Parse(value, CultureInfo.InvariantCulture); if (typeof(T) == typeof(decimal)) return value => decimal.Parse(value, CultureInfo.InvariantCulture); if (typeof(T) == typeof(Guid)) return value => new Guid(value); if (typeof(T) == typeof(DateTime) || typeof(T) == typeof(DateTime?)) return value => DateTimeSerializer.ParseShortestXsdDateTime(value); if (typeof(T) == typeof(TimeSpan)) return value => TimeSpan.Parse(value); #if !MONOTOUCH && !SILVERLIGHT && !XBOX if (typeof(T) == typeof(System.Data.Linq.Binary)) return value => new System.Data.Linq.Binary(Convert.FromBase64String(value)); #endif if (typeof(T) == typeof(char)) { char cValue; return value => char.TryParse(value, out cValue) ? cValue : '\0'; } if (typeof(T) == typeof(ushort)) return value => ushort.Parse(value); if (typeof(T) == typeof(uint)) return value => uint.Parse(value); if (typeof(T) == typeof(ulong)) return value => ulong.Parse(value); if (typeof(T) == typeof(bool?)) return value => value == null ? (bool?)null : bool.Parse(value); if (typeof(T) == typeof(byte?)) return value => value == null ? (byte?)null : byte.Parse(value); if (typeof(T) == typeof(sbyte?)) return value => value == null ? (sbyte?)null : sbyte.Parse(value); if (typeof(T) == typeof(short?)) return value => value == null ? (short?)null : short.Parse(value); if (typeof(T) == typeof(int?)) return value => value == null ? (int?)null : int.Parse(value); if (typeof(T) == typeof(long?)) return value => value == null ? (long?)null : long.Parse(value); if (typeof(T) == typeof(float?)) return value => value == null ? (float?)null : float.Parse(value, CultureInfo.InvariantCulture); if (typeof(T) == typeof(double?)) return value => value == null ? (double?)null : double.Parse(value, CultureInfo.InvariantCulture); if (typeof(T) == typeof(decimal?)) return value => value == null ? (decimal?)null : decimal.Parse(value, CultureInfo.InvariantCulture); if (typeof(T) == typeof(TimeSpan?)) return value => value == null ? (TimeSpan?)null : TimeSpan.Parse(value); if (typeof(T) == typeof(Guid?)) return value => value == null ? (Guid?)null : new Guid(value); if (typeof(T) == typeof(ushort?)) return value => value == null ? (ushort?)null : ushort.Parse(value); if (typeof(T) == typeof(uint?)) return value => value == null ? (uint?)null : uint.Parse(value); if (typeof(T) == typeof(ulong?)) return value => value == null ? (ulong?)null : ulong.Parse(value); if (typeof(T) == typeof(char?)) { char cValue; return value => value == null ? (char?)null : char.TryParse(value, out cValue) ? cValue : '\0'; } return null; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/ITypeSerializer.cs0000644000175000017500000000450212146506553030430 0ustar00meebeymeebey00000000000000using System; using System.IO; using ServiceStack.Text.Json; namespace ServiceStack.Text.Common { internal interface ITypeSerializer { string TypeAttrInObject { get; } WriteObjectDelegate GetWriteFn(); WriteObjectDelegate GetWriteFn(Type type); TypeInfo GetTypeInfo(Type type); void WriteRawString(TextWriter writer, string value); void WritePropertyName(TextWriter writer, string value); void WriteBuiltIn(TextWriter writer, object value); void WriteObjectString(TextWriter writer, object value); void WriteException(TextWriter writer, object value); void WriteString(TextWriter writer, string value); void WriteDateTime(TextWriter writer, object oDateTime); void WriteNullableDateTime(TextWriter writer, object dateTime); void WriteGuid(TextWriter writer, object oValue); void WriteNullableGuid(TextWriter writer, object oValue); void WriteBytes(TextWriter writer, object oByteValue); void WriteChar(TextWriter writer, object charValue); void WriteByte(TextWriter writer, object byteValue); void WriteInt16(TextWriter writer, object intValue); void WriteUInt16(TextWriter writer, object intValue); void WriteInt32(TextWriter writer, object intValue); void WriteUInt32(TextWriter writer, object uintValue); void WriteInt64(TextWriter writer, object longValue); void WriteUInt64(TextWriter writer, object ulongValue); void WriteBool(TextWriter writer, object boolValue); void WriteFloat(TextWriter writer, object floatValue); void WriteDouble(TextWriter writer, object doubleValue); void WriteDecimal(TextWriter writer, object decimalValue); void WriteEnum(TextWriter writer, object enumValue); void WriteEnumFlags(TextWriter writer, object enumFlagValue); void WriteLinqBinary(TextWriter writer, object linqBinaryValue); //object EncodeMapKey(object value); ParseStringDelegate GetParseFn(); ParseStringDelegate GetParseFn(Type type); string ParseRawString(string value); string ParseString(string value); string EatTypeValue(string value, ref int i); bool EatMapStartChar(string value, ref int i); string EatMapKey(string value, ref int i); bool EatMapKeySeperator(string value, ref int i); string EatValue(string value, ref int i); bool EatItemSeperatorOrMapEndChar(string value, ref int i); } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/DateTimeSerializer.cs0000644000175000017500000001210512146506553031070 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Globalization; using System.Xml; using ServiceStack.Text.Json; namespace ServiceStack.Text.Common { public static class DateTimeSerializer { public const string ShortDateTimeFormat = "yyyy-MM-dd"; //11 public const string DefaultDateTimeFormat = "dd/MM/yyyy HH:mm:ss"; //20 public const string DefaultDateTimeFormatWithFraction = "dd/MM/yyyy HH:mm:ss.fff"; //24 public const string XsdDateTimeFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; //29 public const string XsdDateTimeFormat3F = "yyyy-MM-ddTHH:mm:ss.fffZ"; //25 public const string XsdDateTimeFormatSeconds = "yyyy-MM-ddTHH:mm:ssZ"; //21 public const string EscapedWcfJsonPrefix = "\\/Date("; public const string EscapedWcfJsonSuffix = ")\\/"; public const string WcfJsonPrefix = "/Date("; public const char WcfJsonSuffix = ')'; public static DateTime ParseShortestXsdDateTime(string dateTimeStr) { if (string.IsNullOrEmpty(dateTimeStr)) return DateTime.MinValue; if (dateTimeStr.StartsWith(EscapedWcfJsonPrefix) || dateTimeStr.StartsWith(WcfJsonPrefix)) return ParseWcfJsonDate(dateTimeStr); if (dateTimeStr.Length == DefaultDateTimeFormat.Length || dateTimeStr.Length == DefaultDateTimeFormatWithFraction.Length) return DateTime.Parse(dateTimeStr, CultureInfo.InvariantCulture); if (dateTimeStr.Length == XsdDateTimeFormatSeconds.Length) return DateTime.ParseExact(dateTimeStr, XsdDateTimeFormatSeconds, null, DateTimeStyles.AdjustToUniversal); if (dateTimeStr.Length >= XsdDateTimeFormat3F.Length && dateTimeStr.Length <= XsdDateTimeFormat.Length) return XmlConvert.ToDateTime(dateTimeStr, XmlDateTimeSerializationMode.Local); return DateTime.Parse(dateTimeStr, null, DateTimeStyles.AssumeLocal); } public static string ToDateTimeString(DateTime dateTime) { return dateTime.ToStableUniversalTime().ToString(XsdDateTimeFormat); } public static DateTime ParseDateTime(string dateTimeStr) { return DateTime.ParseExact(dateTimeStr, XsdDateTimeFormat, null); } public static string ToXsdDateTimeString(DateTime dateTime) { return XmlConvert.ToString(dateTime.ToStableUniversalTime(), XmlDateTimeSerializationMode.Utc); } public static DateTime ParseXsdDateTime(string dateTimeStr) { return XmlConvert.ToDateTime(dateTimeStr, XmlDateTimeSerializationMode.Utc); } public static string ToShortestXsdDateTimeString(DateTime dateTime) { var timeOfDay = dateTime.TimeOfDay; if (timeOfDay.Ticks == 0) return dateTime.ToString(ShortDateTimeFormat); if (timeOfDay.Milliseconds == 0) return dateTime.ToStableUniversalTime().ToString(XsdDateTimeFormatSeconds); return ToXsdDateTimeString(dateTime); } static readonly char[] TimeZoneChars = new[] { '+', '-' }; /// /// WCF Json format: /Date(unixts+0000)/ /// /// /// public static DateTime ParseWcfJsonDate(string wcfJsonDate) { if (wcfJsonDate[0] == JsonUtils.EscapeChar) { wcfJsonDate = wcfJsonDate.Substring(1); } var suffixPos = wcfJsonDate.IndexOf(WcfJsonSuffix); var timeString = wcfJsonDate.Substring(WcfJsonPrefix.Length, suffixPos - WcfJsonPrefix.Length); if (JsConfig.DateHandler == JsonDateHandler.ISO8601) { return DateTime.Parse(timeString, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); } var timeZonePos = timeString.LastIndexOfAny(TimeZoneChars); var timeZone = timeZonePos <= 0 ? string.Empty : timeString.Substring(timeZonePos); var unixTimeString = timeString.Substring(0, timeString.Length - timeZone.Length); var unixTime = long.Parse(unixTimeString); if (timeZone == string.Empty) { // when no timezone offset is supplied, then treat the time as UTC return unixTime.FromUnixTimeMs(); } if (JsConfig.DateHandler == JsonDateHandler.DCJSCompatible) { // DCJS ignores the offset and considers it local time if any offset exists return unixTime.FromUnixTimeMs().ToLocalTime(); } var offset = timeZone.FromTimeOffsetString(); var date = unixTime.FromUnixTimeMs(offset); return date; } public static string ToWcfJsonDate(DateTime dateTime) { if (JsConfig.DateHandler == JsonDateHandler.ISO8601) { return EscapedWcfJsonPrefix + dateTime.ToString("o", CultureInfo.InvariantCulture) + EscapedWcfJsonSuffix; } var timestamp = dateTime.ToUnixTimeMs(); var offset = dateTime.Kind == DateTimeKind.Utc || dateTime.Kind == DateTimeKind.Unspecified ? string.Empty : TimeZoneInfo.Local.GetUtcOffset(dateTime).ToTimeOffsetString(); return EscapedWcfJsonPrefix + timestamp + offset + EscapedWcfJsonSuffix; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/DeserializeArray.cs0000644000175000017500000001373112146506553030607 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Reflection; using System.Threading; namespace ServiceStack.Text.Common { internal static class DeserializeArrayWithElements where TSerializer : ITypeSerializer { private static Dictionary ParseDelegateCache = new Dictionary(); private delegate object ParseArrayOfElementsDelegate(string value, ParseStringDelegate parseFn); public static Func GetParseFn(Type type) { ParseArrayOfElementsDelegate parseFn; if (ParseDelegateCache.TryGetValue(type, out parseFn)) return parseFn.Invoke; var genericType = typeof(DeserializeArrayWithElements<,>).MakeGenericType(type, typeof(TSerializer)); var mi = genericType.GetMethod("ParseGenericArray", BindingFlags.Public | BindingFlags.Static); parseFn = (ParseArrayOfElementsDelegate)Delegate.CreateDelegate(typeof(ParseArrayOfElementsDelegate), mi); Dictionary snapshot, newCache; do { snapshot = ParseDelegateCache; newCache = new Dictionary(ParseDelegateCache); newCache[type] = parseFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref ParseDelegateCache, newCache, snapshot), snapshot)); return parseFn.Invoke; } } internal static class DeserializeArrayWithElements where TSerializer : ITypeSerializer { private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); public static T[] ParseGenericArray(string value, ParseStringDelegate elementParseFn) { if ((value = DeserializeListWithElements.StripList(value)) == null) return null; if (value == string.Empty) return new T[0]; if (value[0] == JsWriter.MapStartChar) { var itemValues = new List(); var i = 0; do { itemValues.Add(Serializer.EatTypeValue(value, ref i)); } while (++i < value.Length); var results = new T[itemValues.Count]; for (var j=0; j < itemValues.Count; j++) { results[j] = (T)elementParseFn(itemValues[j]); } return results; } else { var to = new List(); var valueLength = value.Length; var i = 0; while (i < valueLength) { var elementValue = Serializer.EatValue(value, ref i); var listValue = elementValue; to.Add((T)elementParseFn(listValue)); Serializer.EatItemSeperatorOrMapEndChar(value, ref i); } return to.ToArray(); } } } internal static class DeserializeArray where TSerializer : ITypeSerializer { private static Dictionary ParseDelegateCache = new Dictionary(); public static ParseStringDelegate GetParseFn(Type type) { ParseStringDelegate parseFn; if (ParseDelegateCache.TryGetValue(type, out parseFn)) return parseFn; var genericType = typeof(DeserializeArray<,>).MakeGenericType(type, typeof(TSerializer)); var mi = genericType.GetMethod("GetParseFn", BindingFlags.Public | BindingFlags.Static); var parseFactoryFn = (Func)Delegate.CreateDelegate( typeof(Func), mi); parseFn = parseFactoryFn(); Dictionary snapshot, newCache; do { snapshot = ParseDelegateCache; newCache = new Dictionary(ParseDelegateCache); newCache[type] = parseFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref ParseDelegateCache, newCache, snapshot), snapshot)); return parseFn; } } internal static class DeserializeArray where TSerializer : ITypeSerializer { private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); private static readonly ParseStringDelegate CacheFn; static DeserializeArray() { CacheFn = GetParseFn(); } public static ParseStringDelegate Parse { get { return CacheFn; } } public static ParseStringDelegate GetParseFn() { var type = typeof (T); if (!type.IsArray) throw new ArgumentException(string.Format("Type {0} is not an Array type", type.FullName)); if (type == typeof(string[])) return ParseStringArray; if (type == typeof(byte[])) return ParseByteArray; var elementType = type.GetElementType(); var elementParseFn = Serializer.GetParseFn(elementType); if (elementParseFn != null) { var parseFn = DeserializeArrayWithElements.GetParseFn(elementType); return value => parseFn(value, elementParseFn); } return null; } public static string[] ParseStringArray(string value) { if ((value = DeserializeListWithElements.StripList(value)) == null) return null; return value == string.Empty ? new string[0] : DeserializeListWithElements.ParseStringList(value).ToArray(); } public static byte[] ParseByteArray(string value) { if ((value = DeserializeListWithElements.StripList(value)) == null) return null; if ((value = Serializer.ParseRawString(value)) == null) return null; return value == string.Empty ? new byte[0] : Convert.FromBase64String(value); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/DeserializeTypeRefJsv.cs0000644000175000017500000000636412146506553031576 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Runtime.Serialization; using ServiceStack.Text.Jsv; namespace ServiceStack.Text.Common { internal static class DeserializeTypeRefJsv { private static readonly JsvTypeSerializer Serializer = (JsvTypeSerializer)JsvTypeSerializer.Instance; internal static object StringToType( Type type, string strType, EmptyCtorDelegate ctorFn, Dictionary typeAccessorMap) { var index = 0; if (strType == null) return null; //if (!Serializer.EatMapStartChar(strType, ref index)) if (strType[index++] != JsWriter.MapStartChar) throw DeserializeTypeRef.CreateSerializationError(type, strType); if (strType == JsWriter.EmptyMap) return ctorFn(); object instance = null; var strTypeLength = strType.Length; while (index < strTypeLength) { var propertyName = Serializer.EatMapKey(strType, ref index); //Serializer.EatMapKeySeperator(strType, ref index); index++; var propertyValueStr = Serializer.EatValue(strType, ref index); var possibleTypeInfo = propertyValueStr != null && propertyValueStr.Length > 1 && propertyValueStr[0] == '_'; if (possibleTypeInfo && propertyName == JsWriter.TypeAttr) { var typeName = Serializer.ParseString(propertyValueStr); instance = ReflectionExtensions.CreateInstance(typeName); if (instance == null) { Tracer.Instance.WriteWarning("Could not find type: " + propertyValueStr); } else { //If __type info doesn't match, ignore it. if (!type.IsInstanceOfType(instance)) instance = null; } //Serializer.EatItemSeperatorOrMapEndChar(strType, ref index); if (index != strType.Length) index++; continue; } if (instance == null) instance = ctorFn(); TypeAccessor typeAccessor; typeAccessorMap.TryGetValue(propertyName, out typeAccessor); var propType = possibleTypeInfo ? TypeAccessor.ExtractType(Serializer, propertyValueStr) : null; if (propType != null) { try { if (typeAccessor != null) { var parseFn = Serializer.GetParseFn(propType); var propertyValue = parseFn(propertyValueStr); typeAccessor.SetProperty(instance, propertyValue); } //Serializer.EatItemSeperatorOrMapEndChar(strType, ref index); if (index != strType.Length) index++; continue; } catch { Tracer.Instance.WriteWarning("WARN: failed to set dynamic property {0} with: {1}", propertyName, propertyValueStr); } } if (typeAccessor != null && typeAccessor.GetProperty != null && typeAccessor.SetProperty != null) { try { var propertyValue = typeAccessor.GetProperty(propertyValueStr); typeAccessor.SetProperty(instance, propertyValue); } catch { Tracer.Instance.WriteWarning("WARN: failed to set property {0} with: {1}", propertyName, propertyValueStr); } } //Serializer.EatItemSeperatorOrMapEndChar(strType, ref index); if (index != strType.Length) index++; } return instance; } } //The same class above but JSON-specific to enable inlining in this hot class. }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/DeserializeCollection.cs0000644000175000017500000001077012146506553031624 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Reflection; using System.Threading; namespace ServiceStack.Text.Common { internal static class DeserializeCollection where TSerializer : ITypeSerializer { private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); public static ParseStringDelegate GetParseMethod(Type type) { var collectionInterface = type.GetTypeWithGenericInterfaceOf(typeof(ICollection<>)); if (collectionInterface == null) throw new ArgumentException(string.Format("Type {0} is not of type ICollection<>", type.FullName)); //optimized access for regularly used types if (type.HasInterface(typeof(ICollection))) return value => ParseStringCollection(value, type); if (type.HasInterface(typeof(ICollection))) return value => ParseIntCollection(value, type); var elementType = collectionInterface.GetGenericArguments()[0]; var supportedTypeParseMethod = Serializer.GetParseFn(elementType); if (supportedTypeParseMethod != null) { var createCollectionType = type.HasAnyTypeDefinitionsOf(typeof(ICollection<>)) ? null : type; return value => ParseCollectionType(value, createCollectionType, elementType, supportedTypeParseMethod); } return null; } public static ICollection ParseStringCollection(string value, Type createType) { var items = DeserializeArrayWithElements.ParseGenericArray(value, Serializer.ParseString); return CreateAndPopulate(createType, items); } public static ICollection ParseIntCollection(string value, Type createType) { var items = DeserializeArrayWithElements.ParseGenericArray(value, x => int.Parse(x)); return CreateAndPopulate(createType, items); } public static ICollection ParseCollection(string value, Type createType, ParseStringDelegate parseFn) { if (value == null) return null; var items = DeserializeArrayWithElements.ParseGenericArray(value, parseFn); return CreateAndPopulate(createType, items); } private static ICollection CreateAndPopulate(Type ofCollectionType, T[] withItems) { if (ofCollectionType == null) return new List(withItems); var genericTypeDefinition = ofCollectionType.IsGenericType() ? ofCollectionType.GetGenericTypeDefinition() : null; #if !XBOX if (genericTypeDefinition == typeof(HashSet)) return new HashSet(withItems); #endif if (genericTypeDefinition == typeof(LinkedList)) return new LinkedList(withItems); var collection = (ICollection)ofCollectionType.CreateInstance(); foreach (var item in withItems) { collection.Add(item); } return collection; } private static Dictionary ParseDelegateCache = new Dictionary(); private delegate object ParseCollectionDelegate(string value, Type createType, ParseStringDelegate parseFn); public static object ParseCollectionType(string value, Type createType, Type elementType, ParseStringDelegate parseFn) { ParseCollectionDelegate parseDelegate; if (ParseDelegateCache.TryGetValue(elementType, out parseDelegate)) return parseDelegate(value, createType, parseFn); var mi = typeof(DeserializeCollection).GetMethod("ParseCollection", BindingFlags.Static | BindingFlags.Public); var genericMi = mi.MakeGenericMethod(new[] { elementType }); parseDelegate = (ParseCollectionDelegate)Delegate.CreateDelegate(typeof(ParseCollectionDelegate), genericMi); Dictionary snapshot, newCache; do { snapshot = ParseDelegateCache; newCache = new Dictionary(ParseDelegateCache); newCache[elementType] = parseDelegate; } while (!ReferenceEquals( Interlocked.CompareExchange(ref ParseDelegateCache, newCache, snapshot), snapshot)); return parseDelegate(value, createType, parseFn); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Common/WriteDictionary.cs0000644000175000017500000001503112146506553030463 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Threading; using ServiceStack.Text.Json; namespace ServiceStack.Text.Common { internal delegate void WriteMapDelegate( TextWriter writer, object oMap, WriteObjectDelegate writeKeyFn, WriteObjectDelegate writeValueFn); internal static class WriteDictionary where TSerializer : ITypeSerializer { private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); internal class MapKey { internal Type KeyType; internal Type ValueType; public MapKey(Type keyType, Type valueType) { KeyType = keyType; ValueType = valueType; } public bool Equals(MapKey other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.KeyType, KeyType) && Equals(other.ValueType, ValueType); } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; if (obj.GetType() != typeof(MapKey)) return false; return Equals((MapKey)obj); } public override int GetHashCode() { unchecked { return ((KeyType != null ? KeyType.GetHashCode() : 0) * 397) ^ (ValueType != null ? ValueType.GetHashCode() : 0); } } } static Dictionary CacheFns = new Dictionary(); public static Action GetWriteGenericDictionary(Type keyType, Type valueType) { WriteMapDelegate writeFn; var mapKey = new MapKey(keyType, valueType); if (CacheFns.TryGetValue(mapKey, out writeFn)) return writeFn.Invoke; var genericType = typeof(ToStringDictionaryMethods<,,>).MakeGenericType(keyType, valueType, typeof(TSerializer)); var mi = genericType.GetMethod("WriteIDictionary", BindingFlags.Static | BindingFlags.Public); writeFn = (WriteMapDelegate)Delegate.CreateDelegate(typeof(WriteMapDelegate), mi); Dictionary snapshot, newCache; do { snapshot = CacheFns; newCache = new Dictionary(CacheFns); newCache[mapKey] = writeFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref CacheFns, newCache, snapshot), snapshot)); return writeFn.Invoke; } public static void WriteIDictionary(TextWriter writer, object oMap) { WriteObjectDelegate writeKeyFn = null; WriteObjectDelegate writeValueFn = null; writer.Write(JsWriter.MapStartChar); var encodeMapKey = false; var map = (IDictionary)oMap; var ranOnce = false; foreach (var key in map.Keys) { var dictionaryValue = map[key]; var isNull = (dictionaryValue == null); if (isNull && !JsConfig.IncludeNullValues) continue; if (writeKeyFn == null) { var keyType = key.GetType(); writeKeyFn = Serializer.GetWriteFn(keyType); encodeMapKey = Serializer.GetTypeInfo(keyType).EncodeMapKey; } if (writeValueFn == null) writeValueFn = Serializer.GetWriteFn(dictionaryValue.GetType()); JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); JsState.WritingKeyCount++; JsState.IsWritingValue = false; if (encodeMapKey) { JsState.IsWritingValue = true; //prevent ""null"" writer.Write(JsWriter.QuoteChar); writeKeyFn(writer, key); writer.Write(JsWriter.QuoteChar); } else { writeKeyFn(writer, key); } JsState.WritingKeyCount--; writer.Write(JsWriter.MapKeySeperator); if (isNull) { writer.Write(JsonUtils.Null); } else { JsState.IsWritingValue = true; writeValueFn(writer, dictionaryValue); JsState.IsWritingValue = false; } } writer.Write(JsWriter.MapEndChar); } } internal static class ToStringDictionaryMethods where TSerializer : ITypeSerializer { private static readonly ITypeSerializer Serializer = JsWriter.GetTypeSerializer(); public static void WriteIDictionary( TextWriter writer, object oMap, WriteObjectDelegate writeKeyFn, WriteObjectDelegate writeValueFn) { if (writer == null) return; //AOT WriteGenericIDictionary(writer, (IDictionary)oMap, writeKeyFn, writeValueFn); } public static void WriteGenericIDictionary( TextWriter writer, IDictionary map, WriteObjectDelegate writeKeyFn, WriteObjectDelegate writeValueFn) { if (map == null) { writer.Write(JsonUtils.Null); return; } writer.Write(JsWriter.MapStartChar); var encodeMapKey = Serializer.GetTypeInfo(typeof(TKey)).EncodeMapKey; var ranOnce = false; foreach (var kvp in map) { var isNull = (kvp.Value == null); if (isNull && !JsConfig.IncludeNullValues) continue; JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); JsState.WritingKeyCount++; JsState.IsWritingValue = false; if (encodeMapKey) { JsState.IsWritingValue = true; //prevent ""null"" writer.Write(JsWriter.QuoteChar); writeKeyFn(writer, kvp.Key); writer.Write(JsWriter.QuoteChar); } else { writeKeyFn(writer, kvp.Key); } JsState.WritingKeyCount--; writer.Write(JsWriter.MapKeySeperator); if (isNull) { writer.Write(JsonUtils.Null); } else { JsState.IsWritingValue = true; writeValueFn(writer, kvp.Value); JsState.IsWritingValue = false; } } writer.Write(JsWriter.MapEndChar); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/XmlSerializer.cs0000644000175000017500000001171312146506553026710 0ustar00meebeymeebey00000000000000using System; using System.IO; #if !XBOX360 && !SILVERLIGHT using System.IO.Compression; #endif using System.Runtime.Serialization; using System.Text; using System.Xml; namespace ServiceStack.Text { #if !XBOX public class XmlSerializer { private readonly XmlDictionaryReaderQuotas quotas; private static readonly XmlWriterSettings XSettings = new XmlWriterSettings(); public static XmlSerializer Instance = new XmlSerializer( #if !SILVERLIGHT new XmlDictionaryReaderQuotas { MaxStringContentLength = 1024 * 1024, } #endif ); public XmlSerializer(XmlDictionaryReaderQuotas quotas=null, bool omitXmlDeclaration = false) { this.quotas = quotas; XSettings.Encoding = Encoding.UTF8; XSettings.OmitXmlDeclaration = omitXmlDeclaration; } private static object Deserialize(string xml, Type type, XmlDictionaryReaderQuotas quotas) { try { var bytes = Encoding.UTF8.GetBytes(xml); using (var reader = XmlDictionaryReader.CreateTextReader(bytes, quotas)) { var serializer = new DataContractSerializer(type); return serializer.ReadObject(reader); } } catch (Exception ex) { throw new SerializationException("DeserializeDataContract: Error converting type: " + ex.Message, ex); } } public static object DeserializeFromString(string xml, Type type) { return Deserialize(xml, type, Instance.quotas); } public static T DeserializeFromString(string xml) { var type = typeof(T); return (T)Deserialize(xml, type, Instance.quotas); } public static T DeserializeFromReader(TextReader reader) { return DeserializeFromString(reader.ReadToEnd()); } public static T DeserializeFromStream(Stream stream) { var serializer = new DataContractSerializer(typeof(T)); return (T)serializer.ReadObject(stream); } public static object DeserializeFromStream(Type type, Stream stream) { var serializer = new DataContractSerializer(type); return serializer.ReadObject(stream); } public static string SerializeToString(T from) { try { using (var ms = new MemoryStream()) { using (var xw = XmlWriter.Create(ms, XSettings)) { var serializer = new DataContractSerializer(from.GetType()); serializer.WriteObject(xw, from); xw.Flush(); ms.Seek(0, SeekOrigin.Begin); var reader = new StreamReader(ms); return reader.ReadToEnd(); } } } catch (Exception ex) { throw new SerializationException(string.Format("Error serializing object of type {0}", from.GetType().FullName), ex); } } public static void SerializeToWriter(T value, TextWriter writer) { try { #if !SILVERLIGHT using (var xw = new XmlTextWriter(writer)) #else using (var xw = XmlWriter.Create(writer)) #endif { var serializer = new DataContractSerializer(value.GetType()); serializer.WriteObject(xw, value); } } catch (Exception ex) { throw new SerializationException(string.Format("Error serializing object of type {0}", value.GetType().FullName), ex); } } public static void SerializeToStream(object obj, Stream stream) { #if !SILVERLIGHT using (var xw = new XmlTextWriter(stream, Encoding.UTF8)) #else using (var xw = XmlWriter.Create(stream)) #endif { var serializer = new DataContractSerializer(obj.GetType()); serializer.WriteObject(xw, obj); } } #if !SILVERLIGHT public static void CompressToStream(TXmlDto from, Stream stream) { using (var deflateStream = new DeflateStream(stream, CompressionMode.Compress)) using (var xw = new XmlTextWriter(deflateStream, Encoding.UTF8)) { var serializer = new DataContractSerializer(from.GetType()); serializer.WriteObject(xw, from); xw.Flush(); } } public static byte[] Compress(TXmlDto from) { using (var ms = new MemoryStream()) { CompressToStream(from, ms); return ms.ToArray(); } } #endif } #endif } smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/AssemblyUtils.cs0000644000175000017500000001037112146506553026715 0ustar00meebeymeebey00000000000000using System; using System.IO; using System.Reflection; using System.Text; using System.Text.RegularExpressions; #if SILVERLIGHT using System.Windows; #endif using ServiceStack.Common.Support; namespace ServiceStack.Text { /// /// Utils to load types /// public static class AssemblyUtils { private const string FileUri = "file:///"; private const string DllExt = "dll"; private const string ExeExt = "dll"; private const char UriSeperator = '/'; #if !XBOX /// /// Find the type from the name supplied /// /// [typeName] or [typeName, assemblyName] /// public static Type FindType(string typeName) { #if !SILVERLIGHT var type = Type.GetType(typeName); if (type != null) return type; #endif var typeDef = new AssemblyTypeDefinition(typeName); if (!String.IsNullOrEmpty(typeDef.AssemblyName)) { return FindType(typeDef.TypeName, typeDef.AssemblyName); } else { return FindTypeFromLoadedAssemblies(typeDef.TypeName); } } #endif #if !XBOX /// /// Find type if it exists /// /// /// /// The type if it exists public static Type FindType(string typeName, string assemblyName) { var type = FindTypeFromLoadedAssemblies(typeName); if (type != null) { return type; } var binPath = GetAssemblyBinPath(Assembly.GetExecutingAssembly()); Assembly assembly = null; var assemblyDllPath = binPath + String.Format("{0}.{1}", assemblyName, DllExt); if (File.Exists(assemblyDllPath)) { assembly = LoadAssembly(assemblyDllPath); } var assemblyExePath = binPath + String.Format("{0}.{1}", assemblyName, ExeExt); if (File.Exists(assemblyExePath)) { assembly = LoadAssembly(assemblyExePath); } return assembly != null ? assembly.GetType(typeName) : null; } #endif #if !XBOX public static Type FindTypeFromLoadedAssemblies(string typeName) { #if SILVERLIGHT4 var assemblies = ((dynamic) AppDomain.CurrentDomain).GetAssemblies() as Assembly[]; #else var assemblies = AppDomain.CurrentDomain.GetAssemblies(); #endif foreach (var assembly in assemblies) { var type = assembly.GetType(typeName); if (type != null) { return type; } } return null; } #endif #if !SILVERLIGHT private static Assembly LoadAssembly(string assemblyPath) { return Assembly.LoadFrom(assemblyPath); } #else private static Assembly LoadAssembly(string assemblyPath) { var sri = Application.GetResourceStream(new Uri(assemblyPath, UriKind.Relative)); var myPart = new AssemblyPart(); var assembly = myPart.Load(sri.Stream); return assembly; } #endif #if !XBOX public static string GetAssemblyBinPath(Assembly assembly) { var binPathPos = assembly.CodeBase.LastIndexOf(UriSeperator); var assemblyPath = assembly.CodeBase.Substring(0, binPathPos + 1); if (assemblyPath.StartsWith(FileUri)) { assemblyPath = assemblyPath.Remove(0, FileUri.Length); } return assemblyPath; } #endif #if !SILVERLIGHT static readonly Regex versionRegEx = new Regex(", Version=[^\\]]+", RegexOptions.Compiled); #else static readonly Regex versionRegEx = new Regex(", Version=[^\\]]+"); #endif public static string ToTypeString(this Type type) { return versionRegEx.Replace(type.AssemblyQualifiedName, ""); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/StreamExtensions.cs0000644000175000017500000001461212146506553027432 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.IO; namespace ServiceStack.Text { public static class StreamExtensions { public static void WriteTo(this Stream inStream, Stream outStream) { var memoryStream = inStream as MemoryStream; if (memoryStream != null) { memoryStream.WriteTo(outStream); return; } var data = new byte[4096]; int bytesRead; while ((bytesRead = inStream.Read(data, 0, data.Length)) > 0) { outStream.Write(data, 0, bytesRead); } } public static IEnumerable ReadLines(this StreamReader reader) { if (reader == null) throw new ArgumentNullException("reader"); string line; while ((line = reader.ReadLine()) != null) { yield return line; } } /// /// @jonskeet: Collection of utility methods which operate on streams. /// r285, February 26th 2009: http://www.yoda.arachsys.com/csharp/miscutil/ /// const int DefaultBufferSize = 8 * 1024; /// /// Reads the given stream up to the end, returning the data as a byte /// array. /// public static byte[] ReadFully(this Stream input) { return ReadFully(input, DefaultBufferSize); } /// /// Reads the given stream up to the end, returning the data as a byte /// array, using the given buffer size. /// public static byte[] ReadFully(this Stream input, int bufferSize) { if (bufferSize < 1) { throw new ArgumentOutOfRangeException("bufferSize"); } return ReadFully(input, new byte[bufferSize]); } /// /// Reads the given stream up to the end, returning the data as a byte /// array, using the given buffer for transferring data. Note that the /// current contents of the buffer is ignored, so the buffer needn't /// be cleared beforehand. /// public static byte[] ReadFully(this Stream input, byte[] buffer) { if (buffer == null) { throw new ArgumentNullException("buffer"); } if (input == null) { throw new ArgumentNullException("input"); } if (buffer.Length == 0) { throw new ArgumentException("Buffer has length of 0"); } // We could do all our own work here, but using MemoryStream is easier // and likely to be just as efficient. using (var tempStream = new MemoryStream()) { CopyTo(input, tempStream, buffer); // No need to copy the buffer if it's the right size if (tempStream.Length == tempStream.GetBuffer().Length) { return tempStream.GetBuffer(); } // Okay, make a copy that's the right size return tempStream.ToArray(); } } /// /// Copies all the data from one stream into another. /// public static void CopyTo(this Stream input, Stream output) { CopyTo(input, output, DefaultBufferSize); } /// /// Copies all the data from one stream into another, using a buffer /// of the given size. /// public static void CopyTo(this Stream input, Stream output, int bufferSize) { if (bufferSize < 1) { throw new ArgumentOutOfRangeException("bufferSize"); } CopyTo(input, output, new byte[bufferSize]); } /// /// Copies all the data from one stream into another, using the given /// buffer for transferring data. Note that the current contents of /// the buffer is ignored, so the buffer needn't be cleared beforehand. /// public static void CopyTo(this Stream input, Stream output, byte[] buffer) { if (buffer == null) { throw new ArgumentNullException("buffer"); } if (input == null) { throw new ArgumentNullException("input"); } if (output == null) { throw new ArgumentNullException("output"); } if (buffer.Length == 0) { throw new ArgumentException("Buffer has length of 0"); } int read; while ((read = input.Read(buffer, 0, buffer.Length)) > 0) { output.Write(buffer, 0, read); } } /// /// Reads exactly the given number of bytes from the specified stream. /// If the end of the stream is reached before the specified amount /// of data is read, an exception is thrown. /// public static byte[] ReadExactly(this Stream input, int bytesToRead) { return ReadExactly(input, new byte[bytesToRead]); } /// /// Reads into a buffer, filling it completely. /// public static byte[] ReadExactly(this Stream input, byte[] buffer) { return ReadExactly(input, buffer, buffer.Length); } /// /// Reads exactly the given number of bytes from the specified stream, /// into the given buffer, starting at position 0 of the array. /// public static byte[] ReadExactly(this Stream input, byte[] buffer, int bytesToRead) { return ReadExactly(input, buffer, 0, bytesToRead); } /// /// Reads exactly the given number of bytes from the specified stream, /// into the given buffer, starting at position 0 of the array. /// public static byte[] ReadExactly(this Stream input, byte[] buffer, int startIndex, int bytesToRead) { if (input == null) { throw new ArgumentNullException("input"); } if (buffer == null) { throw new ArgumentNullException("buffer"); } if (startIndex < 0 || startIndex >= buffer.Length) { throw new ArgumentOutOfRangeException("startIndex"); } if (bytesToRead < 1 || startIndex + bytesToRead > buffer.Length) { throw new ArgumentOutOfRangeException("bytesToRead"); } return ReadExactlyFast(input, buffer, startIndex, bytesToRead); } /// /// Same as ReadExactly, but without the argument checks. /// private static byte[] ReadExactlyFast(Stream fromStream, byte[] intoBuffer, int startAtIndex, int bytesToRead) { var index = 0; while (index < bytesToRead) { var read = fromStream.Read(intoBuffer, startAtIndex + index, bytesToRead - index); if (read == 0) { throw new EndOfStreamException (String.Format("End of stream reached with {0} byte{1} left to read.", bytesToRead - index, bytesToRead - index == 1 ? "s" : "")); } index += read; } return intoBuffer; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/DateTimeExtensions.cs0000644000175000017500000001100012146506553027657 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using ServiceStack.Text.Common; namespace ServiceStack.Text { /// /// A fast, standards-based, serialization-issue free DateTime serailizer. /// public static class DateTimeExtensions { public const long UnixEpoch = 621355968000000000L; private static readonly DateTime UnixEpochDateTimeUtc = new DateTime(UnixEpoch, DateTimeKind.Utc); private static readonly DateTime UnixEpochDateTimeUnspecified = new DateTime(UnixEpoch, DateTimeKind.Unspecified); public static long ToUnixTime(this DateTime dateTime) { return (dateTime.ToStableUniversalTime().Ticks - UnixEpoch) / TimeSpan.TicksPerSecond; } public static DateTime FromUnixTime(this double unixTime) { return UnixEpochDateTimeUtc + TimeSpan.FromSeconds(unixTime); } public static long ToUnixTimeMs(this DateTime dateTime) { return (dateTime.ToStableUniversalTime().Ticks - UnixEpoch) / TimeSpan.TicksPerMillisecond; } public static DateTime FromUnixTimeMs(this double msSince1970) { return UnixEpochDateTimeUtc + TimeSpan.FromMilliseconds(msSince1970); } public static DateTime FromUnixTimeMs(this long msSince1970) { return UnixEpochDateTimeUtc + TimeSpan.FromMilliseconds(msSince1970); } public static DateTime FromUnixTimeMs(this long msSince1970, TimeSpan offset) { return UnixEpochDateTimeUnspecified + TimeSpan.FromMilliseconds(msSince1970) + offset; } public static DateTime FromUnixTimeMs(this double msSince1970, TimeSpan offset) { return UnixEpochDateTimeUnspecified + TimeSpan.FromMilliseconds(msSince1970) + offset; } public static DateTime FromUnixTimeMs(string msSince1970) { long ms; if (long.TryParse(msSince1970, out ms)) return ms.FromUnixTimeMs(); // Do we really need to support fractional unix time ms time strings?? return double.Parse(msSince1970).FromUnixTimeMs(); } public static DateTime FromUnixTimeMs(string msSince1970, TimeSpan offset) { long ms; if (long.TryParse(msSince1970, out ms)) return ms.FromUnixTimeMs(offset); // Do we really need to support fractional unix time ms time strings?? return double.Parse(msSince1970).FromUnixTimeMs(offset); } public static DateTime RoundToMs(this DateTime dateTime) { return new DateTime((dateTime.Ticks / TimeSpan.TicksPerMillisecond) * TimeSpan.TicksPerMillisecond); } public static DateTime RoundToSecond(this DateTime dateTime) { return new DateTime((dateTime.Ticks / TimeSpan.TicksPerSecond) * TimeSpan.TicksPerSecond); } public static string ToShortestXsdDateTimeString(this DateTime dateTime) { return DateTimeSerializer.ToShortestXsdDateTimeString(dateTime); } public static DateTime FromShortestXsdDateTimeString(this string xsdDateTime) { return DateTimeSerializer.ParseShortestXsdDateTime(xsdDateTime); } public static bool IsEqualToTheSecond(this DateTime dateTime, DateTime otherDateTime) { return dateTime.ToStableUniversalTime().RoundToSecond().Equals(otherDateTime.ToStableUniversalTime().RoundToSecond()); } public static string ToTimeOffsetString(this TimeSpan offset, bool includeColon = false) { var sign = offset < TimeSpan.Zero ? "-" : "+"; var hours = Math.Abs(offset.Hours); var minutes = Math.Abs(offset.Minutes); var separator = includeColon ? ":" : ""; return string.Format("{0}{1:00}{2}{3:00}", sign, hours, separator, minutes); } public static TimeSpan FromTimeOffsetString(this string offsetString) { if (!offsetString.Contains(":")) offsetString = offsetString.Insert(offsetString.Length - 2, ":"); offsetString = offsetString.TrimStart('+'); return TimeSpan.Parse(offsetString); } public static DateTime ToStableUniversalTime(this DateTime dateTime) { #if SILVERLIGHT // Silverlight 3, 4 and 5 all work ok with DateTime.ToUniversalTime, but have no TimeZoneInfo.ConverTimeToUtc implementation. return dateTime.ToUniversalTime(); #else // .Net 2.0 - 3.5 has an issue with DateTime.ToUniversalTime, but works ok with TimeZoneInfo.ConvertTimeToUtc. // .Net 4.0+ does this under the hood anyway. return TimeZoneInfo.ConvertTimeToUtc(dateTime); #endif } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/MapExtensions.cs0000644000175000017500000000172612146506553026716 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System.Collections.Generic; using System.Text; using ServiceStack.Text.Common; namespace ServiceStack.Text { public static class MapExtensions { public static string Join(this Dictionary values) { return Join(values, JsWriter.ItemSeperatorString, JsWriter.MapKeySeperatorString); } public static string Join(this Dictionary values, string itemSeperator, string keySeperator) { var sb = new StringBuilder(); foreach (var entry in values) { if (sb.Length > 0) sb.Append(itemSeperator); sb.Append(entry.Key).Append(keySeperator).Append(entry.Value); } return sb.ToString(); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Env.cs0000644000175000017500000000171512146506553024647 0ustar00meebeymeebey00000000000000 using System; namespace ServiceStack.Text { public static class Env { static Env() { var platform = (int)Environment.OSVersion.Platform; IsUnix = (platform == 4) || (platform == 6) || (platform == 128); IsMono = Type.GetType("Mono.Runtime") != null; IsMonoTouch = Type.GetType("MonoTouch.Foundation.NSObject") != null; SupportsExpressions = SupportsEmit = !IsMonoTouch; ServerUserAgent = "ServiceStack/" + ServiceStackVersion + " " + Environment.OSVersion.Platform + (IsMono ? "/Mono" : "/.NET") + (IsMonoTouch ? " MonoTouch" : ""); } public static decimal ServiceStackVersion = 3.55m; public static bool IsUnix { get; set; } public static bool IsMono { get; set; } public static bool IsMonoTouch { get; set; } public static bool SupportsExpressions { get; set; } public static bool SupportsEmit { get; set; } public static string ServerUserAgent { get; set; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/JsvFormatter.cs0000644000175000017500000000426312146506553026546 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Peter Townsend (townsend.pete@gmail.com) // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Text; using ServiceStack.Text.Common; namespace ServiceStack.Text { public static class JsvFormatter { public static string Format(string serializedText) { if (string.IsNullOrEmpty(serializedText)) return null; var tabCount = 0; var sb = new StringBuilder(); var firstKeySeparator = true; for (var i = 0; i < serializedText.Length; i++) { var current = serializedText[i]; var previous = i - 1 >= 0 ? serializedText[i - 1] : 0; var next = i < serializedText.Length - 1 ? serializedText[i + 1] : 0; if (current == JsWriter.MapStartChar || current == JsWriter.ListStartChar) { if (previous == JsWriter.MapKeySeperator) { if (next == JsWriter.MapEndChar || next == JsWriter.ListEndChar) { sb.Append(current); sb.Append(serializedText[++i]); //eat next continue; } AppendTabLine(sb, tabCount); } sb.Append(current); AppendTabLine(sb, ++tabCount); firstKeySeparator = true; continue; } if (current == JsWriter.MapEndChar || current == JsWriter.ListEndChar) { AppendTabLine(sb, --tabCount); sb.Append(current); firstKeySeparator = true; continue; } if (current == JsWriter.ItemSeperator) { sb.Append(current); AppendTabLine(sb, tabCount); firstKeySeparator = true; continue; } sb.Append(current); if (current == JsWriter.MapKeySeperator && firstKeySeparator) { sb.Append(" "); firstKeySeparator = false; } } return sb.ToString(); } private static void AppendTabLine(StringBuilder sb, int tabCount) { sb.AppendLine(); if (tabCount > 0) { sb.Append(new string('\t', tabCount)); } } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/JsonObject.cs0000644000175000017500000000425512146506553026161 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.Text { public static class JsonExtensions { public static T JsonTo(this Dictionary map, string key) { return Get(map, key); } public static T Get(this Dictionary map, string key) { string strVal; return map.TryGetValue(key, out strVal) ? JsonSerializer.DeserializeFromString(strVal) : default(T); } public static string Get(this Dictionary map, string key) { string strVal; return map.TryGetValue(key, out strVal) ? strVal : null; } public static JsonArrayObjects ArrayObjects(this string json, string propertyName) { return Text.JsonArrayObjects.Parse(json); } public static List ConvertAll(this JsonArrayObjects jsonArrayObjects, Func converter) { var results = new List(); foreach (var jsonObject in jsonArrayObjects) { results.Add(converter(jsonObject)); } return results; } public static T ConvertTo(this JsonObject jsonObject, Func converFn) { return jsonObject == null ? default(T) : converFn(jsonObject); } public static Dictionary ToDictionary(this JsonObject jsonObject) { return jsonObject == null ? new Dictionary() : new Dictionary(jsonObject); } } public class JsonObject : Dictionary { public static JsonObject Parse(string json) { return JsonSerializer.DeserializeFromString(json); } public JsonArrayObjects ArrayObjects(string propertyName) { string strValue; return this.TryGetValue(propertyName, out strValue) ? JsonArrayObjects.Parse(strValue) : null; } public JsonObject Object(string propertyName) { string strValue; return this.TryGetValue(propertyName, out strValue) ? Parse(strValue) : null; } } public class JsonArrayObjects : List { public static JsonArrayObjects Parse(string json) { return JsonSerializer.DeserializeFromString(json); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/CsvWriter.cs0000644000175000017500000001127112146506553026045 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.IO; using ServiceStack.Text.Common; using ServiceStack.Text.Reflection; namespace ServiceStack.Text { internal class CsvWriter { public const char DelimiterChar = ','; public static List Headers { get; set; } internal static List> PropertyGetters; private static readonly WriteObjectDelegate OptimizedWriter; static CsvWriter() { if (typeof(T) == typeof(string)) { OptimizedWriter = (w, o) => WriteRow(w, (IEnumerable)o); return; } Reset(); } internal static void Reset() { Headers = new List(); PropertyGetters = new List>(); foreach (var propertyInfo in TypeConfig.Properties) { if (!propertyInfo.CanRead || propertyInfo.GetGetMethod() == null) continue; if (!TypeSerializer.CanCreateFromString(propertyInfo.PropertyType)) continue; PropertyGetters.Add(propertyInfo.GetValueGetter()); Headers.Add(propertyInfo.Name); } } internal static void ConfigureCustomHeaders(Dictionary customHeadersMap) { Reset(); for (var i = Headers.Count - 1; i >= 0; i--) { var oldHeader = Headers[i]; string newHeaderValue; if (!customHeadersMap.TryGetValue(oldHeader, out newHeaderValue)) { Headers.RemoveAt(i); PropertyGetters.RemoveAt(i); } else { Headers[i] = newHeaderValue.EncodeJsv(); } } } private static List GetSingleRow(IEnumerable records, Type recordType) { var row = new List(); foreach (var value in records) { var strValue = recordType == typeof(string) ? value as string : TypeSerializer.SerializeToString(value); row.Add(strValue); } return row; } public static List> GetRows(IEnumerable records) { var rows = new List>(); if (records == null) return rows; if (typeof(T).IsValueType || typeof(T) == typeof(string)) { rows.Add(GetSingleRow(records, typeof(T))); return rows; } foreach (var record in records) { var row = new List(); foreach (var propertyGetter in PropertyGetters) { var value = propertyGetter(record) ?? ""; var strValue = value.GetType() == typeof(string) ? (string)value : TypeSerializer.SerializeToString(value); row.Add(strValue); } rows.Add(row); } return rows; } public static void WriteObject(TextWriter writer, object records) { Write(writer, (IEnumerable)records); } public static void WriteObjectRow(TextWriter writer, object record) { WriteRow(writer, (T)record); } public static void Write(TextWriter writer, IEnumerable records) { if (records == null) return; //AOT if (OptimizedWriter != null) { OptimizedWriter(writer, records); return; } if (!CsvConfig.OmitHeaders && Headers.Count > 0) { var ranOnce = false; foreach (var header in Headers) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); writer.Write(header); } writer.WriteLine(); } if (records == null) return; if (typeof(T).IsValueType || typeof(T) == typeof(string)) { var singleRow = GetSingleRow(records, typeof(T)); WriteRow(writer, singleRow); return; } var row = new string[Headers.Count]; foreach (var record in records) { for (var i = 0; i < PropertyGetters.Count; i++) { var propertyGetter = PropertyGetters[i]; var value = propertyGetter(record) ?? ""; var strValue = value.GetType() == typeof(string) ? (string)value : TypeSerializer.SerializeToString(value); row[i] = strValue; } WriteRow(writer, row); } } public static void WriteRow(TextWriter writer, T row) { if (row == null) return; //AOT Write(writer, new[] { row }); } public static void WriteRow(TextWriter writer, IEnumerable row) { var ranOnce = false; foreach (var field in row) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); writer.Write(field.ToCsvField()); } writer.WriteLine(); } public static void Write(TextWriter writer, IEnumerable> rows) { if (Headers.Count > 0) { var ranOnce = false; foreach (var header in Headers) { JsWriter.WriteItemSeperatorIfRanOnce(writer, ref ranOnce); writer.Write(header); } writer.WriteLine(); } foreach (var row in rows) { WriteRow(writer, row); } } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/TypeSerializer.Generic.cs0000644000175000017500000000303112146506553030436 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.IO; using System.Text; using ServiceStack.Text.Jsv; namespace ServiceStack.Text { public class TypeSerializer : ITypeSerializer { public bool CanCreateFromString(Type type) { return JsvReader.GetParseFn(type) != null; } /// /// Parses the specified value. /// /// The value. /// public T DeserializeFromString(string value) { if (string.IsNullOrEmpty(value)) return default(T); return (T)JsvReader.Parse(value); } public T DeserializeFromReader(TextReader reader) { return DeserializeFromString(reader.ReadToEnd()); } public string SerializeToString(T value) { if (value == null) return null; if (typeof(T) == typeof(string)) return value as string; var sb = new StringBuilder(); using (var writer = new StringWriter(sb)) { JsvWriter.WriteObject(writer, value); } return sb.ToString(); } public void SerializeToWriter(T value, TextWriter writer) { if (value == null) return; if (typeof(T) == typeof(string)) { writer.Write(value); return; } JsvWriter.WriteObject(writer, value); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/CsvStreamExtensions.cs0000644000175000017500000000141112146506553030077 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System.Collections.Generic; using System.IO; namespace ServiceStack.Text { public static class CsvStreamExtensions { public static void WriteCsv(this Stream outputStream, IEnumerable records) { using (var textWriter = new StreamWriter(outputStream)) { textWriter.WriteCsv(records); } } public static void WriteCsv(this TextWriter writer, IEnumerable records) { CsvWriter.Write(writer, records); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/ITypeSerializer.Generic.cs0000644000175000017500000000277612146506553030566 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.IO; namespace ServiceStack.Text { public interface ITypeSerializer { /// /// Determines whether this serializer can create the specified type from a string. /// /// The type. /// /// true if this instance [can create from string] the specified type; otherwise, false. /// bool CanCreateFromString(Type type); /// /// Parses the specified value. /// /// The value. /// T DeserializeFromString(string value); /// /// Deserializes from reader. /// /// The reader. /// T DeserializeFromReader(TextReader reader); /// /// Serializes to string. /// /// The value. /// string SerializeToString(T value); /// /// Serializes to writer. /// /// The value. /// The writer. void SerializeToWriter(T value, TextWriter writer); } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/JsConfig.cs0000644000175000017500000002634612146506553025630 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.IO; using ServiceStack.Text.Common; using ServiceStack.Text.Json; using ServiceStack.Text.Jsv; namespace ServiceStack.Text { public static class JsConfig { static JsConfig() { //In-built default serialization, to Deserialize Color struct do: //JsConfig.SerializeFn = c => c.ToString().Replace("Color ", "").Replace("[", "").Replace("]", ""); //JsConfig.DeSerializeFn = System.Drawing.Color.FromName; } [ThreadStatic] private static bool? tsConvertObjectTypesIntoStringDictionary; private static bool? sConvertObjectTypesIntoStringDictionary; public static bool ConvertObjectTypesIntoStringDictionary { get { return tsConvertObjectTypesIntoStringDictionary ?? sConvertObjectTypesIntoStringDictionary ?? false; } set { if (!tsConvertObjectTypesIntoStringDictionary.HasValue) tsConvertObjectTypesIntoStringDictionary = value; if (!sConvertObjectTypesIntoStringDictionary.HasValue) sConvertObjectTypesIntoStringDictionary = value; } } [ThreadStatic] private static bool? tsIncludeNullValues; private static bool? sIncludeNullValues; public static bool IncludeNullValues { get { return tsIncludeNullValues ?? sIncludeNullValues ?? false; } set { if (!tsIncludeNullValues.HasValue) tsIncludeNullValues = value; if (!sIncludeNullValues.HasValue) sIncludeNullValues = value; } } [ThreadStatic] private static bool? tsExcludeTypeInfo; private static bool? sExcludeTypeInfo; public static bool ExcludeTypeInfo { get { return tsExcludeTypeInfo ?? sExcludeTypeInfo ?? false; } set { if (!tsExcludeTypeInfo.HasValue) tsExcludeTypeInfo = value; if (!sExcludeTypeInfo.HasValue) sExcludeTypeInfo = value; } } [ThreadStatic] private static JsonDateHandler? tsDateHandler; private static JsonDateHandler? sDateHandler; public static JsonDateHandler DateHandler { get { return tsDateHandler ?? sDateHandler ?? JsonDateHandler.TimestampOffset; } set { if (!tsDateHandler.HasValue) tsDateHandler = value; if (!sDateHandler.HasValue) sDateHandler = value; } } /// /// if the is configured /// to take advantage of specification, /// to support user-friendly serialized formats, ie emitting camelCasing for JSON /// and parsing member names and enum values in a case-insensitive manner. /// [ThreadStatic] private static bool? tsEmitCamelCaseNames; private static bool? sEmitCamelCaseNames; public static bool EmitCamelCaseNames { // obeying the use of ThreadStatic, but allowing for setting JsConfig once as is the normal case get { return tsEmitCamelCaseNames ?? sEmitCamelCaseNames ?? false; } set { if (!tsEmitCamelCaseNames.HasValue) tsEmitCamelCaseNames = value; if (!sEmitCamelCaseNames.HasValue) sEmitCamelCaseNames = value; } } internal static HashSet HasSerializeFn = new HashSet(); public static void Reset() { tsConvertObjectTypesIntoStringDictionary = sConvertObjectTypesIntoStringDictionary = null; tsIncludeNullValues = sIncludeNullValues = null; tsExcludeTypeInfo = sExcludeTypeInfo = null; tsEmitCamelCaseNames = sEmitCamelCaseNames = null; tsDateHandler = sDateHandler = null; HasSerializeFn = new HashSet(); } #if SILVERLIGHT || MONOTOUCH /// /// Provide hint to MonoTouch AOT compiler to pre-compile generic classes for all your DTOs. /// Just needs to be called once in a static constructor. /// public static void InitForAot() { } public static void RegisterForAot() { JsonAotConfig.Register(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterElement(); RegisterQueryStringWriter(); RegisterCsvSerializer(); } static void RegisterQueryStringWriter() { var i = 0; if (QueryStringWriter.WriteFn() != null) i++; } static void RegisterCsvSerializer() { CsvSerializer.WriteFn(); CsvSerializer.WriteObject(null, null); CsvWriter.WriteObject(null, null); CsvWriter.WriteObjectRow(null, null); } public static void RegisterElement() { JsonAotConfig.RegisterElement(); } #endif } #if SILVERLIGHT || MONOTOUCH internal class Poco { public string Dummy { get; set; } } internal class JsonAotConfig { static JsReader reader; static JsonTypeSerializer serializer; static JsonAotConfig() { serializer = new JsonTypeSerializer(); reader = new JsReader(); } public static ParseStringDelegate GetParseFn(Type type) { var parseFn = JsonTypeSerializer.Instance.GetParseFn(type); return parseFn; } internal static ParseStringDelegate RegisterBuiltin() { var i = 0; if (reader.GetParseFn() != null) i++; if (JsonReader.GetParseFn() != null) i++; if (JsonReader.Parse(null) != null) i++; if (JsonWriter.WriteFn() != null) i++; return serializer.GetParseFn(); } public static void Register() { var i = 0; var serializer = JsonTypeSerializer.Instance; if (new List() != null) i++; if (new T[0] != null) i++; if (serializer.GetParseFn() != null) i++; if (DeserializeArray.Parse != null) i++; JsConfig.ExcludeTypeInfo = false; //JsConfig.SerializeFn = arg => ""; //JsConfig.DeSerializeFn = arg => default(T); DeserializeArrayWithElements.ParseGenericArray(null, null); DeserializeCollection.ParseCollection(null, null, null); DeserializeListWithElements.ParseGenericList(null, null, null); SpecializedQueueElements.ConvertToQueue(null); SpecializedQueueElements.ConvertToStack(null); WriteListsOfElements.WriteList(null, null); WriteListsOfElements.WriteIList(null, null); WriteListsOfElements.WriteEnumerable(null, null); WriteListsOfElements.WriteListValueType(null, null); WriteListsOfElements.WriteIListValueType(null, null); JsonReader.Parse(null); JsonWriter.WriteFn(); TranslateListWithElements.LateBoundTranslateToGenericICollection(null, null); TranslateListWithConvertibleElements.LateBoundTranslateToGenericICollection(null, null); QueryStringWriter.WriteObject(null, null); } public static void RegisterElement() { RegisterBuiltin(); DeserializeDictionary.ParseDictionary(null, null, null, null); DeserializeDictionary.ParseDictionary(null, null, null, null); ToStringDictionaryMethods.WriteIDictionary(null, null, null, null); ToStringDictionaryMethods.WriteIDictionary(null, null, null, null); TranslateListWithElements.LateBoundTranslateToGenericICollection(null, typeof(List)); TranslateListWithConvertibleElements.LateBoundTranslateToGenericICollection(null, typeof(List)); } } #endif public class JsConfig //where T : struct { /// /// Never emit type info for this type /// public static bool ExcludeTypeInfo = false; /// /// if the is configured /// to take advantage of specification, /// to support user-friendly serialized formats, ie emitting camelCasing for JSON /// and parsing member names and enum values in a case-insensitive manner. /// public static bool EmitCamelCaseNames = false; /// /// Define custom serialization fn for BCL Structs /// private static Func serializeFn; public static Func SerializeFn { get { return serializeFn; } set { serializeFn = value; if (value != null) JsConfig.HasSerializeFn.Add(typeof(T)); else JsConfig.HasSerializeFn.Remove(typeof(T)); } } /// /// Define custom deserialization fn for BCL Structs /// public static Func DeSerializeFn; /// /// Exclude specific properties of this type from being serialized /// public static string[] ExcludePropertyNames; public static void WriteFn(TextWriter writer, object obj) { var serializer = JsWriter.GetTypeSerializer(); serializer.WriteString(writer, SerializeFn((T)obj)); } public static object ParseFn(string str) { return DeSerializeFn(str); } } public enum JsonDateHandler { TimestampOffset, DCJSCompatible, ISO8601 } } smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Controller/0000755000175000017500000000000012146506553025707 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Controller/CommandProcessor.cs0000644000175000017500000000414612146506553031521 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Linq; namespace ServiceStack.Text.Controller { public class CommandProcessor { private object[] Controllers { get; set; } private readonly Dictionary contextMap; public CommandProcessor(object[] controllers) { this.Controllers = controllers; this.contextMap = new Dictionary(); controllers.ToList().ForEach(x => contextMap[x.GetType().Name] = x); } public void Invoke(string commandUri) { var actionParts = commandUri.Split(new[] { "://" }, StringSplitOptions.None); var controllerName = actionParts[0]; var pathInfo = PathInfo.Parse(actionParts[1]); object context; if (!this.contextMap.TryGetValue(controllerName, out context)) { throw new Exception("UnknownContext: " + controllerName); } var methodName = pathInfo.ActionName; var method = context.GetType().GetMethods().First( c => c.Name == methodName && c.GetParameters().Count() == pathInfo.Arguments.Count); var methodParamTypes = method.GetParameters().Select(x => x.ParameterType); var methodArgs = ConvertValuesToTypes(pathInfo.Arguments, methodParamTypes.ToList()); try { method.Invoke(context, methodArgs); } catch (Exception ex) { throw new Exception("InvalidCommand", ex); } } private static object[] ConvertValuesToTypes(IList values, IList types) { var convertedValues = new object[types.Count]; for (var i = 0; i < types.Count; i++) { var propertyValueType = types[i]; var propertyValueString = values[i]; var argValue = TypeSerializer.DeserializeFromString(propertyValueString, propertyValueType); convertedValues[i] = argValue; } return convertedValues; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Controller/PathInfo.cs0000644000175000017500000000520212146506553027745 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Linq; namespace ServiceStack.Text.Controller { /// /// Class to hold /// public class PathInfo { public string ControllerName { get; private set; } public string ActionName { get; private set; } public List Arguments { get; private set; } public Dictionary Options { get; private set; } public PathInfo(string actionName, params string[] arguments) : this(actionName, arguments.ToList(), null) { } public PathInfo(string actionName, List arguments, Dictionary options) { ActionName = actionName; Arguments = arguments ?? new List(); Options = options ?? new Dictionary(); } public string FirstArgument { get { return this.Arguments.Count > 0 ? this.Arguments[0] : null; } } public T GetArgumentValue(int index) { return TypeSerializer.DeserializeFromString(this.Arguments[index]); } /// /// Parses the specified path info. /// e.g. /// MusicPage/arg1/0/true?debug&showFlows=3 => PathInfo /// .ActionName = 'MusicPage' /// .Arguments = ['arg1','0','true'] /// .Options = { debug:'True', showFlows:'3' } /// /// The path url. /// public static PathInfo Parse(string pathUri) { var actionParts = pathUri.Split(new[] { "://" }, StringSplitOptions.None); var controllerName = actionParts.Length == 2 ? actionParts[0] : null; var pathInfo = actionParts[actionParts.Length - 1]; var optionMap = new Dictionary(); var optionsPos = pathInfo.LastIndexOf('?'); if (optionsPos != -1) { var options = pathInfo.Substring(optionsPos + 1).Split('&'); foreach (var option in options) { var keyValuePair = option.Split('='); optionMap[keyValuePair[0]] = keyValuePair.Length == 1 ? true.ToString() : keyValuePair[1].UrlDecode(); } pathInfo = pathInfo.Substring(0, optionsPos); } var args = pathInfo.Split('/'); var pageName = args[0]; return new PathInfo(pageName, args.Skip(1).ToList(), optionMap) { ControllerName = controllerName }; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/ListExtensions.cs0000644000175000017500000000262612146506553027114 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Linq; using System.Text; using ServiceStack.Text.Common; namespace ServiceStack.Text { public static class ListExtensions { public static string Join(this IEnumerable values) { return Join(values, JsWriter.ItemSeperatorString); } public static string Join(this IEnumerable values, string seperator) { var sb = new StringBuilder(); foreach (var value in values) { if (sb.Length > 0) sb.Append(seperator); sb.Append(value); } return sb.ToString(); } public static bool IsNullOrEmpty(this List list) { return list == null || list.Count == 0; } //TODO: make it work public static IEnumerable SafeWhere(this List list, Func predicate) { return list.Where(predicate); } public static int NullableCount(this List list) { return list == null ? 0 : list.Count; } public static void AddIfNotExists(this List list, T item) { if (!list.Contains(item)) list.Add(item); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Tracer.cs0000644000175000017500000000261612146506553025340 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Text { public class Tracer { public static ITracer Instance = new NullTracer(); public class NullTracer : ITracer { public void WriteDebug(string error) { } public void WriteDebug(string format, params object[] args) { } public void WriteWarning(string warning) { } public void WriteWarning(string format, params object[] args) { } public void WriteError(Exception ex) { } public void WriteError(string error) { } public void WriteError(string format, params object[] args) { } } public class ConsoleTracer : ITracer { public void WriteDebug(string error) { Console.WriteLine(error); } public void WriteDebug(string format, params object[] args) { Console.WriteLine(format, args); } public void WriteWarning(string warning) { Console.WriteLine(warning); } public void WriteWarning(string format, params object[] args) { Console.WriteLine(format, args); } public void WriteError(Exception ex) { Console.WriteLine(ex); } public void WriteError(string error) { Console.WriteLine(error); } public void WriteError(string format, params object[] args) { Console.WriteLine(format, args); } } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/ReflectionExtensions.cs0000644000175000017500000003001612146506553030265 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.Serialization; using System.Threading; using ServiceStack.Text.Support; namespace ServiceStack.Text { public delegate object EmptyCtorDelegate(); public static class ReflectionExtensions { private static Dictionary DefaultValueTypes = new Dictionary(); public static object GetDefaultValue(Type type) { if (!type.IsValueType) return null; object defaultValue; if (DefaultValueTypes.TryGetValue(type, out defaultValue)) return defaultValue; defaultValue = Activator.CreateInstance(type); Dictionary snapshot, newCache; do { snapshot = DefaultValueTypes; newCache = new Dictionary(DefaultValueTypes); newCache[type] = defaultValue; } while (!ReferenceEquals( Interlocked.CompareExchange(ref DefaultValueTypes, newCache, snapshot), snapshot)); return defaultValue; } public static bool IsInstanceOf(this Type type, Type thisOrBaseType) { while (type != null) { if (type == thisOrBaseType) return true; type = type.BaseType; } return false; } public static bool IsGenericType(this Type type) { while (type != null) { if (type.IsGenericType) return true; type = type.BaseType; } return false; } public static Type GetGenericType(this Type type) { while (type != null) { if (type.IsGenericType) return type; type = type.BaseType; } return null; } public static bool IsOrHasGenericInterfaceTypeOf(this Type type, Type genericTypeDefinition) { return type.GetTypeWithGenericTypeDefinitionOf(genericTypeDefinition) != null; } public static Type GetTypeWithGenericTypeDefinitionOf(this Type type, Type genericTypeDefinition) { foreach (var t in type.GetInterfaces()) { if (t.IsGenericType && t.GetGenericTypeDefinition() == genericTypeDefinition) { return t; } } var genericType = type.GetGenericType(); if (genericType != null && genericType.GetGenericTypeDefinition() == genericTypeDefinition) { return genericType; } return null; } public static Type GetTypeWithInterfaceOf(this Type type, Type interfaceType) { if (type == interfaceType) return interfaceType; foreach (var t in type.GetInterfaces()) { if (t == interfaceType) return t; } return null; } public static bool HasInterface(this Type type, Type interfaceType) { foreach (var t in type.GetInterfaces()) { if (t == interfaceType) return true; } return false; } public static bool AllHaveInterfacesOfType( this Type assignableFromType, params Type[] types) { foreach (var type in types) { if (assignableFromType.GetTypeWithInterfaceOf(type) == null) return false; } return true; } public static bool IsNumericType(this Type type) { if (!type.IsValueType) return false; return type.IsIntegerType() || type.IsRealNumberType(); } public static bool IsIntegerType(this Type type) { if (!type.IsValueType) return false; var underlyingType = Nullable.GetUnderlyingType(type) ?? type; return underlyingType == typeof(byte) || underlyingType == typeof(sbyte) || underlyingType == typeof(short) || underlyingType == typeof(ushort) || underlyingType == typeof(int) || underlyingType == typeof(uint) || underlyingType == typeof(long) || underlyingType == typeof(ulong); } public static bool IsRealNumberType(this Type type) { if (!type.IsValueType) return false; var underlyingType = Nullable.GetUnderlyingType(type) ?? type; return underlyingType == typeof(float) || underlyingType == typeof(double) || underlyingType == typeof(decimal); } public static Type GetTypeWithGenericInterfaceOf(this Type type, Type genericInterfaceType) { foreach (var t in type.GetInterfaces()) { if (t.IsGenericType && t.GetGenericTypeDefinition() == genericInterfaceType) return t; } if (!type.IsGenericType) return null; var genericType = type.GetGenericType(); return genericType.GetGenericTypeDefinition() == genericInterfaceType ? genericType : null; } public static bool HasAnyTypeDefinitionsOf(this Type genericType, params Type[] theseGenericTypes) { if (!genericType.IsGenericType) return false; var genericTypeDefinition = genericType.GetGenericTypeDefinition(); foreach (var thisGenericType in theseGenericTypes) { if (genericTypeDefinition == thisGenericType) return true; } return false; } public static Type[] GetGenericArgumentsIfBothHaveSameGenericDefinitionTypeAndArguments( this Type assignableFromType, Type typeA, Type typeB) { var typeAInterface = typeA.GetTypeWithGenericInterfaceOf(assignableFromType); if (typeAInterface == null) return null; var typeBInterface = typeB.GetTypeWithGenericInterfaceOf(assignableFromType); if (typeBInterface == null) return null; var typeAGenericArgs = typeAInterface.GetGenericArguments(); var typeBGenericArgs = typeBInterface.GetGenericArguments(); if (typeAGenericArgs.Length != typeBGenericArgs.Length) return null; for (var i = 0; i < typeBGenericArgs.Length; i++) { if (typeAGenericArgs[i] != typeBGenericArgs[i]) { return null; } } return typeAGenericArgs; } public static TypePair GetGenericArgumentsIfBothHaveConvertibleGenericDefinitionTypeAndArguments( this Type assignableFromType, Type typeA, Type typeB) { var typeAInterface = typeA.GetTypeWithGenericInterfaceOf(assignableFromType); if (typeAInterface == null) return null; var typeBInterface = typeB.GetTypeWithGenericInterfaceOf(assignableFromType); if (typeBInterface == null) return null; var typeAGenericArgs = typeAInterface.GetGenericArguments(); var typeBGenericArgs = typeBInterface.GetGenericArguments(); if (typeAGenericArgs.Length != typeBGenericArgs.Length) return null; for (var i = 0; i < typeBGenericArgs.Length; i++) { if (!AreAllStringOrValueTypes(typeAGenericArgs[i], typeBGenericArgs[i])) { return null; } } return new TypePair(typeAGenericArgs, typeBGenericArgs); } public static bool AreAllStringOrValueTypes(params Type[] types) { foreach (var type in types) { if (!(type == typeof(string) || type.IsValueType)) return false; } return true; } static Dictionary ConstructorMethods = new Dictionary(); public static EmptyCtorDelegate GetConstructorMethod(Type type) { EmptyCtorDelegate emptyCtorFn; if (ConstructorMethods.TryGetValue(type, out emptyCtorFn)) return emptyCtorFn; emptyCtorFn = GetConstructorMethodToCache(type); Dictionary snapshot, newCache; do { snapshot = ConstructorMethods; newCache = new Dictionary(ConstructorMethods); newCache[type] = emptyCtorFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref ConstructorMethods, newCache, snapshot), snapshot)); return emptyCtorFn; } static Dictionary TypeNamesMap = new Dictionary(); public static EmptyCtorDelegate GetConstructorMethod(string typeName) { EmptyCtorDelegate emptyCtorFn; if (TypeNamesMap.TryGetValue(typeName, out emptyCtorFn)) return emptyCtorFn; var type = AssemblyUtils.FindType(typeName); if (type == null) return null; emptyCtorFn = GetConstructorMethodToCache(type); Dictionary snapshot, newCache; do { snapshot = TypeNamesMap; newCache = new Dictionary(TypeNamesMap); newCache[typeName] = emptyCtorFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref TypeNamesMap, newCache, snapshot), snapshot)); return emptyCtorFn; } public static EmptyCtorDelegate GetConstructorMethodToCache(Type type) { var emptyCtor = type.GetConstructor(Type.EmptyTypes); if (emptyCtor != null) { #if MONOTOUCH || SILVERLIGHT || XBOX return () => Activator.CreateInstance(type); #else var dm = new System.Reflection.Emit.DynamicMethod("MyCtor", type, Type.EmptyTypes, typeof(ReflectionExtensions).Module, true); var ilgen = dm.GetILGenerator(); ilgen.Emit(System.Reflection.Emit.OpCodes.Nop); ilgen.Emit(System.Reflection.Emit.OpCodes.Newobj, emptyCtor); ilgen.Emit(System.Reflection.Emit.OpCodes.Ret); return (EmptyCtorDelegate)dm.CreateDelegate(typeof(EmptyCtorDelegate)); #endif } #if SILVERLIGHT || XBOX return () => Activator.CreateInstance(type); #else //Anonymous types don't have empty constructors return () => FormatterServices.GetUninitializedObject(type); #endif } private static class TypeMeta { public static readonly EmptyCtorDelegate EmptyCtorFn; static TypeMeta() { EmptyCtorFn = GetConstructorMethodToCache(typeof(T)); } } public static object CreateInstance() { return TypeMeta.EmptyCtorFn(); } public static object CreateInstance(this Type type) { var ctorFn = GetConstructorMethod(type); return ctorFn(); } public static object CreateInstance(string typeName) { var ctorFn = GetConstructorMethod(typeName); return ctorFn(); } public static PropertyInfo[] GetPublicProperties(this Type type) { if (type.IsInterface) { var propertyInfos = new List(); var considered = new List(); var queue = new Queue(); considered.Add(type); queue.Enqueue(type); while (queue.Count > 0) { var subType = queue.Dequeue(); foreach (var subInterface in subType.GetInterfaces()) { if (considered.Contains(subInterface)) continue; considered.Add(subInterface); queue.Enqueue(subInterface); } var typeProperties = subType.GetProperties( BindingFlags.FlattenHierarchy | BindingFlags.Public | BindingFlags.Instance); var newPropertyInfos = typeProperties .Where(x => !propertyInfos.Contains(x)); propertyInfos.InsertRange(0, newPropertyInfos); } return propertyInfos.ToArray(); } return type.GetProperties(BindingFlags.FlattenHierarchy | BindingFlags.Public | BindingFlags.Instance); } const string DataContract = "DataContractAttribute"; const string DataMember = "DataMemberAttribute"; const string IgnoreDataMember = "IgnoreDataMemberAttribute"; public static PropertyInfo[] GetSerializableProperties(this Type type) { var publicProperties = GetPublicProperties(type); var publicReadableProperties = publicProperties.Where(x => x.GetGetMethod(false) != null); //If it is a 'DataContract' only return 'DataMember' properties. //checking for "DataContract" using strings to avoid dependency on System.Runtime.Serialization if (type.IsDto()) { return publicReadableProperties.Where(attr => attr.GetCustomAttributes(false).Any(x => x.GetType().Name == DataMember)) .ToArray(); } // else return those properties that are not decorated with IgnoreDataMember return publicReadableProperties.Where(prop => !prop.GetCustomAttributes(false).Any(attr => attr.GetType().Name == IgnoreDataMember)).ToArray(); } public static bool IsDto(this Type type) { return type.GetCustomAttributes(true).Any(x => x.GetType().Name == DataContract); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Properties/0000755000175000017500000000000012146506553025720 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Properties/AssemblyInfo.cs0000644000175000017500000000267512146506553030654 0ustar00meebeymeebey00000000000000using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ServiceStack.Text")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("ServiceStack.Text")] [assembly: AssemblyCopyright("Copyright © ServiceStack 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("a352d4d3-df2a-4c78-b646-67181a6333a6")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.5.7.*")] //[assembly: AssemblyFileVersion("1.0.0.0")] smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Json/0000755000175000017500000000000012146506553024475 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Json/JsonReader.Generic.cs0000644000175000017500000000510112146506553030430 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Reflection; using System.Threading; using ServiceStack.Text.Common; namespace ServiceStack.Text.Json { internal static class JsonReader { public static readonly JsReader Instance = new JsReader(); private static Dictionary ParseFnCache = new Dictionary(); public static ParseStringDelegate GetParseFn(Type type) { ParseFactoryDelegate parseFactoryFn; ParseFnCache.TryGetValue(type, out parseFactoryFn); if (parseFactoryFn != null) return parseFactoryFn(); var genericType = typeof(JsonReader<>).MakeGenericType(type); var mi = genericType.GetMethod("GetParseFn", BindingFlags.Public | BindingFlags.Static); parseFactoryFn = (ParseFactoryDelegate)Delegate.CreateDelegate(typeof(ParseFactoryDelegate), mi); Dictionary snapshot, newCache; do { snapshot = ParseFnCache; newCache = new Dictionary(ParseFnCache); newCache[type] = parseFactoryFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref ParseFnCache, newCache, snapshot), snapshot)); return parseFactoryFn(); } } public static class JsonReader { private static readonly ParseStringDelegate ReadFn; static JsonReader() { ReadFn = JsonReader.Instance.GetParseFn(); } public static ParseStringDelegate GetParseFn() { return ReadFn ?? Parse; } public static object Parse(string value) { if (ReadFn == null) { if (typeof(T).IsAbstract || typeof(T).IsInterface) { if (string.IsNullOrEmpty(value)) return null; var concreteType = DeserializeType.ExtractType(value); if (concreteType != null) { return JsonReader.GetParseFn(concreteType)(value); } throw new NotSupportedException("Can not deserialize interface type: " + typeof(T).Name); } } return value == null ? null : ReadFn(value); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Json/JsonUtils.cs0000644000175000017500000000556112146506553026765 0ustar00meebeymeebey00000000000000using System; using System.IO; namespace ServiceStack.Text.Json { public static class JsonUtils { public const char EscapeChar = '\\'; public const char QuoteChar = '"'; public const string Null = "null"; public const string True = "true"; public const string False = "false"; static readonly char[] EscapeChars = new[] { QuoteChar, '\n', '\r', '\t', '"', '\\', '\f', '\b', }; private const int LengthFromLargestChar = '\\' + 1; private static readonly bool[] EscapeCharFlags = new bool[LengthFromLargestChar]; static JsonUtils() { foreach (var escapeChar in EscapeChars) { EscapeCharFlags[escapeChar] = true; } } public static void WriteString(TextWriter writer, string value) { if (value == null) { writer.Write(JsonUtils.Null); return; } if (!HasAnyEscapeChars(value)) { writer.Write(QuoteChar); writer.Write(value); writer.Write(QuoteChar); return; } var hexSeqBuffer = new char[4]; writer.Write(QuoteChar); var len = value.Length; for (var i = 0; i < len; i++) { switch (value[i]) { case '\n': writer.Write("\\n"); continue; case '\r': writer.Write("\\r"); continue; case '\t': writer.Write("\\t"); continue; case '"': case '\\': writer.Write('\\'); writer.Write(value[i]); continue; case '\f': writer.Write("\\f"); continue; case '\b': writer.Write("\\b"); continue; } //Is printable char? if (value[i] >= 32 && value[i] <= 126) { writer.Write(value[i]); continue; } var isValidSequence = value[i] < 0xD800 || value[i] > 0xDFFF; if (isValidSequence) { // Default, turn into a \uXXXX sequence IntToHex(value[i], hexSeqBuffer); writer.Write("\\u"); writer.Write(hexSeqBuffer); } } writer.Write(QuoteChar); } /// /// micro optimizations: using flags instead of value.IndexOfAny(EscapeChars) /// /// /// private static bool HasAnyEscapeChars(string value) { var len = value.Length; for (var i = 0; i < len; i++) { var c = value[i]; if (c >= LengthFromLargestChar || !EscapeCharFlags[c]) continue; return true; } return false; } public static void IntToHex(int intValue, char[] hex) { for (var i = 0; i < 4; i++) { var num = intValue % 16; if (num < 10) hex[3 - i] = (char)('0' + num); else hex[3 - i] = (char)('A' + (num - 10)); intValue >>= 4; } } public static bool IsJsObject(string value) { return !string.IsNullOrEmpty(value) && value[0] == '{' && value[value.Length - 1] == '}'; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Json/JsonWriter.Generic.cs0000644000175000017500000001016312146506553030506 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Threading; using ServiceStack.Text.Common; namespace ServiceStack.Text.Json { internal static class JsonWriter { public static readonly JsWriter Instance = new JsWriter(); private static Dictionary WriteFnCache = new Dictionary(); public static WriteObjectDelegate GetWriteFn(Type type) { try { WriteObjectDelegate writeFn; if (WriteFnCache.TryGetValue(type, out writeFn)) return writeFn; var genericType = typeof(JsonWriter<>).MakeGenericType(type); var mi = genericType.GetMethod("WriteFn", BindingFlags.Public | BindingFlags.Static); var writeFactoryFn = (Func)Delegate.CreateDelegate(typeof(Func), mi); writeFn = writeFactoryFn(); Dictionary snapshot, newCache; do { snapshot = WriteFnCache; newCache = new Dictionary(WriteFnCache); newCache[type] = writeFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref WriteFnCache, newCache, snapshot), snapshot)); return writeFn; } catch (Exception ex) { Tracer.Instance.WriteError(ex); throw; } } private static Dictionary JsonTypeInfoCache = new Dictionary(); public static TypeInfo GetTypeInfo(Type type) { try { TypeInfo writeFn; if (JsonTypeInfoCache.TryGetValue(type, out writeFn)) return writeFn; var genericType = typeof(JsonWriter<>).MakeGenericType(type); var mi = genericType.GetMethod("GetTypeInfo", BindingFlags.Public | BindingFlags.Static); var writeFactoryFn = (Func)Delegate.CreateDelegate(typeof(Func), mi); writeFn = writeFactoryFn(); Dictionary snapshot, newCache; do { snapshot = JsonTypeInfoCache; newCache = new Dictionary(JsonTypeInfoCache); newCache[type] = writeFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref JsonTypeInfoCache, newCache, snapshot), snapshot)); return writeFn; } catch (Exception ex) { Tracer.Instance.WriteError(ex); throw; } } public static void WriteLateBoundObject(TextWriter writer, object value) { if (value == null) { if (JsConfig.IncludeNullValues) { writer.Write(JsonUtils.Null); } return; } var writeFn = GetWriteFn(value.GetType()); var prevState = JsState.IsWritingDynamic; JsState.IsWritingDynamic = true; writeFn(writer, value); JsState.IsWritingDynamic = prevState; } public static WriteObjectDelegate GetValueTypeToStringMethod(Type type) { return Instance.GetValueTypeToStringMethod(type); } } internal class TypeInfo { internal bool EncodeMapKey; } /// /// Implement the serializer using a more static approach /// /// internal static class JsonWriter { internal static TypeInfo TypeInfo; private static readonly WriteObjectDelegate CacheFn; public static WriteObjectDelegate WriteFn() { return CacheFn ?? WriteObject; } public static TypeInfo GetTypeInfo() { return TypeInfo; } static JsonWriter() { TypeInfo = new TypeInfo { EncodeMapKey = typeof(T) == typeof(bool) || typeof(T).IsNumericType() }; CacheFn = typeof(T) == typeof(object) ? JsonWriter.WriteLateBoundObject : JsonWriter.Instance.GetWriteFn(); } public static void WriteObject(TextWriter writer, object value) { CacheFn(writer, value); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Json/JsonTypeSerializer.cs0000644000175000017500000003363012146506553030636 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Globalization; using System.IO; using System.Text; using ServiceStack.Text.Common; namespace ServiceStack.Text.Json { internal class JsonTypeSerializer : ITypeSerializer { public static ITypeSerializer Instance = new JsonTypeSerializer(); public string TypeAttrInObject { get { return "{\"__type\":"; } } public static readonly bool[] WhiteSpaceFlags = new bool[(int)' ' + 1]; static JsonTypeSerializer() { WhiteSpaceFlags[(int)' '] = true; WhiteSpaceFlags[(int)'\t'] = true; WhiteSpaceFlags[(int)'\r'] = true; WhiteSpaceFlags[(int)'\n'] = true; } public WriteObjectDelegate GetWriteFn() { return JsonWriter.WriteFn(); } public WriteObjectDelegate GetWriteFn(Type type) { return JsonWriter.GetWriteFn(type); } public TypeInfo GetTypeInfo(Type type) { return JsonWriter.GetTypeInfo(type); } /// /// Shortcut escape when we're sure value doesn't contain any escaped chars /// /// /// public void WriteRawString(TextWriter writer, string value) { writer.Write(JsWriter.QuoteChar); writer.Write(value); writer.Write(JsWriter.QuoteChar); } public void WritePropertyName(TextWriter writer, string value) { if (JsState.WritingKeyCount > 0) { writer.Write(JsWriter.EscapedQuoteString); writer.Write(value); writer.Write(JsWriter.EscapedQuoteString); } else { WriteRawString(writer, value); } } public void WriteString(TextWriter writer, string value) { JsonUtils.WriteString(writer, value); } public void WriteBuiltIn(TextWriter writer, object value) { if (JsState.WritingKeyCount > 0 && !JsState.IsWritingValue) writer.Write(JsonUtils.QuoteChar); WriteRawString(writer, value.ToString()); if (JsState.WritingKeyCount > 0 && !JsState.IsWritingValue) writer.Write(JsonUtils.QuoteChar); } public void WriteObjectString(TextWriter writer, object value) { JsonUtils.WriteString(writer, value != null ? value.ToString() : null); } public void WriteException(TextWriter writer, object value) { WriteString(writer, ((Exception)value).Message); } public void WriteDateTime(TextWriter writer, object oDateTime) { WriteRawString(writer, DateTimeSerializer.ToWcfJsonDate((DateTime)oDateTime)); } public void WriteNullableDateTime(TextWriter writer, object dateTime) { if (dateTime == null) writer.Write( JsonUtils.Null ); else WriteDateTime(writer, dateTime); } public void WriteGuid(TextWriter writer, object oValue) { WriteRawString(writer, ((Guid)oValue).ToString("N")); } public void WriteNullableGuid(TextWriter writer, object oValue) { if (oValue == null) return; WriteRawString(writer, ((Guid)oValue).ToString("N")); } public void WriteBytes(TextWriter writer, object oByteValue) { if (oByteValue == null) return; WriteRawString(writer, Convert.ToBase64String((byte[])oByteValue)); } public void WriteChar(TextWriter writer, object charValue) { if (charValue == null) writer.Write(JsonUtils.Null); else WriteRawString(writer, ((char)charValue).ToString(CultureInfo.InvariantCulture)); } public void WriteByte(TextWriter writer, object byteValue) { if (byteValue == null) writer.Write(JsonUtils.Null); else writer.Write((byte)byteValue); } public void WriteInt16(TextWriter writer, object intValue) { if (intValue == null) writer.Write(JsonUtils.Null); else writer.Write((short)intValue); } public void WriteUInt16(TextWriter writer, object intValue) { if (intValue == null) writer.Write(JsonUtils.Null); else writer.Write((ushort)intValue); } public void WriteInt32(TextWriter writer, object intValue) { if (intValue == null) writer.Write(JsonUtils.Null); else writer.Write((int)intValue); } public void WriteUInt32(TextWriter writer, object uintValue) { if (uintValue == null) writer.Write(JsonUtils.Null); else writer.Write((uint)uintValue); } public void WriteInt64(TextWriter writer, object integerValue) { if (integerValue == null) writer.Write(JsonUtils.Null); else writer.Write((long)integerValue); } public void WriteUInt64(TextWriter writer, object ulongValue) { if (ulongValue == null) { writer.Write(JsonUtils.Null); } else writer.Write((ulong)ulongValue); } public void WriteBool(TextWriter writer, object boolValue) { if (boolValue == null) writer.Write(JsonUtils.Null); else writer.Write(((bool)boolValue) ? JsonUtils.True : JsonUtils.False); } public void WriteFloat(TextWriter writer, object floatValue) { if (floatValue == null) writer.Write(JsonUtils.Null); else { var floatVal = (float)floatValue; if (Equals(floatVal, float.MaxValue) || Equals(floatVal, float.MinValue)) writer.Write(floatVal.ToString("r", CultureInfo.InvariantCulture)); else writer.Write(floatVal.ToString(CultureInfo.InvariantCulture)); } } public void WriteDouble(TextWriter writer, object doubleValue) { if (doubleValue == null) writer.Write(JsonUtils.Null); else { var doubleVal = (double)doubleValue; if (Equals(doubleVal, double.MaxValue) || Equals(doubleVal, double.MinValue)) writer.Write(doubleVal.ToString("r", CultureInfo.InvariantCulture)); else writer.Write(doubleVal.ToString(CultureInfo.InvariantCulture)); } } public void WriteDecimal(TextWriter writer, object decimalValue) { if (decimalValue == null) writer.Write(JsonUtils.Null); else writer.Write(((decimal)decimalValue).ToString(CultureInfo.InvariantCulture)); } public void WriteEnum(TextWriter writer, object enumValue) { if (enumValue == null) return; WriteRawString(writer, enumValue.ToString()); } public void WriteEnumFlags(TextWriter writer, object enumFlagValue) { if (enumFlagValue == null) return; var intVal = (int)enumFlagValue; writer.Write(intVal); } public void WriteLinqBinary(TextWriter writer, object linqBinaryValue) { #if !MONOTOUCH && !SILVERLIGHT && !XBOX WriteRawString(writer, Convert.ToBase64String(((System.Data.Linq.Binary)linqBinaryValue).ToArray())); #endif } public ParseStringDelegate GetParseFn() { return JsonReader.Instance.GetParseFn(); } public ParseStringDelegate GetParseFn(Type type) { return JsonReader.GetParseFn(type); } public string ParseRawString(string value) { if (String.IsNullOrEmpty(value)) return value; return value[0] == JsonUtils.QuoteChar ? value.Substring(1, value.Length - 2) : value; } public string ParseString(string value) { return string.IsNullOrEmpty(value) ? value : ParseRawString(value); } static readonly char[] IsSafeJsonChars = new[] { JsonUtils.QuoteChar, JsonUtils.EscapeChar }; internal static string ParseJsonString(string json, ref int index) { var jsonLength = json.Length; for (; index < json.Length; index++) { var ch = json[index]; if (ch >= WhiteSpaceFlags.Length || !WhiteSpaceFlags[ch]) break; } //Whitespace inline if (json[index] == JsonUtils.QuoteChar) { index++; //MicroOp: See if we can short-circuit evaluation (to avoid StringBuilder) var strEndPos = json.IndexOfAny(IsSafeJsonChars, index); if (strEndPos == -1) return json.Substring(index, jsonLength - index); if (json[strEndPos] == JsonUtils.QuoteChar) { var potentialValue = json.Substring(index, strEndPos - index); index = strEndPos + 1; return potentialValue; } } var sb = new StringBuilder(jsonLength); char c; while (true) { if (index == jsonLength) break; c = json[index++]; if (c == JsonUtils.QuoteChar) break; if (c == '\\') { if (index == jsonLength) { break; } c = json[index++]; switch (c) { case '"': sb.Append('"'); break; case '\\': sb.Append('\\'); break; case '/': sb.Append('/'); break; case 'b': sb.Append('\b'); break; case 'f': sb.Append('\f'); break; case 'n': sb.Append('\n'); break; case 'r': sb.Append('\r'); break; case 't': sb.Append('\t'); break; case 'u': var remainingLength = jsonLength - index; if (remainingLength >= 4) { var unicodeString = json.Substring(index, 4); var unicodeIntVal = UInt32.Parse(unicodeString, NumberStyles.HexNumber); sb.Append(ConvertFromUtf32((int)unicodeIntVal)); index += 4; } else { break; } break; } } else { sb.Append(c); } } var strValue = sb.ToString(); return strValue == JsonUtils.Null ? null : strValue; } /// /// Since Silverlight doesn't have char.ConvertFromUtf32() so putting Mono's implemenation inline. /// /// /// private static string ConvertFromUtf32(int utf32) { if (utf32 < 0 || utf32 > 0x10FFFF) throw new ArgumentOutOfRangeException("utf32", "The argument must be from 0 to 0x10FFFF."); if (0xD800 <= utf32 && utf32 <= 0xDFFF) throw new ArgumentOutOfRangeException("utf32", "The argument must not be in surrogate pair range."); if (utf32 < 0x10000) return new string((char)utf32, 1); utf32 -= 0x10000; return new string(new[] {(char) ((utf32 >> 10) + 0xD800), (char) (utf32 % 0x0400 + 0xDC00)}); } private static void EatWhitespace(string json, ref int index) { int c; for (; index < json.Length; index++) { c = json[index]; if (c >= WhiteSpaceFlags.Length || !WhiteSpaceFlags[c]) { break; } } } public string EatTypeValue(string value, ref int i) { return EatValue(value, ref i); } public bool EatMapStartChar(string value, ref int i) { for (; i < value.Length; i++) { var c = value[i]; if (c >= WhiteSpaceFlags.Length || !WhiteSpaceFlags[c]) break; } //Whitespace inline return value[i++] == JsWriter.MapStartChar; } public string EatMapKey(string value, ref int i) { return ParseJsonString(value, ref i); } public bool EatMapKeySeperator(string value, ref int i) { for (; i < value.Length; i++) { var c = value[i]; if (c >= WhiteSpaceFlags.Length || !WhiteSpaceFlags[c]) break; } //Whitespace inline if (value.Length == i) return false; return value[i++] == JsWriter.MapKeySeperator; } public bool EatItemSeperatorOrMapEndChar(string value, ref int i) { for (; i < value.Length; i++) { var c = value[i]; if (c >= WhiteSpaceFlags.Length || !WhiteSpaceFlags[c]) break; } //Whitespace inline if (i == value.Length) return false; var success = value[i] == JsWriter.ItemSeperator || value[i] == JsWriter.MapEndChar; i++; if (success) { for (; i < value.Length; i++) { var c = value[i]; if (c >= WhiteSpaceFlags.Length || !WhiteSpaceFlags[c]) break; } //Whitespace inline } return success; } public string EatValue(string value, ref int i) { var valueLength = value.Length; if (i == valueLength) return null; for (; i < value.Length; i++) { var c = value[i]; if (c >= WhiteSpaceFlags.Length || !WhiteSpaceFlags[c]) break; } //Whitespace inline var tokenStartPos = i; var valueChar = value[i]; var withinQuotes = false; var endsToEat = 1; switch (valueChar) { //If we are at the end, return. case JsWriter.ItemSeperator: case JsWriter.MapEndChar: return null; //Is Within Quotes, i.e. "..." case JsWriter.QuoteChar: return ParseJsonString(value, ref i); //Is Type/Map, i.e. {...} case JsWriter.MapStartChar: while (++i < valueLength && endsToEat > 0) { valueChar = value[i]; if (valueChar == JsWriter.QuoteChar && value[i - 1] != JsonUtils.EscapeChar) withinQuotes = !withinQuotes; if (withinQuotes) continue; if (valueChar == JsWriter.MapStartChar) endsToEat++; if (valueChar == JsWriter.MapEndChar) endsToEat--; } return value.Substring(tokenStartPos, i - tokenStartPos); //Is List, i.e. [...] case JsWriter.ListStartChar: while (++i < valueLength && endsToEat > 0) { valueChar = value[i]; if (valueChar == JsWriter.QuoteChar && value[i - 1] != JsonUtils.EscapeChar) withinQuotes = !withinQuotes; if (withinQuotes) continue; if (valueChar == JsWriter.ListStartChar) endsToEat++; if (valueChar == JsWriter.ListEndChar) endsToEat--; } return value.Substring(tokenStartPos, i - tokenStartPos); } //Is Value while (++i < valueLength) { valueChar = value[i]; if (valueChar == JsWriter.ItemSeperator || valueChar == JsWriter.MapEndChar //If it doesn't have quotes it's either a keyword or number so also has a ws boundary || (valueChar < WhiteSpaceFlags.Length && WhiteSpaceFlags[valueChar]) ) { break; } } var strValue = value.Substring(tokenStartPos, i - tokenStartPos); return strValue == JsonUtils.Null ? null : strValue; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/CsvConfig.cs0000644000175000017500000000244012146506553025774 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; namespace ServiceStack.Text { public static class CsvConfig { public static bool OmitHeaders { get; set; } private static Dictionary customHeadersMap; public static Dictionary CustomHeadersMap { get { return customHeadersMap; } set { customHeadersMap = value; if (value == null) return; CsvWriter.ConfigureCustomHeaders(customHeadersMap); } } public static object CustomHeaders { set { if (value == null) return; if (value.GetType().IsValueType) throw new ArgumentException("CustomHeaders is a ValueType"); var propertyInfos = value.GetType().GetProperties(); if (propertyInfos.Length == 0) return; customHeadersMap = new Dictionary(); foreach (var pi in propertyInfos) { var getMethod = pi.GetGetMethod(); if (getMethod == null) continue; var oValue = getMethod.Invoke(value, new object[0]); if (oValue == null) continue; customHeadersMap[pi.Name] = oValue.ToString(); } CsvWriter.ConfigureCustomHeaders(customHeadersMap); } } public static void Reset() { OmitHeaders = false; CsvWriter.Reset(); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Reflection/0000755000175000017500000000000012146506553025656 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Reflection/StaticAccessors.cs0000644000175000017500000000450012146506553031301 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Reflection; #if !XBOX using System.Linq.Expressions ; #endif namespace ServiceStack.Text.Reflection { public static class StaticAccessors { public static Func GetValueGetter(this PropertyInfo propertyInfo, Type type) { #if SILVERLIGHT || MONOTOUCH || XBOX var getMethodInfo = propertyInfo.GetGetMethod(); if (getMethodInfo == null) return null; return x => getMethodInfo.Invoke(x, new object[0]); #else var instance = Expression.Parameter(typeof(object), "i"); var convertInstance = Expression.TypeAs(instance, propertyInfo.DeclaringType); var property = Expression.Property(convertInstance, propertyInfo); var convertProperty = Expression.TypeAs(property, typeof(object)); return Expression.Lambda>(convertProperty, instance).Compile(); #endif } public static Func GetValueGetter(this PropertyInfo propertyInfo) { #if SILVERLIGHT || MONOTOUCH || XBOX var getMethodInfo = propertyInfo.GetGetMethod(); if (getMethodInfo == null) return null; return x => getMethodInfo.Invoke(x, new object[0]); #else var instance = Expression.Parameter(propertyInfo.DeclaringType, "i"); var property = Expression.Property(instance, propertyInfo); var convert = Expression.TypeAs(property, typeof(object)); return Expression.Lambda>(convert, instance).Compile(); #endif } #if !XBOX public static Action GetValueSetter(this PropertyInfo propertyInfo) { if (typeof(T) != propertyInfo.DeclaringType) { throw new ArgumentException(); } var instance = Expression.Parameter(propertyInfo.DeclaringType, "i"); var argument = Expression.Parameter(typeof(object), "a"); var setterCall = Expression.Call( instance, propertyInfo.GetSetMethod(), Expression.Convert(argument, propertyInfo.PropertyType)); return Expression.Lambda> ( setterCall, instance, argument ).Compile(); } #endif } } smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Marc/0000755000175000017500000000000012146506553024446 5ustar00meebeymeebey00000000000000smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Marc/Link.cs0000644000175000017500000000340212146506553025671 0ustar00meebeymeebey00000000000000using System.Threading; //Not using it here, but @marcgravell's stuff is too good not to include namespace ServiceStack.Text.Marc { /// /// Pretty Thread-Safe cache class from: /// http://code.google.com/p/dapper-dot-net/source/browse/Dapper/SqlMapper.cs /// /// This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example), /// and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE** /// equality. The type is fully thread-safe. /// class Link where TKey : class { public static bool TryGet(Link link, TKey key, out TValue value) { while (link != null) { if ((object)key == (object)link.Key) { value = link.Value; return true; } link = link.Tail; } value = default(TValue); return false; } public static bool TryAdd(ref Link head, TKey key, ref TValue value) { bool tryAgain; do { var snapshot = Interlocked.CompareExchange(ref head, null, null); TValue found; if (TryGet(snapshot, key, out found)) { // existing match; report the existing value instead value = found; return false; } var newNode = new Link(key, value, snapshot); // did somebody move our cheese? tryAgain = Interlocked.CompareExchange(ref head, newNode, snapshot) != snapshot; } while (tryAgain); return true; } private Link(TKey key, TValue value, Link tail) { Key = key; Value = value; Tail = tail; } public TKey Key { get; private set; } public TValue Value { get; private set; } public Link Tail { get; private set; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Marc/TypeAccessor.cs0000644000175000017500000003304112146506553027402 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Reflection; using System.Reflection.Emit; using System.Threading; //using System.Dynamic; //Not using it here, but @marcgravell's stuff is too good not to include // http://code.google.com/p/fast-member/ Apache License 2.0 #if !SILVERLIGHT && !MONOTOUCH && !XBOX namespace FastMember { /// /// Provides by-name member-access to objects of a given type /// public abstract class TypeAccessor { // hash-table has better read-without-locking semantics than dictionary private static readonly Hashtable typeLookyp = new Hashtable(); /// /// Does this type support new instances via a parameterless constructor? /// public virtual bool CreateNewSupported { get { return false; } } /// /// Create a new instance of this type /// public virtual object CreateNew() { throw new NotSupportedException();} /// /// Provides a type-specific accessor, allowing by-name access for all objects of that type /// /// The accessor is cached internally; a pre-existing accessor may be returned public static TypeAccessor Create(Type type) { if(type == null) throw new ArgumentNullException("type"); TypeAccessor obj = (TypeAccessor)typeLookyp[type]; if (obj != null) return obj; lock(typeLookyp) { // double-check obj = (TypeAccessor)typeLookyp[type]; if (obj != null) return obj; obj = CreateNew(type); typeLookyp[type] = obj; return obj; } } //sealed class DynamicAccessor : TypeAccessor //{ // public static readonly DynamicAccessor Singleton = new DynamicAccessor(); // private DynamicAccessor(){} // public override object this[object target, string name] // { // get { return CallSiteCache.GetValue(name, target); } // set { CallSiteCache.SetValue(name, target, value); } // } //} private static AssemblyBuilder assembly; private static ModuleBuilder module; private static int counter; private static void WriteGetter(ILGenerator il, Type type, PropertyInfo[] props, FieldInfo[] fields, bool isStatic) { LocalBuilder loc = type.IsValueType ? il.DeclareLocal(type) : null; OpCode propName = isStatic ? OpCodes.Ldarg_1 : OpCodes.Ldarg_2, target = isStatic ? OpCodes.Ldarg_0 : OpCodes.Ldarg_1; foreach (PropertyInfo prop in props) { if (prop.GetIndexParameters().Length != 0 || !prop.CanRead) continue; Label next = il.DefineLabel(); il.Emit(propName); il.Emit(OpCodes.Ldstr, prop.Name); il.EmitCall(OpCodes.Call, strinqEquals, null); il.Emit(OpCodes.Brfalse_S, next); // match: il.Emit(target); Cast(il, type, loc); il.EmitCall(type.IsValueType ? OpCodes.Call : OpCodes.Callvirt, prop.GetGetMethod(), null); if (prop.PropertyType.IsValueType) { il.Emit(OpCodes.Box, prop.PropertyType); } il.Emit(OpCodes.Ret); // not match: il.MarkLabel(next); } foreach (FieldInfo field in fields) { Label next = il.DefineLabel(); il.Emit(propName); il.Emit(OpCodes.Ldstr, field.Name); il.EmitCall(OpCodes.Call, strinqEquals, null); il.Emit(OpCodes.Brfalse_S, next); // match: il.Emit(target); Cast(il, type, loc); il.Emit(OpCodes.Ldfld, field); if (field.FieldType.IsValueType) { il.Emit(OpCodes.Box, field.FieldType); } il.Emit(OpCodes.Ret); // not match: il.MarkLabel(next); } il.Emit(OpCodes.Ldstr, "name"); il.Emit(OpCodes.Newobj, typeof(ArgumentOutOfRangeException).GetConstructor(new Type[] { typeof(string) })); il.Emit(OpCodes.Throw); } private static void WriteSetter(ILGenerator il, Type type, PropertyInfo[] props, FieldInfo[] fields, bool isStatic) { if (type.IsValueType) { il.Emit(OpCodes.Ldstr, "Write is not supported for structs"); il.Emit(OpCodes.Newobj, typeof(NotSupportedException).GetConstructor(new Type[] { typeof(string) })); il.Emit(OpCodes.Throw); } else { OpCode propName = isStatic ? OpCodes.Ldarg_1 : OpCodes.Ldarg_2, target = isStatic ? OpCodes.Ldarg_0 : OpCodes.Ldarg_1, value = isStatic ? OpCodes.Ldarg_2 : OpCodes.Ldarg_3; LocalBuilder loc = type.IsValueType ? il.DeclareLocal(type) : null; foreach (PropertyInfo prop in props) { if (prop.GetIndexParameters().Length != 0 || !prop.CanWrite) continue; Label next = il.DefineLabel(); il.Emit(propName); il.Emit(OpCodes.Ldstr, prop.Name); il.EmitCall(OpCodes.Call, strinqEquals, null); il.Emit(OpCodes.Brfalse_S, next); // match: il.Emit(target); Cast(il, type, loc); il.Emit(value); Cast(il, prop.PropertyType, null); il.EmitCall(type.IsValueType ? OpCodes.Call : OpCodes.Callvirt, prop.GetSetMethod(), null); il.Emit(OpCodes.Ret); // not match: il.MarkLabel(next); } foreach (FieldInfo field in fields) { Label next = il.DefineLabel(); il.Emit(propName); il.Emit(OpCodes.Ldstr, field.Name); il.EmitCall(OpCodes.Call, strinqEquals, null); il.Emit(OpCodes.Brfalse_S, next); // match: il.Emit(target); Cast(il, type, loc); il.Emit(value); Cast(il, field.FieldType, null); il.Emit(OpCodes.Stfld, field); il.Emit(OpCodes.Ret); // not match: il.MarkLabel(next); } il.Emit(OpCodes.Ldstr, "name"); il.Emit(OpCodes.Newobj, typeof(ArgumentOutOfRangeException).GetConstructor(new Type[] { typeof(string) })); il.Emit(OpCodes.Throw); } } private static readonly MethodInfo strinqEquals = typeof(string).GetMethod("op_Equality", new Type[] { typeof(string), typeof(string) }); sealed class DelegateAccessor : TypeAccessor { private readonly Func getter; private readonly Action setter; private readonly Func ctor; public DelegateAccessor(Func getter, Action setter, Func ctor) { this.getter = getter; this.setter = setter; this.ctor = ctor; } public override bool CreateNewSupported { get { return ctor != null; } } public override object CreateNew() { return ctor != null ? ctor() : base.CreateNew(); } public override object this[object target, string name] { get { return getter(target, name); } set { setter(target, name, value); } } } private static bool IsFullyPublic(Type type) { while (type.IsNestedPublic) type = type.DeclaringType; return type.IsPublic; } static TypeAccessor CreateNew(Type type) { //if (typeof(IDynamicMetaObjectProvider).IsAssignableFrom(type)) //{ // return DynamicAccessor.Singleton; //} PropertyInfo[] props = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance); ConstructorInfo ctor = null; if(type.IsClass && !type.IsAbstract) { ctor = type.GetConstructor(Type.EmptyTypes); } ILGenerator il; if(!IsFullyPublic(type)) { DynamicMethod dynGetter = new DynamicMethod(type.FullName + "_get", typeof(object), new Type[] { typeof(object), typeof(string) }, type, true), dynSetter = new DynamicMethod(type.FullName + "_set", null, new Type[] { typeof(object), typeof(string), typeof(object) }, type, true); WriteGetter(dynGetter.GetILGenerator(), type, props, fields, true); WriteSetter(dynSetter.GetILGenerator(), type, props, fields, true); DynamicMethod dynCtor = null; if(ctor != null) { dynCtor = new DynamicMethod(type.FullName + "_ctor", typeof(object), Type.EmptyTypes, type, true); il = dynCtor.GetILGenerator(); il.Emit(OpCodes.Newobj, ctor); il.Emit(OpCodes.Ret); } return new DelegateAccessor( (Func)dynGetter.CreateDelegate(typeof(Func)), (Action)dynSetter.CreateDelegate(typeof(Action)), dynCtor == null ? null : (Func)dynCtor.CreateDelegate(typeof(Func))); } // note this region is synchronized; only one is being created at a time so we don't need to stress about the builders if(assembly == null) { AssemblyName name = new AssemblyName("FastMember_dynamic"); assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(name, AssemblyBuilderAccess.Run); module = assembly.DefineDynamicModule(name.Name); } TypeBuilder tb = module.DefineType("FastMember_dynamic." + type.Name + "_" + Interlocked.Increment(ref counter), (typeof(TypeAccessor).Attributes | TypeAttributes.Sealed) & ~TypeAttributes.Abstract, typeof(TypeAccessor) ); tb.DefineDefaultConstructor(MethodAttributes.Public); PropertyInfo indexer = typeof (TypeAccessor).GetProperty("Item"); MethodInfo baseGetter = indexer.GetGetMethod(), baseSetter = indexer.GetSetMethod(); MethodBuilder body = tb.DefineMethod(baseGetter.Name, baseGetter.Attributes & ~MethodAttributes.Abstract, typeof(object), new Type[] {typeof(object), typeof(string)}); il = body.GetILGenerator(); WriteGetter(il, type, props, fields, false); tb.DefineMethodOverride(body, baseGetter); body = tb.DefineMethod(baseSetter.Name, baseSetter.Attributes & ~MethodAttributes.Abstract, null, new Type[] { typeof(object), typeof(string), typeof(object) }); il = body.GetILGenerator(); WriteSetter(il, type, props, fields, false); tb.DefineMethodOverride(body, baseSetter); if(ctor != null) { MethodInfo baseMethod = typeof (TypeAccessor).GetProperty("CreateNewSupported").GetGetMethod(); body = tb.DefineMethod(baseMethod.Name, baseMethod.Attributes, typeof (bool), Type.EmptyTypes); il = body.GetILGenerator(); il.Emit(OpCodes.Ldc_I4_1); il.Emit(OpCodes.Ret); tb.DefineMethodOverride(body, baseMethod); baseMethod = typeof (TypeAccessor).GetMethod("CreateNew"); body = tb.DefineMethod(baseMethod.Name, baseMethod.Attributes, typeof (object), Type.EmptyTypes); il = body.GetILGenerator(); il.Emit(OpCodes.Newobj, ctor); il.Emit(OpCodes.Ret); tb.DefineMethodOverride(body, baseMethod); } return (TypeAccessor)Activator.CreateInstance(tb.CreateType()); } private static void Cast(ILGenerator il, Type type, LocalBuilder addr) { if(type == typeof(object)) {} else if(type.IsValueType) { il.Emit(OpCodes.Unbox_Any, type); if (addr != null) { il.Emit(OpCodes.Stloc, addr); il.Emit(OpCodes.Ldloca_S, addr); } } else { il.Emit(OpCodes.Castclass, type); } } /// /// Get or set the value of a named member on the target instance /// public abstract object this[object target, string name] { get; set; } } } #endif smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/Marc/ObjectAccessor.cs0000644000175000017500000000612312146506553027670 0ustar00meebeymeebey00000000000000using System; //using System.Dynamic; //Not using it here, but @marcgravell's stuff is too good not to include #if !SILVERLIGHT && !MONOTOUCH && !XBOX namespace FastMember { /// /// Represents an individual object, allowing access to members by-name /// public abstract class ObjectAccessor { /// /// Get or Set the value of a named member for the underlying object /// public abstract object this[string name] { get; set; } /// /// The object represented by this instance /// public abstract object Target { get; } /// /// Use the target types definition of equality /// public override bool Equals(object obj) { return Target.Equals(obj); } /// /// Obtain the hash of the target object /// public override int GetHashCode() { return Target.GetHashCode(); } /// /// Use the target's definition of a string representation /// public override string ToString() { return Target.ToString(); } /// /// Wraps an individual object, allowing by-name access to that instance /// public static ObjectAccessor Create(object target) { if (target == null) throw new ArgumentNullException("target"); //IDynamicMetaObjectProvider dlr = target as IDynamicMetaObjectProvider; //if (dlr != null) return new DynamicWrapper(dlr); // use the DLR return new TypeAccessorWrapper(target, TypeAccessor.Create(target.GetType())); } sealed class TypeAccessorWrapper : ObjectAccessor { private readonly object target; private readonly TypeAccessor accessor; public TypeAccessorWrapper(object target, TypeAccessor accessor) { this.target = target; this.accessor = accessor; } public override object this[string name] { get { return accessor[target, name.ToUpperInvariant()]; } set { accessor[target, name.ToUpperInvariant()] = value; } } public override object Target { get { return target; } } } //sealed class DynamicWrapper : ObjectAccessor //{ // private readonly IDynamicMetaObjectProvider target; // public override object Target // { // get { return target; } // } // public DynamicWrapper(IDynamicMetaObjectProvider target) // { // this.target = target; // } // public override object this[string name] // { // get { return CallSiteCache.GetValue(name, target); } // set { CallSiteCache.SetValue(name, target, value); } // } //} } } #endifsmuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/TypeSerializer.cs0000644000175000017500000001446212146506553027075 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using ServiceStack.Text.Common; using ServiceStack.Text.Jsv; namespace ServiceStack.Text { /// /// Creates an instance of a Type from a string value /// public static class TypeSerializer { private static readonly UTF8Encoding UTF8EncodingWithoutBom = new UTF8Encoding(false); public const string DoubleQuoteString = "\"\""; /// /// Determines whether the specified type is convertible from string. /// /// The type. /// /// true if the specified type is convertible from string; otherwise, false. /// public static bool CanCreateFromString(Type type) { return JsvReader.GetParseFn(type) != null; } /// /// Parses the specified value. /// /// The value. /// public static T DeserializeFromString(string value) { if (string.IsNullOrEmpty(value)) return default(T); return (T)JsvReader.Parse(value); } public static T DeserializeFromReader(TextReader reader) { return DeserializeFromString(reader.ReadToEnd()); } /// /// Parses the specified type. /// /// The type. /// The value. /// public static object DeserializeFromString(string value, Type type) { return value == null ? null : JsvReader.GetParseFn(type)(value); } public static object DeserializeFromReader(TextReader reader, Type type) { return DeserializeFromString(reader.ReadToEnd(), type); } public static string SerializeToString(T value) { if (value == null) return null; if (typeof(T) == typeof(string)) return value as string; if (typeof(T) == typeof(object) || typeof(T).IsAbstract || typeof(T).IsInterface) { if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = true; var result = SerializeToString(value, value.GetType()); if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = false; return result; } var sb = new StringBuilder(); using (var writer = new StringWriter(sb, CultureInfo.InvariantCulture)) { JsvWriter.WriteObject(writer, value); } return sb.ToString(); } public static string SerializeToString(object value, Type type) { if (value == null) return null; if (type == typeof(string)) return value as string; var sb = new StringBuilder(); using (var writer = new StringWriter(sb, CultureInfo.InvariantCulture)) { JsvWriter.GetWriteFn(type)(writer, value); } return sb.ToString(); } public static void SerializeToWriter(T value, TextWriter writer) { if (value == null) return; if (typeof(T) == typeof(string)) { writer.Write(value); return; } if (typeof(T) == typeof(object)) { if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = true; SerializeToWriter(value, value.GetType(), writer); if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = false; return; } JsvWriter.WriteObject(writer, value); } public static void SerializeToWriter(object value, Type type, TextWriter writer) { if (value == null) return; if (type == typeof(string)) { writer.Write(value); return; } JsvWriter.GetWriteFn(type)(writer, value); } public static void SerializeToStream(T value, Stream stream) { if (value == null) return; if (typeof(T) == typeof(object)) { if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = true; SerializeToStream(value, value.GetType(), stream); if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = false; return; } var writer = new StreamWriter(stream, UTF8EncodingWithoutBom); JsvWriter.WriteObject(writer, value); writer.Flush(); } public static void SerializeToStream(object value, Type type, Stream stream) { var writer = new StreamWriter(stream, UTF8EncodingWithoutBom); JsvWriter.GetWriteFn(type)(writer, value); writer.Flush(); } public static T Clone(T value) { var serializedValue = SerializeToString(value); var cloneObj = DeserializeFromString(serializedValue); return cloneObj; } public static T DeserializeFromStream(Stream stream) { using (var reader = new StreamReader(stream, UTF8EncodingWithoutBom)) { return DeserializeFromString(reader.ReadToEnd()); } } public static object DeserializeFromStream(Type type, Stream stream) { using (var reader = new StreamReader(stream, UTF8EncodingWithoutBom)) { return DeserializeFromString(reader.ReadToEnd(), type); } } /// /// Useful extension method to get the Dictionary[string,string] representation of any POCO type. /// /// public static Dictionary ToStringDictionary(this T obj) where T : class { var jsv = SerializeToString(obj); var map = DeserializeFromString>(jsv); return map; } /// /// Recursively prints the contents of any POCO object in a human-friendly, readable format /// /// public static string Dump(this T instance) { return SerializeAndFormat(instance); } public static string SerializeAndFormat(this T instance) { var dtoStr = SerializeToString(instance); var formatStr = JsvFormatter.Format(dtoStr); return formatStr; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/TranslateListWithElements.cs0000644000175000017500000001730312146506553031241 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using System.Threading; using ServiceStack.Text.Common; namespace ServiceStack.Text { public static class TranslateListWithElements { private static Dictionary TranslateICollectionCache = new Dictionary(); public static object TranslateToGenericICollectionCache(object from, Type toInstanceOfType, Type elementType) { ConvertInstanceDelegate translateToFn; if (TranslateICollectionCache.TryGetValue(toInstanceOfType, out translateToFn)) return translateToFn(from, toInstanceOfType); var genericType = typeof(TranslateListWithElements<>).MakeGenericType(elementType); var mi = genericType.GetMethod("LateBoundTranslateToGenericICollection", BindingFlags.Static | BindingFlags.Public); translateToFn = (ConvertInstanceDelegate)Delegate.CreateDelegate(typeof(ConvertInstanceDelegate), mi); Dictionary snapshot, newCache; do { snapshot = TranslateICollectionCache; newCache = new Dictionary(TranslateICollectionCache); newCache[elementType] = translateToFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref TranslateICollectionCache, newCache, snapshot), snapshot)); return translateToFn(from, toInstanceOfType); } private static Dictionary TranslateConvertibleICollectionCache = new Dictionary(); public static object TranslateToConvertibleGenericICollectionCache( object from, Type toInstanceOfType, Type fromElementType) { var typeKey = new ConvertibleTypeKey(toInstanceOfType, fromElementType); ConvertInstanceDelegate translateToFn; if (TranslateConvertibleICollectionCache.TryGetValue(typeKey, out translateToFn)) return translateToFn(from, toInstanceOfType); var toElementType = toInstanceOfType.GetGenericType().GetGenericArguments()[0]; var genericType = typeof(TranslateListWithConvertibleElements<,>).MakeGenericType(fromElementType, toElementType); var mi = genericType.GetMethod("LateBoundTranslateToGenericICollection", BindingFlags.Static | BindingFlags.Public); translateToFn = (ConvertInstanceDelegate)Delegate.CreateDelegate(typeof(ConvertInstanceDelegate), mi); Dictionary snapshot, newCache; do { snapshot = TranslateConvertibleICollectionCache; newCache = new Dictionary(TranslateConvertibleICollectionCache); newCache[typeKey] = translateToFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref TranslateConvertibleICollectionCache, newCache, snapshot), snapshot)); return translateToFn(from, toInstanceOfType); } public static object TryTranslateToGenericICollection(Type fromPropertyType, Type toPropertyType, object fromValue) { var args = typeof(ICollection<>).GetGenericArgumentsIfBothHaveSameGenericDefinitionTypeAndArguments( fromPropertyType, toPropertyType); if (args != null) { return TranslateToGenericICollectionCache( fromValue, toPropertyType, args[0]); } var varArgs = typeof(ICollection<>).GetGenericArgumentsIfBothHaveConvertibleGenericDefinitionTypeAndArguments( fromPropertyType, toPropertyType); if (varArgs != null) { return TranslateToConvertibleGenericICollectionCache( fromValue, toPropertyType, varArgs.Args1[0]); } return null; } } public class ConvertibleTypeKey { public Type ToInstanceType { get; set; } public Type FromElemenetType { get; set; } public ConvertibleTypeKey() { } public ConvertibleTypeKey(Type toInstanceType, Type fromElemenetType) { ToInstanceType = toInstanceType; FromElemenetType = fromElemenetType; } public bool Equals(ConvertibleTypeKey other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.ToInstanceType, ToInstanceType) && Equals(other.FromElemenetType, FromElemenetType); } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; if (obj.GetType() != typeof(ConvertibleTypeKey)) return false; return Equals((ConvertibleTypeKey)obj); } public override int GetHashCode() { unchecked { return ((ToInstanceType != null ? ToInstanceType.GetHashCode() : 0) * 397) ^ (FromElemenetType != null ? FromElemenetType.GetHashCode() : 0); } } } public class TranslateListWithElements { public static object CreateInstance(Type toInstanceOfType) { if (toInstanceOfType.IsGenericType) { if (toInstanceOfType.HasAnyTypeDefinitionsOf( typeof(ICollection<>), typeof(IList<>))) { return ReflectionExtensions.CreateInstance(typeof(List)); } } return ReflectionExtensions.CreateInstance(toInstanceOfType); } public static IList TranslateToIList(IList fromList, Type toInstanceOfType) { var to = (IList)ReflectionExtensions.CreateInstance(toInstanceOfType); foreach (var item in fromList) { to.Add(item); } return to; } public static object LateBoundTranslateToGenericICollection( object fromList, Type toInstanceOfType) { if (fromList == null) return null; //AOT return TranslateToGenericICollection( (ICollection)fromList, toInstanceOfType); } public static ICollection TranslateToGenericICollection( ICollection fromList, Type toInstanceOfType) { var to = (ICollection)CreateInstance(toInstanceOfType); foreach (var item in fromList) { to.Add(item); } return to; } } public class TranslateListWithConvertibleElements { private static readonly Func ConvertFn; static TranslateListWithConvertibleElements() { ConvertFn = GetConvertFn(); } public static object LateBoundTranslateToGenericICollection( object fromList, Type toInstanceOfType) { return TranslateToGenericICollection( (ICollection)fromList, toInstanceOfType); } public static ICollection TranslateToGenericICollection( ICollection fromList, Type toInstanceOfType) { if (fromList == null) return null; //AOT var to = (ICollection)TranslateListWithElements.CreateInstance(toInstanceOfType); foreach (var item in fromList) { var toItem = ConvertFn(item); to.Add(toItem); } return to; } private static Func GetConvertFn() { if (typeof(TTo) == typeof(string)) { return x => (TTo)(object)TypeSerializer.SerializeToString(x); } if (typeof(TFrom) == typeof(string)) { return x => TypeSerializer.DeserializeFromString((string)(object)x); } return x => TypeSerializer.DeserializeFromString(TypeSerializer.SerializeToString(x)); } } } smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/QueryStringSerializer.cs0000644000175000017500000000677412146506553030457 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Reflection; using System.Text; using System.Threading; using ServiceStack.Text.Common; using ServiceStack.Text.Jsv; namespace ServiceStack.Text { public static class QueryStringSerializer { internal static readonly JsWriter Instance = new JsWriter(); private static Dictionary WriteFnCache = new Dictionary(); internal static WriteObjectDelegate GetWriteFn(Type type) { try { WriteObjectDelegate writeFn; if (WriteFnCache.TryGetValue(type, out writeFn)) return writeFn; var genericType = typeof(QueryStringWriter<>).MakeGenericType(type); var mi = genericType.GetMethod("WriteFn", BindingFlags.NonPublic | BindingFlags.Static); var writeFactoryFn = (Func)Delegate.CreateDelegate( typeof(Func), mi); writeFn = writeFactoryFn(); Dictionary snapshot, newCache; do { snapshot = WriteFnCache; newCache = new Dictionary(WriteFnCache); newCache[type] = writeFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref WriteFnCache, newCache, snapshot), snapshot)); return writeFn; } catch (Exception ex) { Tracer.Instance.WriteError(ex); throw; } } public static void WriteLateBoundObject(TextWriter writer, object value) { if (value == null) return; var writeFn = GetWriteFn(value.GetType()); writeFn(writer, value); } internal static WriteObjectDelegate GetValueTypeToStringMethod(Type type) { return Instance.GetValueTypeToStringMethod(type); } public static string SerializeToString(T value) { var sb = new StringBuilder(); using (var writer = new StringWriter(sb, CultureInfo.InvariantCulture)) { GetWriteFn(value.GetType())(writer, value); } return sb.ToString(); } } /// /// Implement the serializer using a more static approach /// /// public static class QueryStringWriter { private static readonly WriteObjectDelegate CacheFn; internal static WriteObjectDelegate WriteFn() { return CacheFn; } static QueryStringWriter() { if (typeof(T) == typeof(object)) { CacheFn = QueryStringSerializer.WriteLateBoundObject; } else { if (typeof(T).IsClass || typeof(T).IsInterface) { var canWriteType = WriteType.Write; if (canWriteType != null) { CacheFn = WriteType.WriteQueryString; return; } } CacheFn = QueryStringSerializer.Instance.GetWriteFn(); } } public static void WriteObject(TextWriter writer, object value) { if (writer == null) return; CacheFn(writer, value); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/JsonSerializer.cs0000644000175000017500000001134512146506553027062 0ustar00meebeymeebey00000000000000 // // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Globalization; using System.IO; using System.Text; using ServiceStack.Text.Common; using ServiceStack.Text.Json; namespace ServiceStack.Text { /// /// Creates an instance of a Type from a string value /// public static class JsonSerializer { private static readonly UTF8Encoding UTF8EncodingWithoutBom = new UTF8Encoding(false); public static T DeserializeFromString(string value) { if (string.IsNullOrEmpty(value)) return default(T); return (T)JsonReader.Parse(value); } public static T DeserializeFromReader(TextReader reader) { return DeserializeFromString(reader.ReadToEnd()); } public static object DeserializeFromString(string value, Type type) { return value == null ? null : JsonReader.GetParseFn(type)(value); } public static object DeserializeFromReader(TextReader reader, Type type) { return DeserializeFromString(reader.ReadToEnd(), type); } public static string SerializeToString(T value) { if (value == null) return null; if (typeof(T) == typeof(object) || typeof(T).IsAbstract || typeof(T).IsInterface) { if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = true; var result = SerializeToString(value, value.GetType()); if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = false; return result; } var sb = new StringBuilder(); using (var writer = new StringWriter(sb, CultureInfo.InvariantCulture)) { if (typeof(T) == typeof(string)) { JsonUtils.WriteString(writer, value as string); } else { JsonWriter.WriteObject(writer, value); } } return sb.ToString(); } public static string SerializeToString(object value, Type type) { if (value == null) return null; var sb = new StringBuilder(); using (var writer = new StringWriter(sb, CultureInfo.InvariantCulture)) { if (type == typeof(string)) { JsonUtils.WriteString(writer, value as string); } else { JsonWriter.GetWriteFn(type)(writer, value); } } return sb.ToString(); } public static void SerializeToWriter(T value, TextWriter writer) { if (value == null) return; if (typeof(T) == typeof(string)) { writer.Write(value); return; } if (typeof(T) == typeof(object) || typeof(T).IsAbstract || typeof(T).IsInterface) { if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = true; SerializeToWriter(value, value.GetType(), writer); if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = false; return; } JsonWriter.WriteObject(writer, value); } public static void SerializeToWriter(object value, Type type, TextWriter writer) { if (value == null) return; if (type == typeof(string)) { writer.Write(value); return; } JsonWriter.GetWriteFn(type)(writer, value); } public static void SerializeToStream(T value, Stream stream) { if (value == null) return; if (typeof(T) == typeof(object) || typeof(T).IsAbstract || typeof(T).IsInterface) { if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = true; SerializeToStream(value, value.GetType(), stream); if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = false; return; } var writer = new StreamWriter(stream, UTF8EncodingWithoutBom); JsonWriter.WriteObject(writer, value); writer.Flush(); } public static void SerializeToStream(object value, Type type, Stream stream) { var writer = new StreamWriter(stream, UTF8EncodingWithoutBom); JsonWriter.GetWriteFn(type)(writer, value); writer.Flush(); } public static T DeserializeFromStream(Stream stream) { using (var reader = new StreamReader(stream, UTF8EncodingWithoutBom)) { return DeserializeFromString(reader.ReadToEnd()); } } public static object DeserializeFromStream(Type type, Stream stream) { using (var reader = new StreamReader(stream, UTF8EncodingWithoutBom)) { return DeserializeFromString(reader.ReadToEnd(), type); } } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/ITracer.cs0000644000175000017500000000065212146506553025447 0ustar00meebeymeebey00000000000000using System; namespace ServiceStack.Text { public interface ITracer { void WriteDebug(string error); void WriteDebug(string format, params object[] args); void WriteWarning(string warning); void WriteWarning(string format, params object[] args); void WriteError(Exception ex); void WriteError(string error); void WriteError(string format, params object[] args); } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/CsvSerializer.cs0000644000175000017500000001714012146506553026703 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Reflection; using System.Text; using System.Threading; using ServiceStack.Text.Common; using ServiceStack.Text.Jsv; using ServiceStack.Text.Reflection; namespace ServiceStack.Text { public class CsvSerializer { private static readonly UTF8Encoding UTF8EncodingWithoutBom = new UTF8Encoding(false); private static Dictionary WriteFnCache = new Dictionary(); internal static WriteObjectDelegate GetWriteFn(Type type) { try { WriteObjectDelegate writeFn; if (WriteFnCache.TryGetValue(type, out writeFn)) return writeFn; var genericType = typeof(CsvSerializer<>).MakeGenericType(type); var mi = genericType.GetMethod("WriteFn", BindingFlags.Public | BindingFlags.Static); var writeFactoryFn = (Func)Delegate.CreateDelegate( typeof(Func), mi); writeFn = writeFactoryFn(); Dictionary snapshot, newCache; do { snapshot = WriteFnCache; newCache = new Dictionary(WriteFnCache); newCache[type] = writeFn; } while (!ReferenceEquals( Interlocked.CompareExchange(ref WriteFnCache, newCache, snapshot), snapshot)); return writeFn; } catch (Exception ex) { Tracer.Instance.WriteError(ex); throw; } } public static string SerializeToCsv(IEnumerable records) { var sb = new StringBuilder(); using (var writer = new StringWriter(sb, CultureInfo.InvariantCulture)) { writer.WriteCsv(records); return sb.ToString(); } } public static string SerializeToString(T value) { if (value == null) return null; if (typeof(T) == typeof(string)) return value as string; var sb = new StringBuilder(); using (var writer = new StringWriter(sb, CultureInfo.InvariantCulture)) { CsvSerializer.WriteObject(writer, value); } return sb.ToString(); } public static void SerializeToWriter(T value, TextWriter writer) { if (value == null) return; if (typeof(T) == typeof(string)) { writer.Write(value); return; } CsvSerializer.WriteObject(writer, value); } public static void SerializeToStream(T value, Stream stream) { if (value == null) return; using (var writer = new StreamWriter(stream, UTF8EncodingWithoutBom)) { CsvSerializer.WriteObject(writer, value); } } public static void SerializeToStream(object obj, Stream stream) { if (obj == null) return; using (var writer = new StreamWriter(stream, UTF8EncodingWithoutBom)) { var writeFn = GetWriteFn(obj.GetType()); writeFn(writer, obj); } } public static T DeserializeFromStream(Stream stream) { throw new NotImplementedException(); } public static object DeserializeFromStream(Type type, Stream stream) { throw new NotImplementedException(); } public static void WriteLateBoundObject(TextWriter writer, object value) { if (value == null) return; var writeFn = GetWriteFn(value.GetType()); writeFn(writer, value); } } internal static class CsvSerializer { private static readonly WriteObjectDelegate CacheFn; public static WriteObjectDelegate WriteFn() { return CacheFn; } private const string IgnoreResponseStatus = "ResponseStatus"; private static Func valueGetter = null; private static WriteObjectDelegate writeElementFn = null; private static WriteObjectDelegate GetWriteFn() { PropertyInfo firstCandidate = null; Type bestCandidateEnumerableType = null; PropertyInfo bestCandidate = null; if (typeof(T).IsValueType) { return JsvWriter.WriteObject; } //If type is an enumerable property itself write that bestCandidateEnumerableType = typeof(T).GetTypeWithGenericTypeDefinitionOf(typeof(IEnumerable<>)); if (bestCandidateEnumerableType != null) { var elementType = bestCandidateEnumerableType.GetGenericArguments()[0]; writeElementFn = CreateWriteFn(elementType); return WriteEnumerableType; } //Look for best candidate property if DTO if (typeof(T).IsDto()) { var properties = TypeConfig.Properties; foreach (var propertyInfo in properties) { if (propertyInfo.Name == IgnoreResponseStatus) continue; if (propertyInfo.PropertyType == typeof(string) || propertyInfo.PropertyType.IsValueType || propertyInfo.PropertyType == typeof(byte[])) continue; if (firstCandidate == null) { firstCandidate = propertyInfo; } var enumProperty = propertyInfo.PropertyType .GetTypeWithGenericTypeDefinitionOf(typeof(IEnumerable<>)); if (enumProperty != null) { bestCandidateEnumerableType = enumProperty; bestCandidate = propertyInfo; break; } } } //If is not DTO or no candidates exist, write self var noCandidatesExist = bestCandidate == null && firstCandidate == null; if (noCandidatesExist) { return WriteSelf; } //If is DTO and has an enumerable property serialize that if (bestCandidateEnumerableType != null) { valueGetter = bestCandidate.GetValueGetter(typeof(T)); var elementType = bestCandidateEnumerableType.GetGenericArguments()[0]; writeElementFn = CreateWriteFn(elementType); return WriteEnumerableProperty; } //If is DTO and has non-enumerable, reference type property serialize that valueGetter = firstCandidate.GetValueGetter(typeof(T)); writeElementFn = CreateWriteRowFn(firstCandidate.PropertyType); return WriteNonEnumerableType; } private static WriteObjectDelegate CreateWriteFn(Type elementType) { return CreateCsvWriterFn(elementType, "WriteObject"); } private static WriteObjectDelegate CreateWriteRowFn(Type elementType) { return CreateCsvWriterFn(elementType, "WriteObjectRow"); } private static WriteObjectDelegate CreateCsvWriterFn(Type elementType, string methodName) { var genericType = typeof(CsvWriter<>).MakeGenericType(elementType); var mi = genericType.GetMethod(methodName, BindingFlags.Static | BindingFlags.Public); var writeFn = (WriteObjectDelegate)Delegate.CreateDelegate(typeof(WriteObjectDelegate), mi); return writeFn; } public static void WriteEnumerableType(TextWriter writer, object obj) { writeElementFn(writer, obj); } public static void WriteSelf(TextWriter writer, object obj) { CsvWriter.WriteRow(writer, (T)obj); } public static void WriteEnumerableProperty(TextWriter writer, object obj) { if (obj == null) return; //AOT var enumerableProperty = valueGetter(obj); writeElementFn(writer, enumerableProperty); } public static void WriteNonEnumerableType(TextWriter writer, object obj) { var nonEnumerableType = valueGetter(obj); writeElementFn(writer, nonEnumerableType); } static CsvSerializer() { if (typeof(T) == typeof(object)) { CacheFn = CsvSerializer.WriteLateBoundObject; } else { CacheFn = GetWriteFn(); } } public static void WriteObject(TextWriter writer, object value) { CacheFn(writer, value); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/StringExtensions.cs0000644000175000017500000004237412146506553027453 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Globalization; using System.Text.RegularExpressions; using ServiceStack.Text.Support; namespace ServiceStack.Text { public static class StringExtensions { public static T To(this string value) { return TypeSerializer.DeserializeFromString(value); } public static T To(this string value, T defaultValue) { return string.IsNullOrEmpty(value) ? defaultValue : TypeSerializer.DeserializeFromString(value); } public static T ToOrDefaultValue(this string value) { return string.IsNullOrEmpty(value) ? default(T) : TypeSerializer.DeserializeFromString(value); } public static object To(this string value, Type type) { return TypeSerializer.DeserializeFromString(value, type); } /// /// Converts from base: 0 - 62 /// /// The source. /// From. /// To. /// public static string BaseConvert(this string source, int from, int to) { const string chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; var result = ""; var length = source.Length; var number = new int[length]; for (var i = 0; i < length; i++) { number[i] = chars.IndexOf(source[i]); } int newlen; do { var divide = 0; newlen = 0; for (var i = 0; i < length; i++) { divide = divide * from + number[i]; if (divide >= to) { number[newlen++] = divide / to; divide = divide % to; } else if (newlen > 0) { number[newlen++] = 0; } } length = newlen; result = chars[divide] + result; } while (newlen != 0); return result; } public static string EncodeXml(this string value) { return value.Replace("<", "<").Replace(">", ">").Replace("&", "&"); } public static string EncodeJson(this string value) { return string.Concat ("\"", value.Replace("\\", "\\\\").Replace("\"", "\\\"").Replace("\r", "").Replace("\n", "\\n"), "\"" ); } public static string EncodeJsv(this string value) { return value.ToCsvField(); } public static string UrlEncode(this string text) { if (string.IsNullOrEmpty(text)) return text; var sb = new StringBuilder(); var textLength = text.Length; for (var i = 0; i < textLength; i++) { var c = text.Substring(i, 1); int charCode = text[i]; if ( charCode >= 65 && charCode <= 90 // A-Z || charCode >= 97 && charCode <= 122 // a-z || charCode >= 48 && charCode <= 57 // 0-9 || charCode >= 44 && charCode <= 46 // ,-. ) { sb.Append(c); } else { sb.Append('%' + charCode.ToString("x")); } } return sb.ToString(); } public static string UrlDecode(this string text) { if (string.IsNullOrEmpty(text)) return null; var sb = new StringBuilder(); var textLength = text.Length; for (var i = 0; i < textLength; i++) { var c = text.Substring(i, 1); if (c == "+") { sb.Append(" "); } else if (c == "%") { var hexNo = Convert.ToInt32(text.Substring(i + 1, 2), 16); sb.Append((char)hexNo); i += 2; } else { sb.Append(c); } } return sb.ToString(); } #if !XBOX public static string HexEscape(this string text, params char[] anyCharOf) { if (string.IsNullOrEmpty(text)) return text; if (anyCharOf == null || anyCharOf.Length == 0) return text; var encodeCharMap = new HashSet(anyCharOf); var sb = new StringBuilder(); var textLength = text.Length; for (var i = 0; i < textLength; i++) { var c = text[i]; if (encodeCharMap.Contains(c)) { sb.Append('%' + ((int)c).ToString("x")); } else { sb.Append(c); } } return sb.ToString(); } #endif public static string HexUnescape(this string text, params char[] anyCharOf) { if (string.IsNullOrEmpty(text)) return null; if (anyCharOf == null || anyCharOf.Length == 0) return text; var sb = new StringBuilder(); var textLength = text.Length; for (var i = 0; i < textLength; i++) { var c = text.Substring(i, 1); if (c == "%") { var hexNo = Convert.ToInt32(text.Substring(i + 1, 2), 16); sb.Append((char)hexNo); i += 2; } else { sb.Append(c); } } return sb.ToString(); } public static string UrlFormat(this string url, params string[] urlComponents) { var encodedUrlComponents = new string[urlComponents.Length]; for (var i = 0; i < urlComponents.Length; i++) { var x = urlComponents[i]; encodedUrlComponents[i] = x.UrlEncode(); } return string.Format(url, encodedUrlComponents); } public static string ToRot13(this string value) { var array = value.ToCharArray(); for (var i = 0; i < array.Length; i++) { var number = (int)array[i]; if (number >= 'a' && number <= 'z') number += (number > 'm') ? -13 : 13; else if (number >= 'A' && number <= 'Z') number += (number > 'M') ? -13 : 13; array[i] = (char)number; } return new string(array); } public static string WithTrailingSlash(this string path) { if (string.IsNullOrEmpty(path)) throw new ArgumentNullException("path"); if (path[path.Length - 1] != '/') { return path + "/"; } return path; } public static string AppendUrlPaths(this string uri, params string[] uriComponents) { var sb = new StringBuilder(uri.WithTrailingSlash()); var i = 0; foreach (var uriComponent in uriComponents) { if (i++ > 0) sb.Append('/'); sb.Append(uriComponent.UrlEncode()); } return sb.ToString(); } public static string FromUtf8Bytes(this byte[] bytes) { return bytes == null ? null : Encoding.UTF8.GetString(bytes, 0, bytes.Length); } public static byte[] ToUtf8Bytes(this string value) { return Encoding.UTF8.GetBytes(value); } public static byte[] ToUtf8Bytes(this int intVal) { return FastToUtf8Bytes(intVal.ToString()); } public static byte[] ToUtf8Bytes(this long longVal) { return FastToUtf8Bytes(longVal.ToString()); } public static byte[] ToUtf8Bytes(this double doubleVal) { var doubleStr = doubleVal.ToString(CultureInfo.InvariantCulture.NumberFormat); if (doubleStr.IndexOf('E') != -1 || doubleStr.IndexOf('e') != -1) doubleStr = DoubleConverter.ToExactString(doubleVal); return FastToUtf8Bytes(doubleStr); } /// /// Skip the encoding process for 'safe strings' /// /// /// private static byte[] FastToUtf8Bytes(string strVal) { var bytes = new byte[strVal.Length]; for (var i = 0; i < strVal.Length; i++) bytes[i] = (byte)strVal[i]; return bytes; } public static string[] SplitOnFirst(this string strVal, char needle) { if (strVal == null) return new string[0]; var pos = strVal.IndexOf(needle); return pos == -1 ? new[] { strVal } : new[] { strVal.Substring(0, pos), strVal.Substring(pos + 1) }; } public static string[] SplitOnFirst(this string strVal, string needle) { if (strVal == null) return new string[0]; var pos = strVal.IndexOf(needle); return pos == -1 ? new[] { strVal } : new[] { strVal.Substring(0, pos), strVal.Substring(pos + 1) }; } public static string[] SplitOnLast(this string strVal, char needle) { if (strVal == null) return new string[0]; var pos = strVal.LastIndexOf(needle); return pos == -1 ? new[] { strVal } : new[] { strVal.Substring(0, pos), strVal.Substring(pos + 1) }; } public static string[] SplitOnLast(this string strVal, string needle) { if (strVal == null) return new string[0]; var pos = strVal.LastIndexOf(needle); return pos == -1 ? new[] { strVal } : new[] { strVal.Substring(0, pos), strVal.Substring(pos + 1) }; } public static string WithoutExtension(this string filePath) { if (string.IsNullOrEmpty(filePath)) return null; var extPos = filePath.LastIndexOf('.'); if (extPos == -1) return filePath; var dirPos = filePath.LastIndexOfAny(DirSeps); return extPos > dirPos ? filePath.Substring(0, extPos) : filePath; } private static readonly char DirSep = Path.DirectorySeparatorChar; private static readonly char AltDirSep = Path.DirectorySeparatorChar == '/' ? '\\' : '/'; static readonly char[] DirSeps = new[] { '\\', '/' }; public static string ParentDirectory(this string filePath) { if (string.IsNullOrEmpty(filePath)) return null; var dirSep = filePath.IndexOf(DirSep) != -1 ? DirSep : filePath.IndexOf(AltDirSep) != -1 ? AltDirSep : (char)0; return dirSep == 0 ? null : filePath.TrimEnd(dirSep).SplitOnLast(dirSep)[0]; } public static string ToJsv(this T obj) { return TypeSerializer.SerializeToString(obj); } public static T FromJsv(this string jsv) { return TypeSerializer.DeserializeFromString(jsv); } public static string ToJson(this T obj) { return JsonSerializer.SerializeToString(obj); } public static T FromJson(this string json) { return JsonSerializer.DeserializeFromString(json); } #if !XBOX && !SILVERLIGHT public static string ToXml(this T obj) { return XmlSerializer.SerializeToString(obj); } #endif #if !XBOX && !SILVERLIGHT public static T FromXml(this string json) { return XmlSerializer.DeserializeFromString(json); } #endif public static string FormatWith(this string text, params object[] args) { return string.Format(text, args); } public static string Fmt(this string text, params object[] args) { return string.Format(text, args); } public static bool StartsWithIgnoreCase(this string text, string startsWith) { return text != null && text.StartsWith(startsWith, StringComparison.InvariantCultureIgnoreCase); } public static string ReadAllText(this string filePath) { #if XBOX && !SILVERLIGHT using( var fileStream = new FileStream( filePath, FileMode.Open, FileAccess.Read ) ) { return new StreamReader( fileStream ).ReadToEnd( ) ; } #else return File.ReadAllText(filePath); #endif } public static int IndexOfAny(this string text, params string[] needles) { return IndexOfAny(text, 0, needles); } public static int IndexOfAny(this string text, int startIndex, params string[] needles) { if (text == null) return -1; var firstPos = -1; foreach (var needle in needles) { var pos = text.IndexOf(needle); if (firstPos == -1 || pos < firstPos) firstPos = pos; } return firstPos; } public static string ExtractContents(this string fromText, string startAfter, string endAt) { return ExtractContents(fromText, startAfter, startAfter, endAt); } public static string ExtractContents(this string fromText, string uniqueMarker, string startAfter, string endAt) { if (string.IsNullOrEmpty(uniqueMarker)) throw new ArgumentNullException("uniqueMarker"); if (string.IsNullOrEmpty(startAfter)) throw new ArgumentNullException("startAfter"); if (string.IsNullOrEmpty(endAt)) throw new ArgumentNullException("endAt"); if (string.IsNullOrEmpty(fromText)) return null; var markerPos = fromText.IndexOf(uniqueMarker); if (markerPos == -1) return null; var startPos = fromText.IndexOf(startAfter, markerPos); if (startPos == -1) return null; startPos += startAfter.Length; var endPos = fromText.IndexOf(endAt, startPos); if (endPos == -1) endPos = fromText.Length; return fromText.Substring(startPos, endPos - startPos); } #if XBOX && !SILVERLIGHT static readonly Regex StripHtmlRegEx = new Regex(@"<(.|\n)*?>", RegexOptions.Compiled); #else static readonly Regex StripHtmlRegEx = new Regex(@"<(.|\n)*?>"); #endif public static string StripHtml(this string html) { return string.IsNullOrEmpty(html) ? null : StripHtmlRegEx.Replace(html, ""); } #if XBOX && !SILVERLIGHT static readonly Regex StripBracketsRegEx = new Regex(@"\[(.|\n)*?\]", RegexOptions.Compiled); static readonly Regex StripBracesRegEx = new Regex(@"\((.|\n)*?\)", RegexOptions.Compiled); #else static readonly Regex StripBracketsRegEx = new Regex(@"\[(.|\n)*?\]"); static readonly Regex StripBracesRegEx = new Regex(@"\((.|\n)*?\)"); #endif public static string StripMarkdownMarkup(this string markdown) { if (string.IsNullOrEmpty(markdown)) return null; markdown = StripBracketsRegEx.Replace(markdown, ""); markdown = StripBracesRegEx.Replace(markdown, ""); markdown = markdown .Replace("*", "") .Replace("!", "") .Replace("\r", "") .Replace("\n", "") .Replace("#", ""); return markdown; } private const int LowerCaseOffset = 'a' - 'A'; public static string ToCamelCase(this string value) { if (string.IsNullOrEmpty(value)) return value; var firstChar = value[0]; if (firstChar < 'A' || firstChar > 'Z') return value; return (char)(firstChar + LowerCaseOffset) + value.Substring(1); } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/TypeConfig.cs0000644000175000017500000000243112146506553026162 0ustar00meebeymeebey00000000000000using System; using System.Linq; using System.Reflection; namespace ServiceStack.Text { internal class TypeConfig { internal readonly Type Type; internal bool EnableAnonymousFieldSetterses; internal PropertyInfo[] Properties; internal TypeConfig(Type type) { Type = type; EnableAnonymousFieldSetterses = false; Properties = new PropertyInfo[0]; } } public static class TypeConfig { private static readonly TypeConfig config; public static PropertyInfo[] Properties { get { return config.Properties; } set { config.Properties = value; } } public static bool EnableAnonymousFieldSetters { get { return config.EnableAnonymousFieldSetterses; } set { config.EnableAnonymousFieldSetterses = value; } } static TypeConfig() { config = new TypeConfig(typeof(T)); var excludedProperties = JsConfig.ExcludePropertyNames ?? new string[0]; var properties = excludedProperties.Any() ? config.Type.GetSerializableProperties().Where(x => !excludedProperties.Contains(x.Name)) : config.Type.GetSerializableProperties(); Properties = properties.Where(x => x.GetIndexParameters().Length == 0).ToArray(); } internal static TypeConfig GetState() { return config; } } }smuxi-0.11/lib/ServiceStack.Text/src/ServiceStack.Text/JsonSerializer.Generic.cs0000644000175000017500000000470712146506553030441 0ustar00meebeymeebey00000000000000// // http://code.google.com/p/servicestack/wiki/TypeSerializer // ServiceStack.Text: .NET C# POCO Type Text Serializer. // // Authors: // Demis Bellot (demis.bellot@gmail.com) // // Copyright 2011 Liquidbit Ltd. // // Licensed under the same terms of ServiceStack: new BSD license. // using System; using System.IO; using System.Text; using ServiceStack.Text.Common; using ServiceStack.Text.Json; namespace ServiceStack.Text { public class JsonSerializer : ITypeSerializer { public bool CanCreateFromString(Type type) { return JsonReader.GetParseFn(type) != null; } /// /// Parses the specified value. /// /// The value. /// public T DeserializeFromString(string value) { if (string.IsNullOrEmpty(value)) return default(T); return (T)JsonReader.Parse(value); } public T DeserializeFromReader(TextReader reader) { return DeserializeFromString(reader.ReadToEnd()); } public string SerializeToString(T value) { if (value == null) return null; if (typeof(T) == typeof(string)) return value as string; if (typeof(T) == typeof(object) || typeof(T).IsAbstract || typeof(T).IsInterface) { if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = true; var result = JsonSerializer.SerializeToString(value, value.GetType()); if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = false; return result; } var sb = new StringBuilder(); using (var writer = new StringWriter(sb)) { JsonWriter.WriteObject(writer, value); } return sb.ToString(); } public void SerializeToWriter(T value, TextWriter writer) { if (value == null) return; if (typeof(T) == typeof(string)) { writer.Write(value); return; } if (typeof(T) == typeof(object) || typeof(T).IsAbstract || typeof(T).IsInterface) { if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = true; JsonSerializer.SerializeToWriter(value, value.GetType(), writer); if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = false; return; } JsonWriter.WriteObject(writer, value); } } }smuxi-0.11/libtool.m40000644000175000017500000106011112311344225015301 0ustar00meebeymeebey00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS smuxi-0.11/po-Frontend-GNOME/0000755000175000017500000000000012311344243016431 5ustar00meebeymeebey00000000000000smuxi-0.11/po-Frontend-GNOME/fi.po0000644000175000017500000012476012300202374017375 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Kalle Kaitala , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-05 19:06+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/smuxi/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "Smuxi-asetukset" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "Käytettävä lempinimi. Voit määritellä ylimääräisiä lempinimiä (eroteltuna välilyönnillä) joita käytetään varalla jos ensimmäinen vaihtoehto ei ole saatavilla. Oletuksena varalla käytetään $nick_ ja $nick__." #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "Lempinimi/et:" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Käyttäjänimi:" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "Oikea nimi:" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "Enkoodaus:" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "Käännä UTF-8 -merkit automaattisesti" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr "Yleiset" #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "Tyyppi:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "Isäntä:" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "Salasana:" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "Portti:" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Näytä salasana" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "Verkon välityspalvelin" #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "Yhdistyksenaikaiset komennot:" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "Käynnistyksenaikaiset komennot:" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr "Globaalit komennot" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "Y_hteys" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "Aikaleiman muoto:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "Puskuririvit:" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "Moottorin puskuririvit:" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "ss = sekunnit\nmm = minuutit\nhh = tunnit (01 - 12)\nHH = tunnit (00-23)\ntt = AM/PM\n\ndd = päivä\nMM = kuukausi\nyy/yyyy = vuosi" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "Pysyvyyden tyyppi:" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "Epävakaat puskuririvit:" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "Pysyvät puskuririvit:" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr "Viestipuskuri" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "Poista värit" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "Poista muotoilut" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "Poista UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "Näytä edistyneet asetukset" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr "Edistyneet" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "Yleiset" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "Ylhäällä" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "Pohjalla" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "Vasen" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "Oikea" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "Ei mitään" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " Välilehtien sijainti " #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "Korostaminen" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "Aktiviteetti" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "Ei aktiviteettia" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "Liity/Poistu/Moodi" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " Välilehtien värit " #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "Siirry automaattisesti uutena avautuvaan yksityiskeskusteluun" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "Siirry automaattisesti uutena avautuviin ryhmäkeskusteluihin" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "Täydennysmerkki:" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "Komentomerkki:" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "Komentohistorian koko:" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Bash-tyylinen täyttäminen" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " Syöttökenttä " #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "Syöte" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "Lempinimien värit" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr " Henkilölistan sijainti " #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "Ohita" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " Fontti " #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " Aihekentän sijainti " #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "Etuala" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "Tausta" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " Väri " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "_Kietaisumoodi:" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr " Chat " #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "Korosta sanat:" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "Piippaus korostuksen yhteydessä" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " Korostaminen " #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "Tuloste" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "Aktivoi" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "Näytä aina" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "Näytä kun ikkuna on minimoituna" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "Näytä kun ikkuna on suljettuna" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr " Huomioalueen ikoni " #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "Näytä Smuxi viestivalikossa" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr "Viestivalikko" #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "Näytä ilmoitusten ponnahdusikkunat" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr "Ilmoitusten ponnahdusikkunat" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "Ilmoitus" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "_Käyttöliittymä" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "_Palvelimet" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "_Suodattimet" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "Aktivoitu" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "Kirjoita suodatetut viestit lokiin" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "_Loki" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - Palvelin" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "Yhdistä palvelimeen automaattisesti käynnistyksen yhteydessä" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "Protokolla:" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "Verkko:" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "Isäntänimi:" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "IRC-keskustelu" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Smuxi IRC-asiakasohjelma" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "Juttele muiden kanssa IRC:ssä" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "kääntäjien tiedot" #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "Smuxi Web-sivu" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "Oops, tein sen taas..." #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi kaatui koska käsittelemätön poikkeus heitettiin!" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "Tässä on kasajälki, ole hyvä ja ilmoita tästä bugista!" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "_Raportoi Bugi" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "Moottoria ei löytynyt." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "Moottorinhallinta" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "Valitse Smuxi-moottori johon haluat yhdistää" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "Moottori:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "Käytä alhaisen kaistan tilaa" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "Paikallinen moottori" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "Ole hyvä ja valitse moottori!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "Käyttöliittymän versio ({0}) ei vastaa moottorin versiota ({1})!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "Tapahtui virhe yhdistettäessä moottoriin!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "Moottorin URL: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "Virhe: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Haluatko varmasti poistaa moottorin \"{0}\"?" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Aiot liittää {0} riviä. Haluatko varmasti jatkaa?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "Käyttöliittymän komennot" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Sori, tätä ei ole vielä sisällytetty!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "Merkki" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "Sana" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "Epävakaa" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "Pysyvä" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "Ei välityspalvelinta" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "Käyttöjärjestelmän oletus" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "Yhteys" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "Käyttöliittymä" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "Palvelimet" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "Suodattimet" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "Loki" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "Lempinimi-kenttä ei saa olla tyhjä." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Epäkelpo korostuksen regex: '{0}'. Syy: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "Nimi" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "Aihe" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "Ryhmäkeskusteluiden etsintää ilman suodatinta ei suositella. Tämä voi kestää hetken, tai ei välttämättä toimi ollenkaan. Haluatko jatkaa?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "Virhe haettaessa ryhmäkeskusteluiden listaa palvelimelta." #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "Yhteys moottoriin katkaistu." #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "Yhdistetään uudelleen moottoriin... (yritys {0})" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "Syy: {0}" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "Käyttöliittymä on menettänyt yhteyden palvelimeen. Haluatko yhdistää uudelleen nyt?" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "Uudelleenyhdistäminen palvelimeen on epäonnistunut. Haluatko yrittää uudelleen?" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "Palvelin on menettänyt yhteyden käyttöliittymään. Haluatko yhdistää uudelleen nyt?" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "Näytä" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protokolla" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Isäntänimi" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "Palvelinta ei voitu ladata:" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "Henkilö / Yksityinen" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "Ryhmä / Julkinen" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "Moottoriavustaja - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "Lisää Smuxi-moottori" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "Muokkaa Smuxi-moottoria" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "Todennustiedot" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "Voit nyt käyttää Smuxi-moottoria" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "Kiitos" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "Tämän niminen moottori on jo olemassa! Määritä toinen nimi." #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "Syötä liittyttävän keskustelun nimi" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "Tietoja Smuxista" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "Asetukset" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "Palvelinta ei voitu lisätä:" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Paikalliseen moottoriin vaihto katkaisee yhteytesi nykyiseen moottoriin! Haluatko varmasti tehdä tämän?" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Etämoottorin vaihto katkaisee yhteyden nykyiseen moottoriin! Haluatko varmasti tehdä tämän?" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "Päivä vaihtui päivästä {0} päivään {1}" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "Päivä vaihtui, {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Epäkelpo suodatuksen regex: '{0}'. Syy: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "Haluatko varmasti poistaa valitun suodattimen?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "Protokolla / Palvelin" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "Keskustelutyyppi" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "Normaali" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "Tapahtuma" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "Tyyppi" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "Kuvio" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "Alhaisen kaistan tila on päällä: Viestejä ei ole synkronoitu." #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "Näytä _valikkopalkki" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Noudetaan käyttäjälistaa {0}:lle..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "Valmis." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "Henkilö" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "Yhdistä uudelleen" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "Protokollakeskustelun sulkeminen sulkee myös kaikki siihen liitetyt keskustelut! Haluatko varmasti tehdä tämän?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "Haluatko varmasti poistaa valitun palvelimen?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "Palvelinta ei voitu muokata:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "Etsi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "_Etsi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "_Täsmää sijamuoto" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "Etsi _Takaperin" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "_Kietaise ympäri" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "Käytä _Säännöllisiä lausekkeita" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Etsi Ryhmäkeskustelua" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "_Nimi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "Liity" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "_Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "_Palvelin" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "_Keskustelu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "_Moottori" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "_Näytä" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "_Apua" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "Yhdistä" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "Avaa loki" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "_Asetukset" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "_Lopeta" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "_Yhdistä" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "_Lisää" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "_Hallinnoi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "_Avaa / Liity keskusteluun" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "_Etsi ryhmäkeskustelu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "P_uhdista kaikki aktiviteetti" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "_Seuraava keskustelu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "_Edellinen keskustelu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "_Sulje" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "_Käytä paikallista moottoria" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "_Lisää etämoottori" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "Vaihda etämoottoria" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "_Caret-moodi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "_Browse-moodi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "Näytä _Statuspalkki" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "_Kokoruudun tila" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "_Tietoja" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "Etsi ryhmäkeskustelu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "_Web-sivu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "Näytä _Työkalupalkki" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "Smuxi - Yhdistä" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - asetukset" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "Lempinimet:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "Välilehdet" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr " Käyttäjälistan sijainti " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " Kanava " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "Kanavasuodattimet" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "Käyttäjäsuodattimet" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "Käytä _SSH-tunnelia" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "Mahdollistaa SSH:n käytön yhteydessä. Tällä on pieni suorituskykyvaikutus, mutta tarjoaa lisäturvaa ja on pakollinen käytettäessä NAT:ia tai porttiperustaisia palomuureja" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "SSH-_Isäntä:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "DNS tai IP-osoite ja portti SSH-palvelimelle" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "_Portti:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "DNS tai IP-osoite ja portti Smuxi-palvelimeen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "_Smuxi-isäntä:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "_SSH-käyttäjänimi: (valinnainen)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "Käyttäjänimi jolla kirjaudutaan sisään SSH-palvelimeen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "_SSH-salasana: (valinnainen)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "Salasana jota käytetään SSH-palvelimelle kirjautumiseen. Tämä salasana on valinnainen jos SSH-avaintunnistautumista käytetään (katso alempaa)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "_SSH-avaintiedosto: (valinnainen)" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "Valitse tiedosto" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "Yksityinen SSH-avaintiedosto jota käytetään SSH-palvelimelle kirjautumiseen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "_Käyttäjänimi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "Käyttäjänimi jolla kirjaudutaan sisään Smuxi-palvelimeen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "_Salasana:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "Käyttäjän salasana" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "_Vahvista salasana:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "Toista salasana sen varmentamiseksi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "Tervetuloa Smuxi-moottorin säätöavustajaan.\nSinun tulee syöttää muutamia tietoja ennen kuin pääset käyttämään moottoria.\n\nValitse \"Eteenpäin\" aloittaaksesi." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "_Moottorin nimi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "Uuden moottorin profiilinimi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "_Oletusmoottori:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "Käytä uutena oletusmoottorina" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "Jos valittu, nykyinen moottori on oletuksena käytössä seuraavalla Smuxin käynnistyskerralla" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "Smuxi - Avaa keskustelu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "_Tyyppi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "_Isäntänimi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_Verkko:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "_Protokolla:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "Käytä salausta" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "Vahvista palvelimen sertifikaatti" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "_Yhdistyksenaikaiset komennot:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "_Jätä komennot suorittamatta" smuxi-0.11/po-Frontend-GNOME/zh_CN.po0000644000175000017500000012242312300202374017772 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Dean Lee , 2012-2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-13 08:04+0000\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/smuxi/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "Smuxi 偏好设置" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "要使用的昵称。您可以指定多个昵称(用空格分隔)作为首个选项不可用时的候选项。默认使用 $昵称_ 和 $昵称__ 作为候选项。" #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "昵称:" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "用户名:" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "真名:" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "编码:" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "自动转换 UTF-8 字符" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr "全局" #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "类型:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "主机:" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "密码:" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "端口:" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "显示密码" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "网络代理" #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "连接时命令:" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "启动时命令:" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr "全局命令" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "连接(_O)" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "时间戳格式:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "缓冲行数:" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "引擎缓冲行数:" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "ss = 秒数\nmm = 分数\nhh = 小时数 (01 - 12)\nHH = 小时数 (00 - 23)\ntt = AM/PM\n\ndd = day\nMM = month\nyy/yyyy = year" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "持久类型:" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "临时缓冲行数:" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "持久缓冲行数:" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr "信息缓冲" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "去除颜色" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "去除格式" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "去除 UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "显示高级设置" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr "高级" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "全局" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "顶部" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "底部" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "左边" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "右边" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "无" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " 标签位置 " #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "高亮" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "活动" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "无活动" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "加入/离开/模式" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " 标签颜色 " #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "自动切换到新打开的单人聊天" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "自动切换到新打开的群组聊天" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "树" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "完成字符:" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "命令字符:" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "命令历史数:" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Bash 式完成" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " 预留字段 " #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "输入" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "昵称颜色" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr " 成员列表位置 " #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "覆盖" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " 字体 " #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " 主题位置 " #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "前景" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "背景" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " 颜色 " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "_自动换行模式:" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr " 聊天 " #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "高亮单词:" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "高亮时鸣叫" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " 高亮 " #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "输出" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "启用" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "总是显示" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "当窗口最小化时显示" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "当窗口关闭时显示" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr " 通知区域图标 " #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "在消息菜单中显示 Smuxi" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr "消息菜单" #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "显示通知弹出" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr "通知弹出" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "通知" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "界面(_I)" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "服务器(_S)" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "过滤器(_F)" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "启用" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "记录经过滤的消息" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "历史(_L)" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - 服务器" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "启动时自动连接到服务器" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "协议:" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "网络:" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "主机名:" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "IRC 聊天" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Smuxi IRC 客户端" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "和 IRC 上的其他人聊天" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "Dean Lee " #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "Smuxi 网站" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "Oops,我又做了一次..." #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi 崩溃了,因为遇到了未处理的意外!" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "这是 stacktrace,请报告错误!" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "报告错误(_R)" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "引擎未找到。" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "引擎管理器" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "选择希望连接到的 Smuxi 引擎" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "引擎:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "使用低带宽模式" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "本地引擎" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "请选择一个引擎!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "您的前端版本 ({0}) 与引擎版本 ({1}) 不匹配!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "连接到引擎时出现了一个错误!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "引擎 URL: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "错误: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "您确实要删除引擎 \"{0}\" 吗?" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "您正在粘贴 {0} 行。是否继续?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "前端命令" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "抱歉,尚未实现!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "字符" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "单词" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "临时" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "持久" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "无代理" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "系统默认" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "连接" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "界面" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "服务器" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "过滤器" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "历史" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "昵称字段不能为空。" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "高亮正则表达式无效: '{0}'。原因: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "名称" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "主题" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "不建议不用过滤器搜索群组聊天。可能要耗费一些时间,也可能无法完成搜索。\n您是否打算继续?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "从服务器装载群组聊天列表出错。" #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "从引擎断开连接。" #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "正在重新连接到引擎... (第 {0} 次尝试)" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "原因: {0}" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "前端与服务器之间的连接已丢失。\n是否希望现在重新连接?" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "重新连接到服务器失败。\n是否重试?" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "服务器与前端之间的连接已丢失。\n是否希望现在重新连接?" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "显示" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "协议" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "主机名" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "无法加载服务器: " #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "成员 / 私聊" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "群组 / 公开" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "引擎助手 - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "添加 Smuxi 引擎" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "编辑 Smuxi 引擎" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "证书" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "现在您可以使用该 Smuxi 引擎了" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "谢谢您" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "已存在同名引擎! 请另外指定一个。" #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "输入要加入的聊天" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "关于 Smuxi" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "偏好设置" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "无法添加服务器: " #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "切换到本地引擎会将您与当前引擎断开!\n您确实大赛这样做吗?" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "切换到远程引擎会将您与当前引擎断开!\n您确实大赛这样做吗?" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "天数由 {0} 变为 {1}" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "日期已改为 {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "无效的过滤器正则表达式: '{0}'。原因: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "您确实要删除选中的过滤器?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "协议 / 服务器" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "聊天类型" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "普通" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "事件" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "类型" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "匹配" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "低带宽模式未启用: 未同步任何信息。" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "显示菜单栏(_M)" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "正在检索 {0} 的用户列表..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "完成。" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "成员" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "重新连接" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "关闭该协议将同时关闭所有连接到它的开放聊天!\n您确实希望这么做吗?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "您确实打算删除选中的服务器吗?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "无法编辑服务器: " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "查找" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "搜索(_S):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "匹配大小写(_M)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "向上搜索(_B)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "全文搜索(_W)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "使用正则表达式(_R)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - 查找群组聊天" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "名称(_N):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "加入" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "_Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "服务器(_S)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "聊天(_C)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "引擎(_E)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "视图(_V)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "帮助(_H)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "连接" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "打开聊天历史" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "偏好设置(_P)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "退出(_Q)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "连接(_C)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "添加(_A)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "管理(_M)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "打开(_O) / 加入聊天" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "查找群组聊天(_F)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "清除所有活动(_L)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "下一个聊天(_N)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "上一个聊天(_P)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "关闭(_C)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "使用本地引擎(_U)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "添加远程引擎(_A)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "切换远程引擎" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "插入模式(_C)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "浏览模式(_B)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "显示状态栏(_S)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "全屏(_F)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "关于(_A)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "查找群组聊天" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "网站(_W)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "显示工具栏(_T)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "Smuxi - 连接" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - 首选项" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "昵称:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "标签" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr " 用户列表位置 " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " 频道 " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "频道过滤器" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "用户过滤器" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "使用 _SSH 隧道" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "为连接启用 SSH。这对性能有一定影响,但更安全,且使用 NAT 或者基于端口的防火墙时必需" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "SS_H 主机:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "SSH 服务器的 DNS 或者 IP 地址与端口" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "端口(_P):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "Smuxi 服务器的 DNS 或者 IP 地址与端口" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "_Smuxi 主机:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "_SSH 用户名: (可选)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "用于登录 SSH 服务器的用户名" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "_SSH 密码: (可选)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "将用于登录 SSH 服务器的密码。若使用了 SSH 密钥(参见下方选项),则密码可选。" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "_SSH 密钥文件: (可选)" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "选择文件" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "SSH 私钥文件将用于登录 SSH 服务器" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "用户名(_U):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "将用于登录 Smuxi 服务器的用户名" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "密码(_P):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "用户密码" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "验证密码(_V):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "请再次输入密码以供验证" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "欢迎使用 Smuxi 引擎配置助手。\n在您能够使用引擎之前,需要输入一些信息。\n\n点击“前进”开始。" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "引擎名称(_E):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "新引擎配置文件的名称" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "默认引擎(_D):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "用作新的默认引擎" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "如果启用,Smuxi 下次启动时当前引擎将作为默认引擎" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "Smuxi - 开放聊天" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "_类型:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "_主机名:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_网络:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "_协议:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "使用加密" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "验证服务器证书" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "连接时命令(_O):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "忽略命令(_I)" smuxi-0.11/po-Frontend-GNOME/POTFILES.skip0000644000175000017500000000046612300202374020550 0ustar00meebeymeebey00000000000000glade/ src/Common/ src/Frontend/ src/Frontend-GNOME/obj/ src/Frontend-GNOME-IRC/ src/Frontend-GNOME-Twitter/ src/Frontend-GNOME-XMPP/ src/Frontend-STFL/ src/Frontend-SWF/ src/Frontend-WPF/ src/Engine/ src/Engine-Campfire/ src/Engine-IRC/ src/Engine-JabbR/ src/Engine-XMPP/ src/Engine-Twitter/ src/Server/ lib/ smuxi-0.11/po-Frontend-GNOME/tr.po0000644000175000017500000011034612300202374017417 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Mirco Bauer , 2012 # zeugma , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-05 19:06+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/smuxi/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Kullanıcı adı:" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr "Genel" #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "Tür:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "Parola:" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Parolayı Göster" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr "Küresel Komutlar" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "Gelişmiş Ayarları Göster" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "Genel" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " Yazı Tipi" #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "Arkaplan" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " Renk " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr " Sohbet " #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "Bildirim baloncuklarını göster" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "Bildiri" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "_Arayüz" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "_Sunucular" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - Sunucu" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "Ağ:" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Smuxi IRC İstemci" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "Umut Albayrak " #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "Smuxi Web sayfası" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "_Hata Bildir" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "Hata: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "Arayüz" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "Sunucular" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "İsim" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "Konu" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "Göster" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protokol" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "Teşekkürler" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "" #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "Smuxi Hakkında" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "Tercihler" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "Sohbet Türü" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "" #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "_İsim:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "_Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "_Sunucu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "_Sohbet" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "_Yardım" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "_Tercihler" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "_Ekle" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "_Kapat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "_Tam Ekran" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "_Hakkında" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "_Web sayfası" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - Tercihler" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " Kanal " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "_Kullanıcı adı:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "_Parola:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_Ağ:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "_Protokol:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "" smuxi-0.11/po-Frontend-GNOME/pt.po0000644000175000017500000011462012300202374017414 0ustar00meebeymeebey00000000000000# Translation of smuxi-frontend-gnome messages to Portuguese # Copyright (C) 2010 the smuxi's copyright holder # This file is distributed under the same license as the smuxi-frontend-gnome package. # # Américo Monteiro , 2010. # Pedro Ribeiro , 2012. # msgid "" msgstr "" "Project-Id-Version: smuxi-frontend-gnome \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-07-25 06:28+0200\n" "PO-Revision-Date: 2012-07-30 09:28+0100\n" "Last-Translator: Pedro Ribeiro \n" "Language-Team: Portuguese \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "Preferências de Smuxi" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "" "A alcunha a usar. Você pode especificar alcunhas extra (separadas por " "espaços) que serão usadas quando a primeira escolha não estiver disponível. " "Estão predefinidos como extras $alcunha_ e $alcunha__." #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "Alcunha(s):" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Nome de utilizador:" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "Nome Real:" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "Codificação:" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "General" msgstr "Geral" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "Type:" msgstr "Tipo:" #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Host:" msgstr "Máquina:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Password:" msgstr "Palavra-passe:" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Port:" msgstr "Porto:" #: ../glade/smuxi-frontend-gnome.glade.h:12 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Mostrar a palavra-passe" #: ../glade/smuxi-frontend-gnome.glade.h:13 msgid "Network Proxy" msgstr "Proxy de Rede" #: ../glade/smuxi-frontend-gnome.glade.h:14 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "Comandos Ao Ligar:" #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "Comandos Ao Arrancar:" #: ../glade/smuxi-frontend-gnome.glade.h:16 msgid "Global Commands" msgstr "Comandos Globais" #: ../glade/smuxi-frontend-gnome.glade.h:17 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "Ligaçã_o" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "Formato de Datas:" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "Linhas do Buffer:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "Linhas do Buffer do Motor:" #: ../glade/smuxi-frontend-gnome.glade.h:21 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "" "ss = segundos\n" "mm = minutos\n" "hh = horas (01 - 12)\n" "HH = horas (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = dia\n" "MM = mês\n" "yy/yyyy = ano" #: ../glade/smuxi-frontend-gnome.glade.h:30 msgid "Persistency Type:" msgstr "Tipo de Persistência:" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Volatile Buffer Lines:" msgstr "Linhas Voláteis do Buffer:" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Persistent Buffer Lines:" msgstr "Linhas Persistentes do Buffer:" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Message Buffer" msgstr "Buffers de Mensagem" #: ../glade/smuxi-frontend-gnome.glade.h:34 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "Remover Cores" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "Remover Formatações" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "Remover UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:37 msgid "Show Advanced Settings" msgstr "Mostrar Definições Avançadas" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Advanced" msgstr "Avançado" #: ../glade/smuxi-frontend-gnome.glade.h:39 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "Geral" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "Topo" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "Fundo" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "Esquerda" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "Direita" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "Nenhum" #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " Posição dos Separadores " #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "Destacar" #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "Actividade" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "Nenhuma Actividade" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "Juntar/Parte/Modo" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " Cores do Separador " #: ../glade/smuxi-frontend-gnome.glade.h:51 msgid "Automatically switch to newly opened person chats" msgstr "Mudar automaticamente para conversas pessoais recém iniciadas" #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened group chats" msgstr "Mudar automaticament para conversas de grupo recém iniciadas" #: ../glade/smuxi-frontend-gnome.glade.h:53 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "Separadores" #: ../glade/smuxi-frontend-gnome.glade.h:54 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "Caractere de Acabamento:" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "Caractere de Comandos:" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "Tamanho do Histórico de Comandos:" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Completar ao Estilo Bash" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " Campo de Entrada " #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "Entrada" #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "Cores da Alcunha" #: ../glade/smuxi-frontend-gnome.glade.h:61 msgid " Person List Position " msgstr " Posição da Lista de Pessoas " #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid "Override" msgstr "Sobrepor" #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid " Font " msgstr " Tipo de Letra " #: ../glade/smuxi-frontend-gnome.glade.h:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " Posição do Tópico " #: ../glade/smuxi-frontend-gnome.glade.h:65 msgid "Foreground" msgstr "Primeiro plano" #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Background" msgstr "Fundo" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid " Color " msgstr " Cor " #. This is a setting for character based line wrapping vs word based when showing messages #: ../glade/smuxi-frontend-gnome.glade.h:69 msgid "_Wrap Mode:" msgstr "Modo de _Wrap:" #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid " Chat " msgstr " Conversar " #: ../glade/smuxi-frontend-gnome.glade.h:71 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "Destacar palavras:" #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "Apitar no destaque" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " Destaque " #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "Saída" #: ../glade/smuxi-frontend-gnome.glade.h:75 msgid "Enable" msgstr "Activar" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Show always" msgstr "Mostrar sempre" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show when window is minimized" msgstr "Mostrar quando a janela é minimizada" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is closed" msgstr "Mostrar quando a janela é fechada" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid " Notification Area Icon " msgstr " Ícone da Área de Notificação " #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid "Show Smuxi in the messaging menu" msgstr "Mostrar Smuxi no menu de mensagens" #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Messaging Menu" msgstr "Menu de Mensagens" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Show notification popups" msgstr "Mostrar popups de notificação" #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Notification Popups" msgstr "Popups de Notificação" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification" msgstr "Notificação" #: ../glade/smuxi-frontend-gnome.glade.h:85 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "_Interface" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "_Servidores" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "_Filtros" #: ../glade/smuxi-frontend-gnome.glade.h:88 msgid "Enabled" msgstr "Activo" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Log Filtered Messages" msgstr "Registar Mensagens Filtradas" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "_Logging" msgstr "Registo em _Log" #: ../glade/smuxi-frontend-gnome.glade.h:91 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - Servidor" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "Ligar automaticamente ao servidor no inicio" #: ../glade/smuxi-frontend-gnome.glade.h:93 msgid "Protocol:" msgstr "Protocolo:" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Network:" msgstr "Rede:" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Hostname:" msgstr "Nome da máquina:" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "Conversação de IRC" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Cliente de IRC Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "Conversar com outra pessoa no IRC" #: ../src/Frontend-GNOME/AboutDialog.cs:61 msgid "translator-credits" msgstr "" "Américo Monteiro \n" "Pedro Ribeiro " #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "Smuxi Website" msgstr "Site web do Smuxi" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "Oops, já o fiz outra vez..." #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi crashou porque uma excepção não prevista foi lançada!" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "Aqui está informação de depuração, por favor reporte este bug!" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "_Reportar um Bug" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "Motor não encontrado." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "Gestor de Motores" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "Seleccionar o motor Smuxi ao qual deseja ligar-se" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "Motor:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "Usar Modo de Largura de Banda Estreita" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "Motor Local" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "Por favor seleccione um motor!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "A sua versão de frontend {0} não equivale à versão do motor ({1})!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "Ocorreu um erro ao ligar ao motor!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "URL do Motor: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "Erro: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Tem certeza que deseja apagar o motor \"{0}\"?" #: ../src/Frontend-GNOME/Entry.cs:430 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Você vai colar {0} linhas. Deseja continuar?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:538 msgid "Frontend Commands" msgstr "Comandos do Frontend" #: ../src/Frontend-GNOME/MainWindow.cs:253 msgid "_File" msgstr "_Ficheiro" #: ../src/Frontend-GNOME/MainWindow.cs:271 msgid "_Server" msgstr "_Servidor" #: ../src/Frontend-GNOME/MainWindow.cs:275 msgid "_Quick Connect" msgstr "Ligação _Rápida" #: ../src/Frontend-GNOME/MainWindow.cs:286 msgid "_Manage" msgstr "_Gerir" #: ../src/Frontend-GNOME/MainWindow.cs:293 msgid "_Chat" msgstr "_Conversação" #: ../src/Frontend-GNOME/MainWindow.cs:297 msgid "Open / Join Chat" msgstr "Iniciar / Juntar-se a uma Conversa" #: ../src/Frontend-GNOME/MainWindow.cs:308 msgid "_Find Group Chat" msgstr "_Procurar Grupo de Conversação" #: ../src/Frontend-GNOME/MainWindow.cs:314 msgid "C_lear All Activity" msgstr "_Limpar Toda a Actividade" #: ../src/Frontend-GNOME/MainWindow.cs:321 msgid "_Next Chat" msgstr "_Próxima Conversa" #: ../src/Frontend-GNOME/MainWindow.cs:332 msgid "_Previous Chat" msgstr "Conversa An_terior" #: ../src/Frontend-GNOME/MainWindow.cs:383 msgid "Open Log" msgstr "Abrir Registo" #: ../src/Frontend-GNOME/MainWindow.cs:398 msgid "_Engine" msgstr "_Motor" #: ../src/Frontend-GNOME/MainWindow.cs:402 msgid "_Use Local Engine" msgstr "_Usar Motor Local" #: ../src/Frontend-GNOME/MainWindow.cs:408 msgid "_Add Remote Engine" msgstr "_Adicionar Motor Remoto" #: ../src/Frontend-GNOME/MainWindow.cs:413 msgid "_Switch Remote Engine" msgstr "_Trocar Motor Remoto" #: ../src/Frontend-GNOME/MainWindow.cs:420 msgid "_View" msgstr "_Ver" #: ../src/Frontend-GNOME/MainWindow.cs:424 msgid "_Caret Mode" msgstr "Modo _Caret" #: ../src/Frontend-GNOME/MainWindow.cs:433 msgid "_Browse Mode" msgstr "Modo de _Explorador" #: ../src/Frontend-GNOME/MainWindow.cs:448 #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:734 msgid "Show _Menubar" msgstr "Mostrar Barra de _Menu" #: ../src/Frontend-GNOME/MainWindow.cs:453 msgid "Show _Status Bar" msgstr "Mostrar Barra de E_stado" #: ../src/Frontend-GNOME/MainWindow.cs:463 msgid "Show _Quick Join" msgstr "Mostrar Ligação _Rápida" #: ../src/Frontend-GNOME/MainWindow.cs:485 msgid "_Help" msgstr "_Ajuda" #: ../src/Frontend-GNOME/MainWindow.cs:797 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:225 msgid "Unable to add server: " msgstr "Incapaz de adicionar servidor: " #: ../src/Frontend-GNOME/MainWindow.cs:1151 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Mudar para o motor local irá desligá-lo do motor actual!\n" "Tem certeza que deseja fazer isto?" #: ../src/Frontend-GNOME/MainWindow.cs:1193 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Mudar o motor remoto irá desligá-lo do motor actual!\n" "Tem certeza que deseja fazer isto?" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Desculpe, ainda não implementado!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:179 msgid "Character" msgstr "Caractere" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:180 msgid "Word" msgstr "Palavra" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:197 msgid "Volatile" msgstr "Volátil" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:199 msgid "Persistent" msgstr "Persistente" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:222 msgid "No Proxy" msgstr "Nenhum Proxy" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:224 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:307 msgid "System Default" msgstr "Predefinição do Sistema" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:238 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "Ligação" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:242 msgid "Interface" msgstr "Interface" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:246 msgid "Servers" msgstr "Servidores" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:253 msgid "Filters" msgstr "Filtros" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:257 msgid "Logging" msgstr "Registar em log" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:655 msgid "Nicknames(s) field must not be empty." msgstr "O campo da(s) alcunha(s) não pode estar vazio." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:846 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Destaque regex inválido: '{0}'. Razão: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:271 msgid "Name" msgstr "Nome" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "Tópico" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may " "take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "" "Não é recomendado procurar por grupos de conversação sem um filtro. Isto " "pode demorar imenso, ou nem funcionar de todo.\n" "Deseja continuar?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "Erro ao obter a lista de grupos de conversação a partir do servidor." #: ../src/Frontend-GNOME/Frontend.cs:356 msgid "Disconnected from engine." msgstr "Desligado do motor." #: ../src/Frontend-GNOME/Frontend.cs:398 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "A ligar novamente ao motor... (tentativa {0})" #: ../src/Frontend-GNOME/Frontend.cs:496 #, csharp-format msgid "Cause: {0}" msgstr "Causa: {0}" #: ../src/Frontend-GNOME/Frontend.cs:622 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "" "O frontend perdeu a ligação ao servidor.\n" "Deseja ligar novamente agora?" #: ../src/Frontend-GNOME/Frontend.cs:641 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "" "A re-ligação ao servidor falhou.\n" "Deseja tentar de novo?" #: ../src/Frontend-GNOME/Frontend.cs:860 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "" "O servidor perdeu a ligação ao frontend.\n" "Deseja ligar novamente agora?" #: ../src/Frontend-GNOME/NotifyManager.cs:267 msgid "Show" msgstr "Mostrar" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:56 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:238 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protocolo" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:57 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Nome da máquina" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:160 msgid "Unable to load server: " msgstr "Incapaz de carregar servidor: " #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:244 msgid "Person / Private" msgstr "Pessoa / Privado" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:245 msgid "Group / Public" msgstr "Grupo / Público" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "Assistente de Motores - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "Adicionar Motor Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "Editar Motor Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "Credenciais" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "Agora você pode usar o motor Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "Obrigado" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "Já existe um motor com este nome! Por favor especifique um diferente." #: ../src/Frontend-GNOME/Views/MessageTextView.cs:261 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "Dia alterado de {0} para {1}" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:267 #, csharp-format msgid "Day changed to {0}" msgstr "Dia alterado para {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:123 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:133 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Filtro regex inválido: '{0}'. Razão: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:200 msgid "Are you sure you want to delete the selected filter?" msgstr "Tem certeza que deseja apagar o filtro seleccionado?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:246 msgid "Protocol / Server" msgstr "Protocolo / Servidor" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:253 msgid "Chat Type" msgstr "Tipo de Conversação" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:287 msgid "Normal" msgstr "Normal" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:288 msgid "Event" msgstr "Evento" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:295 msgid "Type" msgstr "Tipo" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:321 msgid "Pattern" msgstr "Padrão" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:508 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "Modo de Largura de Banda Estreita activo: mensagens não sincronizadas." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:260 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "A obter lista de utilizadores para {0}..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:294 msgid "done." msgstr "feito." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:305 msgid "Person" msgstr "Pessoa" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:139 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "" "Fechar a conversa de protocolo irá também fechar todas as conversações " "abertas ligadas a ele!\n" "Tem certeza que deseja fazer isto?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:187 msgid "Are you sure you want to delete the selected server?" msgstr "Tem certeza que deseja apagar o servidor seleccionado?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:243 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:277 msgid "Unable to edit server: " msgstr "Incapaz de editar o servidor: " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "Procurar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "_Procurar por:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "Caso de _Equivalência" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "Procurar para _Trás" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "En_volver" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "Usar Expressões _Regulares" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Procurar Grupo de Conversação" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "_Nome:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:54 msgid "Join Chat" msgstr "Juntar-se a uma Conversa" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Quick Connect" msgstr "Smuxi - Ligação Rápida" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - Preferências" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "Alcunhas:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr " Posição da Lista de Utilizadores " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " Canal " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "Filtros de Canais" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "Filtros de Utilizadores" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "Usar Túnel _SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "" "Activa o uso de SSH para a ligação. Isto tem um pequeno " "impacto na performance, mas é mais seguro e necessário quando se usa NAT ou " "firewalls baseadas em portos." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "_Máquina SSH:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "" "DNS or IP address and port of the SSH server" msgstr "DNS ou endereço IP e porto do servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "_Porto:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "" "DNS or IP address and port of the Smuxi server" msgstr "" "DNS ou endereço IP e porto do servidor Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "Máquina _Smuxi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "Nome de utilizador _SSH: (opcional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH server" msgstr "" "Nome de utilizador que será usado para login no " "servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "Palavra-passe de _SSH: (opcional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server. " "The password is optional if SSH key authorization is used (see below)." msgstr "" "Palavra-passe que será usada para login no servidor " "SSH. A palavra-passe é opcional se for usada uma chave de autenticação SSH " "(ver abaixo)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "Ficheiro de chave _SSH: (opcional)" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "Escolher um Ficheiro" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "" "Ficheiro de chave privada SSH que será usado para login " "no servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "Nome de _Utilizador:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "" "Nome de utilizador que será usado para login no " "servidor Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "_Palavra-passe:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "Palavra-passe do utilizador" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "_Verificar Palavra-passe:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "Repita a palavra-passe para verificação" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "" "Bem vindo ao Assistente de Configuração de Motores Smuxi.\n" "Você precisa indicar alguma informação antes de poder usar o motor.\n" "\n" "Clique em \"Avançar\" para começar." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "Nom_e do Motor:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "Nome de perfil do novo motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "Motor Pre_definido:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "Usar como novo motor predefinido" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next " "time Smuxi is started" msgstr "" "Se activo, o motor actual será o predefinido na próxima " "vez que o Smuxi for iniciado" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "Smuxi - Abrir Conversação" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "_Tipo:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "Nome de _Máquina:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_Rede:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "_Protocolo:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "Usar Encriptação" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "Validar Certificado do Servidor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "C_omandos Ao Ligar:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "Comandos de Ignorar:" #~ msgid "Unknown ChatType: {0}" #~ msgstr "Tipo de Conversação Desconhecida: {0}" smuxi-0.11/po-Frontend-GNOME/fa.po0000644000175000017500000011245612300202374017364 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Behrooz Amoozad , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-05 19:06+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Persian (http://www.transifex.com/projects/p/smuxi/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "نام مستعار, میتوانید نام های مستعار اضافه ای را نیز مشخص کنید(با فاصله از هم جدا کنید) تا در زمانی که انتخاب اول در دسترس نیست استفاده شوند. به صورت پیش فرض $نام_ و $نام__ به عنوان جانشین استفاده خواهند شد." #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "نام (های) مستعار:" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "نام حقیقی:" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "انکودینگ:" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr " کلی " #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "نوع:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "میزبان:" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "رمز:" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "درگاه:" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "نمایش رمز" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr " پراکسی شبکه " #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "دستورات زمان اتصال:" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "دستورات زمان اجرا:" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr " فرامین عمومی " #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "ارتباط" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "قالب زمان:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "نمایش تنظیمات پیشرفته" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "عمومی" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "بالا" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "پایین" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "چپ" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "راست" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "هیچ" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " موقعیت تب ها " #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "برجسته کردن" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "فعالیت" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "بدون فعالیت" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "چسبیدن/جدا شدن/حالت" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " رنگ تب ها " #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "کاراکتر تکمیل کردن:" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "کاراکتر فرمان:" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "اندازه تاریخچه دستور:" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "تکمیل کردن مانند bash" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " فیلد ورودی " #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "ورودی" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "رنگ نام های مستعار" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr " موقعیت لیست افراد " #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " قلم " #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " موقعیت تاپیک " #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "رنگ رو" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "رنگ زمینه" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " رنگ " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr " چت " #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "کلمات برجسته:" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " برجسته نمایی " #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "خروجی" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "فعال کردن" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "همیشه نمایش بده" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr " علامت ناحیه هشدار " #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "نمایش smuxi در منو پیام رسانی" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr " منو پیغام رسانی " #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "نمایش کادر های هشدار" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr " کادر های هشدار " #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "هشدار" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "فعال" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "ثبت پیغام های فیلتر شده" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "وصل شدن خودکار به سرویس دهنده هنگام شروع" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "پروتوکل:" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "شبکه:" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "نام میزبان:" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "" #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "" #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "" #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "" smuxi-0.11/po-Frontend-GNOME/fr.po0000644000175000017500000012616612300202374017410 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Clément Bourgeois , 2011-2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-13 21:21+0000\n" "Last-Translator: Clément Bourgeois \n" "Language-Team: French (http://www.transifex.com/projects/p/smuxi/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "Préférences de Smuxi" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "Le surnom est déjà en cours d'utilisation. Vous pouvez spécifier plus d'un seul surnom, séparés par des espaces. Ceux ci seront utilisés comme solution de repli si le premier surnom n'est pas disponible. Par défaut, $nick et $nick__ sont utilisés." #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "Surnom(s) :" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Nom d'utilisateur :" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "Nom réel :" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "Encodage :" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "Convertir automatiquement les caractères UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr "Général" #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "Type :" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "Nom d'hôte :" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "Mot de passe :" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "Port :" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Afficher le mot de passe" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "Proxy réseau" #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "Commandes de connexion :" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "Commandes de démarrage :" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr "Commandes globales" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "C_onnexion" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "Format temporel :" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "Lignes du tampon :" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "Lignes du tampon moteur" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "ss = secondes\nmm = minutes\nhh = heures (format 01 - 12)\nHH = heures (format 00 - 23)\ntt = AM/PM\n\ndd = jour\nMM = mois\nyy/yyyy = année" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "Type de persistance :" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "Lignes de tampon volatiles" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "Lignes de tampon sauvegardées :" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr "Tampon de messages" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "Ignorer les couleurs" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "Ignorer le formatage" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "Ignorer l'UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "Afficher les reglages avancés" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr "Avancé" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "Général" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "Haut" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "Bas" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "Gauche" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "Droite" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "Aucun" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " Position des onglets " #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "Surligner" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "Activité" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "Aucune activité" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "Join/Part/Mode" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " Couleur des onglets " #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "Ouvrir automatiquement les nouveaux chats de personne" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "Ouvrir automatiquement les nouveaux chats de groupe" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "Arbre" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "Caractère de complétion :" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "Caractère des commandes :" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "Taille de l'historique des commandes :" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Complétion style Bash" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " Champ d'entrée " #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "Entrée" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "Couleur du surnom" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr " Position de la liste des utilisateurs " #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "Ignorer" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " Police " #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " Position du sujet " #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "Texte" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "Arrière plan" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " Couleur " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "Mode _circulaire :" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr " Discussion " #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "Mots surlignés :" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "Émettre un son en cas de surlignage" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " Surlignement " #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "Sortie" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "Activer" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "Toujours montrer" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "Montrer quand la fenêtre est minimisée" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "Montrer quand la fenêtre est fermée" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr " Icône de l'aire de notification " #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "Afficher Smuxi dans le menu messagerie" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr "Menu de messagerie" #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "Afficher les popups de notification" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr "Popups de notification" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "Notification" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "_Interface" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "_Serveurs" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "_Filtres" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "Activé" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "Journaliser les messages filtrés" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "_Journalisation" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - Serveur" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "Se connecter automatiquement au serveur à chaque démarrage" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "Protocole :" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "Réseau :" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "Nom d'hôte" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "Chat IRC" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Client IRC Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "Chatter sur IRC avec d'autres gens" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "Clément Bourgeois " #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "Site web de Smuxi" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "OoOps, boulette..." #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi a planté en raison de la levée d'une exception non gérée !" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "Voici la pile d'appels, envoyez le rapport de bug s'il-vous-plaît ! " #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "_Rapporter un bogue" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "Moteur non trouvé." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "Gestionnaire de moteurs" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "Sélectionnez le moteur Smuxi auquel vous voulez vous connecter" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "Moteur :" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "Utiliser le mode bande passante faible" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "Moteur local" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "Sélectionnez un moteur s'il vous plaît !" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "Votre version de l'interface utilisateur ({0}) ne correspond pas à celle du moteur ({1}) !" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "Une erreur est survenue durant la connexion au moteur !" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "URL du moteur : {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "Erreur : {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Êtes vous sûr(e) de vouloir supprimer le moteur \"{0}\" ?" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Vous vous apprêtez à coller {0} lignes de texte, êtes vous sûr(e) de vouloir continuer ?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "Commandes Frontend" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Désolé, fonctionnalité pas encore implémentée !" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "Caractère" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "Mot" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "Volatile" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "Persistant" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "Pas de proxy" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "Défaut du système" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "Connexion" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "Interface" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "Serveurs" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "Filtres" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "Journalisation" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "Le champ surnom(s) ne doit pas être vide." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Expression régulière de surlignage invalide '{0}'. Raison : {1} " #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "Nom" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "Sujet" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "Chercher des groupes de discussion" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "Erreur durant la récupération de la liste des groupes de discussion du serveur." #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "Déconnecté du moteur." #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "Reconnexion au moteur... (essai {0})" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "Cause : {0}" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "Le serveur a perdu la connexion a l'interface.\nVoulez-vous vous reconnecter maintenant ?" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "La reconnexion au serveur a échoué.\nVoulez-vous vous reconnecter maintenant ?" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "Le serveur a perdu la connexion à l'interface.\nVoulez-vous vous reconnecter maintenant ?" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "Afficher" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protocole" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Nom d'hôte" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "Impossible de charger le serveur :" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "Personne / Privé" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "Groupe / Public" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "Assistant moteur - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "Ajouter un moteur Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "Editer un moteur Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "Autorisations" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "Vous êtes prêt à utiliser le moteur Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "Merci" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "Un moteur avec ce nom éxiste deja ! Veuillez en spécifier un autre." #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "Entrez le nom du chat à rejoindre" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "À propos de Smuxi" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "Préférences" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "Impossible d'ajouter le serveur :" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Changer de moteur vers le moteur local va vous déconnecter du moteur actuel !\nÊtes vous sûr(e) de vouloir continuer ?" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Changer de moteur pour un moteur distant va vous déconnecter du moteur actuel !\nÊtes vous sûr(e) de vouloir continuer ?" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "Jour changé de {0} à {1}" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "Jour changé à {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Expression régulière de filtrage invalide '{0}'. Raison : {1} " #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "Êtes vous sûr(e) de vouloir supprimer le filtre sélectionné ?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "Protocole / Serveur" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "Type de chat" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "Normal" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "Evenement" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "Type :" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "Motif" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "Mode faible bande passante activé : aucun message synchronisé." #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "Afficher la barre de _menus" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Téléchargement de la liste des utilisateurs pour {0}..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "terminé." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "Personne" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "Reconnecter" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "Fermer la fenêtre de chat du protocole va aussi fermer toutes discussions connectées sur celui-ci !\nÊtes vous sûr(e) de vouloir continuer ?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "Êtes vous sûr(e) de vouloir supprimer le serveur sélectionné ?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "Impossible d'editer le serveur :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "Rechercher" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "_Terme de recherche :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "_Respecter la casse" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "Recherche en _arrière" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "Recherche _cyclique" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "Utiliser des _expression régulières" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Trouver un groupe de discussion" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "_Nom :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "Rejoindre" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "_Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "_Serveur" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "_Discussion" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "_Moteur" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "_Vue" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "_Aide" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "Connexion" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "Ouvrir le journal" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "_Préférences" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "_Quitter" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "Connexion" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "_Ajouter" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "_Gestion" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "_Ouvrir / Rejoindre chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "_Rechercher le groupe de discussion" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "_Supprimer toute activité" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "Discussion _suivante" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "Discussion _précédente" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "_Fermer" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "_Utiliser le moteur local" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "_Ajouter un moteur distant" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "Changer de moteur distant" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "Mode _curseur" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "Mode _navigateur" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "Afficher la barre de status" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "_Plein écran" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "_À propos" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "Rechercher le groupe de discussion" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "Site web de Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "Afficher la barre d'ou_tils" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "Smuxi - Connexion" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - Préférences" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "Surnoms :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "Onglets" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr " Position de la liste d'utilisateurs " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " Canal " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "Filtres de canaux" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "Filtres d'utilisateurs" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "Utiliser un tunnel _SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "Active l'utilisation de SSH pour la connexion. Ceci a un leger impact négatif sur les performances, mais améliore la sécurité et est parfois nécéssaire en cas d'utilisation d'un systeme NAT ou d'un firewall régi par ports" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "SSH _Hôte:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "Adresse IP ou DNS et port du serveur SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "_Port" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "Adresse IP ou DNS et port du serveur Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "_Smuxi Hôte:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "Nom d'utilisateur _SSH (optionnel) :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "Nom d'utilisateur qui sera utilisé pour l'enregistrement auprès du moteur Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "Mot de passe _SSH (optionnel) :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "Le mot de passe qui sera utilisé pour la connexion au serveur SSH. Le mot de passe est optionnel si l'authentification par fichier de clé SSH est activé (voir ci-dessous)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "Fichier de clé_SSH : (optionnel)" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "Choisissez un fichier" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "Le fichier de clé SSH sera utilisé pour l'authentification sur le serveur SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "_Nom d'utilisateur :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "Nom d'utilisateur qui sera utilisé pour l'enregistrement auprès du moteur Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "Mot de _passe :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "Mot de passe de l'utilisateur" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "_Vérification du mot de passe :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "Retapez le mot de passe pour vérification" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "Bienvenue sur l'assistant de configuration du moteur Smuxi.\nVous devez entrer plusieurs informations avant de pouvoir utiliser le moteur.\n\nCliquez sur \"Suivant\" pour commencer." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "Nom du _moteur :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "Nom du profil pour l'entrée du nouveau moteur" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "Moteur par _défaut :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "Utiliser comme moteur par défaut" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "Activé, cette fonctionnalité rend le moteur courant par défaut au prochain démarrage de Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "Smuxi - Ouvrir un chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "_Type :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "_Nom d'hôte :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_Réseau :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "_Protocole :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "Utiliser le chiffrement" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "Valider le certificat du serveur" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "Commandes de _connexion :" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "_Ignorer les commandes" smuxi-0.11/po-Frontend-GNOME/sv.po0000644000175000017500000012433612300202374017426 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # flugsio , 2013 # flugsio , 2011, 2012 # Martin Bagge , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-10 16:50+0000\n" "Last-Translator: Martin Bagge \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/smuxi/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sv\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "Alternativ för Smuxi" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "Smeknamn att använda. Du kan ange flera smeknamn (separerade med mellanslag) som ska användas som alternativ om det första valet inte är ledigt. Standardalternativ är $nick_ och $nick__." #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "Smeknamn:" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Användarnamn:" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "Riktigt namn:" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "Kodning:" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "Konvertera UTF-8 tecken automatiskt" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr "Allmänt" #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "Typ:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "Värd:" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "Lösenord:" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "Port:" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Visa lösenord" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "Nätverksproxy" #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "Kommando vid anslutning:" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "Kommando vid uppstart:" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr "Globala kommandon" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "_Anslutning" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "Format för tidsstämpel:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "Buffrade rader:" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "Buffrade rader i motorn" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "ss = sekunder\nmm = minuter\nhh = timmar (01 - 12)\nHH = timmar (00 - 23)\ntt = AM/PM\n\ndd = dag\nMM = månad\nyy/yyyy = år" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "Typ av persistens:" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "Flyktiga buffer-rader:" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "Beständiga buffer-rader:" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr "Meddelande-buffer" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "Kasta färger" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "Kasta formateringar" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "Kasta UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "Visa avancerade inställningar" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr "Avancerat" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "Allmänt" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "Topp" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "Botten" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "Vänster" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "Höger" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "Ingen" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " Position för flikar " #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "Notifiera" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "Aktivitet" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "Ingen aktivitet" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "Anslut/Lämna/Användartillstånd" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " Flikfärg " #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "Byt automatiskt till nyligen öppnade person-chattar" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "Byt automatiskt till nyligen öppnade grupp-chattar" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "Träd" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "Kompletteringstecken:" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "Kommandotecken:" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "Antal kommandon i historik:" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Bash-liknande komplettering" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " Inmatningsfält " #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "Indata" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "Färg på smekanmn" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr " Position för personlista " #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "ÅSidosätt" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " Teckensnitt " #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " Position för rubrik " #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "Förgrund" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "Bakgrund" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " Färg " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "_Läge för radbrytning:" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr " Chatt " #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "Ord som orsakar notifiering:" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "Pip vid notifiering" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " Notifiering " #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "Utdata" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "Aktivera" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "Visa alltid" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "Visa när fönster är minimerat" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "Visa när fönster är stängt" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr " Ikon i notifieringsområdet " #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "Visa Smuxi i meddelandemenyn" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr "Meddelandemenu" #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "Visa notifieringsmeddelanden" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr "Notifieringsmeddelanden" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "Notifiering" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "_Gränssnitt" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "_Servrar" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "_Filter" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "Aktiverad" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "Logga filtrerade meddelanden" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "_Loggning" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - Server" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "Anslut automatiskt till server vid uppstart" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "Protokoll:" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "Nätverk:" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "Värdnamn:" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "IRC chatt" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Smuxi IRC-klient" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "Chatta med andra människor på IRC" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "Martin Bagge " #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "Smuxis webbplats" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "Oj. Nu gjorde vi sådär igen ja..." #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi krashade på grund av ett ohanterat fel." #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "Ta med den här utskriften från kraschen i felrapporten!" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "_Rapportera fel" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "Motor hittades ej." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "Motorhanterare" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "Ange vilken Smuximotor du vill ansluta till" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "Motor:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "Använd låg bandbreddsläge" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "Lokal motor:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "Välj en motor!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "Versionen för din framdel ({0}) stämmer inte överrens med motorns version ({1})!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "Ett fel uppstod vid anslutning till motorn!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "URL till motorn: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "Fel: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Är du säker på att du vill radera motorn \"{0}\"?" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Du kommer att klistra in {0} rader. Vill du fortsätta?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "Kommandon för framdelen" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Ursäkta, detta är inte implementerat än!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "Tecken" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "Ord" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "Flyktig" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "Beständig" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "Ingen Proxy" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "Systemstandard" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "Anslutning" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "Gränssnitt." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "Servrar" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "Filter" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "Loggning" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "Fältet för smeknamn kan inte lämnas tomt." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Ogiltigt mönster för notifiering: \"{0}\". Anledning: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "Namn" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "Rubrik" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "Sökning efter gruppchattar utan att använda filter är inte rekomenderat. Det kan ta lång tid eller inte fungera alls.\nVill du verkligen fortsätta?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "Fel vid hämtning av lista för gruppchattar från servern." #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "Frånkopplad från motorn." #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "Återkopplar till motorn... (försök {0})" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "Anledning: {0}" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "Framdelen tappade anslutningen till server.\nVill du återansluta?" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "Återanslutningsförsöket fungerade inte.\nVill du försöka igen?" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "Servern har tappat anslutningen till framdelen.\nVill du återansluta?" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "Visa" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protokoll" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Värdnamn" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "Kan inte ladda server:" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "Person / Privat" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "Grupp / Publikt" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "Motorassistent - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "Lägg till Smuxi-motor" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "Redigera Smuxi-motor" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "Inloggningsuppgifter" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "Nu kan du använda Smuxi-motorn" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "Tack" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "En motor med detta namn finns redan. Ange ett annat." #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "Ange vilken chat att ansluta till" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "Om Smuxi" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "Alternativ" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "Kan inte lägga till server:" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Byte till lokal motor kommer att koppla bort dig från den aktuella motorn!\nÄr du säker på att du vill göra detta?" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Byte av fjärrmotor kommer att koppla bort dig från den aktuella motorn!\nÄr du säker på att du vill göra detta?" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "Dag ändrades från {0} till {1}" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "Dygnsskifte, {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Ogiltigt filtermänster: \"{0}\". Anledning: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "Är du säker på att du vill radera det valda filtret?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "Protokoll / Server" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "Chatt-typ" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "Normal" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "Händelse" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "Typ" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "Mönster" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "Låg bandbreddsläge är aktiverat: inga meddelanden synkroniserade." #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "Visa Menu" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Hämtar användarlistan för {0}..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "klar" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "Person" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "Återanslut" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "När protokollchatten stängs kommer även alla öppna chattar som är anslutna till den att stängas!\nÄr du säker på att du vill göra detta?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "Är du säker på att du vill radera den valda servern?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "Kan inte redigera server:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "Sök" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "_Leta efter:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "S_kiftlägeskänslig" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "Sök bakåt" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "Börja _om från början" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "Använd _reguljära uttryck" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Hitta gruppchatt" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "_Namn:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "Anslut" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "_Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "_Server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "_Chatt" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "_Motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "_Visa" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "_Hjälp" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "Anslut" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "Öppna logg" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "A_lternativ" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "A_vsluta" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "_Anslut" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "_Lägg till" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "_Hantera" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "_Öppna / Anslut till chatt" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "_Hitta gruppchatt" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "_Rensa all aktivitet" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "_Nästa chatt" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "_Föregående chatt" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "S_täng" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "_Använd lokal motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "_Lägg till fjärrmotor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "Byt fjärrmotor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "_Markörläge" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "Visningsläge" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "Visa _Statusbar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "_Fullskärm" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "_Om" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "Hitta grupp-chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "_Webbplats" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "Visa _Verktygsfält" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "Smuxi - Anslut" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - Egenskaper" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "Smeknamn:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "Flikar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr " Position för användarlista" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " Kanal" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "Kanalfilter" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "Användarfilter" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "_Använd SSH-Tunnel" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "Aktiverar användning av SSH för anslutningen. Detta kan innebära en liten negativ inverkan på hastigheten men är säkrare och krävs när NAT eller port-baserade brändväggar används" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "SS_H-värd:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "DNS eller IP-adress och port för SSH-servern" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "_Port" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "DNS eller IP-adress och port för Smuxi-servern" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "Smuxi-_värd;" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "_SSH-avnändarnamn: (valbart)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "Användarnamn som ska användas för att logga in i SSH-servern" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "SSH-_lösenord: (valbart)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "Lösenord som kommer användas att logga in till SSH-servern. Lösenordet är valfritt om SSH-nyckel-auktorisation används (se nedan)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "_SSH-nyckelfil: (valfri)" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "Välj en fil" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "Privat SSH-nyckelfil att användas för att logga in på SSH-servern" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "_Användarnamn:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "Användarnamnet som ska användas för att logga in i Smuxi-server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "_Lösenord:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "Lösenord för användaren" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "_Verifiera lösenord:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "Upprepa lösenordet för att verifiera det" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "Välkommen till inställningsdelen för Smuximotorn.\nDu behöver ange lite information innan du kan börja använda motorn.\n\nKlicka \"Nästa\" för att böja." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "_Motornamn:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "Profilnamn för den nya motorn" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "_Standardmotor:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "Använd som ny standardmotor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "Om detta väljs kommer den aktuella motorn att bli standardmotor nästa gång Smuxi startas" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "Smuxi - Öppen chatt" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "_Typ:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "_Värdnamn:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_Nätverk:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "P_rotokoll:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "Använd kryptering" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "Validera serverns certifikat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "_Kommando vid anslutning:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "Kommando att _ignorera" smuxi-0.11/po-Frontend-GNOME/en_GB.po0000644000175000017500000010672012300202374017745 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2009 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # Ryan Smith-Evans , 2008. # msgid "" msgstr "" "Project-Id-Version: 0.6.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-08-10 19:14+0200\n" "PO-Revision-Date: 2010-01-09 00:18+0100\n" "Last-Translator: Ryan Smith-Evans \n" "Language-Team: English-GB \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid " Chat " msgstr " Chat " #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid " Color " msgstr " Colour " #: ../glade/smuxi-frontend-gnome.glade.h:3 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1364 msgid " Entry Field " msgstr " Entry Field " #: ../glade/smuxi-frontend-gnome.glade.h:4 msgid " Font " msgstr " Font " #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1694 msgid " Highlighting " msgstr " Highlighting " #: ../glade/smuxi-frontend-gnome.glade.h:6 msgid " Notification Area Icon " msgstr " Notification Area Icon " #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid " Person List Position " msgstr " Person List Position " #: ../glade/smuxi-frontend-gnome.glade.h:8 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1201 msgid " Tab Colors " msgstr " Tab Colours " #: ../glade/smuxi-frontend-gnome.glade.h:9 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1102 msgid " Tabs Position " msgstr " Tabs Position " #: ../glade/smuxi-frontend-gnome.glade.h:10 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1507 msgid " Topic Position " msgstr " Topic Position " #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Messaging Menu" msgstr "Messaging Menu" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Notification Popups" msgstr " Notification Area Icon " #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1153 msgid "Activity" msgstr "Activity" #: ../glade/smuxi-frontend-gnome.glade.h:14 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:99 msgid "Automatically connect to server at startup" msgstr "Automatically connect to server at startup" #: ../glade/smuxi-frontend-gnome.glade.h:15 msgid "Background" msgstr "Background" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1352 msgid "Bash-Style Completion" msgstr "Bash-Style Completion" #: ../glade/smuxi-frontend-gnome.glade.h:17 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1682 msgid "Beep on highlight" msgstr "Beep on highlight" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:972 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:994 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1453 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1478 msgid "Bottom" msgstr "Bottom" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:738 msgid "Buffer Lines:" msgstr "Buffer Lines:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:663 msgid "C_onnection" msgstr "C_onnection" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1304 msgid "Command Character:" msgstr "Command Character:" #: ../glade/smuxi-frontend-gnome.glade.h:22 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1327 msgid "Command History Size:" msgstr "Command History Size:" #: ../glade/smuxi-frontend-gnome.glade.h:23 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1284 msgid "Completion Character:" msgstr "Completion Character:" #: ../glade/smuxi-frontend-gnome.glade.h:24 msgid "Enable" msgstr "Enable" #: ../glade/smuxi-frontend-gnome.glade.h:25 msgid "Enabled" msgstr "Enable" #: ../glade/smuxi-frontend-gnome.glade.h:26 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:551 msgid "Encoding:" msgstr "Encoding:" #: ../glade/smuxi-frontend-gnome.glade.h:27 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:761 msgid "Engine Buffer Lines:" msgstr "Engine Buffer Lines:" #: ../glade/smuxi-frontend-gnome.glade.h:28 msgid "Foreground" msgstr "Foreground" #: ../glade/smuxi-frontend-gnome.glade.h:29 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:917 msgid "General" msgstr "General" #: ../glade/smuxi-frontend-gnome.glade.h:30 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1173 msgid "Highlight" msgstr "Highlight" #: ../glade/smuxi-frontend-gnome.glade.h:31 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1658 msgid "Highlight words:" msgstr "Highlight words:" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Hostname:" msgstr "Hostname:" #: ../glade/smuxi-frontend-gnome.glade.h:33 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1373 msgid "Input" msgstr "Input" #: ../glade/smuxi-frontend-gnome.glade.h:34 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1163 msgid "Join/Part/Mode" msgstr "Join/Part/Mode" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1008 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1033 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1527 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1553 msgid "Left" msgstr "Left" #: ../glade/smuxi-frontend-gnome.glade.h:36 msgid "Log Filtered Messages" msgstr "Log Filtered Messages" #: ../glade/smuxi-frontend-gnome.glade.h:37 msgid "Network:" msgstr "Network:" #: ../glade/smuxi-frontend-gnome.glade.h:38 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1394 msgid "Nick Colors" msgstr "Nick Colours" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Nickname(s):" msgstr "Nickname(s):" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1145 msgid "No Activity" msgstr "No Activity" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1088 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1493 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1608 msgid "None" msgstr "None" #: ../glade/smuxi-frontend-gnome.glade.h:42 msgid "Notification" msgstr "Notification" #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:573 msgid "On Connect Commands:" msgstr "On Connect Commands:" #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:619 msgid "On Startup Commands:" msgstr "On Start-up Commands:" #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1706 msgid "Output" msgstr "Output" #: ../glade/smuxi-frontend-gnome.glade.h:46 msgid "Override" msgstr "Override" #: ../glade/smuxi-frontend-gnome.glade.h:47 msgid "Password:" msgstr "Password" #: ../glade/smuxi-frontend-gnome.glade.h:48 msgid "Port:" msgstr "Port" #: ../glade/smuxi-frontend-gnome.glade.h:49 msgid "Protocol:" msgstr "Protocol" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:530 msgid "Realname:" msgstr "Real Name" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1048 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1073 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1568 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1593 msgid "Right" msgstr "Right" #: ../glade/smuxi-frontend-gnome.glade.h:52 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:187 msgid "Show Password" msgstr "Show Password" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Show Smuxi in the messaging menu" msgstr "Show Smuxi in the messaging menu" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Show always" msgstr "Show always" #: ../glade/smuxi-frontend-gnome.glade.h:55 msgid "Show notification popups" msgstr "Show notification popups" #: ../glade/smuxi-frontend-gnome.glade.h:56 msgid "Show when window is closed" msgstr "Show when window is closed" #: ../glade/smuxi-frontend-gnome.glade.h:57 msgid "Show when window is minimized" msgstr "Show when window is minimized" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:398 msgid "Smuxi - Preferences" msgstr "Smuxi - Preferences" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:18 msgid "Smuxi - Server" msgstr "Smuxi - Server" #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:820 msgid "Strip Colors" msgstr "Strip Colours" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:859 msgid "Strip Formattings" msgstr "Strip Formatting" #: ../glade/smuxi-frontend-gnome.glade.h:62 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:899 msgid "Strip UTF-8" msgstr "Strip UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:63 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1214 msgid "Tabs" msgstr "Tabs" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid "The nickname to use. You can specify extra nicknames (separated by spaces) which will be used as fallbacks when the first choice is not available. By default $nick_ and $nick__ will be used as fallbacks." msgstr "The nickname used. You can specify more than one nickname, separated by a space, which will be used as fall-back when the nickname was not available. By default $nick_ and $nick__ will be used as a fall-back." #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:718 msgid "Timestamp Format:" msgstr "Time-stamp Format:" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:66 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:935 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:959 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1412 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1438 msgid "Top" msgstr "Top" #: ../glade/smuxi-frontend-gnome.glade.h:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:507 msgid "Username:" msgstr "Username:" #: ../glade/smuxi-frontend-gnome.glade.h:68 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1873 msgid "_Filters" msgstr "_Filters" #: ../glade/smuxi-frontend-gnome.glade.h:69 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1715 msgid "_Interface" msgstr "_Interface" #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Logging" msgstr "_Logging" #: ../glade/smuxi-frontend-gnome.glade.h:71 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1781 msgid "_Servers" msgstr "_Servers" #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:73 msgid "_Wrap Mode:" msgstr "_Wrap Mode" #: ../glade/smuxi-frontend-gnome.glade.h:74 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "" "ss = second\n" "mm = minute\n" "hh = hour (1 - 12)\n" "HH = hour (0 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 #, fuzzy msgid "Chat with other people on IRC" msgstr "Chat with other people on IRC" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 #, fuzzy msgid "IRC Chat" msgstr "_Chat" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 #, fuzzy msgid "Smuxi IRC Client" msgstr "Smuxi - Open Chat" #: ../src/Frontend-GNOME/AboutDialog.cs:58 msgid "translator-credits" msgstr "Ryan Smith-Evans " #: ../src/Frontend-GNOME/AboutDialog.cs:61 msgid "Smuxi Website" msgstr "Smuxi Website" #: ../src/Frontend-GNOME/CrashDialog.cs:44 msgid "Oops, I did it again..." msgstr "Oops, I did it again..." #: ../src/Frontend-GNOME/CrashDialog.cs:57 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi crashed because an unhandled exception was thrown!" #: ../src/Frontend-GNOME/CrashDialog.cs:61 msgid "Here is the stacktrace, please report this bug!" msgstr "Here is the stacktrace, please report this bug!" #: ../src/Frontend-GNOME/CrashDialog.cs:81 msgid "_Report Bug" msgstr "_Report Bug" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:61 msgid "Engine Manager" msgstr "Engine Manager" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:68 msgid "_Connect" msgstr "_Connect" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:84 msgid "Select which Smuxi engine you want to connect to" msgstr "Select which Smuxi engine you want to connect to" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:90 msgid "Engine:" msgstr "Engine:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:116 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:176 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:353 msgid "Local Engine" msgstr "Local Engine" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:168 msgid "Please select an engine!" msgstr "Please select an engine!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:189 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "Your front-end version ({0}) is not matching the engine version ({1})!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:216 msgid "An error occurred while connecting to the engine!" msgstr "Error occurred while connecting to the engine!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:217 #, csharp-format msgid "Engine URL: {0}" msgstr "Engine URL: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:220 #, csharp-format msgid "Error: {0}" msgstr "Error: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:290 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Are you sure you want to delete the engine \"{0}\"?" #: ../src/Frontend-GNOME/Entry.cs:412 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "You are going to paste {0} lines. Do you want to continue?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:515 msgid "Frontend Commands" msgstr "Front-end Commands" #: ../src/Frontend-GNOME/MainWindow.cs:193 msgid "_File" msgstr "_File" #: ../src/Frontend-GNOME/MainWindow.cs:209 msgid "_Server" msgstr "_Server" #: ../src/Frontend-GNOME/MainWindow.cs:213 msgid "_Quick Connect" msgstr "_Quick Connect" #: ../src/Frontend-GNOME/MainWindow.cs:224 msgid "_Manage" msgstr "_Manage" #: ../src/Frontend-GNOME/MainWindow.cs:231 msgid "_Chat" msgstr "_Chat" #: ../src/Frontend-GNOME/MainWindow.cs:235 msgid "Open / Join Chat" msgstr "Open / Join Chat" #: ../src/Frontend-GNOME/MainWindow.cs:240 msgid "_Find Group Chat" msgstr "_Find Group Chat" #: ../src/Frontend-GNOME/MainWindow.cs:245 msgid "C_lear All Activity" msgstr "C_lear All Activity" #: ../src/Frontend-GNOME/MainWindow.cs:252 msgid "_Next Chat" msgstr "_Next Chat" #: ../src/Frontend-GNOME/MainWindow.cs:262 msgid "_Previous Chat" msgstr "_Previous Chat" #: ../src/Frontend-GNOME/MainWindow.cs:312 msgid "Open Log" msgstr "Open Log" #: ../src/Frontend-GNOME/MainWindow.cs:326 msgid "_Engine" msgstr "_Engine" #: ../src/Frontend-GNOME/MainWindow.cs:330 msgid "_Use Local Engine" msgstr "_Use Local Engine" #: ../src/Frontend-GNOME/MainWindow.cs:336 msgid "_Add Remote Engine" msgstr "_Add Remote Engine" #: ../src/Frontend-GNOME/MainWindow.cs:341 msgid "_Switch Remote Engine" msgstr "_Switch Remote Engine" #: ../src/Frontend-GNOME/MainWindow.cs:348 msgid "_View" msgstr "_View" #: ../src/Frontend-GNOME/MainWindow.cs:352 msgid "_Caret Mode" msgstr "_Caret Mode" #: ../src/Frontend-GNOME/MainWindow.cs:362 msgid "_Help" msgstr "_Help" #: ../src/Frontend-GNOME/MainWindow.cs:616 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:222 msgid "Unable to add server: " msgstr "Unable to add server: " #: ../src/Frontend-GNOME/MainWindow.cs:663 #, csharp-format msgid "Unknown ChatType: {0}" msgstr "Unknown ChatType: {0}" #: ../src/Frontend-GNOME/MainWindow.cs:892 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" #: ../src/Frontend-GNOME/MainWindow.cs:934 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Sorry, not implemented yet!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:171 msgid "Character" msgstr "Character" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:172 msgid "Word" msgstr "Word" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:182 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:139 msgid "Connection" msgstr "Connection" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Interface" msgstr "Interface" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:190 msgid "Servers" msgstr "Servers" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:197 msgid "Filters" msgstr "Filters" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:201 #, fuzzy msgid "Logging" msgstr "Logging" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:251 msgid "System Default" msgstr "System Default" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:528 msgid "Nicknames(s) field must not be empty." msgstr "Nicknames(s) field must not be empty." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:672 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Invalid highlight regex: '{0}'. Reason: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:69 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:105 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:271 msgid "Name" msgstr "Name" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:74 msgid "Topic" msgstr "Topic" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:102 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:143 msgid "Error while fetching the list of group chats from the server." msgstr "Error while fetching the list of group chats from the server." #: ../src/Frontend-GNOME/Frontend.cs:394 #, csharp-format msgid "Cause: {0}" msgstr "Cause: {0}" #: ../src/Frontend-GNOME/Frontend.cs:464 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "" "The front-end has lost the connection to the server.\n" " Do you want to reconnect now?" #: ../src/Frontend-GNOME/Frontend.cs:479 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "" "Reconnecting to the server has failed.\n" "Do you want to try again?" #: ../src/Frontend-GNOME/Frontend.cs:580 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "" "The server has lost connection to the front-end.\n" " Do you want to reconnect now?" #: ../src/Frontend-GNOME/NotifyManager.cs:229 msgid "Show" msgstr "Show" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:62 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:238 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protocol" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:63 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Hostname" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:166 #, fuzzy msgid "Unable to load server: " msgstr "Unable to add server: " #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:244 msgid "Person / Private" msgstr "Person / Private" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:245 msgid "Group / Public" msgstr "Group / Public" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:70 msgid "Engine Assistant - Smuxi" msgstr "Engine Assistant - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:92 msgid "Add Smuxi Engine" msgstr "Add Smuxi Engine" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:94 msgid "Edit Smuxi Engine" msgstr "Edit Smuxi Engine" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:203 msgid "Credentials" msgstr "Credentials" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:265 msgid "Now you can use the Smuxi Engine" msgstr "Now you can use the Smuxi Engine" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:268 msgid "Thank you" msgstr "Thank You" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:285 msgid "An engine with this name already exists! Please specify a different one." msgstr "An engine with this name already exists! Please specify a different one." #: ../src/Frontend-GNOME/Views/MessageTextView.cs:198 #, csharp-format msgid "Day changed to {0}" msgstr "Day changed to {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:123 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:133 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Invalid filter regex: '{0}'. Reason: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:200 msgid "Are you sure you want to delete the selected filter?" msgstr "Are you sure you want to delete the selected server?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:246 #, fuzzy msgid "Protocol / Server" msgstr "Protocol" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:253 msgid "Chat Type" msgstr "Chat Type" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:287 msgid "Normal" msgstr "Normal" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:288 msgid "Event" msgstr "Event" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:295 msgid "Type" msgstr "_Type:" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:321 msgid "Pattern" msgstr "Pattern" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:241 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Retrieving user list for {0}..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:288 msgid "done." msgstr " done." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:303 msgid "Person" msgstr "Person" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:68 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:184 msgid "Are you sure you want to delete the selected server?" msgstr "Are you sure you want to delete the selected server?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:240 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:274 #, fuzzy msgid "Unable to edit server: " msgstr "Unable to add server: " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:34 msgid "Find" msgstr "Find" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:54 msgid "_Search for:" msgstr "_Search for:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:83 msgid "_Match Case" msgstr "_Match case" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:95 msgid "Search _Backwards" msgstr "Search _Backwards" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:107 msgid "_Wrap Around" msgstr "_Wrap around" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:120 msgid "Use _Regular Expressions" msgstr "Use _Regular Expressions" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:32 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Find Group Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:79 msgid "_Name:" msgstr "_Name:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:24 msgid "Smuxi - Quick Connect" msgstr "Smuxi - Quick Connect" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:487 msgid "Nicknames:" msgstr "Nicknames:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1622 msgid " User List Position " msgstr " User List Position " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1633 msgid " Channel " msgstr " Channel " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1844 msgid "Channel Filters" msgstr "Channel Filters" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1861 msgid "User Filters" msgstr "User Filters" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "Use _SSH Tunnel" msgstr "Use _SSH Tunnel" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:70 msgid "Enables the use of SSH for the connection. This has a small performance impact, but is more secure and required when using NAT or port-based firewalls" msgstr "Enables the use of SSH for the connection. This has a small performance impact, but is more secure and required when using NAT or port-based firewalls" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:149 msgid "SSH _Host:" msgstr "SSH _Host:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:160 msgid "DNS or IP address and port of the SSH server" msgstr "DNS or IP address and port of the SSH server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:187 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:146 msgid "_Port:" msgstr "_Port:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:200 msgid "DNS or IP address and port of the Smuxi server" msgstr "DNS or IP address and port of the Smuxi server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:213 msgid "_Smuxi Host:" msgstr "_Smuxi Host:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:68 msgid "_SSH Username: (optional)" msgstr "_SSH Username: (optional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:91 msgid "Username which will be used to log into the SSH server" msgstr "Username which will be used to log into the SSH server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:111 msgid "_SSH Password: (optional)" msgstr "_SSH Password: (optional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:135 msgid "Password which will be used to log into the SSH server. The password is optional if SSH key authorization is used (via Pageant from the PuTTY tools)." msgstr "Password which will be used to log into the SSH server. The password is optional if SSH key authorization is used (via Pageant from the PuTTY tools)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:156 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:215 msgid "_Username:" msgstr "_Username:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:179 msgid "Username which will be used to log into the Smuxi server" msgstr "Username which will be used to log into the Smuxi server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:199 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:225 msgid "_Password:" msgstr "_Password:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:223 msgid "Password of the user" msgstr "Password of the user" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:243 msgid "_Verify Password:" msgstr "_Verify Password:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:267 msgid "Repeat the password for verification" msgstr "Repeat the password for verification" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:44 msgid "_Engine Name:" msgstr "_Engine Name:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:67 msgid "Profile name of the new engine" msgstr "Profile name of the new engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:88 msgid "_Default Engine:" msgstr "_Default Engine:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:99 msgid "Use as new default engine" msgstr "Use as new default engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:112 msgid "If enabled, the current engine will be the default next time Smuxi is started" msgstr "If enabled, the current engine will be the default next time Smuxi is started" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:26 msgid "Smuxi - Open Chat" msgstr "Smuxi - Open Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:69 msgid "_Type:" msgstr "_Type:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 #, fuzzy msgid "_Network:" msgstr "Network:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:205 msgid "_Hostname:" msgstr "_Hostname:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:235 msgid "_Protocol:" msgstr "_Protocol:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "_On Connect Commands:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "_Ignore Commands" #~ msgid "German" #~ msgstr "German" #~ msgid "Spanish" #~ msgstr "Spanish" #~ msgid "British English" #~ msgstr "British English" #~ msgid "French" #~ msgstr "French" #~ msgid "Italian" #~ msgstr "Italian" #~ msgid "_Edit" #~ msgstr "_Edit" #~ msgid "Joins" #~ msgstr "Joins" #~ msgid "Parts" #~ msgstr "Parts" #~ msgid "Quits" #~ msgstr "Quits" #~ msgid "Unknown Command: {0}" #~ msgstr "Unknown Command: {0}" #~ msgid "gtk-cancel" #~ msgstr "gtk-cancel" #~ msgid "gtk-ok" #~ msgstr "gtk-ok" #~ msgid "#" #~ msgstr "#" #~ msgid "Syncing chat persons of {0}..." #~ msgstr "Syncing users for {0}..." #~ msgid "localhost" #~ msgstr "localhost" #~ msgid "smuxi - Preferences" #~ msgstr "Smuxi - Preferences" #~ msgid "Smuxi's first start" #~ msgstr "Smuxi's first start" #~ msgid "" #~ "Welcome to the smuxi\n" #~ "You started smuxi for the first time and it needs some answers from you.\n" #~ "\n" #~ "Click \"Forward\" to begin." #~ msgstr "" #~ "Welcome to the Smuxi\n" #~ "You started Smuxi for the first time and it needs some answers from you.\n" #~ "\n" #~ "Click \"Forward\" to begin." #~ msgid "Local" #~ msgstr "Local" #~ msgid "Remote" #~ msgstr "Remote" #~ msgid "When smuxi is started which mode it should use by default" #~ msgstr "When Smuxi is started which mode should it use by default" #~ msgid "Now you can use smuxi" #~ msgstr "Now you can use Smuxi" #~ msgid "First Start Druid" #~ msgstr "First Start Druid" #~ msgid "DNS or IP address of the smuxi engine" #~ msgstr "Smuxi engine DNS or IP address" #~ msgid "TCP port of the smuxi engine" #~ msgstr "Smuxi engine TCP port" #~ msgid "_Channel:" #~ msgstr "_Channel:" #~ msgid "" #~ ".NET Remoting Channel which will be used for communication\n" #~ "between the frontend and the engine" #~ msgstr "" #~ ".NET Remoting Channel used for communication\n" #~ "between the front-end and the engine" #~ msgid "_Formatter:" #~ msgstr "_Formatter:" #~ msgid ".NET Remoting Data Formatter" #~ msgstr ".NET Remote Data Formatter" #~ msgid "Opening URL ({0}) failed." #~ msgstr "Opening URL ({0}) failed." #~ msgid "Tray" #~ msgstr "Tray" smuxi-0.11/po-Frontend-GNOME/cs.po0000644000175000017500000012464412300202374017405 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Ondřej Hošek , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-06 13:56+0000\n" "Last-Translator: Ondřej Hošek \n" "Language-Team: Czech (http://www.transifex.com/projects/p/smuxi/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "Nastavení Smuxi" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "Použít tuto přezdívku. Můžete zvolit více přezdívek (oddělených mezerami), které se použijí jako náhradní v případě, že první přezdívka nebude dostupná. Ve výchozím nastavení budou použity náhradní přezdívky $nick_ a $nick__." #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "Přezdívka(y)" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Uživatelské jméno:" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "Skutečné jméno:" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "Kódování:" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "Automaticky převádět znaky UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr "Obecné" #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "Druh:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "Hostitel:" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "Heslo:" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "Port:" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Ukázat heslo" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "Síťový proxy" #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "Příkazy při připojení:" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "Příkazy při spuštění:" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr "Globální příkazy" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "_Připojení" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "Formát času:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "Pamatovat si řádky:" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "Pamatovat si řádky enginu:" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "ss = sekundy\nmm = minuty\nhh = hodiny (01 - 12)\nHH = hodiny (00 - 23)\ntt = Dopoledne/Odpoledne\n\ndd = den\nMM = měsíc\nyy/yyyy = rok" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "Druh ukládání:" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "Počet dočasných řádků v bufferu:" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "Počet trvalých řádků v bufferu:" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr "Buffer zpráv" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "Barevný proužek" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "Formátování proužku" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "Proužek v UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "Zobrazit pokročilá nastavení" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr "Pokročilé" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "Obecné" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "Nahoře" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "Dole" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "Vlevo" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "Vpravo" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "Žádné" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " Umístění záložek " #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "Zvýraznit" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "Aktivita" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "Žádná aktivita" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "Join/Part/Mode" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " Barvy záložek " #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "Automaticky přepnout k nově otevřeným chatům s jednotlivci" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "Automaticky přepnout k nově otevřeným skupinovým chatům" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "Strom" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "Znak dokončování:" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "Znak příkazu:" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "Velikost historie příkazů:" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Dokončování ve stylu Bash" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " Vstupní políčko " #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "Vstup" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "Barvy přezdívek" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr " Umístění seznamu osob " #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "Potlačit" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " Písmo " #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " Umístění témata " #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "Popředí" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "Pozadí" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " Barva " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "Režim zalamování:" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr " Chat " #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "Zvýraznit slova:" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "Pípnout při zvýraznění" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " Zvýraznění " #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "Výstup" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "Povolit" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "Ukazovat vždy" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "Ukázat když je okno minimalizováno" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "Ukázat když je okno zavřeno" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr " Ikona oznamovací oblasti " #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "Zobrazit Smuxi v nabídce zpráv" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr "Nabídka zpráv" #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "Zobrazit vyskakovací upozornění" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr "Vyskakovací upozornění" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "Upozornění" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "Vzhled" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "_Servery" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "_Filtry" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "Povoleno" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "Uchovávat filtrované zprávy" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "Přihlašování" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - Server" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "Po spuštění se automaticky připojit k serveru" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "Protokol:" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "Síť:" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "Hostitel:" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "IRC Chat" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Smuxi klient IRC" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "Chatujte s jinými lidmi na IRC" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "Michal Simunek " #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "Web Smuxi" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "Hups, zkouším to znovu..." #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi spadl, protože obdržel nezpracovatelný požadavek!" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "Zde je výpis, nahlaste prosím tuto chybu!" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "_Nahlásit chybu" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "Engine nenalezen." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "Správce enginu" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "Vyberte engine Smuxi ke kterému se chcete připojit" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "Engine:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "Použít režim pomalého spojení" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "Místní engine" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "Vyberte si prosím engine!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "Verze rozhraní ({0}) neodpovídá verzi enginu ({1})!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "Během připojování k enginu se vyskytla chyba!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "Adresa enginu: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "Chyba: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Opravdu si přejete odstranit engine \"{0}\"?" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Chystáte se vložit {0} řádků. Chcete pokračovat?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "Příkazy rozhraní" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Promiňte, ještě není podporováno!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "Znak" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "Slovo" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "dočasný" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "stálý" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "Nepoužívat proxy" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "Podle systému" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "Připojení" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "Vzhled" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "Servery" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "Filtry" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "Přihlašování" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "Políčko Přezdívka(y) nemůže být prázdné." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Neplatný výraz pro zvýraznění: '{0}'. Příčina: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "Název" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "Téma" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "Vyhledávání skupinových chatů bez filtru není doporučeno. Nemusí vždy fungovat, nebo zabere hodně času.\nPřejete si pokračovat?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "Chyba při přijmu seznamu skupinových chatů ze serveru." #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "Odpojen od enginu." #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "Obnovuji připojení k enginu... (pokus {0})" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "Způsobeno: {0}" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "Rozhraní ztratilo spojení se serverem.\nChcete se nyní znovu připojit?" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "Opětovné připojení k serveru selhalo.\nChcete to zkusit znovu?" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "Server ztratil spojení s rozhraním.\nChcete se nyní znovu připojit?" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "Zobrazit" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protokol" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Hostitel" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "Nelze nahrát server: " #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "Osobní / Soukromý" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "Skupinový / Veřejný" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "Asistent enginu - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "Přidat engine Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "Upravit engine Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "Kredity" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "Nyní můžete používat tento engine Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "Děkujeme" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "Engine s tímto názvem již existuje. Zadejte prosím jiný název." #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "Zadejte se kterým chatem se připojit" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "O Smuxi" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "Nastavení" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "Nelze přidat server: " #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Přepnutím na místní engine se odpojíte od aktuálního enginu!\nOpravdu si přejete pokračovat?" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Přepnutím na vzdálený engine se odpojíte od aktuálního enginu!\nOpravdu si přejete pokračovat?" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "Den se změnil z {0} v {1}" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "Den změněn na {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Neplatný výraz pro filtr: '{0}'. Příčina: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "Opravdu si přejete smazat vybraný filtr?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "Protokol / Server" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "Typ chatu" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "Normální" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "Událost" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "Typ" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "Vzor" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "Režim pomalého spojení je aktivní: nesynchronizuji zprávy." #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "Zobrazit _nabídky" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Přijímání seznamu uživatelů pro {0}..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "hotovo." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "Osoba" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "Opět se připojit" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "Zavření tohoto chatového protokolu také zavře všechny otevřené chaty na něm připojené!\nOpravdu si přejete pokračovat?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "Opravdu si přejete smazat vybraný server?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "Nelze upravit server: " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "Najít" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "_Hledat:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "_Výsledky" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "Hledat pozpát_ku" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "Přenášet te_xt" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "Použít re_gulární výrazy" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Najít skupinový chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "_Název:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "Vstoupit" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "_Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "S_erver" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "_Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "_Engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "Zo_brazit" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "Nápo_věda" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "Spojit se" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "Otevřít protokol" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "_Nastavení" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "_Ukončit" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "_Spojit se" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "_Přidat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "Spr_avovat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "_Otevřít / vstoupit do chatu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "_Najít skupinový chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "_Vyprázdnit všechnu aktivitu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "_Další Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "Předcho_zí Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "_Zavřít" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "Po_užit místní engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "Př_idat vzdálený engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "Připojit se k jinému vzdálenému enginu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "Z_nakový režim" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "Mód _prohledávání" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "Zobrazit _stavový řádek" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "_Plná obrazovka" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "_O Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "Najít skupinový chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "_Webová stránka" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "Zobrazit _panel nástrojů" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "Smuxi - Spojení" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - Předvolby" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "Přezdívky:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "Záložky" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr " Umístění seznamu uživatelů " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " Kanál " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "Filtry kanálů" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "Filtry uživatelů" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "Použít tunel _SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "Povolí používat SSH pro toto připojení. To má malý dopad na výkon, ale je to mnohem bezpečnější a je potřeba pokud používáte NAT nebo firewally založené na portech" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "_Hostitel SSH:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "DNS nebo IP adresa a port SSH serveru" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "_Port:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "DNS nebo IP adresa a port serveru Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "Hostitel _Smuxi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "_SSH uživatelské jméno: (volitelné)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "Uživatelské jméno pro přihlášení k SSH serveru" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "_SSH heslo: (volitelné)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "Heslo ke spojení se serverem SSH. Není nutné jej zadat při autorizaci pomocí klíče SSH (viz dole)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "Soubor s klíčem _SSH: (nepovinný)" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "Vyberte soubor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "Soubor se soukromým klíčem SSH který bude použit při spojování se serverem SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "_Uživatel:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "Uživatelské jméno pro přihlášení k serveru Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "H_eslo:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "Heslo uživatele" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "_Ověřit heslo:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "Zopakujte heslo pro ověření" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "Vítejte v asistentu nastavení enginu Smuxi.\nPřed použitím enginu bude třeba, aby jste zadali některé informace.\n\nZačněte kliknutím na \"Pokračovat\"." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "_Název enginu:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "Název profilu nového enginu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "_Výchozí engine:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "Použít jako nový výchozí engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "Pokud je zaškrtnuto, aktuální engine bude použit jako výchozí při příštím spuštění Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "Smuxi - Otevřít chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "_Typ" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "_Hostitel:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_Síť:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "P_rotokol:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "Použít šifrování" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "Ověřit certifikát serveru" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "_Příkazy při připojení:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "_Ignorovat příkazy" smuxi-0.11/po-Frontend-GNOME/nl.po0000644000175000017500000012431712311343665017421 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Jeroen Baten , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-26 15:06+0000\n" "Last-Translator: Jeroen Baten \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/smuxi/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "Smuxi Voorkeuren" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "De alias om the gebruiken. U kunt extra aliasen specificeren (gescheiden door spaties) welke gebruikt zullen worden als reserve als de eerste keus niet beschikbaar is. Standaard worden $alias_ en $alias__ gebruikt als reserve." #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "Alias(en):" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Gebruikersnaam:" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "Echte naam:" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "Codering:" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "Converteer automatisch UTF-8 karakters" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr "Algemeen" #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "Type:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "Host:" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "Wachtwoord:" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "Poort:" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Toon Wachtwoord" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "Netwerkproxy" #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "Commando's bij verbinding:" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "Commando's bij opstarten:" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr "Globale Commando's" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "V_erbinding" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "Tijdstempelnotatie:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "Bufferregels:" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "Enginebufferregels:" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "ss = seconden\nmm = minuten\nhh = uren (01 - 12)\nHH = uren (00 - 23)\ntt = AM/PM\n\ndd = dag\nMM = maand\nyy/yyyy = jaar" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "Persistency Type:" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "Volatile Buffer Lines:" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "Persistent Buffer Lines:" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr "Meldingenbuffer" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "Strip Kleuren" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "Strip Opmaak" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "Strip UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "Toon gevorderde instellingen" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr "Gevorderd" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "Algemeen" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "Top" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "Bodem" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "Links" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "Rechts" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "Geen" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " Tabs Positie " #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "Highlight" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "Activiteit" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "Geen activiteit" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "Join/Part/Mode" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " Tab Kleuren " #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "Automatisch omschakelen naar rechtstreekse persoonchats" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "Automatisch omschakelen naar nieuw geopende groepchats" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "Boom" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "Aanvullingskarakter:" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "Commandokarakter:" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "Commandohistorieomvang:" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Bash-stijl aanvulling" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " Invoeg veld " #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "Invoer" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "Alias-kleuren" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr " Persoonslijst Positie " #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "Override" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " Lettertype " #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " Onderwerp Positie " #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "Voorgrond" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "Achtergrond" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " Kleur " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "_Wrap Mode:" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr " Chat " #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "Highlight woorden:" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "Piep bij highlights" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " Highlighting " #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "Uitvoer" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "Aanzetten" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "Toon altijd" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "Toon als het venster is geminimaliseerd" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "Toon als het venster is gesloten" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr " Notificatiedeel Icoon " #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "Toon Smuxi in het messaging-menu" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr "Boodschappenmenu" #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "Toon notificatie popups" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr "Meldingen Popups" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "Melding" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "_Interface" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "_Servers" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "_Filters" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "Aangezet" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "Log gefilterde meldingen" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "_Logging" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi -Server" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "Automatisch verbinden met server tijdens opstarten" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "Protocol:" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "Netwerk:" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "Hostnaam:" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "IRC Chat" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Smuxi IRC Client" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "Praat met andere mensen op IRC" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "Jeroen Baten " #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "Smuxi Website" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "Oops, I did it again..." #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi crashed omdat een niet afgehandelde exceptie ontstond!" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "Hier is de stacktrace. Rapporteer aub deze bug!" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "_Report Bug" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "Engine niet gevonden." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "Engine Manager" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "Kies met welke Smuxi engine u wilt verbinden" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "Engine:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "Gebruik LageBandbreedteMode" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "Lokale Engine" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "Kies aub een engine!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "Uw frontend versie ({0}) komt niet overeen met de engine versie ({1})!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "Een fout trad op tijdens het verbinden met de engine!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "Engine URL: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "Fout: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Weet u zeker dat u engine \"{0}\" wilt verwijderen?" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "U staat op het punt om {0} regels te plakken. Wilt u echt verder?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "Frontend Commando's" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Sorry. Nog niet geimplementeerd!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "Karakter" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "Woord" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "Volatile" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "Persistent" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "Geen Proxy" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "Systeem Standaard" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "Verbinding" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "Interface" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "Servers" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "Filters" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "Logging" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "Alias(en)veld mag niet leeg zijn." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Ongeldige highlight regex: '{0}'. Reden: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "Naam" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "Onderwerp" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "Zoeken naar groepchats zonder een filter is door het grote aantal niet verstandig. Dit kan nogal lang duren, of zelfs helemaal niet werken.\nWilt u toch doorgaan?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "Fout tijdens het ophalen van een lijst met groepchats vanaf de server." #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "Verbinding met engine verbreken." #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "Opnieuw verbinden met engine... (poging {0})" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "Oorzaak: {0}" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "De frontend is de verbinding verloren met de server.\nWilt u de verbinding herstellen?" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "Het opnieuw verbinden met de server is mislukt.\nWilt u opnieuw proberen?" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "De server is de verbinding met de frontend kwijt.\nWilt u opnieuw verbinden?" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "Toon" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protocol" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Hostnaam" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "Niet in staat om de server te laden:" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "Persoon / Privé" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "Group / Openbaar" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "Engine Assistent - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "Toevoegen Smuxi Engine" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "Wijzigen Smuxi Engine" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "Legitimatiegegevens" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "U kunt nu de Smuxi Engine gebruiken" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "Dank u" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "Een engine met deze naam bestaat reeds. Kies aub een andere." #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "Voer in met welke chat u wilt verbinden" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "Over Smuxi" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "Voorkeuren" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "Niet in staat om server toe te voegen:" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Omschakelen naar lokale engine zal uw verbinding met de huidige engine verbreken!\nWeet u zeker dat u dit wilt doen?" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Omschakelen naar andere engine zal uw verbinding met de huidige engine verbreken!\nWeet u zeker dat u dit wilt doen?" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "Dag gewijzigd van {0} naar {1}" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "Dag gewijzigd naar {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Ongeldige filter regex: '{0}'. Reden: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "Weet u zeker dat het geselecteerde filter wilt verwijderen?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "Protocol / Server" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "Chat Type" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "Normaal" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "Gebeurtenis" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "Type" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "Patroon" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "LageBandbreedteMode is aktief: geen meldingen gesynchroniseerd." #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "Toon _Menubalk" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Ophalen van gebruikerslijst voor {0}..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "klaar." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "Persoon" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "Opnieuw verbinden" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "Het sluiten van het protocolverkeer zal ook alle open chats die hiermee verbonden zijn afsluiten. \nWeet u zeker dat u dit wilt doen?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "Weet u zeker dat u de geselecteerde server wilt verwijderen?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "Niet in staat om server te wijzigen:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "Vind" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "_Zoek naar:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "_Match Case" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "Zoek _Achteruit" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "_Wrap Around" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "Gebruik _Reguliere Expressies" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Vind Groep Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "_Naam:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "Join" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "_Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "_Server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "_Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "_Engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "_Toon" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "_Help" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "Verbinden" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "Open Log" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "_Voorkeuren" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "_Afsluiten" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "_Verbinden" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "_Toevoegen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "_Beheer" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "_Open / Join Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "_Vind Groep Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "W_is alle activiteiten" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "_Next Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "_Previous Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "_Sluit" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "_Gebruik Lokaal Engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "_Add Remote Engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "Omschakelen Remote Engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "_Caret Mode" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "_Browse Mode" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "Toon _Statusbalk" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "_Volledig scherm" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "_Over" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "Vind groepchat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "_Website" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "Toon _Toolbar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "Smuxi - Verbinden" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - Voorkeuren" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "Aliasen:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "Tabbladen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr " Gebruikerslijstpositie " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " Kanaal " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "Kanaal Filters" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "Gebruikersfilters" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "Gebruik _SSH Tunnel" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "Maakt het mogelijk SSH te gebruiken voor de verbinding. Dit heeft een kleine performance impact, maar is veiliger en noodzakelijk bij het gebruik van NAT of poort-gebaseerde firewalls" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "SSH _Host:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "DNS of IP address en poort van de SSH server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "_Poort:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "DNS of IP adres en poort van de Smuxi server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "_Smuxi Host:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "_SSH Gebruikersnaam: (optioneel)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "Gebruikersnaam welke gebruikt zal worden voor het aanmelden bij de SSH server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "_SSH Wachtwoord: (optioneel)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "Wachtwoord welke gebruikt zal worden voor het aanmelden bij de SSH server. Het wachtwoord is optioneel als SSH key authorisatie wordt gebruikt (zie hier onder)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "_SSH Keyfile: (optioneel)" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "Kies een Bestand" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "SSH private keyfile welke gebruikt wordt bij het aanmelden op de SSH server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "_Gebruikersnaam:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "Gebruikersnaam welke gebruikt zal worden voor het aanmelden bij de Smuxi server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "_Wachtwoord:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "Wachtwoord van de gebruiker" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "_Controle Wachtwoord:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "Herhaal het wachtwoord ter verificatie" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "Welkom bij de Smuxi Engine Configuratie Assistent.\nU dient wat informatie in te voeren voordat u de engine kunt gebruiken.\n\nKlik \"Forward\" om te beginnen." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "_Engine Naam:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "Profielnaam van de nieuwe engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "_Standaard Engine:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "Gebruik als nieuwe standaard engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "Indien geselecteerd zal de huidige engine de standaard engine zijn bij de volgende keer dat Smuxi start" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "Smuxi - Open Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "_Type:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "_Hostname:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_Netwerk:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "_Protocol:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "Gebruik Versleuteling" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "Valideer Servercertifikaat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "_On Connect Commando's:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "_Ignore Commando's" smuxi-0.11/po-Frontend-GNOME/es_AR.po0000644000175000017500000007731112300202374017767 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2009 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # Juan Miguel Carrero , 2008-2009. # msgid "" msgstr "" "Project-Id-Version: 0.6.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-11 03:23+0100\n" "PO-Revision-Date: 2009-08-12 16:47+0100\n" "Last-Translator: Damian Kleiman \n" "Language-Team: Spanish Spanish Localization \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid " Chat " msgstr " Chat " #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid " Color " msgstr " Color " #: ../glade/smuxi-frontend-gnome.glade.h:3 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1372 msgid " Entry Field " msgstr " Campo de Entrada " #: ../glade/smuxi-frontend-gnome.glade.h:4 msgid " Font " msgstr " Fuente " #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1702 msgid " Highlighting " msgstr " Resaltar " #: ../glade/smuxi-frontend-gnome.glade.h:6 msgid " Notification Area Icon " msgstr " Icono de Área de Notificación " #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid " Person List Position " msgstr " Posición Lista de Personas " #: ../glade/smuxi-frontend-gnome.glade.h:8 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1209 msgid " Tab Colors " msgstr " Colores de pestañas " #: ../glade/smuxi-frontend-gnome.glade.h:9 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1110 msgid " Tabs Position " msgstr " Posicion de pestañas " #: ../glade/smuxi-frontend-gnome.glade.h:10 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1515 msgid " Topic Position " msgstr " Posicion del topic " #: ../glade/smuxi-frontend-gnome.glade.h:11 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1853 msgid "Channel Filters" msgstr "Filtro de canales" #: ../glade/smuxi-frontend-gnome.glade.h:12 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1870 msgid "User Filters" msgstr "Filtro de usuarios" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1161 msgid "Activity" msgstr "Actividad" #: ../glade/smuxi-frontend-gnome.glade.h:14 #, fuzzy msgid "Automatically connect to server at startup" msgstr "Conectar automaticamente al servidor al iniciar" #: ../glade/smuxi-frontend-gnome.glade.h:15 msgid "Background" msgstr "Fondo" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1360 msgid "Bash-Style Completion" msgstr "Autocompletado Bash" #: ../glade/smuxi-frontend-gnome.glade.h:17 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1690 msgid "Beep on highlight" msgstr "Beep al resaltar" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:980 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1002 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1461 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1486 msgid "Bottom" msgstr "Abajo" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:746 msgid "Buffer Lines:" msgstr "Lineas de buffer:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:671 msgid "C_onnection" msgstr "C_onexión" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1312 msgid "Command Character:" msgstr "Carácter de Comandos:" #: ../glade/smuxi-frontend-gnome.glade.h:22 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 msgid "Command History Size:" msgstr "Tamaño Historial de Comandos:" #: ../glade/smuxi-frontend-gnome.glade.h:23 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1292 msgid "Completion Character:" msgstr "Carácter de Auto-Completar" #: ../glade/smuxi-frontend-gnome.glade.h:24 msgid "Enable" msgstr "Habilitar" #: ../glade/smuxi-frontend-gnome.glade.h:25 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:559 msgid "Encoding:" msgstr "Codificación:" #: ../glade/smuxi-frontend-gnome.glade.h:26 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:769 msgid "Engine Buffer Lines:" msgstr "Lineas de buffer del motor" #: ../glade/smuxi-frontend-gnome.glade.h:27 msgid "Foreground" msgstr "Prioridad" #: ../glade/smuxi-frontend-gnome.glade.h:28 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:925 msgid "General" msgstr "General" #: ../glade/smuxi-frontend-gnome.glade.h:29 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Highlight" msgstr "Resaltar" #: ../glade/smuxi-frontend-gnome.glade.h:30 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1666 msgid "Highlight words:" msgstr "Palabras resaltadas:" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Hostname:" msgstr "Nombre del Host:" #: ../glade/smuxi-frontend-gnome.glade.h:32 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1381 msgid "Input" msgstr "Entrada" #: ../glade/smuxi-frontend-gnome.glade.h:33 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1171 msgid "Join/Part/Mode" msgstr "Entrar/Salir/Modo" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:34 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1016 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1041 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1535 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1561 msgid "Left" msgstr "Izquierda" #: ../glade/smuxi-frontend-gnome.glade.h:35 msgid "Network:" msgstr "Redes:" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1402 msgid "Nick Colors" msgstr "Colores del Nick" #: ../glade/smuxi-frontend-gnome.glade.h:37 msgid "Nickname(s):" msgstr "Nick(s):" #: ../glade/smuxi-frontend-gnome.glade.h:38 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1153 msgid "No Activity" msgstr "Sin Actividad" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:39 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1096 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1501 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1616 msgid "None" msgstr "Ninguno" #: ../glade/smuxi-frontend-gnome.glade.h:40 msgid "Notification" msgstr "Notificación" #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:581 msgid "On Connect Commands:" msgstr "Comandos al conectar:" #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:627 msgid "On Startup Commands:" msgstr "Comandos al arrancar:" #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1714 msgid "Output" msgstr "Salida" #: ../glade/smuxi-frontend-gnome.glade.h:44 msgid "Override" msgstr "Anular" #: ../glade/smuxi-frontend-gnome.glade.h:45 msgid "Password:" msgstr "Contraseña:" #: ../glade/smuxi-frontend-gnome.glade.h:46 msgid "Port:" msgstr "Puerto:" #: ../glade/smuxi-frontend-gnome.glade.h:47 msgid "Protocol:" msgstr "Protocolo:" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:538 msgid "Realname:" msgstr "Nombre Real:" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1056 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1081 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1576 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1601 msgid "Right" msgstr "Derecha" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:186 msgid "Show Password" msgstr "Mostrar Contraseña:" #: ../glade/smuxi-frontend-gnome.glade.h:51 msgid "Show always" msgstr "Mostrar siempre" #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Show when window is closed" msgstr "Mostrar cuando la ventana se cierra" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Show when window is minimized" msgstr "Mostrar cuando la ventana se minimiza" #: ../glade/smuxi-frontend-gnome.glade.h:54 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:406 msgid "Smuxi - Preferences" msgstr "Smuxi - Preferencias" #: ../glade/smuxi-frontend-gnome.glade.h:55 msgid "Smuxi - Server" msgstr "Smuxi - Servidor" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:828 msgid "Strip Colors" msgstr "Ocultar Colores" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:867 msgid "Strip Formattings" msgstr "Ocultar Formatos" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:907 msgid "Strip UTF-8" msgstr "Ocultar UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1222 msgid "Tabs" msgstr "Pestañas" #: ../glade/smuxi-frontend-gnome.glade.h:60 #, fuzzy msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "El apodo " #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:726 msgid "Timestamp Format:" msgstr "Formato de Marca de Tiempo:" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:62 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:943 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:967 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1420 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1446 msgid "Top" msgstr "Arriba" #: ../glade/smuxi-frontend-gnome.glade.h:63 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:515 msgid "Username:" msgstr "Usuario:" #: ../glade/smuxi-frontend-gnome.glade.h:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1882 msgid "_Filters" msgstr "_Filtros" #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1723 msgid "_Interface" msgstr "_Interfaz" #: ../glade/smuxi-frontend-gnome.glade.h:66 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1789 msgid "_Servers" msgstr "_Servidores" #. This is a setting for character based line wrapping vs word based when showing messages #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid "_Wrap Mode:" msgstr "_Modo Caret" #: ../glade/smuxi-frontend-gnome.glade.h:69 #, fuzzy msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "" "ss = segundos\n" "mm = minutos\n" "hh = hora (1 - 12)\n" "HH = hora (0 - 23)\n" "tt = AM/PM\n" "\n" "dd = día\n" "MM = mes\n" "yy/yyyy = año" #: ../src/Frontend-GNOME/AboutDialog.cs:52 msgid "translator-credits" msgstr "Juan Miguel Carrero \nDamian Kleiman " #: ../src/Frontend-GNOME/AboutDialog.cs:47 msgid "German" msgstr "Alemán" #: ../src/Frontend-GNOME/AboutDialog.cs:48 msgid "Spanish" msgstr "Español" #: ../src/Frontend-GNOME/AboutDialog.cs:49 msgid "British English" msgstr "Inglés Británico" #: ../src/Frontend-GNOME/AboutDialog.cs:50 msgid "French" msgstr "Francés" #: ../src/Frontend-GNOME/AboutDialog.cs:51 msgid "Italian" msgstr "Italiano" #: ../src/Frontend-GNOME/AboutDialog.cs:54 msgid "Smuxi Website" msgstr "Web de Smuxi" #: ../src/Frontend-GNOME/CrashDialog.cs:39 msgid "Oops, I did it again..." msgstr "Opps, lo hice de nuevo..." #: ../src/Frontend-GNOME/CrashDialog.cs:53 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi ha fallado porque una excepción incontrolada ocurrió! " #: ../src/Frontend-GNOME/CrashDialog.cs:57 msgid "Here is the stacktrace, please report this bug!" msgstr "Aquí esta el stacktrace , por favor reporta este fallo!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:61 msgid "Engine Manager" msgstr "Gestor de Motor" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:68 msgid "_Connect" msgstr "_Conectar" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:78 msgid "_Edit" msgstr "_Editar" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:90 #, fuzzy msgid "Select which Smuxi engine you want to connect to" msgstr "Elegir motor con el cual deseas que Smuxi conecte" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:96 msgid "Engine:" msgstr "Motor:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:122 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:182 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:360 msgid "Local Engine" msgstr "Motor Local:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:174 msgid "Please select an engine!" msgstr "Seleccione un motor por favor!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:196 #, fuzzy, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "" "La version de tu frontend ({0}) no corresponde a la version del motor ({1})!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:223 #, fuzzy msgid "An error occurred while connecting to the engine!" msgstr "Se ha producido un error al conectar al motor!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:224 #, csharp-format msgid "Engine URL: {0}" msgstr "Dirección Motor: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:227 #, csharp-format msgid "Error: {0}" msgstr "Error: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:297 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Estas seguro de que quieres borrar el motor \"{0}\"?" #: ../src/Frontend-GNOME/Entry.cs:403 #, fuzzy, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Vas a pegar {0} líneas , quieres continuar?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:505 #, fuzzy msgid "Frontend Commands" msgstr "[Comandos Frontend]" #: ../src/Frontend-GNOME/MainWindow.cs:179 msgid "_File" msgstr "_Archivo" #: ../src/Frontend-GNOME/MainWindow.cs:195 msgid "_Server" msgstr "_Servidor" #: ../src/Frontend-GNOME/MainWindow.cs:199 msgid "_Quick Connect" msgstr "Conexión _Rapida" #: ../src/Frontend-GNOME/MainWindow.cs:210 msgid "_Manage" msgstr "A_dministrar" #: ../src/Frontend-GNOME/MainWindow.cs:217 msgid "_Chat" msgstr "_Chat" #: ../src/Frontend-GNOME/MainWindow.cs:221 msgid "Open / Join Chat" msgstr "Abrir / Unirse a Chat" #: ../src/Frontend-GNOME/MainWindow.cs:226 msgid "_Find Group Chat" msgstr "_Encontrar Salas Chat" #: ../src/Frontend-GNOME/MainWindow.cs:231 msgid "C_lear All Activity" msgstr "Eliminar Toda Actividad" #: ../src/Frontend-GNOME/MainWindow.cs:238 msgid "_Next Chat" msgstr "_Siguiente Chat" #: ../src/Frontend-GNOME/MainWindow.cs:248 msgid "_Previous Chat" msgstr "_Chat Anterior" #: ../src/Frontend-GNOME/MainWindow.cs:300 msgid "_Engine" msgstr "_Motor" #: ../src/Frontend-GNOME/MainWindow.cs:304 msgid "_Use Local Engine" msgstr "_Usar Motor Local" #: ../src/Frontend-GNOME/MainWindow.cs:310 msgid "_Add Remote Engine" msgstr "_Añadir Motor Remoto" #: ../src/Frontend-GNOME/MainWindow.cs:315 msgid "_Switch Remote Engine" msgstr "_Cambiar Motor Remoto" #: ../src/Frontend-GNOME/MainWindow.cs:322 msgid "_View" msgstr "_Ver" #: ../src/Frontend-GNOME/MainWindow.cs:326 msgid "_Caret Mode" msgstr "_Modo Caret" #: ../src/Frontend-GNOME/MainWindow.cs:336 msgid "_Help" msgstr "A_yuda" #: ../src/Frontend-GNOME/MainWindow.cs:507 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:220 msgid "Unable to add server: " msgstr "Imposible añadir el servidor: " #: ../src/Frontend-GNOME/MainWindow.cs:554 #, csharp-format msgid "Unknown ChatType: {0}" msgstr "Comando desconocido: {0}" #: ../src/Frontend-GNOME/MainWindow.cs:770 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Cambiar al motor local te desconectará del engine actual!\n" "¿Estás seguro de que quieres hacer ésto?" #: ../src/Frontend-GNOME/MainWindow.cs:812 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Cambiar al motor remoto te desconectará del engine actual!\n" "¿Estás seguro de que quieres hacer ésto?" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Lo siento , no está aún implementado!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:144 msgid "Character" msgstr "Carácter de Comandos:" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:145 msgid "Word" msgstr "Palabra" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:155 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:139 msgid "Connection" msgstr "Conexión" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:159 msgid "Interface" msgstr "Interfaz" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:163 msgid "Servers" msgstr "Servidores" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:215 msgid "System Default" msgstr "Sistema por defecto" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:461 msgid "Nicknames(s) field must not be empty." msgstr "El campo Nick(s) no debe estar vacío." #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:69 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:105 msgid "Name" msgstr "Nombre" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:74 msgid "Topic" msgstr "Topic" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:102 msgid "" "Searching for group chats without a filter is not recommended. This may " "take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "" "Buscar un grupo de canales sin filtrar no se recomienda. Esto puede tardar " "un rato, o puede no funcionar.\n" "¿Desea continuar?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:143 msgid "Error while fetching the list of group chats from the server." msgstr "" "Se ha producido un error mientras se descargaba la lista salas del servidor." #: ../src/Frontend-GNOME/Frontend.cs:415 #, csharp-format msgid "Cause: {0}" msgstr "Motivo: {0}" #: ../src/Frontend-GNOME/Frontend.cs:465 #, fuzzy msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "" "El servidor ha perdido la conexión con el frontend.\n" "¿Desea reconectar ahora?" #: ../src/Frontend-GNOME/Frontend.cs:479 #, fuzzy msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "" "El servidor ha perdido la conexión con el frontend.\n" "¿Desea reconectar ahora?" #: ../src/Frontend-GNOME/Frontend.cs:628 #, fuzzy msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "" "El servidor ha perdido la conexión con el frontend.\n" " ¿Quieres reconectar ahora?" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:62 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protocolo" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:63 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Nombre del Host" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 msgid "Person / Private" msgstr "Persona / Privado" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 msgid "Group / Public" msgstr "Grupo / Público" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:70 msgid "Engine Assistant - Smuxi" msgstr "Smuxi - Asistente de Motores" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:92 msgid "Add Smuxi Engine" msgstr "Añadir Motor a Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:94 msgid "Edit Smuxi Engine" msgstr "Editar Motor de Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:203 msgid "Credentials" msgstr "Credenciales" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:265 msgid "Now you can use the Smuxi Engine" msgstr "Ya puedes usar el Motor Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:268 msgid "Thank you" msgstr "Gracias" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:285 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:162 #, csharp-format msgid "Day changed to {0}" msgstr "El día ha cambiado a {0}" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:241 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "" #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:286 #, fuzzy msgid "done." msgstr "hecho." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:306 msgid "Person" msgstr "Persona" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:72 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "" "Cerrar el protocolo también cerrará todos los canales abiertos que estés " "conectado!\n" "¿Estás seguro de querer hacer ésto?" #: ../src/Frontend-GNOME/Preferences/ChannelFilterListView.cs:81 msgid "Pattern" msgstr "Patrón" #: ../src/Frontend-GNOME/Preferences/ChannelFilterListView.cs:96 msgid "Joins" msgstr "Entradas" #: ../src/Frontend-GNOME/Preferences/ChannelFilterListView.cs:111 msgid "Parts" msgstr "Salidas" #: ../src/Frontend-GNOME/Preferences/ChannelFilterListView.cs:127 msgid "Quits" msgstr "Cierres" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:182 msgid "Are you sure you want to delete the selected server?" msgstr "¿Estás seguro de que quieres borrar el servidor seleccionado?" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:42 msgid "Find" msgstr "Buscar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:62 msgid "_Search for:" msgstr "_Buscar:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:91 #, fuzzy msgid "_Match Case" msgstr "_Coincidir mayúsculas y minúsculas" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:103 #, fuzzy msgid "Search _Backwards" msgstr "Buscar _anterior" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:115 #, fuzzy msgid "_Wrap Around" msgstr "_Volver Caret" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:128 msgid "Use _Regular Expressions" msgstr "Usar _Expresion Regular" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:40 msgid "Smuxi - Find Group Chat" msgstr "Smuxi- Buscar Grupos de Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:87 msgid "_Name:" msgstr "_Nombre:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:74 msgid "Smuxi - Quick Connect" msgstr "Smuxi - Conexión Rápida" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:145 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:195 msgid "_Port:" msgstr "_Puerto" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:204 msgid "_Hostname:" msgstr "Nombre del _Host:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:214 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:164 msgid "_Username:" msgstr "_Usuario:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:207 msgid "_Password:" msgstr "_Contraseña:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:234 msgid "_Protocol:" msgstr "_Protocolo:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:253 #, fuzzy msgid "_On Connect Commands:" msgstr "Comandos al conectar:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:264 #, fuzzy msgid "_Ignore Commands" msgstr "Comandos al conectar:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:495 msgid "Nicknames:" msgstr "Nicks:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1630 msgid " User List Position " msgstr " Posición Lista de Usuarios " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1641 msgid " Channel " msgstr " Canal " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:64 #, fuzzy msgid "Use _SSH Tunnel" msgstr "Usar Tunel _SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:78 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "" "Permite el uso de SSH para la conexión. Esto conlleva a " "una pequeña bajada de rendimiento , pero se aumenta la seguridad y es un " "requisito para el uso de NAT o un cortafuegos " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:157 msgid "SSH _Host:" msgstr "_Servidor SSH:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:168 msgid "" "DNS or IP address and port of the SSH server" msgstr "" "DNS o dirección IP y puerto del servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:208 msgid "" "DNS or IP address and port of the Smuxi server" msgstr "" "DNS o dirección IP y puerto del servidor Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:221 msgid "_Smuxi Host:" msgstr "_Servidor Smuxi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:76 msgid "_SSH Username: (optional)" msgstr "_Usuario SSH: (opcional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:99 msgid "" "Username which will be used to log into the SSH server" msgstr "" "Usuario que sere usado para logear en el servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "_SSH Password: (optional)" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:143 msgid "" "Password which will be used to log into the SSH server. " "The password is optional if SSH key authorization is used (via Pageant from " "the PuTTY tools)." msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:187 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "" "Usuario que sere usado para logear en el servidor " "Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:231 msgid "Password of the user" msgstr "Contraseña del usuario" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:251 msgid "_Verify Password:" msgstr "_Verifica Contraseña:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:275 msgid "Repeat the password for verification" msgstr "Repetir contraseña para verificación" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:27 #, fuzzy msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "" "Bienvenido al Asistente de Configuración de Motor de Smuxi.\n" "Necesita introducir alguna información antes de que puedas usar el engine.\n" "\n" "Click \"Avanzar\" para comenzar." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:52 msgid "_Engine Name:" msgstr "Nombre del _Motor:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:75 msgid "Profile name of the new engine" msgstr "Nombre del perfil del nuevo motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:96 msgid "_Default Engine:" msgstr "Motor por _Defecto:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:107 msgid "Use as new default engine" msgstr "Usar como motor por defecto" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:120 #, fuzzy msgid "" "If enabled, the current engine will be the default next " "time Smuxi is started" msgstr "" "Si se habilita modifica el motor actual por defecto " "cuando Smuxi arranque la próxima vez" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:34 msgid "Smuxi - Open Chat" msgstr "Smuxi - Chat Abierto" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:77 msgid "_Type:" msgstr "_Tipo:" #~ msgid "Unknown Command: {0}" #~ msgstr "Comando desconocido: {0}" #~ msgid "gtk-cancel" #~ msgstr "gtk-cancel" #~ msgid "gtk-ok" #~ msgstr "gtk-ok" #~ msgid "#" #~ msgstr "#" #~ msgid "Syncing chat persons of {0}..." #~ msgstr "Sincronizando lista de usuarios de {0}..." #~ msgid "localhost" #~ msgstr "localhost" #~ msgid "smuxi - Preferences" #~ msgstr "smuxi - Preferencias" smuxi-0.11/po-Frontend-GNOME/da.po0000644000175000017500000012402612300202374017356 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Joe Hansen , 2011-2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-05 19:24+0000\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish (http://www.transifex.com/projects/p/smuxi/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "Præferencer for Smuxi" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "Brugernavnet. Du kan angive yderligere brugernavne (adskilt af mellemrum) som vil blive brugt hvis det første valg ikke er tilgængeligt. Som standard vil $nick_ og $nick__ blive anvendt." #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "Brugernavne:" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Brugernavn:" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "Navn:" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "Kodning:" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "Konverter automatisk UTF-8-tegn" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr "Generelt" #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "Type:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "Vært:" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "Adgangskode:" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "Port:" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Vis adgangskode" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "Netværksproxy" #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "Ingen tilslutningskommandoer:" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "Ingen opstartskommandoer:" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr "Globale kommandoer" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "_Tilslutning" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "Tidsstempelformat:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "Mellemlagerlinjer:" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "Mellemlagerlinjer for motor:" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "ss = sekunder\nmm = minutter\nhh = timer (01 - 12)\nHH = timer (00 - 23)\ntt = AM/PM\n\ndd = dag\nMM = måned\nyy/yyyy = år" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "Persistenstype:" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "Ustabile mellemlagerlinjer:" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "Mellemlagerlinjer for persistens:" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr "Beskedmellemlager" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "Fjern farver" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "Fjern formater" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "Fjern UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "Vis avanceret opsætning" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr "Avanceret" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "Generelt" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "Øverst" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "Bund" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "Venstre" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "Højre" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "Ingen" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " Fanebladsplacering " #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "Fremhæv" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "Aktivitet" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "Ingen aktivitet" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "Deltag/del/tilstand" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " Fanebladsfarver " #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "Skift automatisk til seneste åbnede personlige samtaler (chat)" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "Skift automatisk til seneste åbnede gruppesamtaler (chat)" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "Træ" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "Afslutningstegn:" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "Kommandotegn:" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "Historikstørrelse for kommando:" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Bashagtig fuldførelse" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " Indtastningsfelt " #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "Inddata" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "Farver for brugernavn" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr " Placering af personliste " #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "Overskriv" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " Skrifttype " #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " Emneplacering " #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "Forgrund" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "Baggrund" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " Farve " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "_Ombrydningstilstand:" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr " Snak " #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "Fremhæv ord:" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "Beep ved fremhævelse" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " Fremhævelse " #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "Uddata" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "Aktiver" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "Vis altid" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "Vis når vinduet er minimeret" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "Vis når vinduet er lukket" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr " Ikon for statusfelt " #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "Vis Smuxi i beskedmenuen" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr "Beskedmenu" #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "Vis påmindelses-pop op'er" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr "Påmindelses-pop op'er" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "Påmindelse" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "_Grænseflade" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "_Servere" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "_Filtre" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "Aktiveret" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "Logfiltrerede beskeder" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "_Logning" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - Server" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "Tilslut automatisk til server ved opstart" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "Protokol:" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "Netværk:" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "Værtsnavn:" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "IRC-snak" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Smuxi - IRC-klient" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "Snak med andre via IRC" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "Joe Hansen " #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "Smuxis hjemmeside" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "Oops, jeg gjorde det igen..." #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi brød ned da en uhåndteret undtagelse opstod!" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "Her er stacktracen, rapporter venligst denne fejl!" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "_Rapporter fejl" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "Motor blev ikke fundet." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "Motorhåndtering" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "Vælg hvilken Smuximotor du ønsker at forbinde til" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "Motor:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "Brug tilstand for lav båndbredde" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "Lokal motor" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "Vælg venligst en motor!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "Din grænsefladeversion ({0}) svarer ikke til motorversionen ({1})!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "En fejl opstod under tilslutning til motoren!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "Motor-URL: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "Fejl: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Er du sikker på, at du ønsker at slette motoren »{0}«?" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Du er ved at indsætte {0} linjer. Ønsker du at fortsætte?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "Grænsefladekommandoer" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Beklager, ikke implementeret endnu!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "Tegn" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "Ord" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "Ustabile" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "Persistent" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "Ingen proxy" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "Systemstandard" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "Tilslutning" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "Grænseflade" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "Servere" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "Filtre" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "Logning" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "Brugernavnsfelter må ikke være tomme." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Ugyldigt fremhævet regulært udtryk: '{0}'. Årsag: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "Navn" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "Emne" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "Søgning efter gruppesnak uden et filter kan ikke anbefales. Det kan tage lang tid eller slet ikke virke.\nØnsker du at fortsætte?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "Kunne ikke hente listen over gruppesnak fra serveren." #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "Afbrudt fra motor." #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "Forbinder til motor igen... (forsøg {0})" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "Årsag: {0}" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "Grænsefladen har mistet forbindelsen til serveren.\nØnsker du at tilslutte nu?" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "Gentilslutning til serveren mislykkedes.\nØnsker du at forsøge igen?" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "Serveren har mistet forbindelsen til grænsefladen.\nØnsker du at tilslutte igen?" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "Vis" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protokol" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Værtsnavn" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "Kunne ikke indlæse server: " #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "Person / privat" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "Gruppe / offenlig" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "Motorassisten - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "Tilføj Smuximotor" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "Rediger Smuximotor" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "Akkreditiver" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "Nu kan du bruge Smuximotoren" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "Mange tak" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "En motor med dette navn findes allerede! Angiv venligst et andet." #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "Indtast hvilken samtale (chat) du ønsker at deltage i" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "Om Smuxi" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "Præferencer" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "Kunne ikke tilføje server: " #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Skift til lokal motor vil afbryde dig fra den aktuelle motor!\nEr du sikker på, at du ønsker at gøre dette?" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Skift af den eksterne motor vil afbryde dig fra den aktuelle motor!\nEr du sikker på, at du ønsker at gøre dette?" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "Dag ændret fra {0} til {1}" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "Dag ændret til {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Ugyldig filter for regulært udtryk: '{0}'. Årsag: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "Er du sikker på, at du ønsker at slette det valgte filter?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "Protokol / server" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "Snaktype" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "Normal" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "Begivenhed" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "Type" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "Mønster" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "Tilstand for lav båndbredde er aktiv: Ingen beskeder synkroniseret." #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "Vis _menubjælke" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Henter brugerlsite for {0}..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "færdig." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "Person" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "Genforbind" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "Lukning af protokolsamtalen vil også lukke alle åbne samtalerum der er forbundet til den!\nEr du sikker på, at du ønsker at gøre dette?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "Er du sikker på, at du ønsker at slette den valgte server?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "Kunne ikke redigere server: " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "Find" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "_Søg efter:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "_Versalfølsom" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "Søg _baglæns" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "_Ombryd" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "Brug _reuglære udtryk" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Find gruppesnak" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "_Navn:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "Deltag" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "_Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "_Server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "_Snak" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "_Motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "_Vis" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "_Hjælp" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "Forbind" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "Åbn log" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "_Præferencer" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "_Afslut" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "_Forbind" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "_Tilføj" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "_Håndter" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "_Åbn / deltag i samtale" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "_Find gruppesnak" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "_Ryd al aktivitet" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "_Næste snak" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "_Forrige snak" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "_Luk" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "_Brug lokal motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "_Tilføj ekstern motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "Skift ekstern motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "_Markørtilstand" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "_Navigeringstilstand" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "Vis _statuslinje" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "_Fuldskærm" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "_Om" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "Find gruppesamtale" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "_Hjemmeside" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "Vis _værktøjslinje" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "Smuxi - forbind" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - indstillinger" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "Brugernavne:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "Faneblade" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr " Placering af brugerliste" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " Kanal " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "Kanalfiltre" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "Brugerfiltre" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "Brug _SSH-tunnel" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "Aktiverer brugen af SSH til forbindelsen. Dette har en mindre ydelsespåvirkning, men er mere sikker og krævet med brug af NAT- eller portbaserede brandmure (firewalls)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "SSH-_vært:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "DNS- eller IP-adresse og port på SSH-serveren" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "_Port:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "DNS- eller IP-adresse og port på Smuxiserveren" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "_Smuxivært:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "_SSH-brugernavn: (valgfri)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "Brugernavn som vil blive brugt til at logge ind på SSH-serveren" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "_SSH-adgangskode: (valgfri)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "Adgangskode vil blive brugt til at logge ind på SSH-serveren. Adgangskoden er valgfri hvis SSH-nøglegodkendelse anvendes (se nedenfor)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "_SSH-nøglefil: (valgfri)" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "Vælg en fil" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "SSH-privatnøglefil vil blive brugt til at logge ind på SSH-serveren" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "_Brugernavn:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "Brugernavn som vil blive brugt til at logge ind til Smuxiserveren" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "_Adgangskode:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "Brugerens adgangskode" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "_Bekræft adgangskode:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "Gentag adgangskoden for bekræftelse" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "Velkommen til konfigurationsassistenten til Smuximotoren.\nDet er nødvendigt at indtaste nogle informationer før du kan bruge motoren.\n\nKlik »Fremad« for at begynde." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "_Motornavn:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "Profilnavn på den nye motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "_Standardmotor:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "Brug som ny standardmotor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "Hvis aktiveret, vil den aktuelle motor være standard næste gang Smuxi startes" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "Smuxi - åben snak" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "_Type:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "_Værtsnavn:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_Netværk:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "_Protokol:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "Brug kryptering" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "Valider servercertifikat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "Kommandoer _ved tilslutning:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "_Ignorer kommandoer" smuxi-0.11/po-Frontend-GNOME/POTFILES.in0000644000175000017500000000373712300202374020214 0ustar00meebeymeebey00000000000000glade/smuxi-frontend-gnome.glade src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in src/Frontend-GNOME/AboutDialog.cs src/Frontend-GNOME/CrashDialog.cs src/Frontend-GNOME/EngineManagerDialog.cs src/Frontend-GNOME/Entry.cs src/Frontend-GNOME/GnomeUI.cs src/Frontend-GNOME/MainWindow.cs src/Frontend-GNOME/NotImplementedMessageDialog.cs src/Frontend-GNOME/Preferences/PreferencesDialog.cs src/Frontend-GNOME/FindGroupChatDialog.cs src/Frontend-GNOME/Frontend.cs src/Frontend-GNOME/Notebook.cs src/Frontend-GNOME/NotifyManager.cs src/Frontend-GNOME/QuickConnectDialog.cs src/Frontend-GNOME/ChatTypeWidget.cs src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs src/Frontend-GNOME/Views/JoinWidget.cs src/Frontend-GNOME/Views/MenuWidget.cs src/Frontend-GNOME/Views/MessageTextView.cs src/Frontend-GNOME/Views/FilterListWidget.cs src/Frontend-GNOME/Views/Chats/ChatView.cs src/Frontend-GNOME/Views/Chats/GroupChatView.cs src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs src/Frontend-GNOME/Preferences/ServerListView.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FilterListWidget.cs smuxi-0.11/po-Frontend-GNOME/pt_BR.po0000644000175000017500000012415212300202374020000 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Leonardopf , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-05 19:06+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/smuxi/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "Preferências do Smuxi" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "O nick para usar. Você pode especificar vários nicks (separados por espaços) que serão usados quando o nick não estiver disponível. Por padrão $nick_ e $nick__ serão usados em caso de erros." #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "Apelido(s):" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Nome de usuário:" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "Nome Real:" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "Codificação:" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr " Geral " #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "Tipo:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "Servidor:" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "Senha:" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "Porta:" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Mostrar Senha" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr " Proxy de Rede " #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "Comandos ao conectar:" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "Comandos ao iniciar:" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr " Comandos Globais " #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "C_onexão" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "Formato do horário:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "Linhas de buffer:" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "Linhas de Buffer do motor:" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "ss = segundos\nmm = minutos\nhh = horas(01-12)\nHH = horas(00-23)\ntt = AM/PM\n\ndd = dia\nMM = mês\nyy/yyyy = ano" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "Tipo persistente:" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "Linhas de buffer volátil:" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "Linhas de buffer persistentes:" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr " Buffer de Mensagem " #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "Tirar Cores" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "Tirar formatações" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "Tirar UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "Mostrar Configurações Avançadas" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr " Avançado " #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "Geral" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "Topo" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "Fundo" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "Saiu" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "Direita" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "Nenhuma" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " Aba de posição " #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "Realçar" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "Atividade" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "Sem atividade" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "Join/Part/Mode" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " Aba de cores " #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "Automaticamente mudar para novos chats com pessoas" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "Automaticamente mudar para novos chats de grupo" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "Completar Caracter:" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "Caractere comando:" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "Histórico Tamanho do Comando" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Completar Estilo Bash" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " Campo de entrada " #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "Entrada" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "Cores do Nick" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr " Lista de Posições de Pessoas " #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "Sobrescrever" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " Fonte " #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " Posição do Tópico " #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "Primeiro Plano" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "Plano de fundo" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " Cor " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "_Modo de quebra:" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr " Chat" #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "Palavras para Realçar" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "Som ao realçar" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " Ressaltar " #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "Saida" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "Ativar" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "Sempre mostrar" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "Mostrar quando a janela é minimizada" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "Mostrar quando janela é fechada" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr " Ícone da Área de Notificação " #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "Mostrar Smuxi no menu de mensagens" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr " Menu de mensagens " #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "Mostrar janela de notificação" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr " Janela de notificação " #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "Notificação" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "_Interface" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "_Servidores" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "_Filtros" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "Ativado" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "Mensagens de Log Filtradas" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "_Logging" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - Servidor" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "Conectar automaticamente ao servidor no início" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "Protocolo:" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "Rede:" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "Servidor:" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "IRC Chat" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Smuxi Cliente IRC" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "Converse com outras pessoas no IRC" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "creditos tradução" #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "Smuxi Site" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "Vix, acho que fiz de novo..." #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi falhou por causa de uma exceção que não foi controlada!" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "Aqui está a parte do erro, Por favor reporte este problema!" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "_Reportar Problema" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "Motor não encontrado." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "Controlador de Motor" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "Selecione qual motor do Smuxi você deseja se conectar" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "Motor:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "Usar modo de pouca largura de banda" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "Motor Local" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "Por favor selecione um motor!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "Sua versão de primeiro plano ({0}) não é igual a versão do motor ({1})!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "Aconteceu um erro enquanto conectava ao motor!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "URL do motor: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "Erro: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Tem certeza que você deseja deletar o motor \"{0}\"?" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Você está colando {0} linhas. Deseja continuar?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "Comandos Finais" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Desculpe, não implementado ainda!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "Caracter " #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "Palavra" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "Volátil" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "Persistente" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "Sem Proxy" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "Padrão do Sistema" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "Conexão" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "Interface" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "Servidores" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "Filtros" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "Registrando log" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "Campo do(s) nick(s) não pode estar vazio." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Regex de realçamento Inválido . '{0}', Razão: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "Nome" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "Tópico" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "Procurando por grupo de chat sem filtro não é recomendado. Isso pode levar muito tempo, ou não funcionar.\nDeseja continuar?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "Erro enquanto baixando lista com grupos de chat do servidor." #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "Desconectado do motor." #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "Reconectando ao motor... (Tentativa {0})" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "Causa: {0}" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "O programa perdeu a conexão com o servidor.\nDeseja reconectar agora?" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "Reconexão ao servidor falhou.\nDeseja tentar novamente?" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "O servidor perdeu a conexão com o programa.\nDeseja reconectar agora?" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "Mostrar" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protocolo" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Nome do servidor" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "Não foi possível carregar servidor:" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "Pessoa / Privado" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "Grupo / Público" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "Assistente de motor - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "Adicionar Motor Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "Editar moto Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "Credenciais" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "Agora você pode usar o motor do Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "Obrigado" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "O motor com esse nome já existe! Por favor especifique outro nome." #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "Entre qual chat você deseja entrar" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "Sobre Smuxi" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "Preferências" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "Não foi possível adicionar servidor:" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Mudando o motor vai fazer com que você desconecte do motor atual!\nTem certeza que deseja fazer isso?" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Mudando para motor remoto você será desconectado do motor atual!\nTem certeza que deseja fazer isso?" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "Dia mudado de {0} para {1}" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "Dia mudado para {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Regex de filtro Inválido . '{0}', Razão: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "Tem certeza que deseja apagar o filtro selecionado?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "Protocolo / Servidor" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "Tipo de Chat" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "Normal" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "Evento" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "Tipo" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "Padrão" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "Modo de pouca largura de banda está ativado: Nenhuma mensagem sincronizada." #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "Mostrar _Barra de Menu" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Pegando lista de usuário de {0}..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "Feito." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "Pessoa" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "Fechando o protocolo do chat fechará também todos chats conectados a ele!\nCerteza que deseja fazer isso?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "Tem certeza que deseja apagar o servidor selecionado?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "Não foi possível editar o servidor:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "Procurar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "_Procurar por:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "_Caso combinar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "Procuar_Atrás" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "_Quebrar perto de" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "Usar _Expressão Regular" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Procurar Grupo de chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "_Nome:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "Entrar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "_Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "_Servidor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "_Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "_Motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "_Visão" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "_Ajuda" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "Conectar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "Abrir Log" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "_Preferências" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "_Sair" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "_Conectar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "_Adicionar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "_Administrar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "_Abrir / entrar chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "_Procurar Grupo de Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "L_impar todas atividades" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "_Proximo Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "_Chat Anterior" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "_Fechar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "_Usar Motor Local" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "_Adicionar Motor Remoto" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "Mudar motor remoto" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "_Modo Acento Circunflexo" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "_Modo de Navegação" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "Mostrar _Barra de estatus" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "_Tela inteira" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "_Sobre" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "Procurar Grupo de Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "_Site" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "Smuxi - Conectar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - Preferências" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "Apelidos:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "Abas" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr " Posição da lista de usuários " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " Canal " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr " Filtro de Canais " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr " Filtro de Usuário " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "Usar _Tunnel SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "Habilitar o uso do SSH para a conexão. Com isso uma pequena perfomance será perdida, mas é bem mais seguro e é requirido quando usando NAT ou firewall com restrinções de portas" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "SSH_Servidor:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "DNS ou endereço de IP e porta do servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "_Porta:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "DNS ou endereço de IP e porta do servidor Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "_Servidor Smuxi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "_Nome de usuário SSH: (opcional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "Nome de usuário que será usado para fazer login no servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "_Senha SSH: (opcional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "Senha que será usada para fazer login no servidor SSH. A senha é opcional se a chave SSH for usada(Veja mais abaixo)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "_Chave SSH: (opcional)" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "Selecione o arquivo" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "Chave SSH privada que será usada para fazer login no servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "_Nome de usuário:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "Nome de usuário que será usado para fazer login no servidor Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "_Senha:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "Senha do usuário" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "_Verificar senha:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "Repetir a senha para verificação" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "Bem vindo ao assistente de configuração do motor do Smuxi.\nVocê precisa entrar algumas informações antes que possa usar o motor.\n\nClique \"Continuar\" para começar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "_Nome Motor:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "Nome do perfil do novo motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "_Motor Padrão:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "Usar como novo motor padrão" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "Se ativado, o motor atual será o padrão na proxima vez que o Smuxi iniciar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "Smuxi - Chat Aberto" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "_Tipo:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "_Endereço Servidor:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_Rede:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "_Protocolo:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "Usar Encriptação" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "Validar Certificado do Servidor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "_Comandos ao conectar:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "_Comandos para ignorar" smuxi-0.11/po-Frontend-GNOME/ru.po0000644000175000017500000011134412300202374017417 0ustar00meebeymeebey00000000000000# msgid "" msgstr "" "Project-Id-Version: smuxi 0.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: \n" "Last-Translator: Алекс \n" "Language-Team: None <->\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n%10==1 && n%100!=11 ? 3 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Poedit-Language: Russian\n" "X-Poedit-Country: RUSSIAN FEDERATION\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid " Chat " msgstr " Разговор " #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid " Color " msgstr " Цвета " #: ../glade/smuxi-frontend-gnome.glade.h:3 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1364 msgid " Entry Field " msgstr " Строка ввода " #: ../glade/smuxi-frontend-gnome.glade.h:4 msgid " Font " msgstr " Шрифт " #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1694 msgid " Highlighting " msgstr " Подсветка " #: ../glade/smuxi-frontend-gnome.glade.h:6 msgid " Notification Area Icon " msgstr " Значок в области уведомлений " #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid " Person List Position " msgstr " Список участников " #: ../glade/smuxi-frontend-gnome.glade.h:8 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1201 msgid " Tab Colors " msgstr " Цвета вкладок " #: ../glade/smuxi-frontend-gnome.glade.h:9 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1102 msgid " Tabs Position " msgstr " Положение " #: ../glade/smuxi-frontend-gnome.glade.h:10 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1507 msgid " Topic Position " msgstr " Тема " #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "General" msgstr "Общие" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Global Commands" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:13 msgid "Messaging Menu" msgstr "Меню сообщений" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "Прокси-сервер" #: ../glade/smuxi-frontend-gnome.glade.h:15 msgid "Notification Popups" msgstr "Вcплываюoщие cообщения" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1153 msgid "Activity" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:17 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:235 msgid "Automatically connect to server at startup" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:18 msgid "Background" msgstr "Фон" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1352 msgid "Bash-Style Completion" msgstr "Дополнение в стиле Bash" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1682 msgid "Beep on highlight" msgstr "Звуковой сигнал" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:972 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:994 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1453 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1478 msgid "Bottom" msgstr "Снизу" #: ../glade/smuxi-frontend-gnome.glade.h:22 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:738 msgid "Buffer Lines:" msgstr "Раз_мер буфера:" #: ../glade/smuxi-frontend-gnome.glade.h:23 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:663 msgid "C_onnection" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:24 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1304 msgid "Command Character:" msgstr "Символ команды:" #: ../glade/smuxi-frontend-gnome.glade.h:25 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1327 msgid "Command History Size:" msgstr "Размер журнала команд:" #: ../glade/smuxi-frontend-gnome.glade.h:26 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1284 msgid "Completion Character:" msgstr "Символ дополнения:" #: ../glade/smuxi-frontend-gnome.glade.h:27 msgid "Enable" msgstr "Включить" #: ../glade/smuxi-frontend-gnome.glade.h:28 msgid "Enabled" msgstr "Запись в журнал" #: ../glade/smuxi-frontend-gnome.glade.h:29 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:551 msgid "Encoding:" msgstr "Кодировка:" #: ../glade/smuxi-frontend-gnome.glade.h:30 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:761 msgid "Engine Buffer Lines:" msgstr "Строк в буфере ядра:" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Foreground" msgstr "Текст" #: ../glade/smuxi-frontend-gnome.glade.h:32 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:917 msgid "General" msgstr "Общие" #: ../glade/smuxi-frontend-gnome.glade.h:33 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1173 msgid "Highlight" msgstr "Подсветка" #: ../glade/smuxi-frontend-gnome.glade.h:34 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1658 msgid "Highlight words:" msgstr "Подсвечивать слова" #: ../glade/smuxi-frontend-gnome.glade.h:35 msgid "Host:" msgstr "Сервер:" #: ../glade/smuxi-frontend-gnome.glade.h:36 msgid "Hostname:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1373 msgid "Input" msgstr "Ввод" #: ../glade/smuxi-frontend-gnome.glade.h:38 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1163 msgid "Join/Part/Mode" msgstr "Служебные сообщения" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:39 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1008 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1033 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1527 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1553 msgid "Left" msgstr "Слева" #: ../glade/smuxi-frontend-gnome.glade.h:40 msgid "Log Filtered Messages" msgstr "Включать отфильтрованные сообщения" #: ../glade/smuxi-frontend-gnome.glade.h:41 msgid "Network:" msgstr "Сеть:" #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1394 msgid "Nick Colors" msgstr "Цветные имена" #: ../glade/smuxi-frontend-gnome.glade.h:43 msgid "Nickname(s):" msgstr "Имена:" #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1145 msgid "No Activity" msgstr "Без изменений" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1088 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1493 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1608 msgid "None" msgstr "Нет" #: ../glade/smuxi-frontend-gnome.glade.h:46 msgid "Notification" msgstr "Оповещения" #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:573 msgid "On Connect Commands:" msgstr "Команды при соединении:" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:619 msgid "On Startup Commands:" msgstr "Команды при запуске:" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1706 msgid "Output" msgstr "Вывод" #: ../glade/smuxi-frontend-gnome.glade.h:50 msgid "Override" msgstr "Изменить:" #: ../glade/smuxi-frontend-gnome.glade.h:51 msgid "Password:" msgstr "Пароль:" #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Port:" msgstr "Порт:" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Protocol:" msgstr "Протокол:" #: ../glade/smuxi-frontend-gnome.glade.h:54 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:530 msgid "Realname:" msgstr "Полное имя:" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1048 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1073 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1568 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1593 msgid "Right" msgstr "Справа" #: ../glade/smuxi-frontend-gnome.glade.h:56 msgid "Show Advanced Settings" msgstr "Показывать расширенные настройки" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:196 msgid "Show Password" msgstr "Отображать пароль" #: ../glade/smuxi-frontend-gnome.glade.h:58 msgid "Show Smuxi in the messaging menu" msgstr "Включать Smuxi в меню сообщений" #: ../glade/smuxi-frontend-gnome.glade.h:59 msgid "Show always" msgstr "Всегда" #: ../glade/smuxi-frontend-gnome.glade.h:60 msgid "Show notification popups" msgstr "Использовать всплывающие сообщения" #: ../glade/smuxi-frontend-gnome.glade.h:61 msgid "Show when window is closed" msgstr "Когда окно закрыто" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid "Show when window is minimized" msgstr "Когда окно свернуто" #: ../glade/smuxi-frontend-gnome.glade.h:63 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:398 msgid "Smuxi - Preferences" msgstr "Smuxi - параметры" #: ../glade/smuxi-frontend-gnome.glade.h:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:18 msgid "Smuxi - Server" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:820 msgid "Strip Colors" msgstr "Убирать цвета" #: ../glade/smuxi-frontend-gnome.glade.h:66 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:859 msgid "Strip Formattings" msgstr "Убирать начертания" #: ../glade/smuxi-frontend-gnome.glade.h:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:899 msgid "Strip UTF-8" msgstr "Убирать символы UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:68 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1214 msgid "Tabs" msgstr "Вкладки" #: ../glade/smuxi-frontend-gnome.glade.h:69 msgid "The nickname to use. You can specify extra nicknames (separated by spaces) which will be used as fallbacks when the first choice is not available. By default $nick_ and $nick__ will be used as fallbacks." msgstr "Используемое имя. Можно указать дополнительные имена, разделенные пробелами, которые будут использоваться, если первое недоступно; по умолчанию для этого будут использоваться варианты $nick_ и $nick__." #: ../glade/smuxi-frontend-gnome.glade.h:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:718 msgid "Timestamp Format:" msgstr "Формат метки времени:" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:71 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:935 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:959 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1412 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1438 msgid "Top" msgstr "Сверху" #: ../glade/smuxi-frontend-gnome.glade.h:72 msgid "Type:" msgstr "Тип:" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:507 msgid "Username:" msgstr "Имя пользователя:" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1873 msgid "_Filters" msgstr "_Фильтры" #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1715 msgid "_Interface" msgstr "_Вид" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "_Logging" msgstr "_Журнал" #: ../glade/smuxi-frontend-gnome.glade.h:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1781 msgid "_Servers" msgstr "_Серверы" #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "_Wrap Mode:" msgstr "Режим п_ереноса:" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Chat with other people on IRC" msgstr "Разговор с людьми в сети IRC" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "IRC-чат" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "IRC-клиент Smuxi" #: ../src/Frontend-GNOME/AboutDialog.cs:58 msgid "translator-credits" msgstr "Alexandr Ponomarenko, 2010" #: ../src/Frontend-GNOME/AboutDialog.cs:61 msgid "Smuxi Website" msgstr "Сайт Smuxi" #: ../src/Frontend-GNOME/CrashDialog.cs:44 msgid "Oops, I did it again..." msgstr "Опять двадцать пять..." #: ../src/Frontend-GNOME/CrashDialog.cs:57 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi аварийно завершается из-за необработанного исключения!" #: ../src/Frontend-GNOME/CrashDialog.cs:61 msgid "Here is the stacktrace, please report this bug!" msgstr "Сообщите об ошибке, приложив эту трассировку." #: ../src/Frontend-GNOME/CrashDialog.cs:81 msgid "_Report Bug" msgstr "Сообщить об о_шибке" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:61 msgid "Engine Manager" msgstr "Управление ядрами" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:68 msgid "_Connect" msgstr "П_одключение" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:84 msgid "Select which Smuxi engine you want to connect to" msgstr "Выберите ядро Smuxi, к которому следует подключиться" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:90 msgid "Engine:" msgstr "Ядро:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:116 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:176 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:353 msgid "Local Engine" msgstr "Локальное ядро" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:168 msgid "Please select an engine!" msgstr "Нужно выбрать ядро!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:189 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "Версия оболочки ({0}) не соответствует версии ядра ({1})!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:216 msgid "An error occurred while connecting to the engine!" msgstr "Ошибка при подключении к ядру!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:217 #, csharp-format msgid "Engine URL: {0}" msgstr "Адрес URL: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:220 #, csharp-format msgid "Error: {0}" msgstr "Ошибка: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:290 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Вы действительно хотите удалить ядро \"{0}\"?" #: ../src/Frontend-GNOME/Entry.cs:421 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Будут вставлены {0} строк текста. Продолжить?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:524 msgid "Frontend Commands" msgstr "Команды оболочки" #: ../src/Frontend-GNOME/MainWindow.cs:222 msgid "_File" msgstr "_Файл" #: ../src/Frontend-GNOME/MainWindow.cs:238 msgid "_Server" msgstr "_Сервер" #: ../src/Frontend-GNOME/MainWindow.cs:242 msgid "_Quick Connect" msgstr "_Быстрое соединение" #: ../src/Frontend-GNOME/MainWindow.cs:253 msgid "_Manage" msgstr "_Управление" #: ../src/Frontend-GNOME/MainWindow.cs:260 msgid "_Chat" msgstr "_Разговор" #: ../src/Frontend-GNOME/MainWindow.cs:264 msgid "Open / Join Chat" msgstr "_Начать или вступить..." #: ../src/Frontend-GNOME/MainWindow.cs:269 msgid "_Find Group Chat" msgstr "Найти _конференцию" #: ../src/Frontend-GNOME/MainWindow.cs:274 msgid "C_lear All Activity" msgstr "У_брать метки активности" #: ../src/Frontend-GNOME/MainWindow.cs:281 msgid "_Next Chat" msgstr "С_ледующий" #: ../src/Frontend-GNOME/MainWindow.cs:291 msgid "_Previous Chat" msgstr "Пре_дыдущий" #: ../src/Frontend-GNOME/MainWindow.cs:341 msgid "Open Log" msgstr "Открыть _журнал" #: ../src/Frontend-GNOME/MainWindow.cs:355 msgid "_Engine" msgstr "_Ядро" #: ../src/Frontend-GNOME/MainWindow.cs:359 msgid "_Use Local Engine" msgstr "_Локальное ядро" #: ../src/Frontend-GNOME/MainWindow.cs:365 msgid "_Add Remote Engine" msgstr "_Добавить ядро в сети" #: ../src/Frontend-GNOME/MainWindow.cs:370 msgid "_Switch Remote Engine" msgstr "_Выбрать ядро в сети" #: ../src/Frontend-GNOME/MainWindow.cs:377 msgid "_View" msgstr "_Вид" #: ../src/Frontend-GNOME/MainWindow.cs:381 msgid "_Caret Mode" msgstr "Режим _выделения" #: ../src/Frontend-GNOME/MainWindow.cs:389 msgid "_Browse Mode" msgstr "Режим _обзора" #: ../src/Frontend-GNOME/MainWindow.cs:403 #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:586 msgid "Show _Menubar" msgstr "Строка _меню" #: ../src/Frontend-GNOME/MainWindow.cs:430 msgid "_Help" msgstr "Спр_авка" #: ../src/Frontend-GNOME/MainWindow.cs:691 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:225 msgid "Unable to add server: " msgstr "Не удалось добавить сервер: " #: ../src/Frontend-GNOME/MainWindow.cs:742 #, csharp-format msgid "Unknown ChatType: {0}" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:971 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Переключение на локальное ядро отключит вас от текущего!\n" "Продолжить?" #: ../src/Frontend-GNOME/MainWindow.cs:1013 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Смена ядра в сети отключит вас от текущего!\n" "Продолжить?" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Функция не реализована." #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:179 msgid "Character" msgstr "по символам" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:180 msgid "Word" msgstr "по словам" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:198 msgid "No Proxy" msgstr "Без прокси-сервера" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:212 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:139 msgid "Connection" msgstr "Соединение" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:216 msgid "Interface" msgstr "Вид" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:220 msgid "Servers" msgstr "Серверы" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:227 msgid "Filters" msgstr "Фильтры" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:231 msgid "Logging" msgstr "Журнал" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:281 msgid "System Default" msgstr "Системная" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:588 msgid "Nicknames(s) field must not be empty." msgstr "Нужно указать хотя бы одно имя" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:748 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Неверное выражение для подсветки: '{0}'. Причина: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:69 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:105 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:271 msgid "Name" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:74 msgid "Topic" msgstr "Тема" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:102 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "" "Поиск конференций без указания фильтра не рекомендуется. Это может занять много времени, но не принести результата.\n" "Продолжить?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:143 msgid "Error while fetching the list of group chats from the server." msgstr "Не удалось получить с сервера список конференций." #: ../src/Frontend-GNOME/Frontend.cs:399 #, csharp-format msgid "Cause: {0}" msgstr "Причина: {0}" #: ../src/Frontend-GNOME/Frontend.cs:469 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:484 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "" "Не удалось возобновить подключение к серверу.\n" "Попробовать еще раз?" #: ../src/Frontend-GNOME/Frontend.cs:585 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "" #: ../src/Frontend-GNOME/NotifyManager.cs:229 msgid "Show" msgstr "" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:62 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:238 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Протокол" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:63 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Имя" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:166 msgid "Unable to load server: " msgstr "Не удалось загрузить сервер: " #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:244 msgid "Person / Private" msgstr "Личные" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:245 msgid "Group / Public" msgstr "Групповые и обществ." #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:70 msgid "Engine Assistant - Smuxi" msgstr "Мастер настройки - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:92 msgid "Add Smuxi Engine" msgstr "Добавить ядро Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:94 msgid "Edit Smuxi Engine" msgstr "Свойства ядра Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:203 msgid "Credentials" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:265 msgid "Now you can use the Smuxi Engine" msgstr "Ядро Smuxi готово к использованию" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:268 msgid "Thank you" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:285 msgid "An engine with this name already exists! Please specify a different one." msgstr "Ядро под таким названием уже существует! Выберите другое." #: ../src/Frontend-GNOME/Views/MessageTextView.cs:198 #, csharp-format msgid "Day changed to {0}" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:123 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:133 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Неверное выражение фильтра: '{0}'. Причина: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:200 msgid "Are you sure you want to delete the selected filter?" msgstr "Вы хотите удалить выбранный фильтр?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:246 msgid "Protocol / Server" msgstr "Протокол и сервер" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:253 msgid "Chat Type" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:287 msgid "Normal" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:288 msgid "Event" msgstr "Событие" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:295 msgid "Type" msgstr "Тип" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:321 msgid "Pattern" msgstr "Шаблон" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:242 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Получение списка пользователей на {0}..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:289 msgid "done." msgstr "готово." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:304 msgid "Person" msgstr "Люди" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:68 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "" "Закрытие окна протокола прервет все разговоры по этому протоколу.\n" "Вы действительно хотите это сделать?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:187 msgid "Are you sure you want to delete the selected server?" msgstr "Вы хотите удалить выбранный сервер?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:243 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:277 msgid "Unable to edit server: " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:34 msgid "Find" msgstr "Поиск" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:54 msgid "_Search for:" msgstr "_Искать:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:83 msgid "_Match Case" msgstr "С _учетом регистра" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:95 msgid "Search _Backwards" msgstr "На_зад" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:107 msgid "_Wrap Around" msgstr "Во _всем тексте" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:120 msgid "Use _Regular Expressions" msgstr "_Регулярные выражения" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:32 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Поиск конференций" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:79 msgid "_Name:" msgstr "_Название:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:24 msgid "Smuxi - Quick Connect" msgstr "Smuxi - Быстрое соединение" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:487 msgid "Nicknames:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1622 msgid " User List Position " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1633 msgid " Channel " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1844 msgid "Channel Filters" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1861 msgid "User Filters" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "Use _SSH Tunnel" msgstr "Использовать _туннелирование SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:70 msgid "Enables the use of SSH for the connection. This has a small performance impact, but is more secure and required when using NAT or port-based firewalls" msgstr "Использовать SSH для данного соединения. Это слегка снижает производительность, но обеспечивает безопасность и позволяет соединяться через NAT и брандмауэры." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:149 msgid "SSH _Host:" msgstr "_Сервер SSH:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:160 msgid "DNS or IP address and port of the SSH server" msgstr "Имя или адрес, а так же порт сервера SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:187 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:155 msgid "_Port:" msgstr "_Порт:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:200 msgid "DNS or IP address and port of the Smuxi server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:213 msgid "_Smuxi Host:" msgstr "_Адрес Smuxi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:68 msgid "_SSH Username: (optional)" msgstr "_Имя пользователя SSH Username: (необязательно)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:91 msgid "Username which will be used to log into the SSH server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:111 msgid "_SSH Password: (optional)" msgstr "П_ароль SSH: (необязательно)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:135 msgid "Password which will be used to log into the SSH server. The password is optional if SSH key authorization is used (via Pageant from the PuTTY tools)." msgstr "Пароль для входа на сервер SSH. Необязательно, если используются сертификаты (напр. через Pageant из пакета PuTTY)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:156 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:214 msgid "_Username:" msgstr "И_мя пользователя:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:179 msgid "Username which will be used to log into the Smuxi server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:199 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:113 msgid "_Password:" msgstr "_Пароль:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:223 msgid "Password of the user" msgstr "Пароль пользователя" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:243 msgid "_Verify Password:" msgstr "Про_верка пароля:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:267 msgid "Repeat the password for verification" msgstr "Введите пароль еще раз для проверки" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "" "Добро пожаловать в мастер настройки ядра Smuxi.\n" "Перед его использованием потребуется указать некоторые сведения.\n" "\n" "Щелкните \"Вперёд\"." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:44 msgid "_Engine Name:" msgstr "_Название ядра:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:67 msgid "Profile name of the new engine" msgstr "Название профиля для нового ядра" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:88 msgid "_Default Engine:" msgstr "По _умолчанию:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:99 msgid "Use as new default engine" msgstr "Использовать как ядро по умолчанию" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:112 msgid "If enabled, the current engine will be the default next time Smuxi is started" msgstr "Использовать данное ядро по умолчанию при следующем запуске Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:26 msgid "Smuxi - Open Chat" msgstr "Smuxi - Выбор разговора" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:69 msgid "_Type:" msgstr "_Тип:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:80 msgid "_Hostname:" msgstr "_Сервер:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:101 msgid "_Network:" msgstr "С_еть:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:224 msgid "_Protocol:" msgstr "П_ротокол:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:248 msgid "Use Encryption" msgstr "Использовать _шифрование" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:260 msgid "Validate Server Certificate" msgstr "Проверять сертификат сервера" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:280 msgid "_On Connect Commands:" msgstr "П_ри подключении:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:291 msgid "_Ignore Commands" msgstr "И_гнорировать команды" smuxi-0.11/po-Frontend-GNOME/pl.po0000644000175000017500000010021712300202374017401 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:22+0100\n" "PO-Revision-Date: 2012-01-06 16:36+0000\n" "Last-Translator: OkweL \n" "Language-Team: Polish (http://www.transifex.net/projects/p/smuxi/team/pl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pl\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid " Chat " msgstr " Czat" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid " Color " msgstr " Kolor" #: ../glade/smuxi-frontend-gnome.glade.h:3 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " Pole wprowadzania danych" #: ../glade/smuxi-frontend-gnome.glade.h:4 msgid " Font " msgstr " Czcionka" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " Powiadomienia" #: ../glade/smuxi-frontend-gnome.glade.h:6 msgid " Notification Area Icon " msgstr " Ikona w obszarze powiadomień" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid " Person List Position " msgstr " Pozycja listy osób" #: ../glade/smuxi-frontend-gnome.glade.h:8 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " Kolory kart" #: ../glade/smuxi-frontend-gnome.glade.h:9 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " Pozycja kart" #: ../glade/smuxi-frontend-gnome.glade.h:10 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " Pozycja tematu" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Advanced" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "General" msgstr " Ogólne" #: ../glade/smuxi-frontend-gnome.glade.h:13 msgid "Global Commands" msgstr " Komendy dla wszystkich sieci" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Message Buffer" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:15 msgid "Messaging Menu" msgstr " Menu wiadomości" #: ../glade/smuxi-frontend-gnome.glade.h:16 msgid "Network Proxy" msgstr " Proxy" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Notification Popups" msgstr " Pop-upy powiadomień" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "Aktywność" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "Automatycznie połącz się z serwerem przy starcie Smuxi" #: ../glade/smuxi-frontend-gnome.glade.h:20 msgid "Background" msgstr "Tło" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Uzupełnianie (jak w bashu)" #: ../glade/smuxi-frontend-gnome.glade.h:22 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "Powiadomienie dźwiękowe" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:23 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "Dół" #: ../glade/smuxi-frontend-gnome.glade.h:24 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "Ilość linii bufora" #: ../glade/smuxi-frontend-gnome.glade.h:25 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "Połączenie" #: ../glade/smuxi-frontend-gnome.glade.h:26 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "Znak komend" #: ../glade/smuxi-frontend-gnome.glade.h:27 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "Rozmiar historii komend" #: ../glade/smuxi-frontend-gnome.glade.h:28 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "Znak uzupełniania" #: ../glade/smuxi-frontend-gnome.glade.h:29 msgid "Enable" msgstr "Włącz" #: ../glade/smuxi-frontend-gnome.glade.h:30 msgid "Enabled" msgstr "Włączone" #: ../glade/smuxi-frontend-gnome.glade.h:31 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "Kodowanie" #: ../glade/smuxi-frontend-gnome.glade.h:32 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "Ilość linii bufora programu" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Foreground" msgstr "Tekst" #: ../glade/smuxi-frontend-gnome.glade.h:34 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "Ogólne" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "Powiadomienia" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "Słowa" #: ../glade/smuxi-frontend-gnome.glade.h:37 msgid "Host:" msgstr "Host" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Hostname:" msgstr "Nazwa hosta" #: ../glade/smuxi-frontend-gnome.glade.h:39 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "Wyszedł" #: ../glade/smuxi-frontend-gnome.glade.h:42 msgid "Log Filtered Messages" msgstr "Loguj filtrowane wiadomości" #: ../glade/smuxi-frontend-gnome.glade.h:43 msgid "Network:" msgstr "Sieć" #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:45 msgid "Nickname(s):" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "Brak aktywności" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:48 msgid "Notification" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "Komendy po połączeniu" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "Komendy po włączeniu" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Override" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Password:" msgstr "Hasło:" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Persistency Type:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:55 msgid "Persistent Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:56 msgid "Port:" msgstr "Port:" #: ../glade/smuxi-frontend-gnome.glade.h:57 msgid "Protocol:" msgstr "Protokół:" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "Prawdziwe imię:" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:60 msgid "Show Advanced Settings" msgstr "Pokaż zaawansowane opcje" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Pokaż hasło" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid "Show Smuxi in the messaging menu" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Show always" msgstr "Zawsze pokazuj" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid "Show notification popups" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:65 msgid "Show when window is closed" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Show when window is minimized" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - Serwer" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid "Smuxi Preferences" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:69 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:71 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "Zakładki" #: ../glade/smuxi-frontend-gnome.glade.h:73 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Type:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Użytkownik" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Volatile Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:80 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "_Logging" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:82 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "" #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "_Wrap Mode:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "" "ss = sekundy\n" "mm = minuty\n" "hh = godziny (01 - 12)\n" "HH = godziny (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = dzień\n" "MM = miesiąc\n" "yy/yyyy = rok" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Chat with other people on IRC" msgstr "" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi" msgstr "" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Smuxi IRC Client" msgstr "" #: ../src/Frontend-GNOME/AboutDialog.cs:60 msgid "translator-credits" msgstr "" #: ../src/Frontend-GNOME/AboutDialog.cs:65 msgid "Smuxi Website" msgstr "Strona internetowa Smuxi" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:61 msgid "Engine Manager" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:80 msgid "Select which Smuxi engine you want to connect to" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:86 msgid "Engine:" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:97 msgid "Use Low Bandwidth Mode" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:121 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:181 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:358 msgid "Local Engine" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:173 msgid "Please select an engine!" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:194 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:221 msgid "An error occurred while connecting to the engine!" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:222 #, csharp-format msgid "Engine URL: {0}" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:225 #, csharp-format msgid "Error: {0}" msgstr "Błąd: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:295 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "" #: ../src/Frontend-GNOME/Entry.cs:443 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Zamierzasz wkleić {0} linii. Czy chcesz kontynuować?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:547 msgid "Frontend Commands" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:252 msgid "_File" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:276 msgid "_Server" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:280 msgid "_Quick Connect" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:291 msgid "_Manage" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:298 msgid "_Chat" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:302 msgid "Open / Join Chat" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:308 msgid "_Find Group Chat" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:314 msgid "C_lear All Activity" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:321 msgid "_Next Chat" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:335 msgid "_Previous Chat" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:389 msgid "Open Log" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:407 msgid "_Engine" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:411 msgid "_Use Local Engine" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:417 msgid "_Add Remote Engine" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:422 msgid "_Switch Remote Engine" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:429 msgid "_View" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:433 msgid "_Caret Mode" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:445 msgid "_Browse Mode" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:463 #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:722 msgid "Show _Menubar" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:494 msgid "_Help" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:768 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:225 msgid "Unable to add server: " msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:828 #, csharp-format msgid "Unknown ChatType: {0}" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:1097 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" #: ../src/Frontend-GNOME/MainWindow.cs:1139 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:179 msgid "Character" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:180 msgid "Word" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:197 msgid "Volatile" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:199 msgid "Persistent" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:222 msgid "No Proxy" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:224 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:307 msgid "System Default" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:238 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:242 msgid "Interface" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:246 msgid "Servers" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:253 msgid "Filters" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:257 msgid "Logging" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:642 msgid "Nicknames(s) field must not be empty." msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:823 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:271 msgid "Name" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:325 msgid "Disconnected from engine." msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:368 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:465 #, csharp-format msgid "Cause: {0}" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:583 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:602 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:705 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "" #: ../src/Frontend-GNOME/NotifyManager.cs:267 msgid "Show" msgstr "" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:62 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:238 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:63 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:166 msgid "Unable to load server: " msgstr "" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:244 msgid "Person / Private" msgstr "" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:245 msgid "Group / Public" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:204 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:210 #, csharp-format msgid "Day changed to {0}" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:123 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:133 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:200 msgid "Are you sure you want to delete the selected filter?" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:246 msgid "Protocol / Server" msgstr "Protokół / Serwer" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:253 msgid "Chat Type" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:287 msgid "Normal" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:288 msgid "Event" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:295 msgid "Type" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:321 msgid "Pattern" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:506 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:245 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "" #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:279 msgid "done." msgstr "" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:290 msgid "Person" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:69 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:187 msgid "Are you sure you want to delete the selected server?" msgstr "Czy na pewno chcesz usunąć zaznaczony serwer?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:243 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:277 msgid "Unable to edit server: " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "Szukaj" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Quick Connect" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - Opcje" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "" smuxi-0.11/po-Frontend-GNOME/LINGUAS0000644000175000017500000000011312311343665017460 0ustar00meebeymeebey00000000000000ca cs da de es es_AR en_GB fa fi fr hr it nl pl pt pt_BR ru sv te tr zh_CN smuxi-0.11/po-Frontend-GNOME/it.po0000644000175000017500000011006612300202374017405 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2010 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # David Paleino , 2008. # # Vincenzo Campanella , 2009-2010, 2010. msgid "" msgstr "" "Project-Id-Version: smuxi-frontend-gnome\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-11 11:52+0200\n" "PO-Revision-Date: 2010-09-11 09:50+0200\n" "Last-Translator: Vincenzo Campanella \n" "Language-Team: Italian \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid " Chat " msgstr " Chat " #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid " Color " msgstr " Colore " #: ../glade/smuxi-frontend-gnome.glade.h:3 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1364 msgid " Entry Field " msgstr " Campo d'inserimento " #: ../glade/smuxi-frontend-gnome.glade.h:4 msgid " Font " msgstr " Carattere " #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1694 msgid " Highlighting " msgstr " Evidenziazione " #: ../glade/smuxi-frontend-gnome.glade.h:6 msgid " Notification Area Icon " msgstr " Icona dell'area di notifica " #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid " Person List Position " msgstr " Posizione dell'elenco persone " #: ../glade/smuxi-frontend-gnome.glade.h:8 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1201 msgid " Tab Colors " msgstr " Colori delle schede " #: ../glade/smuxi-frontend-gnome.glade.h:9 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1102 msgid " Tabs Position " msgstr " Posizione delle schede " #: ../glade/smuxi-frontend-gnome.glade.h:10 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1507 msgid " Topic Position " msgstr " Posizione dell'argomento " #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "General" msgstr "Generale" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Global Commands" msgstr "Comandi globali" #: ../glade/smuxi-frontend-gnome.glade.h:13 msgid "Messaging Menu" msgstr "Menu dei messaggi" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "Proxy di rete" #: ../glade/smuxi-frontend-gnome.glade.h:15 msgid "Notification Popups" msgstr " Finestre a comparsa di notifica " #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1153 msgid "Activity" msgstr "Attività" # #: ../glade/smuxi-frontend-gnome.glade.h:17 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:235 msgid "Automatically connect to server at startup" msgstr "Connessione automatica al server all'avvio" #: ../glade/smuxi-frontend-gnome.glade.h:18 msgid "Background" msgstr "Sfondo" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1352 msgid "Bash-Style Completion" msgstr "Completamento in stile bash" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1682 msgid "Beep on highlight" msgstr "Avviso acustico sull'evidenziazione" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:972 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:994 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1453 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1478 msgid "Bottom" msgstr "Giù" #: ../glade/smuxi-frontend-gnome.glade.h:22 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:738 msgid "Buffer Lines:" msgstr "Righe di buffer:" #: ../glade/smuxi-frontend-gnome.glade.h:23 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:663 msgid "C_onnection" msgstr "C_onnessione" #: ../glade/smuxi-frontend-gnome.glade.h:24 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1304 msgid "Command Character:" msgstr "Carattere di comando:" #: ../glade/smuxi-frontend-gnome.glade.h:25 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1327 msgid "Command History Size:" msgstr "Dimensione della cronologia dei comandi:" #: ../glade/smuxi-frontend-gnome.glade.h:26 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1284 msgid "Completion Character:" msgstr "Carattere di completamento:" #: ../glade/smuxi-frontend-gnome.glade.h:27 msgid "Enable" msgstr "Abilita" #: ../glade/smuxi-frontend-gnome.glade.h:28 msgid "Enabled" msgstr "Abilitato" #: ../glade/smuxi-frontend-gnome.glade.h:29 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:551 msgid "Encoding:" msgstr "Codifica:" #: ../glade/smuxi-frontend-gnome.glade.h:30 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:761 msgid "Engine Buffer Lines:" msgstr "Righe di buffer del motore:" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Foreground" msgstr "In primo piano" #: ../glade/smuxi-frontend-gnome.glade.h:32 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:917 msgid "General" msgstr "Generale" #: ../glade/smuxi-frontend-gnome.glade.h:33 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1173 msgid "Highlight" msgstr "Evidenziazione" #: ../glade/smuxi-frontend-gnome.glade.h:34 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1658 msgid "Highlight words:" msgstr "Evidenzia parole:" #: ../glade/smuxi-frontend-gnome.glade.h:35 msgid "Host:" msgstr "Host:" #: ../glade/smuxi-frontend-gnome.glade.h:36 msgid "Hostname:" msgstr "Nome dell'host:" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1373 msgid "Input" msgstr "Input" #: ../glade/smuxi-frontend-gnome.glade.h:38 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1163 msgid "Join/Part/Mode" msgstr "Entra/Esci/Modo" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:39 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1008 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1033 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1527 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1553 msgid "Left" msgstr "Sinistra" #: ../glade/smuxi-frontend-gnome.glade.h:40 msgid "Log Filtered Messages" msgstr "Messaggi di registro filtrati" #: ../glade/smuxi-frontend-gnome.glade.h:41 msgid "Network:" msgstr "Rete:" #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1394 msgid "Nick Colors" msgstr "Colori dei soprannomi" #: ../glade/smuxi-frontend-gnome.glade.h:43 msgid "Nickname(s):" msgstr "Soprannomi:" #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1145 msgid "No Activity" msgstr "Nessuna attività" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1088 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1493 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1608 msgid "None" msgstr "Nessuna" #: ../glade/smuxi-frontend-gnome.glade.h:46 msgid "Notification" msgstr "Notifica" #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:573 msgid "On Connect Commands:" msgstr "Comandi alla connessione:" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:619 msgid "On Startup Commands:" msgstr "Comandi all'avvio:" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1706 msgid "Output" msgstr "Output" #: ../glade/smuxi-frontend-gnome.glade.h:50 msgid "Override" msgstr "Sovrascrivi" #: ../glade/smuxi-frontend-gnome.glade.h:51 msgid "Password:" msgstr "Password:" #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Port:" msgstr "Porta:" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Protocol:" msgstr "Protocollo:" #: ../glade/smuxi-frontend-gnome.glade.h:54 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:530 msgid "Realname:" msgstr "Nome reale:" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1048 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1073 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1568 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1593 msgid "Right" msgstr "Destra" #: ../glade/smuxi-frontend-gnome.glade.h:56 msgid "Show Advanced Settings" msgstr "Mostra impostazioni avanzate" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:196 msgid "Show Password" msgstr "Mostra la password" #: ../glade/smuxi-frontend-gnome.glade.h:58 msgid "Show Smuxi in the messaging menu" msgstr "Mostra Smuxi nel menù dei messaggi" #: ../glade/smuxi-frontend-gnome.glade.h:59 msgid "Show always" msgstr "Mostra sempre" #: ../glade/smuxi-frontend-gnome.glade.h:60 msgid "Show notification popups" msgstr "Mostra finestre a comparsa di notifica" #: ../glade/smuxi-frontend-gnome.glade.h:61 msgid "Show when window is closed" msgstr "Mostra quando la finestra viene chiusa" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid "Show when window is minimized" msgstr "Mostra quando la finestra viene minimizzata" #: ../glade/smuxi-frontend-gnome.glade.h:63 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:398 msgid "Smuxi - Preferences" msgstr "Preferenze di Smuxi" #: ../glade/smuxi-frontend-gnome.glade.h:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:18 msgid "Smuxi - Server" msgstr "Server di Smuxi" #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:820 msgid "Strip Colors" msgstr "Rimuovi i colori" #: ../glade/smuxi-frontend-gnome.glade.h:66 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:859 msgid "Strip Formattings" msgstr "Rimuovi le formattazioni" #: ../glade/smuxi-frontend-gnome.glade.h:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:899 msgid "Strip UTF-8" msgstr "Rimuovi UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:68 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1214 msgid "Tabs" msgstr "Schede" # #: ../glade/smuxi-frontend-gnome.glade.h:69 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "" "Il soprannome da usare. È possibile specificare più soprannomi, separati da " "uno spazio, che verranno usati come alternativa qualora quello principale " "non sia disponibile. In modo predefinito verrà usato $nick_, mentre $nick__ " "viene usato come alternativa." #: ../glade/smuxi-frontend-gnome.glade.h:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:718 msgid "Timestamp Format:" msgstr "Formato dell'ora:" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:71 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:935 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:959 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1412 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1438 msgid "Top" msgstr "Su" #: ../glade/smuxi-frontend-gnome.glade.h:72 msgid "Type:" msgstr "Tipo:" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:507 msgid "Username:" msgstr "Nome utente:" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1873 msgid "_Filters" msgstr "_Filtri" #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1715 msgid "_Interface" msgstr "_Interfaccia" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "_Logging" msgstr "_Registro" #: ../glade/smuxi-frontend-gnome.glade.h:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1781 msgid "_Servers" msgstr "_Server" #. This is a setting for character based line wrapping vs word based when showing messages #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "_Wrap Mode:" msgstr "_Modalità a capo automatico:" # #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "" "ss = secondi\n" "mm = minuti\n" "hh = ore (01 - 12)\n" "HH = ore (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = giorno\n" "MM = mese\n" "yy/yyyy = anno" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Chat with other people on IRC" msgstr "Chiacchiera con altre persone su IRC" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "Chat IRC" # #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Client di IRC Smuxi" #: ../src/Frontend-GNOME/AboutDialog.cs:58 msgid "translator-credits" msgstr "" "David Paleino \n" "Vincenzo Campanella " #: ../src/Frontend-GNOME/AboutDialog.cs:61 msgid "Smuxi Website" msgstr "Sito web di Smuxi" #: ../src/Frontend-GNOME/CrashDialog.cs:44 msgid "Oops, I did it again..." msgstr "Oops, l'ho fatto ancora." #: ../src/Frontend-GNOME/CrashDialog.cs:57 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi si è bloccato perché è avvenuta un'eccezione non gestita." #: ../src/Frontend-GNOME/CrashDialog.cs:61 msgid "Here is the stacktrace, please report this bug!" msgstr "Ecco lo stacktrace. Per favore, segnalare questo bug." #: ../src/Frontend-GNOME/CrashDialog.cs:81 msgid "_Report Bug" msgstr "_Segnala bug" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:61 msgid "Engine Manager" msgstr "Gestore del motore" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:68 msgid "_Connect" msgstr "_Connetti" # #: ../src/Frontend-GNOME/EngineManagerDialog.cs:84 msgid "Select which Smuxi engine you want to connect to" msgstr "Selezionare il motore Smuxi a cui connettersi" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:90 msgid "Engine:" msgstr "Motore:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:116 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:176 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:353 msgid "Local Engine" msgstr "Motore locale" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:168 msgid "Please select an engine!" msgstr "Scegliere un motore." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:189 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "" "La versione dell'interfaccia in uso ({0}) non corrisponde a quella del " "motore ({1})." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:216 msgid "An error occurred while connecting to the engine!" msgstr "Errore durante la connessione al motore." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:217 #, csharp-format msgid "Engine URL: {0}" msgstr "URL del motore: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:220 #, csharp-format msgid "Error: {0}" msgstr "Errore: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:290 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Si è sicuri di voler eliminare il motore «{0}»?" #: ../src/Frontend-GNOME/Entry.cs:421 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Si stanno per incollare {0} righe. Continuare?" # #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:524 msgid "Frontend Commands" msgstr "Comandi dell'interfaccia" #: ../src/Frontend-GNOME/MainWindow.cs:222 msgid "_File" msgstr "_File" #: ../src/Frontend-GNOME/MainWindow.cs:238 msgid "_Server" msgstr "_Server" #: ../src/Frontend-GNOME/MainWindow.cs:242 msgid "_Quick Connect" msgstr "C_onnessione Rapida" #: ../src/Frontend-GNOME/MainWindow.cs:253 msgid "_Manage" msgstr "_Gestisci" #: ../src/Frontend-GNOME/MainWindow.cs:260 msgid "_Chat" msgstr "_Chat" #: ../src/Frontend-GNOME/MainWindow.cs:264 msgid "Open / Join Chat" msgstr "Apri / Partecipa alla chat" #: ../src/Frontend-GNOME/MainWindow.cs:269 msgid "_Find Group Chat" msgstr "_Trova chat di gruppo" #: ../src/Frontend-GNOME/MainWindow.cs:274 msgid "C_lear All Activity" msgstr "Cance_lla tutte le attività" #: ../src/Frontend-GNOME/MainWindow.cs:281 msgid "_Next Chat" msgstr "Chat segue_nte" #: ../src/Frontend-GNOME/MainWindow.cs:291 msgid "_Previous Chat" msgstr "Chat p_recedente" #: ../src/Frontend-GNOME/MainWindow.cs:341 msgid "Open Log" msgstr "Apri il registro" #: ../src/Frontend-GNOME/MainWindow.cs:355 msgid "_Engine" msgstr "_Motore" #: ../src/Frontend-GNOME/MainWindow.cs:359 msgid "_Use Local Engine" msgstr "_Utilizza il motore locale" #: ../src/Frontend-GNOME/MainWindow.cs:365 msgid "_Add Remote Engine" msgstr "_Aggiungi motore remoto" #: ../src/Frontend-GNOME/MainWindow.cs:370 msgid "_Switch Remote Engine" msgstr "_Cambia motore remoto" #: ../src/Frontend-GNOME/MainWindow.cs:377 msgid "_View" msgstr "_Visualizza" #: ../src/Frontend-GNOME/MainWindow.cs:381 msgid "_Caret Mode" msgstr "Modalità _cursore" #: ../src/Frontend-GNOME/MainWindow.cs:389 msgid "_Browse Mode" msgstr "Modalità di _navigazione" #: ../src/Frontend-GNOME/MainWindow.cs:403 #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:586 msgid "Show _Menubar" msgstr "Mostra la barra del _menù" #: ../src/Frontend-GNOME/MainWindow.cs:430 msgid "_Help" msgstr "A_iuto" #: ../src/Frontend-GNOME/MainWindow.cs:691 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:225 msgid "Unable to add server: " msgstr "Impossibile aggiungere il server: " #: ../src/Frontend-GNOME/MainWindow.cs:742 #, csharp-format msgid "Unknown ChatType: {0}" msgstr "Tipo di chat sconosciuto: {0}" #: ../src/Frontend-GNOME/MainWindow.cs:971 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Il passaggio al motore locale provocherà la disconnessione dal motore " "attuale.\n" "Si è sicuri di volerlo fare?" #: ../src/Frontend-GNOME/MainWindow.cs:1013 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Il passaggio al motore remoto provocherà la disconnessione dal motore " "attuale.\n" "Si è sicuri di volerlo fare?" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Spiacente, non ancora implementato." #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:179 msgid "Character" msgstr "Carattere" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:180 msgid "Word" msgstr "Parola" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:198 msgid "No Proxy" msgstr "Nessun proxy" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:212 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:139 msgid "Connection" msgstr "Connessione" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:216 msgid "Interface" msgstr "Interfaccia" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:220 msgid "Servers" msgstr "Server" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:227 msgid "Filters" msgstr "Filtri" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:231 msgid "Logging" msgstr "Registri" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:281 msgid "System Default" msgstr "Predefinito dal sistema" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:588 msgid "Nicknames(s) field must not be empty." msgstr "Il campo soprannomi non deve essere vuoto." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:748 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "" "Espressione regolare di evidenziazione non valida: «{0}». Motivo: «{1}»." #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:69 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:105 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:271 msgid "Name" msgstr "Nome" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:74 msgid "Topic" msgstr "Argomento" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:102 msgid "" "Searching for group chats without a filter is not recommended. This may " "take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "" "La ricerca di chat di gruppo senza un filtro non è consigliata: potrebbe " "volerci un po' di tempo, o potrebbe non funzionare del tutto.\n" "Continuare?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:143 msgid "Error while fetching the list of group chats from the server." msgstr "" "Errore durante il recupero dell'elenco delle chat di gruppo dal server." #: ../src/Frontend-GNOME/Frontend.cs:399 #, csharp-format msgid "Cause: {0}" msgstr "Causa: {0}" # #: ../src/Frontend-GNOME/Frontend.cs:469 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "" "L'interfaccia ha perso la connessione al server.\n" "Riconnettersi ora?" # #: ../src/Frontend-GNOME/Frontend.cs:484 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "" "La riconnessione al server non è riuscita.\n" "Riprovare?" # #: ../src/Frontend-GNOME/Frontend.cs:585 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "" "Il server ha perso la connessione all'interfaccia.\n" "Riconnettersi ora?" #: ../src/Frontend-GNOME/NotifyManager.cs:229 msgid "Show" msgstr "Mostra" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:62 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:238 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protocollo" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:63 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Nome dell'host" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:166 msgid "Unable to load server: " msgstr "Impossibile caricare il server: " #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:244 msgid "Person / Private" msgstr "Persona / Privato" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:245 msgid "Group / Public" msgstr "Gruppo / Pubblico" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:70 msgid "Engine Assistant - Smuxi" msgstr "Assistente del motore di Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:92 msgid "Add Smuxi Engine" msgstr "Aggiungi motore Smuxi" # #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:94 msgid "Edit Smuxi Engine" msgstr "Modifica motore Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:203 msgid "Credentials" msgstr "Credenziali" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:265 msgid "Now you can use the Smuxi Engine" msgstr "Adesso è possibile usare il motore Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:268 msgid "Thank you" msgstr "Grazie" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:285 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "Un motore con questo nome esiste già. Specificarne un altro." #: ../src/Frontend-GNOME/Views/MessageTextView.cs:198 #, csharp-format msgid "Day changed to {0}" msgstr "Giorno modificato in {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:123 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:133 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Espressione regolare del filtro non valida: «{0}». Motivo: »{1}»." #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:200 msgid "Are you sure you want to delete the selected filter?" msgstr "Si è sicuri di voler eliminare il filtro selezionato?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:246 msgid "Protocol / Server" msgstr "Protocollo / Server" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:253 msgid "Chat Type" msgstr "Tipo di chat" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:287 msgid "Normal" msgstr "Normale" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:288 msgid "Event" msgstr "Evento" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:295 msgid "Type" msgstr "Tipo" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:321 msgid "Pattern" msgstr "Modello" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:242 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Recupero dell'elenco degli utenti per {0} in corso" # #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:289 msgid "done." msgstr "eseguito." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:304 msgid "Person" msgstr "Persona" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:68 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "" "La chiusura della chat di protocollo chiuderà anche tutte le chat aperte a " "essa collegate.\n" "Si è sicuri di volerlo fare?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:187 msgid "Are you sure you want to delete the selected server?" msgstr "Si è sicuri di voler eliminare il server selezionato?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:243 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:277 msgid "Unable to edit server: " msgstr "Impossibile modificare il server: " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:34 msgid "Find" msgstr "Trova" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:54 msgid "_Search for:" msgstr "_Cerca:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:83 msgid "_Match Case" msgstr "_Distingui le maiuscole" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:95 msgid "Search _Backwards" msgstr "Cerca all'_indietro" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:107 msgid "_Wrap Around" msgstr "_A capo automatico" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:120 msgid "Use _Regular Expressions" msgstr "Usa le espressioni _regolari" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:32 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Trova chat di gruppo" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:79 msgid "_Name:" msgstr "_Nome:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:24 msgid "Smuxi - Quick Connect" msgstr "Smuxi - Connessione rapida" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:487 msgid "Nicknames:" msgstr "Soprannomi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1622 msgid " User List Position " msgstr " Posizione dell'elenco degli utenti " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1633 msgid " Channel " msgstr " Canale " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1844 msgid "Channel Filters" msgstr "Filtri del canale" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1861 msgid "User Filters" msgstr "Filtri dell'utente" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "Use _SSH Tunnel" msgstr "Usa tunnel _SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:70 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "" "Abilita l'uso di SSH per la connessione. Questo ha un " "impatto ridotto sulle prestazioni, ma è più sicuro ed è richiesto quando si " "usa NAT o firewall basati sulle porte" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:149 msgid "SSH _Host:" msgstr "_Host SSH:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:160 msgid "" "DNS or IP address and port of the SSH server" msgstr "DNS o indirizzo IP e porta del server SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:187 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:155 msgid "_Port:" msgstr "_Porta:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:200 msgid "" "DNS or IP address and port of the Smuxi server" msgstr "" "DNS o indirizzo IP e porta del server Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:213 msgid "_Smuxi Host:" msgstr "Host _Smuxi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:68 msgid "_SSH Username: (optional)" msgstr "Nome utente _SSH: (facoltativo)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:91 msgid "" "Username which will be used to log into the SSH server" msgstr "" "Nome utente che verrà utilizzato per accedere al server " "SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:111 msgid "_SSH Password: (optional)" msgstr "Password _SSH: (facoltativa)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:135 msgid "" "Password which will be used to log into the SSH server. " "The password is optional if SSH key authorization is used (via Pageant from " "the PuTTY tools)." msgstr "" "Password che verrà utilizzata per accedere al server " "SSH. La password è facoltativa se viene utilizzata una chiave di " "autorizzazione SSH (tramite Pageant dagli strumenti di PuTTY)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:156 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:214 msgid "_Username:" msgstr "Nome _utente:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:179 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "" "Nome utente che verrà utilizzato per accedere al server " "Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:199 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:113 msgid "_Password:" msgstr "_Password:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:223 msgid "Password of the user" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:243 msgid "_Verify Password:" msgstr "_Verifica password:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:267 msgid "Repeat the password for verification" msgstr "Ripetere la password per la verifica" # #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "" "Benvenuti nell'assistente di configurazione del motore di Smuxi.\n" "Sarà necessario inserire alcune informazioni prima di poter usare il " "motore.\n" "\n" "Fare clic su «Avanti» per iniziare." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:44 msgid "_Engine Name:" msgstr "_Nome del motore:" # #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:67 msgid "Profile name of the new engine" msgstr "Nome del profilo del nuovo motore" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:88 msgid "_Default Engine:" msgstr "Motore _predefinito:" # #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:99 msgid "Use as new default engine" msgstr "Usa come motore predefinito" # #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:112 msgid "" "If enabled, the current engine will be the default next " "time Smuxi is started" msgstr "" "Se abilitato, il motore attuale sarà quello predefinito " "al prossimo avvio di Smuxi" # #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:26 msgid "Smuxi - Open Chat" msgstr "Smuxi - Apri chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:69 msgid "_Type:" msgstr "_Tipo:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:80 msgid "_Hostname:" msgstr "Nome dell'_host:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:101 msgid "_Network:" msgstr "_Rete:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:224 msgid "_Protocol:" msgstr "_Protocollo:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:248 msgid "Use Encryption" msgstr "Usa la cifratura" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:260 msgid "Validate Server Certificate" msgstr "Convalida il certificato del server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:280 msgid "_On Connect Commands:" msgstr "_Comandi alla connessione:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:291 msgid "_Ignore Commands" msgstr "_Ignora comandi" #~ msgid "German" #~ msgstr "Tedesco" #~ msgid "Spanish" #~ msgstr "Spagnolo" #~ msgid "British English" #~ msgstr "Inglese britannico" #~ msgid "French" #~ msgstr "Francese" #~ msgid "Italian" #~ msgstr "Italiano" #~ msgid "_Edit" #~ msgstr "_Modifica" #~ msgid "Joins" #~ msgstr "Ingressi" #~ msgid "Parts" #~ msgstr "Uscite" #~ msgid "Quits" #~ msgstr "Disconnessioni" #~ msgid "Unknown Command: {0}" #~ msgstr "Comando sconosciuto: {0}" smuxi-0.11/po-Frontend-GNOME/de.po0000644000175000017500000012541312300202374017363 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Bianca Mix , 2011-2013 # Mirco Bauer , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-11 19:30+0000\n" "Last-Translator: Bianca Mix \n" "Language-Team: German (http://www.transifex.com/projects/p/smuxi/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "Smuxi Einstellungen" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "Der Nickname der verwendet werden soll. Sie können mehr als einen Nicknamen angeben, indem Sie Leerzeichen als Trenner verwenden. Diese werden als Ausweichmöglichkeit benutzt, wenn der Nickname nicht verfügbar ist. Standardmäßig wird $nick_ und $nick__ als Ausweichmöglichkeit verwendet." #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "Nickname(n):" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Benutzername:" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "Wirklicher Name:" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "Kodierung:" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "Automatisches Konvertieren von UTF-8 Zeichen" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr "Allgemein" #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "Typ:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "Host:" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "Passwort:" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "Port:" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Passwort anzeigen" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "Netzwerk Proxy" #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "Befehle beim Verbinden:" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "Befehle beim Starten:" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr "übergreifende Kommandos" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "_Verbindung" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "Zeitstempel-Format:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "Puffer-Zeilen:" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "Engine-Puffer-Zeilen:" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "ss = Sekunden\nmm = Minuten\nhh = Stunden (1 - 12)\nHH = Stunden (0 - 23)\ntt = AM/PM\n\ndd = Tag\nMM = Monat\nyy/yyyy = Jahr" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "Persistenz-Typ" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "Zeilen Volatilitäts-Puffer" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "Zeilen Persistenz-Puffer" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr "Nachrichtenpuffer" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "Farben entfernen" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "Formatierungen entfernen" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "UTF-8 entfernen" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "Zeige erweiterte Einstellungen" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr "Erweitert" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "Allgemein" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "Oben" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "Unten" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "Links" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "Rechts" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "Nichts" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " Position der Reiter " #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "Highlight" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "Aktivität" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "Keine Aktivität" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "Beitreten/Verlassen/Mode" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " Farbe der Reiter " #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "Automatisches Wechseln zu neu geöffneten Personen-Gesprächsfenstern" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "Automatisches Wechseln zu neu geöffneten Gruppen-Gesprächsfenstern" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "Baum" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "Vervollständigungzeichen:" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "Befehlszeichen:" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "Befehlsprotokollgröße:" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Vervollständigung im Bash-Stil" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " Eingabefeld " #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "Eingabe" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "Nick-Farben" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr " Position der Personenliste " #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "Übersteuern" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " Schrift " #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " Position des Themas " #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "Vordergrund" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "Hintergrund" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " Farbe " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "_Umbruch-Modus" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr " Chat " #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "Highlight-Wörter:" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "Bei Highlight piepsen" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " Highlighting " #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "Ausgabe" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "Aktivieren" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "Immer anzeigen" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "Zeigen, wenn Fenster minimiert ist" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "Anzeigen, wenn Fenster geschlossen ist" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr " Symbol im Benachrichtigungsfeld " #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "Zeige Smuxi im Messaging-Menü" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr "Messaging-Menü" #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "Zeige Benachrichtigungs-Pop-ups" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr "Beachrichtigungs-Pop-ups" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "Benachrichtigung" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "_Anzeige" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "_Server" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "_Filter" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "Aktiviert" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "Protokollierung gefilterter Nachrichten" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "_Geprächsprotokollierung" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - Server" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "Beim Start automatisch zu diesem Server verbinden" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "Protokoll:" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "Netzwerk:" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "Hostname:" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "IRC Chat" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Smuxi - Chat Client" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "Kommuniziere mit anderen Leuten im IRC" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "Mirco Bauer \nBianca Mix " #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "Smuxi Webseite" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "Ups, ich habe es wieder getan..." #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi ist abgestürtzt, weil eine unbehandelte Ausnahme aufgetreten ist!" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "Hier ist der Stack-Trace, bitte berichten Sie diesen Fehler!" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "_Fehler berichten" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "Engine nicht gefunden." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "Engine-Manager" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "Wählen Sie, zu welcher Smuxi-Engine Sie sich verbinden möchten" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "Engine:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "Benutze Geringe-Bandbreite-Modus" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "Lokale Engine" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "Bitte wählen Sie eine Engine aus!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "Ihre Frontend-Version ({0}) stimmt nicht mit der Engine-Version ({1}) überein!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "Ein Fehler ist beim Verbinden zur Engine aufgetreten!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "Engine URL: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "Fehler: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Möchten Sie wirklich die Engine \"{0}\" löschen?" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Sie sind dabei, {0} Zeilen einzufügen. Möchten Sie fortfahren?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "Frontend Befehle" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Tut mir leid, das ist noch nicht implementiert!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "Zeichen" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "Wort" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "Volatil" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "Persistent" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "Kein Proxy" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "System-Standard" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "Verbindung" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "Anzeige" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "Server" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "Filter" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "Geprächsprotokollierung" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "Das Nickname(n)-Feld darf nicht leer sein." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Ungültiger Highlight regex: '{0}'. Ursache: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "Name" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "Thema" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "Vom Suchen nach Gruppen-Chats ohne einen Filter wird abgeraten. Es könnte eine Weile dauern, oder es funktioniert gar nicht.\nMöchten Sie fortfahren?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "Fehler beim Abrufen der Liste für Gruppen-Chats vom Server." #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "Von der Engine getrennt." #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "Wiederverbinden zur Engine... (Versuch {0})" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "Grund: {0}" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "Der Server hat die Verbindung zum Frontend verloren.\nMöchten Sie diese nun erneut aufbauen?" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "Erneutes Verbindung zum Server ist fehlgeschlagen.\nMöchten Sie es nochmals versuchen?" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "Der Server hat die Verbindung zum Frontend verloren.\nMöchten Sie diese nun erneut aufbauen?" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "Zeige" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protokoll" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Hostname" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "Laden des Servers nicht möglich:" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "Person / Privat" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "Gruppe / Öffentlich" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "Engine-Assistent - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "Smuxi-Engine hinzufügen" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "Smuxi-Engine bearbeiten" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "Zugangsdaten" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "Nun können Sie die Smuxi-Engine verwenden" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "Vielen Dank" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "Es existiert bereits eine Engine mit diesem Namen! Bitte geben Sie einen anderen an." #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "Geben Sie den zu betretenden Chat ein" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "Über Smuxi" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "Einstellungen" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "Fehler beim Hinzufügen des Servers:" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Das Wechseln zur lokalen Engine wird Sie von der jetzigen Engine trennen!\nMöchten Sie fortfahren?" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "Das Wechseln zur entfernten Engine wird Sie von der jetzigen Engine trennen!\nMöchten Sie fortfahren?" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "Tag wechselte vom {0} zum {1}" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "Tageswechsel: {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Üngültiger Filter regex: '{0}'. Ursache: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "Möchten Sie den ausgewählten Filter wirklich löschen?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "Protokoll / Server" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "Gesprächstyp" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "Normal" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "Ereignis" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "Typ" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "Muster" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "Geringe-Bandbreite-Modus ist aktiviert: Keine Nachrichten synchronisiert." #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "Zeige Menüleiste" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Rufe die Benutzer-Liste für {0} ab..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "abgeschlossen." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "Person" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "Wiederverbinden" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "Das Schließen des Protokoll-Chats wird alle dazugehörigen Chats ebenfalls schließen!\nMöchten Sie fortfahren?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "Möchten Sie den ausgewählten Server wirklich löschen?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "Bearbeiten des Servers nicht möglich:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "Suchen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "_Suchen nach:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "_Groß-/Kleinschreibung berücksichtigen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "_Rückwärts suchen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "_Wieder am Anfang beginnen, wenn das Ende erreicht ist" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "_Reguläre Ausdrücke anwenden" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Finde Gruppen-Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "_Name:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "Betreten" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "_Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "_Server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "_Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "_Engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "_Anzeige" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "_Hilfe" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "Verbinden" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "Mitschnitt Öffnen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "_Einstellungen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "_Beenden" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "_Verbinden" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "_Hinzufügen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "_Verwalten" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "Chat _Öffnen / Betreten" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "_Finde Gruppen-Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "Alle Aktivitäten _löschen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "_Nächster Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "_Vorheriger Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "_Schließen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "_Verwende lokale Engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "_Füge entfernte Engine hinzu" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "Entfernte Engine wechseln" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "_Caret-Modus" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "_Durchstöber-Modus" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "Zeige _Statusanzeige" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "_Vollbild" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "_Über" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "Finde Gruppen-Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "_Webseite" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "Zeige _Werkzeugleiste" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "Smuxi - Verbinden" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - Einstellungen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "Nicknamen:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "Reiter" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr " Position der Benutzer-Liste " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " Channel " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "Channel-Filter" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "Benutzer-Filter" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "SSH-Tunnel verwenden" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "Aktiviert die Verwendung von SSH für die Verbindung. Dies hat Einfluss auf die Performanz, ist jedoch sicherer und notwendig, wenn NAT oder Port basierte Firewalls verwendet werden." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "SSH-_Host:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "DNS oder IP-Adresse und Port vom SSH-Server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "_Port:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "DNS oder IP-Adresse und Port vom Smuxi-Server" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "_Smuxi-Host:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "_SSH-Benutzer: (optional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "Benutzername, welcher zur Anmeldung beim SSH-Server verwendet werden soll" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "_SSH-Passwort: (optional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "Passwort welches zum Login in den SSH-Server benutzt wird. Das Passwort ist optional wenn Autorisation mit SSH-Schlüsseln benutzt wird (siehe unten). " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "_SSH Schlüssel-Datei: (optional)" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "Datei auswählen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "SSH nicht-öffentliche Schlüssel-Datei, die für den Login am SSH-Server verwendet wird" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "_Benutzer:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "Benutzername, welcher zur Anmeldung beim Smuxi-Server verwendet werden soll" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "_Passwort:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "Passwort des Benutzers" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "Passwort _bestätigen:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "Wiederholen Sie das Passwort zur Überprüfung" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "Willkommen beim Engine-Konfigurations-Assistenten von Smuxi.\nSie müssen ein paar Informationen eingeben, bevor Sie diese Engine nutzen können.\n\nKlicken Sie auf \"Weiter\" um anzufangen." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "_Engine-Name:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "Name des Profils für die neue Engine" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "_Standard-Engine:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "Als neue Standard-Engine verwenden" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "Wenn dies aktiviert ist, wird die Engine standardmäßig beim nächsten Start von Smuxi verwendet" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "Smuxi - Chat Öffnen" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "_Typ:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "_Hostname:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_Netzwerk:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "_Protokoll:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "Verschlüsselung verwenden" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "Serverzertifikat validieren" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "Befehle beim Verbinden:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "Befehle ignorieren:" smuxi-0.11/po-Frontend-GNOME/Makefile.in.in0000644000175000017500000001533012300202374021101 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE_FRONTEND_GNOME@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/po-Frontend-GNOME/es.po0000644000175000017500000012502612300202374017402 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # toote, 2013 # Ricardo Hermosilla , 2012 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-10 19:45+0000\n" "Last-Translator: toote\n" "Language-Team: Spanish (http://www.transifex.com/projects/p/smuxi/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "Preferencias Smuxi" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "El nick a usar. Puede especificar nicks adicionales (separados por espacios) que serán usados como opciones de respaldo cuando la primera no esté disponible. De forma predeterminada se utilizará $nick_ y $nick__ como respaldos." #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "Nick(s):" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Nombre de usuario:" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "Nombre real:" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "Codificación:" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "Convertir caracteres UTF-8 automáticamente" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr "General" #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "Tipo:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "Dominio:" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "Contraseña:" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "Puerto:" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Mostrar contraseña:" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "Proxy de red" #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "Órdenes al conectar:" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "Órdenes al arrancar:" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr "Órdenes globales" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "C_onexión" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "Formato de marca temporal:" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "Lineas de buffer:" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "Líneas de buffer del motor:" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "ss = segundos\nmm = minutos\nhh = hora (01 - 12)\nHH = hora (00 - 23)\ntt = AM/PM\n\ndd = día\nMM = mes\nyy/yyyy = año" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "Tipo de persistencia:" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "Líneas de buffer volátiles:" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "Líneas de buffer persistentes:" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr "Buffer de mensaje" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "Quitar colores" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "Quitar formatos" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "Quitar UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "Mostrar configuraciones avanzadas" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr "Avanzado" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "General" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "Arriba" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "Abajo" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "Izquierda" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "Derecha" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "Ninguno" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " Posición de pestañas " #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "Resaltar" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "Actividad" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "Sin actividad" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "Entrar/Salir/Modo" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " Colores de pestañas " #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "Cambiar automáticamente a nuevos chats personales abiertos" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "Cambiar automáticamente a nuevos chats grupales abiertos" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "Árbol" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "Carácter de autocompletado" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "Carácter de órdenes:" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "Tamaño historial de órdenes:" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Autocompletado estilo Bash" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " Campo de entrada " #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "Entrada" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "Colores de nick" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr " Posición de lista de personas " #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "Anular" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " Tipografía " #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " Posición del topic " #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "Frente" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "Fondo" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " Color " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "_Modo de alineación" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr " Chat " #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "Palabras resaltadas:" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "Beep al resaltar" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " Resaltado " #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "Salida" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "Habilitar" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "Mostrar siempre" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "Mostrar cuando se minimice la ventana" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "Mostrar cuando se cierre la ventana" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr " Icono del área de notificación " #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "Mostrar Smuxi en el menú de mensajería" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr "Menú de mensajería" #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "Mostrar notificaciones emergentes" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr "Notificaciones emergentes" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "Notificación" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "_Interfaz" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "_Servidores" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "_Filtros" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "Habilitado" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "Registrar mensajes filtrados" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "_Registros" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - Servidor" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "Conectar automáticamente al servidor al iniciar" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "Protocolo:" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "Red:" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "Nombre del equipo:" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "Chat IRC" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Cliente IRC Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "Charla con otras personas en IRC" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "Juan Miguel Carrero ,\nMatías Bellone " #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "Sitio web de Smuxi" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "Perdón, lo hice de nuevo..." #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "¡Falló Smuxi porque ocurrió una excepción inesperada!" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "Aquí esta la traza de pila ¡reporte este fallo por favor!" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "_Reportar fallo" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "No se encontró el motor." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "Gestor de motor" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "Seleccione a qué motor Smuxi desea conectarse" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "Motor:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "Utilizar modo de bajo ancho de banda" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "Motor local:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "¡Seleccione un motor!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "¡Su versión de interfaz ({0}) no corresponde a la versión del motor ({1})!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "¡Ocurrió un error durante la conexión al motor!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "URL del motor: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "Error: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "¿Seguro que desea borrar el motor «{0}»?" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Va a pegar {0} líneas ¿desea continuar?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "Órdenes de interfaz" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Lo siento, ¡aún no está implementado!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "Carácter" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "Palabra" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "Volátil" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "Persistente" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "Sin proxy" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "Predeterminado del sistema" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "Conexión" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "Interfaz" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "Servidores" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "Filtros" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "Registros" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "El campo Nick(s) no debe estar vacío." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Expresión regular para resaltado inválida: «{0}». Razón: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "Nombre" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "Topic" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "No se recomienda buscar chats grupales sin un filtro. Esto puede tardar bastante o puede no funcionar.\n¿Desea continuar?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "Ocurrió un error durante la carga de la lista de chats grupales del servidor." #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "Desconectado del motor." #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "Reconectando al motor... (intento {0})" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "Motivo: {0}" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "La interfaz perdió la conexión con el servidor.\n¿Desea volver a conectarse ahora?" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "Falló la reconexión con el servidor.\n¿Desea volver a intentarlo?" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "El servidor perdió la conexión con la interfaz.\n¿Desea reconectar ahora?" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "Mostrar" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protocolo" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Nombre del equipo" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "No se pudo cargar el servidor:" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "Persona / Privado" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "Grupo / Público" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "Smuxi - Asistente de motores" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "Agregar motor a Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "Editar motor de Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "Credenciales" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "Ahora puede utilizar el motor de Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "Gracias" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "¡Ya existe un motor con ese nombre! Especifique uno diferente." #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "Ingrese el chat al que desea entrar" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "Sobre Smuxi" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "Preferencias" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "No se pudo agregar el servidor: " #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "¡Cambiar al motor local lo desconectará del motor actual!\n¿Seguro que desea continuar?" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "¡Cambiar al motor remoto lo desconectará del motor actual!\n¿Seguro que desea continuar?" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "Cambió el día de {0} a {1}" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "Cambió el día a {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Expresión regularde filtro inválida: «{0}». Razón: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "¿Seguro que desea borrar el filtro seleccionado?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "Protocolo / Servidor" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "Tipo de chat" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "Normal" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "Evento" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "Tipo:" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "Patrón" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "Modo de bajo ancho de banda activado: no se sincronizaron mensajes." #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "Mostrar barra de men_ú" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Obteniendo la lista de usuarios para {0}" #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "hecho." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "Persona" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "Reconectar" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "¡Cerrar el protocolo también cerrará todos los chats abiertos en él!\n¿Seguro que desea continuar?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "¿Seguro que desea borrar el servidor seleccionado?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "No se puede editar el servidor:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "Buscar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "_Buscar:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "_Coincidir mayúsculas y minúsculas" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "Buscar _hacia atrás" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "_Desde el principio" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "Utilizar e_xpresion regular" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Buscar chat grupal" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "_Nombre:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "Entrar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "_Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "_Servidor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "_Chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "_Motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "_Ver" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "_Ayuda" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "Conectar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "Abrir registro" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "_Preferencias" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "_Salir" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "_Conectar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "_Agregar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "_Gestionar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "Abrir / _Entrar a chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "_Buscar chat grupal" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "_Eliminar toda actividad" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "Chat siguie_nte" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "Chat _anterior" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "_Cerrar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "Utilizar motor _local" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "Agregar motor _remoto" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "Cambiar motor remoto" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "Mo_do de alineación" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "Modo de e_xaminación" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "Mostrar _barra de estado" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "_Pantalla completa" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "_Acerca de" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "Buscar chat grupal" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "Sitio _web" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "Mostrar barra de _herramientas" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "Smuxi - Connectar" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - Preferencias" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "Nicks:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "Pestañas" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr " Posición en lista de usuarios " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " Canal " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "Filtros de canales" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "Filtros de usuarios" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "Utilizar túnel _SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "Permite el uso de SSH para la conexión. Esto conlleva a una pequeña baja en el rendimiento , pero se aumenta la seguridad y es un requisito cuando utiliza NAT o un cortafuegos basado en puertos" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "_Servidor SSH:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "DNS o dirección IP y puerto del servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "_Puerto:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "DNS o dirección IP y puerto del servidor Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "_Servidor Smuxi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "Nombre de _usuario SSH: (opcional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "Nombre de usuario para iniciar sesión en el servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "Contraseña _SSH: (opcional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "Contraseña para iniciar sesión el servidor SSH. La contraseña es opcional utiliza una clave SSH (revise más abajo)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "Archivo de claves _SSH: (opcional)" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "Seleccione un archivo" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "Archivo privaod de claves SSH para iniciar sesión en el servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "Nombre de _usuario:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "Nombre de usuario para iniciar sesión en el servidor Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "_Contraseña:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "Contraseña del usuario" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "_Verificar contraseña:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "Repita la contraseña para verificación" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "Bienvenido al asistente de configuración del motor de Smuxi.\nNecesita ingresar alguna información antes de poder utilizar el motor.\n\nPulse en «Avanzar» para empezar." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "Nombre del _motor:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "Nombre del perfil para el nuevo motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "Motor _predeterminado:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "Utilizar como nuevo motor predeterminado" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "Si está habilitada, el motor actual será utilizado como predeterminado por Smuxi la próxima vez que inicie" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "Smuxi - Chat abierto" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "_Tipo:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "Nombre del _equipo:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_Red:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "_Protocolo:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "Usar cifrado" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "Validar el certificado del servidor." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "_Órdenes al conectar:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "_Ignorar órdenes" smuxi-0.11/po-Frontend-GNOME/te.po0000644000175000017500000011361412300202374017403 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # ప్రవీణ్ ఇళ్ళ , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:04+0100\n" "PO-Revision-Date: 2013-12-12 04:44+0000\n" "Last-Translator: ప్రవీణ్ ఇళ్ళ \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/smuxi/language/te/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: te\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid "Smuxi Preferences" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:3 msgid "Nickname(s):" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:4 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "వాడుకరిపేరు:" #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "అసలుపేరు:" #: ../glade/smuxi-frontend-gnome.glade.h:6 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid "Automatically convert UTF-8 characters" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:8 msgid "General" msgstr "సాధారణం" #: ../glade/smuxi-frontend-gnome.glade.h:9 msgid "Type:" msgstr "రకం:" #: ../glade/smuxi-frontend-gnome.glade.h:10 msgid "Host:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Password:" msgstr "సంకేతపదం:" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Port:" msgstr "పోర్టు:" #: ../glade/smuxi-frontend-gnome.glade.h:13 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "సంకేతపదాన్ని చూపించు" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "నెట్వర్క్ ప్రాక్సీ" #: ../glade/smuxi-frontend-gnome.glade.h:15 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Global Commands" msgstr "Global Commands" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:22 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Persistency Type:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:32 msgid "Volatile Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Persistent Buffer Lines:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:34 msgid "Message Buffer" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Show Advanced Settings" msgstr "ఉన్నత అమరికలను చూపించు" #: ../glade/smuxi-frontend-gnome.glade.h:39 msgid "Advanced" msgstr "ఉన్నతం" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "సాధారణం" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "కింద" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:43 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " ట్యాబుల స్థానం " #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "కలాపం" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " ట్యాబు రంగులు " #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Automatically switch to newly opened person chats" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Automatically switch to newly opened group chats" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Tree" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " ప్రవేశిక క్షేత్రం " #: ../glade/smuxi-frontend-gnome.glade.h:60 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid " Person List Position " msgstr " వ్యక్తి జాబితా స్థానం " #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Override" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid " Font " msgstr " ఖతి " #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " విషయపు స్థానం " #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Foreground" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:67 msgid "Background" msgstr "నేపథ్యం" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid " Color " msgstr " రంగు " #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:70 msgid "_Wrap Mode:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:71 msgid " Chat " msgstr "సంభాషణ" #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " ఉద్దీపనం " #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Enable" msgstr "చేతనించు" #: ../glade/smuxi-frontend-gnome.glade.h:77 msgid "Show always" msgstr "ఎల్లప్పుడూ చూపించు" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Show when window is minimized" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "Show when window is closed" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid " Notification Area Icon " msgstr " గమనిక ప్రాంత ప్రతీక " #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "Show Smuxi in the messaging menu" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:82 msgid "Messaging Menu" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:83 msgid "Show notification popups" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "Notification Popups" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "Notification" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:86 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:88 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:89 msgid "Enabled" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:90 msgid "Log Filtered Messages" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:91 msgid "_Logging" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:92 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:94 msgid "Protocol:" msgstr "ప్రతినిధి:" #: ../glade/smuxi-frontend-gnome.glade.h:95 msgid "Network:" msgstr "" #: ../glade/smuxi-frontend-gnome.glade.h:96 msgid "Hostname:" msgstr "" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Smuxi" msgstr "స్మక్సి" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Chat with other people on IRC" msgstr "" #: ../src/Frontend-GNOME/AboutDialog.cs:66 msgid "translator-credits" msgstr "Praveen Illa , 2013" #: ../src/Frontend-GNOME/AboutDialog.cs:73 msgid "Smuxi Website" msgstr "స్మక్సి జాలగూడు" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:66 msgid "Engine not found." msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:81 msgid "Engine Manager" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:100 msgid "Select which Smuxi engine you want to connect to" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:106 msgid "Engine:" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:117 msgid "Use Low Bandwidth Mode" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:141 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:201 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:383 msgid "Local Engine" msgstr "స్థానిక యంత్రం" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:193 msgid "Please select an engine!" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:219 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:246 msgid "An error occurred while connecting to the engine!" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:247 #, csharp-format msgid "Engine URL: {0}" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:250 #, csharp-format msgid "Error: {0}" msgstr "" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:320 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "" #: ../src/Frontend-GNOME/Entry.cs:484 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:601 msgid "Frontend Commands" msgstr "" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:185 msgid "Character" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:186 msgid "Word" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:203 msgid "Volatile" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:205 msgid "Persistent" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:228 msgid "No Proxy" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:230 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:326 msgid "System Default" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:244 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:248 msgid "Interface" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:252 msgid "Servers" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:259 msgid "Filters" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:263 msgid "Logging" msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:682 msgid "Nicknames(s) field must not be empty." msgstr "" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:878 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:265 msgid "Name" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:401 msgid "Disconnected from engine." msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:443 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:548 #, csharp-format msgid "Cause: {0}" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:680 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:699 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "" #: ../src/Frontend-GNOME/Frontend.cs:1007 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "" #: ../src/Frontend-GNOME/NotifyManager.cs:338 msgid "Show" msgstr "చూపించు" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:58 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:233 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "ప్రతినిధి" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:59 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "అతిధేయినామం" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:162 msgid "Unable to load server: " msgstr "" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:239 msgid "Person / Private" msgstr "" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:240 msgid "Group / Public" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "ధన్యవాదములు" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "" #: ../src/Frontend-GNOME/Views/JoinWidget.cs:89 msgid "Enter which chat to join" msgstr "" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:153 msgid "About Smuxi" msgstr "స్మక్సి గురించి" #. TODO: add cmd+, accelerator #: ../src/Frontend-GNOME/Views/MenuWidget.cs:157 msgid "Preferences" msgstr "ప్రాధాన్యతలు" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:251 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:227 msgid "Unable to add server: " msgstr "" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:372 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" #: ../src/Frontend-GNOME/Views/MenuWidget.cs:416 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:288 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:292 #, csharp-format msgid "Day changed to {0}" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:120 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:130 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:197 msgid "Are you sure you want to delete the selected filter?" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:241 msgid "Protocol / Server" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:248 msgid "Chat Type" msgstr "సంభాషణ రకం" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:281 msgid "Normal" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:282 msgid "Event" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:289 msgid "Type" msgstr "" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:314 msgid "Pattern" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:548 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:792 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:135 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:136 msgid "Show _Menubar" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:337 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "" #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:366 msgid "done." msgstr "" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:398 msgid "Person" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:131 msgid "Reconnect" msgstr "" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:180 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:189 msgid "Are you sure you want to delete the selected server?" msgstr "" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:245 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:279 msgid "Unable to edit server: " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "పేరు (_N):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs:69 msgid "Join" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:56 msgid "_Smuxi" msgstr "స్మక్సి (_S)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:59 msgid "_Server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:62 msgid "_Chat" msgstr "సంభాషించు (_C)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:65 msgid "_Engine" msgstr "యంత్రం (_E)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:68 msgid "_View" msgstr "వీక్షణం (_V)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:71 msgid "_Help" msgstr "సహాయం (_H)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:75 msgid "Connect" msgstr "అనుసంధానించు" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:147 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:148 msgid "Open Log" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:87 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:88 msgid "_Preferences" msgstr "ప్రాధాన్యతలు (_P)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:90 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:91 msgid "_Quit" msgstr "నిష్క్రమించు (_Q)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:93 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:94 msgid "_Connect" msgstr "అనుసంధానించు (_C)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:96 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:97 msgid "_Add" msgstr "జతచేయి (_A)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:99 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:100 msgid "_Manage" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:102 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:103 msgid "_Open / Join Chat" msgstr "సంభాషణ తెరువు / చేరు (_O)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:105 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:106 msgid "_Find Group Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:108 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:109 msgid "C_lear All Activity" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:111 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:112 msgid "_Next Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:114 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:115 msgid "_Previous Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:117 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:118 msgid "_Close" msgstr "మూసివేయి (_C)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:120 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:121 msgid "_Use Local Engine" msgstr "స్థానిక యంత్రాన్ని వాడు (_U)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:123 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:124 msgid "_Add Remote Engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:126 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:127 msgid "Switch Remote Engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:129 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:130 msgid "_Caret Mode" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:132 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:133 msgid "_Browse Mode" msgstr "విహారణ రీతి (_B)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:138 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:139 msgid "Show _Statusbar" msgstr "స్థితిపట్టీని చూపించు (_S)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:141 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:142 msgid "_Fullscreen" msgstr "పూర్తితెర (_F)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:144 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:145 msgid "_About" msgstr "గురించి (_A)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:150 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:152 msgid "Find Group Chat" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:154 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:155 msgid "_Website" msgstr "జాలగూడు (_W)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:157 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs:158 msgid "Show _Toolbar" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Connect" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "ఒక దస్త్రాన్ని ఎంచుకోండి" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "వాడుకరిపేరు (_U):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "సంకేతపదం (_P):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "సంకేతపదాన్ని సరిచూడు (_V):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "స్మక్సి - స్వేచ్ఛా సంభాషణ" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "రకం (_T):" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "" smuxi-0.11/po-Frontend-GNOME/hr.po0000644000175000017500000011273312300202374017405 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Mirco Bauer , 2012. # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:22+0100\n" "PO-Revision-Date: 2012-01-22 11:03+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Croatian (http://www.transifex.net/projects/p/smuxi/team/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hr\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid " Chat " msgstr " Chat " #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid " Color " msgstr " Boja " #: ../glade/smuxi-frontend-gnome.glade.h:3 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1172 msgid " Entry Field " msgstr " Polje za unos " #: ../glade/smuxi-frontend-gnome.glade.h:4 msgid " Font " msgstr " Font " #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1502 msgid " Highlighting " msgstr " Isticanje " #: ../glade/smuxi-frontend-gnome.glade.h:6 msgid " Notification Area Icon " msgstr " Obavijesna sličica " #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid " Person List Position " msgstr " Pozicioniranje popisa osoba " #: ../glade/smuxi-frontend-gnome.glade.h:8 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1009 msgid " Tab Colors " msgstr " Boje kartica " #: ../glade/smuxi-frontend-gnome.glade.h:9 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:910 msgid " Tabs Position " msgstr " Pozicija kartica " #: ../glade/smuxi-frontend-gnome.glade.h:10 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1315 msgid " Topic Position " msgstr " Pozicija teme " #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "Advanced" msgstr "Napredno" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "General" msgstr "Općenito" #: ../glade/smuxi-frontend-gnome.glade.h:13 msgid "Global Commands" msgstr "Općenite naredbe" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Message Buffer" msgstr "Međuspremnik poruka" #: ../glade/smuxi-frontend-gnome.glade.h:15 msgid "Messaging Menu" msgstr "Izbornik za poruke" #: ../glade/smuxi-frontend-gnome.glade.h:16 msgid "Network Proxy" msgstr "Mrežni proxy" #: ../glade/smuxi-frontend-gnome.glade.h:17 msgid "Notification Popups" msgstr "Obavijesni popupovi" #: ../glade/smuxi-frontend-gnome.glade.h:18 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:961 msgid "Activity" msgstr "Aktivnost" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:209 msgid "Automatically connect to server at startup" msgstr "Automatski se pri pokretanju poveži sa poslužiteljem" #: ../glade/smuxi-frontend-gnome.glade.h:20 msgid "Background" msgstr "Pozadina" #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1160 msgid "Bash-Style Completion" msgstr "Kompletiranje na Bash način" #: ../glade/smuxi-frontend-gnome.glade.h:22 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1490 msgid "Beep on highlight" msgstr "Ozvuči pri isticanju" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:23 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:780 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:802 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1261 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1286 msgid "Bottom" msgstr "Dno" #: ../glade/smuxi-frontend-gnome.glade.h:24 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:546 msgid "Buffer Lines:" msgstr "Broj redaka u međuspremniku:" #: ../glade/smuxi-frontend-gnome.glade.h:25 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:471 msgid "C_onnection" msgstr "V_eza" #: ../glade/smuxi-frontend-gnome.glade.h:26 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1112 msgid "Command Character:" msgstr "Naredbeni simbol" #: ../glade/smuxi-frontend-gnome.glade.h:27 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1135 msgid "Command History Size:" msgstr "Veličina naredbene povijesti:" #: ../glade/smuxi-frontend-gnome.glade.h:28 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1092 msgid "Completion Character:" msgstr "Simbol za kompletiranje" #: ../glade/smuxi-frontend-gnome.glade.h:29 msgid "Enable" msgstr "Omogući" #: ../glade/smuxi-frontend-gnome.glade.h:30 msgid "Enabled" msgstr "Omogućeno" #: ../glade/smuxi-frontend-gnome.glade.h:31 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:359 msgid "Encoding:" msgstr "Enkodiranje:" #: ../glade/smuxi-frontend-gnome.glade.h:32 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:569 msgid "Engine Buffer Lines:" msgstr "Broj redaka međuspremnika jezgre:" #: ../glade/smuxi-frontend-gnome.glade.h:33 msgid "Foreground" msgstr "Prednja strana" #: ../glade/smuxi-frontend-gnome.glade.h:34 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:725 msgid "General" msgstr "Općenito" #: ../glade/smuxi-frontend-gnome.glade.h:35 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:981 msgid "Highlight" msgstr "Isticanje" #: ../glade/smuxi-frontend-gnome.glade.h:36 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1466 msgid "Highlight words:" msgstr "Istaknute riječi:" #: ../glade/smuxi-frontend-gnome.glade.h:37 msgid "Host:" msgstr "Poslužitelj:" #: ../glade/smuxi-frontend-gnome.glade.h:38 msgid "Hostname:" msgstr "Naziv poslužitelja:" #: ../glade/smuxi-frontend-gnome.glade.h:39 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1181 msgid "Input" msgstr "Unos" #: ../glade/smuxi-frontend-gnome.glade.h:40 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:971 msgid "Join/Part/Mode" msgstr "Spajanje/Napuštanje/Način" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:41 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:816 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:841 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1335 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1361 msgid "Left" msgstr "Napuštanje" #: ../glade/smuxi-frontend-gnome.glade.h:42 msgid "Log Filtered Messages" msgstr "Filtrirane poruke zapisa" #: ../glade/smuxi-frontend-gnome.glade.h:43 msgid "Network:" msgstr "Mreža:" #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1202 msgid "Nick Colors" msgstr "Boje nadimka" #: ../glade/smuxi-frontend-gnome.glade.h:45 msgid "Nickname(s):" msgstr "Nadimak(ili više njih):" #: ../glade/smuxi-frontend-gnome.glade.h:46 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:953 msgid "No Activity" msgstr "Bez aktivnosti" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:896 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1301 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1416 msgid "None" msgstr "Bez" #: ../glade/smuxi-frontend-gnome.glade.h:48 msgid "Notification" msgstr "Obavijest" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:381 msgid "On Connect Commands:" msgstr "Naredbe pri spajanju:" #: ../glade/smuxi-frontend-gnome.glade.h:50 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:427 msgid "On Startup Commands:" msgstr "Naredbe pri pokretanju:" #: ../glade/smuxi-frontend-gnome.glade.h:51 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1514 msgid "Output" msgstr "Ispis" #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Override" msgstr "Prekorači" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Password:" msgstr "Lozinka:" #: ../glade/smuxi-frontend-gnome.glade.h:54 msgid "Persistency Type:" msgstr "Način stalnosti:" #: ../glade/smuxi-frontend-gnome.glade.h:55 msgid "Persistent Buffer Lines:" msgstr "Broj redaka stalnog međuspremnika:" #: ../glade/smuxi-frontend-gnome.glade.h:56 msgid "Port:" msgstr "Port:" #: ../glade/smuxi-frontend-gnome.glade.h:57 msgid "Protocol:" msgstr "Protokol:" #: ../glade/smuxi-frontend-gnome.glade.h:58 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:338 msgid "Realname:" msgstr "Pravo ime:" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:59 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:856 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:881 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1376 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1401 msgid "Right" msgstr "Desno" #: ../glade/smuxi-frontend-gnome.glade.h:60 msgid "Show Advanced Settings" msgstr "Prikaži napredne postavke" #: ../glade/smuxi-frontend-gnome.glade.h:61 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:170 msgid "Show Password" msgstr "Prikaži lozinku" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid "Show Smuxi in the messaging menu" msgstr "Prikaži Smuxi u izborniku za poruke" #: ../glade/smuxi-frontend-gnome.glade.h:63 msgid "Show always" msgstr "Prikaži uvijek" #: ../glade/smuxi-frontend-gnome.glade.h:64 msgid "Show notification popups" msgstr "Prikažu obavijesne popupove" #: ../glade/smuxi-frontend-gnome.glade.h:65 msgid "Show when window is closed" msgstr "Prikaži kada je prozor zatvoren" #: ../glade/smuxi-frontend-gnome.glade.h:66 msgid "Show when window is minimized" msgstr "Prikaži kada je prozor minimiziran" #: ../glade/smuxi-frontend-gnome.glade.h:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:16 msgid "Smuxi - Server" msgstr "Smuxi - Poslužitelj" #: ../glade/smuxi-frontend-gnome.glade.h:68 msgid "Smuxi Preferences" msgstr "Smuxi postavke" #: ../glade/smuxi-frontend-gnome.glade.h:69 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:628 msgid "Strip Colors" msgstr "Ukloni boje" #: ../glade/smuxi-frontend-gnome.glade.h:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:667 msgid "Strip Formattings" msgstr "Ukloni formatiranje" #: ../glade/smuxi-frontend-gnome.glade.h:71 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:707 msgid "Strip UTF-8" msgstr "Ukloni UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:72 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1022 msgid "Tabs" msgstr "Kartice" #: ../glade/smuxi-frontend-gnome.glade.h:73 msgid "" "The nickname to use. You can specify extra nicknames (separated by spaces) " "which will be used as fallbacks when the first choice is not available. By " "default $nick_ and $nick__ will be used as fallbacks." msgstr "" "Nadimak za korištenje. Možete odrediti dodatne nadimke (odvojene razmakom) " "koji će biti korišten u slučaju da prvi odabir nije dostupan. Tada će $nick_" " i $nick__ biti korišteni." #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:526 msgid "Timestamp Format:" msgstr "Format vremenske oznake:" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:743 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:767 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1220 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1246 msgid "Top" msgstr "Vrh" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "Type:" msgstr "Oblik:" #: ../glade/smuxi-frontend-gnome.glade.h:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:315 msgid "Username:" msgstr "Korisnički ime:" #: ../glade/smuxi-frontend-gnome.glade.h:78 msgid "Volatile Buffer Lines:" msgstr "Broj redaka nestalnog međuspremnika:" #: ../glade/smuxi-frontend-gnome.glade.h:79 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1681 msgid "_Filters" msgstr "_Filteri" #: ../glade/smuxi-frontend-gnome.glade.h:80 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1523 msgid "_Interface" msgstr "_Sučelje" #: ../glade/smuxi-frontend-gnome.glade.h:81 msgid "_Logging" msgstr "_Zapisivanje" #: ../glade/smuxi-frontend-gnome.glade.h:82 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1589 msgid "_Servers" msgstr "_Poslužitelji" #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:84 msgid "_Wrap Mode:" msgstr "_Način omota:" #: ../glade/smuxi-frontend-gnome.glade.h:85 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "" "ss = sekunde\n" "mm = minute\n" "hh = sati (01 - 12)\n" "HH = sati (00 - 23)\n" "tt = prijepodne/poslijepodne\n" "\n" "dd = dan\n" "MM = mjesec\n" "yy/yyyy = godina" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Chat with other people on IRC" msgstr "Chatajte sa drugim ljudima na IRCu" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "IRC Chat" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi" msgstr "Smuxi" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:4 msgid "Smuxi IRC Client" msgstr "Smuxi IRC klijent" #: ../src/Frontend-GNOME/AboutDialog.cs:60 msgid "translator-credits" msgstr "Matias M. " #: ../src/Frontend-GNOME/AboutDialog.cs:65 msgid "Smuxi Website" msgstr "Smuxi web stranica" #: ../src/Frontend-GNOME/CrashDialog.cs:46 msgid "Oops, I did it again..." msgstr "Ups, ponovno sam to učinio..." #: ../src/Frontend-GNOME/CrashDialog.cs:59 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "Smuxi se srušio zbog iznimke kojom nije bilo moguće rukovati!" #: ../src/Frontend-GNOME/CrashDialog.cs:63 msgid "Here is the stacktrace, please report this bug!" msgstr "Ovdje je zapis, molimo vas prijavite ovu pogrešku!" #: ../src/Frontend-GNOME/CrashDialog.cs:83 msgid "_Report Bug" msgstr "_Prijavi pogrešku" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:61 msgid "Engine Manager" msgstr "Upravitelj jezgri" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:80 msgid "Select which Smuxi engine you want to connect to" msgstr "Odaberite Smuxi jezgru na koju se želite spojiti" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:86 msgid "Engine:" msgstr "Jezgra:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:97 msgid "Use Low Bandwidth Mode" msgstr "Koristi način rada sa nižom propusnošću" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:121 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:181 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:358 msgid "Local Engine" msgstr "Lokalna jezgra" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:173 msgid "Please select an engine!" msgstr "Molimo odaberite jezgru!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:194 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "Vaša inačica sučelja ({0}) ne odgovara inačici jezgre ({1})!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:221 msgid "An error occurred while connecting to the engine!" msgstr "Došlo je do pogreške pri spajanju sa jezgrom!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:222 #, csharp-format msgid "Engine URL: {0}" msgstr "URL jezgre: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:225 #, csharp-format msgid "Error: {0}" msgstr "Pogreška: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:295 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Želite li sigurno ukloniti jezgru \"{0}\"?" #: ../src/Frontend-GNOME/Entry.cs:443 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Zalijepiti ćete {0} redaka. Želite li nastaviti?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:547 msgid "Frontend Commands" msgstr "Naredbe sučelja" #: ../src/Frontend-GNOME/MainWindow.cs:252 msgid "_File" msgstr "_Datoteka" #: ../src/Frontend-GNOME/MainWindow.cs:276 msgid "_Server" msgstr "_Poslužitelj" #: ../src/Frontend-GNOME/MainWindow.cs:280 msgid "_Quick Connect" msgstr "_Brzo spajanje" #: ../src/Frontend-GNOME/MainWindow.cs:291 msgid "_Manage" msgstr "_uredi" #: ../src/Frontend-GNOME/MainWindow.cs:298 msgid "_Chat" msgstr "_Chat" #: ../src/Frontend-GNOME/MainWindow.cs:302 msgid "Open / Join Chat" msgstr "Otvori / spoji na chat" #: ../src/Frontend-GNOME/MainWindow.cs:308 msgid "_Find Group Chat" msgstr "_Pronađi grupni chat" #: ../src/Frontend-GNOME/MainWindow.cs:314 msgid "C_lear All Activity" msgstr "O_čisti sve aktivnosti" #: ../src/Frontend-GNOME/MainWindow.cs:321 msgid "_Next Chat" msgstr "_Sljedeći chat" #: ../src/Frontend-GNOME/MainWindow.cs:335 msgid "_Previous Chat" msgstr "_Prethodni chat" #: ../src/Frontend-GNOME/MainWindow.cs:389 msgid "Open Log" msgstr "Otvori zapis" #: ../src/Frontend-GNOME/MainWindow.cs:407 msgid "_Engine" msgstr "_Jezgra" #: ../src/Frontend-GNOME/MainWindow.cs:411 msgid "_Use Local Engine" msgstr "_Koristi lokalnu jezgru" #: ../src/Frontend-GNOME/MainWindow.cs:417 msgid "_Add Remote Engine" msgstr "_Dodaj udaljenu jezgru" #: ../src/Frontend-GNOME/MainWindow.cs:422 msgid "_Switch Remote Engine" msgstr "_Promijeni udaljenu jezgru" #: ../src/Frontend-GNOME/MainWindow.cs:429 msgid "_View" msgstr "_Prikaz" #: ../src/Frontend-GNOME/MainWindow.cs:433 msgid "_Caret Mode" msgstr "_Način sa znakom za umetanje" #: ../src/Frontend-GNOME/MainWindow.cs:445 msgid "_Browse Mode" msgstr "_Način pregledavanja" #: ../src/Frontend-GNOME/MainWindow.cs:463 #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:722 msgid "Show _Menubar" msgstr "Prikaži _traku izbornika" #: ../src/Frontend-GNOME/MainWindow.cs:494 msgid "_Help" msgstr "_Pomoć" #: ../src/Frontend-GNOME/MainWindow.cs:768 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:225 msgid "Unable to add server: " msgstr "Dodavanje poslužitelja nije uspjelo:" #: ../src/Frontend-GNOME/MainWindow.cs:828 #, csharp-format msgid "Unknown ChatType: {0}" msgstr "Nepoznat ChatType: {0}" #: ../src/Frontend-GNOME/MainWindow.cs:1097 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Prebacivanjem na lokalnu jezgru odvojiti ćete se od trenutne!\n" "Želite li to sigurno učiniti?" #: ../src/Frontend-GNOME/MainWindow.cs:1139 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Prebacivanje na udaljenu jezgru će vas odvojiti od trenutne jezgre!\n" "Želite li to sigurno učiniti?" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Ispričavamo se, još nije implementirano!" #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:179 msgid "Character" msgstr "Simbol" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:180 msgid "Word" msgstr "Riječ" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:197 msgid "Volatile" msgstr "Nestalno" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:199 msgid "Persistent" msgstr "Stalno" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:222 msgid "No Proxy" msgstr "Bez proxya" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:224 #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:307 msgid "System Default" msgstr "Početno stanje" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:238 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:140 msgid "Connection" msgstr "Veza" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:242 msgid "Interface" msgstr "Sučelje" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:246 msgid "Servers" msgstr "Poslužitelji" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:253 msgid "Filters" msgstr "Filteri" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:257 msgid "Logging" msgstr "Zapisivanje" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:642 msgid "Nicknames(s) field must not be empty." msgstr "Polje za nadimak ne smije biti prazno." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:823 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Nepoznati regularni izraz za isticanje: '{0}'. Razlog: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:81 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:106 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:271 msgid "Name" msgstr "Ime" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:86 msgid "Topic" msgstr "Tema" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:115 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "" "Pretraga za grupni chatom bez filtera nije preporučena. To bi moglo potrajati ili pak uopće ne raditi.\n" "Želite li nastaviti?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:156 msgid "Error while fetching the list of group chats from the server." msgstr "Greška pri dohvaćanju popisa grupnih chatova sa poslužitelja" #: ../src/Frontend-GNOME/Frontend.cs:325 msgid "Disconnected from engine." msgstr "Više niste spojeni sa jezgrom." #: ../src/Frontend-GNOME/Frontend.cs:368 #, csharp-format msgid "Reconnecting to engine... (attempt {0})" msgstr "Ponovno spajanje sa jezgrom... (pokušaj broj {0})" #: ../src/Frontend-GNOME/Frontend.cs:465 #, csharp-format msgid "Cause: {0}" msgstr "Razlog: {0}" #: ../src/Frontend-GNOME/Frontend.cs:583 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "" "Sučelje je izgubilo vezu sa poslužiteljem.\n" "Želite li se ponovno spojiti?" #: ../src/Frontend-GNOME/Frontend.cs:602 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "" "Ponovno spajanje sa poslužiteljem nije uspjelo.\n" "Želite li pokušati ponovno?" #: ../src/Frontend-GNOME/Frontend.cs:705 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "" "Poslužitelj je izgubio vezu sa sučeljem.\n" "Želite li se ponovno spojiti." #: ../src/Frontend-GNOME/NotifyManager.cs:267 msgid "Show" msgstr "Prikaži" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:62 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:238 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protokol" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:63 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Naziv poslužitelja" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:166 msgid "Unable to load server: " msgstr "Neuspjelo učitavanje poslužitelja:" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:244 msgid "Person / Private" msgstr "Osoba / Privatno" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:245 msgid "Group / Public" msgstr "Grupa / Javno" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:71 msgid "Engine Assistant - Smuxi" msgstr "Pomoćnik za jezgre - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:93 msgid "Add Smuxi Engine" msgstr "Dodaj Smuxi jezgru" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:95 msgid "Edit Smuxi Engine" msgstr "Uredi Smuxi jezgru" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:204 msgid "Credentials" msgstr "Oznaka autoriteta" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:284 msgid "Now you can use the Smuxi Engine" msgstr "Sada možete koristiti Smuxi jezgru" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:287 msgid "Thank you" msgstr "Hvala" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:304 msgid "" "An engine with this name already exists! Please specify a different one." msgstr "Jezgra tog imena već postoji! Molimo odaberite neko drugo ime." #: ../src/Frontend-GNOME/Views/MessageTextView.cs:204 #, csharp-format msgid "Day changed from {0} to {1}" msgstr "Dan se promijenio iz {0} u {1}" #: ../src/Frontend-GNOME/Views/MessageTextView.cs:210 #, csharp-format msgid "Day changed to {0}" msgstr "Dan promijenjen u {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:123 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:133 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Nepravilan regularan izraz filtera: '{0}'. Razlog: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:200 msgid "Are you sure you want to delete the selected filter?" msgstr "Želite li sigurno ukloniti označeni filter?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:246 msgid "Protocol / Server" msgstr "Protokol / Poslužitelj" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:253 msgid "Chat Type" msgstr "Način chata" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:287 msgid "Normal" msgstr "Normalno" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:288 msgid "Event" msgstr "Događaj" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:295 msgid "Type" msgstr "Način" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:321 msgid "Pattern" msgstr "Obrazac" #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:506 msgid "Low Bandwidth Mode is active: no messages synced." msgstr "" "Način rada sa niskom propusnošću je aktivan: nijedna poruka još nije " "sinkronizirana:" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:245 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "Dohvaćanje popisa korisnika za {0}..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:279 msgid "done." msgstr "gotovo." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:290 msgid "Person" msgstr "Osoba" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:69 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "" "Zatvaranje protokolnog chata će također zatvoriti sve otvorene kartice koje su spojene!\n" "Želite li to sigurno učiniti?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:187 msgid "Are you sure you want to delete the selected server?" msgstr "Želite li sigurno ukloniti označeni poslužitelj?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:243 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:277 msgid "Unable to edit server: " msgstr "Nije moguće urediti poslužitelj: " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:24 msgid "Find" msgstr "Nađi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:44 msgid "_Search for:" msgstr "_Traži:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:73 msgid "_Match Case" msgstr "_Razlikuj veliko i malo slovo" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:85 msgid "Search _Backwards" msgstr "Traži _unatrag" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:97 msgid "_Wrap Around" msgstr "_Omotaj okolo" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:110 msgid "Use _Regular Expressions" msgstr "Koristi _regularne izraze" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:23 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Pronađi grupni chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:73 msgid "_Name:" msgstr "_Ime:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:19 msgid "Smuxi - Quick Connect" msgstr "Smuxi - Brzo spajanje" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:206 msgid "Smuxi - Preferences" msgstr "Smuxi - Postavke" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:295 msgid "Nicknames:" msgstr "Nadimci:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1430 msgid " User List Position " msgstr " Pozicioniranje popisa korisnika " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1441 msgid " Channel " msgstr " Kanal " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1652 msgid "Channel Filters" msgstr "Filteri kanal" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1669 msgid "User Filters" msgstr "Korisnički filteri" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:42 msgid "Use _SSH Tunnel" msgstr "Koristi _SSH tunel" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "" "Enables the use of SSH for the connection. This has a " "small performance impact, but is more secure and required when using NAT or " "port-based firewalls" msgstr "" "Omogućava korištenje SSHa pri povezivanju. Dolazi po " "cijeni nižih performansi ali je sigurnije te potrebno pri korištenju NATa i " "određenih vatrozida." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:135 msgid "SSH _Host:" msgstr "SSH _poslužitelj:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:146 msgid "DNS or IP address and port of the SSH server" msgstr "DNS ili IP adresa i port SSH poslužitelja" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:159 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:129 msgid "_Port:" msgstr "_Port;" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:186 msgid "DNS or IP address and port of the Smuxi server" msgstr "DNS ili IP adresa i port Smuxi poslužitelja" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:199 msgid "_Smuxi Host:" msgstr "_Smuxi poslužitelj:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:52 msgid "_SSH Username: (optional)" msgstr "_SSH korisnički ime: (dodatno)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:75 msgid "" "Username which will be used to log into the SSH " "server" msgstr "" "Korisničko ime korišteno za prijavu na SSH " "poslužitelj" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:95 msgid "_SSH Password: (optional)" msgstr "_SSH lozinka: (dodatno)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:119 msgid "" "Password which will be used to log into the SSH server." " The password is optional if SSH key authorization is used (see " "below)." msgstr "" "Lozinka koja će biti korištena za prijavu na SSH " "poslužitelj. Lozinka nije obavezna ako se koristi SSH autorizacijski ključ " "(vidi dolje)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:140 msgid "_SSH Keyfile: (optional)" msgstr "_SSH ključ: (dodatno)" #. Container child vbox17.Gtk.Box+BoxChild #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:148 msgid "Select a File" msgstr "Odaberite datoteku" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:161 msgid "" "SSH private keyfile which will be used to log into the " "SSH server" msgstr "" "SSH privatni ključ koji će biti korišten za prijavu na " "SSH poslužitelj" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:181 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:188 msgid "_Username:" msgstr "_Korisničko ime:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:204 msgid "" "Username which will be used to log into the Smuxi " "server" msgstr "" "Korisničko ime korišteno za prijavu na Smuxi " "poslužitelj" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:224 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:87 msgid "_Password:" msgstr "_Lozinka:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:248 msgid "Password of the user" msgstr "Korisnička lozinka" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:268 msgid "_Verify Password:" msgstr "_Potvrda lozinke:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:292 msgid "Repeat the password for verification" msgstr "Potvrdite lozinku ponovnim upisivanjem" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "" "Smuxi asistent za namještavanje jezgre vas pozdravlja.\n" "Morate unijeti određene podatke prije korištenja jezgre.\n" "\n" "Kliknite \"Naprijed\" za početak." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:36 msgid "_Engine Name:" msgstr "_Naziv jezgre" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:59 msgid "Profile name of the new engine" msgstr "Ime profila nove jezgre" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:80 msgid "_Default Engine:" msgstr "_Zadana jezgra:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:91 msgid "Use as new default engine" msgstr "Koristi kao novu zadanu jezgru" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:104 msgid "" "If enabled, the current engine will be the default next" " time Smuxi is started" msgstr "" "Ako uključena, nova jezgra će biti zadana pri sljedećem" " pokretanju Smuxi aplikacije" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:20 msgid "Smuxi - Open Chat" msgstr "Smuxi - Otvori chat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:63 msgid "_Type:" msgstr "_Oblik:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:54 msgid "_Hostname:" msgstr "_Ime poslužitelja:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:75 msgid "_Network:" msgstr "_Mreža:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:198 msgid "_Protocol:" msgstr "_Protokol:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:222 msgid "Use Encryption" msgstr "Koristi enkripciju" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:234 msgid "Validate Server Certificate" msgstr "Utvrdi valjanost poslužiteljevog certifikata" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:254 msgid "_On Connect Commands:" msgstr "_Naredbe pri spajanju:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:265 msgid "_Ignore Commands" msgstr "_Ignoriraj naredbe" smuxi-0.11/po-Frontend-GNOME/ca.po0000644000175000017500000011001012300202374017341 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: Smuxi\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2010-07-18 19:35+0100\n" "Last-Translator: Siegfried-Angel Gevatter Pujals \n" "Language-Team: Siegfried-Angel Gevatter Pujals \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: \n" "Plural-Forms: nplurals=2; plural=n != 1\n" "X-Poedit-Language: Catalan\n" #: ../glade/smuxi-frontend-gnome.glade.h:1 msgid " Chat " msgstr " Xat " #: ../glade/smuxi-frontend-gnome.glade.h:2 msgid " Color " msgstr " Color " #: ../glade/smuxi-frontend-gnome.glade.h:3 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1364 msgid " Entry Field " msgstr " Camp d'entrada " #: ../glade/smuxi-frontend-gnome.glade.h:4 msgid " Font " msgstr " Tipus de lletra " #: ../glade/smuxi-frontend-gnome.glade.h:5 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1694 msgid " Highlighting " msgstr " Ressaltat " #: ../glade/smuxi-frontend-gnome.glade.h:6 msgid " Notification Area Icon " msgstr " Icona a l'àrea de notificació " #: ../glade/smuxi-frontend-gnome.glade.h:7 msgid " Person List Position " msgstr " Posició de la llista de persones " #: ../glade/smuxi-frontend-gnome.glade.h:8 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1201 msgid " Tab Colors " msgstr " Colors de les pestanyes " #: ../glade/smuxi-frontend-gnome.glade.h:9 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1102 msgid " Tabs Position " msgstr " Posició de les pestanyes " #: ../glade/smuxi-frontend-gnome.glade.h:10 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1507 msgid " Topic Position " msgstr " Posició del títol " #: ../glade/smuxi-frontend-gnome.glade.h:11 msgid "General" msgstr "General" #: ../glade/smuxi-frontend-gnome.glade.h:12 msgid "Global Commands" msgstr "Ordres globals" #: ../glade/smuxi-frontend-gnome.glade.h:13 msgid "Messaging Menu" msgstr "Indicator de missatges" #: ../glade/smuxi-frontend-gnome.glade.h:14 msgid "Network Proxy" msgstr "Servidor intermediari" #: ../glade/smuxi-frontend-gnome.glade.h:15 msgid "Notification Popups" msgstr "Notificacions" #: ../glade/smuxi-frontend-gnome.glade.h:16 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1153 msgid "Activity" msgstr "Activitat" #: ../glade/smuxi-frontend-gnome.glade.h:17 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:235 msgid "Automatically connect to server at startup" msgstr "Connecta't automàticament al servidor a l'inici" #: ../glade/smuxi-frontend-gnome.glade.h:18 msgid "Background" msgstr "Fons" #: ../glade/smuxi-frontend-gnome.glade.h:19 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1352 msgid "Bash-Style Completion" msgstr "Completat semblant al del Bash" #: ../glade/smuxi-frontend-gnome.glade.h:20 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1682 msgid "Beep on highlight" msgstr "Fes un avís sonor en ressaltar una paraula" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:21 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:972 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:994 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1453 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1478 msgid "Bottom" msgstr "A baix" #: ../glade/smuxi-frontend-gnome.glade.h:22 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:738 msgid "Buffer Lines:" msgstr "Línies a la memòria intermediària:" #: ../glade/smuxi-frontend-gnome.glade.h:23 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:663 msgid "C_onnection" msgstr "_Connexió" #: ../glade/smuxi-frontend-gnome.glade.h:24 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1304 msgid "Command Character:" msgstr "Caràcter d'ordre:" #: ../glade/smuxi-frontend-gnome.glade.h:25 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1327 msgid "Command History Size:" msgstr "Mida de l'historial d'ordres:" #: ../glade/smuxi-frontend-gnome.glade.h:26 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1284 msgid "Completion Character:" msgstr "Caràcter de completat:" #: ../glade/smuxi-frontend-gnome.glade.h:27 msgid "Enable" msgstr "Habilita" #: ../glade/smuxi-frontend-gnome.glade.h:28 msgid "Enabled" msgstr "Habilitat" #: ../glade/smuxi-frontend-gnome.glade.h:29 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:551 msgid "Encoding:" msgstr "Codificació:" #: ../glade/smuxi-frontend-gnome.glade.h:30 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:761 msgid "Engine Buffer Lines:" msgstr "Línies a la memòria intermediària del motor:" #: ../glade/smuxi-frontend-gnome.glade.h:31 msgid "Foreground" msgstr "Primer pla" #: ../glade/smuxi-frontend-gnome.glade.h:32 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:917 msgid "General" msgstr "General" #: ../glade/smuxi-frontend-gnome.glade.h:33 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1173 msgid "Highlight" msgstr "Ressaltat" #: ../glade/smuxi-frontend-gnome.glade.h:34 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1658 msgid "Highlight words:" msgstr "Paraules a ressaltar:" #: ../glade/smuxi-frontend-gnome.glade.h:35 msgid "Host:" msgstr "Màquina:" #: ../glade/smuxi-frontend-gnome.glade.h:36 msgid "Hostname:" msgstr "Nom de la màquina:" #: ../glade/smuxi-frontend-gnome.glade.h:37 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1373 msgid "Input" msgstr "Entrada" #: ../glade/smuxi-frontend-gnome.glade.h:38 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1163 msgid "Join/Part/Mode" msgstr "Entra/Surt/Mode" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:39 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1008 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1033 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1527 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1553 msgid "Left" msgstr "A l'esquerra" #: ../glade/smuxi-frontend-gnome.glade.h:40 msgid "Log Filtered Messages" msgstr "Enregistra els missatges filtrats" #: ../glade/smuxi-frontend-gnome.glade.h:41 msgid "Network:" msgstr "Xarxa:" #: ../glade/smuxi-frontend-gnome.glade.h:42 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1394 msgid "Nick Colors" msgstr "Colors dels sobrenoms" #: ../glade/smuxi-frontend-gnome.glade.h:43 msgid "Nickname(s):" msgstr "Sobrenom(s):" #: ../glade/smuxi-frontend-gnome.glade.h:44 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1145 msgid "No Activity" msgstr "Sense activitat" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:45 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1088 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1493 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1608 msgid "None" msgstr "Enlloc" #: ../glade/smuxi-frontend-gnome.glade.h:46 msgid "Notification" msgstr "Notificació" #: ../glade/smuxi-frontend-gnome.glade.h:47 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:573 msgid "On Connect Commands:" msgstr "Ordres al connectar:" #: ../glade/smuxi-frontend-gnome.glade.h:48 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:619 msgid "On Startup Commands:" msgstr "Ordres a l'inici:" #: ../glade/smuxi-frontend-gnome.glade.h:49 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1706 msgid "Output" msgstr "Sortida" #: ../glade/smuxi-frontend-gnome.glade.h:50 msgid "Override" msgstr "Sobreescriu" #: ../glade/smuxi-frontend-gnome.glade.h:51 msgid "Password:" msgstr "Contrasenya:" #: ../glade/smuxi-frontend-gnome.glade.h:52 msgid "Port:" msgstr "Port:" #: ../glade/smuxi-frontend-gnome.glade.h:53 msgid "Protocol:" msgstr "Protocol:" #: ../glade/smuxi-frontend-gnome.glade.h:54 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:530 msgid "Realname:" msgstr "Nom real:" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox12.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:55 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1048 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1073 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1568 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1593 msgid "Right" msgstr "A la dreta" #: ../glade/smuxi-frontend-gnome.glade.h:56 msgid "Show Advanced Settings" msgstr "Mostra les opcions avançades" #: ../glade/smuxi-frontend-gnome.glade.h:57 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:196 msgid "Show Password" msgstr "Mostra la contrasenya" #: ../glade/smuxi-frontend-gnome.glade.h:58 msgid "Show Smuxi in the messaging menu" msgstr "Mostra el Smuxi a l'indicador de missatges" #: ../glade/smuxi-frontend-gnome.glade.h:59 msgid "Show always" msgstr "Sempre visible" #: ../glade/smuxi-frontend-gnome.glade.h:60 msgid "Show notification popups" msgstr "Mostra notificacions emergents" #: ../glade/smuxi-frontend-gnome.glade.h:61 msgid "Show when window is closed" msgstr "Visible quan la finestra està tancada" #: ../glade/smuxi-frontend-gnome.glade.h:62 msgid "Show when window is minimized" msgstr "Visible quan la finestra està minimitzada" #: ../glade/smuxi-frontend-gnome.glade.h:63 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:398 msgid "Smuxi - Preferences" msgstr "Smuxi - Preferències" #: ../glade/smuxi-frontend-gnome.glade.h:64 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs:18 msgid "Smuxi - Server" msgstr "Smuxi - Servidor" #: ../glade/smuxi-frontend-gnome.glade.h:65 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:820 msgid "Strip Colors" msgstr "Elimina els colors" #: ../glade/smuxi-frontend-gnome.glade.h:66 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:859 msgid "Strip Formattings" msgstr "Elimina el format" #: ../glade/smuxi-frontend-gnome.glade.h:67 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:899 msgid "Strip UTF-8" msgstr "Elimina caràcters UTF-8" #: ../glade/smuxi-frontend-gnome.glade.h:68 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1214 msgid "Tabs" msgstr "Pestanyes" #: ../glade/smuxi-frontend-gnome.glade.h:69 msgid "The nickname to use. You can specify extra nicknames (separated by spaces) which will be used as fallbacks when the first choice is not available. By default $nick_ and $nick__ will be used as fallbacks." msgstr "El sobrenom a utilitzar. Podeu especificar sobrenoms addicionals (separats per comes) a utilitzar alternativament en cas que la primera tria no estigui disponible. Per omissió, s'utilitza $nick_ i $nick__ com a sobrenoms alternatius." #: ../glade/smuxi-frontend-gnome.glade.h:70 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:718 msgid "Timestamp Format:" msgstr "Format de les marques horàries:" #. Container child vbox6.Gtk.Box+BoxChild #. Container child vbox11.Gtk.Box+BoxChild #: ../glade/smuxi-frontend-gnome.glade.h:71 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:935 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:959 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1412 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1438 msgid "Top" msgstr "A dalt" #: ../glade/smuxi-frontend-gnome.glade.h:72 msgid "Type:" msgstr "Tipus:" #: ../glade/smuxi-frontend-gnome.glade.h:73 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:507 msgid "Username:" msgstr "Nom d'usuari:" #: ../glade/smuxi-frontend-gnome.glade.h:74 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1873 msgid "_Filters" msgstr "_Filtres" #: ../glade/smuxi-frontend-gnome.glade.h:75 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1715 msgid "_Interface" msgstr "_Interfície" #: ../glade/smuxi-frontend-gnome.glade.h:76 msgid "_Logging" msgstr "_Registre" #: ../glade/smuxi-frontend-gnome.glade.h:77 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1781 msgid "_Servers" msgstr "_Servidors" #. This is a setting for character based line wrapping vs word based when #. showing messages #: ../glade/smuxi-frontend-gnome.glade.h:79 msgid "_Wrap Mode:" msgstr "_Ajustament de línia:" #: ../glade/smuxi-frontend-gnome.glade.h:80 msgid "" "ss = seconds\n" "mm = minutes\n" "hh = hours (01 - 12)\n" "HH = hours (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = day\n" "MM = month\n" "yy/yyyy = year" msgstr "" "ss = segons\n" "mm = minuts\n" "hh = hores (01 - 12)\n" "HH = hores (00 - 23)\n" "tt = AM/PM\n" "\n" "dd = dia\n" "MM = mes\n" "yy/yyyy = any" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:1 msgid "Chat with other people on IRC" msgstr "Xategeu amb altres persones a l'IRC" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:2 msgid "IRC Chat" msgstr "_Xat a l'IRC" #: ../src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in.h:3 msgid "Smuxi IRC Client" msgstr "Client d'IRC Smuxi" #: ../src/Frontend-GNOME/AboutDialog.cs:58 msgid "translator-credits" msgstr "Siegfried-Angel Gevatter Pujals " #: ../src/Frontend-GNOME/AboutDialog.cs:61 msgid "Smuxi Website" msgstr "Pàgina web del Smuxi" #: ../src/Frontend-GNOME/CrashDialog.cs:44 msgid "Oops, I did it again..." msgstr "Ups, ho he tornat a fer..." #: ../src/Frontend-GNOME/CrashDialog.cs:57 msgid "Smuxi crashed because an unhandled exception was thrown!" msgstr "El Smuxi ha petat perquè s'ha produït una excepció imprevista." #: ../src/Frontend-GNOME/CrashDialog.cs:61 msgid "Here is the stacktrace, please report this bug!" msgstr "Aquí teniu el traçat de la pila. Si us plau, informeu d'aquest error!" #: ../src/Frontend-GNOME/CrashDialog.cs:81 msgid "_Report Bug" msgstr "_Informeu d'un error" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:61 msgid "Engine Manager" msgstr "Gestor de motors" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:68 msgid "_Connect" msgstr "_Connecta" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:84 msgid "Select which Smuxi engine you want to connect to" msgstr "Trieu a quin motor del Smuxi us voleu connectar" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:90 msgid "Engine:" msgstr "Motor:" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:116 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:176 #: ../src/Frontend-GNOME/EngineManagerDialog.cs:353 msgid "Local Engine" msgstr "Motor local" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:168 msgid "Please select an engine!" msgstr "Trieu un motor!" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:189 #, csharp-format msgid "Your frontend version ({0}) does not match the engine version ({1})!" msgstr "La versió del frontal ({0}) no coincideix amb la versió del motor ({1})." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:216 msgid "An error occurred while connecting to the engine!" msgstr "S'ha produït un error al intentar connectar al motor." #: ../src/Frontend-GNOME/EngineManagerDialog.cs:217 #, csharp-format msgid "Engine URL: {0}" msgstr "URL del motor: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:220 #, csharp-format msgid "Error: {0}" msgstr "Error: {0}" #: ../src/Frontend-GNOME/EngineManagerDialog.cs:290 #, csharp-format msgid "Are you sure you want to delete the engine \"{0}\"?" msgstr "Esteu segur que voleu esborrar el motor «{0}»?" #: ../src/Frontend-GNOME/Entry.cs:421 #, csharp-format msgid "You are going to paste {0} lines. Do you want to continue?" msgstr "Esteu a punt d'enganxar {0} línies. Voleu continuar?" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Frontend-GNOME/Entry.cs:524 msgid "Frontend Commands" msgstr "Ordres del frontal" #: ../src/Frontend-GNOME/MainWindow.cs:222 msgid "_File" msgstr "_Fitxer" #: ../src/Frontend-GNOME/MainWindow.cs:238 msgid "_Server" msgstr "_Servidor" #: ../src/Frontend-GNOME/MainWindow.cs:242 msgid "_Quick Connect" msgstr "_Connexió ràpida" #: ../src/Frontend-GNOME/MainWindow.cs:253 msgid "_Manage" msgstr "_Gestiona" #: ../src/Frontend-GNOME/MainWindow.cs:260 msgid "_Chat" msgstr "_Xat" #: ../src/Frontend-GNOME/MainWindow.cs:264 msgid "Open / Join Chat" msgstr "Obre / Uneix-te a una sala de xat" #: ../src/Frontend-GNOME/MainWindow.cs:269 msgid "_Find Group Chat" msgstr "_Troba sales de xat en grup" #: ../src/Frontend-GNOME/MainWindow.cs:274 msgid "C_lear All Activity" msgstr "_Neteja totes les activitats" #: ../src/Frontend-GNOME/MainWindow.cs:281 msgid "_Next Chat" msgstr "Xat _següent" #: ../src/Frontend-GNOME/MainWindow.cs:291 msgid "_Previous Chat" msgstr "Xat _anterior" #: ../src/Frontend-GNOME/MainWindow.cs:341 msgid "Open Log" msgstr "Obre el registre" #: ../src/Frontend-GNOME/MainWindow.cs:355 msgid "_Engine" msgstr "_Motor" #: ../src/Frontend-GNOME/MainWindow.cs:359 msgid "_Use Local Engine" msgstr "_Utilitza el motor local" #: ../src/Frontend-GNOME/MainWindow.cs:365 msgid "_Add Remote Engine" msgstr "_Afegeix un motor remot" #: ../src/Frontend-GNOME/MainWindow.cs:370 msgid "_Switch Remote Engine" msgstr "_Canvia el motor remot" #: ../src/Frontend-GNOME/MainWindow.cs:377 msgid "_View" msgstr "_Mostra" #: ../src/Frontend-GNOME/MainWindow.cs:381 msgid "_Caret Mode" msgstr "Navega amb el _cursor" #: ../src/Frontend-GNOME/MainWindow.cs:389 msgid "_Browse Mode" msgstr "Mode d'_exploració" #: ../src/Frontend-GNOME/MainWindow.cs:403 #: ../src/Frontend-GNOME/Views/Chats/ChatView.cs:586 msgid "Show _Menubar" msgstr "Mostra la barra de _menú" #: ../src/Frontend-GNOME/MainWindow.cs:430 msgid "_Help" msgstr "_Ajuda" #: ../src/Frontend-GNOME/MainWindow.cs:691 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:225 msgid "Unable to add server: " msgstr "No s'ha pogut afegir el servidor:" #: ../src/Frontend-GNOME/MainWindow.cs:742 #, csharp-format msgid "Unknown ChatType: {0}" msgstr "Tipus de xat desconegut: {0}" #: ../src/Frontend-GNOME/MainWindow.cs:971 msgid "" "Switching to local engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Si canvieu al motor local us desconnectareu del vostre motor actual!\n" "Esteu segur que voleu fer això?" #: ../src/Frontend-GNOME/MainWindow.cs:1013 msgid "" "Switching the remote engine will disconnect you from the current engine!\n" "Are you sure you want to do this?" msgstr "" "Si canvieu el motor remot us desconnectareu del vostre motor actual!\n" "Esteu segur que voleu fer això?" #: ../src/Frontend-GNOME/NotImplementedMessageDialog.cs:40 msgid "Sorry, not implemented yet!" msgstr "Això encara no ha estat implementat." #. fill ListStore #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:179 msgid "Character" msgstr "Caràcter" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:180 msgid "Word" msgstr "Paraula" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:198 msgid "No Proxy" msgstr "Sense servidor intermediari" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:212 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:139 msgid "Connection" msgstr "Connexió" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:216 msgid "Interface" msgstr "Interfície" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:220 msgid "Servers" msgstr "Servidors" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:227 msgid "Filters" msgstr "Filtres" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:231 msgid "Logging" msgstr "Registre" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:281 msgid "System Default" msgstr "Predeterminat del sistema" #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:588 msgid "Nicknames(s) field must not be empty." msgstr "Cal indicar un o més sobrenoms." #: ../src/Frontend-GNOME/Preferences/PreferencesDialog.cs:748 #, csharp-format msgid "Invalid highlight regex: '{0}'. Reason: {1}" msgstr "Expressió regular de ressaltat no vàlida: '{0}'. Motiu: {1}" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:69 #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:105 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:271 msgid "Name" msgstr "Nom" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:74 msgid "Topic" msgstr "Tema" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:102 msgid "" "Searching for group chats without a filter is not recommended. This may take a while, or may not work at all.\n" "Do you wish to continue?" msgstr "" "No es recomana cercar sales de xat en grup sense un filtre. Això pot trigar una estona, o pot ser que no funcioni.\n" "Voleu continuar?" #: ../src/Frontend-GNOME/FindGroupChatDialog.cs:143 msgid "Error while fetching the list of group chats from the server." msgstr "S'ha produït un error en recuperar la llista de xats en grup del servidor." #: ../src/Frontend-GNOME/Frontend.cs:399 #, csharp-format msgid "Cause: {0}" msgstr "Motiu: {0}" #: ../src/Frontend-GNOME/Frontend.cs:469 msgid "" "The frontend has lost the connection to the server.\n" "Do you want to reconnect now?" msgstr "" "El frontal ha perdut la connexió amb el servidor.\n" "Voleu tornar a connectar-hi?" #: ../src/Frontend-GNOME/Frontend.cs:484 msgid "" "Reconnecting to the server has failed.\n" "Do you want to try again?" msgstr "" "L'intent de reconnexió amb el servidor ha fallat.\n" "Voleu tornar-ho a intentar?" #: ../src/Frontend-GNOME/Frontend.cs:585 msgid "" "The server has lost the connection to the frontend.\n" "Do you want to reconnect now?" msgstr "" "El servidor ha perdut la connexió al frontal.\n" "Voleu tornar a connectar-hi?" #: ../src/Frontend-GNOME/NotifyManager.cs:229 msgid "Show" msgstr "Mostra" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:62 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:238 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:70 msgid "Protocol" msgstr "Protocol" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:63 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:71 msgid "Hostname" msgstr "Nom de la màquina" #: ../src/Frontend-GNOME/QuickConnectDialog.cs:166 msgid "Unable to load server: " msgstr "No s'ha pogut carregar el servidor:" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:54 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:244 msgid "Person / Private" msgstr "Persona / Privat" #: ../src/Frontend-GNOME/ChatTypeWidget.cs:55 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:245 msgid "Group / Public" msgstr "Grup / Públic" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:70 msgid "Engine Assistant - Smuxi" msgstr "Assistent de configuració de motors - Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:92 msgid "Add Smuxi Engine" msgstr "Afegeix un motor Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:94 msgid "Edit Smuxi Engine" msgstr "Edita un motor Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:203 msgid "Credentials" msgstr "Credencials" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:265 msgid "Now you can use the Smuxi Engine" msgstr "Ara podeu utilitzar el motor Smuxi" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:268 msgid "Thank you" msgstr "Gràcies" #: ../src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs:285 msgid "An engine with this name already exists! Please specify a different one." msgstr "Ja existeix un motor amb aquest nom! Especifique-ne un altre." #: ../src/Frontend-GNOME/Views/MessageTextView.cs:198 #, csharp-format msgid "Day changed to {0}" msgstr "El dia ha canviat a {0}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:123 #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:133 #, csharp-format msgid "Invalid filter regex: '{0}'. Reason: {1}" msgstr "Expressió regular de filtre no vàlida: '{0}'. Motiu: {1}" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:200 msgid "Are you sure you want to delete the selected filter?" msgstr "Esteu segur que voleu eliminar el filtre seleccionat?" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:246 msgid "Protocol / Server" msgstr "Protocol / Servidor" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:253 msgid "Chat Type" msgstr "Tipus de xat" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:287 msgid "Normal" msgstr "Normal" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:288 msgid "Event" msgstr "Esdeveniment" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:295 msgid "Type" msgstr "_Tipus" #: ../src/Frontend-GNOME/Views/FilterListWidget.cs:321 msgid "Pattern" msgstr "Patró" #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:242 #, csharp-format msgid "Retrieving user list for {0}..." msgstr "S'està obtenint el llistat d'usuari per a {0}..." #. TRANSLATOR: this string will be appended to the one above #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:289 msgid "done." msgstr "fet." #: ../src/Frontend-GNOME/Views/Chats/GroupChatView.cs:304 msgid "Person" msgstr "Persones" #: ../src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs:68 msgid "" "Closing the protocol chat will also close all open chats connected to it!\n" "Are you sure you want to do this?" msgstr "" "Si tanqueu la pestanya del protocol es tancaran també totes les sales de xat que en depenen.\n" "Esteu segur que voleu fer això?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:187 msgid "Are you sure you want to delete the selected server?" msgstr "Esteu segur que voleu eliminar el servidor seleccionat?" #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:243 #: ../src/Frontend-GNOME/Preferences/ServerListView.cs:277 msgid "Unable to edit server: " msgstr "No es pot modificar el servidor:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:34 msgid "Find" msgstr "Troba" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:54 msgid "_Search for:" msgstr "_Cerca:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:83 msgid "_Match Case" msgstr "Sensible a _majúscules" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:95 msgid "Search _Backwards" msgstr "Cerca cap endarrere" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:107 msgid "_Wrap Around" msgstr "_Torna a començar pel principi en arribar al final" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs:120 msgid "Use _Regular Expressions" msgstr "Utilitza expressions _regulars" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:32 msgid "Smuxi - Find Group Chat" msgstr "Smuxi - Troba sales de xat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs:56 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:79 msgid "_Name:" msgstr "_Nom:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs:24 msgid "Smuxi - Quick Connect" msgstr "Smuxi - Connexió ràpida" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:487 msgid "Nicknames:" msgstr "Sobrenoms:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1622 msgid " User List Position " msgstr " Posició de la llista d'usuaris " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1633 msgid " Channel " msgstr " Sala " #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1844 msgid "Channel Filters" msgstr "Filtres de canal" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs:1861 msgid "User Filters" msgstr "Filtres d'usuari" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:56 msgid "Use _SSH Tunnel" msgstr "Utilitza un _túnel SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:70 msgid "Enables the use of SSH for the connection. This has a small performance impact, but is more secure and required when using NAT or port-based firewalls" msgstr "Habilita l'ús de l'SSH per a la connexió. Això afectarà lleugerament el rendiment, però és més segur i és necessari quan s'utilitza NAT o tallafocs que bloquegin certs ports." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:149 msgid "SSH _Host:" msgstr "S_ervidor SSH:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:160 msgid "DNS or IP address and port of the SSH server" msgstr "DNS o adreça IP i port del servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:173 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:187 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:155 msgid "_Port:" msgstr "_Port:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:200 msgid "DNS or IP address and port of the Smuxi server" msgstr "DNS o adreça IP i port del servidor del Smuxi" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs:213 msgid "_Smuxi Host:" msgstr "Servidor _Smuxi:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:68 msgid "_SSH Username: (optional)" msgstr "Nom d'usuari de l'SSH: (opcional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:91 msgid "Username which will be used to log into the SSH server" msgstr "Nom d'usuari que s'utilitzarà per iniciar sessió al servidor SSH" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:111 msgid "_SSH Password: (optional)" msgstr "Contrasenya de l'SSH: (opcional)" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:135 msgid "Password which will be used to log into the SSH server. The password is optional if SSH key authorization is used (via Pageant from the PuTTY tools)." msgstr "Contrasenya que s'utilitzarà per iniciar sessió al servidor SSH. La contrasenya és opcional si s'utilitza autenticació via claus SSH (mitjançant Pageant, de les eines PuTTY)." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:156 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:214 msgid "_Username:" msgstr "_Sobrenom:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:179 msgid "Username which will be used to log into the Smuxi server" msgstr "Nom d'usuari que s'utilitzarà per iniciar sessió al servidor del Smuxi." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:199 #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:113 msgid "_Password:" msgstr "_Contrasenya:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:223 msgid "Password of the user" msgstr "Contrasenya de l'usuari" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:243 msgid "_Verify Password:" msgstr "_Repetiu la contrasenya:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs:267 msgid "Repeat the password for verification" msgstr "Repetiu la contrasenya per assegurar que l'heu escrita correctament" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs:19 msgid "" "Welcome to the Smuxi Engine Configuration Assistant.\n" "You need to enter some information before you can use the engine.\n" "\n" "Click \"Forward\" to begin." msgstr "" "Benvingut a l'assistent de configuració de motors dels Smuxi.\n" "Cal que introduïu una mica d'informació abans de començar a utilitzar el motor. Premeu «Endavant» per a començar." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:44 msgid "_Engine Name:" msgstr "Nom del _motor:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:67 msgid "Profile name of the new engine" msgstr "Nom per al nou perfil de motor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:88 msgid "_Default Engine:" msgstr "_Motor predeterminat:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:99 msgid "Use as new default engine" msgstr "Utilitza'l com a nou motor predeterminat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs:112 msgid "If enabled, the current engine will be the default next time Smuxi is started" msgstr "Si marqueu la casella, la propera vegada que inicieu l'Smuxi el motor que esteu configurant s'utilitzarà de forma predeterminada." #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:26 msgid "Smuxi - Open Chat" msgstr "Smuxi - Obre un xat" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs:69 msgid "_Type:" msgstr "_Tipus:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:80 msgid "_Hostname:" msgstr "_Nom de la màquina:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:101 msgid "_Network:" msgstr "_Xarxa:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:224 msgid "_Protocol:" msgstr "_Protocol:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:248 msgid "Use Encryption" msgstr "Utilitza xifratge" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:260 msgid "Validate Server Certificate" msgstr "Valida el certificat del servidor" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:280 msgid "_On Connect Commands:" msgstr "_Ordres al connectar:" #: ../src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs:291 msgid "_Ignore Commands" msgstr "_Ignora les ordres" #~ msgid "German" #~ msgstr "Alemany" #~ msgid "Spanish" #~ msgstr "Castellà" #~ msgid "British English" #~ msgstr "Anglès britànic" #~ msgid "French" #~ msgstr "Francès" #~ msgid "Italian" #~ msgstr "Italià" #~ msgid "_Edit" #~ msgstr "_Modifica" #~ msgid "Joins" #~ msgstr "Entrades" #~ msgid "Parts" #~ msgstr "Sortides" #~ msgid "Quits" #~ msgstr "Desconnexions" smuxi-0.11/CREDITS0000644000175000017500000000173211655545675014444 0ustar00meebeymeebey00000000000000/** * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ */ This is the credit list for smuxi The fields are: (N) name (E) email (W) web-address (P) PGP key ID and fingerprint (D) description (S) snail-mail address --------------------------- N: Mirco 'meebey' Bauer E: meebey@meebey.net W: http://www.meebey.net/ P: EEF946C8 / ABE1 95E1 50A8 DBE7 809D 3F42 7127 E5AB EEF9 46C8 D: Project Founder/Leader S: Brucknerstrasse 29B S: 22083 Hamburg S: Germany N: Jeffrey 'the' Mann Richardson E: themann@indyfantasysports.net W: http://db.zhilaware.starfusion.org/ D: Developer of Frontend-SWF N: Giacomo Di Ciocco E: admin@nectarine.info W: www.nectarine.info D: Preferences Abstraction Layer and Backend (patch) Alpha/Beta Testers ------------------ GNOME on Linux: Frank Besler Ubuntu 5.04 (Hoary) Bjarke Srensen Ubuntu 6.10 (Edgy Eft) GNOME on Windows: cobrian@cobrian.net Windows: smuxi-0.11/configure.ac0000644000175000017500000005710112264335155015676 0ustar00meebeymeebey00000000000000AC_PREREQ([2.54]) AC_INIT([smuxi], [0.11], [https://smuxi.im/issues/new]) # using the --foreign option makes automake less strict about GNU policy AC_CONFIG_MACRO_DIR([.]) AM_INIT_AUTOMAKE([foreign tar-ustar]) AM_MAINTAINER_MODE AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test "x$PKG_CONFIG" = "xno"; then AC_MSG_ERROR([You need to install pkg-config]) fi AC_PROG_INSTALL AC_DISABLE_STATIC AC_PROG_LIBTOOL #LT_INIT([disable-static]) # I18N IT_PROG_INTLTOOL([0.25]) POSUB=" po po-Engine po-Engine-Campfire po-Engine-IRC po-Engine-JabbR po-Engine-Twitter po-Engine-XMPP po-Server po-Frontend po-Frontend-GNOME po-Frontend-GNOME-IRC po-Frontend-GNOME-Twitter po-Frontend-GNOME-XMPP po-Frontend-SWF " AC_SUBST(POSUB) GETTEXT_PACKAGE=smuxi AC_SUBST(GETTEXT_PACKAGE) GETTEXT_PACKAGE_ENGINE=smuxi-engine AC_SUBST(GETTEXT_PACKAGE_ENGINE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_ENGINE, "$GETTEXT_PACKAGE_ENGINE", [Gettext package]) GETTEXT_PACKAGE_ENGINE_IRC=smuxi-engine-irc AC_SUBST(GETTEXT_PACKAGE_ENGINE_IRC) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_ENGINE_IRC, "$GETTEXT_PACKAGE_ENGINE_IRC", [Gettext package]) GETTEXT_PACKAGE_ENGINE_XMPP=smuxi-engine-xmpp AC_SUBST(GETTEXT_PACKAGE_ENGINE_XMPP) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_ENGINE_XMPP, "$GETTEXT_PACKAGE_ENGINE_XMPP", [Gettext package]) GETTEXT_PACKAGE_ENGINE_TWITTER=smuxi-engine-twitter AC_SUBST(GETTEXT_PACKAGE_ENGINE_TWITTER) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_ENGINE_TWITTER, "$GETTEXT_PACKAGE_ENGINE_TWITTER", [Gettext package]) GETTEXT_PACKAGE_ENGINE_CAMPFIRE=smuxi-engine-campfire AC_SUBST(GETTEXT_PACKAGE_ENGINE_CAMPFIRE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_ENGINE_CAMPFIRE, "$GETTEXT_PACKAGE_ENGINE_CAMPFIRE", [Gettext package]) GETTEXT_PACKAGE_ENGINE_JABBR=smuxi-engine-jabbr AC_SUBST(GETTEXT_PACKAGE_ENGINE_JABBR) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_ENGINE_JABBR, "$GETTEXT_PACKAGE_ENGINE_JABBR", [Gettext package]) GETTEXT_PACKAGE_SERVER=smuxi-server AC_SUBST(GETTEXT_PACKAGE_SERVER) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_SERVER, "$GETTEXT_PACKAGE_SERVER", [Gettext package]) GETTEXT_PACKAGE_FRONTEND=smuxi-frontend AC_SUBST(GETTEXT_PACKAGE_FRONTEND) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_FRONTEND, "$GETTEXT_PACKAGE_FRONTEND", [Gettext package]) GETTEXT_PACKAGE_FRONTEND_GNOME=smuxi-frontend-gnome AC_SUBST(GETTEXT_PACKAGE_FRONTEND_GNOME) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_FRONTEND_GNOME, "$GETTEXT_PACKAGE_FRONTEND_GNOME", [Gettext package]) GETTEXT_PACKAGE_FRONTEND_GNOME_IRC=smuxi-frontend-gnome-irc AC_SUBST(GETTEXT_PACKAGE_FRONTEND_GNOME_IRC) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_FRONTEND_GNOME_IRC, "$GETTEXT_PACKAGE_FRONTEND_GNOME_IRC", [Gettext package]) GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER=smuxi-frontend-gnome-twitter AC_SUBST(GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER, "$GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER", [Gettext package]) GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP=smuxi-frontend-gnome-xmpp AC_SUBST(GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP, "$GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP", [Gettext package]) GETTEXT_PACKAGE_FRONTEND_STFL=smuxi-frontend-stfl AC_SUBST(GETTEXT_PACKAGE_FRONTEND_STFL) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_FRONTEND_STFL, "$GETTEXT_PACKAGE_FRONTEND_STFL", [Gettext package]) GETTEXT_PACKAGE_FRONTEND_CURSES=smuxi-frontend-curses AC_SUBST(GETTEXT_PACKAGE_FRONTEND_CURSES) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_FRONTEND_CURSES, "$GETTEXT_PACKAGE_FRONTEND_CURSES", [Gettext package]) GETTEXT_PACKAGE_FRONTEND_SWF=smuxi-frontend-swf AC_SUBST(GETTEXT_PACKAGE_FRONTEND_SWF) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_FRONTEND_SWF, "$GETTEXT_PACKAGE_FRONTEND_SWF", [Gettext package]) GETTEXT_PACKAGE_FRONTEND_WPF=smuxi-frontend-wpf AC_SUBST(GETTEXT_PACKAGE_FRONTEND_WPF) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE_FRONTEND_WPF, "$GETTEXT_PACKAGE_FRONTEND_WPF", [Gettext package]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.17]) # doesn't support multiple po directories :( #AM_GLIB_GNU_GETTEXT AC_ARG_WITH([vendor-package-version], AC_HELP_STRING([--with-vendor-package-version="DISTRO_NAME PACKAGE_VERSION"], [Set the distro name and package version, e.g. "Debian 0.8-1"]), [], with_vendor_package_version= ) WITH_VENDOR_PACKAGE_VERSION=$with_vendor_package_version if test "x$WITH_VENDOR_PACKAGE_VERSION" = "x"; then AC_MSG_CHECKING([for git version]) if git log --oneline 295b37c8ac4939829a3c7f9150943dba8fff07f0 > /dev/null 2>&1; then GIT_BRANCH=$(git branch | grep '^\*' | cut -d ' ' -f 2) GIT_COMMIT_HASH=$(git log --no-color --first-parent -n1 --pretty=format:%h) DIST_VERSION=$GIT_BRANCH/$GIT_COMMIT_HASH DEV_VERSION_SUFFIX="-dev" AC_MSG_RESULT(yes) else DIST_VERSION=tarball DEV_VERSION_SUFFIX= AC_MSG_RESULT(no) fi else DIST_VERSION=$WITH_VENDOR_PACKAGE_VERSION fi AC_SUBST([git_branch], "$GIT_BRANCH") AC_SUBST([git_commit_hash], "$GIT_COMMIT_HASH") AC_SUBST([DEV_VERSION_SUFFIX]) AC_SUBST([dist_version], "$DIST_VERSION") SHAMROCK_EXPAND_LIBDIR SHAMROCK_CHECK_MONO_MODULE(1.9.1) SHAMROCK_FIND_MONO_RUNTIME SHAMROCK_FIND_MONO_2_0_COMPILER_OR_HIGHER SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES([ System System.Core System.Xml System.Runtime.Remoting Mono.Posix ]) PROFILE=debug AC_ARG_ENABLE(release, AC_HELP_STRING([--enable-release], [Use 'RELEASE' Configuration [default=NO]]), enable_release=yes, enable_release=no) AM_CONDITIONAL(ENABLE_RELEASE, test x$enable_release = xyes) if test "x$enable_release" = "xyes" ; then PROFILE=release fi AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Use 'DEBUG' Configuration [default=YES]]), enable_debug=yes, enable_debug=no) AM_CONDITIONAL(ENABLE_DEBUG, test x$enable_debug = xyes) if test "x$enable_debug" = "xyes" ; then PROFILE=debug fi AC_SUBST(PROFILE) AC_SUBST(CSC, "$MCS") CSC_FLAGS= if test "x$PROFILE" = "xdebug"; then AM_CONDITIONAL(ENABLE_DEBUG, true) CSC_FLAGS+=-define:DEBUG,TRACE,LOG4NET else AM_CONDITIONAL(ENABLE_RELEASE, true) fi AC_SUBST(CSC_FLAGS) MCS_BASENAME=$(basename $MCS) CLI_RUNTIME= if test "$MCS_BASENAME" = "gmcs"; then CLI_RUNTIME=2.0 fi if test "$MCS_BASENAME" = "dmcs"; then CLI_RUNTIME=4.0 fi if test "$CLI_RUNTIME" = "2.0"; then XBUILD_FLAGS="/toolsversion:3.5 /p:TargetFrameworkVersion=v3.5" fi if test "$CLI_RUNTIME" = "4.0"; then XBUILD_FLAGS="/toolsversion:4.0 /p:TargetFrameworkVersion=v4.0" fi AC_SUBST(XBUILD_FLAGS) # Required Libraries PKG_CHECK_MODULES([LOG4NET], [log4net]) PKG_CHECK_EXISTS([nini-1.1], FOUND_NINI=yes, FOUND_NINI=no) nini_files= if test "x$FOUND_NINI" = "xyes"; then nini_files=`pkg-config --variable=Libraries nini-1.1` if test -z "$nini_files" ; then # Debian-based distros place Nini into the GAC PKG_CHECK_MODULES([NINI], [nini-1.1]) else # openSUSE has Nini as a private assembly; need to copy it. AC_SUBST([NINI_LIBS], "$nini_files") fi else PKG_CHECK_MODULES([NINI], [nini >= 1.1]) fi AM_CONDITIONAL([BUNDLE_NINI], test -n "$nini_files") AC_ARG_WITH([db4o], AC_HELP_STRING([--with-db4o=auto|system|included], [Use system or included db4o @<:@default=auto@:>@]), [], with_db4o=auto ) WITH_DB4O=$with_db4o if test "x$WITH_DB4O" = "xauto"; then PKG_CHECK_EXISTS([db4o >= 8.0], FOUND_DB4O=yes, FOUND_DB4O=no) if test "x$FOUND_DB4O" = "xyes"; then WITH_DB4O=system else WITH_DB4O=included fi fi if test "x$WITH_DB4O" = "xsystem"; then PKG_CHECK_MODULES([DB4O], [db4o >= 8.0]) AM_CONDITIONAL([BUNDLE_DB4O], false) fi if test "x$WITH_DB4O" = "xincluded"; then if test ! -d "$srcdir/lib/db4o-net/Db4objects.Db4o"; then AC_MSG_ERROR([lib/db4o-net is empty!]) fi AC_PATH_PROG(XBUILD, xbuild, no) if test "x$XBUILD" = "xno"; then AC_MSG_ERROR([You need to install xbuild]) fi AM_CONDITIONAL([BUNDLE_DB4O], true) #AC_SUBST([DB4O_FILES], "Db4objects.Db4o.dll Db4objects.Db4o.Instrumentation.dll Db4objects.Db4o.NativeQueries.dll") AC_SUBST([DB4O_FILES], "Db4objects.Db4o.dll") fi # Optional Libraries AC_ARG_WITH([messaging-menu], AC_HELP_STRING([--with-messaging-menu=auto|system|included|no], [Support Messaging Menu (Ubuntu >= 12.10) @<:@default=auto@:>@]), [], with_messagingmenu=auto ) WITH_MESSAGINGMENU=$with_messagingmenu if test "x$WITH_MESSAGINGMENU" = "xauto"; then PKG_CHECK_EXISTS([messagingmenu-sharp], FOUND_MESSAGINGMENU_SHARP=yes, FOUND_MESSAGINGMENU_SHARP=no) if test "x$FOUND_MESSAGINGMENU_SHARP" = "xyes"; then WITH_MESSAGINGMENU=system else PKG_CHECK_EXISTS([messaging-menu], FOUND_MESSAGING_MENU=yes, FOUND_MESSAGING_MENU=no) if test "x$FOUND_MESSAGING_MENU" = "xyes"; then WITH_MESSAGINGMENU=included else WITH_MESSAGINGMENU=no fi fi fi if test "x$WITH_MESSAGINGMENU" = "xsystem"; then PKG_CHECK_MODULES([MESSAGINGMENU_SHARP], [messagingmenu-sharp]) fi if test "x$WITH_MESSAGINGMENU" = "xincluded"; then if test ! -f "$srcdir/lib/messagingmenu-sharp/configure.ac"; then AC_MSG_ERROR([lib/messagingmenu-sharp is empty!]) fi PKG_CHECK_MODULES([MESSAGING_MENU], [messaging-menu]) PKG_CHECK_MODULES([GIO_SHARP], [gio-sharp-2.0]) GIO_SHARP_LIBS=`$PKG_CONFIG --variable=Libraries gio-sharp-2.0` AC_SUBST([GIO_SHARP_LIBS]) GIO_SHARP_FILES="gio-sharp.dll" AC_SUBST([GIO_SHARP_FILES]) ac_configure_args="$ac_configure_args CSC=$MCS" AC_CONFIG_SUBDIRS([lib/messagingmenu-sharp]) AC_SUBST([MESSAGINGMENU_SHARP_FILES], "messagingmenu-sharp.dll") fi AM_CONDITIONAL([WITH_MESSAGINGMENU_SHARP_INCLUDED], test "x$WITH_MESSAGINGMENU" = "xincluded") AC_ARG_WITH([indicate], AC_HELP_STRING([--with-indicate], [Support Messaging Menu (Ubuntu <= 12.04) @<:@default=auto@:>@]), [], with_indicate=auto ) WITH_INDICATE=$with_indicate PKG_CHECK_EXISTS([indicate-sharp-0.1], INDICATE_SHARP_SUPPORT=yes, INDICATE_SHARP_SUPPORT=no) if test "x$WITH_INDICATE" = "xauto" -a "x$WITH_MESSAGINGMENU" != "xno"; then WITH_INDICATE=no fi if test "x$WITH_INDICATE" = "xauto"; then WITH_INDICATE=$INDICATE_SHARP_SUPPORT fi if test "x$WITH_INDICATE" = "xyes"; then PKG_CHECK_MODULES([INDICATE_SHARP], [indicate-sharp-0.1]) fi AC_ARG_WITH([notify], AC_HELP_STRING([--with-notify], [Support Desktop Notifications @<:@default=auto@:>@]), [], with_notify=auto ) WITH_NOTIFY=$with_notify PKG_CHECK_EXISTS([notify-sharp], NOTIFY_SHARP_SUPPORT=yes, NOTIFY_SHARP_SUPPORT=no) if test "x$WITH_NOTIFY" = "xauto"; then WITH_NOTIFY=$NOTIFY_SHARP_SUPPORT fi if test "x$WITH_NOTIFY" = "xyes"; then PKG_CHECK_MODULES([NOTIFY_SHARP], [notify-sharp]) fi AC_ARG_WITH([dbus], AC_HELP_STRING([--with-dbus], [Support D-Bus @<:@default=auto@:>@]), [], with_dbus=auto ) WITH_DBUS=$with_dbus PKG_CHECK_EXISTS([dbus-sharp-1.0], DBUS_SHARP1_SUPPORT=yes, DBUS_SHARP1_SUPPORT=no) PKG_CHECK_EXISTS([dbus-sharp-2.0], DBUS_SHARP2_SUPPORT=yes, DBUS_SHARP2_SUPPORT=no) PKG_CHECK_EXISTS([ndesk-dbus-1.0], NDESK_DBUS_SUPPORT=yes, NDESK_DBUS_SUPPORT=no) if test "x$WITH_DBUS" = "xauto"; then if test "x$DBUS_SHARP1_SUPPORT" = "xyes"; then WITH_DBUS=$DBUS_SHARP1_SUPPORT elif test "x$DBUS_SHARP2_SUPPORT" = "xyes"; then WITH_DBUS=$DBUS_SHARP2_SUPPORT else WITH_DBUS=$NDESK_DBUS_SUPPORT fi fi if test "x$WITH_DBUS" = "xyes"; then if test "x$DBUS_SHARP2_SUPPORT" = "xyes"; then PKG_CHECK_MODULES([DBUS_SHARP], [dbus-sharp-2.0]) PKG_CHECK_MODULES([DBUS_SHARP_GLIB], [dbus-sharp-glib-2.0]) AC_SUBST([DBUS_LIBS], "$DBUS_SHARP_LIBS $DBUS_SHARP_GLIB_LIBS") CSC_FLAGS+=" -define:IPC_DBUS -define:DBUS_SHARP" elif test "x$DBUS_SHARP1_SUPPORT" = "xyes"; then PKG_CHECK_MODULES([DBUS_SHARP], [dbus-sharp-1.0]) PKG_CHECK_MODULES([DBUS_SHARP_GLIB], [dbus-sharp-glib-1.0]) AC_SUBST([DBUS_LIBS], "$DBUS_SHARP_LIBS $DBUS_SHARP_GLIB_LIBS") CSC_FLAGS+=" -define:IPC_DBUS -define:DBUS_SHARP" else # fallback to ndesk-dbus PKG_CHECK_MODULES([NDESK_DBUS], [ndesk-dbus-1.0]) PKG_CHECK_MODULES([NDESK_DBUS_GLIB], [ndesk-dbus-glib-1.0]) AC_SUBST([DBUS_LIBS], "$NDESK_DBUS_LIBS $NDESK_DBUS_GLIB_LIBS") CSC_FLAGS+=" -define:IPC_DBUS -define:NDESK_DBUS" fi fi AC_ARG_WITH([gtkspell], AC_HELP_STRING([--with-gtkspell], [Support GTK+ spell checking @<:@default=auto@:>@]), [], with_gtkspell=auto ) WITH_GTKSPELL=$with_gtkspell PKG_CHECK_EXISTS([gtkspell-2.0], GTKSPELL_SUPPORT=yes, GTKSPELL_SUPPORT=no) if test "x$WITH_GTKSPELL" = "xauto"; then WITH_GTKSPELL=$GTKSPELL_SUPPORT fi if test "x$WITH_GTKSPELL" = "xyes"; then PKG_CHECK_MODULES([GTKSPELL], [gtkspell-2.0 >= 2.0.9]) fi # Engines AC_ARG_ENABLE([engine-irc], AC_HELP_STRING([--enable-engine-irc], [Enable IRC protocol support (default yes)]), ENABLE_ENGINE_IRC=$enableval, ENABLE_ENGINE_IRC=yes ) if test "x$ENABLE_ENGINE_IRC" != "xno"; then AC_PATH_PROG(XBUILD, xbuild, no) if test "x$XBUILD" = "xno"; then AC_MSG_ERROR([You need to install xbuild for irc support]) fi if test ! -f "$srcdir/lib/SmartIrc4net/SmartIrc4net.csproj"; then AC_MSG_ERROR([lib/SmartIrc4net is empty!]) fi SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES([ System Mono.Posix ]) fi AM_CONDITIONAL(ENABLE_ENGINE_IRC, test "x$ENABLE_ENGINE_IRC" = "xyes") AC_ARG_ENABLE([engine-campfire], AC_HELP_STRING([--enable-engine-campfire], [Enable Campfire protocol support (default yes)]), ENABLE_ENGINE_CAMPFIRE=$enableval, ENABLE_ENGINE_CAMPFIRE=yes ) AM_CONDITIONAL(ENABLE_ENGINE_CAMPFIRE, test "x$ENABLE_ENGINE_CAMPFIRE" = "xyes") AC_ARG_ENABLE([engine-xmpp], AC_HELP_STRING([--enable-engine-xmpp], [Enable XMPP (Jabber) protocol support (default yes)]), ENABLE_ENGINE_XMPP=$enableval, ENABLE_ENGINE_XMPP=yes ) if test "x$ENABLE_ENGINE_XMPP" != "xno"; then AC_PATH_PROG(XBUILD, xbuild, no) if test "x$XBUILD" = "xno"; then AC_MSG_ERROR([You need to install xbuild for XMPP support]) fi if test ! -f "$srcdir/lib/agsxmpp/agsxmpp/agsxmpp.csproj"; then AC_MSG_ERROR([lib/agsxmpp is empty!]) fi SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES([ System System.Core Mono.Posix System.Xml ]) fi AM_CONDITIONAL(ENABLE_ENGINE_XMPP, test "x$ENABLE_ENGINE_XMPP" = "xyes") if test ! -f "$srcdir/lib/StarkSoftProxy/StarkSoftProxy.csproj"; then AC_MSG_ERROR([lib/StarkSoftProxy is empty!]) fi AC_ARG_ENABLE([engine-twitter], AC_HELP_STRING([--enable-engine-twitter], [Enable Twitter support (default yes)]), ENABLE_ENGINE_TWITTER=$enableval, ENABLE_ENGINE_TWITTER=yes ) if test "x$ENABLE_ENGINE_TWITTER" != "xno"; then AC_PATH_PROG(XBUILD, xbuild, no) if test "x$XBUILD" = "xno"; then AC_MSG_ERROR([You need to install xbuild for Twitter support]) fi # compiling Json.NET with the C# compiler of Mono 2.4 will result in # a endless loop with eating all memory :/ AC_MSG_CHECKING([for Mono >= 2.6]) if $PKG_CONFIG 'mono >= 2.6'; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_MSG_ERROR([You need Mono 2.6 or later for Twitter support]) fi if test ! -f "$srcdir/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Newtonsoft.Json.csproj"; then AC_MSG_ERROR([lib/Newtonsoft.Json is empty!]) fi SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES([ System System.Core System.Data System.Runtime.Serialization System.Web System.Xml System.Xml.Linq ]) if test ! -f "$srcdir/lib/Twitterizer/Twitterizer2/Twitterizer2.csproj"; then AC_MSG_ERROR([lib/Twitterizer is empty!]) fi SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES([ System System.Configuration System.Core System.Data System.Drawing System.Web System.Web.Extensions System.Xml System.Xml.Linq ]) fi AM_CONDITIONAL(ENABLE_ENGINE_TWITTER, test "x$ENABLE_ENGINE_TWITTER" = "xyes") AC_ARG_WITH([twitter-api-key], AC_HELP_STRING([--with-twitter-api-key], [Specify custom Twitter API key]), [], with_twitter_api_key="60QV2qQx9cS7y1BJDbgAA|2VgD6qQKddsF5HYQ0TrRgs3tFTnCwDONBmRlTmG658" ) AC_SUBST([twitter_api_key], $with_twitter_api_key) AC_ARG_ENABLE([engine-jabbr], AC_HELP_STRING([--enable-engine-jabbr], [Enable JabbR support (default yes)]), ENABLE_ENGINE_JABBR=$enableval, ENABLE_ENGINE_JABBR=yes ) if test "x$ENABLE_ENGINE_JABBR" != "xno"; then AC_PATH_PROG(XBUILD, xbuild, no) if test "x$XBUILD" = "xno"; then AC_MSG_ERROR([You need to install xbuild for JabbR support]) fi # compiling Json.NET with the C# compiler of Mono 2.4 will result in # a endless loop with eating all memory :/ # SignalR.Client requires System.Threading.Tasks which is part of .NET 4.0 # thus Mono 2.10 with dmcs is required! AC_MSG_CHECKING([for Mono >= 2.10]) if $PKG_CONFIG 'mono >= 2.10'; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_MSG_ERROR([You need Mono 2.10 or later for JabbR support (or use --disable-engine-jabbr)]) fi AC_MSG_CHECKING([for 4.0 compiler]) if test "x$CLI_RUNTIME" = "x2.0"; then AC_MSG_RESULT(no) AC_MSG_ERROR([You need to compile with a 4.0 compiler (dmcs) for JabbR support (or use --disable-engine-jabbr)]) else AC_MSG_RESULT(yes) fi if test ! -f "$srcdir/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Newtonsoft.Json.csproj"; then AC_MSG_ERROR([lib/Newtonsoft.Json is empty!]) fi SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES([ System System.Core System.Data System.Runtime.Serialization System.Web System.Xml System.Xml.Linq ]) if test ! -f "$srcdir/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Microsoft.AspNet.SignalR.Client.csproj"; then AC_MSG_ERROR([lib/SignalR is empty!]) fi SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES([ System System.Core ]) if test ! -f "$srcdir/lib/JabbR/JabbR.Client/JabbR.Client.csproj"; then AC_MSG_ERROR([lib/JabbR is empty!]) fi SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES([ System System.Core System.Data System.Data.DataSetExtensions System.Xml System.Xml.Linq ]) fi AM_CONDITIONAL(ENABLE_ENGINE_JABBR, test "x$ENABLE_ENGINE_JABBR" = "xyes") # Server if $PKG_CONFIG 'mono >= 2.6'; then SERVER_COMPILER_FLAGS+=" -platform:x86" fi AC_SUBST(SERVER_COMPILER_FLAGS) # Frontends AC_ARG_ENABLE([frontend-gnome], AC_HELP_STRING([--enable-frontend-gnome], [Enable GNOME frontend (default yes)]), ENABLE_FRONTEND_GNOME=$enableval, ENABLE_FRONTEND_GNOME=yes ) if test "x$ENABLE_FRONTEND_GNOME" != "xno"; then PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0 >= 2.8]) PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0 >= 2.8]) PKG_CHECK_MODULES([GLADE_SHARP_20], [glade-sharp-2.0 >= 2.8]) AC_MSG_CHECKING([for gtk-sharp version >= 2.10]) if $PKG_CONFIG 'gtk-sharp-2.0 >= 2.10'; then AC_MSG_RESULT(yes) AC_DEFINE(GTK_SHARP_2_10,1,[System has gtk-sharp 2.10 or better]) FRONTEND_GNOME_COMPILER_FLAGS+=" -define:GTK_SHARP_2_10" else AC_MSG_RESULT(no) fi SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES([ System.Drawing ]) if test "x$WITH_MESSAGINGMENU" = "xsystem"; then FRONTEND_GNOME_COMPILER_FLAGS+=" -define:MESSAGING_MENU_SHARP" fi if test "x$WITH_MESSAGINGMENU" = "xincluded"; then FRONTEND_GNOME_COMPILER_FLAGS+=" -define:MESSAGING_MENU_SHARP" fi if test "x$WITH_INDICATE" = "xyes"; then FRONTEND_GNOME_COMPILER_FLAGS+=" -define:INDICATE_SHARP" fi if test "x$WITH_NOTIFY" = "xyes"; then FRONTEND_GNOME_COMPILER_FLAGS+=" -define:NOTIFY_SHARP" fi if test "x$WITH_GTKSPELL" = "xyes"; then FRONTEND_GNOME_COMPILER_FLAGS+=" -define:GTKSPELL" fi if $PKG_CONFIG 'mono >= 2.6'; then FRONTEND_GNOME_COMPILER_FLAGS+=" -platform:x86" fi AC_SUBST(FRONTEND_GNOME_COMPILER_FLAGS) ENABLE_FRONTEND_GNOME_IRC=$ENABLE_ENGINE_IRC; ENABLE_FRONTEND_GNOME_TWITTER=$ENABLE_ENGINE_TWITTER; ENABLE_FRONTEND_GNOME_XMPP=$ENABLE_ENGINE_XMPP; fi AM_CONDITIONAL(ENABLE_FRONTEND_GNOME, test "x$ENABLE_FRONTEND_GNOME" = "xyes") AM_CONDITIONAL(ENABLE_FRONTEND_GNOME_IRC, test "x$ENABLE_FRONTEND_GNOME_IRC" = "xyes") AM_CONDITIONAL(ENABLE_FRONTEND_GNOME_TWITTER, test "x$ENABLE_FRONTEND_GNOME_TWITTER" = "xyes") AM_CONDITIONAL(ENABLE_FRONTEND_GNOME_XMPP, test "x$ENABLE_FRONTEND_GNOME_XMPP" = "xyes") AC_ARG_ENABLE([frontend-stfl], AC_HELP_STRING([--enable-frontend-stfl], [Enable STFL frontend (default no)]), ENABLE_FRONTEND_STFL=$enableval, ENABLE_FRONTEND_STFL=no ) if test "x$ENABLE_FRONTEND_STFL" != "xno"; then PKG_CHECK_MODULES([STFL], [stfl >= 0.21]) fi AM_CONDITIONAL(ENABLE_STATIC_STFL, false) AM_CONDITIONAL(ENABLE_FRONTEND_STFL, test "x$ENABLE_FRONTEND_STFL" = "xyes") AC_ARG_ENABLE([frontend-curses], AC_HELP_STRING([--enable-frontend-curses], [Enable Ncurses frontend (default no)]), ENABLE_FRONTEND_CURSES=$enableval, ENABLE_FRONTEND_CURSES=no ) if test "x$ENABLE_FRONTEND_CURSES" != "xno"; then # TODO: check deps AC_MSG_ERROR([Ncurses frontend not supported (yet)]) fi AM_CONDITIONAL(ENABLE_FRONTEND_CURSES, test "x$ENABLE_FRONTEND_CURSES" = "xyes") AC_ARG_ENABLE([frontend-swf], AC_HELP_STRING([--enable-frontend-swf], [Enable SWF (WinForms) frontend (default no)]), ENABLE_FRONTEND_SWF=$enableval, ENABLE_FRONTEND_SWF=no ) if test "x$ENABLE_FRONTEND_SWF" != "xno"; then SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES([ System.Windows.Forms ]) fi AM_CONDITIONAL(ENABLE_FRONTEND_SWF, test "x$ENABLE_FRONTEND_SWF" = "xyes") AC_ARG_ENABLE([frontend-wpf], AC_HELP_STRING([--enable-frontend-wpf], [Enable WPF (Windows Presentation Foundation) frontend (default no)]), ENABLE_FRONTEND_WPF=$enableval, ENABLE_FRONTEND_WPF=no ) if test "x$ENABLE_FRONTEND_WPF" != "xno"; then # TODO: check deps AC_MSG_ERROR([WPF frontend not supported (yet)]) fi AM_CONDITIONAL(ENABLE_FRONTEND_WPF, test "x$ENABLE_FRONTEND_WPF" = "xyes") AC_ARG_ENABLE([frontend-test], AC_HELP_STRING([--enable-frontend-test], [Enable Test frontend (default no)]), ENABLE_FRONTEND_TEST=$enableval, ENABLE_FRONTEND_TEST=no ) AM_CONDITIONAL(ENABLE_FRONTEND_TEST, test "x$ENABLE_FRONTEND_TEST" = "xyes") AC_CONFIG_FILES([ Makefile src/Makefile src/AssemblyVersion.cs src/smuxi-win32.nsis src/Common/Makefile src/Common/Defines.cs src/Common/smuxi-common.pc src/Engine/Makefile src/Engine/smuxi-engine.pc src/Engine-IRC/Makefile src/Engine-IRC/smuxi-engine-irc.pc src/Engine-JabbR/Makefile src/Engine-JabbR/smuxi-engine-jabbr.pc src/Engine-Twitter/Makefile src/Engine-XMPP/Makefile src/Engine-XMPP/smuxi-engine-xmpp.pc src/Engine-Campfire/Makefile src/Server/Makefile src/Server/smuxi-server src/Frontend/Makefile src/Frontend/smuxi-frontend.pc src/Frontend-GNOME/Makefile src/Frontend-GNOME/smuxi-frontend-gnome src/Frontend-GNOME-IRC/Makefile src/Frontend-GNOME-Twitter/Makefile src/Frontend-GNOME-XMPP/Makefile src/Frontend-Curses/Makefile src/Frontend-Curses/smuxi-frontend-curses src/Frontend-STFL/Makefile src/Frontend-STFL/smuxi-frontend-stfl src/Frontend-STFL/STFL/Makefile src/Frontend-SWF/Makefile src/Frontend-SWF/smuxi-frontend-swf src/Frontend-Test/Makefile src/Frontend-Test/smuxi-frontend-test lib/Makefile lib/osx/Info.plist po/Makefile.in po-Engine/Makefile.in po-Engine-Campfire/Makefile.in po-Engine-IRC/Makefile.in po-Engine-JabbR/Makefile.in po-Engine-Twitter/Makefile.in po-Engine-XMPP/Makefile.in po-Server/Makefile.in po-Frontend/Makefile.in po-Frontend-GNOME/Makefile.in po-Frontend-GNOME-IRC/Makefile.in po-Frontend-GNOME-Twitter/Makefile.in po-Frontend-GNOME-XMPP/Makefile.in ]) AC_OUTPUT if test "x$CLI_RUNTIME" = "x"; then CLI_RUNTIME=default fi AC_MSG_RESULT([ Configuration summary for $PACKAGE_NAME $VERSION ($DIST_VERSION) * Installation prefix: $prefix * Build profile: $PROFILE * Compiler: $CSC * Target CLI runtime: $CLI_RUNTIME * Engines ------- Core: (db4o: $WITH_DB4O) IRC: $ENABLE_ENGINE_IRC XMPP: $ENABLE_ENGINE_XMPP Twitter: $ENABLE_ENGINE_TWITTER Campfire: $ENABLE_ENGINE_CAMPFIRE JabbR: $ENABLE_ENGINE_JABBR * Frontends --------- GNOME: $ENABLE_FRONTEND_GNOME (IRC: $ENABLE_FRONTEND_GNOME_IRC XMPP: $ENABLE_FRONTEND_GNOME_XMPP Twitter: $ENABLE_FRONTEND_GNOME_TWITTER) + Messaging Menu (indicate: Ubuntu <= 12.04, messaging-menu: Ubuntu >= 12.04) - indicate: $WITH_INDICATE - messaging-menu: $WITH_MESSAGINGMENU + Notifications: $WITH_NOTIFY + Spell Checking: $WITH_GTKSPELL + D-Bus: $WITH_DBUS Ncurses: $ENABLE_FRONTEND_CURSES STFL: $ENABLE_FRONTEND_STFL SWF (WinForms): $ENABLE_FRONTEND_SWF WPF: $ENABLE_FRONTEND_WPF Test: $ENABLE_FRONTEND_TEST ]) smuxi-0.11/README.md0000644000175000017500000000301112257043746014662 0ustar00meebeymeebey00000000000000Software Requirements ===================== First you will need to install a few libraries to compile the source Libraries: * Mono SDK (>= 1.9.1) * Nini (>= 1.1) * log4net * GTK# (>= 2.10) * Notify# (optional) * Indicate# / MessagingMenu# (optional) * DBus# / NDesk.DBus (optional) * GtkSpell (optional) * STFL (optional) Depending on your operating system and favorite distribution the installation of the listed applications varies. For Debian based distributions it's just a matter of the following commands: apt-get install mono-devel mono-xbuild libnini-cil-dev liblog4net-cil-dev libgtk2.0-cil-dev libglade2.0-cil-dev libnotify-cil-dev libindicate0.1-cil-dev libndesk-dbus-glib1.0-cil-dev libndesk-dbus1.0-cil-dev lsb-release Compiling Source ================ ./configure make Installing ========== make install Running ======= Now you can start Smuxi from the GNOME or KDE menu. Source Structure ================ src/ ---- This directory contains the source code of all Smuxi components. lib/ ---- This directory contains libraries that Smuxi needs and ships as part of Smuxi. po\*/ ----- These directories contain translation files based on gettext. debian/ ------- The debian/ directory contains upstream packaging used for the daily development builds for Ubuntu and Debian found on [launchpad][]. The official (downstream) Debian packaging can be found on [here][]. [launchpad]: https://launchpad.net/~meebey/+archive/smuxi-daily [here]: http://git.debian.org/?p=pkg-cli-apps/packages/smuxi.git smuxi-0.11/po-Frontend-GNOME-XMPP/0000755000175000017500000000000012311344243017213 5ustar00meebeymeebey00000000000000smuxi-0.11/po-Frontend-GNOME-XMPP/fi.po0000644000175000017500000000232112300202374020143 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-05 18:36+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/smuxi/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "" smuxi-0.11/po-Frontend-GNOME-XMPP/zh_CN.po0000644000175000017500000000245512300202374020556 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Dean Lee , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-13 08:17+0000\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/smuxi/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "私聊" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "详情" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "添加到联系人" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "邀请加入" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "改名" smuxi-0.11/po-Frontend-GNOME-XMPP/POTFILES.skip0000644000175000017500000000043112300202374021322 0ustar00meebeymeebey00000000000000glade/ src/Common/ src/Engine/ src/Engine-Campfire/ src/Engine-IRC/ src/Engine-JabbR/ src/Engine-XMPP/ src/Engine-Twitter/ src/Frontend/ src/Frontend-GNOME/ src/Frontend-GNOME-IRC/ src/Frontend-GNOME-Twitter/ src/Frontend-STFL/ src/Frontend-SWF/ src/Frontend-WPF/ src/Server/ lib/ smuxi-0.11/po-Frontend-GNOME-XMPP/tr.po0000644000175000017500000000232012300202374020171 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-05 18:36+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/smuxi/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "" smuxi-0.11/po-Frontend-GNOME-XMPP/pt.po0000644000175000017500000000347612300202374020204 0ustar00meebeymeebey00000000000000# Translation of smuxi-frontend-gnome-irc messages to Portuguese # Copyright (C) 2010 the smuxi's copyright holder # This file is distributed under the same license as the smuxi-frontend-gnome-irc package. # # Américo Monteiro , 2010. msgid "" msgstr "" "Project-Id-Version: smuxi-frontend-gnome-irc \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-08-19 12:23+0200\n" "PO-Revision-Date: 2010-07-15 01:56+0100\n" "Last-Translator: Américo Monteiro \n" "Language-Team: Portuguese \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:220 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:51 msgid "Whois" msgstr "Quem é" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:224 msgid "Query" msgstr "Questionar" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:229 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:55 msgid "Add To Contacts" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:234 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:59 msgid "Invite to" msgstr "Convidar para" #~ msgid "Op" #~ msgstr "Dar Op" #~ msgid "Deop" #~ msgstr "Retirar Op" #~ msgid "Voice" #~ msgstr "Dar Voz" #~ msgid "Devoice" #~ msgstr "Retirar Voz" #~ msgid "Kick" #~ msgstr "Expulsar" #~ msgid "Kick + Ban" #~ msgstr "Expulsar + Banir" #~ msgid "Ban" #~ msgstr "Banir" #~ msgid "Unban" #~ msgstr "Retirar dos Banidos" #~ msgid "CTCP" #~ msgstr "CTCP" #~ msgid "Ping" #~ msgstr "Ping" #~ msgid "Version" #~ msgstr "Versão" #~ msgid "Time" #~ msgstr "Hora" #~ msgid "Finger" #~ msgstr "Finger" #~ msgid "Userinfo" #~ msgstr "Informação do utilizador" smuxi-0.11/po-Frontend-GNOME-XMPP/fa.po0000644000175000017500000000231212300202374020133 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-05 18:36+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Persian (http://www.transifex.com/projects/p/smuxi/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "" smuxi-0.11/po-Frontend-GNOME-XMPP/fr.po0000644000175000017500000000247412300202374020165 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Clément Bourgeois , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-13 21:40+0000\n" "Last-Translator: Clément Bourgeois \n" "Language-Team: French (http://www.transifex.com/projects/p/smuxi/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "Chat privé" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "Ajouter aux contacts" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "Inviter à" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "Renommer" smuxi-0.11/po-Frontend-GNOME-XMPP/sv.po0000644000175000017500000000246112300202374020202 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Martin Bagge , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-10 13:30+0000\n" "Last-Translator: Martin Bagge \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/smuxi/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sv\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "Fråga" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "Vem är" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "Lägg till i kontakter" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "Bjud in till" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "Byt namn" smuxi-0.11/po-Frontend-GNOME-XMPP/en_GB.po0000644000175000017500000000315212300202374020522 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2009 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # Ryan Smith-Evans , 2009. # msgid "" msgstr "" "Project-Id-Version: smuxi 0.6.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-08-19 12:23+0200\n" "PO-Revision-Date: 2010-01-09 00:20+0100\n" "Last-Translator: Ryan Smith-Evans \n" "Language-Team: English (British)\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:220 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:51 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:224 msgid "Query" msgstr "Query" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:229 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:55 msgid "Add To Contacts" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:234 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:59 msgid "Invite to" msgstr "" #~ msgid "Op" #~ msgstr "Op" #~ msgid "Deop" #~ msgstr "Deop" #~ msgid "Voice" #~ msgstr "Voice" #~ msgid "Devoice" #~ msgstr "Devoice" #~ msgid "Kick" #~ msgstr "Kick" #~ msgid "Kick + Ban" #~ msgstr "Kick + Ban" #~ msgid "Ban" #~ msgstr "Ban" #~ msgid "Unban" #~ msgstr "Unban" #~ msgid "CTCP" #~ msgstr "CTCP" #~ msgid "Ping" #~ msgstr "Ping" #~ msgid "Version" #~ msgstr "Version" #~ msgid "Time" #~ msgstr "Time" #~ msgid "Finger" #~ msgstr "Finger" smuxi-0.11/po-Frontend-GNOME-XMPP/cs.po0000644000175000017500000000254312300202374020160 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Ondřej Hošek , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-06 15:10+0000\n" "Last-Translator: Ondřej Hošek \n" "Language-Team: Czech (http://www.transifex.com/projects/p/smuxi/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "Soukromý rozhovor" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "Kdo je" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "Přidat ke kontaktům" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "Pozvat do" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "Přejmenovat" smuxi-0.11/po-Frontend-GNOME-XMPP/nl.po0000644000175000017500000000246712311343665020204 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Jeroen Baten , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-26 14:50+0000\n" "Last-Translator: Jeroen Baten \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/smuxi/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "Query" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "Toevoegen aan Contacten" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "Uitnodigen voor" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "Hernoemen" smuxi-0.11/po-Frontend-GNOME-XMPP/es_AR.po0000644000175000017500000000270612300202374020545 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2009 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # Juan Miguel Carrero , 2008. # msgid "" msgstr "" "Project-Id-Version: 0.6.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-08-19 12:23+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Damian Kleiman \n" "Language-Team: Spanish Spanish Localization \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:220 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:51 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:224 msgid "Query" msgstr "Privado" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:229 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:55 msgid "Add To Contacts" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:234 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:59 msgid "Invite to" msgstr "" #~ msgid "Op" #~ msgstr "Op" #~ msgid "Deop" #~ msgstr "Deop" #~ msgid "Voice" #~ msgstr "Voz" #~ msgid "Devoice" #~ msgstr "Quitar Voz" #~ msgid "Kick" #~ msgstr "Patada" #~ msgid "Kick + Ban" #~ msgstr "Patada + Ban" #~ msgid "Ban" #~ msgstr "Ban" #~ msgid "Unban" #~ msgstr "Quitar Ban" smuxi-0.11/po-Frontend-GNOME-XMPP/da.po0000644000175000017500000000246512300202374020142 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Joe Hansen , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-05 19:51+0000\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish (http://www.transifex.com/projects/p/smuxi/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "Forespørgsel" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "Hvem er" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "Tilføj til kontakter" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "Inviter til" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "Omdøb" smuxi-0.11/po-Frontend-GNOME-XMPP/POTFILES.in0000644000175000017500000000020312300202374020757 0ustar00meebeymeebey00000000000000src/Frontend-GNOME-XMPP/InviteToMenu.cs src/Frontend-GNOME-XMPP/XmppGroupChatView.cs src/Frontend-GNOME-XMPP/XmppPersonChatView.cs smuxi-0.11/po-Frontend-GNOME-XMPP/pt_BR.po0000644000175000017500000000234212300202374020556 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-05 18:36+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/smuxi/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "" smuxi-0.11/po-Frontend-GNOME-XMPP/ru.po0000644000175000017500000000300212300202374020170 0ustar00meebeymeebey00000000000000msgid "" msgstr "" "Project-Id-Version: smuxi 0.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-08-19 12:23+0200\n" "PO-Revision-Date: \n" "Last-Translator: Urmas \n" "Language-Team: None <->\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n%10==1 && n%100!=11 ? 3 : n" "%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Poedit-Language: Russian\n" "X-Poedit-Country: RUSSIAN FEDERATION\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:220 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:51 msgid "Whois" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:224 msgid "Query" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:229 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:55 msgid "Add To Contacts" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:234 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:59 msgid "Invite to" msgstr "Пригласить" #~ msgid "Op" #~ msgstr "Сделать оператором" #~ msgid "Deop" #~ msgstr "Убрать статус оператора" #~ msgid "Kick" #~ msgstr "Выгнать" #~ msgid "Kick + Ban" #~ msgstr "Выгнать и запретить" #~ msgid "Ban" #~ msgstr "Запретить" #~ msgid "Unban" #~ msgstr "Разрешить" #~ msgid "CTCP" #~ msgstr "CTCP" #~ msgid "Version" #~ msgstr "Версия" #~ msgid "Time" #~ msgstr "Время" smuxi-0.11/po-Frontend-GNOME-XMPP/pl.po0000644000175000017500000000351412300202374020165 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-08-19 12:23+0200\n" "PO-Revision-Date: 2012-01-06 20:01+0000\n" "Last-Translator: lukasznaw \n" "Language-Team: Polish (http://www.transifex.net/projects/p/smuxi/team/pl/)\n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2)\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:220 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:51 msgid "Whois" msgstr "Kim jest" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:224 msgid "Query" msgstr "Zapytanie" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:229 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:55 msgid "Add To Contacts" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:234 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:59 msgid "Invite to" msgstr "Zaproś na" #~ msgid "Op" #~ msgstr "Daj opa" #~ msgid "Deop" #~ msgstr "Zabierz opa" #~ msgid "Voice" #~ msgstr "Daj voice" #~ msgid "Devoice" #~ msgstr "Zabierz voice" #~ msgid "Kick" #~ msgstr "Wyrzuć z kanału" #~ msgid "Kick + Ban" #~ msgstr "Wyrzuć z kanału i zbanuj" #~ msgid "Ban" #~ msgstr "Zbanuj" #~ msgid "Unban" #~ msgstr "Odbanuj" #~ msgid "CTCP" #~ msgstr "CTCP" #~ msgid "Ping" #~ msgstr "Ping" #~ msgid "Version" #~ msgstr "Wersja" #~ msgid "Time" #~ msgstr "Czas" #~ msgid "Finger" #~ msgstr "Finger - informacje o osobie" #~ msgid "Userinfo" #~ msgstr "Informacje o użytkowniku" smuxi-0.11/po-Frontend-GNOME-XMPP/LINGUAS0000644000175000017500000000011012311343665020237 0ustar00meebeymeebey00000000000000cs da de en_GB es es_AR fa fi fr hr it nl pl pt pt_BR ru sv te tr zh_CN smuxi-0.11/po-Frontend-GNOME-XMPP/it.po0000644000175000017500000000355612300202374020174 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2010 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # David Paleino , 2008. # # Vincenzo Campanella , 2009-2010, 2010. msgid "" msgstr "" "Project-Id-Version: smuxi-frontend-gnome-irc\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-08-19 12:23+0200\n" "PO-Revision-Date: 2010-07-15 13:28+0200\n" "Last-Translator: Vincenzo Campanella \n" "Language-Team: Italian \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:220 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:51 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:224 msgid "Query" msgstr "Messaggio privato" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:229 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:55 msgid "Add To Contacts" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:234 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:59 msgid "Invite to" msgstr "Invita a" #~ msgid "Op" #~ msgstr "Operatore" #~ msgid "Deop" #~ msgstr "Rimuovi l'operatore" #~ msgid "Voice" #~ msgstr "Dai la parola" #~ msgid "Devoice" #~ msgstr "Togli la parola" #~ msgid "Kick" #~ msgstr "Espelli (kick)" #~ msgid "Kick + Ban" #~ msgstr "Espelli (kick) e allontana (ban)" #~ msgid "Ban" #~ msgstr "Allontana (ban)" #~ msgid "Unban" #~ msgstr "Rimuovi l'allontanamento (unban)" #~ msgid "CTCP" #~ msgstr "CTCP" #~ msgid "Ping" #~ msgstr "Ping" #~ msgid "Version" #~ msgstr "Versione" #~ msgid "Time" #~ msgstr "Ora" #~ msgid "Finger" #~ msgstr "Finger" #~ msgid "Userinfo" #~ msgstr "Informazioni sull'utente" smuxi-0.11/po-Frontend-GNOME-XMPP/de.po0000644000175000017500000000253512300202374020144 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Bianca Mix , 2013 # Mirco Bauer , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-11 19:38+0000\n" "Last-Translator: Bianca Mix \n" "Language-Team: German (http://www.transifex.com/projects/p/smuxi/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "Query" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "Zu Kontakten hinzufügen" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "Einladen zu" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "Umbenennen" smuxi-0.11/po-Frontend-GNOME-XMPP/Makefile.in.in0000644000175000017500000001533512300202374021670 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/po-Frontend-GNOME-XMPP/es.po0000644000175000017500000000237012300202374020160 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # toote, 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-10 12:53+0000\n" "Last-Translator: toote\n" "Language-Team: Spanish (http://www.transifex.com/projects/p/smuxi/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "Consulta" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "Whois" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "Agregar a contactos" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "Invitar a" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "Renombrar" smuxi-0.11/po-Frontend-GNOME-XMPP/te.po0000644000175000017500000000232012300202374020154 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:06+0100\n" "PO-Revision-Date: 2013-12-10 18:22+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/smuxi/language/te/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: te\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:219 msgid "Query" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:227 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:215 msgid "Whois" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:233 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:221 msgid "Add To Contacts" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:239 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:227 msgid "Invite to" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:257 msgid "Rename" msgstr "" smuxi-0.11/po-Frontend-GNOME-XMPP/hr.po0000644000175000017500000000346312300202374020166 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-08-19 12:23+0200\n" "PO-Revision-Date: 2012-01-08 08:23+0000\n" "Last-Translator: Matias M. \n" "Language-Team: Croatian (http://www.transifex.net/projects/p/smuxi/team/" "hr/)\n" "Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2\n" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:220 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:51 msgid "Whois" msgstr "Whois naredba" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:224 msgid "Query" msgstr "Upit" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:229 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:55 msgid "Add To Contacts" msgstr "" #: ../src/Frontend-GNOME-XMPP/XmppGroupChatView.cs:234 #: ../src/Frontend-GNOME-XMPP/XmppPersonChatView.cs:59 msgid "Invite to" msgstr "Pozovi u" #~ msgid "Op" #~ msgstr "Dodijeli Op" #~ msgid "Deop" #~ msgstr "Oduzmi Op" #~ msgid "Voice" #~ msgstr "Dodijeli Voice" #~ msgid "Devoice" #~ msgstr "Oduzmi Voice" #~ msgid "Kick" #~ msgstr "Izbaci" #~ msgid "Kick + Ban" #~ msgstr "Izbaci + zabrani" #~ msgid "Ban" #~ msgstr "Zabrani" #~ msgid "Unban" #~ msgstr "Skini zabranu" #~ msgid "CTCP" #~ msgstr "CTCP" #~ msgid "Ping" #~ msgstr "Ping" #~ msgid "Version" #~ msgstr "Inačica" #~ msgid "Time" #~ msgstr "Vrijeme" #~ msgid "Finger" #~ msgstr "Finger naredba" #~ msgid "Userinfo" #~ msgstr "Userinfo naredba" smuxi-0.11/images/0000755000175000017500000000000012311344241014636 5ustar00meebeymeebey00000000000000smuxi-0.11/images/protocol-chat_256x256.png0000644000175000017500000003253511700531610021152 0ustar00meebeymeebey00000000000000PNG  IHDR\rfsRGBbKGD pHYs B(xtIME W IDATx}k-U޷vyv;{f sgx "E%![(V X"GP(AVq+E"a cQ^UէϽs{}{ԩsZZ{m@ @ @ ^?Ї JO~\A|ri*\@@ !@  @ B@@ !@p/Çx_bgg_ !p8};8y\ @ B@@ ~kZr|Bx"pG~E~%ǟ}%!@  @ X&g?c8$Po'"g?"27i;_q.:W7˷^}Xr`4`e4* 5jxapeto+\x<Ҹ C'*oxmQ=pLCcrv%ϸǦAOM.)!$@uHP!U)sot';ތɒ~Dc9f!!X֣VRo[YBDfloSgd5ct#~)#PmK BaFK ] 9cC06W l.yv+%ث=RM^ Я$rXK(LG!?z.)( 5AYUq U/ugSio.9IM®r6q )8PUFd@dSȈmc"76vY;HZi2PW#~ex b@&Pp VYcFoض3J^)j \o;Mٯ}^!SWx@)+Tbg9vfO$Wq}ȚNmR 1@oo?ehD՞G m}q< yS]n)7I? 4|"#Gؿٿt^k ^\;Ҋ~1͖>5 AXLRޝb`\i)@6&qw&@  J/Zz !2~"7p uF?oV!\6NPQq[}R D' nLq8MsFypm!H"p5,!YV\ U=ΦLH6Y=jd{f {'?Iqc{i$nW_juv_]"(2$&X@` @,M]U7*uen@3& ;9aH@ CpiX(d84a[SBK>klʦ"O^e~QKNm~pPLHYo9nNpX 5oC&'UF Nހ ,ФѸ'[&/EGv/ ?..Ŗ,׸?aM`*Z}LDXV/c2RAEzFF'h0=~ ``ZBluڣEf^?;,%63$Z ~A_Wd::v^ֽ+X{}ȩ$( S7S y~XT XV9 cYiRڪl*HU8403' 4qg$ݜo@_Bba7h%P`YCe* @﫦*(oE^`)4鸣gil2N pk;d}mqC@vxP C7^//\`#V Z PK\`V >I&5 RWAq1*vz{  8v͢:uH< ,`F U\n.*ub$tHL Z<ԙz ^ ֕GDLo2xS$4I8$%BoFa{^M^n.rf32OkvЁ :wcP3IV(Cu]^/>ؿ2zkKUL A^`~5)ܞG37m>+,0Rz5 `\M"!i;u{07jH pl/VӴӭ9& i^z!qV(n&A}LFOKJl׿% (V@f/P!M $%+ݟ(vMMIpÁ{zbdXѿ-'^TlÚ/\{ T$F3,7(hnMS&cVsgx-G 4o{ X"긾 4UdM25#52H3m6/ۍ)v^Wem$&P}Ղ1Ca!j\rߪnP֌5. ?g{QF߶xZ |*%) v -5^ۉrC@ ,\ CD+n^f@WUmhF9>ww &k=m㷦 Oo5f7 x,ʠ$W**OV#I,\cԗBuOma~=O51}~P *4r :l>1OdFR v1Fy8Z嶻݀Xl1~3?10P[[YcV׃BP h[ 0ߙGhUnwy"]2xMy0!>׼^ZX3Xk !@pqBexcNwqdzڧ~I&O~W$ppeEG~1Փ:Uf\{N,/~Oϝɋ]&X\^W}%:Xn2BB@@ !@p1"`$x7ّ;L p|~G~ @B@  96~G@.9şɟb< xƆ\so}KC!@  9d^}S,;\ame  xZ.’S<ySK ]3%sO׮|nY/܍_^.m gp"3ܹ+w@B@p1Bs fֺЌz: &8oߟoӴ^mo{!d/?&N]ƌ9%'{/S CsDĀS_ʿM/}G?d|s}lR 2@83VH ȍ *!вK2#o!. iar` # ,.0E/緌s8쑝Z|oo5}jZrҳI  N?t>M ʮטau٤d٨:>2Ma\@y~t.!O}Sv*rb^sgM>@:" B!o_볹"UTuBQ1-b;v2 W38'Ս +ݛu02$ABh'3'$bkk} Z]dW6ēo;~J)DQdQ!NO#"S $i' = @ 30S6G\`߄FsFO\-Nvj f 8:l숂Zl@BXGZh?EF(>0+Ls\EGHۧHLY6¤HmT h+r~&U;SXj0GkLB h r3`b`$kasE$"`^v9Efol^jQjbι7do;i6C?!bZ+(H9t6/6Z wnt~߼pOU/Y*3M[0=V!*gpޫܐ^WnNb<$ vg3j(l]"fЊɇy+?&.c# Z}h^ˑc/Ű?B7d 17ꙣd::Qt-L&ﴻo~qx0=W#R ݝ|b[h <]֘{biޛ IidnJuI!uvЙ,K"QAE YdZph"$Ms97o{& 92e.v~QdTQ1T $o%P 7b$ŭ &)t£fR |Lm$ؘeHMj{AYd]8B:H"R wD͍MDq4ˊRr>ܺs i_HKxs'{f51PamA>sa[;S)%f2D Zua>?̏w^|^DemE1eZp7)U˻[D\ SS(p<U`>A,<\6 [3ٛ"t0|0ڝiAxZyP: TO/{g?^goȟ!724y|6bb|s4:{]:[{)nN0 ax=SY,IDAT!B4{~ a@!:1t˲ E ^ }F`݀@jl{ds0pkwY\!="PQaRBفjwR/5ß['Ks\qcZUKlMޱFY$>-D*fR渹~Xה7nMGYPSyӠg[ ? bjbX2 6\OaÚ1 fٛao\ֈo-G톗 agVn 9p}+]~z/$80S~ṳ i:5_wDC7g^Aä#~oS?Bl'.FXPyuo|Z^%- PyfKu4arjq0৵ i.bP4 6bjCFݔ YJ*36H?^zZc?^yk>6ujbӉurJW-5bZFo8 #4Ͱu0Cjg/k-Cּ7 " /܍_75}`.m:c0YjXZf PFIpi&Ei5Wv(okG* ze",I@D@ט (ōTmVv@tPd8d9 >M,)5=&+D<( 7P\'ظ|~*"~f\[2qTChWY(=cؚNfvy<9h5'^1V>OgCE&X$@; H{UB2AܸU'"eO ":wS*57X=T@8dnj}=fnr{HnfHFUƄ ]jīf)KTifI k.UGd5 O/LldϊZ!}"Py;`;בo#fFkw=~^˧0]~ Aۜ[p[FsP4i/8ۼ~,cL $wZϭf874xXy}x\x:G>OeN[2.9 fUTuEO@0٣^]^xLM>4G9zܘ?{~;_PuiT{U9sK}aj]`CUpa53꼱;.W!;$~ u8TwrFkkR" @rǎJ z1g@+@cM(`~a5"z^,myj!@ OafdЬkF6`|𝙄@h:3s Ф|U(Є9-q@dUHP.uhkj]>Ko3~'kAX!uF~.|s@{p_}=`.dcGk\S[F @\=$Wڊ] BNOa[iT+1svɌ/.hCff{KvS"m<'>gW Z﬚ 9L#*HV8hlkG  K^c t,>Y(qVo <'~Yohnhk3Gbj=KK- qRskm>2ԡs<}PLc4V/>1qگ?xF\ (4/+*ɨIpunslEkGh3X1sQp܌WͰ"i.9-}*4G G^lQm.@yl͘R4GYW2(n家k9V)j请ϳ7;\@<\@@ !@  HEXr?$ 8?*A !@ B@@  Y%>@ B@@ !@  @ BL:Q@YOH0W29j{Ow<[`:CK)'^l2g46 }Va;Hs}nw/_}YB@  d2t:O[_wA+!8ϝp8 #G|?pGQGĕ6ѱ#׌<*'G@EZ*3>zGA"UdgǞe橙 "DQ REIkcS)"9L@T[Py>i;q6x_b?Ygrw=#RG,ɕ* D/Y;a4T;!2L: ̈́1><ֺ%23z= 2dY67[! U"!(dgo{QĽ_}c[__?8vbW62~"|"!{*oh߅^V G>%% I:k5K*hȉϺ2ZAܫq8ʕq fFEDTÏ<۷1O=8sREXL-pFAybhJcNc?HEkؙi:/PKn& AAVFt8>Ac<wi"3zq E@Z<ᆴkǿxq}?qO0ZwzTWkٟf~^W "Bͦ *\d`{wI2{=#R y54ܺ}ˈ1J"*9N0L@Qs7_G9!VW _w<8د6IfAR +++`Iaff"1ODžvX̥Pz^cq__SX,nQ3het Fxwƕs>;y^t{Xcspm>PQThQ͍+1@ VGqqm*hg9K f\vmMAkzv.x"ukBW?ibD;Wwy_]ZG ,rO0sBg)fo!|ŌkO0X3`hh{,Osjxڝv߅ZйO&c'9-Lci4I0K$)޸Z'ܺ&<++XFۿ.rCs9Ykhu;+]%qGpe1КO$ pxg~/w?XJOQi*M=¥jK̺Y2+g}>^y2>RytwН^?+t֌4M}ozslFI2֑^Gg P-ΑsVxdiA׿zϏ}^߫8x8~!.8:(IZ7^PaufĪ+2S;k03ho~9sv>GQgJuKsH)h bV:ǽZMNxP-UǦItSHdbuwxs{*,pxzg}?C?$=?Z[|ߘ{RXv .git NF^W\@?>_~D`X<{|ɱI <E ah{{{c XrV;}^ |E'?>ٿXJg]|ߕ (8`3|X{{O NzyN` q޻XI,= 8;==7^Qr AcjfzJ#6 h&ȾJh~&`~gmAS*;<43h&>moہ{<78>7|͕ #쑟z7~9B2xbyL=f*=d} u I3ɩm΅ˏx׽:LL*s>?AqҲIyf\OkGx'-Vu{R\jd2ˍW-3g\|*]BL1jU:Ck}:b/w?$ͼDRDB^!Ц+2@u_>(,1 YiM IK,,JX/QUF ˓ `C} l xmȎ_mcd;J6奩D"Aݍ-CȲLX F:&P<@((S|(n5aY=uߎEBu \gfdr @XxwE|iaɫi!f."550?XsXu DhB,5E" U~*q< 1:eXHvzo܋mm2U4nOc J0lۦVbƦ_)3ubÐR 5aT lAVGKWCHҦm`beoOJggH4cY] R\(qwƚ_ bOWw"AKs2%W֖?R,j-qK bgҜ:I@9{llu&Leuoup,^~z{g3x5/zN»?T8v' HT*E__?躎aTu||tcʉTt]'ߗ'ϓdjx5մ>OCDƒ, p۶0M2m!a՞$YtD\RsmlL`6,QUIڒ=CQu4̓mXֿ,dYh2ɤyc8##wPY򨾤km]N%m~!2 rnn+\K'[\U!\\ql&Q(޹};C_>o( $TwG?Y\?~+/n6+ $I8KK\ïR$w ؒƳIENDB`smuxi-0.11/images/session-chat_256x256.png0000644000175000017500000002271611700531610020774 0ustar00meebeymeebey00000000000000PNG  IHDR\rfsRGBbKGD pHYs B(xtIME ,~ IDATxyT\ם(b C*adkVKB-$[,Yv$v2=ݧgN {>ǙΌ8v"ˎENOOl!B$((; )խWU$zAAAAAAAAAAAAAAAQi4ttZNd݂,<~~d!$Ds8p@GM"Kpu70|p9?ރN^rA"Զwߘ%k ^ In{5t%w#k$D&m]/S~t,y.~LwH瑿iF>mu,nE"-cv o M"{;`y $Dz  S"]nK$cݯ{P Xַ\rC=2.OJ'0v ^ȿ`{>Gǿ~*%NUROY?nD0bPQR=GοSWeY %%WL/8*.#T](*V/‚"fw]]5"G-C@$wkW2\Mh^FQ~tU.,\7,mݻHQP;hYMh^#oUAƀV:QYi5_k  LN;X=6 -Qk7>DMEL]\]EH$i1+w9)ئ<\}?_p \UEzczt= `:M~c=7nju͙JzYkJVA]5B$D8&_[ x1czlXQeue"jP|5 !Μo찈эl6 #+*fWO !Wѿ+ʫuVwSTICj$mݝEWS[¢-Ym,rB6 snD"a r7 f(Xu9bՔ}[W@%,M}|IԆ%/E;7~&1,Mc:L1MP[_kGLg7Mض$vt1A"h"TW/}yv޾ V9SG >jZ6q?AYY;ūϵlNè* @{j"s/‘a25%xHD@dJ*B&,ja9 p`3,f1x6uBv+\UW⥧f;bkf "^j=Z@JK&m[Zň}H 0wF )|H3ք{?Fi%8,0vSsQW ϖ7,OnId,KG"GZP's4.'KH٪J@T#Qf+ϵ$/%gU<6wtZ"ʳZxT:R֬p]l:@I2coEg2xpK|ƺUn߽Vh p_[BN3ͨ{PrcUHH@mk_Ee1<фŮ2C~-떢y%5: c ߂ŕw8-Ȁmkk|i q|s5Qu`FjV+q}4}Des#Z6? @:ݿnQ۹V[60: صQlݰ: @] %]Vaza62[!Pس}%[J [FAPmcQ'˟牽s| aojl\8Q1+$DLj۰vڷ?"HJ>=V9  ?+ 0ڍ@"In&&!(ךGؿc0 x\U̠W<պk먳duw!(׊Nt:^FC8?9ͦrG|bD@%t] $`$FP %j~|#dYL8wͧ{[rb<ZٷKl} ƿz$"-r. Om;]|a=ND$JھUOٓ[[]nYP@2 LIƑdQ%u&vk*O2ZDyx&aI<'Bx1Tg6BԻʩS֮R&K2J8ʡY<@ %Ĝ1Lĉ;PW[F1K#>FKG+&_0ā{vUnatÏ@ZSdgşI HĎ] Avn}M%¼zsãiyoax*nPf1Jurxaa(nOb??3cXZU ,ˑ(yRk$I(oس}<~ã\ψ{qnȗT䴝`No^Tv^Qwf7xcȘk!oD(oZ>Q^ZtD :|A_{? ܐK`<<"؇JE]C6@Afu!o\tRn=Zaʏ!(W]m9<L&YHW$EN%7}A23\8O<1S? UŎw"3^p5ccA\N`r?uv$Zz&B|pVKMUϲɩWx)k3 @SsU ($_1W? ŠѪfnwHgS-yzȳۄ R3FqTv!Hx Pi 6"+GZP3VфgM'88|a\g"`},<~ԥ;Ե;;B8&`rsxp$SW<Ԭg8zۓ}pqM D[V{a.ſpPDi6_<%bx"\`2kH,٧žgչ KO]^ˈGedlW_Q,;iEV8N],o YxUgEuB9?g 0*ەp1IQg 9& /l!!Q8>x L#\3rm[PQY3}DovۣOI τFl%&Nw_WfQ߲kÎ0E!h_aT =c8W.oZp`aQ )+EIi @Uʪjc7Odz`+:NJŒ̠#!8FT8fX-w<lߠ-!Þ~$I?@ЊVc͊Ewnȋ[Y& yrł|A1i9£ucn~I{7ڷ?kk^|6F/PD$!?GHs|0(<(zNIXg Z65`0AR/ 0; L:ɹ~[ʫؑ6!??GH'#Q2~m_6<Y|q.˜O\aϱUO""$89£?Htj @mkv06?x޻1MJ晱LONy"v3Wt? aUZ6$'gmpdaطG3a"ַyzO^ܭ]^yN*ݱ)yãd89V*욍z:PBUT0L=r浠āx]D( Ϳ / ǡZOUU{|W^5  ?=3)ɷY E0c"2 ky [VI dDʽvU4~tIS[H\pZpcژs}9D00&a!(J'-*ǻ5];?RtjUmH]H/u/N Tu\>xd 5ݫ ^79fõa|zc*1JĢ׶A1@1vȷn:;IIJ.NpVk+i+1\ƛ@"#=g[b%&ƛZ֡/K߬aj4il&?2t(;]YwiuN'xuhqޚ O72-$a@5ɐi8N[; &ζW9gQE+2}0~ǺV W{ 㗼i GW_ CE~"L]Op߄(mԟm''IFIY6zo[csVTF WkN Hb<}"h" 'xzGl/0K\]9;,zg5i7wu.ߏYjڻ8_QPjI2]\e rg}\138f  \j{W~\=ՋV\m?@{DTkdY`\wtG/Q#||SV1?1ZvεHv' tUմWg, ^)N^0p %Bz"&ֈYbfҹ@ϒ 3|fd2j m}!KVbo92|r K6IS$^G1@(6 TFɋbE&}^@RaCS!@N6TDD sR6У$m)$DJ<@bʒV1  H:cњ^ v3c Ui@^pޛ"'ߎ9!Hv#|3Iiƌ[Ӕeͭg${e$ l|"szG"NˀrJPs"?Ez)H*̎ ؔ -c>@!@(\YVx@MrȨN=ɇ8!݃AUpU_O@5z7$cțidYdY$ M H,߆et;}ɵyun"JE?$04`X:p<|<H1| /@{(%X4.Y2c*0'Dh`Qt8]2rfĚ1#"l ' ;f3~?}@.y2!"agd 0& i0D"dD`1C>0A %\N]HirC" $SP^"ݜg>F;JI@>Ͽg=7G(I6KQ|6 0F"@dup0%Y "0pHLi)@%LyyMAi&@E@d 1H;Kf}<7W???t=k_VTMCݡxl=&[?_<e;AWQ^|Nx6[ f.A(QaY.Q]q 8Yֆ*r}fiO;?ikmI&] N6S9dUE;4uAzbØy-qʊaRUWrk]cɥ[gLd=ql1hJ avUྐྵ 7#Lgtn\A*uܣ>Oo6BQMCYG9, {'';$4%e|wϽwsW4C;(BQ*B#-qcP,)jQDfIMs[k\By2=z/mh)=cOEP:x= !.\<ϖ.FFG; v<ע~pHöm~l\:5y؃V< G7}| #Ygp1fRD,L B'm;liJRDYs^4S 7R٧^MOye~@״N_TF3|0Z-|?֦nOQSݻH)6ӊt}+dYR,BWYY L.ÓNX"B@Tx.dޤb{gh7}]hj<'`x+oN 11\fv-Cgaq4pNB+ɟq}qa:k>Q QtW&U=4[S@P%N4Ķp.. fq]MZ|(:vS>O?yX{:B_Cͩf( N$]@c?f4J l`szCBx]w@q:P)=<ò,#$6*"E wb E"NbĖ/Ʃ;۶ytN.:2e- 6(4/(Eƫq p{YYdgj`0DYߊލj 2RJ<4Mjcds @{؁7+O)ضe2mBd0wzu%'q]G8no[8(K0{揲ǖr XV@ E{ ُJ[p\ɝIf~)M Xd2L,iwxuW8W^i"\Vj!å+ 6TPGK/q{jytW~:u*gNvT&*d3Xe=oR_ {I~y W6HY7d׎p!x!4fXmNpkϖ+xk_}ė#  !"kK7]H܎<ŵiWɐ7l}{F#TUV8syBw!L^)JÕ+WVow0;;KKK+T"Ƴ=7&3XDinnrBA8m|ᣍ U_oll, b1|ߗH}re Bt=m84J1MӨ !}A)456?/G5M4tLfh4>u7 b7o\Rq]&L?y###8E{{k"o7l׺[YfMMʐRbr+PM)eQ VeR0!M xk>@) !^myB ϓR~A+䬿;&\?oڴŚ/ٻw/ ;lf.tү ާjRzTVV244X,LҀ6&}_s]wb S|,[oKs~{oKW‘-p8" 0 @BhP^`̿Ͼ{{Wħ RĉtiMcRByJ˅l?599 d?UMMMgЍZ,c@)+Ϙ<0`p^'$'mH7FV1@SA^c}-='<`0cΝ EÀ:_JO?oO)8{1#wB'ʀ`쉰>T@4?I"m](!Qc T0yTfc`sa2L2B(v}=cF_EC!i*$op_L0̓aU~xS=xؽ$?f  | o)$< *fۿ }0!^?1F_H~>$l7ްս{*eyf*-u6Ä=g[e9vC.G.C:FF008ѱKDeo?D"){vF>2% ܎:Rbwp99}QP_b~1O0.YKm>DQ4Ngw"xxɐc_y-xᇛ,y:҂kףpZ .|H3h (y>}oz 'zO/RD=x(fx䑞t[lt}>6^ «2k倁.\k#Oߤ >q#MLSO< 7܀ŋ\db~ X_r@ }gpappz&C,GSPhsv0 >!_ ذJܺV475Qڟ/ c/3 N Bd+WD8Źsbuy%3IfصAo_3m݆$%[?}u1]3ff<&`e*k`xqxg6@W~JfݟUĿ!׵ w}7 ڙ4 q;b81|o= 1 #X|92,v\mm{}ّ@\.1rS3~{7m܄oHKFo~#/؀]Oelټz;$G\g= G S ~.D y-XfMњ /MXpA~> p &b E0oZp1?mtg9L.` fA ;t2OxbLAilҁvf~[;>"g v?L.%K߶Ntv.0hgpdl/$<`u@BXEc߾NQDgy@l0G Bm&tuΟ F +]x}<λ!D`{衇fvLe?W+ K,3\Z[1M3?ѱnwc<~n]'z{TjC~trMX~7!J7rRV 5]hE66^ -M~RY! DzmG G(u]`\SCu32dy:`#ݢ)5 qtabb?Wdz>sg L&3CћC`hnn5hZѾĤeˬQB j uM߬UgaדtZbD]} Z#RܹIlal%eYV(R @("1ڞ0 `  {ÄJ===@={Dg@H1 K/u`ۗt{`[jOl^6⤥u'%lKF{:t0D3_/&wmeSWx~^Tvz!VLXA `BH4($<uˆ*EH}/v kB_KO ~L!+ b,`1W TxWS Z| drS\؃z=ZԏZ~/ј_߱"`Xevf{o>Ms*PUZABz@PK|3|-?u 6 ]Ͽwi.?ȓk^l0*B5&\@j@x ]f^]O>ȑ#-T/iCۿ#0!^vonj,}ѲY&F0 㱌0ί~P?HSq_mO;$XQimsY(K?_(ʌ{"@G455BE7L(E#!NctlwXJܾ˟.I3Ҿ81Ȳ֖V+E=vFGGg%`hV v@Fy;}Nl`mȡXغOJVf|011zgOd2f ի`pW,\j"Xk#X?׿'FցukcشA$nq{] xQ¦[M]˛kH c[l`!fBSꬴ 5)(I?OOgLkpņL&-,fO!zcx^A@߁sW4y/qO$&˾,`Q/{$f'Nuw=0X{U^lB]ͫ z.NǓhii?ƛH$MIom&q*|AݮGqmw"0Ў0ϼ$NE1xvgR.[c}s`d&oOs-7>Q475/Nv?mgnnek,&:-]듿5kO׌ܳ;`.`|޴Fn^q # A|\k? XIo"Ν?Ny G>+VB+Ⱥۡ> T}G͸뎻! }瑞f`POL.osfL TjmsTfs¾/,ZaUȇ?z=wwb:5G:]ͬ*6ą{>OWj om%Z ^R`a=ٜxm?`-eVwsYX};-%ځ`R3~vl`BlQmՕʍ+~9 Ys E?|?pw`.ZI艣FoC,t߼yEQ[nu6% o/Y/);@@050 5/V0P9_W λյAif@BpݵMք `ZF(E4y!N McsNk1o:[5NEomYw6ܷ#Ud5Q lX cǎi|G 6}JsZ=ぁ[ lo=恷tuor:::*֬^(7t-V,'$z4/ vT*@ #/7;*sc =V?66K 7`% Bo؂Vo߾%iyX2^qahf 4g`{~?`mbÕ]_=}[!e$& ^?w|A@rq:"R JQXJBt8ydxH$b[E㼷lPN4~tk3>hY<7CO.*B,85T3"L- (g[80cwo܂X,Vg\\D-Pjv>fSiXJ{t,@D&'t"eFF=( Ǡ@` ,K^xsE݋1AT\Ld- QUp}l`pŕH& $]gD"7G#Ӧ P h  <^ ,@c#M?yIelxuvuEr(5>lZ̕u-`ݜ%\{~LHLX>~gǼd^ـ LY#Jl6#={ֳyW!r"sЮ5L5G,:Yܩ32:+tuvbA? `:.׽ɤ10x6 < z=$$S 'z%ޓ^8/[^&EvFOiޒZm'wHfG!_,Ы7]Te< 1=ƝfF]H^70CmF` &8M08gA=ݩ84 `ƀZt/|٩2gcdd<@DHdX+؋{в^HaOοH$ŋN'Q ) ;a6`r?+ܹnB|===Y3^λri_^|CB$B-HJSy8dy]di̳ߍgNq{af@q P> hmܵkWm>Bc; ]_ItǠ xYx܀ 4!nً=5@"͏V5a \$ҥ˼jb~K>/|K@8zqE &, CxaeB>8Ppqxohh@mm#w3HMQzvpr10-o%%HC7j.N㌎ӟ6DQB(*8ˁtJcNq~ntɣoP'|u:+\|w&`p :W70 Cdqz-g g$#@D)#E޳Oi0R`QO?HXbafͨ:1 @׀(^|)vML'0ƀcΝDoFGT*д\{5!Ԕ圱XKqY=)o9[0s;73=³5|;Cՙ2 a/ϊߜ==p(bxJVR< 8s(A=d\iv` A`5x֜Lع{ǵyEMob(,:f=@-X)ܘ_;#( N{y.xoN>k!ؗ;yoRK Ȓ̥N)nK|| ?|Pp r:gB,ނ&$rٳ'ڽs@J//.ἥbT IDAT C!؁9 dpریe_4! h^'/~߼&R Y<9!xuL?1뤉x~~Ps_r}I4y|t|%`zOH b0JH8z,ZEfOѨy̋+$p{3;(e8{gϩADp G2D,,ː$ BMPhJ""5FF0pa (4l( v p2,́򻃀U}z[/cbb898fcw``}``hmnC4EcS^y%0:xLG PiS}YBJLRsP[PߛA@|A͔pr; ?cg~8c?_+_@]mbo_>#[(ZRuY14666@vEQ¯ ,0 tA,&TWoF~axW2\a~sŊXx t,@}}=DQ3~nid9<<ّ.8ZzU&|<|{ҁ ܚ[Ï/Οln2]?/k`A'8$I( ([oنDbg)s&kԪP"fU&"]f[|FN¯(y z{l 7oΐѹ 7nBG{G tS`^<ܺ6t_0w'@>Om]Nz F̯3nٴ ?0449 PXǧ?iY̷,vpf6A0\( EFa<.XRgU`AtˇK?p`'~ Z3hD38D{}l> s xic+:^CC޲ Mux%HEKPW[o=:|aShjj2-}GiJBe^o7˸,ȁ Vg^_@F@I{stL_>GW'w ACCn&]a: iMSʾNhnrv(-3(JO0T@Xqt5qn*!խ}>ɓt:\߽bwZFx[n܂իrd$<BC(BScZZ( &p jXI ^$:,@8w%=BT[[L8>!МVp w'O3|` `Ϟ=QF_[b%6J%*|*И(T(( -璐L`劕IԽEU.~꾒$K}NZkvjh~ w%`~J:D0?ʫ/+U7I\mnb E;ڳK?/mW:r+rZjG_y-!UWWnwWR3T-ZE!5TQ(A "@ԨB-LN4 $$~f ).g}2G-m}gZ܇T*7Wm,ӣ``@TG(J1_8}ҭ٩W]>ǫ?sKv\óMp)xy}2s"ş("p&u u4J5@˭r~[i 0.Ȩvbʳg7SJ=?q\Yֵޟ 4RTu}o,=s1]ؘS? 3)xź+\|+<Q̙>Ȳ Y/d IшZԃ20RlSk JE[*Oj_IyYop̩fϳ׋%q™Y:>^_:4g.AIpI8q—Eفdx={v.a ۼ^D/MGzxW=?dtjysN~vvz)\FC kf :cHS^)U5z'%tRd"BH)jyA?-ޣBE+}wUX9ȴ g _O> z5KrU>¾099-I{|ɗ/_*Y%gj488q$VFY'5PԸs#SW}b,gv*qwmx}݊Ƕn pȗO/)?[3rcU;+"~ˉeYo @\%jL)NO7ހ$IH&H$c"EZBkgh[V4\f"u?!(zF^|ۇn9θ]x<1'_ "ƿ"Ow},D<2_< 8MMʠл}/NNk׮$06{=WXpuC]OLLپjt*׬yڙ/W6%ERtiˁ% iv J E Oɥ'zO42 f}8AP̩IN}8tm' AyvϞys*1Ť z9iKs36n,"NL&e x QDjo8E$E$)Fؙϧw)mدGK0ϵe@B)'~칳eiJݘυ. ]@~$kgeDo/^z%N < z˭?|g*T(n]Q\2rl14c||@Uʭj_ѦK~<.cYobllT~8_N^Wi##ī~lx;<|}kd2 HlC=0F/' e7tqJ>Z\;1H,㘥rK k }8<\Q?@BPj3]d/~ӟCo]J!3Qg4r/WQ~mE@~ߎ ^xV\m[ow,QɤgfD?{=b $qq$?Yqo &dJM0`tl4[911^m(JڊXp!}_p``<?dP(4>x^d7Ͼrz.@Ef|JxXt9`G@)=VpIE/sSvxl5Koz]svYj_%)QL;ǎ ގD"9=bq)>}2E HRޯ}ks *Xd6O.sH3H$]ի.J\7 9Rpd2O|ؘH"jy3b̓pୃH&hmmASS7q+o ``pyQŲ(ynǎK_r](q1BRAKPq_k <c N `5 J1>rFQ[Sd2p8Txj^:H|lt ccc3ErGKKΜ9]Sׄc{챏}Ae{2vO7K6++ u$ {rQ!S_ grUT~>ukף mmhjl,زf,^(͠zYX}s>{g=(&s^reY*8Kد{Zsl2_K!\avw0| 2{?^oUXx :tYxkj@ʝ$ᖛa\Ѕ΅M~;R?~Yˉ[<|>g'{!Ƙ{=^ 1 '-As0'ּ;|pK/źѱѨVIX0]v6]u'p;1A ,[Wl%Nw=>jm)as U㋅hdY葆̅ʗ |63 =3^0ZMF[[{Q--7oCM&| ::qђ!WƆW{R{_xjSU_Woqv9-6P@)+z%I(RY n@P0Y?t:[}{[;nFXj bD;W?7ߴ JV| b͈D"^}[K/t0"uO k WR["dY+M6.Q9 AO\`{ )S_?[ފ~d͙%6c"MW]}耟rfhnjD}}}ehcL1~na32V),-7'(XlsRCK.PTH yg&`dѣoI"XuA jokMb徕b#`keͨW`bvx6]]=nv;OID J|w/ /,ɦv A:_xqB,˸{Xz2j-дЩ6%IB8+:q3Bk% K,í[@WBOj`]]=B)j׮sub788PHx` 3p_7jjҗ"v=]dB8kck<@E,^m܊5"2S~&u]~s AÑB^> ` /wCtf-a w ؀t0`;-~=믿K,=nӤ*ka t5hnns@ I2.–o² V%nk!nroˀq?-`Se,@!}ĂK@~7c< {koeꊍUgOPkkkfZ\:o!oczG<ǒKqMO5AP]W;w.Y`ͬ぀^f{xxm@,jقj? x+\M5s ^㵖wEsByj6RdD٬ cBB&6 H$Xt,^ CpY \tl>CChnjAkkjk EZ ~ I@u~@p[q c'D9 ْ- ccc/Vp9臺0e<߀+1? :Cև>qA@SC)bz=J,v<$M-Xz\mfn jkչ]یV`^b7ͻwui*Vcw*@]o`6Ug{G:=H$ZdJ)5w񘀕 k23](_{׭Lڗq۶QWWb /QDDbvVT2vֺ!QV475R\.B$RR)O%¡0"((bjkj!R*!Anᩂ`~oU$^SO;zzz~ӓJX$jQS) I"FGG@3 BlUK8cfdԔλ|Y_tVX٬JEQŋ!I(0k҂гB~<-t>1yBΰr,&JMAQP@Qb P(2bX1Uo&Dz_Pi e.Z~;?f5FF#$XvhɲDB!$ $@*u[__of%Ilz¯ |iGBUj`=J$Iu.Fύ^46 Bn~30{zf/Y4t"wo…8{dY(>V@1d@;t{,q۝܀ͮ\PR IDAT`jj /^D<G(B4- 5.o VhP|9՜*VJ-X:ٌomeY]wދG)fl/m.rY[|>Wh/!Xn==^e<s2Qy et? #0\L<&jp|߀>rs6,_ A$V=P̀^Ba}W?f& {F?a0}73X*[#Fon+QB&) CԌ67oPQ1m @%ȔrAW恍ņ c1^r}j#02;~vrr³Gnp)`RMfsP=k2,9),]˜$e-Եyl+h2~}3GѤfsE'тĿוOQqWޏz-`1 x9FF+|S@$廁s3gى֖VO EQLzttCCCa(8gJ nU(q޼Uw|+j+/"r,٬UDjjghl*ߝ-`׽ީi 2^k2ݳg`bjB>{s5ul$GrRH& mT/ջ' B{i \Γl6\.gZ6d2\+$ADWWS?kHV YF:`_?L&eм JR@pر:9[\Rˣ=u$2zK|u B!۬d sل&/4(Ru1XQp9Ql*?rծmlP(} s~Pݹv$ɈE<G$.d}i-N&A@`#`jRTۿ>zj, 'C8U͏>#K 6_gy|q7RcphKN>]uժ2-0J_p+q *A|e#BJ;#?S=o|_-ˢqqx>:*3 X[ yƦ&ol1*ϣӼe `U{~e/}9J@2YSl\b)hdm477{.#$rrGO_4}nV5lz w$ xMk2˙3g+zjTcSnputwBCü({}P WnhKz&U:C}uQ2<^<044kA5Kx'066Zgmm  0׳c/~my Pw +19ԀRjg狌]3 f*'N=wyrV-0Ԅښz H"  [IkZw0[`fUSƑf'L}&{' ( *B\ 5)MRL ҊfzӒx<|>[J6Z[Z=KNq'GϊիLO?qf2C_hB!D#H " dc[0IY,@:Q> R_{1f(JH&cZcmbr)ޣ<#U(NBmB/}3,Y^LNL U"]bPS2d)Vaw|@Y@k; gU y]]m!]+-0fu (\+dM&`3t*G^~vL U82RXۮ.NNNjeڹY8cQx}~fa%ˀ|9 XZ5v9CK |SS)xbhIp*P0S 0Fb CI,)йn^nU{e@c([K$ YLLL"kTW,BXO{_zo)T S_ NCq :hIF@^\Bpb(Sy1 ;{ ,$Qk:%^< (O=ۏ}]SSS'>h +ZB : _g[=Yퟹơv_:]U݄`bNl455ڎW !15|js^y+8p}ؑߧ+O^?{lI-_jrMH&FN?/e؀u;g@),ܮHĵc@gg0^GKF9 9\.wޣ=/ ċ*?LSHReQc'a hvSя~%׸ ]`9ylT*y HUd UQU I- aztuY> C :x_fOozӇ7yI9)R 蘿~~ PӋc1#S'{^= Tbrb NXNBSm~YjՊ⹴gR(.F`9].!۰ E6?odךbHF B@ut,jm"2,dY!j/=c5|1yo7%P+ Nql=w} ֮]cHbDUr9::T>{J{ZZ@fN0 i8*m^^ 3N<]\־Zjs3C(2T8qxw&|旃~JM)=y8bwy;'˗T[X ]R!eOcxd7ZS  We]"9ΟYzV̐4~Ol0o5+eT" eYbehmm+nG~}L6S(hS4=n3P p.Ds.Ç+~;zcȻ B؄" (Z@V/.M˻t;BB&[lS ܫfr89BO<|^$IX~-Ր{Y' ˡw8|}T;mʗ^J'0{bk{MGNۛ}g͛[:ZhCHG"R (4D#c 4ˆ TuxJ奙@4,H Wk\ԣ7ntU 8,@Q466`ٲ mat;T Ν^oN@Y,h:(h .Zpad޼yR4kkkJ)J@)%\MQն\.G`U6S9˺$IH&k kjm;Jc~?wD(er"`ӦMhhh$e곊=ˡlHBN&Oh~{+r7L{{{'z{{+5w:~SjWk~,]Ԕ_^0U D:;5Edf8̻x#yobffm|×v.lB$*i#$jR*UCևJ4i*UKT"m J b0ߍqh͚xwwǻs/g^0';;;s|DF} C^`4s2Leڬ@M[Ϭ ƺ) @2Ǡv(@4& Snfvyò̓xn!db~\.Q2㭥[W#^bSϸMrGn\NW 3mq͹3Gb tWf,:| 850W9"X 07 Y;E9hl |6Vqo2{zzZ4Ϸ&z2.$O>^C'~( 'F_R?NɎA0p$Qv-BFȞ0*! yj'~ynmAbgsc$@? ׇX<~iϟ O, ؘ'ZW_ǕouAC055U$O&?lpy_bb,LگAK8C(#j-9;Y-sB\>Y(--UJE}K+f\=Qrٛ555ޕ zzvCMcAYY,r?JW $(J냻~;| ` )Ҷ M T%OU\_L_˕Ű (-+ҲKa~`e!5K c͎( }\ s$Yaa?Q!G!H$Pfa:h4';˗ <uq( dFb*Iy+***x]{ _ĪDO8xpt$dm! (ߌjǕcu"hu!q/M (C~|ffF=TWq;qeX5<;|c6( %ⱡP(~{sqc݆h z~ϝ}7ϥP(V @@ZO+ bߌB}.k VC 5=)@H0p|xhƺ k} Irw<:ħґxޟ;H$"]n?v)-] pA$/9u8 OBz3XB|isIDAT@ޞ6lPCeY[R\2\he=˲X+wojBFpԽ:&@]8Jq>[|euE?O߮zG(+SgZ꼘zBYk K!?W0/^(+/{ l$Ʀ>u!j,X.W;vo.y$l_.Fi -50d)V,,"z7oٲ'wBszvw~2 "@J6`O,=k-jkk|kq___5WH/bɉ{FG7 zE[ GK|@,Zb$ٶm{K[^(RXXe*lA? ;.|BN҃kxhc8p 5Eʎ׮//xŹ\\5!$I=0#ӡgΜh 6g(Ί5bDm /lX]S*.(\U/9 )!@_~8zqd+ ˊL0-\l?3i>=VS^rJ&f3"`&b0YOrc=:$?>X΋L rN(0E" &`[`첁?PV y ȯG`O惋H@{+`W"'zb$@ @ @ @ @ @ @ @<DIENDB`smuxi-0.11/images/icon_256x256.png0000644000175000017500000013440611700531610017324 0ustar00meebeymeebey00000000000000PNG  IHDR\rfsRGBbKGD pHYs B(xtIME !- IDATxy\guyR{uUuW﫤jId 1`0 [@Yld(d2LB@m06cc}Qԭ{%˶dyOoݭ}|jRԤ&5IMjRԤ&5IMjRԤ&5IMjRԤ&5IMjRԤ&5IMjR\"j%=t蒊lE hBH@@ alDd$ % !HIAY!9%CBS@M^U).MJs+B@|3 p8&< Q_rO*[ ̒ r<+rRڟndmw_bJ. rϧ*H-:A?!?Kŭ+蚊*/[؉Ð&I&_$%g&$LNgJ  }A .Jx_kj ~\vROKSz?u^~f{bxuwiL 32>gplYfǓH)KARH'\ز) v}}4ӻu EԹpiK[ҟϷ,  D,Gg8qz91͍8h~wo6jpH-hƇ׀FS4L6nh9D}Ѝ8~Uߪ8_:_CYRJ9&f;3͑LMO5KཿLm︻4eAzkt5KzظZ )Z|)/LgܡAǘO)=oFd ^O*'5YzU7]M4}(BN_8 7LI&W$3d&Aa!x7$aThT4E\.t]W鷪*`  AN 8;fpLH'ݙ~x6Bkp(~}}W\-]6^T`$tdH2[ _4+ly[{k Х)ANз[ǥUd: xC#൦תmS7WUdu˺HM䉥Ēyҹ" فX D -Wex\*HE8Χ/_6(( L&yA9pBFp I^??)yj&ܹoY߮lX,<)v*~/W(pel]9 jV\ZR.!!AX#,c<GOe||5f@*Dm4`CBǬa]c4̍rRnDљ 4((iuuB<.-E"ݎ)U `QݺJsKk:7yټ3<#85aRCuwIؽھMnnnl[ U_csf 沢 qBq(X (}kkk+åPqdlf#{Hf[_VGVP_~lB몠K[hȃא@B{GO ~c5?%j~~scۮMmhRF+6g04bh2E:_\ +W0.m2Hf73RzQ=L8^<"PwGQfuJ6`dr&b(ޕQjlTAJ{&Y!/~TֻBй~uu~qn޴]\XXs'LgvtR~~DU2$Va`Bd EU%E/_XFIH)1MIИ`"TH*3XO[_碳1@{o)h Sr,>"cNu'*X0\F\uEkC+unnۇץQL $ƓdseݑE96ٽuvʾ_T| YRJ $gb c7R4-sHy ]*~zu>T@ɝ1y8>U׫˧{"C TmMSxY,l_@:[tcuZ Odt_hI7x(&ۈ"tf@) k'6N*`b8VJIW,7!,гq[gKVCyM)24£-=lCkC[ LLVDM!>X{؉" )]{;Zѡ 9 \/p>I<>B-u߮$>@4!341p/y o_:!sWa|l@l/?_Oo(ZA`٪*c mZuKۊE4 u M+{;CX(: ޔ?5X~ xXǥ3:)c!s| .Dӿ v nʶtÓ/́m7gC\H~S"!kwwV-Gȅ,}E=φƿXT~3A2H2ԛI6T砲G?Cl0j#0.!9噁r`\1ȩRO9__1+v`, SޥqP~vEoF9qfBDj;|să\'R?rɚ_ŵm@l0XfY~xGTDy5t?˩1'3- &`4`FGQ5* BG zCEF R- gEpRjt`Yr!7:{=~|c4zn(0tVtԱ!0X1oAe<튣)٥9 Jd (kHPwvhN ϐq^|ܱ5)ou t4]϶ M xECZ- % , 2a߳L $\Vv>AC$jmߤ>!xU͓G(O`)i {Dn6mhgx*I,؊,,|w]ϟxhbӜE%`m+N(/zZ~; 䩣Sͤa1R,]'orI֖Dv)1= !!#46'SXבo9N1~i9<]VYՀEF!SK\Lf|#j-r鷬<'n!~n f}$3mg"Iʌn?wcnpXʊg9:2Pa$ۑB"?YS4Gs-Ѱ1rxlf]ZO LvfD%鯖U(s|7}^Roe2nk,bRgi#~+L"[Jp' %틁d٫0H qț[䚔i\Zm'`abFYK!n'n#i#n#m0Uc[cߖfB CP<;pZQEU;>^s^OY{kZ"!cz>#/1Ç^Ѻ?T|+EGW+xJ3;\),AtT~Ztٔ>+)FF3*?ESSUӀ+go&c81'o%\+HMB'9b*iLF+Ph ` Y'!V~.E)q1f}m :A=U$Z)坡9!~鳮F~=RpYi΂OġIil7\z2P]Z t5|ii:az93a@!H{KtIMC:hF ۂhJVR4nE(һ~\ F`O_Fl&m܄I/3/)HFۣ_P#c[iZԠ`df/GGޱ1rŀՈ0sZgIByrĔ Gz{K:t _lb4&먲Pe:gL"NkkױgOsbtRij8\Z:0m;XBMH #H:Y?WlT7:}(,|&HZЕXR\DXV(: RX{e £[( ;bW/:\f%X. ߏ AmM?(*,iL.!;͆|CLDՄ $[LsmA8Je>g.=극ٴcu-vGʡ5x͟x;> j gb~ ,ffY:K%219=Rmg#'(o;d^,;ZFʅsQ=M;d|; x 'JLHe &sGKEsBBczg-R6=oU^OgKV/'G&L. e󎲧랯2AeY1OLۢpU~؁=(@:&ӿ ҽ],׷*{vTT[-Rś͑gٹ lQ+4]<{#&N  =DGhkxrzN=Dk(8-Kh/M/ Q)lh )-<;ȅ]ʅ۝>w"؋v4zGػ3x\0KcJ2׼ jБ WO`fY~;,hhnQJX\q P1믴%K@ֹq|]KؖBszv3+3I|CKK&-Eii84iUr/.p:4ͯg-5XpLvåxܡ3s~򏱧sms/ |'~l>\i; :w1eVufuzez1OI*:1.R+mS`q ڕ1"*0`є+C҆k9&s\`frQfUfO癶|\繨%<;غ}t&'2'ix׭rNC`|u4j["IK. {;3S3A{?K0]ӓ"kMCJQ 6w~wݽc&c#o#]y1a-Quzuzu-+;E(E!%f ɦ2@e"PR\.'s9{q+єƯ=@-QtBT~mMScd}] {;I[P<"YZ싐;1L^sytx94t蓣qnnG IDAT7DSʙ?>y!م9_Q'5EހG׬eKE+ Lqy;$إy+B`(q5e "z)z]iRQ*^&dPq둨V^|XJ+',osjӭ0K4hڑAߠv߶2¶#w28y!L> sV`9:rmicMA!(6YTw1'JKKE<Š<˸sO#Œyn~q+[x@sEƮb [݇hƪt>-2trNq+{3l#NC0o t@"-,ĥD㤋7Yٓ\Ũ4^)2=eLdY!@bs|mhj-:ZXrm5֮/Z(*/N:Y%fh<}t G!|[S!69ϼm/ 'G"`"Zw\t>JS Ѻ\Ko][ MԑI[֮olb|׼VhqMqkav$Ⴒ\Qlوn;EWDPTRQ^DKѾqAQ%PXAi6ypRU{5B>7]z"5vKE;пawhgw޼M뛩9<(ESZ3$ڿvbN*ׄ)U 3|?fq dR`5ڍذEWlEM m==(.7Hے{H B|a,&N#A(1d#xۙt(aufM/o5-~(>cNME^iqiIv\h]Wz H\BSc :o<; oH@تw5qM;l+H 'Y4ak5PI4tu͏L/6P~/D VtuA@kmAP^Ò+ES. M< b42̨\O->ƭeRkIxp/U 2MƸ~ nW: Bldri?b 0 )D-(8;9h;G8![ 8&{?͞x(o>)*3៾evdp#\9t5[־6E1$- kFJVkE+S|B>UVP)m@6 =hY/*~LR$6iGWN)'[`е40uZ#Q:A'Bֵ*Cb.ҹFl0%_Ehsx`!+ }U\wۧ-oRkX䙥J8?Kb*}骁B%Sʍ*}ȮM}ųT|>rEEӍahR\ƪ !$Bj]/Sx$j8߄02gIKHJ! ҏCz-;RJ:k.q*rϺ8mƣGL!l+z{{˝prx#`=u<]HiRC2RgR~;~ϡǹ..+\hrvf޿)Ut5;p=(!e1&V$32#_uyE|R0t޷f+=B^R[/E+mns<#e֮osѢ):@6).VVx:RezzF Gq+<}p%+S뵯吱fe2N >K(y灓`(*i&!C5k+&m]_#QF\ }47\n;b69ebr΢Hxk_иġmnj$f-T%r-bku PٗVUxtږx=+Oӝ4qf KYMʇNtR4x\ITX-m -y+}RN[{Mst+iTXWɘ(f_B9hHCkМ@\f |˚eqi)D-+vD*$WA$#N~gN?]@ퟎwRKYE9MSF(%е {]ͽlh24HyD0snR\ꟙdgiڋC|Ӊ{>E4!6 t &hFЙ4g@ rJ}gDD6@U)0<gv֡ʟwiuO lwܰ2:X?TrkǷh;8, $UJ{-QᅨHsjamdhn3W|Tǫ'!9_x&!EU55#J) ` ȨpAFahrKvh&-.ԇ<hR}D6ɩKIy,4A{ǨGJ `^86W֭δe 2֔1[}K'̧,cQ?n]({fr.Ԍm!>;࣯ `0H[_7_UcK1 Y6[\P~Ӣtf ]wT on0Rt׋(@}I?U<ˠ _.?BWJM=b[izRQ.tbf\`]JГVr Mf4y}-02J Ork.a ;_o5wQݟgp6eNd"bw|kfeM *?"jG ۉ9E7gv׽NT_I?Ok۸5(ŒFiEF:^B15YM<(B:H " 6QJC@Hh)4ft"s|Şٰ?[txb¢}:rTQl{]ia,K};1a 9j^}ԙ kίpy-T.NR1R~Bx< mmmtwnz˄Y&&mTTU\.ƦcLMM1>1Vդ^ ߓ4jӫ8D]G(ry W $' ~7{ bv̤PPs129/P^(rzrQӳ\yI O.߱Yaoc~)}nvllxǭ=64?egoPSffҗdǙoڴ K/zl4=?>|>m<؜miԪp@8Z@5P("¤t &`zƼ57'9a*1-hNڊ=zsݿWW]֏1Y (8~Qi0{[t\=vbJ~Vr9r0SSS IcpfY+[]?)]_(ڍu l "^-=`RWg4w~ :]K傲gX~vmp|P>Ri=\ʞKzlV*BbMm,,ѯ56]X-ޱԺj>~zOgRb:fzjX-0-/_ m.9=e/R1bG 7/,/-(ddPdgkfTRV 9;7J9-p]Xs_&wT4!^i TL%em=p{lr[7 K,3m 뚣+2Q A./ , C*|^MSSbˏlBu!:; ՅQU!,=twnMs%i_z/˖MH hHSDZ9]kئE3r1͗A|N//+NCA)_܄3$GFo&_Y{65-{:?"~yox@x[>{͗R,! ;0V0Ht~H`py_HIՅ[FbbG[[;J&RiO~44D[ozijjfvftzCͶmp7hkk#P(8އkwlJ9-v{e62ʕdś( шbG$R0DC^J^ق!"Dcno/*+xTh2TtXk &1赜+@׬jzyŢQ };ۯӧ>oWPmHpl4\zBiǺlxU{T+tJ]qyHzY>4M\.X{=몪TW޺;KR z)[0'/2K 22kжYߌ8,%5 $_!&' <'Fپ!jmų/\o}Qo wVnb RXՇG|3k1JEhnTrx,ʿ4wyWA\yiDm$&$QP6lWj{ViL}W/_t-CWS6L`,%Jl{kt|i4lKSj{c3)ee,뚟8 t@`IW 2&=MY!g߶NKJ0g4. gѭ@h$\VpK=/ M%**OIv~Ea-tmݒ\ ~YjW3˟ 镂MvP0L%/j&LcrU]HwQwQ|WSDH)7PF!mvAS/=@ع$ O[ۃǜټѣuw\uw .@J.=U!$?/`ͥ[TR΋Q} _ЕV?"-6D qq'Yew!KPؙgr=2-¼pF4'v0\Pf:]ѥǴH@1xwTHT/%?_ߋEͥ/ZW,]3_]G(W[^;^J2AlfQy4Ca(YvQTqJ}MYtF"Ze~5g/♷/xDm뭔?pehruay>?y',H]'83 M8GxN[웎zdn!!TR,b>Wɱ}l!,=79s= :mM[soyf%ͣ%h|Y(X $DLWT^:P9kzfg}Bu!.ݹ%kWDUW^]*N9dc<)qÒ|ɏ}e?~/~ mg2|iOɉ'xGRy?`BXzx/+bGg9u&Wd:%#=mh.b:bzV4o9MW)9=fWVQ~L~n>>ϗE 5&GgAy'O~tl FGs^3GJqˎR`9`Chϵ IGc]MNZݗ\p `bJ_lSd|*d}B^"lT(;(A者O5uȭ(n)?MG46جD#-qdK]H)9rb?4lp(;-'x122)%r:|ft祬[޶!)[q/ٔP#Yw^FZ@gn O$/giXb%vZ㊂@S/]P04O -#Z,Q%]BW {6rb5҅}DLOOzp8–[rouss}W\W3QN% ?^M ¼wɊ]D:Bn@TK n蹥+M IDATowxZe9>oI$^ P\"! \]FN.t6@Fj.L=D'illfM|™L<}E/&2lETzW}]_{ 4 vP4]&Λ/D 8 Q N|(cϖM[Q=~W./q¤e.BvSY-qҟ -Z#G9:zu̧rdEܺV֢l|g]O. ໿"hE[R8b5r0ݎ;иBá6'/Aȝ@KRɱ7H(:9ӤWn,-^J:ara^bI u'Onl-s;JSh =:#r&cuxbՀvgQMx9ĞWS ag¡T,+e^N E4Gt,k zz.ꂉ(򁄂BAkCd%2.8G (Ih|gVOp!8яdZ\,͟eYL$aJZ"|˅mxA.go e12j cw+ vwJ*o@S MmL<'U"hip2YY^yrGXZ[09^Ch˯BX E5̍Qr]יwn[9tB7ȉ (1ADT%3Ӓylxsje~fg\4͛p`f\$OXͰ~+lj z]B(z|#4#5YWd N)1({n518]*hԭ8 Pfi ʰ˳{< @ySZڤ ]=rLMM.$t]5YN,M.a`v|3&tA8ppYDgguM<.z &cu]ہO}fT*:?XpaŌ*K4&#[nKĉ[6j$ cbC2ZlsTWL5|bC5?۠ ]~&UYW)]:PIȪFtC]˥ ;e_ ,"TOL\x (?+8dϯ wSlh? MӐ |b'!)Hgf!(+D1d$<]Al7+&[qs'j/<0r];;lz-Fwazi=^ =*~*(6[WB4T9Ɍ?GAd ^}/ӊtNdWO L0(P ;T%s# iSt&1е"R ¡59%g\"\`"azMzUcwgn#bg3Ώ0ͭo`WkL-l=_ƺ8VZ )2$I%}~ A(^V`moY `AD 1)*  9a4@[ЕK g_@a5~0&ab}mh^zեθ0v#'εdCCCtHh4 6xZZ`ӦMw0 s}AZpB)[`ݺu^`'96]t:ѻx f]}hy- D^eSr c㳛0>2?C6oxІ( *ur^w\l+THh|9!SQ`HjזMN1wHKHiĥ4T߁"O;ATrV\ zҙQ{W /a|qF`!H|,kKsаӁc_N{wmԅ/䙧ԏ\tmw৿jWKş%L ҷ<%@g39 @oD6Q^S~0ܼ-k xW&o^Te>*W0:``U,.] 40I$l}aA73#nMb6v?!52l E"Eb[Pu  }kh_z(F$̇&> |@]X}K5MbP(}~i7]U.dxLJ/U ! #0 @B'!HUHrʄm[bʰP9m p@_*2 8~TՁrks5q hV .jkO&vqX@~=05vkWt~3`BU!e'{vUҬ( ֗k GUe?$3Rzqs$1\z陭rIdUl.-qևM7L0x@HUʵLXuTkyH\B\N7N3S߂a= :R@YenwzYalR_d2RCE<Ǯ#wˌ !T؈fшl!%.D+FhMJC Ky k!<ﯫt&P84477`XxB!EyS`!_x-B:"wCToSj>}XR"؈pyrU@a)d{vŞ˯'YӲkZ@QIJY?Be.(~ ؍Q$jۂfCB NN0i\ar ,~PG8e)ē'+,a(d)S7~EV0|mU_evv|_kn$Ib~@*@8xe<)r܈c88 eA|2 GE/g51oRxcAs?_bxVCsh0:SA#Q=`u€ɾ⛥û@{mƱ8|LN}0aPCAP%LWSF΃@8)rr"GˆEXG8`݈re-́]<e/jJ` L_& GA@ JBe|m@ YmrR$c( HgҘ(.^BmE -Ɠ&.:ФnxWbl/h @n)|nܵzMǚ7" ::mA/b@ `1AHc&1 # HY~ MgaP1 aSG BC"ȑ;(7m XUU*Յ;?K33*#=Zz-oA0Lus5#lكx7D >5"ʀ}75ه| ڊ{d yfR;a6PY|-`wȻ̺fslV% fxPY%0F :DnD_ HlyН$0qȦM\,40 Ҋp;̕#o g^\w93?H{v]{0==E PZ /C?CIc(dL! oHbekRc@OGn{b-!ú1Zp5`kHQw@٭eA.8 @Yc66j,%}bJTςm9 !j tt t~"+.z;mK&eDIY 6mSS z'=gA A`sAsMH}h9pI _*a .psj+$ᑇ?' iRZlU@R?@oxLEM.Ki‘,:\ l=xyoF0;vrt!Rޟ\d:JPffPf }XBk9.eP9N {}صs^y%qz"0쎏@&2߆ lqtb Q ,(G(4o$pA<ǑJ58d3Miz/Ħ/ԛ>y"k `&݁:3 0dhY!̏@]8^zLrK ~s! KPq f Q ::6Pč`FnCx``jusHhb/اнV7i φ'(h|gI6dscX*Դ#j0d`_VA#̽HVE[EQJkE/UUgt7.〩[ЭӰR0Z|,G:4 wao(IjeOg)!akn*3PEɭ 'Eu4'+k0@)-"L(8zP[[O?yix>qkl)b$d2'~YLB 7Fsgib J#Qb>c\_0 E)%o%E19/5ShOm»nԑ ֢]Għo8|9 .mdaa=+ WUW@>4A6V/$-@;,gԄiE J >_<˗{={qWjiPu_|P1Ti~Cɺ׷\dwdقQhbg {+̺C5'u F[Y;|w:H1 p݅~Ђ3.t7DĤ ~s+0n]w Đm}BK m뷴ƮX)v0)Ta\t<\5Ȁ$IE; 289\|C Mፉu-s@\hr}/(tKP.UⵑA ؞E3qܵV¦~qe]1}-jR^\OSV[q0gxGU-aWp_(>@ Z5n!~M BFJhhG!,^`,J+HqQm Abhڎ $IġA t6U{SxgV+jRܓ:?BSfy-VD;>̵ĺCӴ֠ʢTx+ivRS }g='ap* TETP LĬǴǴĔj3,>lƗZ&f 3KBP 1K3W`0@$$@|iOº8@u?U+FvCj\Ri@سNY?6@}{P , (0YAhy=i-[!@ 0tV+sH`$\~H ! }4|INe@56]Q> Բp@H:* IDAT\ dulfӿ?DP3ο[BQ ȇ‹/lI(v$p|j"P$S5γ+*Q&}r#ت8E|k)[e PkI N9:WBaGjOy6B4$9y9}R ad~)ܨFApbi~o}nA }s0 0Կ-wkss) ?|Nٮ 2H)9_"gnͽ S aPds`&h֛.ٵ q4u]ae! !L̫,HAz0)sxzJ(Cкkx݈8P" PPMn#&#څ_ |oe"'":t3 OF@%tK:H~P؍EV_WIPJi,wUvy8ˀ-*R9WdHy\6"Bu5e3u?6u4!04;*=P(!cr#:%f& ,KE)0? $sp/ F!{ajTC{# fxJTxn=%%ezQ 8+$ wcIf~HL> 9! |ZG,iW!zLO|Q|cS)0+=TUΞaYx6):e֤BHFU{-@nҋ # mÙΡXK2-"F tXk`WXjLm.#%C$h 8@[[b'U4%b\_cm=a&oΰ'hk?ˋu*)ABAJ Q@`LI0 `x`jș2U >/!-N:޿<p~K PY}-z 6c9GP -p)d2Nñ)6S͎HDLg ܳ +jzՀ WPKEBMЂ7t]A(&a 3+G3>2&ȵ>\ۣB(h$,csxqqc2SO_TWu0@U\J(]{q猆5 i Xg`+.>ō,?r>Y߲e3E33r`q+yft 7"t|mvLmkkT. Lj&Ϭ߅`Jtӗo)>@C\OC`jh.h[R@2@4RzvR F,Yv2đ"p5 81Ƌg&vsIe_&;1,*n$Dgf$R)'0WC?@Ԧe`|hiM@4i^MW\h.!wWy?5>vW trP:;qyg2UyP$+ raxNW^y¸ RzZpT9׭2NCz~+'Iɬ2H'p''vn #":֭ǹsvcQys)-~ 4E~s8t_#Aw8Nއl0D/5ϯz y-FpIwCF T?, 斟)"SjnMQfCnٲͣyѐ,4o^qo`,3)BV?ygܵXV2NXoV!I#ަ`7tnmm2 \Jq^0Y)ᥓ?t TW Pe7H;ƭc;ٯ#rm`?C,%qCxQ0;ڭA;NYɸoScB!'2 C*`!hЛ$©ꑀI9t$`Eq/YLyy!/{#[?91GHȩTQBܶiu'nsI/OEs?yw/[d-i:֫CU)o{ 冠̞皱:q;9﫸Քxl_|V.3"pVrP7J:: ) y"?Ĕ` '@UX.;)~B_-mG jnx[QB!hLͮ2~Zae~| ^6 _D<#P႘%8>k4j+<p_We*  yɀ, l^ə%މN #  FQh`ce= 8 Jj5cE+ :YW良ż:x_' :DNx])jlw tj0P(l6c!Uד3W;\Gx/K4冾N'uAj_B~iNVl5U"hAqtSxa€  rz `0EνPI#OR</_fg+P0PiJtdYYׯhx JGAYȊ)0h'c;XD$B}^4At&h,*ʌ>Gy\V>T+RbDQ^+wG'k=.?8A+ D S eWi(лp)(]QRjBsA0U/MpͧW 2=!TnRp-ֿ:<+F>{C"vumGpa RL\=x8.@ #HPe/0Is\[_qёoj1 s qW kR# SjhN{ǫysBr9x~{NzV;F&y]o_*Q1%E* H0MU?s_DSnX(4MC. bd>"x [ڏC }v XZa@i{nw*kB| ?%T|+SLKm[^a"$ׂCf ~ zo)FtUc~K-ݮ`&㭐4 ablbg2{_+y(\EPwq ;0W*M a*@t#R.e燫l Sz~Nt G%Pv[rŁN^r=Klx,g>_ADC N,@'WKNyØtFU P֫T Y|p Y-._\ Ym.@)_pj#yhQ7u D<8͕P:U;zfZj գdRo<i(" /KWzz]A&%!90؈t3 xW@ r?g1 p, {~W_{SLrܹ̿W奢sƅGak@LNl铞%>(,kͫ'vkK5-ᰗr8~ B(o 0?% 8ѧ!\BYU B}i`›lC)ű`W;uȫJxs;k zk֑B(ӫeu[z !XܳOc8}L kP \zСHJ.@G$b 3܅>vH&S媪cY(2("Lq-?9hmB2iCW!-bW \Gn@9%ӸBa&A {;"؛"`k뻸tZ-ȪjM_ CT(uj5Hp,+w}}xY~q; a( u(+,u5?;g6.~@ĀQ49's_42466qbzz֭BC \#wbD{h[GBru ʒMMVf6zok, y?)o+(Pw}nۿ_$>We|cm;l2h_b4D"/_Gnr9$ njk3#x[XJ/vMK+n{3MHe ,c͚Vlڸ {Q˶2+4tq&\Y7''N.b_¸tӦ.H$Fd lip<(ɔ.,*KD^5 E  Qa-D0::g{ss.>hm][o;@,ȰXkmjl~ٳk* ?;,Oga|"L٬BMӡ2LM+ 'kȆ }V֙$T:FFGs##59оPr=, CQd(RN\O>#s? { ._Đm;\v+JJ J$2nنiq_|#2)V_[ՓmFW| 'Gצ.D`-O4u,.rbcqqz΁To7 .\_~ժtlܰ;.#AY$1ٳܵ'4&ؾ٣GO̻/@VO<*Kxʤ~ NNihԡi: C/G0P(f$ cq(Ee ]GPf199\>[EiiCvȲRr^)ׄbtBp@G8qøx?t# GjnojĺHT*O>8b8(_B~l\c||CU|(b=ؾmB5B._ɓyfNצ\lK ( (x;x~x|x|DM x%vC7Uxظ|OuB,n@׍⿭a囮XX\?!H&h_,v_.ZH:ub˖hmm20 LNN.]I,*mنx<Yp8T6@nW`tyic`#ٟՕJu ĕ 7_6‘y ,W-Tk6 k=TÒ"+#L! YBn৒ ع -k\m= @ӴrEQXiAs24&&=&L>.{$g9Ǯ,6}D1rS1a岎D4WdD ap }q &=R;Yi184ӧO7^Å03;S3Ԍm[# @)ʤ(;(ۖk  X[+kr;R|omxm!B׵;ai-N`hd"[f FC!(Yu]i󘙝6nCXDDH@Vp8u1_EG<'|rwդoD߹sp׽w=!‡/TU_2-g}˲fUXꗬ@) C)NJÑe5OE HT#ֶEss+bXƹ;W7]͖3 I^I Cc0hq&WW v7vC3fm lدKXVwC,C0ib)d%Lcbr㘚,wTUEt߄`0d>쑒DQl܈z<!m>[А,!v% _(ȃƟz3HЦB=~_THʉ%/݋b^D#QcI ( ܋-L,YZ'Ԃ5mH%D|&ܒK T[Vԍ C/*-R>6n¥KP(8db$_H4yoz]6rX1A+ Ze LP2ot=p(Xщh4ZN*(YIpA]֏ й=y@-6>yGlO;. _K$~;;vv9-At?PF17 0LPj4RPs.ێ.MZE[֖Qlbٷ%YoIHN%P3?υNп]XmL1=v|9B@|@)㸂N"a(hbiipM>Pѐj,quE Z|@Iֿp(?mv/X~ᶭp;8J)U/b*W,%ǜF%|I hC{uI3eYKJ0VёwHR\>)P: U"am >g9/.%@YY}@HͩO D,I#H$HēO#EJAYАjD[k;Z[%X} :떔\Yϗv`z,2 m|} 0hx%)$)DQjE-)" # #K ͍-hnZD"H8@+n7dJ" ؐj(@צ?숥3҆*ksUKO*6d7 V4$wbhxssN9./D7gF>я󹺊sJnC ZƤT[B %Rr 7dǔ)^̍DK{\o>pRdHĚCM+{[[݊QAClܸ񡾾>N>B}أB> ݴ;vt4Ŧr# dy7¸o24 ]r)xisEl0пɮO{GI`sVNz$I+.[}'m'}ݷ/`#?iޠO^3A?/r3]F B;эyӭ4q-RD@NhV bmk%LB%K0@}eYAWm&5?a o.E]sa~_bIA?i bChTU18~8^{}~1M? )z!'L{jk^r*$ 8w'mVO8n6405\ vo#~Lv_w=z$:KJexcV۪݆e4f7 hnl<ˀdgF ,?X\@Ҽp0uvj.JeB\E-,+ N䄖\˿pu>~aVx!.,//C>\ 0eh@%d4#\]@_hBͷNq*I?cOҊgt3Jo_I_L)PU #@"bzڳNs(m{1|/aMܼw!n/{οmb5 Ed|+E_`0_.Kz2 ԿJ3SOYXXl*'+p .,mBC#LpO{v()ed3_:t>|6(d=}b_@FGFסZPhnpggg4k߇ >CWu:HnGY(5>&Igj_o/ˌ.uC^7?A`Ы/OOKK`Y&J%Iglq>d WE1 =:w#4|.]AHK=~*.tkPoYSmZqr sss~]KrB$$ S"KM3Q @jO,1KN{nϦI=00[ƶ#P U.}YnhhFGIVRя)c;ŃTWb4)t'Actj8L GX7pbAgI?kp }ӟo;Χ8+ 0,W;TdBΜhM;Pd1pgEab-7]ɗ#Hm>*M]W6 (I\wH@`g*t{C`G'{Mc@Ox!uLOOE9Y"@)ڭU f!ZH.G lD A$l D]?]Gc #7p#<~qvid)/cyJer;bv|0 ' M+.=D}WzH4ItTUۡUoOeY@oOh l\`P+|˖-7 Zq8~ \]ׄ~u;TiFMp J@fD<4z֌Ɩ;O-jO$U[m@6o܁zv܅ 74{4A4ey:bȎ> {'˞= ?-,$:@naƋtUMHF,//~ Iu Pt-/7 F;x_,`dxg Hbrld>K+E3 ]ɍqY( 3v؉nQg}syIwf"O ʍDJKʇ}+X"*G e5oi+a!h=57`&@Vu++@pE;wOE`z IEn6TR,@Uuؿo?di}+[o㺀& ;8sLVyb * +>-`(|`d8D}eAfBns z?gBvQms% vl!Z$1J33>au"x™0A c,˪tuكghU֮ŠyUj]G9}?;;jTU+O%H@ Y ߓ 30M u9)){{{P[ruZ +9ufեah!,ixp=N, zcm:ry@+|SvRN>[0bM'8H/VA&]=|>iiZ`Y^LǠx!'5ۗ]߮RЋ|Ǝ;u I9T*ͱzHfbZ @+Guo䏃'IrK=XaӟJa* YRjjSިp)!j ` = )yRV.& 0 ~@}ŏoؓ@O5lg H,mfd&XC2B?$y^M)C`qkhԛp$l7R3;SΜtvvt$ ୷-cć4iA;͍*b a6@#B :݈uJ%~…0MkT_ZObAc;ObYޑen@& [x7@V N S*S9XeaajZs'48 zr(C1AY@GG! 0Mj5OS`\!d?)࿧b Y<7B82;)^/VX bc,$8d, Gbg/d+bwu2`LF" @`bb2g$fb-`u0lB@@w7Ҋ&:,`RUGR^dHg OO{}&cPa-Z+8 t  cS!R&o9aY,,,y#3j:c[ ҲD@)\JGQdd`YH00dl,dҷHYnAor*=M㨫VJ;Fq1`p@]uO>SqʅnsY4X֮xpT;~˰#/?~M{ &hӐ9碏wpщi]OJ",//5gELNdo_b+ָy0M _Gv>f?}chvOXo&py&3plթ*Mw 57Mmn|hI +D3 +!hqggv 0z3#PE(pw87_Wt G&2AMNā_Lq̐$&&? : &+?Uz\B %LPAD[T=aّMDJuYbL#hP?~*c-&!bDW(ta[ j5r,.|=8cO* _? ,4-X\\<"mcA0)6BcǏg$ZAXT*t{AgT7-]]I3 N1Dc/6*C뉖1LJIDATEIBDe ,#@"w&uM3@0VPp… ~ׂhXqVR*T\`\/!H_CZHvuٔ6 Vqϥ`|>{F2/!uJ37d40??xFgoIL VG(HIxL佷T%b6`zDR@NNc=>)tU`҈Qc쏕=-8HDžDicBbycI HŲ1g4Kdtjt!=ˢc|z`.1 R۾ѰZFRO1%NX3 Z,B|b)x+G<ߞœxZeeڝKgr ZAZi  $k3@Ft W b򏮍VץBӀZ͌ԇbfEO\H{סּ7-2[Rf7#?$_x/xBz>]2mJRmrH ,Gw⇥z277l Rt_|!M2ĻXwgZcݤqߙ^k~@VjCXPl ʈ.>5;{*=*ULRۺ(7@,tq '甴(ܷvVk5ڵIӌPks8C$p2"&"F hA A,@7$FʞcAmH#ୃ*ʴXRt|73Q!iJxk4`\aLĽA%ly΂4FooWV bkv,V^r̀iA HpE4V_εX,E&UĈJM:cc.<>U.h~(F&5q`9d bRs.4"9t["C>X\rϭgUd @@L3ASfGiJ&n "BW싩@ӲG1qvLuvx kiKCkO|806%XqneSk8w~eoF5\@+C]ұ@uM!-,`k!u>_ ui֡RD>/i>P\{G_zZNf3̔פ<9Iq/يtrj\81Pnpp%>^Y]i뙶``yyQM{G]֌A8P$"ҝN:::sa7Y@XL/6sȄHΪ$n.U0 #ãf`NSǏWu^N=t^8Bs!EJ7=]8-Ft6q|>v`K*7mB!.4pI8l20&偐Y.03; ۶Fgz^xmjEm@|e'hmHp^t}+w,%aHu‹$Z-(Qpļ8-@FomH XXdk,JrZU~ʅg2طo_$ XzGӰoUv)t H_W>yn>])Jb-}$Vҹi\¸1|9q|wgl-DWpuu1%o >ډid@;Vߍx>>`40&H4wxG=*D.F+QeE|G:h,h tq h!d5}๮nضz*sYL,[:*Hw u~ľ0?54##A5 2Aƃ}6X :s`?G}=' Pʯ71m߱%Il TT,2m@4vdQ`!qVb̊Gt&EHߎ=. grH4(;3OԿ#M A0`D 9dus]u~:]Kw/rsV̰0%?n]lhMӰ~ᔟ\XUyW̙/1r?ϏRvs۱ KY.@ |ܰ@U5 #דVO\%~|L*=r{ k!GmRLƀAUt n `rXc>&5b j~?J<y4AM\=ac|~<VD/8UzQaϲBOi^B_oMؼ뢀aڇ8{OA^|suj$IK$7GM \B k\:p~~k d ~ a+Rg$fxG`_˲I< 4]ߏ]/7<%$zBvvei‹q`^MJxex .ߗ^CрOxP2&XAutt?7u]6!(J@3C9y-5}F̯&d2Y0 gDZkl=qz_g78LݔFVyb(\bZ«q/cb3=ݔ {oo oLI[|W4Gv,/-Ɵ˫U_ew $%j=ȫ ;o{,˂ 2>##RVT(v+a(ٚlrEӴ_>‰);oP>?][ZY~ҝ*ҍ /7-CZE+̷h7ŘW*8yu8|q믡A,..oW)o 2V||٥ދ7fY:uz{zT*d ͂adTPdYEcA6LCB}]JPV (_od`yrd"(bj?y-x;" nz"l߾wWrUI4-.!es…!R"_[W4.Lfg'aܤ`<;nCJOC+GVPg߾c?q=puk/wvؠ80}ay/>˶75.u]J5EeY_|3dZg+%0:<=f!cd#H"᤬@#ض Z W`ff&ΞTh<ѿ|e~Co)1 ~wm.d28xÍk.dW*7FKK‹/[6w]+_$,Rz^wq}Pӵv/ad 2,Fgg@e/[@w8 -v džZ̈́jի4M-˃o}o~sS+c?x\c@O}.'s,\uհs.`J47\W_=O㦧۟=*d0 RB(B!sGV6 Yk O?y<ӧ`X~mD@en(Gn~WkYsIThpvvwpc]iu](0wq&&&`YtSzW?Pr"h)G+c{7uöŹٹG~_|qZ}A]W0h z{zaddJN(t C6]@ok46U=ݜ-m+pq"LOOArşرss["YH[nruwu22$Z2͓Μxg?eL6OZ"1B0 wmIE.,7bvi)ih4'O?oxkAeHTb_a 4C/ۑ/52:*+z|R=yafÏ?":eC>HZqib cka||x>tЇdy@~m{ۇ‰Opwn+(;z"+E4YQr3-D!HqpeqF5톽f۶9?7?k'&_Ut': :&3#?{m[s$ɛ꜖}'O~f @h/@?~L1: -Z lV|vD]ۻ|}ٽ oy4c֬WVVy̙g~_ZnĸiA 5I,Rk]ff 4L@C ޽xO*[ ̒ r<+rRڟndmw_bJ. rϧ*H-:A?!?Kŭ+蚊*/[؉Ð&I&_$%g&$LNgJ  }A .Jx_kj ~\vROKSz?u^~f{bxuwiL 32>gplYfǓH)KARH'\ز) v}}4ӻu EԹpiK[ҟϷ,  D,Gg8qz91͍8h~wo6jpH-hƇ׀FS4L6nh9D}Ѝ8~Uߪ8_:_CYRJ9&f;3͑LMO5KཿLm︻4eAzkt5KzظZ )Z|)/LgܡAǘO)=oFd ^O*'5YzU7]M4}(BN_8 7LI&W$3d&Aa!x7$aThT4E\.t]W鷪*`  AN 8;fpLH'ݙ~x6Bkp(~}}W\-]6^T`$tdH2[ _4+ly[{k Х)ANз[ǥUd: xC#൦תmS7WUdu˺HM䉥Ēyҹ" فX D -Wex\*HE8Χ/_6(( L&yA9pBFp I^??)yj&ܹoY߮lX,<)v*~/W(pel]9 jV\ZR.!!AX#,c<GOe||5f@*Dm4`CBǬa]c4̍rRnDљ 4((iuuB<.-E"ݎ)U `QݺJsKk:7yټ3<#85aRCuwIؽھMnnnl[ U_csf 沢 qBq(X (}kkk+åPqdlf#{Hf[_VGVP_~lB몠K[hȃא@B{GO ~c5?%j~~scۮMmhRF+6g04bh2E:_\ +W0.m2Hf73RzQ=L8^<"PwGQfuJ6`dr&b(ޕQjlTAJ{&Y!/~TֻBй~uu~qn޴]\XXs'LgvtR~~DU2$Va`Bd EU%E/_XFIH)1MIИ`"TH*3XO[_碳1@{o)h Sr,>"cNu'*X0\F\uEkC+unnۇץQL $ƓdseݑE96ٽuvʾ_T| YRJ $gb c7R4-sHy ]*~zu>T@ɝ1y8>U׫˧{"C TmMSxY,l_@:[tcuZ Odt_hI7x(&ۈ"tf@) k'6N*`b8VJIW,7!,гq[gKVCyM)24£-=lCkC[ LLVDM!>X{؉" )]{;Zѡ 9 \/p>I<>B-u߮$>@4!341p/y o_:!sWa|l@l/?_Oo(ZA`٪*c mZuKۊE4 u M+{;CX(: ޔ?5X~ xXǥ3:)c!s| .Dӿ v nʶtÓ/́m7gC\H~S"!kwwV-Gȅ,}E=φƿXT~3A2H2ԛI6T砲G?Cl0j#0.!9噁r`\1ȩRO9__1+v`, SޥqP~vEoF9qfBDj;|să\'R?rɚ_ŵm@l0XfY~xGTDy5t?˩1'3- &`4`FGQ5* BG zCEF R- gEpRjt`Yr!7:{=~|c4zn(0tVtԱ!0X1oAe<튣)٥9 Jd (kHPwvhN ϐq^|ܱ5)ou t4]϶ M xECZ- % , 2a߳L $\Vv>AC$jmߤ>!xU͓G(O`)i {Dn6mhgx*I,؊,,|w]ϟxhbӜE%`m+N(/zZ~; 䩣Sͤa1R,]'orI֖Dv)1= !!#46'SXבo9N1~i9<]VYՀEF!SK\Lf|#j-r鷬<'n!~n f}$3mg"Iʌn?wcnpXʊg9:2Pa$ۑB"?YS4Gs-Ѱ1rxlf]ZO LvfD%鯖U(s|7}^Roe2nk,bRgi#~+L"[Jp' %틁d٫0H qț[䚔i\Zm'`abFYK!n'n#i#n#m0Uc[cߖfB CP<;pZQEU;>^s^OY{kZ"!cz>#/1Ç^Ѻ?T|+EGW+xJ3;\),AtT~Ztٔ>+)FF3*?ESSUӀ+go&c81'o%\+HMB'9b*iLF+Ph ` Y'!V~.E)q1f}m :A=U$Z)坡9!~鳮F~=RpYi΂OġIil7\z2P]Z t5|ii:az93a@!H{KtIMC:hF ۂhJVR4nE(һ~\ F`O_Fl&m܄I/3/)HFۣ_P#c[iZԠ`df/GGޱ1rŀՈ0sZgIByrĔ Gz{K:t _lb4&먲Pe:gL"NkkױgOsbtRij8\Z:0m;XBMH #H:Y?WlT7:}(,|&HZЕXR\DXV(: RX{e £[( ;bW/:\f%X. ߏ AmM?(*,iL.!;͆|CLDՄ $[LsmA8Je>g.=극ٴcu-vGʡ5x͟x;> j gb~ ,ffY:K%219=Rmg#'(o;d^,;ZFʅsQ=M;d|; x 'JLHe &sGKEsBBczg-R6=oU^OgKV/'G&L. e󎲧랯2AeY1OLۢpU~؁=(@:&ӿ ҽ],׷*{vTT[-Rś͑gٹ lQ+4]<{#&N  =DGhkxrzN=Dk(8-Kh/M/ Q)lh )-<;ȅ]ʅ۝>w"؋v4zGػ3x\0KcJ2׼ jБ WO`fY~;,hhnQJX\q P1믴%K@ֹq|]KؖBszv3+3I|CKK&-Eii84iUr/.p:4ͯg-5XpLvåxܡ3s~򏱧sms/ |'~l>\i; :w1eVufuzez1OI*:1.R+mS`q ڕ1"*0`є+C҆k9&s\`frQfUfO癶|\繨%<;غ}t&'2'ix׭rNC`|u4j["IK. {;3S3A{?K0]ӓ"kMCJQ 6w~wݽc&c#o#]y1a-Quzuzu-+;E(E!%f ɦ2@e"PR\.'s9{q+єƯ=@-QtBT~mMScd}] {;I[P<"YZ싐;1L^sytx94t蓣qnnG IDAT7DSʙ?>y!م9_Q'5EހG׬eKE+ Lqy;$إy+B`(q5e "z)z]iRQ*^&dPq둨V^|XJ+',osjӭ0K4hڑAߠv߶2¶#w28y!L> sV`9:rmicMA!(6YTw1'JKKE<Š<˸sO#Œyn~q+[x@sEƮb [݇hƪt>-2trNq+{3l#NC0o t@"-,ĥD㤋7Yٓ\Ũ4^)2=eLdY!@bs|mhj-:ZXrm5֮/Z(*/N:Y%fh<}t G!|[S!69ϼm/ 'G"`"Zw\t>JS Ѻ\Ko][ MԑI[֮olb|׼VhqMqkav$Ⴒ\Qlوn;EWDPTRQ^DKѾqAQ%PXAi6ypRU{5B>7]z"5vKE;пawhgw޼M뛩9<(ESZ3$ڿvbN*ׄ)U 3|?fq dR`5ڍذEWlEM m==(.7Hے{H B|a,&N#A(1d#xۙt(aufM/o5-~(>cNME^iqiIv\h]Wz H\BSc :o<; oH@تw5qM;l+H 'Y4ak5PI4tu͏L/6P~/D VtuA@kmAP^Ò+ES. M< b42̨\O->ƭeRkIxp/U 2MƸ~ nW: Bldri?b 0 )D-(8;9h;G8![ 8&{?͞x(o>)*3៾evdp#\9t5[־6E1$- kFJVkE+S|B>UVP)m@6 =hY/*~LR$6iGWN)'[`е40uZ#Q:A'Bֵ*Cb.ҹFl0%_Ehsx`!+ }U\wۧ-oRkX䙥J8?Kb*}骁B%Sʍ*}ȮM}ųT|>rEEӍahR\ƪ !$Bj]/Sx$j8߄02gIKHJ! ҏCz-;RJ:k.q*rϺ8mƣGL!l+z{{˝prx#`=u<]HiRC2RgR~;~ϡǹ..+\hrvf޿)Ut5;p=(!e1&V$32#_uyE|R0t޷f+=B^R[/E+mns<#e֮osѢ):@6).VVx:RezzF Gq+<}p%+S뵯吱fe2N >K(y灓`(*i&!C5k+&m]_#QF\ }47\n;b69ebr΢Hxk_иġmnj$f-T%r-bku PٗVUxtږx=+Oӝ4qf KYMʇNtR4x\ITX-m -y+}RN[{Mst+iTXWɘ(f_B9hHCkМ@\f |˚eqi)D-+vD*$WA$#N~gN?]@ퟎwRKYE9MSF(%е {]ͽlh24HyD0snR\ꟙdgiڋC|Ӊ{>E4!6 t &hFЙ4g@ rJ}gDD6@U)0<gv֡ʟwiuO lwܰ2:X?TrkǷh;8, $UJ{-QᅨHsjamdhn3W|Tǫ'!9_x&!EU55#J) ` ȨpAFahrKvh&-.ԇ<hR}D6ɩKIy,4A{ǨGJ `^86W֭δe 2֔1[}K'̧,cQ?n]({fr.Ԍm!>;࣯ `0H[_7_UcK1 Y6[\P~Ӣtf ]wT on0Rt׋(@}I?U<ˠ _.?BWJM=b[izRQ.tbf\`]JГVr Mf4y}-02J Ork.a ;_o5wQݟgp6eNd"bw|kfeM *?"jG ۉ9E7gv׽NT_I?Ok۸5(ŒFiEF:^B15YM<(B:H " 6QJC@Hh)4ft"s|Şٰ?[txb¢}:rTQl{]ia,K};1a 9j^}ԙ kίpy-T.NR1R~Bx< mmmtwnz˄Y&&mTTU\.ƦcLMM1>1Vդ^ ߓ4jӫ8D]G(ry W $' ~7{ bv̤PPs129/P^(rzrQӳ\yI O.߱Yaoc~)}nvllxǭ=64?egoPSffҗdǙoڴ K/zl4=?>|>m<؜miԪp@8Z@5P("¤t &`zƼ57'9a*1-hNڊ=zsݿWW]֏1Y (8~Qi0{[t\=vbJ~Vr9r0SSS IcpfY+[]?)]_(ڍu l "^-=`RWg4w~ :]K傲gX~vmp|P>Ri=\ʞKzlV*BbMm,,ѯ56]X-ޱԺj>~zOgRb:fzjX-0-/_ m.9=e/R1bG 7/,/-(ddPdgkfTRV 9;7J9-p]Xs_&wT4!^i TL%em=p{lr[7 K,3m 뚣+2Q A./ , C*|^MSSbˏlBu!:; ՅQU!,=twnMs%i_z/˖MH hHSDZ9]kئE3r1͗A|N//+NCA)_܄3$GFo&_Y{65-{:?"~yox@x[>{͗R,! ;0V0Ht~H`py_HIՅ[FbbG[[;J&RiO~44D[ozijjfvftzCͶmp7hkk#P(8އkwlJ9-v{e62ʕdś( шbG$R0DC^J^ق!"Dcno/*+xTh2TtXk &1赜+@׬jzyŢQ };ۯӧ>oWPmHpl4\zBiǺlxU{T+tJ]qyHzY>4M\.X{=몪TW޺;KR z)[0'/2K 22kжYߌ8,%5 $_!&' <'Fپ!jmų/\o}Qo wVnb RXՇG|3k1JEhnTrx,ʿ4wyWA\yiDm$&$QP6lWj{ViL}W/_t-CWS6L`,%Jl{kt|i4lKSj{c3)ee,뚟8 t@`IW 2&=MY!g߶NKJ0g4. gѭ@h$\VpK=/ M%**OIv~Ea-tmݒ\ ~YjW3˟ 镂MvP0L%/j&LcrU]HwQwQ|WSDH)7PF!mvAS/=@ع$ O[ۃǜټѣuw\uw .@J.=U!$?/`ͥ[TR΋Q} _ЕV?"-6D qq'Yew!KPؙgr=2-¼pF4'v0\Pf:]ѥǴH@1xwTHT/%?_ߋEͥ/ZW,]3_]G(W[^;^J2AlfQy4Ca(YvQTqJ}MYtF"Ze~5g/♷/xDm뭔?pehruay>?y',H]'83 M8GxN[웎zdn!!TR,b>Wɱ}l!,=79s= :mM[soyf%ͣ%h|Y(X $DLWT^:P9kzfg}Bu!.ݹ%kWDUW^]*N9dc<)qÒ|ɏ}e?~/~ mg2|iOɉ'xGRy?`BXzx/+bGg9u&Wd:%#=mh.b:bzV4o9MW)9=fWVQ~L~n>>ϗE 5&GgAy'O~tl FGs^3GJqˎR`9`Chϵ IGc]MNZݗ\p `bJ_lSd|*d}B^"lT(;(A者O5uȭ(n)?MG46جD#-qdK]H)9rb?4lp(;-'x122)%r:|ft祬[޶!)[q/ٔP#Yw^FZ@gn O$/giXb%vZ㊂@S/]P04O -#Z,Q%]BW {6rb5҅}DLOOzp8–[rouss}W\W3QN% ?^M ¼wɊ]D:Bn@TK n蹥+M IDATowxZe9>oI$^ P\"! \]FN.t6@Fj.L=D'illfM|™L<}E/&2lETzW}]_{ 4 vP4]&Λ/D 8 Q N|(cϖM[Q=~W./q¤e.BvSY-qҟ -Z#G9:zu̧rdEܺV֢l|g]O. ໿"hE[R8b5r0ݎ;иBá6'/Aȝ@KRɱ7H(:9ӤWn,-^J:ara^bI u'Onl-s;JSh =:#r&cuxbՀvgQMx9ĞWS ag¡T,+e^N E4Gt,k zz.ꂉ(򁄂BAkCd%2.8G (Ih|gVOp!8яdZ\,͟eYL$aJZ"|˅mxA.go e12j cw+ vwJ*o@S MmL<'U"hip2YY^yrGXZ[09^Ch˯BX E5̍Qr]יwn[9tB7ȉ (1ADT%3Ӓylxsje~fg\4͛p`f\$OXͰ~+lj z]B(z|#4#5YWd N)1({n518]*hԭ8 Pfi ʰ˳{< @ySZڤ ]=rLMM.$t]5YN,M.a`v|3&tA8ppYDgguM<.z &cu]ہO}fT*:?XpaŌ*K4&#[nKĉ[6j$ cbC2ZlsTWL5|bC5?۠ ]~&UYW)]:PIȪFtC]˥ ;e_ ,"TOL\x (?+8dϯ wSlh? MӐ |b'!)Hgf!(+D1d$<]Al7+&[qs'j/<0r];;lz-Fwazi=^ =*~*(6[WB4T9Ɍ?GAd ^}/ӊtNdWO L0(P ;T%s# iSt&1е"R ¡59%g\"\`"azMzUcwgn#bg3Ώ0ͭo`WkL-l=_ƺ8VZ )2$I%}~ A(^V`moY `AD 1)*  9a4@[ЕK g_@a5~0&ab}mh^zեθ0v#'εdCCCtHh4 6xZZ`ӦMw0 s}AZpB)[`ݺu^`'96]t:ѻx f]}hy- D^eSr c㳛0>2?C6oxІ( *ur^w\l+THh|9!SQ`HjזMN1wHKHiĥ4T߁"O;ATrV\ zҙQ{W /a|qF`!H|,kKsаӁc_N{wmԅ/䙧ԏ\tmw৿jWKş%L ҷ<%@g39 @oD6Q^S~0ܼ-k xW&o^Te>*W0:``U,.] 40I$l}aA73#nMb6v?!52l E"Eb[Pu  }kh_z(F$̇&> |@]X}K5MbP(}~i7]U.dxLJ/U ! #0 @B'!HUHrʄm[bʰP9m p@_*2 8~TՁrks5q hV .jkO&vqX@~=05vkWt~3`BU!e'{vUҬ( ֗k GUe?$3Rzqs$1\z陭rIdUl.-qևM7L0x@HUʵLXuTkyH\B\N7N3S߂a= :R@YenwzYalR_d2RCE<Ǯ#wˌ !T؈fшl!%.D+FhMJC Ky k!<ﯫt&P84477`XxB!EyS`!_x-B:"wCToSj>}XR"؈pyrU@a)d{vŞ˯'YӲkZ@QIJY?Be.(~ ؍Q$jۂfCB NN0i\ar ,~PG8e)ē'+,a(d)S7~EV0|mU_evv|_kn$Ib~@*@8xe<)r܈c88 eA|2 GE/g51oRxcAs?_bxVCsh0:SA#Q=`u€ɾ⛥û@{mƱ8|LN}0aPCAP%LWSF΃@8)rr"GˆEXG8`݈re-́]<e/jJ` L_& GA@ JBe|m@ YmrR$c( HgҘ(.^BmE -Ɠ&.:ФnxWbl/h @n)|nܵzMǚ7" ::mA/b@ `1AHc&1 # HY~ MgaP1 aSG BC"ȑ;(7m XUU*Յ;?K33*#=Zz-oA0Lus5#lكx7D >5"ʀ}75ه| ڊ{d yfR;a6PY|-`wȻ̺fslV% fxPY%0F :DnD_ HlyН$0qȦM\,40 Ҋp;̕#o g^\w93?H{v]{0==E PZ /C?CIc(dL! oHbekRc@OGn{b-!ú1Zp5`kHQw@٭eA.8 @Yc66j,%}bJTςm9 !j tt t~"+.z;mK&eDIY 6mSS z'=gA A`sAsMH}h9pI _*a .psj+$ᑇ?' iRZlU@R?@oxLEM.Ki‘,:\ l=xyoF0;vrt!Rޟ\d:JPffPf }XBk9.eP9N {}صs^y%qz"0쎏@&2߆ lqtb Q ,(G(4o$pA<ǑJ58d3Miz/Ħ/ԛ>y"k `&݁:3 0dhY!̏@]8^zLrK ~s! KPq f Q ::6Pč`FnCx``jusHhb/اнV7i φ'(h|gI6dscX*Դ#j0d`_VA#̽HVE[EQJkE/UUgt7.〩[ЭӰR0Z|,G:4 wao(IjeOg)!akn*3PEɭ 'Eu4'+k0@)-"L(8zP[[O?yix>qkl)b$d2'~YLB 7Fsgib J#Qb>c\_0 E)%o%E19/5ShOm»nԑ ֢]Għo8|9 .mdaa=+ WUW@>4A6V/$-@;,gԄiE J >_<˗{={qWjiPu_|P1Ti~Cɺ׷\dwdقQhbg {+̺C5'u F[Y;|w:H1 p݅~Ђ3.t7DĤ ~s+0n]w Đm}BK m뷴ƮX)v0)Ta\t<\5Ȁ$IE; 289\|C Mፉu-s@\hr}/(tKP.UⵑA ؞E3qܵV¦~qe]1}-jR^\OSV[q0gxGU-aWp_(>@ Z5n!~M BFJhhG!,^`,J+HqQm Abhڎ $IġA t6U{SxgV+jRܓ:?BSfy-VD;>̵ĺCӴ֠ʢTx+ivRS }g='ap* TETP LĬǴǴĔj3,>lƗZ&f 3KBP 1K3W`0@$$@|iOº8@u?U+FvCj\Ri@سNY?6@}{P , (0YAhy=i-[!@ 0tV+sH`$\~H ! }4|INe@56]Q> Բp@H:* IDAT\ dulfӿ?DP3ο[BQ ȇ‹/lI(v$p|j"P$S5γ+*Q&}r#ت8E|k)[e PkI N9:WBaGjOy6B4$9y9}R ad~)ܨFApbi~o}nA }s0 0Կ-wkss) ?|Nٮ 2H)9_"gnͽ S aPds`&h֛.ٵ q4u]ae! !L̫,HAz0)sxzJ(Cкkx݈8P" PPMn#&#څ_ |oe"'":t3 OF@%tK:H~P؍EV_WIPJi,wUvy8ˀ-*R9WdHy\6"Bu5e3u?6u4!04;*=P(!cr#:%f& ,KE)0? $sp/ F!{ajTC{# fxJTxn=%%ezQ 8+$ wcIf~HL> 9! |ZG,iW!zLO|Q|cS)0+=TUΞaYx6):e֤BHFU{-@nҋ # mÙΡXK2-"F tXk`WXjLm.#%C$h 8@[[b'U4%b\_cm=a&oΰ'hk?ˋu*)ABAJ Q@`LI0 `x`jș2U >/!-N:޿<p~K PY}-z 6c9GP -p)d2Nñ)6S͎HDLg ܳ +jzՀ WPKEBMЂ7t]A(&a 3+G3>2&ȵ>\ۣB(h$,csxqqc2SO_TWu0@U\J(]{q猆5 i Xg`+.>ō,?r>Y߲e3E33r`q+yft 7"t|mvLmkkT. Lj&Ϭ߅`Jtӗo)>@C\OC`jh.h[R@2@4RzvR F,Yv2đ"p5 81Ƌg&vsIe_&;1,*n$Dgf$R)'0WC?@Ԧe`|hiM@4i^MW\h.!wWy?5>vW trP:;qyg2UyP$+ raxNW^y¸ RzZpT9׭2NCz~+'Iɬ2H'p''vn #":֭ǹsvcQys)-~ 4E~s8t_#Aw8Nއl0D/5ϯz y-FpIwCF T?, 斟)"SjnMQfCnٲͣyѐ,4o^qo`,3)BV?ygܵXV2NXoV!I#ަ`7tnmm2 \Jq^0Y)ᥓ?t TW Pe7H;ƭc;ٯ#rm`?C,%qCxQ0;ڭA;NYɸoScB!'2 C*`!hЛ$©ꑀI9t$`Eq/YLyy!/{#[?91GHȩTQBܶiu'nsI/OEs?yw/[d-i:֫CU)o{ 冠̞皱:q;9﫸Քxl_|V.3"pVrP7J:: ) y"?Ĕ` '@UX.;)~B_-mG jnx[QB!hLͮ2~Zae~| ^6 _D<#P႘%8>k4j+<p_We*  yɀ, l^ə%މN #  FQh`ce= 8 Jj5cE+ :YW良ż:x_' :DNx])jlw tj0P(l6c!Uד3W;\Gx/K4冾N'uAj_B~iNVl5U"hAqtSxa€  rz `0EνPI#OR</_fg+P0PiJtdYYׯhx JGAYȊ)0h'c;XD$B}^4At&h,*ʌ>Gy\V>T+RbDQ^+wG'k=.?8A+ D S eWi(лp)(]QRjBsA0U/MpͧW 2=!TnRp-ֿ:<+F>{C"vumGpa RL\=x8.@ #HPe/0Is\[_qёoj1 s qW kR# SjhN{ǫysBr9x~{NzV;F&y]o_*Q1%E* H0MU?s_DSnX(4MC. bd>"x [ڏC }v XZa@i{nw*kB| ?%T|+SLKm[^a"$ׂCf ~ zo)FtUc~K-ݮ`&㭐4 ablbg2{_+y(\EPwq ;0W*M a*@t#R.e燫l Sz~Nt G%Pv[rŁN^r=Klx,g>_ADC N,@'WKNyØtFU P֫T Y|p Y-._\ Ym.@)_pj#yhQ7u D<8͕P:U;zfZj գdRo<i(" /KWzz]A&%!90؈t3 xW@ r?g1 p, {~W_{SLrܹ̿W奢sƅGak@LNl铞%>(,kͫ'vkK5-ᰗr8~ B(o 0?% 8ѧ!\BYU B}i`›lC)ű`W;uȫJxs;k zk֑B(ӫeu[z !XܳOc8}L kP \zСHJ.@G$b 3܅>vH&S媪cY(2("Lq-?9hmB2iCW!-bW \Gn@9%ӸBa&A {;"؛"`k뻸tZ-ȪjM_ CT(uj5Hp,+w}}xY~q; a( u(+,u5?;g6.~@ĀQ49's_42466qbzz֭BC \#wbD{h[GBru ʒMMVf6zok, y?)o+(Pw}nۿ_$>We|cm;l2h_b4D"/_Gnr9$ njk3#x[XJ/vMK+n{3MHe ,c͚Vlڸ {Q˶2+4tq&\Y7''N.b_¸tӦ.H$Fd lip<(ɔ.,*KD^5 E  Qa-D0::g{ss.>hm][o;@,ȰXkmjl~ٳk* ?;,Oga|"L٬BMӡ2LM+ 'kȆ }V֙$T:FFGs##59оPr=, CQd(RN\O>#s? { ._Đm;\v+JJ J$2nنiq_|#2)V_[ՓmFW| 'Gצ.D`-O4u,.rbcqqz΁To7 .\_~ժtlܰ;.#AY$1ٳܵ'4&ؾ٣GO̻/@VO<*Kxʤ~ NNihԡi: C/G0P(f$ cq(Ee ]GPf199\>[EiiCvȲRr^)ׄbtBp@G8qøx?t# GjnojĺHT*O>8b8(_B~l\c||CU|(b=ؾmB5B._ɓyfNצ\lK ( (x;x~x|x|DM x%vC7Uxظ|OuB,n@׍⿭a囮XX\?!H&h_,v_.ZH:ub˖hmm20 LNN.]I,*mنx<Yp8T6@nW`tyic`#ٟՕJu ĕ 7_6‘y ,W-Tk6 k=TÒ"+#L! YBn৒ ع -k\m= @ӴrEQXiAs24&&=&L>.{$g9Ǯ,6}D1rS1a岎D4WdD ap }q &=R;Yi184ӧO7^Å03;S3Ԍm[# @)ʤ(;(ۖk  X[+kr;R|omxm!B׵;ai-N`hd"[f FC!(Yu]i󘙝6nCXDDH@Vp8u1_EG<'|rwդoD߹sp׽w=!‡/TU_2-g}˲fUXꗬ@) C)NJÑe5OE HT#ֶEss+bXƹ;W7]͖3 I^I Cc0hq&WW v7vC3fm lدKXVwC,C0ib)d%Lcbr㘚,wTUEt߄`0d>쑒DQl܈z<!m>[А,!v% _(ȃƟz3HЦB=~_THʉ%/݋b^D#QcI ( ܋-L,YZ'Ԃ5mH%D|&ܒK T[Vԍ C/*-R>6n¥KP(8db$_H4yoz]6rX1A+ Ze LP2ot=p(Xщh4ZN*(YIpA]֏ й=y@-6>yGlO;. _K$~;;vv9-At?PF17 0LPj4RPs.ێ.MZE[֖Qlbٷ%YoIHN%P3?υNп]XmL1=v|9B@|@)㸂N"a(hbiipM>Pѐj,quE Z|@Iֿp(?mv/X~ᶭp;8J)U/b*W,%ǜF%|I hC{uI3eYKJ0VёwHR\>)P: U"am >g9/.%@YY}@HͩO D,I#H$HēO#EJAYАjD[k;Z[%X} :떔\Yϗv`z,2 m|} 0hx%)$)DQjE-)" # #K ͍-hnZD"H8@+n7dJ" ؐj(@צ?숥3҆*ksUKO*6d7 V4$wbhxssN9./D7gF>я󹺊sJnC ZƤT[B %Rr 7dǔ)^̍DK{\o>pRdHĚCM+{[[݊QAClܸ񡾾>N>B}أB> ݴ;vt4Ŧr# dy7¸o24 ]r)xisEl0пɮO{GI`sVNz$I+.[}'m'}ݷ/`#?iޠO^3A?/r3]F B;эyӭ4q-RD@NhV bmk%LB%K0@}eYAWm&5?a o.E]sa~_bIA?i bChTU18~8^{}~1M? )z!'L{jk^r*$ 8w'mVO8n6405\ vo#~Lv_w=z$:KJexcV۪݆e4f7 hnl<ˀdgF ,?X\@Ҽp0uvj.JeB\E-,+ N䄖\˿pu>~aVx!.,//C>\ 0eh@%d4#\]@_hBͷNq*I?cOҊgt3Jo_I_L)PU #@"bzڳNs(m{1|/aMܼw!n/{οmb5 Ed|+E_`0_.Kz2 ԿJ3SOYXXl*'+p .,mBC#LpO{v()ed3_:t>|6(d=}b_@FGFסZPhnpggg4k߇ >CWu:HnGY(5>&Igj_o/ˌ.uC^7?A`Ы/OOKK`Y&J%Iglq>d WE1 =:w#4|.]AHK=~*.tkPoYSmZqr sss~]KrB$$ S"KM3Q @jO,1KN{nϦI=00[ƶ#P U.}YnhhFGIVRя)c;ŃTWb4)t'Actj8L GX7pbAgI?kp }ӟo;Χ8+ 0,W;TdBΜhM;Pd1pgEab-7]ɗ#Hm>*M]W6 (I\wH@`g*t{C`G'{Mc@Ox!uLOOE9Y"@)ڭU f!ZH.G lD A$l D]?]Gc #7p#<~qvid)/cyJer;bv|0 ' M+.=D}WzH4ItTUۡUoOeY@oOh l\`P+|˖-7 Zq8~ \]ׄ~u;TiFMp J@fD<4z֌Ɩ;O-jO$U[m@6o܁zv܅ 74{4A4ey:bȎ> {'˞= ?-,$:@naƋtUMHF,//~ Iu Pt-/7 F;x_,`dxg Hbrld>K+E3 ]ɍqY( 3v؉nQg}syIwf"O ʍDJKʇ}+X"*G e5oi+a!h=57`&@Vu++@pE;wOE`z IEn6TR,@Uuؿo?di}+[o㺀& ;8sLVyb * +>-`(|`d8D}eAfBns z?gBvQms% vl!Z$1J33>au"x™0A c,˪tuكghU֮ŠyUj]G9}?;;jTU+O%H@ Y ߓ 30M u9)){{{P[ruZ +9ufեah!,ixp=N, zcm:ry@+|SvRN>[0bM'8H/VA&]=|>iiZ`Y^LǠx!'5ۗ]߮RЋ|Ǝ;u I9T*ͱzHfbZ @+Guo䏃'IrK=XaӟJa* YRjjSިp)!j ` = )yRV.& 0 ~@}ŏoؓ@O5lg H,mfd&XC2B?$y^M)C`qkhԛp$l7R3;SΜtvvt$ ୷-cć4iA;͍*b a6@#B :݈uJ%~…0MkT_ZObAc;ObYޑen@& [x7@V N S*S9XeaajZs'48 zr(C1AY@GG! 0Mj5OS`\!d?)࿧b Y<7B82;)^/VX bc,$8d, Gbg/d+bwu2`LF" @`bb2g$fb-`u0lB@@w7Ҋ&:,`RUGR^dHg OO{}&cPa-Z+8 t  cS!R&o9aY,,,y#3j:c[ ҲD@)\JGQdd`YH00dl,dҷHYnAor*=M㨫VJ;Fq1`p@]uO>SqʅnsY4X֮xpT;~˰#/?~M{ &hӐ9碏wpщi]OJ",//5gELNdo_b+ָy0M _Gv>f?}chvOXo&py&3plթ*Mw 57Mmn|hI +D3 +!hqggv 0z3#PE(pw87_Wt G&2AMNā_Lq̐$&&? : &+?Uz\B %LPAD[T=aّMDJuYbL#hP?~*c-&!bDW(ta[ j5r,.|=8cO* _? ,4-X\\<"mcA0)6BcǏg$ZAXT*t{AgT7-]]I3 N1Dc/6*C뉖1LJIDATEIBDe ,#@"w&uM3@0VPp… ~ׂhXqVR*T\`\/!H_CZHvuٔ6 Vqϥ`|>{F2/!uJ37d40??xFgoIL VG(HIxL佷T%b6`zDR@NNc=>)tU`҈Qc쏕=-8HDžDicBbycI HŲ1g4Kdtjt!=ˢc|z`.1 R۾ѰZFRO1%NX3 Z,B|b)x+G<ߞœxZeeڝKgr ZAZi  $k3@Ft W b򏮍VץBӀZ͌ԇbfEO\H{סּ7-2[Rf7#?$_x/xBz>]2mJRmrH ,Gw⇥z277l Rt_|!M2ĻXwgZcݤqߙ^k~@VjCXPl ʈ.>5;{*=*ULRۺ(7@,tq '甴(ܷvVk5ڵIӌPks8C$p2"&"F hA A,@7$FʞcAmH#ୃ*ʴXRt|73Q!iJxk4`\aLĽA%ly΂4FooWV bkv,V^r̀iA HpE4V_εX,E&UĈJM:cc.<>U.h~(F&5q`9d bRs.4"9t["C>X\rϭgUd @@L3ASfGiJ&n "BW싩@ӲG1qvLuvx kiKCkO|806%XqneSk8w~eoF5\@+C]ұ@uM!-,`k!u>_ ui֡RD>/i>P\{G_zZNf3̔פ<9Iq/يtrj\81Pnpp%>^Y]i뙶``yyQM{G]֌A8P$"ҝN:::sa7Y@XL/6sȄHΪ$n.U0 #ãf`NSǏWu^N=t^8Bs!EJ7=]8-Ft6q|>v`K*7mB!.4pI8l20&偐Y.03; ۶Fgz^xmjEm@|e'hmHp^t}+w,%aHu‹$Z-(Qpļ8-@FomH XXdk,JrZU~ʅg2طo_$ XzGӰoUv)t H_W>yn>])Jb-}$Vҹi\¸1|9q|wgl-DWpuu1%o >ډid@;Vߍx>>`40&H4wxG=*D.F+QeE|G:h,h tq h!d5}๮nضz*sYL,[:*Hw u~ľ0?54##A5 2Aƃ}6X :s`?G}=' Pʯ71m߱%Il TT,2m@4vdQ`!qVb̊Gt&EHߎ=. grH4(;3OԿ#M A0`D 9dus]u~:]Kw/rsV̰0%?n]lhMӰ~ᔟ\XUyW̙/1r?ϏRvs۱ KY.@ |ܰ@U5 #דVO\%~|L*=r{ k!GmRLƀAUt n `rXc>&5b j~?J<y4AM\=ac|~<VD/8UzQaϲBOi^B_oMؼ뢀aڇ8{OA^|suj$IK$7GM \B k\:p~~k d ~ a+Rg$fxG`_˲I< 4]ߏ]/7<%$zBvvei‹q`^MJxex .ߗ^CрOxP2&XAutt?7u]6!(J@3C9y-5}F̯&d2Y0 gDZkl=qz_g78LݔFVyb(\bZ«q/cb3=ݔ {oo oLI[|W4Gv,/-Ɵ˫U_ew $%j=ȫ ;o{,˂ 2>##RVT(v+a(ٚlrEӴ_>‰);oP>?][ZY~ҝ*ҍ /7-CZE+̷h7ŘW*8yu8|q믡A,..oW)o 2V||٥ދ7fY:uz{zT*d ͂adTPdYEcA6LCB}]JPV (_od`yrd"(bj?y-x;" nz"l߾wWrUI4-.!es…!R"_[W4.Lfg'aܤ`<;nCJOC+GVPg߾c?q=puk/wvؠ80}ay/>˶75.u]J5EeY_|3dZg+%0:<=f!cd#H"᤬@#ض Z W`ff&ΞTh<ѿ|e~Co)1 ~wm.d28xÍk.dW*7FKK‹/[6w]+_$,Rz^wq}Pӵv/ad 2,Fgg@e/[@w8 -v džZ̈́jի4M-˃o}o~sS+c?x\c@O}.'s,\uհs.`J47\W_=O㦧۟=*d0 RB(B!sGV6 Yk O?y<ӧ`X~mD@en(Gn~WkYsIThpvvwpc]iu](0wq&&&`YtSzW?Pr"h)G+c{7uöŹٹG~_|qZ}A]W0h z{zaddJN(t C6]@ok46U=ݜ-m+pq"LOOArşرss["YH[nruwu22$Z2͓Μxg?eL6OZ"1B0 wmIE.,7bvi)ih4'O?oxkAeHTb_a 4C/ۑ/52:*+z|R=yafÏ?":eC>HZqib cka||x>tЇdy@~m{ۇ‰Opwn+(;z"+E4YQr3-D!HqpeqF5톽f۶9?7?k'&_Ut': :&3#?{m[s$ɛ꜖}'O~f @h/@?~L1: -Z lV|vD]ۻ|}ٽ oy4c֬WVVy̙g~_ZnĸiA 5I,Rk]ff 4L@C ޽xkǣzn`D'u TњmaSl e7FޭV0"1{K+bL1<ڟP8K#^PnS~&FǦk'9}WWc)Z$mhIjAtMM M"C4%Hb,P&8E\4hKuc{64j^y-|aƻ;xd2I2$V`xhq8x1J"RJf#Dbeay%(![&6x˓t{ jSL-Pf+á< KUGӗ ~| uDQ::x"K0 N<A<$%gϞf\xx<{ICL!6g[{ Y,F*K&DmMEmbK"bd9Տ30bR9@=L4Va;16?Vw72X޵'$UU  JU&_Kh&5&f먈;T%>ml5}$퐉,fs]Gzhr ' NEE]a:Ga_<;މD"lذ /о AO]ӻwe_'B ٖKg!E4f qn'n_!mp+ҔTGC14p*vM썊_zJv*imi` ^Q@M6իzƵa[R:PKL\*e+>,UUUA0! $*'Z8c3H >TĝB:.# (JH" A3+Zт<*EmMBeػ7l[.Fq//H$YXGb8iZ@ ́6Usiv50c>& ,9CU*!QaCE4#T7T@ u=<#gHr4!p_z.}DSc3R 0R"e66l?rZw>q:Y@@ "| *Fw? RˤI[u4l܊‘'PJ\B;os:"/4E!$+46nl|#4M#BT#<|Gs0]-d>_ xva M HE)Ehc-c :/֫_xo&RR熇s[-U/|?8b'|h,?]\ɋWucNq38؃AITߗsB2ww}4J;FZ,uƎ;0B~,5:}&3,u,yBVr!n$2Yޫ Nq2)9y,Pt),fppVAZoNrɍGĶX,SB'x..RJ'>M3Xx7:SӴxY.Ro~nWjf oR5H(̫Gc*ITBJ˲BpI "1{ pƒͶ4$ccc444T|\5M0b#e9nU[C ̜Tm钵9g9d2EP(Wv!0Mh4Z_  xw 3L$8%r,i-}~mۘ1| ɠT*X Kmۊ Csh4B:fŊꩩ!nP:Rդko~aMn^^)UMH&r}EԢ|TdمZZۨTylmq\q^J΢q6oO*>( Ţ\= |rib\~}᝺t IQH/SWWwrAR CjTRBm Pf&iLLLPj`yeX莥t]q\X{ 7繘,apMDz, PPN<4UNj1?ADFr+BLMOQYQI*DJH sk}'B\RO8!>T*l_fy\ ؽTUUQ]]CPS\%Kio@4 m,]x>$tvu]765 ʖVݲB躆>54M_-4mb833w>>=9uz|bRoҴ'0Kiw$%Leo{|o|gMMMO$47i| J)< ffg[ݷɁ_:y` ?'?G+W޲yJ8S,{C|fg3tuu޹X:~9b*DcccC;X%G CJ /{ܹsC =%x?Zl])1 \ eP Fx_N`hx9B*TIENDB`smuxi-0.11/images/16/0000755000175000017500000000000012311344241015064 5ustar00meebeymeebey00000000000000smuxi-0.11/images/16/smuxi-frontend-gnome.png0000644000175000017500000000173212311344241021662 0ustar00meebeymeebey00000000000000PNG  IHDRasRGBbKGD pHYs B(xtIME &7ZIDAT8uKhudkl 1(*F"b!BQAD Q ҃hA[kcؤIh5&;>fg$)fI(cwQ7YzƏJ/6GUKWteɦqA:ø,qmB4H.C2lF@D14GЋ."HBfiaa[~3LÛ?D[9djU Qɱ'_̎x5| 6)6_jVu#VTeMH2@G,OS$V/̔,J>(|= >')VpQ#x|^qwM3ח)v( \[fP,U(VXut]Gs\[\fa)u!1LijHe?Y>O}3D`jZ}`v|58B񟺄[蚝ň`Js}~hb>}+_.YY3$ __s.O>O퍯F JeԿ;5:A?bpP H/&7.A Z6lxv5%d,CQjTC4 IGn߿'OQ;D_|Wn 0.7̙=W\~%,YVʊk)SO _] `bp߇={bppA#OW\ J,^ՕQ̉܋-}އ&$T-FQ.R 7nARiӦaE8yȋQqMB}Ee|qʕeեTNGMDݵ?ܟU,t:e˖!>@Hp=kW_Y?/"ҥT ORj`[v1K&UY;?s"@)];7_:҇|#H kJ:} 5\<\(V{VP5cĦ6B׍H>OhH%`)%F6Jokm?_:!5v>q' BwhbCPH?xD1@&>?LЃC:rYnΛO?spC{_N_DQY؈ٝs} #"&@p=w7n; _^x GuFܻ~$ Ao+T;3'9v`kQ1c:>>rDCB Q+JD&R 5-0Oz} 4Fp"1Ү3{Vqw>^gGwxʆ \0*{---̩jp[|2,7½{ZprA5u-hmmC"=nݼy 6Dz"m&0 =ME Zr,Y XʨGy Lyw(ε|Xpq0c^zBk=Un#hiitOvuue@~.󴷵c+#Q*Kt]aDXkm O w 1Y@ nY[ {UUq(+jS_)3}ً{x 6zmѸRK_Jƣ>SThM);ϮoS{yBC-|Ӭ209<2`<[Μ%-uY~] ySؾ[݀`^" `e zݟ͚Ձ3f{Τ+EGœCe,]r'?̢SjsX Xxӆlfi@V7TLRYn.\D")DYa,.m {X^OZLd蘍l6\j?}37  ,Pv)9TQqO}, `p+~O W[ȲŋB $T_cc#fΘixr{H d,?ܽTTZVzb^, ͟$T1ԉlذaPku.XB$OߕXԟg#ïZiY@yk)?|] #ThkkC[k 3zavKܹ|j 0֢o jas Ͻ@U=-WcEk/\@} --T?߯GV;כ=x[E iAsaɬ|S up;]hAۿ.DT`ȟ,~sSBp0kc!a5^Z.~,@S~7`0 p*[ dVbsw`vg``hxUU'o^cPI=^[=NJWRFMV.Ĕ}n f $0Eѯ sxss Ia/ zWs.ʥ^@9#E@-ma˺2tY㧵OcX `%Px&+7 `ek~Vrz~Ӊl!E:*+0c@J9IX$)W Zy v.PFe1Li0764qWoZo2vN +KyA@o϶ g0-Ѕ1Liv zb,b}^`o, ^CϛfLDsfasy1LmWsPQJ|?Ԩ ڒi=A=g#zVnd2!4nJ#wuudk=>H@d%]PR BHv%zPPJȨ"rJPK햖T;_j3{߶{:~d2 IjnF1NCI&yk_ /{^__ u!ȬHSTE 2 R̛=8|PW,@ɠbl% a|0+W @HJP\>o0HC$隣H ,o0v#V6b51vi8MgW!{8e-vW8B\yR581h(@-fS@TO\ԠbK`1JKr;#`v(=c|߿r =Œ83)*rc/}hg"{^rK9go@@w0b% _Dd/)*P@T*i +kE#sԜWD(( 2x+-ys .S둚s!? jb+ T,j@v"{ X)K#_ ùpFO SY(=R#gNx n0)/ <=^0fQᡐ r8)Mp$Ⴣ])zsiޠ__ax+կfւ巫@a7D}ap-J߽V;Mشvu/u/egKO,a.<tK=ζkCN@?Le{L@Jm]]*\@גavp[;MMpcSYt/P(xֶg$I2[zp9Ubч 7Pƥ&ᜪW~? >bԓ'<׫iU L{[DAn@1 x3V=zoPp5 3 k&yb"{V,`1_rË'T8}daAc@9ӌ 2&ue3p}~y~\f|PdZG`EsJP/o9~h"=h*;xUcā_G,$d~$^Lfe=:}BRPbɛ7 ?^E+@ WP6   8)x48zHa~WWW.:5k֜j6X1FO?V dgO܊M|O.^ɖ_w| ПN.K9~xxg{{v`Ю 'zE;N. ]Ho1ԓ@7رc|{B:$ɣف~e)6@s>SJ\D_nD@Ip>@ss1ԑ5&{Vװm۶(n{k]3:8tF` lD"Q.DA4D 98!ER|/3}0z4$!y Ω1 $l1\^Gfn&Dus YسwO}Hr_Ml:wG^0H%hkk"bd&T7ʀ+ʂUc/ˊM)tuu5$RQJd $KL&p{0 ]HM$AGXHO1lVtWпѧ=1`ʳ?{UB_p5|ZEu:} s̆c&+(hg?ZԘ&L>~477v4Eu8y؎\nd̾R|H$B~*`X_]7nu֡*ҩB0g\l9/)FN:cXPjVeg+ IDAT,KA3) { հ1K 477c8z ˖\Ѻçؿ.+&##yPJ!KR[n@-_5ߊҥo ;'0(,^k,@~޳k[CC#͝!m\ׇ=Gq Jqf|nVGJ?SO<.53@(."ݰ_$ܸF̟߃vlߛF1w\D2:1xq'Nqqhh\"Wchxxt C@'{1\*B0/sZ[ѥt݀i8r0ޘE\֖VL>ӦMC{[E<7Awzϝٳg1<<12,}(xgoSQY ?fS \>Fd>wǬNsR4dYa4 @4:} ᄋ6& !hnjFssd33 $r2{JPXDX@>_@.p./b`p`.MGfOoި]r!w=S[cݺ%D60=s/_v9nVR)HTV|Sux|^%:KV1io[o4E)wVVc{KqɔL3׮];]RO̍ڊt͸NgH$\\GGJ1.`ddd^7wps˖oLd2ٳgG:8 {ת{aӦM&tuu%I|(jλ|rәrW{kYM˗]`Kkk}:;:~L_O|bpc2*tJ͜] `Æg~<94A̜9 L$*50-JW͆ ̚ىBV (Xzr\sHRe oWeG<&̛74A#6&H{nG(KQl&md{wL^j3DssPJsdY1cTQ_4!y pA%'U{ƍ`eڵZ#Sl>ZZZ}|O* T@Buf!/ZKU2 ,Y)7Rv \{d0|<%@pwM.0NB)%?{`edqT Z[ېNggHUm+Xk}nTҠfH$455m: CC.kWU-UW@SSs72gα7o>eFHn͛71P?ΗH$p}:2,6'a(M$Tmt]H?yseWhĊ[ `N_L `vll5!'6X6l2J,K՘5cT%`hV*/R{EA{[ܔv ]eKV0ϼ6&3~TMillĬY(w^eӫ0F/¨ymcu_*icm+lON9 H&SX0.[KnY{m3:= `JԂ" Zu76m4r)ޛI_Б >|/^!"Buh2݀b*U`N1BtvŅ }iY$mmm1c&Z$X\,ˠ\pi["ߵl2 7߈ f b<REE.Xo LS? 8B{-'R5 XJf6 g@Q sÒŗaڴȤ3Uޮ$*bY@xM0kV/\tۯZ}=6nܴ;(ֆ{Zt:d2IP,!I}=Xg{ӧ@[4IP h6)܄D"֖6tttbŘ1 {ˇ'T|X¨!B`?q/FEU|Rs& sk2@?ŹR^u/涹Tbe7) V$uVYlL3ftR\.!7C>?2{TEE:F:A&EccRh4)ޖGҞLeSJ%PJѤV+.)9u)kJ2n8{Vc<3gYp P(B׵*a0 Z.$Z)*j~n0R^жmcP( _AP@X@XV*i5 {(Ee .H &JLNj9Ro%DY G69;`oXJ,PĽa-Q9s 8) zO HU1)=Ksg0]lm$k0ەܹX,E+7Xxai+ I7y&+GÇ"!*M]9wX|VP(.4\xl6#-qoW,,j<ܾEY۬W@toWMKZ3pm6ofє , 亮Rl+gJp(B0HU R0b&v*lvpbֶX XPqH 0 yRi%d >1|{/G1ҙN`dIUDʣh{3g˯@:"J%9xJ)Ν!=EQ(\.,R'`1mű]ۏmmZeN\k#˔]v:@'O#˸[ NO04 ŢϾr FVߴp0/ߴTjؕJߝ`n[Vݾ]a*]|)-1/ 7x3"XJ٘_:+Ԅt:7YO144IH$<}XwU9(}*bn tjg,VwmvskoɰleܹwaBt4#@Vʱ,sVrі|%Ge^+<'QJeM= mm1-ZD"\Ou:bi< Uv> Sz{85 뼪.ERY[E!b\~ܗ:py_G'2xJM/bI> ]E.Qo; ke;{T3S2&UV ̛7-a^3iuU]žcPՄGsH_Kq)FRvSJ1 PeG}}5#p*>S o3H] 8-;8KR`UW?! M̗{/2fwEM۷׵v:\^ h_R|!bެF0+<+{. H|QT&~xL  ᷳd"TٸO΢YWAD{);])~XRaϲٷoT*B'99sE7DVNޠ4 n[c슢+zTA3$ß ԢZ1dҦm$4&Df} #Xtyx#h%H z}stvtaV x r#q *e2VWgb6/gLX%ohȎVj*A̕xP0١ G݉Uu 0H(ֆt:}5 ctO]@ *r@WjKJ}>jt=H޵E6Z^z6ř2 B*j2@80k,@7<;v4d+^~koTI} -f4O ~Oy>Om(9 L*f֛`yx7hTׅ9=`_T1 qX|,Ky^Jv‚B[)~S߀\6-Rev2 ÷̻̜93|I; ^x@g(ho]w_EqxOy]Krҳi @=Xx2#=?T_CCvtVdgnxȌJVbf whPTlK;골2r:fww!Md\G|k/eTґ d%Ʊ eő$ _'`ٗdlB[j,Q8qBіk[ ~m|E%.VM  VYuQJCs \nyꊵ:r0ni+EFy @OyE&\!KmoAA]׸*"444! B֯ 24ߏeԟ47;/R/( V3)ۥdҐe3-0_ro TUqJ ^{,+`#G@|3ghnЙ/jú݀xPQ[~ %K(UL$tvu .94Tp01o2V`>?g"H,;y9+VJw?c7T$\ξv˪RRXj6| cg+U~/7Nm.lDTt2v/Ҵ>#t.O @*^Zرrʚn;uU.Aa?72~ϳf\L-_aQ&PP,ʔ߽@Vinj[*lD o.9L⅛;O8i[sYm?B+J;;e :U7vn7+IK)s6XP{ :c & 44 *jV]Z/t?bVBa4WS)5Ƕbb\ {AqS^|}素]iͅBdYA671Q0ij U@'pǏJ_g ggcpǎ+8Ẁ|sę.[r{?BJk#IRyOuGJkUFZq: {mg Dp.2A3e?ߙ+9YknV@J/>cP|I"0 :<u- d1"@=O~f L=6Frʲi:2DU{kv_u4",VJX}oG@خ.\X `ftjUb pacdDiԸ-Z4mxjn}}lV_rD+s(Xtj^8xuԦ"k +=O6;>7WZSzy=@WDk\%ɰW:3GN0m*l``|YJU% YW>> {{)>oDG-kZb^7`xxz-l3lW 9تR \Z7ٳJo@@T)D><|V DZy/TUY~&`OP,GY}gQC10tddˋ$=.Nͭnb1g` tk n+uHSS3r\Vr m.KC\KƗP s?J!6\.[SF JE-~X kIת̿VL\T044 {1ؠ ^(MF _,ĈS{-6{l6xOV[3}[:\FnԚ, J |~xjB#T(Wt_ϟwt 2o])$B100W؋~ فcj߻Pfă)?{s, ;O^ QS%Htoi`4MJYU~d=L^^xlp ,Fgx":@'AʦD"hJ (ͥbKYTg"$57t0A@=F/}ZZyz~,k/S{)%]}hmmXf&hCjGo]O?t]]޳>ėD"Js=ߜQ^1_ G}/bL KSIDATlFeqZŋCaLm@dǎBejQ+'z [|1lX@}S V0f,c&TH^/%w" 9a$0{v'\ҳ(³_brGx xw*-ݬt:-*džfx~]w>8wnTevOPp rYJX +w]okA(?OIRƀRf5 g9Fr(h7 /Pp˔֟!#aO|ؑ@(Ò< TD*-NѸ|W x3(ɴd _֊Q%TbǷ( ܶmGjE~s)b#H[D.r-f!k/Ƙpƥ*>A@+ܡd*0@beS1@nhÜB?Ο㢵7ʥGh7^+?_)i}FZ'K8忶ruehii)NRqT*pp?Cہ \L ( ~}{jlX5^)A5Dc"^ Z߻dttt_+L&hh"r9z3߷;v||!_SƤ P,V!:^!_郺|zUӾadb̛7|5»>r=3)XZzV(صk7$#z";ħ,?4..6|JU}ફV`޼y6A:cPK[`ՉT Z+;8$ID[2(n0 ע} |f2 cvW̝NP׳X*GG\lR:椚a~>}JhH2Bssh;rţrK^@ dV>|\=ꋗT#H$fҊL&+XWw={p@J6< 䔋@9WQb{Ed2&47 @QTF`/@ cOɝbf444lַ =Vnݚcqw1Rr \$޻eyFȋ0.X$Pم HGBEA"B*&ʫߦcRcq#3Pd?Ob[mfk*Y'L!N#BUP5@AڔX*'}:ٟ|iʺ\ƪ$خz:|诖/[_w̛;K/[;8٭D5)\/ eMS&Q od0##oolΜ9_waHgw/|nw2"m >mLA_2Pީ'چxlsع#K`Ch׉q r`߽cח"†jFFCJ/RB,j]֛\H'/nwnxX3-_j477 ޏy!q?O@XM⃝Dxhnt`j{Y @޳{nNYQZAR vDkk+Z#$1P ӂ|̆UO)ٳgPRY9}_?C<XndγT,I":p{tQF.7ٝK@OF4qhԥ+ lr P(|ahp+]0ޖ8x~HsK5Q^ٻmmhnjb v7ؽwTчa{Sw@ }=+oCDbf?TҰ>>}ӧMC:88]w̙hjlBCC^O/B)冱wnM`r1z/.g1cغ֣OoooZh*BȘd- ``?d ԉ'GxB!{9|>?3y/WZ,K@N @|,o{PGmkßeׯ!Νc$3fLesZ[ZAC2fc,:4\n'O¡Çpɪc)|~7>@Pr=4Cw K0@r[oGC_w{JAgG'Νi܂lZ,N 0Ku* qg{#xq_.0Б1 LEc`~ڵhBU͙;:IpeRj|+_믌^lyK@|Tӧξd+XZJҙ+قHwY?kД`^ /D|z{{s￷,N666,;omGG5 Mcxn Ai V,͙3{F8X3[׿BG1=n`@ܼ {%=?~v/"*ɤeT)*_8|෾Be5xtN bUR|eT A1cF? u9$)XDEczӏΝ;7RVF q:? d6؞̟?c'gwv~w,\_9|ܹs#78 x+D[/WV@bX|dXu-Zr}AUUf=c?@||;V g',w\PdC=+ݩTJ'yɒ666^OI*P4;PDÃy$\KY #ݫW,IRsSWJZ wwwʿm>22sWbUk”< B3fH|K::f.illNlE;Jabx,7R844t'o}sg5u  SzD@|!k㮽vEۂ ;[2V5&j !D$"5ID 5>umi@X008pıS'o~… Td)^o(DbY 0Q=IB8,X;7,%]|zl JG~1y_9r7`2f,\q~cP<\XÞ c `,kۯǤS0IOE$Vjtx`dUrx>:Y}+KGA#UIi@VUf,Տ8B &O6e {~?Xyc'OfE?E1 +dV?'Sms0Dh ( @  KMK7digXfki]fki]fki]fki]ejh^dig_\`^S& 1ejhqvtv{yv{yv{yv{yv{xv{yrwuimk! 19;:8缿gkj4,12QQTR[}hU]5^3~~UrBuN1{~b.lF5{~vc0g:|~(t\d3c0~}f6e4e4lDRUT xz{qKi9j9i:i8rRmrp4  ֖;{cn?o?n?o?m=pLX5~hV*wmrDsEtEsErDvWoTFGJ $E/sExJxKxJwI~l~FG@goY|O}P|Q|P{Nt_6E`TUVUdnkz{etPH(S+͢gUzu[Y{MROVdj=bDP[4߽icnebPI}`uTh8kCaY2ھp(t^[Th4sjk;mC]M#͜zVxJ^Y?&oshuxMeED?΢B%IU\A+/[sNJ JCKxtn(,Xlnmqtrqts}V3-)@˘tX/iE˜u&,@L@0-(|hɣAAѯlu,2]iW_f_L740.2ǒmqMIJ$I!J! jEТ<0BRbKǸ9˳8Ų40'fΫCAm~n3co9`QR]vîqv9ı3,yxײY1Q(J FϮo>}ѓjәn۝pjߩګߨHɴ3ŲkpٯnJF5MJ IͬƝ{tJ}b):̹vīӡ|Ξy{qnܹpLCJJ Cnݺ}9*-<ʷ>Ξy˛uɗpƑhϤغ]6F7KDIY1ȣ侤~wx|ʗo̝xױܿ_DN% HBcO&ӫ}\Ǥַ߿ۼѱviD@G&J J AO?~~>~>~>@lE5J J ??(0`  132ORQ+SVV-TXV-TXV-TXV-TXV-TXV-UXV-UXV-SVT,=@>" +gkiiswutzwuzxuzxuzxuzxuzxuyxtywtywrwuhlk~9;:I'($3eig{~|~쀅퀅퀅퀅퀅퀅~||mqo0  .qvt}354i;&&I}ߠ@BBR<>=#y}{ʱVNE\, k8m9e:xzwݻSVU6)-+z}ygCnHpIt\y|f|R{Rq ~pVb0e6yˀ.rXd3f8| }!pQd3f6ziy~|\a^z|jBd3d3sYy~|_kpm}rc1d3d3kC;== }MkDd2e4e4c0zfx}{OvZe3g6g7h7g6g6p}z:6<rkn>n>n>n>m=n>zkzlX|64y' zpe掔f'7uHpAqBqBqBqBqBpAo?oImNDL!K$J}w0,ZsDtFtFtFtFsEsEqArxT)FJ dLR+BsEwIwJwJwIwIvIwK}gBHZL!?fPвe4jxJzM{N{NzNyMyL{TzZL"J DbJ}Y}Q}P}Q}Q}Q}Q}Q}P}WnP&GOeKq~PSTTUUT`\W}|mT+I@K!wZTf|_OSVYXRqIBU^Skaq{fbb:HuM$hx~tRdmńSj`G\dib]fk>aoIGO%rvOz}]UTK?J@cyuQk;`vRFO&uqBf{~inJuT{h{sDm>cyUFN%tX$_}sNjbhqus}~qtsuxwuxv|}Rc}I- |Ro@huQFL#mY!Y~xJzMeGi><:);ktduH”pkFGHi_Ōf:+gxfUuwusvusvuuur`LJ.(jx`{'c˜z[3HZD-oL˞ep#)08lAJ0,-'!zNǝ}R*J JD\6Ұ~T$),2nzyw\_]^b``db`db^b`|Nu8/,*&H|OxO%I GDɧnD),2bSO4.-*"cĕq^IAmuSմsn+-1?}~~wyw{~}UHL71/-*<|QϮa;E(HEӳp:,.8XMZszz{znR9641/-*nsŚwƠDI I#LFpMدm&/19X[FpdC;798Ʋ5î41/,;bظ`8DbI!LO%Ƣǖrm}'0;dCj[[ȩLȷYª9ɶ8Ƴ5°41/&fҨgFڊGKFEe@ؼeS6Ċ`͌]6G\imlfVLͭzkäq7Ų5ð41,uǓmͫO&J 3J J K"BzX޿mOTwʑfTQج߮׬Ъ£yC͸p=ï50/sŕpػe?HnJ FHѪzYݾfi9qʔlЖn͚rѝu̠{>6ݨ۪۩٧Ȧң~ɢ}=ɶ}4ų|ooǗsĭkEGGs] I M$Iٲg۾œl|Q`wc*.IJMʶxӣ~Р{ΞyĞyeBïKfj̚uۿlGEQ'J FFzXڼ֩ʎdhW^MZ*5¯<λ<]ĭѠ{Ξy̜v̙sϕmpǏe̒j׳նiCGP'I I EHY1̩Įy9vJ#*5=ͺ@:ͺΞy̜v˚sɗpǔmĐgѨɴyQ(HuHJ KI!HQF~^ۿ޼ңHiHJƱL˶g~͚t˚s˚sʜwҩոlHFJ ?I I@O&ݩyWšܺปޯ۪Ϊǫ٦֬ײܻëַ~pMIЁBpHI MFFQN%ƎT,e?hǢԵíܿӲĞ`_9S*L"F>GI I G]EDӂCBBBCD΃EHQK"I I J" JK! J J ??PNG  IHDR\rf IDATxwuIg-r%[DRHH3v]lSw=/իWUbX*VUbX*VUbX*VUbX*VUbX*VU XŅE-="/"[A4H)4Z@4Ą !a)f`FJfƔ M >[RWqJW$`b-B(46!D ΍I!ਐrD}~#:egUе5*b7R^'oBln2 @Me&kKݰUTJ6EKC܈ZRB@B^W )z~rR͌U ?nʫ;=Rrx:AG#M)o1R7̈́UD鍊܏qۅy܄^B~/KCS.EQqiA^ CfIsiҙ ll.G&%r*g|K 圚yt$0a^G i܏Ϸ>MU 46D.@}8@8V\EvuKy\ Kd&O2=cbz8xd2}KGVmp?A pչ 0Mj|n^$7G,/:dx(f936\h)|Y1;O=uNp1o9msU~ZmH u5nܚZyh+ m2,s S iFg8>4s 682o|عT V ?x5K@4" im+aCA[T'p{~[ZEJ_3L&9zj'F!;k ?+KRgUJk}ygA֮8K\újx]1%B1RbDd] Ҝ祃<=Bl=]هط8ۃX%ڷ>Ч Vr*tuְZ?R4U):i) I*'IeټNh\@7 4EܚK-~j .ץhx݅OUzdD K#%L/Ń9>xiGНJO˟́oV9\g.ZvվJҗsA,#K戧9yE4?)F)ݭ)=!­Ni)f8pbg^:I*p(wW*y}77觿KŅSJ%Ʋ'dz$3y@8kb99G.n0W [u=][Dp(uNMyӼх/18 zSܦ X%`-ISRI\ ;s54b lBXݐbVBan(|VTA}M$1%w!X Y^<2;Բm-_gVTMUX )z>, V5Fj}&Y/c9ŲΤOŬP]X<z'!x d;TY(&KAI=.:>j<XYCC3<?9/kRÏ YJk;T$XlsS{o4h: fR$䌊 qBZ1íEqJQ;ClN I4J9ZJo>,.U\O$Es(}uɱ9A?"H۾rX%*le_0O 8{nmhjAM4NŸ O'Lˆ=\4MV&y䝌t9BQ?ϽE, !Ln%![wpfZ&淓}eMVR6`&3!HVioҤTn5B|#cLRȿ:*WSw-;p^n%R2>Dt\ST%e?T=z'iC=zwJY ߅v 7 (DJaHV&w1TSVHjkt6io 60#fyWsSQۜ7U ϟ^]Z.~TOuӓqNIgQ%AAEdϟۈw ~~1BTDZ|+&"VJ)uTnnvR )&A?[([9@OsK I 7x8?2SSsT|7t7г7#S!m`- z-rDɌΉ(SqJy\/6F})hAצاfF ՆP}lu/(JE0l+ ~ lDʂj^\G9ͬ 8VJPhoVCЧ΁9z=*ɤVej@~&fʹ MK}{“#BObZb&d&FRb5>4%}E, 6[_ZJB,,2(:( ~ym #;VHzŪK)@[CB>`&љ}5^;4K+:|nz~G*-4=nkq HY`x*%/(|^90~IK*Xf F:[[Yj0P=p&݀WtPz3XrϾ2H2aEk$0AQ (!tt~9!ࣿ*F>W4,V߻n9gc {l,'!B&u [ԙ_38 ( C?[ǡ3T.MFf2XL{(*`cWɗԮR= , 5W*l兩T^ XPXT~^ʦZ!v6ؔsij{sǾ3H+o X? 2.YDim￝׵Y꘽ͦx$q~ͬ?O%Fdv-= פ a0 D3; (] 53NR 8V6ׅ- 6-H~y~1Hr\uyjjr0kHB^JM+U?Zl|23CݹcG+t O=w?УKpSnv#]Ygr:/Щ9r,Z+/5Iea26ZjQuIȳyh#}w$?C[+oh~ۧǁ5N^x׍ܾMQ,/.^^ Eyle( gP V T%[:A:KNo-@!« )ξ*@uD -3%pbC|viH 6eTA"cp<AwK }=m O8*BpW7GްлvomJob~7$:?<8x Cz+ \UI|±{5<[-CMHçF뻷2(g=Y_g|qR1 w'kn9r=Z0,O36$B^d.gbjjլߞw7o?fl׽DĒmDSmDm-bhL!}R glK ) c/K={>[Ny]{o&Xx04㙃 f/lܮdb/%93 AW7|$}uI:M*C2fzƊ(/5A.MqvF3.52tLR ٟ!c\et3 >7^OA{lT2UjwRrNh338re >#ZLQTAC׺I6Ml W xg/_ +rCϞ!S^Gk؍}.:Y>[~ײT8<[|C :M271 UUh*L0nuh;8 &B4hr+cTNN $" ˝ *@ DH,eYŒBbR>K@- R%P r{Jn@7 ˃p`p679;1L'k'gr\6b{Oޛx4GLU&Z05_[Ԭgta#sQQIV|nd!utSvWVIDAȑ+ |~Xe]+lUϷW#m#/ Tl!%Hq^<3躻2$:M$n-_$e]# VM)us/r" Mٷr>|E z._a:~ dp[ fS ,늱k3#RW !ݼ:$3`&KJv CT&ϓ;++]ٮPrm/ZD@C@C_BBb>,}tc..@#L,lE}Ƨle q&X4(DtD&U+|i`C8;[pGl%Akx0lx^O|6"~jn1O"y$#S zـwk>CWYoL\ '~؀cm`לWn Djj6@"w=;\7L=o ̂l|s-5{{]{$:L_pIg{Dэ<3ˆ*gD{ 0BGoFu2q&P5Hs3GeOʵ(u7rz2ƜbWm=n[^b\ ExSP*}߭t-ꧠ0WÓ_F9,8 Y0:?qp;C]w)׵v g!6BT%䯃Tr .{Ϭ{j0@//B߁c7Ch{mkp`Ղln^~u_$i$aj Mh[{綆 I+-,ULLjԷ\L@[-u8-M ^W}^CM(h# IDATjLMe֌w狖ڗE/ ͳm s nv;>gϼDl{n;=ܶS1^;9SC;nNNH^+(::o}c&gN"f.rhckgԫԫӄ BRRa6pf 1l2 ]0 ?U ũ{i3Q @˽rM9"oͽ\܌dO*)5Ig+q]r&;%[P,}_'=S(A h}>o;hGe]G =iQ4(ÆEFӲSFXDO=W/9VF)B6}ʕɛ4Š+kA!au 4''nșM-l 2y|V(]'ǖ|.K '~ M>?uN%DYzm#Oiv |+ǻ9t,$1}W W-lEsT'/4<"E'GG^y >N 8f;JlXt)hn'r^]Vl12O{TngPh86v45Śqkmi> ptq2`A34K#S.BK"oq ۦ+!wKn#{I"}4!sy:F.oQ=Z}5o;ƐNNUhMM['{꽐b@Ȁx}:NK/xɊG_Q$aׯC֯Ai$ۅ8`>K{%;?A&$hox\N R+Q mcYF+/U" 2:ÒnH3&m{^uB[I{@]^Xu"ಚt˾`֥'P_wܸ}ͺ-1PD!cg%MэjjuSl*p!hO+lZP)eynAQ5py_Ÿ nhZ}EexD!)h03J4ʿR )dKK2n45zlucB1r;`!iuG<͹G5#_N7n َ \Ԅ8tlIzlc/s7O:x.TENFB ر9'ɮs"H6@Be˂FKZc˥H;z:d:^\ m=M^kNh醎Ȏ~>H7F .l [-wz e#Okd9Ѳ5]E#*&I{T+c|2HVﳤu=K?B*6&j|èJއnTv(BgM7 N_ʩ˙f)0h}muT*'`.36.|sC_;Kr!5w?xPE.{3u[n`l6s'-B 뫴73M% vPvbO %$9eesB@0LeFDO?jP|>jUU"h_޸CQRXAy YLˎTuYn*~-,CghiۧKF_]MO2 x3ӻYHvKWίٶoh _}Z _^\*WXT<tiAdz|aB₩z"HEY?rָ,=7Hu}w`f}~Y:O4J$gYMZwc.& ZZj_ȯ@5Mdv nBiDAq)+&PhhÒ{IY+Bji@C?F,! Ӛ,r[R&_oQ4"`Hd;eGgl=SP '=v41#RL$nUWvr"}h+wo@,a[}wl-> H Og>mC|($>Bod!ҹZ5?g"ZbtDmEkmA Q.˕PS M,d bM42¨\C$=ed*Q_#2uRUTqS?M&WC7sV%8|zcg,jځRawͯJSR$3HM_Ҫt\n\!z%=! Bt Ѳ^IedU׾Kg2)2FKB9\ZMM.Z_"):#OR<=: 0kXV_u60|dђ膤_:k9480+ |u :#^G< {qܸϤ ȳ[up$|HMaNxU}OjM!Aw}X:PEٵip!URR9?ټLO0XU#Df)^Wm5i839!Qo )6' )5^t8H)xAAȩu[=h6C$9 ݸV<(sbdʓvc:o<ӺнBJ̶Z~'o/2H) )k&߶K v$4gV2^-x}+bHXXDt.h[~Д,>wgg{s.8@#' ou|%q&**+|xI 8;71L`="{yǑZ~)%A;w(cJmw+zSy|.`{sY!(Z>|n8 qb4Z,W H[z2 p>2v=5;u60ИO0z播$6 gM1&Ő*.5,V! S͝AºbCMYfheFWHz걁$<~TؒMuͣ*y,ټn475ҁayQ; x ֟Cl}?d6a\j[+L/Dt^|b;AVWS }|lυ!DӍLźgJ[B}3 6oT^y.F{L[\`)4rt6O~RUnMrlp<;"}Gћl$wq@oW\ܼOC5 ~=W.)dC!3p35$GӍLD{Idwgg93>0J$tÚ:غcd"A}(u8&Uf(>Rxi; ]@NUIF$4I ]=܅ds?_)D#.BlۮncC/019]ՙɏݗhnU|sfz 9FTU;.s@;[Th7.Lw!ĩ٫uӽ+TIdku7|xqTeR 4\{rړW_[9F2FHzEfL@3? 4$5]QhN@0n@:bn-@2:=:J]Ֆ" NmooSCO\Ԉ¯;t}N_ʚ݉. aHryL.-Ůf8_h5KoDs/n?bBA?5hOy+dXyC`_l0? ѹtśˀPVI :jAFuکBS Imb6V PUb jLEE dZr߿} m$g}M_E#0RK^Ǟ?O]srQpqfns}e 06\Z+lWarы*mYAkJЕPR_N1Үcn-c'&2p (3#~:z@@" ˭[S I4ȭhl2*# 첤3Gx\EC~s)fly] 1@x] # mqz&TEF+BE70 ]iJH6#(!bN}0S8 g1X /s(2G}Yŝ?K0#P¥"dYRib䌂Q&|a{7!I*L 3E7-ːPJ804˵"n#'Fkط/GqE׍vk_N:P0RY2bw3#+:9D59 dDt;H_l6+˴ad]+s# (z5' aPhAc]ET17i%b MŒKH Ϝb V^cMw9rnJN0MSW Tt,j jՉ tn04>:ߔ|r!Kǧ YYfhsu16d\Xs/{9&2aHIN>J"p,\<FFG{k, Ffv|456R255آ\ ,Qst*'נ zRx&EYs%=Sh 1;\0F;@CNa)@rikn29kC\UOˡcJ!~}]kƭ16?k.{l$?~~?? 8ܐd$cg (f7"pqQQ20=ƬM9ǽyrxm\8lfYM^9K\X"inoa99 e'WWp.ANZH튲nGGEn?_B3hGg99 C<[8|SSS HOr H\*x =̢BBIbBRCKab(ه3]ᆘþ<[zskﴤO%YHdzZkingb%|O]q jVo܍BE;tjV| }9"*e];';o 89u5QE}ktwEUU 3{Y1ڔ]-"DtL: QW f8)rT9Uc Æk : CKs6&]4gɿAx;#rxN9<|z QJABͽMM̐L.yUzm|~ژ#91]˜[۲NYe3)z-DhD hHDMDYeYe#$ +EԴbU/4t1n ;;QahL*Qx*KgSfڐW[>43CW'.OK]~ 5玀Th0\j1he>iTguןwѷ}yl0pg^z{Q1e"a{悁mDe#=\E +2[ 6̅֋oF~VڼM1/O/&'MOstVyTVR^.^|/}7gj@nNnZRHc#%0%dq~{1JEhlnk%! :gH<_%_[*'tI&!#S#RxaBس* %}[|6jvfRd 8W2 J$Wk+o *0t߭lz(fRawizYngqŜ֕@ecXyټо 3|*AKZىF]4UMN,^PQ``+ڵ$ܐUp[MF OŋZ47ʃxG۽c#.68Ўۥ-ɲH#%t5JH93tS>D$cO3~.QNz/)F .uQa:ʝĔ{1D"v!C;t9$AoА5<04'ȆmNwc+.t}`` ⪁:hS]B䠾zs{D[9畈`s_g-7"\ז뉫&M-^.E Qqiea ΚN%6ٴf=fcir ќۡc=W\4#"ywu㢯04O G+Ӂ@c$!}T'|ıqxPs {Ԗ+kS} o@hNR##6:>RJU"ҩ[ R%f;y  x %@OŨgT;?{J^*z;ٜ|NOؼƪ=6G]Xt˾'WŜ:᪁!8Mwj_ q]oJ 8.@ܪvoxVdKg Uyc-GLSBXb,nks KT*V?y?qƣJ]/}+Y7ݙ%  /sblT&t4M$lգ]I*.W=jFs)" Cc޿3JqbX  O\{ln!?-b8r0?{O>?Z|Batl <0TQa6 \m?̨u&Wmr'A(T >lBQWvY-gm IDAT6\8M3G<][^02/@pM*mF f:炋bՂ) VnK \N1UciЉW$PP{=p֋sOfSkw"TE;iÖg߽Bbfk6Csif%OB\v<uHڜyx=9W/@'!i\ 83p ɞ]ky*vkZQ-cև]p̱({f ,{5 k E\α=݋Y .WA}tRPCcaOs!%IqNһ{7RJ>YŲp]L&IԆkٲe+{K<Ι3#R4@Wo52h&lcX7.B"[-pY22GFn)<4 e-tCEAV!=ffvEiT2fʢ8n' @s~iHi]\-cM\FW:8ǹ`utj҇myF(FlŰ?Ѓ]٥!]&.8b;.N`]g![P Hs"'"zY&lÛb1T q'Gފ@B(7VoPWaП.+nHg3:= ]pCpIf^/x9|h}f֯[_pY7Os%\.]]tvvN!zk!;:<* 0fV薺,YՒ%˖F hxmxx=g8m ՙdw$A *pW[@)͙|Mwtz@ 撥%uAIVj v(kmr'VPwb^\.;f]= /<'NtЭqƲ]ƦʙUU7$褡U J@,ɒCO(ŭ%n4_T=O"$o6ߏ>J58Ov1񲥠?3W م M4h,.N\nK ([U_`xúnL̖qFFo[T>ίbYUo@ʼ=jB[B]=V&ѩv)l䜋Io7hw"f$2`o@_OMWlrLV }q|[|s3X&R)ޖZ^T7$)t7.fhiEvcG9QcuGb ;`bA|Y=E:wTBw`EMvHG{pC^ bMGܔ -qĈ(kے4'A}MQE-.ζm33ȣ8u7EIv<[e|MwM:ny)wٳǛțoX?@G{f͛р@ٷb8?W\ˡvhby{m {!avZ[{2)L:E!pe2Zp|nj]bOK>yy@x=@Rq ޞΰ\n0ō$;W]araZ:%jʓO 6{^߸%0^Pıq+ rww?3?+8N"uN>[l}>\季oyBץ\!4ry^~Y^z{LM31/-؇Bd";xBH`JIYȥp/_m.e+Bam^X& *a}bU#&mڞ,_S<~/G/~ W6&D"G$ .#`}BHH4IXt7 EE) J`#d֯s?[R?\lڴM6ݒD!5p-="q.uɵ;xS3TξM{)\z"K`n+3=6.Qf=jٚUSJɦhYwRu(Wzua#` 55BDܭWs+ȡru'#dKNRG?FgG6O=N_my •Y7"R9Cze::ށ6?K_8txݮϿ';;ԤWc[ܩt{( O]K奰Kv ܽo=>7`3 n܉UTU ah˦bS *J@W}:iˮSl u;EZwvp%A~{*hY/Qլڎw) f2q WCe×[B~$:SO?/ *5iRi~+)-LV&5Ͼ+/8)ޜ݂.\Ό~fZ(sJ% Nouu/T,׭ )EwK͍<0A I5ʇ\ @\h69ͽ~42wmMT}HI֩trX[o 'ǐgrlCXtO:4ہ j.͉DBd N+[? udz#;sm5F}N< ZP` b|$N( +9 9L*Qr$&9т4 weg(6\(=0~Ul[-!if6*(&6PLn .b(.W7o̎ 绸./|c?J/6c!?/|#r9YD+.ut‚J;scw31Q43\ 6+! U"HW4DTRhC: Z$'Kخٍ-(iΓlNgud"ѕd2RbWCB Ļ/b{0zKp re n gaͿ%<ł ON:pSDdؿ أb} 6<Xa}{/F\u]ҙ h.hsDvKVlxnc15Gk')m<M]&y\zSAhbcvHz.R>D7XV0U!R0'5NHgօ]H$`A Q]Ǿ}X~ΎN}*WCfRDƱgq=ߜKCwŠnOd!le(T.F"UcM}ؿoIem߭O(jFK¦H}^@xE {}I4vWtH.](u3Ы6Ě>l)H cVP;tELaek0>X1Nّ`ZM䁃//|~{̇_ n4Jqj#c{ߡh*kYc6r(vDHdg#/C9>F;3נ5T70}{/\_Qx?ZCk?m˭DMSs*zB_vF1 i6՘X?* f I18vGqy4];wH$C;,a# HPj흗aA'qƽ-u]HEIflF=q"AR6YY(%qHHIuHy)5W`!Ϊq)T* fg6vs2;IAenz=GIw%MZNb5bU?_$/q!pD䔚:""J"Fy<\qC:$wX5̎|لBp߽s]dV57Q_Ds 8rIɮ`Ŧ{ MHtFM蚍&pхU+sm4a4$:VbbWϢmF$bxKlA2I/ԐkPP?lߌ{ւxQA*"Jömx{O0!yآ[åkRqz_ENӅ1_ ]vRfU6K]{ ~Cy*=n| XT@{/T$ןcé#-1gR<Îs<]5; 4yXa%v .bV%Y觤=2m|9;:AQ"u0bs&Ghkkgۻq{SO5U-cp;BB[P$ +Ö4 Ge- QovB8o֑N 7wA>t]*ҭuG ]ChG|qoq]ąc @sq9KQՆT#'{hOZEλЄZak;A*ھXDX,ߟǞQ&<<[ a}fɚ5kxяp߽y#?1ȱ3;Is _&nYҥX[FܺRK _ߴ#ìpwU%? p>8뺵PFsĎޱW{]nm)6mG~rF̎G6uyt wch:Kx4{WtSa;)o<'o#3 O3'd Ex{‹qMQ 1)l,`И, KeDž[)ضI063JjrǢ488;CN*E49II!lA,Wxq/pD҂Tw d?:-(Q/  ??./=X+wC bZfTWSU@KjqW, WdڦM4 r_5Z|fm|ӟ!O,;]]9@3}zଲ9u^+{s!:|t]"+euf.)H!4 3u9IB,ylY0 HBy]O~E9)%8L ]B1(}}|Wƞ3w-+ (<kdӄ@_-?Rж<I#JO0)0jƏ|tt"ϵm;,ϋص5'QPV)_}HBZg6ٛ ]q-^zӭRe=1ښĭG^CXú͘uT&åAx*CR;CI{?EՋ+XwbqJJ\qt]CtBd2>ßg…OkD9SO u_1&8d5Sdw2بK x5ٲ,,Y[巣\@L)eӉ at+k7J e!NB!W F+}wqO5;ӗ7Isy~N gp/H< ڇ:Ųi IDATLy)|pH LCkT_/^+G6aw.HLÏ}x ]xʶQ룬O tMDOU=VG Q * 9 @ 4M;?ERqlOo PV,+YԜ!^]CЇhd!t&.sϥz70mSUZYyY ɦ%06njAd!d:mcHCw?L\E;fCDN>ͅ{|Q ,_O#LF\j |WcJ?Hd3mS ȭ+| ڱFL]bF-z$C<קXt>AX!"@o@ߨ+_dw"? S4QSo 5d[?2F$H3/i! neVQ-67"P"2(0zc> m'}8wOIXTH$yLD m{nB%?D*`ꁸPN+RHN[xT2.Wm\W˔kDaREZ,6(\F/OXٕSkŃ>(g\c҃ldn|O BQ=P3w[ _3|(K3E+]-=`Uo}!D^W ;`jJ& b\PVRT*eTtww=̳=burG~#kC2joOZl @̯be21SXHYllqC*rtCoq\{7t*5ı/ ]~"61J^+po~,Ġ"#r5AA'zޜoO=zAS/Õߣi}hb'c&=R)+m + הq h=]V'&lL7lۥXj5G:Ÿ-d, ۶H@1=J,ſCcpuv2J NGnv}u'kY6.Ft! EA !Dc?qz_NJco?\9 '!9D<Ӯ>#7P/Ţ\!H,.j%psQc|`:aXF+%ʔ+//M`UbYMӹ ģm\C[gqcȅ8x􃏑xcT*ta2'l)A;Ljr1uafi0L0tJjk1_8SΝ?.)L8ݸ\"ZӰ*޸ؗxK)EI`k'7%U!$˂`Dd$VqxUJ8wV:bSDA( 8.&!T cfMb7.+Cr8 ğϜ{VuX@RcHHf %kLJju"6%_8,%FH 2fq){& {SO\֭[G.sҧ@ $َz ۯk6Fa/^;Kwm{ d\8+0\$3XϪf)9&eǤ&( ~ǾHQڵH/# WfbfMǹpmzv_QG{h{^)ض2DbJωU?BM TQRa]J&fF8GƄUg 酢Ty% f=:jƆ D;β,]Bv?PQ-AQ *66o3C缝Ʉ!TǙ]^xb[a h-\ Ƕ ㆨiPm;fya[F2ȶM8M0WM3RzwI7Mܰ'32!dKFq휂(O ;:/%P@Үŕ{{#ŠT{oE]*y-d^ƙEڷa Q'ܱcWthB⸂L,)(H-m@xJg x#2~BYf3uEI@]M Jh7AUP}##,1xO0[ }`lzwu2bAmppC~?UV=S?0(83 ~#*' Շ꽿D̅ ϭW:-ɚ5d2a@NKMBSDnVO ןs~㤄{ŅiXfWLNyU&` J\) # |67 ??,o@>)-ʁ%4~ kj*,ƿFFVf}.%ի'(iG}tԛG1\%2cn=8{gzJ+cE ¥<E ,AΞ '$mD3ee!+V9&8 2DS!"1:H#]*@c +u ygN&ST* .LD҅׌ n: ޟaP_7nؤ! .F}p6P|60>"KuEf}$IJ>hp0N֤H 3sjp8@JD`S`CoEИzHFfH/aD'kala+b' 2LP&7#~{ VA3Qjqm|_]X /%_3ƒ-R΁^8x>|JR1%?~-~EXU ^Nw]h۲`;ͧ^Wv* r@g[It]'G54 x{kSMm胛u5Guf+vb>qV=Y`?@Ef m@*&R,6VvMH:4%1Op"啶V _>Pr <=򣯄!E3PQ7"fgМ8Psa?;Oq%JS BCgޗ"i= N0<{MJ۾~ǝ\9섙 N@§P(D1'xrq 4!a& vFWfT\%Q9?@'*`)L36d DScxy@B\. y$qhƚƱrS}pA-^8ix|ڎibz>#~ѝ"D"^q*ه:>L>A ?jZyvl1t*Jku=k;/u rSR$k^\kjX}`߸P1q[JA|n+o&>H(]ADt5 \xhB~w6 NPD«Ʈ+õ_b:n @GjY4( ߱A"? T9-. S}  @z=_br?'\W ];-}uQR`c#WzX̾8⫸f mZ?)DAS$#P Ԣ hV?Gkd`@ELf[ɱ >?\W*&j@ת2gS̅3 =#|3×RK@kB OC5jk6Nn6K)>׆:DIÝull^xC~Gur$[H݋sayFJBisQl &h͝+LQDl^ %ZymQ,]:D~9^aaΌKb5)bصK_HQY'86|C$,'<#DQƹ)=[P;Foy7iʼne-!e~1lfAuHC8S>7&=ѲHɊ@צ質*Rܤc&1'c0oS(EњxMjLEqaσbPcLEED׌ +#^Jd PWrW񭕶*$܅~D0ػPT),ׁ^Kn+gUe gYSM RsT*tQE+M" ͢#{=>h=E\P-B ٸ7F_,qqV,D;plbG\VB|ɽEGHL @\%SV/Y|5"j{3\֘bSF1?|W r_:˶nvvuky|Q@5,a> k^*.fWF+Ļ=8#.L®pU(:s+nZnYY]τqc.>ccLiU QnaeOcJeTv'낫ygJwPgF/h79A6NT+lœGӍ'++K;Ƿ oZea!CHb;\'RoLe`ۿ3ty8=G4 sUg/5@Cv7V8!3߶mFF ވ*!/u4>tgFD][r \t)zށqn`ߟ#Jlԇ_ǣ?r%  p53z}G]/\U0'cQR uj"+!(͉$LFc @9$3SBQcB e&d ~Du(=_,%h(vp[,=&/>Gsz7Q`G<1g:oNn)0lYJW.L3Q_BuV&"XWM@}a|8Bޑ3"+Ek XOYgFԡ~_jG`9\Wrq8$/<:R [)II^豷c\A[(":ZAJ91fYl-;[ɶk-1j?=>06oJ擞E"Rc>ۭiZ@ k̝"+׃7/^pѹ>9KwG-&Fl n98!u]8s-ar2nH$`QKZf.L> :;/"ծqg]S/!=\0;V##W((ax~sK8$VCRah(N*"¥xM -쯫GbpDp]?vQ5~ue\hJs+e鴵WJ̑7,UCM:}K"jOV M3!cr>wkuL&C#J4H$W0AYaPX|oLfp[SBErj$866Ɛ%Bl[fAkWh]}8y33xnqݜN ߧVѭp_e D)(ŭOC&yЅV!rRsC% VUyhu E3CqeYKp[ ޺d+k `\@MxW\ IDATIHtuR=0tq7fF80_BiR 7ow/OuEWL|ittD o"tc9׭K9' cYBbHK+Ҥ,7 [tՄl;ϲmtCQL)֯[u{mJ_!d"._SrrDZuiwjKWp>ff4aV@yHV%]"mKѫWپm{ln!H8p+@)t]KIlcr2. .Z7_cfv!6gn­&_j|S \-\WR)Wd2XK>*Vy Jz,j{R $9s4/~Ee=*jMu MӐv54JX>\b "bri7J#aEV*e&''ؼyK윿hFw;!Lѡf]^b㺔0kg9zjFdG#xR.X-U@~kzO !O4&`:wy'wܱ7+K_8O:G !0Mt:a\|2f6sfoo}C)')ffB:?]'Eynfj #+T턋cY'T](]Aы"z{f8#HץbUI&gvvM7y Hbm}4mmy!%}M8X\e$Wg4JV$BV׻@bcD G.6n"Hו{ffgXn}Xa:Walȋift:C{P(pNDaǎ]]ò:7à<,b${Փ?+`1"~.\`kAyu,˪P 4sslZ4)# Httr79zm"u4)կ1[֘C#OTxɥOܢA^M گ/}ԍ$ ۷#(F@ LɍJj>33ͅtuuބ#r*e_M3$)$dDLRkfHҘfB9ق.Cx^~<7ar9GRajz*D̯Gf!/{AF&(DeJ2 U|ͬ`UzR~G_j5(SLL`ÆJV B[$z\ضͫʉ&+T²(h:[xq3 ]w,j2pUj:/@>&?|khMӤ+8},sLOOהޫ:a`&ab/JP055/<ǻU{>H*&Hl߶>.^:4خv@-A˭SC$_kEFJ&6>ڹJtgx2֭WVH$⠔D0dHӋ. {9.]N7̙3>;\WY_1 ?k&O{DJ/k$r;tv䙝mp Js LMMyW/7vm_?wd2 6i`&kuV_8lc؇$<ّ;pmO\Pe JssM&dm|wQ,)(\.si绚m_L5b`ֈhSYԢ8$It+\#^O~iesr;rDA\\Ǐ73-BW~~4zf6峏|^fYU* ժeUYXXGeQVxʸh!ؼy wE',FrIF|i6nf`dL=<$0I$թT*o=2Ӵ߼S,tG ŷfvtNSMxؾm'mcY՚ĢZrqF4} |hjtCBeqA(Ξ?TX?ȁwH$H&f9z,JDW>'GaUٲ`Zמ 43?trXR.q']\L2_[T +!_ⓦa bg\ He jjq,U ۶-˦\.12z&U3d%IGDcuKe6eQTefz7)i[L3QGrӗdٚuJ4Ͷ-z)ΞUz;6Źz-5h1(J;{n-ŏ|qr\ >W,)Tccc\rqQ3߷ݻ 4n5Rp9}; mv6mR_ ' \Coơrldl掚>';UBį|탩d@Lg>و| eSoY6e׾{mò,f66wAA>gp`#T&}5ţL z5 rd\{,%9H!YL*4!@rU{``O|cSze yeF(lڰ;v߿vlnܸ0taIb2b׎]tttb."(s'$t9:rG"eKrDkLI 6+{zzS"?eUj gʩ{D¤+E&V V|7[6mw-d2wMWd2Y hF> t ;\>  " %"uQAŗd+.K;2SB[arJtD#_qĖE[lKhɲH$BI  }7ѯϙ7Dگjjfzzfz滿ce9HlnZi"΄E H<GqI u7 ڔ 9DxUb t.`w>w]xpZbuF^ )IL乶@t ]=rH6>l4h먺.ffӴ\6Mٲ,ض#X$W!|u.\_}/V}#oDB @`={?;0̃rL&?,Coe@}M3D cFuB'^F>_5kSZl tu`xp}}(J'rW7[fL4^)iOԔ2meɺX.a\iq]>>{{֎ziHwwW7ALyWIb /Mcz".\L;L#ã< l8:`4B?*X,bxċ;`FMnΝJ{\ 9iR0w>ֹؖZU4?QiG#LO)'br]HҰl!g0V& Β˝:Q,Z)mI0D $giz*,֭q j"0C0k=7hvMoWvqxO0Z`t„A6CgGҩL7z-!+`xpF7X,^T j۶Z Ӵ|[6o/0ƶܶgmr% \)ut<Mox#쾎h_ M(@No4p ?lz} {'5eHX*&hMi0PB[em,[oɻَԧ(y|Tk>} gkW[gmoBR7:2w.#V@h\A1̻&&j簼Z%@:ATFwWOx R[-$@? ϟ_#'76,뮻l+fn6Fij57hiw+ =9 l{"Qو;ʘq ʐқJk༉,1?qxzt0 t$^fz.έQ ȷ]E `F!x;h\mΛ8rckskr~%jM҇Oϣ Qҟ3?C

    3o~[dzV Ρn2C~@}h%P܂Vɖ(&\DCy: 2Mma^Bo8 SS8# 22 to2[nk,Cvߛa7ov>HCxƔ_XX@6 $ F%n#3^ۡy4e5-wA6]ShP_m/(3 1k y"O;`>C2ԧ IB!p Fvqf`9Bf €bIbH|wޕCfK h4C eIRc }~vڛю h1257 HE0Je"3_c`iΒVműmkw#GGbSa[gP4׎'{P4VVVPT~+$#Ya?0ˎldt&5T8M.dr+N:1~sy X'aPL5C7Mo0˃9b]fYiHRh6EWLJ.`ssdaq. jE;loon=XALBGGN6c?RJoݭamBZѸ>Wu<` _"ԹS]@:{h+:o/rRa gu"@l0N;Ԛ7zIe .-9LNN¶mtV倝i--ڟyɯ{u=3 Cb(|QѨǶ*:u^+;Sð}JxaI`vv.dNx+NoYb&6^Xܞ)*d`zѨk{,½{=l7*ޚ_倠a[` %<{ WwyAIOx~tf{j%8g逧S@[۶l\@<) <!Lmi=o(4uml!ݎo|{~] o4(m?ůۯV\."&''hCW{%7tg\jsy뙞#aֳm5:nęx_V<t# 5j8H[F6ߴiz{rع|?? J93Oam+wL >%d--ԧǎSS_nlF+.yݻjg@msO~a+M;w6TkB6Mv<5*uUs]>]1$ fOgDC #j*nE)XrWo0XiU; o I&汰0NRg vXt~SOR i*y߫m-I]V֢ŵ'uu qpnW ݷ~0Mro(̼"#SNIHI ̡IWw- ,ˆ뺜^u 4՜c%||끑K2 Z qab,d?9\+ޏ,K 4O`Y,KbNZo%TCm _aurΝ׀f5{;"R)~ܸf>`ǢZޙ1{RZFpISjj]! 0B3l͐=tf~ b9 hΝkQ`Q&k^qc2"MD3}2%`FxZ+SؿoRnƮc^@#@3Ө2 5$D#=3gB 51,T6}<$d$DSV.BT: ߜ](6}- % goۮO~uu/N~6J4 Qxѹr҄* c(Ե%yiVsQG@ ={4Ojo@$WPI:"ӗPT`N+Yj OWɄ(XCt|9ɿ} " "d2n z-))|Os IDAT{zzP,CskNA38Z`\8p02vIBq$P8LqWж]F]\^-|`dd$v@rna۪5Fӧϴ4? 濪1?gNUDyBe|>u5jd [c0 ȮYQnoV2 GvD恈~ǥKNM!5&H(T҄6mOpTm0g0?]}dbhhLBY#&ŋQVJ!Tb%]HCxO3U4Hmk&W 2el d`ڤ~Y 8؄pd%_O&?q.[@ Y)h%~8)NԔt٬ +sI@:}Rȁ xN:::B4JK>VG%? yMxsU!K~f3-3!}z%Yoj:nooRf@Gjq.O(>TFm .{Z?E+P3@*u[K)r .a4{uT*M`Z#>\+8pR?@*fvvjt%jS1fx.2~RHn@g D! .Zˏrvrz3vtwwqYy9s6e6 +3fJzw Ӕ|AK d[+dZqg0` ͪ%hm{"n$1ͨIEl= ~?>>!4тf-uheI-,8QZ*h9 FC -BWj@099Zƙ6&.^ ^$S2%5IsZ,ZD`hpP)ݾk˭ $U"seqZV?!G&I}]>$=G 82&EVTPPj%,O[ԌO 9[}N neљtyGQʅF@q˗ ϓ*{}>LD Sry䲚`CưuS #GOwӡϒ=sȽGAly/o|$wt`HT)Wd-KXX縣æ hL&Bro1ÃibJEPᰆ\<uQ,Z4Ŗwq/hDU *>j 2`Sg2֠'MFC,]]Lٛa~"R )]p7$Ļ1KlY7/Xc=m:::Q7B7ua@Z,<1H y5N7~rd2Y\AڶsB{D _u_ŠpX%C8/Ue @ R<kiN] DdLM*zX^ 0o?.\h MrAXpTo;ǁxEkuY< u>!IwZjv%HK@?h}k^׸n&"u|r `ff5S+]@x Z_$u(^ U3#nM4 ju):mec (0ʂ7\,gJOK݈"u֟{qV "}k8|vq4]HVӜo L&L"+N`pI PM:T@4D&+0GNZ&J9QTix?Wgy߫~O;-on ++2A+^녉OT*UT*!-8Sf"~~wT=$?B6wbkZuu8YyWL?U8-Wp4ߨ직?#^?޳!_Fz<1|` rY7t(ܳ^~5 BFn5Od8"1hE"Nҥp/3,"};?/צ60Nt[D T%7ܧqh |_.TcKF---q?t&UGMD2⑯"= 񴽢Q^,7ض[G&j5T*֔kyP@?HAR&5 Jb$ u;u. 47 tP* DuqF:P3"@!%:]6)r4?K$8ZD3t-^dB>Ox3AEuj&OWA=TA`t?D ~h:3=ꕁx>_FkT&E8W/--IL]D7=mVJ||G.ZYYQ%"F ?Z~ht@FN o@]c#?j9_`Y&| .M+eWTؒfJYL-..VIA32PB;Ɨ]mF x7:Mτ@KyXl\]P(q(3AWo6M.?@*F__/7ׂH!^ Z -Z ķGo%ynMܵ@ݱ2 NlVK#׹@0)0H o S l6 ׭FNǯR3z~a ])pQnt?N‘L"'cBTrΎ+ڭh>^ȱ[ӓSZ1in$^DaÕ*,8:ЗCT|`2uRX_#Cc۫/J@r B1FWFaףTZy cX4f9iq5$ G 6LyV "dgz]Y hwL Yq@B<-{xǞW0 emf-("Ǐ+ 4A,,,pA;:xe`LDxF^D3;.8J!PWPV$l?/R;qRO+-Rů >'ONMb”R0  .JJ&!;V*єM\P7Uw#QoWd2طoSSSXZRZK &PW>qnBT*ř<-J2h@ƵxL2L'ds?q6GG7P \%,,,(ZxC׎Drln B@%Cu?S*!_%h|U {wOݣUA A ?#uҲ"d8v\}>_`|vR!|A}gc>=-֭pVeKg'Bs[<D 㡇> 33x$$)ㅀXE  L='Cx3uZe@w۷O4%E8ȵILMM*xol6O@5sb+'׸4zM.W qĞ> C}zǟx\i]ON4/" J#I!8H&⠉Di!#&ZQ} ?~Nl6կ=nض-a(KV+TVcL;֏ w?џG_9LqeIXf}aǑ=]C05|f$hit3P=w9ٳ]]=2CF7^Q=č'^RA O4VzHb mۊQ! Np=<]%AOc |P&劚lGmcaKVa&F ^RH&Gpy[I@\rQEٔoWWWɤ?4PE9O&c ^(W2sx `}lJT*?|YI|#/4 q@(<[o;N+<۶79Hv ͢G|-ʓ^gkC|ntsJrC=G ϼ4Duatz) M8 @sF??y###(Z!Ngy .&g8g,]Dӆ%qǖe\cӚq 33ſ`O9tYY%tww?+ϝTJ]{pm8)+ ,y^k!/c?5N͏6UϟA<$lKĎߦl/𓇴?;3{=k-ewֈ6wj8+9+y<}ùX7'';6 l+.yJi]xcY\\hH0(ܹ}?8(=^F%7HW3}u(}߾|'O[X\c,,7V*o$e"gϜ?0:HVp t\vSB&A6E:mdòl 2c,[L7:A ܲVˢdN d2@VVqCڄ|>2|C8_Rh۶ms X7mƮk r\$au:#|DL}..M_S'0qn"b xg'?ON癞 k]”l}g߻m0 ݳrzMTe@!/Of z S8t i=Odj˦?=]_#\l6_/T̳rیatuu#" _ЮW@zAG fFj x"Ϟ|"bh6O}}K_>Q7g~Yh ~A|Ƿnd2۱sNͪ2y,@c&fsx#w]4?O"X ` 饽 ~ߴ_sRXۯt:NdYҙtk. ,$. 5=<Ѩh5PTHf뺉]`?M.B5NӲ5<|=?nĎ;ck+ {U\x?Oh{~&'|3 }_.K @AFb?zmr~ٹo?y[o!j~E@}}z{uxÿ1-S]0080wB\wp\+us\3t>t' Bw 4o\.==F܁b|>l6T* Իn^'KWs&o x2py2&QьՕ3_ѣNB_/Xx@E!j|]w^:3 XD?_ssssGϜk_ZFljP5B û\?p  t:[n)2B0M3\T7ݫ luQH&] 4'N>$˸ACs,@Gux@]?ط/Mg2{m]/jąwO>=>>ϽEewyܞnT юxWGP@_6Q[]]]_;0<_*zeZ2Ӳr`Y:#ūA .sg5yn黍fch3f&^xK/,6=j}|C T: І8r1r7~dl\6{<y'N/WQV`-NBasRGBbKGD pHYs B(xtIME  0g` IDATxwu0 LPY%Q%lW-`ӒLQ^{[ْVdJ)"H 93 &]?{f df}>5]] oooooooooe}wsލtc CHQKYv'卡7StF& )K ` rV"O Icw=ѩ7,`ڎ77ہ.Hv }Bꅧy rʿ{bFcCZZb:f5w,e[Ǧ%_ !XWOoD_}ͬmHMŁ\Hq$s<i9zzS#d>j V>}pݮ-`h՝,l9APA%jK\,= ύsyN9fğ(c3Pc@w{u5Qv]kuTA RW>o9rC:o,˕8q]#4U* `脃aS#%@R29cCy$/L-4'g_+-w!/m+iEQBDu Sqq\,Kpr^Ɠ.կ{c,6Mx艃<$ELNB5>8Y(%޻{Axb~h<$霅#4DO$pv 0B x4UUQU`/=*CL+P y(5FgCE@J8yn?CƷu)?t{?|Rwׯ%kqw~2l#:Hs JT~-srH{h} -@R$<.-`*s)}DI\H\šma,ϟ:N îtO>w?p<CA~]s5'&85ʦ/Mލ֑z+r[GQE4sNpzj(TU-rmL%l'n|C9Oݸb擨 $ C=CP RBr8;$hh$"VCsc-O Xg]ߜ:;S ;fIobNd A"i)qێ`aZ!d:j{SyT~=%t0C' ,l#U"&j~_tu =E\+N-+{[!lhk4$ 'dDԎ־wqah{o! [pxf1KKat>!x/(N1BjBFbџ -Vb.ǍVπa»]=ΰO=L:Z 0Wu-|coÑ1u]یOJiougؽ>ߵ w*{gYGB@:kaRYUX5|BeB?[zr?̰ (U | )g+$3:,.byӐx5_BU*zhZ u{1IaF75[xhP` ,͵! M%bv5s8^`մΞ|{nykE|]obUOA&gV`KИ8VE*e$R~TUě/ $Qte C(J Aq8Dgib]ߪ -ͪ廨"f|v=߃a̰_E4bi,ВL̮r$C)Z<x "`k͊[OϜ|kA/$(:x[X O!QH]?qsz6E\eh)GP,"OXR2d R\Nu (@P*/M%+l!__͔\ᩭH!0 PZ~9t\ ~-;/Rew&uZ-qukAmar.G" 0tƆ xJv/H@]Vt7ףA`KIsa6|mEgcgd 2/5hIQur[qWlDkmAP5TCAǠi|*N^EZƗYgWIDScג-XQVpAJCгjH`1XƝD8 Y/|Bnd+%ylӆ+Tc?@W.+v`׏άu!1~WZ8L@*xәG~G?Q#ЂO AmRv$tE_B2JW5N;ᅲjEV(ut\3l ^l1)8&|MY)454^Y "O}Z}[ʴ#lƕpt|uyݏ:럡ZyΌ̲%F8suy+SK7MsS@6G~VtMv\OrX8)rBCOQʘD%‘wc&Rخ]qcg 7E9dSdsrL"&YToT@%)CR!@JH57Ulo%=}?v-_gn8BT9FY%+O&1#~.҃\ dHsvb\=|-a"N̢f4¶ЄE2J\LYZE&!dA"A{JВ8r\ p){A2<} -mZ<ù&c~="s纤h+I9>-]Mp.*d5􉟍D[Wyd`rBW@NR8;P,pkpB5@:`E#R`{Ĵ)LdU!+ޔ@Q=IK%&728-N8\U)pQYW\J&lxra*t+2lNHvo<.y/[Vop WJz`3_"e9Ի2(rپ S:3 e}'A]~49A:z-݈#?4r:𼙽b`3׾f'e DLZ"aT:wts߯/k`]w[65C3q=寕[L8ZLбPmrV,_jnnel{º7!B崳%z)[q sҠ z)^A'-4w:FS2 uرMH<^v-Sfdn%b8yUcH1ϥAQө7F24ՆhmTkeot[x GfABW㋋N-;VLjp]o=MUr]7۩[=qE"rΐ޼%(?JJ dphpm m?|=^$>]ar6-%|]Rpn,EcM)%+:GSo5#[KhcR%o\0d2,,mqN8^\.Ǿ}/ۻ .\r98ƶ%? zy@7z+ԸLL/-̠I8 WmĪ؂)Ί7|Thwt’#=MS('pa*5:Zk+?ykErīhJx}qr,cjn=V+;h(j{* lټr5EQؾ}' #]z-0ضx ;[ͼX#kn+V-]]|}&p2@i5m\xdr9@\\(_OARH`d2YGd#P׷Au-Ƹƛ/鷾+&Pc?M@s֔;,e%q%a\uQKPLOgBSMw߿w8:2@\srIb+'*DlӯTCǡ螄rDQߨ9;7{Ipqx3cbb'Uٵ6I"S*Zb^0IDŤ3Y9EGKY RUWQו4ڛj%Qdb6GMd28ꢃ̩61WŘ:Z\=x5xֹ#&%Z( | s¥Z?#~ϷP5>:555O*ϭP`+ j!5%N09T2e!Vṹ_]]H/g9!`tv4]GI$lp(M$8MPO" ࡃUꕫP(̞17Z1F$ R1*lwsM&WRJ;ccK ;33eYjY B-%6+6iap.6-*>vΣtI娍ŦZ RX UHIRl:ϟz7B )xbl3<^o^[8ǯ;6SՍW~#G?^O4W >Nkk+H}UAn&^%DH444<ʋ^(ssM7i5Srov$.p55Gi\G^5~t佞A^t֢Է01+c8X(1H̠y@9R`ճ¢Ü90,`}a=lf`L":ۉY2_k_*Җ8æt_F 9KKG=UqOZ!&Arn)ĢtG^2(_iqi[|{d8LE-cO^"F")s?㸾 jEfU@DKkjkr\N ofMBruB-#8O ,[G<+KȯG"}c$EYu" )MÕ+V`Y?M܍bبrmvnE?sNvyEfZ֬^t_&>_G=k(1N ;#rpKhFY5L/'U 5XbGDe ]ŕ:.ҕXRS_#7KjlHh4 ob'{-}z?ExLBBކJ!ϐ韼"Eب"TFԓDSʁnEͣ2AYXkHLO ynqse\c\ fggȑLLNxaT;T+f"u#qEMU;vQtUS*YrH!#e֋W,RGffq7mf˖m^}Ɣ:s(r(1bnA^!$1s! a^1ڏPK:0,[ @!cnCѲ#$9lڅAΞ@xe&`@6m?~n/'OHN/U%X)hV`8c_їV,v$Q+x=.v]}[Eq*TWhV Ί{Tߕ6駫 K&h R\ث7By!O"w:BPG]`,*M!G)\:뎻y;M"ᕸknM!BjJ:UlfRFKdd)G/xT UX[wmu'_yIO|oY nӫo),5 ~ڞoHdQIW"<[@dhV~A6ځpVBFTuϢ$:!+b@4!`AǥKA!/6x3q'Uߔ,$K;4w=N>Zldx'[-w2+ΣTIbL|kզaԫn6Z[| ^ԉRT4xu1 ̖]SƇ^G:jYju8Li݂ۺ͘G U2zE{Qih\ۄIb8B [(Umjtq]umV=^z%ƺ!P` -eNҗ)':GL$˺5Y޷H>Ubw,(@8bfJqddʎ1R?`Q<3{5l~ua/?: >SD9BZYdm+WBU|p (R+8dŇPO"U̓fp6ۉ04Ĕ,(gż[y){.q5M0|k;H2 q썴k'7Ge=D~&!bᕥП6lbL糘n?tE 63s~Vܖ|?yU!Cr\:-a]ċUXץp`mߌHC̝$R `aEyXVM>N9"$!%I҉/TUP,=ĜRY.E,t1obQ۶qgj) [޽8W,t4C&\PL#3g.XqN"fc tp%byW|էS<W" Ae$Ϲ[TΓ$K9~© * *R}+-QUhԳ}"F | JWhrJS]%( + ~|XXްY ^.ƺcg7X$셫Vm r%S'o\YTo-ET9T6B ͟`SsrP{/K+#!R|`{w(o,D/ bXSAQ\6/292_.Dz6H,45ru7Znw,[+ _ED V*%;ϸjrSII˷YWKss9qq\)UF_e|0)})ΐ>BC9TQz)*"TKs"AJPPAJFF+/|}4{i+:\[i\te) RJfg˹lUOWlJ}s-@䊭lR_㠪J/Ay^~y;RuA+خ!R{3IOȿo/~x<555Zq}Fs_*\9-Pr;AV4tcjx?LǽXwQm A2 P,OH$hhKQ \\\V2B2ٌ_*&ãXtŮҲ3Sxd,).䊿q hizT_7gP܂ݻAr~r \gr_S!DQ: 2/}-ͣ{翠F9;8^Y Kb+˧.xwrj 0Eu_!E'tGGFH&=g-*nUt.~"VقS+Μ.K\{ ,Ϝ9㇕SɅz>q5W!|yG/)f^૯D)%Pد}\gJDT=ERvB&K-}_^5^ HRCRdG%+ß7/w|n,cMӈUu~UYT*3gN15奷(j8Ɂ;lm8/^sy#, y=CiX^~WHt~1_^3 ġϴRϱS~\P/ny昍SDܓO&IXqb@"^Kb񛙝a=E%Xsh 45W+NW֭2c2@y &4pdT'EY9~Bʕ6 ڇnqE 4?BxI"Q[UXٻ+pHd<#~eLJX Tw(5eo{'Jq4mm4fXqބDq\3"MAs(jÜ >:J;Ki\Y3Ū(v!y8Mkk[-4u>6RUX,})%~.ʥ1 #2vvGTE E&vlہ359I>P(p1Eޯmu`$ c&iÄQA_JWxx'}m;Yn;HA>1'C.h̉\xm韀bapIӸ(sYQU՗^H^a|< w<l[.k̥8XU@|QUs4{v֮Y'el&dށÜ?#.룹ٟD"i=v}Ӟ01xy}B+ ZJT/ykz 4d=D.Who6m"^ HӼe+sB07mpؓ/=5t&˟˯\)>+ (?k_{Q|\.G&!͒fs)ĕls=MhlhP$ ac80D_RiTkDgbvR5,k(v7߲y ;_XV9fggHҤR)Μ=黅47Dr]t:ͅ >}yY|%hD"A,'y5:w褓~?4R]e ӟp0C (wߔAJYLz|s| 3O.crjir +/k0uuu J"o^E _H?ndO+Jr?R0eU\t:y B%hki{YQyضSDF8eM⋳ECʽ??Ur;\|RVjH_iiiN("'H$jH$jIԐ'DE"+/CöZp+ρ4$LԢ˨(*h&:ۻhjj _|޼R4)ݪ9!%]-osF'ŧ?kEP) {]%ɾՑ~NPP(`YVqSUP7 QU+lO_ϞܹZY:)%#1m,Qϰz=[x%8," N)^f/ 0 @ @0,fuϮf0MXv=#F8r0BQ6|޽;n;!2m~ʲ<6ؙٝ]⩃:,QDQl ]T.'E-(Z4{FijS菠(PiAQE|4n:9N-[|Ȯ)ѢHQ\K}9ˤ6T vݙzG' lۨVboH$ߚFDC=<@7C3u\vlߎ޾B6>( L ۖfwQT–prtH$uCL*= 6f]{r iZ$L ;1}yf"uǝG_|WGi/H_/߭'M8v1aO\Z! [148,8l ˍFyX\ չVhEIzG}mSGi]t#]IwHt^1mnjX_/ 4b[Ld2iqӲ,5ɤ!h q7jB)ϧ`@ahtDAW\A*dy`wv#&{*~<4)uG؝UݼѨ@sss0M.X|2aK1to L"2qxWv<+Ȓ,6ٱ}my46L}gN~?|7r>o7Įt'T=*ZHkNWe{6C%_0^ z\HlZɅsP8)a$~'"8LYC^e+TNDC a(J(!Bvg6:6މH-A.iLGy Op҄A!2}*Jhpj۶m\?/>4AY8#&`BmZiiiVI#RݥbND*Zt]G@Tusl%ѽ$I@ޡsW"4`fDauk6:; >E^Q!σi8(B {ԩ0, 9`†t(bbtBd4֖%2@Nõ[Xx>hj3S&?u]GVCPm?7lɎr_HȲ,r]Sf@-~cICyR4J2J2ŢG0k`J=aRC91$G5zv*/0BD _ɒtkO JzeU6 HowG5IW6E\BPDXDZt} [; X=/p|~'aɄE(S^ R)A&mttM' E cbP2j{j{[J\.T*#_1ćET--堪2,>P<px{6~}}YeEJEFBAԩS/jJ"K+^nӖ$4S0 ~8-%tI%(\L&bbIeKȓZ4ҍ]'Q񇕕UR&R) nlޥ|F,%JBcP0::*L8?tMZ; Nr,xpx֏X,  I%nF A3Z63PV1Ǎ;D r$& 1MT3jh/f3mR R:s2}ǫ@Vlm}vmL&cׁ>+ Z3PՅⅤ"D+xKv*Tu TUzanpۃO:m -O@1U_D/O dY ehm@MUcc1b(2xC})l$џ֑IiȤ4Y:@z"AhSt:ä" 6(Iօ+&f+t6׋+9@=ګ8xUwB^{߻|[sp?^=ribbb!AtOj `[*`k$ !cc  RR|+1D8=f&lcxxmD~V~?޸p^\dYAЏݞ@$ٳ SSE:KDQuȔ h3x$)w(U\([}.!BULMMQo,.8L\*=phoJkN%JhJ~|w7Oؿ:e lSN.ξcf o_^Uȭcq)W XZ^Ǎ RdP*6.FL|ץFB 󘝽*h0(~lkCԓ{`288?g:r4&4?9or|aqqyܵk׊*rp a]^h'O>|anbʉV]_]{?홙Uϸ9-U5>p6* I衮ҝw9s P"l7ՁNF\./ ܹj#B  xnۻt&}(D++/=]XX{oW*@eQf/S;n<,wX]v< 8qbmޛNz*9P>'ASqvV/KkkkGo1&8!9;y`?.q6㎑Ȟp< -H~>ԛXB!ny~vs3:nj;b IENDB`smuxi-0.11/images/22/0000755000175000017500000000000012311344241015061 5ustar00meebeymeebey00000000000000smuxi-0.11/images/22/smuxi-frontend-gnome.png0000644000175000017500000000275412311344241021664 0ustar00meebeymeebey00000000000000PNG  IHDRĴl;sRGBbKGD pHYs B(xtIME &H1lIDAT8˝[levgvum|8Yk MCZ6DQA/>jh%Zj*}(< * iB$Bmٻޝ3s-*~yΧCLL?o߷O}+s`coz0MP vaiKŷO~+ӻ urh0%_9BŘ'g?FC11߻cx{Z^RE H/q]O:NUt'?||yJYgڭ5&?\dE.a,U]Ō]$/9,z<û~vcvklOIfX_I/wU2q!^ԉ*WCp3o*@ρ_ņ;w1$ttL0Wɢi1Ρs\vsvvlǐOb[=|@:r_(,:3؍.$ aOࣩ+ԛJ/=RJtЙ~yƄͫ QLЙPH$%ɤT]T\ۦeQLe9ghXO7Y6z7wLrVDE.ϳsd #I6ʶMq;,$#X[mhF{-a.rAcU?IՉѵHG+i*:,lwƔ( BiDQ? YYř/{ QcC4as_w?)Bzu]7>LG -\bj)%/de+ȑʕR4k!<.1|bVZfITռE^Q(?Ν;Bh4F^g|8OEZ@oRpۨT T5f)~c<3y73O}}mv}fu],$2,N7VQ_aCMr%%6n$~Z Ĥȣ>9ˍiZPH#bq|_yx7ϳ!Ⱦ)jeJ&>JUZp]up]&aD1ÒTL"$N#^yBfffbmW P-^/!<s|<;ٶwy+$p:ɤ-/{WGGĎm;4-+RHrɷGn ( @5μcG~=/Çߘ. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or1k-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: smuxi-0.11/Makefile.am0000644000175000017500000002014712257043746015450 0ustar00meebeymeebey00000000000000# Engines if ENABLE_ENGINE_CAMPFIRE PO_ENGINE_CAMPFIRE = po-Engine-Campfire endif if ENABLE_ENGINE_IRC PO_ENGINE_IRC = po-Engine-IRC endif if ENABLE_ENGINE_JABBR PO_ENGINE_JABBR = po-Engine-JabbR endif if ENABLE_ENGINE_TWITTER PO_ENGINE_TWITTER = po-Engine-Twitter endif if ENABLE_ENGINE_XMPP PO_ENGINE_XMPP = po-Engine-XMPP endif # Frontends if ENABLE_FRONTEND_GNOME PO_FRONTEND_GNOME = po-Frontend-GNOME endif if ENABLE_FRONTEND_GNOME_IRC PO_FRONTEND_GNOME_IRC = po-Frontend-GNOME-IRC endif if ENABLE_FRONTEND_GNOME_TWITTER PO_FRONTEND_GNOME_TWITTER = po-Frontend-GNOME-Twitter endif if ENABLE_FRONTEND_GNOME_XMPP PO_FRONTEND_GNOME_XMPP = po-Frontend-GNOME-XMPP endif ACLOCAL_AMFLAGS = -I . EXTRA_DIST = install-sh \ expansions.m4 \ mono.m4 \ programs.m4 \ HACKING \ LICENSE \ README.md \ CREDITS \ PROFILING \ FEATURES \ BUGS \ TODO # HACK: distclean in po/ does not work for some reason DISTCLEANFILES = \ po/POTFILES \ po/Makefile \ po/stamp-it \ po/Makefile.in PODIRS = po \ po-Engine \ $(PO_ENGINE_CAMPFIRE) \ $(PO_ENGINE_IRC) \ $(PO_ENGINE_JABBR) \ $(PO_ENGINE_TWITTER) \ $(PO_ENGINE_XMPP) \ po-Server \ po-Frontend \ $(PO_FRONTEND_GNOME) \ $(PO_FRONTEND_GNOME_IRC) \ $(PO_FRONTEND_GNOME_TWITTER) \ $(PO_FRONTEND_GNOME_XMPP) SUBDIRS = lib \ src \ $(PODIRS) # forcely disable parallel builds export MAKEFLAGS=-j1 update-po: for PODIR in $(PODIRS); do \ echo $$PODIR; \ $(MAKE) -C $$PODIR $@ | egrep -e '(:$$|messages)'; \ done update-pot: for PODIR in $(PODIRS); do \ echo $$PODIR; \ $(MAKE) -C $$PODIR clean; \ $(MAKE) -C $$PODIR check 2>&1 | grep -v 'mismatched quotes at line' 2>&1; \ done update-transifex: tx pull -f -l ca,cs,da,de,en_GB,es,fa,fi,fr,hr,ko,nb_NO,pl,pt_BR,ru,sk,sv,te,tr,ur,zh_CN mail-po: update-po for PODIR in $(PODIRS); do \ echo $$PODIR; \ podebconf-report-po \ --deadline=+14days \ --notdebconf \ --package="Smuxi ($$PODIR)" \ --utf8 \ --from="Mirco Bauer " \ --smtp=booster.qnetp.net \ --podir=$$PODIR \ --langs=cs,es_AR,it,pt; \ done call-po: update-po for PODIR in $(PODIRS); do \ echo $$PODIR; \ podebconf-report-po \ --deadline=+14days \ --notdebconf \ --package="Smuxi ($$PODIR)" \ --utf8 \ --from="Mirco Bauer " \ --smtp=booster.qnetp.net \ --podir=$$PODIR \ --call; \ done install-po: for PODIR in $(PODIRS); do \ $(MAKE) -C $$PODIR install itlocaledir=$(abs_top_builddir)/bin/$(PROFILE)/locale; \ done LIB_DIR = $(top_builddir)/lib BUILD_DIR = $(top_builddir)/bin/$(PROFILE) WIN32_LIB_DIR = $(LIB_DIR)/win32 WIN32_BUILD_DIR = $(top_builddir)/bin-win32 WIN32_ICON_THEME_DIR = $(top_srcdir)/images/Smuxi-Symbolic OSX_LIB_DIR = $(LIB_DIR)/osx OSX_ICON_THEME_DIR = $(top_srcdir)/images/Smuxi-Symbolic OSX_BUILD_DIR = $(top_builddir)/bin-osx OSX_APP_DIR = $(OSX_BUILD_DIR)/Smuxi.app OSX_CONTENTS_DIR = $(OSX_APP_DIR)/Contents OSX_RESOURCES_DIR = $(OSX_CONTENTS_DIR)/Resources OSX_BINARIES_DIR = $(OSX_CONTENTS_DIR)/MacOS LINUX_STATIC_BUILD_DIR = $(top_builddir)/bin-linux-static WIN32_EXE_FILES = \ $(BUILD_DIR)/smuxi-frontend-gnome.exe \ $(BUILD_DIR)/smuxi-server.exe WIN32_FILES = \ $(WIN32_EXE_FILES) \ $(LIB_DIR)/Mono.Posix.dll \ $(LIB_DIR)/Nini.dll \ $(LIB_DIR)/log4net.dll \ $(WIN32_LIB_DIR)/plink.exe \ $(WIN32_LIB_DIR)/fixedsys500c/Fixedsys500c.ttf \ $(BUILD_DIR)/smuxi-common.dll \ $(BUILD_DIR)/smuxi-engine.dll \ $(BUILD_DIR)/smuxi-engine-campfire.dll \ $(BUILD_DIR)/smuxi-engine-irc.dll \ $(BUILD_DIR)/smuxi-engine-jabbr.dll \ $(BUILD_DIR)/smuxi-engine-twitter.dll \ $(BUILD_DIR)/smuxi-engine-xmpp.dll \ $(BUILD_DIR)/smuxi-frontend-gnome-irc.dll \ $(BUILD_DIR)/smuxi-frontend-gnome-twitter.dll \ $(BUILD_DIR)/smuxi-frontend-gnome-xmpp.dll \ $(BUILD_DIR)/smuxi-frontend.dll \ $(BUILD_DIR)/Meebey.SmartIrc4net.dll \ $(BUILD_DIR)/Twitterizer2.dll \ $(BUILD_DIR)/Newtonsoft.Json.dll \ $(BUILD_DIR)/agsxmpp.dll \ $(BUILD_DIR)/StarkSoftProxy.dll \ $(BUILD_DIR)/Db4objects.Db4o.dll \ $(BUILD_DIR)/ServiceStack.Text.dll \ $(BUILD_DIR)/ServiceStack.Interfaces.dll \ $(BUILD_DIR)/ServiceStack.Common.dll \ $(BUILD_DIR)/Microsoft.AspNet.SignalR.Client.dll \ $(BUILD_DIR)/JabbR.Client.dll \ $(WIN32_LIB_DIR)/smuxi-frontend-gnome.exe.config \ $(WIN32_LIB_DIR)/smuxi-server.exe.config OSX_FILES = \ $(LIB_DIR)/Nini.dll \ $(LIB_DIR)/log4net.dll \ $(BUILD_DIR)/smuxi-frontend-gnome.exe \ $(BUILD_DIR)/smuxi-frontend-gnome.exe.config \ $(BUILD_DIR)/smuxi-frontend-gnome-irc.dll \ $(BUILD_DIR)/smuxi-frontend-gnome-twitter.dll \ $(BUILD_DIR)/smuxi-frontend-gnome-xmpp.dll \ $(BUILD_DIR)/smuxi-server.exe \ $(BUILD_DIR)/smuxi-common.dll \ $(BUILD_DIR)/smuxi-engine.dll \ $(BUILD_DIR)/smuxi-engine-campfire.dll \ $(BUILD_DIR)/smuxi-engine-irc.dll \ $(BUILD_DIR)/smuxi-engine-jabbr.dll \ $(BUILD_DIR)/smuxi-engine-twitter.dll \ $(BUILD_DIR)/smuxi-engine-xmpp.dll \ $(BUILD_DIR)/smuxi-frontend.dll \ $(BUILD_DIR)/Meebey.SmartIrc4net.dll \ $(BUILD_DIR)/Twitterizer2.dll \ $(BUILD_DIR)/Newtonsoft.Json.dll \ $(BUILD_DIR)/agsxmpp.dll \ $(BUILD_DIR)/StarkSoftProxy.dll \ $(BUILD_DIR)/Db4objects.Db4o.dll \ $(BUILD_DIR)/ServiceStack.Text.dll \ $(BUILD_DIR)/ServiceStack.Interfaces.dll \ $(BUILD_DIR)/ServiceStack.Common.dll \ $(BUILD_DIR)/Microsoft.AspNet.SignalR.Client.dll \ $(BUILD_DIR)/JabbR.Client.dll LINUX_STATIC_FILES = \ $(LIB_DIR)/Mono.Posix.dll \ $(LIB_DIR)/Nini.dll \ $(LIB_DIR)/log4net.dll \ $(BUILD_DIR)/smuxi-common.dll \ $(BUILD_DIR)/smuxi-engine.dll \ $(BUILD_DIR)/smuxi-engine-irc.dll \ $(BUILD_DIR)/smuxi-engine-twitter.dll \ $(BUILD_DIR)/agsxmpp.dll \ $(BUILD_DIR)/Meebey.SmartIrc4net.dll \ $(BUILD_DIR)/StarkSoftProxy.dll \ $(BUILD_DIR)/Twitterizer2.dll \ $(BUILD_DIR)/Newtonsoft.Json.dll dist-win32: if [ -x /usr/bin/dmcs ]; then \ COMPILER_OVERRIDE="MCS=/usr/bin/dmcs"; \ echo COMPILER_OVERRIDE="$$COMPILER_OVERRIDE"; \ fi; \ DIST_VERSION=$$(git describe); \ ./autogen.sh $$COMPILER_OVERRIDE --without-indicate --without-messaging-menu --without-notify --without-dbus \ --with-db4o=included \ --with-vendor-package-version="dist-win32 $$DIST_VERSION" $(MAKE) mkdir -p $(WIN32_BUILD_DIR) for FILE in $(WIN32_FILES); do \ cp $$FILE $(WIN32_BUILD_DIR); \ done for PODIR in $(PODIRS); do \ $(MAKE) -C $$PODIR install itlocaledir=$(abs_top_builddir)/$(WIN32_BUILD_DIR)/locale; \ done mkdir -p $(WIN32_BUILD_DIR)/icons cp -r $(WIN32_ICON_THEME_DIR) $(WIN32_BUILD_DIR)/icons makensis $(top_srcdir)/src/smuxi-win32.nsis dist-osx: if [ -x /usr/bin/dmcs ]; then \ COMPILER_OVERRIDE="MCS=/usr/bin/dmcs"; \ echo COMPILER_OVERRIDE="$$COMPILER_OVERRIDE"; \ fi; \ DIST_VERSION=$$(git describe); \ ./autogen.sh $$COMPILER_OVERRIDE --without-indicate --without-messaging-menu --without-notify --without-dbus \ --with-db4o=included \ --with-vendor-package-version="dist-osx $$DIST_VERSION" $(MAKE) mkdir -p $(OSX_BINARIES_DIR) $(OSX_RESOURCES_DIR) cp $(OSX_LIB_DIR)/Info.plist $(OSX_CONTENTS_DIR) cp $(OSX_LIB_DIR)/smuxi $(OSX_BINARIES_DIR) cp $(OSX_LIB_DIR)/smuxi-server $(OSX_BINARIES_DIR) cp $(OSX_LIB_DIR)/smuxi.icns $(OSX_RESOURCES_DIR) for FILE in $(OSX_FILES); do \ cp $$FILE $(OSX_BINARIES_DIR); \ done mkdir -p $(OSX_BINARIES_DIR)/icons cp -r $(OSX_ICON_THEME_DIR) $(OSX_BINARIES_DIR)/icons -rm smuxi-osx.zip cd $(OSX_BUILD_DIR) && zip -r ../smuxi-osx.zip Smuxi.app dist-linux-x86-static: $(MAKE) mkdir -p $(LINUX_STATIC_BUILD_DIR) mkbundle --static -o $(LINUX_STATIC_BUILD_DIR)/smuxi-server $(BUILD_DIR)/smuxi-server.exe for FILE in $(LINUX_STATIC_FILES); do \ cp $$FILE $(LINUX_STATIC_BUILD_DIR); \ done tar -czf smuxi-server-$(VERSION)-linux-x86-static.tar.gz $(LINUX_STATIC_BUILD_DIR) dist-linux-debs: git checkout -- debian/changelog dch -b \ -v "1:$(VERSION)+git-1~$$(date +%Y%m%d%H%M%S).$$(git rev-parse --short=8 HEAD)" \ -D "$$(lsb_release -r -s)" \ "Building git snapshot." dpkg-buildpackage -b -us -uc run: run-gnome run-gnome: all cd $(BUILD_DIR) && \ mono --debug ./smuxi-frontend-gnome.exe -d run-stfl: all cd $(BUILD_DIR) && \ mono --debug ./smuxi-frontend-stfl.exe -d 2> smuxi-frontend-stfl.err run-server: all cd $(BUILD_DIR) && \ mono --debug ./smuxi-server.exe -d .NOTPARALLEL: smuxi-0.11/config.guess0000755000175000017500000013036112311344234015717 0ustar00meebeymeebey00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: smuxi-0.11/compile0000755000175000017500000001624512302342414014757 0ustar00meebeymeebey00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: smuxi-0.11/lt~obsolete.m40000644000175000017500000001375612311344225016223 0ustar00meebeymeebey00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) smuxi-0.11/po-Engine-IRC/0000755000175000017500000000000012311344242015626 5ustar00meebeymeebey00000000000000smuxi-0.11/po-Engine-IRC/fi.po0000644000175000017500000002734412300202374016573 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Kalle Kaitala , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-11-20 11:27+0000\n" "Last-Translator: Kalle Kaitala \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/smuxi/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} kutsuu sinut kanavalle {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "Hyväksy kutsu (liity kanavalle)" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "poissa" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "viive {0} sekuntia" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "ei yhteydessä" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Käytetään välityspalvelinta: {0}:{1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Yhdistetään palvelimeen {0} porttiin {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "Yhteys palvelimeen {0} muodostettu" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "Kirjaudutaan sisään..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "Yhteydenmuodostus epäonnistui!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "Yhteydenmuodostus epäonnistui! Syy:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "Katkaistaan..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Katkaistaan yhteyttä palvelimeen {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "Yhteys palvelimeen {0} katkaistu" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "Yhteys katkaistu" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "Ei yhdistetty" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "Yhdistetään uudelleen..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Yhdistetään uudelleen palvelimeen {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "Virhe uudelleenyhdistämisessä" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "Nukutaan {0} millisekuntia" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "IrcProtocolManager -komennot" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "Epäkelpo portti: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "Liittymisiä jonossa: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Kanava {0} on jo auki. Kirjoita /window {0} siirtyäksesi sinne." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Aktiivisia liittymisiä: {0} - Liittymisiä jonossa: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "Liitytään: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "Jäljellä" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "aktiivisia liittymisiä: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "liittymisiä jonossa: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "IRC-operaattori" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "Omistaja" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "KanavaHallinnoija" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "Operaattori" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "PuoliOperaattori" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "Ääni" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Aihe kanavalle {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "Ei aihetta kanavalle {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "Porttikielto" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "Ei porttikieltoja kanavalla" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "Porttikieltopoikkeus" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "Ei porttikieltopoikkeuksia kanavalla" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "kutsupoikkeus" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "Ei kutsupoikkeuksia kanavalla" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "Käyttäjätilasi on {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} on jo kanavalla {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Kutsutaan {0} kanavalle {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "Käyttäjät" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Yhteensä {0} käyttäjää [{1} operaattoria, {2} äänellistä, {3} normaalia]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "Yhteysvirhe! Syy:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Ei tarpeeksi parametrejä komennolle {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "Ei yhdistettynä palvelimelle" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: Ei tällaista käyttäjää/kanavaa" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "Korotettiin lähetysviivettä {0}ms jotta vältytään ylivuotokatkaisulta jatkossa." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "Käyttäjätunnus {0} on jo käytössä" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "Ei voi liittyä kanavalle:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "Sinulla on porttikielto" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] teki CTCP {2} -pyynnön {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "CTCP PING -vastaus käyttäjältä {0}: {1} sekuntia" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} -vastaus käyttäjältä {1}: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] liittyi kanavalle {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] on poistunut kanavalta {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "{1} potkaisi sinut kanavalta {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "{0} poistettiin kanavalta {1} käyttäjän {2} toimesta" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "Sinut tunnetaan nyt nimellä {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} on nyt nimeltään {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} muutti kanavan {1} aiheeksi: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Tilan vaihto [{0}] käyttäjälle {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "tila/{0} [{1}] asettajana {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] lopetti" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "Yhteys palvelimeen {0} portti {1} on epäonnistunut (yritys {2}), yritetään uudelleen {3} sekunnin kuluttua..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} on poissa: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "Poissaolomerkintä poistettu" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "Poissaolomerkintä päällä" smuxi-0.11/po-Engine-IRC/zh_CN.po0000644000175000017500000002635012300202374017172 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Dean Lee , 2012-2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-13 08:02+0000\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/smuxi/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} 邀请您加入 {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "接受邀请 (加入房间)" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "离开" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "延后: {0} 秒" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "未连接" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "使用代理: {0}:{1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "正在连接到 {0} 端口 {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "到 {0} 的连接已建立" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "正在登录..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "连接失败!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "连接失败! 原因: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "正在断开连接..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "正在从 {0} 断开连接..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "已从 {0} 断开连接" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "连接已关闭" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "未连接" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "正在重新连接..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "正在重新连接到 {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "重新连接出错" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "睡眠 {0} 毫秒" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "IrcProtocolManager 命令" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "端口无效: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "正等待加入: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "已经加入了频道: {0}。输入 /window {0} 切换过去。" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "已经加入: {0} - 等待加入: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "正在加入: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "剩余" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "已经加入: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "等待加入: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "IRC 版主" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "主人" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "超级版主" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "版主" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "版主" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "认证用户" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "{0} 的主题: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "{0} 尚未设定主题" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "封禁" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "频道内无被封禁用户" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "封禁例外" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "频道内无封禁例外用户" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "邀请例外" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "频道内无邀请例外用户" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "您的用户模式为 {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} 已在 {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "正在邀请 {0} 加入 {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "用户" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "总计 {0} 位用户 [{1} 位版主, {2} 位认证用户, {3} 位普通用户]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "连接出错! 原因: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "{0} 命令参数不足" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "未连接到服务器" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: 无此昵称/频道" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "发送延时已增加到 {0}ms 以避免再次被服务器挤出。" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "昵称 {0} 已被占用" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "无法加入频道:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "您已被封禁" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] 请求 CTCP {2} 来自 {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "CTCP PING 回复来自 {0}: {1} 秒" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} 回复来自 {1}: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] 已加入 {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] 已离开 {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "您被 {1} 从 {0} 踢出" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "{0} 被 {2} 从 {1} 踢出" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "您现在的昵称为 {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} 现在的昵称为 {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} 将主题 {1} 改为: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "用户 {1} 模式更改 [{0}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "模式/{0} [{1}] by {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] 已退出" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "到 {0} 端口 {1} 的连接失败 (第 {2}次尝试), 将在 {3} 秒后重试..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} 离开: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "您不再被标为离开状态" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "您已被标为离开状态" smuxi-0.11/po-Engine-IRC/POTFILES.skip0000644000175000017500000000044212300202374017740 0ustar00meebeymeebey00000000000000glade/ src/Common/ src/Engine/ src/Engine-Campfire/ src/Engine-JabbR/ src/Engine-XMPP/ src/Engine-Twitter/ src/Frontend/ src/Frontend-GNOME/ src/Frontend-GNOME-IRC/ src/Frontend-GNOME-Twitter/ src/Frontend-GNOME-XMPP/ src/Frontend-STFL/ src/Frontend-SWF/ src/Frontend-WPF/ src/Server/ lib/ smuxi-0.11/po-Engine-IRC/tr.po0000644000175000017500000002430612300202374016615 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # zeugma , 2013 # Umut Albayrak , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-11-20 11:27+0000\n" "Last-Translator: Umut Albayrak \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/smuxi/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} sizi {1}'e davet ediyor" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "uzakta" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "lag: {0} saniye" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "bağlanılamadı" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Bağlanılıyor {0} kapı {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "Oturum açılıyor..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "Bağlantı başarısız!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "Bağlantı başarısız! Sebep:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "Bağlantı kesiliyor..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "{0} bağlantısı kesiliyor..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "{0} bağlantısı kesildi" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "Bağlantı kapatıldı" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "Bağlanılmadı" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "Yeniden bağlanılıyor" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "{0}'a yeniden bağlanılıyor" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "Yeniden bağlanma hatası" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "Geçersiz kapı: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Aktif katılım: {0} - Kuyruk : {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "Kalan" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "IRC Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "Ses" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "{0} konusu: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "{0} için hiç bir konu belirlenmedi" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "Kullanıcılar" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "Bağlantı hatası! Sebep:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "Sunucuya bağlanılamadı" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "Kanala bağlanılamıyor:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "{0} olarak biliniyorsunuz" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "" smuxi-0.11/po-Engine-IRC/pt.po0000644000175000017500000002626512300202374016621 0ustar00meebeymeebey00000000000000# Translation of smuxi-engine-irc messages to Portuguese # Copyright (C) 2010 the smuxi's copyright holder # This file is distributed under the same license as the smuxi-engine-irc package. # # Américo Monteiro , 2010, 2012. msgid "" msgstr "" "Project-Id-Version: smuxi-engine-irc \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-07-25 06:24+0200\n" "PO-Revision-Date: 2012-07-25 23:18+0100\n" "Last-Translator: Américo Monteiro \n" "Language-Team: Portuguese \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.5\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:245 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} convida-o para {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:276 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1538 msgid "away" msgstr "longe" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:282 #, csharp-format msgid "lag: {0} seconds" msgstr "demora: {0} segundos" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:288 msgid "not connected" msgstr "não ligado" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:354 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "A usar o proxy: {0}:{1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:361 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "A ligar ao {0} porto {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:367 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:473 #, csharp-format msgid "Connection to {0} established" msgstr "Ligação a {0} estabelecida" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:370 msgid "Logging in..." msgstr "A efectuar o login..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:404 msgid "Connection failed!" msgstr "Ligação falhada!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:405 msgid "Connection failed! Reason: " msgstr "Ligação falhada! Razão: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:414 msgid "Disconnecting..." msgstr "A desligar..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:417 #, csharp-format msgid "Disconnecting from {0}..." msgstr "A desligar de {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:422 #, csharp-format msgid "Disconnected from {0}" msgstr "Desligado de {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:425 msgid "Connection closed" msgstr "Ligação fechada" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:430 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:487 msgid "Not connected" msgstr "Não ligado" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:459 msgid "Reconnecting..." msgstr "A voltar a ligar..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:467 #, csharp-format msgid "Reconnecting to {0}..." msgstr "A voltar a ligar a {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:481 msgid "Reconnect Error" msgstr "Erro ao Re-ligar" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:885 msgid "IrcProtocolManager Commands" msgstr "Comandos do IrcProtocolManager" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:960 #, csharp-format msgid "Invalid port: {0}" msgstr "Porto inválido: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1064 #, csharp-format msgid "Queuing joins: {0}" msgstr "A colocar entradas em fila de espera: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1078 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Já entrou no canal: {0}. Escreva /window {0} para mudar para lá." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1113 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Entradas activas: {0} - Entradas em fila de espera: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1136 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1167 #, csharp-format msgid "Joining: {0}" msgstr "A entrar em: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1138 msgid "Remaining" msgstr "Restante" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1143 #, csharp-format msgid "active joins: {0}" msgstr "entradas activas: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1152 #, csharp-format msgid "queued joins: {0}" msgstr "entradas em fila de espera: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1525 msgid "IRC Op" msgstr "Op de IRC" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1527 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1529 msgid "Voice" msgstr "Voz" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1589 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Tópico para {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1594 #, csharp-format msgid "No topic set for {0}" msgstr "Nenhum tópico definido para {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1674 msgid "ban" msgstr "banir" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1684 msgid "No bans in channel" msgstr "Ninguém banido no canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "Inviting {0} to {1}" msgstr "A convidar {0} para {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1800 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} já está em {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1825 msgid "Users" msgstr "Utilizadores" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1867 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Total de {0} utilizadores [{1} ops, {2} vozes, {3} normal]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1998 msgid "Connection error! Reason: " msgstr "Erro de ligação! Razão: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2008 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Parâmetros insuficientes para o comando {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2018 msgid "Not connected to server" msgstr "Não ligado ao servidor" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2284 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: Não existe tal alcunha/canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2413 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "" "Atraso de envio aumentado para {0}ms para evitar ser posto fora do servidor " "por flood outra vez." #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2427 msgid "Nick" msgstr "Alcunha" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2437 msgid "is already in use" msgstr "já está em uso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2447 msgid "Cannot join to channel:" msgstr "Não pode entrar no canal:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2455 msgid "You are banned" msgstr "Você está banido" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2531 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] pedido CTCP {2} de {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2556 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "resposta CTCP PING de {0}: {1} segundos" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2564 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} resposta de {1}: {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2770 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] entrou em {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2896 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] abandonou {2}" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2922 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "Você foi expulso de {0} por {1}" #. TRANSLATOR: do NOT change the position of {0} and {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2933 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "{0} foi expulso de {1} por {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2953 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2986 #, csharp-format msgid "You're now known as {0}" msgstr "Você é agora conhecido como {0}" #. TRANSLATOR: do NOT change the position of {0} or {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2991 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} é agora conhecido como {1}" #. TRANSLATOR: do NOT change the position of {0} and {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3028 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} mudou o tópico de {1} para: {2}" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3105 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Alteração de modo [{0}] para o utilizador {1}" #. TRANSLATOR: do NOT change the position of {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3115 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "modo/{0} [{1}] por {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3152 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] saiu" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3229 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "" "A ligação para {0} no porto {1} falhou (tentativa {2}), a tentar de novo em " "{3} segundos..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3278 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} está longe: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3284 msgid "You are no longer marked as being away" msgstr "Você não está mais marcado como estando longe" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3290 msgid "You have been marked as being away" msgstr "Você foi marcado como estando longe" #~ msgid "Not connected!" #~ msgstr "Não ligado!" smuxi-0.11/po-Engine-IRC/fa.po0000644000175000017500000002302712300202374016555 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-11-20 11:27+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Persian (http://www.transifex.com/projects/p/smuxi/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "" smuxi-0.11/po-Engine-IRC/fr.po0000644000175000017500000002751112300202374016600 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Clément Bourgeois , 2012-2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-11-20 11:27+0000\n" "Last-Translator: Clément Bourgeois \n" "Language-Team: French (http://www.transifex.com/projects/p/smuxi/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} vous invite sur {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "Accepter l'invitation (rejoindre le canal)" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "parti" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "lag : {0} secondes" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "non connecté" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Utilisation du proxy {0}:{1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Connexion au serveur {0}, sur le port {1} en cours..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "Connexion au serveur {0} établie" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "Enregistrement en cours..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "Connexion impossible !" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "Connexion impossible ! Raison :" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "Déconnexion en cours..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Déconnexion de {0} en cours..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "Déconnecté de {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "Connexion fermée" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "Non connecté" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "Reconnexion en cours..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Reconnexion à {0} en cours..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "Erreur à la reconnexion" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "Mis en pause pendant {0} millisecondes" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "Commandes IrcProtocolManager" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "Port invalide : {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "Mise des en attente des inscriptions en cours : {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Vous êtes déjà sur le canal: {0}. Utilisez /window {0} pour passer sur celui-ci." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Inscriptions en cours : {0} - Inscriptions en attente : {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "Raccordement : {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "Restant" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "raccordements actifs : {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "raccordements en attente : {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "Opérateur IRC" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "Propriétaire" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "Administrateur de canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "Opérateur" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "Demi-opérateur" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "Voicé" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Sujet de {0} : {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "Pas de sujet sélectionné pour {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "ban" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "Aucun utilisateur banni sur le canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "exception de banissement" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "Pas d'exception de banissement sur le canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "exception d'invitation" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "Pas d'exception d'invitation sur le canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "Votre mode utilisateur est {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} est déjà sur {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Invitation de {0} par {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "Utilisateurs" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Total de {0} utilisateurs, [{1} opérateur(s), {2} voicé(s), {3} normal(ux)]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "Erreur de connexion ! Raison :" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Pas assez de paramètres pour la commande {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "Non connecté au serveur" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: Impossible de trouver le surnom/canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "Augmentation du délai d'envoi jusqu'à {0}ms pour éviter d'être kické pour flooding du serveur encore une fois." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "Le pseudo {0} est déjà en cours d'utilisation" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "Impossible de rejoindre le canal :" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "Vous êtes banni" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] a fait une requête CTCP {2} de {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "Réponse CTCP PING de {0} : {1} secondes" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "Réponse CTCP {0} de {1} : {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] a rejoint {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] a quitté {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "Vous avez été kické de {0} par {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "{0} a été kické de {1} par {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "Vous êtes maintenant connu en tant que {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} est maintenant connu en tant que {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} a changé le sujet de {1} en : {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Changement de mode [{0}] pour l'utilisateur {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "mode/{0} [{1}] par {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] a quitté" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "La connexion vers {0}, port {1} a échoué (essai {2}), nouvel essai dans {3} secondes..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} est parti : {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "Vous êtes marqué comme étant revenu" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "Vous avez été marqué comme étant parti" smuxi-0.11/po-Engine-IRC/sv.po0000644000175000017500000002734112300202374016622 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # flugsio , 2013 # flugsio , 2011, 2012 # Martin Bagge , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-10 16:37+0000\n" "Last-Translator: Martin Bagge \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/smuxi/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sv\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} bjuder in dig till {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "Acceptera inbjudan (anslut till rummet)" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "borta" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "lagg: {0} sekunder" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "inte ansluten" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Använder proxy: {0}:{1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Anluter till {0} port {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "Anslutning till {0} upprättad" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "Loggar in..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "Anslutning misslyckades!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "Anslutning misslyckades! Anledning: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "Kopplar ner..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Kopplar ner från {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "Anslutning till {0} nerkopplad" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "Anslutning stängd" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "Inte ansluten" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "Återansluter..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Återansluter till {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "Återanslutningsfel" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "Väntar i {0} millisekunder" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "Kommandon för IRC-protokollhanterare" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "Felaktig port: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "Köar kanalanslutningar: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Redan ansluten till kanal {0}. Ange kommandot /window {0} för att byta till den." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Aktiva kanalanslutningar: {0} - Köade kanalanslutningar: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "Ansluter till kanal: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "Återstående" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "aktiva kanaler: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "köade kanaler: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "IRC Operatör" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "Ägare" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "Kanaladministratör" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "Operatör" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "Halvoperatör" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "Voice" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Rubrik för {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "Ingen rubrik satt för {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "utestäng" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "Ingen är utestängd från kanalen" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "undantag från utestängning" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "Inga undantag från utestängning finns för kanalen" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "undantag från inbjudningskrav" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "Inga undantag för inbjudingar finns för kanalen" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "Ditt användarläge är {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} är redan på {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Bjuder in {0} till {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "Användare" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Totalt {0} användare [{1} operatörer, {2} voice, {3} vanliga]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "Fel i anslutning! Anledning: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Inte tillräckligt med parametrar för kommandot {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "Inte ansluten till server" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: Användaren/kanalen finns inte" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "Ökar väntetid med {0}ms för att undvika att bli utkastad från servern på grund av för snabbt hanterade kommandon." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "Användarnamnet {0} är upptaget" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "Kan inte ansluta till kanalen:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "Du är utestängd" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] begärde CTCP {2} från {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "CTCP PING-svar från {0}: {1} sekunder" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0}-svar från {1}: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] anslöt till {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] har lämnat {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "Du sparkades från {0} av {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "{0} blev sparkad från {1} av {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "Du kallas numera {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} kallas numera {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} bytte rubrik för {1} till: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Ändrat användartillstånd [{0}] för användaren {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "användartillstånd/{0} [{1}] av {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] har avslutat" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "Uppkoppling till {0} på port {1} har misslyckats (försök {2}), prövar igen om {3} sekunder..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} är borta: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "Du är inte längre markerad som borta" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "Du har markerats som borta" smuxi-0.11/po-Engine-IRC/ur.po0000644000175000017500000002222712300202374016616 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2010-11-30 04:12+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Urdu (http://www.transifex.net/projects/p/smuxi/team/ur/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ur\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:234 #, csharp-format msgid "{0} invites you to {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:255 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1468 msgid "away" msgstr "" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:261 #, csharp-format msgid "lag: {0} seconds" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:267 msgid "not connected" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:337 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:343 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:438 #, csharp-format msgid "Connection to {0} established" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:346 msgid "Logging in..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:369 msgid "Connection failed!" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:370 msgid "Connection failed! Reason: " msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:379 msgid "Disconnecting..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:382 #, csharp-format msgid "Disconnecting from {0}..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #, csharp-format msgid "Disconnected from {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:390 msgid "Connection closed" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:395 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:452 msgid "Not connected" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:424 msgid "Reconnecting..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:432 #, csharp-format msgid "Reconnecting to {0}..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:446 msgid "Reconnect Error" msgstr "" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:816 msgid "IrcProtocolManager Commands" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:887 #, csharp-format msgid "Invalid port: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:997 #, csharp-format msgid "Queuing joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1011 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1046 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1069 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Joining: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1071 msgid "Remaining" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1076 #, csharp-format msgid "active joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1085 #, csharp-format msgid "queued joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1455 msgid "IRC Op" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1457 msgid "Op" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1459 msgid "Voice" msgstr "" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1519 #, csharp-format msgid "Topic for {0}: {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1524 #, csharp-format msgid "No topic set for {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1604 msgid "ban" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1614 msgid "No bans in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1726 #, csharp-format msgid "Inviting {0} to {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1730 #, csharp-format msgid "{0} is already on {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1755 msgid "Users" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1797 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1928 msgid "Connection error! Reason: " msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1938 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1948 msgid "Not connected to server" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2156 #, csharp-format msgid "{0}: No such nick/channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2279 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2293 msgid "Nick" msgstr "" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2303 msgid "is already in use" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2329 msgid "Cannot join to channel:" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2337 msgid "You are banned" msgstr "" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2413 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2438 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2446 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2643 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2769 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2794 #, csharp-format msgid "You were kicked from {0} by {1} [{2}]" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2802 #, csharp-format msgid "{0} was kicked from {1} by {2} [{3}]" msgstr "" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2819 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2852 #, csharp-format msgid "You're now known as {0}" msgstr "" #. TRANSLATOR: do NOT change the position of {0} or {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2857 #, csharp-format msgid "{0} is now known as {1}" msgstr "" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2894 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2970 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "" #. TRANSLATOR: do NOT change the position of {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2980 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3017 #, csharp-format msgid "{0} [{1}] has quit" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3094 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3143 #, csharp-format msgid "{0} is away: {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3149 msgid "You are no longer marked as being away" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3155 msgid "You have been marked as being away" msgstr "" smuxi-0.11/po-Engine-IRC/en_GB.po0000644000175000017500000002366112300202374017145 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2009 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # Ryan Smith-Evans , 2009. # msgid "" msgstr "" "Project-Id-Version: smuxi 0.6.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-08-05 01:46+0200\n" "PO-Revision-Date: 2010-01-08 23:53+0100\n" "Last-Translator: Ryan Smith-Evans \n" "Language-Team: English (British)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:221 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1425 msgid "away" msgstr "away" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:227 #, csharp-format msgid "lag: {0} seconds" msgstr "lag: {0} seconds" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:233 msgid "not connected" msgstr "not connected" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:301 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Connecting to {0} port {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:307 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:402 #, csharp-format msgid "Connection to {0} established" msgstr "Connection to {0} established" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:310 msgid "Logging in..." msgstr "Logging in..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:333 msgid "Connection failed!" msgstr "Connection failed!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:334 msgid "Connection failed! Reason: " msgstr "Connection failed! Reason: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:343 msgid "Disconnecting..." msgstr "Disconnecting..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:346 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Disconnecting from {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:351 #, csharp-format msgid "Disconnected from {0}" msgstr "Disconnected from {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:354 msgid "Connection closed" msgstr "Connection closed" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:359 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:416 msgid "Not connected" msgstr "Not connected" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:388 msgid "Reconnecting..." msgstr "Reconnecting..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Reconnecting to {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:410 msgid "Reconnect Error" msgstr "Reconnection Error" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:760 msgid "IrcProtocolManager Commands" msgstr "IrcProtocolManager Commands" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:829 #, csharp-format msgid "Invalid port: {0}" msgstr "Invalid port: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:957 #, csharp-format msgid "Queuing joins: {0}" msgstr "Queuing joins: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:971 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Already joined to channel: {0}. Type /window {0} to switch to it." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1006 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Active joins: {0} - Queued joins: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1029 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1060 #, csharp-format msgid "Joining: {0}" msgstr "Joining: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1031 msgid "Remaining" msgstr "Remaining" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1036 #, csharp-format msgid "active joins: {0}" msgstr "active joins: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1045 #, csharp-format msgid "queued joins: {0}" msgstr "queued joins: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1412 msgid "IRC Op" msgstr "IRC Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1414 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1416 msgid "Voice" msgstr "Voice" #. For translators: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1478 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Topic for {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1488 #, csharp-format msgid "No topic set for {0}" msgstr "No topic set for {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1582 msgid "ban" msgstr "ban" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1592 msgid "No bans in channel" msgstr "No bans in channel" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1706 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Inviting {0} to {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1710 #, fuzzy, csharp-format msgid "{0} is already on {1}" msgstr "{0} is already on channel" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1738 msgid "Users" msgstr "Users" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1789 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Total of {0} users [{1} ops, {2} voices, {3} normal]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1932 msgid "Connection error! Reason: " msgstr "Connection error! Reason: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1942 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Not enough parameters for {0} command" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1952 msgid "Not connected to server" msgstr "Not connected to server" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2333 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: No such nick/channel" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2459 #, csharp-format msgid "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "Increased send delay to {0}ms to avoid being flooded from the server again." #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2475 msgid "Nick" msgstr "Nick" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2486 msgid "is already in use" msgstr "is already in use" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2516 msgid "Cannot join to channel:" msgstr "Cannot join to channel:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2525 msgid "You are banned" msgstr "You are banned" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2635 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] requested CTCP {2} from {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2660 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "CTCP PING reply from {0}: {1} seconds" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2668 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} reply from {1}: {2}" #. For translators: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2915 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] has joined {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3051 #, csharp-format msgid "{0} [{1}] has left {2} [{3}]" msgstr "{0} [{1}] has left {2} [{3}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3070 #, csharp-format msgid "You were kicked from {0} by {1} [{2}]" msgstr "You were kicked from {0} by {1} [{2}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3078 #, csharp-format msgid "{0} was kicked from {1} by {2} [{3}]" msgstr "{0} was kicked from {1} by {2} [{3}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3096 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3142 #, csharp-format msgid "You're now known as {0}" msgstr "You're now known as {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3170 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} is now known as {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3227 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} changed the topic of {1} to: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3312 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Mode change [{0}] for user {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3329 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "mode/{0} [{1}] by {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3366 #, csharp-format msgid "{0} [{1}] has quit [{2}]" msgstr "{0} [{1}] has quit [{2}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3487 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} is away: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3493 msgid "You are no longer marked as being away" msgstr "You are no longer marked as being away" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3499 msgid "You have been marked as being away" msgstr "You have been marked as being away" #~ msgid "Not connected!" #~ msgstr "Not connected!" #~ msgid "lag" #~ msgstr "lag" smuxi-0.11/po-Engine-IRC/cs.po0000644000175000017500000002704412300202374016577 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Ondřej Hošek , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-11-20 11:27+0000\n" "Last-Translator: Ondřej Hošek \n" "Language-Team: Czech (http://www.transifex.com/projects/p/smuxi/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} Vás zve do {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "Přijmout pozvánku (vstoupit do místnosti)" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "pryč" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "zpoždění: {0} sekund" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "nepřipojen" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Používám proxy: {0}:{1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Připojování k {0} port {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "Spojení s {0} navázáno" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "Přihlašování..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "Připojení selhalo!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "Připojení selhalo! Příčina: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "Odpojování..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Odpojování od {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "Odpojeno od {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "Spojení ukončeno" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "Nepřipojeno" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "Opětovné připojování..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Opětovné připojování k {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "Chyba při opětovném připojování" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "Spím {0} milisekund" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "Příkazy správce protokolu IRC" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "Neplatný port: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "Zařazování vstoupení do fronty: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Již jste v kanálu: {0}. Pro přepnutí na tento kanál zadejte /window {0}." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Aktivní vstupy: {0} - Fronta se vstupy: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "Vstupuji do: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "Zbývající" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "aktivní vstupy: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "vstupy ve frontě: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "IRC Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "Majitel" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "Administrátor kanálu" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "Půl-op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "Hlas" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Téma {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "{0} nemá nastaveno téma" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "ban" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "V kanálu nejsou žádné bany" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "výjimka z banů" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "V kanále nejsou žádné výjimky z banů" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "výjimka zvaní" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "V kanále nejsou žádné výjimky zvaní" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "Váš režim uživatele je {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} je již v {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Zvu {0} do {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "Uživatelé" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Celkem {0} uživatelů [{1} opů, {2} hlasových, {3} normálních]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "Chyba spojení! Příčina: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Pro příkaz {0} nebyl zadán dostatek parametrů" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "Nepřipojen k serveru" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: Neznámá přezdívka/kanál" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "Aby nedošlo opět k zahlcení serveru, bylo zvýšeno zpoždění odeslání na {0} ms." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "Přezdívka {0} se již používá" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "Nelze vstoupit do kanálu:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "Dostal jste ban" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] požádal o CTCP {2} od {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "Odpověď CTCP PING od {0}: {1} sekund" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} odpověď od {1}: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] vstoupil do {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] odešel z {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "Byl jste vykopnut z {0} uživatelem {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "{0} byl vykopnut z {1} uživatelem {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "Nyní jste znám jako {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} je nyní znám jako {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} změnil téma {1} na: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Změna režimu [{0}] uživatele {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "režim/{0} [{1}] od {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] se odpojil" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "Spojení s {0} na portu {1} selhalo (pokus {2}); další pokus za {3} vteřin..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} je pryč: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "Nadále nebudete označován, že jste pryč" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "Byl jste označen, že jste pryč" smuxi-0.11/po-Engine-IRC/nb_NO.po0000644000175000017500000002306612300202374017165 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:20+0100\n" "PO-Revision-Date: 2012-07-25 08:25+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Norwegian Bokmål (Norway) (http://www.transifex.com/projects/p/smuxi/language/nb_NO/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nb_NO\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:245 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} inviterer deg til {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:276 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1519 msgid "away" msgstr "ikke tilstede" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:282 #, csharp-format msgid "lag: {0} seconds" msgstr "forsinkelse: {0} sekunder." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:288 msgid "not connected" msgstr "ikke koblet til" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:351 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Kobler til {0} port {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:357 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:463 #, csharp-format msgid "Connection to {0} established" msgstr "kobling til {0} oprettet" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:360 msgid "Logging in..." msgstr "logger in..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:394 msgid "Connection failed!" msgstr "Tilkobling mislyktes!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:395 msgid "Connection failed! Reason: " msgstr "Tilkobling mislyktes! Årsak: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:404 msgid "Disconnecting..." msgstr "Kobler i fra..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:407 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Kobler i fra {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:412 #, csharp-format msgid "Disconnected from {0}" msgstr "Koblet i fra {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:415 msgid "Connection closed" msgstr "Tilkobling lukket." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:420 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:477 msgid "Not connected" msgstr "Ikke koblet til" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:449 msgid "Reconnecting..." msgstr "Kobler til på nytt..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:457 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Kobler til {0} på nytt..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Reconnect Error" msgstr "" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:875 msgid "IrcProtocolManager Commands" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:943 #, csharp-format msgid "Invalid port: {0}" msgstr "Ugyldig port: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1047 #, csharp-format msgid "Queuing joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1061 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1096 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1119 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1150 #, csharp-format msgid "Joining: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1121 msgid "Remaining" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1126 #, csharp-format msgid "active joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1135 #, csharp-format msgid "queued joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1506 msgid "IRC Op" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1508 msgid "Op" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1510 msgid "Voice" msgstr "" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1570 #, csharp-format msgid "Topic for {0}: {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1575 #, csharp-format msgid "No topic set for {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1655 msgid "ban" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1665 msgid "No bans in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1777 #, csharp-format msgid "Inviting {0} to {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1781 #, csharp-format msgid "{0} is already on {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1806 msgid "Users" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1848 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1979 msgid "Connection error! Reason: " msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1989 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1999 msgid "Not connected to server" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2261 #, csharp-format msgid "{0}: No such nick/channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2390 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2404 msgid "Nick" msgstr "" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2414 msgid "is already in use" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Cannot join to channel:" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2432 msgid "You are banned" msgstr "" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2508 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2533 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2541 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2747 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2873 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2898 #, csharp-format msgid "You were kicked from {0} by {1} [{2}]" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2906 #, csharp-format msgid "{0} was kicked from {1} by {2} [{3}]" msgstr "" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2923 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2956 #, csharp-format msgid "You're now known as {0}" msgstr "" #. TRANSLATOR: do NOT change the position of {0} or {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2961 #, csharp-format msgid "{0} is now known as {1}" msgstr "" #. TRANSLATOR: do NOT change the position of {0} and {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2998 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3075 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "" #. TRANSLATOR: do NOT change the position of {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3085 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3122 #, csharp-format msgid "{0} [{1}] has quit" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3199 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3248 #, csharp-format msgid "{0} is away: {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3254 msgid "You are no longer marked as being away" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3260 msgid "You have been marked as being away" msgstr "" smuxi-0.11/po-Engine-IRC/nl.po0000644000175000017500000002704612311343665016620 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Jeroen Baten , 2013 # Mirco Bauer , 2014 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2014-03-16 12:43+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/smuxi/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} nodigt u uit om {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "Accepteer uitnodiging (verbind met ruimte)" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "afwezig" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "vertraging: {0} seconden" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "niet verbonden" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Gebruik makend van proxy: {0}:{1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Verbinden met {0} poort {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "Verbinding naar {0} gemaakt" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "Aanmelden..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "Verbinding niet gelukt!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "Verbinding niet gelukt! Reden: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "Verbreken..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Verbreken van {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "Verbroken van {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "Verbinding gesloten" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "Niet verbonden" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "Opnieuw verbinden..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Opnieuw verbinden naar {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "Herverbindingsfout" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "{0} milliseconden wachten" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "IrcProtocolManager Commando's" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "Onjuiste poort: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "Wachtende joins: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Reeds verbonden met kanaal: {0}. Type /window {0} om er naar over te schakelen." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Actieve joins: {0} - Wachtende joins: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "Joining: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "Overgebleven" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "actieve joins: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "wachtende joins: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "IRC Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "Eigenaar" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "KanaalBeheerder" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "Halfop" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "Stem" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Onderwerp voor {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "Geen onderwerp ingesteld voor {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "verban" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "Geen verbanningen in kanaal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "Verbanningsuitzondering" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "Geen verbanningsuitzonderingen in kanaal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "uitnodigingsuitzondering" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "Geen uitnodigingsuitzonderingen in kanaal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "Uw gebruikersmode is {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} is al op {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Nodig {0} uit voor {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "Gebruikers" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Totaal van {0} gebruikers [{1} beheerders, {2} voices, {3} normaal]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "Verbindingsfout! Reden: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Niet genoeg parameters voor {0} commando" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "Niet verbonden met de server" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: Geen bekende alias/kanaal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "Verzendvertraging verhoogd naar {0}ms om te voorkomen dat we opnieuw van de server afraken." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "Alias {0} is reeds in gebruik" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "Kan niet verbinden met kanaal:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "U bent verbannen" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] verzocht CTCP {2} van {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "CTCP PING antwoord vanaf {0}: {1} seconden" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} antwoord vanaf {1}: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] is verbonden met {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] heeft {2} verlaten" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "U bent verwijderd van {0} door {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "{0} is verwijderd van {1} door {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "U bent nu bekend als {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} is nu bekend als {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} veranderde het onderwerp van {1} naar: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Mode wijziging [{0}] voor gebruiker {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "mode/{0} [{1}] door {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] is weg" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "Verbinding naar {0} poort {1} is mislukt (poging {2}), nieuwe poging over {3} seconden..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} is weg: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "U bent niet langer gemarkeerd als zijnde afwezig" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "U bent gemarkeerd als zijnde afwezig" smuxi-0.11/po-Engine-IRC/es_AR.po0000644000175000017500000002062212300202374017156 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2009 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # Juan Miguel Carrero , 2008-2009. # msgid "" msgstr "" "Project-Id-Version: 0.6.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-09 21:43+0100\n" "PO-Revision-Date: 2009-11-29 17:01-0300\n" "Last-Translator: Damian Kleiman \n" "Language-Team: Spanish Spanish Localization \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:212 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1270 msgid "away" msgstr "ausente" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:215 msgid "not connected" msgstr "no conectado" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:223 #, fuzzy, csharp-format msgid "lag: {0} seconds" msgstr "retardo: {0} segundos" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:285 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Conectando a {0} puerto {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:291 #, csharp-format msgid "Connection to {0} established" msgstr "Conexión a {0} establecida" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 msgid "Logging in..." msgstr "Autenticando..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:316 msgid "Connection failed!" msgstr "La conexión falló!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:317 msgid "Connection failed! Reason: " msgstr "La conexión falló! Razón: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:326 msgid "Disconnecting..." msgstr "Desconectando..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:329 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Desconectando de {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:333 #, csharp-format msgid "Disconnected from {0}" msgstr "Desconectado de {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:335 msgid "Connection closed" msgstr "Conexión terminada" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:339 msgid "Not connected!" msgstr "No conectado!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:341 msgid "Not connected" msgstr "No conectado" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:717 #, fuzzy msgid "IrcProtocolManager Commands" msgstr "[Comandos IrcProtocolManager]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:786 #, csharp-format msgid "Invalid port: {0}" msgstr "Puerto no válido: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:911 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Ya estás dentro del canal: {0}. Escribe /window {0} para cambiar a él." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1257 msgid "IRC Op" msgstr "IRC Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1259 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1261 msgid "Voice" msgstr "Voz" #. For translators: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1313 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Tema para {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1321 #, csharp-format msgid "No topic set for {0}" msgstr "No hay tema fijado en {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1415 msgid "ban" msgstr "ban" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1425 msgid "No bans in channel" msgstr "No hay baneados en el canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1534 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Invitando {0} a {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1538 #, csharp-format msgid "{0} is already on channel" msgstr "{0} ya está en el canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1566 msgid "Users" msgstr "Usuarios" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1617 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Total de {0} usuarios [{1} operadores, {2} voz, {3} normal]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1757 msgid "Connection error! Reason: " msgstr "Error de conexión! Razón: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1767 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Parámetros insuficientes para el comando {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1777 msgid "Not connected to server" msgstr "No conectado al servidor" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2080 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: No existe nick/canal" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2207 msgid "Nick" msgstr "Nick" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2218 msgid "is already in use" msgstr "ya está en uso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2248 msgid "Cannot join to channel:" msgstr "No se puede entrar al canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2257 msgid "You are banned" msgstr "Estás baneado" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2335 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] solicitó CTCP {2} de {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2360 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "CTCP PING respuesta de {0}: {1} segundos" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2368 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} respuesta de {1}: {2}" #. For translators: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2591 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] entró {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2732 #, csharp-format msgid "{0} [{1}] has left {2} [{3}]" msgstr "{0} [{1}] se marchó {2} [{3}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2751 #, fuzzy, csharp-format msgid "You were kicked from {0} by {1} [{2}]" msgstr "Has sido pateado de {0} por {1} [{2}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2759 #, csharp-format msgid "{0} was kicked from {1} by {2} [{3}]" msgstr "{0} ha sido pateado de {1} by {2} [{3}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2777 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2823 #, csharp-format msgid "You're now known as {0}" msgstr "Ahora eres conocido como {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2851 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} es ahora conocido como {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2902 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} cambió el topic de {1} a: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2987 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Modo cambiado [{0}] para el usuario {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3004 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "modo/{0} [{1}] por {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3041 #, csharp-format msgid "{0} [{1}] has quit [{2}]" msgstr "{0} [{1}] ha cerrado [{2}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3149 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} está ausente: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3155 msgid "You are no longer marked as being away" msgstr "No estás más tiempo como ausente" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3161 msgid "You have been marked as being away" msgstr "Estás ahora ausente" #~ msgid "lag" #~ msgstr "lag" smuxi-0.11/po-Engine-IRC/da.po0000644000175000017500000002660712300202374016562 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Joe Hansen , 2012-2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-11-20 11:27+0000\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish (http://www.transifex.com/projects/p/smuxi/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} inviterer dig til {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "Accepter invitation (gå til rum)" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "fraværende" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "lag: {0} sekunder" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "ikke forbundet" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Bruger proxy: {0}:{1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Forbinder til {0} port {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "Forbindelse til {0} etableret" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "Logger ind..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "Forbindelse mislykkedes!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "Forbindelse mislykkedes! Årsag: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "Afbryder..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Afbryder fra {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "Afbrudt fra {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "Forbindelse lukket" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "Ikke forbundet" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "Genforbinder..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Genforbinder til {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "Genforbindingsfejl" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "Sover i {0} millisekunder" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "Kommandoer for IrcProtocolManager" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "Ugyldig port: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "Sætter join sammen: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Allerede tilsluttet til kanal: {0}. Tast /window {0} for at skifte." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Aktive join: {0} - Join i kø: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "Joiner: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "Tilbage" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "aktive join: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "join i kø: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "IRC Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "Ejer" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "KanalAdm" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "Halfop" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "Voice" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Emne for {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "Intet emne angivet for {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "giv karantæne" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "Ingen karantæner i kanal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "Karantæneundtagelse" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "Ingen karantæneundtagelser i kanal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "invitationsundtagelse" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "Ingen invitationsundtagelser i kanal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "Din brugertilstand er {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} er allerede på {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Inviterer {0} til {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "Brugere" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "I alt {0} brugere [{1} op'er, {2} voice'er, {3} normale]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "Forbindelsesfejl! Årsag: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Ikke nok parametre for {0} kommando" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "Ikke forbundet til server" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: Intet sådan brugernavn/kanal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "Øgede forsinkelse for send til {0}ms for at undgå at blive oversvømmet på serveren igen." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "Brugernavn {0} er allerede i brug" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "Kan ikke slutte til kanal:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "Du har karantæne" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] anmod om CTCP {2} fra {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "CTCP PING svar fra {0}: {1} sekunder" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} svar fra {1}: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] har sluttet sig til {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] har forladt {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "Du blev smidt ud fra {0} af {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "{0} blev smidt ud fra {1} af {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "Du er nu kendt som {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} er nu kendt som {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} ændrede emnet på {1} til: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Tilstandsændring [{0}] for bruger {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "tilstand/{0} [{1}] af {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] er gået" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "Forbindelse til {0} port {1} er mislykkedes (forsøg {2}), forsøger om {3} sekunder..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} er fraværende: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "Du er ikke længere registreret som fraværende" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "Du er registreret som fraværende" smuxi-0.11/po-Engine-IRC/POTFILES.in0000644000175000017500000000006312300202374017377 0ustar00meebeymeebey00000000000000src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs smuxi-0.11/po-Engine-IRC/pt_BR.po0000644000175000017500000002641212300202374017176 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Leonardopf , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-11-20 11:27+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/smuxi/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} está convidando você para {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "Ausente" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "Lag: {0} segundos" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "Não conectado" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Usando proxy: {0}:{1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Conectando a {0} na porta {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "Conexão a {0} feita" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "Registrando log..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "Conexão falhou!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "Conexão falhou! Razão:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "Desconectando..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Desconectando de {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "Desconectado de {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "Conexão encerrada" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "Não conectado" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "Re-conectando..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Re-conectando a {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "Erro na Re-conexão" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "Parando por {0} milisegundos" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "Comandos do protocolo Irc" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "Porta inválida: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "Canais para entrar: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Já entrou no canal: {0}. Digite /window {0} para mudar para ele." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Entradas em canal ativas: {0} - Canais para entrar: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "Entrando: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "Restando" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "Entradas em canal ativas: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "Canais para entrar: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "IRC Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "Voz" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Tópico para {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "Sem tópico definido para {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "banido" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "Sem banidos nesse canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "Seu modo de usuário é {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} já está em {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Convidando {0} para {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "Usuários" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Total de {0} usuários [{1} ops, {2} voz, {3} normal]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "Erro de conexão! Razão:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Parâmetros insfucientes para o comando {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "Não conectado ao servidor" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: não encontrado nick/canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "Aumentado delay de envio de mensagens para {0}ms para evitar ser expulso do servidor por flood novamente." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "Não pode entrar no canal:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "Você está banido" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] requisitou CTCP {2} de {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "CTCP PING resposta de {0}: {1} segundos" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} resposta de {1}: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] entrou em {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] saiu de {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "Você foi expulso de {0} por {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "{0} foi expulso de {1} por {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "Você é conhecido como {0} agora" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} é conhecido como {1} agora" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} mudou o tópico do canal {1} para {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Mudou modo [{0}] para usuário {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "Modo/{0} [{1}] por {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] Saiu" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "Conexão para {0} e porta {1} falhou (Tentativa {2}), tentando novamente em {3} segundos..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} está ausente: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "Você não está mais marcado como ausente" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "Você está marcado como ausente" smuxi-0.11/po-Engine-IRC/ru.po0000644000175000017500000002633512300202374016622 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Yuri Myasoedov , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:20+0100\n" "PO-Revision-Date: 2012-01-11 09:36+0000\n" "Last-Translator: Yuri Myasoedov \n" "Language-Team: Russian (http://www.transifex.net/projects/p/smuxi/team/ru/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ru\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:245 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} пригласил вас на {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:276 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1519 msgid "away" msgstr "ушёл" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:282 #, csharp-format msgid "lag: {0} seconds" msgstr "задержка: {0} сек." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:288 msgid "not connected" msgstr "не подключён" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:351 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Подключение к {0} на порт {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:357 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:463 #, csharp-format msgid "Connection to {0} established" msgstr "Подключение к {0} установлено." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:360 msgid "Logging in..." msgstr "Вход на сервер..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:394 msgid "Connection failed!" msgstr "Сбой подключения!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:395 msgid "Connection failed! Reason: " msgstr "Сбой подключения! Причина:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:404 msgid "Disconnecting..." msgstr "Отключение..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:407 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Отключение от {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:412 #, csharp-format msgid "Disconnected from {0}" msgstr "Отключен от {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:415 msgid "Connection closed" msgstr "Соединение закрыто" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:420 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:477 msgid "Not connected" msgstr "Нет соединения" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:449 msgid "Reconnecting..." msgstr "Возобновление соединения..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:457 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Возобновление соединения с {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Reconnect Error" msgstr "Ошибка повторного подключения" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:875 msgid "IrcProtocolManager Commands" msgstr "Команды IrcProtocolManager" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:943 #, csharp-format msgid "Invalid port: {0}" msgstr "Неверный порт: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1047 #, csharp-format msgid "Queuing joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1061 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1096 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1119 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1150 #, csharp-format msgid "Joining: {0}" msgstr "Вход на канал: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1121 msgid "Remaining" msgstr "Осталось" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1126 #, csharp-format msgid "active joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1135 #, csharp-format msgid "queued joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1506 msgid "IRC Op" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1508 msgid "Op" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1510 msgid "Voice" msgstr "" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1570 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Тема канала {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1575 #, csharp-format msgid "No topic set for {0}" msgstr "У канала {0} нет темы" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1655 msgid "ban" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1665 msgid "No bans in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1777 #, csharp-format msgid "Inviting {0} to {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1781 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} уже на {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1806 msgid "Users" msgstr "Пользователи" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1848 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Пользователей: {0} [операторов: {1}, разрешенных: {2}, обычных: {3}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1979 msgid "Connection error! Reason: " msgstr "Ошибка подключения! Причина: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1989 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Для команды {0} недостаточно параметров" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1999 msgid "Not connected to server" msgstr "Не подключён к серверу" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2261 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: Нет такого имени или канала" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2390 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2404 msgid "Nick" msgstr "Имя" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2414 msgid "is already in use" msgstr "уже используется" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Cannot join to channel:" msgstr "Не удалось зайти на канал:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2432 msgid "You are banned" msgstr "" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2508 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] запросил CTCP {2} у {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2533 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "Ответ CTCP PING от {0}: {1} сек." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2541 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "Ответ CTCP {0} от {1}: {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2747 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] зашел на канал {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2873 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] вышел из канала {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2898 #, csharp-format msgid "You were kicked from {0} by {1} [{2}]" msgstr "{1} выгнал вас из канала {0} [{2}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2906 #, csharp-format msgid "{0} was kicked from {1} by {2} [{3}]" msgstr "{2} выгнал {0} из канала {1} [{3}]" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2923 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2956 #, csharp-format msgid "You're now known as {0}" msgstr "Ваше имя теперь {0}" #. TRANSLATOR: do NOT change the position of {0} or {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2961 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} сменил имя на {1}" #. TRANSLATOR: do NOT change the position of {0} and {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2998 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} изменил тему канала {1} на: {2}" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3075 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Изменен режим [{0}] для пользователя {1}" #. TRANSLATOR: do NOT change the position of {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3085 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "режим/{0} [{1}] {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3122 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] покинул канал" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3199 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "" "Сбой при подключении к {0} к порту {1} (попытка {2}), повторное подключение " "через {3} секунд..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3248 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} отошел: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3254 msgid "You are no longer marked as being away" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3260 msgid "You have been marked as being away" msgstr "" smuxi-0.11/po-Engine-IRC/pl.po0000644000175000017500000002607012300202374016603 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:20+0100\n" "PO-Revision-Date: 2012-01-07 10:08+0000\n" "Last-Translator: lukasznaw \n" "Language-Team: Polish (http://www.transifex.net/projects/p/smuxi/team/pl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pl\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:245 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} zaprasza Cię do {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:276 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1519 msgid "away" msgstr "nieobecny" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:282 #, csharp-format msgid "lag: {0} seconds" msgstr "opóźnienie: {0} sekund" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:288 msgid "not connected" msgstr "nie połączony" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:351 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Lączenie z {0} port {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:357 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:463 #, csharp-format msgid "Connection to {0} established" msgstr "Połączenie z {0} ustanowiono" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:360 msgid "Logging in..." msgstr "Logowanie..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:394 msgid "Connection failed!" msgstr "Połączenie nie powiodło się!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:395 msgid "Connection failed! Reason: " msgstr "Połączenie nie powiodło się! Powód: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:404 msgid "Disconnecting..." msgstr "Rozłączanie..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:407 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Rozłączanie z {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:412 #, csharp-format msgid "Disconnected from {0}" msgstr "Rozłączono z {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:415 msgid "Connection closed" msgstr "Zamknięto połączenie" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:420 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:477 msgid "Not connected" msgstr "Nie połączony" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:449 msgid "Reconnecting..." msgstr "Ponowne łączenie..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:457 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Ponowne łączenie z {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Reconnect Error" msgstr "Błąd ponownego łączenia" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:875 msgid "IrcProtocolManager Commands" msgstr "Komendy IrcProtocolManager" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:943 #, csharp-format msgid "Invalid port: {0}" msgstr "Nieprawidłowy port: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1047 #, csharp-format msgid "Queuing joins: {0}" msgstr "W kolejce: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1061 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "" "Już dołączono do kanału: {0}. Wpisz /window {0} aby ustawić jako aktywny." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1096 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Dołączono do: {0} - W kolejce: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1119 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1150 #, csharp-format msgid "Joining: {0}" msgstr "Dołączam do: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1121 msgid "Remaining" msgstr "Pozostało" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1126 #, csharp-format msgid "active joins: {0}" msgstr "Ddołączono do: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1135 #, csharp-format msgid "queued joins: {0}" msgstr "w kolejce: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1506 msgid "IRC Op" msgstr "Operator IRC" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1508 msgid "Op" msgstr "Operator" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1510 msgid "Voice" msgstr "Voice" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1570 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Temat na {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1575 #, csharp-format msgid "No topic set for {0}" msgstr "Brak ustawionego tematu na {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1655 msgid "ban" msgstr "Ban" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1665 msgid "No bans in channel" msgstr "Brak banów na kanale" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1777 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Zapraszanie {0} na {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1781 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} już jest na {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1806 msgid "Users" msgstr "Użytkownicy" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1848 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "" "Na kanale jest {0} użytkowników [{1} operatorów, {2} użytkowników z voicem, " "{3} zwykłych użytkowników]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1979 msgid "Connection error! Reason: " msgstr "Błąd połączenia! Powód: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1989 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Niewystarczająca ilość parametrów dla komendy {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1999 msgid "Not connected to server" msgstr "Nie połączony z serwerem" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2261 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: brak takiego nicka/kanału" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2390 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "" "Zwiększono opóźnienie wysyłania do {0}ms, żeby nie zostać wyrzuconym z " "serwera za flood." #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2404 msgid "Nick" msgstr "Nick" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2414 msgid "is already in use" msgstr "jest już używany" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Cannot join to channel:" msgstr "Nie można wejść na kanał:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2432 msgid "You are banned" msgstr "Jesteś zbanowany" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2508 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] zażądał CTCP {2} od {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2533 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "Odpowiedź CTCP PING od {0}: {1} sekund" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2541 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "Odpowiedź CTCP {0} od {1}: {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2747 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] dołączył do {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2873 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] opuścił {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2898 #, csharp-format msgid "You were kicked from {0} by {1} [{2}]" msgstr "Zostałeś wyrzucony z {0} przez {1} [{2}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2906 #, csharp-format msgid "{0} was kicked from {1} by {2} [{3}]" msgstr "{0} został wyrzucony z {1} przez {2} [{3}]" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2923 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2956 #, csharp-format msgid "You're now known as {0}" msgstr "Zmieniłeś nickname na {0}" #. TRANSLATOR: do NOT change the position of {0} or {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2961 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} zmienił nickname na {1}" #. TRANSLATOR: do NOT change the position of {0} and {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2998 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} zmienił temat {1} na: {2}" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3075 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Zmiana trybu [{0}] użytkownika {1}" #. TRANSLATOR: do NOT change the position of {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3085 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "tryb/{0} [{1}] przez {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3122 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] wyszedł" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3199 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "" "Połączenie z {0} na porcie {1} nie udało się (póba {2}), ponowna próba " "połączenia za {3} sekund..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3248 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} jest daleko od komputera: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3254 msgid "You are no longer marked as being away" msgstr "Już nie jesteś nieobecny" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3260 msgid "You have been marked as being away" msgstr "Zostałeś zaznaczony jako nieobecny" smuxi-0.11/po-Engine-IRC/LINGUAS0000644000175000017500000000012712311343665016663 0ustar00meebeymeebey00000000000000ca cs da de en_GB es es_AR fa fi fr hr it nb_NO nl pl pt pt_BR ru sv sk te tr ur zh_CN smuxi-0.11/po-Engine-IRC/it.po0000644000175000017500000002613312300202374016604 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2010 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # # David Paleino , 2008. # Vincenzo Campanella , 2009, 2010. msgid "" msgstr "" "Project-Id-Version: smuxi-engine-irc\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2010-09-11 09:37+0200\n" "Last-Translator: Vincenzo Campanella \n" "Language-Team: Italian \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:234 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} ti ha invitato in {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:255 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1468 msgid "away" msgstr "assente" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:261 #, csharp-format msgid "lag: {0} seconds" msgstr "ritardo: {0} secondi" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:267 msgid "not connected" msgstr "non connesso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:337 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Connessione a {0} porta {1} in corso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:343 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:438 #, csharp-format msgid "Connection to {0} established" msgstr "Connessione a {0} stabilita" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:346 msgid "Logging in..." msgstr "Accesso in corso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:369 msgid "Connection failed!" msgstr "Connessione non riuscita." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:370 msgid "Connection failed! Reason: " msgstr "La connessione non è riuscita. Motivo: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:379 msgid "Disconnecting..." msgstr "Disconnessione in corso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:382 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Disconnessione da {0} in corso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #, csharp-format msgid "Disconnected from {0}" msgstr "Disconnesso da {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:390 msgid "Connection closed" msgstr "Connessione chiusa" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:395 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:452 msgid "Not connected" msgstr "Non connesso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:424 msgid "Reconnecting..." msgstr "Riconnessione in corso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:432 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Riconnessione a {0} in corso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:446 msgid "Reconnect Error" msgstr "Errore di riconnessione" # #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:816 msgid "IrcProtocolManager Commands" msgstr "Comandi di IrcProtocolManager" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:887 #, csharp-format msgid "Invalid port: {0}" msgstr "Porta non valida: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:997 #, csharp-format msgid "Queuing joins: {0}" msgstr "Accodamento degli accessi a «{0}» in corso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1011 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Si è già nel canale: {0}. Digitare «/window» {0} per potervi accedere." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1046 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Accessi attivi: «{0}» - Accessi accodati: «{1}»" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1069 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Joining: {0}" msgstr "Accesso a «{0}» in corso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1071 msgid "Remaining" msgstr "Rimanente" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1076 #, csharp-format msgid "active joins: {0}" msgstr "accessi attivi: «{0}»" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1085 #, csharp-format msgid "queued joins: {0}" msgstr "accessi accodati: «{0}»" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1455 msgid "IRC Op" msgstr "Operatore IRC" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1457 msgid "Op" msgstr "Operatore" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1459 msgid "Voice" msgstr "Dai la parola" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1519 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Argomento per {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1524 #, csharp-format msgid "No topic set for {0}" msgstr "Nessun argomento impostato per {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1604 msgid "ban" msgstr "allontana (ban)" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1614 msgid "No bans in channel" msgstr "Nessun allontanamento (ban) nel canale" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1726 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Invito di {0} su {1} in corso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1730 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} è già nel canale {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1755 msgid "Users" msgstr "Utenti" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1797 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Totale di {0} utenti [{1} operatori, {2} voci, {3} normali]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1928 msgid "Connection error! Reason: " msgstr "Errore di connessione. Motivo: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1938 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Non sono stati forniti abbastanza parametri per il comando {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1948 msgid "Not connected to server" msgstr "Non connesso a un server" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2156 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: soprannome o canale inesistente" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2279 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "" "Ritardo d'invio aumentato a {0} ms per evitare una nuova disconnessione dal " "server." #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2293 msgid "Nick" msgstr "Soprannome" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2303 msgid "is already in use" msgstr "è già in uso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2329 msgid "Cannot join to channel:" msgstr "Impossibile accedere al canale:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2337 msgid "You are banned" msgstr "Sei stato allontanato" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2413 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] ha richiesto CTCP {2} da {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2438 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "Risposta CTCP PING da {0}: {1} secondi" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2446 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "Risposta CTCP {0} da {1}: {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2643 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] è entrato in {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2769 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] ha lasciato {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2794 #, csharp-format msgid "You were kicked from {0} by {1} [{2}]" msgstr "Sei stato espulso da {0} da {1} [{2}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2802 #, csharp-format msgid "{0} was kicked from {1} by {2} [{3}]" msgstr "{0} è stato espulso da {1} da {2} [{3}]" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2819 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2852 #, csharp-format msgid "You're now known as {0}" msgstr "Sei ora conosciuto come {0}" #. TRANSLATOR: do NOT change the position of {0} or {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2857 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} è ora conosciuto come {1}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2894 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} ha cambiato l'argomento di {1} in: {2}" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2970 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Cambio modalità [{0}] per l'utente {1}" #. TRANSLATOR: do NOT change the position of {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2980 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "mode/{0} [{1}] di {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3017 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] si è disconnesso" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3094 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "" "La connessione a {0} porta {1} non è riuscita (tentativo {2}), nuovo " "tentativo fra {3} secondi" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3143 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} è assente: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3149 msgid "You are no longer marked as being away" msgstr "Non sei più segnato come assente" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3155 msgid "You have been marked as being away" msgstr "Sei stato segnato come assente" #~ msgid "Not connected!" #~ msgstr "Non connesso." smuxi-0.11/po-Engine-IRC/de.po0000644000175000017500000002715212300202374016562 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Bianca Mix , 2012-2013 # Mirco Bauer , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-11-20 11:27+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: German (http://www.transifex.com/projects/p/smuxi/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} lädt Sie in {1} ein" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "Einladung akzeptieren (Raum betreten)" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "abwesend" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "Verzögerung: {0} Sekunden" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "nicht verbunden" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Benutze Proxy: {0}:{1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Verbinde zu {0} Port {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "Verbindung zu {0} ist hergestellt" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "Anmelden..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "Verbindung ist fehlgeschlagen!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "Verbindung ist fehlgeschlagen! Ursache: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "Trenne..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Trenne von {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "Getrennt von {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "Verbindung wurde geschlossen" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "Nicht verbunden" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "Verbinde erneut..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Verbinde erneut zu {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "Fehler beim Wiederverbinden" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "Warte für {0} Millisekunden" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "IrcProtocolManager Befehle" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "Ungültiger Port: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "Verzögere Beitritte: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Channel wurde bereits betreten: {0}. Tippen Sie /window {0} um dorthin zu wechseln." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Aktive Beitritte: {0} - Wartende Beitritte: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "Betrete: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "Verbleibend" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "Aktive Beitritte: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "Wartende Beitritte: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "IRC Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "Besitzer" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "Channeladministrator" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "Halb-Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "Voice" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Thema für {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "Kein Thema für {0} gesetzt" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "Sperre" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "Keine Sperren in diesem Channel" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "Sperrausnahme" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "Keine Sperrausnahme in diesem Channel" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "Einladungsausnahme" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "Keine Einladungsausnahme in diesem Channel" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "Ihr Benutzermodus ist {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} ist bereits in {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Lade {0} in {1} ein" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "Benutzer" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Insgesamt {0} Benutzer [{1} Ops, {2} Voices, {3} normal]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "Verbindungsfehler! Grund: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Nicht genügend Parameter für den Befehl: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "Nicht mit Server verbunden" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: Kein solcher Nick/Channel" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "Nachrichtenverzögerung auf {0}ms erhöht, um eine Überflutung des Servers zu verhindern." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "Benutzername {0} ist bereits in Benutzung" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "Konnte Channel nicht beitreten:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "Sie sind gesperrt" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] fragt CTCP {2} von {3} ab: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "CTCP PING Antwort von {0}: {1} Sekunden" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} Antwort von {1}: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] hat {2} betreten" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] hat {2} verlassen" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "Sie wurden von {1} aus {0} hinausgeworfen" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "{0} wurde von {2} aus {1} hinausgeworfen" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "Sie sind nun bekannt als: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} ist nun bekannt als: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} hat das Thema des Kanals {1} geändert auf: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Mode für Benutzer {1} geändert [{0}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "mode/{0} [{1}] von {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] hat beendet" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "Die Verbindung {0} über Port {1} ist fehlgeschlagen (Versuch {2}), erneuter Versuch in {3} Sekunden" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} ist abwesend: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "Sie sind nicht mehr als abwesend gekennzeichnet" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "Sie sind als abwesend gekennzeichnet" smuxi-0.11/po-Engine-IRC/Makefile.in.in0000644000175000017500000001532412300202374020302 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE_ENGINE_IRC@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/po-Engine-IRC/es.po0000644000175000017500000002670612300202374016605 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # toote, 2013 # Ricardo Hermosilla , 2012 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-10 19:43+0000\n" "Last-Translator: toote\n" "Language-Team: Spanish (http://www.transifex.com/projects/p/smuxi/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} te ha invitado a {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "Aceptar invitación (entrar al canal)" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "ausente" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "demora: {0} segundos" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "no conectado" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Utilizando proxy: {0}:{1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Conectando a {0} en el puerto {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "Se estableció la conexión a {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "Autenticando..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "¡Falló la conexión!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "¡Falló la conexión! Razón: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "Desconectando..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Desconectando de {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "Desconectado de {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "Conexion terminada" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "No conectado" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "Reconectando..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Reconectando a {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "Error de reconexión" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "Esperando {0} milisegundos" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "Órdenes IrcProtocolManager" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "Puerto no válido: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "Entradas enlistadas: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Ya estás dentro del canal: {0}. Escribe /window {0} para cambiar a él." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Entradas activas: {0} - Entradas enlistadas: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "Entrando: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "Restantes" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "entradas activas: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "entradas enlistadas: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "IRC Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "Dueño" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "ChanAdmin" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "HalfOp" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "Voz" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Topic para {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "No hay topic fijado en {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "bloquear" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "No hay bloqueos en el canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "excepción a bloqueo" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "No hay excepciones en el canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "excepción de invitación" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "No ha excepciones de invitación en el canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "Su modo de usuario es {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} ya se encuentra en {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Invitando {0} a {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "Usuarios" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Total de {0} usuarios [{1} ops, {2} voz, {3} normal]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "¡Error de conexión! Razón:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Parámetros insuficientes para la orden {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "No conectado al servidor" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: No existe nick/canal" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "Se aumentó el retraso para los envíos en {0}ms para evitar inundar el servidor nuevamente." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "Ya se está utilizando el nick {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "No se puede entrar al canal:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "Estás bloqueado" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] solicitó CTCP {2} de {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "CTCP PING respuesta de {0}: {1} segundos" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} respuesta de {1}: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] entró a {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] ha dejado {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "Ha sido expulsado de {0} por {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "{2} expulsó a {0} de {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "Ahora eres conocido como {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} es ahora conocido como {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} cambió el topic de {1} a: {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Modo cambiado [{0}] para el usuario {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "modo/{0} [{1}] por {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] ha salido" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "Falló la conexión a {0} en el puerto {1} ha fallado (intento {2}), reintentando en {3} segundos..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} está ausente: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "Ya no se encuentra marcado como ausente" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "Ha sido marcado como ausente" smuxi-0.11/po-Engine-IRC/sk.po0000644000175000017500000002573512300202374016614 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Tomáš Vadina , 2011. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2011-09-30 08:38+0000\n" "Last-Translator: Tomáš Vadina \n" "Language-Team: Slovak (http://www.transifex.net/projects/p/smuxi/team/sk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sk\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:234 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} vás pozýva na {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:255 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1468 msgid "away" msgstr "preč" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:261 #, csharp-format msgid "lag: {0} seconds" msgstr "oneskorenie: {0} sekúnd" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:267 msgid "not connected" msgstr "nepripojené" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:337 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Pripája sa k {0} port {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:343 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:438 #, csharp-format msgid "Connection to {0} established" msgstr "Pripojenie k {0} nadviazané" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:346 msgid "Logging in..." msgstr "Prihlasovanie..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:369 msgid "Connection failed!" msgstr "Pripojenie zlyhalo!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:370 msgid "Connection failed! Reason: " msgstr "Pripojenie zlyhalo! Príčina: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:379 msgid "Disconnecting..." msgstr "Odpájanie..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:382 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Odpájanie od {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #, csharp-format msgid "Disconnected from {0}" msgstr "Odpojené od {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:390 msgid "Connection closed" msgstr "Pripojenie zatvorené" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:395 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:452 msgid "Not connected" msgstr "Nepripojené" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:424 msgid "Reconnecting..." msgstr "Opätovné pripájanie..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:432 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Opätovné pripájanie k {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:446 msgid "Reconnect Error" msgstr "Chyba pri opätovnom pripojovaní" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:816 msgid "IrcProtocolManager Commands" msgstr "Príkazy správcu protokolu Irc" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:887 #, csharp-format msgid "Invalid port: {0}" msgstr "Neplatný port: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:997 #, csharp-format msgid "Queuing joins: {0}" msgstr "Zaraďovanie pripojenia do frontu: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1011 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "" "Už ste pripojení na kanál: {0}. Pre prepnutie na tento kanál zadajte " "/window." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1046 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Aktívne pripojenia: {0} - Front s pripojeniami: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1069 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Joining: {0}" msgstr "Pripájanie: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1071 msgid "Remaining" msgstr "Ostávajúci" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1076 #, csharp-format msgid "active joins: {0}" msgstr "aktívne pripojenia: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1085 #, csharp-format msgid "queued joins: {0}" msgstr "front s pripojeniami: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1455 msgid "IRC Op" msgstr "IRC Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1457 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1459 msgid "Voice" msgstr "Hlas" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1519 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Téma pre {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1524 #, csharp-format msgid "No topic set for {0}" msgstr "{0} nemá nastavenú tému" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1604 msgid "ban" msgstr "zákaz" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1614 msgid "No bans in channel" msgstr "V kanále nie sú žiadne zákazy" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1726 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Pozvanie {0} do {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1730 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} je už na {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1755 msgid "Users" msgstr "Používatelia" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1797 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Celkom {0} používateľov [{1} opov, {2} hlasových, {3} normálnych]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1928 msgid "Connection error! Reason: " msgstr "Chyba spojenia! Príčina: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1938 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Pre príkaz {0} nie je vložený dostatok parametrov" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1948 msgid "Not connected to server" msgstr "Nie je pripojené k serveru" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2156 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: Neplatná prezývka/kanál" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2279 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "" "Aby opäť nedošlo k zahlteniu servera, bolo zvýšené oneskorenie odoslania na " "{0} ms." #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2293 msgid "Nick" msgstr "Prezývka" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2303 msgid "is already in use" msgstr "sa už používa" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2329 msgid "Cannot join to channel:" msgstr "Nie je možné pripojiť na kanál:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2337 msgid "You are banned" msgstr "Dostali ste zákaz" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2413 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] požiadal o CTCP {2} od {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2438 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "odpoveď CTCP PING od {0}: {1} sekúnd" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2446 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} odpoveď od {1}: {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2643 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] sa pripojil {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2769 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] opustil {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2794 #, csharp-format msgid "You were kicked from {0} by {1} [{2}]" msgstr "Boli ste vykopnutí z {0} používateľom {1} [{2}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2802 #, csharp-format msgid "{0} was kicked from {1} by {2} [{3}]" msgstr "{0} bol vykopnutí z {1} používateľom {2} [{3}]" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2819 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2852 #, csharp-format msgid "You're now known as {0}" msgstr "Teraz ste známi ako {0}" #. TRANSLATOR: do NOT change the position of {0} or {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2857 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} je teraz známy ako {1}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2894 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} zmenil tému {1} na: {2}" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2970 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Zmena režimu [{0}] používateľa {1}" #. TRANSLATOR: do NOT change the position of {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2980 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "režim/{0} [{1}] od {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3017 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] ukončil" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3094 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "" "Pripojenie k {0} port {1} zlyhalo (pokus č. {2}), opakovanie za {3} " "sekúnd..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3143 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} je preč: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3149 msgid "You are no longer marked as being away" msgstr "Nebudete viac označovaní, že ste preč" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3155 msgid "You have been marked as being away" msgstr "Boli ste označení, že ste preč" smuxi-0.11/po-Engine-IRC/te.po0000644000175000017500000002303512300202374016576 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-10 18:22+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/smuxi/language/te/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: te\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:250 #, csharp-format msgid "{0} invites you to {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:266 msgid "Accept invite (join room)" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:294 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1740 msgid "away" msgstr "" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:300 #, csharp-format msgid "lag: {0} seconds" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:306 msgid "not connected" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:366 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:373 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:528 #, csharp-format msgid "Connection to {0} established" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:396 msgid "Logging in..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:436 msgid "Connection failed!" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:440 msgid "Connection failed! Reason: " msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:453 msgid "Disconnecting..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:458 #, csharp-format msgid "Disconnecting from {0}..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:465 #, csharp-format msgid "Disconnected from {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Connection closed" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:480 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:555 msgid "Not connected" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:514 msgid "Reconnecting..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:522 #, csharp-format msgid "Reconnecting to {0}..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:541 msgid "Reconnect Error" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:933 #, csharp-format msgid "Sleeping for {0} milliseconds" msgstr "" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1018 msgid "IrcProtocolManager Commands" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Invalid port: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1193 #, csharp-format msgid "Queuing joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1213 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1247 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1271 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1301 #, csharp-format msgid "Joining: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1273 msgid "Remaining" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1278 #, csharp-format msgid "active joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1287 #, csharp-format msgid "queued joins: {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1721 msgid "IRC Op" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1723 msgid "Owner" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1725 msgid "ChanAdmin" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1727 msgid "Op" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1729 msgid "Halfop" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1731 msgid "Voice" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1794 #, csharp-format msgid "Topic for {0}: {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1796 #, csharp-format msgid "No topic set for {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1961 msgid "ban" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1972 msgid "No bans in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2009 msgid "ban exception" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2020 msgid "No ban exceptions in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2057 msgid "invite exception" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2068 msgid "No invite exceptions in channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2182 #, csharp-format msgid "Your user mode is {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2208 #, csharp-format msgid "{0} is already on {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2216 #, csharp-format msgid "Inviting {0} to {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2239 msgid "Users" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2290 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Connection error! Reason: " msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2436 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2445 msgid "Not connected to server" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2649 #, csharp-format msgid "{0}: No such nick/channel" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2768 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2783 #, csharp-format msgid "Nick {0} is already in use" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2799 msgid "Cannot join to channel:" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2801 msgid "You are banned" msgstr "" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2884 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2911 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2920 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3168 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3310 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3335 #, csharp-format msgid "You were kicked from {0} by {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3343 #, csharp-format msgid "{0} was kicked from {1} by {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3361 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3393 #, csharp-format msgid "You're now known as {0}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3396 #, csharp-format msgid "{0} is now known as {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3430 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3592 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3609 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3635 #, csharp-format msgid "{0} [{1}] has quit" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3712 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3762 #, csharp-format msgid "{0} is away: {1}" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3772 msgid "You are no longer marked as being away" msgstr "" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3782 msgid "You have been marked as being away" msgstr "" smuxi-0.11/po-Engine-IRC/hr.po0000644000175000017500000002557012300202374016605 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:20+0100\n" "PO-Revision-Date: 2012-01-08 14:08+0000\n" "Last-Translator: Matias M. \n" "Language-Team: Croatian (http://www.transifex.net/projects/p/smuxi/team/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hr\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2\n" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:245 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} vas poziva u {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:276 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1519 msgid "away" msgstr "odsutan" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:282 #, csharp-format msgid "lag: {0} seconds" msgstr "zakašnjenje: {0} sekundi" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:288 msgid "not connected" msgstr "nije povezano" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:351 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "Povezivanje sa {0} port {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:357 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:463 #, csharp-format msgid "Connection to {0} established" msgstr "Povezivanje sa {0} uspjelo" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:360 msgid "Logging in..." msgstr "Prijavljivanje..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:394 msgid "Connection failed!" msgstr "Povezivanje nije uspjelo!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:395 msgid "Connection failed! Reason: " msgstr "Povezivanje nije uspjelo! Razlog: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:404 msgid "Disconnecting..." msgstr "Prekidanje veze..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:407 #, csharp-format msgid "Disconnecting from {0}..." msgstr "Prekidanje veze sa {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:412 #, csharp-format msgid "Disconnected from {0}" msgstr "Prekinuta veza sa {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:415 msgid "Connection closed" msgstr "Veza zatvorena" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:420 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:477 msgid "Not connected" msgstr "Bez povezanosti" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:449 msgid "Reconnecting..." msgstr "Ponovno povezivanje..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:457 #, csharp-format msgid "Reconnecting to {0}..." msgstr "Ponovno povezivanje sa {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:471 msgid "Reconnect Error" msgstr "Greška pri ponovnom povezivanju" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:875 msgid "IrcProtocolManager Commands" msgstr "IrcProtocolManager naredbe" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:943 #, csharp-format msgid "Invalid port: {0}" msgstr "Nevažeći port: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1047 #, csharp-format msgid "Queuing joins: {0}" msgstr "Zaredano povezivanje: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1061 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "" "Već ste povezani sa kanalom: {0}. Upišite /window {0} za prebacivanje." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1096 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Aktivne veze: {0} - Zaredani povezivanje: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1119 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1150 #, csharp-format msgid "Joining: {0}" msgstr "Povezivanje: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1121 msgid "Remaining" msgstr "Preostalo" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1126 #, csharp-format msgid "active joins: {0}" msgstr "aktivnih veza: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1135 #, csharp-format msgid "queued joins: {0}" msgstr "zaredanih veza: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1506 msgid "IRC Op" msgstr "IRC Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1508 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1510 msgid "Voice" msgstr "Voice" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1570 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Tema za {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1575 #, csharp-format msgid "No topic set for {0}" msgstr "{0} nema zadanu temu" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1655 msgid "ban" msgstr "zabrana" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1665 msgid "No bans in channel" msgstr "Nema zabrana u kanalu" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1777 #, csharp-format msgid "Inviting {0} to {1}" msgstr "Pozivanje {0} u {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1781 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} je već u {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1806 msgid "Users" msgstr "Korisnici" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1848 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Ukupno korisnika: {0} [Op: {1}, Voice: {2}, Uobičajeni: {3}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1979 msgid "Connection error! Reason: " msgstr "Greška pri povezivanju! Razlog: " #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1989 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Nedovoljno parametara za {0} naredbu" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1999 msgid "Not connected to server" msgstr "Bez povezanosti sa poslužiteljem" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2261 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: Nema takvog nadimka niti kanala" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2390 #, csharp-format msgid "" "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "" "Zakašnjenje pri slanju povećano na {0}ms kako bi se spriječilo floodanje " "poslužitelja." #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2404 msgid "Nick" msgstr "Nadimak" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2414 msgid "is already in use" msgstr "je već u uporabi" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2424 msgid "Cannot join to channel:" msgstr "Nemoguće povezivanje sa kanalom:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2432 msgid "You are banned" msgstr "Prognani ste" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2508 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] traži CTCP {2} od {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2533 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "CTCP PING odgovor od {0}: {1} sekundi" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2541 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "CTCP {0} odgovor od {1}: {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2747 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] se pridružio {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2873 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] je napustio {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2898 #, csharp-format msgid "You were kicked from {0} by {1} [{2}]" msgstr "{1} vas je izbacio sa {0} [{2}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2906 #, csharp-format msgid "{0} was kicked from {1} by {2} [{3}]" msgstr "{1} je izbacio {0} sa {2} [{3}]" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2923 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2956 #, csharp-format msgid "You're now known as {0}" msgstr "Od sada ste znani kao {0}" #. TRANSLATOR: do NOT change the position of {0} or {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2961 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} je sada znan kao {0}" #. TRANSLATOR: do NOT change the position of {0} and {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2998 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} je promijenio temu {1} u: {2}" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3075 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "Promjena modusa [{0}] za korisnika {1}" #. TRANSLATOR: do NOT change the position of {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3085 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "mode/{0} [{1}] od strane {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3122 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] je otišao" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3199 #, csharp-format msgid "" "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} " "seconds..." msgstr "" "Veza sa {0} port {1} nije uspjela (pokušaj {2}), ponovno za {3} sekundi..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3248 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} je odsutan: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3254 msgid "You are no longer marked as being away" msgstr "Više niste označeni kao odsutni" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3260 msgid "You have been marked as being away" msgstr "Označeni ste kao odsutni" smuxi-0.11/po-Engine-IRC/ca.po0000644000175000017500000002546512300202374016562 0ustar00meebeymeebey00000000000000# msgid "" msgstr "" "Project-Id-Version: Smuxi\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: \n" "Last-Translator: Siegfried-Angel Gevatter Pujals \n" "Language-Team: Siegfried-Angel Gevatter Pujals \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: \n" "Plural-Forms: nplurals=2; plural=n != 1\n" "X-Poedit-Language: Catalan\n" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:234 #, csharp-format msgid "{0} invites you to {1}" msgstr "{0} us invita a {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:255 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1468 msgid "away" msgstr "absent" #. TRANSLATOR: {0} is the amount of seconds #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:261 #, csharp-format msgid "lag: {0} seconds" msgstr "retard: {0} segons" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:267 msgid "not connected" msgstr "no esteu connectat" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:337 #, csharp-format msgid "Connecting to {0} port {1}..." msgstr "S'està connectant a {0} al port {1}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:343 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:438 #, csharp-format msgid "Connection to {0} established" msgstr "S'ha establert la connexió a {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:346 msgid "Logging in..." msgstr "S'està iniciant sessió..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:369 msgid "Connection failed!" msgstr "Ha fallat la connexió!" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:370 msgid "Connection failed! Reason: " msgstr "Ha fallat la connexió! Motiu:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:379 msgid "Disconnecting..." msgstr "S'està desconnectant..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:382 #, csharp-format msgid "Disconnecting from {0}..." msgstr "S'està desconnectant de {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:387 #, csharp-format msgid "Disconnected from {0}" msgstr "S'ha desconnectat de {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:390 msgid "Connection closed" msgstr "S'ha tancat la connexió" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:395 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:452 msgid "Not connected" msgstr "No esteu connectat" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:424 msgid "Reconnecting..." msgstr "S'està tornant a connectar..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:432 #, csharp-format msgid "Reconnecting to {0}..." msgstr "S'està tornant a connectar a {0}..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:446 msgid "Reconnect Error" msgstr "Error al tornar a connectar" #. TRANSLATOR: this line is used as label / category for a #. list of commands below #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:816 msgid "IrcProtocolManager Commands" msgstr "Ordres del protocol IRC" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:887 #, csharp-format msgid "Invalid port: {0}" msgstr "Port invàlid: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:997 #, csharp-format msgid "Queuing joins: {0}" msgstr "S'està afegint les unions a la cua: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1011 #, csharp-format msgid "Already joined to channel: {0}. Type /window {0} to switch to it." msgstr "Ja esteu a la sala {0}. Escriviu /window {0} per a canviar-hi." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1046 #, csharp-format msgid "Active joins: {0} - Queued joins: {1}" msgstr "Unions actives: {0} - Unions a la cua: {1}" #. TRANSLATORS: final message will look like this: #. Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1069 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1100 #, csharp-format msgid "Joining: {0}" msgstr "Unint-se a: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1071 msgid "Remaining" msgstr "En cua:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1076 #, csharp-format msgid "active joins: {0}" msgstr "unions actives: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1085 #, csharp-format msgid "queued joins: {0}" msgstr "unions a la cua: {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1455 msgid "IRC Op" msgstr "Operador d'IRC" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1457 msgid "Op" msgstr "Op" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1459 msgid "Voice" msgstr "Dóna veu" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1519 #, csharp-format msgid "Topic for {0}: {1}" msgstr "Títol de {0}: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1524 #, csharp-format msgid "No topic set for {0}" msgstr "No hi ha cap títol a {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1604 msgid "ban" msgstr "expulsa" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1614 msgid "No bans in channel" msgstr "No hi ha bandejaments en aquesta sala" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1726 #, csharp-format msgid "Inviting {0} to {1}" msgstr "S'està invitant {0} a {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1730 #, csharp-format msgid "{0} is already on {1}" msgstr "{0} ja està a {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1755 msgid "Users" msgstr "Usuaris" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1797 #, csharp-format msgid "Total of {0} users [{1} ops, {2} voices, {3} normal]" msgstr "Total de {0} usuaris [{1} operadors, {2} amb veus, {3} normals]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1928 msgid "Connection error! Reason: " msgstr "Error de connexió! Motiu:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1938 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "No heu proporcionat preu paràmetres per a l'ordre {0}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:1948 msgid "Not connected to server" msgstr "No esteu connectat al servidor" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2156 #, csharp-format msgid "{0}: No such nick/channel" msgstr "{0}: No existeix aquest usuari o aquesta sala" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2279 #, csharp-format msgid "Increased send delay to {0}ms to avoid being flooded off the server again." msgstr "S'ha incrementat el retard de l'enviament a {0}ms per evitar ser expulsat un altre cop pel control d'inundacions del servidor." #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2293 msgid "Nick" msgstr "El nom d'usuari" #. TRANSLATOR: the final line will look like this: #. -!- Nick {0} is already in use #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2303 msgid "is already in use" msgstr "ja està en ús" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2329 msgid "Cannot join to channel:" msgstr "No podeu unir-vos a la sala:" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2337 msgid "You are banned" msgstr "Esteu bandejats" #. TRANSLATOR: {0}: nickname, {1}: ident@host, #. {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter #. example: #. meebey [meebey@example.com] requested CTCP VERSION from meebey: #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2413 #, csharp-format msgid "{0} [{1}] requested CTCP {2} from {3}: {4}" msgstr "{0} [{1}] ha enviat una petició CTCP {2} a {3}: {4}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2438 #, csharp-format msgid "CTCP PING reply from {0}: {1} seconds" msgstr "Resposta a CTCP PING de {0}: {1} segons" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2446 #, csharp-format msgid "CTCP {0} reply from {1}: {2}" msgstr "Resposta a CTCP {0} de {1}: {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2643 #, csharp-format msgid "{0} [{1}] has joined {2}" msgstr "{0} [{1}] s'ha unit a {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2769 #, csharp-format msgid "{0} [{1}] has left {2}" msgstr "{0} [{1}] ha deixat {2}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2794 #, csharp-format msgid "You were kicked from {0} by {1} [{2}]" msgstr "Heu estat expulsat de {0} per {1} [{2}]" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2802 #, csharp-format msgid "{0} was kicked from {1} by {2} [{3}]" msgstr "{0} ha estat expulsat de {1} per {2} [{3}]" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2819 #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2852 #, csharp-format msgid "You're now known as {0}" msgstr "El vostre sobrenom ha canviat a {0}" #. TRANSLATOR: do NOT change the position of {0} or {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2857 #, csharp-format msgid "{0} is now known as {1}" msgstr "{0} s'ha canviat el sobrenom per {1}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2894 #, csharp-format msgid "{0} changed the topic of {1} to: {2}" msgstr "{0} ha canviat el títol de {1} a: {2}" #. TRANSLATOR: do NOT change the position of {1}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2970 #, csharp-format msgid "Mode change [{0}] for user {1}" msgstr "S'ha canviat el mode [{0}] a l'usuari {1}" #. TRANSLATOR: do NOT change the position of {2}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:2980 #, csharp-format msgid "mode/{0} [{1}] by {2}" msgstr "mode/{0} [{1}] per {2}" #. TRANSLATOR: do NOT change the position of {0}! #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3017 #, csharp-format msgid "{0} [{1}] has quit" msgstr "{0} [{1}] ha sortit" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3094 #, csharp-format msgid "Connection to {0} port {1} has failed (attempt {2}), retrying in {3} seconds..." msgstr "La connexió a {0} utilitzant el port {1} ha fallat (intent {2}). Es tornarà a intentar en {3} segons..." #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3143 #, csharp-format msgid "{0} is away: {1}" msgstr "{0} està absent: {1}" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3149 msgid "You are no longer marked as being away" msgstr "Ja no esteu marcat com a absent" #: ../src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs:3155 msgid "You have been marked as being away" msgstr "Heu estat marcat com a absent" smuxi-0.11/HACKING0000644000175000017500000000472112257043746014403 0ustar00meebeymeebey00000000000000See https://www.smuxi.org/page/HackingHowto Coding Style ============ using System; using System.IO; using ThirdPartyNamespaces; using MyOwnNamespaces; namespace Smuxi.Frontend.Gnome { public class GroupChatView : ChatView { // fields before auto properties int f_SomeField; string f_AnotherField; public int SomeAutoProperty { get; set; } // properties before ctors public int SomeManualProperty { get { return f_SomeField; } set { f_SomeField = value; } } // events before ctors public event EventHandler StatusChanged; // ctors before methods public ChatView() { } public ChatView(int someParameter, string anotherParameter) : base(someParameter, anotherParameter) { SomeAutoProperty = someParameter; f_AnotherField = anotherParameter; } public void SomePublicMethod() { // avoid nesting if (f_SomeField != 0) { return; } DoSomething(); var res = MethodCallWithLotsOfParameterThatDontFitInASingleLine( f_SomeField, f_AnotherField, String.Format( "Some String with {0}", SomeAutoProperty ) ); switch (res) { case "Foo": // code of Foo case break; case "Bar": // code of Bar case break; } } // do not specify default access modifiers (private for methods) void DoSomething() { try { using (var hardStuff = GetSomethingHard()) { // this is too hard, can't deal with it } } catch (InvalidOperationException) { } // do not use if (!something) with a else case, instead do: if (something) { // something is true case } else { // something is false case } // fluent style var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendFormat("Test message"). ToMessage(); AddMessage(msg); } } } smuxi-0.11/aclocal.m40000644000175000017500000043276712311344227015260 0ustar00meebeymeebey00000000000000# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # gettext.m4 serial 66 (gettext-0.18.2) dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006, 2008-2010. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value '$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ]])], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST([BUILD_INCLUDED_LIBINTL]) AC_SUBST([USE_INCLUDED_LIBINTL]) AC_SUBST([CATOBJEXT]) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST([DATADIRNAME]) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST([INSTOBJEXT]) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST([GENCAT]) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST([INTLOBJS]) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST([INTLLIBS]) dnl Make all documented variables known to autoconf. AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) AC_SUBST([POSUB]) ]) dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ m4_divert_text([DEFAULTS], [gt_needs=]) m4_define([gt_NEEDS_INIT], []) ]) dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) AC_DEFUN([AM_GNU_GETTEXT_NEED], [ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) # iconv.m4 serial 18 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; const char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; }]])], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], [ changequote(,)dnl case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac changequote([,])dnl ]) LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [m4_ifdef([gl_00GNULIB], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ]], [[]])], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test -n "$am_cv_proto_iconv_arg1"; then ICONV_CONST="const" fi ]) fi ]) # intlmacosx.m4 serial 5 (gettext-0.18.2) dnl Copyright (C) 2004-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Checks for special options needed on Mac OS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in Mac OS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], [gt_cv_func_CFPreferencesCopyAppValue], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFPreferencesCopyAppValue(NULL, NULL)]])], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in Mac OS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFLocaleCopyCurrent();]])], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) # lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 = 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) # lib-prefix.m4 serial 7 (gettext-0.18) dnl Copyright (C) 2001-2005, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a variable acl_libdirstem, containing the basename of the libdir, either dnl "lib" or "lib64" or "lib/64", dnl - a variable acl_libdirstem2, as a secondary possible value for dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. dnl On glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine dnl the compiler's default mode by looking at the compiler's library search dnl path. If at least one of its elements ends in /lib64 or points to a dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. dnl Otherwise we use the default, namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) # nls.m4 serial 5 (gettext-0.18) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # po.m4 serial 21 (gettext-0.18.3) dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl AC_REQUIRE([AC_PROG_SED])dnl AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" tab=`printf '\t'` if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <, 1996. AC_PREREQ([2.50]) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$][$1]) else AC_MSG_RESULT([no]) fi AC_SUBST([$1])dnl ]) # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([expansions.m4]) m4_include([intltool.m4]) m4_include([libtool.m4]) m4_include([ltoptions.m4]) m4_include([ltsugar.m4]) m4_include([ltversion.m4]) m4_include([lt~obsolete.m4]) m4_include([mono.m4]) m4_include([programs.m4]) smuxi-0.11/config.rpath0000755000175000017500000004364711655545675015747 0ustar00meebeymeebey00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2007 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; darwin*) case $cc_basename in xlc*) wl='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we cannot use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if test "$GCC" = yes ; then : else case $cc_basename in xlc*) ;; *) ld_shlibs=no ;; esac fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix4* | aix5*) library_names_spec='$libname$shrext' ;; amigaos*) library_names_spec='$libname.a' ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd1*) ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) library_names_spec='$libname$shrext$versuffix' ;; *) library_names_spec='$libname$shrext' ;; esac ;; gnu*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; nto-qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <, 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-05 18:50+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/smuxi/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "Ei verkkoyhteyttä" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Optimoidaan: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Optimointi epäonnistui: {0}. Syy: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "Viestihistoriasi ei ole saatavilla virheen vuoksi mutta se tallennetaan tästä eteenpäin." #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Yhteys palvelimeen katkaistu" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Ei tarpeeksi parametrejä komennolle {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Yhdistetty kohteeseen {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "Yhteys katkaistu kohteesta {0}" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "" #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Automaattinen yhdistys palvelimeen {0} epäonnistui!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "Moottorin komennot" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "Yhdistäminen epäonnistui!" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Yhteyden katkaisu epäonnistui - palvelinta {0} ei löydetty" #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "Uudelleenyhdistäminen epäonnistui!" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "Asetukset ladattu uudelleen" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "Asetukset tallennettu" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "Epäkelpo avain/arvo -muoto." #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "Epäkelpo asetusavain: '{0}'" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "Ei voitu kääntää asetusavainarvoa: '{0}' tyyppiin: {1}" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "Epäkelpo parametri asetuksille; käytä komentoja load, save get tai set." #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Epäkelpo parametri network:lle, käytä komentoja list, switch tai close" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "Yhdistetyt Verkot" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "Verkko" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "Protokolla" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "Isäntä" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "Portti" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "Ei mitään" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "Saatavilla olevat verkot" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Verkon sulkeminen epäonnistui - verkkoa ei löytynyt: {0}" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Verkon vaihtaminen epäonnistui - verkkoa ei löytynyt: {0}" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "Ei yhdistettynä yhteenkään verkkoon" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Chat-historian tallennus epäonnistui. Chat-historiaasi ei säilötä. Syy: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "Yhdistäminen epäonnistui." #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Protokollan hallintaa ei löydetty protokollalle {0}" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "Tervetuloa Smuxiin" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "Kirjoita /help saadaksesi listan käytössäolevista komennoista." #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "Yhteydenmuodostuksen jälkeen lista käytettävistä komennoista muuttuu. Mene uuteen avautuneeseen yhteysvälilehteen ja käytä /help -komentoa nähdäksesi laajennetun komentolistauksen." #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Käyttäjänimi ei saa olla tyhjä." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Salasana ei saa olla tyhjä." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "Käyttäjää \"{0}\" ei ole olemassa." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "Käyttäjä \"{0}\" on jo olemassa." #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "Verkko ei saa olla tyhjä." #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "Palvelimen isäntänimi ei saa olla tyhjä." #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "Palvelimen isäntänimi sisältää epäkelpoja merkkejä (rivinvaihto)." #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "Palvelin ID:llä '{0}' on jo olemassa." #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Chat-historian lataaminen epäonnistui. Chat-historiaasi ei tallenneta. Syy: {0}" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "Chat-historian avaaminen tallentamista varten epäonnistui. Chat-historiaasi ei tallenneta. Syy: {0}" smuxi-0.11/po-Engine/zh_CN.po0000644000175000017500000001774012300202374016562 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Dean Lee , 2011-2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-13 08:15+0000\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/smuxi/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "无网络连接" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "正在优化: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "优化失败: {0}。原因: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "由于发生错误,您的聊天历史不再可用;但今后的聊天历史将会保留。" #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "{0} 正在输入..." #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "{0} 已停止输入..." #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "{0} 处于离开状态" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "{0} 已下线" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "{0} 已上线" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "未连接到服务器" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "{0} 命令参数不足" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "已连接到 {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "已从 {0} 断开连接" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "正在自动连接到 {0}..." #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "自动连接 {0} 失败!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "引擎命令" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "连接失败!" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "连接断开失败 - 找不到服务器: {0}" #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "重新连接失败!" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "配置已重新载入" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "配置已保存" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "键/值格式无效。" #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "配置键无效: '{0}'" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "无法转换配置键: '{0}' 目标类型: {1}" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "config 参数无效; 请使用 load、save、get 或 set。" #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "network 的参数无效; 使用 list、switch 或 close" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "已连接网络" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "网络" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "协议" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "主机" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "端口" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "无" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "可用网络" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "网络关闭失败——无法找到网络: {0}" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "网络切换失败——无法找到网络: {0}" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "未连接到任何网络" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "无法写入聊天历史。您的聊天历史将不会保存。原因: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "连接失败。" #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "未找到该协议的协议管理器: {0}" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "欢迎来到 Smuxi" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "输入 /help 获取可用命令列表。" #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "连接后可用命令列表将有所变化。请访问新打开的连接页面,再次使用 /help 命令查看扩展后的命令列表。" #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "用户名不能为空。" #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "密码不能为空。" #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "用户 \"{0}\" 不存在。" #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "用户名 \"{0}\" 已存在。" #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "网络不能为空。" #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "服务器主机名不能为空。" #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "服务器主机名包含无效字符 (换行)。" #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "服务器 ID '{0}' 已存在。" #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "无法加载聊天历史。您的聊天历史将不会保留。原因: {0}" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "聊天历史无法打开写入。您的聊天历史将不会保留。原因: {0}" smuxi-0.11/po-Engine/POTFILES.skip0000644000175000017500000000050712300202374017327 0ustar00meebeymeebey00000000000000glade/ src/Common/ src/Frontend/ src/Frontend-GNOME/ src/Frontend-GNOME-IRC/ src/Frontend-GNOME-Twitter/ src/Frontend-GNOME-XMPP/ src/Frontend-STFL/ src/Frontend-SWF/ src/Frontend-WPF/ src/Engine/Config/ServerModel.cs src/Engine-Campfire/ src/Engine-IRC/ src/Engine-JabbR/ src/Engine-XMPP/ src/Engine-Twitter/ src/Server/ lib/ smuxi-0.11/po-Engine/tr.po0000644000175000017500000001476212300202374016207 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Umut Albayrak , 2011 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-05 18:50+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/smuxi/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Sunucuya bağlanılamadı" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "" #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "" #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "" #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "" #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "" #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "Smuxi'ye hoşgeldiniz" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "Yazılabilecek komutlar için /help yazın" #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "" #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "" #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "" #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "" #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "" #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "" #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "" #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "" #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "" #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "" smuxi-0.11/po-Engine/pt.po0000644000175000017500000001650512300202374016202 0ustar00meebeymeebey00000000000000# Translation of smuxi-engine messages to Portuguese # Copyright (C) 2010 the smuxi's copyright holder # This file is distributed under the same license as the smuxi-engine package. # # Américo Monteiro , 2010. # Pedro Ribeiro , 2012. msgid "" msgstr "" "Project-Id-Version: smuxi-engine \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-07-25 06:50+0200\n" "PO-Revision-Date: 2012-07-30 09:08+0100\n" "Last-Translator: Pedro Ribeiro \n" "Language-Team: Portuguese \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine/FrontendManager.cs:233 msgid "No network connections" msgstr "Nenhuma ligação à rede" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "A otimizar: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Falhou a otimização de: {0}. Razão: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "" "O seu histórico do chat já não está disponível devido a um erro mas será " "preservado a partir de agora." #: ../src/Engine/Protocols/ProtocolManagerBase.cs:164 msgid "Not connected to server" msgstr "Não está ligado ao servidor" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:172 #: ../src/Engine/Session.cs:841 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Parâmetros insuficientes para o comando {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:183 #, csharp-format msgid "Connected to {0}" msgstr "Ligado a {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:201 #, csharp-format msgid "Disconnected from {0}" msgstr "Desligado de {0}" #: ../src/Engine/Session.cs:218 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Falhou a ligação automática a {0}!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:416 msgid "Engine Commands" msgstr "Comandos do Motor" #: ../src/Engine/Session.cs:539 msgid "Connect failed!" msgstr "Ligação falhada!" #: ../src/Engine/Session.cs:562 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Falha ao desligar - incapaz de encontrar o servidor: {0}" #: ../src/Engine/Session.cs:601 msgid "Reconnect failed!" msgstr "Re-ligação falhada!" #: ../src/Engine/Session.cs:620 msgid "Configuration reloaded" msgstr "Configuração recarregada" #: ../src/Engine/Session.cs:625 msgid "Configuration saved" msgstr "Configuração guardada" #: ../src/Engine/Session.cs:629 msgid "Invalid parameter for config; use load or save" msgstr "Parâmetro inválido para configuração; use load ou save" #: ../src/Engine/Session.cs:694 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Parâmetro inválido para rede; use list, switch, ou close" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:722 msgid "Connected Networks" msgstr "Redes Ligadas" #: ../src/Engine/Session.cs:727 ../src/Engine/Session.cs:751 msgid "Network" msgstr "Rede" #: ../src/Engine/Session.cs:728 msgid "Protocol" msgstr "Protocolo" #: ../src/Engine/Session.cs:729 msgid "Host" msgstr "Máquina" #: ../src/Engine/Session.cs:730 msgid "Port" msgstr "Porto" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:736 ../src/Engine/Session.cs:757 msgid "None" msgstr "Nenhuma" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:743 msgid "Available Networks" msgstr "Redes Disponíveis" #: ../src/Engine/Session.cs:772 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Fecho de rede falhado - incapaz de encontrar a rede: {0}" #: ../src/Engine/Session.cs:811 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Troca de rede falhada - incapaz de encontrar a rede: {0}" #: ../src/Engine/Session.cs:830 msgid "Not connected to any network" msgstr "Não ligado a nenhuma rede" #: ../src/Engine/Session.cs:1076 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" "Falhou a escrita do histórico do chat. O seu histórico de chat não será " "preservado. Razão: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1248 msgid "Connect failed." msgstr "Ligação falhada." #: ../src/Engine/Session.cs:1279 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Nenhum gestor de protocolo encontrado para o protocolo: {0}" #: ../src/Engine/Session.cs:1511 msgid "Welcome to Smuxi" msgstr "Bem vindo ao Smuxi" #: ../src/Engine/Session.cs:1518 msgid "Type /help to get a list of available commands." msgstr "Escreva /help para obter uma lista dos comandos disponíveis." #: ../src/Engine/Session.cs:1524 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "" "Após fazer uma ligação a lista de comandos disponíveis muda. Aceda ao " "separador da nova ligação e use o comando /help outra vez para ver a nova " "lista de comandos aumentada." #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "O nome de utilizador não pode estar vazio." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "A palavra-passe não pode estar vazia." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "O utilizador \"{0}\" não existe." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "O utilizador \"{0}\" já existe." #: ../src/Engine/Config/ServerListController.cs:131 msgid "Network must not be empty." msgstr "A rede não pode estar vazia." #: ../src/Engine/Config/ServerListController.cs:151 msgid "Server hostname must not be empty." msgstr "O nome de máquina do servidor não pode estar vazio." #: ../src/Engine/Config/ServerListController.cs:154 msgid "Server hostname contains invalid characters (newline)." msgstr "O nome de máquina do servidor contém caracteres inválidos (nova linha)." #: ../src/Engine/Config/ServerListController.cs:160 #, csharp-format msgid "Server '{0}' already exists." msgstr "O servidor '{0}' já existe." #: ../src/Engine/Chats/ChatModel.cs:105 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" "Falhou a leitura do histórico do chat. O seu histórico de chat não será " "preservado. Razão: {0}" #: ../src/Engine/Chats/ChatModel.cs:290 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "" "Falhou a escrita do histórico do chat. O seu histórico de chat não será " "preservado. Razão: {0}" smuxi-0.11/po-Engine/fa.po0000644000175000017500000001455212300202374016145 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-05 18:50+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Persian (http://www.transifex.com/projects/p/smuxi/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "" #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "" #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "" #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "" #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "" #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "" #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "" #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "" #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "" #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "" #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "" #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "" #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "" #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "" #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "" #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "" smuxi-0.11/po-Engine/fr.po0000644000175000017500000002106312300202374016161 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Clément Bourgeois , 2011-2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-13 21:23+0000\n" "Last-Translator: Clément Bourgeois \n" "Language-Team: French (http://www.transifex.com/projects/p/smuxi/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "Aucune connexion réseau" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Optimisation : {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Impossible d'optimiser : {0}. Raison : {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "Votre historique de conversation n'est plus disponible en raison d'une erreur mais il sera préservé à partir de maintenant." #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "{0} est en train de taper..." #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "{0} a arrêté de taper.." #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "{0} est parti" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "{0} est hors ligne" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "{0} est en ligne" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Pas de connexion au serveur" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Pas assez d'arguments pour la commande {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Connecté à {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "Deconnecté de {0}" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "Connexion automatique à {0}..." #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Connexion automatique à {0} impossible !" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "Commandes du moteur" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "Connexion impossible !" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Déconnexion impossible : serveur \"{0}\" introuvable" #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "Reconnexion impossible !" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "Configuration rechargée" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "Configuration sauvegardée" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "Format invalide de paire clé/valeur." #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "Clé de configuration incorrecte : '{0}'" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "Impossible de convertir la valeur de configuration '{0}' vers le type : {1}" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "Paramètre invalide pour la configuration, utilisez \"save\", \"get\" ou \"save\"." #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Paramètre invalide pour le réseau ; utilisez list, switch ou close" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "Réseaux connectés" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "Réseau" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "Protocole" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "Hôte" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "Port" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "Aucun" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "Réseaux disponibles" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Impossible de fermer le réseau - impossible de trouver le réseau : {0}" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Impossible de changer de réseau - impossible de trouver le réseau : {0}" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "Aucun réseau connecté" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Impossible d'écrire votre historique de discussion, celui-ci ne sera pas préservé. Raison : {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "Connexion impossible." #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Aucun gestionnaire de protocole trouvé pour le protocole : {0}" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "Bienvenue dans Smuxi" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "Tapez /help pour obtenir la liste des commandes disponibles." #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "Apres s'être connecté, la liste des commandes disponibles change. Allez dans l'onglet de la nouvelle connexion et utilisez la commande /help pour voir la nouvelle liste étendue des commandes." #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Le nom d'utilisateur ne peut pas être vide." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Le mot de passe ne peut pas être vide." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "L'utilisateur \"{0}\" n'existe pas." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "L'utilisateur \"{0}\" existe déjà." #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "Le réseau ne peut pas être vide." #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "Le nom d'hôte ne peut pas être vide." #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "Le nom d'hôte contient des caractères invalides." #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "L'identifiant de serveur \"{0}\" existe déjà." #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Impossible de charger votre historique de discussion, celui-ci ne sera pas préservé. Raison : {0}" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "Impossible d'ouvrir en écriture votre historique de discussion, celui-ci ne sera pas préservé. Raison : {0}" smuxi-0.11/po-Engine/sv.po0000644000175000017500000002107412300202374016204 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # flugsio , 2013 # flugsio , 2011, 2012 # Martin Bagge , 2012-2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-10 16:55+0000\n" "Last-Translator: Martin Bagge \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/smuxi/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sv\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "Inga nätverksanslutningar" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Optimerar: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Misslyckades att optimera: {0}. Anledning: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "Din chatthistorik är inte längre tillgänglig på grund av ett fel, men kommer att bibehållas från och med nu." #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "{0} skriver..." #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "{0} har slutat skriva..." #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "{0} är borta" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "{0} är inte ansluten" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "{0} är ansluten" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Inte ansluten till server" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Inte tillräckligt med parametrar för kommandot {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Ansluten till {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "Frånkopplad från {0}" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "Ansluter automatiskt till {0}..." #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Automatisk anslutning till {0} misslyckades!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "Kommandon för motorn" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "Anslutning misslyckades!" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Nedkoppling misslyckades - kunde inte hitta servern: {0}" #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "Återanslutning misslyckades!" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "Inställningarna laddades" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "Inställningarna sparades" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "Ogiltigt nykel/värde format." #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "Ogiltig konfigurationsnyckel: '{0}'" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "Kunde inte konvertera konfigurationsvärdet: '{0}' till typen: {1}" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "Ogiltig parameter för inställningar; använd load, save, get eller set." #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Ogiltig parameter för nätverk; använd list, switch eller close" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "Anslutna nätverk" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "Nätverk" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "Protokoll" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "Värd" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "Port" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "Ingen" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "Tillgängliga nätverk" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Stängning av nätverk misslyckades - kunde inte hitta nätverket: {0}" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Byte av nätverk misslyckades - kunde inte hitta nätverket: {0}" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "Inte ansluten till något nätverk" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Kunde inte spara chatthistorik. Din chatthistorik kommer inte att bibehållas. Anledning: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "Anslutning misslyckades." #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Ingen protokollshanterare funnen för protokollet: {0}" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "Välkommen till Smuxi" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "Skriv /help för att visa en lista med tillgängliga kommandon." #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "Efter att du har kopplat upp dig så uppdateras listan med tillgängliga kommandon. Gå till den nyligen öppnade anslutningsfliken och använd kommandot /help igen för att se den utökade kommandolistan." #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Användarnamnet får inte lämnas tomt." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Lösenordet får inte lämnas tomt." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "Användaren \"{0}\" finns inte." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "Användaren \"{0}\" finns redan." #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "Nätverk får inte lämnas tomt." #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "Servers värdnamn får inte lämnas tomt." #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "Serverns värdnamn innehåller ogiltiga tecken (ny rad)." #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "Server ID '{0}' finns redan." #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Kunde inte läsa in chatthistoriken. Din chatthistorik kommer inte att sparas. Anledning: {0}" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "Kunde inte öppna chatthistoriken med skrivrättighet. Din chatthistorik kommer inte att sparas. Anledning: {0}" smuxi-0.11/po-Engine/ur.po0000644000175000017500000000770512300202374016207 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2010-11-30 04:12+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Urdu (http://www.transifex.net/projects/p/smuxi/team/ur/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ur\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" #: ../src/Engine/FrontendManager.cs:230 msgid "No network connections" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:161 msgid "Not connected to server" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:173 #: ../src/Engine/Session.cs:751 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:213 #, csharp-format msgid "Disconnected from {0}" msgstr "" #: ../src/Engine/Session.cs:154 msgid "Welcome to Smuxi" msgstr "" #: ../src/Engine/Session.cs:160 msgid "Type /help to get a list of available commands." msgstr "" #: ../src/Engine/Session.cs:163 msgid "" "After you have made a connection the list of available commands changes. Use" " the /help command again to see the extended command list." msgstr "" #: ../src/Engine/Session.cs:216 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:411 msgid "Engine Commands" msgstr "" #: ../src/Engine/Session.cs:514 msgid "Connect failed!" msgstr "" #: ../src/Engine/Session.cs:544 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "" #: ../src/Engine/Session.cs:583 msgid "Reconnect failed!" msgstr "" #: ../src/Engine/Session.cs:602 msgid "Configuration reloaded" msgstr "" #: ../src/Engine/Session.cs:607 msgid "Configuration saved" msgstr "" #: ../src/Engine/Session.cs:611 msgid "Invalid parameter for config; use load or save" msgstr "" #: ../src/Engine/Session.cs:641 msgid "Invalid parameter for network; use list, switch, or close" msgstr "" #: ../src/Engine/Session.cs:652 msgid "Networks" msgstr "" #: ../src/Engine/Session.cs:656 msgid "Type" msgstr "" #: ../src/Engine/Session.cs:657 msgid "Host" msgstr "" #: ../src/Engine/Session.cs:658 msgid "Port" msgstr "" #: ../src/Engine/Session.cs:680 #, csharp-format msgid "Network close failed - could not find network with host: {0}" msgstr "" #: ../src/Engine/Session.cs:725 #, csharp-format msgid "Network switch failed - could not find network with host: {0}" msgstr "" #: ../src/Engine/Session.cs:740 msgid "Not connected to any network" msgstr "" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1067 msgid "Connect failed." msgstr "" #: ../src/Engine/Session.cs:1098 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "" #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "" #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "" #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "" #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "" #: ../src/Engine/Config/ServerListController.cs:131 msgid "Server hostname must not be empty." msgstr "" #: ../src/Engine/Config/ServerListController.cs:134 msgid "Server hostname contains invalid characters (newline)." msgstr "" #: ../src/Engine/Config/ServerListController.cs:140 #, csharp-format msgid "Server '{0}' already exists." msgstr "" smuxi-0.11/po-Engine/en_GB.po0000644000175000017500000001113112300202374016517 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2009 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # Ryan Smith-Evans , 2009. # msgid "" msgstr "" "Project-Id-Version: smuxi 0.6.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-08-05 01:46+0200\n" "PO-Revision-Date: 2010-01-08 23:46+0100\n" "Last-Translator: Ryan Smith-Evans \n" "Language-Team: English (British)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine/FrontendManager.cs:223 msgid "No network connections" msgstr "No network connections" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:146 msgid "Not connected to server" msgstr "Not connected to server" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:158 #: ../src/Engine/Session.cs:736 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Not enough parameters for {0} command" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:174 #, fuzzy, csharp-format msgid "Connected to {0}" msgstr "Not connected to server" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:196 #, csharp-format msgid "Disconnected from {0}" msgstr "Disconnected from {0}" #: ../src/Engine/Session.cs:154 msgid "Welcome to Smuxi" msgstr "Welcome to Smuxi" #: ../src/Engine/Session.cs:160 msgid "Type /help to get a list of available commands." msgstr "Type /help to get a list of available commands." #: ../src/Engine/Session.cs:163 msgid "After you have made a connection the list of available commands changes. Use the /help command again to see the extended command list." msgstr "After you have made a connection the list of available commands changes. Use the /help command again to see the extended command list." #: ../src/Engine/Session.cs:216 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Automatic connect to {0} failed!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:407 msgid "Engine Commands" msgstr "Engine Commands" #: ../src/Engine/Session.cs:510 msgid "Connect failed!" msgstr "Connect failed!" #: ../src/Engine/Session.cs:540 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Disconnect failed. Could not find server: {0}" #: ../src/Engine/Session.cs:579 #, fuzzy msgid "Reconnect failed!" msgstr "Automatic connect to {0} failed!" #: ../src/Engine/Session.cs:598 msgid "Configuration reloaded" msgstr "Configuration reloaded" #: ../src/Engine/Session.cs:603 msgid "Configuration saved" msgstr "Configuration saved" #: ../src/Engine/Session.cs:607 msgid "Invalid parameter for config; use load or save" msgstr "Invalid parameter for config. Use load or save" #: ../src/Engine/Session.cs:637 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Invalid parameter for network. Use list, switch or close" #: ../src/Engine/Session.cs:648 msgid "Networks" msgstr "Networks" #: ../src/Engine/Session.cs:652 msgid "Type" msgstr "Type" #: ../src/Engine/Session.cs:653 msgid "Host" msgstr "Host" #: ../src/Engine/Session.cs:654 msgid "Port" msgstr "Port" #: ../src/Engine/Session.cs:676 #, csharp-format msgid "Network close failed - could not find network with host: {0}" msgstr "Network close failed. Could not find network with host: {0}" #: ../src/Engine/Session.cs:710 #, csharp-format msgid "Network switch failed - could not find network with host: {0}" msgstr "Network switch failed. Could not find network with host: {0}" #: ../src/Engine/Session.cs:725 msgid "Not connected to any network" msgstr "Not connected to any network" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1052 msgid "Connect failed." msgstr "Connection failed." #: ../src/Engine/Session.cs:1083 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "No protocol manager found for the protocol: {0}" #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Username must not be empty." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Password must not be empty." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "User \"{0}\" doesn't exist." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "User \"{0}\" already exists." #~ msgid "Unknown protocol: {0}" #~ msgstr "Unknown protocol: {0}" smuxi-0.11/po-Engine/cs.po0000644000175000017500000002065512300202374016165 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Ondřej Hošek , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-06 14:09+0000\n" "Last-Translator: Ondřej Hošek \n" "Language-Team: Czech (http://www.transifex.com/projects/p/smuxi/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "Žádná připojení k sítí" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Optimalizuji: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Optimalizace {0} se nezdařila. Příčina: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "Vaše historie chatů se stala kvůli chybě nedostupnou, ale odteď bude zase uložena." #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "{0} píše..." #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "{0} přestal(a) psát..." #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "{0} je pryč" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "{0} je online" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "{0} je offline" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Není připojeno k serveru" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Pro příkaz {0} nebyl zadán dostatek parametrů" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Spojen s {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "Odpojen od {0}" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "Automatické připojování s {0}..." #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Automatické připojení k {0} selhalo!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "Příkazy enginu" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "Připojení selhalo!" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Odpojení selhalo - nepodařilo se najít server: {0}" #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "Opětovné připojení selhalo!" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "Nastavení byla načtena" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "Nastavení byla uložena" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "Neplatný formát klíč/hodnota." #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "Neplatný klíč konfigurace: '{0}'" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "Nemohu zkonvertovat konfigurační hodnotu: '{0}' na typ: {1}" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "Neplatný parametr příkazu config: použij load, save, get nebo set." #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Neplatný parametr pro network; zadejte list, switch nebo close" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "Spojen k sítím:" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "Síť" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "Protokol" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "Hostitel" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "Port" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "žádné" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "Dostupné sítě:" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Uzavření sítě selhalo - síť nenalezena: {0}" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Přepnutí sítě selhalo - síť nenalezena: {0}" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "Není připojeno k žádné síti" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Nezdařilo se uložení historie chatů. Vaše historie chatů nebude uchována. Příčina: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "Připojení selhalo." #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Pro protokol nebyl nalezen žádný správce protokolu: {0}" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "Vítejte ve Smuxi" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "Pro zobrazení seznamu dostupných příkazů napište /help." #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "Po zdařeném spojení se změní seznam dostupných příkazů. Pro zobrazení rozšířeného seznamu příkazů přepněte na záložku nového spojení a použijte znovu příkaz /help." #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Uživatelské jméno nemůže být prázdné." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Heslo nemůže být prázdné." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "Uživatel \"{0}\" neexistuje." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "Uživatel \"{0}\" již existuje." #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "Síť nesmí být prázdná." #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "Název hostitele serveru nesmí být prázdný." #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "Název hostitele serveru obsahuje neplatné znaky (nové řádky)." #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "Identifikace serveru '{0}' již existuje." #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Nezdařilo se načtení historie chatů. Vaše historie chatů nebude uchována. Příčina: {0}" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "Nezdařilo se otevření historie chatů pro zápis. Vaše historie chatů nebude uchována. Příčina: {0}" smuxi-0.11/po-Engine/nb_NO.po0000644000175000017500000001507212300202374016550 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2012-01-01 18:47+0100\n" "PO-Revision-Date: 2012-08-19 22:19+0000\n" "Last-Translator: Arianfaol \n" "Language-Team: Norwegian Bokmål (Norway) (http://www.transifex.com/projects/p/smuxi/language/nb_NO/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nb_NO\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" #: ../src/Engine/FrontendManager.cs:233 msgid "No network connections" msgstr "Ingen nettverkstilkoblinger" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Optimaliserer: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Optimalisering mislyktes: {0}. Årsak: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "Chatloggen din er ikke lenger tilgjengelig på grunn av en feil, men vil bil lagret fra nå av." #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Ikke koblet til server" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:778 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Ikke nok parametere for kommando {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Koblet til {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:207 #, csharp-format msgid "Disconnected from {0}" msgstr "Koblet i fra {0}" #: ../src/Engine/Session.cs:218 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Automatisk tilkobling til {0} mislyktes!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:416 msgid "Engine Commands" msgstr "Motorkommandoer" #: ../src/Engine/Session.cs:527 msgid "Connect failed!" msgstr "Tilkobling mislyktes!" #: ../src/Engine/Session.cs:550 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Frakobling mislyktes - kunne ikke finne server: {0}" #: ../src/Engine/Session.cs:589 msgid "Reconnect failed!" msgstr "Gjentilkobling mislyktes." #: ../src/Engine/Session.cs:608 msgid "Configuration reloaded" msgstr "Konfigurasjon lastet på nytt" #: ../src/Engine/Session.cs:613 msgid "Configuration saved" msgstr "Konfigurasjon lagret" #: ../src/Engine/Session.cs:617 msgid "Invalid parameter for config; use load or save" msgstr "Ugyldig parameter for config; bruk load eller save" #: ../src/Engine/Session.cs:676 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Ugyldig parameter for network; bruk list, switch, eller close" #: ../src/Engine/Session.cs:687 msgid "Networks" msgstr "Nettverk" #: ../src/Engine/Session.cs:691 msgid "Protocol" msgstr "Protokol" #: ../src/Engine/Session.cs:692 msgid "Network" msgstr "Nettverk" #: ../src/Engine/Session.cs:693 msgid "Host" msgstr "Vert" #: ../src/Engine/Session.cs:694 msgid "Port" msgstr "Port" #: ../src/Engine/Session.cs:709 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Stenging av nettverk mislyktes - kunne ikke finne nettverk: {0}" #: ../src/Engine/Session.cs:748 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Bytte av nettverk mislyktes - kunne ikke finne nettverk: {0}" #: ../src/Engine/Session.cs:767 msgid "Not connected to any network" msgstr "Ikke koblet til noen nettverk" #: ../src/Engine/Session.cs:1013 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Kunne ikke skrive til Chatlogg. Chatloggen din vil ikke bli lagret. Årsak: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1185 msgid "Connect failed." msgstr "Tilkobling mislyktes." #: ../src/Engine/Session.cs:1216 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Ingen protokollbehandler funnet for protokollen: {0}" #: ../src/Engine/Session.cs:1448 msgid "Welcome to Smuxi" msgstr "Velkommen til Smuxi" #: ../src/Engine/Session.cs:1455 msgid "Type /help to get a list of available commands." msgstr "Skriv /help for å få en liste over tilgjengelige kommandoer." #: ../src/Engine/Session.cs:1461 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "Etter du har koblet til endrer listen med tilgjengelige kommandoer seg. Gå til den nyåpnede tilkoblingsarkfanen og bruk /help kommandoen om igjen for å se den utvidede kommandolisten." #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Brukernavn kan ikke være tomt." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Passord kan ikke være tomt." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "Bruker \"{0}\" eksisterer ikke." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "Bruker \"{0}\" eksisterer allerede." #: ../src/Engine/Config/ServerListController.cs:131 msgid "Server hostname must not be empty." msgstr "Serververtsnavn kan ikke være tomt." #: ../src/Engine/Config/ServerListController.cs:134 msgid "Server hostname contains invalid characters (newline)." msgstr "Serververtsnavn inneholder ugyldige tegn (linjeskift)." #: ../src/Engine/Config/ServerListController.cs:140 #, csharp-format msgid "Server '{0}' already exists." msgstr "Server '{0}' eksisterer allerede" #: ../src/Engine/Chats/ChatModel.cs:105 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Kunne ikke laste chatlogg. Chatloggen din vil ikke bli lagret. Årsak: {0}" #: ../src/Engine/Chats/ChatModel.cs:290 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "Kunne ikke åpne chatlogg for skriving. Chatloggen din vil ikke bli lagret. Årsak: {0}" smuxi-0.11/po-Engine/nl.po0000644000175000017500000002067512311343665016206 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Jeroen Baten , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-26 13:14+0000\n" "Last-Translator: Jeroen Baten \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/smuxi/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "Geen netwerkverbindingen" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Optimaliseren: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Optimaliseren niet gelukt: {0}. Reden: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "Uw chathistorie is niet langer beschikbaar vanwege een fout maar zal van nu af weer vastgelegd worden." #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "{0} is aan het typen..." #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "{0} has gestopt met typen..." #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "{0} is afwezig" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "{0} is niet online" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "{0} is online" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Niet verbonden met server" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "NIet genoeg parameters voor {0} commando" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Verbonden met {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "Verbinding verbroken met {0}" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "Automatisch verbinden met {0}..." #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Automatisch verbinden met {0} niet gelukt!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "Engine Commando's" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "Verbinden niet gelukt!" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Verbinding verbreken is niet gelukt - kon server \"{0}\" niet vinden." #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "Herverbinden niet gelukt!" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "Configuratie herladen" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "Configuratie opgeslagen" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "Ongeldige sleutel/waarde combinatie." #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "Ongeldige configuratiesleutel: '{0}'" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "Kon configuratiesleurel: '{0}' niet converteren naar type: {1}" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "Ongeldige parameter voor configuratie; gebruik \"load\", \"save\", \"get\" of \"set\"." #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Ongeldige parameter voor netwerk; gebruik \"list\", \"switch\" of \"close\"" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "Verbonden netwerken" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "Network" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "Protocol" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "Host" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "Poort" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "Geen" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "Beschikbare netwerken" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Netwerksluiting niet gelukt - kon netwerk niet vinden: {0}" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Netwerkomschakeling niet gelukt - kon netwerk niet vinden: {0}" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "Niet verbonden met enig netwerk" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Wegschrijven van chathistorie niet niet gelukt. Uw chathistorie zal niet bewaard blijven. Reden: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "Verbinden niet gelukt." #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Geen protocol manager gebonden voor protocol: {0}" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "Welkom bij Smuxi" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "Type /help om een lijst met beschikbare commando's te krijgen." #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "Na het maken van een verbinding zal de lijst met mogelijke commando's wijzigen. Ga naar het recentst geopende verbindingstabblad en gebruik het /help commando opnieuw om de actuele commandolijst te zien." #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Gebruikersnaam mag niet leeg zijn." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Wachtwoord mag niet leeg zijn." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "Gebruiker \"{0}\" bestaat niet." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "Gebruiker \"{0}\" bestaat al." #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "Netwerk mag niet leeg zijn." #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "Servernaam mag niet leeg zijn." #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "Servernaam bevat ongeldige tekens (nieuwe-regel)." #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "Server ID '{0}' bestaat reeds." #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Laden van chathistorie is niet gelukt. Uw chathistorie zal niet bewaard blijven. Reden: {0}" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "Het openen van uw chathistorie om te schrijven is niet gelukt. Uw chathistorie zal niet bewaard blijven. Reden: {0}" smuxi-0.11/po-Engine/es_AR.po0000644000175000017500000001011012300202374016532 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2009 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # Juan Miguel Carrero , 2008-2009. # msgid "" msgstr "" "Project-Id-Version: 0.6.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-09 21:43+0100\n" "PO-Revision-Date: 2009-11-29 17:04-0300\n" "Last-Translator: Damian Kleiman \n" "Language-Team: Spanish Spanish Localization \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/Engine/FrontendManager.cs:219 #, fuzzy msgid "No network connections" msgstr "No hay conexiones de red" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:146 msgid "Not connected to server" msgstr "No está conectado al servidor" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:158 #: ../src/Engine/Session.cs:684 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Parámetros insuficientes para el comando {0}" #: ../src/Engine/Session.cs:151 msgid "Welcome to Smuxi" msgstr "Bienvenido a Smuxi" #: ../src/Engine/Session.cs:157 msgid "Type /help to get a list of available commands." msgstr "Escribe /help para obtener una lista de comandos disponibles." #: ../src/Engine/Session.cs:160 #, fuzzy msgid "" "After you have made a connection the list of available commands changes. Use " "the /help command again to see the extended command list." msgstr "" "Despues de efectuar una conexión la lista de comandos disponibles cambia , " "usa /help de nuevo." #: ../src/Engine/Session.cs:210 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Conexión automática a {0} falló!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:398 #, fuzzy msgid "Engine Commands" msgstr "[Comandos del Motor]" #: ../src/Engine/Session.cs:510 #, fuzzy, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Desconexión fallida, no se encuentra el servidor: {0}" #: ../src/Engine/Session.cs:546 msgid "Configuration reloaded" msgstr "Configuración recargada" #: ../src/Engine/Session.cs:551 msgid "Configuration saved" msgstr "Configuración guardada" #: ../src/Engine/Session.cs:555 #, fuzzy msgid "Invalid parameter for config; use load or save" msgstr "Parámetro inválido de configuración , usa importar o guardar" #: ../src/Engine/Session.cs:585 #, fuzzy msgid "Invalid parameter for network; use list, switch, or close" msgstr "Paŕametro inválido de configuración, usa list , switch o close" #: ../src/Engine/Session.cs:596 msgid "Networks" msgstr "Redes" #: ../src/Engine/Session.cs:600 msgid "Type" msgstr "Tipo" #: ../src/Engine/Session.cs:601 msgid "Host" msgstr "Servidor" #: ../src/Engine/Session.cs:602 msgid "Port" msgstr "Puerto" #: ../src/Engine/Session.cs:624 #, fuzzy, csharp-format msgid "Network close failed - could not find network with host: {0}" msgstr "" "Falló el cerrar la red , no se puede encontrar la red con servidor: {0}" #: ../src/Engine/Session.cs:658 #, fuzzy, csharp-format msgid "Network switch failed - could not find network with host: {0}" msgstr "" "Falló el cambio de red , no se puede encontrar la red con servidor: {0}" #: ../src/Engine/Session.cs:673 msgid "Not connected to any network" msgstr "No conectado a ninguna red" #: ../src/Engine/Session.cs:962 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "No existe gestor para el protocolo: {0}" #: ../src/Engine/Session.cs:985 #, csharp-format msgid "Unknown protocol: {0}" msgstr "Protocolo desconocido: {0}" #: ../src/Engine/Config/UserListController.cs:112 msgid "Username must not be empty." msgstr "" #: ../src/Engine/Config/UserListController.cs:122 msgid "Password must not be empty." msgstr "" #: ../src/Engine/Config/UserListController.cs:131 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "" #: ../src/Engine/Config/UserListController.cs:140 #, csharp-format msgid "User \"{0}\" already exists." msgstr "" smuxi-0.11/po-Engine/da.po0000644000175000017500000002066312300202374016143 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Joe Hansen , 2011-2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-05 19:23+0000\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish (http://www.transifex.com/projects/p/smuxi/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "Ingen netværksforbindelser" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Optimerer: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Kunne ikke optimere: {0}. Årsag: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "Din snakkehistorik er ikke længere tilgængelig på grund af en fejl, men den vil blive gemt fremadrettet." #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "{0} taster ..." #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "{0} har stoppet indtastning ..." #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "{0} er fraværende" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "{0} er frakoblet" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "{0} er tilkoblet" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Ikke forbundet til server" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Ikke nok parametre for kommandoen {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Forbundet til {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "Ikke længere forbundet til {0}" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "Automatisk tilslutning til {0} ..." #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Automatisk tilslutning til {0} mislykkedes!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "Motorkommandoer" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "Tilslutning mislykkedes!" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Afbrydelse fejlede - kunne ikke finde server: {0}" #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "Gentilslutning mislykkedes!" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "Konfiguration genindlæst" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "Konfiguration gemt" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "Ugyldigt nøgle/værdi-format." #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "Ugyldig konfigurationsnøgle: »{0}«" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "Kunne ikke konvertere konfigurationsværdi: »{0}« til type: {1}" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "Ugyldig parameter for konfiguration: brug load (indlæs), save (gem), get (hent) eller set (sæt)." #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Ugyldigt parameter for netværk; brug list (vis), switch (skift) eller close (luk)" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "Forbundne netværk" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "Netværk" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "Protokol" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "Vært" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "Port" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "Ingen" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "Tilgængelige netværk" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Lukning af netværk fejlede - kunne ikke finde netværk: {0}" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Netværksomskifter fejlede - kunne ikke finde netværk: {0}" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "Ikke tilsluttet til noget netværk" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Kunne ikke skrive snakkehistorik. Din snakkehistorik vil ikke blive gemt. Årsag: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "Tilslutning mislykkedes." #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Ingen protokolhåndtering fundet til denne protokol: {0}" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "Velkommen til Smuxi" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "Tast /help for en liste over tilgængelige kommandoer." #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "Efter du har foretaget en forbindelsen så ændres listen over tilgængelige kommandoer. Gå til det netop åbnede forbindelsesfaneblad og brug kommandoen /help igen for at se den udvidede kommandoliste." #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Brugernavn må ikke være tomt." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Adgangskode må ikke være tom." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "Bruger »{0}« findes ikke." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "Bruger »{0}« findes allerede." #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "Netværk må ikke være tomt." #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "Serverværtsnavn må ikke være tomt." #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "Serverværtsnavn indeholder ugyldige tegn (nylinje)." #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "Server-id »{0}« findes allerede." #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Kunne ikke indlæse snakkehistorik. Din snakkehistorik vil ikke blive bevaret. Årsag: {0}" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "Kunne ikke åbne snakkehistorik for skrivning. Din snakkehistorik vil ikke blive bevaret. Årsag: {0}" smuxi-0.11/po-Engine/POTFILES.in0000644000175000017500000000044512300202374016770 0ustar00meebeymeebey00000000000000src/Engine/FrontendManager.cs src/Engine/MessageBuffers/Db4oMessageBuffer.cs src/Engine/Messages/MessageBuilder.cs src/Engine/Protocols/ProtocolManagerBase.cs src/Engine/Session.cs src/Engine/Config/UserListController.cs src/Engine/Config/ServerListController.cs src/Engine/Chats/ChatModel.cs smuxi-0.11/po-Engine/pt_BR.po0000644000175000017500000002007712300202374016564 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Leonardopf , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-05 18:50+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/smuxi/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "Sem conexão de rede" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Optimizando: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Falhou a optimização: {0}. Razão: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "Seu histórico de mensagens não está disponível por causa de um erro, mas será preservado à partir de agora." #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Não conectado ao servidor" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Parâmetros insfucientes para o comando {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Conectado a {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "Desconectado de {0}" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "" #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Conexão automática a {0} falhou!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "Comandos principais" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "Conexão falhou!" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Desconexão falhou - Não foi possível encontrar servidor: {0}" #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "Re-conectar falhou!" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "Configuração reiniciada" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "Configuração salva" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "" #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "" #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Parâmetro invalido para rede: use list, switch ou close" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "Redes Conectadas" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "Rede" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "Protocolo" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "Servidor" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "Porta" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "Nenhuma" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "Redes disponíveis" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Desconexão falhou - Não foi possível encontrar servidor: {0}" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Troca de rede falhou - não foi possível encontrar rede: {0}" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "Não conectado em nenhum servidor" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Falha ao escrever o histórico de mensagens. Seu histórico de mensagens não serão preservadas. Razão: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "Conexão falhou!" #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Gerenciador de protocolo não encontrado para o protocolo: {0}" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "Bem vindo ao Smuxi" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "Digite /help para pegar lista de comandos disponíveis." #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "Após você conectar a lista de comandos mudam. Vá para a nova aba de conexão e use o comando /help de novo para ver a lista de comandos. " #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Nome de usuário não pode estar vazio." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Senha não pode estar vazia." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "Usuário \"{0}\" não existe." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "Usuário \"{0}\" já existe." #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "Rede não pode estar vazia." #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "Nome do servidor não pode estar vazio." #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "Nome do servidor contem caracteres inválidos (nova linha)." #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "Servidor de ID '{0}' já existe." #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Falha ao carregar histórico de mensagens. Seu histórico de mensagens não será preservados. Razão: {0}" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "Falha ao abrir histórico de mensagens para escrevê-lá. Seu histórico de mensagens não serão preservados. Razão: {0}" smuxi-0.11/po-Engine/ru.po0000644000175000017500000001766012300202374016210 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Yuri Myasoedov , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2012-01-01 18:47+0100\n" "PO-Revision-Date: 2012-01-07 14:55+0000\n" "Last-Translator: Yuri Myasoedov \n" "Language-Team: Russian (http://www.transifex.net/projects/p/smuxi/team/ru/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ru\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" #: ../src/Engine/FrontendManager.cs:233 msgid "No network connections" msgstr "Нет сетевых соединений" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Оптимизация: {0}…" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Сбой оптимизации: {0}. Причина: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "" "Ваша история сообщений больше недоступна из-за ошибки, но будет сохраняться " "с этого момента." #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Нет подключения к серверу" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:778 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Недостаточно параметров для команды {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Подключён к {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:207 #, csharp-format msgid "Disconnected from {0}" msgstr "Отключён от {0}" #: ../src/Engine/Session.cs:218 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Не удалось автоматически подключиться к {0}!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:416 msgid "Engine Commands" msgstr "Команды ядра" #: ../src/Engine/Session.cs:527 msgid "Connect failed!" msgstr "Сбой при подключении!" #: ../src/Engine/Session.cs:550 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Сбой при разрыве подключения. Не удалось найти сервер: {0}" #: ../src/Engine/Session.cs:589 msgid "Reconnect failed!" msgstr "Сбой при повторном подключении!" #: ../src/Engine/Session.cs:608 msgid "Configuration reloaded" msgstr "Настройки перезагружены" #: ../src/Engine/Session.cs:613 msgid "Configuration saved" msgstr "Настройки сохранены" #: ../src/Engine/Session.cs:617 msgid "Invalid parameter for config; use load or save" msgstr "Недопустимый параметр для настроек; используйте load или save" #: ../src/Engine/Session.cs:676 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Недопустимый параметр для сети; используйте list, switch или close" #: ../src/Engine/Session.cs:687 msgid "Networks" msgstr "Сети" #: ../src/Engine/Session.cs:691 msgid "Protocol" msgstr "Протокол" #: ../src/Engine/Session.cs:692 msgid "Network" msgstr "Сеть" #: ../src/Engine/Session.cs:693 msgid "Host" msgstr "Сервер" #: ../src/Engine/Session.cs:694 msgid "Port" msgstr "Порт" #: ../src/Engine/Session.cs:709 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Сбой при закрытии. Не удалось найти сеть: {0}" #: ../src/Engine/Session.cs:748 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Сбой при переключении. Не удалось найти сеть: {0}" #: ../src/Engine/Session.cs:767 msgid "Not connected to any network" msgstr "Нет подключения к сетям" #: ../src/Engine/Session.cs:1013 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" "Сбой при выполнении записи истории сообщений. Ваша история сообщений не " "будет сохранена. Причина: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1185 msgid "Connect failed." msgstr "Сбой соединения." #: ../src/Engine/Session.cs:1216 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Не найден обработчик протокола: {0}" #: ../src/Engine/Session.cs:1448 msgid "Welcome to Smuxi" msgstr "Добро пожаловать в Smuxi" #: ../src/Engine/Session.cs:1455 msgid "Type /help to get a list of available commands." msgstr "Для получения списка команд введите /help" #: ../src/Engine/Session.cs:1461 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "" "Как только будет создано подключение, список доступных команд изменится. " "Перейдите на новую открытую вкладку и снова используйте команду /help, чтобы" " просмотреть расширенный список команд. " #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Требуется указать имя пользователя." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Требуется указать пароль." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "Пользователя \"{0}\" не существует." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "Пользователь \"{0}\" уже существует." #: ../src/Engine/Config/ServerListController.cs:131 msgid "Server hostname must not be empty." msgstr "Требуется указать имя сервера." #: ../src/Engine/Config/ServerListController.cs:134 msgid "Server hostname contains invalid characters (newline)." msgstr "Имя сервера содержит недопустимые символы или перенос строки." #: ../src/Engine/Config/ServerListController.cs:140 #, csharp-format msgid "Server '{0}' already exists." msgstr "Сервер '{0}' уже существует." #: ../src/Engine/Chats/ChatModel.cs:105 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" "Сбой при выполнении загрузки истории сообщений. Ваша история сообщений не " "будет сохранена. Причина: {0}" #: ../src/Engine/Chats/ChatModel.cs:290 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "" "Сбой при выполнении открытия для записи истории сообщений. Ваша история " "сообщений не будет сохранена. Причина: {0}" smuxi-0.11/po-Engine/pl.po0000644000175000017500000001546212300202374016173 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2012-01-01 18:47+0100\n" "PO-Revision-Date: 2012-01-07 11:23+0000\n" "Last-Translator: lukasznaw \n" "Language-Team: Polish (http://www.transifex.net/projects/p/smuxi/team/pl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pl\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" #: ../src/Engine/FrontendManager.cs:233 msgid "No network connections" msgstr "Brak połączeń" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Optymalizowanie: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Optymalizacja nieudana: {0}. Powód: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "" "Z powodu błędu, twoja historia czatu nie jest dostępna, ale od teraz będzie " "zachowywana." #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Nie połączony z serwerem" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:778 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Zbyt mało parametrów dla komendy {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Połączono z {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:207 #, csharp-format msgid "Disconnected from {0}" msgstr "Rozłączono z {0}" #: ../src/Engine/Session.cs:218 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Automatyczne łączenie z {0} nie powiodło się!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:416 msgid "Engine Commands" msgstr "Komendy silnika" #: ../src/Engine/Session.cs:527 msgid "Connect failed!" msgstr "Połączenie nieudane!" #: ../src/Engine/Session.cs:550 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Rozłączenie nieudane - nie znaleziono serwera: {0}" #: ../src/Engine/Session.cs:589 msgid "Reconnect failed!" msgstr "Ponowne połączenie nieudane!" #: ../src/Engine/Session.cs:608 msgid "Configuration reloaded" msgstr "Ustawienia wczytane ponownie" #: ../src/Engine/Session.cs:613 msgid "Configuration saved" msgstr "Ustawienia zapisane" #: ../src/Engine/Session.cs:617 msgid "Invalid parameter for config; use load or save" msgstr "" "Nieprawidłowy parametr dla config (konfiguracji); użyj save (załaduj) albo " "load (wczytaj)" #: ../src/Engine/Session.cs:676 msgid "Invalid parameter for network; use list, switch, or close" msgstr "" "Nieprawidłowy parametr dla network (sieci); użyj list (wypisz), switch " "(zmień) albo close (zamknij)" #: ../src/Engine/Session.cs:687 msgid "Networks" msgstr "Sieci" #: ../src/Engine/Session.cs:691 msgid "Protocol" msgstr "Protokół" #: ../src/Engine/Session.cs:692 msgid "Network" msgstr "Sieć" #: ../src/Engine/Session.cs:693 msgid "Host" msgstr "Serwer" #: ../src/Engine/Session.cs:694 msgid "Port" msgstr "Port" #: ../src/Engine/Session.cs:709 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Nie udało się zamknąć sieci - nie znaleziono sieci: {0}" #: ../src/Engine/Session.cs:748 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Nie udało się zmienić sieci - nie znaleziono sieci: {0}" #: ../src/Engine/Session.cs:767 msgid "Not connected to any network" msgstr "Nie połączono z żadną siecią" #: ../src/Engine/Session.cs:1013 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" "Nie udało się zapisać historii czatu. Twoja historia czatu nie będzie " "zachowana. Powód: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1185 msgid "Connect failed." msgstr "Połączenie nie powiodło się." #: ../src/Engine/Session.cs:1216 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Nie znaleziono menedżera protokołu dla: {0}" #: ../src/Engine/Session.cs:1448 msgid "Welcome to Smuxi" msgstr "Witaj w Smuxi" #: ../src/Engine/Session.cs:1455 msgid "Type /help to get a list of available commands." msgstr "Wpisz /help aby uzyskać listę dostępnych komend." #: ../src/Engine/Session.cs:1461 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "" "Po tym, jak się połączysz zmienia się lista dostępnych komend. Kliknij na " "nowo otwartą kartę połączenia i użyj komendy /help, aby zobaczyć powiększoną" " listę komend." #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Pole użytkownika nie może być puste." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Pole hasła nie może być puste" #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "Użytkownik \"{0}\" nie istnieje." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "Użytkownik \"{0}\" istnieje." #: ../src/Engine/Config/ServerListController.cs:131 msgid "Server hostname must not be empty." msgstr "Pole adresu serwera nie może być puste." #: ../src/Engine/Config/ServerListController.cs:134 msgid "Server hostname contains invalid characters (newline)." msgstr "Adres serwera zawiera niepoprawne znaki. (newline)" #: ../src/Engine/Config/ServerListController.cs:140 #, csharp-format msgid "Server '{0}' already exists." msgstr "Serwer '{0}' już istnieje." #: ../src/Engine/Chats/ChatModel.cs:105 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" "Nie udało się załadować historii czatu. Twoja historia czatu nie będzie " "zachowana. Powód: {0}" #: ../src/Engine/Chats/ChatModel.cs:290 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "" "Nie udało się otworzyć (do zapisywania) historii czatu. Twoja historia czatu" " nie będzie zachowana. Powód: {0}" smuxi-0.11/po-Engine/LINGUAS0000644000175000017500000000012412311343665016245 0ustar00meebeymeebey00000000000000cs da de en_GB es es_AR fa fi fr hr it nb_NO nl pl pt pt_BR ru sk sv te tr ur zh_CN smuxi-0.11/po-Engine/it.po0000644000175000017500000001263612300202374016174 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2010 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # # David Paleino , 2008. # Vincenzo Campanella , 2009, 2010. msgid "" msgstr "" "Project-Id-Version: smuxi-engine\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2010-09-11 09:33+0200\n" "Last-Translator: Vincenzo Campanella \n" "Language-Team: Italian \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" # #: ../src/Engine/FrontendManager.cs:230 msgid "No network connections" msgstr "Nessuna connessione di rete" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:161 msgid "Not connected to server" msgstr "Non connesso a un server" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:173 #: ../src/Engine/Session.cs:751 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Non sono stati forniti abbastanza parametri per il comando {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Connesso a {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:213 #, csharp-format msgid "Disconnected from {0}" msgstr "Disconnesso da {0}" #: ../src/Engine/Session.cs:154 msgid "Welcome to Smuxi" msgstr "Benvenuti in Smuxi" #: ../src/Engine/Session.cs:160 msgid "Type /help to get a list of available commands." msgstr "Digitare «/help» per ottenere un elenco dei comandi disponibili." # #: ../src/Engine/Session.cs:163 msgid "" "After you have made a connection the list of available commands changes. Use " "the /help command again to see the extended command list." msgstr "" "Dopo aver effettuato una connessione, l'elenco dei comandi disponibili " "cambia. Usare nuovamente il comando «/help» per vedere l'elenco dei comandi " "estesi." #: ../src/Engine/Session.cs:216 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "La connessione automatica a {0} non è riuscita." # #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:411 msgid "Engine Commands" msgstr "Comandi del motore" #: ../src/Engine/Session.cs:514 msgid "Connect failed!" msgstr "La connessione non è riuscita." #: ../src/Engine/Session.cs:544 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "La disconnessione non è riuscita, impossibile trovare il server: {0}" #: ../src/Engine/Session.cs:583 msgid "Reconnect failed!" msgstr "La riconnessione non è riuscita." #: ../src/Engine/Session.cs:602 msgid "Configuration reloaded" msgstr "Configurazione ricaricata" #: ../src/Engine/Session.cs:607 msgid "Configuration saved" msgstr "Configurazione salvata" #: ../src/Engine/Session.cs:611 msgid "Invalid parameter for config; use load or save" msgstr "Parametro non valido per la configurazione, utilizzare «load» o «save»" #: ../src/Engine/Session.cs:641 msgid "Invalid parameter for network; use list, switch, or close" msgstr "" "Parametro non valido per la rete, utilizzare «list», «switch» o «close»" #: ../src/Engine/Session.cs:652 msgid "Networks" msgstr "Reti" #: ../src/Engine/Session.cs:656 msgid "Type" msgstr "Tipo" #: ../src/Engine/Session.cs:657 msgid "Host" msgstr "Host" #: ../src/Engine/Session.cs:658 msgid "Port" msgstr "Porta" #: ../src/Engine/Session.cs:680 #, csharp-format msgid "Network close failed - could not find network with host: {0}" msgstr "" "La chiusura della rete non è riuscita, impossibile trovare la rete con " "l'host: {0}" #: ../src/Engine/Session.cs:725 #, csharp-format msgid "Network switch failed - could not find network with host: {0}" msgstr "" "Il cambio di rete non è riuscito, impossibile trovare la rete con l'host: {0}" #: ../src/Engine/Session.cs:740 msgid "Not connected to any network" msgstr "Non connesso ad alcuna rete" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1067 msgid "Connect failed." msgstr "La connessione non è riuscita." #: ../src/Engine/Session.cs:1098 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Nessun gestore trovato per il protocollo: {0}" #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Il nome utente non può essere vuoto." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "La password non può essere vuota." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "L'utente «{0}» non esiste." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "L'utente «{0}» esiste già." #: ../src/Engine/Config/ServerListController.cs:131 msgid "Server hostname must not be empty." msgstr "Il nome host del server non può essere vuoto." #: ../src/Engine/Config/ServerListController.cs:134 msgid "Server hostname contains invalid characters (newline)." msgstr "" "Il nome host del server contiene caratteri non validi (ritorno a capo)." #: ../src/Engine/Config/ServerListController.cs:140 #, csharp-format msgid "Server '{0}' already exists." msgstr "Il server «{0}» esiste già." #~ msgid "Unknown protocol: {0}" #~ msgstr "Protocollo sconosciuto: {0}" smuxi-0.11/po-Engine/de.po0000644000175000017500000002130012300202374016134 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Bianca Mix , 2011-2013 # Mirco Bauer , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-11 19:33+0000\n" "Last-Translator: Bianca Mix \n" "Language-Team: German (http://www.transifex.com/projects/p/smuxi/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "Keine Netzwerkverbindungen" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Optimiere: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Optimierung fehlgeschlagen: {0}. Grund: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "Ihr Gesprächsverlauf ist auf Grund eines Fehlers nicht länger verfügbar, er wird aber von fortan vorgehalten." #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "{0} tippt..." #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "{0} hat aufgehört zu tippen..." #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "{0} ist abwesend" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "{0} ist offline" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "{0} ist online" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Nicht mit dem Server verbunden" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Nicht genügend Parameter für den Befehl: {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Verbunden zu {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "Getrennt von {0}" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "Verbinde automatisch zu {0}..." #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Automatische Verbindung zu {0} ist fehlgeschlagen!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "Engine Befehle" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "Verbindung ist fehlgeschlagen!" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Die Trennung ist fehlgeschlagen - konnte den Server {0} nicht finden" #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "Wiederverbinden ist fehlgeschlagen!" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "Konfiguration wurde erneuert" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "Konfiguration wurde gespeichert" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "Ungültiges Schlüssel-/Wertformat" #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "Ungültiger Konfigurationsschlüssel: '{0}'" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "Konfigurationswert konnte nicht umgewandelt werden: '{0}' zu {1}" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "Ungültiger Konfigurationsparameter; benutzen Sie load, save, get oder set" #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Ungültiger Parameter für \"network\", verwenden Sie \"list\", \"switch\" oder \"close\"" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "Verbundene Netzwerke" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "Netzwerk" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "Protokoll" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "Host" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "Port" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "Keines" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "Verfügbare Netzwerke" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Schließen des Netzwerks fehlgeschlagen - Netzwerk konnte nicht gefunden werden: {0}" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Wechseln des Netzwerks fehlgeschlagen - Netzwerk konnte nicht gefunden werden: {0}" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "Zu keinem Netzwerk verbunden" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Schreiben des Gesprächverlaufs fehlgeschlagen. Ihr Gesprächsverlauf wird nicht vorgehalten. Grund: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "Verbindung ist fehlgeschlagen." #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Kein Protokoll-Manager gefunden für das Protokoll: {0}" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "Willkommen bei Smuxi" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "Geben Sie /help ein, um eine Liste der verfügbaren Befehle zu erhalten." #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "Nachdem Sie eine Verbindung aufgebaut haben, verändert sich die Liste der verfügbaren Kommandos. Gehen Sie zum neu geöffneten Verbindungsreiter und benutzen sie den Befehl /help erneut, um die erweiterte Kommandoliste zu sehen" #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Benutzername darf nicht leer sein." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Passwort darf nicht leer sein." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "Benutzer \"{0}\" ist nicht vorhanden." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "Benutzer \"{0}\" ist bereits vorhanden." #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "Netzwerk darf nicht leer sein." #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "Hostname des Servers darf nicht leer sein." #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "Hostname des Servers enthält unzuläissige Zeichen (neue Zeile)." #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "Die Server ID {0} ist bereits vorhanden." #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Laden des Gesprächverlaufs fehlgeschlagen. Ihr Gesprächsverlauf wird nicht vorgehalten. Grund: {0}" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "Öffnen des Gesprächverlaufs zum Schreiben fehlgeschlagen. Ihr Gesprächsverlauf wird nicht vorgehalten. Grund: {0}" smuxi-0.11/po-Engine/Makefile.in.in0000644000175000017500000001532012300202374017663 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE_ENGINE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/po-Engine/es.po0000644000175000017500000002066012300202374016163 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # toote, 2013 # Ricardo Hermosilla , 2012 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-10 18:27+0000\n" "Last-Translator: toote\n" "Language-Team: Spanish (http://www.transifex.com/projects/p/smuxi/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "No hay conexiones de red" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Optimizando: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Falló la optimización: {0}. Razón: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "Su historial de chat no está disponible debido a un error, pero será preservado desde ahora en adelante." #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "{0} está escribiendo..." #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "{0} dejó de escribir..." #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "{0} está ausente" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "{0} está desconectado" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "{0} está conectado" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "No conectado al servidor" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Parámetros insuficientes para la orden {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Conectado a {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "Desconectado de {0}" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "Conectando automáticamente a {0}..." #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "¡Falló la conexión automática a {0}!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "Órdenes del motor" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "¡Falló la conexión!" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Falló la desconexión, no se encontró el servidor: {0}" #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "¡Falló la reconexión!" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "Se recargó la configuración" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "Se guardó la configuración" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "Formato de clave/valor inválido." #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "Clave de configuración inválido: «{0}»" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "Fallo al convertir el valor de configuración «{0}» al tipo {1}" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "Parámetro inválido para la configuración: utilice load, save, get o set." #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Parámetro inválido para la red; utilice list, switch o close" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "Redes conectadas" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "Red" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "Protocolo" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "Servidor" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "Puerto" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "Ninguna" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "Redes disponibles" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Falló el cierre de la red - no se pudo encontrar la red: {0}" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Falló el cambio de red - no se pudo encontrar la red: {0}" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "No conectado a ninguna red" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Falló la escritura de su historial de chat. Su historial no será preservado. Razón: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "Falló la conexión." #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "No se encontró un gestor para el protocolo: {0}" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "Bienvenido a Smuxi" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "Escribe /help para obtener una lista de órdenes disponibles." #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "Después de establecer una conexión, cambia la lista de órdenes disponibles. Diríjase a la pestaña de conexión recién establecida y utilice la orden /help para ver una lista extendida." #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "El nombre de usuario no debe estar vacío" #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "La contraseña no debe estar vacía" #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "El usuario «{0}» no existe." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "El usuario «{0}» ya existe." #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "La red no debe estar vacía." #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "El dominio del servidor no debe estar vacío." #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "El dominio del servidor contiene caracteres inválidos (salto de línea)." #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "El ID de servidor «{0}» ya existe." #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "Falló la carga del historial de chat. Su historial no será preservado. Razón: {0}" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "Falló la apertura del historial de chat para escritura. Su historial no será preservado. Razón: {0}" smuxi-0.11/po-Engine/sk.po0000644000175000017500000001240112300202374016163 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Tomáš Vadina , 2011. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2011-09-30 08:39+0000\n" "Last-Translator: Tomáš Vadina \n" "Language-Team: Slovak (http://www.transifex.net/projects/p/smuxi/team/sk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sk\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n" #: ../src/Engine/FrontendManager.cs:230 msgid "No network connections" msgstr "Žiadne pripojenia k sieti" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:161 msgid "Not connected to server" msgstr "Nie je pripojené k serveru" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:173 #: ../src/Engine/Session.cs:751 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Pre príkaz {0} nie je vložený dostatok parametrov" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Pripojené k {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:213 #, csharp-format msgid "Disconnected from {0}" msgstr "Odpojené od {0}" #: ../src/Engine/Session.cs:154 msgid "Welcome to Smuxi" msgstr "Vitajte v Smuxi" #: ../src/Engine/Session.cs:160 msgid "Type /help to get a list of available commands." msgstr "Pre zobrazenie zoznamu dostupných príkazov zadajte príkaz /help." #: ../src/Engine/Session.cs:163 msgid "" "After you have made a connection the list of available commands changes. Use" " the /help command again to see the extended command list." msgstr "" "Zoznam dostupných príkazov sa zmení po tom, ako sa prihlásite. Pre " "zobrazenie rozšíreného zoznamu dostupných príkazov znovu zadajte príkaz " "/help." #: ../src/Engine/Session.cs:216 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Automatické pripojenie k {0} zlyhalo!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:411 msgid "Engine Commands" msgstr "Príkazy enginu" #: ../src/Engine/Session.cs:514 msgid "Connect failed!" msgstr "Pripojenie zlyhalo!" #: ../src/Engine/Session.cs:544 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Odpojenie zlyhalo - nepodarilo sa nájsť server: {0}" #: ../src/Engine/Session.cs:583 msgid "Reconnect failed!" msgstr "Opätovné pripojenie zlyhalo!" #: ../src/Engine/Session.cs:602 msgid "Configuration reloaded" msgstr "Nastavenie znova načítané" #: ../src/Engine/Session.cs:607 msgid "Configuration saved" msgstr "Nastavenie uložené" #: ../src/Engine/Session.cs:611 msgid "Invalid parameter for config; use load or save" msgstr "Neplatný parameter pre config; zadajte load alebo save" #: ../src/Engine/Session.cs:641 msgid "Invalid parameter for network; use list, switch, or close" msgstr "Neplatný parameter pre network; zadajte list, switch alebo close" #: ../src/Engine/Session.cs:652 msgid "Networks" msgstr "Siete" #: ../src/Engine/Session.cs:656 msgid "Type" msgstr "Typ" #: ../src/Engine/Session.cs:657 msgid "Host" msgstr "Hostiteľ" #: ../src/Engine/Session.cs:658 msgid "Port" msgstr "Port" #: ../src/Engine/Session.cs:680 #, csharp-format msgid "Network close failed - could not find network with host: {0}" msgstr "Uzatvorenie siete zlyhalo - nebolo možné nájsť hostiteľskú sieť: {0}" #: ../src/Engine/Session.cs:725 #, csharp-format msgid "Network switch failed - could not find network with host: {0}" msgstr "Sieťový uzol zlyhal - nebolo možné nájsť hostiteľskú sieť: {0}" #: ../src/Engine/Session.cs:740 msgid "Not connected to any network" msgstr "Nie je pripojené k žiadnej sieti" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1067 msgid "Connect failed." msgstr "Pripojenie zlyhalo." #: ../src/Engine/Session.cs:1098 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Pre protokol nebol nájdený žiadny správca protokolu: {0}" #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Používateľské meno nemôže byť prázdne." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Heslo nemôže byť prázdne." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "Používateľ \"{0}\" neexistuje." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "Používateľ \"{0}\" existuje." #: ../src/Engine/Config/ServerListController.cs:131 msgid "Server hostname must not be empty." msgstr "Hostiteľský server nemôže byť prázdny." #: ../src/Engine/Config/ServerListController.cs:134 msgid "Server hostname contains invalid characters (newline)." msgstr "Hostiteľský server obsahuje neplatné znaky (nový riadok)." #: ../src/Engine/Config/ServerListController.cs:140 #, csharp-format msgid "Server '{0}' already exists." msgstr "Server '{0}' už existuje." smuxi-0.11/po-Engine/te.po0000644000175000017500000001456012300202374016166 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:58+0100\n" "PO-Revision-Date: 2013-12-10 18:22+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/smuxi/language/te/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: te\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine/FrontendManager.cs:218 msgid "No network connections" msgstr "" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:782 #, csharp-format msgid "{0} is typing..." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:788 #, csharp-format msgid "{0} has stopped typing..." msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:831 #, csharp-format msgid "{0} is away" msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:837 #, csharp-format msgid "{0} is offline" msgstr "" #: ../src/Engine/Messages/MessageBuilder.cs:843 #, csharp-format msgid "{0} is online" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:998 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:219 #, csharp-format msgid "Disconnected from {0}" msgstr "" #: ../src/Engine/Session.cs:237 #, csharp-format msgid "Automatically connecting to {0}..." msgstr "" #: ../src/Engine/Session.cs:268 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:471 msgid "Engine Commands" msgstr "" #: ../src/Engine/Session.cs:599 msgid "Connect failed!" msgstr "" #: ../src/Engine/Session.cs:622 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "" #: ../src/Engine/Session.cs:664 msgid "Reconnect failed!" msgstr "" #: ../src/Engine/Session.cs:688 msgid "Configuration reloaded" msgstr "" #: ../src/Engine/Session.cs:692 msgid "Configuration saved" msgstr "" #: ../src/Engine/Session.cs:723 msgid "Invalid key/value format." msgstr "" #: ../src/Engine/Session.cs:733 #, csharp-format msgid "Invalid config key: '{0}'" msgstr "" #: ../src/Engine/Session.cs:743 ../src/Engine/Session.cs:749 #, csharp-format msgid "Could not convert config value: '{0}' to type: {1}" msgstr "" #: ../src/Engine/Session.cs:758 msgid "Invalid parameter for config; use load, save, get or set." msgstr "" #: ../src/Engine/Session.cs:850 msgid "Invalid parameter for network; use list, switch, or close" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:880 msgid "Connected Networks" msgstr "" #: ../src/Engine/Session.cs:885 ../src/Engine/Session.cs:909 msgid "Network" msgstr "" #: ../src/Engine/Session.cs:886 msgid "Protocol" msgstr "" #: ../src/Engine/Session.cs:887 msgid "Host" msgstr "" #: ../src/Engine/Session.cs:888 msgid "Port" msgstr "" #. TRANSLATOR: no connected networks #. TRANSLATOR: no available networks #: ../src/Engine/Session.cs:894 ../src/Engine/Session.cs:915 msgid "None" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of networks below #: ../src/Engine/Session.cs:901 msgid "Available Networks" msgstr "" #: ../src/Engine/Session.cs:929 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "" #: ../src/Engine/Session.cs:973 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "" #: ../src/Engine/Session.cs:991 msgid "Not connected to any network" msgstr "" #: ../src/Engine/Session.cs:1245 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1446 msgid "Connect failed." msgstr "" #: ../src/Engine/Session.cs:1460 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "" #: ../src/Engine/Session.cs:1734 msgid "Welcome to Smuxi" msgstr "" #: ../src/Engine/Session.cs:1741 msgid "Type /help to get a list of available commands." msgstr "" #: ../src/Engine/Session.cs:1747 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "" #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "" #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "" #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "" #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "" #: ../src/Engine/Config/ServerListController.cs:118 msgid "Network must not be empty." msgstr "" #: ../src/Engine/Config/ServerListController.cs:138 msgid "Server hostname must not be empty." msgstr "" #: ../src/Engine/Config/ServerListController.cs:141 msgid "Server hostname contains invalid characters (newline)." msgstr "" #: ../src/Engine/Config/ServerListController.cs:148 #, csharp-format msgid "Server ID '{0}' already exists." msgstr "" #: ../src/Engine/Chats/ChatModel.cs:108 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" #: ../src/Engine/Chats/ChatModel.cs:305 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "" smuxi-0.11/po-Engine/hr.po0000644000175000017500000001525112300202374016165 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2012-01-01 18:47+0100\n" "PO-Revision-Date: 2012-01-08 08:35+0000\n" "Last-Translator: Matias M. \n" "Language-Team: Croatian (http://www.transifex.net/projects/p/smuxi/team/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hr\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2\n" #: ../src/Engine/FrontendManager.cs:233 msgid "No network connections" msgstr "Nema mrežnih veza" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:295 #, csharp-format msgid "Optimizing: {0}..." msgstr "Optimizacija: {0}..." #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:313 #, csharp-format msgid "Failed to optimize: {0}. Reason: {1}" msgstr "Optimizacija nije uspjela: {0}. Razlog: {1}" #: ../src/Engine/MessageBuffers/Db4oMessageBuffer.cs:347 msgid "" "Your chat history is no longer available because of an error but will be " "preserved from now on." msgstr "" "Vaša chat povijest više nije dostupna zbog pogreške no od sada nadalje će " "biti sačuvana." #: ../src/Engine/Protocols/ProtocolManagerBase.cs:170 msgid "Not connected to server" msgstr "Nema povezanosti sa poslužiteljem" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:178 #: ../src/Engine/Session.cs:778 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Nema dovoljno parametara za {0} naredbu" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:189 #, csharp-format msgid "Connected to {0}" msgstr "Spojen na {0}" #: ../src/Engine/Protocols/ProtocolManagerBase.cs:207 #, csharp-format msgid "Disconnected from {0}" msgstr "Odspojeno sa {0}" #: ../src/Engine/Session.cs:218 #, csharp-format msgid "Automatic connect to {0} failed!" msgstr "Automatsko spajanje na {0} nije uspjelo!" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine/Session.cs:416 msgid "Engine Commands" msgstr "Naredbe jezgre" #: ../src/Engine/Session.cs:527 msgid "Connect failed!" msgstr "Spajanje nije uspjelo!" #: ../src/Engine/Session.cs:550 #, csharp-format msgid "Disconnect failed - could not find server: {0}" msgstr "Prekid veze nije uspio - nije moguće pronaći poslužitelj: {0}" #: ../src/Engine/Session.cs:589 msgid "Reconnect failed!" msgstr "Ponovno spajanje nije uspjelo!" #: ../src/Engine/Session.cs:608 msgid "Configuration reloaded" msgstr "Postavke ponovno učitane" #: ../src/Engine/Session.cs:613 msgid "Configuration saved" msgstr "Postavke pohranjene" #: ../src/Engine/Session.cs:617 msgid "Invalid parameter for config; use load or save" msgstr "Netočan parametar za postavke; upotrijebite load ili save naredbu" #: ../src/Engine/Session.cs:676 msgid "Invalid parameter for network; use list, switch, or close" msgstr "" "Netočan parametar za mrežu; upotrijebite list, switch ili close naredbu" #: ../src/Engine/Session.cs:687 msgid "Networks" msgstr "Mreže" #: ../src/Engine/Session.cs:691 msgid "Protocol" msgstr "Protokol" #: ../src/Engine/Session.cs:692 msgid "Network" msgstr "Mreža" #: ../src/Engine/Session.cs:693 msgid "Host" msgstr "Poslužitelj" #: ../src/Engine/Session.cs:694 msgid "Port" msgstr "Port" #: ../src/Engine/Session.cs:709 #, csharp-format msgid "Network close failed - could not find network: {0}" msgstr "Zatvaranje mreže nije uspjelo - mreža nije pronađena: {0}" #: ../src/Engine/Session.cs:748 #, csharp-format msgid "Network switch failed - could not find network: {0}" msgstr "Prebacivanje mreže nije uspjelo - mreža nije pronađena: {0}" #: ../src/Engine/Session.cs:767 msgid "Not connected to any network" msgstr "Nema povezanosti sa nijednom mrežom" #: ../src/Engine/Session.cs:1013 #, csharp-format msgid "" "Failed to write to chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" "Zapisivanje u chat povijest nije uspjelo. Vaša chat povijest neće biti " "sačuvana. Razlog: {0}" #. just in case the ProtocolManager is not setting the #. protocol chat #: ../src/Engine/Session.cs:1185 msgid "Connect failed." msgstr "Spajanje nije uspjelo." #: ../src/Engine/Session.cs:1216 #, csharp-format msgid "No protocol manager found for the protocol: {0}" msgstr "Za sljedeći protokol nema imenovanog upravitelja: {0}" #: ../src/Engine/Session.cs:1448 msgid "Welcome to Smuxi" msgstr "Smuxi vas pozdravlja" #: ../src/Engine/Session.cs:1455 msgid "Type /help to get a list of available commands." msgstr "Upišite /help za popis dostupnih naredbi." #: ../src/Engine/Session.cs:1461 msgid "" "After you have made a connection the list of available commands changes. Go " "to the newly opened connection tab and use the /help command again to see " "the extended command list." msgstr "" "Popis dostupnih naredbi se mijenja nakon spajanja. Odaberite novootvorenu " "karticu i upotrijebite /help naredbu za prikaz cjelokupnog popisa." #: ../src/Engine/Config/UserListController.cs:117 msgid "Username must not be empty." msgstr "Korisničko ime ne smije biti prazno." #: ../src/Engine/Config/UserListController.cs:127 msgid "Password must not be empty." msgstr "Lozinka ne smije biti prazna." #: ../src/Engine/Config/UserListController.cs:136 #, csharp-format msgid "User \"{0}\" doesn't exist." msgstr "Korisnik \"{0}\" ne postoji." #: ../src/Engine/Config/UserListController.cs:145 #, csharp-format msgid "User \"{0}\" already exists." msgstr "Korisnik \"{0}\" već postoji." #: ../src/Engine/Config/ServerListController.cs:131 msgid "Server hostname must not be empty." msgstr "Ime poslužitelja ne smije biti prazno." #: ../src/Engine/Config/ServerListController.cs:134 msgid "Server hostname contains invalid characters (newline)." msgstr "Ime poslužitelja sadrži nevažeće simbole (novi redak)." #: ../src/Engine/Config/ServerListController.cs:140 #, csharp-format msgid "Server '{0}' already exists." msgstr "Poslužitelj '{0}' već postoji." #: ../src/Engine/Chats/ChatModel.cs:105 #, csharp-format msgid "" "Failed to load chat history. Your chat history will not be preserved. " "Reason: {0}" msgstr "" "Učitavanje chat povijesti nije uspjelo. Vaša chat povijest neće biti " "sačuvana. Razlog: {0}" #: ../src/Engine/Chats/ChatModel.cs:290 #, csharp-format msgid "" "Failed to open chat history for writing. Your chat history will not be " "preserved. Reason: {0}" msgstr "" "Nije uspjelo otvaranje chat povijesti za zapis. Vaša chat povijest neće biti" " sačuvana. Razlog: {0}" smuxi-0.11/ltversion.m40000644000175000017500000000126212311344225015663 0ustar00meebeymeebey00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) smuxi-0.11/mono.m40000644000175000017500000000300412253423337014611 0ustar00meebeymeebey00000000000000AC_DEFUN([SHAMROCK_FIND_MONO_1_0_COMPILER], [ SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, mcs) ]) AC_DEFUN([SHAMROCK_FIND_MONO_2_0_COMPILER], [ SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, gmcs) ]) AC_DEFUN([SHAMROCK_FIND_MONO_2_0_COMPILER_OR_HIGHER], [ if pkg-config --atleast-version=2.8 mono; then SHAMROCK_FIND_PROGRAM(MCS, dmcs) fi if test "x$MCS" = "x" ; then SHAMROCK_FIND_PROGRAM(MCS, gmcs) fi if test "x$MCS" = "x" ; then AC_MSG_ERROR([You need to install 'dmcs' or 'gmcs']) fi ]) AC_DEFUN([SHAMROCK_FIND_MONO_RUNTIME], [ SHAMROCK_FIND_PROGRAM_OR_BAIL(MONO, mono) ]) AC_DEFUN([SHAMROCK_CHECK_MONO_MODULE], [ PKG_CHECK_MODULES(MONO_MODULE, mono >= $1) ]) AC_DEFUN([SHAMROCK_CHECK_MONO_MODULE_NOBAIL], [ PKG_CHECK_MODULES(MONO_MODULE, mono >= $1, HAVE_MONO_MODULE=yes, HAVE_MONO_MODULE=no) AC_SUBST(HAVE_MONO_MODULE) ]) AC_DEFUN([_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES], [ for asm in $(echo "$*" | cut -d, -f2- | sed 's/\,/ /g') do AC_MSG_CHECKING([for Mono $1 GAC for $asm.dll]) if test \ -e "$($PKG_CONFIG --variable=libdir mono)/mono/$1/$asm.dll" -o \ -e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/$1/$asm.dll"; \ then \ AC_MSG_RESULT([found]) else AC_MSG_RESULT([not found]) AC_MSG_ERROR([missing reqired Mono $1 assembly: $asm.dll]) fi done ]) AC_DEFUN([SHAMROCK_CHECK_MONO_1_0_GAC_ASSEMBLIES], [ _SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(1.0, $*) ]) AC_DEFUN([SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES], [ _SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(2.0, $*) ]) smuxi-0.11/po-Frontend/0000755000175000017500000000000012311344242015565 5ustar00meebeymeebey00000000000000smuxi-0.11/po-Frontend/fi.po0000644000175000017500000000744112300202374016526 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Kalle Kaitala , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-08-23 06:09+0000\n" "Last-Translator: Kalle Kaitala \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/smuxi/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "Tuntematon komento: {0}" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Ei tarpeeksi parametrejä {0} -komennolle" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "Moottori ei saa olla tyhjä." #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "Moottoria ei ole olemassa." #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Tuntematon kanava ({0}) - vain seuraavia kanavatyyppejä tuetaan:" #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "Rekisteröinti moottorin kanssa epäonnistui! Käyttäjänimi ja/tai salasana väärin - ole hyvä ja tarkista ne." #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "SSH-asiakasohjelmaa ei löytynyt:" #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "SSH-asiakasohjelman on oltava OpenSSH (ssh) tai Plink (plink.exe, ei putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "Paikallinen SSH-edelleenohjausportti {0} on jo käytössä. Onko vanha SSH-tunneli edelleen aktiivinen?" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "SSH-tunnelin pystytys epäonnistui (exit-koodi: {0})\n\nSSH-ohjelma: {1}\nSSH-parametrit: {2}\n\nOhjelmavirhe:\n{3}\nOhjelman tuloste:\n{4}\n" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "SSH-avaintiedostoa ei löytynyt." #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "SSH-avaintiedostoa ei voitu lukea." #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "OpenSSH:n versionumeroa ei löytynyt (exit-koodi: {0})\n\nSSH-ohjelma: {1}\n\nOhjelmavirhe:\n{2}\nOhjelman tuloste:\n{3}\n" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink vaatii että käyttäjänimi on asetettu." #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Plink:in versionumeroa ei löytynyt (exit-koodi: {0})\n\nSSH-ohjelma: {1}\n\nOhjelmavirhe:\n{2}\nOhjelman tuloste:\n{3}\n" smuxi-0.11/po-Frontend/zh_CN.po0000644000175000017500000000715412300202374017132 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Dean Lee , 2012-2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-12-13 08:18+0000\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/smuxi/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "未知命令: {0}" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "{0} 命令参数不足" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "引擎不能为空。" #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "引擎不存在。" #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "未知频道 ({0}) - 仅支持下列频道类型:" #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "引擎注册失败! 用户名和/或密码错误 - 请验证。" #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "未找到 SSH 客户端应用程序: " #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "SSH 客户端必须为 OpenSSH (ssh) 或 Plink (plink.exe, 而非 putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "本地 SSH 转发端口 {0} 已被占用。是不是还有旧版 SSH 隧道处于活动状态?" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "SSH 隧道安装失败 (退出代码: {0})\n\nSSH 程序: {1}\nSSH 参数: {2}\n\n程序错误:\n{3}\n程序输出:\n{4}\n" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "未找到 SSH 密钥文件。" #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "无法读取 SSH 密钥文件。" #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "未发现 OpenSSH 版本号 (退出代码: {0})\n\nSSH 程序: {1}\n\n程序错误:\n{2}\n程序输出:\n{3}\n" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink 需要设置用户名。" #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Plink 版本号未找到 (退出代码: {0})\n\nSSH 程序: {1}\n\n程序错误:\n{2}\n程序输出:\n{3}\n" smuxi-0.11/po-Frontend/POTFILES.skip0000644000175000017500000000044412300202374017701 0ustar00meebeymeebey00000000000000glade/ src/Common/ src/Frontend-GNOME/ src/Frontend-GNOME-IRC/ src/Frontend-GNOME-Twitter/ src/Frontend-GNOME-XMPP/ src/Frontend-STFL/ src/Frontend-SWF/ src/Frontend-WPF/ src/Engine/ src/Engine-Campfire/ src/Engine-IRC/ src/Engine-JabbR/ src/Engine-XMPP/ src/Engine-Twitter/ src/Server/ lib/ smuxi-0.11/po-Frontend/tr.po0000644000175000017500000000536612300202374016561 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-04-29 08:41+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/smuxi/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "" #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "" #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "" #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "" #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "" #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "" #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "" #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "" #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "" #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" smuxi-0.11/po-Frontend/pt.po0000644000175000017500000000765512300202374016562 0ustar00meebeymeebey00000000000000# Translation of smuxi-frontend messages to Portuguese # Copyright (C) 2010 the smuxi's copyright holder # This file is distributed under the same license as the smuxi-frontend package. # # Américo Monteiro , 2010. # Pedro Ribeiro , 2012. # msgid "" msgstr "" "Project-Id-Version: smuxi-frontend \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-12-29 09:21+0100\n" "PO-Revision-Date: 2012-01-07 17:26+0100\n" "Last-Translator: Pedro Ribeiro \n" "Language-Team: Portuguese \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend/CommandManager.cs:143 #, csharp-format msgid "Unknown Command: {0}" msgstr "Comando Desconhecido: {0}" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "O valor de 'Engine' não deve estar vazio" #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "Não existe esse 'Engine'." #: ../src/Frontend/EngineManager.cs:318 #, csharp-format msgid "Unknown channel ({0}) - only the following channel types are supported:" msgstr "" "Canal desconhecido ({0}) - apenas os seguintes tipos de canais são " "suportados:" #: ../src/Frontend/EngineManager.cs:327 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "" "O registo com o motor falhou! O nome de utilizador e/ou a palavra-passe " "estavam errados - por favor verifique-os." #: ../src/Frontend/SshTunnelManager.cs:145 msgid "SSH client application was not found: " msgstr "A aplicação cliente SSH não foi encontrada: " #: ../src/Frontend/SshTunnelManager.cs:148 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "" "O cliente SSH tem de ser ou OpenSSH (ssh) ou Plink (plink.exe, não putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:185 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "" "O porto de encaminhamento de SSH local {0} já está em uso. Existe um túnel " "SSH antigo ainda activo?" #: ../src/Frontend/SshTunnelManager.cs:209 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "" "Configuração do túnel SSH falhou (código ao terminar: {0})\n" "\n" "Programa SSH: {1}\n" "Parâmetros SSH: {2}\n" "\n" "Erro do Programa:\n" "{3}\n" "Saída do Programa:\n" "{4}\n" #: ../src/Frontend/SshTunnelManager.cs:330 #: ../src/Frontend/SshTunnelManager.cs:476 msgid "SSH keyfile not found." msgstr "Ficheiro de chaves SSH não encontrado." #: ../src/Frontend/SshTunnelManager.cs:336 #: ../src/Frontend/SshTunnelManager.cs:482 msgid "SSH keyfile could not be read." msgstr "Ficheiro de chaves SSH não pode ser lido." #: ../src/Frontend/SshTunnelManager.cs:424 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" "Número de versão de OpenSSH não encontrado (código ao terminar: {0})\n" "\n" "Programa SSH: {1}\n" "\n" "Erro do Programa:\n" "{2}\n" "Saída do Programa:\n" "{3}\n" #: ../src/Frontend/SshTunnelManager.cs:467 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink requer que seja definido um nome de utilizador." #: ../src/Frontend/SshTunnelManager.cs:555 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" "Número de versão de Plink não encontrado (código ao terminar: {0})\n" "\n" "Programa SSH: {1}\n" "\n" "Erro do Programa:\n" "{2}\n" "Saída do Programa:\n" "{3}\n" smuxi-0.11/po-Frontend/fa.po0000644000175000017500000000650212300202374016513 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Behrooz Amoozad , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-08-19 12:56+0000\n" "Last-Translator: Behrooz Amoozad \n" "Language-Team: Persian (http://www.transifex.com/projects/p/smuxi/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "دستور ناشناخته: {0}" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "" #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "" #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "کانال ناشناخته ({0}) فقط کانال های ذیل پشتیبانی میشوند. " #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "ثبت نام نا موفق بود.نام کاربر و/یا رمز نادرست بودند - لطفا از صحت آنها اطمینان پیدا کنید." #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "برنامه ssh پیدا نشد:" #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "برنامه ssh باید یا OpenSSH(ssh) و یا PLink(plink.exe و نه putty.exe) باشد." #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "درگاه داخلی {0} در حال ساتفاده است؟ آیا یک تونل قدیمی ssh هنوز فعال است؟" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "" #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "" #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "" #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" smuxi-0.11/po-Frontend/fr.po0000644000175000017500000000767012300202374016543 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Clément Bourgeois , 2011 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-04-29 08:41+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: French (http://www.transifex.com/projects/p/smuxi/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "Commande inconnue : {0}" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Pas assez de paramètres pour la commande {0}" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "Le moteur ne doit pas être vide." #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "Le moteur n'existe pas." #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Canal inconnu ({0}), seuls les types de canaux suivants sont supportés :" #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "Impossible de s'enregistrer auprès du moteur, le nom d'utilisateur et/ou le mot de passe était(ent) mauvais, veuillez le(s) vérifier." #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "L'application SSH client n'a pas été trouvée :" #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "Le client SSH doit être soit OpenSSH (ssh) ou Plink (plink.exe, et non putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "La redirection locale de port {0} est toujours en cours d'utilisation. L'ancien tunnel SSH est-il toujours actif ?" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "Mise en route du tunnel SSH échouée (code de sortie : {0})\n\nProgramme SSH : {1}\nParamètres SSH : {2}\n\nErreur du programme :\n{3}\nSortie du programme :\n{4}\n" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "Fichier de clé SSH introuvable" #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "Impossible de lire le fichier de clé SSH." #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Impossible de trouver la version d'OpenSSH (code de sortie: {0})\n\nProgramme SSH: {1}\n\nErreur du programme:\n{2}\nSortie du programme:\n{3}\n" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY ou Plink nécessitent un nom d'utilisateur pour fonctionner." #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Numéro de version Plink non trouvé (code de retour : {0})\n\nProgramme SSH : {1}\n\nErreur du programme : \n{2}\nSortie du programme : \n{3}\n" smuxi-0.11/po-Frontend/sv.po0000644000175000017500000000754212300202374016562 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # flugsio , 2013 # flugsio , 2011 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-12-10 13:32+0000\n" "Last-Translator: Martin Bagge \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/smuxi/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sv\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "Okänt kommando: {0}" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Inte tillräckligt med parametrar för kommandot {0}" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "Motor får inte lämnas tom." #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "Vald motor finns inte." #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Okänd kanal ({0}) - endast följande kanaltyper stöds:" #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "Kunde inte ansluta till motorn! Användarnamnet och/eller lösenordet var fel - kontrollera dessa." #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "SSH-klient-applikationen kunde inte hittas:" #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "SSH-klienten måste vara antingen OpenSSH (ssh) eller Plink (plink.exe, inte putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "Den lokala porten för vidaresändning av SSH {0} används redan. Finns där en gammal SSH-tunnel som fortfarande är aktiv?" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "Fel vid upprättande av SSH-tunnel (felkod: {0})\n\nSSH-applikation: {1}\nSSH-parameterar: {2}\n\nApplikationsfel:\n{3}\nUtdata från applikation:\n{4}\n" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "SSH-nyckelfil hittades inte." #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "SSH-nyckelfilen kunde inte läsas." #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Versionsnummer för OpenSSH kunde inte hittas (felkod: {0})\n\nSSH-applikation: {1}\n\nApplikationsfel:\n{2}\nUtdata från applikation:\n{3}\n" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY/Plink kräver att ett användarnamn används." #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Plink versions-nummer hittades inte (avslutningskod: {0})\n\nSSH program: {1}\n\nProgramfel:\n{2}\nProgramutdata:\n{3}\n" smuxi-0.11/po-Frontend/en_GB.po0000644000175000017500000000523112300202374017075 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2009 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # Ryan Smith-Evans , 2009. # msgid "" msgstr "" "Project-Id-Version: smuxi 0.6.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-09 21:43+0100\n" "PO-Revision-Date: 2010-01-09 00:08+0100\n" "Last-Translator: Ryan Smith-Evans \n" "Language-Team: English (British)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/Frontend/CommandManager.cs:144 #, csharp-format msgid "Unknown Command: {0}" msgstr "Unknown Command: {0}" #: ../src/Frontend/EngineManager.cs:292 #, csharp-format msgid "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Unknown channel ({0}). Only the following channel types are supported:" #: ../src/Frontend/EngineManager.cs:301 msgid "Registration with engine failed! The username and/or password were wrong - please verify them." msgstr "Registration with engine failed! The username and/or password are incorrect - please verify them." #: ../src/Frontend/SshTunnelManager.cs:146 msgid "SSH client application was not found: " msgstr "SSH client application was not found: " #: ../src/Frontend/SshTunnelManager.cs:149 msgid "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:186 #, csharp-format msgid "The local SSH forwarding port {0} is already in use. Is there an old SSH tunnel still active?" msgstr "The local SSH forwarding port {0} is already in use. Is there an old SSH tunnel still active?" #: ../src/Frontend/SshTunnelManager.cs:210 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "" "SSH tunnel setup failed with (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" #: ../src/Frontend/SshTunnelManager.cs:405 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" "Couldn't get OpenSSH version (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" #: ../src/Frontend/SshTunnelManager.cs:441 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink requires a username to be set." smuxi-0.11/po-Frontend/cs.po0000644000175000017500000000751412300202374016536 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Ondřej Hošek , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-05-22 18:03+0000\n" "Last-Translator: Ondřej Hošek \n" "Language-Team: Czech (http://www.transifex.com/projects/p/smuxi/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "Neznámý příkaz: {0}" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Nedostatek parametrů pro příkaz {0}" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "Engine nesmí být prázdný." #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "Engine neexistuje." #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Neznámý kanál ({0}) - podporovány jsou pouze následující typy kanálů:" #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "Registrace selhala! Uživatelské jméno nebo heslo bylo chybné - zkontrolujte je prosím." #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "Klientská aplikace SSH nebyla nalezena: " #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "Klient SSH musí být buď OpenSSH (ssh) nebo Plink (plink.exe, nikoli putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "Místní forwarding SSH port {0} se již používá. Není stále aktivní dřívější tunel SSH?" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "Nastavení tunelu SSH selhalo (exit code: {0})\n\nProgram SSH: {1}\nParametry SSH: {2}\n\nChyba programu:\n{3}\nVýstup programu:\n{4}\n" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "Soubor s klíčem SSH nenalezen." #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "Načtení souboru s klíčem SSH se nezdařilo." #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Nenalezeno číslo verze OpenSSH (exit code: {0})\n\nProgram SSH: {1}\n\nChyba programu:\n{2}\nVýstup programu:\n{3}\n" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink potřebuje mít nastavené uživatelské jméno." #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Číslo verze programu Plink nenalezeno (kód ukončení: {0})\n\nProgram SSH: {1}\n\nChyba programu:\n{2}\n\nVýstup programu:\n{3}\n" smuxi-0.11/po-Frontend/nl.po0000644000175000017500000000741212311343665016552 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Jeroen Baten , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-12-26 14:58+0000\n" "Last-Translator: Jeroen Baten \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/smuxi/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "Onbekend commando: {0}" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Niet genoeg parameters voor {0} commando" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "Engine mag niet leeg zijn." #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "Engine bestaat niet." #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Onbekend kanaal ({0}) - Alleen de volgende kanaaltypes worden ondersteund:" #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "Registratie van engine mislukt! De gebruikersnaam en/of wachtwoord waren niet correct - controleer ze aub." #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "SSH client applicatie was niet gevonden:" #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "SSH client dient OpenSSH (ssh) of Plink (plink.exe, niet putty.exe) te zijn" #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "De lokale SSH forwarding poort {0} is reeds in gebruik. Is er nog een oudere SSH tunnel actief?" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "SSH tunnel setup niet gelukt (exit code: {0})\n\nSSH programma: {1}\nSSH parameters: {2}\n\nProgrammafout:\n{3}\nProgramma-uitvoer:\n{4}\n" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "SSH keyfile niet gevonden." #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "SSH keyfile kon niet gelezen worden." #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "OpenSSH versienummer niet gevonden (exit code: {0})\n\nSSH programma: {1}\n\nProgrammafout:\n{2}\nProgramma-uitvoer:\n{3}\n" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink heeft een ingestelde gebruikersnaam nodig." #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Plink versienummer niet gevonden (exit code: {0})\n\nSSH programma: {1}\n\nProgrammafout:\n{2}\nProgramma-uitvoer:\n{3}\n" smuxi-0.11/po-Frontend/es_AR.po0000644000175000017500000000535412300202374017122 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2009 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # Juan Miguel Carrero , 2008-2009. # msgid "" msgstr "" "Project-Id-Version: smuxi 0.6.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-09 21:43+0100\n" "PO-Revision-Date: 2009-11-29 17:11-0300\n" "Last-Translator: Damian Kleiman \n" "Language-Team: Spanish Spanish Localization \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/Frontend/CommandManager.cs:144 #, csharp-format msgid "Unknown Command: {0}" msgstr "" #: ../src/Frontend/EngineManager.cs:292 #, fuzzy, csharp-format msgid "Unknown channel ({0}) - only the following channel types are supported:" msgstr "" "Canal desconocido ({0}), sólo los siguientes tipos de canales estan " "soportados:" #: ../src/Frontend/EngineManager.cs:301 #, fuzzy msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "" "Falló el registro en el motor , usuario o contraseña inválidos, compruebe " "los datos." #: ../src/Frontend/SshTunnelManager.cs:146 msgid "SSH client application was not found: " msgstr "El programa del cliente SSH no se ha encontrado: " #: ../src/Frontend/SshTunnelManager.cs:149 #, fuzzy msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "" "El cliente SSH debe ser o OpenSSH (ssh) o Plink (plink.exe, no putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:186 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "" #: ../src/Frontend/SshTunnelManager.cs:210 #, fuzzy, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "" "La configuración del tunel SSH falló (código de salida: {0})\n" "\n" "Programa SSH: {1}\n" "\n" "Error de aplicación:\n" "{2}\n" "Salida de aplicaciónt:\n" "{3}\n" #: ../src/Frontend/SshTunnelManager.cs:405 #, fuzzy, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" "No ha sido posible obtener la versión de OpenSSH (código de salida: {0})\n" "\n" "Programa SSH: {1}\n" "\n" "Error del programa:\n" "{2}\n" "Salida del programa:\n" "{3}\n" #: ../src/Frontend/SshTunnelManager.cs:441 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink necesita que se establezca un usuario." smuxi-0.11/po-Frontend/da.po0000644000175000017500000000741512300202374016515 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Joe Hansen , 2011,2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-04-29 08:41+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Danish (http://www.transifex.com/projects/p/smuxi/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "Ukendt kommando: {0}" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Ikke nok parametre for kommandoen {0}" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "Motor må ikke være tom." #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "Motor findes ikke." #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Ukendt kanal ({0}) - kun de følgende kanaltyper er understøttet:" #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "Registrering med motor mislykkedes! Brugernavnet og/eller adgangskoden var forkert - bekræft dem venligst." #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "SSH-klientprogram blev ikke fundet: " #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "SSH-klient skal enten være OpenSSH (ssh) eller Plink (plink.exe, ikke putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "Den lokale SSH-videresendelsesport {0} er allerede i brug. Er der en gammel SSH-tunnel, der stadig er aktiv?" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "Kunne ikke opsætte SSH-tunnel (afbrydelseskode: {0})\n\nSSH-program: {1}\nSSH-parametre: {2}\n\nProgramfejl:\n{3}\nProgramuddata:\n{4}\n" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "SSH-nøglefil blev ikke fundet." #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "SSH-nøglefil kunne ikke læses." #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Versionnummer for OpenSSH blev ikke fundet (afbrydelseskode: {0})\n\nSSH-program: {1}\n\nProgramfejl:\n{2}\nProgramuddata:\n{3}\n" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink kræver at et brugernavn er angivet." #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Plink-versionsnummer blev ikke fundet (afslutningskode: {0})\n\nSSH-program: {1}\n\nProgramfejl:\n{2}\nProgramuddata:\n{3}\n" smuxi-0.11/po-Frontend/POTFILES.in0000644000175000017500000000013612300202374017337 0ustar00meebeymeebey00000000000000src/Frontend/CommandManager.cs src/Frontend/EngineManager.cs src/Frontend/SshTunnelManager.cs smuxi-0.11/po-Frontend/pt_BR.po0000644000175000017500000000753312300202374017140 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Leonardopf , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-07-15 00:19+0000\n" "Last-Translator: Leonardopf \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/smuxi/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "Comando desconhecido: {0}" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Parâmetro insuficiente para o comando {0}" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "Motor não pode estar vazio." #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "Motor não existe." #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Canal desconhecido ({0}) - Somente os seguintes tipos de canais são suportados:" #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "Registro do motor falhou! O nome de usuário e/ou senha estão errados - por favor verifique-os" #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "Programa de cliente SSH não encontrado:" #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "O cliente SSH deve ser ou OpenSSH(ssh) ou Plink (plink.exe, não putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "A porta {0} que será feito o forwarding já está em uso. Você tem um antigo tunel SSH ainda ativo?" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "Criação do Tunel SSh falhou (código de saída: {0})\n\nPrograma SSH: {1}\nParâmetros SSH: {2}\n\nErro do programa:\n{3}\nSaída do programa:\n{4}\n" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "Arquivo-chave SSH não encontrado." #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "Arquivo-chave SSH não pôde ser lido." #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Versão do OpenSSH não encontrada (código de saída: {0})\n\nPrograma SSH: {1}\n\nErro do programa:\n{2}\nSaída do programa:\n{3}\n" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink necessita de um nome de usuário para ser usado. " #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Versão do Plink não encontrada (código de saída: {0})\n\nPrograma SSH: {1}\n\nErro do programa:\n{2}\nSaída do programa:\n{3}\n" smuxi-0.11/po-Frontend/pl.po0000644000175000017500000000751012300202374016540 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:21+0100\n" "PO-Revision-Date: 2012-01-06 19:55+0000\n" "Last-Translator: lukasznaw \n" "Language-Team: Polish (http://www.transifex.net/projects/p/smuxi/team/pl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pl\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" #: ../src/Frontend/CommandManager.cs:143 #, csharp-format msgid "Unknown Command: {0}" msgstr "Nieznana komenda: {0}" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "Silnik nie może być pusty." #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "Ten silnik nie istnieje." #: ../src/Frontend/EngineManager.cs:318 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Nieznany kanał ({0}) - wspierane są tylko następujące typy kanałów:" #: ../src/Frontend/EngineManager.cs:327 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "" "Rejestracja silnika nie powiodła się! Nazwa użytkownika i/lub hasło są " "niepoprawne - sprawdź je." #: ../src/Frontend/SshTunnelManager.cs:145 msgid "SSH client application was not found: " msgstr "Nie znaleziono aplikacji klienta SSH: " #: ../src/Frontend/SshTunnelManager.cs:148 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "" "Klientem SSH musi być albo OpenSSH (ssh) albo Plink (plink.exe, nie " "putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:185 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "" "Lokalny port przekierowania SSH {0} jest już używany. Czy stary tunel SSH " "jest nadal aktywny?" #: ../src/Frontend/SshTunnelManager.cs:209 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "" "Nie udało się ustawienie tunelu SSH (kod wyjścia: {0})\n" "\n" "Program SSH: {1}\n" "Parametry SSH: {2}\n" "\n" "Błąd programu:\n" "{3}\n" "Dane wyjściowe programu:\n" "{4}\n" #: ../src/Frontend/SshTunnelManager.cs:330 #: ../src/Frontend/SshTunnelManager.cs:476 msgid "SSH keyfile not found." msgstr "Nie znaleziono pliku z kluczem SSH." #: ../src/Frontend/SshTunnelManager.cs:336 #: ../src/Frontend/SshTunnelManager.cs:482 msgid "SSH keyfile could not be read." msgstr "Nie można odczytać pliku z kluczem SSH." #: ../src/Frontend/SshTunnelManager.cs:424 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" "Nie znaleziono numeru wersji OpenSSH (kod wyjścia: {0})\n" "\n" "Program SSH: {1}\n" "\n" "Błąd programu:\n" "{2}\n" "Dane wyjściowe programu:\n" "{3}\n" #: ../src/Frontend/SshTunnelManager.cs:467 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink wymaga ustawienia nazwy użytkownika." #: ../src/Frontend/SshTunnelManager.cs:555 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" "Nie znaleziono numeru wersji Plink (kod wyjścia: {0})\n" "\n" "Program SSH: {1}\n" "\n" "Błąd programu:\n" "{2}\n" "Dane wyjściowe programu:\n" "{3}\n" smuxi-0.11/po-Frontend/LINGUAS0000644000175000017500000000011012311343665016612 0ustar00meebeymeebey00000000000000ca cs da de es es_AR en_GB fa fi fr hr it nl pl pt pt_BR sv te tr zh_CN smuxi-0.11/po-Frontend/it.po0000644000175000017500000000552712300202374016547 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2010 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # # Vincenzo Campanella , 2009-2010, 2010. msgid "" msgstr "" "Project-Id-Version: smuxi-frontend\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2010-07-15 13:15+0200\n" "Last-Translator: Vincenzo Campanella \n" "Language-Team: Italian \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/Frontend/CommandManager.cs:143 #, csharp-format msgid "Unknown Command: {0}" msgstr "Comando sconosciuto: {0}" #: ../src/Frontend/EngineManager.cs:292 #, csharp-format msgid "Unknown channel ({0}) - only the following channel types are supported:" msgstr "" "Il canale {0} è sconosciuto. Sono supportati solo i seguenti tipi di canale:" #: ../src/Frontend/EngineManager.cs:301 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "" "La registrazione con il motore non è riuscita: il nome utente o la password " "sono errati. Verificarli." #: ../src/Frontend/SshTunnelManager.cs:146 msgid "SSH client application was not found: " msgstr "Non è stata trovata l'applicazione client di SSH: " #: ../src/Frontend/SshTunnelManager.cs:149 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "" "Il client SSH deve essere OpenSSH (ssh) o Plink (plink.exe, non putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:186 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "" "La porta d'inoltro locale di SSH {0} è già utilizzata. Controllare se è " "ancora attivo un vecchio tunnel SSH." #: ../src/Frontend/SshTunnelManager.cs:210 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "" "Impostazione del tunnel SSH non riuscita (codice di uscita: {0})\n" "\n" "Programma SSH: {1}\n" "Parametri SSH: {2}\n" "\n" "Errore del programma:\n" "{3}\n" "Output del programma:\n" "{4}\n" #: ../src/Frontend/SshTunnelManager.cs:405 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" "Numero di versione di OpenSSH non trovato (codice di uscita: {0})\n" "\n" "Programma SSH: {1}\n" "\n" "Errore del programma:\n" "{2}\n" "Output del programma:\n" "{3}\n" #: ../src/Frontend/SshTunnelManager.cs:441 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink richiede l'impostazione di un nome utente." smuxi-0.11/po-Frontend/de.po0000644000175000017500000000756212300202374016524 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Bianca Mix , 2011,2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-04-29 08:41+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: German (http://www.transifex.com/projects/p/smuxi/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "Unbekannter Befehl: {0}" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Nicht genügend Parameter für Kommando {0}" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "Engine darf nicht leer sein." #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "Engine existiert nicht." #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Unbekannter Channel ({0}) - nur die folgenden Channel-Typen werden unterstützt:" #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "Registierung gegenüber der Engine ist fehlgeschlagen. Benutzer und/oder Passwort ist falsch, bitte überprüfen Sie Ihre Eingabe." #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "SSH-Client-Programm wurde nicht gefunden: " #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "SSH-Client muss entweder OpenSSH (ssh) oder Plink (plink.exe, nicht putty.exe) sein" #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "Der lokale SSH Weiterleitungs-Port {0} wird bereits verwendet. Ist noch ein alter SSH Tunnel aktiv?" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "Aufbau des SSH-Tunnels ist fehlgeschlagen (Exit-Code: {0})\n\nSSH-Programm: {1}\nSSH-Parameter: {2}\n\nProgramm-Fehler:\n{3}\nProgramm-Ausgabe:\n{4}\n" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "SSH Schlüssel-Datei nicht gefunden." #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "SSH Schlüssel-Datei konnte nicht gelesen werden." #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "OpenSSH-Version konnte nicht ermittelt werden (Exit-Code: {0})\n\nSSH-Programm: {1}\n\nProgramm-Fehler:\n{2}\nProgramm-Ausgabe:\n{3}\n" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink fordert einen gesetzten Benutzernamen." #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "Plink Versionsnummer nicht gefunden (Rückgabewert: {0})\n\nSSH Programm: {1}\n\nProgramm Fehler:\n{2}\nProgramm Ausgabe:\n{3}\n" smuxi-0.11/po-Frontend/Makefile.in.in0000644000175000017500000001532212300202374020237 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE_FRONTEND@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/po-Frontend/es.po0000644000175000017500000000754712300202374016546 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # toote, 2013 # Ricardo Hermosilla , 2012 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-12-10 18:57+0000\n" "Last-Translator: toote\n" "Language-Team: Spanish (http://www.transifex.com/projects/p/smuxi/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "Orden desconocida: {0}" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "Faltan parámetros para la orden {0}" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "El motor no puede estar vacío." #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "El motor no existe." #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Canal desconocido ({0}) - sólo se es compatible con los siguientes tipos de canales:" #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "¡Falló la registración con el motor! El usuario y/o la contraseña son inválidos - verifíquelos. " #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "No se encontró el programa del cliente SSH:" #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "El cliente SSH debe ser OpenSSH (ssh) o Plink (plink.exe, no putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "El puerto local SSH {0} está actualmente en uso. ¿Existe todavía un túnel SSH antiguo activo?" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "Falló la configuración del túnel SSH (código de salida: {0})\n\nPrograma SSH: {1}\nParámetros SSH: {2}\n\nError del programa:\n{3}\nSalida del programa:\n{4}\n" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "No se econtró el archivo de claves SSH." #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "No se pudo leer el archivo de claves SSH." #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "No ha sido posible obtener la versión de OpenSSH (código de salida: {0})\n\nPrograma SSH: {1}\n\nError del programa:\n{2}\nSalida del programa:\n{3}\n" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink necesita que configure un usuario." #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "No se encontró la versión de Plink (código de salida: {0})\n\nPrograma SSH: {1}\n\nError del programa:\n{2}\n\nSalida del programa:\n{3}\n" smuxi-0.11/po-Frontend/te.po0000644000175000017500000000536612300202374016544 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:03+0100\n" "PO-Revision-Date: 2013-12-10 18:22+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/smuxi/language/te/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: te\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend/CommandManager.cs:343 #, csharp-format msgid "Unknown Command: {0}" msgstr "" #: ../src/Frontend/CommandManager.cs:352 #, csharp-format msgid "Not enough parameters for {0} command" msgstr "" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "" #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "" #: ../src/Frontend/EngineManager.cs:317 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "" #: ../src/Frontend/EngineManager.cs:326 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "" #: ../src/Frontend/SshTunnelManager.cs:144 msgid "SSH client application was not found: " msgstr "" #: ../src/Frontend/SshTunnelManager.cs:147 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "" #: ../src/Frontend/SshTunnelManager.cs:184 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "" #: ../src/Frontend/SshTunnelManager.cs:208 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "" #: ../src/Frontend/SshTunnelManager.cs:329 #: ../src/Frontend/SshTunnelManager.cs:478 msgid "SSH keyfile not found." msgstr "" #: ../src/Frontend/SshTunnelManager.cs:335 #: ../src/Frontend/SshTunnelManager.cs:484 msgid "SSH keyfile could not be read." msgstr "" #: ../src/Frontend/SshTunnelManager.cs:426 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" #: ../src/Frontend/SshTunnelManager.cs:469 msgid "PuTTY / Plink requires a username to be set." msgstr "" #: ../src/Frontend/SshTunnelManager.cs:557 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" smuxi-0.11/po-Frontend/hr.po0000644000175000017500000000742712300202374016545 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:21+0100\n" "PO-Revision-Date: 2012-01-08 14:11+0000\n" "Last-Translator: Matias M. \n" "Language-Team: Croatian (http://www.transifex.net/projects/p/smuxi/team/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hr\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2\n" #: ../src/Frontend/CommandManager.cs:143 #, csharp-format msgid "Unknown Command: {0}" msgstr "Nepoznata naredba: {0}" #: ../src/Frontend/EngineManager.cs:122 msgid "Engine must not be empty." msgstr "Jezgra ne smije biti prazna." #: ../src/Frontend/EngineManager.cs:133 msgid "Engine does not exist." msgstr "Jezgra ne postoji." #: ../src/Frontend/EngineManager.cs:318 #, csharp-format msgid "" "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Nepoznati kanal ({0}) - samo sljedeći oblici kanala su podržani:" #: ../src/Frontend/EngineManager.cs:327 msgid "" "Registration with engine failed! The username and/or password were wrong - " "please verify them." msgstr "" "Registracija sa jezgrom nije uspjela! Korisničko ime i/ili lozinka su krivi" " - molimo provjerite ih." #: ../src/Frontend/SshTunnelManager.cs:145 msgid "SSH client application was not found: " msgstr "SSH klijent nije pronađen: " #: ../src/Frontend/SshTunnelManager.cs:148 msgid "" "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "" "SSH klijent mora biti OpenSSH (ssh) ili Plink (plink.exe, ne putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:185 #, csharp-format msgid "" "The local SSH forwarding port {0} is already in use. Is there an old SSH " "tunnel still active?" msgstr "" "Lokalni SSH port preusmjeravanja {0} je već u upotrebi. Da li je neki drugi " "SSH tunel još aktivan?" #: ../src/Frontend/SshTunnelManager.cs:209 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "" "Instalacija SSH tunela nije uspjela (izlazni kȏd: {0})\n" "\n" "SSH program: {1}\n" "SSH parametri: {2}\n" "\n" "Programska greška:\n" "{3}\n" "Programski ispis:\n" "{4}\n" #: ../src/Frontend/SshTunnelManager.cs:330 #: ../src/Frontend/SshTunnelManager.cs:476 msgid "SSH keyfile not found." msgstr "SSH ključ nije pronađen." #: ../src/Frontend/SshTunnelManager.cs:336 #: ../src/Frontend/SshTunnelManager.cs:482 msgid "SSH keyfile could not be read." msgstr "SSH ključ nije moguće pročitati." #: ../src/Frontend/SshTunnelManager.cs:424 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" "Oznaka OpenSSH inačice nije pronađena (izlazni kȏd: {0})\n" "\n" "SSH program: {1}\n" "\n" "Programska greška:\n" "{2}\n" "Programski ispis:\n" "{3}\n" #: ../src/Frontend/SshTunnelManager.cs:467 msgid "PuTTY / Plink requires a username to be set." msgstr "PuTTY / Plink zahtijeva postavljanje korisničkog imena." #: ../src/Frontend/SshTunnelManager.cs:555 #, csharp-format msgid "" "Plink version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" "Oznaka inačice Plinka nije pronađena (izlazni kȏd: {0})\n" "\n" "SSH program: {1}\n" "\n" "Programska greška:\n" "{2}\n" "Programski ispis:\n" "{3}\n" smuxi-0.11/po-Frontend/ca.po0000644000175000017500000000525312300202374016512 0ustar00meebeymeebey00000000000000msgid "" msgstr "" "Project-Id-Version: Smuxi\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-07-15 01:40+0200\n" "PO-Revision-Date: \n" "Last-Translator: Siegfried-Angel Gevatter Pujals \n" "Language-Team: Siegfried-Angel Gevatter Pujals \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1\n" "X-Poedit-Language: Catalan\n" #: ../src/Frontend/CommandManager.cs:143 #, csharp-format msgid "Unknown Command: {0}" msgstr "Orde desconeguda: {0}" #: ../src/Frontend/EngineManager.cs:292 #, csharp-format msgid "Unknown channel ({0}) - only the following channel types are supported:" msgstr "Sala desconeguda ({0}) - només s'admeten els següent tipus de sales:" #: ../src/Frontend/EngineManager.cs:301 msgid "Registration with engine failed! The username and/or password were wrong - please verify them." msgstr "No s'ha pogut registrar amb el motor! El nom d'usuari i/o la contrasenya són incorrectes - comproveu-les." #: ../src/Frontend/SshTunnelManager.cs:146 msgid "SSH client application was not found: " msgstr "No s'ha trobat cap client d'SSH:" #: ../src/Frontend/SshTunnelManager.cs:149 msgid "SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)" msgstr "El client d'SSH ha de ser l'OpenSSH (ssh) o bé el Plink (plink.exe, no putty.exe)" #: ../src/Frontend/SshTunnelManager.cs:186 #, csharp-format msgid "The local SSH forwarding port {0} is already in use. Is there an old SSH tunnel still active?" msgstr "El port local de reenviament de l'SSH {0} ja està en ús. Hi ha un túnel SSH vell que encara estigui actiu?" #: ../src/Frontend/SshTunnelManager.cs:210 #, csharp-format msgid "" "SSH tunnel setup failed (exit code: {0})\n" "\n" "SSH program: {1}\n" "SSH parameters: {2}\n" "\n" "Program Error:\n" "{3}\n" "Program Output:\n" "{4}\n" msgstr "" "Ha fallat la creació del túnel SSH (codi de sortida: {0})\n" "\n" "Programa SSH: {1}\n" "Paràmetres SSH: {2}\n" "\n" "Missatges d'error del programa:\n" "{3}\n" "Sortida del programa:\n" "{4}\n" #: ../src/Frontend/SshTunnelManager.cs:405 #, csharp-format msgid "" "OpenSSH version number not found (exit code: {0})\n" "\n" "SSH program: {1}\n" "\n" "Program Error:\n" "{2}\n" "Program Output:\n" "{3}\n" msgstr "" "No s'ha trobat el nombre de versió de l'OpenSSH (codi de sortida: {0})\n" "\n" "Programa SSH: {1}\n" "\n" "Missatge d'error del programa:\n" "{2}\n" "Sortida del programa:\n" "{3}\n" #: ../src/Frontend/SshTunnelManager.cs:441 msgid "PuTTY / Plink requires a username to be set." msgstr "El PuTTY / Plink requereix que un nom d'usuari estigui establert." smuxi-0.11/configure0000755000175000017500000236003512311344231015310 0ustar00meebeymeebey00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for smuxi 0.11. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: https://smuxi.im/issues/new about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='smuxi' PACKAGE_TARNAME='smuxi' PACKAGE_VERSION='0.11' PACKAGE_STRING='smuxi 0.11' PACKAGE_BUGREPORT='https://smuxi.im/issues/new' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" gt_needs= enable_option_checking=no ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS ENABLE_FRONTEND_TEST_FALSE ENABLE_FRONTEND_TEST_TRUE ENABLE_FRONTEND_WPF_FALSE ENABLE_FRONTEND_WPF_TRUE ENABLE_FRONTEND_SWF_FALSE ENABLE_FRONTEND_SWF_TRUE ENABLE_FRONTEND_CURSES_FALSE ENABLE_FRONTEND_CURSES_TRUE ENABLE_FRONTEND_STFL_FALSE ENABLE_FRONTEND_STFL_TRUE ENABLE_STATIC_STFL_FALSE ENABLE_STATIC_STFL_TRUE STFL_LIBS STFL_CFLAGS ENABLE_FRONTEND_GNOME_XMPP_FALSE ENABLE_FRONTEND_GNOME_XMPP_TRUE ENABLE_FRONTEND_GNOME_TWITTER_FALSE ENABLE_FRONTEND_GNOME_TWITTER_TRUE ENABLE_FRONTEND_GNOME_IRC_FALSE ENABLE_FRONTEND_GNOME_IRC_TRUE ENABLE_FRONTEND_GNOME_FALSE ENABLE_FRONTEND_GNOME_TRUE FRONTEND_GNOME_COMPILER_FLAGS GLADE_SHARP_20_LIBS GLADE_SHARP_20_CFLAGS GTK_SHARP_20_LIBS GTK_SHARP_20_CFLAGS GLIB_SHARP_20_LIBS GLIB_SHARP_20_CFLAGS SERVER_COMPILER_FLAGS ENABLE_ENGINE_JABBR_FALSE ENABLE_ENGINE_JABBR_TRUE twitter_api_key ENABLE_ENGINE_TWITTER_FALSE ENABLE_ENGINE_TWITTER_TRUE ENABLE_ENGINE_XMPP_FALSE ENABLE_ENGINE_XMPP_TRUE ENABLE_ENGINE_CAMPFIRE_FALSE ENABLE_ENGINE_CAMPFIRE_TRUE ENABLE_ENGINE_IRC_FALSE ENABLE_ENGINE_IRC_TRUE GTKSPELL_LIBS GTKSPELL_CFLAGS NDESK_DBUS_GLIB_LIBS NDESK_DBUS_GLIB_CFLAGS NDESK_DBUS_LIBS NDESK_DBUS_CFLAGS DBUS_LIBS DBUS_SHARP_GLIB_LIBS DBUS_SHARP_GLIB_CFLAGS DBUS_SHARP_LIBS DBUS_SHARP_CFLAGS NOTIFY_SHARP_LIBS NOTIFY_SHARP_CFLAGS INDICATE_SHARP_LIBS INDICATE_SHARP_CFLAGS WITH_MESSAGINGMENU_SHARP_INCLUDED_FALSE WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE MESSAGINGMENU_SHARP_FILES subdirs GIO_SHARP_FILES GIO_SHARP_LIBS GIO_SHARP_CFLAGS MESSAGING_MENU_LIBS MESSAGING_MENU_CFLAGS MESSAGINGMENU_SHARP_LIBS MESSAGINGMENU_SHARP_CFLAGS DB4O_FILES XBUILD BUNDLE_DB4O_FALSE BUNDLE_DB4O_TRUE DB4O_LIBS DB4O_CFLAGS BUNDLE_NINI_FALSE BUNDLE_NINI_TRUE NINI_LIBS NINI_CFLAGS LOG4NET_LIBS LOG4NET_CFLAGS XBUILD_FLAGS CSC_FLAGS CSC PROFILE ENABLE_DEBUG_FALSE ENABLE_DEBUG_TRUE ENABLE_RELEASE_FALSE ENABLE_RELEASE_TRUE MCS MONO MONO_MODULE_LIBS MONO_MODULE_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH expanded_libdir dist_version DEV_VERSION_SUFFIX git_commit_hash git_branch LTLIBINTL LIBINTL INTLLIBS LTLIBICONV LIBICONV INTL_MACOSX_LIBS XGETTEXT_EXTRA_OPTIONS XGETTEXT_015 GMSGFMT_015 MSGFMT_015 GETTEXT_MACRO_VERSION GETTEXT_PACKAGE_FRONTEND_WPF GETTEXT_PACKAGE_FRONTEND_SWF GETTEXT_PACKAGE_FRONTEND_CURSES GETTEXT_PACKAGE_FRONTEND_STFL GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER GETTEXT_PACKAGE_FRONTEND_GNOME_IRC GETTEXT_PACKAGE_FRONTEND_GNOME GETTEXT_PACKAGE_FRONTEND GETTEXT_PACKAGE_SERVER GETTEXT_PACKAGE_ENGINE_JABBR GETTEXT_PACKAGE_ENGINE_CAMPFIRE GETTEXT_PACKAGE_ENGINE_TWITTER GETTEXT_PACKAGE_ENGINE_XMPP GETTEXT_PACKAGE_ENGINE_IRC GETTEXT_PACKAGE_ENGINE GETTEXT_PACKAGE POSUB DATADIRNAME ALL_LINGUAS INTLTOOL_PERL GMSGFMT MSGFMT MSGMERGE XGETTEXT INTLTOOL_POLICY_RULE INTLTOOL_SERVICE_RULE INTLTOOL_THEME_RULE INTLTOOL_SCHEMAS_RULE INTLTOOL_CAVES_RULE INTLTOOL_XML_NOMERGE_RULE INTLTOOL_XML_RULE INTLTOOL_KBD_RULE INTLTOOL_XAM_RULE INTLTOOL_UI_RULE INTLTOOL_SOUNDLIST_RULE INTLTOOL_SHEET_RULE INTLTOOL_SERVER_RULE INTLTOOL_PONG_RULE INTLTOOL_OAF_RULE INTLTOOL_PROP_RULE INTLTOOL_KEYS_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_DESKTOP_RULE intltool__v_merge_options_0 intltool__v_merge_options_ INTLTOOL_V_MERGE_OPTIONS INTLTOOL__v_MERGE_0 INTLTOOL__v_MERGE_ INTLTOOL_V_MERGE INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE USE_NLS CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL PKG_CONFIG MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_static enable_shared with_pic enable_fast_install enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_nls enable_rpath with_libiconv_prefix with_libintl_prefix with_vendor_package_version enable_release enable_debug with_db4o with_messaging_menu with_indicate with_notify with_dbus with_gtkspell enable_engine_irc enable_engine_campfire enable_engine_xmpp enable_engine_twitter with_twitter_api_key enable_engine_jabbr enable_frontend_gnome enable_frontend_stfl enable_frontend_curses enable_frontend_swf enable_frontend_wpf enable_frontend_test ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR MONO_MODULE_CFLAGS MONO_MODULE_LIBS LOG4NET_CFLAGS LOG4NET_LIBS NINI_CFLAGS NINI_LIBS DB4O_CFLAGS DB4O_LIBS MESSAGINGMENU_SHARP_CFLAGS MESSAGINGMENU_SHARP_LIBS MESSAGING_MENU_CFLAGS MESSAGING_MENU_LIBS GIO_SHARP_CFLAGS GIO_SHARP_LIBS INDICATE_SHARP_CFLAGS INDICATE_SHARP_LIBS NOTIFY_SHARP_CFLAGS NOTIFY_SHARP_LIBS DBUS_SHARP_CFLAGS DBUS_SHARP_LIBS DBUS_SHARP_GLIB_CFLAGS DBUS_SHARP_GLIB_LIBS NDESK_DBUS_CFLAGS NDESK_DBUS_LIBS NDESK_DBUS_GLIB_CFLAGS NDESK_DBUS_GLIB_LIBS GTKSPELL_CFLAGS GTKSPELL_LIBS GLIB_SHARP_20_CFLAGS GLIB_SHARP_20_LIBS GTK_SHARP_20_CFLAGS GTK_SHARP_20_LIBS GLADE_SHARP_20_CFLAGS GLADE_SHARP_20_LIBS STFL_CFLAGS STFL_LIBS' ac_subdirs_all='lib/messagingmenu-sharp' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures smuxi 0.11 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/smuxi] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of smuxi 0.11:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths --enable-release Use 'RELEASE' Configuration [default=NO] --enable-debug Use 'DEBUG' Configuration [default=YES] --enable-engine-irc Enable IRC protocol support (default yes) --enable-engine-campfire Enable Campfire protocol support (default yes) --enable-engine-xmpp Enable XMPP (Jabber) protocol support (default yes) --enable-engine-twitter Enable Twitter support (default yes) --enable-engine-jabbr Enable JabbR support (default yes) --enable-frontend-gnome Enable GNOME frontend (default yes) --enable-frontend-stfl Enable STFL frontend (default no) --enable-frontend-curses Enable Ncurses frontend (default no) --enable-frontend-swf Enable SWF (WinForms) frontend (default no) --enable-frontend-wpf Enable WPF (Windows Presentation Foundation) frontend (default no) --enable-frontend-test Enable Test frontend (default no) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir --with-vendor-package-version="DISTRO_NAME PACKAGE_VERSION" Set the distro name and package version, e.g. "Debian 0.8-1" --with-db4o=auto|system|included Use system or included db4o [default=auto] --with-messaging-menu=auto|system|included|no Support Messaging Menu (Ubuntu >= 12.10) [default=auto] --with-indicate Support Messaging Menu (Ubuntu <= 12.04) [default=auto] --with-notify Support Desktop Notifications [default=auto] --with-dbus Support D-Bus [default=auto] --with-gtkspell Support GTK+ spell checking [default=auto] --with-twitter-api-key Specify custom Twitter API key Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path MONO_MODULE_CFLAGS C compiler flags for MONO_MODULE, overriding pkg-config MONO_MODULE_LIBS linker flags for MONO_MODULE, overriding pkg-config LOG4NET_CFLAGS C compiler flags for LOG4NET, overriding pkg-config LOG4NET_LIBS linker flags for LOG4NET, overriding pkg-config NINI_CFLAGS C compiler flags for NINI, overriding pkg-config NINI_LIBS linker flags for NINI, overriding pkg-config DB4O_CFLAGS C compiler flags for DB4O, overriding pkg-config DB4O_LIBS linker flags for DB4O, overriding pkg-config MESSAGINGMENU_SHARP_CFLAGS C compiler flags for MESSAGINGMENU_SHARP, overriding pkg-config MESSAGINGMENU_SHARP_LIBS linker flags for MESSAGINGMENU_SHARP, overriding pkg-config MESSAGING_MENU_CFLAGS C compiler flags for MESSAGING_MENU, overriding pkg-config MESSAGING_MENU_LIBS linker flags for MESSAGING_MENU, overriding pkg-config GIO_SHARP_CFLAGS C compiler flags for GIO_SHARP, overriding pkg-config GIO_SHARP_LIBS linker flags for GIO_SHARP, overriding pkg-config INDICATE_SHARP_CFLAGS C compiler flags for INDICATE_SHARP, overriding pkg-config INDICATE_SHARP_LIBS linker flags for INDICATE_SHARP, overriding pkg-config NOTIFY_SHARP_CFLAGS C compiler flags for NOTIFY_SHARP, overriding pkg-config NOTIFY_SHARP_LIBS linker flags for NOTIFY_SHARP, overriding pkg-config DBUS_SHARP_CFLAGS C compiler flags for DBUS_SHARP, overriding pkg-config DBUS_SHARP_LIBS linker flags for DBUS_SHARP, overriding pkg-config DBUS_SHARP_GLIB_CFLAGS C compiler flags for DBUS_SHARP_GLIB, overriding pkg-config DBUS_SHARP_GLIB_LIBS linker flags for DBUS_SHARP_GLIB, overriding pkg-config NDESK_DBUS_CFLAGS C compiler flags for NDESK_DBUS, overriding pkg-config NDESK_DBUS_LIBS linker flags for NDESK_DBUS, overriding pkg-config NDESK_DBUS_GLIB_CFLAGS C compiler flags for NDESK_DBUS_GLIB, overriding pkg-config NDESK_DBUS_GLIB_LIBS linker flags for NDESK_DBUS_GLIB, overriding pkg-config GTKSPELL_CFLAGS C compiler flags for GTKSPELL, overriding pkg-config GTKSPELL_LIBS linker flags for GTKSPELL, overriding pkg-config GLIB_SHARP_20_CFLAGS C compiler flags for GLIB_SHARP_20, overriding pkg-config GLIB_SHARP_20_LIBS linker flags for GLIB_SHARP_20, overriding pkg-config GTK_SHARP_20_CFLAGS C compiler flags for GTK_SHARP_20, overriding pkg-config GTK_SHARP_20_LIBS linker flags for GTK_SHARP_20, overriding pkg-config GLADE_SHARP_20_CFLAGS C compiler flags for GLADE_SHARP_20, overriding pkg-config GLADE_SHARP_20_LIBS linker flags for GLADE_SHARP_20, overriding pkg-config STFL_CFLAGS C compiler flags for STFL, overriding pkg-config STFL_LIBS linker flags for STFL, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF smuxi configure 0.11 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by smuxi $as_me 0.11, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi gt_needs="$gt_needs " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # using the --foreign option makes automake less strict about GNU policy am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='smuxi' VERSION='0.11' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' # The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 $as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; } if test $am_uid -le $am_max_uid; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } _am_tools=none fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 $as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; } if test $am_gid -le $am_max_gid; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } _am_tools=none fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 $as_echo_n "checking how to create a ustar tar archive... " >&6; } # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_ustar-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_ustar}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 (cat conftest.dir/file) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if ${am_cv_prog_tar_ustar+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_ustar=$_am_tool fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 $as_echo "$am_cv_prog_tar_ustar" >&6; } # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$PKG_CONFIG" = "xno"; then as_fn_error $? "You need to install pkg-config" "$LINENO" 5 fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: #LT_INIT([disable-static]) # I18N { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } case "$am__api_version" in 1.01234) as_fn_error $? "Automake 1.5 or newer is required to use intltool" "$LINENO" 5 ;; *) ;; esac INTLTOOL_REQUIRED_VERSION_AS_INT=`echo 0.25 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` if test -n "0.25"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intltool >= 0.25" >&5 $as_echo_n "checking for intltool >= 0.25... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found" >&5 $as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; } test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || as_fn_error $? "Your intltool is too old. You need intltool 0.25 or later." "$LINENO" 5 fi # Extract the first word of "intltool-update", so it can be a program name with args. set dummy intltool-update; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_UPDATE+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_UPDATE in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_UPDATE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE if test -n "$INTLTOOL_UPDATE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_UPDATE" >&5 $as_echo "$INTLTOOL_UPDATE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "intltool-merge", so it can be a program name with args. set dummy intltool-merge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_MERGE+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_MERGE in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_MERGE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE if test -n "$INTLTOOL_MERGE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_MERGE" >&5 $as_echo "$INTLTOOL_MERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "intltool-extract", so it can be a program name with args. set dummy intltool-extract; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_EXTRACT+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_EXTRACT in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_EXTRACT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT if test -n "$INTLTOOL_EXTRACT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_EXTRACT" >&5 $as_echo "$INTLTOOL_EXTRACT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then as_fn_error $? "The intltool scripts were not found. Please install intltool." "$LINENO" 5 fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' INTLTOOL__v_MERGE_0='@echo " ITMRG " $@;' INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' intltool__v_merge_options_0='-q' INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< $@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< $@' else INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.$$RANDOM && mkdir $$_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u $$_it_tmp_dir $< $@ && rmdir $$_it_tmp_dir' fi INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' # Check the gettext tools to make sure they are GNU # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case $XGETTEXT in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XGETTEXT=$ac_cv_path_XGETTEXT if test -n "$XGETTEXT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case $MSGMERGE in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MSGMERGE=$ac_cv_path_MSGMERGE if test -n "$MSGMERGE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $MSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MSGFMT=$ac_cv_path_MSGFMT if test -n "$MSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 fi xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_PERL in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL if test -n "$INTLTOOL_PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_PERL" >&5 $as_echo "$INTLTOOL_PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$INTLTOOL_PERL"; then as_fn_error $? "perl not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl >= 5.8.1" >&5 $as_echo_n "checking for perl >= 5.8.1... " >&6; } $INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 if test $? -ne 0; then as_fn_error $? "perl 5.8.1 is required for intltool" "$LINENO" 5 else IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IT_PERL_VERSION" >&5 $as_echo "$IT_PERL_VERSION" >&6; } fi if test "x" != "xno-xml"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML::Parser" >&5 $as_echo_n "checking for XML::Parser... " >&6; } if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else as_fn_error $? "XML::Parser perl module is required for intltool" "$LINENO" 5 fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile # Set DATADIRNAME correctly if it is not set yet # (copied from glib-gettext.m4) if test -z "$DATADIRNAME"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : DATADIRNAME=share else case $host in *-*-solaris*) ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : DATADIRNAME=share else DATADIRNAME=lib fi ;; *) DATADIRNAME=lib ;; esac fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi POSUB=" po po-Engine po-Engine-Campfire po-Engine-IRC po-Engine-JabbR po-Engine-Twitter po-Engine-XMPP po-Server po-Frontend po-Frontend-GNOME po-Frontend-GNOME-IRC po-Frontend-GNOME-Twitter po-Frontend-GNOME-XMPP po-Frontend-SWF " GETTEXT_PACKAGE=smuxi GETTEXT_PACKAGE_ENGINE=smuxi-engine cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_ENGINE "$GETTEXT_PACKAGE_ENGINE" _ACEOF GETTEXT_PACKAGE_ENGINE_IRC=smuxi-engine-irc cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_ENGINE_IRC "$GETTEXT_PACKAGE_ENGINE_IRC" _ACEOF GETTEXT_PACKAGE_ENGINE_XMPP=smuxi-engine-xmpp cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_ENGINE_XMPP "$GETTEXT_PACKAGE_ENGINE_XMPP" _ACEOF GETTEXT_PACKAGE_ENGINE_TWITTER=smuxi-engine-twitter cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_ENGINE_TWITTER "$GETTEXT_PACKAGE_ENGINE_TWITTER" _ACEOF GETTEXT_PACKAGE_ENGINE_CAMPFIRE=smuxi-engine-campfire cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_ENGINE_CAMPFIRE "$GETTEXT_PACKAGE_ENGINE_CAMPFIRE" _ACEOF GETTEXT_PACKAGE_ENGINE_JABBR=smuxi-engine-jabbr cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_ENGINE_JABBR "$GETTEXT_PACKAGE_ENGINE_JABBR" _ACEOF GETTEXT_PACKAGE_SERVER=smuxi-server cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_SERVER "$GETTEXT_PACKAGE_SERVER" _ACEOF GETTEXT_PACKAGE_FRONTEND=smuxi-frontend cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_FRONTEND "$GETTEXT_PACKAGE_FRONTEND" _ACEOF GETTEXT_PACKAGE_FRONTEND_GNOME=smuxi-frontend-gnome cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_FRONTEND_GNOME "$GETTEXT_PACKAGE_FRONTEND_GNOME" _ACEOF GETTEXT_PACKAGE_FRONTEND_GNOME_IRC=smuxi-frontend-gnome-irc cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_FRONTEND_GNOME_IRC "$GETTEXT_PACKAGE_FRONTEND_GNOME_IRC" _ACEOF GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER=smuxi-frontend-gnome-twitter cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER "$GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER" _ACEOF GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP=smuxi-frontend-gnome-xmpp cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP "$GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP" _ACEOF GETTEXT_PACKAGE_FRONTEND_STFL=smuxi-frontend-stfl cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_FRONTEND_STFL "$GETTEXT_PACKAGE_FRONTEND_STFL" _ACEOF GETTEXT_PACKAGE_FRONTEND_CURSES=smuxi-frontend-curses cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_FRONTEND_CURSES "$GETTEXT_PACKAGE_FRONTEND_CURSES" _ACEOF GETTEXT_PACKAGE_FRONTEND_SWF=smuxi-frontend-swf cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_FRONTEND_SWF "$GETTEXT_PACKAGE_FRONTEND_SWF" _ACEOF GETTEXT_PACKAGE_FRONTEND_WPF=smuxi-frontend-wpf cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE_FRONTEND_WPF "$GETTEXT_PACKAGE_FRONTEND_WPF" _ACEOF GETTEXT_MACRO_VERSION=0.18 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$localedir" || localedir='${datadir}/locale' test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= ac_config_commands="$ac_config_commands po-directories" if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 sixtyfour bits #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sixtyfour bits" >/dev/null 2>&1; then : gl_cv_solaris_64bit=yes else gl_cv_solaris_64bit=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 $as_echo "$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFPreferencesCopyAppValue=yes else gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 $as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFLocaleCopyCurrent=yes else gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 $as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 $as_echo_n "checking for GNU gettext in libc... " >&6; } if eval \${$gt_func_gnugettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libc=yes" else eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$gt_func_gnugettext_libc { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; const char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : am_cv_func_iconv_works=yes else am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBINTL= LTLIBINTL= INCINTL= LIBINTL_PREFIX= HAVE_LIBINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if eval \${$gt_func_gnugettext_libintl+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libintl=yes" else eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi eval ac_res=\$$gt_func_gnugettext_libintl { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 $as_echo_n "checking whether to use NLS... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 $as_echo_n "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 $as_echo "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 $as_echo_n "checking how to link with libintl... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 $as_echo "$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h $as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h fi POSUB=po fi INTLLIBS="$LIBINTL" # doesn't support multiple po directories :( #AM_GLIB_GNU_GETTEXT # Check whether --with-vendor-package-version was given. if test "${with_vendor_package_version+set}" = set; then : withval=$with_vendor_package_version; else with_vendor_package_version= fi WITH_VENDOR_PACKAGE_VERSION=$with_vendor_package_version if test "x$WITH_VENDOR_PACKAGE_VERSION" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for git version" >&5 $as_echo_n "checking for git version... " >&6; } if git log --oneline 295b37c8ac4939829a3c7f9150943dba8fff07f0 > /dev/null 2>&1; then GIT_BRANCH=$(git branch | grep '^\*' | cut -d ' ' -f 2) GIT_COMMIT_HASH=$(git log --no-color --first-parent -n1 --pretty=format:%h) DIST_VERSION=$GIT_BRANCH/$GIT_COMMIT_HASH DEV_VERSION_SUFFIX="-dev" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else DIST_VERSION=tarball DEV_VERSION_SUFFIX= { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else DIST_VERSION=$WITH_VENDOR_PACKAGE_VERSION fi git_branch="$GIT_BRANCH" git_commit_hash="$GIT_COMMIT_HASH" dist_version="$DIST_VERSION" expanded_libdir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac eval echo $libdir )` if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MONO_MODULE" >&5 $as_echo_n "checking for MONO_MODULE... " >&6; } if test -n "$MONO_MODULE_CFLAGS"; then pkg_cv_MONO_MODULE_CFLAGS="$MONO_MODULE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mono >= 1.9.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "mono >= 1.9.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MONO_MODULE_CFLAGS=`$PKG_CONFIG --cflags "mono >= 1.9.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$MONO_MODULE_LIBS"; then pkg_cv_MONO_MODULE_LIBS="$MONO_MODULE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mono >= 1.9.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "mono >= 1.9.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MONO_MODULE_LIBS=`$PKG_CONFIG --libs "mono >= 1.9.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MONO_MODULE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mono >= 1.9.1" 2>&1` else MONO_MODULE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mono >= 1.9.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MONO_MODULE_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (mono >= 1.9.1) were not met: $MONO_MODULE_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables MONO_MODULE_CFLAGS and MONO_MODULE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables MONO_MODULE_CFLAGS and MONO_MODULE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else MONO_MODULE_CFLAGS=$pkg_cv_MONO_MODULE_CFLAGS MONO_MODULE_LIBS=$pkg_cv_MONO_MODULE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Extract the first word of "mono", so it can be a program name with args. set dummy mono; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MONO+:} false; then : $as_echo_n "(cached) " >&6 else case $MONO in [\\/]* | ?:[\\/]*) ac_cv_path_MONO="$MONO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MONO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MONO" && ac_cv_path_MONO="no" ;; esac fi MONO=$ac_cv_path_MONO if test -n "$MONO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MONO" >&5 $as_echo "$MONO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$MONO" = "xno"; then as_fn_error $? "You need to install 'mono'" "$LINENO" 5 fi if pkg-config --atleast-version=2.8 mono; then # Extract the first word of "dmcs", so it can be a program name with args. set dummy dmcs; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MCS+:} false; then : $as_echo_n "(cached) " >&6 else case $MCS in [\\/]* | ?:[\\/]*) ac_cv_path_MCS="$MCS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MCS=$ac_cv_path_MCS if test -n "$MCS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5 $as_echo "$MCS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$MCS" = "x" ; then # Extract the first word of "gmcs", so it can be a program name with args. set dummy gmcs; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MCS+:} false; then : $as_echo_n "(cached) " >&6 else case $MCS in [\\/]* | ?:[\\/]*) ac_cv_path_MCS="$MCS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MCS=$ac_cv_path_MCS if test -n "$MCS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5 $as_echo "$MCS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$MCS" = "x" ; then as_fn_error $? "You need to install 'dmcs' or 'gmcs'" "$LINENO" 5 fi for asm in $(echo "2.0,System System.Core System.Xml System.Runtime.Remoting Mono.Posix " | cut -d, -f2- | sed 's/\,/ /g') do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mono 2.0 GAC for $asm.dll" >&5 $as_echo_n "checking for Mono 2.0 GAC for $asm.dll... " >&6; } if test \ -e "$($PKG_CONFIG --variable=libdir mono)/mono/2.0/$asm.dll" -o \ -e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/2.0/$asm.dll"; \ then \ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "missing reqired Mono 2.0 assembly: $asm.dll" "$LINENO" 5 fi done PROFILE=debug # Check whether --enable-release was given. if test "${enable_release+set}" = set; then : enableval=$enable_release; enable_release=yes else enable_release=no fi if test x$enable_release = xyes; then ENABLE_RELEASE_TRUE= ENABLE_RELEASE_FALSE='#' else ENABLE_RELEASE_TRUE='#' ENABLE_RELEASE_FALSE= fi if test "x$enable_release" = "xyes" ; then PROFILE=release fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; enable_debug=yes else enable_debug=no fi if test x$enable_debug = xyes; then ENABLE_DEBUG_TRUE= ENABLE_DEBUG_FALSE='#' else ENABLE_DEBUG_TRUE='#' ENABLE_DEBUG_FALSE= fi if test "x$enable_debug" = "xyes" ; then PROFILE=debug fi CSC="$MCS" CSC_FLAGS= if test "x$PROFILE" = "xdebug"; then if true; then ENABLE_DEBUG_TRUE= ENABLE_DEBUG_FALSE='#' else ENABLE_DEBUG_TRUE='#' ENABLE_DEBUG_FALSE= fi CSC_FLAGS+=-define:DEBUG,TRACE,LOG4NET else if true; then ENABLE_RELEASE_TRUE= ENABLE_RELEASE_FALSE='#' else ENABLE_RELEASE_TRUE='#' ENABLE_RELEASE_FALSE= fi fi MCS_BASENAME=$(basename $MCS) CLI_RUNTIME= if test "$MCS_BASENAME" = "gmcs"; then CLI_RUNTIME=2.0 fi if test "$MCS_BASENAME" = "dmcs"; then CLI_RUNTIME=4.0 fi if test "$CLI_RUNTIME" = "2.0"; then XBUILD_FLAGS="/toolsversion:3.5 /p:TargetFrameworkVersion=v3.5" fi if test "$CLI_RUNTIME" = "4.0"; then XBUILD_FLAGS="/toolsversion:4.0 /p:TargetFrameworkVersion=v4.0" fi # Required Libraries pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOG4NET" >&5 $as_echo_n "checking for LOG4NET... " >&6; } if test -n "$LOG4NET_CFLAGS"; then pkg_cv_LOG4NET_CFLAGS="$LOG4NET_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"log4net\""; } >&5 ($PKG_CONFIG --exists --print-errors "log4net") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LOG4NET_CFLAGS=`$PKG_CONFIG --cflags "log4net" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LOG4NET_LIBS"; then pkg_cv_LOG4NET_LIBS="$LOG4NET_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"log4net\""; } >&5 ($PKG_CONFIG --exists --print-errors "log4net") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LOG4NET_LIBS=`$PKG_CONFIG --libs "log4net" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LOG4NET_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "log4net" 2>&1` else LOG4NET_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "log4net" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LOG4NET_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (log4net) were not met: $LOG4NET_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LOG4NET_CFLAGS and LOG4NET_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables LOG4NET_CFLAGS and LOG4NET_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else LOG4NET_CFLAGS=$pkg_cv_LOG4NET_CFLAGS LOG4NET_LIBS=$pkg_cv_LOG4NET_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nini-1.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "nini-1.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then FOUND_NINI=yes else FOUND_NINI=no fi nini_files= if test "x$FOUND_NINI" = "xyes"; then nini_files=`pkg-config --variable=Libraries nini-1.1` if test -z "$nini_files" ; then # Debian-based distros place Nini into the GAC pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NINI" >&5 $as_echo_n "checking for NINI... " >&6; } if test -n "$NINI_CFLAGS"; then pkg_cv_NINI_CFLAGS="$NINI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nini-1.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "nini-1.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NINI_CFLAGS=`$PKG_CONFIG --cflags "nini-1.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$NINI_LIBS"; then pkg_cv_NINI_LIBS="$NINI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nini-1.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "nini-1.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NINI_LIBS=`$PKG_CONFIG --libs "nini-1.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then NINI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "nini-1.1" 2>&1` else NINI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "nini-1.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$NINI_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (nini-1.1) were not met: $NINI_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NINI_CFLAGS and NINI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables NINI_CFLAGS and NINI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else NINI_CFLAGS=$pkg_cv_NINI_CFLAGS NINI_LIBS=$pkg_cv_NINI_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi else # openSUSE has Nini as a private assembly; need to copy it. NINI_LIBS="$nini_files" fi else pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NINI" >&5 $as_echo_n "checking for NINI... " >&6; } if test -n "$NINI_CFLAGS"; then pkg_cv_NINI_CFLAGS="$NINI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nini >= 1.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "nini >= 1.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NINI_CFLAGS=`$PKG_CONFIG --cflags "nini >= 1.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$NINI_LIBS"; then pkg_cv_NINI_LIBS="$NINI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nini >= 1.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "nini >= 1.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NINI_LIBS=`$PKG_CONFIG --libs "nini >= 1.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then NINI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "nini >= 1.1" 2>&1` else NINI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "nini >= 1.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$NINI_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (nini >= 1.1) were not met: $NINI_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NINI_CFLAGS and NINI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables NINI_CFLAGS and NINI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else NINI_CFLAGS=$pkg_cv_NINI_CFLAGS NINI_LIBS=$pkg_cv_NINI_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test -n "$nini_files"; then BUNDLE_NINI_TRUE= BUNDLE_NINI_FALSE='#' else BUNDLE_NINI_TRUE='#' BUNDLE_NINI_FALSE= fi # Check whether --with-db4o was given. if test "${with_db4o+set}" = set; then : withval=$with_db4o; else with_db4o=auto fi WITH_DB4O=$with_db4o if test "x$WITH_DB4O" = "xauto"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"db4o >= 8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "db4o >= 8.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then FOUND_DB4O=yes else FOUND_DB4O=no fi if test "x$FOUND_DB4O" = "xyes"; then WITH_DB4O=system else WITH_DB4O=included fi fi if test "x$WITH_DB4O" = "xsystem"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DB4O" >&5 $as_echo_n "checking for DB4O... " >&6; } if test -n "$DB4O_CFLAGS"; then pkg_cv_DB4O_CFLAGS="$DB4O_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"db4o >= 8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "db4o >= 8.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DB4O_CFLAGS=`$PKG_CONFIG --cflags "db4o >= 8.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DB4O_LIBS"; then pkg_cv_DB4O_LIBS="$DB4O_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"db4o >= 8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "db4o >= 8.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DB4O_LIBS=`$PKG_CONFIG --libs "db4o >= 8.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DB4O_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "db4o >= 8.0" 2>&1` else DB4O_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "db4o >= 8.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DB4O_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (db4o >= 8.0) were not met: $DB4O_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DB4O_CFLAGS and DB4O_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DB4O_CFLAGS and DB4O_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DB4O_CFLAGS=$pkg_cv_DB4O_CFLAGS DB4O_LIBS=$pkg_cv_DB4O_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if false; then BUNDLE_DB4O_TRUE= BUNDLE_DB4O_FALSE='#' else BUNDLE_DB4O_TRUE='#' BUNDLE_DB4O_FALSE= fi fi if test "x$WITH_DB4O" = "xincluded"; then if test ! -d "$srcdir/lib/db4o-net/Db4objects.Db4o"; then as_fn_error $? "lib/db4o-net is empty!" "$LINENO" 5 fi # Extract the first word of "xbuild", so it can be a program name with args. set dummy xbuild; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XBUILD+:} false; then : $as_echo_n "(cached) " >&6 else case $XBUILD in [\\/]* | ?:[\\/]*) ac_cv_path_XBUILD="$XBUILD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XBUILD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_XBUILD" && ac_cv_path_XBUILD="no" ;; esac fi XBUILD=$ac_cv_path_XBUILD if test -n "$XBUILD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XBUILD" >&5 $as_echo "$XBUILD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$XBUILD" = "xno"; then as_fn_error $? "You need to install xbuild" "$LINENO" 5 fi if true; then BUNDLE_DB4O_TRUE= BUNDLE_DB4O_FALSE='#' else BUNDLE_DB4O_TRUE='#' BUNDLE_DB4O_FALSE= fi #AC_SUBST([DB4O_FILES], "Db4objects.Db4o.dll Db4objects.Db4o.Instrumentation.dll Db4objects.Db4o.NativeQueries.dll") DB4O_FILES="Db4objects.Db4o.dll" fi # Optional Libraries # Check whether --with-messaging-menu was given. if test "${with_messaging_menu+set}" = set; then : withval=$with_messaging_menu; else with_messagingmenu=auto fi WITH_MESSAGINGMENU=$with_messagingmenu if test "x$WITH_MESSAGINGMENU" = "xauto"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"messagingmenu-sharp\""; } >&5 ($PKG_CONFIG --exists --print-errors "messagingmenu-sharp") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then FOUND_MESSAGINGMENU_SHARP=yes else FOUND_MESSAGINGMENU_SHARP=no fi if test "x$FOUND_MESSAGINGMENU_SHARP" = "xyes"; then WITH_MESSAGINGMENU=system else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"messaging-menu\""; } >&5 ($PKG_CONFIG --exists --print-errors "messaging-menu") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then FOUND_MESSAGING_MENU=yes else FOUND_MESSAGING_MENU=no fi if test "x$FOUND_MESSAGING_MENU" = "xyes"; then WITH_MESSAGINGMENU=included else WITH_MESSAGINGMENU=no fi fi fi if test "x$WITH_MESSAGINGMENU" = "xsystem"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MESSAGINGMENU_SHARP" >&5 $as_echo_n "checking for MESSAGINGMENU_SHARP... " >&6; } if test -n "$MESSAGINGMENU_SHARP_CFLAGS"; then pkg_cv_MESSAGINGMENU_SHARP_CFLAGS="$MESSAGINGMENU_SHARP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"messagingmenu-sharp\""; } >&5 ($PKG_CONFIG --exists --print-errors "messagingmenu-sharp") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MESSAGINGMENU_SHARP_CFLAGS=`$PKG_CONFIG --cflags "messagingmenu-sharp" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$MESSAGINGMENU_SHARP_LIBS"; then pkg_cv_MESSAGINGMENU_SHARP_LIBS="$MESSAGINGMENU_SHARP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"messagingmenu-sharp\""; } >&5 ($PKG_CONFIG --exists --print-errors "messagingmenu-sharp") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MESSAGINGMENU_SHARP_LIBS=`$PKG_CONFIG --libs "messagingmenu-sharp" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MESSAGINGMENU_SHARP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "messagingmenu-sharp" 2>&1` else MESSAGINGMENU_SHARP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "messagingmenu-sharp" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MESSAGINGMENU_SHARP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (messagingmenu-sharp) were not met: $MESSAGINGMENU_SHARP_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables MESSAGINGMENU_SHARP_CFLAGS and MESSAGINGMENU_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables MESSAGINGMENU_SHARP_CFLAGS and MESSAGINGMENU_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else MESSAGINGMENU_SHARP_CFLAGS=$pkg_cv_MESSAGINGMENU_SHARP_CFLAGS MESSAGINGMENU_SHARP_LIBS=$pkg_cv_MESSAGINGMENU_SHARP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test "x$WITH_MESSAGINGMENU" = "xincluded"; then if test ! -f "$srcdir/lib/messagingmenu-sharp/configure.ac"; then as_fn_error $? "lib/messagingmenu-sharp is empty!" "$LINENO" 5 fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MESSAGING_MENU" >&5 $as_echo_n "checking for MESSAGING_MENU... " >&6; } if test -n "$MESSAGING_MENU_CFLAGS"; then pkg_cv_MESSAGING_MENU_CFLAGS="$MESSAGING_MENU_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"messaging-menu\""; } >&5 ($PKG_CONFIG --exists --print-errors "messaging-menu") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MESSAGING_MENU_CFLAGS=`$PKG_CONFIG --cflags "messaging-menu" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$MESSAGING_MENU_LIBS"; then pkg_cv_MESSAGING_MENU_LIBS="$MESSAGING_MENU_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"messaging-menu\""; } >&5 ($PKG_CONFIG --exists --print-errors "messaging-menu") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MESSAGING_MENU_LIBS=`$PKG_CONFIG --libs "messaging-menu" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MESSAGING_MENU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "messaging-menu" 2>&1` else MESSAGING_MENU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "messaging-menu" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MESSAGING_MENU_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (messaging-menu) were not met: $MESSAGING_MENU_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables MESSAGING_MENU_CFLAGS and MESSAGING_MENU_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables MESSAGING_MENU_CFLAGS and MESSAGING_MENU_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else MESSAGING_MENU_CFLAGS=$pkg_cv_MESSAGING_MENU_CFLAGS MESSAGING_MENU_LIBS=$pkg_cv_MESSAGING_MENU_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIO_SHARP" >&5 $as_echo_n "checking for GIO_SHARP... " >&6; } if test -n "$GIO_SHARP_CFLAGS"; then pkg_cv_GIO_SHARP_CFLAGS="$GIO_SHARP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GIO_SHARP_CFLAGS=`$PKG_CONFIG --cflags "gio-sharp-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GIO_SHARP_LIBS"; then pkg_cv_GIO_SHARP_LIBS="$GIO_SHARP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GIO_SHARP_LIBS=`$PKG_CONFIG --libs "gio-sharp-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GIO_SHARP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gio-sharp-2.0" 2>&1` else GIO_SHARP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-sharp-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GIO_SHARP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (gio-sharp-2.0) were not met: $GIO_SHARP_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GIO_SHARP_CFLAGS and GIO_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GIO_SHARP_CFLAGS and GIO_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GIO_SHARP_CFLAGS=$pkg_cv_GIO_SHARP_CFLAGS GIO_SHARP_LIBS=$pkg_cv_GIO_SHARP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi GIO_SHARP_LIBS=`$PKG_CONFIG --variable=Libraries gio-sharp-2.0` GIO_SHARP_FILES="gio-sharp.dll" ac_configure_args="$ac_configure_args CSC=$MCS" subdirs="$subdirs lib/messagingmenu-sharp" MESSAGINGMENU_SHARP_FILES="messagingmenu-sharp.dll" fi if test "x$WITH_MESSAGINGMENU" = "xincluded"; then WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE= WITH_MESSAGINGMENU_SHARP_INCLUDED_FALSE='#' else WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE='#' WITH_MESSAGINGMENU_SHARP_INCLUDED_FALSE= fi # Check whether --with-indicate was given. if test "${with_indicate+set}" = set; then : withval=$with_indicate; else with_indicate=auto fi WITH_INDICATE=$with_indicate if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicate-sharp-0.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "indicate-sharp-0.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then INDICATE_SHARP_SUPPORT=yes else INDICATE_SHARP_SUPPORT=no fi if test "x$WITH_INDICATE" = "xauto" -a "x$WITH_MESSAGINGMENU" != "xno"; then WITH_INDICATE=no fi if test "x$WITH_INDICATE" = "xauto"; then WITH_INDICATE=$INDICATE_SHARP_SUPPORT fi if test "x$WITH_INDICATE" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for INDICATE_SHARP" >&5 $as_echo_n "checking for INDICATE_SHARP... " >&6; } if test -n "$INDICATE_SHARP_CFLAGS"; then pkg_cv_INDICATE_SHARP_CFLAGS="$INDICATE_SHARP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicate-sharp-0.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "indicate-sharp-0.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_INDICATE_SHARP_CFLAGS=`$PKG_CONFIG --cflags "indicate-sharp-0.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$INDICATE_SHARP_LIBS"; then pkg_cv_INDICATE_SHARP_LIBS="$INDICATE_SHARP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicate-sharp-0.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "indicate-sharp-0.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_INDICATE_SHARP_LIBS=`$PKG_CONFIG --libs "indicate-sharp-0.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then INDICATE_SHARP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "indicate-sharp-0.1" 2>&1` else INDICATE_SHARP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "indicate-sharp-0.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$INDICATE_SHARP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (indicate-sharp-0.1) were not met: $INDICATE_SHARP_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables INDICATE_SHARP_CFLAGS and INDICATE_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables INDICATE_SHARP_CFLAGS and INDICATE_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else INDICATE_SHARP_CFLAGS=$pkg_cv_INDICATE_SHARP_CFLAGS INDICATE_SHARP_LIBS=$pkg_cv_INDICATE_SHARP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Check whether --with-notify was given. if test "${with_notify+set}" = set; then : withval=$with_notify; else with_notify=auto fi WITH_NOTIFY=$with_notify if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"notify-sharp\""; } >&5 ($PKG_CONFIG --exists --print-errors "notify-sharp") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then NOTIFY_SHARP_SUPPORT=yes else NOTIFY_SHARP_SUPPORT=no fi if test "x$WITH_NOTIFY" = "xauto"; then WITH_NOTIFY=$NOTIFY_SHARP_SUPPORT fi if test "x$WITH_NOTIFY" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NOTIFY_SHARP" >&5 $as_echo_n "checking for NOTIFY_SHARP... " >&6; } if test -n "$NOTIFY_SHARP_CFLAGS"; then pkg_cv_NOTIFY_SHARP_CFLAGS="$NOTIFY_SHARP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"notify-sharp\""; } >&5 ($PKG_CONFIG --exists --print-errors "notify-sharp") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NOTIFY_SHARP_CFLAGS=`$PKG_CONFIG --cflags "notify-sharp" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$NOTIFY_SHARP_LIBS"; then pkg_cv_NOTIFY_SHARP_LIBS="$NOTIFY_SHARP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"notify-sharp\""; } >&5 ($PKG_CONFIG --exists --print-errors "notify-sharp") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NOTIFY_SHARP_LIBS=`$PKG_CONFIG --libs "notify-sharp" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then NOTIFY_SHARP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "notify-sharp" 2>&1` else NOTIFY_SHARP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "notify-sharp" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$NOTIFY_SHARP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (notify-sharp) were not met: $NOTIFY_SHARP_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NOTIFY_SHARP_CFLAGS and NOTIFY_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables NOTIFY_SHARP_CFLAGS and NOTIFY_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else NOTIFY_SHARP_CFLAGS=$pkg_cv_NOTIFY_SHARP_CFLAGS NOTIFY_SHARP_LIBS=$pkg_cv_NOTIFY_SHARP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Check whether --with-dbus was given. if test "${with_dbus+set}" = set; then : withval=$with_dbus; else with_dbus=auto fi WITH_DBUS=$with_dbus if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-sharp-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-sharp-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then DBUS_SHARP1_SUPPORT=yes else DBUS_SHARP1_SUPPORT=no fi if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then DBUS_SHARP2_SUPPORT=yes else DBUS_SHARP2_SUPPORT=no fi if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ndesk-dbus-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "ndesk-dbus-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then NDESK_DBUS_SUPPORT=yes else NDESK_DBUS_SUPPORT=no fi if test "x$WITH_DBUS" = "xauto"; then if test "x$DBUS_SHARP1_SUPPORT" = "xyes"; then WITH_DBUS=$DBUS_SHARP1_SUPPORT elif test "x$DBUS_SHARP2_SUPPORT" = "xyes"; then WITH_DBUS=$DBUS_SHARP2_SUPPORT else WITH_DBUS=$NDESK_DBUS_SUPPORT fi fi if test "x$WITH_DBUS" = "xyes"; then if test "x$DBUS_SHARP2_SUPPORT" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_SHARP" >&5 $as_echo_n "checking for DBUS_SHARP... " >&6; } if test -n "$DBUS_SHARP_CFLAGS"; then pkg_cv_DBUS_SHARP_CFLAGS="$DBUS_SHARP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_SHARP_CFLAGS=`$PKG_CONFIG --cflags "dbus-sharp-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_SHARP_LIBS"; then pkg_cv_DBUS_SHARP_LIBS="$DBUS_SHARP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_SHARP_LIBS=`$PKG_CONFIG --libs "dbus-sharp-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DBUS_SHARP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-sharp-2.0" 2>&1` else DBUS_SHARP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-sharp-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_SHARP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (dbus-sharp-2.0) were not met: $DBUS_SHARP_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DBUS_SHARP_CFLAGS and DBUS_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DBUS_SHARP_CFLAGS and DBUS_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DBUS_SHARP_CFLAGS=$pkg_cv_DBUS_SHARP_CFLAGS DBUS_SHARP_LIBS=$pkg_cv_DBUS_SHARP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_SHARP_GLIB" >&5 $as_echo_n "checking for DBUS_SHARP_GLIB... " >&6; } if test -n "$DBUS_SHARP_GLIB_CFLAGS"; then pkg_cv_DBUS_SHARP_GLIB_CFLAGS="$DBUS_SHARP_GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-sharp-glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-sharp-glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_SHARP_GLIB_CFLAGS=`$PKG_CONFIG --cflags "dbus-sharp-glib-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_SHARP_GLIB_LIBS"; then pkg_cv_DBUS_SHARP_GLIB_LIBS="$DBUS_SHARP_GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-sharp-glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-sharp-glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_SHARP_GLIB_LIBS=`$PKG_CONFIG --libs "dbus-sharp-glib-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DBUS_SHARP_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-sharp-glib-2.0" 2>&1` else DBUS_SHARP_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-sharp-glib-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_SHARP_GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (dbus-sharp-glib-2.0) were not met: $DBUS_SHARP_GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DBUS_SHARP_GLIB_CFLAGS and DBUS_SHARP_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DBUS_SHARP_GLIB_CFLAGS and DBUS_SHARP_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DBUS_SHARP_GLIB_CFLAGS=$pkg_cv_DBUS_SHARP_GLIB_CFLAGS DBUS_SHARP_GLIB_LIBS=$pkg_cv_DBUS_SHARP_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi DBUS_LIBS="$DBUS_SHARP_LIBS $DBUS_SHARP_GLIB_LIBS" CSC_FLAGS+=" -define:IPC_DBUS -define:DBUS_SHARP" elif test "x$DBUS_SHARP1_SUPPORT" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_SHARP" >&5 $as_echo_n "checking for DBUS_SHARP... " >&6; } if test -n "$DBUS_SHARP_CFLAGS"; then pkg_cv_DBUS_SHARP_CFLAGS="$DBUS_SHARP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-sharp-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-sharp-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_SHARP_CFLAGS=`$PKG_CONFIG --cflags "dbus-sharp-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_SHARP_LIBS"; then pkg_cv_DBUS_SHARP_LIBS="$DBUS_SHARP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-sharp-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-sharp-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_SHARP_LIBS=`$PKG_CONFIG --libs "dbus-sharp-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DBUS_SHARP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-sharp-1.0" 2>&1` else DBUS_SHARP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-sharp-1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_SHARP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (dbus-sharp-1.0) were not met: $DBUS_SHARP_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DBUS_SHARP_CFLAGS and DBUS_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DBUS_SHARP_CFLAGS and DBUS_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DBUS_SHARP_CFLAGS=$pkg_cv_DBUS_SHARP_CFLAGS DBUS_SHARP_LIBS=$pkg_cv_DBUS_SHARP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_SHARP_GLIB" >&5 $as_echo_n "checking for DBUS_SHARP_GLIB... " >&6; } if test -n "$DBUS_SHARP_GLIB_CFLAGS"; then pkg_cv_DBUS_SHARP_GLIB_CFLAGS="$DBUS_SHARP_GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-sharp-glib-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-sharp-glib-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_SHARP_GLIB_CFLAGS=`$PKG_CONFIG --cflags "dbus-sharp-glib-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_SHARP_GLIB_LIBS"; then pkg_cv_DBUS_SHARP_GLIB_LIBS="$DBUS_SHARP_GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-sharp-glib-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-sharp-glib-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_SHARP_GLIB_LIBS=`$PKG_CONFIG --libs "dbus-sharp-glib-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DBUS_SHARP_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-sharp-glib-1.0" 2>&1` else DBUS_SHARP_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-sharp-glib-1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_SHARP_GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (dbus-sharp-glib-1.0) were not met: $DBUS_SHARP_GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DBUS_SHARP_GLIB_CFLAGS and DBUS_SHARP_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DBUS_SHARP_GLIB_CFLAGS and DBUS_SHARP_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DBUS_SHARP_GLIB_CFLAGS=$pkg_cv_DBUS_SHARP_GLIB_CFLAGS DBUS_SHARP_GLIB_LIBS=$pkg_cv_DBUS_SHARP_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi DBUS_LIBS="$DBUS_SHARP_LIBS $DBUS_SHARP_GLIB_LIBS" CSC_FLAGS+=" -define:IPC_DBUS -define:DBUS_SHARP" else # fallback to ndesk-dbus pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NDESK_DBUS" >&5 $as_echo_n "checking for NDESK_DBUS... " >&6; } if test -n "$NDESK_DBUS_CFLAGS"; then pkg_cv_NDESK_DBUS_CFLAGS="$NDESK_DBUS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ndesk-dbus-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "ndesk-dbus-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NDESK_DBUS_CFLAGS=`$PKG_CONFIG --cflags "ndesk-dbus-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$NDESK_DBUS_LIBS"; then pkg_cv_NDESK_DBUS_LIBS="$NDESK_DBUS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ndesk-dbus-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "ndesk-dbus-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NDESK_DBUS_LIBS=`$PKG_CONFIG --libs "ndesk-dbus-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then NDESK_DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ndesk-dbus-1.0" 2>&1` else NDESK_DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ndesk-dbus-1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$NDESK_DBUS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (ndesk-dbus-1.0) were not met: $NDESK_DBUS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NDESK_DBUS_CFLAGS and NDESK_DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables NDESK_DBUS_CFLAGS and NDESK_DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else NDESK_DBUS_CFLAGS=$pkg_cv_NDESK_DBUS_CFLAGS NDESK_DBUS_LIBS=$pkg_cv_NDESK_DBUS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NDESK_DBUS_GLIB" >&5 $as_echo_n "checking for NDESK_DBUS_GLIB... " >&6; } if test -n "$NDESK_DBUS_GLIB_CFLAGS"; then pkg_cv_NDESK_DBUS_GLIB_CFLAGS="$NDESK_DBUS_GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ndesk-dbus-glib-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "ndesk-dbus-glib-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NDESK_DBUS_GLIB_CFLAGS=`$PKG_CONFIG --cflags "ndesk-dbus-glib-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$NDESK_DBUS_GLIB_LIBS"; then pkg_cv_NDESK_DBUS_GLIB_LIBS="$NDESK_DBUS_GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ndesk-dbus-glib-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "ndesk-dbus-glib-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NDESK_DBUS_GLIB_LIBS=`$PKG_CONFIG --libs "ndesk-dbus-glib-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then NDESK_DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ndesk-dbus-glib-1.0" 2>&1` else NDESK_DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ndesk-dbus-glib-1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$NDESK_DBUS_GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (ndesk-dbus-glib-1.0) were not met: $NDESK_DBUS_GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NDESK_DBUS_GLIB_CFLAGS and NDESK_DBUS_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables NDESK_DBUS_GLIB_CFLAGS and NDESK_DBUS_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else NDESK_DBUS_GLIB_CFLAGS=$pkg_cv_NDESK_DBUS_GLIB_CFLAGS NDESK_DBUS_GLIB_LIBS=$pkg_cv_NDESK_DBUS_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi DBUS_LIBS="$NDESK_DBUS_LIBS $NDESK_DBUS_GLIB_LIBS" CSC_FLAGS+=" -define:IPC_DBUS -define:NDESK_DBUS" fi fi # Check whether --with-gtkspell was given. if test "${with_gtkspell+set}" = set; then : withval=$with_gtkspell; else with_gtkspell=auto fi WITH_GTKSPELL=$with_gtkspell if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkspell-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtkspell-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then GTKSPELL_SUPPORT=yes else GTKSPELL_SUPPORT=no fi if test "x$WITH_GTKSPELL" = "xauto"; then WITH_GTKSPELL=$GTKSPELL_SUPPORT fi if test "x$WITH_GTKSPELL" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKSPELL" >&5 $as_echo_n "checking for GTKSPELL... " >&6; } if test -n "$GTKSPELL_CFLAGS"; then pkg_cv_GTKSPELL_CFLAGS="$GTKSPELL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkspell-2.0 >= 2.0.9\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtkspell-2.0 >= 2.0.9") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKSPELL_CFLAGS=`$PKG_CONFIG --cflags "gtkspell-2.0 >= 2.0.9" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTKSPELL_LIBS"; then pkg_cv_GTKSPELL_LIBS="$GTKSPELL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkspell-2.0 >= 2.0.9\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtkspell-2.0 >= 2.0.9") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKSPELL_LIBS=`$PKG_CONFIG --libs "gtkspell-2.0 >= 2.0.9" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTKSPELL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtkspell-2.0 >= 2.0.9" 2>&1` else GTKSPELL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtkspell-2.0 >= 2.0.9" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTKSPELL_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (gtkspell-2.0 >= 2.0.9) were not met: $GTKSPELL_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GTKSPELL_CFLAGS and GTKSPELL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GTKSPELL_CFLAGS and GTKSPELL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GTKSPELL_CFLAGS=$pkg_cv_GTKSPELL_CFLAGS GTKSPELL_LIBS=$pkg_cv_GTKSPELL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Engines # Check whether --enable-engine-irc was given. if test "${enable_engine_irc+set}" = set; then : enableval=$enable_engine_irc; ENABLE_ENGINE_IRC=$enableval else ENABLE_ENGINE_IRC=yes fi if test "x$ENABLE_ENGINE_IRC" != "xno"; then # Extract the first word of "xbuild", so it can be a program name with args. set dummy xbuild; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XBUILD+:} false; then : $as_echo_n "(cached) " >&6 else case $XBUILD in [\\/]* | ?:[\\/]*) ac_cv_path_XBUILD="$XBUILD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XBUILD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_XBUILD" && ac_cv_path_XBUILD="no" ;; esac fi XBUILD=$ac_cv_path_XBUILD if test -n "$XBUILD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XBUILD" >&5 $as_echo "$XBUILD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$XBUILD" = "xno"; then as_fn_error $? "You need to install xbuild for irc support" "$LINENO" 5 fi if test ! -f "$srcdir/lib/SmartIrc4net/SmartIrc4net.csproj"; then as_fn_error $? "lib/SmartIrc4net is empty!" "$LINENO" 5 fi for asm in $(echo "2.0,System Mono.Posix " | cut -d, -f2- | sed 's/\,/ /g') do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mono 2.0 GAC for $asm.dll" >&5 $as_echo_n "checking for Mono 2.0 GAC for $asm.dll... " >&6; } if test \ -e "$($PKG_CONFIG --variable=libdir mono)/mono/2.0/$asm.dll" -o \ -e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/2.0/$asm.dll"; \ then \ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "missing reqired Mono 2.0 assembly: $asm.dll" "$LINENO" 5 fi done fi if test "x$ENABLE_ENGINE_IRC" = "xyes"; then ENABLE_ENGINE_IRC_TRUE= ENABLE_ENGINE_IRC_FALSE='#' else ENABLE_ENGINE_IRC_TRUE='#' ENABLE_ENGINE_IRC_FALSE= fi # Check whether --enable-engine-campfire was given. if test "${enable_engine_campfire+set}" = set; then : enableval=$enable_engine_campfire; ENABLE_ENGINE_CAMPFIRE=$enableval else ENABLE_ENGINE_CAMPFIRE=yes fi if test "x$ENABLE_ENGINE_CAMPFIRE" = "xyes"; then ENABLE_ENGINE_CAMPFIRE_TRUE= ENABLE_ENGINE_CAMPFIRE_FALSE='#' else ENABLE_ENGINE_CAMPFIRE_TRUE='#' ENABLE_ENGINE_CAMPFIRE_FALSE= fi # Check whether --enable-engine-xmpp was given. if test "${enable_engine_xmpp+set}" = set; then : enableval=$enable_engine_xmpp; ENABLE_ENGINE_XMPP=$enableval else ENABLE_ENGINE_XMPP=yes fi if test "x$ENABLE_ENGINE_XMPP" != "xno"; then # Extract the first word of "xbuild", so it can be a program name with args. set dummy xbuild; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XBUILD+:} false; then : $as_echo_n "(cached) " >&6 else case $XBUILD in [\\/]* | ?:[\\/]*) ac_cv_path_XBUILD="$XBUILD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XBUILD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_XBUILD" && ac_cv_path_XBUILD="no" ;; esac fi XBUILD=$ac_cv_path_XBUILD if test -n "$XBUILD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XBUILD" >&5 $as_echo "$XBUILD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$XBUILD" = "xno"; then as_fn_error $? "You need to install xbuild for XMPP support" "$LINENO" 5 fi if test ! -f "$srcdir/lib/agsxmpp/agsxmpp/agsxmpp.csproj"; then as_fn_error $? "lib/agsxmpp is empty!" "$LINENO" 5 fi for asm in $(echo "2.0,System System.Core Mono.Posix System.Xml " | cut -d, -f2- | sed 's/\,/ /g') do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mono 2.0 GAC for $asm.dll" >&5 $as_echo_n "checking for Mono 2.0 GAC for $asm.dll... " >&6; } if test \ -e "$($PKG_CONFIG --variable=libdir mono)/mono/2.0/$asm.dll" -o \ -e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/2.0/$asm.dll"; \ then \ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "missing reqired Mono 2.0 assembly: $asm.dll" "$LINENO" 5 fi done fi if test "x$ENABLE_ENGINE_XMPP" = "xyes"; then ENABLE_ENGINE_XMPP_TRUE= ENABLE_ENGINE_XMPP_FALSE='#' else ENABLE_ENGINE_XMPP_TRUE='#' ENABLE_ENGINE_XMPP_FALSE= fi if test ! -f "$srcdir/lib/StarkSoftProxy/StarkSoftProxy.csproj"; then as_fn_error $? "lib/StarkSoftProxy is empty!" "$LINENO" 5 fi # Check whether --enable-engine-twitter was given. if test "${enable_engine_twitter+set}" = set; then : enableval=$enable_engine_twitter; ENABLE_ENGINE_TWITTER=$enableval else ENABLE_ENGINE_TWITTER=yes fi if test "x$ENABLE_ENGINE_TWITTER" != "xno"; then # Extract the first word of "xbuild", so it can be a program name with args. set dummy xbuild; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XBUILD+:} false; then : $as_echo_n "(cached) " >&6 else case $XBUILD in [\\/]* | ?:[\\/]*) ac_cv_path_XBUILD="$XBUILD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XBUILD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_XBUILD" && ac_cv_path_XBUILD="no" ;; esac fi XBUILD=$ac_cv_path_XBUILD if test -n "$XBUILD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XBUILD" >&5 $as_echo "$XBUILD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$XBUILD" = "xno"; then as_fn_error $? "You need to install xbuild for Twitter support" "$LINENO" 5 fi # compiling Json.NET with the C# compiler of Mono 2.4 will result in # a endless loop with eating all memory :/ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mono >= 2.6" >&5 $as_echo_n "checking for Mono >= 2.6... " >&6; } if $PKG_CONFIG 'mono >= 2.6'; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "You need Mono 2.6 or later for Twitter support" "$LINENO" 5 fi if test ! -f "$srcdir/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Newtonsoft.Json.csproj"; then as_fn_error $? "lib/Newtonsoft.Json is empty!" "$LINENO" 5 fi for asm in $(echo "2.0,System System.Core System.Data System.Runtime.Serialization System.Web System.Xml System.Xml.Linq " | cut -d, -f2- | sed 's/\,/ /g') do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mono 2.0 GAC for $asm.dll" >&5 $as_echo_n "checking for Mono 2.0 GAC for $asm.dll... " >&6; } if test \ -e "$($PKG_CONFIG --variable=libdir mono)/mono/2.0/$asm.dll" -o \ -e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/2.0/$asm.dll"; \ then \ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "missing reqired Mono 2.0 assembly: $asm.dll" "$LINENO" 5 fi done if test ! -f "$srcdir/lib/Twitterizer/Twitterizer2/Twitterizer2.csproj"; then as_fn_error $? "lib/Twitterizer is empty!" "$LINENO" 5 fi for asm in $(echo "2.0,System System.Configuration System.Core System.Data System.Drawing System.Web System.Web.Extensions System.Xml System.Xml.Linq " | cut -d, -f2- | sed 's/\,/ /g') do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mono 2.0 GAC for $asm.dll" >&5 $as_echo_n "checking for Mono 2.0 GAC for $asm.dll... " >&6; } if test \ -e "$($PKG_CONFIG --variable=libdir mono)/mono/2.0/$asm.dll" -o \ -e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/2.0/$asm.dll"; \ then \ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "missing reqired Mono 2.0 assembly: $asm.dll" "$LINENO" 5 fi done fi if test "x$ENABLE_ENGINE_TWITTER" = "xyes"; then ENABLE_ENGINE_TWITTER_TRUE= ENABLE_ENGINE_TWITTER_FALSE='#' else ENABLE_ENGINE_TWITTER_TRUE='#' ENABLE_ENGINE_TWITTER_FALSE= fi # Check whether --with-twitter-api-key was given. if test "${with_twitter_api_key+set}" = set; then : withval=$with_twitter_api_key; else with_twitter_api_key="60QV2qQx9cS7y1BJDbgAA|2VgD6qQKddsF5HYQ0TrRgs3tFTnCwDONBmRlTmG658" fi twitter_api_key=$with_twitter_api_key # Check whether --enable-engine-jabbr was given. if test "${enable_engine_jabbr+set}" = set; then : enableval=$enable_engine_jabbr; ENABLE_ENGINE_JABBR=$enableval else ENABLE_ENGINE_JABBR=yes fi if test "x$ENABLE_ENGINE_JABBR" != "xno"; then # Extract the first word of "xbuild", so it can be a program name with args. set dummy xbuild; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XBUILD+:} false; then : $as_echo_n "(cached) " >&6 else case $XBUILD in [\\/]* | ?:[\\/]*) ac_cv_path_XBUILD="$XBUILD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XBUILD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_XBUILD" && ac_cv_path_XBUILD="no" ;; esac fi XBUILD=$ac_cv_path_XBUILD if test -n "$XBUILD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XBUILD" >&5 $as_echo "$XBUILD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$XBUILD" = "xno"; then as_fn_error $? "You need to install xbuild for JabbR support" "$LINENO" 5 fi # compiling Json.NET with the C# compiler of Mono 2.4 will result in # a endless loop with eating all memory :/ # SignalR.Client requires System.Threading.Tasks which is part of .NET 4.0 # thus Mono 2.10 with dmcs is required! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mono >= 2.10" >&5 $as_echo_n "checking for Mono >= 2.10... " >&6; } if $PKG_CONFIG 'mono >= 2.10'; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "You need Mono 2.10 or later for JabbR support (or use --disable-engine-jabbr)" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 4.0 compiler" >&5 $as_echo_n "checking for 4.0 compiler... " >&6; } if test "x$CLI_RUNTIME" = "x2.0"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "You need to compile with a 4.0 compiler (dmcs) for JabbR support (or use --disable-engine-jabbr)" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test ! -f "$srcdir/lib/Newtonsoft.Json/Src/Newtonsoft.Json/Newtonsoft.Json.csproj"; then as_fn_error $? "lib/Newtonsoft.Json is empty!" "$LINENO" 5 fi for asm in $(echo "2.0,System System.Core System.Data System.Runtime.Serialization System.Web System.Xml System.Xml.Linq " | cut -d, -f2- | sed 's/\,/ /g') do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mono 2.0 GAC for $asm.dll" >&5 $as_echo_n "checking for Mono 2.0 GAC for $asm.dll... " >&6; } if test \ -e "$($PKG_CONFIG --variable=libdir mono)/mono/2.0/$asm.dll" -o \ -e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/2.0/$asm.dll"; \ then \ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "missing reqired Mono 2.0 assembly: $asm.dll" "$LINENO" 5 fi done if test ! -f "$srcdir/lib/SignalR/src/Microsoft.AspNet.SignalR.Client/Microsoft.AspNet.SignalR.Client.csproj"; then as_fn_error $? "lib/SignalR is empty!" "$LINENO" 5 fi for asm in $(echo "2.0,System System.Core " | cut -d, -f2- | sed 's/\,/ /g') do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mono 2.0 GAC for $asm.dll" >&5 $as_echo_n "checking for Mono 2.0 GAC for $asm.dll... " >&6; } if test \ -e "$($PKG_CONFIG --variable=libdir mono)/mono/2.0/$asm.dll" -o \ -e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/2.0/$asm.dll"; \ then \ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "missing reqired Mono 2.0 assembly: $asm.dll" "$LINENO" 5 fi done if test ! -f "$srcdir/lib/JabbR/JabbR.Client/JabbR.Client.csproj"; then as_fn_error $? "lib/JabbR is empty!" "$LINENO" 5 fi for asm in $(echo "2.0,System System.Core System.Data System.Data.DataSetExtensions System.Xml System.Xml.Linq " | cut -d, -f2- | sed 's/\,/ /g') do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mono 2.0 GAC for $asm.dll" >&5 $as_echo_n "checking for Mono 2.0 GAC for $asm.dll... " >&6; } if test \ -e "$($PKG_CONFIG --variable=libdir mono)/mono/2.0/$asm.dll" -o \ -e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/2.0/$asm.dll"; \ then \ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "missing reqired Mono 2.0 assembly: $asm.dll" "$LINENO" 5 fi done fi if test "x$ENABLE_ENGINE_JABBR" = "xyes"; then ENABLE_ENGINE_JABBR_TRUE= ENABLE_ENGINE_JABBR_FALSE='#' else ENABLE_ENGINE_JABBR_TRUE='#' ENABLE_ENGINE_JABBR_FALSE= fi # Server if $PKG_CONFIG 'mono >= 2.6'; then SERVER_COMPILER_FLAGS+=" -platform:x86" fi # Frontends # Check whether --enable-frontend-gnome was given. if test "${enable_frontend_gnome+set}" = set; then : enableval=$enable_frontend_gnome; ENABLE_FRONTEND_GNOME=$enableval else ENABLE_FRONTEND_GNOME=yes fi if test "x$ENABLE_FRONTEND_GNOME" != "xno"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB_SHARP_20" >&5 $as_echo_n "checking for GLIB_SHARP_20... " >&6; } if test -n "$GLIB_SHARP_20_CFLAGS"; then pkg_cv_GLIB_SHARP_20_CFLAGS="$GLIB_SHARP_20_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-sharp-2.0 >= 2.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-sharp-2.0 >= 2.8") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_SHARP_20_CFLAGS=`$PKG_CONFIG --cflags "glib-sharp-2.0 >= 2.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_SHARP_20_LIBS"; then pkg_cv_GLIB_SHARP_20_LIBS="$GLIB_SHARP_20_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-sharp-2.0 >= 2.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-sharp-2.0 >= 2.8") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_SHARP_20_LIBS=`$PKG_CONFIG --libs "glib-sharp-2.0 >= 2.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-sharp-2.0 >= 2.8" 2>&1` else GLIB_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-sharp-2.0 >= 2.8" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_SHARP_20_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-sharp-2.0 >= 2.8) were not met: $GLIB_SHARP_20_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_SHARP_20_CFLAGS and GLIB_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_SHARP_20_CFLAGS and GLIB_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GLIB_SHARP_20_CFLAGS=$pkg_cv_GLIB_SHARP_20_CFLAGS GLIB_SHARP_20_LIBS=$pkg_cv_GLIB_SHARP_20_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK_SHARP_20" >&5 $as_echo_n "checking for GTK_SHARP_20... " >&6; } if test -n "$GTK_SHARP_20_CFLAGS"; then pkg_cv_GTK_SHARP_20_CFLAGS="$GTK_SHARP_20_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-sharp-2.0 >= 2.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk-sharp-2.0 >= 2.8") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK_SHARP_20_CFLAGS=`$PKG_CONFIG --cflags "gtk-sharp-2.0 >= 2.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTK_SHARP_20_LIBS"; then pkg_cv_GTK_SHARP_20_LIBS="$GTK_SHARP_20_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-sharp-2.0 >= 2.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk-sharp-2.0 >= 2.8") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK_SHARP_20_LIBS=`$PKG_CONFIG --libs "gtk-sharp-2.0 >= 2.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTK_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk-sharp-2.0 >= 2.8" 2>&1` else GTK_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk-sharp-2.0 >= 2.8" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTK_SHARP_20_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (gtk-sharp-2.0 >= 2.8) were not met: $GTK_SHARP_20_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GTK_SHARP_20_CFLAGS and GTK_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GTK_SHARP_20_CFLAGS and GTK_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GTK_SHARP_20_CFLAGS=$pkg_cv_GTK_SHARP_20_CFLAGS GTK_SHARP_20_LIBS=$pkg_cv_GTK_SHARP_20_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLADE_SHARP_20" >&5 $as_echo_n "checking for GLADE_SHARP_20... " >&6; } if test -n "$GLADE_SHARP_20_CFLAGS"; then pkg_cv_GLADE_SHARP_20_CFLAGS="$GLADE_SHARP_20_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glade-sharp-2.0 >= 2.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "glade-sharp-2.0 >= 2.8") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLADE_SHARP_20_CFLAGS=`$PKG_CONFIG --cflags "glade-sharp-2.0 >= 2.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLADE_SHARP_20_LIBS"; then pkg_cv_GLADE_SHARP_20_LIBS="$GLADE_SHARP_20_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glade-sharp-2.0 >= 2.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "glade-sharp-2.0 >= 2.8") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLADE_SHARP_20_LIBS=`$PKG_CONFIG --libs "glade-sharp-2.0 >= 2.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLADE_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glade-sharp-2.0 >= 2.8" 2>&1` else GLADE_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glade-sharp-2.0 >= 2.8" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLADE_SHARP_20_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glade-sharp-2.0 >= 2.8) were not met: $GLADE_SHARP_20_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLADE_SHARP_20_CFLAGS and GLADE_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLADE_SHARP_20_CFLAGS and GLADE_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GLADE_SHARP_20_CFLAGS=$pkg_cv_GLADE_SHARP_20_CFLAGS GLADE_SHARP_20_LIBS=$pkg_cv_GLADE_SHARP_20_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk-sharp version >= 2.10" >&5 $as_echo_n "checking for gtk-sharp version >= 2.10... " >&6; } if $PKG_CONFIG 'gtk-sharp-2.0 >= 2.10'; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define GTK_SHARP_2_10 1" >>confdefs.h FRONTEND_GNOME_COMPILER_FLAGS+=" -define:GTK_SHARP_2_10" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for asm in $(echo "2.0,System.Drawing " | cut -d, -f2- | sed 's/\,/ /g') do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mono 2.0 GAC for $asm.dll" >&5 $as_echo_n "checking for Mono 2.0 GAC for $asm.dll... " >&6; } if test \ -e "$($PKG_CONFIG --variable=libdir mono)/mono/2.0/$asm.dll" -o \ -e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/2.0/$asm.dll"; \ then \ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "missing reqired Mono 2.0 assembly: $asm.dll" "$LINENO" 5 fi done if test "x$WITH_MESSAGINGMENU" = "xsystem"; then FRONTEND_GNOME_COMPILER_FLAGS+=" -define:MESSAGING_MENU_SHARP" fi if test "x$WITH_MESSAGINGMENU" = "xincluded"; then FRONTEND_GNOME_COMPILER_FLAGS+=" -define:MESSAGING_MENU_SHARP" fi if test "x$WITH_INDICATE" = "xyes"; then FRONTEND_GNOME_COMPILER_FLAGS+=" -define:INDICATE_SHARP" fi if test "x$WITH_NOTIFY" = "xyes"; then FRONTEND_GNOME_COMPILER_FLAGS+=" -define:NOTIFY_SHARP" fi if test "x$WITH_GTKSPELL" = "xyes"; then FRONTEND_GNOME_COMPILER_FLAGS+=" -define:GTKSPELL" fi if $PKG_CONFIG 'mono >= 2.6'; then FRONTEND_GNOME_COMPILER_FLAGS+=" -platform:x86" fi ENABLE_FRONTEND_GNOME_IRC=$ENABLE_ENGINE_IRC; ENABLE_FRONTEND_GNOME_TWITTER=$ENABLE_ENGINE_TWITTER; ENABLE_FRONTEND_GNOME_XMPP=$ENABLE_ENGINE_XMPP; fi if test "x$ENABLE_FRONTEND_GNOME" = "xyes"; then ENABLE_FRONTEND_GNOME_TRUE= ENABLE_FRONTEND_GNOME_FALSE='#' else ENABLE_FRONTEND_GNOME_TRUE='#' ENABLE_FRONTEND_GNOME_FALSE= fi if test "x$ENABLE_FRONTEND_GNOME_IRC" = "xyes"; then ENABLE_FRONTEND_GNOME_IRC_TRUE= ENABLE_FRONTEND_GNOME_IRC_FALSE='#' else ENABLE_FRONTEND_GNOME_IRC_TRUE='#' ENABLE_FRONTEND_GNOME_IRC_FALSE= fi if test "x$ENABLE_FRONTEND_GNOME_TWITTER" = "xyes"; then ENABLE_FRONTEND_GNOME_TWITTER_TRUE= ENABLE_FRONTEND_GNOME_TWITTER_FALSE='#' else ENABLE_FRONTEND_GNOME_TWITTER_TRUE='#' ENABLE_FRONTEND_GNOME_TWITTER_FALSE= fi if test "x$ENABLE_FRONTEND_GNOME_XMPP" = "xyes"; then ENABLE_FRONTEND_GNOME_XMPP_TRUE= ENABLE_FRONTEND_GNOME_XMPP_FALSE='#' else ENABLE_FRONTEND_GNOME_XMPP_TRUE='#' ENABLE_FRONTEND_GNOME_XMPP_FALSE= fi # Check whether --enable-frontend-stfl was given. if test "${enable_frontend_stfl+set}" = set; then : enableval=$enable_frontend_stfl; ENABLE_FRONTEND_STFL=$enableval else ENABLE_FRONTEND_STFL=no fi if test "x$ENABLE_FRONTEND_STFL" != "xno"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STFL" >&5 $as_echo_n "checking for STFL... " >&6; } if test -n "$STFL_CFLAGS"; then pkg_cv_STFL_CFLAGS="$STFL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"stfl >= 0.21\""; } >&5 ($PKG_CONFIG --exists --print-errors "stfl >= 0.21") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_STFL_CFLAGS=`$PKG_CONFIG --cflags "stfl >= 0.21" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$STFL_LIBS"; then pkg_cv_STFL_LIBS="$STFL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"stfl >= 0.21\""; } >&5 ($PKG_CONFIG --exists --print-errors "stfl >= 0.21") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_STFL_LIBS=`$PKG_CONFIG --libs "stfl >= 0.21" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then STFL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "stfl >= 0.21" 2>&1` else STFL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "stfl >= 0.21" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$STFL_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (stfl >= 0.21) were not met: $STFL_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables STFL_CFLAGS and STFL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables STFL_CFLAGS and STFL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else STFL_CFLAGS=$pkg_cv_STFL_CFLAGS STFL_LIBS=$pkg_cv_STFL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if false; then ENABLE_STATIC_STFL_TRUE= ENABLE_STATIC_STFL_FALSE='#' else ENABLE_STATIC_STFL_TRUE='#' ENABLE_STATIC_STFL_FALSE= fi if test "x$ENABLE_FRONTEND_STFL" = "xyes"; then ENABLE_FRONTEND_STFL_TRUE= ENABLE_FRONTEND_STFL_FALSE='#' else ENABLE_FRONTEND_STFL_TRUE='#' ENABLE_FRONTEND_STFL_FALSE= fi # Check whether --enable-frontend-curses was given. if test "${enable_frontend_curses+set}" = set; then : enableval=$enable_frontend_curses; ENABLE_FRONTEND_CURSES=$enableval else ENABLE_FRONTEND_CURSES=no fi if test "x$ENABLE_FRONTEND_CURSES" != "xno"; then # TODO: check deps as_fn_error $? "Ncurses frontend not supported (yet)" "$LINENO" 5 fi if test "x$ENABLE_FRONTEND_CURSES" = "xyes"; then ENABLE_FRONTEND_CURSES_TRUE= ENABLE_FRONTEND_CURSES_FALSE='#' else ENABLE_FRONTEND_CURSES_TRUE='#' ENABLE_FRONTEND_CURSES_FALSE= fi # Check whether --enable-frontend-swf was given. if test "${enable_frontend_swf+set}" = set; then : enableval=$enable_frontend_swf; ENABLE_FRONTEND_SWF=$enableval else ENABLE_FRONTEND_SWF=no fi if test "x$ENABLE_FRONTEND_SWF" != "xno"; then for asm in $(echo "2.0,System.Windows.Forms " | cut -d, -f2- | sed 's/\,/ /g') do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mono 2.0 GAC for $asm.dll" >&5 $as_echo_n "checking for Mono 2.0 GAC for $asm.dll... " >&6; } if test \ -e "$($PKG_CONFIG --variable=libdir mono)/mono/2.0/$asm.dll" -o \ -e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/2.0/$asm.dll"; \ then \ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "missing reqired Mono 2.0 assembly: $asm.dll" "$LINENO" 5 fi done fi if test "x$ENABLE_FRONTEND_SWF" = "xyes"; then ENABLE_FRONTEND_SWF_TRUE= ENABLE_FRONTEND_SWF_FALSE='#' else ENABLE_FRONTEND_SWF_TRUE='#' ENABLE_FRONTEND_SWF_FALSE= fi # Check whether --enable-frontend-wpf was given. if test "${enable_frontend_wpf+set}" = set; then : enableval=$enable_frontend_wpf; ENABLE_FRONTEND_WPF=$enableval else ENABLE_FRONTEND_WPF=no fi if test "x$ENABLE_FRONTEND_WPF" != "xno"; then # TODO: check deps as_fn_error $? "WPF frontend not supported (yet)" "$LINENO" 5 fi if test "x$ENABLE_FRONTEND_WPF" = "xyes"; then ENABLE_FRONTEND_WPF_TRUE= ENABLE_FRONTEND_WPF_FALSE='#' else ENABLE_FRONTEND_WPF_TRUE='#' ENABLE_FRONTEND_WPF_FALSE= fi # Check whether --enable-frontend-test was given. if test "${enable_frontend_test+set}" = set; then : enableval=$enable_frontend_test; ENABLE_FRONTEND_TEST=$enableval else ENABLE_FRONTEND_TEST=no fi if test "x$ENABLE_FRONTEND_TEST" = "xyes"; then ENABLE_FRONTEND_TEST_TRUE= ENABLE_FRONTEND_TEST_FALSE='#' else ENABLE_FRONTEND_TEST_TRUE='#' ENABLE_FRONTEND_TEST_FALSE= fi ac_config_files="$ac_config_files Makefile src/Makefile src/AssemblyVersion.cs src/smuxi-win32.nsis src/Common/Makefile src/Common/Defines.cs src/Common/smuxi-common.pc src/Engine/Makefile src/Engine/smuxi-engine.pc src/Engine-IRC/Makefile src/Engine-IRC/smuxi-engine-irc.pc src/Engine-JabbR/Makefile src/Engine-JabbR/smuxi-engine-jabbr.pc src/Engine-Twitter/Makefile src/Engine-XMPP/Makefile src/Engine-XMPP/smuxi-engine-xmpp.pc src/Engine-Campfire/Makefile src/Server/Makefile src/Server/smuxi-server src/Frontend/Makefile src/Frontend/smuxi-frontend.pc src/Frontend-GNOME/Makefile src/Frontend-GNOME/smuxi-frontend-gnome src/Frontend-GNOME-IRC/Makefile src/Frontend-GNOME-Twitter/Makefile src/Frontend-GNOME-XMPP/Makefile src/Frontend-Curses/Makefile src/Frontend-Curses/smuxi-frontend-curses src/Frontend-STFL/Makefile src/Frontend-STFL/smuxi-frontend-stfl src/Frontend-STFL/STFL/Makefile src/Frontend-SWF/Makefile src/Frontend-SWF/smuxi-frontend-swf src/Frontend-Test/Makefile src/Frontend-Test/smuxi-frontend-test lib/Makefile lib/osx/Info.plist po/Makefile.in po-Engine/Makefile.in po-Engine-Campfire/Makefile.in po-Engine-IRC/Makefile.in po-Engine-JabbR/Makefile.in po-Engine-Twitter/Makefile.in po-Engine-XMPP/Makefile.in po-Server/Makefile.in po-Frontend/Makefile.in po-Frontend-GNOME/Makefile.in po-Frontend-GNOME-IRC/Makefile.in po-Frontend-GNOME-Twitter/Makefile.in po-Frontend-GNOME-XMPP/Makefile.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi ac_config_commands="$ac_config_commands po/stamp-it" if test -z "${ENABLE_RELEASE_TRUE}" && test -z "${ENABLE_RELEASE_FALSE}"; then as_fn_error $? "conditional \"ENABLE_RELEASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DEBUG_TRUE}" && test -z "${ENABLE_DEBUG_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DEBUG_TRUE}" && test -z "${ENABLE_DEBUG_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_RELEASE_TRUE}" && test -z "${ENABLE_RELEASE_FALSE}"; then as_fn_error $? "conditional \"ENABLE_RELEASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUNDLE_NINI_TRUE}" && test -z "${BUNDLE_NINI_FALSE}"; then as_fn_error $? "conditional \"BUNDLE_NINI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUNDLE_DB4O_TRUE}" && test -z "${BUNDLE_DB4O_FALSE}"; then as_fn_error $? "conditional \"BUNDLE_DB4O\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUNDLE_DB4O_TRUE}" && test -z "${BUNDLE_DB4O_FALSE}"; then as_fn_error $? "conditional \"BUNDLE_DB4O\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE}" && test -z "${WITH_MESSAGINGMENU_SHARP_INCLUDED_FALSE}"; then as_fn_error $? "conditional \"WITH_MESSAGINGMENU_SHARP_INCLUDED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ENGINE_IRC_TRUE}" && test -z "${ENABLE_ENGINE_IRC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ENGINE_IRC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ENGINE_CAMPFIRE_TRUE}" && test -z "${ENABLE_ENGINE_CAMPFIRE_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ENGINE_CAMPFIRE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ENGINE_XMPP_TRUE}" && test -z "${ENABLE_ENGINE_XMPP_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ENGINE_XMPP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ENGINE_TWITTER_TRUE}" && test -z "${ENABLE_ENGINE_TWITTER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ENGINE_TWITTER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ENGINE_JABBR_TRUE}" && test -z "${ENABLE_ENGINE_JABBR_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ENGINE_JABBR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FRONTEND_GNOME_TRUE}" && test -z "${ENABLE_FRONTEND_GNOME_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FRONTEND_GNOME\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FRONTEND_GNOME_IRC_TRUE}" && test -z "${ENABLE_FRONTEND_GNOME_IRC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FRONTEND_GNOME_IRC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FRONTEND_GNOME_TWITTER_TRUE}" && test -z "${ENABLE_FRONTEND_GNOME_TWITTER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FRONTEND_GNOME_TWITTER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FRONTEND_GNOME_XMPP_TRUE}" && test -z "${ENABLE_FRONTEND_GNOME_XMPP_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FRONTEND_GNOME_XMPP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_STATIC_STFL_TRUE}" && test -z "${ENABLE_STATIC_STFL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_STATIC_STFL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FRONTEND_STFL_TRUE}" && test -z "${ENABLE_FRONTEND_STFL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FRONTEND_STFL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FRONTEND_CURSES_TRUE}" && test -z "${ENABLE_FRONTEND_CURSES_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FRONTEND_CURSES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FRONTEND_SWF_TRUE}" && test -z "${ENABLE_FRONTEND_SWF_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FRONTEND_SWF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FRONTEND_WPF_TRUE}" && test -z "${ENABLE_FRONTEND_WPF_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FRONTEND_WPF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FRONTEND_TEST_TRUE}" && test -z "${ENABLE_FRONTEND_TEST_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FRONTEND_TEST\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by smuxi $as_me 0.11, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ smuxi config.status 0.11 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/AssemblyVersion.cs") CONFIG_FILES="$CONFIG_FILES src/AssemblyVersion.cs" ;; "src/smuxi-win32.nsis") CONFIG_FILES="$CONFIG_FILES src/smuxi-win32.nsis" ;; "src/Common/Makefile") CONFIG_FILES="$CONFIG_FILES src/Common/Makefile" ;; "src/Common/Defines.cs") CONFIG_FILES="$CONFIG_FILES src/Common/Defines.cs" ;; "src/Common/smuxi-common.pc") CONFIG_FILES="$CONFIG_FILES src/Common/smuxi-common.pc" ;; "src/Engine/Makefile") CONFIG_FILES="$CONFIG_FILES src/Engine/Makefile" ;; "src/Engine/smuxi-engine.pc") CONFIG_FILES="$CONFIG_FILES src/Engine/smuxi-engine.pc" ;; "src/Engine-IRC/Makefile") CONFIG_FILES="$CONFIG_FILES src/Engine-IRC/Makefile" ;; "src/Engine-IRC/smuxi-engine-irc.pc") CONFIG_FILES="$CONFIG_FILES src/Engine-IRC/smuxi-engine-irc.pc" ;; "src/Engine-JabbR/Makefile") CONFIG_FILES="$CONFIG_FILES src/Engine-JabbR/Makefile" ;; "src/Engine-JabbR/smuxi-engine-jabbr.pc") CONFIG_FILES="$CONFIG_FILES src/Engine-JabbR/smuxi-engine-jabbr.pc" ;; "src/Engine-Twitter/Makefile") CONFIG_FILES="$CONFIG_FILES src/Engine-Twitter/Makefile" ;; "src/Engine-XMPP/Makefile") CONFIG_FILES="$CONFIG_FILES src/Engine-XMPP/Makefile" ;; "src/Engine-XMPP/smuxi-engine-xmpp.pc") CONFIG_FILES="$CONFIG_FILES src/Engine-XMPP/smuxi-engine-xmpp.pc" ;; "src/Engine-Campfire/Makefile") CONFIG_FILES="$CONFIG_FILES src/Engine-Campfire/Makefile" ;; "src/Server/Makefile") CONFIG_FILES="$CONFIG_FILES src/Server/Makefile" ;; "src/Server/smuxi-server") CONFIG_FILES="$CONFIG_FILES src/Server/smuxi-server" ;; "src/Frontend/Makefile") CONFIG_FILES="$CONFIG_FILES src/Frontend/Makefile" ;; "src/Frontend/smuxi-frontend.pc") CONFIG_FILES="$CONFIG_FILES src/Frontend/smuxi-frontend.pc" ;; "src/Frontend-GNOME/Makefile") CONFIG_FILES="$CONFIG_FILES src/Frontend-GNOME/Makefile" ;; "src/Frontend-GNOME/smuxi-frontend-gnome") CONFIG_FILES="$CONFIG_FILES src/Frontend-GNOME/smuxi-frontend-gnome" ;; "src/Frontend-GNOME-IRC/Makefile") CONFIG_FILES="$CONFIG_FILES src/Frontend-GNOME-IRC/Makefile" ;; "src/Frontend-GNOME-Twitter/Makefile") CONFIG_FILES="$CONFIG_FILES src/Frontend-GNOME-Twitter/Makefile" ;; "src/Frontend-GNOME-XMPP/Makefile") CONFIG_FILES="$CONFIG_FILES src/Frontend-GNOME-XMPP/Makefile" ;; "src/Frontend-Curses/Makefile") CONFIG_FILES="$CONFIG_FILES src/Frontend-Curses/Makefile" ;; "src/Frontend-Curses/smuxi-frontend-curses") CONFIG_FILES="$CONFIG_FILES src/Frontend-Curses/smuxi-frontend-curses" ;; "src/Frontend-STFL/Makefile") CONFIG_FILES="$CONFIG_FILES src/Frontend-STFL/Makefile" ;; "src/Frontend-STFL/smuxi-frontend-stfl") CONFIG_FILES="$CONFIG_FILES src/Frontend-STFL/smuxi-frontend-stfl" ;; "src/Frontend-STFL/STFL/Makefile") CONFIG_FILES="$CONFIG_FILES src/Frontend-STFL/STFL/Makefile" ;; "src/Frontend-SWF/Makefile") CONFIG_FILES="$CONFIG_FILES src/Frontend-SWF/Makefile" ;; "src/Frontend-SWF/smuxi-frontend-swf") CONFIG_FILES="$CONFIG_FILES src/Frontend-SWF/smuxi-frontend-swf" ;; "src/Frontend-Test/Makefile") CONFIG_FILES="$CONFIG_FILES src/Frontend-Test/Makefile" ;; "src/Frontend-Test/smuxi-frontend-test") CONFIG_FILES="$CONFIG_FILES src/Frontend-Test/smuxi-frontend-test" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/osx/Info.plist") CONFIG_FILES="$CONFIG_FILES lib/osx/Info.plist" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "po-Engine/Makefile.in") CONFIG_FILES="$CONFIG_FILES po-Engine/Makefile.in" ;; "po-Engine-Campfire/Makefile.in") CONFIG_FILES="$CONFIG_FILES po-Engine-Campfire/Makefile.in" ;; "po-Engine-IRC/Makefile.in") CONFIG_FILES="$CONFIG_FILES po-Engine-IRC/Makefile.in" ;; "po-Engine-JabbR/Makefile.in") CONFIG_FILES="$CONFIG_FILES po-Engine-JabbR/Makefile.in" ;; "po-Engine-Twitter/Makefile.in") CONFIG_FILES="$CONFIG_FILES po-Engine-Twitter/Makefile.in" ;; "po-Engine-XMPP/Makefile.in") CONFIG_FILES="$CONFIG_FILES po-Engine-XMPP/Makefile.in" ;; "po-Server/Makefile.in") CONFIG_FILES="$CONFIG_FILES po-Server/Makefile.in" ;; "po-Frontend/Makefile.in") CONFIG_FILES="$CONFIG_FILES po-Frontend/Makefile.in" ;; "po-Frontend-GNOME/Makefile.in") CONFIG_FILES="$CONFIG_FILES po-Frontend-GNOME/Makefile.in" ;; "po-Frontend-GNOME-IRC/Makefile.in") CONFIG_FILES="$CONFIG_FILES po-Frontend-GNOME-IRC/Makefile.in" ;; "po-Frontend-GNOME-Twitter/Makefile.in") CONFIG_FILES="$CONFIG_FILES po-Frontend-GNOME-Twitter/Makefile.in" ;; "po-Frontend-GNOME-XMPP/Makefile.in") CONFIG_FILES="$CONFIG_FILES po-Frontend-GNOME-XMPP/Makefile.in" ;; "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Whether or not to build static libraries. build_old_libs=$enable_static # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; "po/stamp-it":C) if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then as_fn_error $? "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5 fi rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp" >"po/stamp-it.tmp" sed '/^#/d s/^[[].*] *// /^[ ]*$/d '"s|^| $ac_top_srcdir/|" \ "$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES" sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r po/POTFILES } ' "po/Makefile.in" >"po/Makefile" rm -f "po/Makefile.tmp" mv "po/stamp-it.tmp" "po/stamp-it" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file, --srcdir, and --disable-option-checking arguments # so they do not pile up. ac_sub_configure_args= ac_prev= eval "set x $ac_configure_args" shift for ac_arg do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ | --c=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; --disable-option-checking) ;; *) case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_sub_configure_args " '$ac_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" # Pass --silent if test "$silent" = yes; then ac_sub_configure_args="--silent $ac_sub_configure_args" fi # Always prepend --disable-option-checking to silence warnings, since # different subdirs can have different --enable and --with options. ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 $as_echo "$ac_msg" >&6 as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" # Check for guested configure; otherwise get Cygnus style configure. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ac_sub_configure=$ac_aux_dir/configure else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative name. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 fi cd "$ac_popdir" done fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi if test "x$CLI_RUNTIME" = "x"; then CLI_RUNTIME=default fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: Configuration summary for $PACKAGE_NAME $VERSION ($DIST_VERSION) * Installation prefix: $prefix * Build profile: $PROFILE * Compiler: $CSC * Target CLI runtime: $CLI_RUNTIME * Engines ------- Core: (db4o: $WITH_DB4O) IRC: $ENABLE_ENGINE_IRC XMPP: $ENABLE_ENGINE_XMPP Twitter: $ENABLE_ENGINE_TWITTER Campfire: $ENABLE_ENGINE_CAMPFIRE JabbR: $ENABLE_ENGINE_JABBR * Frontends --------- GNOME: $ENABLE_FRONTEND_GNOME (IRC: $ENABLE_FRONTEND_GNOME_IRC XMPP: $ENABLE_FRONTEND_GNOME_XMPP Twitter: $ENABLE_FRONTEND_GNOME_TWITTER) + Messaging Menu (indicate: Ubuntu <= 12.04, messaging-menu: Ubuntu >= 12.04) - indicate: $WITH_INDICATE - messaging-menu: $WITH_MESSAGINGMENU + Notifications: $WITH_NOTIFY + Spell Checking: $WITH_GTKSPELL + D-Bus: $WITH_DBUS Ncurses: $ENABLE_FRONTEND_CURSES STFL: $ENABLE_FRONTEND_STFL SWF (WinForms): $ENABLE_FRONTEND_SWF WPF: $ENABLE_FRONTEND_WPF Test: $ENABLE_FRONTEND_TEST " >&5 $as_echo " Configuration summary for $PACKAGE_NAME $VERSION ($DIST_VERSION) * Installation prefix: $prefix * Build profile: $PROFILE * Compiler: $CSC * Target CLI runtime: $CLI_RUNTIME * Engines ------- Core: (db4o: $WITH_DB4O) IRC: $ENABLE_ENGINE_IRC XMPP: $ENABLE_ENGINE_XMPP Twitter: $ENABLE_ENGINE_TWITTER Campfire: $ENABLE_ENGINE_CAMPFIRE JabbR: $ENABLE_ENGINE_JABBR * Frontends --------- GNOME: $ENABLE_FRONTEND_GNOME (IRC: $ENABLE_FRONTEND_GNOME_IRC XMPP: $ENABLE_FRONTEND_GNOME_XMPP Twitter: $ENABLE_FRONTEND_GNOME_TWITTER) + Messaging Menu (indicate: Ubuntu <= 12.04, messaging-menu: Ubuntu >= 12.04) - indicate: $WITH_INDICATE - messaging-menu: $WITH_MESSAGINGMENU + Notifications: $WITH_NOTIFY + Spell Checking: $WITH_GTKSPELL + D-Bus: $WITH_DBUS Ncurses: $ENABLE_FRONTEND_CURSES STFL: $ENABLE_FRONTEND_STFL SWF (WinForms): $ENABLE_FRONTEND_SWF WPF: $ENABLE_FRONTEND_WPF Test: $ENABLE_FRONTEND_TEST " >&6; } smuxi-0.11/po-Engine-Campfire/0000755000175000017500000000000012311344241016736 5ustar00meebeymeebey00000000000000smuxi-0.11/po-Engine-Campfire/fi.po0000644000175000017500000000566212300202374017703 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Kalle Kaitala , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-05 18:50+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/smuxi/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "Yhdistetään campfireen..." #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "Yhdistetty campfireen" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "Campfire-komennot" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "Lähetä" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "'{0}' ({1} B) {2}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "on lähettänyt '{0}' ({1} B) {2}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "on liittynyt huoneeseen {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "on lähtenyt huoneesta {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "on lukinnut huoneen {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "on avannut huoneen {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "on vaihtanut aihetta" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "on suorittanut tuntemattoman toiminnon" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "" smuxi-0.11/po-Engine-Campfire/zh_CN.po0000644000175000017500000000563112300202374020302 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Dean Lee , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-13 08:10+0000\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/smuxi/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "正在连接到 campfire..." #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "已连接到 campfire" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "Campfire 命令" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "上传" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "'{0}' ({1} 字节) {2}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "无法发布信息: {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "已上传 '{0}' ({1} 字节) {2}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "已加入 {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "已离开 {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "已锁定 {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "已解锁 {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "已更改主题" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "已执行未知操作" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "流读取错误: {0}" smuxi-0.11/po-Engine-Campfire/POTFILES.skip0000644000175000017500000000043512300202374021053 0ustar00meebeymeebey00000000000000glade/ src/Common/ src/Frontend/ src/Frontend-GNOME/ src/Frontend-GNOME-IRC/ src/Frontend-GNOME-Twitter/ src/Frontend-GNOME-XMPP/ src/Frontend-STFL/ src/Frontend-SWF/ src/Frontend-WPF/ src/Engine/ src/Engine-IRC/ src/Engine-JabbR/ src/Engine-XMPP/ src/Engine-Twitter/ src/Server/ lib/ smuxi-0.11/po-Engine-Campfire/tr.po0000644000175000017500000000515612300202374017730 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-05 18:50+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/smuxi/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "" smuxi-0.11/po-Engine-Campfire/fa.po0000644000175000017500000000515012300202374017663 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-05 18:50+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Persian (http://www.transifex.com/projects/p/smuxi/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "" smuxi-0.11/po-Engine-Campfire/fr.po0000644000175000017500000000571212300202374017710 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Clément Bourgeois , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-13 21:21+0000\n" "Last-Translator: Clément Bourgeois \n" "Language-Team: French (http://www.transifex.com/projects/p/smuxi/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "Connexion à campfire..." #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "Connecté à campfire" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "Commandes Campfire" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "Envoyer" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "'{0}' ({1} O) {2}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "Impossible de poster le message : {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "a envoyé '{0}' ({1} O) {2}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "a rejoint {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "a quitté {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "a bloqué {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "a débloqué {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "a changé le sujet" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "a effectué une action inconnue" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "Erreur pendant la lecture du flux : {0}" smuxi-0.11/po-Engine-Campfire/sv.po0000644000175000017500000000574112300202374017733 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # flugsio , 2013 # Martin Bagge , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-10 13:29+0000\n" "Last-Translator: Martin Bagge \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/smuxi/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sv\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "Ansluter till campfire..." #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "Ansluten till campfire" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "Campfire-kommandon" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "Skicka" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "'{0}' ({1} B) {2}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "Kunde inte sända meddelande: {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "har laddat upp '{0}' ({1} B) {2}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "har anslutit till {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "har lämnat {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "har låst {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "har låst upp {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "har ändrat rubrik" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "har utfört en okänd åtgärd" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "Kunde inte läsa data: {0}" smuxi-0.11/po-Engine-Campfire/cs.po0000644000175000017500000000572012300202374017705 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Ondřej Hošek , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-06 13:58+0000\n" "Last-Translator: Ondřej Hošek \n" "Language-Team: Czech (http://www.transifex.com/projects/p/smuxi/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "Připojuji se s campfire..." #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "Připojen ke campfire" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "Příkazy campfire" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "Upload" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "'{0}' ({1} B) {2}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "Odeslání zprávy se nezdařilo: {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "uploadoval '{0}' ({1} B) {2}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "vstoupil do {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "odešel z {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "uzamkl {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "odemkl {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "změnil téma" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "provedl neznámou činnost" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "Chyba při čtení z proudu: {0}" smuxi-0.11/po-Engine-Campfire/nl.po0000644000175000017500000000576012311343665017730 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Jeroen Baten , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-26 12:54+0000\n" "Last-Translator: Jeroen Baten \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/smuxi/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "Verbinden met campfile..." #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "Verbonden met campfire" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "Campfire commando's" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "Upload" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "'{0}' ({1} B) {2}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "Publicatie van boodschap niet gelukt: {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "heeft geupload '{0}' ({1} B) {2}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "is verbonden met {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "heeft {0} verlaten" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "heeft {0} gelocked" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "heeft {0} ontsloten" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "heeft het onderwerp gewijzigd" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "heeft een onbekende actie uitgevoerd" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "Fout tijdens lezen van datastroom: {0}" smuxi-0.11/po-Engine-Campfire/da.po0000644000175000017500000000571412300202374017667 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Joe Hansen , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-05 19:22+0000\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish (http://www.transifex.com/projects/p/smuxi/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "Forbinder til campfire ..." #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "Forbundet til campfire" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "Campfire-kommandoer" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "Overfør" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "»{0}« ({1} B) {2}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "Kunne ikke sende besked: {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "har overført »{0}« ({1} B) {2}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "er sluttet til {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "har forladt {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "har låst {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "har åbent {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "har ændret emnet" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "har udført ukendt handling" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "Der opstod en fejl under læsning af strøm: {0}" smuxi-0.11/po-Engine-Campfire/POTFILES.in0000644000175000017500000000010212300202374020502 0ustar00meebeymeebey00000000000000src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs smuxi-0.11/po-Engine-Campfire/pt_BR.po0000644000175000017500000000557012300202374020311 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Leonardopf , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-05 18:50+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/smuxi/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "Conectando a campfire" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "Conectado a campfire" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "Comandos do Campfire " #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "Upload" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "'{0}' ({1} B) {2}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "fez upload '{0}' ({1} B) {2}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "Entrou em {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "Saiu de {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "Trancou {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "Destravou {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "Mudou o tópico" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "Fez uma ação desconhecida" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "" smuxi-0.11/po-Engine-Campfire/LINGUAS0000644000175000017500000000005512311343665017774 0ustar00meebeymeebey00000000000000cs da de es fa fi fr nl pt_BR sv te tr zh_CN smuxi-0.11/po-Engine-Campfire/de.po0000644000175000017500000000574712300202374017701 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Bianca Mix , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-11 19:35+0000\n" "Last-Translator: Bianca Mix \n" "Language-Team: German (http://www.transifex.com/projects/p/smuxi/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "verbinde zu campfire..." #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "Verbunden mit campfire" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "Campfire Kommandos" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "Hochladen" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "'{0}' ({1} B) {2}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "Nachricht konnte nicht gesendet werden: {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "hat '{0}' ({1} B) hochgeladen {2}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "hat {0} betreten" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "hat {0} verlassen" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "hat {0} gesperrt" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "hat {0} entsperrt" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "hat das Thema geändert" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "hat eine unbekannte Aktion ausgeführt" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "Fehler beim lesen des Datenstroms: {0}" smuxi-0.11/po-Engine-Campfire/Makefile.in.in0000644000175000017500000001533112300202374021411 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/po-Engine-Campfire/es.po0000644000175000017500000000562512300202374017713 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # toote, 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-10 19:43+0000\n" "Last-Translator: toote\n" "Language-Team: Spanish (http://www.transifex.com/projects/p/smuxi/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "Conectando a campfire..." #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "Conectado a campfire" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "Órdenes de campfire" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "Subir" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "'{0}' ({1} B) {2}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "No se pudo publicar el mensaje: {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "ha subido «{0}» ({1} B) {2}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "entró a {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "ha dejado {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "ha bloqueado {0}" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "ha desbloqueado {0}" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "ha cambiado el tema" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "ha realizado una acción desconocida" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "Ocurrió un error al leer del flujo: {0}" smuxi-0.11/po-Engine-Campfire/te.po0000644000175000017500000000515612300202374017713 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 16:59+0100\n" "PO-Revision-Date: 2013-12-10 18:22+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/smuxi/language/te/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: te\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:123 msgid "Connecting to campfire... " msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:166 msgid "Connected to campfire" msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:200 msgid "Campfire Commands" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:262 msgid "Upload" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:263 #, csharp-format msgid "'{0}' ({1} B) {2}" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:367 #, csharp-format msgid "Failed to post message: {0}" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:383 #, csharp-format msgid "has uploaded '{0}' ({1} B) {2}" msgstr "" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:415 #, csharp-format msgid "has joined {0}" msgstr "" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:424 #, csharp-format msgid "has left {0}" msgstr "" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:432 #, csharp-format msgid "has locked {0}" msgstr "" #. TRANSLATOR: {0} is the name of the room #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:436 #, csharp-format msgid "has unlocked {0}" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:441 msgid "has changed the topic" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:451 msgid "has performed an unknown action" msgstr "" #: ../src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs:492 #, csharp-format msgid "Error reading from stream: {0}" msgstr "" smuxi-0.11/install-sh0000755000175000017500000003325512311344234015407 0ustar00meebeymeebey00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: smuxi-0.11/Makefile.include0000644000175000017500000001177211714013610016462 0ustar00meebeymeebey00000000000000VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__=, get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref)))) build_references_ref += $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) build_references_ref += $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) EXTRA_DIST += $(build_sources) $(build_resx_files) $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) $(DATA_FILES) $(build_culture_res_files) CLEANFILES += $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) $(build_satellite_assembly_list) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) smuxi-0.11/po-Frontend-GNOME-Twitter/0000755000175000017500000000000012311344243020071 5ustar00meebeymeebey00000000000000smuxi-0.11/po-Frontend-GNOME-Twitter/fi.po0000644000175000017500000000175612300202374021034 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-05 18:35+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/smuxi/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "" smuxi-0.11/po-Frontend-GNOME-Twitter/zh_CN.po0000644000175000017500000000207312300202374021430 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Dean Lee , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-13 08:16+0000\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/smuxi/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "私信" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "时间线" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "取消关注" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "关注" smuxi-0.11/po-Frontend-GNOME-Twitter/POTFILES.skip0000644000175000017500000000052512300202374022204 0ustar00meebeymeebey00000000000000glade/ src/Common/ src/Engine/ src/Engine-Campfire/ src/Engine-IRC/ src/Engine-JabbR/ src/Engine-MSNP/ src/Engine-OSCAR/ src/Engine-XMPP/ src/Engine-Twitter/ src/Frontend/ src/Frontend-GNOME/ src/Frontend-GNOME-IRC/ src/Frontend-GNOME-Twitter/ src/Frontend-GNOME-XMPP/ src/Frontend-STFL/ src/Frontend-SWF/ src/Frontend-WPF/ src/Server/ lib/ smuxi-0.11/po-Frontend-GNOME-Twitter/tr.po0000644000175000017500000000175512300202374021062 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-05 18:35+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/smuxi/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "" smuxi-0.11/po-Frontend-GNOME-Twitter/fa.po0000644000175000017500000000174712300202374021024 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-05 18:35+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Persian (http://www.transifex.com/projects/p/smuxi/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "" smuxi-0.11/po-Frontend-GNOME-Twitter/fr.po0000644000175000017500000000212012300202374021027 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Clément Bourgeois , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-13 21:36+0000\n" "Last-Translator: Clément Bourgeois \n" "Language-Team: French (http://www.transifex.com/projects/p/smuxi/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "Message privé" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "Chronologie" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "Se désabonner" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "Suivre" smuxi-0.11/po-Frontend-GNOME-Twitter/sv.po0000644000175000017500000000207412300202374021060 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Martin Bagge , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-10 13:30+0000\n" "Last-Translator: Martin Bagge \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/smuxi/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sv\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "Direktmeddelande" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "Tidslinje" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "Avfölj" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "Följ" smuxi-0.11/po-Frontend-GNOME-Twitter/cs.po0000644000175000017500000000217612300202374021040 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Ondřej Hošek , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-06 15:08+0000\n" "Last-Translator: Ondřej Hošek \n" "Language-Team: Czech (http://www.transifex.com/projects/p/smuxi/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "Přímá zpráva" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "Časový přehled" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "Přestat následovat" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "Následovat" smuxi-0.11/po-Frontend-GNOME-Twitter/nl.po0000644000175000017500000000210212311343665021044 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Jeroen Baten , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-26 14:49+0000\n" "Last-Translator: Jeroen Baten \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/smuxi/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "Privéberichten" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "Tijdslijn" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "Ontvolgen" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "Volgen" smuxi-0.11/po-Frontend-GNOME-Twitter/da.po0000644000175000017500000000210712300202374021011 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Joe Hansen , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-05 19:51+0000\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish (http://www.transifex.com/projects/p/smuxi/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "Direkte besked" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "Tidslinje" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "Følg ikke længere" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "Følg" smuxi-0.11/po-Frontend-GNOME-Twitter/POTFILES.in0000644000175000017500000000006312300202374021641 0ustar00meebeymeebey00000000000000src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs smuxi-0.11/po-Frontend-GNOME-Twitter/pt_BR.po0000644000175000017500000000177712300202374021447 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-05 18:35+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/smuxi/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "" smuxi-0.11/po-Frontend-GNOME-Twitter/LINGUAS0000644000175000017500000000005512311343665021125 0ustar00meebeymeebey00000000000000cs da de es fa fi fr nl pt_BR sv te tr zh_CN smuxi-0.11/po-Frontend-GNOME-Twitter/de.po0000644000175000017500000000216212300202374021016 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Bianca Mix , 2013 # Mirco Bauer , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-11 19:38+0000\n" "Last-Translator: Bianca Mix \n" "Language-Team: German (http://www.transifex.com/projects/p/smuxi/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "Direktnachricht" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "Zeitachse" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "Nicht mehr folgen" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "Folgen" smuxi-0.11/po-Frontend-GNOME-Twitter/Makefile.in.in0000644000175000017500000001534012300202374022542 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/po-Frontend-GNOME-Twitter/es.po0000644000175000017500000000202612300202374021034 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # toote, 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-10 18:53+0000\n" "Last-Translator: toote\n" "Language-Team: Spanish (http://www.transifex.com/projects/p/smuxi/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "Mensaje directo" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "Línea temporal" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "Dejar de seguir" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "Seguir" smuxi-0.11/po-Frontend-GNOME-Twitter/te.po0000644000175000017500000000175512300202374021045 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:05+0100\n" "PO-Revision-Date: 2013-12-10 18:22+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/smuxi/language/te/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: te\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:52 msgid "Direct Message" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:60 msgid "Timeline" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:65 msgid "Unfollow" msgstr "" #: ../src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs:69 msgid "Follow" msgstr "" smuxi-0.11/Makefile.in0000644000175000017500000011110712311344227015443 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(top_srcdir)/lib/osx/Info.plist.in TODO compile config.guess \ config.rpath config.sub install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = lib/osx/Info.plist CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = lib src po po-Engine po-Engine-Campfire po-Engine-IRC \ po-Engine-JabbR po-Engine-Twitter po-Engine-XMPP po-Server \ po-Frontend po-Frontend-GNOME po-Frontend-GNOME-IRC \ po-Frontend-GNOME-Twitter po-Frontend-GNOME-XMPP DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ # Engines @ENABLE_ENGINE_CAMPFIRE_TRUE@PO_ENGINE_CAMPFIRE = po-Engine-Campfire @ENABLE_ENGINE_IRC_TRUE@PO_ENGINE_IRC = po-Engine-IRC @ENABLE_ENGINE_JABBR_TRUE@PO_ENGINE_JABBR = po-Engine-JabbR @ENABLE_ENGINE_TWITTER_TRUE@PO_ENGINE_TWITTER = po-Engine-Twitter @ENABLE_ENGINE_XMPP_TRUE@PO_ENGINE_XMPP = po-Engine-XMPP # Frontends @ENABLE_FRONTEND_GNOME_TRUE@PO_FRONTEND_GNOME = po-Frontend-GNOME @ENABLE_FRONTEND_GNOME_IRC_TRUE@PO_FRONTEND_GNOME_IRC = po-Frontend-GNOME-IRC @ENABLE_FRONTEND_GNOME_TWITTER_TRUE@PO_FRONTEND_GNOME_TWITTER = po-Frontend-GNOME-Twitter @ENABLE_FRONTEND_GNOME_XMPP_TRUE@PO_FRONTEND_GNOME_XMPP = po-Frontend-GNOME-XMPP ACLOCAL_AMFLAGS = -I . EXTRA_DIST = install-sh \ expansions.m4 \ mono.m4 \ programs.m4 \ HACKING \ LICENSE \ README.md \ CREDITS \ PROFILING \ FEATURES \ BUGS \ TODO # HACK: distclean in po/ does not work for some reason DISTCLEANFILES = \ po/POTFILES \ po/Makefile \ po/stamp-it \ po/Makefile.in PODIRS = po \ po-Engine \ $(PO_ENGINE_CAMPFIRE) \ $(PO_ENGINE_IRC) \ $(PO_ENGINE_JABBR) \ $(PO_ENGINE_TWITTER) \ $(PO_ENGINE_XMPP) \ po-Server \ po-Frontend \ $(PO_FRONTEND_GNOME) \ $(PO_FRONTEND_GNOME_IRC) \ $(PO_FRONTEND_GNOME_TWITTER) \ $(PO_FRONTEND_GNOME_XMPP) SUBDIRS = lib \ src \ $(PODIRS) LIB_DIR = $(top_builddir)/lib BUILD_DIR = $(top_builddir)/bin/$(PROFILE) WIN32_LIB_DIR = $(LIB_DIR)/win32 WIN32_BUILD_DIR = $(top_builddir)/bin-win32 WIN32_ICON_THEME_DIR = $(top_srcdir)/images/Smuxi-Symbolic OSX_LIB_DIR = $(LIB_DIR)/osx OSX_ICON_THEME_DIR = $(top_srcdir)/images/Smuxi-Symbolic OSX_BUILD_DIR = $(top_builddir)/bin-osx OSX_APP_DIR = $(OSX_BUILD_DIR)/Smuxi.app OSX_CONTENTS_DIR = $(OSX_APP_DIR)/Contents OSX_RESOURCES_DIR = $(OSX_CONTENTS_DIR)/Resources OSX_BINARIES_DIR = $(OSX_CONTENTS_DIR)/MacOS LINUX_STATIC_BUILD_DIR = $(top_builddir)/bin-linux-static WIN32_EXE_FILES = \ $(BUILD_DIR)/smuxi-frontend-gnome.exe \ $(BUILD_DIR)/smuxi-server.exe WIN32_FILES = \ $(WIN32_EXE_FILES) \ $(LIB_DIR)/Mono.Posix.dll \ $(LIB_DIR)/Nini.dll \ $(LIB_DIR)/log4net.dll \ $(WIN32_LIB_DIR)/plink.exe \ $(WIN32_LIB_DIR)/fixedsys500c/Fixedsys500c.ttf \ $(BUILD_DIR)/smuxi-common.dll \ $(BUILD_DIR)/smuxi-engine.dll \ $(BUILD_DIR)/smuxi-engine-campfire.dll \ $(BUILD_DIR)/smuxi-engine-irc.dll \ $(BUILD_DIR)/smuxi-engine-jabbr.dll \ $(BUILD_DIR)/smuxi-engine-twitter.dll \ $(BUILD_DIR)/smuxi-engine-xmpp.dll \ $(BUILD_DIR)/smuxi-frontend-gnome-irc.dll \ $(BUILD_DIR)/smuxi-frontend-gnome-twitter.dll \ $(BUILD_DIR)/smuxi-frontend-gnome-xmpp.dll \ $(BUILD_DIR)/smuxi-frontend.dll \ $(BUILD_DIR)/Meebey.SmartIrc4net.dll \ $(BUILD_DIR)/Twitterizer2.dll \ $(BUILD_DIR)/Newtonsoft.Json.dll \ $(BUILD_DIR)/agsxmpp.dll \ $(BUILD_DIR)/StarkSoftProxy.dll \ $(BUILD_DIR)/Db4objects.Db4o.dll \ $(BUILD_DIR)/ServiceStack.Text.dll \ $(BUILD_DIR)/ServiceStack.Interfaces.dll \ $(BUILD_DIR)/ServiceStack.Common.dll \ $(BUILD_DIR)/Microsoft.AspNet.SignalR.Client.dll \ $(BUILD_DIR)/JabbR.Client.dll \ $(WIN32_LIB_DIR)/smuxi-frontend-gnome.exe.config \ $(WIN32_LIB_DIR)/smuxi-server.exe.config OSX_FILES = \ $(LIB_DIR)/Nini.dll \ $(LIB_DIR)/log4net.dll \ $(BUILD_DIR)/smuxi-frontend-gnome.exe \ $(BUILD_DIR)/smuxi-frontend-gnome.exe.config \ $(BUILD_DIR)/smuxi-frontend-gnome-irc.dll \ $(BUILD_DIR)/smuxi-frontend-gnome-twitter.dll \ $(BUILD_DIR)/smuxi-frontend-gnome-xmpp.dll \ $(BUILD_DIR)/smuxi-server.exe \ $(BUILD_DIR)/smuxi-common.dll \ $(BUILD_DIR)/smuxi-engine.dll \ $(BUILD_DIR)/smuxi-engine-campfire.dll \ $(BUILD_DIR)/smuxi-engine-irc.dll \ $(BUILD_DIR)/smuxi-engine-jabbr.dll \ $(BUILD_DIR)/smuxi-engine-twitter.dll \ $(BUILD_DIR)/smuxi-engine-xmpp.dll \ $(BUILD_DIR)/smuxi-frontend.dll \ $(BUILD_DIR)/Meebey.SmartIrc4net.dll \ $(BUILD_DIR)/Twitterizer2.dll \ $(BUILD_DIR)/Newtonsoft.Json.dll \ $(BUILD_DIR)/agsxmpp.dll \ $(BUILD_DIR)/StarkSoftProxy.dll \ $(BUILD_DIR)/Db4objects.Db4o.dll \ $(BUILD_DIR)/ServiceStack.Text.dll \ $(BUILD_DIR)/ServiceStack.Interfaces.dll \ $(BUILD_DIR)/ServiceStack.Common.dll \ $(BUILD_DIR)/Microsoft.AspNet.SignalR.Client.dll \ $(BUILD_DIR)/JabbR.Client.dll LINUX_STATIC_FILES = \ $(LIB_DIR)/Mono.Posix.dll \ $(LIB_DIR)/Nini.dll \ $(LIB_DIR)/log4net.dll \ $(BUILD_DIR)/smuxi-common.dll \ $(BUILD_DIR)/smuxi-engine.dll \ $(BUILD_DIR)/smuxi-engine-irc.dll \ $(BUILD_DIR)/smuxi-engine-twitter.dll \ $(BUILD_DIR)/agsxmpp.dll \ $(BUILD_DIR)/Meebey.SmartIrc4net.dll \ $(BUILD_DIR)/StarkSoftProxy.dll \ $(BUILD_DIR)/Twitterizer2.dll \ $(BUILD_DIR)/Newtonsoft.Json.dll all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): lib/osx/Info.plist: $(top_builddir)/config.status $(top_srcdir)/lib/osx/Info.plist.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am # forcely disable parallel builds export MAKEFLAGS=-j1 update-po: for PODIR in $(PODIRS); do \ echo $$PODIR; \ $(MAKE) -C $$PODIR $@ | egrep -e '(:$$|messages)'; \ done update-pot: for PODIR in $(PODIRS); do \ echo $$PODIR; \ $(MAKE) -C $$PODIR clean; \ $(MAKE) -C $$PODIR check 2>&1 | grep -v 'mismatched quotes at line' 2>&1; \ done update-transifex: tx pull -f -l ca,cs,da,de,en_GB,es,fa,fi,fr,hr,ko,nb_NO,pl,pt_BR,ru,sk,sv,te,tr,ur,zh_CN mail-po: update-po for PODIR in $(PODIRS); do \ echo $$PODIR; \ podebconf-report-po \ --deadline=+14days \ --notdebconf \ --package="Smuxi ($$PODIR)" \ --utf8 \ --from="Mirco Bauer " \ --smtp=booster.qnetp.net \ --podir=$$PODIR \ --langs=cs,es_AR,it,pt; \ done call-po: update-po for PODIR in $(PODIRS); do \ echo $$PODIR; \ podebconf-report-po \ --deadline=+14days \ --notdebconf \ --package="Smuxi ($$PODIR)" \ --utf8 \ --from="Mirco Bauer " \ --smtp=booster.qnetp.net \ --podir=$$PODIR \ --call; \ done install-po: for PODIR in $(PODIRS); do \ $(MAKE) -C $$PODIR install itlocaledir=$(abs_top_builddir)/bin/$(PROFILE)/locale; \ done dist-win32: if [ -x /usr/bin/dmcs ]; then \ COMPILER_OVERRIDE="MCS=/usr/bin/dmcs"; \ echo COMPILER_OVERRIDE="$$COMPILER_OVERRIDE"; \ fi; \ DIST_VERSION=$$(git describe); \ ./autogen.sh $$COMPILER_OVERRIDE --without-indicate --without-messaging-menu --without-notify --without-dbus \ --with-db4o=included \ --with-vendor-package-version="dist-win32 $$DIST_VERSION" $(MAKE) mkdir -p $(WIN32_BUILD_DIR) for FILE in $(WIN32_FILES); do \ cp $$FILE $(WIN32_BUILD_DIR); \ done for PODIR in $(PODIRS); do \ $(MAKE) -C $$PODIR install itlocaledir=$(abs_top_builddir)/$(WIN32_BUILD_DIR)/locale; \ done mkdir -p $(WIN32_BUILD_DIR)/icons cp -r $(WIN32_ICON_THEME_DIR) $(WIN32_BUILD_DIR)/icons makensis $(top_srcdir)/src/smuxi-win32.nsis dist-osx: if [ -x /usr/bin/dmcs ]; then \ COMPILER_OVERRIDE="MCS=/usr/bin/dmcs"; \ echo COMPILER_OVERRIDE="$$COMPILER_OVERRIDE"; \ fi; \ DIST_VERSION=$$(git describe); \ ./autogen.sh $$COMPILER_OVERRIDE --without-indicate --without-messaging-menu --without-notify --without-dbus \ --with-db4o=included \ --with-vendor-package-version="dist-osx $$DIST_VERSION" $(MAKE) mkdir -p $(OSX_BINARIES_DIR) $(OSX_RESOURCES_DIR) cp $(OSX_LIB_DIR)/Info.plist $(OSX_CONTENTS_DIR) cp $(OSX_LIB_DIR)/smuxi $(OSX_BINARIES_DIR) cp $(OSX_LIB_DIR)/smuxi-server $(OSX_BINARIES_DIR) cp $(OSX_LIB_DIR)/smuxi.icns $(OSX_RESOURCES_DIR) for FILE in $(OSX_FILES); do \ cp $$FILE $(OSX_BINARIES_DIR); \ done mkdir -p $(OSX_BINARIES_DIR)/icons cp -r $(OSX_ICON_THEME_DIR) $(OSX_BINARIES_DIR)/icons -rm smuxi-osx.zip cd $(OSX_BUILD_DIR) && zip -r ../smuxi-osx.zip Smuxi.app dist-linux-x86-static: $(MAKE) mkdir -p $(LINUX_STATIC_BUILD_DIR) mkbundle --static -o $(LINUX_STATIC_BUILD_DIR)/smuxi-server $(BUILD_DIR)/smuxi-server.exe for FILE in $(LINUX_STATIC_FILES); do \ cp $$FILE $(LINUX_STATIC_BUILD_DIR); \ done tar -czf smuxi-server-$(VERSION)-linux-x86-static.tar.gz $(LINUX_STATIC_BUILD_DIR) dist-linux-debs: git checkout -- debian/changelog dch -b \ -v "1:$(VERSION)+git-1~$$(date +%Y%m%d%H%M%S).$$(git rev-parse --short=8 HEAD)" \ -D "$$(lsb_release -r -s)" \ "Building git snapshot." dpkg-buildpackage -b -us -uc run: run-gnome run-gnome: all cd $(BUILD_DIR) && \ mono --debug ./smuxi-frontend-gnome.exe -d run-stfl: all cd $(BUILD_DIR) && \ mono --debug ./smuxi-frontend-stfl.exe -d 2> smuxi-frontend-stfl.err run-server: all cd $(BUILD_DIR) && \ mono --debug ./smuxi-server.exe -d .NOTPARALLEL: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/LICENSE0000644000175000017500000004310311655545675014427 0ustar00meebeymeebey00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. smuxi-0.11/po-Engine-Twitter/0000755000175000017500000000000012311344242016653 5ustar00meebeymeebey00000000000000smuxi-0.11/po-Engine-Twitter/fi.po0000644000175000017500000001631412300202374017613 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Kalle Kaitala , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-05 19:06+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/smuxi/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "Koti-aikajana" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "Vastaukset" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "Suoraviestit" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Käytetään välityspalvelinta: {0}:{1}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "Yhdistetään Twitteriin..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "Twitter-tunnistetiedot vaaditaan." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "Avaa seuraava URL ja valitse \"Allow\" salliaksesi Smuxin yhdistäminen Twitter-tiliisi: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "Kun olet sallinut Smuxin pääsyn Twitter-tiliisi, Twitter antaa sinulle PIN-koodin." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Kirjoita: /pin PIN_JONKA_SAIT_TWITTERILTÄ" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "Yhteydenmuodostus epäonnistui!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "Noudetaan käyttäjätietoja Twitteristä, odota ole hyvä..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "Käyttäjätietojen haku valmis." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "Yhdistäminen Twitteriin onnistui." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Käyttäjätietojen haku Twitteristä epäonnistui. Syy:" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "Noudetaan ystäviä Twitteristä, odota ole hyvä..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "Ystävien haku valmis." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Ystävien haku Twitteristä epäonnistui. Syy:" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "Twitter-komennot" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "Ei voimassaolevaa auktorisointipyyntöä!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Auktorisointi Twitterin kanssa epäonnistui: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter ei hyväksynyt PIN-koodiasi. Syötitkö sen oikein?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "Yritä uudelleen sulkemalla tämä välilehti ja uudelleenyhdistämällä Twitter \"{0}\"-tiliin." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Muutettiin Twitter-autentikointi perustilasta OAuth-tilaan." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Twitter-tili \"{0}\" autorisoitu onnistuneesti Smuxiin" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Tilaa ei voitu päivittää - Syy: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "Viestiä ei voida lähettää - kohdetta ei ole määritelty. Käytä: /msg $nick viesti" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Viestiä ei voitu lähettää - Syy: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "Viestiä ei voitu lähettää - määriteltyä käyttäjää ei ole." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "Twitter ei palauttanut oikeanlaista vastausta, palvelussa voi olla ruuhkaa" smuxi-0.11/po-Engine-Twitter/zh_CN.po0000644000175000017500000001632512300202374020220 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Dean Lee , 2011,2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-13 08:14+0000\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/smuxi/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "主时间线" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "回复" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "私信" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "使用代理: {0}:{1}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "正在连接到 Twitter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "需要 Twitter 授权认证。" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "请打开下面的 URL 并点击“允许”授权 Smuxi 连接您的 Twitter 账户: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "在您允许 Smuxi 访问您的 Twitter 账户后,Twitter 将提供 PIN。" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "请输入: /pin TWITTER_给您的_PIN" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "连接失败!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "连接失败! 原因: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "正在从 Twitter 装载用户详细信息,请稍候..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "装载用户详细信息完成。" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "成功连接到 Twitter。" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "从 Twitter 装载用户详细信息失败。原因: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "正在从 Twitter 装载好友,请稍候..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "装载好友完成。" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "从 Twitter 装载好友失败。原因: " #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "Twitter 命令" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "无待处理的认证请求!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Twitter 认证失败: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter 不接受您提供的 PIN。您是否已经正确输入?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "请关闭本标签,重新连接 Twitter \"{0}\" 账户再次尝试。" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Twitter 账户已从 basic auth 迁移至 OAuth。" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Smuxi 成功认证 Twitter 账户 \"{0}\"" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "无法更新状态 - 原因: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "无法发送信息 - 未指定目标。用法: /msg $昵称 信息" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "无法发送信息 - 原因: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "其他时间线" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "无法发送信息 - 指定用户不存在。" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "搜索 {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "从 Twitter 装取好友时间线时发生了一个错误。原因: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "从 Twitter 装取回复时发生了一个错误。原因: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "从 Twitter 装取私信时发生了一个错误。原因: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "Twitter 所发送的响应无效,该网站可能处于过载状态" smuxi-0.11/po-Engine-Twitter/POTFILES.skip0000644000175000017500000000043612300202374020770 0ustar00meebeymeebey00000000000000glade/ src/Common/ src/Engine/ src/Engine-Campfire/ src/Engine-IRC/ src/Engine-JabbR/ src/Engine-XMPP/ src/Frontend/ src/Frontend-GNOME/ src/Frontend-GNOME-IRC/ src/Frontend-GNOME-Twitter/ src/Frontend-GNOME-XMPP/ src/Frontend-STFL/ src/Frontend-SWF/ src/Frontend-WPF/ src/Server/ lib/ smuxi-0.11/po-Engine-Twitter/tr.po0000644000175000017500000001350612300202374017642 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-05 19:06+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/smuxi/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "" smuxi-0.11/po-Engine-Twitter/pt.po0000644000175000017500000001653212300202374017642 0ustar00meebeymeebey00000000000000# Translation of smuxi-engine-twitter messages to Portuguese # Copyright (C) 2010 the smuxi's copyright holder # This file is distributed under the same license as the smuxi-engine-twitter package. # # Américo Monteiro , 2010. # Pedro Ribeiro , 2012. msgid "" msgstr "" "Project-Id-Version: smuxi-engine-twitter \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-07-25 06:25+0200\n" "PO-Revision-Date: 2012-07-25 23:28+0100\n" "Last-Translator: Pedro Ribeiro \n" "Language-Team: Portuguese \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:127 msgid "Home Timeline" msgstr "Timeline de Home" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:138 msgid "Replies" msgstr "Respostas" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:149 msgid "Direct Messages" msgstr "Mensagens Directas" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:197 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "A usar proxy: {0}:{1}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:204 msgid "Connecting to Twitter..." msgstr "A ligar ao Twitter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:242 msgid "Twitter authorization required." msgstr "Necessária autorização do Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:249 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "" "Por favor abra o seguinte URL e clique em \"Permitir\" (Allow) para permitir " "que o Smuxi se ligue à sua conta do Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:265 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "" "Após ter permitido que o Smuxi tenha acesso à sua conta do Twitter, o " "Twitter irá fornecer um PIN." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:272 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Por favor escreva: /pin PIN_DO_TWITTER" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:279 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Connection failed!" msgstr "Ligação falhada!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:281 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:321 msgid "Connection failed! Reason: " msgstr "Ligação falhada! Razão: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:294 msgid "Fetching user details from Twitter, please wait..." msgstr "" "A obter detalhes do utilizador a partir do Twitter, por favor aguarde..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:299 msgid "Finished fetching user details." msgstr "Obtenção de detalhes do utilizador terminada." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:304 msgid "Successfully connected to Twitter." msgstr "Ligação ao Twitter efectuada com sucesso." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:313 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Falhou ao obter os detalhes do utilizador a partir do Twitter. Razão: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:334 msgid "Fetching friends from Twitter, please wait..." msgstr "A obter amigos a partir do Twitter, por favor aguarde..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:339 msgid "Finished fetching friends." msgstr "Obtenção de amigos terminada." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:342 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Falhou ao obter amigos a partir do Twitter. Razão: " #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:619 msgid "Twitter Commands" msgstr "Comandos do Twitter" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:661 msgid "No pending authorization request!" msgstr "Nenhum pedido de autorização pendente!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:682 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Falhou a autorização com o Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:690 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "O Twitter não aceitou o seu PIN. Indicou-o correctamente?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:698 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "" "Por favor tente de novo fechando este separador e ligando de novo à conta " "Twitter {0}." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:739 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Conta Twitter migrada de autenticação básica para OAuth." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:753 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Conta Twitter {0} autorizada com sucesso para o Smuxi" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:775 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Incapaz de actualizar o estado - Razão: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:784 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "" "Incapaz de enviar mensagem - nenhum destino especificado. Use: /msg $alcunha " "mensagem" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:797 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:834 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Incapaz de enviar mensagem - Razão: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:821 msgid "Could not send message - the specified user does not exist." msgstr "Incapaz de enviar mensagem - o utilizador especificado não existe." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:910 msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " msgstr "" "Ocorreu um erro ao obter o timeline de amigos a partir do Twitter. Razão: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1017 msgid "An error occurred while fetching the replies from Twitter. Reason: " msgstr "Ocorreu um erro ao obter as respostas a partir do Twitter. Razão: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1113 msgid "An error occurred while fetching direct messages from Twitter. Reason: " msgstr "" "Ocorreu um erro ao obter as mensagens directas a partir do Twitter. Razão: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1458 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "" "O Twitter não enviou uma resposta válida, provavelmente estão sobrecarregados" smuxi-0.11/po-Engine-Twitter/fa.po0000644000175000017500000001350012300202374017575 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-05 19:06+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Persian (http://www.transifex.com/projects/p/smuxi/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "" smuxi-0.11/po-Engine-Twitter/fr.po0000644000175000017500000001752712300202374017633 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Clément Bourgeois , 2011-2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-13 21:27+0000\n" "Last-Translator: Clément Bourgeois \n" "Language-Team: French (http://www.transifex.com/projects/p/smuxi/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "Chronologie générale" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "Réponses" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "Messages directs" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Utilisation du proxy : {0} : {1}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "Connexion à Twitter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "Autorisation de Twitter nécessaire" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "Veuillez ouvrir l'URL suivante et cliquez sur \"Autoriser\\” pour autoriser Smuxi à se connecter sur votre compte Twitter : {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "Une fois que vous avez autorisé Smuxi à accéder à votre compte Twitter, Twitter va vous envoyer un code PIN." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Veuillez taper : /pin CODE_PIN_DE_TWITTER" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "Connexion impossible !" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "Connexion échouée ! Raison : {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "Téléchargement des détails utilisateur Twitter. Veuillez patienter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "Téléchargement des détails utilisateur terminée." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "Connexion à Twitter réussie." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Impossible de télécharger les détails utilisateur de Twitter. Raison :" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "Téléchargement de la liste des amis Twitter en cours, veuillez patienter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "Téléchargement de la liste des amis terminée." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Impossible de télécharger la liste des amis Twitter. Raison :" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "Commandes Twitter" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "Aucune requête d'autorisation en attente !" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Impossible d'obtenir une autorisation de Twitter : {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter n'a pas accepté votre code PIN. L'avez vous entré correctement ?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "Veuillez réessayer en fermant cet onglet et en vous connectant à nouveau au compte Twitter \"{0}\"." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Le compte Twitter géré par autorisation basique à été migré la methode OAuth." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Twitter a accepté la demande d'autorisation Smuxi pour le compte \"{0}\"." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Impossible de mettre à jour le statut - Raison : {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "Impossible d'envoyer le message. Aucune cible spécifiée. Utilisez /msg $nick message" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Impossible d'envoyer le message - Raison : {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "Autres chronologies" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "Impossible d'envoyer le message. L'utilisateur spécifié n'existe pas." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "Rechercher {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "Une erreur est survenue pendant la récupération de la chronologie des amis depuis Twitter. Raison : {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "Une erreur est survenue pendant la récuperation des réponses depuis Twitter. Raison : {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "Une erreur est survenue pendant la récupération des messages privés depuis Twitter. Raison : {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "Twitter n'a pas envoyé de réponse valide, le service est peut-être en surcapacité" smuxi-0.11/po-Engine-Twitter/sv.po0000644000175000017500000001714512300202374017650 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # flugsio , 2013 # flugsio , 2011 # Martin Bagge , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-10 14:54+0000\n" "Last-Translator: Martin Bagge \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/smuxi/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sv\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "Din tidslinje" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "Svar" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "Direktmeddelanden" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Använder proxy: {0}:{1}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "Ansluter till Twitter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "Inloggning till Twitter krävs." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "Vänligen öppna följande URL och klicka \"Godkänn\" för att tillåta Smuxi att ansluta till ditt Twitterkonto: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "När Smuxi har tillgång till ditt Twitterkonto, kommer Twitter att tillhandhålla en PIN-kod." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Vänligen skriv: /pin PIN_KOD_FRÅN_TWITTER" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "Anslutning misslyckades!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "Anslutning misslyckades! Anledning: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "Hämtar användarinformation från Twitter. Vänligen vänta..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "Hämtade användarinformation." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "Ansluten till Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Misslyckades med att hämta användarinformation från Twitter. Anledning: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "Hämtar vänner från Twitter. Vänligen vänta..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "Hämtade vänner." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Misslyckades med att hämta vänner från Twitter. Anledning: " #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "Twitter-kommandon" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "Ingen pågående auktoriseringsansökan!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Misslyckades att autentisera med Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter accepterade inte din PIN-kod. Angav du den korrekt?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "Vänligen försök igen genom att stänga denna flik och återansluta till Twitterkontot \"{0}\"." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Migrerade Twitterkontot från enkel auktorisering till OAuth." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Lyckades att auktorisera Twitterkontot \"{0}\" för Smuxi" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Kunde inte uppdatera status. Anledning: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "Kan inte skicka meddelande - inget mål specificerades. Använd /msg $nick meddelande" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Kunde inte skicka meddelande. Anledning: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "Andra tidslinjer" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "Kunde inte skicka meddelande - den specificerade användaren hittades inte." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "Sök {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "Ett fle uppstod när vännernas tidslinjer skulle hämtas från Twitter. Anledning: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "Ett fel uppstod när svar skulle hämtas från Twitter. Anledning: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "Ett fel uppstod när direktmeddelanden skulle hämtas från Twitter. Anledning: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "Twitter skickade inte ett giltigt svar, de är antagligen överbelastade" smuxi-0.11/po-Engine-Twitter/ur.po0000644000175000017500000001237412300202374017645 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2010-11-30 04:12+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Urdu (http://www.transifex.net/projects/p/smuxi/team/ur/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ur\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:125 msgid "Home Timeline" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:132 msgid "Replies" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:139 msgid "Direct Messages" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:174 msgid "Connecting to Twitter..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:203 msgid "Twitter authorization required." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:218 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:234 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:241 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:251 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:291 msgid "Connection failed!" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:253 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:293 msgid "Connection failed! Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:266 msgid "Fetching user details from Twitter, please wait..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:271 msgid "Finished fetching user details." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:276 msgid "Successfully connected to Twitter." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:285 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:306 msgid "Fetching friends from Twitter, please wait..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:311 msgid "Finished fetching friends." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:314 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:588 msgid "Twitter Commands" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:632 msgid "No pending authorization request!" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:653 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:661 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:669 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:709 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:722 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:744 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:753 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:766 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:803 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:790 msgid "Could not send message - the specified user does not exist." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:879 msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:980 msgid "An error occurred while fetching the replies from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1073 msgid "" "An error occurred while fetching direct messages from Twitter. Reason: " msgstr "" smuxi-0.11/po-Engine-Twitter/en_GB.po0000644000175000017500000001242612300202374020167 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2010-11-30 04:12+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: English (United Kingdom) (http://www.transifex.net/projects/p/smuxi/team/en_GB/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: en_GB\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:125 msgid "Home Timeline" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:132 msgid "Replies" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:139 msgid "Direct Messages" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:174 msgid "Connecting to Twitter..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:203 msgid "Twitter authorization required." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:218 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:234 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:241 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:251 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:291 msgid "Connection failed!" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:253 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:293 msgid "Connection failed! Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:266 msgid "Fetching user details from Twitter, please wait..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:271 msgid "Finished fetching user details." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:276 msgid "Successfully connected to Twitter." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:285 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:306 msgid "Fetching friends from Twitter, please wait..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:311 msgid "Finished fetching friends." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:314 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:588 msgid "Twitter Commands" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:632 msgid "No pending authorization request!" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:653 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:661 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:669 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:709 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:722 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:744 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:753 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:766 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:803 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:790 msgid "Could not send message - the specified user does not exist." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:879 msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:980 msgid "An error occurred while fetching the replies from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1073 msgid "" "An error occurred while fetching direct messages from Twitter. Reason: " msgstr "" smuxi-0.11/po-Engine-Twitter/cs.po0000644000175000017500000001713512300202374017624 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Ondřej Hošek , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-06 14:11+0000\n" "Last-Translator: Ondřej Hošek \n" "Language-Team: Czech (http://www.transifex.com/projects/p/smuxi/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "Domovský časový přehled" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "Odpovědi" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "Přímé zprávy" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Užívám proxy: {0}:{1}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "Připojování ke Twitteru..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "Je nutná autorizace Twitteru." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "Otevřete prosím tuto adresu a klikněte na \"Povolit\", aby bylo Smuxi povoleno připojení k Vašemu kontu Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "Po povolení připojení Smuxi k vašemu kontu Twitter Vám Twitter zobrazí PIN." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Zadejte prosím: /pin PIN_OD_TWITTERU" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "Připojování selhalo!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "Připojení selhalo! Příčina: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "Probíhá příjem podrobností o uživateli z Twitteru, čekejte prosím..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "Příjem podrobností o uživateli dokončen." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "Připojení ke Twitteru proběhlo úspěšně." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Příjem podrobností o uživateli z Twitteru selhal z důvodu: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "Probíhá příjem seznamu přátel z Twitteru, čekejte prosím..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "Příjem seznamu přátel dokončen." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Příjem seznamu přátel z Twitteru selhal z důvodu: " #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "Příkazy Twitteru" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "Žádná nevyřízená žádost o autorizaci nenalezena!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Autorizace s Twitterem selhala: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter neuznal Váš PIN. Zadal jste jej správně?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "Zkuste to, prosím, znovu: uzavřete tuto záložku a znovu se spojte s kontem Twitter \"{0}\"." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Konto Twitter přepnuto z jednoduché autentizace na OAuth." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Autorizace konta Twitter \"{0}\" se Smuxi úspěšná." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Nelze aktualizovat stav - Příčina: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "Zprávu nelze odeslat - nezadali jste příjemce. Zadejte: /msg $nick zpráva" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Zprávu nelze odeslat - Příčina: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "Ostatní časové přehledy" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "Zprávu nelze odeslat - zadaný uživatel neexistuje." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "Hledání {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "Během přijmu časového pásma přátel z Twitteru nastala chyba. Příčina: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "Během přijmu odpovědí z Twitteru nastala chyba. Příčina: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "Během přijmu přímých zpráv z Twitteru nastala chyba. Příčina: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "Twitter neodeslal platnou odpověď; asi mají problémy s kapacitou" smuxi-0.11/po-Engine-Twitter/nl.po0000644000175000017500000001724012311343665017640 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Jeroen Baten , 2013 # Mirco Bauer , 2014 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2014-03-16 12:45+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/smuxi/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "Eigen tijdslijn" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "Antwoorden" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "Directe Boodschappen" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Gebruikmakend van proxy: {0}:{1}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "Verbinden met Twitter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "Twitter autorisatie benodigd." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "Open aub de volgend eURL en click \"Toestaan\" om Smuxi toe te staan met uw Twitter account te verbinden: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "Zodra u Smuxi heeft toegestaan om uw Twitter account te benaderen zal Twitter u een PIN code geven." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Type aub: /pin PIN_VAN_TWITTER" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "Verbinding mislukt!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "Verbinden niet gelukt! Reden: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "Gebruikergegevens van Twitter downloaden. Een ogenblik geduld aub..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "Klaar met downloaden van gebruikergegevens." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "Succesvol verbonden met Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Downloaden van gebruikergegevens vanaf twitter is niet gelukt. Reden: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "Downloaden van vriendenlijst van Twitter. Een ogenblik geduld aub..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "Klaar met downloaden van vriendenlijst." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Downloaden van vriendenlijst vanaf twitter is niet gelukt. Reden: " #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "Twitter Commando's" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "Geen openstaand autorisatieverzoek!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Autoriseren met Twitter niet gelukt: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter accepteerde uw PIN niet. Heeft u het wel correct opgegeven?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "Probeer het aub opnieuw door het sluiten van dit tabblad en het opnieuw verbinden met het \"{0}\" Twitteraccount." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Twitteraccount gemigreerd van basic auth naar OAuth." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Met succes Twitteraccount \"{0}\" geautoriseerd voor Smuxi" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Kon status niet actualiseren - Reden: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "Kan melding niet versturen - geen bestemming gespecificeerd. Gebruik: /msg $alias boodschap" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Kon melding niet verzenden - Reden: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "Andere tijdslijnen" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "Kon boodschap niet verzenden - de opgegeven gebruiker bestaat niet." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "Zoek {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "Een fout is opgetreden tijdens het ophalen van uw vriendentijdslijn vanaf Twitter. Reden: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "Een fout is opgetreden tijdens het ophalen van reacties vanaf Twitter. Reden: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "Een fout is opgetreden tijdens het ophalen van persoonlijke boodschapen vanaf twitter. Reden: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "Twitter stuurde een onbegrijpbare reactie. Ze zijn waarschijnlijk overbelast" smuxi-0.11/po-Engine-Twitter/da.po0000644000175000017500000001661112300202374017601 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Joe Hansen , 2011,2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-05 19:25+0000\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish (http://www.transifex.com/projects/p/smuxi/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "Hjemmetidslinje" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "Svar" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "Direkte beskeder" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Bruger proxy: {0}:{1}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "Tilslutter til Twitter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "Twittergodkendelse krævet." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "Åbn venligst den følgende adresse og klik »Tillad« for at tillade Smuxi at forbinde til din Twitterkonto: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "Når du har tilladt Smuxi at tilgå din Twitterkonto, vil Twitter tilbyde en PIN." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Indtast venligst: /pin PIN_FRA_TWITTER" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "Tilslutning mislykkedes!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "Forbindelse mislykkedes! Årsag: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "Henter brugerdetaljer fra Twitter, vent venligst..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "Færdig med hentning af brugerdetaljer." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "Tilsluttet Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Kunne ikke hente brugerdetaljer fra Twitter. Årsag: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "Henter venneliste fra Twitter, vent venligst..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "Afsluttede hentning af venneliste." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Kunne ikke hente venneliste fra Twitter. Årsag: " #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "Twitterkommandoer" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "Ingen igangværende godkendelsesforespørgsel!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Kunne ikke indhente godkendelse hos Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter accepterede ikke din PIN. Indtastede du den korrekt?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "Forsøg igen ved at lukke dette faneblad og forbinde igen til Twitter »{0}-kontoen«." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Migrerede Twitterkonto fra grundlæggende auth til Oauth." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Godkendte Twitterkonto »{0}« til Smuxi" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Kunne ikke opdatere status - årsag: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "Kan ikke sende besked - intet mål angivet. Brug: /msg $nick besked" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Kunne ikke sende besked - årsag: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "Andre tidslinjer" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "Kunne ikke sende besked - den angivne bruger findes ikke." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "Søg {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "Der opstod en fejl under hentning af vennetidslinjen fra Twitter. Årsag: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "Der opstod en fejl under hentning af svar fra Twitter. Årsag: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "Der opstod en fejl under hentning af direkte beskeder fra Twitter. Årsag: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "Twitter sendte ikke et gyldigt svar, de er sikkert overbelastet" smuxi-0.11/po-Engine-Twitter/POTFILES.in0000644000175000017500000000007712300202374020431 0ustar00meebeymeebey00000000000000src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs smuxi-0.11/po-Engine-Twitter/pt_BR.po0000644000175000017500000001642612300202374020227 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Leonardopf , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-05 19:06+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/smuxi/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "Timeline de início" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "Respostas" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "Mensagens diretas" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Usando proxy: {0}:{1}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "Conectando ao Twitter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "Autorização no Twitter necessária." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "Abra a seguinte URL e clique em \"autorizar(Allow)\" para autorizar o Smuxi a conectar a sua conta do Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "Assim que você autorizar Smuxi a acessar sua conta do Twitter. O Twitter providenciará à você um código PIN." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Por favor digite: /pin PIN_RECEBIDO_NO_TWITTER" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "Conexão falhou!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "Recebendo dados de usuário do Twitter, por favor aguarde..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "Finalizado recebimento de dados." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "Conectado ao Twitter com sucesso." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Não foi possível receber dados do Twitter. Razão:" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "Recebendo os amigos do Twitter, por favor aguarde..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "Finalizado lista de amigos." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Falha no download de amigos do Twitter. Razão:" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "Comandos Twitter" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "Sem requisição de autorizações pendentes!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Falha em autorização com o Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter não aceitou seu código PIN. Você entrou o código correto?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "Por favor tente novamente fechando essa aba e re-conectando a conta \"{0}\" do Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Conta do Twitter mudada de autenticação Básica para OAuth." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Conta do Twitter \"{0}\" autorizada para o Smuxi" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Não foi possível atualizar status - Razão: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "Não foi possível enviar mensagem - Nenhum alvo especificado. Use: /msg $nick message" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Não foi possível enviar mensagem - Razão: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "Não foi possível enviar mensagem - O usuário especificado não existe." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "Twitter não enviou uma resposta válida. Eles provavelmente estão sobrecarregados" smuxi-0.11/po-Engine-Twitter/ru.po0000644000175000017500000001742612300202374017650 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Yuri Myasoedov , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:20+0100\n" "PO-Revision-Date: 2012-01-11 09:27+0000\n" "Last-Translator: Yuri Myasoedov \n" "Language-Team: Russian (http://www.transifex.net/projects/p/smuxi/team/ru/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ru\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "Ответы" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "Прямые сообщения" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:189 msgid "Connecting to Twitter..." msgstr "Подключение к Twitter…" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:228 msgid "Twitter authorization required." msgstr "Twitter требует авторизацию." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:235 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "" "Откройте следующий URL и нажмите «Allow», чтобы разрешить Smuxi подключаться" " к вашей учётной записи в Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:251 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "" "После того, как вы разрешите Smuxi получить доступ к учётной записи в " "Twitter, Twitter предложит PIN-код." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:258 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Введите: /pin PIN_КОД_TWITTER" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:265 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:305 msgid "Connection failed!" msgstr "Сбой при подключении!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:267 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:307 msgid "Connection failed! Reason: " msgstr "Сбой при подключении! Причина: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:280 msgid "Fetching user details from Twitter, please wait..." msgstr "Получение данных о пользователе с Twitter, подождите…" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:285 msgid "Finished fetching user details." msgstr "Получение данных о пользователе завершено." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:290 msgid "Successfully connected to Twitter." msgstr "Успешно подключено к Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:299 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Сбой при получении данных о пользователе. Причина: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:320 msgid "Fetching friends from Twitter, please wait..." msgstr "Получение друзей с Twitter, подождите…" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Finished fetching friends." msgstr "Получение друзей завершено." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:328 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Сбой при получении друзей с Twitter. Причина: " #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:605 msgid "Twitter Commands" msgstr "Команды Twitter" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:647 msgid "No pending authorization request!" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:668 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Сбой авторизации Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:676 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter не принял PIN-код. Проверьте, что он введён правильно." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:684 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "" "Повторите, закрыв эту вкладку и переподключившись к учётной записи «{0}» в " "Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:725 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:739 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Учётная запись «{0}» успешно авторизована в Twitter" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:761 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Не удалось обновить статус. Причина: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "" "Не удалось отправить сообщение: не указано назначение. Используйте команду: " "/msg $псевдоним сообщение" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:783 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:820 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Не удалось отправить сообщение. Причина: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:807 msgid "Could not send message - the specified user does not exist." msgstr "Не удалось отправить сообщение: указанный пользователь не существует." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:896 msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1001 msgid "An error occurred while fetching the replies from Twitter. Reason: " msgstr "Ошибка при получении ответов с Twitter. Причина: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1097 msgid "" "An error occurred while fetching direct messages from Twitter. Reason: " msgstr "Ошибка при получении прямых сообщений с Twitter. Причина: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1441 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "Twitter не отправил корректный ответ, возможно они перегружены" smuxi-0.11/po-Engine-Twitter/pl.po0000644000175000017500000001432512300202374017630 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:20+0100\n" "PO-Revision-Date: 2012-01-06 21:41+0000\n" "Last-Translator: OkweL \n" "Language-Team: Polish (http://www.transifex.net/projects/p/smuxi/team/pl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pl\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "Odpowiedzi" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:189 msgid "Connecting to Twitter..." msgstr "Łączenie z Twitterem..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:228 msgid "Twitter authorization required." msgstr "Wymagana jest autoryzacja Twittera." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:235 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "" "Proszę otworzyć poniższy adres URL i kliknąć przycisk \"Zezwól\", aby " "umożliwić Smuxi łączenie się z kontem na Twitterze: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:251 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "" "Gdy zezwolisz Smuxi na dostęp do Twojego konta na Twitterze, Twitter poda " "PIN." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:258 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Wpisz: /pin PIN_Z_TWITTERA" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:265 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:305 msgid "Connection failed!" msgstr "Połączenie nieudane!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:267 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:307 msgid "Connection failed! Reason: " msgstr "Połączenie nieudane! Powód: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:280 msgid "Fetching user details from Twitter, please wait..." msgstr "Pobieranie danych użytkownika z Twittera, proszę czekać ..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:285 msgid "Finished fetching user details." msgstr "Zakończono pobieranie danych użytkownika." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:290 msgid "Successfully connected to Twitter." msgstr "Pomyślnie połączono z Twitterem." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:299 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Nie udało się pobrać danych użytkownika z Twittera. Powód: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:320 msgid "Fetching friends from Twitter, please wait..." msgstr "Pobieranie listy znajomych z Twittera, proszę czekać..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Finished fetching friends." msgstr "Zakończono pobieranie listy znajomych." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:328 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Nie udało się pobrać listy znajomych z Twittera. Powód: " #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:605 msgid "Twitter Commands" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:647 msgid "No pending authorization request!" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:668 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:676 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:684 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:725 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:739 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:761 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:783 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:820 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:807 msgid "Could not send message - the specified user does not exist." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:896 msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1001 msgid "An error occurred while fetching the replies from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1097 msgid "" "An error occurred while fetching direct messages from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1441 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "" smuxi-0.11/po-Engine-Twitter/LINGUAS0000644000175000017500000000011312311343665017703 0ustar00meebeymeebey00000000000000ca cs da de es en_GB fa fi fr hr it nl pl pt pt_BR ru sk sv te tr ur zh_CN smuxi-0.11/po-Engine-Twitter/it.po0000644000175000017500000001616612300202374017636 0ustar00meebeymeebey00000000000000# Smuxi - IRC client for sophisticated users # Copyright (C) 2005-2010 Mirco Bauer # This file is distributed under the same license as the Smuxi package. # # Vincenzo Campanella , 2009, 2010. msgid "" msgstr "" "Project-Id-Version: smuxi-engine-twitter\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2010-09-11 09:43+0200\n" "Last-Translator: Vincenzo Campanella \n" "Language-Team: Italian \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:125 msgid "Home Timeline" msgstr "Cronologia di home" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:132 msgid "Replies" msgstr "Risposte" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:139 msgid "Direct Messages" msgstr "Messaggi diretti" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:174 msgid "Connecting to Twitter..." msgstr "Connessione a Twitter in corso" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:203 msgid "Twitter authorization required." msgstr "È necessaria l'autorizzazione di Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:218 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "" "Aprire l'URL seguente e cliccare «Allow» per consentire a Smuxi di " "collegarsi al proprio account Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:234 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "" "Dopo aver abilitato Smuxi ad accedere al proprio account Twitter, Twitter " "fornirà un PIN." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:241 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Inserire: /pin PIN_FROM_TWITTER" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:251 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:291 msgid "Connection failed!" msgstr "Connessione non riuscita." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:253 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:293 msgid "Connection failed! Reason: " msgstr "Connessione non riuscita. Motivo: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:266 msgid "Fetching user details from Twitter, please wait..." msgstr "Recupero dei dettagli sull'utente da Twitter in corso, attendere." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:271 msgid "Finished fetching user details." msgstr "Recupero dei dettagli sull'utente terminato." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:276 msgid "Successfully connected to Twitter." msgstr "Collegamento a Twitter avvenuto con successo." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:285 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Impossibile recuperare i dettagli sull'utente da Twitter. Motivo: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:306 msgid "Fetching friends from Twitter, please wait..." msgstr "Recupero degli amici da Twitter in corso, attendere." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:311 msgid "Finished fetching friends." msgstr "Recupero degli amici terminato." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:314 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Impossibile recuperare gli amici da Twitter. Motivo: " #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:588 msgid "Twitter Commands" msgstr "Comandi di Twitter" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:632 msgid "No pending authorization request!" msgstr "Nessuna richiesta d'autorizzazione in sospeso." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:653 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Impossibile ottenere l'autorizzazione da Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:661 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "" "Twitter non ha accettato il PIN inserito. Controllare che sia stato inserito " "correttamente." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:669 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "" "Provare nuovamente chiudendo questa scheda e ricollegandosi all'account " "Twitter «{0}»." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:709 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Account Twitter migrato da auth base a OAuth." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:722 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Autorizzazione dell'account Twitter «{0}» per Smuxi riuscita" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:744 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Impossibile aggiornare lo stato. Motivo: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:753 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "" "Impossibile inviare il messaggio: nessun destinatario specificato. " "Utilizzare: /msg $nick messaggio" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:766 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:803 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Impossibile inviare il messaggio. Motivo: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:790 msgid "Could not send message - the specified user does not exist." msgstr "Impossibile inviare il messaggio: l'utente specificato non esiste." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:879 msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " msgstr "" "Si è verificato un errore durante il recupero della cronologia degli amici " "da Twitter. Motivo: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:980 msgid "An error occurred while fetching the replies from Twitter. Reason: " msgstr "" "Si è verificato un errore durante il recupero delle risposte da Twitter. " "Motivo: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1073 msgid "An error occurred while fetching direct messages from Twitter. Reason: " msgstr "" "Si è verificato un errore durante il recupero dei messaggi diretti da " "Twitter. Motivo: " #~ msgid "Login failed!" #~ msgstr "Accesso non riuscito." #~ msgid "Login failed! Username and/or password are incorrect." #~ msgstr "" #~ "Accesso non riuscito: il nome utente o la password non sono corretti." smuxi-0.11/po-Engine-Twitter/de.po0000644000175000017500000001743112300202374017606 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Bianca Mix , 2011,2013 # Mirco Bauer , 2013 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-11 16:50+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: German (http://www.transifex.com/projects/p/smuxi/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "Zuhause Zeitachse" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "Antworten" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "Direktnachrichten" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Benutze Proxy: {0}:{1}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "Verbinde zu Twitter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "Twitter Autorisierung erfolgreich" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "Bitte öffnen Sie die follgende URL und klicken Sie \"Allow\" um Smuxi zu erlauben, sich mit ihrem Twitter-Benutzerkonto zu verbinden: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "Sobald Sie Smuxi erlaubt haben, sich mit Ihrem Twitter-Benutzerkonto zu verbinden, wird Twitter Ihnen eine PIN bereitstellen" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Bitte tippen Sie: /pin PIN_VON_TWITTER" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "Verbindung ist fehlgeschlagen!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "Verbindung ist fehlgeschlagen! Ursache: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "Rufe die Benutzerinformationen von Twitter ab, bitte warten Sie..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "Abrufen der Benutzerinformationen abgeschlossen." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "Erfolgreich zu Twitter verbunden." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Abrufen der Benutzerinformationen fehlgeschlagen. Grund:" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "Rufe Freunde von Twitter ab, bitte warten Sie..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "Abrufen der Freunde abgeschlossen." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Abrufen der Freunde von Twitter fehlgeschlagen. Grund :" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "Twitter Befehle" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "Keine ausstehenden Autorisierungsanfragen!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Autorisierung gegenüber Twitter fehlgeschlagen: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter hat Ihre PIN nicht akzeptiert. Haben Sie sie korrekt eingegeben?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "Bitte versuchen Sie es erneut, indem Sie diesen Reiter schließen und sich erneut zum Twitter-Benutzerkont \"{0}\" verbinden." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Migrierte Twitter-Benutzerkonto von basic auth zu OAuth" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Einrichtung des Twitter-Benutzerkontos \"{0}\" für Smuxi war erfolgreich " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Konnte den Status nicht aktualisieren - Ursache: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "Kann Nachricht nicht senden - Ziel ist nicht definiert. Verwenden Sie /msg $nick Nachricht" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Konnte Nachricht nicht senden - Ursache: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "Andere Zeitachsen" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "Konnte Nachricht nicht senden - der gewählte Benutzer existiert nicht" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "Suche {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "Ein Fehler ist aufgetreten, während die Freunde Zeitachse von Twitter abgerufen wurde. Grund: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "Während des Abrufens der Antworten von Twitter ist ein Fehler aufgetreten. Grund: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "Während des Abrufens der Direktnachrichten von Twitter ist ein Fehler aufgetreten. Grund: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "Twitter hat keine gültige Antwort gesendet. Der Dienst ist womöglich überbeansprucht." smuxi-0.11/po-Engine-Twitter/Makefile.in.in0000644000175000017500000001533012300202374021324 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE_ENGINE_TWITTER@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/po-Engine-Twitter/es.po0000644000175000017500000001720412300202374017623 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # toote, 2013 # Ricardo Hermosilla , 2012 msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-10 18:35+0000\n" "Last-Translator: toote\n" "Language-Team: Spanish (http://www.transifex.com/projects/p/smuxi/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "Línea de tiempo principal" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "Respuestas" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "Mensajes directos" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "Utilizando proxy: {0}:{1}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "Conectando a Twitter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "Se requiere autorización de Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "Por favor, abra la siguiente dirección y haga click en «Autorizar» para permitir que Smuxi se conecte a su cuenta de Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "Una vez que haya autorizado a Smuxi acceder a su cuenta, Twitter le proveerá un número secreto («PIN»)." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Escriba: /pin NUMERO_SECRETO_DE_TWITTER" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "¡Falló la conexión!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "¡Falló la conexión! Razón: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "Obteniendo los detalles del usuario de Twitter, por favor espere..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "Finalizó la obtención de los detalles de usuario." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "Conexión satisfactoria con Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "No se pudo obtener la información del usuario en Twitter. Razón:" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "Obteniendo lista de amigos en Twitter, por favor espere..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "Finalizó la obtención de la lista de amigos." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "No se pudo obtener la lista de amigos de Twitter. Razón:" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "Órdenes de Twitter" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "¡No hay autorización pendiente!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "No se pudo autorizar con Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter no ha aceptado tu número secreto. ¿Lo ha ingresado correctamente?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "Inténtelo nuevamente cerrando esta pestaña y conectando a la cuenta de Twitter «{0}» nuevamente." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Se migró la cuenta de Twitter desde autenticación básica a OAuth." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Se autorizó la cuenta Twitter «{0}» para Smuxi" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "No se pudo actualizar su estado - Razón: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "No se puede enviar el mensaje - no ha seleccionado un destinatario. Utilice: /msg $nick mensaje" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "No se pudo enviar el mensaje - Razón: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "Otras líneas temporales" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "No se pudo enviar el mensaje - el usuario especificado no existe." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "Buscar {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "Ocurrió un error al obtener la línea temporal de amigos desde Twitter. Razón: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "Ocurrió un error al obtener respuestas desde Twitter. Razón: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "Ocurrió un error al obtener mensajes directos desde Twitter. Razón: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "Twitter no envió una respuesta válida, seguramente está sobrecargado." smuxi-0.11/po-Engine-Twitter/sk.po0000644000175000017500000001613612300202374017634 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Tomáš Vadina , 2011. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: 2011-09-30 08:37+0000\n" "Last-Translator: Tomáš Vadina \n" "Language-Team: Slovak (http://www.transifex.net/projects/p/smuxi/team/sk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: sk\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:125 msgid "Home Timeline" msgstr "Domovské časové pásmo" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:132 msgid "Replies" msgstr "Odpovede" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:139 msgid "Direct Messages" msgstr "Priame správy" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:174 msgid "Connecting to Twitter..." msgstr "Pripájanie na Twitter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:203 msgid "Twitter authorization required." msgstr "Vyžadované overenie Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:218 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "" "Prosím otvorte nasledujúcu URL adresu a kliknite na \"Povoliť\" pre " "povolenie pripojiť sa Smuxi na váš Twitter účet: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:234 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "" "Akonáhle povolíte Smuxi prístup k vášmu Twitter účtu, Twitter poskytne " "bezpečnostný kód PIN." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:241 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Prosím zadajte: /pin PIN_Z_TWITTER_ÚČTU" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:251 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:291 msgid "Connection failed!" msgstr "Pripojenie zlyhalo!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:253 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:293 msgid "Connection failed! Reason: " msgstr "Pripojenie zlyhalo! Príčina: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:266 msgid "Fetching user details from Twitter, please wait..." msgstr "" "Prebieha príjem podrobností o používateľovi služby Twitter, čakajte " "prosím..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:271 msgid "Finished fetching user details." msgstr "Príjem podrobností o používateľovi dokončený." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:276 msgid "Successfully connected to Twitter." msgstr "Pripojenie k službe Twitter prebehlo úspešne." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:285 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "" "Príjem podrobností o používateľovi zo služby Twitter zlyhal. Príčina: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:306 msgid "Fetching friends from Twitter, please wait..." msgstr "" "Prebieha príjem zoznamu priateľov zo služby Twitter, čakajte prosím..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:311 msgid "Finished fetching friends." msgstr "Príjem zoznamu priateľov dokončený." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:314 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Príjem zoznamu priateľov zo služby Twitter zlyhal. Príčina: " #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:588 msgid "Twitter Commands" msgstr "Príkazy služby Twitter" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:632 msgid "No pending authorization request!" msgstr "Žiadne nevybavené overovacie požiadavky!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:653 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Overenie so službou Twitter zlyhalo: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:661 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Služba Twitter neprijala zadané PIN. Zadali ste ho správne?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:669 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "" "Prosím opakujte zatvorením tejto karty a znovupripojením k účtu služby " "Twitter \"{0}\"." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:709 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Presunutý účet služby Twitter zo základného overovania na OAuth." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:722 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Overenie účtu služby Twitter \"{0}\" pre Smuxi prebehlo úspešne." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:744 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Nie je možné aktualizovať stav - Príčina: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:753 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "" "Nie je možné odoslať správu - nebol zadaný príjemca. Použite: /msg $prezývka" " správa" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:766 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:803 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Nie je možné odoslať správu - Príčina: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:790 msgid "Could not send message - the specified user does not exist." msgstr "Nie je možné odoslať správu - zadaný používateľ neexistuje." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:879 msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " msgstr "" "Počas príjmu časového pásma priateľov zo služby Twitter nastala chyba. " "Príčina: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:980 msgid "An error occurred while fetching the replies from Twitter. Reason: " msgstr "Počas príjmu odpovedí zo služby Twitter nastala chyba. Príčina: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1073 msgid "" "An error occurred while fetching direct messages from Twitter. Reason: " msgstr "" "Počas príjmu priamych správ zo služby Twitter nastala chyba. Príčina: " smuxi-0.11/po-Engine-Twitter/te.po0000644000175000017500000001350612300202374017625 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-11 17:01+0100\n" "PO-Revision-Date: 2013-12-10 18:22+0000\n" "Last-Translator: Mirco Bauer \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/smuxi/language/te/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: te\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:193 #, csharp-format msgid "Using proxy: {0}:{1}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:212 msgid "Connecting to Twitter..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:254 msgid "Twitter authorization required." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:261 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:277 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:284 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:292 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:354 msgid "Connection failed!" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:297 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:358 #, csharp-format msgid "Connection failed! Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:312 msgid "Fetching user details from Twitter, please wait..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:319 msgid "Finished fetching user details." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Successfully connected to Twitter." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:343 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:376 msgid "Fetching friends from Twitter, please wait..." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:385 msgid "Finished fetching friends." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:389 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:703 msgid "Twitter Commands" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:749 msgid "No pending authorization request!" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:778 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:786 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:827 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:841 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:864 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:875 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:892 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:987 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:912 msgid "Other timelines" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:970 msgid "Could not send message - the specified user does not exist." msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1081 #, csharp-format msgid "Search {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1228 #, csharp-format msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " "{0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1340 #, csharp-format msgid "An error occurred while fetching the replies from Twitter. Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1446 #, csharp-format msgid "" "An error occurred while fetching direct messages from Twitter. Reason: {0}" msgstr "" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1817 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "" smuxi-0.11/po-Engine-Twitter/hr.po0000644000175000017500000001620612300202374017626 0ustar00meebeymeebey00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: Smuxi - IRC client\n" "Report-Msgid-Bugs-To: http://www.smuxi.org/issues\n" "POT-Creation-Date: 2011-12-29 09:20+0100\n" "PO-Revision-Date: 2012-01-08 20:00+0000\n" "Last-Translator: Matias M. \n" "Language-Team: Croatian (http://www.transifex.net/projects/p/smuxi/team/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hr\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:124 msgid "Home Timeline" msgstr "Naslovna stranica" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:135 msgid "Replies" msgstr "Odgovori" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:146 msgid "Direct Messages" msgstr "Izravne poruke" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:189 msgid "Connecting to Twitter..." msgstr "Spajanje na Twitter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:228 msgid "Twitter authorization required." msgstr "Nužna je Twitter autorizacija." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:235 #, csharp-format msgid "" "Please open the following URL and click \"Allow\" to allow Smuxi to connect " "to your Twitter account: {0}" msgstr "" "Molimo otvorite sljedeći URL i kliknite na \"Allow\" kako biste dozvolili " "spajanje Smuxi aplikacije sa vašim Twitter korisničkim računom: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:251 msgid "" "Once you have allowed Smuxi to access your Twitter account, Twitter will " "provide a PIN." msgstr "" "Nakon što ste dozvolili pristup svojem Twitter računu, Twitter će vam dati " "PIN." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:258 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Molimo upišite: /pin PIN_SA_TWITTERA" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:265 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:305 msgid "Connection failed!" msgstr "Povezivanje nije uspjelo!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:267 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:307 msgid "Connection failed! Reason: " msgstr "Povezivanje nije uspjelo! Razlog: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:280 msgid "Fetching user details from Twitter, please wait..." msgstr "Hvatamo korisničke Twitter detalje, molimo budite strpljivi..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:285 msgid "Finished fetching user details." msgstr "Hvatanje korisničkih detalja je završeno." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:290 msgid "Successfully connected to Twitter." msgstr "Povezivanje sa Twitterom je uspješno." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:299 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "Hvatanje korisničkih Twitter detalja nije uspjelo. Razlog: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:320 msgid "Fetching friends from Twitter, please wait..." msgstr "Hvatamo Twitter prijatelje, molimo budite strpljivi..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:325 msgid "Finished fetching friends." msgstr "Hvatanje prijatelja je uspješno." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:328 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "Hvatanje Twitter prijatelja nije uspjelo. Razlog: " #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:605 msgid "Twitter Commands" msgstr "Twitter naredbe" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:647 msgid "No pending authorization request!" msgstr "Nema zahtjeva za autorizaciju!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:668 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "Twitter autorizacija nije uspjela: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:676 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter ne prihvaća vaš PIN. Da li ste ga ispravno unijeli?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:684 #, csharp-format msgid "" "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" " "account." msgstr "" "Molimo pokušajte ponovno tako da zatvorite ovu karticu i spojite se na " "Twitter {0} korisnički račun." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:725 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "Migracija Twitter računa sa basic auth na OAuth." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:739 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "Vaš Twitter račun \"{0}\" je uspješno autoriziran za Smuxi" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:761 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "Ažuriranje statusa nije uspjelo - Razlog: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:770 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "" "Nije moguće poslati poruku - niste naveli kome je treba poslati. " "Upotrijebite: /msg $nick poruka" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:783 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:820 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "Nije moguće poslati poruku - Razlog: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:807 msgid "Could not send message - the specified user does not exist." msgstr "Nije moguće poslati poruku - navedeni korisnik ne postoji." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:896 msgid "" "An error occurred while fetching the friends timeline from Twitter. Reason: " msgstr "" "Došlo je do greške pri hvatanju status vaših Twitter prijatelja. Razlog: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1001 msgid "An error occurred while fetching the replies from Twitter. Reason: " msgstr "Došlo je do greške pri hvatanju Twitter odgovora. Razlog: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1097 msgid "" "An error occurred while fetching direct messages from Twitter. Reason: " msgstr "Došlo je do greške pri hvatanju izravnih Twitter poruka. Razlog: " #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1441 msgid "Twitter didn't send a valid response, they're probably overloaded" msgstr "" "Twitter ne šalje valjani odgovor, poslužitelj je vjerojatno preopterećen" smuxi-0.11/po-Engine-Twitter/ca.po0000644000175000017500000001567712300202374017613 0ustar00meebeymeebey00000000000000# msgid "" msgstr "" "Project-Id-Version: Smuxi\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-09-02 15:23+0200\n" "PO-Revision-Date: \n" "Last-Translator: Siegfried-Angel Gevatter Pujals \n" "Language-Team: Siegfried-Angel Gevatter Pujals \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: \n" "Plural-Forms: nplurals=2; plural=n != 1\n" "X-Poedit-Language: Catalan\n" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:125 msgid "Home Timeline" msgstr "Línia temporal" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:132 msgid "Replies" msgstr "Respostes" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:139 msgid "Direct Messages" msgstr "Missatges directes" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:174 msgid "Connecting to Twitter..." msgstr "S'està connectant al Twitter..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:203 msgid "Twitter authorization required." msgstr "Cal una autoritzat per a accedir al Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:218 #, csharp-format msgid "Please open the following URL and click \"Allow\" to allow Smuxi to connect to your Twitter account: {0}" msgstr "Obriu l'adreça següent i premeu «Permet» per a permetre a l'Smuxi de connectar al vostre compte de Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:234 msgid "Once you have allowed Smuxi to access your Twitter account, Twitter will provide a PIN." msgstr "Un cop hageu permès a l'Smuxi accedir al vostre compte de Twitter, aquest us proporcionarà un codi PIN." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:241 msgid "Please type: /pin PIN_FROM_TWITTER" msgstr "Escriviu: /pin PIN_DEL_TWITTER" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:251 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:291 msgid "Connection failed!" msgstr "Ha fallat la connexió!" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:253 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:293 msgid "Connection failed! Reason: " msgstr "Ha fallat la connexió! Motiu:" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:266 msgid "Fetching user details from Twitter, please wait..." msgstr "S'està recuperant els detalls de l'usuari de Twitter, espereu..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:271 msgid "Finished fetching user details." msgstr "S'ha acabat de recuperar els detalls de l'usuari." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:276 msgid "Successfully connected to Twitter." msgstr "S'ha connectat correctament amb Twitter." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:285 msgid "Failed to fetch user details from Twitter. Reason: " msgstr "No s'ha pogut recuperar els detalls de l'usuari de Twitter. Motiu:" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:306 msgid "Fetching friends from Twitter, please wait..." msgstr "S'està recuperant la llista d'amics de Twitter, espereu..." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:311 msgid "Finished fetching friends." msgstr "S'ha acabat de recuperar la llista d'amics." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:314 msgid "Failed to fetch friends from Twitter. Reason: " msgstr "No s'ha pogut recuperar la llista d'amics de Twitter. Motiu:" #. TRANSLATOR: this line is used as a label / category for a #. list of commands below #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:588 msgid "Twitter Commands" msgstr "Ordres del Twitter" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:632 msgid "No pending authorization request!" msgstr "No hi ha cap petició d'autorització pendent." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:653 #, csharp-format msgid "Failed to authorize with Twitter: {0}" msgstr "No s'ha pogut autoritzar l'accés al Twitter: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:661 msgid "Twitter did not accept your PIN. Did you enter it correctly?" msgstr "Twitter no ha acceptat el PIN. L'heu introduït correctament?" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:669 #, csharp-format msgid "Please retry by closing this tab and reconnecting to the Twitter \"{0}\" account." msgstr "Torneu a intentar-ho tancant aquesta pestanya i tornant a connectar al compte de Twitter «{0}»." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:709 msgid "Migrated Twitter account from basic auth to OAuth." msgstr "S'ha migrat el compte de Twitter de l'autenticació bàsica a OAuth." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:722 #, csharp-format msgid "Successfully authorized Twitter account \"{0}\" for Smuxi" msgstr "L'Smuxi ha estat autoritzat per a accedir al compte de Twitter «{0}»." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:744 #, csharp-format msgid "Could not update status - Reason: {0}" msgstr "No s'ha pogut actualitzar l'estat - Motiu: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:753 msgid "Cannot send message - no target specified. Use: /msg $nick message" msgstr "No es pot enviar el missatge - no s'ha especificat cap destinatari. Utilitzeu: /msg $sobrenom missatge" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:766 #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:803 #, csharp-format msgid "Could not send message - Reason: {0}" msgstr "No s'ha pogut enviar el missatge - Motiu: {0}" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:790 msgid "Could not send message - the specified user does not exist." msgstr "No s'ha pogut enviar el missatge - l'usuari especificat no existeix." #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:879 msgid "An error occurred while fetching the friends timeline from Twitter. Reason: " msgstr "S'ha produït un error al recuperar la línia temporal de l'amic de Twitter. Motiu:" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:980 msgid "An error occurred while fetching the replies from Twitter. Reason: " msgstr "S'ha produït un error al recuperar les respostes de Twitter. Motiu:" #: ../src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs:1073 msgid "An error occurred while fetching direct messages from Twitter. Reason: " msgstr "S'ha produït un error al recuperar els missatges directes de Twitter. Motiu:" #~ msgid "Login failed!" #~ msgstr "No s'ha pogut iniciar sessió!" #~ msgid "Login failed! Username and/or password are incorrect." #~ msgstr "No s'ha pogut iniciar sessió! El nom d'usuari i/o la contrasenya són incorrectes." smuxi-0.11/po/0000755000175000017500000000000012311344241014007 5ustar00meebeymeebey00000000000000smuxi-0.11/po/POTFILES.skip0000644000175000017500000000001712300202374016120 0ustar00meebeymeebey00000000000000src glade lib/ smuxi-0.11/po/POTFILES.in0000644000175000017500000000000012300202374015550 0ustar00meebeymeebey00000000000000smuxi-0.11/po/Makefile.in.in0000644000175000017500000001604612311344225016472 0ustar00meebeymeebey00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ INTLTOOL_V_MSGFMT = $(INTLTOOL__v_MSGFMT_$(V)) INTLTOOL__v_MSGFMT_= $(INTLTOOL__v_MSGFMT_$(AM_DEFAULT_VERBOSITY)) INTLTOOL__v_MSGFMT_0 = @echo " MSGFMT" $@; .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(INTLTOOL_V_MSGFMT)$(MSGFMT) -o $@ $< .po.gmo: $(INTLTOOL_V_MSGFMT)file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info ctags tags CTAGS TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/0000755000175000017500000000000012311344241014160 5ustar00meebeymeebey00000000000000smuxi-0.11/src/AssemblyVersion.cs0000644000175000017500000000236512311344236017646 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyDescription("Smart MUltipleXed Irc")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("qNETp")] [assembly: AssemblyProduct("Smuxi")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("0.11")] smuxi-0.11/src/Server/0000755000175000017500000000000012311344240015425 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Server/Server.cs0000644000175000017500000001273012257043746017245 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Threading; using System.Collections; using System.Runtime.Remoting; using System.Runtime.Remoting.Lifetime; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; using System.Runtime.Remoting.Channels.Http; using System.Runtime.Serialization.Formatters; using Smuxi; using Mono.Unix; using Mono.Unix.Native; //using Smuxi.Channels.Tcp; #if CHANNEL_TCPEX using TcpEx; #endif namespace Smuxi.Server { public class Server { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public static void Init(string[] args) { Engine.Engine.Init(); string channel = (string)Engine.Engine.Config["Server/Channel"]; string formatter = (string)Engine.Engine.Config["Server/Formatter"]; string host = (string)Engine.Engine.Config["Server/Host"]; string bindAddress = (string)Engine.Engine.Config["Server/BindAddress"]; int port = (int)Engine.Engine.Config["Server/Port"]; IDictionary props = new Hashtable(); props["port"] = port.ToString(); if (host != null) { props["machineName"] = host; } if (bindAddress != null) { props["bindTo"] = bindAddress; } switch (channel) { case "TCP": props["name"] = "TcpChannel"; BinaryClientFormatterSinkProvider cprovider = new BinaryClientFormatterSinkProvider(); BinaryServerFormatterSinkProvider sprovider = new BinaryServerFormatterSinkProvider(); // required for MS .NET 1.1 sprovider.TypeFilterLevel = TypeFilterLevel.Full; #if LOG4NET _Logger.Debug("Registering TcpChannel port: "+props["port"]); #endif try { ChannelServices.RegisterChannel(new TcpChannel(props, cprovider, sprovider), false); } catch (System.Net.Sockets.SocketException ex) { Console.WriteLine("Could not register remoting channel on port {0} " + "(server already running on that port?) Error: " + ex.Message, port); Environment.Exit(1); } break; #if CHANNEL_TCPEX case "TcpEx": props["name"] = "TcpExChannel"; #if LOG4NET _Logger.Debug("Registering TcpExChannel port: "+props["port"]); #endif ChannelServices.RegisterChannel(new TcpExChannel(props, null, null), false); break; #endif case "HTTP": props["name"] = "HttpChannel"; #if LOG4NET _Logger.Debug("Registering HttpChannel port: "+props["port"]); #endif ChannelServices.RegisterChannel(new HttpChannel(props, null, null), false); break; default: Console.WriteLine("Unknown channel ("+channel+"), aborting..."); Environment.Exit(1); break; } // register the SessionManager for .NET remoting RemotingServices.Marshal(Engine.Engine.SessionManager, "SessionManager"); #if LOG4NET _Logger.Info("Spawned remoting server with channel: "+channel+" formatter: "+formatter+" port: "+port); #endif if ((Environment.OSVersion.Platform == PlatformID.Unix) || (Environment.OSVersion.Platform == PlatformID.MacOSX)) { // Register shutdown handlers #if LOG4NET _Logger.Info("Registering signal handlers"); #endif UnixSignal[] shutdown_signals = { new UnixSignal(Signum.SIGINT), new UnixSignal(Signum.SIGTERM), }; Thread signal_thread = new Thread(() => { var index = UnixSignal.WaitAny(shutdown_signals); #if LOG4NET _Logger.Info("Caught signal " + shutdown_signals[index].Signum.ToString() + ", shutting down"); #endif Engine.Engine.Shutdown(); }); signal_thread.Start(); } Thread.CurrentThread.Join(); #if LOG4NET _Logger.Info("Shutting down remoting server..."); #endif } } } smuxi-0.11/src/Server/Main.cs0000644000175000017500000003263311700531610016647 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006, 2008, 2010 Mirco Bauer * Copyright (c) 2010 Clement Bourgeois * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using NDesk.Options; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Server { public class MainClass { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string _LibraryTextDomain = "smuxi-server"; public static void Main(string[] args) { System.Threading.Thread.CurrentThread.Name = "Main"; #if LOG4NET // initialize log level log4net.Repository.ILoggerRepository repo = log4net.LogManager.GetRepository(); repo.Threshold = log4net.Core.Level.Error; #endif bool addUser = false; bool delUser = false; bool modUser = false; bool listUsers = false; bool debug = false; string optBuffers = null; string username = null; string password = null; InitLocale(); OptionSet parser = new OptionSet(); parser.Add( "add-user", _("Add user to Server"), delegate(string val) { addUser = true; CheckExclusiveParameters(addUser, modUser, delUser, listUsers); } ); parser.Add( "modify-user", _("Modify existing user of Server"), delegate(string val) { modUser = true; CheckExclusiveParameters(addUser, modUser, delUser, listUsers); } ); parser.Add( "delete-user", _("Delete user from Server"), delegate(string val) { delUser = true; CheckExclusiveParameters(addUser, modUser, delUser, listUsers); } ); parser.Add( "list-users", _("List all existing users of Server"), delegate(string val) { listUsers = true; CheckExclusiveParameters(addUser, modUser, delUser, listUsers); } ); parser.Add( "username=", _("User to create, modify or delete"), delegate(string val) { CheckUsernameParameter(val); username = val; } ); parser.Add( "password=", _("Password of the user when creating or modifying a user"), delegate(string val) { CheckPasswordParameter(val); password = val; } ); parser.Add( "d|debug", _("Enable debug output"), delegate (string v) { debug = true; } ); parser.Add( "optimize-message-buffers=", _("Optimize message buffers and exit " + "(valid values: none, defrag, index, all)"), delegate (string val) { if (String.IsNullOrEmpty(val)) { val = "all"; } CheckOptimizeMessageBuffersParameter(val); optBuffers = val; } ); parser.Add( "h|help", _("Show this help"), delegate(string val) { Console.WriteLine(_("Usage: smuxi-server [options]")); Console.WriteLine(); Console.WriteLine(_("Options:")); parser.WriteOptionDescriptions(Console.Out); Environment.Exit(0); } ); parser.Add( "<>", delegate(string val) { throw new OptionException( String.Format( _("Unknown option: '{0}'"), val ), val ); } ); try { parser.Parse(args); #if LOG4NET if (debug) { repo.Threshold = log4net.Core.Level.Debug; } #endif if (optBuffers != null) { OptimizeMessageBuffers(optBuffers); } if (addUser || modUser) { CheckUsernameParameter(username); CheckPasswordParameter(password); } if (delUser) { CheckUsernameParameter(username); } ManageUser(addUser, delUser, modUser, listUsers, username, password); } catch (OptionException ex) { Console.Error.WriteLine(_("Command line error: {0}"), ex.Message); Environment.Exit(1); } try { Server.Init(args); } catch (Exception e) { #if LOG4NET _Logger.Fatal(e); #endif // rethrow the exception for console output throw; } } private static void InitLocale() { string appDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); string localeDir = Path.Combine(appDir, "locale"); if (!Directory.Exists(localeDir)) { localeDir = Path.Combine(Defines.InstallPrefix, "share"); localeDir = Path.Combine(localeDir, "locale"); } LibraryCatalog.Init("smuxi-server", localeDir); #if LOG4NET _Logger.Debug("Using locale data from: " + localeDir); #endif } private static void CheckExclusiveParameters(params bool[] parameters) { int enabled = 0; foreach (bool parameter in parameters) { if (parameter) { enabled++; } } if (enabled <= 1 ) { return; } throw new OptionException( _("At most one of --add-user, --modify-user, and --delete-user " + "may be used at a time."), String.Empty ); } private static void CheckUsernameParameter(string username) { if (username == null) { throw new OptionException( _("You must specify a username with the --username option."), String.Empty ); } if (username.Trim().Length == 0) { throw new OptionException( _("Username must not be empty."), String.Empty ); } } private static void CheckPasswordParameter(string password) { if (password == null) { throw new OptionException( _("You must specify a password with the --password option."), String.Empty ); } if (password.Trim().Length == 0) { throw new OptionException( _("Password must not be empty."), String.Empty ); } } private static void CheckOptimizeMessageBuffersParameter(string opts) { try { ParseBufferOptimizationTypes(opts); } catch (Exception) { var validOpts = Enum.GetNames(typeof(Db4oMessageBufferOptimizationTypes)); // lower-case values for (int i = 0; i < validOpts.Length; i++) { validOpts[i] = validOpts[i].ToLower(); } var validValues = String.Join(", ", validOpts); throw new OptionException( String.Format( _("Invalid optimization value passed to " + "--optimize-message-buffer, valid values are: {0}"), validValues ), String.Empty ); } } private static void ManageUser(bool addUser, bool delUser, bool modUser, bool listUsers, string username, string password) { Config config = new Config(); UserListController controller = new UserListController(config); if (addUser) { config.Load(); controller.AddUser(username, password); config.Save(); Console.WriteLine( _("User \"{0}\" successfully added to server."), username ); Environment.Exit(0); } else if (modUser) { config.Load(); controller.ModifyUser(username, password); config.Save(); Console.WriteLine( _("User \"{0}\" successfully modified."), username ); Environment.Exit(0); } else if (delUser) { config.Load(); controller.DeleteUser(username); config.Save(); Console.WriteLine( _("User \"{0}\" successfully deleted from server."), username ); Environment.Exit(0); } else if (listUsers) { config.Load(); var users = controller.GetUsers(); Console.WriteLine(_("Users:")); foreach (var user in users) { if (user == "local") { // is not a real user and could cause confusion continue; } Console.WriteLine("\t{0}", user); } Environment.Exit(0); } } private static Db4oMessageBufferOptimizationTypes ParseBufferOptimizationTypes(string optString) { if (optString == null) { throw new ArgumentNullException("optString"); } var optList = optString.Split(' ', ','); var opts = Db4oMessageBufferOptimizationTypes.None; foreach (var optItem in optList) { var optEnum = (Db4oMessageBufferOptimizationTypes) Enum.Parse( typeof(Db4oMessageBufferOptimizationTypes), optItem, true ); opts |= optEnum; } return opts; } private static void OptimizeMessageBuffers(string optString) { var logRepo = log4net.LogManager.GetRepository(); var origThreshold = logRepo.Threshold; // don't spew errors of Db4oMessageBuffer if (origThreshold == log4net.Core.Level.Error) { logRepo.Threshold = log4net.Core.Level.Fatal; } try { var opts = ParseBufferOptimizationTypes(optString); if (opts == Db4oMessageBufferOptimizationTypes.None) { Environment.Exit(0); return; } var bufferCount = Db4oMessageBuffer.OptimizeAllBuffers(opts); Console.WriteLine( String.Format( _("Successfully optimized {0} message buffers."), bufferCount ) ); Environment.Exit(0); } catch (Exception ex) { string error = ex.Message; if (ex.InnerException != null) { // inner-exceptio is more useful for some reason... error = ex.InnerException.Message; } Console.WriteLine( String.Format( _("Failed to optimize message buffers: {0}"), error ) ); Environment.Exit(1); } logRepo.Threshold = origThreshold; } private static string _(string msg) { return LibraryCatalog.GetString(msg, _LibraryTextDomain); } } } smuxi-0.11/src/Server/ChangeLog0000644000175000017500000000276011655545675017235 0ustar00meebeymeebey000000000000002008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-08-24 Mirco Bauer * Main.cs, Server.cs, Server.mdp: Init gettext. (closes trac bug #95) 2008-07-30 Mirco Bauer * Server.mdp, smuxi-server.exe.config: Added .exe.config for log4net configuration to project. 2008-07-27 Mirco Bauer * AssemblyInfo.cs.in, Server.mdp: Removed AssemblyInfo.cs.in files, not needed anymore as we use a shared AssemblyVersion.cs(.in) now. 2008-07-27 Mirco Bauer * Server.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-22 Mirco Bauer * Makefile.am: Distribute and install .exe.config files. 2008-07-22 Mirco Bauer * AssemblyInfo.cs, AssemblyInfo.cs.in, Server.mdp, Main.cs, Makefile.am: Made debug logging an explicit command line parameter (closes trac bug#60). 2008-07-22 Mirco Bauer * Server.cs: Call superseded method of ChannelServices.RegisterChannel(). 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 2008-01-31 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * Server.mdp: Updated using MonoDevelop 0.18.1 smuxi-0.11/src/Server/smuxi-server.10000644000175000017500000000377112307053667020207 0ustar00meebeymeebey00000000000000.Dd $Mdocdate: February 23 2014 $ .Dt smuxi-server 1 .Os .Sh NAME .Nm smuxi-server .Nd remote engine for Smuxi chat client .Sh SYNOPSIS .Nm smuxi-server .Op Fl dh .Op Fl \-add-user .Op Fl \-modify-user .Op Fl \-delete-user .Op Fl \-list-users .Op Fl \-username Ns = Ns Ar username .Op Fl \-password Ns = Ns Ar password .Op Fl \-optimize-message-buffers Ns = Ns Ar action .Sh DESCRIPTION .Nm is a remote engine for the Smuxi chat client. Multiple Smuxi frontends can connect and be kept in sync, and when none are connected, keeps track and stays connected to servers. .Pp Some options are mutually exclusive. When no special options are taken, the server will start normally. The options are as follows: .Bl -tag -width Ds .It Fl d , Fl \-debug Turn on debugging. Debug logs are sent to .Pa $XDG_DATA_HOME/smuxi/smuxi-server.log , and older logs are moved to the date of usage. .It Fl h , Fl \-help Show the arguments Smuxi takes. .It Fl \-add-user Adds a user to the server. .It Fl \-delete-user Deletes a user from the server. .It Fl \-modify-user Changes a user's properties. .It Fl \-list-users Lists the users of the server. .It Fl \-username Ns = Ns Ar username When adding, deleting, or modifying a user, use that username. .It Fl \-password Ns = Ns Ar password When adding or modifying a user, use that password. .It Fl \-optimize-message-buffers Ns = Ns Ar action Optimizes the message buffers. Valid values are none, defrag, index, and all. .Sh FILES .Bl -tag -width -compact .It Pa $XDG_DATA_HOME/smuxi/share/smuxi-server.log smuxi debug log .It Pa $XDG_CONFIG_HOME/smuxi/smuxi-engine.ini smuxi engine config .Sh SIGNALS Smuxi will handle and catch these signals: .Bl -tag -width xxxxxxxx -compact .It SIGINT Gracefully exits the server. .It SIGTERM Gracefully exits the server. .Sh SEE ALSO .Xr smuxi-frontend-gnome 1 , .Xr smuxi-frontend-stfl 1 , .Xr smuxi-message-buffer 1 .Pp Website: http://smuxi.im .Sh AUTHOR/CREDITS Smuxi, including this server, was written by Mirco Bauer. .Pp This manpage was written by Calvin Buckley. smuxi-0.11/src/Server/Makefile.am0000644000175000017500000000632012257043746017502 0ustar00meebeymeebey00000000000000 EXTRA_DIST = $(man_MANS) man_MANS = smuxi-server.1 SERVER_EXE_CONFIG_SOURCE = smuxi-server.exe.config SERVER_EXE_CONFIG = $(BUILD_DIR)/smuxi-server.exe.config ASSEMBLY_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ # Warning: This is an automatically generated file, do not edit! if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS += -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = ../../bin/release/smuxi-server.exe ASSEMBLY_MDB = COMPILE_TARGET = exe PROJECT_REFERENCES = \ ../../bin/release/smuxi-common.dll \ ../../bin/release/smuxi-engine.dll BUILD_DIR = ../../bin/release LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_MDB= NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/release/smuxi-engine.dll TCPEXCHANNEL_DLL_SOURCE=../../lib/TcpExChannel.dll SMUXI_COMMON_DLL_SOURCE=../../bin/release/smuxi-common.dll endif if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS += -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG "-define:TRACE,DEBUG,LOG4NET" ASSEMBLY = ../../bin/debug/smuxi-server.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = exe PROJECT_REFERENCES = \ ../../bin/debug/smuxi-common.dll \ ../../bin/debug/smuxi-engine.dll BUILD_DIR = ../../bin/debug LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/debug/smuxi-engine.dll TCPEXCHANNEL_DLL_SOURCE=../../lib/TcpExChannel.dll SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll endif AL=al2 SATELLITE_ASSEMBLY_NAME=.resources.dll PROGRAMFILES = \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_COMMON_DLL) \ $(SERVER_EXE_CONFIG) BINARIES = \ $(SERVER) all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Main.cs \ Server.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-server.in \ $(SERVER_EXE_CONFIG_SOURCE) REFERENCES = \ System.Runtime.Remoting \ System \ Mono.Posix DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) include $(top_srcdir)/Makefile.include LOG4NET_DLL = $(BUILD_DIR)/log4net.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll SERVER = $(BUILD_DIR)/smuxi-server TCPEXCHANNEL_DLL = $(BUILD_DIR)/TcpExChannel.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll $(eval $(call emit-deploy-wrapper,SERVER,smuxi-server,x)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(eval $(call emit-deploy-target,SERVER_EXE_CONFIG)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS) smuxi-0.11/src/Server/smuxi-server.in0000644000175000017500000000012111714013610020420 0ustar00meebeymeebey00000000000000#!/bin/sh exec mono --debug "@expanded_libdir@/@PACKAGE@/smuxi-server.exe" "$@" smuxi-0.11/src/Server/smuxi-server.exe.config0000644000175000017500000000113711655545675022100 0ustar00meebeymeebey00000000000000

    smuxi-0.11/src/Server/AssemblyInfo.cs0000644000175000017500000000241711655545675020404 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Smuxi - server")] [assembly: AssemblyCopyright("2005-2008, 2010 (C) Mirco Bauer ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] #if LOG4NET // let log4net use .exe.config file [assembly: log4net.Config.XmlConfigurator] #endif smuxi-0.11/src/Server/Makefile.in0000644000175000017500000010641112311344231017475 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_RELEASE_TRUE@am__append_1 = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@am__append_2 = -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG "-define:TRACE,DEBUG,LOG4NET" DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/smuxi-server.in ChangeLog subdir = src/Server ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = smuxi-server CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ EXTRA_DIST = $(man_MANS) $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) man_MANS = smuxi-server.1 SERVER_EXE_CONFIG_SOURCE = smuxi-server.exe.config SERVER_EXE_CONFIG = $(BUILD_DIR)/smuxi-server.exe.config ASSEMBLY_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ $(am__append_1) \ $(am__append_2) @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ # Warning: This is an automatically generated file, do not edit! @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/debug/smuxi-server.exe @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/release/smuxi-server.exe @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = exe @ENABLE_RELEASE_TRUE@COMPILE_TARGET = exe @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-common.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-engine.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-common.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-engine.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin/debug @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin/release @ENABLE_DEBUG_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_RELEASE_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB = $(BUILD_DIR)/smuxi-engine.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_MDB = @ENABLE_DEBUG_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_RELEASE_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/debug/smuxi-engine.dll @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/release/smuxi-engine.dll @ENABLE_DEBUG_TRUE@TCPEXCHANNEL_DLL_SOURCE = ../../lib/TcpExChannel.dll @ENABLE_RELEASE_TRUE@TCPEXCHANNEL_DLL_SOURCE = ../../lib/TcpExChannel.dll @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/release/smuxi-common.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB_SOURCE = ../../bin/debug/smuxi-engine.dll.mdb AL = al2 SATELLITE_ASSEMBLY_NAME = .resources.dll PROGRAMFILES = \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_COMMON_DLL) \ $(SERVER_EXE_CONFIG) BINARIES = \ $(SERVER) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Main.cs \ Server.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-server.in \ $(SERVER_EXE_CONFIG_SOURCE) REFERENCES = \ System.Runtime.Remoting \ System \ Mono.Posix DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) $(ASSEMBLY) $(ASSEMBLY).mdb \ $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) LOG4NET_DLL = $(BUILD_DIR)/log4net.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll SERVER = $(BUILD_DIR)/smuxi-server TCPEXCHANNEL_DLL = $(BUILD_DIR)/TcpExChannel.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Server/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Server/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): smuxi-server: $(top_builddir)/config.status $(srcdir)/smuxi-server.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-man \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-man1 \ install-pdf install-pdf-am install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-man uninstall-man1 \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(eval $(call emit-deploy-wrapper,SERVER,smuxi-server,x)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(eval $(call emit-deploy-target,SERVER_EXE_CONFIG)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Engine-Twitter/0000755000175000017500000000000012311344240017024 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-Twitter/Makefile.am0000644000175000017500000000202612257043746021100 0ustar00meebeymeebey00000000000000TARGET_DIR = $(top_builddir)/bin/$(PROFILE) ASSEMBLY_NAME = smuxi-engine-twitter ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll ASSEMBLY_TARGET = $(TARGET_DIR)/$(ASSEMBLY_FILENAME) #ASSEMBLY_PC = $(top_srcdir)/$(PACKAGE_NAME).pc SOURCES = $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Protocols/Twitter/TwitterProtocolManager.cs \ Protocols/Twitter/TwitterMessageBuilder.cs REFERENCES = $(LOG4NET_LIBS) \ $(SMARTIRC4NET_LIBS) \ System.Web \ System.Core DLL_REFERENCES = $(TARGET_DIR)/Twitterizer2.dll \ $(TARGET_DIR)/smuxi-common.dll \ $(TARGET_DIR)/smuxi-engine.dll SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES)) # automake magic variables EXTRA_DIST = $(SOURCES_BUILD) CLEANFILES = $(ASSEMBLY_TARGET) pkgapp_DATA = $(ASSEMBLY_TARGET) #pkgconfigdir = $(libdir)/pkgconfig #pkgconfig_DATA = $(ASSEMBLY_PC) include $(top_srcdir)/Makefile.include all: $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET): $(SOURCES) $(DLL_REFERENCES) $(MCS) $(CSC_FLAGS) $(build_references_ref) -target:library -out:$@ $(SOURCES_BUILD) smuxi-0.11/src/Engine-Twitter/AssemblyInfo.cs0000644000175000017500000000235512253423337021765 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Smuxi - Twitter support")] [assembly: AssemblyCopyright("2009-2013 (C) Mirco Bauer ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] smuxi-0.11/src/Engine-Twitter/Protocols/0000755000175000017500000000000012311344240021010 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-Twitter/Protocols/Twitter/0000755000175000017500000000000012311344240022452 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs0000644000175000017500000022164412274103742027501 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2009-2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Net; using System.Net.Security; using System.Web; using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Collections.Generic; using Twitterizer; using Twitterizer.Core; using Smuxi.Common; namespace Smuxi.Engine { public enum TwitterChatType { FriendsTimeline, Replies, DirectMessages } [ProtocolManagerInfo(Name = "Twitter", Description = "Twitter Micro-Blogging", Alias = "twitter")] public class TwitterProtocolManager : ProtocolManagerBase { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif static readonly string f_LibraryTextDomain = "smuxi-engine-twitter"; static readonly TextColor f_BlueTextColor = new TextColor(0x0000FF); OAuthTokens f_OAuthTokens; string f_RequestToken; OptionalProperties f_OptionalProperties; TwitterUser f_TwitterUser; WebProxy f_WebProxy; string f_Username; ProtocolChatModel f_ProtocolChat; Dictionary f_Friends; List f_GroupChats = new List(); GroupChatModel f_FriendsTimelineChat; AutoResetEvent f_FriendsTimelineEvent = new AutoResetEvent(false); Thread f_UpdateFriendsTimelineThread; int f_UpdateFriendsTimelineInterval = 120; decimal f_LastFriendsTimelineStatusID; DateTime f_LastFriendsUpdate; GroupChatModel f_RepliesChat; Thread f_UpdateRepliesThread; int f_UpdateRepliesInterval = 120; decimal f_LastReplyStatusID; GroupChatModel f_DirectMessagesChat; AutoResetEvent f_DirectMessageEvent = new AutoResetEvent(false); Thread f_UpdateDirectMessagesThread; int f_UpdateDirectMessagesInterval = 120; decimal f_LastDirectMessageReceivedStatusID; decimal f_LastDirectMessageSentStatusID; bool f_Listening; bool f_IsConnected; int ErrorResponseCount { get; set; } const int MaxErrorResponseCount = 3; TwitterStatus[] StatusIndex { get; set; } int StatusIndexOffset { get; set; } public override string NetworkID { get { if (f_TwitterUser == null) { return "Twitter"; } return String.Format("Twitter/{0}", f_TwitterUser.ScreenName); } } public override string Protocol { get { return "Twitter"; } } public override ChatModel Chat { get { return f_ProtocolChat; } } protected bool HasTokens { get { return f_OAuthTokens != null && f_OAuthTokens.HasConsumerToken && f_OAuthTokens.HasAccessToken; } } public TwitterProtocolManager(Session session) : base(session) { Trace.Call(session); f_FriendsTimelineChat = new GroupChatModel( TwitterChatType.FriendsTimeline.ToString(), _("Home Timeline"), this ); f_FriendsTimelineChat.InitMessageBuffer( MessageBufferPersistencyType.Volatile ); f_FriendsTimelineChat.ApplyConfig(Session.UserConfig); f_GroupChats.Add(f_FriendsTimelineChat); f_RepliesChat = new GroupChatModel( TwitterChatType.Replies.ToString(), _("Replies"), this ); f_RepliesChat.InitMessageBuffer( MessageBufferPersistencyType.Volatile ); f_RepliesChat.ApplyConfig(Session.UserConfig); f_GroupChats.Add(f_RepliesChat); f_DirectMessagesChat = new GroupChatModel( TwitterChatType.DirectMessages.ToString(), _("Direct Messages"), this ); f_DirectMessagesChat.InitMessageBuffer( MessageBufferPersistencyType.Volatile ); f_DirectMessagesChat.ApplyConfig(Session.UserConfig); f_GroupChats.Add(f_DirectMessagesChat); StatusIndex = new TwitterStatus[99]; } public override void Connect(FrontendManager fm, ServerModel server) { Trace.Call(fm, server); if (server == null) { throw new ArgumentNullException("server"); } f_Username = server.Username; var proxySettings = new ProxySettings(); proxySettings.ApplyConfig(Session.UserConfig); var twitterUrl = new OptionalProperties().APIBaseAddress; var proxy = proxySettings.GetWebProxy(twitterUrl); // HACK: Twitterizer will always use the system proxy if set to null // so explicitely override this by setting an empty proxy if (proxy == null) { f_WebProxy = new WebProxy(); } else { f_WebProxy = proxy; } f_OptionalProperties = CreateOptions(); f_ProtocolChat = new ProtocolChatModel(NetworkID, "Twitter " + f_Username, this); f_ProtocolChat.InitMessageBuffer( MessageBufferPersistencyType.Volatile ); f_ProtocolChat.ApplyConfig(Session.UserConfig); Session.AddChat(f_ProtocolChat); Session.SyncChat(f_ProtocolChat); MessageBuilder builder; if (proxy != null && proxy.Address != null) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Using proxy: {0}:{1}"), proxy.Address.Host, proxy.Address.Port); Session.AddMessageToChat(Chat, builder.ToMessage()); } if (!server.ValidateServerCertificate) { var whitelist = Session.CertificateValidator.HostnameWhitelist; lock (whitelist) { // needed for favicon if (!whitelist.Contains("www.twitter.com")) { whitelist.Add("www.twitter.com"); } if (!whitelist.Contains("api.twitter.com")) { whitelist.Add("api.twitter.com"); } } } string msgStr = _("Connecting to Twitter..."); if (fm != null) { fm.SetStatus(msgStr); } var msg = CreateMessageBuilder(). AppendEventPrefix().AppendText(msgStr).ToMessage(); Session.AddMessageToChat(Chat, msg); try { var key = GetApiKey(); f_OAuthTokens = new OAuthTokens(); f_OAuthTokens.ConsumerKey = key[0]; f_OAuthTokens.ConsumerSecret = key[1]; var password = server.Password ?? String.Empty; var access = password.Split('|'); if (access.Length == 2) { f_OAuthTokens.AccessToken = access[0]; f_OAuthTokens.AccessTokenSecret = access[1]; // verify access token var options = CreateOptions(); var response = TwitterAccount.VerifyCredentials( f_OAuthTokens, options ); if (response.Result == RequestResult.Unauthorized) { #if LOG4NET f_Logger.Warn("Connect(): Invalid access token, " + "re-authorization required"); #endif f_OAuthTokens.AccessToken = null; f_OAuthTokens.AccessTokenSecret = null; } } if (!f_OAuthTokens.HasAccessToken) { // new account or basic auth user that needs to be migrated var reqToken = OAuthUtility.GetRequestToken(key[0], key[1], "oob", f_WebProxy); f_RequestToken = reqToken.Token; var authUri = OAuthUtility.BuildAuthorizationUri(f_RequestToken); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Twitter authorization required.")); Session.AddMessageToChat(f_ProtocolChat, builder.ToMessage()); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); // TRANSLATOR: do NOT change the position of {0}! builder.AppendText( _("Please open the following URL and click " + "\"Allow\" to allow Smuxi to connect to your " + "Twitter account: {0}"), String.Empty ); Session.AddMessageToChat(f_ProtocolChat, builder.ToMessage()); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(" "); builder.AppendUrl(authUri.AbsoluteUri); Session.AddMessageToChat(f_ProtocolChat, builder.ToMessage()); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText( _("Once you have allowed Smuxi to access your " + "Twitter account, Twitter will provide a PIN.") ); Session.AddMessageToChat(f_ProtocolChat, builder.ToMessage()); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Please type: /pin PIN_FROM_TWITTER")); Session.AddMessageToChat(f_ProtocolChat, builder.ToMessage()); } } catch (Exception ex) { #if LOG4NET f_Logger.Error("Connect(): Exception", ex); #endif if (fm != null) { fm.SetStatus(_("Connection failed!")); } msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText( _("Connection failed! Reason: {0}"), ex.Message). ToMessage(); Session.AddMessageToChat(Chat, msg); return; } // twitter is sometimes pretty slow, so fetch this in the background ThreadPool.QueueUserWorkItem(delegate { try { // FIXME: replace with AutoResetEvent while (!HasTokens) { Thread.Sleep(1000); } var message = _("Fetching user details from Twitter, please wait..."); msg = CreateMessageBuilder(). AppendEventPrefix().AppendText(message).ToMessage(); Session.AddMessageToChat(Chat, msg); UpdateUser(); message = _("Finished fetching user details."); msg = CreateMessageBuilder(). AppendEventPrefix().AppendText(message).ToMessage(); Session.AddMessageToChat(Chat, msg); f_IsConnected = true; message =_("Successfully connected to Twitter."); if (fm != null) { fm.UpdateNetworkStatus(); fm.SetStatus(message); } msg = CreateMessageBuilder(). AppendEventPrefix().AppendText(message).ToMessage(); Session.AddMessageToChat(Chat, msg); f_Listening = true; f_FriendsTimelineChat.PersonCount = f_RepliesChat.PersonCount = f_DirectMessagesChat.PersonCount = (int) f_TwitterUser.NumberOfFriends; OnConnected(EventArgs.Empty); } catch (Exception ex) { var message = _("Failed to fetch user details from Twitter. Reason: "); #if LOG4NET f_Logger.Error("Connect(): " + message, ex); #endif msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText(message + ex.Message). ToMessage(); Session.AddMessageToChat(Chat, msg); if (fm != null) { fm.SetStatus(_("Connection failed!")); } msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText(_("Connection failed! Reason: {0}"), ex.Message). ToMessage(); Session.AddMessageToChat(Chat, msg); } }); ThreadPool.QueueUserWorkItem(delegate { try { // FIXME: replace with AutoResetEvent // f_TwitterUser needed for proper self detection in the // CreatePerson() method while (!HasTokens || f_TwitterUser == null) { Thread.Sleep(1000); } msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText( _("Fetching friends from Twitter, please wait...") ). ToMessage(); Session.AddMessageToChat(Chat, msg); UpdateFriends(); msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("Finished fetching friends.")). ToMessage(); Session.AddMessageToChat(Chat, msg); } catch (Exception ex) { var message = _("Failed to fetch friends from Twitter. Reason: "); #if LOG4NET f_Logger.Error("Connect(): " + message, ex); #endif msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText(message + ex.Message). ToMessage(); Session.AddMessageToChat(Chat, msg); } }); OpenFriendsTimelineChat(); OpenRepliesChat(); OpenDirectMessagesChat(); } public override void Reconnect(FrontendManager fm) { Trace.Call(fm); } public override void Disconnect(FrontendManager fm) { Trace.Call(fm); f_Listening = false; f_FriendsTimelineEvent.Set(); } public override IList FindGroupChats(GroupChatModel filter) { Trace.Call(filter); return f_GroupChats; } public override void OpenChat(FrontendManager fm, ChatModel chat) { Trace.Call(fm, chat); if (chat.ChatType == ChatType.Group) { TwitterChatType twitterChatType = (TwitterChatType) Enum.Parse(typeof(TwitterChatType), chat.ID); switch (twitterChatType) { case TwitterChatType.FriendsTimeline: OpenFriendsTimelineChat(); break; case TwitterChatType.Replies: OpenRepliesChat(); break; case TwitterChatType.DirectMessages: OpenDirectMessagesChat(); break; } return; } OpenPrivateChat(chat.ID); } private void OpenFriendsTimelineChat() { ChatModel chat = Session.GetChat( TwitterChatType.FriendsTimeline.ToString(), ChatType.Group, this ); if (chat != null) { return; } if (f_UpdateFriendsTimelineThread != null && f_UpdateFriendsTimelineThread.IsAlive) { return; } // BUG: causes a race condition as the frontend syncs the // unpopulated chat! So only add it if it's ready //Session.AddChat(f_FriendsTimelineChat); f_UpdateFriendsTimelineThread = new Thread( new ThreadStart(UpdateFriendsTimelineThread) ); f_UpdateFriendsTimelineThread.IsBackground = true; f_UpdateFriendsTimelineThread.Name = "TwitterProtocolManager friends timeline listener"; f_UpdateFriendsTimelineThread.Start(); } private void OpenRepliesChat() { ChatModel chat = Session.GetChat( TwitterChatType.Replies.ToString(), ChatType.Group, this ); if (chat != null) { return; } if (f_UpdateRepliesThread != null && f_UpdateRepliesThread.IsAlive) { return; } // BUG: causes a race condition as the frontend syncs the // unpopulated chat! So only add it if it's ready //Session.AddChat(f_RepliesChat); f_UpdateRepliesThread = new Thread( new ThreadStart(UpdateRepliesThread) ); f_UpdateRepliesThread.IsBackground = true; f_UpdateRepliesThread.Name = "TwitterProtocolManager replies listener"; f_UpdateRepliesThread.Start(); } private void OpenDirectMessagesChat() { ChatModel chat = Session.GetChat( TwitterChatType.DirectMessages.ToString(), ChatType.Group, this ); if (chat != null) { return; } if (f_UpdateDirectMessagesThread != null && f_UpdateDirectMessagesThread.IsAlive) { return; } // BUG: causes a race condition as the frontend syncs the // unpopulated chat! So only add it if it's ready //Session.AddChat(f_DirectMessagesChat); f_UpdateDirectMessagesThread = new Thread( new ThreadStart(UpdateDirectMessagesThread) ); f_UpdateDirectMessagesThread.IsBackground = true; f_UpdateDirectMessagesThread.Name = "TwitterProtocolManager direct messages listener"; f_UpdateDirectMessagesThread.Start(); } private ChatModel OpenPrivateChat(string userId) { return OpenPrivateChat(Decimal.Parse(userId)); } private ChatModel OpenPrivateChat(decimal userId) { ChatModel chat = Session.GetChat( userId.ToString(), ChatType.Person, this ); if (chat != null) { return chat; } var response = TwitterUser.Show(f_OAuthTokens, userId, f_OptionalProperties); CheckResponse(response); var user = response.ResponseObject; PersonModel person = CreatePerson(user); PersonChatModel personChat = new PersonChatModel( person, user.Id.ToString(), user.ScreenName, this ); personChat.InitMessageBuffer( MessageBufferPersistencyType.Volatile ); personChat.ApplyConfig(Session.UserConfig); Session.AddChat(personChat); Session.SyncChat(personChat); return personChat; } public override void CloseChat(FrontendManager fm, ChatModel chat) { Trace.Call(fm, chat); TwitterChatType? chatType = null; try { chatType = (TwitterChatType) Enum.Parse( typeof(TwitterChatType), chat.ID ); } catch (ArgumentException) { } if (chat.ChatType == ChatType.Group && chatType.HasValue) { switch (chatType.Value) { case TwitterChatType.FriendsTimeline: if (f_UpdateFriendsTimelineThread != null && f_UpdateFriendsTimelineThread.IsAlive) { f_UpdateFriendsTimelineThread.Abort(); } break; case TwitterChatType.Replies: if (f_UpdateRepliesThread != null && f_UpdateRepliesThread.IsAlive) { f_UpdateRepliesThread.Abort(); } break; case TwitterChatType.DirectMessages: if (f_UpdateDirectMessagesThread != null && f_UpdateDirectMessagesThread.IsAlive) { f_UpdateDirectMessagesThread.Abort(); } break; } } Session.RemoveChat(chat); } public override void SetPresenceStatus(PresenceStatus status, string message) { Trace.Call(status, message); // TODO: implement me // should we send updates here?!? } public override bool Command(CommandModel command) { bool handled = false; if (command.IsCommand) { if (f_IsConnected) { switch (command.Command) { case "msg": case "query": CommandMessage(command); handled = true; break; case "timeline": CommandTimeline(command); handled = true; break; case "follow": CommandFollow(command); handled = true; break; case "unfollow": CommandUnfollow(command); handled = true; break; case "search": case "join": CommandSearch(command); handled = true; break; case "rt": case "retweet": CommandRetweet(command); handled = true; break; case "reply": CommandReply(command); handled = true; break; } } switch (command.Command) { case "help": CommandHelp(command); handled = true; break; case "connect": CommandConnect(command); handled = true; break; case "pin": CommandPin(command); handled = true; break; } } else { if (f_IsConnected) { CommandSay(command); handled = true; } else { NotConnected(command); handled = true; } } return handled; } public override string ToString() { if (f_TwitterUser == null) { return NetworkID; } return String.Format("{0} (Twitter)", f_TwitterUser.ScreenName); } public void CommandHelp(CommandModel cd) { var builder = CreateMessageBuilder(); // TRANSLATOR: this line is used as a label / category for a // list of commands below builder.AppendHeader(_("Twitter Commands")); Session.AddMessageToFrontend(cd, builder.ToMessage()); string[] help = { "connect twitter username", "pin pin-number", "follow screen-name|user-id", "unfollow screen-name|user-id", "search keyword", "retweet/rt index-number|tweet-id", "reply index-number|tweet-id message", }; foreach (string line in help) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(line); Session.AddMessageToFrontend(cd, builder.ToMessage()); } } public void CommandConnect(CommandModel cd) { var server = new ServerModel(); if (cd.DataArray.Length >= 3) { server.Username = cd.DataArray[2]; } else { NotEnoughParameters(cd); return; } Connect(cd.FrontendManager, server); } public void CommandPin(CommandModel cd) { if (String.IsNullOrEmpty(cd.Parameter)) { NotEnoughParameters(cd); return; } var pin = cd.Parameter.Trim(); MessageBuilder builder; if (String.IsNullOrEmpty(f_RequestToken)) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("No pending authorization request!")); Session.AddMessageToChat(f_ProtocolChat, builder.ToMessage()); return; } var reqToken = f_RequestToken; f_RequestToken = null; var key = GetApiKey(); OAuthTokenResponse response; try { response = OAuthUtility.GetAccessToken(key[0], key[1], reqToken, pin, f_WebProxy); } catch (Exception ex) { #if LOG4NET f_Logger.Error("CommandPin(): GetAccessToken() threw Exception!", ex); #endif builder = CreateMessageBuilder(); builder.AppendEventPrefix(); // TRANSLATOR: {0} contains the reason of the failure builder.AppendText( _("Failed to authorize with Twitter: {0}"), ex.Message ); Session.AddMessageToChat(f_ProtocolChat, builder.ToMessage()); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText( _("Twitter did not accept your PIN. " + "Did you enter it correctly?") ); Session.AddMessageToChat(f_ProtocolChat, builder.ToMessage()); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText( _("Please retry by closing this tab and reconnecting to " + "the Twitter \"{0}\" account."), f_Username ); Session.AddMessageToChat(f_ProtocolChat, builder.ToMessage()); // allow the user to re-enter the pin // LAME: An incorrect PIN invalidates the request token! //f_RequestToken = reqToken; return; } #if LOG4NET f_Logger.Debug("CommandPin(): retrieved " + " AccessToken: " + response.Token + " AccessTokenSecret: " + response.TokenSecret + " ScreenName: " + response.ScreenName + " UserId: " + response.UserId); #endif var servers = new ServerListController(Session.UserConfig); var server = servers.GetServer(Protocol, response.ScreenName); if (server == null) { server = new ServerModel() { Protocol = Protocol, Network = String.Empty, Hostname = response.ScreenName, Username = response.ScreenName, Password = String.Format("{0}|{1}", response.Token, response.TokenSecret), OnStartupConnect = true }; servers.AddServer(server); var obsoleteServer = servers.GetServer(Protocol, String.Empty); if (obsoleteServer != null && obsoleteServer.Username.ToLower() == response.ScreenName.ToLower()) { // found an old server entry for this user using basic auth servers.RemoveServer(Protocol, String.Empty); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText( _("Migrated Twitter account from basic auth to OAuth.") ); Session.AddMessageToChat(f_ProtocolChat, builder.ToMessage()); } } else { // update token server.Password = String.Format("{0}|{1}", response.Token, response.TokenSecret); servers.SetServer(server); } servers.Save(); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Successfully authorized Twitter account " + "\"{0}\" for Smuxi"), response.ScreenName); Session.AddMessageToChat(f_ProtocolChat, builder.ToMessage()); f_OAuthTokens.AccessToken = response.Token; f_OAuthTokens.AccessTokenSecret = response.TokenSecret; f_Username = response.ScreenName; } public void CommandSay(CommandModel cmd) { if (cmd.Chat.ChatType == ChatType.Group) { TwitterChatType twitterChatType = (TwitterChatType) Enum.Parse(typeof(TwitterChatType), cmd.Chat.ID); switch (twitterChatType) { case TwitterChatType.FriendsTimeline: case TwitterChatType.Replies: { try { PostUpdate(cmd.Data); } catch (Exception ex) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText( _("Could not update status - Reason: {0}"), ex.Message). ToMessage(); Session.AddMessageToFrontend(cmd, msg); } break; } case TwitterChatType.DirectMessages: { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText( _("Cannot send message - no target specified. " + "Use: /msg $nick message")). ToMessage(); Session.AddMessageToFrontend(cmd, msg); break; } } } else if (cmd.Chat.ChatType == ChatType.Person) { try { SendMessage(cmd.Chat.Name, cmd.Data); } catch (Exception ex) { #if LOG4NET f_Logger.Error(ex); #endif var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText( _("Could not send message - Reason: {0}"), ex.Message). ToMessage(); Session.AddMessageToFrontend(cmd, msg); } } else { // ignore protocol chat } } public void CommandTimeline(CommandModel cmd) { if (cmd.DataArray.Length < 2) { NotEnoughParameters(cmd); return; } string keyword = cmd.Parameter; string[] users = cmd.Parameter.Split(','); string chatName = users.Length > 1 ? _("Other timelines") : "@" + users[0]; ChatModel chat; if (users.Length > 1) { chat = Session.CreateChat(keyword, chatName, this); } else { var userResponse = TwitterUser.Show(f_OAuthTokens, users [0], f_OptionalProperties); CheckResponse(userResponse); var person = GetPerson(userResponse.ResponseObject); chat = Session.CreatePersonChat(person, person.ID + "/timeline", chatName, this); } var statuses = new List(); foreach (var user in users) { var opts = CreateOptions(); opts.ScreenName = user; var statusCollectionResponse = TwitterTimeline.UserTimeline(f_OAuthTokens, opts); CheckResponse(statusCollectionResponse); foreach (var status in statusCollectionResponse.ResponseObject) { statuses.Add(status); } } var sortedStatuses = SortTimeline(statuses); foreach (var status in sortedStatuses) { AddIndexToStatus(status); var msg = CreateMessageBuilder(). Append(status, GetPerson(status.User)).ToMessage(); chat.MessageBuffer.Add(msg); var userId = status.User.Id.ToString(); var groupChat = chat as GroupChatModel; if (groupChat != null) { if (!groupChat.UnsafePersons.ContainsKey(userId)) { groupChat.UnsafePersons.Add(userId, GetPerson(status.User)); } } } Session.AddChat(chat); Session.SyncChat(chat); } public void CommandMessage(CommandModel cmd) { string nickname; if (cmd.DataArray.Length >= 2) { nickname = cmd.DataArray[1]; } else { NotEnoughParameters(cmd); return; } var response = TwitterUser.Show(f_OAuthTokens, nickname, f_OptionalProperties); if (response.Result != RequestResult.Success) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText(_("Could not send message - the " + "specified user does not exist.")). ToMessage(); Session.AddMessageToFrontend(cmd, msg); return; } var user = response.ResponseObject; var chat = OpenPrivateChat(user.Id); if (cmd.DataArray.Length >= 3) { string message = String.Join(" ", cmd.DataArray, 2, cmd.DataArray.Length-2); try { SendMessage(user.ScreenName, message); } catch (Exception ex) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText( _("Could not send message - Reason: {0}"), ex.Message). ToMessage(); Session.AddMessageToFrontend(cmd.FrontendManager, chat, msg); } } } public void CommandFollow(CommandModel cmd) { if (cmd.DataArray.Length < 2) { NotEnoughParameters(cmd); return; } var chat = cmd.Chat as GroupChatModel; if (chat == null) { return; } var options = CreateOptions(); options.Follow = true; decimal userId; TwitterResponse res; if (Decimal.TryParse(cmd.Parameter, out userId)) { // parameter is an ID res = TwitterFriendship.Create(f_OAuthTokens, userId, options); } else { // parameter is a screen name var screenName = cmd.Parameter; res = TwitterFriendship.Create(f_OAuthTokens, screenName, options); } CheckResponse(res); var person = CreatePerson(res.ResponseObject); if (chat.GetPerson(person.ID) == null) { Session.AddPersonToGroupChat(chat, person); } } public void CommandUnfollow(CommandModel cmd) { if (cmd.DataArray.Length < 2) { NotEnoughParameters(cmd); return; } var chat = cmd.Chat as GroupChatModel; if (chat == null) { return; } PersonModel person; var persons = chat.Persons; if (persons.TryGetValue(cmd.Parameter, out person)) { // parameter is an ID decimal userId; Decimal.TryParse(cmd.Parameter, out userId); var res = TwitterFriendship.Delete(f_OAuthTokens, userId, f_OptionalProperties); CheckResponse(res); } else { // parameter is a screen name var screenName = cmd.Parameter; person = persons.SingleOrDefault((arg) => arg.Value.IdentityName == screenName).Value; if (person == null) { return; } var res = TwitterFriendship.Delete(f_OAuthTokens, screenName, f_OptionalProperties); CheckResponse(res); } Session.RemovePersonFromGroupChat(chat, person); } public bool IsHomeTimeLine(ChatModel chatModel) { return chatModel.Equals(f_FriendsTimelineChat); } private List SortTimeline(IList timeline) { List sortedTimeline = new List( timeline ); sortedTimeline.Sort( (a, b) => (a.CreatedDate.CompareTo(b.CreatedDate)) ); return sortedTimeline; } public void CommandSearch(CommandModel cmd) { if (cmd.DataArray.Length < 2) { NotEnoughParameters(cmd); return; } var keyword = cmd.Parameter; var chatName = String.Format(_("Search {0}"), keyword); var chat = Session.CreateChat(keyword, chatName, this); Session.AddChat(chat); var options = CreateOptions(); options.Count = 50; var response = TwitterSearch.Search(f_OAuthTokens, keyword, options); CheckResponse(response); var search = response.ResponseObject; var sortedSearch = SortTimeline(search); foreach (var status in sortedSearch) { AddIndexToStatus(status); var msg = CreateMessageBuilder(). Append(status, GetPerson(status.User)). ToMessage(); chat.MessageBuffer.Add(msg); var userId = status.User.Id.ToString(); if (!chat.UnsafePersons.ContainsKey(userId)) { chat.UnsafePersons.Add(userId, GetPerson(status.User)); } } Session.SyncChat(chat); } public void CommandRetweet(CommandModel cmd) { if (cmd.DataArray.Length < 2) { NotEnoughParameters(cmd); return; } TwitterStatus status = null; int indexId; if (Int32.TryParse(cmd.Parameter, out indexId)) { status = GetStatusFromIndex(indexId); } decimal statusId; if (status == null) { if (!Decimal.TryParse(cmd.Parameter, out statusId)) { return; } } else { statusId = status.Id; } var response = TwitterStatus.Retweet(f_OAuthTokens, statusId, f_OptionalProperties); CheckResponse(response); status = response.ResponseObject; var msg = CreateMessageBuilder(). Append(status, GetPerson(status.User)). ToMessage(); Session.AddMessageToChat(f_FriendsTimelineChat, msg); } public void CommandReply(CommandModel cmd) { if (cmd.DataArray.Length < 3) { NotEnoughParameters(cmd); return; } var id = cmd.DataArray[1]; TwitterStatus status = null; int indexId; if (Int32.TryParse(id, out indexId)) { status = GetStatusFromIndex(indexId); } decimal statusId; if (status == null) { if (!Decimal.TryParse(id, out statusId)) { return; } var response = TwitterStatus.Show(f_OAuthTokens, statusId, f_OptionalProperties); CheckResponse(response); status = response.ResponseObject; } var text = String.Join(" ", cmd.DataArray.Skip(2).ToArray()); // the screen name must be somewhere in the message for replies if (!text.Contains("@" + status.User.ScreenName)) { text = String.Format("@{0} {1}", status.User.ScreenName, text); } var options = CreateOptions(); options.InReplyToStatusId = status.Id; PostUpdate(text, options); } private List SortTimeline(TwitterDirectMessageCollection timeline) { var sortedTimeline = new List(timeline.Count); foreach (TwitterDirectMessage msg in timeline) { sortedTimeline.Add(msg); } sortedTimeline.Sort( (a, b) => (a.CreatedDate.CompareTo(b.CreatedDate)) ); return sortedTimeline; } private void UpdateFriendsTimelineThread() { Trace.Call(); try { // query the timeline only after we have fetched the user and friends while (f_TwitterUser == null /*|| f_TwitterUser.IsEmpty*/ || f_Friends == null) { Thread.Sleep(1000); } // populate friend list lock (f_Friends) { foreach (PersonModel friend in f_Friends.Values) { f_FriendsTimelineChat.UnsafePersons.Add(friend.ID, friend); } } Session.AddChat(f_FriendsTimelineChat); Session.SyncChat(f_FriendsTimelineChat); while (f_Listening) { try { UpdateFriendsTimeline(); } catch (TwitterizerException ex) { CheckTwitterizerException(ex); } catch (WebException ex) { CheckWebException(ex); } // only poll once per interval or when we get fired f_FriendsTimelineEvent.WaitOne( f_UpdateFriendsTimelineInterval * 1000, false ); } } catch (ThreadAbortException) { #if LOG4NET f_Logger.Debug("UpdateFriendsTimelineThread(): thread aborted"); #endif } catch (Exception ex) { #if LOG4NET f_Logger.Error("UpdateFriendsTimelineThread(): Exception", ex); #endif var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText( _("An error occurred while fetching the friends " + "timeline from Twitter. Reason: {0}"), ex.Message). ToMessage(); Session.AddMessageToChat(Chat, msg); } finally { #if LOG4NET f_Logger.Debug("UpdateFriendsTimelineThread(): finishing thread."); #endif lock (Session.Chats) { if (Session.Chats.Contains(f_FriendsTimelineChat)) { Session.RemoveChat(f_FriendsTimelineChat); } } f_FriendsTimelineChat.UnsafePersons.Clear(); } } private void UpdateFriendsTimeline() { Trace.Call(); #if LOG4NET f_Logger.Debug("UpdateFriendsTimeline(): getting friend timeline from twitter..."); #endif var options = CreateOptions(); options.SinceStatusId = f_LastFriendsTimelineStatusID; options.Count = 50; var response = TwitterTimeline.HomeTimeline(f_OAuthTokens, options); // ignore temporarily issues if (IsTemporilyErrorResponse(response)) { return; } CheckResponse(response); var timeline = response.ResponseObject; #if LOG4NET f_Logger.Debug("UpdateFriendsTimeline(): done. New tweets: " + timeline.Count); #endif if (timeline.Count == 0) { return; } List sortedTimeline = SortTimeline(timeline); foreach (TwitterStatus status in sortedTimeline) { AddIndexToStatus(status); var msg = CreateMessageBuilder(). Append(status, GetPerson(status.User)). ToMessage(); Session.AddMessageToChat(f_FriendsTimelineChat, msg); if (status.User.Id.ToString() == Me.ID) { OnMessageSent( new MessageEventArgs(f_FriendsTimelineChat, msg, null, status.InReplyToScreenName ?? String.Empty) ); } else { OnMessageReceived( new MessageEventArgs(f_FriendsTimelineChat, msg, status.User.ScreenName, status.InReplyToScreenName ?? String.Empty) ); } f_LastFriendsTimelineStatusID = status.Id; } } private void UpdateRepliesThread() { Trace.Call(); try { // query the replies only after we have fetched the user and friends while (f_TwitterUser == null /*|| f_TwitterUser.IsEmpty*/ || f_Friends == null) { Thread.Sleep(1000); } // populate friend list lock (f_Friends) { foreach (PersonModel friend in f_Friends.Values) { f_RepliesChat.UnsafePersons.Add(friend.ID, friend); } } Session.AddChat(f_RepliesChat); Session.SyncChat(f_RepliesChat); while (f_Listening) { try { UpdateReplies(); } catch (TwitterizerException ex) { CheckTwitterizerException(ex); } catch (WebException ex) { CheckWebException(ex); } // only poll once per interval Thread.Sleep(f_UpdateRepliesInterval * 1000); } } catch (ThreadAbortException) { #if LOG4NET f_Logger.Debug("UpdateRepliesThread(): thread aborted"); #endif } catch (Exception ex) { #if LOG4NET f_Logger.Error("UpdateRepliesThread(): Exception", ex); #endif var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText( _("An error occurred while fetching the replies " + "from Twitter. Reason: {0}"), ex.Message). ToMessage(); Session.AddMessageToChat(Chat, msg); } finally { #if LOG4NET f_Logger.Debug("UpdateRepliesThread(): finishing thread."); #endif lock (Session.Chats) { if (Session.Chats.Contains(f_RepliesChat)) { Session.RemoveChat(f_RepliesChat); } } f_RepliesChat.UnsafePersons.Clear(); } } private void UpdateReplies() { Trace.Call(); #if LOG4NET f_Logger.Debug("UpdateReplies(): getting replies from twitter..."); #endif var options = CreateOptions(); options.SinceStatusId = f_LastReplyStatusID; var response = TwitterTimeline.Mentions(f_OAuthTokens, options); // ignore temporarily issues if (IsTemporilyErrorResponse(response)) { return; } CheckResponse(response); var timeline = response.ResponseObject; #if LOG4NET f_Logger.Debug("UpdateReplies(): done. New replies: " + timeline.Count); #endif if (timeline.Count == 0) { return; } // if this isn't the first time we receive replies, this is new! bool highlight = f_LastReplyStatusID != 0; List sortedTimeline = SortTimeline(timeline); foreach (TwitterStatus status in sortedTimeline) { AddIndexToStatus(status); var msg = CreateMessageBuilder(). Append(status, GetPerson(status.User), highlight). ToMessage(); Session.AddMessageToChat(f_RepliesChat, msg); OnMessageReceived( new MessageEventArgs(f_RepliesChat, msg, status.User.ScreenName, status.InReplyToScreenName ?? String.Empty) ); f_LastReplyStatusID = status.Id; } } private void UpdateDirectMessagesThread() { Trace.Call(); try { // query the messages only after we have fetched the user and friends while (f_TwitterUser == null || f_Friends == null) { Thread.Sleep(1000); } // populate friend list lock (f_Friends) { foreach (PersonModel friend in f_Friends.Values) { f_DirectMessagesChat.UnsafePersons.Add(friend.ID, friend); } } Session.AddChat(f_DirectMessagesChat); Session.SyncChat(f_DirectMessagesChat); while (f_Listening) { try { UpdateDirectMessages(); } catch (TwitterizerException ex) { CheckTwitterizerException(ex); } catch (WebException ex) { CheckWebException(ex); } // only poll once per interval or when we get fired f_DirectMessageEvent.WaitOne( f_UpdateDirectMessagesInterval * 1000, false ); } } catch (ThreadAbortException) { #if LOG4NET f_Logger.Debug("UpdateDirectMessagesThread(): thread aborted"); #endif } catch (Exception ex) { #if LOG4NET f_Logger.Error("UpdateDirectMessagesThread(): Exception", ex); #endif var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText( _("An error occurred while fetching direct messages " + "from Twitter. Reason: {0}"), ex.Message). ToMessage(); Session.AddMessageToChat(Chat, msg); } finally { #if LOG4NET f_Logger.Debug("UpdateDirectMessagesThread(): finishing thread."); #endif lock (Session.Chats) { if (Session.Chats.Contains(f_DirectMessagesChat)) { Session.RemoveChat(f_DirectMessagesChat); } } f_DirectMessagesChat.UnsafePersons.Clear(); } } private void UpdateDirectMessages() { Trace.Call(); #if LOG4NET f_Logger.Debug("UpdateDirectMessages(): getting received direct messages from twitter..."); #endif var options = CreateOptions(); options.SinceStatusId = f_LastDirectMessageReceivedStatusID; options.Count = 50; var response = TwitterDirectMessage.DirectMessages( f_OAuthTokens, options ); // ignore temporarily issues if (IsTemporilyErrorResponse(response)) { return; } CheckResponse(response); var receivedTimeline = response.ResponseObject; #if LOG4NET f_Logger.Debug("UpdateDirectMessages(): done. New messages: " + (receivedTimeline == null ? 0 : receivedTimeline.Count)); #endif #if LOG4NET f_Logger.Debug("UpdateDirectMessages(): getting sent direct messages from twitter..."); #endif var sentOptions = CreateOptions(); sentOptions.SinceStatusId = f_LastDirectMessageSentStatusID; sentOptions.Count = 50; response = TwitterDirectMessage.DirectMessagesSent( f_OAuthTokens, sentOptions ); // ignore temporarily issues if (IsTemporilyErrorResponse(response)) { return; } CheckResponse(response); var sentTimeline = response.ResponseObject; #if LOG4NET f_Logger.Debug("UpdateDirectMessages(): done. New messages: " + (sentTimeline == null ? 0 : sentTimeline.Count)); #endif var timeline = new TwitterDirectMessageCollection(); if (receivedTimeline != null) { foreach (TwitterDirectMessage msg in receivedTimeline) { timeline.Add(msg); } } if (sentTimeline != null) { foreach (TwitterDirectMessage msg in sentTimeline) { timeline.Add(msg); } } if (timeline.Count == 0) { // nothing to do return; } var sortedTimeline = SortTimeline(timeline); foreach (TwitterDirectMessage directMsg in sortedTimeline) { // if this isn't the first time a receive a direct message, // this is a new one! bool highlight = receivedTimeline.Contains(directMsg) && f_LastDirectMessageReceivedStatusID != 0; var msg = CreateMessageBuilder(). Append(directMsg, GetPerson(directMsg.Sender), highlight). ToMessage(); Session.AddMessageToChat(f_DirectMessagesChat, msg); // if there is a tab open for this user put the message there too string userId; if (receivedTimeline.Contains(directMsg)) { // this is a received message userId = directMsg.SenderId.ToString(); OnMessageReceived( new MessageEventArgs(f_DirectMessagesChat, msg, directMsg.SenderScreenName, null) ); } else { // this is a sent message userId = directMsg.RecipientId.ToString(); OnMessageSent( new MessageEventArgs(f_DirectMessagesChat, msg, null, directMsg.RecipientScreenName) ); } ChatModel chat = Session.GetChat( userId, ChatType.Person, this ); if (chat != null) { Session.AddMessageToChat(chat, msg); } } if (receivedTimeline != null) { // first one is the newest foreach (TwitterDirectMessage msg in receivedTimeline) { f_LastDirectMessageReceivedStatusID = msg.Id; break; } } if (sentTimeline != null) { // first one is the newest foreach (TwitterDirectMessage msg in sentTimeline) { f_LastDirectMessageSentStatusID = msg.Id; break; } } } private void UpdateFriends() { Trace.Call(); if (f_Friends != null) { return; } #if LOG4NET f_Logger.Debug("UpdateFriends(): fetching friend IDs from twitter..."); #endif var options = CreateOptions(); options.UserId = f_TwitterUser.Id; var response = TwitterFriendship.FriendsIds( f_OAuthTokens, options ); CheckResponse(response); var friendIds = response.ResponseObject; #if LOG4NET f_Logger.Debug("UpdateFriends(): done. Fetched IDs: " + friendIds.Count); #endif var persons = new Dictionary(friendIds.Count); // users/lookup only permits 100 users per call var pageSize = 100; var idList = new List(friendIds); var idPages = new List>(); for (int offset = 0; offset < idList.Count; offset += pageSize) { var count = Math.Min(pageSize, idList.Count - offset); idPages.Add(idList.GetRange(offset, count)); } foreach (var idPage in idPages) { #if LOG4NET f_Logger.Debug("UpdateFriends(): fetching friends from twitter..."); #endif var userIds = new TwitterIdCollection(idPage); var lookupOptions = CreateOptions(); lookupOptions.UserIds = userIds; var lookupResponse = TwitterUser.Lookup(f_OAuthTokens, lookupOptions); CheckResponse(lookupResponse); var friends = lookupResponse.ResponseObject; #if LOG4NET f_Logger.Debug("UpdateFriends(): done. Fetched friends: " + friends.Count); #endif foreach (var friend in friends) { var person = CreatePerson(friend); persons.Add(person.ID, person); } } f_Friends = persons; } private void UpdateUser() { #if LOG4NET f_Logger.Debug("UpdateUser(): getting user details from twitter..."); #endif var response = TwitterUser.Show(f_OAuthTokens, f_Username, f_OptionalProperties); CheckResponse(response); var user = response.ResponseObject; f_TwitterUser = user; Me = CreatePerson(f_TwitterUser); #if LOG4NET f_Logger.Debug("UpdateUser(): done."); #endif } protected new TwitterMessageBuilder CreateMessageBuilder() { return CreateMessageBuilder(); } private T CreateOptions() where T : OptionalProperties, new() { var options = new T() { Proxy = f_WebProxy }; return options; } void PostUpdate(string text) { PostUpdate(text, null); } void PostUpdate(string text, StatusUpdateOptions options) { if (options == null) { options = CreateOptions(); } var res = TwitterStatus.Update(f_OAuthTokens, text, options); CheckResponse(res); f_FriendsTimelineEvent.Set(); } private void SendMessage(string target, string text) { var res = TwitterDirectMessage.Send(f_OAuthTokens, target, text, f_OptionalProperties); CheckResponse(res); f_DirectMessageEvent.Set(); } void AddIndexToStatus(TwitterStatus status) { lock (StatusIndex) { var slot = ++StatusIndexOffset; if (slot > StatusIndex.Length) { StatusIndexOffset = 1; slot = 1; } StatusIndex[slot - 1] = status; status.Text = String.Format("[{0:00}] {1}", slot, status.Text); var rtStatus = status.RetweetedStatus; if (rtStatus != null) { rtStatus.Text = String.Format("[{0:00}] {1}", slot, rtStatus.Text); } } } TwitterStatus GetStatusFromIndex(int slot) { lock (StatusIndex) { if (slot > StatusIndex.Length || slot < 1) { return null; } return StatusIndex[slot - 1]; } } private void CheckTwitterizerException(TwitterizerException exception) { Trace.Call(exception == null ? null : exception.GetType()); if (exception.InnerException is WebException) { CheckWebException((WebException) exception.InnerException); return; } else if (exception.InnerException != null) { #if LOG4NET f_Logger.Warn("CheckTwitterizerException(): unknown inner exception: " + exception.InnerException.GetType(), exception.InnerException); #endif } throw exception; } private void CheckWebException(WebException exception) { Trace.Call(exception == null ? null : exception.GetType()); switch (exception.Status) { case WebExceptionStatus.ConnectFailure: case WebExceptionStatus.ConnectionClosed: case WebExceptionStatus.Timeout: case WebExceptionStatus.ReceiveFailure: case WebExceptionStatus.NameResolutionFailure: case WebExceptionStatus.ProxyNameResolutionFailure: // ignore temporarly issues #if LOG4NET f_Logger.Warn("CheckWebException(): ignored exception", exception); #endif return; } /* http://apiwiki.twitter.com/HTTP-Response-Codes-and-Errors * 200 OK: Success! * 304 Not Modified: There was no new data to return. * 400 Bad Request: The request was invalid. An accompanying error * message will explain why. This is the status code will be * returned during rate limiting. * 401 Unauthorized: Authentication credentials were missing or * incorrect. * 403 Forbidden: The request is understood, but it has been * refused. An accompanying error message will explain why. * This code is used when requests are being denied due to * update limits. * 404 Not Found: The URI requested is invalid or the resource * requested, such as a user, does not exists. * 406 Not Acceptable: Returned by the Search API when an invalid * format is specified in the request. * 500 Internal Server Error: Something is broken. Please post to * the group so the Twitter team can investigate. * 502 Bad Gateway: Twitter is down or being upgraded. * 503 Service Unavailable: The Twitter servers are up, but * overloaded with requests. Try again later. The search and * trend methods use this to indicate when you are being rate * limited. */ HttpWebResponse httpRes = exception.Response as HttpWebResponse; if (httpRes == null) { throw exception; } switch (httpRes.StatusCode) { case HttpStatusCode.BadGateway: case HttpStatusCode.BadRequest: case HttpStatusCode.Forbidden: case HttpStatusCode.ServiceUnavailable: case HttpStatusCode.GatewayTimeout: // ignore temporarly issues #if LOG4NET f_Logger.Warn("CheckWebException(): ignored exception", exception); #endif return; default: #if LOG4NET f_Logger.Error("CheckWebException(): " + "Status: " + exception.Status + " " + "ResponseUri: " + exception.Response.ResponseUri); #endif throw exception; } } private void CheckResponse(TwitterResponse response) where T : ITwitterObject { if (response == null) { throw new ArgumentNullException("response"); } if (response.Result == RequestResult.Success) { return; } #if LOG4NET f_Logger.Error("CheckResponse(): " + "RequestUrl: " + response.RequestUrl + " " + "Result: " + response.Result + " " + "Content:\n" + response.Content); #endif // HACK: Twitter returns HTML code saying they are overloaded o_O if (response.Result == RequestResult.Unknown && response.ErrorMessage == null) { response.ErrorMessage = _("Twitter didn't send a valid response, they're probably overloaded"); } throw new TwitterizerException(response.ErrorMessage); } private bool IsTemporilyErrorResponse(TwitterResponse response) where T : ITwitterObject { if (response == null) { throw new ArgumentNullException("response"); } switch (response.Result) { case RequestResult.Success: // no error at all ErrorResponseCount = 0; return false; case RequestResult.ConnectionFailure: case RequestResult.RateLimited: case RequestResult.TwitterIsDown: case RequestResult.TwitterIsOverloaded: // probably "Twitter is over capacity" case RequestResult.Unknown: #if LOG4NET f_Logger.Debug("IsTemporilyErrorResponse(): " + "Detected temporily error " + "RequestUrl: " + response.RequestUrl + " " + "Result: " + response.Result + " " + "Content:\n" + response.Content); #endif return true; } if (ErrorResponseCount++ < MaxErrorResponseCount) { #if LOG4NET f_Logger.WarnFormat( "IsTemporilyErrorResponse(): Ignoring permanent error " + "({0}/{1}) " + "RequestUrl: {2} " + "Result: {3} " + "Content:\n{4}", ErrorResponseCount, MaxErrorResponseCount, response.RequestUrl, response.Result, response.Content ); #endif return true; } #if LOG4NET f_Logger.ErrorFormat( "IsTemporilyErrorResponse(): Detected permanent error " + "RequestUrl: {0} Result: {1} " + "Content:\n{2}", response.RequestUrl, response.Result, response.Content ); #endif return false; } private PersonModel GetPerson(TwitterUser user) { if (user == null) { throw new ArgumentNullException("user"); } PersonModel person; if (!f_Friends.TryGetValue(user.Id.ToString(), out person)) { return CreatePerson(user); } return person; } private PersonModel CreatePerson(decimal userId) { var res = TwitterUser.Show(f_OAuthTokens, userId, f_OptionalProperties); CheckResponse(res); var user = res.ResponseObject; return CreatePerson(user); } private PersonModel CreatePerson(TwitterUser user) { if (user == null) { throw new ArgumentNullException("user"); } var person = new PersonModel( user.Id.ToString(), user.ScreenName, NetworkID, Protocol, this ); if (f_TwitterUser != null && f_TwitterUser.ScreenName == user.ScreenName) { person.IdentityNameColored.ForegroundColor = f_BlueTextColor; person.IdentityNameColored.BackgroundColor = TextColor.None; person.IdentityNameColored.Bold = true; } return person; } protected override T CreateMessageBuilder() { var builder = new TwitterMessageBuilder(); builder.ApplyConfig(Session.UserConfig); return (T)(object) builder; } private string[] GetApiKey() { var key = Defines.TwitterApiKey.Split('|'); if (key.Length != 2) { throw new InvalidOperationException("Invalid Twitter API key!"); } return key; } private static string _(string msg) { return LibraryCatalog.GetString(msg, f_LibraryTextDomain); } } } smuxi-0.11/src/Engine-Twitter/Protocols/Twitter/TwitterMessageBuilder.cs0000644000175000017500000000625312257043746027305 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010, 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Web; using System.Text; using Twitterizer; namespace Smuxi.Engine { public class TwitterMessageBuilder : MessageBuilder { public TwitterMessageBuilder Append(TwitterStatus status, ContactModel sender, bool isHighlight) { if (status == null) { throw new ArgumentNullException("status"); } if (sender == null) { throw new ArgumentNullException("sender"); } // MessageModel serializer expects UTC values TimeStamp = status.CreatedDate.ToUniversalTime(); AppendSenderPrefix(sender, isHighlight); // LAME: Twitter lies in the truncated field and says it's not // truncated while it is, thus always use retweet_status if // available if (status.RetweetedStatus != null) { var text = String.Format( "RT @{0}: {1}", status.RetweetedStatus.User.ScreenName, status.RetweetedStatus.Text ); AppendMessage(text); } else { AppendMessage(status.Text); } return this; } public TwitterMessageBuilder Append(TwitterStatus status, ContactModel sender) { return Append(status, sender, false); } public TwitterMessageBuilder Append(TwitterDirectMessage status, ContactModel sender, bool isHighlight) { if (status == null) { throw new ArgumentNullException("status"); } if (sender == null) { throw new ArgumentNullException("sender"); } // MessageModel serializer expects UTC values TimeStamp = status.CreatedDate.ToUniversalTime(); AppendSenderPrefix(sender, isHighlight); AppendMessage(status.Text); return this; } public override MessageBuilder AppendMessage(string msg) { msg = NormalizeNewlines(msg); return base.AppendMessage(HttpUtility.HtmlDecode(msg)); } } } smuxi-0.11/src/Engine-Twitter/Makefile.in0000644000175000017500000010272112311344230021073 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am subdir = src/Engine-Twitter ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(pkgapp_DATA) $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ TARGET_DIR = $(top_builddir)/bin/$(PROFILE) ASSEMBLY_NAME = smuxi-engine-twitter ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll ASSEMBLY_TARGET = $(TARGET_DIR)/$(ASSEMBLY_FILENAME) #ASSEMBLY_PC = $(top_srcdir)/$(PACKAGE_NAME).pc SOURCES = $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Protocols/Twitter/TwitterProtocolManager.cs \ Protocols/Twitter/TwitterMessageBuilder.cs REFERENCES = $(LOG4NET_LIBS) \ $(SMARTIRC4NET_LIBS) \ System.Web \ System.Core DLL_REFERENCES = $(TARGET_DIR)/Twitterizer2.dll \ $(TARGET_DIR)/smuxi-common.dll \ $(TARGET_DIR)/smuxi-engine.dll SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES)) # automake magic variables EXTRA_DIST = $(SOURCES_BUILD) $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) CLEANFILES = $(ASSEMBLY_TARGET) $(ASSEMBLY) $(ASSEMBLY).mdb \ $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) pkgapp_DATA = $(ASSEMBLY_TARGET) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Engine-Twitter/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Engine-Twitter/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-pkgappDATA: $(pkgapp_DATA) @$(NORMAL_INSTALL) @list='$(pkgapp_DATA)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgappdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgappdir)" || exit $$?; \ done uninstall-pkgappDATA: @$(NORMAL_UNINSTALL) @list='$(pkgapp_DATA)'; test -n "$(pkgappdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappDATA \ install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappDATA \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappDATA \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) #pkgconfigdir = $(libdir)/pkgconfig #pkgconfig_DATA = $(ASSEMBLY_PC) all: $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET): $(SOURCES) $(DLL_REFERENCES) $(MCS) $(CSC_FLAGS) $(build_references_ref) -target:library -out:$@ $(SOURCES_BUILD) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Frontend-Test/0000755000175000017500000000000012311344241016654 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-Test/Main.cs0000644000175000017500000000275011655545675020123 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.FrontendTest { public class MainClass { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public static void Main(string[] args) { #if LOG4NET log4net.Config.BasicConfigurator.Configure(); #endif try { Frontend.Init(args); } catch (Exception e) { #if LOG4NET _Logger.Fatal(e); #endif throw; } } } } smuxi-0.11/src/Frontend-Test/Frontend.cs0000644000175000017500000001520011655545675021010 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Http; using System.Runtime.Remoting.Channels.Tcp; using System.Runtime.Serialization.Formatters; using Smuxi; using Smuxi.Frontend; using Smuxi.Engine; namespace Smuxi.FrontendTest { public class Frontend { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public const char Escape = (char)27; private static FrontendManager _FrontendManager; private static FrontendConfig _FrontendConfig; private static Session _Session; private static UserConfig _UserConfig; public static FrontendConfig FrontendConfig { get { return _FrontendConfig; } } public static FrontendManager FrontendManager { get { return _FrontendManager; } } public static Session Session { get { return _Session; } } public static UserConfig UserConfig { get { return _UserConfig; } } public static void Init(string[] args) { System.Threading.Thread.CurrentThread.Name = "Main"; if (!(args.Length >= 1)) { Console.Error.WriteLine("Usage: smuxi-test.exe profile"); Environment.Exit(1); } #if LOG4NET _Logger.Info("smuxi-test starting"); #endif _FrontendConfig = new FrontendConfig("Test"); _FrontendConfig.Load(); string profile = args[0]; if (String.IsNullOrEmpty(profile)) { Console.Error.WriteLine("profile parameter must not be empty!"); Environment.Exit(1); } IFrontendUI ui = new TestUI(); Session session = null; if (profile == "local") { Engine.Engine.Init(); session = new Engine.Session(Engine.Engine.Config, Engine.Engine.ProtocolManagerFactory, "local"); session.RegisterFrontendUI(ui); } else { // remote engine EngineManager engineManager = new EngineManager(_FrontendConfig, ui); engineManager.Connect(profile); session = engineManager.Session; } if (session == null) { Console.Error.WriteLine("Session is null, something went wrong setting up or connecting to the engine!"); Environment.Exit(1); } _Session = session; _UserConfig = session.UserConfig; _FrontendManager = session.GetFrontendManager(ui); _FrontendManager.Sync(); if (_UserConfig.IsCaching) { // when our UserConfig is cached, we need to invalidate the cache _FrontendManager.ConfigChangedDelegate = new SimpleDelegate(_UserConfig.ClearCache); } while (true) { string line = Console.ReadLine(); // TODO: remove the entered line from output //Console.WriteLine(Escape+"M"); _ExecuteCommand(line); } } public static void _ExecuteCommand(string cmd) { bool handled = false; CommandModel cd = new CommandModel(_FrontendManager, _FrontendManager.CurrentChat, (string)_UserConfig["Interface/Entry/CommandCharacter"], cmd); if (cd.IsCommand) { switch (cd.Command) { case "window": bool found = false; lock (_Session.Chats) { foreach (ChatModel chatModel in _Session.Chats) { if (chatModel.Name.ToLower() == cd.Parameter.ToLower()) { found = true; ChangeActiveChat(chatModel); break; } } } if (!found) { Console.WriteLine("-!- Unknown page: "+cd.Parameter); } handled = true; break; case "quit": Environment.Exit(0); handled = true; break; } } if (!handled) { handled = _Session.Command(cd); } if (!handled) { // we may have no network manager yet if (_FrontendManager.CurrentProtocolManager != null) { handled = _FrontendManager.CurrentProtocolManager.Command(cd); } else { handled = true; } } if (!handled) { Console.WriteLine("-!- Unknown command"); } } public static void ChangeActiveChat(ChatModel chatModel) { Console.WriteLine("Active chat: "+chatModel.Name); _FrontendManager.CurrentChat = chatModel; } } } smuxi-0.11/src/Frontend-Test/TestUI.cs0000644000175000017500000000774611655545675020426 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.FrontendTest { public class TestUI : PermanentRemoteObject, IFrontendUI { private int _Version = 0; public int Version { get { return _Version; } } public void AddChat(ChatModel page) { Trace.Call(page); Console.WriteLine("New page: "+page.Name+ " type: "+page.ChatType); Frontend.ChangeActiveChat(page); } public void AddMessageToChat(ChatModel page, MessageModel msg) { Trace.Call(page, msg); string finalMsg = String.Empty; foreach (MessagePartModel msgPart in msg.MessageParts) { // TODO: implement other types if (msgPart is TextMessagePartModel) { TextMessagePartModel fmsgti = (TextMessagePartModel) msgPart; finalMsg += fmsgti.Text; } } string timestamp; try { timestamp = msg.TimeStamp.ToLocalTime().ToString((string)Frontend.UserConfig["Interface/Notebook/TimestampFormat"]); } catch (FormatException e) { timestamp = "Timestamp Format ERROR: " + e.Message; } finalMsg = timestamp + " " + page.Name + " " + finalMsg; Console.WriteLine(finalMsg); } public void RemoveChat(ChatModel page) { Trace.Call(page); Console.WriteLine("Removed page: "+page.Name+" type: "+page.ChatType); } public void EnableChat(ChatModel page) { Trace.Call(page); } public void DisableChat(ChatModel page) { Trace.Call(page); } public void SyncChat(ChatModel page) { Trace.Call(page); Console.WriteLine("Synced page: "+page.Name+" type: "+page.ChatType); Frontend.FrontendManager.AddSyncedChat(page); } public void AddPersonToGroupChat(GroupChatModel cpage, PersonModel user) { Trace.Call(cpage, user); } public void UpdatePersonInGroupChat(GroupChatModel cpage, PersonModel olduser, PersonModel newuser) { Trace.Call(cpage, olduser, newuser); } public void UpdateTopicInGroupChat(GroupChatModel cpage, MessageModel topic) { Trace.Call(cpage, topic); Console.WriteLine("Topic changed to: " + topic.ToString() + " on " + cpage.Name); } public void RemovePersonFromGroupChat(GroupChatModel cpage, PersonModel user) { Trace.Call(cpage, user); } public void SetNetworkStatus(string status) { Trace.Call(status); } public void SetStatus(string status) { Trace.Call(status); } } } smuxi-0.11/src/Frontend-Test/ChangeLog0000644000175000017500000000167311655545675020465 0ustar00meebeymeebey000000000000002008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-09-14 Mirco Bauer * TestUI.cs: Fixed SyncChat(). Fixed AddMessageToChat(): 2008-09-14 Mirco Bauer * Frontend.cs, Frontend-Test.mdp: Refactored Frontend-Test to use the EngineManager class of the Frontend library instead of homebrew code. 2008-07-27 Mirco Bauer * Frontend-Test.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 2008-01-31 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * Frontend-Test.mdp: Updated using MonoDevelop 0.18.1 smuxi-0.11/src/Frontend-Test/Makefile.am0000644000175000017500000000601211655545675020737 0ustar00meebeymeebey00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG ASSEMBLY = ../../bin/release/smuxi-frontend-test.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = exe PROJECT_REFERENCES = \ ../../bin/release/smuxi-engine.dll \ ../../bin/release/smuxi-common.dll \ ../../bin/release/smuxi-frontend.dll BUILD_DIR = ../../bin/release LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_MDB= NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/release/smuxi-engine.dll SMUXI_COMMON_DLL_SOURCE=../../bin/release/smuxi-common.dll endif if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" ASSEMBLY = ../../bin/debug/smuxi-frontend-test.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = exe PROJECT_REFERENCES = \ ../../bin/debug/smuxi-engine.dll \ ../../bin/debug/smuxi-common.dll \ ../../bin/debug/smuxi-frontend.dll BUILD_DIR = ../../bin/debug LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/debug/smuxi-engine.dll SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll endif AL=al2 SATELLITE_ASSEMBLY_NAME=.resources.dll PROGRAMFILES = \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_COMMON_DLL) BINARIES = \ $(FRONTEND_TEST) all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Frontend.cs \ Main.cs \ TestUI.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-frontend-test.in REFERENCES = \ System.Runtime.Remoting \ $(LOG4NET_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) include $(top_srcdir)/Makefile.include LOG4NET_DLL = $(BUILD_DIR)/log4net.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll FRONTEND_TEST = $(BUILD_DIR)/smuxi-frontend-test SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll $(eval $(call emit-deploy-target,LOG4NET_DLL)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,NINI_DLL)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-wrapper,FRONTEND_TEST,smuxi-frontend-test,x)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) smuxi-0.11/src/Frontend-Test/AssemblyInfo.cs0000644000175000017500000000225411655545675021631 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Smuxi - Test frontend")] [assembly: AssemblyCopyright("2005-2008 (C) Mirco Bauer ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] smuxi-0.11/src/Frontend-Test/smuxi-frontend-test.in0000644000175000017500000000012011655545675023164 0ustar00meebeymeebey00000000000000#!/bin/sh exec mono "@expanded_libdir@/@PACKAGE@/smuxi-frontend-test.exe" "$@" smuxi-0.11/src/Frontend-Test/Makefile.in0000644000175000017500000010246712311344230020731 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/smuxi-frontend-test.in \ ChangeLog subdir = src/Frontend-Test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = smuxi-frontend-test CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ # Warning: This is an automatically generated file, do not edit! @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/debug/smuxi-frontend-test.exe @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/release/smuxi-frontend-test.exe @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_DEBUG_TRUE@COMPILE_TARGET = exe @ENABLE_RELEASE_TRUE@COMPILE_TARGET = exe @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-engine.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-common.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-frontend.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-engine.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-common.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-frontend.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin/debug @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin/release @ENABLE_DEBUG_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_RELEASE_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB = $(BUILD_DIR)/smuxi-engine.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_MDB = @ENABLE_DEBUG_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_RELEASE_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/debug/smuxi-engine.dll @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/release/smuxi-engine.dll @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/release/smuxi-common.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB_SOURCE = ../../bin/debug/smuxi-engine.dll.mdb AL = al2 SATELLITE_ASSEMBLY_NAME = .resources.dll PROGRAMFILES = \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_COMMON_DLL) BINARIES = \ $(FRONTEND_TEST) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Frontend.cs \ Main.cs \ TestUI.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-frontend-test.in REFERENCES = \ System.Runtime.Remoting \ $(LOG4NET_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) $(ASSEMBLY) $(ASSEMBLY).mdb \ $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) LOG4NET_DLL = $(BUILD_DIR)/log4net.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll FRONTEND_TEST = $(BUILD_DIR)/smuxi-frontend-test SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Frontend-Test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Frontend-Test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): smuxi-frontend-test: $(top_builddir)/config.status $(srcdir)/smuxi-frontend-test.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(eval $(call emit-deploy-target,LOG4NET_DLL)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,NINI_DLL)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-wrapper,FRONTEND_TEST,smuxi-frontend-test,x)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Common/0000755000175000017500000000000012311344240015407 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Common/Pattern.cs0000644000175000017500000000550511655545675017411 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Text.RegularExpressions; namespace Smuxi.Common { public static class Pattern { public static bool IsMatch(string input, string pattern) { if (input == null) { throw new ArgumentNullException("input"); } if (pattern == null) { throw new ArgumentNullException("pattern"); } // regex matching if (pattern.StartsWith("/") && pattern.EndsWith("/")) { var regexPattern = pattern.Substring(1, pattern.Length - 2); return Regex.IsMatch(input, regexPattern); } // globbing if (pattern.Length == 0 && input.Length == 0) { return true; } if (pattern == "*") { return true; } if (pattern.StartsWith("*") && pattern.EndsWith("*")) { string globPattern = pattern.Substring(1, pattern.Length - 2); return input.Contains(globPattern); } if (pattern.StartsWith("*")) { string globPattern = pattern.Substring(1); return input.EndsWith(globPattern); } if (pattern.EndsWith("*")) { string globPattern = pattern.Substring(0, pattern.Length - 1); return input.StartsWith(globPattern); } // exact matching return input == pattern; } public static bool ContainsPatternCharacters(string input) { if (input == null) { throw new ArgumentNullException("input"); } if (input.Length == 0) { return false; } return input.StartsWith("*") || input.EndsWith("*") || (input.Length >= 2 && input.StartsWith("/") && input.EndsWith("/")); } } } smuxi-0.11/src/Common/IOSecurity.cs0000644000175000017500000000647011700531605020010 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.IO; namespace Smuxi.Common { public static class IOSecurity { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public static string GetFilteredPath(string path) { if (path == null) { throw new ArgumentNullException("path"); } if (path.Trim().Length == 0) { throw new ArgumentException("Argument must not be empty.", "path"); } if (path.IndexOfAny(Path.GetInvalidPathChars()) != -1) { #if LOG4NET f_Logger.Debug( "GetFilteredPath(): path: '" + path + "' contains invalid chars, removing them!" ); #endif // remove invalid chars foreach (char invalidChar in Path.GetInvalidPathChars()) { path = path.Replace(invalidChar.ToString(), String.Empty); } } return path; } public static string GetFilteredFileName(string fileName) { return GetFilteredFileName(fileName, true); } public static string GetFilteredFileName(string fileName, bool filterSpaces) { if (fileName == null) { throw new ArgumentNullException("fileName"); } if (fileName.Trim().Length == 0) { throw new ArgumentException("Argument must not be empty.", "fileName"); } if (filterSpaces) { fileName = fileName.Replace(" ", "_"); } if (fileName.IndexOfAny(Path.GetInvalidFileNameChars()) != -1) { #if LOG4NET f_Logger.Debug( "GetValidFilename(): filename: '" + fileName + "' contains " + "invalid chars, removing them!" ); #endif // remove invalid chars foreach (char invalidChar in Path.GetInvalidFileNameChars()) { fileName = fileName.Replace(invalidChar.ToString(), String.Empty); } } fileName = fileName.Replace("..", String.Empty); return fileName; } } } smuxi-0.11/src/Common/NDesk.Options.cs0000644000175000017500000007665512274103742020427 0ustar00meebeymeebey00000000000000// // Options.cs // // Authors: // Jonathan Pryor // // Copyright (C) 2008 Novell (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // Compile With: // gmcs -debug+ -r:System.Core Options.cs -o:NDesk.Options.dll // gmcs -debug+ -d:LINQ -r:System.Core Options.cs -o:NDesk.Options.dll // // The LINQ version just changes the implementation of // OptionSet.Parse(IEnumerable), and confers no semantic changes. // // A Getopt::Long-inspired option parsing library for C#. // // NDesk.Options.OptionSet is built upon a key/value table, where the // key is a option format string and the value is a delegate that is // invoked when the format string is matched. // // Option format strings: // Regex-like BNF Grammar: // name: .+ // type: [=:] // sep: ( [^{}]+ | '{' .+ '}' )? // aliases: ( name type sep ) ( '|' name type sep )* // // Each '|'-delimited name is an alias for the associated action. If the // format string ends in a '=', it has a required value. If the format // string ends in a ':', it has an optional value. If neither '=' or ':' // is present, no value is supported. `=' or `:' need only be defined on one // alias, but if they are provided on more than one they must be consistent. // // Each alias portion may also end with a "key/value separator", which is used // to split option values if the option accepts > 1 value. If not specified, // it defaults to '=' and ':'. If specified, it can be any character except // '{' and '}' OR the *string* between '{' and '}'. If no separator should be // used (i.e. the separate values should be distinct arguments), then "{}" // should be used as the separator. // // Options are extracted either from the current option by looking for // the option name followed by an '=' or ':', or is taken from the // following option IFF: // - The current option does not contain a '=' or a ':' // - The current option requires a value (i.e. not a Option type of ':') // // The `name' used in the option format string does NOT include any leading // option indicator, such as '-', '--', or '/'. All three of these are // permitted/required on any named option. // // Option bundling is permitted so long as: // - '-' is used to start the option group // - all of the bundled options are a single character // - at most one of the bundled options accepts a value, and the value // provided starts from the next character to the end of the string. // // This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value' // as '-Dname=value'. // // Option processing is disabled by specifying "--". All options after "--" // are returned by OptionSet.Parse() unchanged and unprocessed. // // Unprocessed options are returned from OptionSet.Parse(). // // Examples: // int verbose = 0; // OptionSet p = new OptionSet () // .Add ("v", v => ++verbose) // .Add ("name=|value=", v => Console.WriteLine (v)); // p.Parse (new string[]{"-v", "--v", "/v", "-name=A", "/name", "B", "extra"}); // // The above would parse the argument string array, and would invoke the // lambda expression three times, setting `verbose' to 3 when complete. // It would also print out "A" and "B" to standard output. // The returned array would contain the string "extra". // // C# 3.0 collection initializers are supported and encouraged: // var p = new OptionSet () { // { "h|?|help", v => ShowHelp () }, // }; // // System.ComponentModel.TypeConverter is also supported, allowing the use of // custom data types in the callback type; TypeConverter.ConvertFromString() // is used to convert the value option to an instance of the specified // type: // // var p = new OptionSet () { // { "foo=", (Foo f) => Console.WriteLine (f.ToString ()) }, // }; // // Random other tidbits: // - Boolean options (those w/o '=' or ':' in the option format string) // are explicitly enabled if they are followed with '+', and explicitly // disabled if they are followed with '-': // string a = null; // var p = new OptionSet () { // { "a", s => a = s }, // }; // p.Parse (new string[]{"-a"}); // sets v != null // p.Parse (new string[]{"-a+"}); // sets v != null // p.Parse (new string[]{"-a-"}); // sets v == null // using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Globalization; using System.IO; using System.Runtime.Serialization; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; #if LINQ using System.Linq; #endif #if TEST using NDesk.Options; #endif #if NDESK_OPTIONS namespace NDesk.Options #else namespace Mono.Options #endif { public class OptionValueCollection : IList, IList { List values = new List (); OptionContext c; internal OptionValueCollection (OptionContext c) { this.c = c; } #region ICollection void ICollection.CopyTo (Array array, int index) {(values as ICollection).CopyTo (array, index);} bool ICollection.IsSynchronized {get {return (values as ICollection).IsSynchronized;}} object ICollection.SyncRoot {get {return (values as ICollection).SyncRoot;}} #endregion #region ICollection public void Add (string item) {values.Add (item);} public void Clear () {values.Clear ();} public bool Contains (string item) {return values.Contains (item);} public void CopyTo (string[] array, int arrayIndex) {values.CopyTo (array, arrayIndex);} public bool Remove (string item) {return values.Remove (item);} public int Count {get {return values.Count;}} public bool IsReadOnly {get {return false;}} #endregion #region IEnumerable IEnumerator IEnumerable.GetEnumerator () {return values.GetEnumerator ();} #endregion #region IEnumerable public IEnumerator GetEnumerator () {return values.GetEnumerator ();} #endregion #region IList int IList.Add (object value) {return (values as IList).Add (value);} bool IList.Contains (object value) {return (values as IList).Contains (value);} int IList.IndexOf (object value) {return (values as IList).IndexOf (value);} void IList.Insert (int index, object value) {(values as IList).Insert (index, value);} void IList.Remove (object value) {(values as IList).Remove (value);} void IList.RemoveAt (int index) {(values as IList).RemoveAt (index);} bool IList.IsFixedSize {get {return false;}} object IList.this [int index] {get {return this [index];} set {(values as IList)[index] = value;}} #endregion #region IList public int IndexOf (string item) {return values.IndexOf (item);} public void Insert (int index, string item) {values.Insert (index, item);} public void RemoveAt (int index) {values.RemoveAt (index);} private void AssertValid (int index) { if (c.Option == null) throw new InvalidOperationException ("OptionContext.Option is null."); if (index >= c.Option.MaxValueCount) throw new ArgumentOutOfRangeException ("index"); if (c.Option.OptionValueType == OptionValueType.Required && index >= values.Count) throw new OptionException (string.Format ( c.OptionSet.MessageLocalizer ("Missing required value for option '{0}'."), c.OptionName), c.OptionName); } public string this [int index] { get { AssertValid (index); return index >= values.Count ? null : values [index]; } set { values [index] = value; } } #endregion public List ToList () { return new List (values); } public string[] ToArray () { return values.ToArray (); } public override string ToString () { return string.Join (", ", values.ToArray ()); } } public class OptionContext { private Option option; private string name; private int index; private OptionSet set; private OptionValueCollection c; public OptionContext (OptionSet set) { this.set = set; this.c = new OptionValueCollection (this); } public Option Option { get {return option;} set {option = value;} } public string OptionName { get {return name;} set {name = value;} } public int OptionIndex { get {return index;} set {index = value;} } public OptionSet OptionSet { get {return set;} } public OptionValueCollection OptionValues { get {return c;} } } public enum OptionValueType { None, Optional, Required, } public abstract class Option { string prototype, description; string[] names; OptionValueType type; int count; string[] separators; protected Option (string prototype, string description) : this (prototype, description, 1) { } protected Option (string prototype, string description, int maxValueCount) { if (prototype == null) throw new ArgumentNullException ("prototype"); if (prototype.Length == 0) throw new ArgumentException ("Cannot be the empty string.", "prototype"); if (maxValueCount < 0) throw new ArgumentOutOfRangeException ("maxValueCount"); this.prototype = prototype; this.names = prototype.Split ('|'); this.description = description; this.count = maxValueCount; this.type = ParsePrototype (); if (this.count == 0 && type != OptionValueType.None) throw new ArgumentException ( "Cannot provide maxValueCount of 0 for OptionValueType.Required or " + "OptionValueType.Optional.", "maxValueCount"); if (this.type == OptionValueType.None && maxValueCount > 1) throw new ArgumentException ( string.Format ("Cannot provide maxValueCount of {0} for OptionValueType.None.", maxValueCount), "maxValueCount"); if (Array.IndexOf (names, "<>") >= 0 && ((names.Length == 1 && this.type != OptionValueType.None) || (names.Length > 1 && this.MaxValueCount > 1))) throw new ArgumentException ( "The default option handler '<>' cannot require values.", "prototype"); } public string Prototype {get {return prototype;}} public string Description {get {return description;}} public OptionValueType OptionValueType {get {return type;}} public int MaxValueCount {get {return count;}} public string[] GetNames () { return (string[]) names.Clone (); } public string[] GetValueSeparators () { if (separators == null) return new string [0]; return (string[]) separators.Clone (); } protected static T Parse (string value, OptionContext c) { Type tt = typeof (T); bool nullable = tt.IsValueType && tt.IsGenericType && !tt.IsGenericTypeDefinition && tt.GetGenericTypeDefinition () == typeof (Nullable<>); Type targetType = nullable ? tt.GetGenericArguments () [0] : typeof (T); TypeConverter conv = TypeDescriptor.GetConverter (targetType); T t = default (T); try { if (value != null) t = (T) conv.ConvertFromString (value); } catch (Exception e) { throw new OptionException ( string.Format ( c.OptionSet.MessageLocalizer ("Could not convert string `{0}' to type {1} for option `{2}'."), value, targetType.Name, c.OptionName), c.OptionName, e); } return t; } internal string[] Names {get {return names;}} internal string[] ValueSeparators {get {return separators;}} static readonly char[] NameTerminator = new char[]{'=', ':'}; private OptionValueType ParsePrototype () { char type = '\0'; List seps = new List (); for (int i = 0; i < names.Length; ++i) { string name = names [i]; if (name.Length == 0) throw new ArgumentException ("Empty option names are not supported.", "prototype"); int end = name.IndexOfAny (NameTerminator); if (end == -1) continue; names [i] = name.Substring (0, end); if (type == '\0' || type == name [end]) type = name [end]; else throw new ArgumentException ( string.Format ("Conflicting option types: '{0}' vs. '{1}'.", type, name [end]), "prototype"); AddSeparators (name, end, seps); } if (type == '\0') return OptionValueType.None; if (count <= 1 && seps.Count != 0) throw new ArgumentException ( string.Format ("Cannot provide key/value separators for Options taking {0} value(s).", count), "prototype"); if (count > 1) { if (seps.Count == 0) this.separators = new string[]{":", "="}; else if (seps.Count == 1 && seps [0].Length == 0) this.separators = null; else this.separators = seps.ToArray (); } return type == '=' ? OptionValueType.Required : OptionValueType.Optional; } private static void AddSeparators (string name, int end, ICollection seps) { int start = -1; for (int i = end+1; i < name.Length; ++i) { switch (name [i]) { case '{': if (start != -1) throw new ArgumentException ( string.Format ("Ill-formed name/value separator found in \"{0}\".", name), "prototype"); start = i+1; break; case '}': if (start == -1) throw new ArgumentException ( string.Format ("Ill-formed name/value separator found in \"{0}\".", name), "prototype"); seps.Add (name.Substring (start, i-start)); start = -1; break; default: if (start == -1) seps.Add (name [i].ToString ()); break; } } if (start != -1) throw new ArgumentException ( string.Format ("Ill-formed name/value separator found in \"{0}\".", name), "prototype"); } public void Invoke (OptionContext c) { OnParseComplete (c); c.OptionName = null; c.Option = null; c.OptionValues.Clear (); } protected abstract void OnParseComplete (OptionContext c); public override string ToString () { return Prototype; } } [Serializable] public class OptionException : Exception { private string option; public OptionException () { } public OptionException (string message, string optionName) : base (message) { this.option = optionName; } public OptionException (string message, string optionName, Exception innerException) : base (message, innerException) { this.option = optionName; } protected OptionException (SerializationInfo info, StreamingContext context) : base (info, context) { this.option = info.GetString ("OptionName"); } public string OptionName { get {return this.option;} } [SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)] public override void GetObjectData (SerializationInfo info, StreamingContext context) { base.GetObjectData (info, context); info.AddValue ("OptionName", option); } } public delegate void OptionAction (TKey key, TValue value); public class OptionSet : KeyedCollection { public OptionSet () : this (delegate (string f) {return f;}) { } public OptionSet (Converter localizer) { this.localizer = localizer; } Converter localizer; public Converter MessageLocalizer { get {return localizer;} } protected override string GetKeyForItem (Option item) { if (item == null) throw new ArgumentNullException ("option"); if (item.Names != null && item.Names.Length > 0) return item.Names [0]; // This should never happen, as it's invalid for Option to be // constructed w/o any names. throw new InvalidOperationException ("Option has no names!"); } [Obsolete ("Use KeyedCollection.this[string]")] protected Option GetOptionForName (string option) { if (option == null) throw new ArgumentNullException ("option"); try { return base [option]; } catch (KeyNotFoundException) { return null; } } protected override void InsertItem (int index, Option item) { base.InsertItem (index, item); AddImpl (item); } protected override void RemoveItem (int index) { base.RemoveItem (index); Option p = Items [index]; // KeyedCollection.RemoveItem() handles the 0th item for (int i = 1; i < p.Names.Length; ++i) { Dictionary.Remove (p.Names [i]); } } protected override void SetItem (int index, Option item) { base.SetItem (index, item); RemoveItem (index); AddImpl (item); } private void AddImpl (Option option) { if (option == null) throw new ArgumentNullException ("option"); List added = new List (option.Names.Length); try { // KeyedCollection.InsertItem/SetItem handle the 0th name. for (int i = 1; i < option.Names.Length; ++i) { Dictionary.Add (option.Names [i], option); added.Add (option.Names [i]); } } catch (Exception) { foreach (string name in added) Dictionary.Remove (name); throw; } } public new OptionSet Add (Option option) { base.Add (option); return this; } sealed class ActionOption : Option { Action action; public ActionOption (string prototype, string description, int count, Action action) : base (prototype, description, count) { if (action == null) throw new ArgumentNullException ("action"); this.action = action; } protected override void OnParseComplete (OptionContext c) { action (c.OptionValues); } } public OptionSet Add (string prototype, Action action) { return Add (prototype, null, action); } public OptionSet Add (string prototype, string description, Action action) { if (action == null) throw new ArgumentNullException ("action"); Option p = new ActionOption (prototype, description, 1, delegate (OptionValueCollection v) { action (v [0]); }); base.Add (p); return this; } public OptionSet Add (string prototype, OptionAction action) { return Add (prototype, null, action); } public OptionSet Add (string prototype, string description, OptionAction action) { if (action == null) throw new ArgumentNullException ("action"); Option p = new ActionOption (prototype, description, 2, delegate (OptionValueCollection v) {action (v [0], v [1]);}); base.Add (p); return this; } sealed class ActionOption : Option { Action action; public ActionOption (string prototype, string description, Action action) : base (prototype, description, 1) { if (action == null) throw new ArgumentNullException ("action"); this.action = action; } protected override void OnParseComplete (OptionContext c) { action (Parse (c.OptionValues [0], c)); } } sealed class ActionOption : Option { OptionAction action; public ActionOption (string prototype, string description, OptionAction action) : base (prototype, description, 2) { if (action == null) throw new ArgumentNullException ("action"); this.action = action; } protected override void OnParseComplete (OptionContext c) { action ( Parse (c.OptionValues [0], c), Parse (c.OptionValues [1], c)); } } public OptionSet Add (string prototype, Action action) { return Add (prototype, null, action); } public OptionSet Add (string prototype, string description, Action action) { return Add (new ActionOption (prototype, description, action)); } public OptionSet Add (string prototype, OptionAction action) { return Add (prototype, null, action); } public OptionSet Add (string prototype, string description, OptionAction action) { return Add (new ActionOption (prototype, description, action)); } protected virtual OptionContext CreateOptionContext () { return new OptionContext (this); } #if LINQ public List Parse (IEnumerable arguments) { bool process = true; OptionContext c = CreateOptionContext (); c.OptionIndex = -1; var def = GetOptionForName ("<>"); var unprocessed = from argument in arguments where ++c.OptionIndex >= 0 && (process || def != null) ? process ? argument == "--" ? (process = false) : !Parse (argument, c) ? def != null ? Unprocessed (null, def, c, argument) : true : false : def != null ? Unprocessed (null, def, c, argument) : true : true select argument; List r = unprocessed.ToList (); if (c.Option != null) c.Option.Invoke (c); return r; } #else public List Parse (IEnumerable arguments) { OptionContext c = CreateOptionContext (); c.OptionIndex = -1; bool process = true; List unprocessed = new List (); Option def = Contains ("<>") ? this ["<>"] : null; foreach (string argument in arguments) { ++c.OptionIndex; if (argument == "--") { process = false; continue; } if (!process) { Unprocessed (unprocessed, def, c, argument); continue; } if (!Parse (argument, c)) Unprocessed (unprocessed, def, c, argument); } if (c.Option != null) c.Option.Invoke (c); return unprocessed; } #endif private static bool Unprocessed (ICollection extra, Option def, OptionContext c, string argument) { if (def == null) { extra.Add (argument); return false; } c.OptionValues.Add (argument); c.Option = def; c.Option.Invoke (c); return false; } static readonly Regex ValueOption = new Regex ( @"^(?--|-|/)(?[^:=]+)((?[:=])(?.*))?$"); protected bool GetOptionParts (string argument, out string flag, out string name, out string sep, out string value) { if (argument == null) throw new ArgumentNullException ("argument"); flag = name = sep = value = null; Match m = ValueOption.Match (argument); if (!m.Success) { return false; } flag = m.Groups ["flag"].Value; name = m.Groups ["name"].Value; if (m.Groups ["sep"].Success && m.Groups ["value"].Success) { sep = m.Groups ["sep"].Value; value = m.Groups ["value"].Value; } return true; } protected virtual bool Parse (string argument, OptionContext c) { if (c.Option != null) { ParseValue (argument, c); return true; } string f, n, s, v; if (!GetOptionParts (argument, out f, out n, out s, out v)) return false; Option p; if (Contains (n)) { p = this [n]; c.OptionName = f + n; c.Option = p; switch (p.OptionValueType) { case OptionValueType.None: c.OptionValues.Add (n); c.Option.Invoke (c); break; case OptionValueType.Optional: case OptionValueType.Required: ParseValue (v, c); break; } return true; } // no match; is it a bool option? if (ParseBool (argument, n, c)) return true; // is it a bundled option? if (ParseBundledValue (f, string.Concat (n + s + v), c)) return true; return false; } private void ParseValue (string option, OptionContext c) { if (option != null) foreach (string o in c.Option.ValueSeparators != null ? option.Split (c.Option.ValueSeparators, StringSplitOptions.None) : new string[]{option}) { c.OptionValues.Add (o); } if (c.OptionValues.Count == c.Option.MaxValueCount || c.Option.OptionValueType == OptionValueType.Optional) c.Option.Invoke (c); else if (c.OptionValues.Count > c.Option.MaxValueCount) { throw new OptionException (localizer (string.Format ( "Error: Found {0} option values when expecting {1}.", c.OptionValues.Count, c.Option.MaxValueCount)), c.OptionName); } } private bool ParseBool (string option, string n, OptionContext c) { Option p; string rn; if (n.Length >= 1 && (n [n.Length-1] == '+' || n [n.Length-1] == '-') && Contains ((rn = n.Substring (0, n.Length-1)))) { p = this [rn]; string v = n [n.Length-1] == '+' ? option : null; c.OptionName = option; c.Option = p; c.OptionValues.Add (v); p.Invoke (c); return true; } return false; } private bool ParseBundledValue (string f, string n, OptionContext c) { if (f != "-") return false; for (int i = 0; i < n.Length; ++i) { Option p; string opt = f + n [i].ToString (); string rn = n [i].ToString (); if (!Contains (rn)) { if (i == 0) return false; throw new OptionException (string.Format (localizer ( "Cannot bundle unregistered option '{0}'."), opt), opt); } p = this [rn]; switch (p.OptionValueType) { case OptionValueType.None: Invoke (c, opt, n, p); break; case OptionValueType.Optional: case OptionValueType.Required: { string v = n.Substring (i+1); c.Option = p; c.OptionName = opt; ParseValue (v.Length != 0 ? v : null, c); return true; } default: throw new InvalidOperationException ("Unknown OptionValueType: " + p.OptionValueType); } } return true; } private static void Invoke (OptionContext c, string name, string value, Option option) { c.OptionName = name; c.Option = option; c.OptionValues.Add (value); option.Invoke (c); } private const int OptionWidth = 29; public void WriteOptionDescriptions (TextWriter o) { foreach (Option p in this) { int written = 0; if (!WriteOptionPrototype (o, p, ref written)) continue; if (written < OptionWidth) o.Write (new string (' ', OptionWidth - written)); else { o.WriteLine (); o.Write (new string (' ', OptionWidth)); } bool indent = false; string prefix = new string (' ', OptionWidth+2); foreach (string line in GetLines (localizer (GetDescription (p.Description)))) { if (indent) o.Write (prefix); o.WriteLine (line); indent = true; } } } bool WriteOptionPrototype (TextWriter o, Option p, ref int written) { string[] names = p.Names; int i = GetNextOptionIndex (names, 0); if (i == names.Length) return false; if (names [i].Length == 1) { Write (o, ref written, " -"); Write (o, ref written, names [0]); } else { Write (o, ref written, " --"); Write (o, ref written, names [0]); } for ( i = GetNextOptionIndex (names, i+1); i < names.Length; i = GetNextOptionIndex (names, i+1)) { Write (o, ref written, ", "); Write (o, ref written, names [i].Length == 1 ? "-" : "--"); Write (o, ref written, names [i]); } if (p.OptionValueType == OptionValueType.Optional || p.OptionValueType == OptionValueType.Required) { if (p.OptionValueType == OptionValueType.Optional) { Write (o, ref written, localizer ("[")); } Write (o, ref written, localizer ("=" + GetArgumentName (0, p.MaxValueCount, p.Description))); string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0 ? p.ValueSeparators [0] : " "; for (int c = 1; c < p.MaxValueCount; ++c) { Write (o, ref written, localizer (sep + GetArgumentName (c, p.MaxValueCount, p.Description))); } if (p.OptionValueType == OptionValueType.Optional) { Write (o, ref written, localizer ("]")); } } return true; } static int GetNextOptionIndex (string[] names, int i) { while (i < names.Length && names [i] == "<>") { ++i; } return i; } static void Write (TextWriter o, ref int n, string s) { n += s.Length; o.Write (s); } private static string GetArgumentName (int index, int maxIndex, string description) { if (description == null) return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); string[] nameStart; if (maxIndex == 1) nameStart = new string[]{"{0:", "{"}; else nameStart = new string[]{"{" + index + ":"}; for (int i = 0; i < nameStart.Length; ++i) { int start, j = 0; do { start = description.IndexOf (nameStart [i], j); } while (start >= 0 && j != 0 ? description [j++ - 1] == '{' : false); if (start == -1) continue; int end = description.IndexOf ("}", start); if (end == -1) continue; return description.Substring (start + nameStart [i].Length, end - start - nameStart [i].Length); } return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); } private static string GetDescription (string description) { if (description == null) return string.Empty; StringBuilder sb = new StringBuilder (description.Length); int start = -1; for (int i = 0; i < description.Length; ++i) { switch (description [i]) { case '{': if (i == start) { sb.Append ('{'); start = -1; } else if (start < 0) start = i + 1; break; case '}': if (start < 0) { if ((i+1) == description.Length || description [i+1] != '}') throw new InvalidOperationException ("Invalid option description: " + description); ++i; sb.Append ("}"); } else { sb.Append (description.Substring (start, i - start)); start = -1; } break; case ':': if (start < 0) goto default; start = i + 1; break; default: if (start < 0) sb.Append (description [i]); break; } } return sb.ToString (); } private static IEnumerable GetLines (string description) { if (string.IsNullOrEmpty (description)) { yield return string.Empty; yield break; } int length = 80 - OptionWidth - 1; int start = 0, end; do { end = GetLineEnd (start, length, description); char c = description [end-1]; if (char.IsWhiteSpace (c)) --end; bool writeContinuation = end != description.Length && !IsEolChar (c); string line = description.Substring (start, end - start) + (writeContinuation ? "-" : ""); yield return line; start = end; if (char.IsWhiteSpace (c)) ++start; length = 80 - OptionWidth - 2 - 1; } while (end < description.Length); } private static bool IsEolChar (char c) { return !char.IsLetterOrDigit (c); } private static int GetLineEnd (int start, int length, string description) { int end = System.Math.Min (start + length, description.Length); int sep = -1; for (int i = start+1; i < end; ++i) { if (description [i] == '\n') return i+1; if (IsEolChar (description [i])) sep = i+1; } if (sep == -1 || end == description.Length) return end; return sep; } } } smuxi-0.11/src/Common/LibraryCatalog.cs0000644000175000017500000000453211655545675020672 0ustar00meebeymeebey00000000000000/* * $Id: Page.cs 111 2006-02-20 23:10:45Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GtkGnome/Page.cs $ * $Rev: 111 $ * $Author: meebey $ * $Date: 2006-02-21 00:10:45 +0100 (Tue, 21 Feb 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Mono.Unix; namespace Smuxi.Common { public class LibraryCatalog { private static Object _SyncRoot = new Object(); private static string _TextDomain; private static string _LocaleDirectory; private static bool _IsInitialized; private LibraryCatalog() { } public static void Init(string textDomain, string localeDirectory) { _TextDomain = textDomain; _LocaleDirectory = localeDirectory; Catalog.Init(textDomain, localeDirectory); _IsInitialized = true; } public static string GetString(string s, string textDomain) { lock (_SyncRoot) { if (_IsInitialized) { Catalog.Init(textDomain, _LocaleDirectory); string msg = Catalog.GetString(s); Catalog.Init(_TextDomain, _LocaleDirectory); return msg; } return s; } } public static string GetString(string s) { // TODO: use text-domain registry for each calling assembly or class throw new NotImplementedException(); } } } smuxi-0.11/src/Common/Defines.cs.in0000644000175000017500000000374311700531610017727 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.Common { public static class Defines { public const string GitBranch = "@git_branch@"; public const string GitCommitHash = "@git_commit_hash@"; private static readonly string f_InstallPrefix = "@prefix@"; private static readonly string f_DistVersion = "@dist_version@"; private static readonly string f_TwitterApiKey = "@twitter_api_key@"; public static string InstallPrefix { get { return f_InstallPrefix; } } public static string TwitterApiKey { get { return f_TwitterApiKey; } } public static string GitVersion { get { if (String.IsNullOrEmpty(GitBranch) || String.IsNullOrEmpty(GitCommitHash)) { return String.Empty; } return String.Format("{0}/{1}", GitBranch, GitCommitHash); } } public static string DistVersion { get { return f_DistVersion; } } } } smuxi-0.11/src/Common/Platform.cs0000644000175000017500000002010512253423337017532 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010-2012 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.IO; using System.Text.RegularExpressions; using System.Diagnostics; namespace Smuxi.Common { public static class Platform { public static string OperatingSystem { get { if (Environment.OSVersion.Platform == PlatformID.Win32NT) { return Environment.OSVersion.Platform.ToString(); } // uname present? try { var pinfo = new ProcessStartInfo("uname"); pinfo.UseShellExecute = false; pinfo.RedirectStandardOutput = true; pinfo.RedirectStandardError = true; Process.Start(pinfo).WaitForExit(); } catch (Exception) { // fall back to runtime detector return Environment.OSVersion.Platform.ToString(); } string os = null; // GNU/Linux // GNU/kFreeBSD // Cygwin var info = new ProcessStartInfo("uname", "-o"); info.UseShellExecute = false; info.RedirectStandardOutput = true; info.RedirectStandardError = true; var process = Process.Start(info); process.WaitForExit(); if (process.ExitCode == 0) { os = process.StandardOutput.ReadLine(); // HACK: if Cygwin was installed on Windows and is in PATH // we should not trust uname and ask the runtime instead if (os == "Cygwin") { return Environment.OSVersion.Platform.ToString(); } } if (String.IsNullOrEmpty(os)) { // not all operating systems support -o so lets fallback to -s // Linux // FreeBSD // Darwin info = new ProcessStartInfo("uname", "-s"); info.UseShellExecute = false; info.RedirectStandardOutput = true; info.RedirectStandardError = true; process = Process.Start(info); process.WaitForExit(); if (process.ExitCode == 0) { os = process.StandardOutput.ReadLine(); } } if (String.IsNullOrEmpty(os)) { return "Unknown"; } string distro = null; try { info = new ProcessStartInfo("lsb_release", "-i"); info.UseShellExecute = false; info.RedirectStandardOutput = true; info.RedirectStandardError = true; process = Process.Start(info); process.WaitForExit(); if (process.ExitCode == 0) { distro = process.StandardOutput.ReadLine(); var match = Regex.Match(distro, @"^Distributor ID:\s+(.+)"); if (match.Success && match.Groups.Count > 1) { distro = match.Groups[1].Value; } else { distro = null; } } } catch (Exception) { } if (String.IsNullOrEmpty(distro)) { return os; } return String.Format("{0} ({1})", os, distro); } } public static string Architecture { get { if (Environment.OSVersion.Platform == PlatformID.Win32NT) { // x86 // AMD64 var arch = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"); if (!String.IsNullOrEmpty(arch)) { return arch; } arch = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE"); if (!String.IsNullOrEmpty(arch)) { return arch; } } // uname present? try { var pinfo = new ProcessStartInfo("uname"); pinfo.UseShellExecute = false; pinfo.RedirectStandardOutput = true; Process.Start(pinfo).WaitForExit(); } catch (Exception) { // no uname, fall back to pointer size return String.Format("{0}-bit", IntPtr.Size * 8); } // i386 // i686 // x86_64 var info = new ProcessStartInfo("uname", "-m"); info.UseShellExecute = false; info.RedirectStandardOutput = true; var process = Process.Start(info); process.WaitForExit(); if (process.ExitCode == 0) { return process.StandardOutput.ReadLine(); } return "Unknown"; } } public static string LogPath { get { var logPath = Environment.GetFolderPath( Environment.SpecialFolder.LocalApplicationData ); logPath = Path.Combine(logPath, "smuxi"); // FIXME: include session username logPath = Path.Combine(logPath, "logs"); return logPath; } } public static string CachePath { get { string cachePath = null; if (Environment.OSVersion.Platform == PlatformID.Win32NT) { cachePath = Environment.GetFolderPath( Environment.SpecialFolder.LocalApplicationData ); cachePath = Path.Combine(cachePath, "smuxi"); cachePath = Path.Combine(cachePath, "cache"); } else { var home = Environment.GetFolderPath(Environment.SpecialFolder.Personal); var xdgCache = Environment.GetEnvironmentVariable("XDG_CACHE_HOME"); if (String.IsNullOrEmpty(xdgCache)) { xdgCache = Path.Combine(home, ".cache"); } cachePath = Path.Combine(xdgCache, "smuxi"); } if (!Directory.Exists(cachePath)) { Directory.CreateDirectory(cachePath); } return cachePath; } } public static string GetBuffersPath(string username) { var dbPath = GetBuffersBasePath(); dbPath = Path.Combine(dbPath, IOSecurity.GetFilteredPath(username)); return dbPath; } public static string GetBuffersBasePath() { var dbPath = Environment.GetFolderPath( Environment.SpecialFolder.LocalApplicationData ); dbPath = Path.Combine(dbPath, "smuxi"); dbPath = Path.Combine(dbPath, "buffers"); return dbPath; } } } smuxi-0.11/src/Common/smuxi-common.pc.in0000644000175000017500000000017411655545675021026 0ustar00meebeymeebey00000000000000Name: smuxi-common Description: Common Version: @VERSION@ Requires: Libs: -r:@expanded_libdir@/@PACKAGE@/smuxi-common.dll smuxi-0.11/src/Common/Crc32.cs0000644000175000017500000001442212250426634016627 0ustar00meebeymeebey00000000000000// Copyright (c) 2009. Tom Kaminski // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Security.Cryptography; namespace Smuxi.Common { public class Crc32 : HashAlgorithm { public const uint DefaultSeed = 0xffffffff; readonly static uint[] CrcTable = new uint[] { 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D }; uint crcValue = 0; public override void Initialize() { crcValue = 0; } protected override void HashCore(byte[] buffer, int start, int length) { crcValue ^= DefaultSeed; unchecked { while (--length >= 0) { crcValue = CrcTable[(crcValue ^ buffer[start++]) & 0xFF] ^ (crcValue >> 8); } } crcValue ^= DefaultSeed; } protected override byte[] HashFinal() { this.HashValue = new byte[] { (byte)((crcValue >> 24) & 0xff), (byte)((crcValue >> 16) & 0xff), (byte)((crcValue >> 8) & 0xff), (byte)(crcValue & 0xff) }; return this.HashValue; } public uint CrcValue { get { return (uint)(((uint)HashValue[0] << 24) | (HashValue[1] << 16) | (HashValue[2] << 8) | HashValue[3]); } } public override int HashSize { get { return 32; } } } } smuxi-0.11/src/Common/MD5.cs0000644000175000017500000000324711655545675016362 0ustar00meebeymeebey00000000000000/* * $Id: Page.cs 111 2006-02-20 23:10:45Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GtkGnome/Page.cs $ * $Rev: 111 $ * $Author: meebey $ * $Date: 2006-02-21 00:10:45 +0100 (Tue, 21 Feb 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Text; using System.Security.Cryptography; namespace Smuxi.Common { public class MD5 { public static string FromString(string cleartext) { MD5CryptoServiceProvider csp = new MD5CryptoServiceProvider(); byte[] md5bytes = csp.ComputeHash(Encoding.UTF8.GetBytes(cleartext)); StringBuilder md5text = new StringBuilder(); foreach (byte md5byte in md5bytes) { md5text.Append(md5byte.ToString("x2").ToLower()); } return md5text.ToString(); } } } smuxi-0.11/src/Common/ITraceable.cs0000644000175000017500000000231711655545675017765 0ustar00meebeymeebey00000000000000/* * $Id: Page.cs 111 2006-02-20 23:10:45Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GtkGnome/Page.cs $ * $Rev: 111 $ * $Author: meebey $ * $Date: 2006-02-21 00:10:45 +0100 (Tue, 21 Feb 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.Common { public interface ITraceable { string ToTraceString(); } } smuxi-0.11/src/Common/ChangeLog0000644000175000017500000000367611655545675017226 0ustar00meebeymeebey000000000000002008-12-28 Mirco Bauer 2008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-12-26 Mirco Bauer * TaskQueue.cs: Call Dispose() in destructor as fallback. 2008-12-26 Mirco Bauer * TaskQueue.cs: Set disposed in Dispose() else the Thread will never terminate as long there is no exception thrown. 2008-12-17 Mirco Bauer * TaskQueue.cs: Fixed name. 2008-09-23 Mirco Bauer * Common.mdp, TaskQueue.cs: Replaced poor mans Queue in FrontendManager with TaskQueue from Alan McGovern . 2008-08-28 Mirco Bauer * FastSerializer.cs: Set eol-style to native and converted files using dos2unix where needed. 2008-08-25 Mirco Bauer 2008-08-24 Mirco Bauer * Defines.cs, Common.mdp: Provide Defines. * LibraryCatalog.cs: Catalog (gettext) wrapper that allows multiple text-domains. 2008-08-21 Mirco Bauer * ITraceable.cs, Trace.cs: Fixed whitespace (replaced \t with 4 spaces). 2008-07-27 Mirco Bauer * AssemblyInfo.cs, AssemblyInfo.cs.in: Removed AssemblyInfo.cs.in files, not needed anymore as we use a shared AssemblyVersion.cs(.in) now. 2008-07-27 Mirco Bauer * Common.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-07-17 Mirco Bauer * MD5.cs: Fixed whitespace. 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 2008-01-31 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * Common.mdp: Updated using MonoDevelop 0.18.1 smuxi-0.11/src/Common/ThreadPoolQueue.cs0000644000175000017500000000446011700531605021014 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Threading; using System.Collections.Generic; namespace Smuxi.Common { public class ThreadPoolQueue { public int MaxWorkers { set; get; } Queue ActionQueue { set; get; } int ActiveWorkers; public ThreadPoolQueue() { MaxWorkers = Environment.ProcessorCount; ActionQueue = new Queue(); } /// /// This method is thread safe. /// public void Enqueue(Action action) { if (action == null) { throw new ArgumentNullException("action"); } lock (ActionQueue) { ActionQueue.Enqueue(action); } CheckQueue(); } void CheckQueue() { lock (ActionQueue) { if (ActionQueue.Count == 0) { return; } if (ActiveWorkers >= MaxWorkers) { return; } var action = ActionQueue.Dequeue(); Interlocked.Increment(ref ActiveWorkers); ThreadPool.QueueUserWorkItem(delegate { try { action(); } finally { Interlocked.Decrement(ref ActiveWorkers); CheckQueue(); } }); } } } } smuxi-0.11/src/Common/TaskQueue.cs0000644000175000017500000001647312253423337017672 0ustar00meebeymeebey00000000000000/* * $Id: FrontendManager.cs 378 2008-08-24 00:26:35Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/FrontendManager.cs $ * $Rev: 378 $ * $Author: meebey $ * $Date: 2008-08-24 02:26:35 +0200 (Sun, 24 Aug 2008) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008 Alan McGovern * Copyright (c) 2008 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using System.Text; using System.Threading; namespace Smuxi.Common { public delegate object TaskQueueJobHandler(); public delegate void TaskQueueTaskHandler(); public delegate bool TaskQueueTimeoutHandler(); public delegate void TaskQueueExceptionEventHandler(object sender, TaskQueueExceptionEventArgs e); public class TaskQueueExceptionEventArgs : EventArgs { Exception f_Exception; public Exception Exception { get { return f_Exception; } } public TaskQueueExceptionEventArgs(Exception ex) { f_Exception = ex; } } public class TaskQueue : IDisposable { private class DelegateTask { private ManualResetEvent handle; private object result; private TaskQueueJobHandler task; private Exception exception; public ManualResetEvent Handle { get { return handle; } set { handle = value; } } public object Result { get { return result; } } public Exception Exception { get { return exception; } } public DelegateTask(TaskQueueJobHandler task) { this.task = task; } public void Execute() { try { result = task(); } catch (Exception ex) { exception = ex; } if (handle != null) handle.Set(); } } bool disposed; AutoResetEvent handle = new AutoResetEvent(false); Queue tasks = new Queue(); Thread thread; string name; public TaskQueueExceptionEventHandler ExceptionEvent; public EventHandler AbortedEvent; public bool Disposed { get { return disposed; } } public TaskQueue(string name) { this.name = name; InitThread(); } ~TaskQueue() { Dispose(false); } void InitThread() { thread = new Thread(new ThreadStart(Loop)); thread.Name = name; thread.IsBackground = true; thread.Start(); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected void Dispose(bool disposing) { if (disposed) return; disposed = true; // make sure the thread will notice the disposed state when // disposing or finalizing this object handle.Set(); } void Loop() { while (true) { DelegateTask task = null; lock (tasks) { if (tasks.Count > 0) task = tasks.Dequeue(); } if (task == null) { if (disposed) break; #if DISABLED // WARNING: if we are being disposed at _this_ point, there // are no new tasks added and we are waiting forever, then // we would leak this thread! The dispose check + break will // never happen, so we have to use a sane timeout here. // Checking every 60 seconds if we are disposed should be // reasonable. handle.WaitOne(60 * 1000); #endif // OPT: let Dispose() trigger the handle, but is this safe? handle.WaitOne(); } else { task.Execute(); if (task.Exception != null) { if (ExceptionEvent != null) { ExceptionEvent(this, new TaskQueueExceptionEventArgs(task.Exception)); } break; } } } if (AbortedEvent != null) { AbortedEvent(this, EventArgs.Empty); } } private void Queue(DelegateTask task) { lock (tasks) { tasks.Enqueue(task); handle.Set(); } } public void Queue(TaskQueueTaskHandler task) { Queue(new DelegateTask(delegate { task(); return null; })); } public void QueueWait(TaskQueueTaskHandler task) { QueueWait(delegate { task(); return null; }); } public object QueueWait(TaskQueueJobHandler task) { return QueueWait(new DelegateTask(task)); } private object QueueWait(DelegateTask t) { if (t.Handle != null) t.Handle.Reset(); else t.Handle = new ManualResetEvent(false); if (Thread.CurrentThread == thread) t.Execute(); else Queue(t); t.Handle.WaitOne(); t.Handle.Close(); return t.Result; } public void Reset(bool abortActiveTask) { if (abortActiveTask) { thread.Abort(); InitThread(); } lock (tasks) { tasks.Clear(); } } public void Reset() { Reset(false); } } } smuxi-0.11/src/Common/Makefile.am0000644000175000017500000000461712250426634017465 0ustar00meebeymeebey00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:NET_2_0,NDESK_OPTIONS" ASSEMBLY = ../../bin/release/smuxi-common.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = BUILD_DIR = ../../bin/release LOG4NET_DLL_SOURCE=../../lib/log4net.dll endif if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -debug -optimize+ "-define:DEBUG,TRACE,LOG4NET,NET_2_0,NDESK_OPTIONS" ASSEMBLY = ../../bin/debug/smuxi-common.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = BUILD_DIR = ../../bin/debug SMUXI_COMMON_DLL=$(ASSEMBLY) SMUXI_COMMON_DLL_SOURCE=$(ASSEMBLY) SMUXI_COMMON_DLL_MDB=$(ASSEMBLY_MDB) SMUXI_COMMON_DLL_MDB_SOURCE=$(ASSEMBLY_MDB) LOG4NET_DLL_SOURCE=../../lib/log4net.dll endif AL=al2 SATELLITE_ASSEMBLY_NAME=.resources.dll PROGRAMFILES = LINUX_PKGCONFIG = \ $(COMMON_PC) all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ AtomFeed.cs \ Crc32.cs \ IOSecurity.cs \ ITraceable.cs \ Trace.cs \ MD5.cs \ FastSerializer.cs \ LibraryCatalog.cs \ NDesk.Options.cs \ Defines.cs \ SpecialFolderPatternConverter.cs \ TaskQueue.cs \ ThreadPoolQueue.cs \ Platform.cs \ Pattern.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-common.pc.in REFERENCES = \ System \ System.Core \ System.Xml \ Mono.Posix DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) include $(top_srcdir)/Makefile.include LOG4NET_DLL = $(BUILD_DIR)/log4net.dll COMMON_PC = $(BUILD_DIR)/smuxi-common.pc $(eval $(call emit-deploy-wrapper,COMMON_PC,smuxi-common.pc)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL_MDB)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS) smuxi-0.11/src/Common/AssemblyInfo.cs0000644000175000017500000000235511700531610020336 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Smuxi - common library")] [assembly: AssemblyCopyright("2005-2011 (C) Mirco Bauer ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] smuxi-0.11/src/Common/FastSerializer.cs0000644000175000017500000003510111700531605020671 0ustar00meebeymeebey00000000000000// FastSerializer.cs. Provides SerializationWriter and SerializationReader classes to help high speed serialization. // This short example shows how they're used: // // [Serializable] // public class TestObject : ISerializable { // Class must be ISerializable // public long x; // public string y; // // public void GetObjectData (SerializationInfo info, StreamingContext ctxt) { // Serialization method // SerializationWriter sw = SerializationWriter.GetWriter (); // Get a Writer // sw.Write(x); // Write fields // sw.Write(y); // ditto // sw.AddToInfo (info); // Add the Writer to info // } // // public TestObject (SerializationInfo info, StreamingContext ctxt) { // Deserialization .ctor // SerializationReader sr = SerializationReader.GetReader (info); // Get a Reader from info // x = sr.ReadInt64 (); // Read a field // y = sr.ReadInt64 (); // ditto // } // // } // // Author: Tim Haynes, May 2006. Use freely as you see fit. // Author: Mirco Bauer , Aug 2007. // Added .NET 1.1 support // Added BinaryFormatter optimization // Using "is" operator instead of switch on GetType() string. // Author: Mirco Bauer , Sep 2007 // Applied smuxi Coding-Standards using System; using System.IO; using System.Reflection; using System.Collections; #if NET_2_0 using System.Collections.Generic; #endif using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; namespace Smuxi.Common { // Enum for the standard types handled by Read/WriteObject() internal enum ObjType : byte { Null = 0, Boolean, Byte, UInt16, UInt32, UInt64, SByte, Int16, Int32, Int64, Char, String, Single, Double, Decimal, DateTime, ByteArray, CharArray, Unknown } /// SerializationWriter. Extends BinaryWriter to add additional data types, /// handle null strings and simplify use with ISerializable. public class SerializationWriter : BinaryWriter { private static BinaryFormatter _BinaryFormatter = new BinaryFormatter(); private SerializationWriter(Stream s) : base(s) { } /// Static method to initialise the writer with a suitable MemoryStream. public static SerializationWriter GetWriter() { MemoryStream ms = new MemoryStream(1024); return new SerializationWriter(ms); } internal void Write(ObjType type) { Write((byte) type); } /// Writes a string to the buffer. Overrides the base implementation so it can cope with nulls public override void Write(string str) { if (str == null) { Write(ObjType.Null); return; } Write(ObjType.String); base.Write(str); } /// Writes a byte array to the buffer. Overrides the base implementation to /// send the length of the array which is needed when it is retrieved public override void Write(byte[] b) { WriteBytes(b); } public void WriteBytes(byte[] b) { if (b==null) { Write(-1); } else { int len = b.Length; Write(len); if (len>0) base.Write(b); } } /// Writes a char array to the buffer. Overrides the base implementation to /// sends the length of the array which is needed when it is read. public override void Write(char[] c) { if (c==null) { Write(-1); } else { int len = c.Length; Write(len); if (len>0) base.Write(c); } } /// Writes a DateTime to the buffer. public void Write(DateTime dt) { Write(dt.Ticks); } public void Write(ICollection c) { if (c == null) { Write(-1); return; } Write(c.Count); foreach (Object item in c) { WriteObject(item); } } public void Write(IDictionary d) { if (d == null) { Write(-1); return; } Write(d.Count); foreach (DictionaryEntry de in d) { WriteObject(de.Key); WriteObject(de.Value); } } #if NET_2_0 /// Writes a generic ICollection (such as an IList) to the buffer. public void Write (ICollection c) { if (c==null) { Write(-1); } else { Write(c.Count); foreach (T item in c) WriteObject (item); } } /// Writes a generic IDictionary to the buffer. public void Write (IDictionary d) { if (d==null) { Write(-1); } else { Write(d.Count); foreach (KeyValuePair kvp in d) { WriteObject (kvp.Key); WriteObject (kvp.Value); } } } #endif /// Writes an arbitrary object to the buffer. Useful where we have something of type "object" /// and don't know how to treat it. This works out the best method to use to write to the buffer. public void WriteObject(object obj) { if (obj == null) { Write(ObjType.Null); return; } if (obj is Boolean) { Write(ObjType.Boolean); Write((Boolean) obj); } else if (obj is Byte) { Write(ObjType.Byte); Write((Byte) obj); } else if (obj is UInt16) { Write(ObjType.UInt16); Write((ushort) obj); } else if (obj is UInt32) { Write(ObjType.UInt32); Write((uint) obj); } else if (obj is UInt64) { Write(ObjType.UInt64); Write((ulong) obj); } else if (obj is SByte) { Write(ObjType.SByte); Write((sbyte) obj); } else if (obj is Int16) { Write(ObjType.Int16); Write((short) obj); } else if (obj is Int32) { Write(ObjType.Int32); Write((int) obj); } else if (obj is Int64) { Write(ObjType.Int64); Write((long) obj); } else if (obj is Char) { Write(ObjType.Char); base.Write((char) obj); } else if (obj is String) { Write(ObjType.String); base.Write((string) obj); } else if (obj is Single) { Write(ObjType.Single); Write((float) obj); } else if (obj is Double) { Write(ObjType.Double); Write((double) obj); } else if (obj is Decimal) { Write(ObjType.Decimal); Write((decimal) obj); } else if (obj is DateTime) { Write(ObjType.DateTime); Write((DateTime) obj); } else if (obj is Byte[]) { Write(ObjType.ByteArray); base.Write((byte[]) obj); } else if (obj is Char[]) { Write(ObjType.CharArray); base.Write((char[]) obj); } else { Write(ObjType.Unknown); _BinaryFormatter.Serialize(BaseStream, obj); } } /// Adds the SerializationWriter buffer to the SerializationInfo at the end of GetObjectData(). public void AddToInfo(SerializationInfo info) { var b = GetData(); info.AddValue("X", b, typeof(byte[])); } public byte[] GetData() { return ((MemoryStream) BaseStream).ToArray(); } } /// SerializationReader. Extends BinaryReader to add additional data types, /// handle null strings and simplify use with ISerializable. public class SerializationReader : BinaryReader { private static BinaryFormatter _BinaryFormatter = new BinaryFormatter(); protected SerializationReader(Stream s) : base(s) { } internal ObjType ReadObjType() { return (ObjType) ReadByte(); } /// Static method to take a SerializationInfo object (an input to an ISerializable constructor) /// and produce a SerializationReader from which serialized objects can be read . public static SerializationReader GetReader(SerializationInfo info) { byte[] byteArray = (byte[]) info.GetValue("X", typeof(byte[])); MemoryStream ms = new MemoryStream(byteArray); return new SerializationReader(ms); } public static SerializationReader GetReader(byte[] data) { MemoryStream ms = new MemoryStream(data); return new SerializationReader(ms); } /// Reads a string from the buffer. Overrides the base implementation so it can cope with nulls. public override string ReadString() { ObjType t = ReadObjType(); if (t == ObjType.Null) { return null; } if (t == ObjType.String) { return base.ReadString(); } throw new SerializationException(); } /// Reads a byte array from the buffer, handling nulls and the array length. public byte[] ReadByteArray () { int len = ReadInt32 (); if (len>0) return ReadBytes (len); if (len<0) return null; return new byte[0]; } /// Reads a char array from the buffer, handling nulls and the array length. public char[] ReadCharArray () { int len = ReadInt32 (); if (len>0) return ReadChars (len); if (len<0) return null; return new char[0]; } /// Reads a DateTime from the buffer. public DateTime ReadDateTime() { return new DateTime(ReadInt64()); } public IList ReadList() { int count = ReadInt32(); if (count < 0) { return null; } IList list = new ArrayList(count); for (int i = 0; i < count; i++) { list.Add(ReadObject()); } return list; } public IDictionary ReadDictionary() { int count = ReadInt32(); if (count < 0) { return null; } // BUG: if the dictionary was not a hashtable or custom comparer were // used, we might get problems IDictionary dict = new Hashtable(count); for (int i = 0; i < count; i++) { dict.Add(ReadObject(), ReadObject()); } return dict; } #if NET_2_0 /// Reads a generic list from the buffer. public IList ReadList() { int count = ReadInt32(); if (count < 0) { return null; } IList list = new List(count); for (int i = 0; i Reads a generic Dictionary from the buffer. public IDictionary ReadDictionary() { int count = ReadInt32(); if (count < 0) { return null; } // BUG: if the dictionary was not a Dictionary or custom comparer were // used, we might get problems IDictionary dict = new Dictionary(count); for (int i = 0; i Reads an object which was added to the buffer by WriteObject. public object ReadObject() { ObjType t = (ObjType) ReadByte(); switch (t) { case ObjType.Null: return null; case ObjType.Boolean: return ReadBoolean(); case ObjType.Byte: return ReadByte(); case ObjType.UInt16: return ReadUInt16(); case ObjType.UInt32: return ReadUInt32(); case ObjType.UInt64: return ReadUInt64(); case ObjType.SByte: return ReadSByte(); case ObjType.Int16: return ReadInt16(); case ObjType.Int32: return ReadInt32(); case ObjType.Int64: return ReadInt64(); case ObjType.Char: return ReadChar(); case ObjType.String: return base.ReadString(); case ObjType.Single: return ReadSingle(); case ObjType.Double: return ReadDouble(); case ObjType.Decimal: return ReadDecimal(); case ObjType.DateTime: return ReadDateTime(); case ObjType.ByteArray: return ReadByteArray(); case ObjType.CharArray: return ReadCharArray(); case ObjType.Unknown: return _BinaryFormatter.Deserialize(BaseStream); default: throw new SerializationException(); } } } } smuxi-0.11/src/Common/Trace.cs0000644000175000017500000001656011700531605017010 0ustar00meebeymeebey00000000000000/* * $Id: Page.cs 111 2006-02-20 23:10:45Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GtkGnome/Page.cs $ * $Rev: 111 $ * $Author: meebey $ * $Date: 2006-02-21 00:10:45 +0100 (Tue, 21 Feb 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Text; using System.Runtime.Remoting; using System.Reflection; using System.Collections; using System.Diagnostics; using SysTrace = System.Diagnostics.Trace; namespace Smuxi.Common { public sealed class Trace { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger("TRACE"); #else static Trace() { TextWriterTraceListener myWriter = new TextWriterTraceListener(Console.Out); SysTrace.Listeners.Add(myWriter); } #endif public static MethodBase GetMethodBase() { return new StackTrace(new StackFrame(1)).GetFrame(0).GetMethod(); } public static string GetStackTrace() { string line = null; StackTrace st = new StackTrace(); for (int i = st.FrameCount - 1; i >= 1 ; i--) { StackFrame sf = new StackFrame(); sf = st.GetFrame(i); MethodBase method = sf.GetMethod(); string methodname = method.DeclaringType + "." + method.Name; line += methodname + "()" + Environment.NewLine; } return line; } [Conditional("TRACE")] public static void CallFull(params object[] args) { MethodBase mb = new StackTrace(new StackFrame(1)).GetFrame(0).GetMethod(); string methodname = mb.DeclaringType.Name + "." + mb.Name; string line = GetStackTrace(); line += methodname + "(" + _Parameterize(mb, args) + ")"; #if LOG4NET _Logger.Debug(line); #else SysTrace.Write(line); #endif } [Conditional("TRACE")] public static void Call(params object[] args) { MethodBase mb = new StackTrace(new StackFrame(1)).GetFrame(0).GetMethod(); Call(mb, args); } [Conditional("TRACE")] public static void Call(MethodBase mb, params object[] args) { if (mb == null) { throw new ArgumentNullException("mb"); } StringBuilder line = new StringBuilder(); line.Append("["); line.Append(System.IO.Path.GetFileName(mb.DeclaringType.Assembly.Location)); line.Append("] "); line.Append(mb.DeclaringType.Name); line.Append("."); line.Append(mb.Name); line.Append("("); line.Append(_Parameterize(mb, args)); line.Append(")"); #if LOG4NET _Logger.Debug(line.ToString()); #else SysTrace.WriteLine(line.ToString()); #endif } private static string _Parameterize(MethodBase method, params object[] parameters) { ParameterInfo[] parameter_info = method.GetParameters(); if (parameter_info.Length == 0) { return String.Empty; } StringBuilder res = new StringBuilder(); for (int i = 0; i < parameter_info.Length; i++) { res.Append(parameter_info[i].Name).Append(" = "); if (parameters == null) { res.Append(_ParameterizeQuote(null)); } else if (parameters != null && parameters.Length > i) { res.Append(_ParameterizeQuote(parameters[i])); } else { // empty array res.Append("[]"); } res.Append(", "); } res.Remove(res.Length - 2, 2); return res.ToString(); } private static string _ParameterizeQuote(object obj) { if (obj == null) { return "(null)"; } // OPT: tracing over remote objects is too expensive! if (RemotingServices.IsTransparentProxy(obj)) { return obj.GetType().ToString(); } StringBuilder line = new StringBuilder(); if (obj is string) { line.Append("'").Append(obj).Append("'"); } else if (obj is ITraceable) { line.AppendFormat("<{0}>", ((ITraceable) obj).ToTraceString()); } else if (obj is IList) { line.Append("["); foreach (object val in (IList) obj) { if (val is IList || val is IDictionary) { line.Append(_ParameterizeQuote(val)); line.Append(", "); continue; } line.Append((val == null ? "(null)" : val.ToString())); line.Append(", "); } // remove last ", " if (line.Length > 1) { line.Remove(line.Length - 2, 2); } line.Append("]"); } else if (obj is IDictionary) { line.Append("{"); foreach (DictionaryEntry de in (IDictionary) obj) { if (de.Value is IList || de.Value is IDictionary) { line.Append(de.Key.ToString()); line.Append("="); line.Append(_ParameterizeQuote(de.Value)); line.Append(", "); continue; } line.Append(de.Key.ToString()); line.Append("="); line.Append((de.Value == null ? "(null)" : de.Value.ToString())); line.Append(", "); } if (line.Length > 1) { line.Remove(line.Length - 2, 2); } line.Append("}"); } else { line.Append(obj.ToString()); } return line.ToString(); } /* private static string Dump(Hashtable ht) { string line = null; line += "{"; foreach (DictionaryEntry de in (Hashtable)obj) { line += de.Key.ToString(); line += "="; line += (de.Value == null ? "(null)" : de.Value.ToString()); line += ", "; } line = line.Substring(0, line.Length - 2); line += "}"; return line; } */ } } smuxi-0.11/src/Common/Defines.cs0000644000175000017500000000402012311344236017314 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.Common { public static class Defines { public const string GitBranch = "release/0.11"; public const string GitCommitHash = "dff7157"; private static readonly string f_InstallPrefix = "/usr/local"; private static readonly string f_DistVersion = "release/0.11/dff7157"; private static readonly string f_TwitterApiKey = "60QV2qQx9cS7y1BJDbgAA|2VgD6qQKddsF5HYQ0TrRgs3tFTnCwDONBmRlTmG658"; public static string InstallPrefix { get { return f_InstallPrefix; } } public static string TwitterApiKey { get { return f_TwitterApiKey; } } public static string GitVersion { get { if (String.IsNullOrEmpty(GitBranch) || String.IsNullOrEmpty(GitCommitHash)) { return String.Empty; } return String.Format("{0}/{1}", GitBranch, GitCommitHash); } } public static string DistVersion { get { return f_DistVersion; } } } } smuxi-0.11/src/Common/SpecialFolderPatternConverter.cs0000644000175000017500000000250412250426634023713 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2012 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.IO; #if LOG4NET namespace Smuxi.Common { public class SpecialFolderPatternConverter : log4net.Util.PatternConverter { protected override void Convert(TextWriter writer, object state) { var specialFolder = (Environment.SpecialFolder) Enum.Parse( typeof(Environment.SpecialFolder), Option, true ); writer.Write(Environment.GetFolderPath(specialFolder)); } } } #endifsmuxi-0.11/src/Common/AtomFeed.cs0000644000175000017500000001021411700531610017420 0ustar00meebeymeebey00000000000000/* * Copyright (c) 2007 Carlos Martín Nieto * * This file is released under the terms of the GNU GPLv2 or later */ using System; using System.IO; using System.Text; using System.Xml.Serialization; namespace Smuxi.Common { [XmlType("feed")] public class AtomFeed { [XmlElement("link")] public AtomLink[] Link = null; [XmlElement("updated")] public DateTime UpdateTime = DateTime.MinValue; [XmlElement("modified")] public DateTime ModifyTime = DateTime.MinValue; [XmlElement("title")] public AtomText Title = null; [XmlElement("subtitle")] public string Subtitle = null; [XmlElement("author")] public AtomAuthor Author = null; [XmlElement("entry")] public AtomEntry[] Entry; private static XmlSerializer ser = new XmlSerializer(typeof(AtomFeed), "http://www.w3.org/2005/Atom"); public static AtomFeed LoadFromXml(string file) { try { FileStream fs = new FileStream(file, FileMode.Open); return (AtomFeed)ser.Deserialize(fs); } catch(FileNotFoundException){ Console.Error.WriteLine("Unable to open file"); return null; } } public static AtomFeed Load(StringReader sr) { return (AtomFeed)ser.Deserialize(sr); } public static AtomFeed Load(Stream stream) { return (AtomFeed) ser.Deserialize(stream); } public DateTime Modified { get { if(UpdateTime != DateTime.MinValue){ return UpdateTime; } else { return ModifyTime; } } } public DateTime Updated { get { return Modified; } } public AtomLink LinkByType(string type) { foreach(AtomLink link in Link){ if(link.Type == type){ return link; } } return null; } } [XmlType("author")] public class AtomAuthor { [XmlElement("name")] public string Name; [XmlElement("email")] public string Email; } [XmlType("link")] public class AtomLink { [XmlAttribute("href")] public string Url = null; [XmlAttribute("rel")] public string Rel = null; [XmlAttribute("type")] public string Type = null; } [XmlType("entry")] public class AtomEntry { [XmlElement("link")] public AtomLink[] Link = null; [XmlElement("published")] public DateTime Published; [XmlElement("updated")] public DateTime UpdateTime = DateTime.MinValue; [XmlElement("modified")] public DateTime ModifyTime = DateTime.MinValue; [XmlElement("title")] public AtomText Title; [XmlElement("author")] public AtomAuthor Author = null; [XmlElement("id")] public string Id; [XmlElement("content")] public AtomText[] Content; [XmlElement("summary")] public AtomText Summary; public DateTime Modified { get { if(UpdateTime != DateTime.MinValue){ return UpdateTime; } else { return ModifyTime; } } } public DateTime Updated { get { return Modified; } } public AtomLink LinkByType(string type) { foreach(AtomLink link in Link){ if(link.Type == type){ return link; } } return null; } public AtomText ContentByType(string type) { foreach(AtomText text in Content){ if(text.Type == type){ return text; } } return null; } } public class AtomText { [XmlText] public string Text = null; [XmlAttribute("type")] public string Type = null; } } smuxi-0.11/src/Common/Makefile.in0000644000175000017500000010112112311344230017447 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/Defines.cs.in \ $(srcdir)/smuxi-common.pc.in ChangeLog subdir = src/Common ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = Defines.cs smuxi-common.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ # Warning: This is an automatically generated file, do not edit! @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -debug -optimize+ "-define:DEBUG,TRACE,LOG4NET,NET_2_0,NDESK_OPTIONS" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:NET_2_0,NDESK_OPTIONS" @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/release/smuxi-common.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin/debug @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin/release @ENABLE_DEBUG_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_RELEASE_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL = $(ASSEMBLY) @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL_SOURCE = $(ASSEMBLY) @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL_MDB = $(ASSEMBLY_MDB) @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL_MDB_SOURCE = $(ASSEMBLY_MDB) AL = al2 SATELLITE_ASSEMBLY_NAME = .resources.dll PROGRAMFILES = LINUX_PKGCONFIG = \ $(COMMON_PC) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ AtomFeed.cs \ Crc32.cs \ IOSecurity.cs \ ITraceable.cs \ Trace.cs \ MD5.cs \ FastSerializer.cs \ LibraryCatalog.cs \ NDesk.Options.cs \ Defines.cs \ SpecialFolderPatternConverter.cs \ TaskQueue.cs \ ThreadPoolQueue.cs \ Platform.cs \ Pattern.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-common.pc.in REFERENCES = \ System \ System.Core \ System.Xml \ Mono.Posix DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) LOG4NET_DLL = $(BUILD_DIR)/log4net.dll COMMON_PC = $(BUILD_DIR)/smuxi-common.pc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Common/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): Defines.cs: $(top_builddir)/config.status $(srcdir)/Defines.cs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ smuxi-common.pc: $(top_builddir)/config.status $(srcdir)/smuxi-common.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(eval $(call emit-deploy-wrapper,COMMON_PC,smuxi-common.pc)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL_MDB)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Frontend-Curses/0000755000175000017500000000000012311344241017201 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-Curses/Main.cs0000644000175000017500000000323311655545675020445 0ustar00meebeymeebey00000000000000/* * $Id: Main.cs 183 2007-04-21 15:14:23Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/Main.cs $ * $Rev: 183 $ * $Author: meebey $ * $Date: 2007-04-21 17:14:23 +0200 (Sat, 21 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.Frontend.Curses { public class MainClass { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public static void Main(string[] args) { #if LOG4NET //log4net.Config.BasicConfigurator.Configure(); #endif try { Frontend.Init(args); } catch (Exception e) { #if LOG4NET _Logger.Fatal(e); #endif throw; } } } } smuxi-0.11/src/Frontend-Curses/MainWindow.cs0000644000175000017500000001157411655545675021644 0ustar00meebeymeebey00000000000000/* * $Id: MainWindow.cs 192 2007-04-22 11:48:12Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/MainWindow.cs $ * $Rev: 192 $ * $Author: meebey $ * $Date: 2007-04-22 13:48:12 +0200 (Sun, 22 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using Mono.Unix; using Mono.Terminal; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Curses { public class MainWindow : Container { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private Label _NetworkStatusbar; private Label _Statusbar; private CursesUI _UI; private Entry _Entry; public CursesUI UI { get { return _UI; } } public Entry Entry { get { return _Entry; } } public MainWindow() : base(0, 0, Application.Cols, Application.Lines) { //Frame layout = new Frame(0,0, Application.Cols, Application.Lines, "smuxi"); //Add(layout); // menu Button fileButton = new Button(0, 0, "File"); fileButton.Clicked += delegate { Dialog dialog = new Dialog(40, 6, "File Menu"); Button quitButton = new Button(0, 0, "Quit"); quitButton.Clicked += delegate { Frontend.Quit(); }; dialog.AddButton(quitButton); Button closeButton = new Button(0, 0, "Close"); closeButton.Clicked += delegate { dialog.Running = false; dialog.Clear(); }; dialog.AddButton(closeButton); Application.Run(dialog); }; Add(fileButton); Button helpButton = new Button(10, 0, "Help"); helpButton.Clicked += delegate { Dialog dialog = new Dialog(30, 6, "Help Menu"); Button aboutButton = new Button(0, 0, "About"); aboutButton.Clicked += delegate { Dialog aboutDialog = new Dialog(70, 10, "About smuxi"); aboutDialog.Add(new Label(0, 0, "Smuxi")); aboutDialog.Add(new Label(0, 1, "Frontend: " + Frontend.UIName + " " + Frontend.Version)); aboutDialog.Add(new Label(0, 2, "Engine: " + Frontend.EngineVersion)); aboutDialog.Add(new Label(0, 4, "Copyright(C) 2005-2007 (C) Mirco Bauer ")); Button closeButton = new Button("Close"); closeButton.Clicked += delegate { aboutDialog.Running = false; aboutDialog.Clear(); }; aboutDialog.AddButton(closeButton); Application.Run(aboutDialog); }; dialog.AddButton(aboutButton); Button helpCloseButton = new Button(0, 0, "Close"); helpCloseButton.Clicked += delegate { dialog.Running = false; dialog.Clear(); }; dialog.AddButton(helpCloseButton); Application.Run(dialog); }; Add(helpButton); // output /* TextView textView = new TextView(0, 1, Application.Cols, Application.Lines -2); textView.Add("Hello World!"); textView.Add("Foo bar me!"); Add(textView); */ LogWidget log = new LogWidget(0, 1, Application.Cols, Application.Lines -2); Add(log); _UI = new CursesUI(log); // input Entry entry = new Entry(0, Application.Lines - 1, Application.Cols, String.Empty); Add(entry); _Entry = entry; // status } } } smuxi-0.11/src/Frontend-Curses/Entry.cs0000644000175000017500000000672411655545675020672 0ustar00meebeymeebey00000000000000/* * $Id: MainWindow.cs 192 2007-04-22 11:48:12Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/MainWindow.cs $ * $Rev: 192 $ * $Author: meebey $ * $Date: 2007-04-22 13:48:12 +0200 (Sun, 22 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using Mono.Unix; using Mono.Terminal; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Curses { public class Entry : Mono.Terminal.Entry { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public event EventHandler Activated; public Entry(int x, int y, int w, string s) : base(x, y, w, s) { } public override bool ProcessKey(int key) { Trace.Call(key); bool res = base.ProcessKey(key); if (key == 10) { OnActivated(EventArgs.Empty); } return res; } public virtual void OnActivated(EventArgs e) { ExecuteCommand(Text); if (Activated != null) { Activated(this, EventArgs.Empty); } Text = String.Empty; } public void ExecuteCommand(string cmd) { if (!(cmd.Length > 0)) { return; } bool handled = false; CommandModel cd = new CommandModel(Frontend.FrontendManager, null, (string)Frontend.UserConfig["Interface/Entry/CommandCharacter"], cmd); //handled = _Command(cd); if (!handled) { handled = Frontend.Session.Command(cd); } if (!handled) { // we may have no network manager yet Engine.IProtocolManager nm = Frontend.FrontendManager.CurrentProtocolManager; if (nm != null) { handled = nm.Command(cd); } else { handled = false; } } if (!handled) { _CommandUnknown(cd); } } private void _CommandUnknown(CommandModel cd) { cd.FrontendManager.AddTextToChat(cd.Chat, "-!- " + String.Format(Catalog.GetString( "Unknown Command: {0}"), cd.Command)); } } } smuxi-0.11/src/Frontend-Curses/TextView.cs0000644000175000017500000000334211655545675021341 0ustar00meebeymeebey00000000000000/* * $Id: MainWindow.cs 192 2007-04-22 11:48:12Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/MainWindow.cs $ * $Rev: 192 $ * $Author: meebey $ * $Date: 2007-04-22 13:48:12 +0200 (Sun, 22 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using Mono.Unix; using Mono.Terminal; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Curses { public class TextView : Container { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private int _CurrentLine; public TextView(int x, int y, int w, int h) : base(x, y, w, h) { } public void Add(string line) { Add(new Label(0, _CurrentLine++, line)); } } }smuxi-0.11/src/Frontend-Curses/Frontend.cs0000644000175000017500000001646111655545675021347 0ustar00meebeymeebey00000000000000/* * $Id: Frontend.cs 192 2007-04-22 11:48:12Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/Frontend.cs $ * $Rev: 192 $ * $Author: meebey $ * $Date: 2007-04-22 13:48:12 +0200 (Sun, 22 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using Mono.Terminal; using Smuxi.Engine; namespace Smuxi.Frontend.Curses { public class Frontend { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string _Name = "smuxi"; private static readonly string _UIName = "Curses"; private static Version _Version; private static string _VersionNumber; private static string _VersionString; private static Version _EngineVersion; private static MainWindow _MainWindow; private static FrontendConfig _FrontendConfig; private static Session _Session; private static UserConfig _UserConfig; private static FrontendManager _FrontendManager; public static string Name { get { return _Name; } } public static string UIName { get { return _UIName; } } public static Version Version { get { return _Version; } } public static Version EngineVersion { get { return _EngineVersion; } set { _EngineVersion = value; } } public static string VersionString { get { return _VersionString; } } public static MainWindow MainWindow { get { return _MainWindow; } } public static Session Session { get { return _Session; } set { _Session = value; } } public static FrontendManager FrontendManager { get { return _FrontendManager; } } public static Config Config { get { return _Session.Config; } } public static UserConfig UserConfig { get { return _UserConfig; } set { _UserConfig = value; } } public static FrontendConfig FrontendConfig { get { return _FrontendConfig; } } public static void Init(string[] args) { System.Threading.Thread.CurrentThread.Name = "Main"; Assembly asm = Assembly.GetAssembly(typeof(Frontend)); AssemblyName asm_name = asm.GetName(false); AssemblyProductAttribute pr = (AssemblyProductAttribute)asm. GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]; _Version = asm_name.Version; _VersionNumber = asm_name.Version.ToString(); _VersionString = pr.Product + " - " + _UIName + " frontend " + _Version; #if LOG4NET _Logger.Info(_VersionString + " starting"); #endif Application.Init(false); _MainWindow = new MainWindow(); _FrontendConfig = new FrontendConfig(UIName); // loading and setting defaults _FrontendConfig.Load(); _FrontendConfig.Save(); if (_FrontendConfig.IsCleanConfig) { } else { if (((string)FrontendConfig["Engines/Default"]).Length == 0) { InitLocalEngine(); } else { // there is a default engine set, means we want a remote engine //new EngineManagerDialog(); InitLocalEngine(); } } Application.Timeout = 100; Application.Iteration += delegate { Application.Refresh (); }; Application.Run(_MainWindow); #if LOG4NET _Logger.Warn("Application.Run() returned!"); #endif } public static void InitLocalEngine() { Engine.Engine.Init(); _EngineVersion = Engine.Engine.Version; _Session = new Engine.Session(Engine.Engine.Config, Engine.Engine.ProtocolManagerFactory, "local"); _Session.RegisterFrontendUI(_MainWindow.UI); _UserConfig = _Session.UserConfig; ConnectEngineToGUI(); } public static void ConnectEngineToGUI() { _FrontendManager = _Session.GetFrontendManager(_MainWindow.UI); _FrontendManager.Sync(); if (_UserConfig.IsCaching) { // when our UserConfig is cached, we need to invalidate the cache _FrontendManager.ConfigChangedDelegate = new SimpleDelegate(_UserConfig.ClearCache); } // make sure entry got attention :-P // BUG: MonoCurses //_MainWindow.Entry.HasFocus = true; } public static void DisconnectEngineFromGUI() { _FrontendManager.IsFrontendDisconnecting = true; //_Session.DeregisterFrontendUI(_MainWindow.UI); //_MainWindow.Hide(); //_MainWindow.Notebook.RemoveAllPages(); _FrontendManager = null; _Session = null; } public static void Quit() { Mono.Terminal.Curses.endwin(); Environment.Exit(0); if (_FrontendManager != null) { _FrontendManager.IsFrontendDisconnecting = true; } /* BUG: don't do this, the access to config is lost and the entry will throw an exception then. if (_FrontendManager != null) { DisconnectEngineFromGUI(); } */ } public static void ShowException(Exception ex) { Application.Error("Error occurred!", ex.ToString()); } } } smuxi-0.11/src/Frontend-Curses/LogWidget.cs0000644000175000017500000000466711655545675021462 0ustar00meebeymeebey00000000000000/* * $Id: MainWindow.cs 192 2007-04-22 11:48:12Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/MainWindow.cs $ * $Rev: 192 $ * $Author: meebey $ * $Date: 2007-04-22 13:48:12 +0200 (Sun, 22 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using Mono.Unix; using Mono.Terminal; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Curses { public class LogWidget : Widget { string [] messages = new string [80]; int head, tail; int count; public LogWidget (int x, int y, int w, int h) : base (x, y, w, h) { //Fill = Fill.Horizontal | Fill.Vertical; AddText ("Started"); } public void AddText (string s) { messages [head] = s; head++; if (head == messages.Length) head = 0; if (head == tail) tail = (tail+1) % messages.Length; } public override void Redraw () { Mono.Terminal.Curses.attrset(ColorNormal); int i = 0; int l; int n = head > tail ? head-tail : (head + messages.Length) - tail; for (l = h-1; l >= 0 && n-- > 0; l--){ int item = head-1-i; if (item < 0) item = messages.Length+item; Move (y+l, x); int sl = messages [item].Length; if (sl < w){ Mono.Terminal.Curses.addstr (messages [item]); for (int fi = 0; fi < w-sl; fi++) Mono.Terminal.Curses.addch (' '); } else { Mono.Terminal.Curses.addstr (messages [item].Substring (0, sl)); } i++; } for (; l >= 0; l--) { Move (y+l, x); for (i = 0; i < w; i++) Mono.Terminal.Curses.addch (' '); } } } } smuxi-0.11/src/Frontend-Curses/ChangeLog0000644000175000017500000000150711655545675021006 0ustar00meebeymeebey000000000000002008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-08-21 Mirco Bauer * MainWindow.cs, Frontend.cs, TextView.cs, Entry.cs, LogWidget.cs: Fixed whitespace (replaced \t with 4 spaces). 2008-07-27 Mirco Bauer * AssemblyInfo.cs, Frontend-Curses.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 2008-01-31 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * Frontend-Curses.mdp: Updated using MonoDevelop 0.18.1 smuxi-0.11/src/Frontend-Curses/Makefile.am0000644000175000017500000000727411655545675021277 0ustar00meebeymeebey00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = ../../bin/release/smuxi-frontend-curses.exe ASSEMBLY_MDB = COMPILE_TARGET = exe PROJECT_REFERENCES = \ ../../bin/release/smuxi-frontend.dll \ ../../bin/release/smuxi-engine.dll \ ../../bin/release/smuxi-common.dll BUILD_DIR = ../../bin/release LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_MDB= NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/release/smuxi-engine.dll MONO_CURSES_DLL_SOURCE=../../lib/mono-curses/mono-curses.dll SMUXI_FRONTEND_DLL_MDB= SMUXI_FRONTEND_DLL_SOURCE=../../bin/release/smuxi-frontend.dll SMUXI_COMMON_DLL_SOURCE=../../bin/release/smuxi-common.dll endif if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" ASSEMBLY = ../../bin/debug/smuxi-frontend-curses.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = exe PROJECT_REFERENCES = \ ../../bin/debug/smuxi-frontend.dll \ ../../bin/debug/smuxi-engine.dll \ ../../bin/debug/smuxi-common.dll BUILD_DIR = ../../bin/debug LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/debug/smuxi-engine.dll MONO_CURSES_DLL_SOURCE=../../lib/mono-curses/mono-curses.dll SMUXI_FRONTEND_DLL_MDB_SOURCE=../../bin/debug/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_MDB=$(BUILD_DIR)/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_SOURCE=../../bin/debug/smuxi-frontend.dll SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll endif AL=al2 SATELLITE_ASSEMBLY_NAME=.resources.dll PROGRAMFILES = \ $(LOG4NET_DLL) \ $(SMUXI_ENGINE_DLL_MDB) \ $(NINI_DLL) \ $(SMUXI_ENGINE_DLL) \ $(MONO_CURSES_DLL) \ $(SMUXI_FRONTEND_DLL_MDB) \ $(SMUXI_FRONTEND_DLL) \ $(SMUXI_COMMON_DLL) BINARIES = \ $(FRONTEND_CURSES) all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) FILES = \ Main.cs \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Frontend.cs \ MainWindow.cs \ Entry.cs \ CursesUI.cs \ TextView.cs \ LogWidget.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-frontend-curses.in REFERENCES = \ System \ Mono.Posix \ $(MONO_CURSES_LIBS) \ $(LOG4NET_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) include $(top_srcdir)/Makefile.include LOG4NET_DLL = $(BUILD_DIR)/log4net.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll FRONTEND_CURSES = $(BUILD_DIR)/smuxi-frontend-curses MONO_CURSES_DLL = $(BUILD_DIR)/mono-curses.dll SMUXI_FRONTEND_DLL = $(BUILD_DIR)/smuxi-frontend.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-wrapper,FRONTEND_CURSES,frontend-smuxi-curses,x)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) smuxi-0.11/src/Frontend-Curses/AssemblyInfo.cs0000644000175000017500000000255411655545675022161 0ustar00meebeymeebey00000000000000/* * $Id: AssemblyInfo.cs 197 2007-06-12 00:57:23Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/AssemblyInfo.cs $ * $Rev: 197 $ * $Author: meebey $ * $Date: 2007-06-12 02:57:23 +0200 (Tue, 12 Jun 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Smuxi - Curses frontend")] [assembly: AssemblyCopyright("2007-2008 (C) Mirco Bauer ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] smuxi-0.11/src/Frontend-Curses/smuxi-frontend-curses.in0000644000175000017500000000012211655545675024040 0ustar00meebeymeebey00000000000000#!/bin/sh exec mono "@expanded_libdir@/@PACKAGE@/smuxi-frontend-curses.exe" "$@" smuxi-0.11/src/Frontend-Curses/Makefile.in0000644000175000017500000010422012311344230021243 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/smuxi-frontend-curses.in \ ChangeLog subdir = src/Frontend-Curses ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = smuxi-frontend-curses CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ # Warning: This is an automatically generated file, do not edit! @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/debug/smuxi-frontend-curses.exe @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/release/smuxi-frontend-curses.exe @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = exe @ENABLE_RELEASE_TRUE@COMPILE_TARGET = exe @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-frontend.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-engine.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-frontend.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-engine.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-common.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin/debug @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin/release @ENABLE_DEBUG_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_RELEASE_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB = $(BUILD_DIR)/smuxi-engine.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_MDB = @ENABLE_DEBUG_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_RELEASE_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/debug/smuxi-engine.dll @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/release/smuxi-engine.dll @ENABLE_DEBUG_TRUE@MONO_CURSES_DLL_SOURCE = ../../lib/mono-curses/mono-curses.dll @ENABLE_RELEASE_TRUE@MONO_CURSES_DLL_SOURCE = ../../lib/mono-curses/mono-curses.dll @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_DLL_MDB = $(BUILD_DIR)/smuxi-frontend.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_FRONTEND_DLL_MDB = @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_DLL_SOURCE = ../../bin/debug/smuxi-frontend.dll @ENABLE_RELEASE_TRUE@SMUXI_FRONTEND_DLL_SOURCE = ../../bin/release/smuxi-frontend.dll @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/release/smuxi-common.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB_SOURCE = ../../bin/debug/smuxi-engine.dll.mdb @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_DLL_MDB_SOURCE = ../../bin/debug/smuxi-frontend.dll.mdb AL = al2 SATELLITE_ASSEMBLY_NAME = .resources.dll PROGRAMFILES = \ $(LOG4NET_DLL) \ $(SMUXI_ENGINE_DLL_MDB) \ $(NINI_DLL) \ $(SMUXI_ENGINE_DLL) \ $(MONO_CURSES_DLL) \ $(SMUXI_FRONTEND_DLL_MDB) \ $(SMUXI_FRONTEND_DLL) \ $(SMUXI_COMMON_DLL) BINARIES = \ $(FRONTEND_CURSES) FILES = \ Main.cs \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Frontend.cs \ MainWindow.cs \ Entry.cs \ CursesUI.cs \ TextView.cs \ LogWidget.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-frontend-curses.in REFERENCES = \ System \ Mono.Posix \ $(MONO_CURSES_LIBS) \ $(LOG4NET_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) $(ASSEMBLY) $(ASSEMBLY).mdb \ $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) LOG4NET_DLL = $(BUILD_DIR)/log4net.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll FRONTEND_CURSES = $(BUILD_DIR)/smuxi-frontend-curses MONO_CURSES_DLL = $(BUILD_DIR)/mono-curses.dll SMUXI_FRONTEND_DLL = $(BUILD_DIR)/smuxi-frontend.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Frontend-Curses/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Frontend-Curses/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): smuxi-frontend-curses: $(top_builddir)/config.status $(srcdir)/smuxi-frontend-curses.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-wrapper,FRONTEND_CURSES,frontend-smuxi-curses,x)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Frontend-Curses/CursesUI.cs0000644000175000017500000001054311655545675021265 0ustar00meebeymeebey00000000000000/* * $Id: TestUI.cs 179 2007-04-21 15:01:29Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-Test/TestUI.cs $ * $Rev: 179 $ * $Author: meebey $ * $Date: 2007-04-21 17:01:29 +0200 (Sat, 21 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend.Curses { public class CursesUI : PermanentRemoteObject, IFrontendUI { private int _Version = 0; private LogWidget _TextView; public int Version { get { return _Version; } } public CursesUI(LogWidget logWidget) { _TextView = logWidget; } public void AddChat(ChatModel page) { Trace.Call(page); //Console.WriteLine("New page: "+page.Name+ " type: "+page.ChatType); } public void AddMessageToChat(ChatModel page, MessageModel msg) { Trace.Call(page, msg); string finalMsg = String.Empty; foreach (MessagePartModel msgPart in msg.MessageParts) { // TODO: implement other types if (msgPart is TextMessagePartModel) { TextMessagePartModel fmsgti = (TextMessagePartModel) msgPart; finalMsg += fmsgti.Text; } } string timestamp; try { timestamp = msg.TimeStamp.ToLocalTime().ToString((string)Frontend.UserConfig["Interface/Notebook/TimestampFormat"]); } catch (FormatException e) { timestamp = "Timestamp Format ERROR: " + e.Message; } finalMsg = timestamp + " " + page.Name + " " + finalMsg; //Console.WriteLine(finalMsg); _TextView.AddText(finalMsg); } public void RemoveChat(ChatModel page) { Trace.Call(page); //Console.WriteLine("Removed page: "+page.Name+" type: "+page.ChatType); } public void EnableChat(ChatModel page) { Trace.Call(page); } public void DisableChat(ChatModel page) { Trace.Call(page); } public void SyncChat(ChatModel page) { Trace.Call(page); //Console.WriteLine("Synced page: "+page.Name+" type: "+page.ChatType); // HACK: fake that we synced the chat, else we get no messages Frontend.FrontendManager.AddSyncedChat(page); } public void AddPersonToGroupChat(GroupChatModel cpage, PersonModel user) { Trace.Call(cpage, user); } public void UpdatePersonInGroupChat(GroupChatModel cpage, PersonModel olduser, PersonModel newuser) { Trace.Call(cpage, olduser, newuser); } public void UpdateTopicInGroupChat(GroupChatModel cpage, MessageModel topic) { Trace.Call(cpage, topic); //Console.WriteLine("Topic changed to: "+topic+ " on "+cpage.Name); } public void RemovePersonFromGroupChat(GroupChatModel cpage, PersonModel user) { Trace.Call(cpage, user); } public void SetNetworkStatus(string status) { Trace.Call(status); } public void SetStatus(string status) { Trace.Call(status); } } } smuxi-0.11/src/Engine-IRC/0000755000175000017500000000000012311344240015777 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-IRC/smuxi-engine-irc.pc.in0000644000175000017500000000022411655545675022142 0ustar00meebeymeebey00000000000000Name: smuxi-engine-irc Description: Engine-IRC Version: @VERSION@ Requires: smuxi-engine Libs: -r:@expanded_libdir@/@PACKAGE@/smuxi-engine-irc.dll smuxi-0.11/src/Engine-IRC/ChangeLog0000644000175000017500000001415711655545675017612 0ustar00meebeymeebey000000000000002008-12-28 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Don't log ThreadAbortException as error, as we expect them. 2008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-12-28 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Implemented /names command. (closes trac ticket #120) 2008-12-24 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Fixed CommandQuit(), it will not cause a reconnect anymore by preparing the IRC library and the Listen() thread before we send the QUIT to the server. (closes trac bug #139) 2008-12-19 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Don't create a new chat for outgoing notices, only use it if it's already there. 2008-12-19 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Notices are not highlights and incoming and outgoing notices always create a chat (when missing). (closes trac bug #45) 2008-12-17 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Implemented distinction of event and normal messages. (closes trac ticket #66) 2008-08-31 Mirco Bauer * Engine-IRC.mdp: Added po files to MonoDevelop projects. 2008-08-31 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Implemented new commands: /amsg /anotice /ame. (closes trac ticket #109) Fixed crash bug in /notice command. (closes trac ticket #108) Fixed display bug in /msg #channel when being in the channel. 2008-08-25 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Sync person chats after re-enabling them in OnConnected, else they don't get new messages. (closes trac bug #99) 2008-08-24 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Using LibraryCatalog now. 2008-08-24 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Kill threads we started when disconnecting. 2008-08-21 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Dispose all chats after quitting in CommandQuit(). 2008-08-05 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Colorize nicks in nick changes and quit messages. 2008-08-04 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: _OnNickChange(): Nick changes now use colored nicks. 2008-07-31 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Fixed /help command to spit out the header in the session instead of the frontend manager directly. 2008-07-29 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Fixed resetting colors in messages where clear control character is used. (thanks to Zhila for spotting this) 2008-07-27 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Don't pass ReceiveType.List to protocol chat. 2008-07-27 Mirco Bauer * AssemblyInfo.cs, AssemblyInfo.cs.in: Removed AssemblyInfo.cs.in files, not needed anymore as we use a shared AssemblyVersion.cs(.in) now. 2008-07-27 Mirco Bauer * Engine-IRC.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-07-17 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Added listing ban list support to /ban command (closes trac bug #17). 2008-07-17 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Implemented /who command (closes trac bug #51). 2008-07-15 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Use global username if server username is empty (closes trac bug #36). Set highlight for query actions and notices. 2008-07-15 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Implemented FindGroupChats(). Implemented OpenChat(). Implemented CloseChat(). 2008-07-14 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Fixed CommandCycle(). 2008-07-07 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Implemented lag indicator. 2008-06-30 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Pass IRC errors to frontend. Pass IRC messages to protocol manager also if being on session chat. 2008-06-02 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: _Run(): Fixed reconnect handling. OnDisconnected(): Don't disable the protocol chat, else the user loses the control over the protocol manager. 2008-06-02 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Renamed confusing NetworkChatModel to ProtocolChatModel and ChatType.Network to ChatType.Protocol. 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 2008-03-02 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: When connecting to a new server call SyncChat() after AddChat(), else already connected frontends will not get any messages. 2008-03-02 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: CommandMessageQuery() sends message now once. CommandPart() sends part message now correctly when no channel name was given. CommandMe() uses now nickname coloring. _OnJoin() uses now nickname coloring. _OnPart() uses now nickname coloring. 2008-03-02 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Trim trailing spaces in commands that use space as separator (like op/deop). 2008-03-02 Mirco Bauer * Protocols/Irc/IrcProtocolManager.cs: Reply error message when channel is moderated. 2008-01-31 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * Engine-IRC.mdp: Updated using MonoDevelop 0.18.1 * Protocols/Irc/IrcProtocolManager.cs: Added some "not enough parameters" to commands. smuxi-0.11/src/Engine-IRC/Makefile.am0000644000175000017500000000604412253423337020051 0ustar00meebeymeebey00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = ../../bin/release/smuxi-engine-irc.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/release/smuxi-common.dll \ ../../bin/release/smuxi-engine.dll BUILD_DIR = ../../bin/release SMUXI_ENGINE_DLL_MDB= LOG4NET_DLL_SOURCE=../../lib/log4net.dll NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/release/smuxi-engine.dll SMUXI_COMMON_DLL_SOURCE=../../bin/release/smuxi-common.dll endif if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" ASSEMBLY = ../../bin/debug/smuxi-engine-irc.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/debug/smuxi-common.dll \ ../../bin/debug/smuxi-engine.dll BUILD_DIR = ../../bin/debug SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb LOG4NET_DLL_SOURCE=../../lib/log4net.dll NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/debug/smuxi-engine.dll SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll endif AL=al2 SATELLITE_ASSEMBLY_NAME=.resources.dll PROGRAMFILES = \ $(LOG4NET_DLL) \ $(NINI_DLL) \ $(SMUXI_COMMON_DLL) \ $(SMUXI_COMMON_DLL_MDB) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_ENGINE_DLL_MDB) LINUX_PKGCONFIG = \ $(ENGINE_IRC_PC) all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) FILES = \ Protocols/Irc/IrcGroupPersonModel.cs \ Protocols/Irc/IrcMessageBuilder.cs \ Protocols/Irc/IrcProtocolManager.cs \ Protocols/Irc/IrcPersonModel.cs \ Protocols/Irc/IrcTextColor.cs \ Config/IrcServerModel.cs \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-engine-irc.pc.in REFERENCES = \ System \ System.Core \ Mono.Posix \ $(LOG4NET_LIBS) DLL_REFERENCES = \ $(BUILD_DIR)/Meebey.SmartIrc4net.dll CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) include $(top_srcdir)/Makefile.include ENGINE_IRC_PC = $(BUILD_DIR)/smuxi-engine-irc.pc SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll $(eval $(call emit-deploy-wrapper,ENGINE_IRC_PC,smuxi-engine-irc.pc)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) smuxi-0.11/src/Engine-IRC/AssemblyInfo.cs0000644000175000017500000000236312253423337020737 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Smuxi - IRC protocol support")] [assembly: AssemblyCopyright("2005-2013 (C) Mirco Bauer ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] smuxi-0.11/src/Engine-IRC/Protocols/0000755000175000017500000000000012311344240017763 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-IRC/Protocols/Irc/0000755000175000017500000000000012311344240020500 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-IRC/Protocols/Irc/IrcTextColor.cs0000644000175000017500000001305211655545675023442 0ustar00meebeymeebey00000000000000/* * $Id: Config.cs 100 2005-08-07 14:54:22Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/Config.cs $ * $Rev: 100 $ * $Author: meebey $ * $Date: 2005-08-07 16:54:22 +0200 (Sun, 07 Aug 2005) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.Engine { [Serializable] public static class IrcTextColor { private static TextColor _Normal = new TextColor(-1); private static TextColor _White = new TextColor(0xFFFFFF); private static TextColor _Black = new TextColor(0x000000); private static TextColor _Blue = new TextColor(0x0000FF); private static TextColor _Green = new TextColor(0x008000); private static TextColor _Red = new TextColor(0xFF0000); private static TextColor _Brown = new TextColor(0xA52A2A); private static TextColor _Purple = new TextColor(0x800080); private static TextColor _Orange = new TextColor(0xFFA500); private static TextColor _Yellow = new TextColor(0xFFFF00); private static TextColor _LightGreen = new TextColor(0x00FF00); private static TextColor _Teal = new TextColor(0x008080); private static TextColor _LightCyan = new TextColor(0xE0FFFF); //static private TextColor _LightBlue = new TextColor(0xADD8E6); private static TextColor _LightBlue = new TextColor(0xA4C8E0); private static TextColor _LightPurple = new TextColor(0xEE82EE); private static TextColor _Grey = new TextColor(0x808080); private static TextColor _LightGrey = new TextColor(0xD3D3D3); public static TextColor Normal { get { return _Normal; } set { _Normal = value; } } public static TextColor White { get { return _White; } set { _White = value; } } public static TextColor Black { get { return _Black; } set { _Black = value; } } public static TextColor Blue { get { return _Blue; } set { _Blue = value; } } public static TextColor Green { get { return _Green; } set { _Green = value; } } public static TextColor Red { get { return _Red; } set { _Red = value; } } public static TextColor Brown { get { return _Brown; } set { _Brown = value; } } public static TextColor Purple { get { return _Purple; } set { _Purple = value; } } public static TextColor Orange { get { return _Orange; } set { _Orange = value; } } public static TextColor Yellow { get { return _Yellow; } set { _Yellow = value; } } public static TextColor LightGreen { get { return _LightGreen; } set { _LightGreen = value; } } public static TextColor Teal { get { return _Teal; } set { _Teal = value; } } public static TextColor LightCyan { get { return _LightCyan; } set { _LightCyan = value; } } public static TextColor LightBlue { get { return _LightBlue; } set { _LightBlue = value; } } public static TextColor LightPurple { get { return _LightPurple; } set { _LightPurple = value; } } public static TextColor Grey { get { return _Grey; } set { _Grey = value; } } public static TextColor LightGrey { get { return _LightGrey; } set { _LightGrey = value; } } } } smuxi-0.11/src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs0000644000175000017500000046726112300201645024600 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2014 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Text; using System.Text.RegularExpressions; using System.Security.Cryptography.X509Certificates; using System.Globalization; using System.Threading; using System.Collections; using System.Collections.Generic; using System.Linq; using Meebey.SmartIrc4net; using Smuxi.Common; using IrcProxyType = Meebey.SmartIrc4net.ProxyType; namespace Smuxi.Engine { [ProtocolManagerInfo(Name = "IRC", Description = "Internet Relay Chat", Alias = "irc")] public class IrcProtocolManager : ProtocolManagerBase { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string _LibraryTextDomain = "smuxi-engine-irc"; private IrcFeatures _IrcClient; private ServerModel _ServerModel; private string _Host; private int _Port; private string _Network; private string[] _Nicknames; string _Realname; private int _CurrentNickname; private string _Username; private string _Password; private FrontendManager _FrontendManager; private bool _Listening; private ChatModel _NetworkChat; private TimeSpan _LastLag; private Thread _RunThread; private Thread _LagWatcherThread; private TaskQueue _ChannelJoinQueue = new TaskQueue("JoinChannelQueue"); private List _QueuedChannelJoinList = new List(); private List _ActiveChannelJoinList = new List(); private AutoResetEvent _ActiveChannelJoinHandle = new AutoResetEvent(false); bool HasListMaskSearchSupport { get; set; } bool HasSafeListSupport { get; set; } IList NetworkChannels { get; set; } DateTime NetworkChannelsAge { get; set; } TimeSpan NetworkChannelsMaxAge { get; set; } List ChannelTypes { get; set; } public override bool IsConnected { get { if ((_IrcClient != null) && (_IrcClient.IsConnected)) { return true; } return false; } } public override string Host { get { if (_IrcClient == null) { return null; } return _IrcClient.Address; } } public override int Port { get { if (_IrcClient == null) { return -1; } return _IrcClient.Port; } } public override string NetworkID { get { if (String.IsNullOrEmpty(_Network)) { return _IrcClient.Address; } return _Network; } } public override string Protocol { get { return "IRC"; } } public override ChatModel Chat { get { return _NetworkChat; } } private string Prefix { get { if (_IrcClient == null) { return String.Empty; } if (IrcMe == null) { return _IrcClient.Nickname; } return String.Format("{0}!{1}@{2}", _IrcClient.Nickname, IrcMe.Ident, IrcMe.Host); } } private IrcPersonModel IrcMe { get { return (IrcPersonModel) Me; } set { Me = value; } } public IrcProtocolManager(Session session) : base(session) { Trace.Call(session); NetworkChannelsMaxAge = TimeSpan.FromMinutes(5); ChannelTypes = new List(new string[] {"#", "&", "!", "+"}); _IrcClient = new IrcFeatures(); _IrcClient.AutoRetry = true; // keep retrying to connect forever _IrcClient.AutoRetryLimit = 0; _IrcClient.AutoRetryDelay = 120; _IrcClient.AutoReconnect = true; _IrcClient.AutoRelogin = true; _IrcClient.AutoRejoin = true; // HACK: SmartIrc4net <= 0.4.5.1 is not resetting the nickname list // after disconnect. This causes random nicks to be used when there // are many reconnects like when the network connection goes flaky, // see: http://projects.qnetp.net/issues/show/163 _IrcClient.AutoNickHandling = false; _IrcClient.CtcpVersion = Engine.VersionString; _IrcClient.SendDelay = 250; _IrcClient.SupportNonRfc = true; _IrcClient.OnRawMessage += new IrcEventHandler(_OnRawMessage); _IrcClient.OnChannelMessage += new IrcEventHandler(_OnChannelMessage); _IrcClient.OnChannelAction += new ActionEventHandler(_OnChannelAction); _IrcClient.OnChannelNotice += new IrcEventHandler(_OnChannelNotice); _IrcClient.OnQueryMessage += new IrcEventHandler(_OnQueryMessage); _IrcClient.OnQueryAction += new ActionEventHandler(_OnQueryAction); _IrcClient.OnQueryNotice += new IrcEventHandler(_OnQueryNotice); _IrcClient.OnJoin += new JoinEventHandler(_OnJoin); _IrcClient.OnNames += new NamesEventHandler(_OnNames); _IrcClient.OnPart += new PartEventHandler(_OnPart); _IrcClient.OnKick += new KickEventHandler(_OnKick); _IrcClient.OnNickChange += new NickChangeEventHandler(_OnNickChange); _IrcClient.OnOwner += new OwnerEventHandler(OnOwner); _IrcClient.OnDeowner += new DeownerEventHandler(OnDeowner); _IrcClient.OnChannelAdmin += new ChannelAdminEventHandler(OnChannelAdmin); _IrcClient.OnDeChannelAdmin += new DeChannelAdminEventHandler(OnDeChannelAdmin); _IrcClient.OnOp += new OpEventHandler(_OnOp); _IrcClient.OnDeop += new DeopEventHandler(_OnDeop); _IrcClient.OnHalfop += new HalfopEventHandler(OnHalfop); _IrcClient.OnDehalfop += new DehalfopEventHandler(OnDehalfop); _IrcClient.OnVoice += new VoiceEventHandler(_OnVoice); _IrcClient.OnDevoice += new DevoiceEventHandler(_OnDevoice); _IrcClient.OnModeChange += new IrcEventHandler(_OnModeChange); _IrcClient.OnTopic += new TopicEventHandler(_OnTopic); _IrcClient.OnTopicChange += new TopicChangeEventHandler(_OnTopicChange); _IrcClient.OnQuit += new QuitEventHandler(_OnQuit); _IrcClient.OnRegistered += new EventHandler(_OnRegistered); _IrcClient.OnDisconnected += new EventHandler(_OnDisconnected); _IrcClient.OnAutoConnectError += OnAutoConnectError; _IrcClient.OnAway += new AwayEventHandler(_OnAway); _IrcClient.OnUnAway += new IrcEventHandler(_OnUnAway); _IrcClient.OnNowAway += new IrcEventHandler(_OnNowAway); _IrcClient.OnCtcpRequest += new CtcpEventHandler(_OnCtcpRequest); _IrcClient.OnCtcpReply += new CtcpEventHandler(_OnCtcpReply); _IrcClient.OnWho += OnWho; _IrcClient.OnInvite += OnInvite; _IrcClient.OnReadLine += OnReadLine; _IrcClient.OnWriteLine += OnWriteLine; _IrcClient.CtcpUserInfo = (string) Session.UserConfig["Connection/Realname"]; // disabled as we don't use / support DCC yet _IrcClient.CtcpDelegates.Remove("dcc"); // finger we handle ourself, no little helga here! _IrcClient.CtcpDelegates["finger"] = delegate(CtcpEventArgs e) { _IrcClient.SendMessage( SendType.CtcpReply, e.Data.Nick, String.Format("{0} {1}", e.CtcpCommand, _IrcClient.CtcpUserInfo ) ); }; // time we handle ourself _IrcClient.CtcpDelegates["time"] = delegate(CtcpEventArgs e) { _IrcClient.SendMessage( SendType.CtcpReply, e.Data.Nick, String.Format("{0} {1}", e.CtcpCommand, DateTime.Now.ToString( "ddd MMM dd HH:mm:ss yyyy", DateTimeFormatInfo.InvariantInfo ) ) ); }; } private void OnWho(object sender, WhoEventArgs e) { if (e.WhoInfo.Nick == _IrcClient.Nickname) { // that's me! IrcMe.Ident = e.WhoInfo.Ident; IrcMe.Host = e.WhoInfo.Host; IrcMe.RealName = e.WhoInfo.Realname; } } private void OnInvite(object sender, InviteEventArgs e) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.MessageType = MessageType.Normal; var msg = builder.CreateFormat(_("{0} invites you to {1}"), CreatePerson(e.Who), e.Channel); foreach (var part in msg) { part.IsHighlight = true; } builder.Append(msg); Session.AddMessageToChat(_NetworkChat, builder.ToMessage()); builder = CreateMessageBuilder(); string host; if (String.IsNullOrEmpty(NetworkID)) { host = _IrcClient.Address; } else { host = NetworkID; var serverSettings = new ServerListController(Session.UserConfig); var server = serverSettings.GetServerByNetwork(host); if (server == null) { // if the network is not stored in config, we need to // fallback to the bare server address. Otherwise the // frontend will have no idea how to connect to it. host = _IrcClient.Address; } } string url = String.Format("irc://{0}/{1}", host, e.Channel); builder.AppendUrl(url, _("Accept invite (join room)")); Session.AddMessageToChat(_NetworkChat, builder.ToMessage()); } void OnReadLine(object sender, ReadLineEventArgs e) { DebugRead(e.Line); } void OnWriteLine(object sender, WriteLineEventArgs e) { DebugWrite(e.Line); } public override string ToString() { string result = null; if (_IrcClient != null) { if (String.IsNullOrEmpty(_Network)) { result += _IrcClient.Address; } else { result += _Network; } } result += " (IRC)"; if (IsConnected) { if (_IrcClient.IsAway) { result += " (" + _("away") + ")"; } if (_IrcClient.Lag > TimeSpan.FromSeconds(5)) { result += String.Format(" ({0})", String.Format( // TRANSLATOR: {0} is the amount of seconds _("lag: {0} seconds"), (int) _IrcClient.Lag.TotalSeconds ) ); } } else { result += " (" + _("not connected") + ")"; } return result; } public override void Connect(FrontendManager fm, ServerModel server) { Trace.Call(fm, server); if (fm == null) { throw new ArgumentNullException("fm"); } if (server == null) { throw new ArgumentNullException("server"); } _FrontendManager = fm; _ServerModel = server; ApplyConfig(Session.UserConfig, server); // TODO: use config for single network chat or once per network manager _NetworkChat = Session.CreateChat( _Network, "IRC " + _Network, this ); // BUG: race condition when we use Session.AddChat() as it pushes this already // to the connected frontend and the frontend will sync and get the page 2 times! //Session.Chats.Add(_NetworkChat); // NOTABUG: the frontend manager needs to take care for that Session.AddChat(_NetworkChat); Session.SyncChat(_NetworkChat); _RunThread = new Thread(new ThreadStart(_Run)); _RunThread.IsBackground = true; _RunThread.Name = String.Format( "IrcProtocolManager ({0}:{1}) listener", server.Hostname, server.Port ); _RunThread.Start(); _LagWatcherThread = new Thread(new ThreadStart(_LagWatcher)); _LagWatcherThread.IsBackground = true; _LagWatcherThread.Name = String.Format( "IrcProtocolManager ({0}:{1}) lag watcher", server.Hostname, server.Port ); _LagWatcherThread.Start(); } public void Connect(FrontendManager fm) { Trace.Call(fm); MessageBuilder builder; try { if (!String.IsNullOrEmpty(_IrcClient.ProxyHost)) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Using proxy: {0}:{1}"), _IrcClient.ProxyHost, _IrcClient.ProxyPort); Session.AddMessageToChat(Chat, builder.ToMessage()); } string msg; msg = String.Format(_("Connecting to {0} port {1}..."), _Host, _Port); if (fm != null) { fm.SetStatus(msg); } builder = CreateMessageBuilder(); builder.AppendEventPrefix().AppendText(msg); Session.AddMessageToChat(Chat, builder.ToMessage()); // TODO: add SSL support _IrcClient.Connect(_Host, _Port); if (fm != null) { fm.UpdateNetworkStatus(); } msg = String.Format(_("Connection to {0} established"), _Host); if (fm != null) { fm.SetStatus(msg); } builder = CreateMessageBuilder(); builder.AppendEventPrefix().AppendText(msg); Session.AddMessageToChat(Chat, builder.ToMessage()); builder = CreateMessageBuilder(); builder.AppendEventPrefix().AppendText(_("Logging in...")); Session.AddMessageToChat(Chat, builder.ToMessage()); string realname = _Realname; if (realname == null || realname.Trim().Length == 0) { realname = "unset"; } if (!Regex.IsMatch(_Username, "^[a-z0-9]+$", RegexOptions.IgnoreCase)) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendWarningText( "Warning: Your username (ident) contains special " + "characters which the IRC server might refuse. " + "If this happens please change your username in the " + "server settings." ); Session.AddMessageToChat(_NetworkChat, builder.ToMessage()); } _IrcClient.Login(_Nicknames, realname, 0, _Username, _Password); // set Me property very early as we might need to know who we // are before the registration was confirmed in _OnRegistered() Me = CreatePerson(_IrcClient.Nickname); foreach (string command in (string[]) Session.UserConfig["Connection/OnConnectCommands"]) { if (command.Length == 0) { continue; } CommandModel cd = new CommandModel(_FrontendManager, _NetworkChat, (string) Session.UserConfig["Interface/Entry/CommandCharacter"], command); bool handled; handled = Session.Command(cd); if (!handled) { Command(cd); } } _Listening = true; } catch (CouldNotConnectException ex) { if (fm != null) { fm.SetStatus(_("Connection failed!")); } builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Connection failed! Reason: ")); builder.AppendText(ex.Message); Session.AddMessageToChat(Chat, builder.ToMessage()); throw; } } public override void Disconnect(FrontendManager fm) { Trace.Call(fm); MessageBuilder builder; if (fm != null) { fm.SetStatus(_("Disconnecting...")); } if (IsConnected) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Disconnecting from {0}..."), _IrcClient.Address); Session.AddMessageToChat(Chat, builder.ToMessage()); // else the Listen() thread would try to connect again _Listening = false; _IrcClient.Disconnect(); if (fm != null) { fm.SetStatus(String.Format(_("Disconnected from {0}"), _IrcClient.Address)); } builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Connection closed")); Session.AddMessageToChat(Chat, builder.ToMessage()); // TODO: set someone else as current network manager? } else { if (fm != null) { fm.SetStatus(String.Empty); } builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Not connected")); Session.AddMessageToFrontend(fm, Chat, builder.ToMessage()); } if (_RunThread != null && _RunThread.IsAlive) { try { _RunThread.Abort(); } catch (Exception ex) { #if LOG4NET _Logger.Error("_RunThread.Abort() failed:", ex); #endif } } if (_LagWatcherThread != null && _LagWatcherThread.IsAlive) { try { _LagWatcherThread.Abort(); } catch (Exception ex) { #if LOG4NET _Logger.Error("_LagWatcherThread.Abort() failed:", ex); #endif } } if (fm != null) { fm.UpdateNetworkStatus(); } } public override void Reconnect(FrontendManager fm) { Trace.Call(fm); MessageBuilder builder; if (fm != null) { fm.SetStatus(_("Reconnecting...")); } try { string msg; if (_IrcClient != null) { if (_IrcClient.IsConnected) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Reconnecting to {0}..."), _IrcClient.Address); Session.AddMessageToChat(Chat, builder.ToMessage()); ApplyConfig(Session.UserConfig, _ServerModel); _IrcClient.Reconnect(true); msg = String.Format(_("Connection to {0} established"), _IrcClient.Address); if (fm != null) { fm.SetStatus(msg); } builder = CreateMessageBuilder(); builder.AppendEventPrefix().AppendText(msg); Session.AddMessageToChat(Chat, builder.ToMessage()); } else { Connect(fm); } } else { msg = _("Reconnect Error"); if (fm != null) { fm.SetStatus(msg); } builder = CreateMessageBuilder(); builder.AppendEventPrefix().AppendText(msg); Session.AddMessageToChat(Chat, builder.ToMessage()); } } catch (ConnectionException) { if (fm != null) { fm.SetStatus(String.Empty); } builder = CreateMessageBuilder(); builder.AppendEventPrefix().AppendText(_("Not connected")); Session.AddMessageToFrontend(fm, Chat, builder.ToMessage()); } if (fm != null) { fm.UpdateNetworkStatus(); } } public override void Dispose() { Trace.Call(); _ChannelJoinQueue.Dispose(); base.Dispose(); } public override IList FindGroupChats(GroupChatModel filter) { Trace.Call(filter); // invalidate channel list cache when too old if (NetworkChannels != null && (DateTime.UtcNow - NetworkChannelsAge) > NetworkChannelsMaxAge) { NetworkChannels = null; } string searchPattern = null; if (filter == null || String.IsNullOrEmpty(filter.Name)) { // full channel list } else { if (!filter.Name.StartsWith("*") && !filter.Name.EndsWith("*")) { searchPattern = String.Format("*{0}*", filter.Name); } else { searchPattern = filter.Name; } } var channels = NetworkChannels; if (channels == null && HasSafeListSupport) { // fetch and cache full channel list from server channels = _IrcClient.GetChannelList(String.Empty); NetworkChannels = channels; NetworkChannelsAge = DateTime.UtcNow; } else if (channels == null && searchPattern != null && HasListMaskSearchSupport) { channels = _IrcClient.GetChannelList(searchPattern); } else if (channels == null) { // Houston, we have a problem // no safelist and empty search pattern, the IRCd might kill us! channels = _IrcClient.GetChannelList(String.Empty); NetworkChannels = channels; NetworkChannelsAge = DateTime.UtcNow; } List chats = new List(channels.Count); foreach (ChannelInfo info in channels) { if (channels == NetworkChannels && searchPattern != null && !Pattern.IsMatch(info.Channel, searchPattern)) { continue; } GroupChatModel chat = new GroupChatModel( info.Channel, info.Channel, null ); chat.PersonCount = info.UserCount; var topic = CreateMessageBuilder(); topic.AppendMessage(info.Topic); chat.Topic = topic.ToMessage(); chats.Add(chat); } return chats; } public override void OpenChat(FrontendManager fm, ChatModel chat) { Trace.Call(fm, chat); CommandModel cmd = new CommandModel(fm, _NetworkChat, chat.ID); switch (chat.ChatType) { case ChatType.Person: CommandQuery(cmd); break; case ChatType.Group: CommandJoin(cmd); break; } } public override void CloseChat(FrontendManager fm, ChatModel chatInfo) { Trace.Call(fm, chatInfo); if (fm == null) { throw new ArgumentNullException("fm"); } if (chatInfo == null) { throw new ArgumentNullException("chatInfo"); } // get real chat object from session var chat = GetChat(chatInfo.ID, chatInfo.ChatType); if (chat == null) { #if LOG4NET _Logger.Error("CloseChat(): Session.GetChat(" + chatInfo.ID + ", " + chatInfo.ChatType + ")" + " returned null!"); #endif return; } if (!chat.IsEnabled) { Session.RemoveChat(chat); return; } switch (chat.ChatType) { case ChatType.Person: Session.RemoveChat(chat); break; case ChatType.Group: CommandModel cmd = new CommandModel(fm, _NetworkChat, chat.ID); CommandPart(cmd); break; } } public override void SetPresenceStatus(PresenceStatus status, string message) { Trace.Call(status, message); if (!_IrcClient.IsConnected) { return; } switch (status) { case PresenceStatus.Online: if (!_IrcClient.IsAway) { // nothing to do return; } _IrcClient.RfcAway(); break; case PresenceStatus.Away: if (String.IsNullOrEmpty(message)) { // HACK: empty away message unsets away state on IRC message = "away"; } _IrcClient.RfcAway(message); break; } } public override bool Command(CommandModel command) { Trace.Call(command); bool handled = false; if (IsConnected) { if (command.IsCommand) { // commands which work when we have a connection switch (command.Command) { case "help": CommandHelp(command); handled = true; break; // commands which work on serverchat/channels/queries case "j": case "join": CommandJoin(command); handled = true; break; case "msg": CommandMessage(command); handled = true; break; case "query": CommandQuery(command); handled = true; break; case "amsg": CommandAllMessage(command); handled = true; break; case "anotice": CommandAllNotice(command); handled = true; break; case "ame": CommandAllMe(command); handled = true; break; case "notice": CommandNotice(command); handled = true; break; case "nick": CommandNick(command); handled = true; break; case "raw": case "quote": CommandRaw(command); handled = true; break; case "ping": CommandPing(command); handled = true; break; case "version": CommandVersion(command); handled = true; break; case "time": CommandTime(command); handled = true; break; case "finger": CommandFinger(command); handled = true; break; case "who": CommandWho(command); handled = true; break; case "whois": CommandWhoIs(command); handled = true; break; case "whowas": CommandWhoWas(command); handled = true; break; case "away": CommandAway(command); // send away on all other IRC networks too lock (Session.ProtocolManagers) { foreach (IProtocolManager nm in Session.ProtocolManagers) { if (nm == this) { // skip us, else we send it 2 times continue; } if (nm is IrcProtocolManager) { IrcProtocolManager ircnm = (IrcProtocolManager)nm; ircnm.CommandAway(command); } } } handled = true; break; case "ctcp": CommandCtcp(command); handled = true; break; // commands which only work on channels or queries case "me": CommandMe(command); handled = true; break; case "say": CommandSay(command); handled = true; break; // commands which only work on channels case "p": case "part": CommandPart(command); handled = true; break; case "topic": CommandTopic(command); handled = true; break; case "cycle": case "rejoin": CommandCycle(command); handled = true; break; case "op": CommandOp(command); handled = true; break; case "deop": CommandDeop(command); handled = true; break; case "owner": CommandOwner(command); handled = true; break; case "deowner": CommandDeowner(command); handled = true; break; case "chanadmin": CommandChanAdmin(command); handled = true; break; case "dechanadmin": CommandDeChanAdmin(command); handled = true; break; case "halfop": CommandHalfop(command); handled = true; break; case "dehalfop": CommandDehalfop(command); handled = true; break; case "voice": CommandVoice(command); handled = true; break; case "devoice": CommandDevoice(command); handled = true; break; case "ban": CommandBan(command); handled = true; break; case "unban": CommandUnban(command); handled = true; break; case "banexcept": CommandBanException(command); handled = true; break; case "unbanexcept": CommandUnBanException(command); handled = true; break; case "inviteexcept": CommandInviteException(command); handled = true; break; case "uninviteexcept": CommandUnInviteException(command); handled = true; break; case "kick": CommandKick(command); handled = true; break; case "kickban": case "kb": CommandKickban(command); handled = true; break; case "mode": CommandMode(command); handled = true; break; case "invite": CommandInvite(command); handled = true; break; case "names": CommandNames(command); handled = true; break; case "quit": CommandQuit(command); handled = true; break; case "sleep": int amount = 0; if (Int32.TryParse(command.Parameter, out amount)) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText( _("Sleeping for {0} milliseconds"), amount ). ToMessage(); Session.AddMessageToChat(Chat, msg); Thread.Sleep(amount); } else { _NotEnoughParameters(command); } handled = true; break; } } else { // normal text if (command.Chat.ChatType == ChatType.Session || command.Chat.ChatType == ChatType.Protocol) { // we are on the session chat or protocol chat _IrcClient.WriteLine(command.Data); } else { // split multiline messages string[] lines = command.Data.Split(new char[] {'\n'}); foreach (string line in lines) { // split too long messages var messages = SplitMessage("PRIVMSG", command.Chat.ID, line); foreach (string message in messages) { _Say(command.Chat, message); } } } handled = true; } } else { if (command.IsCommand) { // commands which work even without beeing connected switch (command.Command) { case "help": CommandHelp(command); handled = true; break; case "connect": CommandConnect(command); handled = true; break; } } else { // normal text, without connection _NotConnected(command); handled = true; } } return handled; } private void CommandFallback(CommandModel cmd) { string parameters; if (cmd.DataArray.Length <= 3) { parameters = cmd.Parameter; } else { parameters = String.Format("{0} :{1}", cmd.DataArray[1], String.Join(" ", cmd.DataArray, 2, cmd.DataArray.Length - 2)); } string data = String.Format("{0}raw {1} {2}", cmd.CommandCharacter, cmd.Command, parameters); CommandModel command = new CommandModel( cmd.FrontendManager, cmd.Chat, cmd.CommandCharacter, data ); CommandRaw(command); } public void CommandHelp(CommandModel cd) { var builder = CreateMessageBuilder(); // TRANSLATOR: this line is used as label / category for a // list of commands below builder.AppendHeader(_("IrcProtocolManager Commands")); Session.AddMessageToFrontend(cd, builder.ToMessage()); string[] help = { "connect irc server [port|+port] [password] [nicknames]", "say", "join/j channel(s) [key]", "part/p [channel(s)] [part-message]", "topic [new-topic]", "names", "cycle/rejoin", "msg/query (channel|nick) message", "amsg message", "me action-message", "ame action-message", "notice (channel|nick) message", "anotice message", "invite nick [channel]", "who nick/channel", "whois nick", "whowas nick", "ping nick", "version nick", "time nick", "finger nick", "mode [target] [new-mode]", "away [away-message]", "kick nick(s) [reason]", "kickban/kb nick(s) [reason]", "ban [mask]", "unban mask", "banexcept [mask]", "unbanexcept mask", "inviteexcept [mask]", "uninviteexcept mask", "voice nick", "devoice nick", "op nick", "deop nick", "owner nick", "deowner nick", "chanadmin nick", "dechanadmin nick", "halfop nick", "dehalfop nick", "nick newnick", "ctcp destination command [data]", "raw/quote irc-command", "quit [quit-message]", }; foreach (string line in help) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(line); Session.AddMessageToFrontend(cd, builder.ToMessage()); } } public void CommandConnect(CommandModel cd) { FrontendManager fm = cd.FrontendManager; var server = new IrcServerModel(); if (cd.DataArray.Length >= 3) { server.Hostname = cd.DataArray[2]; } else { server.Hostname = "localhost"; } if (cd.DataArray.Length >= 4) { var port = cd.DataArray[3]; var ssl = port.StartsWith("+"); if (ssl) { server.UseEncryption = true; port = port.Substring(1); } try { server.Port = Int32.Parse(port); } catch (FormatException) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Invalid port: {0}"), cd.DataArray[3]); Session.AddMessageToFrontend(fm, Chat, builder.ToMessage()); return; } } else { server.Port = 6667; } if (cd.DataArray.Length >= 5) { server.Password = cd.DataArray[4]; } if (cd.DataArray.Length >= 6) { var nicks = new List(1); nicks.Add(cd.DataArray[5]); server.Nicknames = nicks; } Connect(fm, server); } public void CommandSay(CommandModel cd) { _Say(cd.Chat, cd.Parameter); } private void _Say(ChatModel chat, string message) { if (!chat.IsEnabled) { return; } if (chat is PersonChatModel) { PersonModel person = ((PersonChatModel) chat).Person; IrcPersonModel ircperson = (IrcPersonModel) person; ircperson.IsAway = false; } _IrcClient.SendMessage(SendType.Message, chat.ID, message); var builder = CreateMessageBuilder(); builder.AppendSenderPrefix(Me); Match m = Regex.Match(message, String.Format(@"^@(?\S+)|^(?\S+)(?:\:|,)")); if (m.Success && chat is GroupChatModel) { // this is probably a reply with a nickname string nick = m.Groups["nick"].Value; #if LOG4NET _Logger.Debug("_Say(): detected reply with possible nick: '" + nick + "' in: '" + m.Value + "'"); #endif var groupChat = (GroupChatModel) chat; PersonModel person; if (groupChat.Persons.TryGetValue(nick, out person)) { // bingo, it's a nick on this channel message = message.Substring(m.Value.Length); var coloredNick = builder.CreateIdendityName(person); coloredNick.Text = m.Value; builder.AppendText(coloredNick); } } builder.AppendMessage(message); var msg = builder.ToMessage(); Session.AddMessageToChat(chat, msg, true); OnMessageSent( new MessageEventArgs(chat, msg, null, chat.ID) ); } public void CommandJoin(CommandModel cd) { Trace.Call(cd); MessageBuilder builder; if (cd.DataArray.Length < 2 || cd.DataArray[1].Length == 0) { _NotEnoughParameters(cd); return; } string[] channels = cd.DataArray[1].Split(','); string[] keys = null; if (cd.DataArray.Length > 2) { keys = cd.DataArray[2].Split(','); } int activeCount; lock (_ActiveChannelJoinList) { activeCount = _ActiveChannelJoinList.Count; } if (activeCount > 0) { // ok, these channels will be queued builder = CreateMessageBuilder(); builder.AppendEventPrefix(); // TRANSLATOR: some IRC networks dislike too many joins in a // short period and thus Smuxi throttles/queues them builder.AppendText(_("Queuing joins: {0}"), String.Join(" ", channels)); Session.AddMessageToFrontend(cd.FrontendManager, Chat, builder.ToMessage()); } int i = 0; foreach (string channel in channels) { // HACK: copy channel from foreach() into our scope var chan = channel; var chanType = chan[0]; if (!ChannelTypes.Contains(chanType.ToString())) { chan = "#" + chan; } string key = keys != null && keys.Length > i ? keys[i] : null; var chat = GetChat(chan, ChatType.Group); if (chat != null && chat.IsEnabled) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText( _("Already joined to channel: {0}." + " Type /window {0} to switch to it."), channel ); Session.AddMessageToFrontend(cd, builder.ToMessage()); continue; } lock (_QueuedChannelJoinList) { _QueuedChannelJoinList.Add(channel); } _ChannelJoinQueue.Queue(delegate { try { int count = 0; string activeChans = null; lock (_ActiveChannelJoinList) { count = _ActiveChannelJoinList.Count; if (count > 0) { activeChans = String.Join( " ", _ActiveChannelJoinList.ToArray() ); } } if (count > 0) { string queuedChans; lock (_QueuedChannelJoinList) { queuedChans = String.Join( " ", _QueuedChannelJoinList.ToArray() ); } builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText( _("Active joins: {0} - Queued joins: {1}"), activeChans, queuedChans ); Session.AddMessageToFrontend(cd.FrontendManager, Chat, builder.ToMessage()); #if LOG4NET _Logger.Debug("CommandJoin(): waiting to join: " + chan); #endif _ActiveChannelJoinHandle.WaitOne(); lock (_ActiveChannelJoinList) { activeChans = String.Join( " ", _ActiveChannelJoinList.ToArray() ); } lock (_QueuedChannelJoinList) { _QueuedChannelJoinList.Remove(chan); queuedChans = String.Join( " ", _QueuedChannelJoinList.ToArray() ); } // TRANSLATORS: final message will look like this: // Joining: #chan1 - Remaining active joins: #chan2 / queued joins: #chan3 string msg = String.Format(_("Joining: {0}"), chan); if (activeChans.Length > 0 || queuedChans.Length > 0) { msg += String.Format(" - {0} ", _("Remaining")); } if (activeChans.Length > 0) { msg += String.Format( _("active joins: {0}"), activeChans ); } if (queuedChans.Length > 0) { if (activeChans.Length > 0) { msg += " / "; } msg += String.Format( _("queued joins: {0}"), queuedChans ); } builder = CreateMessageBuilder(); builder.AppendEventPrefix().AppendText(msg); Session.AddMessageToFrontend(cd.FrontendManager, Chat, builder.ToMessage()); } else { lock (_QueuedChannelJoinList) { _QueuedChannelJoinList.Remove(chan); } builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Joining: {0}"), chan); Session.AddMessageToFrontend(cd.FrontendManager, Chat, builder.ToMessage()); } #if LOG4NET _Logger.Debug("CommandJoin(): joining: " + chan); #endif // we have a slot, show time! if (key == null) { _IrcClient.RfcJoin(chan); } else { _IrcClient.RfcJoin(chan, key); } // Some IRC networks are very kick happy and thus need // some artificial delay between JOINs. // We know our friendly networks though :) string network = _Network == null ? String.Empty : _Network.ToLower(); switch (network) { case "efnet": case "freenode": case "gimpnet": case "ircnet": case "oftc": // give the IRCd some time to actually sent us a JOIN // confirmation, else we will just hammer all channels // in a single row _ActiveChannelJoinHandle.WaitOne(2 * 1000, false); break; default: // delay the queue for some extra seconds so new join // attempts will not happen too early as some IRCds // limit this and disconnect us if we are not brave Thread.Sleep(2000); break; } } catch (ThreadAbortException ex) { #if LOG4NET _Logger.Warn("ThreadAbortException when trying to join channel: " + chan, ex); #endif } catch (Exception ex) { #if LOG4NET _Logger.Error("Exception when trying to join channel: " + chan, ex); #endif } }); i++; } } public void CommandCycle(CommandModel cd) { if (cd.Chat.ChatType == ChatType.Group) { if (cd.Chat.IsEnabled) { // disable chat so we don't loose the message buffer Session.DisableChat(cd.Chat); _IrcClient.RfcPart(cd.Chat.ID); } _IrcClient.RfcJoin(cd.Chat.ID); } } public void CommandMessage(CommandModel cd) { Trace.Call(cd); if ((cd.DataArray.Length >= 2) && (cd.DataArray[1].Length >= 1)) { var chanType = cd.DataArray[1][0].ToString(); if (ChannelTypes.Contains(chanType)) { // seems to be a channel CommandMessageChannel(cd); } else { // seems to be a nick CommandMessageNick(cd); } } else { NotEnoughParameters(cd); } } public void CommandQuery(CommandModel cd) { ChatModel chat = null; if (cd.DataArray.Length >= 2) { string nickname = cd.DataArray[1]; chat = GetChat(nickname, ChatType.Person); if (chat == null) { var person = CreatePerson(nickname); chat = Session.CreatePersonChat(person, nickname, nickname, this); Session.AddChat(chat); if (Session.IsLocal) { Session.SyncChat(chat); } else { // HACK: lower probability of sync race condition swallowing // messages, see: https://www.smuxi.org/issues/show/634 ThreadPool.QueueUserWorkItem(delegate { Thread.Sleep(1000); Session.SyncChat(chat); }); } } } if (cd.DataArray.Length >= 3) { string message = String.Join(" ", cd.DataArray, 2, cd.DataArray.Length-2); // ignore empty messages if (message.TrimEnd(' ').Length > 0) { _Say(chat, message); } } } public void CommandMessageChannel(CommandModel cd) { if (cd.DataArray.Length >= 3) { string message = String.Join(" ", cd.DataArray, 2, cd.DataArray.Length-2); string channelname = cd.DataArray[1]; ChatModel chat = GetChat(channelname, ChatType.Group); if (chat == null) { // server chat as fallback if we are not joined var builder = CreateMessageBuilder(); builder.AppendText("<{0}:{1}> ", _IrcClient.Nickname, channelname); builder.AppendMessage(message); Session.AddMessageToChat(Chat, builder.ToMessage(), true); _IrcClient.SendMessage(SendType.Message, channelname, message); } else { _Say(chat, message); } } else { _NotEnoughParameters(cd); } } [Obsolete("CommandMessageQuery() is deprecated, use CommandQuery() instead")] public void CommandMessageQuery(CommandModel cmd) { CommandQuery(cmd); } public void CommandMessageNick(CommandModel cmd) { if (cmd == null) { throw new ArgumentNullException("cmd"); } if (cmd.DataArray.Length < 3) { NotEnoughParameters(cmd); return; } var nickname = cmd.DataArray[1]; string message = String.Join(" ", cmd.DataArray, 2, cmd.DataArray.Length - 2); // ignore empty messages if (message.TrimEnd(' ').Length == 0) { return; } var chat = GetChat(nickname, ChatType.Person); if (chat == null) { // fallback to protocol chat + where the command was issued var msg = CreateMessageBuilder(). AppendText("<{0}:{1}> ", _IrcClient.Nickname, nickname). AppendMessage(message). ToMessage(); Session.AddMessageToChat(_NetworkChat, msg, true); if (cmd.Chat != _NetworkChat && cmd.FrontendManager != null) { cmd.FrontendManager.AddMessageToChat(cmd.Chat, msg); } _IrcClient.SendMessage(SendType.Message, nickname, message); } else { _Say(chat, message); } } private IList SplitMessage(string command, string target, string message) { List messages = new List(); int line = 0; do { var lineByteLength = GetProtocolMessageLength(command, target, message); if (lineByteLength <= 512) { if (line > 0) { // remove leading spaces as we are a new line messages.Add(message.TrimStart(new char[] {' '})); } else { messages.Add(message); } break; } line++; // UTF8 can have multi-byte chars, thus we need to remove char // by char and see when it fits into an IRC message var chunkBuilder = new StringBuilder(message); var chunkByteLength = lineByteLength; while (chunkByteLength > 512) { chunkBuilder.Length--; chunkByteLength = GetProtocolMessageLength( command, target, chunkBuilder.ToString() ); } var chunk = chunkBuilder.ToString(); string nextChar = message.Substring(chunk.Length, 1); if (nextChar != " ") { // we split in the middle of a word, split it better! int lastWordPos = chunk.LastIndexOf(" "); if (lastWordPos > 0) { // the chunk has to get smaller, else we run into an // endless loop chunk = chunk.Substring(0, lastWordPos); } } // remove leading spaces as we are a new line messages.Add(chunk.TrimStart(new char[] {' '})); message = message.Substring(chunk.Length); } while (true); return messages; } public void CommandAllMessage(CommandModel cd) { if (cd.DataArray.Length < 2) { _NotEnoughParameters(cd); return; } string message = cd.Parameter; foreach (ChatModel chat in Chats) { if (chat.ChatType != ChatType.Group) { // only show on group chats continue; } CommandModel msgCmd = new CommandModel( cd.FrontendManager, cd.Chat, String.Format("{0} {1}", chat.ID, message) ); CommandMessageChannel(msgCmd); } } public void CommandAllNotice(CommandModel cd) { if (cd.DataArray.Length < 2) { _NotEnoughParameters(cd); return; } string message = cd.Parameter; foreach (ChatModel chat in Chats) { if (chat.ChatType != ChatType.Group) { // only show on group chats continue; } CommandModel msgCmd = new CommandModel( cd.FrontendManager, cd.Chat, String.Format("{0} {1}", chat.ID, message) ); CommandNotice(msgCmd); } } public void CommandAllMe(CommandModel cd) { if (cd.DataArray.Length < 2) { _NotEnoughParameters(cd); return; } string message = cd.Parameter; foreach (ChatModel chat in Chats) { if (chat.ChatType != ChatType.Group) { // only show on group chats continue; } CommandModel msgCmd = new CommandModel( cd.FrontendManager, chat, message ); CommandMe(msgCmd); } } public void CommandPart(CommandModel cd) { ChatModel chat = cd.Chat; if ((cd.DataArray.Length >= 2) && (cd.DataArray[1].Length >= 1)) { // have to guess here if we got a channel passed or not var chanType = cd.DataArray[1][0].ToString(); if (ChannelTypes.Contains(chanType)) { // seems to be a channel string[] channels = cd.DataArray[1].Split(new char[] {','}); string message = null; if (cd.DataArray.Length >= 3) { message = String.Join(" ", cd.DataArray, 2, cd.DataArray.Length-2); } foreach (string channel in channels) { if (message != null) { _IrcClient.RfcPart(channel, message); } else { _IrcClient.RfcPart(channel); } } } else { // sems to be only a part message _IrcClient.RfcPart(chat.ID, cd.Parameter); } } else { _IrcClient.RfcPart(chat.ID); } } public void CommandAway(CommandModel cd) { if (cd.DataArray.Length >= 2) { _IrcClient.RfcAway(cd.Parameter); } else { _IrcClient.RfcAway(); } } public void CommandCtcp(CommandModel cd) { if (cd.DataArray.Length >= 3) { string destination = cd.DataArray[1]; string command = cd.DataArray[2].ToUpper(); string parameters = String.Empty; if (cd.DataArray.Length >= 4) { parameters = String.Join(" ", cd.DataArray, 3, cd.DataArray.Length-3); } var builder = CreateMessageBuilder(); builder.AppendText("[ctcp({0})] {1} {2}", destination, command, parameters); Session.AddMessageToChat(Chat, builder.ToMessage()); _IrcClient.SendMessage(SendType.CtcpRequest, destination, command + " " + parameters); } else { _NotEnoughParameters(cd); } } public void CommandPing(CommandModel cd) { if (cd.DataArray.Length >= 2) { string destination = cd.DataArray[1]; string timestamp = DateTime.Now.ToFileTime().ToString(); var builder = CreateMessageBuilder(); builder.AppendText("[ctcp({0})] {1} {2}", destination, "PING", timestamp); Session.AddMessageToChat(Chat, builder.ToMessage()); _IrcClient.SendMessage(SendType.CtcpRequest, destination, "PING " + timestamp); } else { _NotEnoughParameters(cd); } } public void CommandTime(CommandModel cd) { if (cd.DataArray.Length >= 2) { string destination = cd.DataArray[1]; var builder = CreateMessageBuilder(); builder.AppendText("[ctcp({0})] {1}", destination, "TIME"); Session.AddMessageToChat(Chat, builder.ToMessage()); _IrcClient.SendMessage(SendType.CtcpRequest, destination, "TIME"); } else { _NotEnoughParameters(cd); } } public void CommandVersion(CommandModel cd) { if (cd.DataArray.Length >= 2) { string destination = cd.DataArray[1]; var builder = CreateMessageBuilder(); builder.AppendText("[ctcp({0})] {1}", destination, "VERSION"); Session.AddMessageToChat(Chat, builder.ToMessage()); _IrcClient.SendMessage(SendType.CtcpRequest, destination, "VERSION"); } else { _NotEnoughParameters(cd); } } public void CommandFinger(CommandModel cd) { if (cd.DataArray.Length >= 2) { string destination = cd.DataArray[1]; var builder = CreateMessageBuilder(); builder.AppendText("[ctcp({0})] {1}", destination, "FINGER"); Session.AddMessageToChat(Chat, builder.ToMessage()); _IrcClient.SendMessage(SendType.CtcpRequest, destination, "FINGER"); } else { _NotEnoughParameters(cd); } } public void CommandWho(CommandModel cd) { if (cd.DataArray.Length < 2) { _NotEnoughParameters(cd); return; } IList infos = _IrcClient.GetWhoList(cd.DataArray[1]); // irssi: * meebey H 1 ~meebey@e176002059.adsl.alicedsl.de [Mirco Bauer] foreach (WhoInfo info in infos) { string mode; if (info.IsIrcOp) { mode = _("IRC Op"); } else if (info.IsOwner) { mode = _("Owner"); } else if (info.IsChannelAdmin) { mode = _("ChanAdmin"); } else if (info.IsOp) { mode = _("Op"); } else if (info.IsHalfop) { mode = _("Halfop"); } else if (info.IsVoice) { mode = _("Voice"); } else { mode = String.Empty; } string msg = String.Format( "-!- {0} {1} {2}{3} {4} {5}@{6} [{7}]", info.Channel, info.Nick, mode, info.IsAway ? " (" + _("away") + ")" : String.Empty, info.HopCount, info.Ident, info.Host, info.Realname ); var builder = CreateMessageBuilder().AppendText(msg); Session.AddMessageToChat(cd.Chat, builder.ToMessage()); } } public void CommandWhoIs(CommandModel cd) { if (cd.DataArray.Length >= 2) { _IrcClient.RfcWhois(cd.DataArray[1]); } else { if (cd.Chat is PersonChatModel) { var pchat = (PersonChatModel) cd.Chat; _IrcClient.RfcWhois(pchat.Person.ID); } else { _NotEnoughParameters(cd); } } } public void CommandWhoWas(CommandModel cd) { if (cd.DataArray.Length >= 2) { _IrcClient.RfcWhowas(cd.DataArray[1]); } else { if (cd.Chat is PersonChatModel) { var pchat = (PersonChatModel) cd.Chat; _IrcClient.RfcWhowas(pchat.Person.ID); } else { _NotEnoughParameters(cd); } } } public void CommandTopic(CommandModel cd) { MessageBuilder builder; string channel = cd.Chat.ID; if (cd.DataArray.Length >= 2) { _IrcClient.RfcTopic(channel, cd.Parameter); } else { var groupChat = (GroupChatModel) Session.GetChat( channel, ChatType.Group, this ); if (groupChat != null) { var topic = groupChat.Topic; builder = CreateMessageBuilder(); builder.AppendEventPrefix(); if (topic != null && !topic.IsEmpty) { builder.AppendFormat(_("Topic for {0}: {1}"), channel, topic); } else { builder.AppendText(_("No topic set for {0}"), channel); } Session.AddMessageToFrontend(cd, builder.ToMessage()); } } } public void CommandOp(CommandModel cd) { ChatModel chat = cd.Chat; string channel = chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.Op(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.Op(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandDeop(CommandModel cd) { ChatModel chat = cd.Chat; string channel = chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.Deop(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.Deop(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandVoice(CommandModel cd) { ChatModel chat = cd.Chat; string channel = chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.Voice(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.Voice(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandDevoice(CommandModel cd) { ChatModel chat = cd.Chat; string channel = chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.Devoice(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.Devoice(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandOwner(CommandModel cd) { ChatModel chat = cd.Chat; string channel = chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.Owner(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.Owner(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandDeowner(CommandModel cd) { ChatModel chat = cd.Chat; string channel = chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.Deowner(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.Deowner(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandChanAdmin(CommandModel cd) { ChatModel chat = cd.Chat; string channel = chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.ChanAdmin(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.ChanAdmin(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandDeChanAdmin(CommandModel cd) { ChatModel chat = cd.Chat; string channel = chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.DeChanAdmin(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.DeChanAdmin(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandHalfop(CommandModel cd) { ChatModel chat = cd.Chat; string channel = chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.Halfop(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.Halfop(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandDehalfop(CommandModel cd) { ChatModel chat = cd.Chat; string channel = chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.Dehalfop(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.Dehalfop(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandBan(CommandModel cd) { MessageBuilder builder; string channel = cd.Chat.ID; if (cd.DataArray.Length == 2) { // TODO: use a smart mask by default _IrcClient.Ban(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.Ban(channel, candidates); } else { IList infos = _IrcClient.GetBanList(channel); int i = 1; foreach (BanInfo info in infos) { string msg = String.Format( "{0} - {1}: {2} {3}", i++, info.Channel, _("ban"), info.Mask ); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(msg); Session.AddMessageToFrontend(cd, builder.ToMessage()); } if (infos.Count == 0) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("No bans in channel"), channel); Session.AddMessageToFrontend(cd, builder.ToMessage()); } } } public void CommandUnban(CommandModel cd) { string channel = cd.Chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.Unban(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.Unban(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandBanException(CommandModel cd) { MessageBuilder builder; string channel = cd.Chat.ID; if (cd.DataArray.Length == 2) { // TODO: use a smart mask by default _IrcClient.BanException(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.BanException(channel, candidates); } else { IList infos = _IrcClient.GetBanExceptionList(channel); int i = 1; foreach (BanInfo info in infos) { string msg = String.Format( "{0} - {1}: {2} {3}", i++, info.Channel, _("ban exception"), info.Mask ); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(msg); Session.AddMessageToFrontend(cd, builder.ToMessage()); } if (infos.Count == 0) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("No ban exceptions in channel"), channel); Session.AddMessageToFrontend(cd, builder.ToMessage()); } } } public void CommandUnBanException(CommandModel cd) { string channel = cd.Chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.UnBanException(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.UnBanException(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandInviteException(CommandModel cd) { MessageBuilder builder; string channel = cd.Chat.ID; if (cd.DataArray.Length == 2) { // TODO: use a smart mask by default _IrcClient.InviteException(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.InviteException(channel, candidates); } else { IList infos = _IrcClient.GetInviteExceptionList(channel); int i = 1; foreach (BanInfo info in infos) { string msg = String.Format( "{0} - {1}: {2} {3}", i++, info.Channel, _("invite exception"), info.Mask ); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(msg); Session.AddMessageToFrontend(cd, builder.ToMessage()); } if (infos.Count == 0) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("No invite exceptions in channel"), channel); Session.AddMessageToFrontend(cd, builder.ToMessage()); } } } public void CommandUnInviteException(CommandModel cd) { string channel = cd.Chat.ID; if (cd.DataArray.Length == 2) { _IrcClient.UnInviteException(channel, cd.Parameter); } else if (cd.DataArray.Length > 2) { string[] candidates = cd.Parameter.TrimEnd().Split(new char[] {' '}); _IrcClient.UnInviteException(channel, candidates); } else { _NotEnoughParameters(cd); } } public void CommandKick(CommandModel cd) { string channel = cd.Chat.ID; if (cd.DataArray.Length >= 2) { string[] candidates = cd.DataArray[1].Split(new char[] {','}); if (cd.DataArray.Length >= 3) { string reason = String.Join(" ", cd.DataArray, 2, cd.DataArray.Length-2); foreach (string nick in candidates) { _IrcClient.RfcKick(channel, nick, reason); } } else { foreach (string nick in candidates) { _IrcClient.RfcKick(channel, nick); } } } else { _NotEnoughParameters(cd); } } public void CommandKickban(CommandModel cd) { if (cd.DataArray.Length < 2) { _NotEnoughParameters(cd); return; } var chat = cd.Chat as GroupChatModel; if (chat == null) { return; } string channel = chat.ID; string[] candidates = cd.DataArray[1].Split(new char[] {','}); string reason = null; if (cd.DataArray.Length >= 3) { reason = String.Join(" ", cd.DataArray, 2, cd.DataArray.Length-2); } foreach (string nick in candidates) { var victim = (IrcGroupPersonModel) chat.GetPerson(nick); if (victim == null) { continue; } _IrcClient.Ban(channel, "*!*" + victim.Ident + "@" + victim.Host); if (reason == null) { _IrcClient.RfcKick(channel, victim.NickName); } else { _IrcClient.RfcKick(channel, victim.NickName, reason); } } } public void CommandMode(CommandModel cd) { string target = null; string mode = null; if (cd.DataArray.Length >= 2) { // /mode #smuxi // /mode meebey var param1 = cd.DataArray[1]; if (param1.StartsWith("+") || param1.StartsWith("-")) { // no target given, this is the mode already // /mode +i (on server) // /mode +b (on channel) // /mode +b *!*@foo (on channel) if (cd.Chat.ChatType == ChatType.Group) { target = cd.Chat.ID; } else { target = _IrcClient.Nickname; } mode = cd.Parameter; } else { target = param1; if (cd.DataArray.Length >= 3) { // /mode #smuxi +b *!*@foo // /mode #smuxi +b // /mode meebey +i mode = String.Join(" ", cd.DataArray, 2, cd.DataArray.Length-2); } } } else { // /mode (on server) // /mode (on channel) if (cd.Chat.ChatType == ChatType.Group) { target = cd.Chat.ID; } else { target = _IrcClient.Nickname; } } if (target != null && mode != null) { _IrcClient.RfcMode(target, mode); } else if (target != null) { if (_IrcClient.IsMe(target)) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Your user mode is {0}"), String.Format("[{0}]", _IrcClient.Usermode)); Session.AddMessageToFrontend(cd, builder.ToMessage()); } else { _IrcClient.RfcMode(target); } } } public void CommandInvite(CommandModel cd) { string channel; if (cd.DataArray.Length >= 3) { channel = cd.DataArray[2]; } else { channel = cd.Chat.ID; } if (cd.DataArray.Length < 2) { _NotEnoughParameters(cd); return; } var invitee = cd.DataArray[1]; var groupChat = cd.Chat as GroupChatModel; if (groupChat != null && groupChat.GetPerson(invitee) != null) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("{0} is already on {1}"), invitee, channel). ToMessage(); Session.AddMessageToFrontend(cd, msg); } else { _IrcClient.RfcInvite(invitee, channel); var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("Inviting {0} to {1}"), invitee, channel). ToMessage(); Session.AddMessageToFrontend(cd, msg); } } public void CommandNames(CommandModel cd) { /* 13:10 [Users #smuxi] 13:10 [ CIA-5] [ d-best] [ meebey] [ meebey_] [ NotZh817] [ RAOF] 13:10 -!- Irssi: #smuxi: Total of 6 nicks [0 ops, 0 halfops, 0 voices, 6 normal] */ ChatModel chat = cd.Chat; if (!(chat is GroupChatModel)) { return; } GroupChatModel groupChat = (GroupChatModel) chat; var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText("[{0} {1}]", _("Users"), groupChat.Name); Session.AddMessageToFrontend(cd, builder.ToMessage()); builder = CreateMessageBuilder(); int opCount = 0; int voiceCount = 0; int normalCount = 0; builder.AppendEventPrefix(); // sort nicklist var persons = groupChat.Persons; if (persons == null) { persons = new Dictionary(0); } List ircPersons = new List(persons.Values); ircPersons.Sort((a, b) => (a.IdentityName.CompareTo(b.IdentityName))); builder.AppendText("[ "); foreach (IrcGroupPersonModel ircPerson in ircPersons) { string mode; if (ircPerson.IsOwner) { opCount++; mode = "~"; } else if (ircPerson.IsChannelAdmin) { opCount++; mode = "&"; } else if (ircPerson.IsOp) { opCount++; mode = "@"; } else if (ircPerson.IsHalfop) { opCount++; mode = "%"; } else if (ircPerson.IsVoice) { voiceCount++; mode = "+"; } else { normalCount++; mode = String.Empty; } if (!String.IsNullOrEmpty(mode)) { builder.AppendText(mode); } builder.AppendNick(ircPerson); builder.AppendSpace(); } builder.AppendText("]"); Session.AddMessageToFrontend(cd, builder.ToMessage()); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText( String.Format( _("Total of {0} users [{1} ops, {2} voices, {3} normal]"), opCount + voiceCount + normalCount, opCount, voiceCount, normalCount ) ); Session.AddMessageToFrontend(cd, builder.ToMessage()); } public void CommandRaw(CommandModel cd) { _IrcClient.WriteLine(cd.Parameter); } public void CommandMe(CommandModel cd) { if (cd.DataArray.Length < 2) { _NotEnoughParameters(cd); return; } _IrcClient.SendMessage(SendType.Action, cd.Chat.ID, cd.Parameter); var builder = CreateMessageBuilder(); builder.AppendActionPrefix(); builder.AppendIdendityName(Me); builder.AppendText(" "); builder.AppendMessage(cd.Parameter); Session.AddMessageToChat(cd.Chat, builder.ToMessage(), true); } public void CommandNotice(CommandModel cd) { if (cd.DataArray.Length >= 3) { string target = cd.DataArray[1]; string message = String.Join(" ", cd.DataArray, 2, cd.DataArray.Length-2); _IrcClient.SendMessage(SendType.Notice, target, message); var chat = GetChat(target, ChatType.Group); if (chat == null) { // wasn't a channel but maybe a query chat = GetChat(target, ChatType.Person); } if (chat == null) { chat = _NetworkChat; } var msg = CreateMessageBuilder(). AppendText("[notice({0})] ", target). AppendMessage(message). ToMessage(); Session.AddMessageToChat(chat, msg, true); } } public void CommandNick(CommandModel cd) { if (cd.DataArray.Length >= 2) { _IrcClient.RfcNick(cd.Parameter); } } public void CommandQuit(CommandModel cd) { Trace.Call(cd); string message = cd.Parameter; // else SmartIrc4net would reconnect us _IrcClient.AutoReconnect = false; // else the Listen() thread would try to connect again _Listening = false; // when we are disconnected, remove all chats _IrcClient.OnDisconnected += delegate { // cleanup all open chats Dispose(); }; // ok now we are ready to die if (message != null) { _IrcClient.RfcQuit(message); } else { _IrcClient.RfcQuit(); } } private void _Run() { Trace.Call(); try { Connect(_FrontendManager); while (_Listening) { try { _Listen(); #if LOG4NET _Logger.Warn("_Run(): _Listen() returned."); #endif } catch (ThreadAbortException) { throw; } catch (Exception ex) { #if LOG4NET _Logger.Error("_Run(): exception in _Listen() occurred!" ,ex); #endif Reconnect(_FrontendManager); } // sleep for 10 seconds, we don't want to be abusive System.Threading.Thread.Sleep(10000); } } catch (ThreadAbortException) { #if LOG4NET _Logger.Debug("_Run(): thread aborted"); #endif } catch (Exception ex) { #if LOG4NET _Logger.Error(ex); #endif } // don't need the FrontendManager anymore _FrontendManager = null; } private void _Listen() { try { _IrcClient.Listen(); } catch (Exception ex) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("Connection error! Reason: ")). AppendText(ex.Message). ToMessage(); Session.AddMessageToChat(Chat, msg); throw; } } private void _NotEnoughParameters(CommandModel cd) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("Not enough parameters for {0} command"), cd.Command). ToMessage(); Session.AddMessageToFrontend(cd, msg); } private void _NotConnected(CommandModel cd) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("Not connected to server")). ToMessage(); Session.AddMessageToFrontend(cd, msg); } private void ApplyConfig(UserConfig config, ServerModel server) { _Host = server.Hostname; _Port = server.Port; if (String.IsNullOrEmpty(server.Network)) { _Network = server.Hostname; } else { _Network = server.Network; } if (String.IsNullOrEmpty(server.Nickname)) { _Nicknames = (string[]) config["Connection/Nicknames"]; } else { _Nicknames = server.Nickname.Split(' '); } if (String.IsNullOrEmpty(server.Realname)) { _Realname = (string) config["Connection/Realname"]; } else { _Realname = server.Realname; } if (String.IsNullOrEmpty(server.Username)) { _Username = (string) config["Connection/Username"]; } else { _Username = server.Username; } _Password = server.Password; // internal fallbacks if (String.IsNullOrEmpty(_Username)) { _Username = "smuxi"; } // IRC specific settings if (server is IrcServerModel) { var ircServer = (IrcServerModel) server; if (ircServer.Nicknames != null && ircServer.Nicknames.Count > 0) { _Nicknames = ircServer.Nicknames.ToArray(); } } // add fallbacks if only one nick was specified, else we get random // number nicks when nick collisions happen if (_Nicknames.Length == 1) { _Nicknames = new string[] { _Nicknames[0], _Nicknames[0] + "_", _Nicknames[0] + "__" }; } string encodingName = (string) config["Connection/Encoding"]; if (String.IsNullOrEmpty(encodingName)) { _IrcClient.Encoding = Encoding.Default; } else { try { _IrcClient.Encoding = Encoding.GetEncoding(encodingName); } catch (Exception ex) { #if LOG4NET _Logger.Warn("ApplyConfig(): Error getting encoding for: " + encodingName + " falling back to system encoding.", ex); #endif _IrcClient.Encoding = Encoding.Default; } } if (config["Connection/AutoConvertUTF8"] == null) { _IrcClient.EnableUTF8Recode = true; } else { _IrcClient.EnableUTF8Recode = (bool) config["Connection/AutoConvertUTF8"]; } var proxySettings = new ProxySettings(); proxySettings.ApplyConfig(config); var protocol = server.UseEncryption ? "ircs" : "irc"; var serverUri = String.Format("{0}://{1}:{2}", protocol, server.Hostname, server.Port); var proxy = proxySettings.GetWebProxy(serverUri); if (proxy == null) { _IrcClient.ProxyType = IrcProxyType.None; } else { var proxyScheme = proxy.Address.Scheme; var ircProxyType = IrcProxyType.None; try { // HACK: map proxy scheme to SmartIrc4net's ProxyType ircProxyType = (IrcProxyType) Enum.Parse( typeof(IrcProxyType), proxyScheme, true ); } catch (ArgumentException ex) { #if LOG4NET _Logger.Error("ApplyConfig(): Couldn't parse proxy type: " + proxyScheme, ex); #endif } _IrcClient.ProxyType = ircProxyType; _IrcClient.ProxyHost = proxy.Address.Host; _IrcClient.ProxyPort = proxy.Address.Port; if (!String.IsNullOrEmpty(proxySettings.ProxyUsername)) { _IrcClient.ProxyUsername = proxySettings.ProxyUsername; } if (!String.IsNullOrEmpty(proxySettings.ProxyPassword)) { _IrcClient.ProxyPassword = proxySettings.ProxyPassword; } } if (server != null) { _IrcClient.UseSsl = server.UseEncryption; _IrcClient.ValidateServerCertificate = server.ValidateServerCertificate; } } private void _OnRawMessage(object sender, IrcEventArgs e) { #if LOG4NET //_Logger.Debug("_OnRawMessage(): received: '" + e.Data.RawMessage + "'"); #endif bool handled = false; switch (e.Data.Type) { case ReceiveType.Who: case ReceiveType.List: case ReceiveType.Name: case ReceiveType.Login: case ReceiveType.Topic: case ReceiveType.BanList: case ReceiveType.ChannelMode: // ignore handled = true; break; } if (e.Data.Message != null) { switch (e.Data.Type) { case ReceiveType.Error: _OnError(e); handled = true; break; case ReceiveType.WhoIs: case ReceiveType.WhoWas: _OnReceiveTypeWho(e); handled = true; break; } } string chan; string nick; MessageModel msg; ChatModel chat; switch (e.Data.ReplyCode) { case ReplyCode.Null: case ReplyCode.Away: // already handled via _OnAway() case ReplyCode.NowAway: // already handled via _OnNowAway() case ReplyCode.UnAway: // already handled via _OnUnAway() case (ReplyCode) 329: // RPL_CREATIONTIME case (ReplyCode) 333: // RPL_TOPICWHOTIME: who set topic + timestamp // ignore break; case ReplyCode.Bounce: // RPL_ISUPPORT // :friendly.landlord.eloxoph.com 005 meebey CHANTYPES=# PREFIX=(ohv)@%+ NETWORK=Eloxoph AWAYLEN=200 TOPICLEN=300 :are supported by this server // :friendly.landlord.eloxoph.com 005 meebey CHANLIMIT=#:12 IRCD=WeIRCd NICKLEN=25 CASEMAPPING=ascii USERLEN=9 :are supported by this server // :friendly.landlord.eloxoph.com 005 meebey CHANMODE=b,kl,,cimnOrst PENALTY MAXTARGETS=1 MAXBANS=50 MODES=5 LISTMODE=997 :are supported by this server string line = String.Empty; if (e.Data.RawMessageArray.Length >= 4) { line = String.Join( " ", e.Data.RawMessageArray, 3, e.Data.RawMessageArray.Length - 3 ); } string[] supportList = line.Split(' '); foreach (string support in supportList) { string supportKey = null; string supportValue = null; if (support.Contains("=")) { supportKey = support.Split('=')[0]; supportValue = support.Split('=')[1]; } else { supportKey = support; supportValue = null; } switch (supportKey) { case "NETWORK": _Network = supportValue; #if LOG4NET _Logger.Debug( "_OnRawMessage(): detected IRC network: " + "'" + _Network + "'" ); #endif break; case "ELIST": HasListMaskSearchSupport = supportValue.Contains("M"); break; case "SAFELIST": HasSafeListSupport = true; break; case "CHANTYPES": ChannelTypes.Clear(); foreach (var type in supportValue) { ChannelTypes.Add(type.ToString()); } break; } } break; case ReplyCode.ErrorNoSuchNickname: nick = e.Data.RawMessageArray[3]; chat = GetChat(nick, ChatType.Person) ?? Chat; msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("{0}: No such nick/channel"), nick). ToMessage(); Session.AddMessageToChat(chat, msg); break; case ReplyCode.ErrorChannelIsFull: case ReplyCode.ErrorInviteOnlyChannel: case ReplyCode.ErrorBadChannelKey: case ReplyCode.ErrorTooManyChannels: case ReplyCode.ErrorChannelOpPrivilegesNeeded: case ReplyCode.ErrorCannotSendToChannel: case ReplyCode.ErrorUnavailableResource: chan = e.Data.RawMessageArray[3]; chat = GetChat(chan, ChatType.Group) ?? Chat; msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(chan).AppendSpace(). AppendMessage(e.Data.Message). ToMessage(); Session.AddMessageToChat(chat, msg); // if our own nick is temporarily not available then we // need to deal this like an already used nick if (chan == _IrcClient.Nickname) { AutoRenick(); } break; case ReplyCode.ErrorBannedFromChannel: _OnErrorBannedFromChannel(e); break; case ReplyCode.ErrorNicknameInUse: _OnErrorNicknameInUse(e); break; case ReplyCode.EndOfNames: OnEndOfNames(e); break; case ReplyCode.ChannelModeIs: OnChannelModeIs(e); break; default: if (!handled) { var builder = CreateMessageBuilder(); builder.MessageType = MessageType.Event; int replyCode = (int) e.Data.ReplyCode; string numeric = String.Format("{0:000}", replyCode); string constant; if (Enum.IsDefined(typeof(ReplyCode), e.Data.ReplyCode)) { constant = e.Data.ReplyCode.ToString(); } else { constant = "?"; } string parameters = String.Empty; if (e.Data.RawMessageArray.Length >= 4) { parameters = String.Join( " ", e.Data.RawMessageArray, 3, e.Data.RawMessageArray.Length - 3 ); } int colonPosition = parameters.IndexOf(':'); if (colonPosition > 0) { parameters = " " + parameters.Substring(0, colonPosition - 1); } else { parameters = String.Empty; } TextMessagePartModel msgPart; msgPart = new TextMessagePartModel("["); msgPart.ForegroundColor = IrcTextColor.Grey; msgPart.Bold = true; builder.AppendText(msgPart); msgPart = new TextMessagePartModel(numeric); if (replyCode >= 400 && replyCode <= 599) { msgPart.ForegroundColor = new TextColor(255, 0, 0); } msgPart.Bold = true; builder.AppendText(msgPart); var response = String.Format( " ({0}){1}", constant, parameters ); builder.AppendText(response); msgPart = new TextMessagePartModel("] "); msgPart.ForegroundColor = IrcTextColor.Grey; msgPart.Bold = true; builder.AppendText(msgPart); if (e.Data.Message != null) { builder.MessageType = MessageType.Normal; builder.AppendMessage(e.Data.Message); } Session.AddMessageToChat(_NetworkChat, builder.ToMessage()); } break; } } private void _OnError(IrcEventArgs e) { var builder = CreateMessageBuilder(); var text = builder.CreateText(e.Data.Message); text.ForegroundColor = IrcTextColor.Red; text.Bold = true; text.IsHighlight = true; builder.AppendText(text); Session.AddMessageToChat(_NetworkChat, builder.ToMessage()); if (e.Data.Message.ToLower().Contains("flood")) { _IrcClient.SendDelay += 250; var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText( _("Increased send delay to {0}ms to avoid being " + "flooded off the server again."), _IrcClient.SendDelay ).ToMessage(); Session.AddMessageToChat(Chat, msg); } } private void _OnErrorNicknameInUse(IrcEventArgs e) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); var text = builder.CreateText(e.Data.RawMessageArray[3]); text.Bold = true; builder.AppendFormat(_("Nick {0} is already in use"), text); Session.AddMessageToChat(_NetworkChat, builder.ToMessage()); AutoRenick(); } private void _OnErrorBannedFromChannel(IrcEventArgs e) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); var text = builder.CreateText(e.Data.RawMessageArray[3]); text.Bold = true; builder.AppendFormat("{0}: {1} ({2})", _("Cannot join to channel:"), text, _("You are banned")); Session.AddMessageToChat(_NetworkChat, builder.ToMessage()); } private void _OnReceiveTypeWho(IrcEventArgs e) { MessageModel msg; string nick = e.Data.RawMessageArray[3]; ChatModel chat = GetChat(nick, ChatType.Person); if (chat == null) { chat = _NetworkChat; } switch (e.Data.ReplyCode) { case ReplyCode.WhoIsUser: case ReplyCode.WhoWasUser: string ident = e.Data.RawMessageArray[4]; string host = e.Data.RawMessageArray[5]; string realname = e.Data.Message; msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText("{0} [{1}@{2}]", nick, ident, host). ToMessage(); Session.AddMessageToChat(chat, msg); msg = CreateMessageBuilder(). AppendEventPrefix().AppendSpace(). AppendText("realname: {0}", realname). ToMessage(); Session.AddMessageToChat(chat, msg); break; case ReplyCode.WhoIsServer: string server = e.Data.RawMessageArray[4]; string serverinfo = e.Data.Message; msg = CreateMessageBuilder(). AppendEventPrefix().AppendSpace(). AppendText("server: {0} [{1}]", server, serverinfo). ToMessage(); Session.AddMessageToChat(chat, msg); break; case ReplyCode.WhoIsIdle: string idle = e.Data.RawMessageArray[4]; try { long timestamp = Int64.Parse(e.Data.RawMessageArray[5]); DateTime signon = new DateTime(1970, 1, 1, 0, 0, 0, 0); signon = signon.AddSeconds(timestamp).ToLocalTime(); msg = CreateMessageBuilder(). AppendEventPrefix().AppendSpace(). AppendText("idle: {0} [signon: {1}]", idle, signon.ToString()). ToMessage(); Session.AddMessageToChat(chat, msg); } catch (FormatException) { } break; case ReplyCode.WhoIsChannels: string channels = e.Data.Message; msg = CreateMessageBuilder(). AppendEventPrefix().AppendSpace(). AppendText("channels: {0}", channels). ToMessage(); Session.AddMessageToChat(chat, msg); break; case ReplyCode.WhoIsOperator: case ReplyCode.EndOfWhoIs: case ReplyCode.EndOfWhoWas: msg = CreateMessageBuilder(). AppendEventPrefix().AppendSpace(). AppendText(e.Data.Message). ToMessage(); Session.AddMessageToChat(chat, msg); break; } } private void _OnCtcpRequest(object sender, CtcpEventArgs e) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText( // TRANSLATOR: {0}: nickname, {1}: ident@host, // {2}: CTCP command, {3}: own nickname, {4}: CTCP parameter // example: // meebey [meebey@example.com] requested CTCP VERSION from meebey: _("{0} [{1}] requested CTCP {2} from {3}: {4}"), e.Data.Nick, e.Data.Ident+"@"+e.Data.Host, e.CtcpCommand, _IrcClient.Nickname, e.CtcpParameter ). ToMessage(); Session.AddMessageToChat(Chat, msg); } private void _OnCtcpReply(object sender, CtcpEventArgs e) { ChatModel chat = GetChat(e.Data); if (chat == null) { chat = _NetworkChat; } if (e.CtcpCommand == "PING") { try { long timestamp = Int64.Parse(e.CtcpParameter); if (!(timestamp >= 0)) { return; } DateTime sent = DateTime.FromFileTime(timestamp); string duration = DateTime.Now.Subtract(sent).TotalSeconds.ToString(); var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("CTCP PING reply from {0}: {1} seconds"), e.Data.Nick, duration). ToMessage(); Session.AddMessageToChat(chat, msg); } catch (FormatException) { } } else { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("CTCP {0} reply from {1}: {2}"), e.CtcpCommand, e.Data.Nick, e.CtcpParameter). ToMessage(); Session.AddMessageToChat(chat, msg); } } private void _OnChannelMessage(object sender, IrcEventArgs e) { var chat = GetChat(e.Data.Channel, ChatType.Group) ?? Chat; UpdateGroupPerson(chat, e.Data); var builder = CreateMessageBuilder(); builder.AppendMessage(GetPerson(chat, e.Data.Nick ?? e.Data.From), e.Data.Message); builder.MarkHighlights(); var msg = builder.ToMessage(); Session.AddMessageToChat(chat, msg); OnMessageReceived( new MessageEventArgs(chat, msg, e.Data.Nick ?? e.Data.From, e.Data.Channel) ); } private void _OnChannelAction(object sender, ActionEventArgs e) { var chat = GetChat(e.Data.Channel, ChatType.Group) ?? Chat; UpdateGroupPerson(chat, e.Data); var builder = CreateMessageBuilder(); builder.AppendActionPrefix(); builder.AppendIdendityName(GetPerson(chat, e.Data.Nick ?? e.Data.From)); builder.AppendText(" "); builder.AppendMessage(e.ActionMessage); builder.MarkHighlights(); var msg = builder.ToMessage(); Session.AddMessageToChat(chat, msg); OnMessageReceived( new MessageEventArgs(chat, msg, e.Data.Nick ?? e.Data.From, e.Data.Channel) ); } private void _OnChannelNotice(object sender, IrcEventArgs e) { var chat = GetChat(e.Data.Channel, ChatType.Group) ?? Chat; UpdateGroupPerson(chat, e.Data); var builder = CreateMessageBuilder(); builder.AppendText("-{0}:{1}- ", e.Data.Nick, e.Data.Channel); builder.AppendMessage(e.Data.Message); builder.MarkHighlights(); var msg = builder.ToMessage(); Session.AddMessageToChat(chat, msg); OnMessageReceived( new MessageEventArgs(chat, msg, e.Data.Nick ?? e.Data.From, e.Data.Channel) ); } private void _OnQueryMessage(object sender, IrcEventArgs e) { var chat = (PersonChatModel) GetChat(e.Data.Nick, ChatType.Person); bool newChat = false; if (chat == null) { var person = CreatePerson(e.Data.Nick); person.Ident = e.Data.Ident; person.Host = e.Data.Host; chat = Session.CreatePersonChat(person, e.Data.Nick, e.Data.Nick, this); newChat = true; } var builder = CreateMessageBuilder(); builder.AppendSenderPrefix(chat.Person, true); builder.AppendMessage(e.Data.Message); builder.MarkHighlights(); var msg = builder.ToMessage(); if (newChat) { // don't create chats for filtered messages if (Session.IsFilteredMessage(chat, msg)) { Session.LogMessage(chat, msg, true); return; } Session.AddChat(chat); Session.AddMessageToChat(chat, msg); // HACK: lower probability of sync race condition swallowing // messages, see: https://www.smuxi.org/issues/show/634 ThreadPool.QueueUserWorkItem(delegate { Thread.Sleep(1000); Session.SyncChat(chat); }); return; } Session.AddMessageToChat(chat, msg); OnMessageReceived( new MessageEventArgs(chat, msg, e.Data.Nick ?? e.Data.From, null) ); } private void _OnQueryAction(object sender, ActionEventArgs e) { var chat = (PersonChatModel) GetChat(e.Data.Nick, ChatType.Person); bool newChat = false; if (chat == null) { var person = CreatePerson(e.Data.Nick); person.Ident = e.Data.Ident; person.Host = e.Data.Host; chat = Session.CreatePersonChat(person, e.Data.Nick, e.Data.Nick, this); newChat = true; } var builder = CreateMessageBuilder(); builder.AppendActionPrefix(); builder.AppendIdendityName(chat.Person, true); builder.AppendSpace(); builder.AppendMessage(e.ActionMessage); builder.MarkHighlights(); var msg = builder.ToMessage(); if (newChat) { // don't create chats for filtered messages if (Session.IsFilteredMessage(chat, msg)) { Session.LogMessage(chat, msg, true); return; } Session.AddChat(chat); Session.AddMessageToChat(chat, msg); // HACK: lower probability of sync race condition swallowing // messages, see: https://www.smuxi.org/issues/show/634 ThreadPool.QueueUserWorkItem(delegate { Thread.Sleep(1000); Session.SyncChat(chat); }); return; } Session.AddMessageToChat(chat, msg); OnMessageReceived( new MessageEventArgs(chat, msg, e.Data.Nick ?? e.Data.From, null) ); } private void _OnQueryNotice(object sender, IrcEventArgs e) { var targetChats = new List(); if (e.Data.Nick != null) { var chat = (PersonChatModel) GetChat(e.Data.Nick, ChatType.Person); if (chat != null) { targetChats.Add(chat); } } if (targetChats.Count == 0 && e.Data.Nick != null) { // always show on server chat targetChats.Add(_NetworkChat); // check if we share a channel with the sender foreach (var chat in Chats) { if (!(chat is GroupChatModel)) { continue; } var groupChat = (GroupChatModel) chat; if (groupChat.UnsafePersons == null) { continue; } if (groupChat.UnsafePersons.ContainsKey(e.Data.Nick)) { targetChats.Add(groupChat); } } } if (targetChats.Count == 0) { // use server chat as fallback targetChats.Add(_NetworkChat); } var builder = CreateMessageBuilder(); if (e.Data.Nick == null) { // server message builder.AppendText("!{0} ", e.Data.From); } else { builder.AppendText("-"); builder.AppendIdendityName(GetPerson(targetChats[0], e.Data.Nick)); builder.AppendText(" ({0}@{1})- ", e.Data.Ident, e.Data.Host); } builder.AppendMessage(e.Data.Message); builder.MarkHighlights(); var msg = builder.ToMessage(); foreach (var targetChat in targetChats) { Session.AddMessageToChat(targetChat, msg); } OnMessageReceived( new MessageEventArgs(Chat, msg, e.Data.Nick ?? e.Data.From, null) ); } private void _OnJoin(object sender, JoinEventArgs e) { GroupChatModel groupChat = (GroupChatModel) GetChat(e.Channel, ChatType.Group); if (e.Data.Irc.IsMe(e.Who)) { // tell join handlers, that they need to wait!! lock (_ActiveChannelJoinList) { _ActiveChannelJoinList.Add(e.Channel.ToLower()); } if (groupChat == null) { groupChat = Session.CreateChat( e.Channel, e.Channel, this ); groupChat.UnsafePersonsComparer = StringComparer.OrdinalIgnoreCase; Session.AddChat(groupChat); } else { // chat still exists, so we we only need to enable it // (sync is done in _OnChannelActiveSynced) Session.EnableChat(groupChat); } } else { // someone else joined, let's add him to the channel chat // HACK: some buggy networks might send JOIN messages for users // that are already on the channel if (groupChat.UnsafePersons.ContainsKey(e.Who)) { #if LOG4NET _Logger.Error("_OnJoin(): groupChat.UnsafePerson contains " + "already: '" + e.Who + "', ignoring..."); #endif // ignore } else { var person = CreateGroupPerson(e.Who); person.Ident = e.Data.Ident; person.Host = e.Data.Host; Session.AddPersonToGroupChat(groupChat, person); } } var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendFormat(_("{0} [{1}] has joined {2}"), GetPerson(groupChat, e.Who), String.Format("{0}@{1}", e.Data.Ident, e.Data.Host), e.Channel); var msg = builder.ToMessage(); Session.AddMessageToChat(groupChat, msg); } private void _OnNames(object sender, NamesEventArgs e) { #if LOG4NET // logging noise //_Logger.Debug("_OnNames() e.Channel: " + e.Channel); #endif GroupChatModel groupChat = (GroupChatModel) GetChat(e.Data.Channel, ChatType.Group); if (groupChat == null || groupChat.IsSynced) { // nothing todo for us return; } foreach (string user in e.RawUserList) { // skip empty users (some IRC servers send an extra space) if (user.TrimEnd(' ').Length == 0) { continue; } string username = user; switch (user[0]) { case '@': case '+': // RFC VIOLATION // some IRC network do this and break our nice smuxi... case '&': case '%': case '~': case '!': case '.': username = user.Substring(1); break; } var groupPerson = CreateGroupPerson(username); switch (user[0]) { case '~': groupPerson.IsOwner = true; break; case '&': groupPerson.IsChannelAdmin = true; break; case '@': groupPerson.IsOp = true; break; case '%': groupPerson.IsHalfop = true; break; case '+': groupPerson.IsVoice = true; break; } groupChat.UnsafePersons.Add(groupPerson.NickName, groupPerson); #if LOG4NET // logging noise //_Logger.Debug("_OnNames() added user: " + username + " to: " + groupChat.Name); #endif } } void OnEndOfNames(IrcEventArgs e) { Trace.Call(e); var chan = e.Data.RawMessageArray[3]; lock (_ActiveChannelJoinList) { _ActiveChannelJoinList.Remove(chan.ToLower()); } // tell the currently waiting join task item from the task queue // that one channel is finished _ActiveChannelJoinHandle.Set(); var groupChat = (GroupChatModel) GetChat(chan, ChatType.Group); if (groupChat == null) { #if LOG4NET _Logger.Error("OnEndOfNames(): GetChat(" + e.Data.Channel + ", ChatType.Group) returned null!"); #endif return; } #if LOG4NET _Logger.Debug("OnEndOfNames(): " + chan + " synced"); #endif groupChat.IsSynced = true; // prime-time Session.SyncChat(groupChat); } void OnChannelModeIs(IrcEventArgs e) { Trace.Call(e); var chat = GetChat(e.Data.Channel, ChatType.Group) ?? Chat; var mode = String.Join(" ", e.Data.RawMessageArray.Skip(4).ToArray()).Trim(); var channelName = e.Data.RawMessageArray[3]; var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText("mode/{0} [{1}]", channelName, mode); Session.AddMessageToChat(chat, builder.ToMessage()); } private void _OnPart(object sender, PartEventArgs e) { #if LOG4NET _Logger.Debug("_OnPart() e.Channel: "+e.Channel+" e.Who: "+e.Who); #endif GroupChatModel groupChat = (GroupChatModel) GetChat(e.Channel, ChatType.Group); // only remove the chat if it was enabled, that way we can retain // the message buffer if (e.Data.Irc.IsMe(e.Who)) { if (groupChat.IsEnabled) { Session.RemoveChat(groupChat); } // nothing else we can do return; } PersonModel person = groupChat.GetPerson(e.Who); if (person == null) { #if LOG4NET // HACK: some buggy networks might send PART messages for users // that are not on the channel _Logger.Error("_OnPart(): groupChat.GetPerson(" + e.Who + ") returned null!"); #endif } else { Session.RemovePersonFromGroupChat(groupChat, person); } var builder = CreateMessageBuilder(); builder.MessageType = MessageType.Event; builder.AppendEventPrefix(); builder.AppendFormat(_("{0} [{1}] has left {2}"), GetPerson(groupChat, e.Who), String.Format("{0}@{1}", e.Data.Ident, e.Data.Host), e.Channel); if (!String.IsNullOrEmpty(e.PartMessage)) { builder.AppendText(" ["); // colors in part messages are annoying builder.Settings.StripColors = true; builder.AppendMessage(e.PartMessage); builder.AppendText("]"); } Session.AddMessageToChat(groupChat, builder.ToMessage()); } private void _OnKick(object sender, KickEventArgs e) { #if LOG4NET _Logger.Debug("_OnKick() e.Channel: "+e.Channel+" e.Whom: "+e.Whom); #endif var chat = (GroupChatModel) GetChat(e.Channel, ChatType.Group); var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); if (e.Data.Irc.IsMe(e.Whom)) { builder.AppendFormat(_("You were kicked from {0} by {1}"), e.Channel, GetPerson(chat, e.Who)); builder.AppendText(" [").AppendMessage(e.KickReason).AppendText("]"); Session.AddMessageToChat(chat, builder.ToMessage()); Session.DisableChat(chat); } else { PersonModel user = chat.GetPerson(e.Whom); Session.RemovePersonFromGroupChat(chat, user); builder.AppendFormat(_("{0} was kicked from {1} by {2}"), GetPerson(chat, e.Whom), e.Channel, GetPerson(chat, e.Who)); builder.AppendText(" [").AppendMessage(e.KickReason).AppendText("]"); Session.AddMessageToChat(chat, builder.ToMessage()); } } private void _OnNickChange(object sender, NickChangeEventArgs e) { #if LOG4NET _Logger.Debug("_OnNickChange() e.OldNickname: "+e.OldNickname+" e.NewNickname: "+e.NewNickname); #endif if (e.Data.Irc.IsMe(e.NewNickname)) { IrcMe = CreatePerson(e.NewNickname, IrcMe.RealName, IrcMe.Ident, IrcMe.Host); var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendFormat(_("You're now known as {0}"), CreatePerson(e.NewNickname)); Session.AddMessageToChat(_NetworkChat, builder.ToMessage()); } foreach (var chat in Chats) { if (!(chat is GroupChatModel)) { continue; } var groupChat = (GroupChatModel) chat; var oldPerson = (IrcGroupPersonModel) groupChat.GetPerson(e.OldNickname); if (oldPerson == null) { // nobodoy to rename continue; } // clone the old user to a new user var newPerson = CreateGroupPerson(e.NewNickname); newPerson.RealName = oldPerson.RealName; newPerson.Ident = oldPerson.Ident; newPerson.Host = oldPerson.Host; newPerson.IsOwner = oldPerson.IsOwner; newPerson.IsChannelAdmin = oldPerson.IsChannelAdmin; newPerson.IsOp = oldPerson.IsOp; newPerson.IsHalfop = oldPerson.IsHalfop; newPerson.IsVoice = oldPerson.IsVoice; Session.UpdatePersonInGroupChat(groupChat, oldPerson, newPerson); var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); if (e.Data.Irc.IsMe(e.NewNickname)) { builder.AppendFormat(_("You're now known as {0}"), newPerson); } else { builder.AppendFormat(_("{0} is now known as {1}"), oldPerson, newPerson); } Session.AddMessageToChat(groupChat, builder.ToMessage()); } } private void _OnTopic(object sender, TopicEventArgs e) { GroupChatModel cchat = (GroupChatModel)GetChat(e.Channel, ChatType.Group); var topic = CreateMessageBuilder(); topic.AppendMessage(e.Topic); Session.UpdateTopicInGroupChat(cchat, topic.ToMessage()); } private void _OnTopicChange(object sender, TopicChangeEventArgs e) { GroupChatModel cchat = (GroupChatModel)GetChat(e.Channel, ChatType.Group); var builder = CreateMessageBuilder(); builder.AppendMessage(e.NewTopic); Session.UpdateTopicInGroupChat(cchat, builder.ToMessage()); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); MessagePartModel who; if (String.IsNullOrEmpty(e.Who)) { // server changed topic who = builder.CreateText(e.Data.From); } else { who = builder.CreateIdendityName(GetPerson(cchat, e.Who)); } builder.AppendFormat(_("{0} changed the topic of {1} to: {2}"), who, e.Channel, e.NewTopic); Session.AddMessageToChat(cchat, builder.ToMessage()); } void OnOwner(object sender, OwnerEventArgs e) { var cchat = (GroupChatModel) GetChat(e.Channel, ChatType.Group); var user = (IrcGroupPersonModel) cchat.GetPerson(e.Whom); if (user != null) { user.IsOwner = true; Session.UpdatePersonInGroupChat(cchat, user, user); #if LOG4NET } else { _Logger.Error("OnOwner(): cchat.GetPerson(e.Whom) returned null! cchat.Name: "+cchat.Name+" e.Whom: "+e.Whom); #endif } } void OnDeowner(object sender, DeownerEventArgs e) { var cchat = (GroupChatModel) GetChat(e.Channel, ChatType.Group); var user = (IrcGroupPersonModel) cchat.GetPerson(e.Whom); if (user != null) { user.IsOwner = false; Session.UpdatePersonInGroupChat(cchat, user, user); #if LOG4NET } else { _Logger.Error("OnDeowner(): cchat.GetPerson(e.Whom) returned null! cchat.Name: "+cchat.Name+" e.Whom: "+e.Whom); #endif } } void OnChannelAdmin(object sender, ChannelAdminEventArgs e) { var cchat = (GroupChatModel) GetChat(e.Channel, ChatType.Group); var user = (IrcGroupPersonModel) cchat.GetPerson(e.Whom); if (user != null) { user.IsChannelAdmin = true; Session.UpdatePersonInGroupChat(cchat, user, user); #if LOG4NET } else { _Logger.Error("OnChannelAdmin(): cchat.GetPerson(e.Whom) returned null! cchat.Name: "+cchat.Name+" e.Whom: "+e.Whom); #endif } } void OnDeChannelAdmin(object sender, DeChannelAdminEventArgs e) { var cchat = (GroupChatModel) GetChat(e.Channel, ChatType.Group); var user = (IrcGroupPersonModel) cchat.GetPerson(e.Whom); if (user != null) { user.IsChannelAdmin = false; Session.UpdatePersonInGroupChat(cchat, user, user); #if LOG4NET } else { _Logger.Error("OnDeChannelAdmin(): cchat.GetPerson(e.Whom) returned null! cchat.Name: "+cchat.Name+" e.Whom: "+e.Whom); #endif } } private void _OnOp(object sender, OpEventArgs e) { GroupChatModel cchat = (GroupChatModel)GetChat(e.Channel, ChatType.Group); IrcGroupPersonModel user = (IrcGroupPersonModel)cchat.GetPerson(e.Whom); if (user != null) { user.IsOp = true; Session.UpdatePersonInGroupChat(cchat, user, user); #if LOG4NET } else { _Logger.Error("_OnOp(): cchat.GetPerson(e.Whom) returned null! cchat.Name: "+cchat.Name+" e.Whom: "+e.Whom); #endif } } private void _OnDeop(object sender, DeopEventArgs e) { GroupChatModel cchat = (GroupChatModel)GetChat(e.Channel, ChatType.Group); IrcGroupPersonModel user = (IrcGroupPersonModel)cchat.GetPerson(e.Whom); if (user != null) { user.IsOp = false; Session.UpdatePersonInGroupChat(cchat, user, user); #if LOG4NET } else { _Logger.Error("_OnDeop(): cchat.GetPerson(e.Whom) returned null! cchat.Name: "+cchat.Name+" e.Whom: "+e.Whom); #endif } } void OnHalfop(object sender, HalfopEventArgs e) { var cchat = (GroupChatModel) GetChat(e.Channel, ChatType.Group); var user = (IrcGroupPersonModel) cchat.GetPerson(e.Whom); if (user != null) { user.IsHalfop = true; Session.UpdatePersonInGroupChat(cchat, user, user); #if LOG4NET } else { _Logger.Error("OnHalfop(): cchat.GetPerson(e.Whom) returned null! cchat.Name: "+cchat.Name+" e.Whom: "+e.Whom); #endif } } void OnDehalfop(object sender, DehalfopEventArgs e) { GroupChatModel cchat = (GroupChatModel)GetChat(e.Channel, ChatType.Group); IrcGroupPersonModel user = (IrcGroupPersonModel)cchat.GetPerson(e.Whom); if (user != null) { user.IsHalfop = false; Session.UpdatePersonInGroupChat(cchat, user, user); #if LOG4NET } else { _Logger.Error("OnDehalfop(): cchat.GetPerson(e.Whom) returned null! cchat.Name: "+cchat.Name+" e.Whom: "+e.Whom); #endif } } private void _OnVoice(object sender, VoiceEventArgs e) { GroupChatModel cchat = (GroupChatModel)GetChat(e.Channel, ChatType.Group); IrcGroupPersonModel user = (IrcGroupPersonModel)cchat.GetPerson(e.Whom); if (user != null) { user.IsVoice = true; Session.UpdatePersonInGroupChat(cchat, user, user); #if LOG4NET } else { _Logger.Error("cchat.GetPerson(e.Whom) returned null! cchat.Name: "+cchat.Name+" e.Whom: "+e.Whom); #endif } } private void _OnDevoice(object sender, DevoiceEventArgs e) { GroupChatModel cchat = (GroupChatModel)GetChat(e.Channel, ChatType.Group); IrcGroupPersonModel user = (IrcGroupPersonModel)cchat.GetPerson(e.Whom); if (user != null) { user.IsVoice = false; Session.UpdatePersonInGroupChat(cchat, user, user); #if LOG4NET } else { _Logger.Error("cchat.GetPerson(e.Whom) returned null! cchat.Name: "+cchat.Name+" e.Whom: "+e.Whom); #endif } } private void _OnModeChange(object sender, IrcEventArgs e) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); string modechange; string who = null; ChatModel target = null; switch (e.Data.Type) { case ReceiveType.UserModeChange: modechange = e.Data.RawMessageArray[3]; if (modechange.StartsWith(":")) { modechange = modechange.Substring(1); } who = e.Data.Irc.Nickname; target = _NetworkChat; builder.AppendFormat(_("Mode change [{0}] for user {1}"), modechange, CreatePerson(who)); break; case ReceiveType.ChannelModeChange: modechange = String.Join(" ", e.Data.RawMessageArray, 3, e.Data.RawMessageArray.Length - 3); target = GetChat(e.Data.Channel, ChatType.Group) ?? Chat; UpdateGroupPerson(target, e.Data); MessagePartModel whoMsgPart; if (e.Data.Nick != null && e.Data.Nick.Length > 0) { whoMsgPart = builder.CreateIdendityName(GetPerson(target, e.Data.Nick)); } else { // server changed mode whoMsgPart = builder.CreateText(e.Data.From); } builder.AppendFormat(_("mode/{0} [{1}] by {2}"), e.Data.Channel, modechange, whoMsgPart); break; } if (target == null) { #if LOG4NET _Logger.Error("_OnModeChange(): target is null!"); #endif return; } Session.AddMessageToChat(target, builder.ToMessage()); } private void _OnQuit(object sender, QuitEventArgs e) { #if LOG4NET // logging noise //_Logger.Debug("_Quit() e.Who: "+e.Who); #endif if (e.Data.Irc.IsMe(e.Who)) { // _OnDisconnect() handles this } else { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendFormat(_("{0} [{1}] has quit"), CreatePerson(e.Who), String.Format("{0}@{1}", e.Data.Ident, e.Data.Host)); builder.AppendText(" ["); // colors are annoying in quit messages builder.Settings.StripColors = true; builder.AppendMessage(e.QuitMessage); builder.AppendText("]"); var quitMsg = builder.ToMessage(); foreach (ChatModel chat in Chats) { if (chat.ChatType == ChatType.Group) { GroupChatModel cchat = (GroupChatModel)chat; PersonModel user = cchat.GetPerson(e.Who); if (user != null) { // he is on this channel, let's remove him Session.RemovePersonFromGroupChat(cchat, user); Session.AddMessageToChat(cchat, quitMsg); } } else if ((chat.ChatType == ChatType.Person) && (chat.ID == e.Who)) { Session.AddMessageToChat(chat, quitMsg); } } } } private void _OnRegistered(object sender, EventArgs e) { OnConnected(EventArgs.Empty); // preliminary person Me = CreatePerson(_IrcClient.Nickname); // WHO ourself so OnWho() can retrieve our ident, host and realname _IrcClient.RfcWho(_IrcClient.Nickname); } protected override void OnConnected(EventArgs e) { foreach (ChatModel chat in Chats) { // re-enable all person chats if (chat.ChatType == ChatType.Person) { Session.EnableChat(chat); // and re-sync them else new messages are not processed in // the FrontendManager Session.SyncChat(chat); } // group chats are handled in _OnJoin() } base.OnConnected(e); } private void _OnDisconnected(object sender, EventArgs e) { Trace.Call(sender, e); // reset join queue lock (_ActiveChannelJoinList) { _ActiveChannelJoinList.Clear(); } lock (_QueuedChannelJoinList) { _QueuedChannelJoinList.Clear(); } _ChannelJoinQueue.Reset(true); _ActiveChannelJoinHandle.Reset(); OnDisconnected(EventArgs.Empty); } private void OnAutoConnectError(object sender, AutoConnectErrorEventArgs e) { Trace.Call(sender, e); var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Connection to {0} port {1} has failed " + "(attempt {2}), retrying in {3} seconds..."), e.Address, e.Port, _IrcClient.AutoRetryAttempt, _IrcClient.AutoRetryDelay); Session.AddMessageToChat(_NetworkChat, builder.ToMessage()); } protected override void OnDisconnected(EventArgs e) { foreach (ChatModel chat in Chats) { // don't disable the protocol chat, else the user loses all // control for the protocol manager! e.g. after a manual // reconnect or server-side disconnect if (chat.ChatType == ChatType.Protocol) { continue; } Session.DisableChat(chat); } // reset the nickname list, so if we connect again we will start // using the best nickname again _CurrentNickname = 0; base.OnDisconnected(e); } private void _OnAway(object sender, AwayEventArgs e) { ChatModel chat = GetChat(e.Who, ChatType.Person); if (chat == null) { chat = _NetworkChat; } else { PersonModel person = ((PersonChatModel) chat).Person; IrcPersonModel ircperson = (IrcPersonModel) person; if (ircperson.AwayMessage != e.AwayMessage) { ircperson.AwayMessage = e.AwayMessage; ircperson.IsAwaySeen = false; ircperson.IsAway = true; } if (ircperson.IsAwaySeen) { return; } ircperson.IsAwaySeen = true; } var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("{0} is away: {1}"), e.Who, e.AwayMessage). ToMessage(); Session.AddMessageToChat(chat, msg); } private void _OnUnAway(object sender, IrcEventArgs e) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("You are no longer marked as being away")). ToMessage(); Session.AddMessageToChat(Chat, msg); Session.UpdateNetworkStatus(); } private void _OnNowAway(object sender, IrcEventArgs e) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("You have been marked as being away")). ToMessage(); Session.AddMessageToChat(Chat, msg); Session.UpdateNetworkStatus(); } private void _LagWatcher() { try { while (true) { // check every 10 seconds Thread.Sleep(10000); if (_IrcClient == null || !_IrcClient.IsConnected) { // nothing to do continue; } TimeSpan lag = _IrcClient.Lag; TimeSpan diff = lag - _LastLag; int absDiff = Math.Abs((int) diff.TotalSeconds); // update network status if the lag changed over 5 seconds if (absDiff > 5) { #if LOG4NET _Logger.Debug("_LagWatcher(): lag: " + lag.TotalSeconds + " seconds, difference: " + absDiff + " seconds"); #endif Session.UpdateNetworkStatus(); } _LastLag = lag; } } catch (ThreadAbortException) { #if LOG4NET _Logger.Debug("_LagWatcher(): thread aborted"); #endif } catch (Exception ex) { #if LOG4NET _Logger.Error(ex); #endif } } private int GetProtocolMessageLength(string command, string target, string message) { // : : return 1 + Prefix.Length + 1 + command.Length + 1 + target.Length + 2 + _IrcClient.Encoding.GetByteCount(message) + 2; } // HACK: workaround a compiler bug in Mono #if __MonoCS__ protected new T GetPerson(ChatModel chat, string nick) where T : PersonModel #else protected override T GetPerson(ChatModel chat, string nick) #endif { var person = base.GetPerson(chat, nick); #if LOG4NET if (chat == null) { _Logger.Warn("GetPerson(" + chat + ", " + nick + "): chat is null!"); } if (person == null) { _Logger.Warn("GetPerson(" + chat + ", " + nick + "): person is null!"); } #endif if (chat == null || person == null) { person = (T)(object) CreatePerson(nick); } return person; } IrcPersonModel GetPerson(ChatModel chat, string nick) { return GetPerson(chat, nick); } private IrcPersonModel CreatePerson(string nick) { return CreatePerson(nick, null, null, null); } private IrcPersonModel CreatePerson(string nick, string realname, string ident, string host) { var person = new IrcPersonModel(nick, realname,ident, host, NetworkID, this); if (_IrcClient.IsMe(nick)) { person.IdentityNameColored.ForegroundColor = IrcTextColor.Blue; person.IdentityNameColored.BackgroundColor = TextColor.None; person.IdentityNameColored.Bold = true; } return person; } private IrcGroupPersonModel CreateGroupPerson(string nick) { var person = new IrcGroupPersonModel(nick, NetworkID, this); if (_IrcClient.IsMe(nick)) { person.IdentityNameColored.ForegroundColor = IrcTextColor.Blue; person.IdentityNameColored.BackgroundColor = TextColor.None; person.IdentityNameColored.Bold = true; } return person; } void UpdateGroupPerson(ChatModel chat, IrcMessageData msg) { if (!(chat is GroupChatModel)) { return; } // server messages have no nick if (msg.Nick == null) { return; } // write-back ident/host to person var groupChat = (GroupChatModel) chat; var person = groupChat.GetPerson(msg.Nick) as IrcGroupPersonModel; if (person == null) { return; } person.Ident = person.Ident ?? msg.Ident; person.Host = person.Host ?? msg.Host; } private ChatModel GetChat(IrcMessageData msg) { if (msg == null) { throw new ArgumentNullException("msg"); } if (msg.Channel != null) { // group chat message return GetChat(msg.Channel, ChatType.Group); } if (msg.Nick != null) { // person chat message return GetChat(msg.Nick, ChatType.Person); } if (msg.From != null) { // server message return _NetworkChat; } return null; } protected override T CreateMessageBuilder() { return (T)(object) base.CreateMessageBuilder(); } void AutoRenick() { if (_IrcClient.AutoNickHandling || _IrcClient.IsRegistered) { return; } // allright, we have to care then and try a different nick as // we don't have a nick yet string nick; if (_CurrentNickname == _Nicknames.Length - 1) { // we tried all nicks already, so fallback to random Random rand = new Random(); int number = rand.Next(999); nick = _Nicknames[_CurrentNickname].Substring(0, 5) + number; } else { _CurrentNickname++; nick = _Nicknames[_CurrentNickname]; } _IrcClient.RfcNick(nick, Priority.Critical); } private static string _(string msg) { return LibraryCatalog.GetString(msg, _LibraryTextDomain); } public static string NormalizeNick(string nickname) { string normalized = nickname; normalized = normalized.ToLower(); normalized = normalized.Replace("[", "{"); normalized = normalized.Replace("]", "}"); normalized = normalized.Replace("\\", "|"); normalized = normalized.Replace("~", "^"); return normalized; } public static bool CompareNicks(string a, string b) { return NormalizeNick(a) == NormalizeNick(b); } } } smuxi-0.11/src/Engine-IRC/Protocols/Irc/IrcGroupPersonModel.cs0000644000175000017500000001043112253423337024742 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2007, 2011 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Runtime.Serialization; using Smuxi.Common; namespace Smuxi.Engine { [Serializable] public class IrcGroupPersonModel : IrcPersonModel { public bool IsOwner { get; internal set; } public bool IsChannelAdmin { get; internal set; } public bool IsOp { get; internal set; } public bool IsHalfop { get; internal set; } public bool IsVoice { get; internal set; } internal IrcGroupPersonModel(string nickname, string realname, string ident, string host, string networkID, IProtocolManager networkManager) : base(nickname, realname, ident, host, networkID, networkManager) { } internal IrcGroupPersonModel(string nickname, string networkID, IProtocolManager networkManager) : base(nickname, networkID, networkManager) { } internal protected IrcGroupPersonModel(SerializationInfo info, StreamingContext ctx) : base(info, ctx) { } protected override void GetObjectData(SerializationWriter sw) { if (sw == null) { throw new ArgumentNullException("sw"); } base.GetObjectData(sw); sw.Write(IsOp); sw.Write(IsVoice); sw.Write(IsOwner); sw.Write(IsChannelAdmin); sw.Write(IsHalfop); } protected override void SetObjectData(SerializationReader sr) { if (sr == null) { throw new ArgumentNullException("sr"); } base.SetObjectData(sr); IsOp = sr.ReadBoolean(); IsVoice = sr.ReadBoolean(); // backward compatibility if (sr.PeekChar() != -1) { IsOwner = sr.ReadBoolean(); IsChannelAdmin = sr.ReadBoolean(); IsHalfop = sr.ReadBoolean(); } } public override int CompareTo(ContactModel contact) { var ircContact = contact as IrcGroupPersonModel; if (ircContact == null) { return 1; } int status1 = 0; if (IsOwner) { status1 += 5; } else if (IsChannelAdmin) { status1 += 4; } else if (IsOp) { status1 += 3; } else if (IsHalfop) { status1 += 2; } else if (IsVoice) { status1 += 1; } int status2 = 0; if (ircContact.IsOwner) { status2 += 5; } else if (ircContact.IsChannelAdmin) { status2 += 4; } else if (ircContact.IsOp) { status2 += 3; } else if (ircContact.IsHalfop) { status2 += 2; } else if (ircContact.IsVoice) { status2 += 1; } int res = status2.CompareTo(status1); if (res != 0 ) { return res; } // the status is equal, so the name decides return base.CompareTo(contact); } } } smuxi-0.11/src/Engine-IRC/Protocols/Irc/IrcPersonModel.cs0000644000175000017500000001171711655545675023754 0ustar00meebeymeebey00000000000000/* * $Id: IrcUser.cs 142 2007-01-02 22:19:08Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/IrcUser.cs $ * $Rev: 142 $ * $Author: meebey $ * $Date: 2007-01-02 23:19:08 +0100 (Tue, 02 Jan 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Runtime.Serialization; using Smuxi.Common; namespace Smuxi.Engine { [Serializable] public class IrcPersonModel : PersonModel { private string _RealName; private string _Ident; private string _Host; private string _AwayMessage; private bool _IsAwaySeen; private bool _IsAway; public string NickName { get { return IdentityName; } internal set { IdentityName = value; } } public string RealName { get { return _RealName; } internal set { _RealName = value; } } public string Ident { get { return _Ident; } internal set { _Ident = value; } } public string Host { get { return _Host; } internal set { _Host = value; } } /// /// Store the last away message. /// public string AwayMessage { get { return this._AwayMessage; } set { this._AwayMessage = value; } } /// /// Whether has been shown or not. /// public bool IsAwaySeen { get { return this._IsAwaySeen; } set { this._IsAwaySeen = value; } } /// /// Whether this user is away or not. /// public bool IsAway { get { return this._IsAway; } set { this._IsAway = value; } } internal IrcPersonModel(string nickName, string realName, string ident, string host, string networkID, IProtocolManager protocolManager) : base(nickName, nickName, networkID, "IRC", protocolManager) { _RealName = realName; _Ident = ident; _Host = host; } internal protected IrcPersonModel(string nickName, string networkID, IProtocolManager protocolManager) : base(nickName, nickName, networkID, "IRC", protocolManager) { } internal protected IrcPersonModel(SerializationInfo info, StreamingContext ctx) : base(info, ctx) { } protected override void GetObjectData(SerializationWriter sw) { if (sw == null) { throw new ArgumentNullException("sw"); } base.GetObjectData(sw); sw.Write(_RealName); sw.Write(_Ident); sw.Write(_Host); } protected override void SetObjectData(SerializationReader sr) { if (sr == null) { throw new ArgumentNullException("sr"); } base.SetObjectData(sr); _RealName = sr.ReadString(); _Ident = sr.ReadString(); _Host = sr.ReadString(); } protected override TextMessagePartModel GetColoredIdentityName( string idendityName, string normalized) { normalized = IrcProtocolManager.NormalizeNick(idendityName.TrimEnd('_')); return base.GetColoredIdentityName(idendityName, normalized); } } } smuxi-0.11/src/Engine-IRC/Protocols/Irc/IrcMessageBuilder.cs0000644000175000017500000002635712300201645024374 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Text.RegularExpressions; namespace Smuxi.Engine { public enum IrcControlCode : int { Bold = 2, Color = 3, Clear = 15, Italic = 29, Underline = 31, } public class IrcMessageBuilder : MessageBuilder { private static char[] IrcControlChars { get; set; } static IrcMessageBuilder() { int[] intValues = (int[])Enum.GetValues(typeof(IrcControlCode)); char[] chars = new char[intValues.Length]; int i = 0; foreach (int intValue in intValues) { chars[i++] = (char)intValue; } IrcControlChars = chars; } public override MessageBuilder AppendMessage(string msg) { msg = msg ?? ""; if (msg.Length == 0) { return this; } // strip color and formatting if configured if (Settings.StripColors) { msg = Regex.Replace(msg, (char)IrcControlCode.Color + "[0-9]{1,2}(,[0-9]{1,2})?", String.Empty); } if (Settings.StripFormattings) { msg = Regex.Replace(msg, String.Format("({0}|{1}|{2}|{3})", (char)IrcControlCode.Bold, (char)IrcControlCode.Clear, (char)IrcControlCode.Italic, (char)IrcControlCode.Underline), String.Empty); } // convert * / _ to mIRC control characters string[] messageParts = msg.Split(new char[] {' '}); // better regex? \*([^ *]+)\* //string pattern = @"^({0})([A-Za-z0-9]+?){0}$"; string pattern = @"^({0})([^ *]+){0}$"; for (int i = 0; i < messageParts.Length; i++) { messageParts[i] = Regex.Replace(messageParts[i], String.Format(pattern, @"\*"), (char)IrcControlCode.Bold + "$1$2$1" + (char)IrcControlCode.Bold); messageParts[i] = Regex.Replace(messageParts[i], String.Format(pattern, "_"), (char)IrcControlCode.Underline + "$1$2$1" + (char)IrcControlCode.Underline); messageParts[i] = Regex.Replace(messageParts[i], String.Format(pattern, "/"), (char)IrcControlCode.Italic + "$1$2$1" + (char)IrcControlCode.Italic); } msg = String.Join(" ", messageParts); // crash: ^C^C0,7Dj Ler #Dj KanaL?na Girmek ZorunDaD?rLar UnutMay?N @>'^C0,4WwW.MaViGuL.NeT ^C4]^O ^C4]' // parse colors bool bold = false; bool underline = false; bool italic = false; bool color = false; TextColor fg_color = IrcTextColor.Normal; TextColor bg_color = IrcTextColor.Normal; bool controlCharFound; do { string submessage; int controlPos = msg.IndexOfAny(IrcControlChars); if (controlPos > 0) { // control char found and we have normal text infront controlCharFound = true; submessage = msg.Substring(0, controlPos); msg = msg.Substring(controlPos); } else if (controlPos != -1) { // control char found controlCharFound = true; char controlChar = msg.Substring(controlPos, 1)[0]; IrcControlCode controlCode = (IrcControlCode)controlChar; string controlChars = controlChar.ToString(); switch (controlCode) { case IrcControlCode.Clear: #if LOG4NET && MSG_DEBUG Logger.Debug("AppendMessage(): found clear control character"); #endif bold = false; underline = false; italic = false; color = false; fg_color = IrcTextColor.Normal; bg_color = IrcTextColor.Normal; break; case IrcControlCode.Bold: #if LOG4NET && MSG_DEBUG Logger.Debug("AppendMessage(): found bold control character"); #endif bold = !bold; break; case IrcControlCode.Underline: #if LOG4NET && MSG_DEBUG Logger.Debug("AppendMessage(): found underline control character"); #endif underline = !underline; break; case IrcControlCode.Italic: #if LOG4NET && MSG_DEBUG Logger.Debug("AppendMessage(): found italic control character"); #endif italic = !italic; break; case IrcControlCode.Color: #if LOG4NET && MSG_DEBUG Logger.Debug("AppendMessage(): found color control character"); #endif color = !color; string colorMessage = msg.Substring(controlPos); #if LOG4NET && MSG_DEBUG Logger.Debug("AppendMessage(): colorMessage: '" + colorMessage + "'"); #endif Match match = Regex.Match(colorMessage, "^" + (char)IrcControlCode.Color + "(?[0-9][0-9]?)(,(?[0-9][0-9]?))?"); if (match.Success) { controlChars = match.Value; int color_code; if (match.Groups["fg"] != null) { #if LOG4NET && MSG_DEBUG Logger.Debug("AppendMessage(): match.Groups[fg].Value: " + match.Groups["fg"].Value); #endif try { color_code = Int32.Parse(match.Groups["fg"].Value); fg_color = IrcColorToTextColor(color_code); } catch (FormatException) { fg_color = IrcTextColor.Normal; } } if (match.Groups["bg"] != null) { #if LOG4NET && MSG_DEBUG Logger.Debug("AppendMessage(): match.Groups[bg].Value: " + match.Groups["bg"].Value); #endif try { color_code = Int32.Parse(match.Groups["bg"].Value); bg_color = IrcColorToTextColor(color_code); } catch (FormatException) { bg_color = IrcTextColor.Normal; } } } else { controlChars = controlChar.ToString(); fg_color = IrcTextColor.Normal; bg_color = IrcTextColor.Normal; } #if LOG4NET && MSG_DEBUG Logger.Debug("AppendMessage(): fg_color.HexCode: " + String.Format("0x{0:X6}", fg_color.HexCode)); Logger.Debug("AppendMessage(): bg_color.HexCode: " + String.Format("0x{0:X6}", bg_color.HexCode)); #endif break; } #if LOG4NET && MSG_DEBUG Logger.Debug("AppendMessage(): controlChars.Length: " + controlChars.Length); #endif // check if there are more control chars in the rest of the message int nextControlPos = msg.IndexOfAny(IrcControlChars, controlPos + controlChars.Length); if (nextControlPos != -1) { // more control chars found submessage = msg.Substring(controlChars.Length, nextControlPos - controlChars.Length); msg = msg.Substring(nextControlPos); } else { // no next control char // skip the control chars submessage = msg.Substring(controlChars.Length); msg = String.Empty; } } else { // no control char, nothing to do controlCharFound = false; submessage = msg; } TextMessagePartModel msgPart = new TextMessagePartModel(); msgPart.Text = submessage; msgPart.Bold = bold; msgPart.Underline = underline; msgPart.Italic = italic; msgPart.ForegroundColor = fg_color; msgPart.BackgroundColor = bg_color; Append(ParsePatterns(msgPart)); } while (controlCharFound); return this; } private static TextColor IrcColorToTextColor(int color) { switch (color) { case 0: return IrcTextColor.White; case 1: return IrcTextColor.Black; case 2: return IrcTextColor.Blue; case 3: return IrcTextColor.Green; case 4: return IrcTextColor.Red; case 5: return IrcTextColor.Brown; case 6: return IrcTextColor.Purple; case 7: return IrcTextColor.Orange; case 8: return IrcTextColor.Yellow; case 9: return IrcTextColor.LightGreen; case 10: return IrcTextColor.Teal; case 11: return IrcTextColor.LightCyan; case 12: return IrcTextColor.LightBlue; case 13: return IrcTextColor.LightPurple; case 14: return IrcTextColor.Grey; case 15: return IrcTextColor.LightGrey; default: return IrcTextColor.Normal; } } } } smuxi-0.11/src/Engine-IRC/Config/0000755000175000017500000000000012311344240017204 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-IRC/Config/IrcServerModel.cs0000644000175000017500000000213011700531610022414 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; namespace Smuxi.Engine { public class IrcServerModel : ServerModel { public List Nicknames { get; set; } public IrcServerModel() { } } } smuxi-0.11/src/Engine-IRC/Makefile.in0000644000175000017500000010244512311344230020051 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/smuxi-engine-irc.pc.in \ ChangeLog subdir = src/Engine-IRC ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = smuxi-engine-irc.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ # Warning: This is an automatically generated file, do not edit! @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/debug/smuxi-engine-irc.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/release/smuxi-engine-irc.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-common.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-engine.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-common.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-engine.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin/debug @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin/release @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB = $(BUILD_DIR)/smuxi-engine.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_MDB = @ENABLE_DEBUG_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_RELEASE_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_DEBUG_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_RELEASE_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/debug/smuxi-engine.dll @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/release/smuxi-engine.dll @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/release/smuxi-common.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB_SOURCE = ../../bin/debug/smuxi-engine.dll.mdb AL = al2 SATELLITE_ASSEMBLY_NAME = .resources.dll PROGRAMFILES = \ $(LOG4NET_DLL) \ $(NINI_DLL) \ $(SMUXI_COMMON_DLL) \ $(SMUXI_COMMON_DLL_MDB) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_ENGINE_DLL_MDB) LINUX_PKGCONFIG = \ $(ENGINE_IRC_PC) FILES = \ Protocols/Irc/IrcGroupPersonModel.cs \ Protocols/Irc/IrcMessageBuilder.cs \ Protocols/Irc/IrcProtocolManager.cs \ Protocols/Irc/IrcPersonModel.cs \ Protocols/Irc/IrcTextColor.cs \ Config/IrcServerModel.cs \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-engine-irc.pc.in REFERENCES = \ System \ System.Core \ Mono.Posix \ $(LOG4NET_LIBS) DLL_REFERENCES = \ $(BUILD_DIR)/Meebey.SmartIrc4net.dll CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) ENGINE_IRC_PC = $(BUILD_DIR)/smuxi-engine-irc.pc SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Engine-IRC/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Engine-IRC/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): smuxi-engine-irc.pc: $(top_builddir)/config.status $(srcdir)/smuxi-engine-irc.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(eval $(call emit-deploy-wrapper,ENGINE_IRC_PC,smuxi-engine-irc.pc)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Frontend-STFL/0000755000175000017500000000000012311344241016505 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-STFL/smuxi-frontend-stfl.exe.config0000644000175000017500000000243112253423337024415 0ustar00meebeymeebey00000000000000
    smuxi-0.11/src/Frontend-STFL/STFL/0000755000175000017500000000000012311344241017255 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-STFL/STFL/KeyPressedEventArgs.cs0000644000175000017500000000327211700531605023510 0ustar00meebeymeebey00000000000000/* * $Id: TestUI.cs 179 2007-04-21 15:01:29Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-Test/TestUI.cs $ * $Rev: 179 $ * $Author: meebey $ * $Date: 2007-04-21 17:01:29 +0200 (Sat, 21 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Stfl { public delegate void KeyPressedEventHandler(object sender, KeyPressedEventArgs e); public class KeyPressedEventArgs : EventArgs { private string _Key; private string _Focus; public string Key { get { return _Key; } } public string Focus { get { return _Focus; } } public KeyPressedEventArgs(string key, string focus) { _Key = key; _Focus = focus; } } } smuxi-0.11/src/Frontend-STFL/STFL/TextView.cs0000644000175000017500000003170712253423337021404 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011, 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Collections.Generic; namespace Stfl { public class TextView : Widget { #if LOG4NET static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public string OffsetVariableName { get; set; } public bool AutoLineWrap { get; set; } List Lines { get; set; } int WrappedLineCount { get; set; } static Regex StyleTagRegex = new Regex("<([^>]+)>"); public int Offset { get { var offset = Form[OffsetVariableName]; if (String.IsNullOrEmpty(offset)) { return -1; } return Int32.Parse(offset); } set { var minOffset = OffsetStart; var maxOffset = OffsetEnd; if (value == -1) { value = maxOffset; } else if (value > maxOffset) { value = maxOffset; } else if (value < minOffset) { value = minOffset; } Form[OffsetVariableName] = value.ToString(); } } public int OffsetStart { get { return 0; } } public int OffsetEnd { get { int heigth = Heigth; if (WrappedLineCount <= heigth) { return 0; } return WrappedLineCount - heigth; } } public TextView(Form form, string widgetId) : base(form, widgetId) { Lines = new List(); Form.EventReceived += OnEventReceived; } public void AppendWrappedLine(string line) { WrappedLineCount++; Form.Modify( WidgetName, "append", String.Format("{{listitem text:{0}}}", StflApi.stfl_quote(line)) ); } public void AppendWrappedLines(IEnumerable lines) { foreach (var line in lines) { AppendWrappedLine(line); } } public void AppendLine(string line) { var width = Width; if (!AutoLineWrap || width <= 0) { // we don't know our width for whatever reason thus we can't // apply any line wrapping Lines.Add(line); AppendWrappedLine(line); return; } Lines.Add(line); AppendWrappedLines(WrapLine(line, width)); } public void AppendLines(IEnumerable lines) { var width = Width; if (!AutoLineWrap || width <= 0) { // we don't know our width for whatever reason thus we can't // apply any line wrapping Lines.AddRange(lines); AppendWrappedLines(lines); return; } Lines.AddRange(lines); var wrappedLines = new List(lines); foreach (var line in lines) { wrappedLines.AddRange(WrapLine(line, width)); } AppendWrappedLines(wrappedLines); } public void ScrollUp() { Scroll(-0.9); } public void ScrollDown() { Scroll(0.9); } protected void Scroll(double scrollFactor) { int currentOffset = Offset; try { int newOffset = (int) (currentOffset + (Heigth * scrollFactor)); if (newOffset < 0) { newOffset = 0; } else if (newOffset > OffsetEnd) { newOffset = OffsetEnd; } Offset = newOffset; } catch (FormatException ex) { #if LOG4NET Logger.ErrorFormat( "Scroll({0}): FormatException, ignoring...", ex ); #endif } } public void ScrollToStart() { Offset = OffsetStart; } public void ScrollToEnd() { Offset = OffsetEnd; } public void Clear() { Lines.Clear(); WrappedLineCount = 0; Form.Modify(WidgetName, "replace_inner", "{list}"); ScrollToStart(); } /// /// Splits a line into characters, keeping style tags intact and /// attached to the character following them, and not breaking apart /// escapes of <. /// private static IList SplitStyledLineIntoCharacters(string line) { var chars = new List(); string assembleStyle = null; bool tagging = false; for (int i = 0; i < line.Length; ++i) { char c = line [i]; if (c == '<') { if (i < line.Length - 1 && line [i+1] == '>') { // this is <> which is an escape of < if (assembleStyle != null) { chars.Add('<' + assembleStyle + "><>"); } else { chars.Add("<>"); } // no style anymore assembleStyle = null; // skip the > too ++i; } else { // style begins assembleStyle = String.Empty; tagging = true; } } else if (c == '>') { // style ended tagging = false; } else if (tagging) { // add to style assembleStyle += c; } else { // normal character if (assembleStyle != null) { // we have a style too chars.Add('<' + assembleStyle + '>' + c); } else { chars.Add(c.ToString()); } // no style anymore assembleStyle = null; } } return chars; } /// /// Returns the length of the given line in characters that will /// actually be displayed. /// private static int LengthWithoutStyle(string line) { var untaggedString = StyleTagRegex.Replace(line, ""); var unescapedString = untaggedString.Replace("<>", "<"); return unescapedString.Length; } public static List WrapLine(string line, int wrapWidth) { if (line == null) { throw new ArgumentNullException("line"); } if (wrapWidth <= 0) { throw new ArgumentException("Wrap width must bigger than 0", "wrapWidth"); } // split the line on spaces IList splitOnSpaces = line.Split(' ').ToList(); var wrappedLine = new List(); var freshestStyle = ""; // as long as there is anything left to wrap while (splitOnSpaces.Count > 0) { var joinedUp = splitOnSpaces [0]; int currentLengthWithoutStyle = LengthWithoutStyle(joinedUp); // take one word if (currentLengthWithoutStyle > wrapWidth) { // uh-oh, cannot grab first word whole; must split it var chars = SplitStyledLineIntoCharacters(joinedUp); joinedUp = String.Join("", chars.Take(wrapWidth).ToArray()); currentLengthWithoutStyle = wrapWidth; // process the remaining characters next time var rest = splitOnSpaces [0].Substring(joinedUp.Length); splitOnSpaces.RemoveAt(0); splitOnSpaces.Insert(0, rest); } else { // that worked splitOnSpaces.RemoveAt(0); // try taking more words var joinedUpBuilder = new StringBuilder(joinedUp, wrapWidth*2); while (splitOnSpaces.Count > 0) { // + 1 accounts for the joining space var newLengthWithoutStyle = currentLengthWithoutStyle + 1 + LengthWithoutStyle(splitOnSpaces [0]); if (newLengthWithoutStyle > wrapWidth) { // that won't work anymore break; } joinedUpBuilder.Append(' '); joinedUpBuilder.Append(splitOnSpaces [0]); currentLengthWithoutStyle = newLengthWithoutStyle; splitOnSpaces.RemoveAt(0); } joinedUp = joinedUpBuilder.ToString(); } // prepend the currently freshest style unless the line starts with a style if (!joinedUp.StartsWith("<")) { joinedUp = freshestStyle + joinedUp; } // find out the now-freshest style var styleTags = StyleTagRegex.Matches(joinedUp); if (styleTags.Count > 0) { var lastTagName = styleTags[styleTags.Count-1].Groups[1].Value; if (lastTagName.IndexOf('/') != -1) { // closing tag -- no more style freshestStyle = ""; } else { // we have a new style freshestStyle = '<' + lastTagName + '>'; // make sure to terminate our string joinedUp += ""; } } // add the joined-up, style-terminated line to the list wrappedLine.Add(joinedUp); } return wrappedLine; } void Resize() { var width = Width; if (!AutoLineWrap || width <= 0) { // nothing to do return; } var estimatedLines = Math.Max(WrappedLineCount, Lines.Count); // see items.AppendFormat() below var lineStyleOverhead = 18; var listStyleOverhead = 6; var estimatedLength = listStyleOverhead + (estimatedLines * (width + lineStyleOverhead)); estimatedLength = (int) (estimatedLength * 1.2); // re-wrap all lines and re-apply offset WrappedLineCount = 0; var offset = Offset; var items = new StringBuilder("{list", estimatedLength); foreach (var line in Lines) { foreach (var wrappedLine in WrapLine(line, width)) { WrappedLineCount++; items.AppendFormat("{{listitem text:{0}}}", StflApi.stfl_quote(wrappedLine)); } } items.Append("}"); Form.Modify(WidgetName, "replace_inner", items.ToString()); Offset = offset; } void OnEventReceived(object sender, EventReceivedEventArgs e) { if (e.Event == "RESIZE") { DateTime start, stop; start = DateTime.UtcNow; Resize(); stop = DateTime.UtcNow; #if LOG4NET Logger.DebugFormat( "OnEventReceived(): Resize() took: {0:0.00} ms " + "lines: {1} wrapped lines: {2} width: {3}", (stop - start).TotalMilliseconds, Lines.Count, WrappedLineCount, Width ); #endif } } } } smuxi-0.11/src/Frontend-STFL/STFL/Form.cs0000644000175000017500000001306412253423337020524 0ustar00meebeymeebey00000000000000/* * $Id: TestUI.cs 179 2007-04-21 15:01:29Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-Test/TestUI.cs $ * $Rev: 179 $ * $Author: meebey $ * $Date: 2007-04-21 17:01:29 +0200 (Sat, 21 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Text; using System.Runtime.InteropServices; using System.Reflection; namespace Stfl { public class Form : IDisposable { IntPtr f_Handle; bool Disposed { get; set; } public event KeyPressedEventHandler KeyPressed; public event EventHandler EventReceived; public event EventHandler Resized; public string this[string name] { get { CheckDisposed(); return StflApi.stfl_get(f_Handle, name); } set { CheckDisposed(); StflApi.stfl_set(f_Handle, name, value); } } public Form(string text) { f_Handle = StflApi.stfl_create(text); // initialize ncurses StflApi.stfl_run(f_Handle, -3); //StflApi.raw(); NcursesApi.nocbreak(); } public Form(Assembly assembly, string resourceName) { if (assembly == null) { assembly = Assembly.GetCallingAssembly(); } using (Stream stream = assembly.GetManifestResourceStream(resourceName)) using (StreamReader reader = new StreamReader(stream)) { if (stream == null) { throw new ArgumentException(resourceName + " could not be found in assembly", "resourceName"); } string text = reader.ReadToEnd(); if (String.IsNullOrEmpty(text)) { throw new ArgumentException(resourceName + " in assembly is missing or empty.", "resourceName"); } f_Handle = StflApi.stfl_create(text); } } ~Form() { Dispose(false); } protected virtual void Dispose(bool disposing) { var disposed = Disposed; if (disposed) { return; } if (f_Handle != IntPtr.Zero) { StflApi.stfl_free(f_Handle); } } public virtual void Dispose() { Dispose(true); GC.SuppressFinalize(this); } public virtual void Run(int timeout) { CheckDisposed(); string @event = StflApi.stfl_run(f_Handle, timeout); if (timeout == -3) { // HACK: timeout of -3 should never return an event but // sometimes does which causes event duplication return; } ProcessEvent(@event); } public void Run() { Run(0); } public void Modify(string name, string mode, string text) { CheckDisposed(); StflApi.stfl_modify(f_Handle, name, mode, text); } public string Dump(string name, string prefix, int focus) { CheckDisposed(); return StflApi.stfl_dump(f_Handle, name, prefix, focus); } public void Reset() { CheckDisposed(); Dispose(); StflApi.stfl_reset(); } protected virtual void ProcessEvent(string @event) { OnEventReceived(new EventReceivedEventArgs(@event)); switch (@event) { case null: case "TIMEOUT": return; case "RESIZE": OnResized(EventArgs.Empty); return; } ProcessKey(@event); } protected virtual void OnEventReceived(EventReceivedEventArgs e) { if (EventReceived != null) { EventReceived(this, e); } } protected virtual void OnResized(EventArgs e) { if (Resized != null) { Resized(this, e); } } protected virtual void ProcessKey(string key) { CheckDisposed(); string focus = StflApi.stfl_get_focus(f_Handle); OnKeyPressed(new KeyPressedEventArgs(key, focus)); } protected virtual void OnKeyPressed(KeyPressedEventArgs e) { if (KeyPressed != null) { KeyPressed(this, e); } } void CheckDisposed() { if (!Disposed) { return; } throw new ObjectDisposedException(GetType().Name); } } } smuxi-0.11/src/Frontend-STFL/STFL/NcursesApi.cs0000644000175000017500000000243512250426550021672 0ustar00meebeymeebey00000000000000// $Id$ // // Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Runtime.InteropServices; namespace Stfl { internal static class NcursesApi { [DllImport("ncurses")] public static extern void raw(); [DllImport("ncurses")] public static extern void nocbreak(); [DllImport("ncurses")] public static extern void endwin(); [DllImport("ncurses")] public static extern void refresh(); } } smuxi-0.11/src/Frontend-STFL/STFL/StflApi.cs0000644000175000017500000001735412250426634021171 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2010 Mirco Bauer * Copyright (c) 2010 Andrius Bentkus * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Text; using System.Runtime.InteropServices; using Mono.Unix; namespace Stfl { internal class StflApi { public static bool IsXterm { get; private set; } static bool IsUtf8Locale { get; set; } static string EscapeLessThanCharacter { get; set; } static string EscapeGreaterThanCharacter { get; set; } static StflApi() { // check if he has a graphical terminal. screen/tmux in not // detected in case someone is using it in pure text mode string termName = Environment.GetEnvironmentVariable("TERM"); IsXterm = (termName != null && (termName.StartsWith("xterm") || termName.StartsWith("rxvt"))); // detect UTF-8 locale according to: // http://www.cl.cam.ac.uk/~mgk25/unicode.html#activate var locale = Environment.GetEnvironmentVariable("LC_ALL") ?? Environment.GetEnvironmentVariable("LC_LCTYPE") ?? Environment.GetEnvironmentVariable("LANG") ?? String.Empty; locale = locale.ToUpperInvariant(); IsUtf8Locale = locale.Contains("UTF-8") || locale.Contains("UTF8"); EscapeLessThanCharacter = "<>"; EscapeGreaterThanCharacter = ">"; } public static IntPtr ToUnixWideCharacters(string text) { if (text == null) { return IntPtr.Zero; } return UnixMarshal.StringToHeap(text, Encoding.UTF32); } public static string FromUnixWideCharacters(IntPtr text) { if (text == IntPtr.Zero) { return null; } return UnixMarshal.PtrToString(text, Encoding.UTF32); } public static string EscapeRichText(string text) { text = text.Replace("<", EscapeLessThanCharacter); text = text.Replace(">", EscapeGreaterThanCharacter); return text; } [DllImport("stfl")] static extern IntPtr stfl_create(IntPtr text); internal static IntPtr stfl_create(string text) { return stfl_create(ToUnixWideCharacters(text)); } [DllImport("stfl")] internal static extern void stfl_free(IntPtr form); [DllImport("stfl", EntryPoint = "stfl_run")] static extern IntPtr stfl_run_native(IntPtr form, int timeout); internal static string stfl_run(IntPtr form, int timeout) { IntPtr res = stfl_run_native(form, timeout); if (res == IntPtr.Zero) { return null; } return UnixMarshal.PtrToString(res, Encoding.UTF32); } [DllImport("stfl")] internal static extern void stfl_reset(); [DllImport("stfl")] static extern IntPtr stfl_get(IntPtr form, IntPtr name); internal static string stfl_get(IntPtr form, string text) { return FromUnixWideCharacters( stfl_get(form, ToUnixWideCharacters(text)) ); } [DllImport("stfl")] static extern void stfl_set(IntPtr form, IntPtr name, IntPtr value); internal static void stfl_set(IntPtr form, string name, string value) { stfl_set(form, ToUnixWideCharacters(name), ToUnixWideCharacters(value)); } [DllImport("stfl", EntryPoint = "stfl_get_focus")] static extern IntPtr stfl_get_focus_native(IntPtr form); internal static string stfl_get_focus(IntPtr form) { IntPtr res = stfl_get_focus_native(form); if (res == IntPtr.Zero) { return null; } return UnixMarshal.PtrToString(res, Encoding.UTF32); } [DllImport("stfl")] static extern void stfl_set_focus(IntPtr form, IntPtr name); internal static void stfl_set_focus(IntPtr form, string name) { stfl_set_focus(form, ToUnixWideCharacters(name)); } [DllImport("stfl")] static extern IntPtr stfl_quote(IntPtr text); internal static string stfl_quote(string text) { return FromUnixWideCharacters( stfl_quote(ToUnixWideCharacters(text)) ); } [DllImport("stfl")] static extern IntPtr stfl_dump(IntPtr form, IntPtr name, IntPtr prefix, int focus); internal static string stfl_dump(IntPtr form, string name, string prefix, int focus) { return FromUnixWideCharacters( stfl_dump(form, ToUnixWideCharacters(name), ToUnixWideCharacters(prefix), focus) ); } [DllImport("stfl")] static extern void stfl_modify(IntPtr form, IntPtr name, IntPtr mode, IntPtr text); internal static void stfl_modify(IntPtr form, string name, string mode, string text) { stfl_modify(form, ToUnixWideCharacters(name), ToUnixWideCharacters(mode), ToUnixWideCharacters(text)); } [DllImport("stfl")] static extern IntPtr stfl_lookup(IntPtr form, IntPtr path, IntPtr newname); internal static string stfl_lookup(IntPtr form, string path, string newname) { return FromUnixWideCharacters( stfl_lookup(form, ToUnixWideCharacters(path), ToUnixWideCharacters(newname)) ); } [DllImport("stfl", EntryPoint = "stfl_error")] static extern IntPtr stfl_error_native(); internal static string stfl_error() { return FromUnixWideCharacters(stfl_error_native()); } [DllImport("stfl")] static extern void stfl_error_action(IntPtr mode); internal static void stfl_error_action(string mode) { stfl_error_action(ToUnixWideCharacters(mode)); } /* [DllImport("stfl")] internal static extern IntPtr stfl_ipool_create(IntPtr code); [DllImport("stfl")] internal static extern IntPtr stfl_ipool_add(IntPtr pool, IntPtr data); [DllImport("stfl")] internal static extern IntPtr stfl_ipool_towc(IntPtr pool, IntPtr buf); [DllImport("stfl")] internal static extern IntPtr stfl_ipool_fromwc(IntPtr pool, IntPtr buf); [DllImport("stfl")] internal static extern void stfl_ipool_flush(IntPtr pool); [DllImport("stfl")] internal static extern void stfl_ipool_destroy(IntPtr pool); */ } } smuxi-0.11/src/Frontend-STFL/STFL/Makefile.am0000644000175000017500000000045211700531605021315 0ustar00meebeymeebey00000000000000if ENABLE_STATIC_STFL STFL_STATIC_LIB = /usr/lib/libstfl.a LIB_FILE = libstflsharp.so OBJ_FILES = $(wildcard *.o) CLEANFILES = $(LIB_FILE) $(OBJ_FILES) all: $(LIB_FILE) $(LIB_FILE): $(OBJ_FILES) $(AR) -x $(STFL_STATIC_LIB) $(LD) -o $(LIB_FILE) -shared -lncursesw -lpthread $(OBJ_FILES) endif smuxi-0.11/src/Frontend-STFL/STFL/EventReceivedEventArgs.cs0000644000175000017500000000210711700531605024156 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Stfl { public class EventReceivedEventArgs : EventArgs { public string Event { get; set; } public EventReceivedEventArgs(string @event) { Event = @event; } } } smuxi-0.11/src/Frontend-STFL/STFL/Widget.cs0000644000175000017500000001046212253423337021043 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Stfl { public abstract class Widget { public string HeigthVariableName { get; set; } public string WidthVariableName { get; set; } protected Form Form { get; private set; } protected string WidgetName { get; set; } public int Heigth { get { Render(); var variableName = HeigthVariableName; if (variableName == null) { variableName = String.Format("{0}:h", WidgetName); } var value = Form[variableName]; try { return Int32.Parse(value); } catch (FormatException ex) { throw new FormatException( String.Format( "Failed to parse Widget.Heigth: '{0}' as number " + "(HeigthVariableName: '{1}').", value, variableName ), ex ); } } } public int Width { get { Render(); var variableName = WidthVariableName; if (variableName == null) { variableName = String.Format("{0}:w", WidgetName); } var value = Form[variableName]; try { return Int32.Parse(value); } catch (FormatException ex) { throw new FormatException( String.Format( "Failed to parse Widget.Width: '{0}' as number " + "(WidthVariableName: '{1}').", value, variableName ), ex ); } } } public int MinHeigth { get { Render(); return Int32.Parse(Form[String.Format("{0}:minh", WidgetName)]); } } public int MinWidth { get { Render(); return Int32.Parse(Form[String.Format("{0}:minw", WidgetName)]); } } public int XPosition { get { Render(); return Int32.Parse(Form[String.Format("{0}:x", WidgetName)]); } } public int YPosition { get { Render(); return Int32.Parse(Form[String.Format("{0}:y", WidgetName)]); } } protected Widget(Form form, string widgetName) { if (form == null) { throw new ArgumentNullException("form"); } if (widgetName == null) { throw new ArgumentNullException("widgetName"); } Form = form; WidgetName = widgetName; } public void Bind() { CheckWidget(); } protected void Render() { Form.Run(-3); } protected bool WidgetExists() { return String.IsNullOrEmpty(Form.Dump(WidgetName, null, 0)); } protected void CheckWidget() { if (!WidgetExists()) { return; } throw new ArgumentException( String.Format("Widget name: '{0}' is already used.", WidgetName) ); } } } smuxi-0.11/src/Frontend-STFL/STFL/Makefile.in0000644000175000017500000004015712311344230021327 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/Frontend-STFL/STFL DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ @ENABLE_STATIC_STFL_TRUE@STFL_STATIC_LIB = /usr/lib/libstfl.a @ENABLE_STATIC_STFL_TRUE@LIB_FILE = libstflsharp.so @ENABLE_STATIC_STFL_TRUE@OBJ_FILES = $(wildcard *.o) @ENABLE_STATIC_STFL_TRUE@CLEANFILES = $(LIB_FILE) $(OBJ_FILES) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Frontend-STFL/STFL/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Frontend-STFL/STFL/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am @ENABLE_STATIC_STFL_TRUE@all: $(LIB_FILE) @ENABLE_STATIC_STFL_TRUE@$(LIB_FILE): $(OBJ_FILES) @ENABLE_STATIC_STFL_TRUE@ $(AR) -x $(STFL_STATIC_LIB) @ENABLE_STATIC_STFL_TRUE@ $(LD) -o $(LIB_FILE) -shared -lncursesw -lpthread $(OBJ_FILES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Frontend-STFL/Main.cs0000644000175000017500000001316312307053667017742 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007, 2010-2011 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using System.Threading; using SysDiag = System.Diagnostics; using NDesk.Options; using Smuxi.Common; using Smuxi.Engine; using Mono.Unix; using Mono.Unix.Native; namespace Smuxi.Frontend.Stfl { public class MainClass { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public static void Main(string[] args) { #if LOG4NET // initialize log level log4net.Repository.ILoggerRepository repo = log4net.LogManager.GetRepository(); repo.Threshold = log4net.Core.Level.Error; #endif bool debug = false; bool listEngines = false; string engine = "local"; InitLocale(); OptionSet parser = new OptionSet(); parser.Add( "d|debug", _("Enable debug output"), delegate (string value) { debug = true; } ); parser.Add( "e|engine=", _("Engine to connect to"), delegate (string value) { engine = value; } ); parser.Add( "l|list-engines", _("List available engines"), delegate (string value) { listEngines = true; } ); parser.Add( "h|help", _("Show this help"), delegate(string value) { Console.WriteLine(_("Usage: smuxi-frontend-stfl [options]")); Console.WriteLine(); Console.WriteLine(_("Options:")); parser.WriteOptionDescriptions(Console.Out); Environment.Exit(0); } ); parser.Add( "<>", delegate(string value) { throw new OptionException( String.Format( _("Unknown option: '{0}'"), value ), value ); } ); try { parser.Parse(args); #if LOG4NET if (debug) { repo.Threshold = log4net.Core.Level.Debug; } #endif } catch (OptionException ex) { Console.Error.WriteLine(_("Command line error: {0}"), ex.Message); Environment.Exit(1); } if (listEngines) { Console.WriteLine(_("Available Engines:")); var config = new FrontendConfig(Frontend.UIName); config.Load(); foreach (var entry in (string[]) config["Engines/Engines"]) { Console.WriteLine("\t{0}", entry); } return; } if ((Environment.OSVersion.Platform == PlatformID.Unix) || (Environment.OSVersion.Platform == PlatformID.MacOSX)) { // Register shutdown handlers #if LOG4NET _Logger.Info("Registering signal handlers"); #endif UnixSignal[] shutdown_signals = { new UnixSignal(Signum.SIGINT), new UnixSignal(Signum.SIGTERM), }; Thread signal_thread = new Thread(() => { var index = UnixSignal.WaitAny(shutdown_signals); #if LOG4NET _Logger.Info("Caught signal " + shutdown_signals[index].Signum.ToString() + ", shutting down"); #endif Frontend.Quit(); }); signal_thread.Start(); } try { Frontend.Init(engine); } catch (Exception e) { #if LOG4NET _Logger.Fatal(e); #endif if (SysDiag.Debugger.IsAttached) { throw; } } } private static void InitLocale() { string appDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); string localeDir = Path.Combine(appDir, "locale"); if (!Directory.Exists(localeDir)) { localeDir = Path.Combine(Defines.InstallPrefix, "share"); localeDir = Path.Combine(localeDir, "locale"); } LibraryCatalog.Init("smuxi-frontend-stfl", localeDir); #if LOG4NET _Logger.Debug("Using locale data from: " + localeDir); #endif } static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-STFL/MainWindow.cs0000644000175000017500000000700212253423337021120 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007, 2010-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using Mono.Unix; using Smuxi.Common; using Smuxi.Engine; using Stfl; namespace Smuxi.Frontend.Stfl { public class MainWindow : Form { #if LOG4NET static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public StflUI UI { get; private set; } Entry Entry { get; set; } public ChatViewManager ChatViewManager { get; private set; } public string InputLabel { get { return this["input_label_text"]; } set { this["input_label_text"] = String.Format("{0} ", value); } } public string NavigationLabel { get { return this["navigation_label_text"]; } set { this["navigation_label_text"] = value; } } public bool ShowTitle { get { return this["title_hbox_display"] == "1"; } set { this["title_hbox_display"] = value ? "1" : "0"; } } public string TitleLabel { get { return this["title_label_text"]; } set { this["title_label_text"] = value; } } public bool ShowTopic { get { return this["topic_hbox_display"] == "1"; } set { this["topic_hbox_display"] = value ? "1" : "0"; } } public string TopicLabel { get { return this["topic_label_text"]; } set { this["topic_label_text"] = value; } } public MainWindow() : base(null, "MainWindow.stfl") { ChatViewManager = new ChatViewManager(this); Entry = new Entry(this, ChatViewManager); UI = new StflUI(ChatViewManager); Resized += OnResized; if (StflApi.IsXterm) { ShowTitle = false; } Assembly asm = Assembly.GetExecutingAssembly(); ChatViewManager.Load(asm); } void OnResized(object sender, EventArgs e) { #if LOG4NET Logger.DebugFormat( "OnResized(): terminal resized, columns: {0} lines: {1}", this["root_vbox:w"], this["root_vbox:h"] ); #endif } public void ApplyConfig(UserConfig config) { Entry.ApplyConfig(config); } } } smuxi-0.11/src/Frontend-STFL/Entry.cs0000644000175000017500000003011412253423337020145 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007, 2010-2013 Mirco Bauer * Copyright (c) 2011 Andrius Bentkus * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using Mono.Unix; using Stfl; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Stfl { public class Entry { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif MainWindow f_MainWindow; ChatViewManager f_ChatViewManager; CommandManager CommandManager { get; set; } NickCompleter NickCompleter { get; set; } EntrySettings Settings { get; set; } event EventHandler Activated; public string Text { get { return f_MainWindow["input_text"]; } set { f_MainWindow["input_text"] = value; } } public int Position { get { return Int32.Parse(f_MainWindow["input_pos"]); } set { f_MainWindow["input_pos"] = value.ToString(); } } public Entry(MainWindow mainWindow, ChatViewManager chatViewManager) { if (mainWindow == null) { throw new ArgumentNullException("mainWindow"); } if (chatViewManager == null) { throw new ArgumentNullException("chatViewManager"); } f_MainWindow = mainWindow; f_MainWindow.KeyPressed += OnKeyPressed; f_ChatViewManager = chatViewManager; Frontend.SessionPropertyChanged += delegate { InitCommandManager(); }; Settings = new EntrySettings(); NickCompleter = new TabCycleNickCompleter(); } public virtual void ApplyConfig(UserConfig config) { Trace.Call(config); if (config == null) { throw new ArgumentNullException("config"); } Settings.ApplyConfig(config); // replace nick completer if needed if (Settings.BashStyleCompletion && !(NickCompleter is LongestPrefixNickCompleter)) { NickCompleter = new LongestPrefixNickCompleter(); } else if (!Settings.BashStyleCompletion && !(NickCompleter is TabCycleNickCompleter)) { NickCompleter = new TabCycleNickCompleter(); } // set the completion character NickCompleter.CompletionChar = Settings.CompletionCharacter; } void InitCommandManager() { Trace.Call(); if (CommandManager != null) { CommandManager.Dispose(); } if (Frontend.Session == null) { CommandManager = null; } else { CommandManager = new CommandManager(Frontend.Session); } } private void OnKeyPressed(object sender, KeyPressedEventArgs e) { Trace.Call(sender, e); #if LOG4NET _Logger.Debug("_OnKeyPressed(): e.Key: '" + e.Key + "' e.Focus: '" + e.Focus + "'"); #endif switch (e.Key) { case "ENTER": OnActivated(EventArgs.Empty); break; case "PPAGE": if (f_ChatViewManager.ActiveChat != null) { f_ChatViewManager.ActiveChat.ScrollUp(); } break; case "NPAGE": if (f_ChatViewManager.ActiveChat != null) { f_ChatViewManager.ActiveChat.ScrollDown(); } break; case "TAB": CompleteNick(); break; case "kPRV5": // CTRL + PAGE UP case "^P": f_ChatViewManager.CurrentChatNumber--; break; case "kNXT5": // CTRL + PAGE DOWN case "^N": f_ChatViewManager.CurrentChatNumber++; break; case "^W": DeleteUntilSpace(); break; case "kRIT5": JumpWord(false); break; case "kLFT5": JumpWord(true); break; case "^D": DeleteChar(); break; } } public virtual void OnActivated(EventArgs e) { var text = Text; if (String.IsNullOrEmpty(text)) { return; } ExecuteCommand(text); if (Activated != null) { Activated(this, EventArgs.Empty); } Text = String.Empty; } public void ExecuteCommand(string cmd) { if (cmd == null) { throw new ArgumentNullException("cmd"); } ChatModel chat = null; var currentChat = f_ChatViewManager.CurrentChat; if (currentChat != null) { chat = currentChat.ChatModel; } CommandModel cd = new CommandModel( Frontend.FrontendManager, chat, (string) Frontend.UserConfig["Interface/Entry/CommandCharacter"], cmd ); var handled = Command(cd); if (handled) { return; } CommandManager.Execute(cd); } private bool Command(CommandModel cmd) { bool handled = false; if (cmd.IsCommand) { switch (cmd.Command.ToLower()) { case "help": CommandHelp(cmd); break; case "window": CommandWindow(cmd); handled = true; break; case "exit": Frontend.Quit(); handled = true; break; case "gc": #if LOG4NET _Logger.Debug("GC.Collect()"); #endif var msg = new MessageBuilder(). AppendEventPrefix(). AppendText("GCing..."). ToMessage(); cmd.FrontendManager.AddMessageToChat(cmd.Chat, msg); GC.Collect(); handled = true; break; case "generate_messages": CommandGenerateMessages(cmd); handled = true; break; } } return handled; } void CommandHelp(CommandModel cmd) { var chatView = f_MainWindow.ChatViewManager.GetChat(cmd.Chat); var builder = new MessageBuilder(); // TRANSLATOR: this line is used as a label / category for a // list of commands below builder.AppendHeader(_("Frontend Commands")); chatView.AddMessage(builder.ToMessage()); string[] help = { "window (number|close)", "exit", }; foreach (string line in help) { builder = new MessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(line); chatView.AddMessage(builder.ToMessage()); } } private void CommandWindow(CommandModel cmd) { if (cmd.Parameter == "close") { f_ChatViewManager.CurrentChat.Close(); return; } int window; if (!Int32.TryParse(cmd.Parameter, out window)) { return; } ChatView chat = f_ChatViewManager.GetChat(window - 1); if (chat == null) { return; } f_ChatViewManager.CurrentChat = chat; } private void CommandUnknown(CommandModel cmd) { var msg = new MessageBuilder(). AppendEventPrefix(). AppendText(_("Unknown Command: {0}"), cmd.Command). ToMessage(); cmd.FrontendManager.AddMessageToChat(cmd.Chat, msg); } void CommandGenerateMessages(CommandModel cmd) { var chat = f_ChatViewManager.CurrentChat; CommandManager.CommandGenerateMessages(cmd, chat); } // gets the position of the first space left private int GetLeftSpace(int end) { // we are already at the very beginning if (end == 0) { return 0; } int start; // are the first characters spaces? bool firstSpace = true; for (start = end; start > 0; start--) { if (start >= Text.Length) { continue; } else if (Text[start] == ' ') { if (firstSpace) { continue; } else { start++; // don't cut the last char break; } } else { firstSpace = false; } } return start; } private int GetRightSpace(int start) { bool firstSpace = true; int end; for (end = start; end < Text.Length; end++) { if (Text[end] == ' ') { if (firstSpace) { continue; } else { break; } } else { firstSpace = false; } } return end; } private void DeleteUntilSpace() { int end = Position; // nothing to delete, if we are at the very beginning if (end == 0) { return; } int start = GetLeftSpace(end); Text = Text.Substring(0, start) + Text.Substring(end); Position = start; } private void JumpWord(bool left) { if (left) { int pos = GetLeftSpace(Position); if (pos > 0) { pos--; } Position = pos; } else { Position = GetRightSpace(Position); } } private void DeleteChar() { Text = Text.Substring(0, Position) + Text.Substring(Math.Min(Position + 1, Text.Length)); } void CompleteNick() { // perform completion string text = Text; int position = Position; NickCompleter.Complete(ref text, ref position, f_ChatViewManager.CurrentChat); Text = text; Position = position; } static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-STFL/MainWindow.stfl0000644000175000017500000000266112253423337021471 0ustar00meebeymeebey00000000000000vbox[root_vbox] autobind:0 hbox[title_hbox] .display[title_hbox_display]:1 .expand:0 .height:1 @style_normal:fg=white,bg=blue label[title_label] text[title_label_text]:"Smuxi" hbox[topic_hbox] .display[topic_hbox_display]:0 .expand:0 .height:1 @style_normal:fg=white,bg=blue label[topic_label] text[topic_label_text]:"insert topic here" hbox[menu_hbox] .display:0 .expand:0 .height:1 @style_normal:fg=white,bg=blue label text:"Server" label text:"Chat" label text:"Engine" label text:"View" label text:"Help" vbox[output_vbox] vbox[status] .expand:0 .height:1 @style_normal:fg=white,bg=blue label richtext:1 style_clear_normal:fg=white,bg=blue style_event_normal:fg=green,bg=blue style_msg_normal:fg=cyan,bg=blue,attr=bold style_highlight_normal:fg=magenta,bg=blue,attr=bold text[navigation_label_text]:"Navigation" hbox[input_hbox] .expand:0 .height:1 label[input_label] .expand:0 text[input_label_text]:"[Chat] " !input[input] on_TAB:TAB on_^1:CTRL1 on_^2:CTRL2 on_^3:CTRL3 on_^4:CTRL4 on_^5:CTRL5 on_^6:CTRL6 on_^7:CTRL7 on_^8:CTRL8 on_^9:CTRL9 on_^0:CTRL0 on_^@:CTRL2 on_^]:CTRL5 on_^^:CTRL6 on_^_:CTRL7 on_^]:CTRL5 text[input_text]: pos[input_pos]:"0" smuxi-0.11/src/Frontend-STFL/smuxi-frontend-stfl.10000644000175000017500000000563612307053667022547 0ustar00meebeymeebey00000000000000.Dd $Mdocdate: February 23 2014 $ .Dt smuxi-frontend-stfl 1 .Os .Sh NAME .Nm smuxi-frontend-stfl .Nd terminal frontend for Smuxi chat client .Sh SYNOPSIS .Nm smuxi-frontend-stfl .Op Fl dlh .Op Fl e Ar engine .Sh DESCRIPTION .Nm is a terminal frontend for the Smuxi chat client, powered by the STFL library. It can operate standalone or attached to a remote Smuxi engine. .Pp The options are as follows: .Bl -tag -width Ds .It Fl d , Fl \-debug Turn on debugging. Debug logs are sent to .Pa $XDG_DATA_HOME/smuxi/smuxi-frontend-stfl.log , and older logs are moved to the date of usage. .It Fl h , Fl \-help Show the arguments Smuxi takes. .It Fl l , Fl \-list List the available engines Smuxi can connect to. .It Fl e Ar engine , Fl \-engine Ns = Ns Ar engine Connect to a remote engine. .Sh KEY BINDINGS The keyboards are similar to that of irssi and similar clients. Note that some terminal control characters (like C-c, C-z, etc) are not intercepted. Common line editing keys that work in graphical applications will also work. In the following examples, C-x means Control-x. .Pp .Bl -tag -width xxxxxxxxxxxxxxx -offset indent -compact .It Tab complete nickname .It PageUp move up the scrollback .It PageDown move down the scrollback .It C-p , C-PageUp previous window .It C-n , C-PageDown next window .It C-Left jump to the previous word .It C-Right jump to the next word .It C-w delete word .It C-c exit frontend .Sh SMUXI COMMANDS Like most IRC clients, Smuxi uses commands prefixed with "/", and most use the same commands, also including its own set of commands for the client and engine. In the following examples, the "/" prefix is not included. .Bl -tag -width xx -offset -ident .It exit Exit the Smuxi frontend gracefully. .It window close Closes the current window. .It window Ar number Goes to the window with that number. .It connect Ar protocol Ar protocol-parameters Connects to the server with the given protocol. .It connect Ar network Connects to the preset network. .It disconnect Ar server Disconnects from server. If no parameter is passed, then the server associated with the current window will be disconnected. .It config list Lists the configuration options. .It config get Ar key Get the configuration key's value. .It config set Ar key Ns = Ns Ar value Set the configuration key's value. .It shutdown Shuts down the current engine. .Sh FILES .Bl -tag -width -compact .It Pa $XDG_DATA_HOME/smuxi/share/smuxi-frontend-stfl.log smuxi debug log .It Pa $XDG_CONFIG_HOME/smuxi/smuxi-engine.ini smuxi local engine config .It Pa $XDG_CONFIG_HOME/smuxi/smuxi-frontend.ini smuxi frontend configuration and remote engine list .Sh SEE ALSO .Xr smuxi-frontend-gnome 1 , .Xr smuxi-server 1 , .Xr smuxi-message-buffer 1 .Pp Website: http://smuxi.im .Sh AUTHOR/CREDITS Smuxi, including this frontend, was written by Mirco Bauer. Contributions to this frontend were also made by Ondřej Hošek and Andrius Bentkus. .Pp This manpage was written by Calvin Buckley. smuxi-0.11/src/Frontend-STFL/Frontend.cs0000644000175000017500000002244312307053667020636 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007, 2010-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using System.Runtime.InteropServices; using Smuxi.Engine; using Smuxi.Common; using Stfl; namespace Smuxi.Frontend.Stfl { public class Frontend { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string _Name = "smuxi"; private static readonly string _UIName = "STFL"; private static Version _Version; private static string _VersionString; private static Version _EngineVersion; private static MainWindow _MainWindow; private static FrontendConfig _FrontendConfig; private static Session _LocalSession; private static Session _Session; private static UserConfig _UserConfig; private static FrontendManager _FrontendManager; public static event EventHandler SessionPropertyChanged; public static string Name { get { return _Name; } } public static string UIName { get { return _UIName; } } public static Version Version { get { return _Version; } } public static Version EngineVersion { get { return _EngineVersion; } set { _EngineVersion = value; } } public static string VersionString { get { return _VersionString; } } public static MainWindow MainWindow { get { return _MainWindow; } } public static Session Session { get { return _Session; } set { _Session = value; if (SessionPropertyChanged != null) { SessionPropertyChanged(value, EventArgs.Empty); } } } public static bool IsLocalEngine { get { return _LocalSession != null && _Session == _LocalSession; } } public static FrontendManager FrontendManager { get { return _FrontendManager; } } public static Config Config { get { return _Session.Config; } } public static UserConfig UserConfig { get { return _UserConfig; } set { _UserConfig = value; } } public static FrontendConfig FrontendConfig { get { return _FrontendConfig; } } public static void Init(string engine) { System.Threading.Thread.CurrentThread.Name = "Main"; Trace.Call(engine); Assembly asm = Assembly.GetAssembly(typeof(Frontend)); AssemblyName asm_name = asm.GetName(false); AssemblyProductAttribute pr = (AssemblyProductAttribute)asm. GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]; _Version = asm_name.Version; _VersionString = pr.Product + " - " + _UIName + " frontend " + _Version; // this always calls abort() :((( //StflApi.stfl_error_action("print"); #if LOG4NET _Logger.Info(_VersionString + " starting"); #endif _MainWindow = new MainWindow(); _FrontendConfig = new FrontendConfig(UIName); // loading and setting defaults _FrontendConfig.Load(); _FrontendConfig.Save(); if (_FrontendConfig.IsCleanConfig) { // first start assistant } else { if (String.IsNullOrEmpty(engine) || engine == "local") { InitLocalEngine(); } else { InitRemoteEngine(engine); } } while (true) { // wait maximum for 500ms, to force a refresh even when // not hitting a key _MainWindow.Run(500); } } public static void InitLocalEngine() { Engine.Engine.Init(); _EngineVersion = Engine.Engine.Version; _LocalSession = new Engine.Session(Engine.Engine.Config, Engine.Engine.ProtocolManagerFactory, "local"); Session = _LocalSession; Session.RegisterFrontendUI(_MainWindow.UI); _UserConfig = Session.UserConfig; ConnectEngineToGUI(); } public static void InitRemoteEngine(string engine) { var manager = new EngineManager(_FrontendConfig, _MainWindow.UI); try { try { Console.WriteLine( _("Connecting to remote engine '{0}'..."), engine ); manager.Connect(engine); Console.WriteLine(_("Connection established")); } catch (Exception ex) { #if LOG4NET _Logger.Error(ex); #endif Console.WriteLine( _("Connection failed! Error: {1}"), engine, ex.Message ); Environment.Exit(1); } Session = manager.Session; _UserConfig = manager.UserConfig; _EngineVersion = manager.EngineVersion; ConnectEngineToGUI(); } catch (Exception ex) { #if LOG4NET _Logger.Error(ex); #endif manager.Disconnect(); throw; } } public static void ConnectEngineToGUI() { _FrontendManager = _Session.GetFrontendManager(_MainWindow.UI); _FrontendManager.Sync(); if (_UserConfig.IsCaching) { // when our UserConfig is cached, we need to invalidate the cache _FrontendManager.ConfigChangedDelegate = new SimpleDelegate(_UserConfig.ClearCache); } // make sure entry got attention :-P // BUG: MonoCurses //_MainWindow.Entry.HasFocus = true; } public static void DisconnectEngineFromGUI() { _FrontendManager.IsFrontendDisconnecting = true; //_Session.DeregisterFrontendUI(_MainWindow.UI); //_MainWindow.Hide(); //_MainWindow.Notebook.RemoveAllPages(); _FrontendManager = null; _Session = null; } public static void ApplyConfig(UserConfig userConfig) { Trace.Call(userConfig); if (userConfig == null) { throw new ArgumentNullException("userConfig"); } _MainWindow.ApplyConfig(userConfig); } public static void Quit() { if (_FrontendManager != null) { _FrontendManager.IsFrontendDisconnecting = true; if (IsLocalEngine) { try { // we don't shutdown the remote session Session.Shutdown(); } catch (Exception ex) { #if LOG4NET _Logger.Error("Quit(): Exception", ex); #endif } } } /* BUG: don't do this, the access to config is lost and the entry will throw an exception then. if (_FrontendManager != null) { DisconnectEngineFromGUI(); } */ MainWindow.Reset(); Environment.Exit(0); } public static void ShowException(Exception ex) { //Application.Error("Error occurred!", ex.ToString()); } static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-STFL/Views/0000755000175000017500000000000012311344241017602 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-STFL/Views/PersonChatView.cs0000644000175000017500000000261112250426634023043 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Stfl { [ChatViewInfo(ChatType = ChatType.Person)] public class PersonChatView : ChatView { public PersonChatView(ChatModel chat, MainWindow window) : base(chat, window) { Trace.Call(chat, window); } public override void Sync() { base.Sync(); var personChat = (PersonChatModel) ChatModel; Participants.Add(personChat.Person); } } } smuxi-0.11/src/Frontend-STFL/Views/GroupChatView.cs0000644000175000017500000000441112253423337022671 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Linq; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Stfl { [ChatViewInfo(ChatType = ChatType.Group)] public class GroupChatView : ChatView { public MessageModel Topic { get; set; } public GroupChatView(ChatModel chat, MainWindow window) : base(chat, window) { Trace.Call(chat, window); } public override void AddMessage(MessageModel msg) { base.AddMessage(msg); var nick = msg.GetNick(); if (nick == null) { return; } // update who spoke last for (int i = 0; i < Participants.Count; ++i) { var speaker = Participants[i]; if (speaker.IdentityName == nick) { Participants.RemoveAt(i); Participants.Insert(0, speaker); break; } } } public override void Sync() { base.Sync(); var groupChat = (GroupChatModel) ChatModel; Topic = groupChat.Topic; var persons = groupChat.Persons; if (persons != null) { Participants.Clear(); foreach (var person in persons.Values.OrderBy(x => x)) { Participants.Add(person); } } } } } smuxi-0.11/src/Frontend-STFL/Views/ChatView.cs0000644000175000017500000002761012253423337021662 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007, 2010-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Text; using System.Threading; using System.Collections.Generic; using System.Globalization; using Smuxi.Common; using Smuxi.Engine; using Smuxi.Frontend; using Stfl; namespace Smuxi.Frontend.Stfl { [ChatViewInfo(ChatType = ChatType.Session)] [ChatViewInfo(ChatType = ChatType.Protocol)] public class ChatView : IChatView, IDisposable { #if LOG4NET static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif // HACK: STFL crashes if we use 0 in a widget name static int f_NextID = 1; int f_WidgetID; string f_WidgetName; public ChatModel ChatModel { get; private set; } MainWindow f_MainWindow; TextView MessageTextView { get; set; } IProtocolManager ProtocolManager { get; set; } bool HasEvent { get; set; } bool HasMessage { get; set; } bool HasHighlight { get; set; } public string Name { get; private set; } public IList Participants { get; private set; } public string ID { get { return ChatModel.ID; } } public int Position { get { return ChatModel.Position; } } public bool IsVisible { get { return f_MainWindow[f_WidgetID + "d"] == "1"; } set { if (value) { HasEvent = false; HasMessage = false; HasHighlight = false; } f_MainWindow[f_WidgetID + "d"] = value ? "1" : "0"; } } public string WidgetName { get { return f_WidgetName; } } public string Label { get { string style; if (HasHighlight) { style = "highlight"; } else if (HasMessage) { style = "msg"; } else if (HasEvent) { style = "event"; } else { style = "clear"; } return String.Format("<{0}>{1}", style, Name); } } public ChatView(ChatModel chat, MainWindow window) { Trace.Call(chat, window); if (chat == null) { throw new ArgumentNullException("chat"); } if (window == null) { throw new ArgumentNullException("window"); } ChatModel = chat; f_MainWindow = window; f_WidgetID = f_NextID++; f_WidgetName = "output_textview_" + f_WidgetID; f_MainWindow.Modify("output_vbox", "append", "{" + "textview[" + f_WidgetName + "] " + ".expand:vh " + ".display[" + f_WidgetID + "d]:0 " + "offset[" + f_WidgetID + "os]:0 " + "richtext:1 " + "style_color0_normal:fg=black " + "style_color1_normal:fg=red " + "style_color2_normal:fg=green " + "style_color3_normal:fg=yellow " + "style_color4_normal:fg=blue " + "style_color5_normal:fg=magenta " + "style_color6_normal:fg=cyan " + "style_color7_normal:fg=white " + "style_color8_normal:fg=black,attr=bold " + "style_color9_normal:fg=red,attr=bold " + "style_color10_normal:fg=green,attr=bold " + "style_color11_normal:fg=yellow,attr=bold " + "style_color12_normal:fg=blue,attr=bold " + "style_color13_normal:fg=magenta,attr=bold " + "style_color14_normal:fg=cyan,attr=bold " + "style_color15_normal:fg=white,attr=bold " + "style_url_normal:attr=underline " + "style_u_normal:attr=underline " + "style_b_normal:attr=bold " + "style_i_normal:attr=standout " + "}" ); MessageTextView = new TextView(f_MainWindow, f_WidgetName); MessageTextView.OffsetVariableName = f_WidgetID + "os"; // HACK: as the chat is not always visible we can't extract the // heigth and width information from the textview because it simply // returns 0 when invisible, thus we need to abuse output_vbox MessageTextView.HeigthVariableName = "output_vbox:h"; MessageTextView.WidthVariableName = "output_vbox:w"; MessageTextView.AutoLineWrap = true; Participants = new List(); } ~ChatView() { Dispose(false); } protected virtual void Dispose(bool disposing) { Trace.Call(disposing); // do not make STFL calls from the finalizer thread! if (disposing) { f_MainWindow.Modify(f_WidgetName, "delete", null); } } public virtual void Dispose() { Dispose(true); GC.SuppressFinalize(this); } public virtual void Close() { Trace.Call(); var protocolManager = ProtocolManager; if (protocolManager == null) { #if LOG4NET _Logger.WarnFormat( "{0}.Close(): ProtocolManager is null, bailing out!", this ); #endif return; } ThreadPool.QueueUserWorkItem(delegate { try { protocolManager.CloseChat( Frontend.FrontendManager, ChatModel ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } public virtual void Enable() { Trace.Call(); } public virtual void Disable() { Trace.Call(); } public virtual void Sync() { ProtocolManager = ChatModel.ProtocolManager; Name = ChatModel.Name; #if LOG4NET _Logger.Debug("Sync() syncing messages"); #endif // sync messages // cleanup, be sure the output is empty f_MainWindow.Modify("output_textview", "replace_inner", ""); var messages = ChatModel.Messages; if (messages.Count > 0) { foreach (MessageModel msg in messages) { AddMessage(msg); } } } public virtual void Populate() { } public virtual void AddMessage(MessageModel msg) { // OPT: typical message length var line = new StringBuilder(512); int msgLength = 0; switch (msg.MessageType) { case MessageType.Normal: HasMessage = true; break; case MessageType.Event: HasEvent = true; break; } bool hasHighlight = false; foreach (MessagePartModel msgPart in msg.MessageParts) { if (msgPart.IsHighlight) { HasHighlight = true; } // TODO: implement other types if (msgPart is UrlMessagePartModel) { var urlPart = (UrlMessagePartModel) msgPart; var escapedUrl = StflApi.EscapeRichText(urlPart.Url); line.Append(String.Format("{0}", escapedUrl)); msgLength += urlPart.Url.Length; } else if (msgPart is TextMessagePartModel) { var txtPart = (TextMessagePartModel) msgPart; if (String.IsNullOrEmpty(txtPart.Text)) { continue; } var tags = new List(); if (txtPart.ForegroundColor != TextColor.None) { var palette = TextColorPalettes.LinuxConsole; var color = TextColorTools.GetNearestColor( txtPart.ForegroundColor, palette ); var colorNumber = palette.IndexOf(color); tags.Add(String.Format("color{0}", colorNumber)); } // HACK: STFL doesn't support applying multiple styles at // the same time and thus simply overwrites any previous // style. As a workaround we only apply one style with the // highest priority in this order: // color >> underline >> bold >> italic if (txtPart.Underline && tags.Count == 0) { tags.Add("u"); } if (txtPart.Bold && tags.Count == 0) { tags.Add("b"); } if (txtPart.Italic && tags.Count == 0) { tags.Add("i"); } string escapedText = StflApi.EscapeRichText(txtPart.Text); if (tags.Count > 0) { tags.Reverse(); string markup = escapedText; foreach (string tag in tags) { markup = String.Format("<{0}>{1}", tag, markup, tag); } line.Append(markup); } else { line.Append(escapedText); } msgLength += txtPart.Text.Length; } } string timestamp; try { timestamp = msg.TimeStamp.ToLocalTime().ToString((string)Frontend.UserConfig["Interface/Notebook/TimestampFormat"]); } catch (FormatException e) { timestamp = "Timestamp Format ERROR: " + e.Message; } var finalMsg = String.Format("{0} {1}", timestamp, line.ToString()); MessageTextView.AppendLine(finalMsg); ScrollToEnd(); } public void ScrollUp() { Trace.Call(); MessageTextView.ScrollUp(); } public void ScrollDown() { Trace.Call(); MessageTextView.ScrollDown(); } public void ScrollToStart() { Trace.Call(); MessageTextView.ScrollToStart(); } public void ScrollToEnd() { Trace.Call(); MessageTextView.ScrollToEnd(); } } } smuxi-0.11/src/Frontend-STFL/ChangeLog0000644000175000017500000000214511655545675020311 0ustar00meebeymeebey000000000000002008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-12-22 Mirco Bauer 2008-08-21 Mirco Bauer * MainWindow.cs, Frontend.cs, Entry.cs, ChatViewManager.cs, ChatView.cs: Fixed whitespace (replaced \t with 4 spaces). 2008-07-27 Mirco Bauer * AssemblyInfo.cs, Frontend-STFL.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-07-07 Mirco Bauer * Frontend.cs: FIxed indention. 2008-06-02 Mirco Bauer 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 2008-01-31 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * MainWindow.cs, Frontend.cs, MainWindow.stfl, Entry.cs, ChatViewManager.cs, ChatView.cs: Minor fixes * Frontend-STFL.mdp: Updated using MonoDevelop 0.18.1 smuxi-0.11/src/Frontend-STFL/Makefile.am0000644000175000017500000000676212257043746020573 0ustar00meebeymeebey00000000000000SUBDIRS = STFL EXTRA_DIST = $(man_MANS) man_MANS = smuxi-frontend-stfl.1 ASSEMBLY_CONFIG_SOURCE = smuxi-frontend-stfl.exe.config ASSEMBLY_CONFIG = $(BUILD_DIR)/smuxi-frontend-stfl.exe.config ASSEMBLY = $(BUILD_DIR)/smuxi-frontend-stfl.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = exe PROJECT_REFERENCES = \ ../../bin/debug/smuxi-engine.dll \ ../../bin/debug/smuxi-frontend.dll \ ../../bin/debug/smuxi-common.dll BUILD_DIR = ../../bin/debug LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/debug/smuxi-engine.dll STFL_DLL_SOURCE=../../lib/Stfl.dll SMUXI_FRONTEND_DLL_MDB_SOURCE=../../bin/debug/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_MDB=$(BUILD_DIR)/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_SOURCE=../../bin/debug/smuxi-frontend.dll SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll AL=al2 SATELLITE_ASSEMBLY_NAME=.resources.dll PROGRAMFILES = \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_FRONTEND_DLL_MDB) \ $(SMUXI_FRONTEND_DLL) \ $(SMUXI_COMMON_DLL) \ $(ASSEMBLY_CONFIG) BINARIES = \ $(FRONTEND_STFL) all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) FILES = \ Main.cs \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Frontend.cs \ MainWindow.cs \ StflUI.cs \ Entry.cs \ STFL/Form.cs \ STFL/EventReceivedEventArgs.cs \ STFL/KeyPressedEventArgs.cs \ STFL/NcursesApi.cs \ STFL/StflApi.cs \ STFL/TextView.cs \ STFL/Widget.cs \ Views/ChatView.cs \ Views/GroupChatView.cs \ Views/PersonChatView.cs \ ChatViewManager.cs DATA_FILES = RESOURCES = \ MainWindow.stfl EXTRAS = \ smuxi-frontend-stfl.in \ $(ASSEMBLY_CONFIG_SOURCE) REFERENCES = \ System \ System.Core \ Mono.Posix \ $(LOG4NET_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) include $(top_srcdir)/Makefile.include FRONTEND_STFL = $(BUILD_DIR)/smuxi-frontend-stfl LOG4NET_DLL = $(BUILD_DIR)/log4net.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll STFL_DLL = $(BUILD_DIR)/Stfl.dll SMUXI_FRONTEND_DLL = $(BUILD_DIR)/smuxi-frontend.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll LOG4NET_CONFIG = $(BUILD_DIR)/smuxi-frontend-stfl.exe.config LOG4NET_CONFIG_SOURCE = smuxi-frontend-stfl.exe.config build_datafiles = $(LOG4NET_CONFIG) if ENABLE_STATIC_STFL STFLSHARP_SO_SOURCE = $(builddir)/STFL/libstflsharp.so STFLSHARP_SO = $(BUILD_DIR)/libstflsharp.so build_datafiles += $(STFLSHARP_SO) endif $(eval $(call emit-deploy-wrapper,FRONTEND_STFL,smuxi-frontend-stfl,x)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(eval $(call emit-deploy-target,LOG4NET_CONFIG)) $(eval $(call emit-deploy-target,ASSEMBLY_CONFIG)) if ENABLE_STATIC_STFL $(eval $(call emit-deploy-target,STFLSHARP_SO)) endif $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(CSC) $(CSC_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) smuxi-0.11/src/Frontend-STFL/ChatViewManager.cs0000644000175000017500000001651112253423337022056 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007, 2010-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Text; using System.Globalization; using System.Collections.Generic; using Mono.Unix; using Stfl; using Smuxi.Common; using Smuxi.Engine; using Smuxi.Frontend; namespace Smuxi.Frontend.Stfl { public class ChatViewManager : ChatViewManagerBase { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private MainWindow f_MainWindow; private ChatView f_CurrentChat; private Dictionary f_ChatViews = new Dictionary(); private List f_ChatViewList = new List(); public event ChatSwitchedEventHandler CurrentChatSwitched; public override IChatView ActiveChat { get { return CurrentChat; } } public ChatView CurrentChat { get { return f_CurrentChat; } set { if (f_CurrentChat != null) { f_CurrentChat.IsVisible = false; } f_CurrentChat = value; if (f_CurrentChat != null) { #if LOG4NET _Logger.Debug("set_CurrentChat(): making " + value.ChatModel.ID + " visible"); #endif f_CurrentChat.IsVisible = true; UpdateNavigation(); UpdateInput(); UpdateTitle(); UpdateTopic(); } if (CurrentChatSwitched != null) { CurrentChatSwitched(this, new ChatSwitchedEventArgs(f_CurrentChat)); } } } public int CurrentChatNumber { get { if (CurrentChat == null) { return -1; } return f_ChatViewList.IndexOf(CurrentChat); } set { if (value < 0 || value >= f_ChatViewList.Count) { return; } CurrentChat = f_ChatViewList[value]; } } public ChatViewManager(MainWindow mainWindow) { if (mainWindow == null) { throw new ArgumentNullException("mainWindow"); } f_MainWindow = mainWindow; } public override void AddChat(ChatModel chat) { ChatView chatView = (ChatView) CreateChatView(chat, f_MainWindow); f_ChatViews.Add(chat, chatView); f_ChatViewList.Add(chatView); if (CurrentChat == null) { CurrentChat = chatView; } UpdateNavigation(); } public override void RemoveChat(ChatModel chat) { var chatView = GetChat(chat); chatView.IsVisible = false; if (CurrentChat == chatView) { CurrentChatNumber--; } chatView.Dispose(); f_ChatViews.Remove(chat); f_ChatViewList.Remove(chatView); UpdateNavigation(); } public override void EnableChat(ChatModel chat) { ChatView chatView = f_ChatViews[chat]; chatView.Enable(); } public override void DisableChat(ChatModel chat) { ChatView chatView = f_ChatViews[chat]; chatView.Disable(); } public ChatView GetChat(ChatModel chat) { return f_ChatViews[chat]; } public ChatView GetChat(int chat) { if (chat < 0 || chat >= f_ChatViewList.Count) { return null; } return f_ChatViewList[chat]; } public void UpdateNavigation() { var nav = new StringBuilder(); foreach (var chat in f_ChatViewList) { nav.AppendFormat("[{0}] ", chat == CurrentChat ? chat.Name : chat.Label); } if (nav.Length > 0) { nav.Length--; } f_MainWindow.NavigationLabel = nav.ToString(); } public void UpdateInput() { var chatView = CurrentChat; if (chatView == null) { return; } f_MainWindow.InputLabel = String.Format("[{0}]", chatView.Name); } void UpdateTitle() { var chatView = CurrentChat; if (chatView == null) { return; } string title; var chatModel = chatView.ChatModel; string protocolStatus = null; if (chatModel.ProtocolManager != null) { protocolStatus = chatModel.ProtocolManager.ToString(); } if (chatModel is SessionChatModel) { title = String.Empty; } else if (chatModel is ProtocolChatModel) { title = protocolStatus; } else { title = String.Format("{0} @ {1}", chatModel.Name, protocolStatus); } if (!String.IsNullOrEmpty(title)) { title += " - "; } title += "Smuxi"; f_MainWindow.TitleLabel = title; // HACK: set xterm window title if (StflApi.IsXterm) { NcursesApi.endwin(); Console.WriteLine((char) 27 + "]0;{0}" + (char) 7, title); NcursesApi.refresh(); } } public void UpdateTopic() { string topic = String.Empty; var chatView = CurrentChat; if (chatView is GroupChatView) { var topicModel = ((GroupChatView) chatView).Topic; if (topicModel != null) { topic = topicModel.ToString(); } } f_MainWindow.TopicLabel = topic; f_MainWindow.ShowTopic = !String.IsNullOrEmpty(topic); } } public delegate void ChatSwitchedEventHandler(object sender, ChatSwitchedEventArgs e); public class ChatSwitchedEventArgs : EventArgs { public ChatView ChatView { get; set; } public ChatSwitchedEventArgs(ChatView chatView) { ChatView = chatView; } } } smuxi-0.11/src/Frontend-STFL/AssemblyInfo.cs0000644000175000017500000000241512253423337021442 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Smuxi - STFL frontend")] [assembly: AssemblyCopyright("2007-2013 (C) Mirco Bauer , 2011 (C) Andrius Bentkus ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] #if LOG4NET // let log4net use .exe.config file [assembly: log4net.Config.XmlConfigurator] #endif smuxi-0.11/src/Frontend-STFL/smuxi-frontend-stfl.in0000644000175000017500000000013012253423337022770 0ustar00meebeymeebey00000000000000#!/bin/sh exec mono --debug "@expanded_libdir@/@PACKAGE@/smuxi-frontend-stfl.exe" "$@" smuxi-0.11/src/Frontend-STFL/StflUI.cs0000644000175000017500000001724612253423337020225 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007, 2011, 2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend.Stfl { public class StflUI : PermanentRemoteObject, IFrontendUI { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private int _Version = 0; private ChatViewManager _ChatViewManager; public int Version { get { return _Version; } } public StflUI(ChatViewManager chatViewManager) { _ChatViewManager = chatViewManager; } public void AddChat(ChatModel chat) { Trace.Call(chat); try { _ChatViewManager.AddChat(chat); } catch (Exception ex) { #if LOG4NET _Logger.Fatal(ex); #endif } } public void AddMessageToChat(ChatModel chat, MessageModel msg) { Trace.Call(chat, msg); try { ChatView chatView = _ChatViewManager.GetChat(chat); if (chatView == null) { #if LOG4NET _Logger.Fatal(String.Format("AddMessageToChat(): _ChatViewManager.GetChat(chat) chat.Name: {0} returned null!", chat.Name)); #endif return; } // FIXME: this must be marshalled into the UI thread! chatView.AddMessage(msg); _ChatViewManager.UpdateNavigation(); } catch (Exception ex) { #if LOG4NET _Logger.Fatal(ex); #endif } } public void RemoveChat(ChatModel chat) { Trace.Call(chat); try { _ChatViewManager.RemoveChat(chat); } catch (Exception ex) { #if LOG4NET _Logger.Fatal(ex); #endif } } public void EnableChat(ChatModel chat) { Trace.Call(chat); try { _ChatViewManager.EnableChat(chat); } catch (Exception ex) { #if LOG4NET _Logger.Fatal(ex); #endif } } public void DisableChat(ChatModel chat) { Trace.Call(chat); try { _ChatViewManager.DisableChat(chat); } catch (Exception ex) { #if LOG4NET _Logger.Fatal(ex); #endif } } public void SyncChat(ChatModel chat) { Trace.Call(chat); try { var chatView = _ChatViewManager.GetChat(chat); if (chatView == null) { #if LOG4NET _Logger.Fatal(String.Format("SyncChat(): _ChatViewManager.GetChat(chat) chat.Name: {0} returned null!", chat.Name)); #endif return; } chatView.Sync(); if (_ChatViewManager.CurrentChat == chatView) { _ChatViewManager.UpdateInput(); } Frontend.FrontendManager.AddSyncedChat(chat); } catch (Exception ex) { #if LOG4NET _Logger.Fatal(ex); #endif } } public void AddPersonToGroupChat(GroupChatModel groupChat, PersonModel person) { Trace.Call(groupChat, person); try { var chatView = _ChatViewManager.GetChat(groupChat); if (chatView == null) { #if LOG4NET _Logger.Fatal(String.Format("AddPersonToGroupChat(): _ChatViewManager.GetChat(chat) chat.Name: {0} returned null!", groupChat.Name)); #endif return; } lock (chatView.Participants) { chatView.Participants.Add(person); } } catch (Exception ex) { #if LOG4NET _Logger.Fatal(ex); #endif } } public void UpdatePersonInGroupChat(GroupChatModel groupChat, PersonModel oldPerson, PersonModel newPerson) { Trace.Call(groupChat, oldPerson, newPerson); try { var chatView = _ChatViewManager.GetChat(groupChat); if (chatView == null) { #if LOG4NET _Logger.Fatal(String.Format("UpdatePersonInGroupChat(): _ChatViewManager.GetChat(groupChat) groupChat.Name: {0} returned null!", groupChat.Name)); #endif return; } lock (chatView.Participants) { chatView.Participants.Remove(oldPerson); chatView.Participants.Add(newPerson); } } catch (Exception ex) { #if LOG4NET _Logger.Fatal(ex); #endif } } public void UpdateTopicInGroupChat(GroupChatModel groupChat, MessageModel topic) { Trace.Call(groupChat, topic); try { var chatView = _ChatViewManager.GetChat(groupChat); if (chatView == null) { #if LOG4NET _Logger.Fatal(String.Format("UpdateTopicInGroupChat(): _ChatViewManager.GetChat(groupChat) groupChat.Name: {0} returned null!", groupChat.Name)); #endif return; } if (!(chatView is GroupChatView)) { #if LOG4NET _Logger.Fatal(String.Format("UpdateTopicInGroupChat(): _ChatViewManager.GetChat(groupChat) groupChat.Name: {0} returned something that isn't a group chat view!", groupChat.Name)); #endif return; } var groupChatView = (GroupChatView) chatView; groupChatView.Topic = topic; _ChatViewManager.UpdateTopic(); } catch (Exception ex) { #if LOG4NET _Logger.Fatal(ex); #endif } } public void RemovePersonFromGroupChat(GroupChatModel groupChat, PersonModel person) { Trace.Call(groupChat, person); try { var chatView = _ChatViewManager.GetChat(groupChat); if (chatView == null) { #if LOG4NET _Logger.Fatal(String.Format("RemovePersonFromGroupChat(): _ChatViewManager.GetChat(groupChat) groupChat.Name: {0} returned null!", groupChat.Name)); #endif return; } lock (chatView.Participants) { chatView.Participants.Remove(person); } } catch (Exception ex) { #if LOG4NET _Logger.Fatal(ex); #endif } } public void SetNetworkStatus(string status) { Trace.Call(status); } public void SetStatus(string status) { Trace.Call(status); } } } smuxi-0.11/src/Frontend-STFL/Makefile.in0000644000175000017500000012250112311344230020551 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/smuxi-frontend-stfl.in \ ChangeLog @ENABLE_STATIC_STFL_TRUE@am__append_1 = $(STFLSHARP_SO) subdir = src/Frontend-STFL ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = smuxi-frontend-stfl CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) $(programfilesicons_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ SUBDIRS = STFL EXTRA_DIST = $(man_MANS) $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) man_MANS = smuxi-frontend-stfl.1 ASSEMBLY_CONFIG_SOURCE = smuxi-frontend-stfl.exe.config ASSEMBLY_CONFIG = $(BUILD_DIR)/smuxi-frontend-stfl.exe.config ASSEMBLY = $(BUILD_DIR)/smuxi-frontend-stfl.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = exe PROJECT_REFERENCES = \ ../../bin/debug/smuxi-engine.dll \ ../../bin/debug/smuxi-frontend.dll \ ../../bin/debug/smuxi-common.dll BUILD_DIR = ../../bin/debug LOG4NET_DLL_SOURCE = ../../lib/log4net.dll SMUXI_ENGINE_DLL_MDB_SOURCE = ../../bin/debug/smuxi-engine.dll.mdb SMUXI_ENGINE_DLL_MDB = $(BUILD_DIR)/smuxi-engine.dll.mdb NINI_DLL_SOURCE = ../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE = ../../bin/debug/smuxi-engine.dll STFL_DLL_SOURCE = ../../lib/Stfl.dll SMUXI_FRONTEND_DLL_MDB_SOURCE = ../../bin/debug/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_MDB = $(BUILD_DIR)/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_SOURCE = ../../bin/debug/smuxi-frontend.dll SMUXI_COMMON_DLL_SOURCE = ../../bin/debug/smuxi-common.dll AL = al2 SATELLITE_ASSEMBLY_NAME = .resources.dll PROGRAMFILES = \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_FRONTEND_DLL_MDB) \ $(SMUXI_FRONTEND_DLL) \ $(SMUXI_COMMON_DLL) \ $(ASSEMBLY_CONFIG) BINARIES = \ $(FRONTEND_STFL) FILES = \ Main.cs \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Frontend.cs \ MainWindow.cs \ StflUI.cs \ Entry.cs \ STFL/Form.cs \ STFL/EventReceivedEventArgs.cs \ STFL/KeyPressedEventArgs.cs \ STFL/NcursesApi.cs \ STFL/StflApi.cs \ STFL/TextView.cs \ STFL/Widget.cs \ Views/ChatView.cs \ Views/GroupChatView.cs \ Views/PersonChatView.cs \ ChatViewManager.cs DATA_FILES = RESOURCES = \ MainWindow.stfl EXTRAS = \ smuxi-frontend-stfl.in \ $(ASSEMBLY_CONFIG_SOURCE) REFERENCES = \ System \ System.Core \ Mono.Posix \ $(LOG4NET_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) $(ASSEMBLY) $(ASSEMBLY).mdb \ $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) FRONTEND_STFL = $(BUILD_DIR)/smuxi-frontend-stfl LOG4NET_DLL = $(BUILD_DIR)/log4net.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll STFL_DLL = $(BUILD_DIR)/Stfl.dll SMUXI_FRONTEND_DLL = $(BUILD_DIR)/smuxi-frontend.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll LOG4NET_CONFIG = $(BUILD_DIR)/smuxi-frontend-stfl.exe.config LOG4NET_CONFIG_SOURCE = smuxi-frontend-stfl.exe.config build_datafiles = $(LOG4NET_CONFIG) $(am__append_1) @ENABLE_STATIC_STFL_TRUE@STFLSHARP_SO_SOURCE = $(builddir)/STFL/libstflsharp.so @ENABLE_STATIC_STFL_TRUE@STFLSHARP_SO = $(BUILD_DIR)/libstflsharp.so all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Frontend-STFL/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Frontend-STFL/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): smuxi-frontend-stfl: $(top_builddir)/config.status $(srcdir)/smuxi-frontend-stfl.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-man \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA uninstall-man: uninstall-man1 .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-man1 \ install-pdf install-pdf-am install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-man uninstall-man1 \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(eval $(call emit-deploy-wrapper,FRONTEND_STFL,smuxi-frontend-stfl,x)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(eval $(call emit-deploy-target,LOG4NET_CONFIG)) $(eval $(call emit-deploy-target,ASSEMBLY_CONFIG)) @ENABLE_STATIC_STFL_TRUE@$(eval $(call emit-deploy-target,STFLSHARP_SO)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(CSC) $(CSC_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Frontend-GNOME-Twitter/0000755000175000017500000000000012311344241020242 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-GNOME-Twitter/TwitterGroupChatView.cs0000644000175000017500000001512112257043746024722 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Andrés G. Aragoneses // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Threading; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { [ChatViewInfo(ChatType = ChatType.Group, ProtocolManagerType = typeof(TwitterProtocolManager))] public class TwitterGroupChatView : GroupChatView { static readonly string LibraryTextDomain = "smuxi-frontend-gnome-twitter"; TwitterProtocolManager TwitterProtocolManager { get; set; } public TwitterGroupChatView(GroupChatModel groupChat) : base(groupChat) { Trace.Call(groupChat); } protected override void OnPersonMenuShown(object sender, EventArgs e) { Trace.Call(sender, e); foreach (var child in PersonMenu.Children) { PersonMenu.Remove(child); } base.OnPersonMenuShown(sender, e); Gtk.MenuItem item; if (Frontend.EngineVersion >= new Version(0, 7)) { item = new Gtk.ImageMenuItem(_("Direct Message")); item.Activated += OnUserListMenuDirectMessageActivated; PersonMenu.Append(item); PersonMenu.Append(new Gtk.SeparatorMenuItem()); } if (Frontend.EngineVersion >= new Version(0, 10)) { item = new Gtk.ImageMenuItem(_("Timeline")); item.Activated += OnUserListMenuTimelineActivated; PersonMenu.Append(item); if (ID == TwitterChatType.FriendsTimeline.ToString()) { item = new Gtk.ImageMenuItem(_("Unfollow")); item.Activated += OnUserListMenuUnfollowActivated; PersonMenu.Append(item); } else { item = new Gtk.ImageMenuItem(_("Follow")); item.Activated += OnUserListMenuFollowActivated; PersonMenu.Append(item); } } PersonMenu.ShowAll(); } void OnUserListMenuUnfollowActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } foreach (var person in persons) { var per = person; ThreadPool.QueueUserWorkItem(delegate { try { TwitterProtocolManager.CommandUnfollow( new CommandModel( Frontend.FrontendManager, ChatModel, per.ID ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void OnUserListMenuFollowActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } foreach (var person in persons) { var per = person; ThreadPool.QueueUserWorkItem(delegate { try { TwitterProtocolManager.CommandFollow( new CommandModel( Frontend.FrontendManager, ChatModel, per.ID ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void OnUserListMenuDirectMessageActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } foreach (var person in persons) { var per = person; ThreadPool.QueueUserWorkItem(delegate { try { TwitterProtocolManager.CommandMessage( new CommandModel( Frontend.FrontendManager, ChatModel, per.IdentityName ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void OnUserListMenuTimelineActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } foreach (var person in persons) { var per = person; ThreadPool.QueueUserWorkItem(delegate { try { TwitterProtocolManager.CommandTimeline( new CommandModel( Frontend.FrontendManager, ChatModel, per.IdentityName ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } public override void Sync() { Trace.Call(); base.Sync(); TwitterProtocolManager = (TwitterProtocolManager) ProtocolManager; } static string _(string msg) { return LibraryCatalog.GetString(msg, LibraryTextDomain); } } } smuxi-0.11/src/Frontend-GNOME-Twitter/Makefile.am0000644000175000017500000000200512257043746022312 0ustar00meebeymeebey00000000000000TARGET_DIR = $(top_builddir)/bin/$(PROFILE) ASSEMBLY_NAME = smuxi-frontend-gnome-twitter ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll ASSEMBLY_TARGET = $(TARGET_DIR)/$(ASSEMBLY_FILENAME) SOURCES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ TwitterGroupChatView.cs REFERENCES = \ System \ System.Core \ Mono.Posix \ $(LOG4NET_LIBS) \ $(GTK_SHARP_20_LIBS) DLL_REFERENCES = \ $(TARGET_DIR)/smuxi-common.dll \ $(TARGET_DIR)/smuxi-engine.dll \ $(TARGET_DIR)/smuxi-engine-twitter.dll \ $(TARGET_DIR)/smuxi-frontend.dll \ $(TARGET_DIR)/smuxi-frontend-gnome.exe SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES)) # automake magic variables EXTRA_DIST = $(SOURCES_BUILD) CLEANFILES = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb pkgapp_DATA = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb include $(top_srcdir)/Makefile.include all: $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb: $(SOURCES) $(DLL_REFERENCES) $(CSC) $(CSC_FLAGS) $(build_references_ref) -target:library -out:$@ $(SOURCES_BUILD) smuxi-0.11/src/Frontend-GNOME-Twitter/AssemblyInfo.cs0000644000175000017500000000227412257043746023210 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2013 Andrés G. Aragoneses * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Reflection; [assembly: AssemblyTitle("Smuxi - Twitter support for GNOME frontend")] [assembly: AssemblyCopyright("2013 (C) Andrés G. Aragoneses , " + "2013 (C) Mirco Bauer ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] smuxi-0.11/src/Frontend-GNOME-Twitter/Makefile.in0000644000175000017500000010273212311344230022312 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am subdir = src/Frontend-GNOME-Twitter ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(pkgapp_DATA) $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ TARGET_DIR = $(top_builddir)/bin/$(PROFILE) ASSEMBLY_NAME = smuxi-frontend-gnome-twitter ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll ASSEMBLY_TARGET = $(TARGET_DIR)/$(ASSEMBLY_FILENAME) SOURCES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ TwitterGroupChatView.cs REFERENCES = \ System \ System.Core \ Mono.Posix \ $(LOG4NET_LIBS) \ $(GTK_SHARP_20_LIBS) DLL_REFERENCES = \ $(TARGET_DIR)/smuxi-common.dll \ $(TARGET_DIR)/smuxi-engine.dll \ $(TARGET_DIR)/smuxi-engine-twitter.dll \ $(TARGET_DIR)/smuxi-frontend.dll \ $(TARGET_DIR)/smuxi-frontend-gnome.exe SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES)) # automake magic variables EXTRA_DIST = $(SOURCES_BUILD) $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) CLEANFILES = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) pkgapp_DATA = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Frontend-GNOME-Twitter/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Frontend-GNOME-Twitter/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-pkgappDATA: $(pkgapp_DATA) @$(NORMAL_INSTALL) @list='$(pkgapp_DATA)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgappdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgappdir)" || exit $$?; \ done uninstall-pkgappDATA: @$(NORMAL_UNINSTALL) @list='$(pkgapp_DATA)'; test -n "$(pkgappdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappDATA \ install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappDATA \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappDATA \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) all: $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb: $(SOURCES) $(DLL_REFERENCES) $(CSC) $(CSC_FLAGS) $(build_references_ref) -target:library -out:$@ $(SOURCES_BUILD) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Frontend-GNOME-IRC/0000755000175000017500000000000012311344241017215 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-GNOME-IRC/IrcGroupChatView.cs0000644000175000017500000003700212253423337022744 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2011, 2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Threading; using System.Collections.Generic; using System.Globalization; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend.Gnome { [ChatViewInfo(ChatType = ChatType.Group, ProtocolManagerType = typeof(IrcProtocolManager))] public class IrcGroupChatView : GroupChatView { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string _LibraryTextDomain = "smuxi-frontend-gnome-irc"; IrcProtocolManager IrcProtocolManager { get; set; } public IrcGroupChatView(GroupChatModel groupChat) : base(groupChat) { Trace.Call(groupChat); if (PersonTreeView != null) { Gtk.CellRendererText cellr = new Gtk.CellRendererText(); // HACK: for some reason GTK is giving the space of 2 chars which // we workaround using a char width of 0 cellr.WidthChars = 0; Gtk.TreeViewColumn column = new Gtk.TreeViewColumn(String.Empty, cellr); column.Spacing = 0; column.SortIndicator = false; column.Sizing = Gtk.TreeViewColumnSizing.GrowOnly; column.SetCellDataFunc(cellr, new Gtk.TreeCellDataFunc(RenderIrcGroupPersonMode)); PersonTreeView.AppendColumn(column); PersonTreeView.MoveColumnAfter(IdentityNameColumn, column); } } public override void Sync() { Trace.Call(); base.Sync(); IrcProtocolManager = (IrcProtocolManager) ProtocolManager; } void RenderIrcGroupPersonMode(Gtk.TreeViewColumn column, Gtk.CellRenderer cellr, Gtk.TreeModel model, Gtk.TreeIter iter) { var person = model.GetValue(iter, 0) as IrcGroupPersonModel; if (person == null) { #if LOG4NET _Logger.Error("_RenderIrcGroupPersonMode(): person == null"); #endif return; } string mode; if (person.IsOwner) { mode = "~"; } else if (person.IsChannelAdmin) { mode = "&"; } else if (person.IsOp) { mode = "@"; } else if (person.IsHalfop) { mode = "%"; } else if (person.IsVoice) { mode = "+"; } else { mode = String.Empty; } (cellr as Gtk.CellRendererText).Text = mode; } void OnUserListMenuOpActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } // do smart mode changes var nicks = new List(); foreach (var person in persons) { nicks.Add(person.ID); } ThreadPool.QueueUserWorkItem(delegate { try { IrcProtocolManager.CommandOp( new CommandModel( Frontend.FrontendManager, ChatModel, String.Join(" ", nicks.ToArray()) ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } void OnUserListMenuDeopActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } // do smart mode changes var nicks = new List(); foreach (var person in persons) { nicks.Add(person.ID); } ThreadPool.QueueUserWorkItem(delegate { try { IrcProtocolManager.CommandDeop( new CommandModel( Frontend.FrontendManager, ChatModel, String.Join(" ", nicks.ToArray()) ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } void OnUserListMenuVoiceActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } // do smart mode changes var nicks = new List(); foreach (var person in persons) { nicks.Add(person.ID); } ThreadPool.QueueUserWorkItem(delegate { try { IrcProtocolManager.CommandVoice( new CommandModel( Frontend.FrontendManager, ChatModel, String.Join(" ", nicks.ToArray()) ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } void OnUserListMenuDevoiceActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } // do smart mode changes var nicks = new List(); foreach (var person in persons) { nicks.Add(person.ID); } ThreadPool.QueueUserWorkItem(delegate { try { IrcProtocolManager.CommandDevoice( new CommandModel( Frontend.FrontendManager, ChatModel, String.Join(" ", nicks.ToArray()) ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } void OnUserListMenuKickActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } foreach (var person in persons) { var per = person; ThreadPool.QueueUserWorkItem(delegate { try { IrcProtocolManager.CommandKick( new CommandModel( Frontend.FrontendManager, ChatModel, per.ID ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void OnUserListMenuKickBanActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } foreach (var person in persons) { var per = person; ThreadPool.QueueUserWorkItem(delegate { try { IrcProtocolManager.CommandKickban( new CommandModel( Frontend.FrontendManager, ChatModel, per.ID ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void OnUserListMenuBanActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } // do smart mode changes var nicks = new List(); foreach (var person in persons) { nicks.Add(person.ID); } ThreadPool.QueueUserWorkItem(delegate { try { IrcProtocolManager.CommandBan( new CommandModel( Frontend.FrontendManager, ChatModel, String.Join(" ", nicks.ToArray()) ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } void OnUserListMenuUnbanActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } var nicks = new List(); foreach (var person in persons) { nicks.Add(person.ID); } ThreadPool.QueueUserWorkItem(delegate { try { IrcProtocolManager.CommandUnban( new CommandModel( Frontend.FrontendManager, ChatModel, String.Join(" ", nicks.ToArray()) ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } void OnUserListMenuQueryActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } foreach (var person in persons) { var per = person; ThreadPool.QueueUserWorkItem(delegate { try { IrcProtocolManager.CommandMessageQuery( new CommandModel( Frontend.FrontendManager, ChatModel, per.ID ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void OnUserListMenuWhoisActivated(object sender, EventArgs e) { Trace.Call(sender, e); var persons = GetSelectedPersons(); if (persons == null) { return; } foreach (var person in persons) { var per = person; ThreadPool.QueueUserWorkItem(delegate { try { IrcProtocolManager.CommandWhoIs( new CommandModel( Frontend.FrontendManager, ChatModel, per.ID ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } protected override void OnPersonMenuShown(object sender, EventArgs e) { Trace.Call(sender, e); foreach (var child in PersonMenu.Children) { PersonMenu.Remove(child); } base.OnPersonMenuShown(sender, e); Gtk.ImageMenuItem query_item = new Gtk.ImageMenuItem(_("Query")); query_item.Activated += OnUserListMenuQueryActivated; PersonMenu.Append(query_item); PersonMenu.Append(new Gtk.SeparatorMenuItem()); Gtk.ImageMenuItem op_item = new Gtk.ImageMenuItem(_("Op")); op_item.Activated += OnUserListMenuOpActivated; PersonMenu.Append(op_item); Gtk.ImageMenuItem deop_item = new Gtk.ImageMenuItem(_("Deop")); deop_item.Activated += OnUserListMenuDeopActivated; PersonMenu.Append(deop_item); Gtk.ImageMenuItem voice_item = new Gtk.ImageMenuItem(_("Voice")); voice_item.Activated += OnUserListMenuVoiceActivated; PersonMenu.Append(voice_item); Gtk.ImageMenuItem devoice_item = new Gtk.ImageMenuItem(_("Devoice")); devoice_item.Activated += OnUserListMenuDevoiceActivated; PersonMenu.Append(devoice_item); Gtk.ImageMenuItem kick_item = new Gtk.ImageMenuItem(_("Kick")); kick_item.Activated += OnUserListMenuKickActivated; PersonMenu.Append(kick_item); Gtk.ImageMenuItem kickban_item = new Gtk.ImageMenuItem(_("Kick + Ban")); kickban_item.Activated += OnUserListMenuKickBanActivated; PersonMenu.Append(kickban_item); Gtk.ImageMenuItem ban_item = new Gtk.ImageMenuItem(_("Ban")); ban_item.Activated += OnUserListMenuBanActivated; PersonMenu.Append(ban_item); Gtk.ImageMenuItem unban_item = new Gtk.ImageMenuItem(_("Unban")); unban_item.Activated += OnUserListMenuUnbanActivated; PersonMenu.Append(unban_item); PersonMenu.Append(new Gtk.SeparatorMenuItem()); Gtk.ImageMenuItem whois_item = new Gtk.ImageMenuItem(_("Whois")); whois_item.Activated += OnUserListMenuWhoisActivated; PersonMenu.Append(whois_item); Gtk.MenuItem ctcp_item = new Gtk.MenuItem(_("CTCP")); Gtk.Menu ctcp_menu = new CtcpMenu( IrcProtocolManager, Frontend.MainWindow.ChatViewManager, GetSelectedPersons() ); ctcp_item.Submenu = ctcp_menu; PersonMenu.Append(ctcp_item); Gtk.MenuItem invite_to_item = new Gtk.MenuItem(_("Invite to")); Gtk.Menu invite_to_menu_item = new InviteToMenu( IrcProtocolManager, Frontend.MainWindow.ChatViewManager, GetSelectedPersons() ); invite_to_item.Submenu = invite_to_menu_item; PersonMenu.Append(invite_to_item); PersonMenu.ShowAll(); } private static string _(string msg) { return LibraryCatalog.GetString(msg, _LibraryTextDomain); } } } smuxi-0.11/src/Frontend-GNOME-IRC/InviteToMenu.cs0000644000175000017500000001044612253423337022150 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010, 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Threading; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public class InviteToMenu : Gtk.Menu { IrcProtocolManager ProtocolManager { get; set; } ChatViewManager ChatViewManager { get; set; } IList Invitees { get; set; } bool IsPopulated { get; set; } public InviteToMenu(IrcProtocolManager protocolManager, ChatViewManager chatViewManager, PersonModel invitee) : this(protocolManager, chatViewManager, new [] { invitee }) { } public InviteToMenu(IrcProtocolManager protocolManager, ChatViewManager chatViewManager, IList invitees) { if (protocolManager == null) { throw new ArgumentNullException("protocolManager"); } if (chatViewManager == null) { throw new ArgumentNullException("chatViewManager"); } if (invitees == null) { throw new ArgumentNullException("invitees"); } ProtocolManager = protocolManager; ChatViewManager = chatViewManager; Invitees = invitees; } protected override void OnShown() { Trace.Call(); if (!IsPopulated) { IsPopulated = true; foreach (var chatView in ChatViewManager.Chats) { if (!(chatView is GroupChatView)) { // only invite to group chats continue; } if (chatView == ChatViewManager.ActiveChat) { // don't need to add current chat to invite list continue; } if (chatView.ProtocolManager != ProtocolManager) { // only add chats from current server continue; } var item = new Gtk.ImageMenuItem(chatView.Name); item.Image = new Gtk.Image(GroupChatView.IconPixbuf); // HACK: anonymous methods inside foreach loops needs this var chat = chatView; item.Activated += delegate { OnItemActivated(chat); }; item.Show(); Append(item); } } base.OnShown(); } void OnItemActivated(ChatView chat) { Trace.Call(chat); foreach (var invitee in Invitees) { var inviteeId = invitee.ID; ThreadPool.QueueUserWorkItem(delegate { try { ProtocolManager.CommandInvite( new CommandModel( Frontend.FrontendManager, ChatViewManager.ActiveChat.ChatModel, String.Format("{0} {1}", inviteeId, chat.ID) ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } } } smuxi-0.11/src/Frontend-GNOME-IRC/CtcpMenu.cs0000644000175000017500000001652112253423337021300 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010, 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Threading; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public class CtcpMenu : Gtk.Menu { private static readonly string _LibraryTextDomain = "smuxi-frontend-gnome-irc"; IrcProtocolManager ProtocolManager { get; set; } ChatViewManager ChatViewManager { get; set; } IList Targets { get; set; } bool IsPopulated { get; set; } public CtcpMenu(IrcProtocolManager protocolManager, ChatViewManager chatViewManager, PersonModel target) : this(protocolManager, chatViewManager, new [] { target }) { } public CtcpMenu(IrcProtocolManager protocolManager, ChatViewManager chatViewManager, IList targets) { if (protocolManager == null) { throw new ArgumentNullException("protocolManager"); } if (chatViewManager == null) { throw new ArgumentNullException("chatViewManager"); } if (targets == null) { throw new ArgumentNullException("targets"); } ProtocolManager = protocolManager; ChatViewManager = chatViewManager; Targets = targets; } protected override void OnShown() { Trace.Call(); if (!IsPopulated) { IsPopulated = true; Gtk.MenuItem item; item = new Gtk.MenuItem(_("Ping")); item.Activated += OnPingItemActivated; item.Show(); Append(item); item = new Gtk.MenuItem(_("Version")); item.Activated += OnVersionItemActivated; item.Show(); Append(item); item = new Gtk.MenuItem(_("Time")); item.Activated += OnTimeItemActivated; item.Show(); Append(item); item = new Gtk.MenuItem(_("Finger")); item.Activated += OnFingerItemActivated; item.Show(); Append(item); item = new Gtk.MenuItem(_("Userinfo")); item.Activated += OnUserinfoItemActivated; item.Show(); Append(item); } base.OnShown(); } void OnPingItemActivated(object sender, EventArgs e) { Trace.Call(sender, e); foreach (PersonModel target in Targets) { var targetId = target.ID; ThreadPool.QueueUserWorkItem(delegate { try { ProtocolManager.CommandPing( new CommandModel( Frontend.FrontendManager, ChatViewManager.ActiveChat.ChatModel, targetId ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void OnVersionItemActivated(object sender, EventArgs e) { Trace.Call(sender, e); foreach (PersonModel target in Targets) { var targetId = target.ID; ThreadPool.QueueUserWorkItem(delegate { try { ProtocolManager.CommandVersion( new CommandModel( Frontend.FrontendManager, ChatViewManager.ActiveChat.ChatModel, targetId ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void OnTimeItemActivated(object sender, EventArgs e) { Trace.Call(sender, e); foreach (PersonModel target in Targets) { var targetId = target.ID; ThreadPool.QueueUserWorkItem(delegate { try { ProtocolManager.CommandTime( new CommandModel( Frontend.FrontendManager, ChatViewManager.ActiveChat.ChatModel, targetId ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void OnFingerItemActivated(object sender, EventArgs e) { Trace.Call(sender, e); foreach (PersonModel target in Targets) { var targetId = target.ID; ThreadPool.QueueUserWorkItem(delegate { try { ProtocolManager.CommandFinger( new CommandModel( Frontend.FrontendManager, ChatViewManager.ActiveChat.ChatModel, targetId ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void OnUserinfoItemActivated(object sender, EventArgs e) { Trace.Call(sender, e); foreach (PersonModel target in Targets) { var targetId = target.ID; ThreadPool.QueueUserWorkItem(delegate { try { ProtocolManager.CommandCtcp( new CommandModel( Frontend.FrontendManager, ChatViewManager.ActiveChat.ChatModel, String.Format("{0} {1}", targetId, "USERINFO") ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } private static string _(string msg) { return LibraryCatalog.GetString(msg, _LibraryTextDomain); } } } smuxi-0.11/src/Frontend-GNOME-IRC/ChangeLog0000644000175000017500000000461411655545675021024 0ustar00meebeymeebey000000000000002008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-08-31 Mirco Bauer * Frontend-GNOME-IRC.mdp: Added po files to MonoDevelop projects. 2008-08-25 Mirco Bauer * Makefile.am, smuxi-frontend-gnome-irc.pc.in: Removed unneeded pkg-config files. 2008-08-24 Mirco Bauer * IrcGroupChatView.cs: Use LibraryCatalog now. 2008-07-27 Mirco Bauer * AssemblyInfo.cs, AssemblyInfo.cs.in: Removed AssemblyInfo.cs.in files, not needed anymore as we use a shared AssemblyVersion.cs(.in) now. 2008-07-27 Mirco Bauer * IrcGroupChatView.cs: Added whois to popup menu. (closes trac bug #57) 2008-07-27 Mirco Bauer * IrcGroupChatView.cs: Implemented Kick + Ban in popup menu. (closes trac bug #58) 2008-07-27 Mirco Bauer * IrcGroupChatView.cs: Implemented selecting multiple person in a group chat. (closes trac bug #73) Refactored person context menu commands to support a list of persons. 2008-07-27 Mirco Bauer * Frontend-GNOME-IRC.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-07-17 Mirco Bauer 2008-07-17 Mirco Bauer * IrcGroupChatView.cs: Fixed sort order of op + voice, should be above voice not below. 2008-07-16 Mirco Bauer * IrcGroupChatView.cs: Added devider to person popup menu. 2008-06-02 Mirco Bauer * IrcPersonChatView.cs, IrcGroupChatView.cs, Frontend-GNOME-IRC.mdp: Refactored tab menu code. Moved tab popup menu to ChatView. Implemented closing tabs using the middle-mouse button. 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 * Frontend-GNOME-IRC.mdp: Reference GTK# 2.8 / GNOME# 2.8. 2008-04-01 Mirco Bauer * IrcGroupChatView.cs: Fixed whitespace. 2008-01-31 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * IrcGroupChatView.cs: Impemented ban/unban and query in person popup menu. * Frontend-GNOME-IRC.mdp: Updated using MonoDevelop 0.18.1 smuxi-0.11/src/Frontend-GNOME-IRC/Makefile.am0000644000175000017500000001146612264335155021274 0ustar00meebeymeebey00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = ../../bin/release/smuxi-frontend-gnome-irc.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/release/smuxi-common.dll \ ../../bin/release/smuxi-engine.dll \ ../../bin/release/smuxi-frontend-gnome.exe \ ../../bin/release/smuxi-engine-irc.dll \ ../../bin/release/smuxi-frontend.dll BUILD_DIR = ../../bin/release SMUXI_COMMON_DLL_SOURCE=../../bin/release/smuxi-common.dll MEEBEY_SMARTIRC4NET_DLL_SOURCE=../../lib/Meebey.SmartIrc4net.dll SMUXI_FRONTEND_GNOME_EXE_MDB= SMUXI_FRONTEND_DLL_SOURCE=../../bin/release/smuxi-frontend.dll SMUXI_ENGINE_IRC_DLL_SOURCE=../../bin/release/smuxi-engine-irc.dll SMUXI_ENGINE_IRC_DLL_MDB= SMUXI_ENGINE_DLL_MDB= SMUXI_FRONTEND_DLL_MDB= SMUXI_FRONTEND_GNOME_EXE_SOURCE=../../bin/release/smuxi-frontend-gnome.exe NINI_DLL_SOURCE=../../lib/Nini.dll LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/release/smuxi-engine.dll endif if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" ASSEMBLY = ../../bin/debug/smuxi-frontend-gnome-irc.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/debug/smuxi-common.dll \ ../../bin/debug/smuxi-engine.dll \ ../../bin/debug/smuxi-frontend-gnome.exe \ ../../bin/debug/smuxi-engine-irc.dll \ ../../bin/debug/smuxi-frontend.dll BUILD_DIR = ../../bin/debug SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll MEEBEY_SMARTIRC4NET_DLL_SOURCE=../../lib/Meebey.SmartIrc4net.dll SMUXI_FRONTEND_GNOME_EXE_MDB_SOURCE=../../bin/debug/smuxi-frontend-gnome.exe.mdb SMUXI_FRONTEND_GNOME_EXE_MDB=$(BUILD_DIR)/smuxi-frontend-gnome.exe.mdb SMUXI_FRONTEND_DLL_SOURCE=../../bin/debug/smuxi-frontend.dll SMUXI_ENGINE_IRC_DLL_SOURCE=../../bin/debug/smuxi-engine-irc.dll SMUXI_ENGINE_IRC_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine-irc.dll.mdb SMUXI_ENGINE_IRC_DLL_MDB=$(BUILD_DIR)/smuxi-engine-irc.dll.mdb SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb SMUXI_FRONTEND_DLL_MDB_SOURCE=../../bin/debug/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_MDB=$(BUILD_DIR)/smuxi-frontend.dll.mdb SMUXI_FRONTEND_GNOME_EXE_SOURCE=../../bin/debug/smuxi-frontend-gnome.exe NINI_DLL_SOURCE=../../lib/Nini.dll LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/debug/smuxi-engine.dll endif AL=al2 SATELLITE_ASSEMBLY_NAME=.resources.dll PROGRAMFILES = \ $(SMUXI_COMMON_DLL) \ $(SMUXI_FRONTEND_GNOME_EXE_MDB) \ $(SMUXI_FRONTEND_DLL) \ $(SMUXI_ENGINE_IRC_DLL) \ $(SMUXI_ENGINE_IRC_DLL_MDB) \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_FRONTEND_DLL_MDB) \ $(SMUXI_FRONTEND_GNOME_EXE) \ $(SMUXI_ENGINE_DLL) LINUX_PKGCONFIG = \ $(FRONTEND_GNOME_IRC_PC) all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ IrcGroupChatView.cs \ IrcPersonChatView.cs \ InviteToMenu.cs \ CtcpMenu.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ System \ Mono.Posix \ $(GTK_SHARP_20_LIBS) DLL_REFERENCES = \ $(BUILD_DIR)/Meebey.SmartIrc4net.dll CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) include $(top_srcdir)/Makefile.include SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll MEEBEY_SMARTIRC4NET_DLL = $(BUILD_DIR)/Meebey.SmartIrc4net.dll SMUXI_FRONTEND_DLL = $(BUILD_DIR)/smuxi-frontend.dll SMUXI_ENGINE_IRC_DLL = $(BUILD_DIR)/smuxi-engine-irc.dll SMUXI_FRONTEND_GNOME_EXE = $(BUILD_DIR)/smuxi-frontend-gnome.exe NINI_DLL = $(BUILD_DIR)/Nini.dll LOG4NET_DLL = $(BUILD_DIR)/log4net.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_GNOME_EXE_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_IRC_DLL)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_IRC_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_GNOME_EXE)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS) smuxi-0.11/src/Frontend-GNOME-IRC/AssemblyInfo.cs0000644000175000017500000000221312253423337022146 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Smuxi - IRC support for GNOME frontend")] [assembly: AssemblyCopyright("2005-2013 (C) Mirco Bauer ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] smuxi-0.11/src/Frontend-GNOME-IRC/IrcPersonChatView.cs0000644000175000017500000001070612264335155023122 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008, 2010-2011 Mirco Bauer * Copyright (c) 2013 Andrés G. Aragoneses * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using System.Threading; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend.Gnome { [ChatViewInfo(ChatType = ChatType.Person, ProtocolManagerType = typeof(IrcProtocolManager))] public class IrcPersonChatView : PersonChatView { private static readonly string _LibraryTextDomain = "smuxi-frontend-gnome-irc"; IrcProtocolManager IrcProtocolManager; public IrcPersonChatView(PersonChatModel personChat) : base(personChat) { Trace.Call(personChat); OutputMessageTextView.PopulatePopup += OnOutputMessageTextViewPopulatePopup; } public override void Sync() { Trace.Call(); base.Sync(); IrcProtocolManager = (IrcProtocolManager) ProtocolManager; } protected override void OnTabMenuShown(object sender, EventArgs e) { base.OnTabMenuShown(sender, e); var stack = new Stack(); foreach (var menu_item in CreateContextMenuItems()) { stack.Push(menu_item); } TabMenu.Prepend(new Gtk.SeparatorMenuItem()); while (stack.Count != 0) { TabMenu.Prepend(stack.Pop()); } TabMenu.ShowAll(); } void OnOutputMessageTextViewPopulatePopup(object o, Gtk.PopulatePopupArgs args) { if (OutputMessageTextView.IsAtUrlTag) { return; } Gtk.Menu popup = args.Menu; popup.Append(new Gtk.SeparatorMenuItem()); foreach (var menu_item in CreateContextMenuItems()) { popup.Append(menu_item); } popup.ShowAll(); } IEnumerable CreateContextMenuItems() { Gtk.ImageMenuItem whois_item = new Gtk.ImageMenuItem(_("Whois")); whois_item.Activated += OnMenuWhoisItemActivated; yield return whois_item; Gtk.ImageMenuItem ctcp_item = new Gtk.ImageMenuItem(_("CTCP")); Gtk.Menu ctcp_menu_item = new CtcpMenu(IrcProtocolManager, Frontend.MainWindow.ChatViewManager, PersonModel); ctcp_item.Submenu = ctcp_menu_item; yield return ctcp_item; Gtk.ImageMenuItem invite_to_item = new Gtk.ImageMenuItem(_("Invite to")); Gtk.Menu invite_to_menu_item = new InviteToMenu(IrcProtocolManager, Frontend.MainWindow.ChatViewManager, PersonModel); invite_to_item.Submenu = invite_to_menu_item; yield return invite_to_item; } void OnMenuWhoisItemActivated(object sender, EventArgs e) { Trace.Call(sender, e); ThreadPool.QueueUserWorkItem(delegate { try { IrcProtocolManager.CommandWhoIs( new CommandModel( Frontend.FrontendManager, ChatModel, ID ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } private static string _(string msg) { return LibraryCatalog.GetString(msg, _LibraryTextDomain); } } } smuxi-0.11/src/Frontend-GNOME-IRC/Makefile.in0000644000175000017500000010656112311344230021271 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am ChangeLog subdir = src/Frontend-GNOME-IRC ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ # Warning: This is an automatically generated file, do not edit! @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/debug/smuxi-frontend-gnome-irc.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/release/smuxi-frontend-gnome-irc.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-common.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-engine.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-frontend-gnome.exe \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-engine-irc.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-frontend.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-common.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-engine.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-frontend-gnome.exe \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-engine-irc.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-frontend.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin/debug @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin/release @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/release/smuxi-common.dll @ENABLE_DEBUG_TRUE@MEEBEY_SMARTIRC4NET_DLL_SOURCE = ../../lib/Meebey.SmartIrc4net.dll @ENABLE_RELEASE_TRUE@MEEBEY_SMARTIRC4NET_DLL_SOURCE = ../../lib/Meebey.SmartIrc4net.dll @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_GNOME_EXE_MDB = $(BUILD_DIR)/smuxi-frontend-gnome.exe.mdb @ENABLE_RELEASE_TRUE@SMUXI_FRONTEND_GNOME_EXE_MDB = @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_DLL_SOURCE = ../../bin/debug/smuxi-frontend.dll @ENABLE_RELEASE_TRUE@SMUXI_FRONTEND_DLL_SOURCE = ../../bin/release/smuxi-frontend.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_IRC_DLL_SOURCE = ../../bin/debug/smuxi-engine-irc.dll @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_IRC_DLL_SOURCE = ../../bin/release/smuxi-engine-irc.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_IRC_DLL_MDB = $(BUILD_DIR)/smuxi-engine-irc.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_IRC_DLL_MDB = @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB = $(BUILD_DIR)/smuxi-engine.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_MDB = @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_DLL_MDB = $(BUILD_DIR)/smuxi-frontend.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_FRONTEND_DLL_MDB = @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_GNOME_EXE_SOURCE = ../../bin/debug/smuxi-frontend-gnome.exe @ENABLE_RELEASE_TRUE@SMUXI_FRONTEND_GNOME_EXE_SOURCE = ../../bin/release/smuxi-frontend-gnome.exe @ENABLE_DEBUG_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_RELEASE_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_DEBUG_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_RELEASE_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/debug/smuxi-engine.dll @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/release/smuxi-engine.dll @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_GNOME_EXE_MDB_SOURCE = ../../bin/debug/smuxi-frontend-gnome.exe.mdb @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_IRC_DLL_MDB_SOURCE = ../../bin/debug/smuxi-engine-irc.dll.mdb @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB_SOURCE = ../../bin/debug/smuxi-engine.dll.mdb @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_DLL_MDB_SOURCE = ../../bin/debug/smuxi-frontend.dll.mdb AL = al2 SATELLITE_ASSEMBLY_NAME = .resources.dll PROGRAMFILES = \ $(SMUXI_COMMON_DLL) \ $(SMUXI_FRONTEND_GNOME_EXE_MDB) \ $(SMUXI_FRONTEND_DLL) \ $(SMUXI_ENGINE_IRC_DLL) \ $(SMUXI_ENGINE_IRC_DLL_MDB) \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_FRONTEND_DLL_MDB) \ $(SMUXI_FRONTEND_GNOME_EXE) \ $(SMUXI_ENGINE_DLL) LINUX_PKGCONFIG = \ $(FRONTEND_GNOME_IRC_PC) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ IrcGroupChatView.cs \ IrcPersonChatView.cs \ InviteToMenu.cs \ CtcpMenu.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ System \ Mono.Posix \ $(GTK_SHARP_20_LIBS) DLL_REFERENCES = \ $(BUILD_DIR)/Meebey.SmartIrc4net.dll CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll MEEBEY_SMARTIRC4NET_DLL = $(BUILD_DIR)/Meebey.SmartIrc4net.dll SMUXI_FRONTEND_DLL = $(BUILD_DIR)/smuxi-frontend.dll SMUXI_ENGINE_IRC_DLL = $(BUILD_DIR)/smuxi-engine-irc.dll SMUXI_FRONTEND_GNOME_EXE = $(BUILD_DIR)/smuxi-frontend-gnome.exe NINI_DLL = $(BUILD_DIR)/Nini.dll LOG4NET_DLL = $(BUILD_DIR)/log4net.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Frontend-GNOME-IRC/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Frontend-GNOME-IRC/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_GNOME_EXE_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_IRC_DLL)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_IRC_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_GNOME_EXE)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Frontend-SWF/0000755000175000017500000000000012311344241016374 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-SWF/Main.cs0000644000175000017500000000335611655545675017646 0ustar00meebeymeebey00000000000000/* * $Id: Main.cs 183 2007-04-21 15:14:23Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/Main.cs $ * $Rev: 183 $ * $Author: meebey $ * $Date: 2007-04-21 17:14:23 +0200 (Sat, 21 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.Frontend.Swf { public class MainClass { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif [STAThread] public static void Main(string[] args) { #if LOG4NET log4net.Config.BasicConfigurator.Configure(); #endif try { Frontend.Init(args); } catch (Exception e) { #if LOG4NET _Logger.Fatal(e); #endif // rethrow the exception for console output throw; } } } } smuxi-0.11/src/Frontend-SWF/MainWindow.cs0000644000175000017500000000475011655545675021035 0ustar00meebeymeebey00000000000000 using System; using System.Reflection; using System.Windows.Forms; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Swf { public partial class MainWindow : Form { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private bool _CaretMode; private ChatViewManager _ChatViewManager; private IFrontendUI _UI; private Notebook _Notebook; private Entry _Entry; public bool CaretMode { get { return _CaretMode; } } public Notebook Notebook { get { return _Notebook; } } public IFrontendUI UI { get { return _UI; } } public ToolStripStatusLabel NetworkStatusbar { get { return _NetworkStatusbar; } } public ToolStripStatusLabel Statusbar { get { return _Statusbar; } } public ToolStripProgressBar ProgressBar { get { return _ProgressBar; } } public Entry Entry { get { return _Entry; } } public MainWindow() { InitializeComponent(); _Entry.Notebook = _Notebook; _Notebook.Show(); _ChatViewManager = new ChatViewManager(_Notebook); Assembly asm = Assembly.GetExecutingAssembly(); _ChatViewManager.Load(asm); _ChatViewManager.LoadAll(System.IO.Path.GetDirectoryName(asm.Location), "smuxi-frontend-swf-*.dll"); _UI = new SwfUI(_ChatViewManager, this); _NetworkStatusbar.Text = String.Empty; _Statusbar.Text = String.Empty; } public void ApplyConfig(UserConfig userConfig) { Trace.Call(userConfig); if (userConfig == null) { throw new ArgumentNullException("userConfig"); } _Entry.ApplyConfig(userConfig); _Notebook.ApplyConfig(userConfig); _ChatViewManager.ApplyConfig(userConfig); } } } smuxi-0.11/src/Frontend-SWF/Entry.cs0000644000175000017500000006020212253423337020035 0ustar00meebeymeebey00000000000000/* * $Id: Entry.cs 216 2007-11-05 22:56:57Z meebey $ * $URL: svn+ssh://SmuxiSVN/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/Entry.cs $ * $Rev: 216 $ * $Author: meebey $ * $Date: 2007-11-05 17:56:57 -0500 (Mon, 05 Nov 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Drawing; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Windows.Forms; using Mono.Unix; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend.Swf { public class Entry : TextBox { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private StringCollection _History = new StringCollection(); private int _HistoryPosition; private bool _HistoryChangedLine; private Notebook _Notebook; private NickCompleter NickCompleter { get; set; } public EventHandler Activated; /* public StringCollection History { get { return _History; } } */ /* public int HistoryPosition { get { return _HistoryPosition; } set { _HistoryPosition = value; } } */ /* public bool HistoryChangedLine { get { return _HistoryChangedLine; } set { _HistoryChangedLine = value; } } */ public Notebook Notebook { get { return _Notebook; } internal set { _Notebook = value; } } public Entry() { _History.Add(String.Empty); Activated += _OnActivated; KeyDown += _OnKeyPress; Leave += _OnFocusOut; //ClipboardPasted += new EventHandler(_OnClipboardPasted); } public void UpdateHistoryChangedLine() { if ((_History.Count > 0) && (Text.Length > 0) && (Text != HistoryCurrent())) { // the entry changed and the entry is not empty _HistoryChangedLine = true; #if LOG4NET _Logger.Debug("_HistoryChangedLine = true"); #endif } else { _HistoryChangedLine = false; #if LOG4NET _Logger.Debug("_HistoryChangedLine = false"); #endif } } public void AddToHistory(string data, int positiondiff) { /* // BUG: this code doesnt work well // _History.Count-1 is the last entry, which should be always empty if ((_History.Count > 1) && (data == _History[_History.Count-2])) { // don't add the same value return; } */ _History.Insert(_History.Count-1, data); #if LOG4NET _Logger.Debug("added: '"+data+"' to history"); #endif if (_History.Count > (int)Frontend.UserConfig["Interface/Entry/CommandHistorySize"]) { _History.RemoveAt(0); } else { _HistoryPosition += positiondiff; } } public virtual void ApplyConfig(UserConfig config) { Trace.Call(config); if (config == null) { throw new ArgumentNullException("config"); } string bgStr = (string) config["Interface/Chat/BackgroundColor"]; if (!String.IsNullOrEmpty(bgStr)) { try { BackColor = ColorTools.GetColor(bgStr); } catch (FormatException ex) { #if LOG4NET _Logger.Error("setting background color failed", ex); #endif } } else { BackColor = Color.Empty; } string fgStr = (string) config["Interface/Chat/ForegroundColor"]; if (!String.IsNullOrEmpty(fgStr)) { try { ForeColor = ColorTools.GetColor(fgStr); } catch (FormatException ex) { #if LOG4NET _Logger.Error("setting foreground color failed", ex); #endif } } else { ForeColor = Color.Empty; } string fontFamily = (string) config["Interface/Chat/FontFamily"]; string fontStyle = (string) config["Interface/Chat/FontStyle"]; int fontSize = 0; if (config["Interface/Chat/FontSize"] != null) { fontSize = (int) config["Interface/Chat/FontSize"]; } Font font = null; if (String.IsNullOrEmpty(fontFamily)) { // use Monospace by default float? defaultSize; try { defaultSize = Font.Size; } catch (NullReferenceException) { #if LOG4NET _Logger.Error("could not get default system font size, using internal default"); #endif // Mono bug? defaultSize = 12f; } font = new Font(FontFamily.GenericMonospace, defaultSize.Value); } else { string fontWeigth = null; if (fontStyle.Contains(" ")) { int pos = fontStyle.IndexOf(" "); fontWeigth = fontStyle.Substring(0, pos); fontStyle = fontStyle.Substring(pos + 1); } FontStyle style = (FontStyle) Enum.Parse(typeof(FontStyle), fontStyle); font = new Font(fontFamily, fontSize, style); } Font = font; // replace nick completer if needed bool wantBashCompletion = (bool)config["Interface/Entry/BashStyleCompletion"]; if (wantBashCompletion && !(NickCompleter is LongestPrefixNickCompleter)) { NickCompleter = new LongestPrefixNickCompleter(); } else if (!wantBashCompletion && !(NickCompleter is TabCycleNickCompleter)) { NickCompleter = new TabCycleNickCompleter(); } // set the completion character NickCompleter.CompletionChar = (string)config["Interface/Entry/CompletionChar"]; } public string HistoryCurrent() { return _History[_HistoryPosition]; } public void HistoryPrevious() { if (_HistoryChangedLine) { #if LOG4NET _Logger.Debug("entry changed, adding to history"); #endif AddToHistory(Text, 0); _HistoryChangedLine = false; } if (_HistoryPosition > 0) { #if LOG4NET _Logger.Debug("showing previous item"); #endif _HistoryPosition--; Text = HistoryCurrent(); } } public void HistoryNext() { if (_HistoryChangedLine) { #if LOG4NET _Logger.Debug("entry changed, adding to history"); #endif AddToHistory(Text, 0); _HistoryChangedLine = false; } if (_HistoryPosition < _History.Count-1) { #if LOG4NET _Logger.Debug("showing next item"); #endif _HistoryPosition++; Text = HistoryCurrent(); //Position = -1; } else if (Text.Length > 0) { #if LOG4NET _Logger.Debug("not empty line, lets add one"); #endif // last position and we went further down _History.Add(String.Empty); _HistoryPosition++; Text = String.Empty; } } private void _OnKeyPress(object sender, KeyEventArgs e) { Trace.Call(sender, e); #if LOG4NET _Logger.Debug("_OnKeyPress(): KeyCode: " + e.KeyCode + " KeyValue: " + e.KeyValue); #endif //int keynumber = (int)e.KeyCode; Keys key = e.KeyCode; if (e.Control) { // ctrl is pressed e.Handled = true; switch (key) { case Keys.X: if (_Notebook.CurrentChatView is SessionChatView) { Frontend.FrontendManager.NextProtocolManager(); } else { // don't break cut e.Handled = false; } break; // don't break copy/paste case Keys.C: case Keys.V: e.Handled = false; break; case Keys.PageDown: if (_Notebook.SelectedIndex < _Notebook.TabCount - 1) { _Notebook.SelectedIndex++; } break; case Keys.PageUp: if (_Notebook.SelectedIndex > 0) { _Notebook.SelectedIndex--; } break; case Keys.Home: _Notebook.CurrentChatView.ScrollToStart(); break; case Keys.End: _Notebook.CurrentChatView.ScrollToEnd(); break; } } int pagenumber = -1; if (e.Alt) { // alt is pressed switch (e.KeyValue) { case 49: // 1 case 50: // 2 case 51: // 3 case 52: // 4 case 53: // 5 case 54: // 6 case 55: // 7 case 56: // 8 case 57: // 9 pagenumber = e.KeyValue - 49; break; case 48: // 0 pagenumber = 9; break; case 81: // q pagenumber = 10; break; case 87: // w pagenumber = 11; break; case 69: // e pagenumber = 12; break; case 82: // r pagenumber = 13; break; case 84: // t pagenumber = 14; break; case 89: // y pagenumber = 15; break; case 85: // u pagenumber = 16; break; case 73: // i pagenumber = 17; break; case 79: // o pagenumber = 18; break; case 80: // p pagenumber = 19; break; } if (pagenumber != -1 && _Notebook.TabCount > pagenumber) { _Notebook.SelectedIndex = pagenumber; } } if (e.Alt | e.Control | e.Shift) { // alt, ctrl or shift pushed, returning return; } UpdateHistoryChangedLine(); switch (key) { case Keys.Enter: if (Activated != null) { Activated(this, EventArgs.Empty); } e.Handled = true; break; case Keys.Tab: e.Handled = true; if (Frontend.MainWindow.CaretMode) { // when we are in caret-mode change focus to output textview _Notebook.CurrentChatView.OutputTextView.Focus(); } else { // don't loose the focus (if we are not in caret-mode) if (_Notebook.CurrentChatView.ChatModel is GroupChatModel) { if (Text.Length > 0) { _NickCompletion(); } } } break; case Keys.Up: HistoryPrevious(); break; case Keys.Down: HistoryNext(); break; case Keys.PageUp: _Notebook.CurrentChatView.ScrollUp(); break; case Keys.PageDown: _Notebook.CurrentChatView.ScrollDown(); break; } } private void _OnFocusOut(object sender, EventArgs e) { Trace.Call(sender, e); if (!Frontend.MainWindow.CaretMode) { Select(); } } private void _OnActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { if (!(Text.Length > 0)) { return; } if (Text.IndexOf("\n") != -1) { // seems to be a paste, so let's break it apart string[] msgParts = Text.Split(new char[] {'\n'}); if (msgParts.Length > 3) { string msg = String.Format(_("You are going to paste {0} lines, do you want to continue?"), msgParts.Length); /* Gtk.MessageDialog md = new Gtk.MessageDialog( Frontend.MainWindow, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.YesNo, msg); Gtk.ResponseType res = (Gtk.ResponseType)md.Run(); md.Destroy(); if (res != Gtk.ResponseType.Yes) { Text = String.Empty; return; } */ } foreach (string msg in msgParts) { ExecuteCommand(msg); } } else { ExecuteCommand(Text); AddToHistory(Text, _History.Count - _HistoryPosition); // reset history position to last entry _HistoryPosition = _History.Count - 1; } Text = String.Empty; } catch (Exception ex) { #if LOG4NET _Logger.Error(ex); #endif Frontend.ShowException(null, ex); } } private void _OnClipboardPasted(object sender, EventArgs e) { Trace.Call(sender, e); } public void ExecuteCommand(string cmd) { if (!(cmd.Length > 0)) { return; } bool handled; CommandModel cd = new CommandModel(Frontend.FrontendManager, _Notebook.CurrentChatView.ChatModel, (string)Frontend.UserConfig["Interface/Entry/CommandCharacter"], cmd); handled = _Command(cd); if (!handled) { handled = Frontend.Session.Command(cd); } if (!handled) { // we may have no network manager yet Engine.IProtocolManager nm = Frontend.FrontendManager.CurrentProtocolManager; if (nm != null) { handled = nm.Command(cd); } else { handled = false; } } if (!handled) { _CommandUnknown(cd); } } private bool _Command(CommandModel cd) { bool handled = false; // command that work even without beeing connected if (cd.IsCommand) { switch (cd.Command) { case "help": _CommandHelp(cd); break; case "detach": _CommandDetach(cd); handled = true; break; case "echo": _CommandEcho(cd); handled = true; break; case "exec": _CommandExec(cd); handled = true; break; case "window": _CommandWindow(cd); handled = true; break; case "clear": _CommandClear(cd); handled = true; break; } } return handled; } private void _CommandHelp(CommandModel cd) { MessageModel msg = new MessageModel(); TextMessagePartModel msgPart; msgPart = new TextMessagePartModel(); // TRANSLATOR: this line is used as a label / category for a // list of commands below msgPart.Text = "[" + _("Frontend Commands") + "]"; msgPart.Bold = true; msg.MessageParts.Add(msgPart); cd.FrontendManager.AddMessageToChat(cd.Chat, msg); string[] help = { "window (number|channelname|queryname|close", "clear", "echo data", "exec command", "detach", }; foreach (string line in help) { cd.FrontendManager.AddTextToChat(cd.Chat, "-!- " + line); } } private void _CommandDetach(CommandModel cd) { Frontend.Quit(); } private void _CommandEcho(CommandModel cd) { cd.FrontendManager.AddTextToChat(cd.Chat, "-!- " + cd.Parameter); } private void _CommandExec(CommandModel cd) { if (cd.DataArray.Length >= 2) { string output; System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo.FileName = cd.DataArray[1]; if (cd.DataArray.Length >= 3) { process.StartInfo.Arguments = String.Join(" ", cd.DataArray, 2, cd.DataArray.Length-2); } process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; process.StartInfo.UseShellExecute = false; try { process.Start(); output = process.StandardOutput.ReadToEnd(); cd.FrontendManager.AddTextToChat(cd.Chat, output); } catch { } } } private void _CommandWindow(CommandModel cd) { FrontendManager fm = cd.FrontendManager; if (cd.DataArray.Length >= 2) { ChatModel currentChatModel = _Notebook.CurrentChatView.ChatModel; string name; if (cd.DataArray[1].ToLower() == "close") { name = currentChatModel.Name; // BUG: handle this in GNOME-IRC /* if (currentChatModel.ChatType != ChatType.Network) { if (currentChatModel.ProtocolManager is IrcProtocolManager) { IrcProtocolManager ircm = (IrcProtocolManager) currentChatModel.ProtocolManager; if (currentChatModel.ChatType == ChatType.Group) { // channel ircm.CommandPart(new CommandModel(fm, currentChatModel, name)); } else { // query Frontend.Session.RemoveChat(currentChatModel); } } } */ } else { bool is_number = false; int pagecount = _Notebook.TabCount; try { int number = Int32.Parse(cd.DataArray[1]); is_number = true; if (number <= pagecount) { _Notebook.SelectedIndex = number - 1; } } catch (FormatException) { } if (!is_number) { // seems to be query- or channelname // let's see if we find something ArrayList candidates = new ArrayList(); for (int i = 0; i < pagecount; i++) { ChatView chatView = _Notebook.GetChat(i); ChatModel chatModel = chatView.ChatModel; if (chatModel.Name.ToLower() == cd.DataArray[1].ToLower()) { // name matches // first let's see if there is an exact match, if so, take it if ((chatModel.ChatType == currentChatModel.ChatType) && (chatModel.ProtocolManager == currentChatModel.ProtocolManager)) { _Notebook.SelectedIndex = i; break; } else { // there was no exact match candidates.Add(i); } } } if (candidates.Count > 0) { _Notebook.SelectedIndex = (int)candidates[0]; } } } } } private void _CommandClear(CommandModel cd) { _Notebook.CurrentChatView.OutputTextView.Clear(); } private void _CommandUnknown(CommandModel cd) { cd.FrontendManager.AddTextToChat(cd.Chat, "-!- " + String.Format(Catalog.GetString( "Unknown Command: {0}"), cd.Command)); } private void _NickCompletion() { // perform completion string text = Text; int position = SelectionStart; NickCompleter.Complete(ref text, ref position, _Notebook.CurrentChatView); Text = text; SelectionStart = position; } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-SWF/Chats/0000755000175000017500000000000012311344241017436 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-SWF/Chats/NetworkChatView.cs0000644000175000017500000000267111655545675023107 0ustar00meebeymeebey00000000000000/* * $Id: ChannelPage.cs 138 2006-12-23 17:11:57Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/ChannelPage.cs $ * $Rev: 138 $ * $Author: meebey $ * $Date: 2006-12-23 18:11:57 +0100 (Sat, 23 Dec 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Mono.Unix; using Smuxi.Engine; namespace Smuxi.Frontend.Swf { [ChatViewInfo(ChatType = ChatType.Protocol)] public class NetworkChatView : ChatView { public NetworkChatView(ChatModel chat) : base(chat) { this.Controls.Add(base.OutputTextView); } } } smuxi-0.11/src/Frontend-SWF/Chats/PersonChatView.cs0000644000175000017500000000330112250426634022674 0ustar00meebeymeebey00000000000000/* * $Id: ChannelPage.cs 138 2006-12-23 17:11:57Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/ChannelPage.cs $ * $Rev: 138 $ * $Author: meebey $ * $Date: 2006-12-23 18:11:57 +0100 (Sat, 23 Dec 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using Smuxi.Engine; namespace Smuxi.Frontend.Swf { [ChatViewInfo(ChatType = ChatType.Person)] public class PersonChatView : ChatView { public PersonChatView(ChatModel chat) : base(chat) { this.Controls.Add(base.OutputTextView); } public override IList Participants { get { var ret = new List(); ret.Add(((PersonChatModel)ChatModel).Person); return ret; } } } } smuxi-0.11/src/Frontend-SWF/Chats/GroupChatView.cs0000644000175000017500000001105512253423337022527 0ustar00meebeymeebey00000000000000/* * $Id: ChannelPage.cs 138 2006-12-23 17:11:57Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/ChannelPage.cs $ * $Rev: 138 $ * $Author: meebey $ * $Date: 2006-12-23 18:11:57 +0100 (Sat, 23 Dec 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Linq; using System.Windows.Forms; using System.Collections.Generic; using Mono.Unix; using Smuxi.Engine; namespace Smuxi.Frontend.Swf { [ChatViewInfo(ChatType = ChatType.Group)] public class GroupChatView : ChatView { private TextBox _TopicTextView; private ListBox _PersonListBox; public GroupChatView(ChatModel chat) : base(chat) { InitializeComponents(); } public GroupChatModel GroupChatModel { get { return (GroupChatModel)base.ChatModel; } } private void InitializeComponents() { Splitter personListBoxSplitter = new Splitter(); this._TopicTextView = new TextBox(); this._PersonListBox = new ListBox(); this.SuspendLayout(); // _TopicTextView this._TopicTextView.ReadOnly = true; this._TopicTextView.Name = "_TopicTextView"; this._TopicTextView.Dock = DockStyle.Top; // _PersonListBox this._PersonListBox.Name = "_PersonListBox"; this._PersonListBox.Dock = DockStyle.Right; this._PersonListBox.IntegralHeight = false; // personListBoxSplitter personListBoxSplitter.Dock = DockStyle.Right; this.Controls.Add(base.OutputTextView); this.Controls.Add(_TopicTextView); this.Controls.Add(personListBoxSplitter); this.Controls.Add(_PersonListBox); this.ResumeLayout(); } public override void ApplyConfig(UserConfig config) { base.ApplyConfig(config); if (BackgroundColor.HasValue) _PersonListBox.BackColor = _TopicTextView.BackColor = BackgroundColor.Value; if (BackgroundColor.HasValue) _PersonListBox.ForeColor = _TopicTextView.ForeColor = ForegroundColor.Value; _PersonListBox.Font = _TopicTextView.Font = Font; _PersonListBox.Width = TextRenderer.MeasureText("999999999", Font).Width; } public void AddPerson(PersonModel person) { _PersonListBox.Items.Add(person.IdentityName); } public void UpdatePerson(PersonModel oldPerson, PersonModel newPerson) { _PersonListBox.Items.Remove(oldPerson.IdentityName); _PersonListBox.Items.Add(newPerson.IdentityName); } public void RemovePerson(PersonModel person) { _PersonListBox.Items.Remove(person.IdentityName); } public override void Sync() { base.Sync(); var persons = GroupChatModel.Persons; if (persons == null) { persons = new Dictionary(0); } foreach (PersonModel person in persons.Values) { _PersonListBox.Items.Add(person.IdentityName); } } public override void Disable() { base.Disable(); _PersonListBox.Items.Clear(); _TopicTextView.Clear(); } public override IList Participants { get { var participants = new List(); foreach (PersonModel person in _PersonListBox.Items) { participants.Add(person); } return new List(participants.OrderBy(x => x)); } } } } smuxi-0.11/src/Frontend-SWF/Chats/ChatView.cs0000644000175000017500000003025712250426634021517 0ustar00meebeymeebey00000000000000using System; using System.Text; using System.Drawing; using System.Globalization; using System.Windows.Forms; using System.ComponentModel; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; using Smuxi.Frontend; namespace Smuxi.Frontend.Swf { public abstract partial class ChatView : TabPage, IChatView { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private ChatModel _ChatModel; private bool _HasHighlight; private RichTextBoxEx _OutputTextView; private Color? _BackgroundColor; private Color? _ForegroundColor; private Font _Font; //protected override void OnPaint(PaintEventArgs pe) //{ // // TODO: Add custom paint code here // // Calling the base class OnPaint // base.OnPaint(pe); //} public ChatModel ChatModel { get { return _ChatModel; } } public string ID { get { return ChatModel.ID; } } public int Position { get { return ChatModel.Position; } } public RichTextBox OutputTextView { get { return _OutputTextView; } } public bool HasHighlight { get { return _HasHighlight; } set { _HasHighlight = value; } } protected Font Font { get { return _Font; } } protected Color? BackgroundColor { get { return _BackgroundColor; } } protected Color? ForegroundColor { get { return _ForegroundColor; } } protected ChatView(ChatModel chat) { _ChatModel = chat; InitializeComponent(); Name = chat.Name; Text = chat.Name; _OutputTextView.SelectionChanged += new EventHandler(OutputSelectionChanged); } private void OutputSelectionChanged(object sender, EventArgs e) { #if LOG4NET if (!_OutputTextView.CaretEndPosition) { _Logger.Debug("OutputSelectionChanged()"); } #endif } private void InitializeComponent() { this._OutputTextView = new RichTextBoxEx(); this.SuspendLayout(); // // _OutputTextView // this._OutputTextView.DetectUrls = false; this._OutputTextView.Dock = System.Windows.Forms.DockStyle.Fill; this._OutputTextView.HideSelection = false; this._OutputTextView.Name = "_OutputTextView"; this._OutputTextView.ReadOnly = true; this._OutputTextView.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical; this._OutputTextView.ShowSelectionMargin = true; this._OutputTextView.TabIndex = 0; this.ResumeLayout(false); } public void ScrollUp() { Trace.Call(); // TODO } public void ScrollDown() { Trace.Call(); // TODO } public void ScrollToStart() { Trace.Call(); // TODO } public void ScrollToEnd() { Trace.Call(); _OutputTextView.ScrollToEnd(); } public void Enable() { Trace.Call(); Enabled = true; } public virtual void Disable() { Trace.Call(); Enabled = false; } public virtual void Sync() { Trace.Call(); #if LOG4NET _Logger.Debug("Sync() syncing messages"); #endif // sync messages // cleanup, be sure the output is empty _OutputTextView.Clear(); IList messages = _ChatModel.Messages; if (messages.Count > 0) { foreach (MessageModel msg in messages) { AddMessage(msg); } } } public virtual void Populate() { } public virtual void ApplyConfig(UserConfig config) { Trace.Call(config); if (config == null) { throw new ArgumentNullException("config"); } string bgStr = (string) config["Interface/Chat/BackgroundColor"]; if (!String.IsNullOrEmpty(bgStr)) { try { Color color = ColorTools.GetColor(bgStr); _BackgroundColor = color; _OutputTextView.BackColor = color; } catch (FormatException ex) { #if LOG4NET _Logger.Error("setting background color failed", ex); #endif } } else { _BackgroundColor = null; _OutputTextView.BackColor = Color.Empty; } string fgStr = (string) config["Interface/Chat/ForegroundColor"]; if (!String.IsNullOrEmpty(fgStr)) { try { Color color = ColorTools.GetColor(fgStr); _ForegroundColor = color; _OutputTextView.ForeColor = color; } catch (FormatException ex) { #if LOG4NET _Logger.Error("setting foreground color failed", ex); #endif } } else { _ForegroundColor = null; _OutputTextView.ForeColor = Color.Empty; } string fontFamily = (string) config["Interface/Chat/FontFamily"]; string fontStyle = (string) config["Interface/Chat/FontStyle"]; int fontSize = 0; if (config["Interface/Chat/FontSize"] != null) { fontSize = (int) config["Interface/Chat/FontSize"]; } Font font = null; if (String.IsNullOrEmpty(fontFamily)) { // use Monospace by default float? defaultSize; try { defaultSize = Font.Size; } catch (NullReferenceException) { #if LOG4NET _Logger.Error("could not get default system font size, using internal default"); #endif // Mono bug? defaultSize = 12f; } font = new Font(FontFamily.GenericMonospace, defaultSize.Value); } else { string fontWeigth = null; if (fontStyle.Contains(" ")) { int pos = fontStyle.IndexOf(" "); fontWeigth = fontStyle.Substring(0, pos); fontStyle = fontStyle.Substring(pos + 1); } FontStyle style = (FontStyle) Enum.Parse(typeof(FontStyle), fontStyle); font = new Font(fontFamily, fontSize, style); } _Font = font; _OutputTextView.Font = font; } public virtual void AddMessage(MessageModel msg) { Trace.Call(msg); string timestamp; try { string format = (string)Frontend.UserConfig["Interface/Notebook/TimestampFormat"]; timestamp = msg.TimeStamp.ToLocalTime().ToString(format); } catch (FormatException e) { timestamp = "Timestamp Format ERROR: " + e.Message; } timestamp += " "; _OutputTextView.SelectionHangingIndent = TextRenderer.MeasureText(timestamp, _Font).Width; _OutputTextView.AppendText(timestamp); bool hasHighlight = false; foreach (MessagePartModel msgPart in msg.MessageParts) { #if LOG4NET _Logger.Debug("AddMessage(): msgPart.GetType(): " + msgPart.GetType()); #endif if (msgPart.IsHighlight) { hasHighlight = true; } // TODO: implement all types if (msgPart is UrlMessagePartModel) { UrlMessagePartModel fmsgui = (UrlMessagePartModel) msgPart; /*TODO: Create a link in the TextView (possibly requiring WinAPI hacks...)*/ _OutputTextView.SelectionColor = Color.Blue; _OutputTextView.SelectionFont = new Font(_Font, FontStyle.Underline); _OutputTextView.AppendText(fmsgui.Url); } else if (msgPart is TextMessagePartModel) { /*TODO: Add required formatting to the TextView (possibly requiring WinAPI hacks...)*/ TextMessagePartModel fmsgti = (TextMessagePartModel) msgPart; #if LOG4NET _Logger.Debug("AddMessage(): fmsgti.Text: '" + fmsgti.Text + "'"); #endif FontStyle fstyle = FontStyle.Regular; if (fmsgti.ForegroundColor == TextColor.None) { _OutputTextView.SelectionColor = _ForegroundColor ?? Color.White; } else { #if LOG4NET _Logger.Debug("AddMessage(): fmsgti.ForegroundColor: '" + fmsgti.ForegroundColor.ToString() + "'"); #endif _OutputTextView.SelectionColor = ColorTools.GetColor(fmsgti.ForegroundColor); } if (fmsgti.BackgroundColor == TextColor.None) { _OutputTextView.SelectionBackColor = _BackgroundColor ?? Color.Black; } else { #if LOG4NET _Logger.Debug("AddMessage(): fmsgti.BackgroundColor: '" + fmsgti.BackgroundColor.ToString() + "'"); #endif _OutputTextView.SelectionBackColor = ColorTools.GetColor(fmsgti.BackgroundColor); } if (fmsgti.Underline) { #if LOG4NET _Logger.Debug("AddMessage(): fmsgti.Underline is true"); #endif fstyle |= FontStyle.Underline; } if (fmsgti.Bold) { #if LOG4NET _Logger.Debug("AddMessage(): fmsgti.Bold is true"); #endif fstyle |= FontStyle.Bold; } if (fmsgti.Italic) { #if LOG4NET _Logger.Debug("AddMessage(): fmsgti.Italic is true"); #endif fstyle |= FontStyle.Italic; } _OutputTextView.SelectionFont = new Font(Font, fstyle); _OutputTextView.AppendText(fmsgti.Text); } } _OutputTextView.AppendText("\n"); // HACK: out of scope? if (hasHighlight /*&& !Frontend.MainWindow.HasToplevelFocus*/) { /*TODO: Flash the main window*/ if (Frontend.UserConfig["Sound/BeepOnHighlight"] != null && (bool)Frontend.UserConfig["Sound/BeepOnHighlight"]) { System.Media.SystemSounds.Beep.Play(); } } // HACK: out of scope? if (((TabControl)this.Parent).SelectedTab != this) { string color = null; if (hasHighlight) { _HasHighlight = hasHighlight; color = (string) Frontend.UserConfig["Interface/Notebook/Tab/HighlightColor"]; } else if (!_HasHighlight) { color = (string) Frontend.UserConfig["Interface/Notebook/Tab/ActivityColor"]; } if (color != null) { /*TODO: Color the associated Tab*/ } } } // empty by default public virtual IList Participants { get { return new List(); } } } } smuxi-0.11/src/Frontend-SWF/NotImplementedMessageDialog.cs0000644000175000017500000000270211655545675024325 0ustar00meebeymeebey00000000000000/* * $Id: SplashScreenWindow.cs 122 2006-04-26 19:31:42Z meebey $ * $URL: svn+ssh://SmuxiSVN/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/SplashScreenWindow.cs $ * $Rev: 122 $ * $Author: meebey $ * $Date: 2006-04-26 14:31:42 -0500 (Wed, 26 Apr 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Windows.Forms; using Mono.Unix; namespace Smuxi.Frontend.Swf { public static class NotImplementedMessageDialog { public static void Show() { MessageBox.Show(Catalog.GetString("Sorry, not implemented yet!"), null, MessageBoxButtons.OK, MessageBoxIcon.Information); } } } smuxi-0.11/src/Frontend-SWF/Frontend.cs0000644000175000017500000002102212257043746020516 0ustar00meebeymeebey00000000000000/* * $Id: Frontend.cs 213 2007-09-10 21:25:36Z meebey $ * $URL: svn+ssh://SmuxiSVN/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/Frontend.cs $ * $Rev: 213 $ * $Author: meebey $ * $Date: 2007-09-10 16:25:36 -0500 (Mon, 10 Sep 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using System.Windows.Forms; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend.Swf { public class Frontend { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string _Name = "smuxi"; private static readonly string _UIName = "SWF (WinForms)"; private static Version _Version; private static string _VersionNumber; private static string _VersionString; private static Version _EngineVersion; private static MainWindow _MainWindow; private static FrontendConfig _FrontendConfig; private static Session _Session; private static UserConfig _UserConfig; private static FrontendManager _FrontendManager; private static object _UnhandledExceptionSyncRoot = new Object(); public static string Name { get { return _Name; } } public static string UIName { get { return _UIName; } } public static Version Version { get { return _Version; } } public static Version EngineVersion { get { return _EngineVersion; } set { _EngineVersion = value; } } public static string VersionString { get { return _VersionString; } } public static MainWindow MainWindow { get { return _MainWindow; } } public static Session Session { get { return _Session; } set { _Session = value; } } public static FrontendManager FrontendManager { get { return _FrontendManager; } } public static Config Config { get { return _Session.Config; } } public static UserConfig UserConfig { get { return _UserConfig; } set { _UserConfig = value; } } public static FrontendConfig FrontendConfig { get { return _FrontendConfig; } } public static void Init(string[] args) { System.Threading.Thread.CurrentThread.Name = "Main"; Assembly asm = Assembly.GetAssembly(typeof(Frontend)); AssemblyName asm_name = asm.GetName(false); AssemblyProductAttribute pr = (AssemblyProductAttribute)asm. GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]; _Version = asm_name.Version; _VersionNumber = asm_name.Version.ToString(); _VersionString = pr.Product + " - " + _UIName + " frontend " + _Version; #if LOG4NET _Logger.Info(_VersionString + " starting"); #endif // We don't want to put any XP/Vista users by using the dull ugly // unthemed interface. Application.EnableVisualStyles() should be // called before any form is displayed. Application.EnableVisualStyles(); _MainWindow = new MainWindow(); // HACK: force creation of window handle, else the engine will have problems adding stuff IntPtr handle = _MainWindow.Handle; _FrontendConfig = new FrontendConfig(UIName); // loading and setting defaults _FrontendConfig.Load(); _FrontendConfig.Save(); if (_FrontendConfig.IsCleanConfig) { /*TODO: Create and show first run wizard*/ } else { if (((string)FrontendConfig["Engines/Default"]).Length == 0) { InitLocalEngine(); } else { // there is a default engine set, means we want a remote engine /*TODO: Create and show Engine Manager Dialog*/ // HACK: for now always use local engine InitLocalEngine(); } } /*TODO: Set the main message loop*/ Application.Run(_MainWindow); #if LOG4NET _Logger.Warn("Application.Run() returned!"); #endif } public static void InitLocalEngine() { Engine.Engine.Init(); _EngineVersion = Engine.Engine.Version; _Session = new Engine.Session(Engine.Engine.Config, Engine.Engine.ProtocolManagerFactory, "local"); _Session.RegisterFrontendUI(_MainWindow.UI); _UserConfig = _Session.UserConfig; ConnectEngineToGUI(); } public static void ConnectEngineToGUI() { _FrontendManager = _Session.GetFrontendManager(_MainWindow.UI); _FrontendManager.Sync(); if (_UserConfig.IsCaching) { // when our UserConfig is cached, we need to invalidate the cache _FrontendManager.ConfigChangedDelegate = new SimpleDelegate(_UserConfig.ClearCache); } _MainWindow.Show(); _MainWindow.ApplyConfig(_UserConfig); // make sure entry got attention :-P _MainWindow.Entry.Select(); } public static void DisconnectEngineFromGUI() { Trace.Call(); _FrontendManager.IsFrontendDisconnecting = true; _Session.DeregisterFrontendUI(_MainWindow.UI); _MainWindow.Hide(); _MainWindow.Notebook.RemoveAllPages(); _FrontendManager = null; _Session = null; } public static void Quit() { _MainWindow.Close(); Application.Exit(); if (_FrontendManager != null) { _FrontendManager.IsFrontendDisconnecting = true; } /* BUG: don't do this, the access to config is lost and the entry will throw an exception then. if (_FrontendManager != null) { DisconnectEngineFromGUI(); } */ } public static void ShowException(Form parent, Exception ex) { /* TODO CrashDialog cd = new CrashDialog(parent, ex); cd.Run(); cd.Destroy(); */ } public static void ShowException(Exception ex) { ShowException(null, ex); } /* private static void _OnUnhandledException(GLib.UnhandledExceptionArgs e) { Trace.Call(e); lock (_UnhandledExceptionSyncRoot) { if (e.ExceptionObject is Exception) { ShowException((Exception) e.ExceptionObject); Quit(); } } } */ } } smuxi-0.11/src/Frontend-SWF/smuxi-frontend-swf.in0000644000175000017500000000011711655545675022532 0ustar00meebeymeebey00000000000000#!/bin/sh exec mono "@expanded_libdir@/@PACKAGE@/smuxi-frontend-swf.exe" "$@" smuxi-0.11/src/Frontend-SWF/RichTextBoxEx.cs0000644000175000017500000000237211655545675021457 0ustar00meebeymeebey00000000000000using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; namespace Smuxi.Frontend.Swf { class RichTextBoxEx : RichTextBox { private const int WM_VSCROLL = 0x115; private const int WM_HSCROLL = 0x114; private const int SB_LINEUP = 0; private const int SB_LINEDOWN = 1; private const int SB_PAGEUP = 2; private const int SB_PAGEDOWN = 3; private const int SB_TOP = 6; private const int SB_BOTTOM = 7; public bool CaretEndPosition { get { return SelectionStart == TextLength; } } public RichTextBoxEx() : base() { } private IntPtr SendMessage(int msg, IntPtr wParam, IntPtr lParam) { Message m = new Message(); m.HWnd = Handle; m.Msg = msg; m.WParam = wParam; m.LParam = lParam; WndProc(ref m); return m.Result; } public void ScrollToEnd() { SendMessage(WM_VSCROLL, (IntPtr)SB_BOTTOM, IntPtr.Zero); } public void SetCaretEndPosition() { SelectionStart = TextLength; } } } smuxi-0.11/src/Frontend-SWF/ChangeLog0000644000175000017500000000414411655545675020201 0ustar00meebeymeebey000000000000002008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-08-28 Mirco Bauer * MainWindow.cs, Frontend.cs, Notebook.cs, SplashScreenWindow.designer.cs, SplashScreenWindow.cs, AssemblyInfo.cs, Chats/SessionChatView.cs, Chats/PersonChatView.cs, Chats/NetworkChatView.cs, Chats/GroupChatView.cs, Chats/ChatView.cs, ColorTools.cs, RichTextBoxEx.cs, Entry.cs, NotImplementedMessageDialog.cs: Set eol-style to native and converted files using dos2unix where needed. 2008-08-21 Mirco Bauer * Chats/ChatView.cs: Whitespace fix. * RichTextBoxEx.cs: Coding Standards. 2008-08-21 Mirco Bauer * MainWindow.Designer.cs, Frontend-SWF.mdp, SwfUI.cs, RichTextBoxEx.cs, Entry.cs, NotImplementedMessageDialog.cs: Fixed whitespace (replaced \t with 4 spaces). 2008-08-04 Mirco Bauer * Chats/ChatView.cs: Don't use hardcoded value. * ColorTools.cs: Using HexCode property now. 2008-07-29 Mirco Bauer * MainWindow.cs, Frontend-SWF.mdp, Chats/ChatView.cs, ColorTools.cs, Entry.cs: Implemented theming support for chat page and command entry. 2008-07-29 Mirco Bauer * MainWindow.cs: Fixed indention. Apply theming settings. * Chats/ChatView.cs: Implemented theme support of background and foreground color. * ChatViewManager.cs: Apply theming settings. 2008-07-28 Mirco Bauer * Frontend-SWF.mdp: Build as WinExe. 2008-07-27 Mirco Bauer * Frontend-SWF.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-06-02 Mirco Bauer 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 2008-01-31 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * Frontend-SWF.mdp: Updated using MonoDevelop 0.18.1 smuxi-0.11/src/Frontend-SWF/Makefile.am0000644000175000017500000000726312257043746020457 0ustar00meebeymeebey00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = ../../bin/release/smuxi-frontend-swf.exe ASSEMBLY_MDB = COMPILE_TARGET = winexe PROJECT_REFERENCES = \ ../../bin/release/smuxi-common.dll \ ../../bin/release/smuxi-engine.dll \ ../../bin/release/smuxi-frontend.dll BUILD_DIR = ../../bin/release SMUXI_ENGINE_DLL_MDB= LOG4NET_DLL_SOURCE=../../lib/log4net.dll NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/release/smuxi-engine.dll SMUXI_FRONTEND_DLL_MDB= SMUXI_FRONTEND_DLL_SOURCE=../../bin/release/smuxi-frontend.dll SMUXI_COMMON_DLL_SOURCE=../../bin/release/smuxi-common.dll endif if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" ASSEMBLY = ../../bin/debug/smuxi-frontend-swf.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = exe PROJECT_REFERENCES = \ ../../bin/debug/smuxi-common.dll \ ../../bin/debug/smuxi-engine.dll \ ../../bin/debug/smuxi-frontend.dll BUILD_DIR = ../../bin/debug SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb LOG4NET_DLL_SOURCE=../../lib/log4net.dll NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/debug/smuxi-engine.dll SMUXI_FRONTEND_DLL_MDB_SOURCE=../../bin/debug/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_MDB=$(BUILD_DIR)/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_SOURCE=../../bin/debug/smuxi-frontend.dll SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll endif AL=al2 SATELLITE_ASSEMBLY_NAME=.resources.dll PROGRAMFILES = \ $(SMUXI_ENGINE_DLL_MDB) \ $(LOG4NET_DLL) \ $(NINI_DLL) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_FRONTEND_DLL_MDB) \ $(SMUXI_FRONTEND_DLL) \ $(SMUXI_COMMON_DLL) BINARIES = \ $(FRONTEND_SWF) all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) FILES = \ NotImplementedMessageDialog.cs \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ MainWindow.Designer.cs \ MainWindow.cs \ Notebook.cs \ Entry.cs \ RichTextBoxEx.cs \ Chats/ChatView.cs \ Frontend.cs \ SwfUI.cs \ ChatViewManager.cs \ Chats/GroupChatView.cs \ Main.cs \ Chats/NetworkChatView.cs \ Chats/PersonChatView.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-frontend-swf.in REFERENCES = \ System \ System.Windows.Forms \ System.Drawing \ Mono.Posix \ $(LOG4NET_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) include $(top_srcdir)/Makefile.include LOG4NET_DLL = $(BUILD_DIR)/log4net.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll FRONTEND_SWF = $(BUILD_DIR)/smuxi-frontend-swf SMUXI_FRONTEND_DLL = $(BUILD_DIR)/smuxi-frontend.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-wrapper,FRONTEND_SWF,smuxi-frontend-swf,x)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) smuxi-0.11/src/Frontend-SWF/ChatViewManager.cs0000644000175000017500000000647611655545675021775 0ustar00meebeymeebey00000000000000/* * $Id: ChannelPage.cs 138 2006-12-23 17:11:57Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/ChannelPage.cs $ * $Rev: 138 $ * $Author: meebey $ * $Date: 2006-12-23 18:11:57 +0100 (Sat, 23 Dec 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using System.Globalization; using Mono.Unix; using Smuxi.Common; using Smuxi.Engine; using Smuxi.Frontend; namespace Smuxi.Frontend.Swf { public class ChatViewManager : ChatViewManagerBase { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private List f_Chats = new List(); private Notebook f_Notebook; private UserConfig f_Config; public override IChatView ActiveChat { get { return f_Notebook.CurrentChatView; } } public ChatViewManager(Notebook notebook) { f_Notebook = notebook; } public override void AddChat(ChatModel chat) { ChatView chatView = (ChatView) CreateChatView(chat); f_Chats.Add(chatView); if (f_Config != null) { chatView.ApplyConfig(f_Config); } f_Notebook.TabPages.Add(chatView); } public override void RemoveChat(ChatModel chat) { ChatView chatView = f_Notebook.GetChat(chat); f_Notebook.TabPages.Remove(chatView); f_Chats.Remove(chatView); } public override void EnableChat(ChatModel chat) { ChatView chatView = f_Notebook.GetChat(chat); chatView.Enable(); } public override void DisableChat(ChatModel chat) { ChatView chatView = f_Notebook.GetChat(chat); chatView.Disable(); } public ChatView GetChat(ChatModel chatModel) { return f_Notebook.GetChat(chatModel); } public virtual void ApplyConfig(UserConfig config) { Trace.Call(config); if (config == null) { throw new ArgumentNullException("config"); } f_Config = config; foreach (ChatView chat in f_Chats) { chat.ApplyConfig(f_Config); } } } } smuxi-0.11/src/Frontend-SWF/Notebook.cs0000644000175000017500000001046511655545675020541 0ustar00meebeymeebey00000000000000/* * $Id: Notebook.cs 212 2007-08-23 21:36:44Z meebey $ * $URL: svn+ssh://SmuxiSVN/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/Notebook.cs $ * $Rev: 212 $ * $Author: meebey $ * $Date: 2007-08-23 16:36:44 -0500 (Thu, 23 Aug 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Smuxi.Common; using Smuxi.Engine; using System.Windows.Forms; namespace Smuxi.Frontend.Swf { public class Notebook : TabControl { //private Gtk.Menu _QueryTabMenu; public ChatView CurrentChatView { get { return (ChatView)SelectedTab; } } public Notebook() : base () { Trace.Call(); Selected += _OnSwitchPage; } public void ApplyConfig(UserConfig userConfig) { switch ((string) userConfig["Interface/Notebook/TabPosition"]) { case "top": Alignment = TabAlignment.Top; break; case "bottom": Alignment = TabAlignment.Bottom; break; case "left": Alignment = TabAlignment.Left; break; case "right": Alignment = TabAlignment.Right; break; case "none": //ShowTabs = false; break; } } // BUG: something fishy here, I don't believe the collection contains key // as string and int, see method below. public ChatView GetChat(ChatModel chat) { return (ChatView) Controls[chat.Name]; } public ChatView GetChat(int pageNumber) { return (ChatView) Controls[pageNumber]; } public void RemoveAllPages() { Controls.Clear(); } // events private void _OnSwitchPage(object sender, TabControlEventArgs e) { Trace.Call(sender, e); try { // synchronize FrontManager.CurrenPage ChatView chatView = e.TabPage as ChatView; if (chatView != null) { ChatModel chatModel = chatView.ChatModel; IProtocolManager nmanager = chatModel.ProtocolManager; Frontend.FrontendManager.CurrentChat = chatModel; if (nmanager != null) { Frontend.FrontendManager.CurrentProtocolManager = nmanager; } // even when we have no network manager, we still want to update the state Frontend.FrontendManager.UpdateNetworkStatus(); // lets remove any markup / highlight string color = (string) Frontend.UserConfig["Interface/Notebook/Tab/NoActivityColor"]; // TODO: apply color to tab chatView.HasHighlight = false; // sync title if (Frontend.MainWindow != null) { string network = nmanager != null ? nmanager.ToString() + " / " : ""; Frontend.MainWindow.Text = network + chatView.Text + " - Smuxi"; } } } catch (Exception ex) { Frontend.ShowException(null, ex); } } } } smuxi-0.11/src/Frontend-SWF/AssemblyInfo.cs0000644000175000017500000000272411655545675021353 0ustar00meebeymeebey00000000000000/* * $Id: AssemblyInfo.cs 167 2007-04-17 21:17:37Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/AssemblyInfo.cs $ * $Rev: 167 $ * $Author: meebey $ * $Date: 2007-04-17 23:17:37 +0200 (Tue, 17 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * Copyright (c) 2007-2008 Jeffrey Mann Richardson * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Smuxi - SWF frontend")] [assembly: AssemblyCopyright("2005-2008 (C) Jeffrey Mann Richardson ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] smuxi-0.11/src/Frontend-SWF/Makefile.in0000644000175000017500000010410712311344230020442 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/smuxi-frontend-swf.in \ ChangeLog subdir = src/Frontend-SWF ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = smuxi-frontend-swf CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ # Warning: This is an automatically generated file, do not edit! @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/debug/smuxi-frontend-swf.exe @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/release/smuxi-frontend-swf.exe @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = exe @ENABLE_RELEASE_TRUE@COMPILE_TARGET = winexe @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-common.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-engine.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-frontend.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-common.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-engine.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-frontend.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin/debug @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin/release @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB = $(BUILD_DIR)/smuxi-engine.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_MDB = @ENABLE_DEBUG_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_RELEASE_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_DEBUG_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_RELEASE_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/debug/smuxi-engine.dll @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/release/smuxi-engine.dll @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_DLL_MDB = $(BUILD_DIR)/smuxi-frontend.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_FRONTEND_DLL_MDB = @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_DLL_SOURCE = ../../bin/debug/smuxi-frontend.dll @ENABLE_RELEASE_TRUE@SMUXI_FRONTEND_DLL_SOURCE = ../../bin/release/smuxi-frontend.dll @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/release/smuxi-common.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB_SOURCE = ../../bin/debug/smuxi-engine.dll.mdb @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_DLL_MDB_SOURCE = ../../bin/debug/smuxi-frontend.dll.mdb AL = al2 SATELLITE_ASSEMBLY_NAME = .resources.dll PROGRAMFILES = \ $(SMUXI_ENGINE_DLL_MDB) \ $(LOG4NET_DLL) \ $(NINI_DLL) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_FRONTEND_DLL_MDB) \ $(SMUXI_FRONTEND_DLL) \ $(SMUXI_COMMON_DLL) BINARIES = \ $(FRONTEND_SWF) FILES = \ NotImplementedMessageDialog.cs \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ MainWindow.Designer.cs \ MainWindow.cs \ Notebook.cs \ Entry.cs \ RichTextBoxEx.cs \ Chats/ChatView.cs \ Frontend.cs \ SwfUI.cs \ ChatViewManager.cs \ Chats/GroupChatView.cs \ Main.cs \ Chats/NetworkChatView.cs \ Chats/PersonChatView.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-frontend-swf.in REFERENCES = \ System \ System.Windows.Forms \ System.Drawing \ Mono.Posix \ $(LOG4NET_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) $(ASSEMBLY) $(ASSEMBLY).mdb \ $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) LOG4NET_DLL = $(BUILD_DIR)/log4net.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll FRONTEND_SWF = $(BUILD_DIR)/smuxi-frontend-swf SMUXI_FRONTEND_DLL = $(BUILD_DIR)/smuxi-frontend.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Frontend-SWF/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Frontend-SWF/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): smuxi-frontend-swf: $(top_builddir)/config.status $(srcdir)/smuxi-frontend-swf.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-wrapper,FRONTEND_SWF,smuxi-frontend-swf,x)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Frontend-SWF/SwfUI.cs0000644000175000017500000002160011655545675017747 0ustar00meebeymeebey00000000000000/* * $Id: GnomeUI.cs 213 2007-09-10 21:25:36Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/GnomeUI.cs $ * $Rev: 213 $ * $Author: meebey $ * $Date: 2007-09-10 23:25:36 +0200 (Mon, 10 Sep 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Reflection; using SysDiag = System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.ComponentModel; using System.Windows.Forms; using Mono.Unix; using Smuxi.Common; using Smuxi.Engine; using Smuxi.Frontend; namespace Smuxi.Frontend.Swf { public class SwfUI : PermanentRemoteObject, IFrontendUI { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private int _Version = 0; private ChatViewManager _ChatViewManager; private IList _SyncedChatViews; private Control _Control; public int Version { get { return _Version; } } public IList SyncedChatViews { get { return _SyncedChatViews; } } public SwfUI(ChatViewManager chatViewManager, Control control) { _ChatViewManager = chatViewManager; _Control = control; } public void AddChat(ChatModel chat) { TraceRemotingCall(chat); MethodBase mb = Trace.GetMethodBase(); _Control.Invoke(new MethodInvoker(delegate { TraceRemotingCall(mb, chat); _ChatViewManager.AddChat(chat); })); } private void _AddMessageToChat(ChatModel epage, MessageModel msg) { ChatView chatView = _ChatViewManager.GetChat(epage); #if LOG4NET if (chatView == null) { _Logger.Fatal(String.Format("_AddMessageToChat(): Notebook.GetPage(epage) epage.Name: {0} returned null!", epage.Name)); return; } #endif chatView.AddMessage(msg); } public void AddMessageToChat(ChatModel epage, MessageModel fmsg) { TraceRemotingCall(epage, fmsg); MethodBase mb = Trace.GetMethodBase(); _Control.Invoke(new MethodInvoker(delegate { TraceRemotingCall(mb, epage, fmsg); _AddMessageToChat(epage, fmsg); })); } public void RemoveChat(ChatModel chat) { TraceRemotingCall(chat); MethodBase mb = Trace.GetMethodBase(); _Control.Invoke(new MethodInvoker(delegate { TraceRemotingCall(mb, chat); _ChatViewManager.RemoveChat(chat); })); } public void EnableChat(ChatModel chat) { TraceRemotingCall(chat); MethodBase mb = Trace.GetMethodBase(); _Control.Invoke(new MethodInvoker(delegate { TraceRemotingCall(mb, chat); _ChatViewManager.EnableChat(chat); })); } public void DisableChat(ChatModel chat) { TraceRemotingCall(chat); MethodBase mb = Trace.GetMethodBase(); _Control.Invoke(new MethodInvoker(delegate { TraceRemotingCall(mb, chat); _ChatViewManager.DisableChat(chat); })); } public void SyncChat(ChatModel chatModel) { TraceRemotingCall(chatModel); MethodBase mb = Trace.GetMethodBase(); _Control.Invoke(new MethodInvoker(delegate { TraceRemotingCall(mb, chatModel); ChatView chatView = _ChatViewManager.GetChat(chatModel); #if LOG4NET DateTime syncStart = DateTime.UtcNow; #endif chatView.Sync(); #if LOG4NET DateTime syncStop = DateTime.UtcNow; double duration = syncStop.Subtract(syncStart).TotalMilliseconds; _Logger.Debug("SyncChat() done, syncing took: " + Math.Round(duration) + " ms"); #endif // maybe a BUG here? should be tell the FrontendManager before we sync? Frontend.FrontendManager.AddSyncedChat(chatModel); //_SyncedChats.Add(chatView); // BUG: doesn't work?!? chatView.ScrollToEnd(); })); } public void AddPersonToGroupChat(GroupChatModel groupChat, PersonModel person) { TraceRemotingCall(groupChat, person); MethodBase mb = Trace.GetMethodBase(); _Control.Invoke(new MethodInvoker(delegate { TraceRemotingCall(mb, groupChat, person); GroupChatView groupChatView = (GroupChatView) _ChatViewManager.GetChat(groupChat); groupChatView.AddPerson(person); })); } public void UpdatePersonInGroupChat(GroupChatModel groupChat, PersonModel oldPerson, PersonModel newPerson) { TraceRemotingCall(groupChat, oldPerson, newPerson); MethodBase mb = Trace.GetMethodBase(); _Control.Invoke(new MethodInvoker(delegate { TraceRemotingCall(mb, groupChat, oldPerson, newPerson); GroupChatView groupChatView = (GroupChatView) _ChatViewManager.GetChat(groupChat); groupChatView.UpdatePerson(oldPerson, newPerson); })); } public void UpdateTopicInGroupChat(GroupChatModel ecpage, MessageModel topic) { TraceRemotingCall(ecpage, topic); MethodBase mb = Trace.GetMethodBase(); _Control.Invoke(new MethodInvoker(delegate { TraceRemotingCall(mb, ecpage, topic); /* GroupChatView cpage = (GroupChatView)Frontend.MainWindow.Notebook.GetChat(ecpage); if (cpage.TopicEntry != null) { cpage.TopicEntry.Text = topic; } */ })); } public void RemovePersonFromGroupChat(GroupChatModel groupChat, PersonModel person) { TraceRemotingCall(groupChat, person); MethodBase mb = Trace.GetMethodBase(); _Control.Invoke(new MethodInvoker(delegate { TraceRemotingCall(mb, groupChat, person); GroupChatView groupChatView = (GroupChatView) _ChatViewManager.GetChat(groupChat); groupChatView.RemovePerson(person); })); } public void SetNetworkStatus(string status) { TraceRemotingCall(status); MethodBase mb = Trace.GetMethodBase(); _Control.Invoke(new MethodInvoker(delegate { TraceRemotingCall(mb, status); Frontend.MainWindow.NetworkStatusbar.Text = status; })); } public void SetStatus(string status) { TraceRemotingCall(status); MethodBase mb = Trace.GetMethodBase(); _Control.Invoke(new MethodInvoker(delegate { TraceRemotingCall(mb, status); Frontend.MainWindow.Statusbar.Text = status; })); } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } [SysDiag.Conditional("REMOTING_TRACE")] protected static void TraceRemotingCall(MethodBase mb, params object[] parameters) { Trace.Call(mb, parameters); } [SysDiag.Conditional("REMOTING_TRACE")] protected static void TraceRemotingCall(params object[] parameters) { TraceRemotingCall(Trace.GetMethodBase(), parameters); } } } smuxi-0.11/src/Frontend-SWF/MainWindow.Designer.cs0000644000175000017500000003104511655545675022571 0ustar00meebeymeebey00000000000000namespace Smuxi.Frontend.Swf { partial class MainWindow { /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { System.Windows.Forms.MenuStrip menuStrip1; System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; System.Windows.Forms.ToolStripMenuItem preferencesToolStripMenuItem; System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem; System.Windows.Forms.ToolStripMenuItem caretModeToolStripMenuItem; System.Windows.Forms.ToolStripMenuItem engineToolStripMenuItem; System.Windows.Forms.ToolStripMenuItem useLocalEngineToolStripMenuItem; System.Windows.Forms.ToolStripMenuItem addRemoteEngineToolStripMenuItem; System.Windows.Forms.ToolStripMenuItem switchRemoteEngineToolStripMenuItem; System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this._Statusbar = new System.Windows.Forms.ToolStripStatusLabel(); this._NetworkStatusbar = new System.Windows.Forms.ToolStripStatusLabel(); this._ProgressBar = new System.Windows.Forms.ToolStripProgressBar(); this._Notebook = new Smuxi.Frontend.Swf.Notebook(); this._Entry = new Smuxi.Frontend.Swf.Entry(); menuStrip1 = new System.Windows.Forms.MenuStrip(); fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); caretModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); engineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); useLocalEngineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); addRemoteEngineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); switchRemoteEngineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); menuStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // // menuStrip1 // menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { fileToolStripMenuItem, viewToolStripMenuItem, engineToolStripMenuItem, helpToolStripMenuItem}); menuStrip1.Location = new System.Drawing.Point(0, 0); menuStrip1.Name = "menuStrip1"; menuStrip1.Size = new System.Drawing.Size(784, 24); menuStrip1.TabIndex = 0; menuStrip1.Text = "menuStrip1"; // // fileToolStripMenuItem // fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { preferencesToolStripMenuItem, toolStripMenuItem1, exitToolStripMenuItem}); fileToolStripMenuItem.Name = "fileToolStripMenuItem"; fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); fileToolStripMenuItem.Text = "&File"; // // preferencesToolStripMenuItem // preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem"; preferencesToolStripMenuItem.Size = new System.Drawing.Size(152, 22); preferencesToolStripMenuItem.Text = "&Preferences..."; // // toolStripMenuItem1 // toolStripMenuItem1.Name = "toolStripMenuItem1"; toolStripMenuItem1.Size = new System.Drawing.Size(149, 6); // // exitToolStripMenuItem // exitToolStripMenuItem.Name = "exitToolStripMenuItem"; exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q))); exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); exitToolStripMenuItem.Text = "E&xit"; // // viewToolStripMenuItem // viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { caretModeToolStripMenuItem}); viewToolStripMenuItem.Name = "viewToolStripMenuItem"; viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20); viewToolStripMenuItem.Text = "&View"; // // caretModeToolStripMenuItem // caretModeToolStripMenuItem.CheckOnClick = true; caretModeToolStripMenuItem.Name = "caretModeToolStripMenuItem"; caretModeToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F7; caretModeToolStripMenuItem.Size = new System.Drawing.Size(155, 22); caretModeToolStripMenuItem.Text = "&Caret Mode"; // // engineToolStripMenuItem // engineToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { useLocalEngineToolStripMenuItem, addRemoteEngineToolStripMenuItem, switchRemoteEngineToolStripMenuItem}); engineToolStripMenuItem.Name = "engineToolStripMenuItem"; engineToolStripMenuItem.Size = new System.Drawing.Size(55, 20); engineToolStripMenuItem.Text = "&Engine"; // // useLocalEngineToolStripMenuItem // useLocalEngineToolStripMenuItem.Name = "useLocalEngineToolStripMenuItem"; useLocalEngineToolStripMenuItem.Size = new System.Drawing.Size(192, 22); useLocalEngineToolStripMenuItem.Text = "&Use Local Engine"; // // addRemoteEngineToolStripMenuItem // addRemoteEngineToolStripMenuItem.Name = "addRemoteEngineToolStripMenuItem"; addRemoteEngineToolStripMenuItem.Size = new System.Drawing.Size(192, 22); addRemoteEngineToolStripMenuItem.Text = "&Add Remote Engine"; // // switchRemoteEngineToolStripMenuItem // switchRemoteEngineToolStripMenuItem.Name = "switchRemoteEngineToolStripMenuItem"; switchRemoteEngineToolStripMenuItem.Size = new System.Drawing.Size(192, 22); switchRemoteEngineToolStripMenuItem.Text = "&Switch Remote Engine"; // // helpToolStripMenuItem // helpToolStripMenuItem.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { aboutToolStripMenuItem}); helpToolStripMenuItem.Name = "helpToolStripMenuItem"; helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); helpToolStripMenuItem.Text = "&Help"; // // aboutToolStripMenuItem // aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); aboutToolStripMenuItem.Text = "&About"; // // statusStrip1 // this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this._NetworkStatusbar, this._Statusbar, this._ProgressBar}); this.statusStrip1.Location = new System.Drawing.Point(0, 540); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new System.Drawing.Size(784, 24); this.statusStrip1.TabIndex = 1; this.statusStrip1.Text = "statusStrip1"; // // _Statusbar // this._Statusbar.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); this._Statusbar.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenInner; this._Statusbar.Name = "_Statusbar"; this._Statusbar.Size = new System.Drawing.Size(318, 19); this._Statusbar.Spring = true; this._Statusbar.Text = "Status"; this._Statusbar.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // _NetworkStatusbar // this._NetworkStatusbar.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); this._NetworkStatusbar.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenInner; this._NetworkStatusbar.Name = "_NetworkStatusbar"; this._NetworkStatusbar.Size = new System.Drawing.Size(318, 19); this._NetworkStatusbar.Spring = true; this._NetworkStatusbar.Text = "NetworkStatus"; this._NetworkStatusbar.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // _ProgressBar // this._ProgressBar.Name = "_ProgressBar"; this._ProgressBar.Size = new System.Drawing.Size(100, 18); // // _Notebook // this._Notebook.Dock = System.Windows.Forms.DockStyle.Fill; this._Notebook.Location = new System.Drawing.Point(0, 24); this._Notebook.Name = "_Notebook"; this._Notebook.SelectedIndex = 0; this._Notebook.Size = new System.Drawing.Size(784, 496); this._Notebook.TabIndex = 2; // // _Entry // this._Entry.Dock = System.Windows.Forms.DockStyle.Bottom; this._Entry.Location = new System.Drawing.Point(0, 520); this._Entry.Name = "_Entry"; this._Entry.Size = new System.Drawing.Size(784, 20); this._Entry.TabIndex = 3; // // MainWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(784, 564); this.Controls.Add(this._Notebook); this.Controls.Add(this._Entry); this.Controls.Add(this.statusStrip1); this.Controls.Add(menuStrip1); this.MainMenuStrip = menuStrip1; this.Name = "MainWindow"; this.Text = "Smuxi - Smart MUltipleXed Irc"; menuStrip1.ResumeLayout(false); menuStrip1.PerformLayout(); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.StatusStrip statusStrip1; private System.Windows.Forms.ToolStripStatusLabel _Statusbar; private System.Windows.Forms.ToolStripStatusLabel _NetworkStatusbar; private System.Windows.Forms.ToolStripProgressBar _ProgressBar; } }smuxi-0.11/src/AssemblyVersion.cs.in0000644000175000017500000000237211655545675020275 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyDescription("Smart MUltipleXed Irc")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("qNETp")] [assembly: AssemblyProduct("Smuxi")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("@VERSION@")] smuxi-0.11/src/Frontend/0000755000175000017500000000000012311344240015736 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend/NickCompleter.cs0000644000175000017500000001153112253423337021037 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2013 Mirco Bauer * Copyright (c) 2013 Ondra Hosek * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using Smuxi.Engine; namespace Smuxi.Frontend { /// /// Automatically completes nicknames (e.g. when the user presses the Tab key). /// public abstract class NickCompleter { public string CompletionChar = ":"; /// /// Isolates the nickname that should be completed. /// /// The isolated nickname. /// The text currently typed into the input text box. /// The current location of the cursor in the input text box. /// Stores where the isolated nickname begins in the entered text. /// Whether to append a space when the nickname is completed. /// Whether the nickname started with a leading @ (which was stripped away). protected static string IsolateNickToComplete(string entryLine, int cursorPosition, out int nickBeginning, out bool appendSpace, out bool leadingAt) { string ret; int prev_space = entryLine.Substring(0, cursorPosition).LastIndexOf(' '); int next_space = entryLine.IndexOf(' ', cursorPosition); appendSpace = false; if (prev_space == -1 && next_space == -1) { // no spaces (the nick is the only thing) nickBeginning = 0; appendSpace = true; ret = entryLine; } else if (prev_space == -1) { nickBeginning = 0; ret = entryLine.Substring(0, next_space); } else if (next_space == -1) { nickBeginning = prev_space + 1; appendSpace = true; ret = entryLine.Substring(nickBeginning); } else { nickBeginning = prev_space + 1; ret = entryLine.Substring(prev_space + 1, next_space - prev_space - 1); } leadingAt = false; if (ret.StartsWith("@")) { leadingAt = true; ++nickBeginning; ret = ret.Substring(1); } return ret; } /// /// Returns a list containing only the nicknames matching the given prefix. /// /// /// The list of nicknames matching the given prefix. /// /// /// List of people to enumerate. The ordering will be taken over verbatim. /// /// Prefix of nicknames to return. protected static IList NicksMatchingPrefix(IList persons, string prefix) { var ret = new List(); string lowerPfx = prefix.ToLower(); foreach (PersonModel person in persons) { string nick = person.IdentityName; if (nick.ToLower().StartsWith(lowerPfx)) { ret.Add(nick); } } return ret; } /// /// Performs nickname tab completion on the specified input. /// /// The text currently typed into the input text box. /// /// The current location of the cursor in the input text box. Equal to the index of the /// character after the current cursor position. /// /// /// The current chat view. The list of participants is fetched from it; the completer may /// also append messages to the chat to provide further information. /// abstract public void Complete(ref string entryLine, ref int cursorPosition, IChatView currentChatView); } } smuxi-0.11/src/Frontend/TabCycleNickCompleter.cs0000644000175000017500000001212512250426634022446 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2013 Mirco Bauer * Copyright (c) 2013 Ondra Hosek * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; namespace Smuxi.Frontend { /// /// Tab Cycle (irssi-style) nick completer. /// /// /// When triggered, the first nickname matching the input characters is /// completed. If triggered again at the same position, the match is /// replaced by the next nickname. /// public class TabCycleNickCompleter : NickCompleter { IList PreviousNicks { get; set; } int PreviousNickIndex { get; set; } int PreviousMatchPos { get; set; } int PreviousMatchLength { get; set; } int PreviousMatchCursorOffset { get; set; } // offset from match pos + match len IChatView PreviousChatView { get; set; } public TabCycleNickCompleter() { PreviousNicks = null; PreviousNickIndex = -1; PreviousMatchPos = -1; PreviousMatchLength = -1; PreviousMatchCursorOffset = 0; PreviousChatView = null; } public override void Complete(ref string entryLine, ref int cursorPosition, IChatView currentChatView) { // isolate the nick to complete int matchPosition; bool appendSpace, leadingAt; string matchMe = IsolateNickToComplete(entryLine, cursorPosition, out matchPosition, out appendSpace, out leadingAt); int rematchCursorPosition = PreviousMatchPos + PreviousMatchLength + PreviousMatchCursorOffset; if (PreviousNickIndex != -1 && currentChatView == PreviousChatView && cursorPosition == rematchCursorPosition) { // re-match PreviousNickIndex = (PreviousNickIndex + 1) % PreviousNicks.Count; string nick = PreviousNicks [PreviousNickIndex]; string prefix = entryLine.Substring(0, PreviousMatchPos); string suffix = entryLine.Substring(PreviousMatchPos + PreviousMatchLength); PreviousMatchLength = nick.Length; entryLine = prefix + nick + suffix; cursorPosition = PreviousMatchPos + PreviousMatchLength + PreviousMatchCursorOffset; return; } // don't re-match even if the user moves the cursor back to the "correct" position PreviousNickIndex = -1; // don't complete empty strings if (matchMe.Length == 0) { return; } bool appendCompletionChar = (matchPosition == 0); int additionalSteps = 0; // find the matching nicknames IList nicks = NicksMatchingPrefix(currentChatView.Participants, matchMe); if (nicks.Count == 0) { // no matches; do nothing return; } else { // bingo! string nick = nicks [0]; // store the new values for the next completion PreviousNicks = nicks; PreviousNickIndex = 0; PreviousMatchPos = matchPosition; PreviousMatchLength = nick.Length; PreviousChatView = currentChatView; // suppress the completion character if we had an @ if (leadingAt) { appendCompletionChar = false; } // find the beginning and end of the string string prefix = entryLine.Substring(0, matchPosition); string suffix = entryLine.Substring(matchPosition + matchMe.Length); // append the completion character and a space, if requested if (appendSpace) { suffix = ' ' + suffix; ++additionalSteps; } if (appendCompletionChar) { suffix = CompletionChar + suffix; ++additionalSteps; } // assemble the line and move the cursor entryLine = prefix + nick + suffix; cursorPosition = matchPosition + nick.Length + additionalSteps; PreviousMatchCursorOffset = additionalSteps; } } } } smuxi-0.11/src/Frontend/ChatViewSyncManager.cs0000644000175000017500000002774212253423337022155 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011, 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Threading; using System.Runtime.Remoting; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend { public class ChatViewSyncManager { #if LOG4NET private static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif ThreadPoolQueue WorkerQueue { set; get; } Dictionary SyncWaitQueue { set; get; } Dictionary SyncReleaseQueue { set; get; } public event EventHandler ChatAdded; public event EventHandler ChatSynced; public event EventHandler WorkerException; public ChatViewSyncManager() { WorkerQueue = new ThreadPoolQueue() { MaxWorkers = 4 }; SyncWaitQueue = new Dictionary(); SyncReleaseQueue = new Dictionary(); } public void Add(ChatModel chatModel) { Trace.Call(chatModel); if (chatModel == null) { throw new ArgumentNullException("chatModel"); } #if LOG4NET DateTime start = DateTime.UtcNow; #endif // REMOTING CALL 1 var chatId = chatModel.ID; // REMOTING CALL 2 var chatType = chatModel.ChatType; // REMOTING CALL 3 var chatPosition = chatModel.Position; // REMOTING CALL 4 IProtocolManager protocolManager = chatModel.ProtocolManager; Type protocolManagerType = null; if (protocolManager != null) { protocolManagerType = protocolManager.GetType(); } #if LOG4NET DateTime stop = DateTime.UtcNow; double duration = stop.Subtract(start).TotalMilliseconds; Logger.Debug("Add() done, syncing took: " + Math.Round(duration) + " ms"); #endif OnChatAdded(chatModel, chatId, chatType, chatPosition, protocolManager, protocolManagerType); } /// /// This method is thread safe. /// public void Remove(ChatModel chatModel) { Trace.Call(chatModel); if (chatModel == null) { throw new ArgumentNullException("chatModel"); } var chatKey = GetChatKey(chatModel); #if LOG4NET Logger.DebugFormat("Remove() <{0}> removing from release queue", chatKey); #endif lock (SyncReleaseQueue) { SyncReleaseQueue.Remove(chatKey); } } public void Sync(IChatView chatView) { Trace.Call(chatView); if (chatView == null) { throw new ArgumentNullException("chatView"); } #if LOG4NET DateTime start = DateTime.UtcNow; #endif chatView.Sync(); #if LOG4NET DateTime stop = DateTime.UtcNow; double duration = stop.Subtract(start).TotalMilliseconds; Logger.Debug("Sync() <" + chatView.ID + ">.Sync() done, " + " syncing took: " + Math.Round(duration) + " ms"); #endif OnChatSynced(chatView); } /// /// This method is thread safe. /// public void QueueAdd(ChatModel chatModel) { Trace.Call(chatModel); if (chatModel == null) { throw new ArgumentNullException("chatModel"); } var chatKey = GetChatKey(chatModel); lock (SyncWaitQueue) { SyncWaitQueue.Add(chatKey, new AutoResetEvent(false)); #if LOG4NET Logger.Debug("QueueAdd() <" + chatKey + "> created sync lock"); #endif } WorkerQueue.Enqueue(delegate { AddWorker(chatModel); }); } /// /// This method is thread safe. /// public void QueueSync(ChatModel chatModel) { Trace.Call(chatModel); if (chatModel == null) { throw new ArgumentNullException("chatModel"); } WorkerQueue.Enqueue(delegate { SyncWorker(chatModel); }); } /// /// This method is thread safe. /// public void ReleaseSync(IChatView chatView) { Trace.Call(chatView); if (chatView == null) { throw new ArgumentNullException("chatView"); } var chatKey = GetChatKey(chatView.ChatModel); #if LOG4NET Logger.Debug("ReleaseSync() <" + chatKey + "> releasing " + "<" + chatView.ID + ">"); #endif lock (SyncReleaseQueue) { SyncReleaseQueue.Add(chatKey, chatView); } AutoResetEvent syncWait = null; lock (SyncWaitQueue) { SyncWaitQueue.TryGetValue(chatKey, out syncWait); } if (syncWait == null) { #if LOG4NET Logger.Error("ReleaseSync(<" + chatView.ID + ">): failed to release " + "<" + chatKey + "> as syncWait is null!"); #endif return; } // release the sync worker syncWait.Set(); } public void Clear() { Trace.Call(); lock (SyncWaitQueue) lock (SyncReleaseQueue) { SyncWaitQueue.Clear(); SyncReleaseQueue.Clear(); } } object GetChatKey(ChatModel chatModel) { if (RemotingServices.IsTransparentProxy(chatModel)) { // HACK: we can't use ChatModel as Dictionary as it is // a remoting object return RemotingServices.GetObjectUri(chatModel); } return chatModel; } void AddWorker(ChatModel chatModel) { try { Add(chatModel); } catch (Exception ex) { #if LOG4NET Logger.Error("AddWorker(): Add() threw exception!" , ex); #endif if (WorkerException != null) { WorkerException( this, new WorkerExceptionEventArgs(chatModel, ex) ); } OnWorkerException(chatModel, ex); } } void SyncWorker(ChatModel chatModel) { try { var chatKey = GetChatKey(chatModel); AutoResetEvent syncWait = null; lock (SyncWaitQueue) { SyncWaitQueue.TryGetValue(chatKey, out syncWait); } if (syncWait != null) { #if LOG4NET Logger.Debug("SyncWorker() <" + chatKey + "> waiting for " + "sync lock release..."); #endif // This chat was queued by QueueAdd() thus we need to wait // till the ChatView is created and ready to be synced syncWait.WaitOne(); #if LOG4NET Logger.Debug("SyncWorker() <" + chatKey + "> " + "sync lock released"); #endif // no longer need the sync lock lock (SyncWaitQueue) { SyncWaitQueue.Remove(chatKey); } } IChatView chatView = null; lock (SyncReleaseQueue) { if (!SyncReleaseQueue.TryGetValue(chatKey, out chatView)) { #if LOG4NET Logger.Warn("SyncWorker(): chatView is null! " + "probably a reconnect, bailing out..."); #endif return; } // no longer need the release slot // BUG: this breaks re-syncing an existing chat! For that // reason the frontend _must_ notify us via Remove() if the // chat sync state is no longer needed //SyncReleaseQueue.Remove(chatKey); } Sync(chatView); } catch (Exception ex) { #if LOG4NET Logger.Error("SyncWorker(): Exception!", ex); #endif OnWorkerException(chatModel, ex); } } void OnChatAdded(ChatModel chatModel, string chatId, ChatType chatType, int chatPosition, IProtocolManager protocolManager, Type protocolManagerType) { if (ChatAdded != null) { ChatAdded(this, new ChatViewAddedEventArgs(chatModel, chatId, chatType, chatPosition, protocolManager, protocolManagerType)); } } void OnChatSynced(IChatView chatView) { if (ChatSynced != null) { ChatSynced(this, new ChatViewSyncedEventArgs(chatView)); } } void OnWorkerException(ChatModel chatModel, Exception ex) { if (WorkerException != null) { WorkerException( this, new WorkerExceptionEventArgs(chatModel, ex) ); } } } public class ChatViewAddedEventArgs : EventArgs { public ChatModel ChatModel { get; private set; } public string ChatID { get; private set; } public ChatType ChatType { get; private set; } public int ChatPosition { get; private set; } public IProtocolManager ProtocolManager { get; private set; } public Type ProtocolManagerType { get; private set; } public ChatViewAddedEventArgs(ChatModel chatModel, string chatId, ChatType chatType, int chatPosition, IProtocolManager protocolManager, Type protocolManagerType) { ChatModel = chatModel; ChatID = chatId; ChatType = chatType; ChatPosition = chatPosition; ProtocolManager = protocolManager; ProtocolManagerType = protocolManagerType; } } public class ChatViewSyncedEventArgs : EventArgs { public IChatView ChatView { get; private set; } public ChatViewSyncedEventArgs(IChatView chatView) { ChatView = chatView; } } public class WorkerExceptionEventArgs : EventArgs { public ChatModel ChatModel { get; private set; } public Exception Exception { get; private set; } public WorkerExceptionEventArgs(ChatModel chat, Exception ex) { ChatModel = chat; Exception = ex; } } } smuxi-0.11/src/Frontend/IChatView.cs0000644000175000017500000000320212250426634020117 0ustar00meebeymeebey00000000000000/* * $Id: AboutDialog.cs 122 2006-04-26 19:31:42Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/AboutDialog.cs $ * $Rev: 122 $ * $Author: meebey $ * $Date: 2006-04-26 21:31:42 +0200 (Wed, 26 Apr 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using Smuxi.Engine; namespace Smuxi.Frontend { public interface IChatView { ChatModel ChatModel { get; } string ID { get; } int Position { get; } IList Participants { get; } void Enable(); void Disable(); void Sync(); void Populate(); void ScrollUp(); void ScrollDown(); void ScrollToStart(); void ScrollToEnd(); void AddMessage(MessageModel msg); } } smuxi-0.11/src/Frontend/SshTunnelManager.cs0000644000175000017500000005364412300201464021515 0ustar00meebeymeebey00000000000000// $Id$ // // Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2009 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.IO; using System.Net; using System.Net.Sockets; using System.Text.RegularExpressions; using System.Reflection; using SysDiag = System.Diagnostics; using Smuxi.Common; namespace Smuxi.Frontend { public class SshTunnelManager : IDisposable { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string f_LibraryTextDomain = "smuxi-frontend"; private SysDiag.Process f_Process; private SysDiag.ProcessStartInfo f_ProcessStartInfo; private string f_Program; private string f_Parameters; private string f_Username; private string f_Password; private string f_Keyfile; private string f_Hostname; private int f_Port = -1; private string f_ForwardBindAddress; private int f_ForwardBindPort; private string f_ForwardHostName; private int f_ForwardHostPort; private string f_BackwardBindAddress; private int f_BackwardBindPort; private string f_BackwardHostName; private int f_BackwardHostPort; public SshTunnelManager(string program, string parameters, string username, string password, string keyfile, string hostname, int port, string forwardBindAddress, int forwardBindPort, string forwardHostName, int forwardHostPort, string backwardBindAddress, int backwardBindPort, string backwardHostName, int backwardHostPort) { Trace.Call(program, parameters, username, "XXX", keyfile, hostname, port, forwardBindAddress, forwardBindPort, forwardHostName, forwardHostPort, backwardBindAddress, backwardBindPort, backwardHostName, backwardHostPort); if (hostname == null) { throw new ArgumentNullException("hostname"); } if (forwardBindAddress == null) { throw new ArgumentNullException("forwardBindAddress"); } if (forwardHostName == null) { throw new ArgumentNullException("forwardHostName"); } if (backwardBindAddress == null) { throw new ArgumentNullException("backwardBindAddress"); } if (backwardHostName == null) { throw new ArgumentNullException("backwardHostName"); } f_Program = program; f_Parameters = parameters; f_Username = username; f_Password = password; f_Keyfile = keyfile; f_Hostname = hostname; f_Port = port; f_ForwardBindAddress = forwardBindAddress; f_ForwardBindPort = forwardBindPort; f_ForwardHostName = forwardHostName; f_ForwardHostPort = forwardHostPort; f_BackwardBindAddress = backwardBindAddress; f_BackwardBindPort = backwardBindPort; f_BackwardHostName = backwardHostName; f_BackwardHostPort = backwardHostPort; } ~SshTunnelManager() { Trace.Call(); Dispose(false); } public void Dispose() { Trace.Call(); Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { Trace.Call(disposing); if (f_Process != null) { f_Process.Dispose(); } } public void Setup() { Trace.Call(); if (String.IsNullOrEmpty(f_Program)) { // use plink by default if it's there var location = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); var plinkPath = Path.Combine(location, "plink.exe"); if (File.Exists(plinkPath)) { f_Program = plinkPath; } else { // TODO: find ssh f_Program = "/usr/bin/ssh"; } } if (!File.Exists(f_Program)) { throw new ApplicationException(_("SSH client application was not found: " + f_Program)); } if (f_Program.ToLower().EndsWith("putty.exe")) { throw new ApplicationException(_("SSH client must be either OpenSSH (ssh) or Plink (plink.exe, not putty.exe)")); } bool isPutty = false; if (f_Program.ToLower().EndsWith("plink.exe")) { isPutty = true; } if (isPutty) { f_ProcessStartInfo = CreatePlinkProcessStartInfo(); } else { f_ProcessStartInfo = CreateOpenSshProcessStartInfo(); } // make sure the tunnel is killed when smuxi is quitting // BUG: this will not kill the tunnel if Smuxi was killed using a // process signal like SIGTERM! Not sure how to handle that case... System.AppDomain.CurrentDomain.ProcessExit += delegate { #if LOG4NET f_Logger.Debug("Setup(): our process is exiting, let's dispose!"); #endif Dispose(); }; } public void Connect() { Trace.Call(); #if LOG4NET f_Logger.Debug("Connect(): checking if local forward port is free..."); #endif using (TcpClient tcpClient = new TcpClient()) { try { tcpClient.Connect(f_ForwardBindAddress, f_ForwardBindPort); // the connect worked, panic! var msg = String.Format( _("The local SSH forwarding port {0} is already in " + "use. Is there an old SSH tunnel still active?"), f_ForwardBindPort ); throw new ApplicationException(msg); } catch (SocketException) { } } #if LOG4NET f_Logger.Debug("Connect(): setting up ssh tunnel using command: " + f_ProcessStartInfo.FileName + " " + f_ProcessStartInfo.Arguments); #endif f_Process = SysDiag.Process.Start(f_ProcessStartInfo); // lets assume the tunnel didn't fail yet as long as the process is // still running and keep checking if the port is ready during that bool forwardPortReady = false, backwardPortReady = false; while (!forwardPortReady || !backwardPortReady) { if (f_Process.HasExited) { string output = f_Process.StandardOutput.ReadToEnd(); string error = f_Process.StandardError.ReadToEnd(); string msg = String.Format( _("SSH tunnel setup failed (exit code: {0})\n\n" + "SSH program: {1}\n" + "SSH parameters: {2}\n\n" + "Program Error:\n" + "{3}\n" + "Program Output:\n" + "{4}\n"), f_Process.ExitCode, f_ProcessStartInfo.FileName, f_ProcessStartInfo.Arguments, error, output ); #if LOG4NET f_Logger.Error("Connect(): " + msg); #endif throw new ApplicationException(msg); } // check forward port using (TcpClient tcpClient = new TcpClient()) { try { tcpClient.Connect(f_ForwardBindAddress, f_ForwardBindPort); #if LOG4NET f_Logger.Debug("Connect(): ssh tunnel's forward port is ready"); #endif forwardPortReady = true; } catch (SocketException ex) { #if LOG4NET f_Logger.Debug("Connect(): ssh tunnel's forward port is not reading yet, retrying...", ex); #endif } } backwardPortReady = true; // we can't test the back-port as the .NET remoting channel // would need to be ready at this point, which isn't /* // check backward port using (TcpClient tcpClient = new TcpClient()) { try { tcpClient.Connect(f_BackwardBindAddress, f_BackwardBindPort); #if LOG4NET f_Logger.Debug("Connect(): ssh tunnel's backward port is ready"); #endif backwardPortReady = true; } catch (SocketException ex) { #if LOG4NET f_Logger.Debug("Connect(): ssh tunnel's backward port is not reading yet, retrying...", ex); #endif } } */ #if LOG4NET f_Logger.Info("Connect(): ssh tunnel is not ready yet, retrying..."); #endif System.Threading.Thread.Sleep(1000); } #if LOG4NET f_Logger.Info("Connect(): ssh tunnel is ready"); #endif } public void Disconnect() { Trace.Call(); if (f_Process != null && !f_Process.HasExited) { #if LOG4NET f_Logger.Debug("Disconnect(): killing ssh tunnel..."); #endif f_Process.Kill(); f_Process.WaitForExit(); #if LOG4NET f_Logger.Debug("Disconnect(): ssh tunnel exited"); #endif } } private SysDiag.ProcessStartInfo CreateOpenSshProcessStartInfo() { string sshArguments = String.Empty; Version sshVersion = GetOpenSshVersion(); // starting with OpenSSH version 4.4p1 we can use the // ExitOnForwardFailure option for detecting tunnel issues better // as the process will quit nicely, for more details see: // http://projects.qnetp.net/issues/show/145 // NOTE: the patch level is mapped to the micro component if (sshVersion >= new Version("4.4.1")) { // exit if the tunnel setup didn't work somehow sshArguments += " -o ExitOnForwardFailure=yes"; } // with OpenSSH 3.8 we can use the keep-alive feature of SSH that // will check the remote peer in defined intervals and kills the // tunnel if it reached the max value if (sshVersion >= new Version("3.8")) { // exit if the peer can't be reached for more than 90 seconds sshArguments += " -o ServerAliveInterval=30 -o ServerAliveCountMax=3"; } // run in the background (detach) // plink doesn't support this and we can't control the process this way! //sshArguments += " -f"; // don't execute a remote command sshArguments += " -N"; // HACK: force SSH to always flush the send buffer, as needed by // .NET Remoting just like the X11 protocol sshArguments += " -X"; if (!String.IsNullOrEmpty(f_Username)) { sshArguments += String.Format(" -l {0}", f_Username); } if (!String.IsNullOrEmpty(f_Password)) { // TODO: pass password, but how? } if (!String.IsNullOrEmpty(f_Keyfile)) { if (!File.Exists(f_Keyfile)) { throw new ApplicationException(_("SSH keyfile not found.")); } try { using (File.OpenRead(f_Keyfile)) {} } catch (Exception ex) { throw new ApplicationException( _("SSH keyfile could not be read."), ex ); } sshArguments += String.Format(" -i \"{0}\"", f_Keyfile); } if (f_Port != -1) { sshArguments += String.Format(" -p {0}", f_Port); } // ssh tunnel sshArguments += String.Format( " -L {0}:{1}:{2}:{3}", f_ForwardBindAddress, f_ForwardBindPort, f_ForwardHostName, f_ForwardHostPort ); // ssh back tunnel sshArguments += String.Format( " -R {0}:{1}:{2}:{3}", f_BackwardBindAddress, f_BackwardBindPort, f_BackwardHostName, f_BackwardHostPort ); // custom ssh parameters sshArguments += String.Format(" {0}", f_Parameters); // ssh host sshArguments += String.Format(" {0}", f_Hostname); SysDiag.ProcessStartInfo psi = new SysDiag.ProcessStartInfo(); psi.FileName = f_Program; psi.Arguments = sshArguments; psi.UseShellExecute = false; psi.RedirectStandardOutput = true; psi.RedirectStandardError = true; return psi; } private Version GetOpenSshVersion() { SysDiag.ProcessStartInfo psi = new SysDiag.ProcessStartInfo(); psi.FileName = f_Program; psi.Arguments = "-V"; psi.UseShellExecute = false; psi.RedirectStandardOutput = true; psi.RedirectStandardError = true; string error; string output; int exitCode; using (var process = SysDiag.Process.Start(psi)) { error = process.StandardError.ReadToEnd(); output = process.StandardOutput.ReadToEnd(); process.WaitForExit(); exitCode = process.ExitCode; } string haystack; // we expect the version output on stderr if (error.Length > 0) { haystack = error; } else { haystack = output; } // OpenSSH_6.2p2 Debian-6, OpenSSL 1.0.1e 11 Feb 2013 // OpenSSH_6.2, OpenSSL 1.0.1c 10 May 2012 Match match = Regex.Match(haystack, @"OpenSSH[_\w](\d+).(\d+)(?:.(\d+))?"); if (match.Success) { string major, minor, micro; string version = null; if (match.Groups.Count >= 3) { major = match.Groups[1].Value; minor = match.Groups[2].Value; version = String.Format("{0}.{1}", major, minor); } if (match.Groups.Count >= 4) { micro = match.Groups[3].Value; version = String.Format("{0}.{1}", version, micro); } version = version.TrimEnd('.'); #if LOG4NET f_Logger.Debug("GetOpenSshVersion(): found version: " + version); #endif return new Version(version); } string msg = String.Format( _("OpenSSH version number not found (exit code: {0})\n\n" + "SSH program: {1}\n\n" + "Program Error:\n" + "{2}\n" + "Program Output:\n" + "{3}\n"), exitCode, f_Program, error, output ); #if LOG4NET f_Logger.Error("GetOpenSshVersion(): " + msg); #endif throw new ApplicationException(msg); } private SysDiag.ProcessStartInfo CreatePlinkProcessStartInfo() { string sshArguments = String.Empty; var sshVersion = GetPlinkVersionString(); // Smuxi by default ships Plink of Quest PuTTY which allows to // accept any fingerprint but does _not_ work with pagent thus we // need to also support the regular plink if the user wants // ssh key authentication instead if (sshVersion.EndsWith("_q1.129")) { // HACK: don't ask for SSH key fingerprints // this is nasty but plink.exe can't ask for fingerprint // confirmation and thus the connect would always fail sshArguments += " -auto_store_key_in_cache"; } // no interactive mode please sshArguments += " -batch"; // don't execute a remote command sshArguments += " -N"; // HACK: force SSH to always flush the send buffer, as needed by // .NET remoting just like the X11 protocol sshArguments += " -X"; if (String.IsNullOrEmpty(f_Username)) { throw new ApplicationException(_("PuTTY / Plink requires a username to be set.")); } sshArguments += String.Format(" -l {0}", f_Username); if (!String.IsNullOrEmpty(f_Password)) { sshArguments += String.Format(" -pw {0}", f_Password); } if (!String.IsNullOrEmpty(f_Keyfile)) { if (!File.Exists(f_Keyfile)) { throw new ApplicationException(_("SSH keyfile not found.")); } try { using (File.OpenRead(f_Keyfile)) {} } catch (Exception ex) { throw new ApplicationException( _("SSH keyfile could not be read."), ex ); } sshArguments += String.Format(" -i \"{0}\"", f_Keyfile); } if (f_Port != -1) { sshArguments += String.Format(" -P {0}", f_Port); } // ssh tunnel sshArguments += String.Format( " -L {0}:{1}:{2}:{3}", f_ForwardBindAddress, f_ForwardBindPort, f_ForwardHostName, f_ForwardHostPort ); // ssh back tunnel sshArguments += String.Format( " -R {0}:{1}:{2}:{3}", f_BackwardBindAddress, f_BackwardBindPort, f_BackwardHostName, f_BackwardHostPort ); // custom ssh parameters sshArguments += String.Format(" {0}", f_Parameters); // ssh host sshArguments += String.Format(" {0}", f_Hostname); SysDiag.ProcessStartInfo psi = new SysDiag.ProcessStartInfo(); psi.FileName = f_Program; psi.Arguments = sshArguments; psi.CreateNoWindow = true; psi.UseShellExecute = false; psi.RedirectStandardOutput = true; psi.RedirectStandardError = true; return psi; } private string GetPlinkVersionString() { var startInfo = new SysDiag.ProcessStartInfo() { FileName = f_Program, Arguments = "-V", UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true, CreateNoWindow = true }; string error; string output; int exitCode; using (var process = SysDiag.Process.Start(startInfo)) { error = process.StandardError.ReadToEnd(); output = process.StandardOutput.ReadToEnd(); process.WaitForExit(); exitCode = process.ExitCode; } Match match = Regex.Match(output, @"[0-9]+\.[0-9a-zA-Z_\.]+"); if (match.Success) { var version = match.Value; #if LOG4NET f_Logger.Debug("GetPlinkVersionString(): found version: " + version); #endif return version; } string msg = String.Format( _("Plink version number not found (exit code: {0})\n\n" + "SSH program: {1}\n\n" + "Program Error:\n" + "{2}\n" + "Program Output:\n" + "{3}\n"), exitCode, f_Program, error, output ); #if LOG4NET f_Logger.Error("GetPlinkVersionString(): " + msg); #endif throw new ApplicationException(msg); } private static string _(string msg) { return LibraryCatalog.GetString(msg, f_LibraryTextDomain); } } } smuxi-0.11/src/Frontend/LongestPrefixNickCompleter.cs0000644000175000017500000001147312250426634023556 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2013 Mirco Bauer * Copyright (c) 2013 Ondra Hosek * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Linq; using System.Collections.Generic; using Smuxi.Engine; namespace Smuxi.Frontend { /// /// Longest Common Prefix (bash-style) nick completer. /// /// /// When triggered, the nickname list is searched for all matching nicknames. /// When only one nickname is found, it is fully completed. When more than one /// nickname is found, the longest prefix common to all these nicknames is /// completed, and a list of the nicknames is output into the chat view. /// The user may then input additional characters to narrow down the search, /// then trigger completion anew. /// public class LongestPrefixNickCompleter : NickCompleter { protected static string LongestCommonPrefix(IList nicks) { string ret = null; if (nicks.Count == 0) { return ret; } foreach (string nick in nicks) { if (ret == null) { ret = nick; } else { while (!nick.StartsWith(ret, StringComparison.OrdinalIgnoreCase)) { // cut off one character at the end ret = ret.Substring(0, ret.Length - 1); } } } return ret; } public override void Complete(ref string entryLine, ref int cursorPosition, IChatView currentChatView) { // isolate the nick to complete int matchPosition; bool appendSpace, leadingAt; string matchMe = IsolateNickToComplete(entryLine, cursorPosition, out matchPosition, out appendSpace, out leadingAt); bool appendCompletionChar = (matchPosition == 0); int additionalSteps = 0; // find the matching nicknames var nicks = NicksMatchingPrefix(currentChatView.Participants, matchMe); if (nicks.Count == 0) { // no matches; do nothing return; } else if (nicks.Count == 1) { // bingo! string nick = nicks [0]; // suppress the completion character if we had an @ if (leadingAt) { appendCompletionChar = false; } // find the beginning and end of the string string prefix = entryLine.Substring(0, matchPosition); string suffix = entryLine.Substring(matchPosition + matchMe.Length); // append the completion character and a space, if requested if (appendSpace) { suffix = ' ' + suffix; ++additionalSteps; } if (appendCompletionChar) { suffix = CompletionChar + suffix; ++additionalSteps; } // assemble the line and move the cursor entryLine = prefix + nick + suffix; cursorPosition = matchPosition + nick.Length + additionalSteps; } else { // find the longest common prefix string lcp = LongestCommonPrefix(nicks); // assemble nickname string string nickString = string.Join(" ", nicks.ToArray()); // output the matched prefixes currentChatView.AddMessage( new MessageModel(String.Format("-!- {0}", nickString)) ); // extend to the longest match string prefix = entryLine.Substring(0, matchPosition); string suffix = entryLine.Substring(matchPosition + matchMe.Length); // assemble the line and move the cursor entryLine = prefix + lcp + suffix; cursorPosition = matchPosition + lcp.Length; } } } } smuxi-0.11/src/Frontend/ChangeLog0000644000175000017500000000345611655545675017551 0ustar00meebeymeebey000000000000002008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-09-28 Mirco Bauer * EngineManager.cs: Refactored SSH command code into CreatePlinkProcessStartInfo() and CreateOpenSshProcessStartInfo(). Don't let OpenSSH detach, as that makes process control impossible, and plink doesn't support it anyhow. Added ssh program, stderror and stdout to error message. 2008-09-28 Mirco Bauer * EngineManager.cs: We have to use and check for plink.exe and not putty.exe. 2008-09-28 Mirco Bauer * EngineManager.cs: Check if sshProgram is present on the harddisk. Added hack for putty support: if sshProgram is putty.exe use -P instead of -p. 2008-09-28 Mirco Bauer * EngineManager.cs: Implemented SSH tunnel support. (closes trac ticket #64) 2008-07-27 Mirco Bauer * AssemblyInfo.cs, AssemblyInfo.cs.in: Removed AssemblyInfo.cs.in files, not needed anymore as we use a shared AssemblyVersion.cs(.in) now. 2008-07-27 Mirco Bauer * Frontend.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-07-07 Mirco Bauer * EngineManager.cs: Using superseded method now. 2008-06-02 Mirco Bauer * ChatView.cs, Frontend.mdp: Delete obsolete ChatView. 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 2008-01-31 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * Frontend.mdp: Updated using MonoDevelop 0.18.1 smuxi-0.11/src/Frontend/Makefile.am0000644000175000017500000000610012257043746020007 0ustar00meebeymeebey00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = ../../bin/release/smuxi-frontend.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/release/smuxi-engine.dll \ ../../bin/release/smuxi-common.dll BUILD_DIR = ../../bin/release LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_MDB= NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/release/smuxi-engine.dll SMUXI_COMMON_DLL_SOURCE=../../bin/release/smuxi-common.dll endif if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" ASSEMBLY = ../../bin/debug/smuxi-frontend.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/debug/smuxi-engine.dll \ ../../bin/debug/smuxi-common.dll BUILD_DIR = ../../bin/debug LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/debug/smuxi-engine.dll SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll endif AL=al2 SATELLITE_ASSEMBLY_NAME=.resources.dll PROGRAMFILES = \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_COMMON_DLL) LINUX_PKGCONFIG = \ $(FRONTEND_PC) all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ ChatViewManagerBase.cs \ ChatViewSyncManager.cs \ IChatView.cs \ ChatViewInfoAttribute.cs \ IEntryView.cs \ EngineManager.cs \ SshTunnelManager.cs \ CommandManager.cs \ NickCompleter.cs \ LongestPrefixNickCompleter.cs \ TabCycleNickCompleter.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-frontend.pc.in REFERENCES = \ System \ System.Core \ System.Runtime.Remoting \ Mono.Posix DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) include $(top_srcdir)/Makefile.include FRONTEND_PC = $(BUILD_DIR)/smuxi-frontend.pc LOG4NET_DLL = $(BUILD_DIR)/log4net.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll $(eval $(call emit-deploy-wrapper,FRONTEND_PC,smuxi-frontend.pc)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS) smuxi-0.11/src/Frontend/AssemblyInfo.cs0000644000175000017500000000274012253423337020675 0ustar00meebeymeebey00000000000000/* * $Id: AssemblyInfo.cs 167 2007-04-17 21:17:37Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/AssemblyInfo.cs $ * $Rev: 167 $ * $Author: meebey $ * $Date: 2007-04-17 23:17:37 +0200 (Tue, 17 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Smuxi - frontend library")] [assembly: AssemblyCopyright("2005-2013 (C) Mirco Bauer ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] smuxi-0.11/src/Frontend/ChatViewManagerBase.cs0000644000175000017500000001501712257043746022111 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2007, 2010-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using System.Collections.Generic; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend { public abstract class ChatViewManagerBase { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private IDictionary _ChatViewTypes = new Dictionary(); public abstract IChatView ActiveChat { get; } protected ChatViewManagerBase() { } public abstract void AddChat(ChatModel chat); public abstract void RemoveChat(ChatModel chat); public abstract void EnableChat(ChatModel chat); public abstract void DisableChat(ChatModel chat); private Type _GetChatViewType(ChatType chatType, Type protocolManagerType) { // exact or any (null) match foreach (var info in _ChatViewTypes.Keys) { if (info.ChatType == chatType && info.ProtocolManagerType == protocolManagerType) { return _ChatViewTypes[info]; } } if (protocolManagerType != null) { // subclass only match foreach (var info in _ChatViewTypes.Keys) { if (info.ProtocolManagerType == null) { continue; } if (info.ChatType == chatType && protocolManagerType.IsSubclassOf(info.ProtocolManagerType)) { return _ChatViewTypes[info]; } } } return null; } [Obsolete("Use CreateChatView(ChatModel, ChatType, Type) instead.")] protected IChatView CreateChatView(ChatModel chat, params object[] parameters) { Trace.Call(chat, parameters); var protocolManagerType = chat.ProtocolManager == null ? null : chat.ProtocolManager.GetType(); // REMOTING CALL 1 + 2 return CreateChatView(chat, chat.ChatType, protocolManagerType, parameters); } protected IChatView CreateChatView(ChatModel chat, ChatType chatType, Type protocolManagerType, params object[] parameters) { Trace.Call(chat, chatType, protocolManagerType, parameters); Type type; type = _GetChatViewType(chatType, protocolManagerType); if (type == null) { type = _GetChatViewType(chatType, null); } if (type == null) { throw new ApplicationException("Unsupported ChatModel type: " + chat.GetType()); } object[] ctorParams; if (parameters != null && parameters.Length > 0) { ctorParams = new object[parameters.Length + 1]; ctorParams[0] = chat; parameters.CopyTo(ctorParams, 1); } else { ctorParams = new object[] {chat}; } return (IChatView) Activator.CreateInstance(type, ctorParams); } public void LoadAll(string path, string pattern) { Trace.Call(path, pattern); string[] filenames = Directory.GetFiles(path, pattern); foreach (string filename in filenames) { Load(filename); } } public void Load(string filename) { Trace.Call(filename); Load(Assembly.LoadFile(filename)); } public void Load(Assembly assembly) { Trace.Call(assembly); Type[] types = assembly.GetTypes(); foreach (Type type in types) { Type foundType = null; Type[] interfaceTypes = type.GetInterfaces(); foreach (Type interfaceType in interfaceTypes) { if (interfaceType == typeof(IChatView)) { #if LOG4NET _Logger.Debug("Load(): found " + type); #endif foundType = type; break; } } if (foundType == null) { continue; } // let's get the info attribute object[] attrs = foundType.GetCustomAttributes(typeof(ChatViewInfoAttribute), true); if (attrs == null || attrs.Length == 0) { continue; } foreach (ChatViewInfoAttribute attr in attrs) { #if LOG4NET _Logger.Debug("Load() found Attribute: " + attr + " in Type: " + foundType); #endif // HACK: MS .NET 2.0 finds the attribute 2 times?!? // this doesn't seem to be a bug in MS .NET but Mono // IrcGroupChatView : GroupChatView : ChatView // GroupChatView contains attributes which is found a second time // when IrcGroupChatView is scanned for attributes if (!_ChatViewTypes.ContainsKey(attr)) { _ChatViewTypes.Add(attr, foundType); } } } } } } smuxi-0.11/src/Frontend/ChatViewInfoAttribute.cs0000644000175000017500000000351212257043746022520 0ustar00meebeymeebey00000000000000/* * $Id: CommandModel.cs 179 2007-04-21 15:01:29Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/CommandModel.cs $ * $Rev: 179 $ * $Author: meebey $ * $Date: 2007-04-21 17:01:29 +0200 (Sat, 21 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Smuxi.Engine; namespace Smuxi.Frontend { [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public class ChatViewInfoAttribute : Attribute { private ChatType _ChatType; private Type _ProtocolManagerType; public ChatType ChatType { get { return _ChatType; } set { _ChatType = value; } } public Type ProtocolManagerType { get { return _ProtocolManagerType; } set { _ProtocolManagerType = value; } } public ChatViewInfoAttribute() { } } } smuxi-0.11/src/Frontend/CommandManager.cs0000644000175000017500000004422112300201645021140 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010, 2012-2014 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.IO; using System.Linq; using System.Reflection; using System.Collections.Generic; using SysDiag = System.Diagnostics; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend { public delegate void CommandExceptionEventHandler(object sender, CommandExceptionEventArgs e); public class CommandExceptionEventArgs : EventArgs { public Exception Exception { get; private set;} public CommandExceptionEventArgs(Exception ex) { Exception = ex; } } public class CommandManager : IDisposable { #if LOG4NET static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif static readonly string f_LibraryTextDomain = "smuxi-frontend"; static string FrontendVersion { get; set; } Session f_Session; TaskQueue f_TaskQueue; TimeSpan f_LastCommandTimeSpan; public Version EngineVersion { get; set; } public TimeSpan LastCommandTimeSpan { get { return f_LastCommandTimeSpan; } } public event CommandExceptionEventHandler ExceptionEvent; static CommandManager() { var asm = Assembly.GetAssembly(typeof(CommandManager)); var asm_name = asm.GetName(false); FrontendVersion = asm_name.Version.ToString(); } public CommandManager(Session session) { if (session == null) { throw new ArgumentNullException("session"); } f_Session = session; f_TaskQueue = new TaskQueue("CommandManager"); f_TaskQueue.ExceptionEvent += OnTaskQueueExceptionEvent; f_TaskQueue.AbortedEvent += OnTaskQueueAbortedEvent; } ~CommandManager() { Trace.Call(); Dispose(false); } public void Dispose() { Trace.Call(); Dispose(true); GC.SuppressFinalize(this); } protected void Dispose(bool disposing) { Trace.Call(disposing); if (disposing) { f_TaskQueue.Dispose(); } } public void Execute(CommandModel cmd) { Trace.Call(cmd); if (cmd == null) { throw new ArgumentNullException("cmd"); } f_TaskQueue.Queue(delegate { try { DoExecute(cmd); } catch (Exception ex) { #if LOG4NET f_Logger.Error("Execute(): DoExecute() threw exception!", ex); #endif var msg = new MessageBuilder(). AppendErrorText("Command '{0}' failed. Reason: {1}", cmd.Command, ex.Message). ToMessage(); AddMessageToFrontend(cmd, msg); } }); } private void DoExecute(CommandModel cmd) { Trace.Call(cmd); var handled = false; if (cmd.IsCommand) { switch (cmd.Command) { case "exec": CommandExec(cmd); handled = true; break; case "echo": CommandEcho(cmd); handled = true; break; case "benchmark_message_builder": CommandBenchmarkMessageBuilder(cmd); handled = true; break; case "exception": throw new Exception("You asked for it."); } } if (handled) { // no need to send the command to the engine return; } DateTime start, stop; start = DateTime.UtcNow; handled = f_Session.Command(cmd); IProtocolManager pm = null; if (!handled) { if (cmd.Chat is SessionChatModel && cmd.FrontendManager != null) { pm = cmd.FrontendManager.CurrentProtocolManager; } else { pm = cmd.Chat.ProtocolManager; } // we maybe have no network manager yet if (pm != null) { handled = pm.Command(cmd); } else { handled = false; } } if (!handled) { var filteredCmd = IOSecurity.GetFilteredPath(cmd.Command); var hooks = new HookRunner("frontend", "command-manager", "command-" + filteredCmd); hooks.EnvironmentVariables.Add("FRONTEND_VERSION", FrontendVersion); hooks.Environments.Add(new CommandHookEnvironment(cmd)); hooks.Environments.Add(new ChatHookEnvironment(cmd.Chat)); if (pm != null) { hooks.Environments.Add(new ProtocolManagerHookEnvironment(pm)); } var cmdChar = (string) f_Session.UserConfig["Interface/Entry/CommandCharacter"]; hooks.Commands.Add(new SessionHookCommand(f_Session, cmd.Chat, cmdChar)); if (pm != null) { hooks.Commands.Add(new ProtocolManagerHookCommand(pm, cmd.Chat, cmdChar)); } // show time hooks.Init(); if (hooks.HasHooks) { hooks.Run(); handled = true; } } if (!handled) { Unknown(cmd); } stop = DateTime.UtcNow; f_LastCommandTimeSpan = (stop - start); } private void CommandExec(CommandModel cmd) { Trace.Call(cmd); if (cmd.DataArray.Length < 2) { NotEnoughParameters(cmd); return; } var parameter = cmd.Parameter; var parameters = cmd.Parameter.Split(' '); var messageOutput = false; var executeOutput = false; if (parameters.Length > 0) { var shift = false; switch (parameters[0]) { case "-c": executeOutput = true; shift = true; break; case "-o": messageOutput = true; shift = true; break; } if (shift) { parameters = parameters.Skip(1).ToArray(); parameter = String.Join(" ", parameters); } } SysDiag.DataReceivedEventHandler handler = (sender, e) => { if (String.IsNullOrEmpty(e.Data)) { return; } // eat trailing newlines var output = e.Data.TrimEnd('\r', '\n'); if (executeOutput || messageOutput) { if (messageOutput && output.StartsWith(cmd.CommandCharacter)) { // escape command character output = String.Format("{0}{1}", cmd.CommandCharacter, output); } DoExecute(new CommandModel(cmd.FrontendManager, cmd.Chat, cmd.CommandCharacter, output)); } else { var msg = new MessageBuilder().AppendText(output).ToMessage(); AddMessageToFrontend(cmd, msg); } }; string file; string args = null; if (Environment.OSVersion.Platform == PlatformID.Unix) { file = "sh"; args = String.Format("-c \"{0}\"", parameter.Replace("\"", @"\""")); } else { file = parameters[1]; if (parameters.Length > 1) { args = String.Join(" ", parameters.Skip(1).ToArray()); } } var info = new SysDiag.ProcessStartInfo() { FileName = file, Arguments = args, RedirectStandardInput = true, RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false }; using (var process = new SysDiag.Process()) { process.StartInfo = info; process.OutputDataReceived += handler; process.ErrorDataReceived += handler; try { process.Start(); process.StandardInput.Close(); process.BeginOutputReadLine(); process.BeginErrorReadLine(); process.WaitForExit(); } catch (Exception ex) { #if LOG4NET f_Logger.Error(ex); #endif var command = info.FileName; if (!String.IsNullOrEmpty(info.Arguments)) { command += " " + info.Arguments; } var msg = new MessageBuilder(). AppendErrorText("Executing '{0}' failed with: {1}", command, ex.Message). ToMessage(); AddMessageToFrontend(cmd, msg); } } } private void CommandEcho(CommandModel cmd) { Trace.Call(cmd); var msg = new MessageBuilder(). AppendEventPrefix(). AppendText(cmd.Parameter). ToMessage(); AddMessageToFrontend(cmd, msg); } public void CommandGenerateMessages(CommandModel cmd, IChatView chat) { Trace.Call(cmd, chat); var count = 0; Int32.TryParse(cmd.Parameter, out count); var builder = new MessageBuilder(); var sender = new ContactModel("msg-tester", "msg-tester", "test", "test"); builder.AppendMessage(sender, "time for a messsage generator command so I can test speed and memory usage"); var text = builder.CreateText(" *formatted text* "); text.Bold = true; builder.Append(text); builder.AppendUrl("https://www.smuxi.org/"); var msgs = new List(count); for (var i = 0; i < count; i++) { var msg = builder.ToMessage(); msgs.Add(msg); } DateTime start, stop; start = DateTime.UtcNow; foreach (var msg in msgs) { chat.AddMessage(msg); } stop = DateTime.UtcNow; builder = new MessageBuilder(); builder.AppendText( "IChatView.AddMessage(): count: {0} took: {1:0} ms avg: {2:0.00} ms", count, (stop - start).TotalMilliseconds, (stop - start).TotalMilliseconds / count ); chat.AddMessage(builder.ToMessage()); } public void CommandBenchmarkMessageBuilder(CommandModel cmd) { Trace.Call(cmd); var count = 1000; var showHelp = false; var appendMessage = false; var appendText = false; var appendEvent = false; var appendFormat = false; var toMessage = false; try { var opts = new NDesk.Options.OptionSet() { { "c|count=", v => count = Int32.Parse(v) }, { "m|append-message", v => appendMessage = true }, { "t|append-text", v => appendText = true }, { "e|append-event", v => appendEvent = true }, { "f|append-format", v => appendFormat = true }, { "T|to-message", v => toMessage = true }, }; opts.Add("h|?|help", x => { showHelp = true; var writer = new StringWriter(); opts.WriteOptionDescriptions(writer); AddMessageToFrontend( cmd, CreateMessageBuilder(). AppendHeader("{0} usage", cmd.Command). AppendText("\n"). AppendText("Parameters:\n"). AppendText(writer.ToString()). ToMessage() ); return; }); opts.Parse(cmd.Parameter.Split(' ')); if (showHelp) { return; } } catch (Exception ex) { AddMessageToFrontend( cmd, CreateMessageBuilder(). AppendErrorText("Invalid parameter: {0}", ex.Message). ToMessage() ); return; } DateTime start, stop; start = DateTime.UtcNow; MessageBuilder builder; for (var i = 0; i < count; i++) { builder = new MessageBuilder(); if (appendMessage) { builder.AppendMessage("This is message with a link to https://www.smuxi.org/."); } if (appendText) { builder.AppendText("This is message with just text."); } if (appendEvent) { builder.AppendEventPrefix(); } if (appendFormat) { builder.AppendFormat("{0} [{1}] has joined {2}", "meebey3", "~smuxi@31-18-115-252-dynip.superkabel.de", "#smuxi-devel"); } if (toMessage) { var msg = builder.ToMessage(); } } stop = DateTime.UtcNow; builder = new MessageBuilder(); builder.AppendText("MessageBuilder()."); if (appendMessage) { builder.AppendText("AppendMessage()."); } if (appendText) { builder.AppendText("AppendText()."); } if (appendEvent) { builder.AppendText("AppendEventPrefix()."); } if (appendFormat) { builder.AppendText("AppendFormat()."); } if (toMessage) { builder.AppendText("ToMessage()"); } builder.AppendText( " count: {1} took: {2:0} ms avg: {3:0.00} ms", cmd.Data, count, (stop - start).TotalMilliseconds, (stop - start).TotalMilliseconds / count ); AddMessageToFrontend(cmd, builder.ToMessage()); } private void Unknown(CommandModel cmd) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("Unknown Command: {0}"), cmd.Command). ToMessage(); AddMessageToFrontend(cmd, msg); } void NotEnoughParameters(CommandModel cmd) { var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("Not enough parameters for {0} command"), cmd.Command). ToMessage(); AddMessageToFrontend(cmd, msg); } MessageBuilder CreateMessageBuilder() { return new MessageBuilder(); } void AddMessageToFrontend(CommandModel cmd, MessageModel msg) { if (cmd == null) { throw new ArgumentNullException("cmd"); } if (msg == null) { throw new ArgumentNullException("msg"); } if (EngineVersion != null && EngineVersion >= new Version(0, 10)) { f_Session.AddMessageToFrontend(cmd, msg); } else { f_Session.AddMessageToChat(cmd.Chat, msg); } } protected virtual void OnTaskQueueExceptionEvent(object sender, TaskQueueExceptionEventArgs e) { Trace.Call(sender, e); #if LOG4NET f_Logger.Error("Exception in TaskQueue: ", e.Exception); f_Logger.Error("Inner-Exception: ", e.Exception.InnerException); #endif if (ExceptionEvent != null) { ExceptionEvent(this, new CommandExceptionEventArgs(e.Exception)); } } protected virtual void OnTaskQueueAbortedEvent(object sender, EventArgs e) { Trace.Call(sender, e); #if LOG4NET f_Logger.Debug("OnTaskQueueAbortedEvent(): task queue aborted!"); #endif } private static string _(string msg) { return LibraryCatalog.GetString(msg, f_LibraryTextDomain); } } } smuxi-0.11/src/Frontend/EngineManager.cs0000644000175000017500000003602212253423337021002 0ustar00meebeymeebey00000000000000/* * $Id: Frontend.cs 73 2005-06-27 12:42:06Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GtkGnome/Frontend.cs $ * $Rev: 73 $ * $Author: meebey $ * $Date: 2005-06-27 14:42:06 +0200 (Mon, 27 Jun 2005) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Net; using System.Net.Sockets; using System.Collections; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Http; using System.Runtime.Remoting.Channels.Tcp; using System.Runtime.Serialization.Formatters; using SysDiag = System.Diagnostics; //using Smuxi.Channels.Tcp; #if CHANNEL_TCPEX using TcpEx; #endif #if CHANNEL_BIRDIRTCP using DotNetRemotingCC.Channels.BidirectionalTCP; #endif using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend { public class EngineManager { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string f_LibraryTextDomain = "smuxi-frontend"; private SessionManager f_SessionManager; private FrontendConfig f_FrontendConfig; private IFrontendUI f_FrontendUI; private string f_Engine; private string f_EngineUrl; private Version f_EngineVersion; private UserConfig f_UserConfig; private Session f_Session; private SshTunnelManager f_SshTunnelManager; private string f_ChannelName; public SessionManager SessionManager { get { return f_SessionManager; } } public string EngineUrl { get { return f_EngineUrl; } } public Version EngineVersion { get { return f_EngineVersion; } } public Session Session { get { return f_Session; } } public UserConfig UserConfig { get { return f_UserConfig; } } public EngineManager(FrontendConfig frontendConfig, IFrontendUI frontendUI) { Trace.Call(frontendConfig, frontendUI); if (frontendConfig == null) { throw new ArgumentNullException("frontendConfig"); } if (frontendUI == null) { throw new ArgumentNullException("frontendUI"); } f_FrontendConfig = frontendConfig; f_FrontendUI = frontendUI; } public void Connect(string engine) { Trace.Call(engine); if (engine == null) { throw new ArgumentNullException("engine"); } if (engine.Length == 0) { throw new ArgumentException(_("Engine must not be empty."), "engine"); } bool engineFound = false; foreach (var entry in (string[]) f_FrontendConfig["Engines/Engines"]) { if (entry == engine) { engineFound = true; break; } } if (!engineFound) { throw new ArgumentException(_("Engine does not exist."), "engine"); } f_Engine = engine; string username = (string) f_FrontendConfig["Engines/"+engine+"/Username"]; string password = (string) f_FrontendConfig["Engines/"+engine+"/Password"]; string hostname = (string) f_FrontendConfig["Engines/"+engine+"/Hostname"]; string bindAddress = (string) f_FrontendConfig["Engines/"+engine+"/BindAddress"]; int port = (int) f_FrontendConfig["Engines/"+engine+"/Port"]; //string formatter = (string) _FrontendConfig["Engines/"+engine+"/Formatter"]; string channel = (string) f_FrontendConfig["Engines/"+engine+"/Channel"]; // SSH tunnel support bool useSshTunnel = false; if (f_FrontendConfig["Engines/"+engine+"/UseSshTunnel"] != null) { useSshTunnel = (bool) f_FrontendConfig["Engines/"+engine+"/UseSshTunnel"]; } string sshProgram = (string) f_FrontendConfig["Engines/"+engine+"/SshProgram"]; string sshParameters = (string) f_FrontendConfig["Engines/"+engine+"/SshParameters"]; string sshHostname = (string) f_FrontendConfig["Engines/"+engine+"/SshHostname"]; int sshPort = -1; if (f_FrontendConfig["Engines/"+engine+"/SshPort"] != null) { sshPort = (int) f_FrontendConfig["Engines/"+engine+"/SshPort"]; } string sshUsername = (string) f_FrontendConfig["Engines/"+engine+"/SshUsername"]; string sshPassword = (string) f_FrontendConfig["Engines/"+engine+"/SshPassword"]; var sshKeyfile = (string) f_FrontendConfig["Engines/"+engine+"/SshKeyfile"]; // OPT: always use SSH compression (both openssh and plink support it) // this reduces the .NET remoting traffic by about 75% if (String.IsNullOrEmpty(sshParameters) || !sshParameters.Contains(" -C")) { sshParameters += " -C"; } int remotingPort = 0; if (useSshTunnel) { // find free remoting back-channel port TcpListener remotingPortListener = new TcpListener(IPAddress.Loopback, 0); remotingPortListener.Start(); remotingPort = ((IPEndPoint)remotingPortListener.LocalEndpoint).Port; // find free local forward port TcpListener localForwardListener = new TcpListener(IPAddress.Loopback, 0); localForwardListener.Start(); int localForwardPort = ((IPEndPoint)localForwardListener.LocalEndpoint).Port; // only stop the listeners after we got all ports we need // else it might re-use a port! remotingPortListener.Stop(); localForwardListener.Stop(); #if LOG4NET f_Logger.Debug("Connect(): found free local backward port (for remoting back-channel): " + remotingPort); f_Logger.Debug("Connect(): found free local forward port: " + localForwardPort); #endif // HACK: we can't use localForwardPort here as .NET remoting // will announce the server port in the server Session object // thus the client will try to reach it using the original // server port :( f_SshTunnelManager = new SshTunnelManager( sshProgram, sshParameters, sshUsername, sshPassword, sshKeyfile, sshHostname, sshPort, //"127.0.0.1", localForwardPort, "127.0.0.1", port, "127.0.0.1", port, "127.0.0.1", port, "127.0.0.1", remotingPort, "127.0.0.1", remotingPort ); f_SshTunnelManager.Setup(); f_SshTunnelManager.Connect(); // so we want to connect via the SSH tunnel now hostname = "127.0.0.1"; // HACK: see above //port = localForwardPort; // the smuxi-server has to connect to us via the SSH tunnel too bindAddress = "127.0.0.1"; } IDictionary props = new Hashtable(); // ugly remoting expects the port as string ;) props["port"] = remotingPort.ToString(); string connection_url = null; SessionManager sessm = null; switch (channel) { case "TCP": // Make sure the channel is really using our random // remotingPort. Already registered channel will for sure // not to that and thus the back-connection fails! if (f_ChannelName != null) { IChannel oldChannel = ChannelServices.GetChannel(f_ChannelName); if (oldChannel != null) { #if LOG4NET f_Logger.Debug("Connect(): found old remoting channel, unregistering..."); #endif ChannelServices.UnregisterChannel(oldChannel); } } // frontend -> engine BinaryClientFormatterSinkProvider cprovider = new BinaryClientFormatterSinkProvider(); // engine -> frontend (back-connection) BinaryServerFormatterSinkProvider sprovider = new BinaryServerFormatterSinkProvider(); // required for MS .NET 1.1 sprovider.TypeFilterLevel = TypeFilterLevel.Full; if (bindAddress != null) { props["machineName"] = bindAddress; } var tcpChannel = new TcpChannel(props, cprovider, sprovider); f_ChannelName = tcpChannel.ChannelName; ChannelServices.RegisterChannel(tcpChannel, false); // make sure the listen port of channel is ready before we // connect to the engine, as it will make a call back! while (true) { using (TcpClient tcpClient = new TcpClient()) { try { tcpClient.Connect(hostname, port); #if LOG4NET f_Logger.Debug("Connect(): listen port of remoting channel is ready"); #endif break; } catch (SocketException ex) { #if LOG4NET f_Logger.Debug("Connect(): listen port of remoting channel is not reading yet, retrying...", ex); #endif } System.Threading.Thread.Sleep(1000); } } connection_url = "tcp://"+hostname+":"+port+"/SessionManager"; #if LOG4NET f_Logger.Info("Connecting to: "+connection_url); #endif sessm = (SessionManager)Activator.GetObject(typeof(SessionManager), connection_url); break; #if CHANNEL_TCPEX case "TcpEx": //props.Remove("port"); //props["name"] = "tcpex"; connection_url = "tcpex://"+hostname+":"+port+"/SessionManager"; if (ChannelServices.GetChannel("ExtendedTcp") == null) { ChannelServices.RegisterChannel(new TcpExChannel(props, null, null)); } #if LOG4NET _Logger.Info("Connecting to: "+connection_url); #endif sessm = (SessionManager)Activator.GetObject(typeof(SessionManager), connection_url); break; #endif #if CHANNEL_BIRDIRTCP case "BirDirTcp": string ip = System.Net.Dns.Resolve(hostname).AddressList[0].ToString(); connection_url = "birdirtcp://"+ip+":"+port+"/SessionManager"; if (ChannelServices.GetChannel("birdirtcp") == null) { ChannelServices.RegisterChannel(new BidirTcpClientChannel()); } #if LOG4NET _Logger.Info("Connecting to: "+connection_url); #endif sessm = (SessionManager)Activator.GetObject(typeof(SessionManager), connection_url); break; #endif case "HTTP": connection_url = "http://"+hostname+":"+port+"/SessionManager"; if (ChannelServices.GetChannel("http") == null) { ChannelServices.RegisterChannel(new HttpChannel(), false); } #if LOG4NET f_Logger.Info("Connecting to: "+connection_url); #endif sessm = (SessionManager)Activator.GetObject(typeof(SessionManager), connection_url); break; default: throw new ApplicationException(String.Format( _("Unknown channel ({0}) - "+ "only the following channel types are supported:"), channel) + " HTTP TCP"); } f_SessionManager = sessm; f_EngineUrl = connection_url; f_Session = sessm.Register(username, MD5.FromString(password), f_FrontendUI); if (f_Session == null) { throw new ApplicationException(_("Registration with engine failed! "+ "The username and/or password were wrong - please verify them.")); } f_EngineVersion = sessm.EngineVersion; f_UserConfig = new UserConfig(f_Session.Config, username); f_UserConfig.IsCaching = true; f_UserConfig.FrontendConfig = f_FrontendConfig; } public void Reconnect() { Trace.Call(); Disconnect(); Connect(f_Engine); } public void Disconnect() { Trace.Call(); // HACK: the transparent proxy object is not automatically updating // changed channel data and thus will re-use the obsolete TCP port // for the next remoting back connection, thus we have to destroy // the proxy object here! RemotingServices.Disconnect((MarshalByRefObject) f_FrontendUI); if (f_SshTunnelManager != null) { f_SshTunnelManager.Disconnect(); f_SshTunnelManager.Dispose(); f_SshTunnelManager = null; } } private static string _(string msg) { return LibraryCatalog.GetString(msg, f_LibraryTextDomain); } } } smuxi-0.11/src/Frontend/IEntryView.cs0000644000175000017500000000242211655545675020363 0ustar00meebeymeebey00000000000000/* * $Id: AboutDialog.cs 122 2006-04-26 19:31:42Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/AboutDialog.cs $ * $Rev: 122 $ * $Author: meebey $ * $Date: 2006-04-26 21:31:42 +0200 (Wed, 26 Apr 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2007 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Smuxi.Engine; namespace Smuxi.Frontend { public interface IEntryView { string Text { get; set; } } } smuxi-0.11/src/Frontend/Makefile.in0000644000175000017500000010245312311344230020007 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/smuxi-frontend.pc.in ChangeLog subdir = src/Frontend ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = smuxi-frontend.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ # Warning: This is an automatically generated file, do not edit! @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/debug/smuxi-frontend.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/release/smuxi-frontend.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-engine.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-engine.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-common.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin/debug @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin/release @ENABLE_DEBUG_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_RELEASE_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB = $(BUILD_DIR)/smuxi-engine.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_MDB = @ENABLE_DEBUG_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_RELEASE_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/debug/smuxi-engine.dll @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/release/smuxi-engine.dll @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/release/smuxi-common.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB_SOURCE = ../../bin/debug/smuxi-engine.dll.mdb AL = al2 SATELLITE_ASSEMBLY_NAME = .resources.dll PROGRAMFILES = \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_COMMON_DLL) LINUX_PKGCONFIG = \ $(FRONTEND_PC) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ ChatViewManagerBase.cs \ ChatViewSyncManager.cs \ IChatView.cs \ ChatViewInfoAttribute.cs \ IEntryView.cs \ EngineManager.cs \ SshTunnelManager.cs \ CommandManager.cs \ NickCompleter.cs \ LongestPrefixNickCompleter.cs \ TabCycleNickCompleter.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-frontend.pc.in REFERENCES = \ System \ System.Core \ System.Runtime.Remoting \ Mono.Posix DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) FRONTEND_PC = $(BUILD_DIR)/smuxi-frontend.pc LOG4NET_DLL = $(BUILD_DIR)/log4net.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Frontend/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Frontend/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): smuxi-frontend.pc: $(top_builddir)/config.status $(srcdir)/smuxi-frontend.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(eval $(call emit-deploy-wrapper,FRONTEND_PC,smuxi-frontend.pc)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Frontend/smuxi-frontend.pc.in0000644000175000017500000000021611655545675021701 0ustar00meebeymeebey00000000000000Name: smuxi-frontend Description: Frontend Version: @VERSION@ Requires: smuxi-engine Libs: -r:@expanded_libdir@/@PACKAGE@/smuxi-frontend.dll smuxi-0.11/src/Engine-JabbR/0000755000175000017500000000000012311344240016342 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-JabbR/smuxi-engine-jabbr.pc.in0000644000175000017500000000022412253423337022771 0ustar00meebeymeebey00000000000000Name: Engine-JabbR Description: Engine-JabbR Version: @VERSION@ Requires: smuxi-engine Libs: -r:@expanded_libdir@/@PACKAGE@/smuxi-engine-jabbr.dll smuxi-0.11/src/Engine-JabbR/JabbrProtocolManager.cs0000644000175000017500000005367612311311336022747 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2012-2014 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; using JabbR.Client; using JabbR.Client.Models; using Microsoft.AspNet.SignalR.Client.Transports; using Microsoft.AspNet.SignalR.Client.Http; using Smuxi.Common; namespace Smuxi.Engine { // https://github.com/davidfowl/Jabbot/blob/master/Jabbot/Bot.cs // https://github.com/davidfowl/JabbR/blob/master/JabbR/Hubs/Chat.cs [ProtocolManagerInfo(Name = "JabbR", Description = "JabbR Chat", Alias = "jabbr")] public class JabbrProtocolManager : ProtocolManagerBase { #if LOG4NET private static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif const string LibraryTextDomain = "smuxi-engine-jabbr"; ChatModel ProtocolChat { get; set; } JabbRClient Client { get; set; } string Username { get; set; } ServerModel Server { get; set; } public override string NetworkID { get { if (Server == null) { return Protocol; } return Server.Hostname; } } public override string Protocol { get { return "JabbR"; } } public override ChatModel Chat { get { return ProtocolChat; } } public JabbrProtocolManager(Session session) : base(session) { Trace.Call(session); } public override bool Command(CommandModel cmd) { Trace.Call(cmd); if (cmd.IsCommand) { var handled = false; switch (cmd.Command) { case "help": CommandHelp(cmd); handled = true; break; case "j": case "join": CommandJoin(cmd); handled = true; break; } return handled; } else { CommandMessage(cmd); } return true; } public void CommandHelp(CommandModel cmd) { Trace.Call(cmd); // TRANSLATOR: this line is used as a label / category for a // list of commands below var builder = CreateMessageBuilder(). AppendEventPrefix(). AppendHeader(_("JabbR Commands")); Session.AddMessageToFrontend(cmd, builder.ToMessage()); string[] help = { "connect jabbr username password", "join" }; foreach (string line in help) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(line); Session.AddMessageToFrontend(cmd, builder.ToMessage()); } } public void CommandJoin(CommandModel cmd) { Trace.Call(cmd); if (String.IsNullOrEmpty(cmd.Parameter)) { NotEnoughParameters(cmd); return; } try { Client.JoinRoom(cmd.Parameter); } catch (Exception ex) { #if LOG4NET Logger.Error(ex); #endif var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText(_("Joining room failed. Reason: {0}"), ex.Message). ToMessage(); Session.AddMessageToFrontend(cmd, msg); } } public void CommandMessage(CommandModel cmd) { Trace.Call(cmd); try { switch (cmd.Chat.ChatType) { case ChatType.Group: Client.Send(cmd.Data, cmd.Chat.ID).Wait(); break; case ChatType.Person: Client.SendPrivateMessage(cmd.Chat.ID, cmd.Data).Wait(); break; } } catch (Exception ex) { #if LOG4NET Logger.Error(ex); #endif var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText(_("Sending message failed. Reason: {0}"), ex.Message). ToMessage(); Session.AddMessageToFrontend(cmd, msg); } } public override void Connect(FrontendManager fm, ServerModel server) { Trace.Call(fm, server); Server = server; Username = server.Username; var chatName = String.Format("{0} {1}", Protocol, NetworkID); ProtocolChat = new ProtocolChatModel(NetworkID, chatName, this); ProtocolChat.InitMessageBuffer(MessageBufferPersistencyType.Volatile); Session.AddChat(Chat); Session.SyncChat(Chat); try { string url; if (server.Hostname.StartsWith("http://") || server.Hostname.StartsWith("https://")) { url = server.Hostname; } else { if (server.UseEncryption && server.Port == 443) { url = String.Format("https://{0}", server.Hostname); } else if (server.UseEncryption) { url = String.Format("https://{0}:{1}", server.Hostname, server.Port); } else if (!server.UseEncryption && server.Port == 80) { url = String.Format("http://{0}", server.Hostname); } else { url = String.Format("http://{0}:{1}", server.Hostname, server.Port); } } // HACK: SignalR's ServerSentEventsTransport times out on Mono // for some reason and then fallbacks to LongPollingTransport // this takes 10 seconds though, so let's go LP directly Func transport = null; if (Type.GetType("Mono.Runtime") == null) { transport = () => new AutoTransport(new DefaultHttpClient()); } else { transport = () => new LongPollingTransport(); } var authProvider = new DefaultAuthenticationProvider(url); Client = new JabbRClient(url, authProvider, transport); Client.AutoReconnect = true; Client.MessageReceived += OnMessageReceived; Client.MeMessageReceived += OnMeMessageReceived; Client.UserLeft += OnUserLeft; Client.UserJoined += OnUserJoined; Client.JoinedRoom += OnJoinedRoom; Client.PrivateMessage += OnPrivateMessage; Me = CreatePerson(Username); Me.IdentityNameColored.ForegroundColor = new TextColor(0, 0, 255); Me.IdentityNameColored.BackgroundColor = TextColor.None; Me.IdentityNameColored.Bold = true; Connect(); } catch (Exception ex) { #if LOG4NET Logger.Error(ex); #endif var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText(_("Connection failed! Reason: {0}"), ex.Message). ToMessage(); Session.AddMessageToChat(ProtocolChat, msg); } } void Connect() { Trace.Call(); var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("Connecting to {0}..."), Client.SourceUrl). ToMessage(); Session.AddMessageToChat(ProtocolChat, msg); if (!Server.ValidateServerCertificate) { var whitelist = Session.CertificateValidator.HostnameWhitelist; lock (whitelist) { var hostname = Server.Hostname; if (hostname.StartsWith("http://") || hostname.StartsWith("https://")) { hostname = new Uri(hostname).Host; } if (!whitelist.Contains(hostname)) { whitelist.Add(hostname); } } } var res = Client.Connect(Server.Username, Server.Password); res.Wait(); // HACK: this event can only be subscribed if we have made an // actual connection o_O Client.Disconnected += OnDisconnected; IsConnected = true; OnConnected(EventArgs.Empty); OnLoggedOn(res.Result.Rooms); } void OnPrivateMessage(string fromUserName, string toUserName, string message) { Trace.Call(fromUserName, toUserName, message); string targetChat; string targetUser; if (fromUserName == Username) { targetChat = toUserName; targetUser = toUserName; } else { targetChat = fromUserName; targetUser = fromUserName; } var chat = (PersonChatModel) GetChat(targetChat, ChatType.Person); if (chat == null) { var person = CreatePerson(targetUser); chat = new PersonChatModel(person, targetUser, targetUser, this); chat.InitMessageBuffer(MessageBufferPersistencyType.Volatile); Session.AddChat(chat); Session.SyncChat(chat); } var builder = CreateMessageBuilder(); if (fromUserName == Username) { builder.AppendSenderPrefix(Me); } else { builder.AppendSenderPrefix(chat.Person, true); } builder.AppendMessage(message); Session.AddMessageToChat(chat, builder.ToMessage()); } void OnDisconnected() { Trace.Call(); foreach (var chat in Chats) { // don't disable the protocol chat, else the user loses all // control for the protocol manager! e.g. after a manual // reconnect or server-side disconnect if (chat.ChatType == ChatType.Protocol) { continue; } Session.DisableChat(chat); } IsConnected = false; OnDisconnected(EventArgs.Empty); } void OnJoinedRoom(Room room) { Trace.Call(room); var groupChat = new GroupChatModel(room.Name, room.Name, this); groupChat.InitMessageBuffer(MessageBufferPersistencyType.Volatile); var task = Client.GetRoomInfo(room.Name); task.Wait(); // check task.Exception var roomInfo = task.Result; groupChat.Topic = CreateMessageBuilder(). AppendMessage(roomInfo.Topic). ToMessage(); foreach (var user in roomInfo.Users) { groupChat.UnsafePersons.Add(user.Name, CreatePerson(user)); } // add ourself if needed if (!groupChat.UnsafePersons.ContainsKey(Username)) { groupChat.UnsafePersons.Add(Username, Me); } Session.AddChat(groupChat); Session.SyncChat(groupChat); } public override void Reconnect(FrontendManager fm) { Trace.Call(fm); var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendText(_("Reconnecting to {0}..."), Server.Hostname). ToMessage(); Session.AddMessageToChat(Chat, msg); try { Client.Disconnect(); Connect(); } catch (Exception ex) { #if LOG4NET Logger.Error("Reconnect(): Exception during reconnect", ex); #endif } } public override void Disconnect(FrontendManager fm) { Trace.Call(fm); Client.Disconnect(); } public override IList FindGroupChats(GroupChatModel filter) { Trace.Call(filter); var res = Client.GetRooms(); res.Wait(); // res.Exception var groupChats = new List(); foreach (var room in res.Result) { var groupChat = new GroupChatModel(room.Name, room.Name, this); groupChat.InitMessageBuffer(MessageBufferPersistencyType.Volatile); groupChat.PersonCount = room.Count; groupChats.Add(groupChat); } return groupChats; } public override void OpenChat(FrontendManager fm, ChatModel chat) { Trace.Call(fm, chat); switch (chat.ChatType) { case ChatType.Person: var personChat = (PersonChatModel) GetChat(chat.ID, ChatType.Person); if (personChat != null) { return; } var person = CreatePerson(chat.ID); personChat = new PersonChatModel(person, chat.ID, chat.ID, this); personChat.InitMessageBuffer(MessageBufferPersistencyType.Volatile); Session.AddChat(personChat); Session.SyncChat(personChat); break; case ChatType.Group: Client.JoinRoom(chat.ID); break; } } public override void CloseChat(FrontendManager fm, ChatModel chatInfo) { Trace.Call(fm, chatInfo); // get real chat object from session var chat = GetChat(chatInfo.ID, chatInfo.ChatType); if (chat == null) { #if LOG4NET Logger.Error("CloseChat(): Session.GetChat(" + chatInfo.ID + ", " + chatInfo.ChatType + ")" + " returned null!"); #endif return; } switch (chat.ChatType) { case ChatType.Person: Session.RemoveChat(chat); break; case ChatType.Group: Client.LeaveRoom(chat.ID); break; } } public override void SetPresenceStatus(PresenceStatus status, string message) { //throw new NotImplementedException(); } public override string ToString() { string result = Chat.Name; if (!IsConnected) { result += " (" + _("not connected") + ")"; } return result; } void OnMessageReceived(Message message, string room) { Trace.Call(message, room); var chat = GetChat(room, ChatType.Group) ?? ProtocolChat; AddMessage(chat, message); } void AddMessage(ChatModel chat, Message msg) { if (chat == null) { throw new ArgumentNullException("chat"); } if (msg == null) { throw new ArgumentNullException("msg"); } string content = msg.Content; string name = msg.User.Name; var builder = CreateMessageBuilder(); if (msg.When != default(DateTimeOffset)) { builder.TimeStamp = msg.When.UtcDateTime; } var sender = name == Username ? Me : CreatePerson(name); builder.AppendSenderPrefix(sender); builder.AppendMessage(content); if (sender != Me) { builder.MarkHighlights(); } var message = builder.ToMessage(); Session.AddMessageToChat(chat, message); if (sender == Me) { // server echos our sent messages for us OnMessageSent( new MessageEventArgs(chat, message, null, chat.ID) ); } else { OnMessageReceived( new MessageEventArgs(chat, message, name, chat.ID) ); } } void OnMeMessageReceived(string userName, string content, string roomName) { Trace.Call(userName, content, roomName); var chat = GetChat(roomName, ChatType.Group) ?? ProtocolChat; var builder = CreateMessageBuilder(). AppendActionPrefix(). AppendIdendityName(GetPerson(chat, userName)). AppendSpace(). AppendMessage(content); if (userName != Username) { builder.MarkHighlights(); } var msg = builder.ToMessage(); Session.AddMessageToChat(chat, msg); OnMessageReceived( new MessageEventArgs(chat, msg, userName, roomName) ); } void OnUserJoined(User user, string room, bool isOwner) { Trace.Call(user, room, isOwner); var chat = (GroupChatModel) GetChat(room, ChatType.Group); if (chat == null) { return; } var person = CreatePerson(user.Name); lock (chat) { if (chat.Persons.ContainsKey(person.ID)) { #if LOG4NET Logger.Warn("OnUserJoined(): person already on chat, ignoring..."); #endif return; } Session.AddPersonToGroupChat(chat, person); } } void OnUserLeft(User user, string room) { Trace.Call(user, room); var chat = (GroupChatModel) GetChat(room, ChatType.Group); if (chat == null) { return; } if (user.Name == Username) { Session.RemoveChat(chat); return; } PersonModel person = null; if (chat.Persons.TryGetValue(user.Name, out person)) { Session.RemovePersonFromGroupChat(chat, person); } } void OnLoggedOn(IEnumerable rooms) { Trace.Call(rooms); try { foreach (var room in rooms) { var groupChat = (GroupChatModel) GetChat(room.Name, ChatType.Group); bool newChat; if (groupChat == null) { groupChat = new GroupChatModel(room.Name, room.Name, this); groupChat.InitMessageBuffer(MessageBufferPersistencyType.Volatile); newChat = true; } else { groupChat.UnsafePersons.Clear(); newChat = false; } var task = Client.GetRoomInfo(room.Name); task.Wait(); // check task.Exception var roomInfo = task.Result; groupChat.Topic = CreateMessageBuilder(). AppendMessage(roomInfo.Topic). ToMessage(); foreach (var user in roomInfo.Users) { groupChat.UnsafePersons.Add(user.Name, CreatePerson(user)); } // add ourself if needed if (!groupChat.UnsafePersons.ContainsKey(Username)) { groupChat.UnsafePersons.Add(Username, Me); } foreach (var msg in roomInfo.RecentMessages) { AddMessage(groupChat, msg); } if (newChat) { Session.AddChat(groupChat); } else { Session.EnableChat(groupChat); } Session.SyncChat(groupChat); } } catch (Exception ex) { #if LOG4NET Logger.Error(ex); #endif var msg = CreateMessageBuilder(). AppendEventPrefix(). AppendErrorText(_("Retrieving chat information failed. " + "Reason: {0}"), ex.Message). ToMessage(); Session.AddMessageToChat(ProtocolChat, msg); } } PersonModel CreatePerson(User user) { return CreatePerson(user.Name); } PersonModel CreatePerson(string username) { return new PersonModel(username, username, NetworkID, Protocol, this); } static string _(string msg) { return LibraryCatalog.GetString(msg, LibraryTextDomain); } } } smuxi-0.11/src/Engine-JabbR/Makefile.am0000644000175000017500000000173312253423337020414 0ustar00meebeymeebey00000000000000TARGET_DIR = $(top_builddir)/bin/$(PROFILE) ASSEMBLY_NAME = smuxi-engine-jabbr ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll ASSEMBLY_TARGET = $(TARGET_DIR)/$(ASSEMBLY_FILENAME) SOURCES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ JabbrMessageBuilder.cs \ JabbrProtocolManager.cs REFERENCES = \ System \ System.Web \ Mono.Posix \ $(LOG4NET_LIBS) DLL_REFERENCES = \ $(TARGET_DIR)/smuxi-common.dll \ $(TARGET_DIR)/smuxi-engine.dll \ $(TARGET_DIR)/Microsoft.AspNet.SignalR.Client.dll \ $(TARGET_DIR)/JabbR.Client.dll SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES)) # automake magic variables EXTRA_DIST = $(SOURCES_BUILD) CLEANFILES = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb pkgapp_DATA = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb include $(top_srcdir)/Makefile.include all: $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb: $(SOURCES) $(DLL_REFERENCES) $(CSC) $(CSC_FLAGS) $(build_references_ref) -target:library -out:$@ $(SOURCES_BUILD) smuxi-0.11/src/Engine-JabbR/AssemblyInfo.cs0000644000175000017500000000235712253423337021305 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2012 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Smuxi - JabbR protocol support")] [assembly: AssemblyCopyright("2012-2013 (C) Mirco Bauer ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] smuxi-0.11/src/Engine-JabbR/JabbrMessageBuilder.cs0000644000175000017500000000445012253423337022542 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2012 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Web; using System.Text; using System.Text.RegularExpressions; using Smuxi.Common; namespace Smuxi.Engine { public class JabbrMessageBuilder : MessageBuilder { public JabbrMessageBuilder() : base() { } public override MessageBuilder AppendMessage(string msg) { return base.AppendMessage(HtmlToText(msg)); } string HtmlToText(string html) { // TODO: implement tag if (html.Contains("\n")) { var normalized = new StringBuilder(html.Length); html = html.Replace("\r\n", "\n"); foreach (var htmlPart in html.Split('\n')) { var trimmed = htmlPart.TrimEnd(' '); if (trimmed.Length == 0) { // skip empty lines continue; } normalized.AppendFormat("{0} ", trimmed); } // remove trailing space normalized.Length--; html = normalized.ToString(); } // strip all HTML tags var text = Regex.Replace(html, "<[^>]+>", String.Empty); // strip leading and trailing whitespace text = text.Trim(); // convert HTML entities to their string values text = HttpUtility.HtmlDecode(text); return text; } } } smuxi-0.11/src/Engine-JabbR/Makefile.in0000644000175000017500000010314012311344230020405 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/smuxi-engine-jabbr.pc.in subdir = src/Engine-JabbR ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = smuxi-engine-jabbr.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(pkgapp_DATA) $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ TARGET_DIR = $(top_builddir)/bin/$(PROFILE) ASSEMBLY_NAME = smuxi-engine-jabbr ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll ASSEMBLY_TARGET = $(TARGET_DIR)/$(ASSEMBLY_FILENAME) SOURCES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ JabbrMessageBuilder.cs \ JabbrProtocolManager.cs REFERENCES = \ System \ System.Web \ Mono.Posix \ $(LOG4NET_LIBS) DLL_REFERENCES = \ $(TARGET_DIR)/smuxi-common.dll \ $(TARGET_DIR)/smuxi-engine.dll \ $(TARGET_DIR)/Microsoft.AspNet.SignalR.Client.dll \ $(TARGET_DIR)/JabbR.Client.dll SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES)) # automake magic variables EXTRA_DIST = $(SOURCES_BUILD) $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) CLEANFILES = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) pkgapp_DATA = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Engine-JabbR/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Engine-JabbR/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): smuxi-engine-jabbr.pc: $(top_builddir)/config.status $(srcdir)/smuxi-engine-jabbr.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-pkgappDATA: $(pkgapp_DATA) @$(NORMAL_INSTALL) @list='$(pkgapp_DATA)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgappdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgappdir)" || exit $$?; \ done uninstall-pkgappDATA: @$(NORMAL_UNINSTALL) @list='$(pkgapp_DATA)'; test -n "$(pkgappdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappDATA \ install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappDATA \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappDATA \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) all: $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb: $(SOURCES) $(DLL_REFERENCES) $(CSC) $(CSC_FLAGS) $(build_references_ref) -target:library -out:$@ $(SOURCES_BUILD) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/ChangeLog0000644000175000017500000000063711655545675015770 0ustar00meebeymeebey000000000000002009-01-01 Mirco Bauer * Packages.mdse: updated archive names 2008-07-27 Mirco Bauer * smuxi.mds: Bumped version to 0.6.1 2008-07-27 Mirco Bauer * smuxi.mds: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2007-12-25 Mirco Bauer * smuxi.mds: Updated using MonoDevelop 0.18.1 smuxi-0.11/src/Makefile.am0000644000175000017500000000241712257043746016237 0ustar00meebeymeebey00000000000000# Engines if ENABLE_ENGINE_IRC ENGINE_IRC = Engine-IRC endif if ENABLE_ENGINE_XMPP ENGINE_XMPP = Engine-XMPP endif if ENABLE_ENGINE_TWITTER ENGINE_TWITTER = Engine-Twitter endif if ENABLE_ENGINE_CAMPFIRE ENGINE_CAMPFIRE = Engine-Campfire endif if ENABLE_ENGINE_JABBR ENGINE_JABBR = Engine-JabbR endif # Frontends if ENABLE_FRONTEND_GNOME FRONTEND_GNOME = Frontend-GNOME endif if ENABLE_FRONTEND_GNOME_IRC FRONTEND_GNOME_IRC = Frontend-GNOME-IRC endif if ENABLE_FRONTEND_GNOME_TWITTER FRONTEND_GNOME_TWITTER = Frontend-GNOME-Twitter endif if ENABLE_FRONTEND_GNOME_XMPP FRONTEND_GNOME_XMPP = Frontend-GNOME-XMPP endif if ENABLE_FRONTEND_STFL FRONTEND_STFL = Frontend-STFL endif if ENABLE_FRONTEND_CURSES FRONTEND_CURSES = Frontend-Curses endif if ENABLE_FRONTEND_SWF FRONTEND_SWF = Frontend-SWF endif if ENABLE_FRONTEND_WPF #FRONTEND_WPF = Frontend-WPF endif if ENABLE_FRONTEND_TEST FRONTEND_TEST = Frontend-Test endif SUBDIRS = Common \ Engine \ $(ENGINE_IRC) \ $(ENGINE_TWITTER) \ $(ENGINE_CAMPFIRE) \ $(ENGINE_JABBR) \ $(ENGINE_XMPP) \ Server \ Frontend \ $(FRONTEND_GNOME) \ $(FRONTEND_GNOME_IRC) \ $(FRONTEND_GNOME_TWITTER) \ $(FRONTEND_GNOME_XMPP) \ $(FRONTEND_STFL) \ $(FRONTEND_CURSES) \ $(FRONTEND_SWF) \ $(FRONTEND_WPF) \ $(FRONTEND_TEST) smuxi-0.11/src/Engine-Campfire/0000755000175000017500000000000012311344240017110 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-Campfire/Makefile.am0000644000175000017500000000216712250426634021164 0ustar00meebeymeebey00000000000000TARGET_DIR = $(top_builddir)/bin/$(PROFILE) ASSEMBLY_NAME = smuxi-engine-campfire ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll ASSEMBLY_TARGET = $(TARGET_DIR)/$(ASSEMBLY_FILENAME) SOURCES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Protocols/Campfire/CampfireProtocolManager.cs \ Protocols/Campfire/CampfirePersonModel.cs \ Protocols/Campfire/CampfireEventStream.cs \ Protocols/Campfire/DTO.cs REFERENCES = \ System \ System.Web \ Mono.Posix \ $(LOG4NET_LIBS) DLL_REFERENCES = \ $(TARGET_DIR)/smuxi-common.dll \ $(TARGET_DIR)/smuxi-engine.dll \ $(TARGET_DIR)/ServiceStack.Common.dll \ $(TARGET_DIR)/ServiceStack.Interfaces.dll \ $(TARGET_DIR)/ServiceStack.Text.dll SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES)) # automake magic variables EXTRA_DIST = $(SOURCES_BUILD) CLEANFILES = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb pkgapp_DATA = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb include $(top_srcdir)/Makefile.include all: $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb: $(SOURCES) $(DLL_REFERENCES) $(CSC) $(CSC_FLAGS) $(build_references_ref) -target:library -out:$@ $(SOURCES_BUILD) smuxi-0.11/src/Engine-Campfire/AssemblyInfo.cs0000644000175000017500000000060012253423337022040 0ustar00meebeymeebey00000000000000using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Smuxi - Campfire support")] [assembly: AssemblyCopyright("2012-2013 © Carlos Martín Nieto ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] smuxi-0.11/src/Engine-Campfire/Protocols/0000755000175000017500000000000012311344240021074 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-Campfire/Protocols/Campfire/0000755000175000017500000000000012311344240022622 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-Campfire/Protocols/Campfire/DTO.cs0000644000175000017500000000705212250426634023615 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2012 Carlos Martín Nieto // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine.Campfire { internal class UserResponse { public User User { get; set; } } internal class RoomsResponse { public Room[] Rooms { get; set; } } internal class RoomResponse { public Room Room { get; set; } } internal class MessagesResponse { public Message[] Messages { get; set; } } internal class MessageResponse { public Message Message { get; set; } } internal class MessageWrapper { public MessageSending message { get; set; } } internal class TopicChange { public string topic { get; set; } } internal class UpdateTopicWrapper { public TopicChange room { get; set; } } internal class UploadWrapper { public Upload Upload { get; set; } } internal class UploadsResponse { public Upload[] Uploads { get; set; } } internal enum MessageType { UnknownMessage, EnterMessage, KickMessage, LeaveMessage, TimestampMessage, TextMessage, PasteMessage, SoundMessage, LockMessage, UnlockMessage, TopicChangeMessage, TweetMessage, UploadMessage, } internal class Room { public string Topic { get; set; } public string Name { get; set; } public int Id { get; set; } public bool Locked { get; set; } public int MembershipLimit { get; set; } public DateTime CreatedAt { get; set; } public DateTime UpdatedAt { get; set; } public User[] Users { get; set; } } internal class User { public int Id { get; set; } public string Name { get; set; } public string Email_Address { get; set; } public bool Admin { get; set; } public DateTimeOffset Created_At { get; set; } public string Type { get; set; } public string Avatar_Url { get; set; } public string Api_Auth_Token { get; set; } } internal class MessageSending { public MessageType type { get; set; } public string body { get; set; } } internal class Message { public int Id { get; set; } public string Body { get; set; } public int Room_Id { get; set; } public int User_Id { get; set; } public DateTimeOffset Created_At { get; set; } public MessageType Type { get; set; } public bool Starred { get; set; } } internal class Upload { public int Id { get; set; } public int Room_Id { get; set; } public string Name { get; set; } public string Full_Url { get; set; } public DateTimeOffset Created_At { get; set; } public string Content_Type { get; set; } public int User_Id { get; set; } public int Byte_Size { get; set; } } } smuxi-0.11/src/Engine-Campfire/Protocols/Campfire/CampfireEventStream.cs0000644000175000017500000001500212253423337027065 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2012 Carlos Martín Nieto // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Net; using System.IO; using System.Text; using System.Threading; using ServiceStack.Text; using ServiceStack.ServiceClient.Web; using Smuxi.Common; using Smuxi.Engine.Campfire; namespace Smuxi.Engine { internal class MessageReceivedEventArgs : EventArgs { public GroupChatModel Chat { get; private set; } public Message Message { get; private set; } public MessageReceivedEventArgs(GroupChatModel chat, Message message) { Chat = chat; Message = message; } } internal class ErrorReceivedEventArgs : EventArgs { public HttpStatusCode StatusCode { get; private set; } public string StatusDescription { get; private set; } public ErrorReceivedEventArgs(HttpStatusCode code, string description) { StatusCode = code; StatusDescription = description; } } internal class CampfireEventStream : IDisposable { public EventHandler MessageReceived; public EventHandler ErrorReceived; HttpWebRequest Request { get; set; } GroupChatModel Chat { get; set; } NetworkCredential Cred { get; set; } Thread Thread { get; set; } Uri BaseUri { get; set; } string Host { get; set; } int LastMessage { get; set; } public CampfireEventStream(GroupChatModel chat, Uri baseuri, NetworkCredential cred) { this.Chat = chat; this.Cred = cred; this.Host = Host; this.BaseUri = baseuri; this.LastMessage = 0; } public void Start() { Thread = new Thread(DoWork); Thread.Start(); } void FillHole() { var client = new JsonServiceClient(BaseUri.AbsoluteUri); client.Credentials = Cred; var messages = client.Get( String.Format("/room/{0}.json?since={1}", Chat.ID, LastMessage)).Messages; if (messages == null) return; foreach (var message in messages) { if (MessageReceived != null) { var args = new MessageReceivedEventArgs(Chat, message); MessageReceived(this, args); } LastMessage = message.Id; } } void DoWork() { while (true) { try { // if LastMessage > 0 we're reconnecting, so we need to ask // the server for the messages we've missed if (LastMessage > 0) { FillHole(); } ParseStream(); } catch (TimeoutException) { // Not to worry, let's just connect again } catch (WebException e) { if (e.Status == WebExceptionStatus.ProtocolError) { var resp = (HttpWebResponse) e.Response; if (resp.StatusCode == HttpStatusCode.Unauthorized || resp.StatusCode == HttpStatusCode.Forbidden) { if (ErrorReceived != null) { ErrorReceived(this, new ErrorReceivedEventArgs(resp.StatusCode, resp.StatusDescription)); } return; } // it's not such a bad error, sleep for a bit before trying again Thread.Sleep(TimeSpan.FromSeconds(5)); } } } } public void ParseStream() { Request = HttpWebRequest.Create( String.Format("https://streaming.campfirenow.com/room/{0}/live.json", Chat.ID)) as HttpWebRequest; Request.Credentials = Cred; Request.PreAuthenticate = true; var res = Request.GetResponse() as HttpWebResponse; using (StreamReader reader = new StreamReader(res.GetResponseStream())) { /* Stupid but easy way to figure out when we've reached the end of a JSON object */ int brackets = 0; StringBuilder bld = new StringBuilder(); while (!reader.EndOfStream) { var line = reader.ReadLine(); for (int i = 0; i < line.Length; i++) { bld.Append(line[i]); switch (line[i]) { case '{': brackets++; break; case '}': brackets--; break; default: continue; } if (brackets == 0) { var str = bld.ToString().Trim(); bld.Length = 0; var message = JsonSerializer.DeserializeFromString(str); if (MessageReceived != null) { var args = new MessageReceivedEventArgs(Chat, message); MessageReceived(this, args); } LastMessage = message.Id; } } } reader.Close(); } res.Close(); Request = null; } public void Dispose() { Thread.Abort(); } } } smuxi-0.11/src/Engine-Campfire/Protocols/Campfire/CampfireProtocolManager.cs0000644000175000017500000005240312257043746027740 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2012 Carlos Martín Nieto // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Web; using System.Net; using System.Linq; using System.Collections; using System.Collections.Generic; using System.Threading; using Smuxi.Common; using Smuxi.Engine.Campfire; using ServiceStack.ServiceClient.Web; namespace Smuxi.Engine { [ProtocolManagerInfo(Name = "Campfire", Description = "Campfire chat", Alias = "campfire")] public class CampfireProtocolManager : ProtocolManagerBase { static readonly string f_LibraryTextDomain = "smuxi-engine-campfire"; Dictionary EventStreams { get; set; } int LastSentId { get; set; } IEnumerable Rooms { get; set; } DateTime RoomsUpdated { get; set; } TimeSpan RefreshInterval { get; set; } Dictionary Users { get; set; } string Key { get; set; } string Network { get; set; } Uri BaseUri { get; set; } ChatModel NetworkChat { get; set; } JsonServiceClient Client { get; set; } public override string Protocol { get { return "Campfire"; } } public override string NetworkID { get { return Network; } } public override ChatModel Chat { get { return NetworkChat; } } static CampfireProtocolManager() { } private CampfirePersonModel CreatePerson(User user) { var person = new CampfirePersonModel(user, NetworkID, this); return person; } private void GetUserDetails(int id) { if (Users.ContainsKey(id) || id == 0) return; var u = Client.Get(String.Format("/users/{0}.json", id)).User; Users[u.Id] = CreatePerson(u); } private void RefreshRooms() { if (Rooms == null || RefreshInterval.CompareTo(RoomsUpdated - DateTime.Now) > 0) Rooms = Client.Get("/rooms.json").Rooms; } public CampfireProtocolManager(Session session) : base(session) { Trace.Call(session); RefreshInterval = TimeSpan.FromMinutes(5); RoomsUpdated = DateTime.MinValue; Users = new Dictionary(); EventStreams = new Dictionary(); } private void FailedToConnect(string str, Exception e) { Session.AddMessageToChat(NetworkChat, CreateMessageBuilder() .AppendErrorText("{0}: {1}", str, e.Message) .ToMessage()); } public override void Connect(FrontendManager fm, ServerModel server) { Trace.Call(fm, server); Network = server.Hostname.Substring(0, server.Hostname.IndexOf('.')); Host = server.Hostname; BaseUri = new Uri(String.Format("https://{0}", Host)); NetworkChat = new ProtocolChatModel(Network, "Campfire " + Network, this); NetworkChat.InitMessageBuffer(MessageBufferPersistencyType.Volatile); NetworkChat.ApplyConfig(Session.UserConfig); Session.AddChat(NetworkChat); Session.SyncChat(NetworkChat); var msg = _("Connecting to campfire... "); if (fm != null) { fm.SetStatus(msg); } var bld = CreateMessageBuilder().AppendEventPrefix().AppendText(msg); Session.AddMessageToChat(NetworkChat, bld.ToMessage()); if (!server.ValidateServerCertificate) { var whitelist = Session.CertificateValidator.HostnameWhitelist; lock (whitelist) { // needed for favicon if (!whitelist.Contains("campfirenow.com")) { whitelist.Add("campfirenow.com"); } // needed for receiving messages if (!whitelist.Contains("streaming.campfirenow.com")) { whitelist.Add("streaming.campfirenow.com"); } if (!whitelist.Contains(Host)) { whitelist.Add(Host); } } } Client = new JsonServiceClient(BaseUri.AbsoluteUri); var creds = new NetworkCredential(server.Username, server.Password); Client.Credentials = creds; try { var me = Client.Get("/users/me.json").User; Key = me.Api_Auth_Token; Me = CreatePerson(me); // The blue color is hardcoded for now Me.IdentityNameColored.ForegroundColor = new TextColor(0x0000FF); Me.IdentityNameColored.BackgroundColor = TextColor.None; Me.IdentityNameColored.Bold = true; } catch (Exception e) { FailedToConnect("Failed to connect to Campfire", e); return; } Client.Credentials = new NetworkCredential(Key, "X"); msg = _("Connected to campfire"); if (fm != null) { fm.SetStatus(msg); } bld = CreateMessageBuilder().AppendEventPrefix().AppendText(msg); Session.AddMessageToChat(NetworkChat, bld.ToMessage()); // Campfire lets us know what channels the user is currently in, so // connect to those rooms automatically Rooms = Client.Get("/rooms.json").Rooms; RoomsUpdated = DateTime.Now; var myrooms = Client.Get("/presence.json").Rooms; if (myrooms.Length > 0) { bld = CreateMessageBuilder(). AppendEventPrefix(). AppendText("Present in {0}", String.Join(", ", myrooms.Select(r => r.Name).ToArray()) ); Session.AddMessageToChat(NetworkChat, bld.ToMessage()); } foreach (var room in myrooms) { var chat = new GroupChatModel(room.Id.ToString(), room.Name, null); OpenChat(fm, chat); } } public void CommandHelp(CommandModel cd) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); // TRANSLATOR: this line is used as a label / category for a // list of commands below builder.AppendHeader(_("Campfire Commands")); Session.AddMessageToFrontend(cd, builder.ToMessage()); string[] help = { "connect campfire username password", "join", "topic", "uploads", "say" }; foreach (string line in help) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(line); Session.AddMessageToFrontend(cd, builder.ToMessage()); } } public void CommandJoin(CommandModel cmd) { Trace.Call(cmd); RefreshRooms(); /* * cmd.DataArray is split at SP, but that's an allowed character * for Campfire. Instead of relying on that, we need to remove the "/join " * part and then split on ',' */ var chans = cmd.Parameter.Split(','); var list = Rooms.Where(r => chans.Any(r.Name.Equals)); foreach(Room room in list) { var chat = new GroupChatModel(room.Id.ToString(), room.Name, null); OpenChat(cmd.FrontendManager, chat); } } public void CommandTopic(CommandModel cmd) { Trace.Call(cmd); var update = new UpdateTopicWrapper { room = new TopicChange { topic = cmd.Parameter } }; Client.Put(String.Format("/room/{0}.json", cmd.Chat.ID), update); } public void CommandUploads(CommandModel cmd) { Trace.Call(cmd); var uploads = Client.Get(String.Format("/room/{0}/uploads.json", cmd.Chat.ID)).Uploads; foreach (var upload in uploads) { var bld = CreateMessageBuilder(); bld.AppendEventPrefix().AppendHeader(_("Upload")).AppendSpace(); bld.AppendText(_("'{0}' ({1} B) {2}"), upload.Name, upload.Byte_Size, upload.Full_Url); Session.AddMessageToChat(cmd.Chat, bld.ToMessage()); } } public void CommandSay(CommandModel cmd) { Trace.Call(cmd); SendMessage((GroupChatModel) cmd.Chat, cmd.Parameter); } public override bool Command(CommandModel command) { Trace.Call(command); bool handled = false; switch (command.Command) { case "j": case "join": CommandJoin(command); handled = true; break; case "say": CommandSay(command); handled = true; break; case "help": CommandHelp(command); handled = true; break; case "topic": CommandTopic(command); handled = true; break; case "uploads": CommandUploads(command); handled = true; break; default: // nothing, normal chat handled = true; if (command.Chat is GroupChatModel) SendMessage((GroupChatModel) command.Chat, command.Data); break; } return handled; } public override IList FindGroupChats(GroupChatModel filter) { Trace.Call(filter); RefreshRooms(); string searchPattern = null; if (filter == null || String.IsNullOrEmpty(filter.Name)) { // full channel list } else { if (!filter.Name.StartsWith("*") && !filter.Name.EndsWith("*")) { searchPattern = String.Format("*{0}*", filter.Name); } else { searchPattern = filter.Name; } } List chats = new List(Rooms.Count()); IEnumerable matching; matching = searchPattern == null ? Rooms : Rooms.Where(r => Pattern.IsMatch(r.Name, searchPattern)); foreach (var room in matching) { GroupChatModel chat = new GroupChatModel(room.Id.ToString(), room.Name, null); var users = Client.Get(String.Format("/room/{0}.json", chat.ID)).Room.Users; /* Don't waste this data */ lock (Users) { foreach (var user in users) { if (!Users.ContainsKey(user.Id)) Users[user.Id] = CreatePerson(user); } } chat.PersonCount = users.Length; chat.Topic = CreateMessageBuilder().AppendMessage(room.Topic).ToMessage(); lock (chat) { chats.Add(chat); } } return chats; } void SendMessage(GroupChatModel chat, string text) { var message = new MessageSending { body = text, type = Campfire.MessageType.TextMessage}; var wrapper = new MessageWrapper { message = message }; Message res; try { res = Client.Post(String.Format("/room/{0}/speak.json", chat.ID), wrapper).Message; } catch (WebServiceException e) { var bld = CreateMessageBuilder(); bld.AppendErrorText(_("Failed to post message: {0}"), e.Message); Session.AddMessageToChat(NetworkChat, bld.ToMessage()); return; } ShowMessage(this, new MessageReceivedEventArgs(chat, res)); LastSentId = res.Id; } void FormatUpload(MessageBuilder bld, PersonModel person, ChatModel chat, Message message) { // Figure out what the user uploaded, we need to issue another call for this var upload = Client.Get(String.Format("/room/{0}/messages/{1}/upload.json", chat.ID, message.Id)).Upload; bld.AppendEventPrefix(); bld.AppendIdendityName(person).AppendSpace(); bld.AppendText(_("has uploaded '{0}' ({1} B) {2}"), upload.Name, upload.Byte_Size, upload.Full_Url); } void FormatEvent(MessageBuilder bld, PersonModel person, string action) { bld.AppendEventPrefix(); bld.AppendIdendityName(person).AppendSpace(); bld.AppendText(action); } void ShowMessage(object sender, MessageReceivedEventArgs args) { var message = args.Message; var chat = args.Chat; bool processed = true; if (message.Type == Campfire.MessageType.TimestampMessage) return; CampfirePersonModel person; lock (Users) { GetUserDetails(message.User_Id); /* Make sure we know who this is */ person = Users[message.User_Id]; } var bld = CreateMessageBuilder(); bld.TimeStamp = message.Created_At.DateTime; switch (message.Type) { case Campfire.MessageType.EnterMessage: // TRANSLATOR: {0} is the name of the room FormatEvent(bld, person, String.Format(_("has joined {0}"), chat.Name)); lock (chat) { if (chat.GetPerson(person.ID) == null) Session.AddPersonToGroupChat(chat, person); } break; case Campfire.MessageType.KickMessage: case Campfire.MessageType.LeaveMessage: // TRANSLATOR: {0} is the name of the room FormatEvent(bld, person, String.Format(_("has left {0}"), chat.Name)); lock (chat) { if (chat.GetPerson(person.ID) != null) Session.RemovePersonFromGroupChat(chat, person); } break; case Campfire.MessageType.LockMessage: // TRANSLATOR: {0} is the name of the room FormatEvent(bld, person, String.Format(_("has locked {0}"), chat.Name)); break; case Campfire.MessageType.UnlockMessage: // TRANSLATOR: {0} is the name of the room FormatEvent(bld, person, String.Format(_("has unlocked {0}"), chat.Name)); break; case Campfire.MessageType.TopicChangeMessage: var topic = CreateMessageBuilder().AppendMessage(message.Body); Session.UpdateTopicInGroupChat(chat, topic.ToMessage()); FormatEvent(bld, person, _("has changed the topic")); break; case Campfire.MessageType.UploadMessage: FormatUpload(bld, person, chat, message); break; case Campfire.MessageType.TextMessage: case Campfire.MessageType.PasteMessage: processed = false; break; default: FormatEvent(bld, person, String.Format(_("has performed an unknown action"), chat.Name)); break; } if (processed) { Session.AddMessageToChat(chat, bld.ToMessage()); return; } bool mine = person == Me; // Don't double-post the messages we've sent if (mine && message.Id <= LastSentId) return; if (mine) bld.AppendSenderPrefix(Me); else bld.AppendNick(person).AppendSpace(); if (message.Type == Campfire.MessageType.TextMessage || message.Type == Campfire.MessageType.TweetMessage) { bld.AppendMessage(message.Body); } else if (message.Type == Campfire.MessageType.PasteMessage) { bld.AppendText("\n"); foreach (string part in message.Body.Split('\n')) { bld.AppendText(" {0}\n", part); } } if (!mine) bld.MarkHighlights(); Session.AddMessageToChat(chat, bld.ToMessage()); } void ShowError(object sender, ErrorReceivedEventArgs args) { var message = args.StatusDescription; var bld = CreateMessageBuilder(); bld.AppendErrorText(_("Error reading from stream: {0}"), message); Session.AddMessageToChat(NetworkChat, bld.ToMessage()); } public override void OpenChat(FrontendManager fm, ChatModel chat_) { Trace.Call(fm, chat_); var room = Rooms.Single(r => r.Name.Equals(chat_.Name)); Client.Post(String.Format("/room/{0}/join.json", room.Id), null); room = Client.Get(String.Format("/room/{0}.json", room.Id)).Room; var chat = Session.GetChat(room.Name, ChatType.Group, this) as GroupChatModel; if (chat == null) chat = Session.CreateChat(room.Id.ToString(), room.Name, this); var bld = CreateMessageBuilder(); bld.AppendMessage(room.Topic); chat.Topic = bld.ToMessage(); Session.AddChat(chat); /* Fill what we know about the users, this is only the currently-connected ones */ lock (Users) { foreach (User user in room.Users) { if (!Users.ContainsKey(user.Id)) Users[user.Id] = CreatePerson(user); Session.AddPersonToGroupChat(chat, Users[user.Id]); } } /* Show the recent messages, then go live. FIXME: race condition */ var recent = Client.Get(String.Format("/room/{0}/recent.json", chat.ID)).Messages; foreach (Message message in recent) ShowMessage(this, new MessageReceivedEventArgs(chat, message)); Session.SyncChat(chat); chat.IsSynced = true; // Let the part and join messages take affect var stream = new CampfireEventStream(chat, BaseUri, new NetworkCredential(Key, "X")); lock (EventStreams) EventStreams.Add(chat, stream); stream.MessageReceived += ShowMessage; stream.ErrorReceived += ShowError; stream.Start(); } public override void CloseChat(FrontendManager fm, ChatModel ChatInfo) { var chat = GetChat(ChatInfo.ID, ChatType.Group); Client.Post(String.Format("/room/{0}/leave.json", chat.ID), null); Session.RemoveChat(chat); lock (EventStreams) { var stream = EventStreams[chat]; stream.Dispose(); EventStreams.Remove(chat); } } public override void Reconnect(FrontendManager fm) { Trace.Call(fm); } public override void Disconnect(FrontendManager fm) { Trace.Call(fm); } public override void SetPresenceStatus(PresenceStatus status, string message) { } public override void Dispose() { Trace.Call(); lock (EventStreams) { foreach (var stream in EventStreams.Values) stream.Dispose(); } base.Dispose(); } public override string ToString() { return Network; } private static string _(string msg) { return LibraryCatalog.GetString(msg, f_LibraryTextDomain); } } } smuxi-0.11/src/Engine-Campfire/Protocols/Campfire/CampfirePersonModel.cs0000644000175000017500000000405212250426634027062 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2012 Carlos Martín Nieto // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Net; using System.Runtime.Serialization; using Smuxi.Common; using Smuxi.Engine.Campfire; namespace Smuxi.Engine.Campfire { [Serializable] internal class CampfirePersonModel : PersonModel { public int Uid { get; internal set; } public string Ident { get; internal set; } public string Host { get; internal set; } public string Name {get; internal set; } public string Email {get; internal set; } public bool Admin {get; internal set; } public string AvatarUrl {get; internal set; } internal protected CampfirePersonModel(User user, string network, IProtocolManager pm) : base(user.Id.ToString(), user.Name, network, "Campfire", pm) { Uid = user.Id; Name = user.Name; Email = user.Email_Address; Admin = user.Admin; AvatarUrl = user.Avatar_Url; Host = network; Ident = Name; } internal protected CampfirePersonModel(SerializationInfo info, StreamingContext ctx) : base(info, ctx) { } } } smuxi-0.11/src/Engine-Campfire/Makefile.in0000644000175000017500000010306712311344230021163 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am subdir = src/Engine-Campfire ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(pkgapp_DATA) $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ TARGET_DIR = $(top_builddir)/bin/$(PROFILE) ASSEMBLY_NAME = smuxi-engine-campfire ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll ASSEMBLY_TARGET = $(TARGET_DIR)/$(ASSEMBLY_FILENAME) SOURCES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Protocols/Campfire/CampfireProtocolManager.cs \ Protocols/Campfire/CampfirePersonModel.cs \ Protocols/Campfire/CampfireEventStream.cs \ Protocols/Campfire/DTO.cs REFERENCES = \ System \ System.Web \ Mono.Posix \ $(LOG4NET_LIBS) DLL_REFERENCES = \ $(TARGET_DIR)/smuxi-common.dll \ $(TARGET_DIR)/smuxi-engine.dll \ $(TARGET_DIR)/ServiceStack.Common.dll \ $(TARGET_DIR)/ServiceStack.Interfaces.dll \ $(TARGET_DIR)/ServiceStack.Text.dll SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES)) # automake magic variables EXTRA_DIST = $(SOURCES_BUILD) $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) CLEANFILES = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) pkgapp_DATA = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Engine-Campfire/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Engine-Campfire/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-pkgappDATA: $(pkgapp_DATA) @$(NORMAL_INSTALL) @list='$(pkgapp_DATA)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgappdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgappdir)" || exit $$?; \ done uninstall-pkgappDATA: @$(NORMAL_UNINSTALL) @list='$(pkgapp_DATA)'; test -n "$(pkgappdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappDATA \ install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappDATA \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappDATA \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) all: $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb: $(SOURCES) $(DLL_REFERENCES) $(CSC) $(CSC_FLAGS) $(build_references_ref) -target:library -out:$@ $(SOURCES_BUILD) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Engine-XMPP/0000755000175000017500000000000012311344240016146 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-XMPP/ChangeLog0000644000175000017500000000242611655545675017755 0ustar00meebeymeebey000000000000002008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-12-17 Mirco Bauer 2008-08-28 Mirco Bauer * AssemblyInfo.cs: Set eol-style to native and converted files using dos2unix where needed. 2008-07-27 Mirco Bauer * Engine-XMPP.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-07-15 Mirco Bauer * Protocols/Xmpp/XmppProtocolManager.cs: Added FindGroupChats(). Added OpenChat(). Added CloseChat(). 2008-06-02 Mirco Bauer * Protocols/Xmpp/XmppProtocolManager.cs: Renamed confusing NetworkChatModel to ProtocolChatModel and ChatType.Network to ChatType.Protocol. 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 2008-03-04 Mirco Bauer * Protocols/Xmpp/XmppProtocolManager.cs: Fixed network chat. 2008-01-31 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * Engine-XMPP.mdp: Updated using MonoDevelop 0.18.1 smuxi-0.11/src/Engine-XMPP/Makefile.am0000644000175000017500000000211012264335155020210 0ustar00meebeymeebey00000000000000TARGET_DIR = $(top_builddir)/bin/$(PROFILE) ASSEMBLY_NAME = smuxi-engine-xmpp ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll ASSEMBLY_TARGET = $(TARGET_DIR)/$(ASSEMBLY_FILENAME) SOURCES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Config/XmppServerModel.cs \ Protocols/Xmpp/XmppGroupChatModel.cs \ Protocols/Xmpp/XmppProtocolManager.cs \ Config/XmppPersonModel.cs \ Protocols/Xmpp/FacebookProtocolManager.cs REFERENCES = \ System \ System.Core \ Mono.Posix \ $(LOG4NET_LIBS) DLL_REFERENCES = \ $(TARGET_DIR)/smuxi-common.dll \ $(TARGET_DIR)/smuxi-engine.dll \ $(TARGET_DIR)/StarkSoftProxy.dll \ $(TARGET_DIR)/agsxmpp.dll SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES)) # automake magic variables EXTRA_DIST = $(SOURCES_BUILD) CLEANFILES = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb pkgapp_DATA = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb include $(top_srcdir)/Makefile.include all: $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb: $(SOURCES) $(DLL_REFERENCES) $(CSC) $(CSC_FLAGS) $(build_references_ref) -target:library -out:$@ $(SOURCES_BUILD) smuxi-0.11/src/Engine-XMPP/AssemblyInfo.cs0000644000175000017500000000262612253423337021110 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Smuxi - XMPP protocol support")] [assembly: AssemblyCopyright("2005-2013 (C) Mirco Bauer , " + "2011 (C) Tuukka Hastrup , " + "2013 (C) Oliver Schneider ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] smuxi-0.11/src/Engine-XMPP/smuxi-engine-xmpp.pc.in0000644000175000017500000000022111655545675022515 0ustar00meebeymeebey00000000000000Name: Engine-XMPP Description: Engine-XMPP Version: @VERSION@ Requires: smuxi-engine Libs: -r:@expanded_libdir@/@PACKAGE@/smuxi-engine-xmpp.dll smuxi-0.11/src/Engine-XMPP/Protocols/0000755000175000017500000000000012311344240020132 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-XMPP/Protocols/Xmpp/0000755000175000017500000000000012311344240021056 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs0000644000175000017500000032073612300201464025357 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2014 Mirco Bauer * Copyright (c) 2011 Tuukka Hastrup * Copyright (c) 2013-2014 Oliver Schneider * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Net.Security; using System.Xml; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Collections; using System.Collections.Generic; using System.Globalization; using agsXMPP; using agsXMPP.protocol; using agsXMPP.protocol.client; using agsXMPP.protocol.x.muc; using agsXMPP.protocol.iq; using agsXMPP.protocol.iq.roster; using agsXMPP.protocol.iq.disco; using agsXMPP.protocol.extensions.caps; using agsXMPP.protocol.extensions.chatstates; using XmppMessageType = agsXMPP.protocol.client.MessageType; using agsXMPP.Factory; using agsXMPP.Net; using Starksoft.Net.Proxy; using Smuxi.Common; using System.Runtime.CompilerServices; using agsXMPP.protocol.extensions.nickname; namespace Smuxi.Engine { [ProtocolManagerInfo(Name = "XMPP", Description = "Extensible Messaging and Presence Protocol", Alias = "xmpp")] public class XmppProtocolManager : ProtocolManagerBase { #if LOG4NET static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif static readonly string LibraryTextDomain = "smuxi-engine-xmpp"; XmppClientConnection JabberClient { get; set; } MucManager MucManager { get; set; } DiscoManager Disco { get; set; } string[] Nicknames { get; set; } Dictionary Contacts { get; set; } Dictionary DiscoCache { get; set; } ChatModel NetworkChat { get; set; } GroupChatModel ContactChat { get; set; } XmppServerModel Server { get; set; } bool AutoReconnect { get; set; } TimeSpan AutoReconnectDelay { get; set; } bool IsDisposed { get; set; } bool ShowChatStates { get; set; } // pidgin's psychic mode bool OpenNewChatOnChatState { get; set; } public override string NetworkID { get { return Host; } } public override string Protocol { get { return "XMPP"; } } public override ChatModel Chat { get { return NetworkChat; } } public override bool IsConnected { get { return JabberClient.Authenticated; } } public XmppProtocolManager(Session session) : base(session) { Trace.Call(session); Contacts = new Dictionary(); DiscoCache = new Dictionary(); ShowChatStates = true; OpenNewChatOnChatState = true; JabberClient = new XmppClientConnection(); JabberClient.AutoRoster = true; JabberClient.AutoPresence = true; JabberClient.OnMessage += OnMessage; JabberClient.OnClose += OnClose; JabberClient.OnLogin += OnLogin; JabberClient.OnError += OnError; JabberClient.OnStreamError += OnStreamError; JabberClient.OnPresence += OnPresence; JabberClient.OnRosterItem += OnRosterItem; JabberClient.OnReadXml += OnReadXml; JabberClient.OnWriteXml += OnWriteXml; JabberClient.OnAuthError += OnAuthError; JabberClient.SendingServiceUnavailable += OnSendingServiceUnavailable; JabberClient.AutoAgents = false; // outdated feature JabberClient.EnableCapabilities = true; JabberClient.Capabilities.Node = "https://smuxi.im"; JabberClient.ClientVersion = Engine.VersionString; // identify smuxi var ident = JabberClient.DiscoInfo.AddIdentity(); ident.Category = "client"; ident.Type = "pc"; ident.Name = Engine.VersionString; // add features here (this is just for notification of other clients) JabberClient.DiscoInfo.AddFeature().Var = "http://jabber.org/protocol/caps"; JabberClient.DiscoInfo.AddFeature().Var = "jabber:iq:last"; JabberClient.DiscoInfo.AddFeature().Var = "http://jabber.org/protocol/muc"; JabberClient.DiscoInfo.AddFeature().Var = "http://jabber.org/protocol/disco#info"; JabberClient.DiscoInfo.AddFeature().Var = "http://jabber.org/protocol/xhtml-im"; Disco = new DiscoManager(JabberClient); Disco.AutoAnswerDiscoInfoRequests = true; MucManager = new MucManager(JabberClient); } [MethodImpl(MethodImplOptions.Synchronized)] void OnSendingServiceUnavailable(object sender, SendingServiceUnavailableEventArgs e) { if (e.Stanza.To == null) { // can only be received by the server return; } if (e.Stanza.To == JabberClient.MyJID.Server) { // explicitly targeting the server return; } XmppPersonModel person; if (!Contacts.TryGetValue(e.Stanza.To.Bare, out person)) { e.Cancel = true; return; } if (person.Subscription != SubscriptionType.both && person.Subscription != SubscriptionType.from) { e.Cancel = true; return; } // the person already knows we are online, this does not give away our privacy } [MethodImpl(MethodImplOptions.Synchronized)] void OnStreamError(object sender, agsXMPP.Xml.Dom.Element e) { Trace.Call(sender, e); var error = e as agsXMPP.protocol.Error; var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); // TODO: create user readable error messages from the error.Condition //builder.AppendErrorText(error.Condition.ToString()); switch (error.Condition) { case StreamErrorCondition.SystemShutdown: builder.AppendErrorText(_("The Server has shut down")); break; case StreamErrorCondition.Conflict: builder.AppendErrorText(_("Another client logged in with the same resource, you have been disconnected")); break; case StreamErrorCondition.SeeOtherHost: Server.Hostname = e.GetTag("see-other-host"); Reconnect(null); break; default: builder.AppendErrorText(error.Text ?? error.Condition.ToString()); break; } Session.AddMessageToChat(NetworkChat, builder.ToMessage()); } [MethodImpl(MethodImplOptions.Synchronized)] void OnAuthError(object sender, agsXMPP.Xml.Dom.Element e) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendErrorText(_("Authentication failed, either username does not exist or invalid password")); Session.AddMessageToChat(NetworkChat, builder.ToMessage()); builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendMessage(_("if you want to create an account with the specified user and password, type /register now")); Session.AddMessageToChat(NetworkChat, builder.ToMessage()); } [MethodImpl(MethodImplOptions.Synchronized)] public override void Connect(FrontendManager fm, ServerModel server) { Trace.Call(fm, server); if (server == null) { throw new ArgumentNullException("server"); } if (server is XmppServerModel) { Server = (XmppServerModel) server; } else { Server = new XmppServerModel(); if (server.ServerID != null) { Server.Load(Session.UserConfig, Protocol, server.ServerID); } // HACK: previous line overwrites any passed values with the values from config // thus we have to copy the original values: Server.Hostname = server.Hostname; Server.Network = server.Network; Server.OnConnectCommands = server.OnConnectCommands; Server.OnStartupConnect = server.OnStartupConnect; Server.Password = server.Password; Server.Port = server.Port; Server.Protocol = server.Protocol; Server.ServerID = server.ServerID; Server.UseEncryption = server.UseEncryption; Server.Username = server.Username; Server.ValidateServerCertificate = server.ValidateServerCertificate; } Host = Server.Hostname; Port = Server.Port; // TODO: use config for single network chat or once per network manager NetworkChat = Session.CreateChat( NetworkID, String.Format("{0} {1}", Protocol, Host), this ); Session.AddChat(NetworkChat); if (Host.EndsWith("facebook.com") && !(this is FacebookProtocolManager)) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendMessage(_("This engine has native Facebook support, you should be using it instead of connecting to facebook with xmpp")); // cannot use AddMessageToFrontend because NetworkChat is not yet synced, causing AddMessageToFrontend to drop it. // cannot sync NetworkChat before this, because then the sync would swallow the message Session.AddMessageToChat(NetworkChat, builder.ToMessage()); } Session.SyncChat(NetworkChat); Connect(); } [MethodImpl(MethodImplOptions.Synchronized)] void Connect() { Trace.Call(); Contacts.Clear(); AutoReconnect = true; AutoReconnectDelay = TimeSpan.FromMinutes(1); ApplyConfig(Session.UserConfig, Server); OpenContactChat(); #if LOG4NET _Logger.Debug("calling JabberClient.Open()"); #endif JabberClient.Open(); } [MethodImpl(MethodImplOptions.Synchronized)] public override void Reconnect(FrontendManager fm) { Trace.Call(fm); // IsConnected checks for a working xmpp connection // we need to know the socket's state here if (JabberClient.XmppConnectionState != XmppConnectionState.Disconnected) { AutoReconnect = true; AutoReconnectDelay = TimeSpan.Zero; JabberClient.Close(); } else { JabberClient.ClientSocket.OnValidateCertificate -= ValidateCertificate; JabberClient.SocketConnectionType = SocketConnectionType.Direct; Reconnect(); } } [MethodImpl(MethodImplOptions.Synchronized)] public override void Disconnect(FrontendManager fm) { Trace.Call(fm); AutoReconnect = false; JabberClient.Close(); } [MethodImpl(MethodImplOptions.Synchronized)] public override void Dispose() { Trace.Call(); IsDisposed = true; base.Dispose(); AutoReconnect = false; JabberClient.OnMessage -= OnMessage; JabberClient.OnClose -= OnClose; JabberClient.OnLogin -= OnLogin; JabberClient.OnError -= OnError; JabberClient.OnStreamError -= OnStreamError; JabberClient.OnPresence -= OnPresence; JabberClient.OnRosterItem -= OnRosterItem; JabberClient.OnReadXml -= OnReadXml; JabberClient.OnWriteXml -= OnWriteXml; JabberClient.OnAuthError -= OnAuthError; JabberClient.ClientSocket.OnValidateCertificate -= ValidateCertificate; JabberClient.SendingServiceUnavailable -= OnSendingServiceUnavailable; JabberClient.SocketDisconnect(); } // this method is used as status / title public override string ToString() { var status = String.Format("{0} ({1})", JabberClient.Server, Protocol); if (!IsConnected) { status += " (" + _("not connected") + ")"; } return status; } DiscoItems ServerDiscoItems { get; set; } List CachedMucJids { get; set; } Dictionary CachedMucInfo { get; set; } DateTime CachedMucJidsTimeStamp { get; set; } // no need to synchronize this method as it only checks for null public override IList FindGroupChats(GroupChatModel filter) { Trace.Call(filter); var list = new List(); if (ContactChat == null) { list.Add(new GroupChatModel("Contacts", "Contacts", this)); } // find all transport/conference groups/whatnot DiscoItem[] discoItems; if (ServerDiscoItems == null) { var reset = new AutoResetEvent(false); lock (this) { Disco.DiscoverItems(JabberClient.Server, (sender, e) => FindGroupChatsDiscoItems(e, reset)); } reset.WaitOne(); } lock (this) { if (ServerDiscoItems == null) { return list; } else { discoItems = ServerDiscoItems.GetDiscoItems(); } } var resetList = new List(); if ((CachedMucJids == null) || ((DateTime.Now - CachedMucJidsTimeStamp) > TimeSpan.FromMinutes(5))) { // find all conference groups var mucList = new List(); foreach (var discoItem in discoItems) { var reset = new AutoResetEvent(false); var jid = discoItem.Jid; lock (this) { Disco.DiscoverInformation(discoItem.Jid, (sender, e) => FindGroupChatsItemDiscoInfo(e, reset, mucList, jid)); } resetList.Add(reset); } foreach (var reset in resetList) { reset.WaitOne(); } resetList.Clear(); // find all chats in all conference groups var jidList = new List(); foreach (var mucGroup in mucList) { var reset = new AutoResetEvent(false); lock (this) { Disco.DiscoverItems(mucGroup, (sender, e) => FindGroupChatsDiscoMucs(e, reset, jidList)); } resetList.Add(reset); } foreach (var reset in resetList) { reset.WaitOne(); } CachedMucJids = jidList; CachedMucJidsTimeStamp = DateTime.Now; CachedMucInfo = new Dictionary(); } // filter found items var filteredList = new List(); if (filter == null || String.IsNullOrEmpty(filter.Name)) { filteredList = CachedMucJids; } else { string searchPattern = null; if (!filter.Name.StartsWith("*") && !filter.Name.EndsWith("*")) { searchPattern = String.Format("*{0}*", filter.Name); } else { searchPattern = filter.Name; } foreach (var jid in CachedMucJids) { if (!Pattern.IsMatch(jid, searchPattern)) { continue; } filteredList.Add(jid); } } // get info on all chats matching the pattern resetList.Clear(); foreach (var jid in CachedMucJids) { bool isCached = false; DiscoInfo info; lock (this) { isCached = CachedMucInfo.TryGetValue(jid, out info); } if (isCached) { FindGroupChatsChatInfoParse(jid, info, list); continue; } var reset = new AutoResetEvent(false); lock (this) { Disco.DiscoverInformation(jid, (sender, e) => FindGroupChatsChatInfo(e, reset, list)); } resetList.Add(reset); } foreach (var reset in resetList) { reset.WaitOne(); } return list; } void FindGroupChatsChatInfoParse(Jid jid, DiscoInfo items, List list) { var ident = items.SelectSingleElement(); string name; if (ident != null && !String.IsNullOrEmpty(ident.Name)) { name = ident.Name + " [" + jid + "]"; } else { name = jid; } var chat = new GroupChatModel(jid, name, null); chat.PersonCount = -1; var x = items.SelectSingleElement(); if (x != null) { var users_field = x.GetField("muc#roominfo_occupants"); var topic_field = x.GetField("muc#roominfo_subject"); var desc_field = x.GetField("muc#roominfo_description"); if (users_field != null) { chat.PersonCount = int.Parse(users_field.GetValue()); } if (topic_field != null) { chat.Topic = new MessageModel(topic_field.GetValue()); } else if (desc_field != null) { chat.Topic = new MessageModel(desc_field.GetValue()); } } lock (list) { list.Add(chat); } } void FindGroupChatsChatInfo(IQEventArgs e, AutoResetEvent reset, List list) { if (e.IQ.Error == null) { var items = (DiscoInfo)e.IQ.Query; lock (this) { CachedMucInfo[e.IQ.From] = items; } FindGroupChatsChatInfoParse(e.IQ.From, items, list); } e.Handled = true; reset.Set(); } void FindGroupChatsDiscoMucs(IQEventArgs e, AutoResetEvent reset, List list) { if (e.IQ.Error == null) { var items = (DiscoItems)e.IQ.Query; foreach (var item in items.GetDiscoItems()) { // no locking required, these callbacks are sequential list.Add(item.Jid); } } e.Handled = true; reset.Set(); } void FindGroupChatsItemDiscoInfo(IQEventArgs e, AutoResetEvent reset, List mucList, Jid jid) { if (e.IQ.Error == null) { var discoInfo = (DiscoInfo)e.IQ.Query; if (discoInfo.HasFeature(agsXMPP.Uri.MUC)) { // no locking required, these callbacks are sequential mucList.Add(jid); } } e.Handled = true; reset.Set(); } void FindGroupChatsDiscoItems(IQEventArgs e, AutoResetEvent reset) { if (e.IQ.Error == null) { lock (this) { ServerDiscoItems = (DiscoItems)e.IQ.Query; } } e.Handled = true; reset.Set(); } [MethodImpl(MethodImplOptions.Synchronized)] public void OpenContactChat() { if (ContactChat == null) { ContactChat = Session.CreateChat( "Contacts", "Contacts", this ); Session.AddChat(ContactChat); } else if (!ContactChat.IsEnabled) { Session.EnableChat(ContactChat); } else { // already open return; } foreach (var pair in Contacts) { if (pair.Value.Resources.Count != 0) { ContactChat.UnsafePersons.Add(pair.Key, pair.Value.ToPersonModel()); } } // HACK: lower probability of sync race condition during connect ThreadPool.QueueUserWorkItem(delegate { Thread.Sleep(5000); lock (this) { if (IsDisposed) { return; } if (ContactChat != null) { Session.SyncChat(ContactChat); } } }); } // no need to synchronize as no members are accessed public override void OpenChat(FrontendManager fm, ChatModel chat) { Trace.Call(fm, chat); if (chat.ID == "Contacts") { OpenContactChat(); return; } CommandModel cmd = new CommandModel(fm, NetworkChat, chat.ID); switch (chat.ChatType) { case ChatType.Person: CommandMessageQuery(cmd); break; case ChatType.Group: CommandJoin(cmd); break; } } [MethodImpl(MethodImplOptions.Synchronized)] public override void CloseChat(FrontendManager fm, ChatModel chat) { Trace.Call(fm, chat); if (chat == ContactChat) { Session.RemoveChat(chat); ContactChat = null; } else if (chat.ChatType == ChatType.Group) { if (IsConnected) { MucManager.LeaveRoom(chat.ID, ((XmppGroupChatModel)chat).OwnNickname); } else { Session.RemoveChat(chat); } } else if (chat.ChatType == ChatType.Person) { Session.RemoveChat(chat); } else { #if LOG4NET _Logger.Error("CloseChat(): Invalid chat type"); #endif } } [MethodImpl(MethodImplOptions.Synchronized)] public override void SetPresenceStatus(PresenceStatus status, string message) { Trace.Call(status, message); if (!IsConnected) { return; } switch (status) { case PresenceStatus.Online: JabberClient.Show = ShowType.NONE; JabberClient.Priority = Server.Priorities[status]; JabberClient.Status = message; break; case PresenceStatus.Away: JabberClient.Priority = Server.Priorities[status]; JabberClient.Show = ShowType.away; JabberClient.Status = message; break; } JabberClient.SendMyPresence(); } [MethodImpl(MethodImplOptions.Synchronized)] public void CommandRegister(CommandModel command) { Trace.Call(command); Connect(); JabberClient.RegisterAccount = true; // TODO: add callbacks to process in case of error or success } public override bool Command(CommandModel command) { bool handled = false; if (IsConnected) { if (command.IsCommand) { switch (command.Command) { case "help": CommandHelp(command); handled = true; break; case "msg": case "query": CommandMessageQuery(command); handled = true; break; case "me": CommandMe(command); handled = true; break; case "say": CommandSay(command); handled = true; break; case "joinas": CommandJoinAs(command); handled = true; break; case "join": CommandJoin(command); handled = true; break; case "invite": CommandInvite(command); handled = true; break; case "part": case "leave": CommandPart(command); handled = true; break; case "away": CommandAway(command); handled = true; break; case "roster": CommandRoster(command); handled = true; break; case "contact": CommandContact(command); handled = true; break; case "priority": CommandPriority(command); handled = true; break; case "whois": CommandWhoIs(command); handled = true; break; case "register": CommandRegister(command); handled = true; break; } } else { _Say(command.Chat, command.Data); handled = true; } } else { if (command.IsCommand) { // commands which work even without beeing connected switch (command.Command) { case "help": CommandHelp(command); handled = true; break; case "connect": CommandConnect(command); handled = true; break; } } else { // normal text, without connection NotConnected(command); handled = true; } } return handled; } public void CommandMe(CommandModel command) { if (command.Data.Length <= 4) { return; } string actionstring = command.Data.Substring(3); // http://xmpp.org/extensions/xep-0245.html // says we should append "/me " no matter what our command char is _Say(command.Chat, "/me" + actionstring, true, false); // groupchat echos messages anyway if (command.Chat.ChatType == ChatType.Person) { var builder = CreateMessageBuilder(); builder.AppendActionPrefix(); builder.AppendIdendityName(Me); builder.AppendText(actionstring); Session.AddMessageToChat(command.Chat, builder.ToMessage()); } } [MethodImpl(MethodImplOptions.Synchronized)] void printResource(MessageBuilder builder, XmppResourceModel res) { builder.AppendText("\n\tName: {0}", res.Name); var pres = res.Presence; builder.AppendText("\n\tPresence:"); builder.AppendText("\n\t\tShow:\t{0}", pres.Show); builder.AppendText("\n\t\tStatus:\t{0}", pres.Status); builder.AppendText("\n\t\tLast:\t{0}", (pres.Last!=null)?pres.Last.Seconds.ToString():""); builder.AppendText("\n\t\tPriority:\t{0}", pres.Priority); builder.AppendText("\n\t\tType:\t{0}", pres.Type); builder.AppendText("\n\t\tXDelay:\t{0}", (pres.XDelay!=null)?pres.XDelay.Stamp.ToString():""); if (res.Disco != null) { builder.AppendText("\n\tFeatures:"); foreach(var feat in res.Disco.GetFeatures()) { builder.AppendText("\n\t\t{0}", feat.Var); } } } [MethodImpl(MethodImplOptions.Synchronized)] public void CommandWhoIs(CommandModel cmd) { Jid jid; if (cmd.DataArray.Length < 2) { if ((cmd.DataArray.Length == 1) && (cmd.Chat is PersonChatModel)) { jid = (cmd.Chat as PersonChatModel).Person.ID; } else { NotEnoughParameters(cmd); return; } } else { jid = GetJidFromNickname(cmd.DataArray[1]); } XmppPersonModel person; var builder = CreateMessageBuilder(); if (!Contacts.TryGetValue(jid.Bare, out person)) { builder.AppendErrorText(_("Could not find contact {0}"), jid); Session.AddMessageToFrontend(cmd, builder.ToMessage()); return; } if (!String.IsNullOrEmpty(jid.Resource)) { if (person.Resources.Count > 1) { builder.AppendText(_("Contact {0} has {1} known resources"), jid.Bare, person.Resources.Count); } XmppResourceModel res; if (!person.Resources.TryGetValue(jid.Resource??"", out res)) { builder.AppendErrorText(_("{0} is not a known resource"), jid.Resource); Session.AddMessageToFrontend(cmd, builder.ToMessage()); return; } printResource(builder, res); Session.AddMessageToFrontend(cmd, builder.ToMessage()); return; } builder.AppendText(_("Contact's Jid: {0}"), person.Jid); builder.AppendText("\n"); switch (person.Subscription) { case SubscriptionType.both: builder.AppendText(_("You have a mutual subscription with this contact")); break; case SubscriptionType.none: builder.AppendText(_("You have no subscription with this contact and this contact is not subscribed to you")); break; case SubscriptionType.to: builder.AppendText(_("You are subscribed to this contact, but the contact is not subcribed to you")); break; case SubscriptionType.from: builder.AppendText(_("You are not subscribed to this contact, but the contact is subcribed to you")); break; case SubscriptionType.remove: #if LOG4NET _Logger.Debug("a contact with SubscriptionType remove has been found"); #endif break; } int i = 0; foreach(var res in person.Resources) { builder.AppendText("\nResource({0}):", i); printResource(builder, res.Value); i++; } Session.AddMessageToFrontend(cmd, builder.ToMessage()); } [MethodImpl(MethodImplOptions.Synchronized)] public void CommandContact(CommandModel cd) { FrontendManager fm = cd.FrontendManager; // todo: allow length of 2 in private chat windows if (cd.DataArray.Length < 3) { NotEnoughParameters(cd); return; } Jid jid = GetJidFromNickname(cd.DataArray[2]); string cmd = cd.DataArray[1]; // the logic here is taken from // http://xmpp.org/rfcs/rfc3921.html#int switch (cmd) { case "addgroup": if (cd.DataArray.Length < 4) { NotEnoughParameters(cd); return; } JabberClient.RosterManager.AddRosterItem(jid, null, cd.DataArray[3]); break; case "addonly": JabberClient.RosterManager.AddRosterItem(jid); break; case "add": XmppPersonModel person; if (Contacts.TryGetValue(jid.Bare, out person)) { if (person.Subscription == SubscriptionType.both) break; if (person.Subscription != SubscriptionType.to) { JabberClient.PresenceManager.Subscribe(jid); } if (person.Subscription != SubscriptionType.from) { // in case we already know this contact… but he can't see us JabberClient.PresenceManager.ApproveSubscriptionRequest(jid); } } else { JabberClient.RosterManager.AddRosterItem(jid); JabberClient.PresenceManager.Subscribe(jid); JabberClient.PresenceManager.ApproveSubscriptionRequest(jid); } break; case "subscribe": JabberClient.PresenceManager.Subscribe(jid); break; case "unsubscribe": // stop receiving status updates from this contact // that contact will still receive your updates JabberClient.PresenceManager.Unsubscribe(jid); break; case "remove": case "rm": case "del": case "delete": JabberClient.RosterManager.RemoveRosterItem(jid); // unsubscribing is unnecessary, the server is required to do this break; case "accept": case "allow": case "approve": case "auth": case "authorize": JabberClient.PresenceManager.ApproveSubscriptionRequest(jid); break; case "deny": case "refuse": // stop the contact from receiving your updates // you will still receive the contact's status updates JabberClient.PresenceManager.RefuseSubscriptionRequest(jid); break; case "rename": if (cd.DataArray.Length < 4) { JabberClient.RosterManager.UpdateRosterItem(jid, ""); } else { var newNick = String.Join(" ", cd.DataArray.Skip(3).ToArray()); JabberClient.RosterManager.UpdateRosterItem(jid, newNick); } break; default: var builder = CreateMessageBuilder(); builder.AppendText(_("Invalid Contact command: {0}"), cmd); Session.AddMessageToFrontend(cd, builder.ToMessage()); return; } } public void CommandHelp(CommandModel cmd) { var builder = CreateMessageBuilder(); // TRANSLATOR: this line is used as a label / category for a // list of commands below builder.AppendHeader(_("{0} Commands"), Protocol); Session.AddMessageToFrontend(cmd, builder.ToMessage()); string[] help = { "connect xmpp/jabber server port username password [resource]", "msg/query jid/nick message", "say message", "join muc-jid [password]", "part/leave [muc-jid]", "away [away-message]", "roster [full]", "contact add/remove jid/nick", "contact rename jid/nick [newnick]" }; foreach (string line in help) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(line); Session.AddMessageToFrontend(cmd, builder.ToMessage()); } // TRANSLATOR: this line is used as a label / category for a // list of commands below builder = CreateMessageBuilder(); builder.AppendHeader(_("Advanced {0} Commands"), Protocol); Session.AddMessageToFrontend(cmd, builder.ToMessage()); string[] help2 = { "contact addonly/subscribe/unsubscribe/approve/deny", "whois jid", "joinas muc-jid nickname [password]", "priority away/online/temp priority-value" }; foreach (string line in help2) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(line); Session.AddMessageToFrontend(cmd, builder.ToMessage()); } } public void CommandConnect(CommandModel cd) { FrontendManager fm = cd.FrontendManager; var server = new XmppServerModel(); if (cd.DataArray.Length >= 3) { server.Hostname = cd.DataArray[2]; } else { NotEnoughParameters(cd); return; } if (cd.DataArray.Length >= 4) { try { server.Port = Int32.Parse(cd.DataArray[3]); } catch (FormatException) { var builder = CreateMessageBuilder(); builder.AppendText(_("Invalid port: {0}"), cd.DataArray[3]); Session.AddMessageToFrontend(cd, builder.ToMessage()); return; } } else { NotEnoughParameters(cd); return; } if (cd.DataArray.Length >= 5) { server.Username = cd.DataArray[4]; } else { NotEnoughParameters(cd); return; } if (cd.DataArray.Length >= 6) { server.Password = cd.DataArray[5]; } else { NotEnoughParameters(cd); return; } if (cd.DataArray.Length >= 7) { server.Resource = cd.DataArray[6]; } Connect(fm, server); } [MethodImpl(MethodImplOptions.Synchronized)] public void CommandPriority(CommandModel command) { if (command.DataArray.Length < 3) { var builder = CreateMessageBuilder(); builder.AppendText(_("Priority for Available is: {0}"), Server.Priorities[PresenceStatus.Online]); Session.AddMessageToFrontend(command, builder.ToMessage()); builder = CreateMessageBuilder(); builder.AppendText(_("Priority for Away is: {0}"), Server.Priorities[PresenceStatus.Away]); Session.AddMessageToFrontend(command, builder.ToMessage()); return; } string subcmd = command.DataArray[1]; int prio; if (!int.TryParse(command.DataArray[2], out prio) || prio < -128 || prio > 127) { var builder = CreateMessageBuilder(); builder.AppendText(_("Invalid Priority: {0} (valid priorities are between -128 and 127 inclusive)"), command.DataArray[2]); Session.AddMessageToFrontend(command, builder.ToMessage()); return; } JabberClient.Priority = prio; bool change_current_prio = false; switch (subcmd) { case "temp": case "temporary": change_current_prio = true; // only set priority break; case "away": Server.Priorities[PresenceStatus.Away] = prio; change_current_prio = (JabberClient.Show == ShowType.away); JabberClient.Priority = prio; break; case "online": case "available": Server.Priorities[PresenceStatus.Online] = prio; change_current_prio = (JabberClient.Show == ShowType.NONE); JabberClient.Priority = prio; break; default: return; } if (change_current_prio) { // set priority and keep all other presence info JabberClient.SendMyPresence(); } } [MethodImpl(MethodImplOptions.Synchronized)] Jid GetJidFromNickname(string nickname) { XmppPersonModel it; Jid jid = nickname; if (Contacts.TryGetValue(jid, out it)) { // nickname is a jid we know return jid; } if (Contacts.TryGetValue(jid.Bare, out it)) { // is a jid with resource return jid; } // arg is not a jid in our rostermanager // find a jid to which the nickname belongs foreach (var pair in Contacts) { if (pair.Value.IdentityName != null && pair.Value.IdentityName.Replace(" ", "_") == nickname) { return pair.Key; } } // not found in roster, message directly to jid // TODO: check jid for validity return jid; } [MethodImpl(MethodImplOptions.Synchronized)] void MessageQuery(Jid jid, string message) { var chat = GetOrCreatePersonChat(jid); if (message != null && message.Trim().Length > 0) { _Say(chat, message); } } public void CommandMessageQuery(CommandModel cd) { if (cd.DataArray.Length < 2) { NotEnoughParameters(cd); return; } Jid jid = GetJidFromNickname(cd.DataArray[1]); if (cd.DataArray.Length >= 3) { // we have a message string message = String.Join(" ", cd.DataArray, 2, cd.DataArray.Length-2); MessageQuery(jid, message); } else { MessageQuery(jid, null); } } public void CommandJoin(CommandModel cd) { if (cd.DataArray.Length < 2) { NotEnoughParameters(cd); return; } string password = null; if (cd.DataArray.Length > 2) { password = cd.DataArray[2]; } JoinRoom(cd.DataArray[1], null, password); } [MethodImpl(MethodImplOptions.Synchronized)] void JoinRoom(Jid jid, string nickname, string password) { XmppGroupChatModel chat = (XmppGroupChatModel)GetChat(jid, ChatType.Group); if (nickname == null) { nickname = Nicknames[0]; } if (chat == null) { chat = Session.CreateChat(jid, jid, this); Session.AddChat(chat); } if (chat.IsJoining) { // double call to JoinRoom return; } chat.IsJoining = true; MucManager.JoinRoom(jid, nickname, password); if (password != null) { chat.Password = password; } chat.IsSynced = false; chat.OwnNickname = nickname; } public void CommandJoinAs(CommandModel cd) { if (cd.DataArray.Length < 3) { NotEnoughParameters(cd); return; } string password = null; if (cd.DataArray.Length > 3) { password = cd.DataArray[3]; } JoinRoom(cd.DataArray[1], cd.DataArray[2], password); } [MethodImpl(MethodImplOptions.Synchronized)] public void CommandPart(CommandModel cd) { string jid; if (cd.DataArray.Length >= 2) jid = cd.DataArray[1]; else jid = cd.Chat.ID; XmppGroupChatModel chat = (XmppGroupChatModel)GetChat(jid, ChatType.Group); if (chat != null) { MucManager.LeaveRoom(jid, chat.OwnNickname); } } public void CommandInvite(CommandModel cd) { if (cd.DataArray.Length < 3) { NotEnoughParameters(cd); return; } string password = null; if (cd.DataArray.Length > 3) { password = cd.DataArray[3]; } Invite(cd.DataArray[2], cd.DataArray[1], null, password); } void Invite(Jid jid, Jid room, string reason, string password) { Invite(new Jid[]{jid}, room, reason, password); } void Invite(string[] jids_string, string room, string reason, string password) { var jids = new Jid[jids_string.Length]; for (int i = 0; i < jids.Length; i++) { jids[i] = jids_string[i]; } Invite(jids, room, reason, password); } [MethodImpl(MethodImplOptions.Synchronized)] void Invite(Jid[] jid, Jid room, string reason, string password) { JoinRoom(room, null, password); XmppGroupChatModel chat = (XmppGroupChatModel)GetChat(room, ChatType.Group); // if no password is passed, but we are already in the chatroom and know // about a password, use that password if (password == null && chat != null) { password = chat.Password; } MucManager.Invite(jid, room, reason, password); } public void CommandAway(CommandModel cd) { if (cd.DataArray.Length >= 2) { SetPresenceStatus(PresenceStatus.Away, cd.Parameter); } else { SetPresenceStatus(PresenceStatus.Online, null); } } [MethodImpl(MethodImplOptions.Synchronized)] public void CommandRoster(CommandModel cd) { bool full = false; if (cd.Parameter == "full") { full = true; } MessageBuilder builder = CreateMessageBuilder(); builder.AppendHeader("Roster"); Session.AddMessageToFrontend(cd, builder.ToMessage()); foreach (var pair in Contacts) { string status = "+"; var contact = pair.Value; if (contact.Resources.Count == 0) { if (!full) { continue; } status = "-"; } builder = CreateMessageBuilder(); builder.AppendText("{0} {1}\t({2}): {3},{4}", status, contact.IdentityName, pair.Key, contact.Subscription, contact.Ask ); foreach (var p in contact.Resources) { builder.AppendText("\t|\t{0}:{1}:{2}", p.Key, p.Value.Presence.Type.ToString(), p.Value.Presence.Priority ); if (!String.IsNullOrEmpty(p.Value.Presence.Status)) { builder.AppendText(":\"{0}\"", p.Value.Presence.Status); } } Session.AddMessageToFrontend(cd, builder.ToMessage()); } } public void CommandSay(CommandModel cd) { _Say(cd.Chat, cd.Parameter); } void _Say(ChatModel chat, string text) { _Say(chat, text, true); } void _Say(ChatModel chat, string text, bool send) { _Say(chat, text, send, true); } [MethodImpl(MethodImplOptions.Synchronized)] void _Say(ChatModel chat, string text, bool send, bool display) { if (!chat.IsEnabled) { return; } if (chat == ContactChat) { return; } if (send) { if (chat.ChatType == ChatType.Person) { var _person = (chat as PersonChatModel).Person as PersonModel; XmppPersonModel person = GetOrCreateContact(_person.ID, _person.IdentityName); SendPrivateMessage(person, text); } else if (chat.ChatType == ChatType.Group) { JabberClient.Send(new Message(chat.ID, XmppMessageType.groupchat, text)); return; // don't show now. the message will be echoed back if it's sent successfully } } var builder = CreateMessageBuilder(); builder.AppendSenderPrefix(Me); builder.AppendMessage(text); var msg = builder.ToMessage(); if (display) { Session.AddMessageToChat(chat, msg); } OnMessageSent( new MessageEventArgs(chat, msg, null, chat.ID) ); } [MethodImpl(MethodImplOptions.Synchronized)] void SendPrivateMessage(XmppPersonModel person, Jid jid, string text) { var mesg = new Message(jid, XmppMessageType.chat, text); XmppResourceModel res; if (person.Resources.TryGetValue(jid.Resource ?? "", out res)) { if (res.NicknameContactKnowsFromMe != Nicknames[0]) { res.NicknameContactKnowsFromMe = Nicknames[0]; mesg.Nickname = new Nickname(Nicknames[0]); } } JabberClient.Send(mesg); } [MethodImpl(MethodImplOptions.Synchronized)] void SendPrivateMessage(XmppPersonModel person, string text) { Jid jid = person.Jid; if ((jid.Server == "gmail.com") || (jid.Server == "googlemail.com")) { // don't send to all high prio resources or to specific resources // because gtalk clones any message to all resources anyway SendPrivateMessage(person, jid.Bare, text); } else if (!String.IsNullOrEmpty(jid.Resource)) { SendPrivateMessage(person, jid, text); } else { var resources = person.GetResourcesWithHighestPriority(); if (resources.Count == 0) { // no connected resource, send to bare jid SendPrivateMessage(person, jid.Bare, text); } else { foreach (var res in resources) { Jid j = new Jid(jid); j.Resource = res.Name; SendPrivateMessage(person, j, text); } } } } void OnReadXml(object sender, string text) { if (!DebugProtocol) { return; } try { var strWriter = new StringWriter(); var xmlWriter = new XmlTextWriter(strWriter); xmlWriter.Formatting = Formatting.Indented; xmlWriter.Indentation = 2; xmlWriter.IndentChar = ' '; var document = new XmlDocument(); document.LoadXml(text); document.WriteContentTo(xmlWriter); DebugRead("\n" + strWriter.ToString()); } catch (XmlException) { DebugRead("\n" + text); } catch (Exception ex) { #if LOG4NET _Logger.Error("OnProtocol(): Exception", ex); #endif } } void OnWriteXml(object sender, string text) { if (!DebugProtocol) { return; } try { if (text == null || text.Trim().Length == 0) { // suppress logging keep-alive messages return; } var strWriter = new StringWriter(); var xmlWriter = new XmlTextWriter(strWriter); xmlWriter.Formatting = Formatting.Indented; xmlWriter.Indentation = 2; xmlWriter.IndentChar = ' '; var document = new XmlDocument(); document.LoadXml(text); document.WriteContentTo(xmlWriter); DebugWrite("\n" + strWriter.ToString()); } catch (XmlException) { // HACK: in case of an invalid doucment fallback to // plain string logging DebugWrite("\n" + text); } catch (Exception ex) { #if LOG4NET _Logger.Error("OnWriteText(): Exception", ex); #endif } } [MethodImpl(MethodImplOptions.Synchronized)] XmppPersonModel GetOrCreateContact(Jid jid, string name) { XmppPersonModel p; if (!Contacts.TryGetValue(jid.Bare, out p)) { p = new XmppPersonModel(jid, name, this); Contacts[jid.Bare] = p; } return p; } [MethodImpl(MethodImplOptions.Synchronized)] void OnRosterItem(object sender, RosterItem rosterItem) { // setting to none also removes the person from chat, as we'd never get an offline message anymore if (rosterItem.Subscription == SubscriptionType.none || rosterItem.Subscription == SubscriptionType.remove) { if (rosterItem.Subscription == SubscriptionType.remove) { Contacts.Remove(rosterItem.Jid); } if (ContactChat == null) { return; } PersonModel oldp = ContactChat.GetPerson(rosterItem.Jid); if (oldp == null) { // doesn't exist, don't need to do anything return; } Session.RemovePersonFromGroupChat(ContactChat, oldp); return; } // create or update a roster item var contact = GetOrCreateContact(rosterItem.Jid.Bare, rosterItem.Name ?? rosterItem.Jid); contact.Temporary = false; contact.Subscription = rosterItem.Subscription; contact.Ask = rosterItem.Ask; string oldIdentityName = contact.IdentityName; var oldIdentityNameColored = contact.IdentityNameColored; contact.IdentityName = rosterItem.Name ?? rosterItem.Jid; if (oldIdentityName == contact.IdentityName) { // identity name didn't change // the rest of this function only handles changed identity names return; } contact.IdentityNameColored = null; // uncache ProcessIdentityNameChanged(contact, oldIdentityNameColored, oldIdentityName); } void ProcessIdentityNameChanged(XmppPersonModel contact, TextMessagePartModel oldIdentityNameColored, string oldIdentityName) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); string idstring = (oldIdentityName == contact.Jid.Bare)?"":GenerateIdString(contact); oldIdentityNameColored.BackgroundColor = TextColor.None; builder.AppendFormat("{2}{1} is now known as {0}", contact, idstring, oldIdentityNameColored); if (ContactChat != null) { PersonModel oldp = ContactChat.GetPerson(contact.ID); if (oldp != null) { Session.UpdatePersonInGroupChat(ContactChat, oldp, contact.ToPersonModel()); Session.AddMessageToChat(ContactChat, new MessageModel(builder.ToMessage())); } } var chat = Session.GetChat(contact.ID, ChatType.Person, this) as PersonChatModel; if (chat != null) { chat.Name = contact.IdentityName; builder.MessageType = MessageType.ChatNameChanged; var msg = builder.ToMessage(); Session.AddMessageToChat(chat, msg); chat.Person = contact.ToPersonModel(); var msg2 = new MessageModel(msg); msg2.MessageType = MessageType.PersonChatPersonChanged; Session.AddMessageToChat(chat, msg2); } } protected virtual string GenerateIdString(PersonModel contact) { if (contact.ID == contact.IdentityName) { return ""; } var jid = new Jid(contact.ID); return String.Format(" [{0}]", jid.Bare); } void RequestCapabilities(Jid jid, Capabilities caps) { string hash = caps.Node + "#" + caps.Version; RequestCapabilities(jid, hash); } [MethodImpl(MethodImplOptions.Synchronized)] void RequestCapabilities(Jid jid, string hash) { // already in cache? DiscoInfo info; if (DiscoCache.TryGetValue(hash, out info)) { AddCapabilityToResource(jid, info); return; } // prevent duplicate requests DiscoCache[hash] = null; // request it Disco.DiscoverInformation(jid, (object sender, IQEventArgs e) => OnDiscoInfo(e, hash) ); } [MethodImpl(MethodImplOptions.Synchronized)] void AddCapabilityToResource(Jid jid, DiscoInfo info) { XmppPersonModel contact; if (!Contacts.TryGetValue(jid.Bare, out contact)) { return; } XmppResourceModel res; if (!contact.Resources.TryGetValue(jid.Resource??"", out res)) { return; } res.Disco = info; } [MethodImpl(MethodImplOptions.Synchronized)] void OnDiscoInfo(IQEventArgs e, string hash) { if (e.IQ.Error != null) { #if LOG4NET _Logger.DebugFormat("An error happened during service discovery: {0}", e.IQ); #endif // clear item from cache so the request is done again some time DiscoCache.Remove(hash); e.Handled = true; return; } if (e.IQ.Type != IqType.result) { #if LOG4NET _Logger.Debug("OnDiscoInfo(): iq is not a result"); #endif return; } if (!(e.IQ.Query is DiscoInfo)) { #if LOG4NET _Logger.Debug("OnDiscoInfo(): query is not a DiscoInfo"); #endif return; } var info = (DiscoInfo)e.IQ.Query; DiscoCache[hash] = info; e.Handled = true; if (String.IsNullOrEmpty(e.IQ.From.User)) { // server capabilities var builder = CreateMessageBuilder(); builder.AppendText("The Server supports the following features: "); Session.AddMessageToChat(NetworkChat, builder.ToMessage()); foreach (var feature in info.GetFeatures()) { builder = CreateMessageBuilder(); builder.AppendText(feature.Var); Session.AddMessageToChat(NetworkChat, builder.ToMessage()); } } else { AddCapabilityToResource(e.IQ.From, info); } } [MethodImpl(MethodImplOptions.Synchronized)] MessageModel CreatePresenceUpdateMessage(Jid jid, PersonModel person, Presence pres) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); string idstring = GenerateIdString(person); // print the type (and in case of available detailed type) switch (pres.Type) { case PresenceType.available: switch(pres.Show) { case ShowType.NONE: builder.AppendFormat(_("{0}{1} is available"), person, idstring); builder.AppendPresenceState(person, MessageType.PresenceStateOnline); break; case ShowType.away: builder.AppendFormat(_("{0}{1} is away"), person, idstring); builder.AppendPresenceState(person, MessageType.PresenceStateAway); break; case ShowType.xa: builder.AppendFormat(_("{0}{1} is extended away"), person, idstring); builder.AppendPresenceState(person, MessageType.PresenceStateAway); break; case ShowType.dnd: builder.AppendFormat(_("{0}{1} wishes not to be disturbed"), person, idstring); builder.AppendPresenceState(person, MessageType.PresenceStateAway); break; case ShowType.chat: builder.AppendFormat(_("{0}{1} wants to chat"), person, idstring); builder.AppendPresenceState(person, MessageType.PresenceStateOnline); break; } break; case PresenceType.unavailable: builder.AppendPresenceState(person, MessageType.PresenceStateOffline); builder.AppendFormat(_("{0}{1} is offline"), person, idstring); break; case PresenceType.subscribe: if ((person as XmppPersonModel).Ask == AskType.subscribe) { builder = CreateMessageBuilder(); builder.AppendActionPrefix(); builder.AppendFormat(_("Automatically allowed {0} to subscribe to you, since you are already asking to subscribe"), person ); } else { builder.AppendFormat(_("{0}{1} wishes to subscribe to you"), person, idstring); // you have to respond builder.MarkAsHighlight(); } break; case PresenceType.subscribed: // you can now see their presences builder.AppendFormat(_("{0}{1} allowed you to subscribe"), person, idstring); break; case PresenceType.unsubscribed: if ((person as XmppPersonModel).Subscription == SubscriptionType.from) { builder = CreateMessageBuilder(); builder.AppendActionPrefix(); builder.AppendFormat( _("Automatically removed {0}'s subscription to " + "your presences after losing the subscription " + "to theirs"), person ); } else { // you cannot (anymore?) see their presences builder.AppendFormat(_("{0}{1} denied/removed your subscription"), person, idstring); } break; case PresenceType.unsubscribe: // you might still be able to see their presences builder.AppendFormat(_("{0}{1} unsubscribed from you"), person, idstring); break; case PresenceType.error: if (pres.Error == null) { builder.AppendErrorText(_("received a malformed error message: {0}"), pres); break; } switch (pres.Error.Type) { case ErrorType.cancel: switch (pres.Error.Condition) { case ErrorCondition.RemoteServerNotFound: builder.AppendErrorText(_("{0}{1}'s server could not be found"), person.IdentityName, idstring); break; case ErrorCondition.Conflict: builder.AppendErrorText(_("{0}{1} is already using your requested resource"), person.IdentityName, idstring); break; default: if (!String.IsNullOrEmpty(pres.Error.ErrorText)) { builder.AppendErrorText(pres.Error.ErrorText); } else { builder.AppendErrorText( _("There is currently no useful error message for {0}, {1}, {2}{3}"), pres.Error.Type, pres.Error.Condition, person.IdentityName, idstring); } break; } break; case ErrorType.auth: switch (pres.Error.Condition) { case ErrorCondition.Forbidden: builder.AppendErrorText( _("You do not have permission to access {0}{1}") , person.IdentityName, idstring); break; default: if (!String.IsNullOrEmpty(pres.Error.ErrorText)) { builder.AppendErrorText(pres.Error.ErrorText); } else { builder.AppendErrorText( _("There is currently no useful error message for {0}, {1}, {2}{3}"), pres.Error.Type, pres.Error.Condition, person.IdentityName, idstring); } break; } break; default: if (!String.IsNullOrEmpty(pres.Error.ErrorText)) { builder.AppendErrorText(pres.Error.ErrorText); } else { builder.AppendErrorText( _("There is currently no useful error message for {0}, {1}, {2}{3}"), pres.Error.Type, pres.Error.Condition, person.IdentityName, idstring); } break; } break; } // print timestamp of presence if (pres.XDelay != null || pres.Last != null) { DateTime stamp = DateTime.MinValue; TimeSpan span = TimeSpan.MinValue; if (pres.XDelay != null) { stamp = pres.XDelay.Stamp; span = DateTime.Now.Subtract(stamp); } else if (pres.Last != null) { span = TimeSpan.FromSeconds(pres.Last.Seconds); stamp = DateTime.Now.Subtract(span); } string spanstr; if (span > TimeSpan.FromDays(1)) { spanstr = String.Format( "{0:00}:{1:00}:{2:00}:{3:00}", span.TotalDays, span.Hours, span.Minutes, span.Seconds ); spanstr = String.Format(_("{0} days"), spanstr); } else if (span > TimeSpan.FromHours(1)) { spanstr = String.Format( "{0:00}:{1:00}:{2:00}", span.Hours, span.Minutes, span.Seconds ); spanstr = String.Format(_("{0} hours"), spanstr); } else if (span > TimeSpan.FromMinutes(1)) { spanstr = String.Format("{0:00}:{1:00}", span.Minutes, span.Seconds); spanstr = String.Format(_("{0} minutes"), spanstr); } else { spanstr = String.Format("{0:00}", span.Seconds); spanstr = String.Format(_("{0} seconds"), spanstr); } string timestamp = null; try { string format = Session.UserConfig["Interface/Notebook/TimestampFormat"] as string; if (!String.IsNullOrEmpty(format)) { timestamp = stamp.ToString(format); } } catch (FormatException e) { timestamp = "Timestamp Format ERROR: " + e.Message; } builder.AppendText(_(" since {0} ({1})"), timestamp, spanstr); } // print user defined message if (pres.Status != null && pres.Status.Trim().Length > 0) { builder.AppendText(": {0}", pres.Status); } return builder.ToMessage(); } [MethodImpl(MethodImplOptions.Synchronized)] void PrintGroupChatPresence(XmppGroupChatModel chat, PersonModel person, Presence pres) { Jid jid = pres.From; var msg = CreatePresenceUpdateMessage(person.ID, person, pres); Session.AddMessageToChat(chat, msg); // clone directly to muc person chat // don't care about real jid, that has its own presence packets var personChat = Session.GetChat(jid, ChatType.Person, this); if (personChat != null) { Session.AddMessageToChat(personChat, msg); } } [MethodImpl(MethodImplOptions.Synchronized)] void OnGroupChatPresence(XmppGroupChatModel chat, Presence pres) { Jid jid = pres.From; var person = new PersonModel(jid, pres.From.Resource, NetworkID, Protocol, this); PrintGroupChatPresence(chat, person, pres); switch (pres.Type) { case PresenceType.available: // don't do anything if the contact already exists if (chat.UnsafePersons.ContainsKey(person.ID)) { return; } // is the chat synced? add the new contact the regular way if (chat.IsSynced) { Session.AddPersonToGroupChat(chat, person); return; } chat.UnsafePersons.Add(person.ID, person); // did I join? then the chat roster is fully received if (pres.From.Resource == chat.OwnNickname) { chat.IsJoining = false; // HACK: lower probability of sync race condition swallowing messages ThreadPool.QueueUserWorkItem(delegate { Thread.Sleep(1000); lock (this) { if (IsDisposed) { return; } chat.IsSynced = true; Session.SyncChat(chat); Session.EnableChat(chat); } }); } break; case PresenceType.unavailable: Session.RemovePersonFromGroupChat(chat, person); // did I leave? then I "probably" left the room if (pres.From.Resource == chat.OwnNickname) { Session.RemoveChat(chat); } break; case PresenceType.error: OnGroupChatPresenceError(chat, pres); break; } } void OnGroupChatPresenceError(XmppGroupChatModel chat, Presence pres) { var builder = CreateMessageBuilder(); if (pres.Error == null) { builder.AppendErrorText(_("An unknown groupchat error occurred: {0}"), pres); Session.AddMessageToChat(NetworkChat, builder.ToMessage()); return; } switch (pres.Error.Type) { case ErrorType.cancel: switch (pres.Error.Condition) { case ErrorCondition.Conflict: // nickname already in use // autorejoin with _ appended to nickname JoinRoom(chat.ID, chat.OwnNickname + "_", chat.Password); return; } break; } if (String.IsNullOrEmpty(pres.Error.ErrorText)) { builder.AppendErrorText(_("An unhandled groupchat error occurred: {0}"), pres); } else { builder.AppendErrorText(_("Error in Groupchat {0}: {1}"), chat.ID, pres.Error.ErrorText); } Session.AddMessageToChat(NetworkChat, builder.ToMessage()); Session.RemoveChat(chat); } [MethodImpl(MethodImplOptions.Synchronized)] void PrintPrivateChatPresence(XmppPersonModel person, Presence pres) { Jid jid = pres.From; XmppResourceModel resource; if (person.Resources.TryGetValue(jid.Resource??"", out resource)) { if (resource.Presence.Show == pres.Show && resource.Presence.Status == pres.Status && resource.Presence.Last == pres.Last && resource.Presence.XDelay == pres.XDelay && resource.Presence.Priority == pres.Priority && resource.Presence.Type == pres.Type ) { // presence didn't change enough to warrent a display message -> abort return; } } MessageModel msg = CreatePresenceUpdateMessage(jid, person, pres); if (!String.IsNullOrEmpty(jid.Resource)) { var directchat = Session.GetChat(jid, ChatType.Person, this); if (directchat != null) { // in case of direct chat we still send this message Session.AddMessageToChat(directchat, msg); } } // a nonexisting resource going offline? if (pres.Type == PresenceType.unavailable) { if (!person.Resources.ContainsKey(jid.Resource??"")) { return; } } var res = person.GetOrCreateResource(jid); var oldpres = res.Presence; res.Presence = pres; // highest pres Jid hjid = jid; Jid nextjid = jid; // 2nd highest pres Presence hpres = pres; Presence nextpres = null; bool amHighest = true; bool wasHighest = true; foreach (var pair in person.Resources) { if (pair.Value == res) continue; if (nextpres == null || pair.Value.Presence.Priority > nextpres.Priority) { nextjid.Resource = pair.Key; nextpres = pair.Value.Presence; } if (pair.Value.Presence.Priority > hpres.Priority) { // someone has a higher priority than I do // print the status of that resource hjid.Resource = pair.Key; hpres = pair.Value.Presence; amHighest = false; } if (oldpres != null && pair.Value.Presence.Priority > oldpres.Priority) { wasHighest = false; } } if (pres.Type == PresenceType.available) { // wasn't and isn't highiest prio -> ignore if (!wasHighest && !amHighest) return; // just another below zero prio -> ignore if (amHighest && pres.Priority < 0) return; // was highest, isn't anymore -> show presence of new highest if (wasHighest && !amHighest) { msg = CreatePresenceUpdateMessage(hjid, person, hpres); } } else if (pres.Type == PresenceType.unavailable) { // still a resource left with positive priority if (nextpres != null && nextpres.Priority >= 0) { msg = CreatePresenceUpdateMessage(nextjid, person, nextpres); } } var chat = Session.GetChat(jid.Bare, ChatType.Person, this); if (chat != null) { Session.AddMessageToChat(chat, msg); } if (ContactChat != null) { Session.AddMessageToChat(ContactChat, msg); } } [MethodImpl(MethodImplOptions.Synchronized)] void OnPrivateChatPresence(Presence pres) { Jid jid = pres.From; if (jid.Bare == JabberClient.MyJID.Bare) { // don't process any of my own resources return; } var person = GetOrCreateContact(jid.Bare, jid); PrintPrivateChatPresence(person, pres); switch (pres.Type) { case PresenceType.available: if (pres.Priority < 0) break; if (ContactChat == null) break; if (ContactChat.UnsafePersons.ContainsKey(jid.Bare)) break; Session.AddPersonToGroupChat(ContactChat, person.ToPersonModel()); break; case PresenceType.unavailable: person.RemoveResource(jid); if (pres.Priority < 0) break; if (ContactChat == null) break; if (!ContactChat.UnsafePersons.ContainsKey(jid.Bare)) break; var pers = ContactChat.GetPerson(jid.Bare); Session.RemovePersonFromGroupChat(ContactChat, pers); break; case PresenceType.subscribe: if (person.Ask == AskType.subscribe) { // we are currently asking the contact OR are subscribed to him // so we allow the contact to subscribe // TODO: make the following dependent on some user setable boolean JabberClient.PresenceManager.ApproveSubscriptionRequest(jid); } break; case PresenceType.subscribed: // we are now able to see that contact's presences break; case PresenceType.unsubscribed: // the contact does not wish us to see his presences anymore if (person.Subscription == SubscriptionType.from) { // but the contact can still see us // TODO: make the following dependent on some user setable boolean JabberClient.PresenceManager.RefuseSubscriptionRequest(jid); } else { // TODO: this contact was just created in OnPresence… prevent it from doing that? // TODO: this can happen when a subscription=none contact sends a deny… Contacts.Remove(jid.Bare); } break; case PresenceType.unsubscribe: // the contact does not wish to see our presence anymore? // we could care less break; } } [MethodImpl(MethodImplOptions.Synchronized)] void OnPresence(object sender, Presence pres) { Trace.Call(sender, pres); Jid jid = pres.From; if (jid == JabberClient.MyJID) return; // we don't care about ourself if (pres.Capabilities != null && pres.Type == PresenceType.available) { // only test capabilities of users going online or changing something in their online state RequestCapabilities(jid, pres.Capabilities); } var groupChat = (XmppGroupChatModel) Session.GetChat(jid.Bare, ChatType.Group, this); if (groupChat != null) { OnGroupChatPresence(groupChat, pres); } else { OnPrivateChatPresence(pres); } } [MethodImpl(MethodImplOptions.Synchronized)] void OnGroupChatMessage(Message msg) { string group_jid = msg.From.Bare; XmppGroupChatModel groupChat = (XmppGroupChatModel) Session.GetChat(group_jid, ChatType.Group, this); // resource can be empty for room messages var sender_id = msg.From.Resource ?? msg.From.Bare; var person = groupChat.GetPerson(sender_id); if (person == null) { // happens in case of a delayed message if the participant has left meanwhile // TODO: or in case of a room message? person = new PersonModel(sender_id, sender_id, NetworkID, Protocol, this); } // XXX maybe only a Google Talk bug requires this: if (msg.XDelay != null) { var stamp = msg.XDelay.Stamp; if (stamp > groupChat.LatestSeenStamp) { groupChat.LatestSeenStamp = stamp; } else { return; // already seen newer delayed message } if (groupChat.SeenNewMessages) { return; // already seen newer messages } } else { groupChat.SeenNewMessages = true; } // mark highlights only for received messages bool hilight = person.ID != groupChat.OwnNickname; var message = CreateMessage(person, msg, hilight, false); Session.AddMessageToChat(groupChat, message); OnMessageReceived( new MessageEventArgs(groupChat, message, msg.From, groupChat.ID) ); } void AddMessageToChatIfNotFiltered(MessageModel msg, ChatModel chat, bool isNew) { if (Session.IsFilteredMessage(chat, msg)) { Session.LogMessage(chat, msg, true); return; } if (isNew) { Session.AddChat(chat); } Session.AddMessageToChat(chat, msg, true); if (isNew) { Session.SyncChat(chat); } } [MethodImpl(MethodImplOptions.Synchronized)] void ProcessNickname(XmppPersonModel person, Nickname nick) { if (String.IsNullOrEmpty(nick.Value)) { return; } // only rename person if it doesn't have a preset name if (person.IdentityName == person.ID) { var oldIdentityNameColored = person.IdentityNameColored; var oldIdentityName = person.IdentityName; person.IdentityName = nick.Value; ProcessIdentityNameChanged(person, oldIdentityNameColored, oldIdentityName); } } [MethodImpl(MethodImplOptions.Synchronized)] void OnPrivateChatMessage(Message msg) { var chat = Session.GetChat(msg.From, ChatType.Person, this) as PersonChatModel; bool isNew = false; if (chat == null) { // in case full jid doesn't have a chat window, use bare jid chat = GetOrCreatePersonChat(msg.From.Bare, out isNew); } if (msg.Nickname != null) { ProcessNickname(GetOrCreateContact(msg.From, msg.Nickname.Value), msg.Nickname); } var message = CreateMessage(chat.Person, msg, true, true); AddMessageToChatIfNotFiltered(message, chat, isNew); OnMessageReceived( new MessageEventArgs(chat, message, msg.From, null) ); } MessageModel CreateMessage(PersonModel person, Message msg, bool mark_hilights, bool force_hilight) { var builder = CreateMessageBuilder(); string msgstring; if (msg.Html != null) { msgstring = msg.Html.ToString(); } else { msgstring = msg.Body.Trim(); } if (msgstring.StartsWith("/me ")) { // leave the " " intact msgstring = msgstring.Substring(3); builder.AppendActionPrefix(); builder.AppendIdendityName(person, force_hilight); } else { builder.AppendSenderPrefix(person, force_hilight); } if (msg.Html != null) { builder.AppendHtmlMessage(msgstring); } else { builder.AppendMessage(msgstring); } if (mark_hilights) { builder.MarkHighlights(); } if (msg.XDelay != null) { builder.TimeStamp = msg.XDelay.Stamp; } return builder.ToMessage(); } void OnGroupChatMessageError(Message msg, XmppGroupChatModel chat) { var builder = CreateMessageBuilder(); // TODO: nicer formatting if (msg.Error.ErrorText != null) { builder.AppendErrorText(msg.Error.ErrorText); } else { builder.AppendErrorText(msg.Error.ToString()); } Session.AddMessageToChat(chat, builder.ToMessage()); } void OnPrivateChatMessageError(Message msg, PersonChatModel chat) { var builder = CreateMessageBuilder(); // TODO: nicer formatting if (msg.Error.ErrorText != null) { builder.AppendErrorText(msg.Error.ErrorText); } else { builder.AppendErrorText(msg.Error.ToString()); } Session.AddMessageToChat(chat, builder.ToMessage()); } [MethodImpl(MethodImplOptions.Synchronized)] void OnMessage(object sender, Message msg) { // process chatstates if (msg.Chatstate != agsXMPP.protocol.extensions.chatstates.Chatstate.None) { OnChatState(msg); } if (String.IsNullOrEmpty(msg.Body)) { // TODO: capture events and stuff return; } switch (msg.Type) { case XmppMessageType.groupchat: OnGroupChatMessage(msg); break; case XmppMessageType.chat: case XmppMessageType.headline: case XmppMessageType.normal: if (String.IsNullOrEmpty(msg.From.User)) { OnServerMessage(msg); } else if (msg.MucUser != null) { OnMucMessage(msg); } else { OnPrivateChatMessage(msg); } break; case XmppMessageType.error: { var chat = Session.GetChat(msg.From, ChatType.Group, this); if (chat != null) { OnGroupChatMessageError(msg, chat as XmppGroupChatModel); break; } chat = Session.GetChat(msg.From, ChatType.Person, this); if (chat != null) { OnPrivateChatMessageError(msg, chat as PersonChatModel); break; } // no person and no groupchat open? -> dump in networkchat var builder = CreateMessageBuilder(); // TODO: nicer formatting if (msg.Error.ErrorText != null) { builder.AppendErrorText(msg.Error.ErrorText); } else { builder.AppendErrorText(msg.Error.ToString()); } Session.AddMessageToChat(NetworkChat, builder.ToMessage()); } break; } } [MethodImpl(MethodImplOptions.Synchronized)] void OnMucMessage (Message msg) { User user = msg.MucUser; string text; if (user.Invite != null) { if (user.Invite.Reason != null && user.Invite.Reason.Trim().Length > 0) { text = String.Format(_("You have been invited to {2} by {0} because {1}"), user.Invite.From, user.Invite.Reason, msg.From ); } else { text = String.Format(_("You have been invited to {1} by {0}"), user.Invite.From, msg.From ); } } else { text = msg.ToString(); } var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); var txt = builder.CreateText(text); txt.IsHighlight = true; builder.AppendText(txt); Session.AddMessageToChat(NetworkChat, builder.ToMessage()); builder = CreateMessageBuilder(); string url; if (!String.IsNullOrEmpty(user.Password)) { url = String.Format("xmpp:{0}?join;password={1}", msg.From, user.Password); } else { url = String.Format("xmpp:{0}?join", msg.From); } builder.AppendUrl(url, _("Accept invite (join room)")); Session.AddMessageToChat(NetworkChat, builder.ToMessage()); } [MethodImpl(MethodImplOptions.Synchronized)] void OnChatState(Message msg) { if (!ShowChatStates) { return; } if (msg.Body != null) { return; } switch (msg.Type) { case XmppMessageType.chat: case XmppMessageType.headline: case XmppMessageType.normal: { var chat = GetChat(msg.From, ChatType.Person) as PersonChatModel; bool isNew = false; // no full jid chat if (chat == null) { // create chat chat = GetOrCreatePersonChat(msg.From.Bare, out isNew); if (isNew) { if (!OpenNewChatOnChatState) { return; } if (msg.Chatstate != Chatstate.composing) { // there is NO reason to open a new chat window for // a chatstate other than composing return; } Session.AddChat(chat); } } var builder = CreateMessageBuilder(); switch (msg.Chatstate) { case Chatstate.composing: builder.AppendChatState(chat.Person, MessageType.ChatStateComposing); break; case Chatstate.paused: builder.AppendChatState(chat.Person, MessageType.ChatStatePaused); break; default: builder.AppendChatState(chat.Person, MessageType.ChatStateReset); break; } Session.AddMessageToChat(chat, builder.ToMessage()); if (isNew) { Session.SyncChat(chat); } } break; default: break; } } void OnServerMessage(Message msg) { var builder = CreateMessageBuilder(); builder.AppendText("<{0}> {1}", msg.From, msg.Body); builder.MarkHighlights(); // todo: can server messages have an xdelay? if (msg.XDelay != null) { builder.TimeStamp = msg.XDelay.Stamp; } Session.AddMessageToChat(NetworkChat, builder.ToMessage()); } [MethodImpl(MethodImplOptions.Synchronized)] PersonChatModel GetOrCreatePersonChat(Jid jid) { bool isNew; var chat = GetOrCreatePersonChat(jid, out isNew); if (isNew) { Session.AddChat(chat); Session.SyncChat(chat); } return chat; } [MethodImpl(MethodImplOptions.Synchronized)] PersonChatModel GetOrCreatePersonChat(Jid jid, out bool isNew) { var chat = (PersonChatModel) Session.GetChat(jid, ChatType.Person, this); isNew = false; if (chat != null) return chat; var person = GetOrCreateContact(jid.Bare, jid); PersonModel pers; if (!String.IsNullOrEmpty(jid.Resource)) { pers = new PersonModel(jid, person.IdentityName, NetworkID, Protocol, this); } else { pers = person.ToPersonModel(); } isNew = true; chat = Session.CreatePersonChat(pers, this); if (jid == JabberClient.MyJID || jid == JabberClient.MyJID.Bare) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText("Note: you are now talking to yourself"); Session.AddMessageToChat(chat, builder.ToMessage()); } return chat; } [MethodImpl(MethodImplOptions.Synchronized)] void OnClose(object sender) { Trace.Call(sender); foreach (var chat in Chats) { // don't disable the protocol chat, else the user loses all // control for the protocol manager! e.g. after a manual // reconnect or server-side disconnect if (chat.ChatType == ChatType.Protocol) { continue; } Session.DisableChat(chat); } OnDisconnected(EventArgs.Empty); // reset socket JabberClient.ClientSocket.OnValidateCertificate -= ValidateCertificate; JabberClient.SocketConnectionType = SocketConnectionType.Direct; if (AutoReconnect) { Reconnect(AutoReconnectDelay); } } void Reconnect() { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Reconnecting to {0}"), JabberClient.Server); Session.AddMessageToChat(Chat, builder.ToMessage()); Connect(); } void Reconnect(TimeSpan span) { int delay = (int)span.TotalMilliseconds; if (delay <= 0) { Reconnect(); } var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Reconnecting to {0} in {1} seconds"), JabberClient.Server, span.TotalSeconds); Session.AddMessageToChat(Chat, builder.ToMessage()); ThreadPool.QueueUserWorkItem(delegate { Thread.Sleep(delay); lock (this) { // prevent this timer from calling connect after it has been closed if (IsDisposed) { return; } // prevent this timer from calling connect if during the timout // some other event already began a connect if (JabberClient.XmppConnectionState != XmppConnectionState.Disconnected) { return; } Connect(); } }); } void OnError(object sender, Exception ex) { Trace.Call(sender); #if LOG4NET _Logger.Error("OnError(): Exception", ex); #endif var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendErrorText(_("Error: {0}"), String.Empty); builder.AppendMessage(ex.Message); Session.AddMessageToChat(NetworkChat, builder.ToMessage()); } [MethodImpl(MethodImplOptions.Synchronized)] void OnLogin(object sender) { Trace.Call(sender); var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Authenticated")); Session.AddMessageToChat(Chat, builder.ToMessage()); RequestCapabilities(JabberClient.Server, JabberClient.Server); OnConnected(EventArgs.Empty); foreach (var chat in Chats) { if (chat is PersonChatModel) { Session.EnableChat(chat); Session.SyncChat(chat); } else if (chat is XmppGroupChatModel) { var muc = (XmppGroupChatModel)chat; JoinRoom(muc.ID, muc.OwnNickname, muc.Password); } } } [MethodImpl(MethodImplOptions.Synchronized)] void ApplyConfig(UserConfig config, XmppServerModel server) { if (String.IsNullOrEmpty(server.Nickname)) { Nicknames = (string[]) config["Connection/Nicknames"]; } else { Nicknames = new string[] { server.Nickname }; } if (server.Username.Contains("@")) { var jid_user = server.Username.Split('@')[0]; var jid_host = server.Username.Split('@')[1]; JabberClient.ConnectServer = server.Hostname; JabberClient.AutoResolveConnectServer = false; JabberClient.Username = jid_user; JabberClient.Server = jid_host; } else { JabberClient.Server = server.Hostname; JabberClient.Username = server.Username; } JabberClient.Port = server.Port; JabberClient.Password = server.Password; var proxySettings = new ProxySettings(); proxySettings.ApplyConfig(config); var protocol = Server.UseEncryption ? "xmpps" : "xmpp"; var serverUri = String.Format("{0}://{1}:{2}", protocol, Server.Hostname, Server.Port); var proxy = proxySettings.GetWebProxy(serverUri); var socket = JabberClient.ClientSocket as ClientSocket; if (proxy == null) { socket.Proxy = null; } else { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(_("Using proxy: {0}:{1}"), proxy.Address.Host, proxy.Address.Port); Session.AddMessageToChat(Chat, builder.ToMessage()); var proxyScheme = proxy.Address.Scheme; var proxyType = Starksoft.Net.Proxy.ProxyType.None; try { proxyType = (Starksoft.Net.Proxy.ProxyType) Enum.Parse( typeof(Starksoft.Net.Proxy.ProxyType), proxy.Address.Scheme, true ); } catch (ArgumentException ex) { #if LOG4NET _Logger.Error("ApplyConfig(): Couldn't parse proxy type: " + proxyScheme, ex); #endif } var proxyFactory = new ProxyClientFactory(); if (String.IsNullOrEmpty(proxySettings.ProxyUsername) && String.IsNullOrEmpty(proxySettings.ProxyPassword)) { socket.Proxy = proxyFactory.CreateProxyClient( proxyType, proxy.Address.Host, proxy.Address.Port ); } else { socket.Proxy = proxyFactory.CreateProxyClient( proxyType, proxy.Address.Host, proxy.Address.Port, proxySettings.ProxyUsername, proxySettings.ProxyPassword ); } } Me = new PersonModel( JabberClient.MyJID.Bare, Nicknames[0], NetworkID, Protocol, this ); Me.IdentityNameColored.ForegroundColor = new TextColor(0, 0, 255); Me.IdentityNameColored.BackgroundColor = TextColor.None; Me.IdentityNameColored.Bold = true; // XMPP specific settings JabberClient.Resource = server.Resource; if (server.UseEncryption) { // HACK: Google Talk doesn't support StartTLS :( if (server.Hostname == "talk.google.com" && server.Port == 5223) { JabberClient.ForceStartTls = false; JabberClient.UseSSL = true; } else { JabberClient.ForceStartTls = true; } } else { JabberClient.ForceStartTls = false; JabberClient.UseStartTLS = true; } if (!server.ValidateServerCertificate) { JabberClient.ClientSocket.OnValidateCertificate += ValidateCertificate; } } static bool ValidateCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; } static string _(string msg) { return LibraryCatalog.GetString(msg, LibraryTextDomain); } } } smuxi-0.11/src/Engine-XMPP/Protocols/Xmpp/FacebookProtocolManager.cs0000644000175000017500000000273612264335155026157 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2014 Oliver Schneider // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Engine { [ProtocolManagerInfo(Name = "Facebook", Description = "Facebook XMPP", Alias = "facebook")] public class FacebookProtocolManager : XmppProtocolManager { public override string Protocol { get { return "Facebook"; } } public FacebookProtocolManager(Session session) : base(session) { Trace.Call(session); } override protected string GenerateIdString(PersonModel contact) { return ""; } } } smuxi-0.11/src/Engine-XMPP/Protocols/Xmpp/XmppGroupChatModel.cs0000644000175000017500000000254012257043746025150 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 tuukka // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public class XmppGroupChatModel : GroupChatModel { internal DateTime LatestSeenStamp { get; set; } internal bool SeenNewMessages { get; set; } internal string OwnNickname { get; set; } internal string Password { get; set; } internal bool IsJoining { get; set; } public XmppGroupChatModel(string id, string name, IProtocolManager networkManager) : base(id, name, networkManager) { } } } smuxi-0.11/src/Engine-XMPP/Config/0000755000175000017500000000000012311344240017353 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine-XMPP/Config/XmppServerModel.cs0000644000175000017500000000562512264335155023022 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; namespace Smuxi.Engine { public class XmppServerModel : ServerModel { public string Resource { get; set; } public Dictionary Priorities { get; private set; } public void InitDefaults() { Priorities = new Dictionary(); // choose somewhat reasonable defaults Priorities[PresenceStatus.Online] = 5; Priorities[PresenceStatus.Away] = 0; Protocol = "XMPP"; } public XmppServerModel() { InitDefaults(); } public override void Load(UserConfig config, string protocol, string id) { if (config == null) { throw new ArgumentNullException("config"); } if (String.IsNullOrEmpty(protocol)) { throw new ArgumentNullException("protocol"); } if (String.IsNullOrEmpty(id)) { throw new ArgumentNullException("id"); } base.Load(config, protocol, id); var obj = config[ConfigKeyPrefix + "PriorityOnline"]; if (obj != null) { Priorities[PresenceStatus.Online] = (int) obj; } obj = config[ConfigKeyPrefix + "PriorityAway"]; if (obj != null) { Priorities[PresenceStatus.Away] = (int) obj; } obj = config[ConfigKeyPrefix + "Resource"]; if (obj != null) { Resource = (string) obj; } } public override void Save(UserConfig config) { if (config == null) { throw new ArgumentNullException("config"); } base.Save(config); config[ConfigKeyPrefix + "PriorityOnline"] = Priorities[PresenceStatus.Online]; config[ConfigKeyPrefix + "PriorityAway"] = Priorities[PresenceStatus.Away]; config[ConfigKeyPrefix + "Resource"] = Resource; } } } smuxi-0.11/src/Engine-XMPP/Config/XmppPersonModel.cs0000644000175000017500000001002412257043746023013 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Oliver Schneider // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using agsXMPP.protocol.client; using System.Collections.Generic; using agsXMPP; using Smuxi.Common; using agsXMPP.protocol.iq.roster; using agsXMPP.protocol.iq.disco; namespace Smuxi.Engine { internal class XmppResourceModel { public Presence Presence { get; set; } public DiscoInfo Disco { get; set; } public string Name { get; set; } public string NicknameContactKnowsFromMe { get; set; } } internal class XmppPersonModel : PersonModel { public bool Temporary { get; set; } public Jid Jid { get; set; } public Dictionary Resources { get; private set; } public SubscriptionType Subscription { get; set; } public AskType Ask { get; set; } public XmppPersonModel(Jid jid, string nick, XmppProtocolManager protocolManager) :base(jid, nick, protocolManager.NetworkID, protocolManager.Protocol, protocolManager) { Trace.Call(jid, nick, protocolManager); Jid = jid.Bare; Resources = new Dictionary(); Ask = AskType.NONE; Subscription = SubscriptionType.none; Temporary = true; if (!String.IsNullOrEmpty(jid.Resource)) { GetOrCreateResource(jid); } } public XmppResourceModel GetOrCreateResource(Jid jid, out bool isNew) { XmppResourceModel ret; string res = jid.Resource ?? ""; if (Resources.TryGetValue(res, out ret)) { isNew = false; return ret; } ret = new XmppResourceModel(); ret.Name = res; Resources.Add(res, ret); isNew = true; return ret; } public XmppResourceModel GetOrCreateResource(Jid jid) { XmppResourceModel ret; string res = jid.Resource ?? ""; if (Resources.TryGetValue(res, out ret)) { return ret; } ret = new XmppResourceModel(); ret.Name = res; Resources.Add(res, ret); return ret; } public List GetResourcesWithHighestPriority() { List ret = new List(); int prio = -99999; foreach (var res in Resources) { if (res.Value.Presence.Priority > prio) { ret.Clear(); ret.Add(res.Value); prio = res.Value.Presence.Priority; } else if (res.Value.Presence.Priority == prio) { ret.Add(res.Value); } } return ret; } public void RemoveResource(Jid jid) { Resources.Remove(jid.Resource ?? ""); } public PersonModel ToPersonModel() { return new PersonModel( base.ID, base.IdentityName, base.NetworkID, base.NetworkID, base.ProtocolManager ); } } } smuxi-0.11/src/Engine-XMPP/Makefile.in0000644000175000017500000010332312311344230020214 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/smuxi-engine-xmpp.pc.in \ ChangeLog subdir = src/Engine-XMPP ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = smuxi-engine-xmpp.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(pkgapp_DATA) $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ TARGET_DIR = $(top_builddir)/bin/$(PROFILE) ASSEMBLY_NAME = smuxi-engine-xmpp ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll ASSEMBLY_TARGET = $(TARGET_DIR)/$(ASSEMBLY_FILENAME) SOURCES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ Config/XmppServerModel.cs \ Protocols/Xmpp/XmppGroupChatModel.cs \ Protocols/Xmpp/XmppProtocolManager.cs \ Config/XmppPersonModel.cs \ Protocols/Xmpp/FacebookProtocolManager.cs REFERENCES = \ System \ System.Core \ Mono.Posix \ $(LOG4NET_LIBS) DLL_REFERENCES = \ $(TARGET_DIR)/smuxi-common.dll \ $(TARGET_DIR)/smuxi-engine.dll \ $(TARGET_DIR)/StarkSoftProxy.dll \ $(TARGET_DIR)/agsxmpp.dll SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES)) # automake magic variables EXTRA_DIST = $(SOURCES_BUILD) $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) CLEANFILES = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) pkgapp_DATA = $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Engine-XMPP/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Engine-XMPP/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): smuxi-engine-xmpp.pc: $(top_builddir)/config.status $(srcdir)/smuxi-engine-xmpp.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-pkgappDATA: $(pkgapp_DATA) @$(NORMAL_INSTALL) @list='$(pkgapp_DATA)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgappdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgappdir)" || exit $$?; \ done uninstall-pkgappDATA: @$(NORMAL_UNINSTALL) @list='$(pkgapp_DATA)'; test -n "$(pkgappdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappDATA \ install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappDATA \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappDATA \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) all: $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET) $(ASSEMBLY_TARGET).mdb: $(SOURCES) $(DLL_REFERENCES) $(CSC) $(CSC_FLAGS) $(build_references_ref) -target:library -out:$@ $(SOURCES_BUILD) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/smuxi-win32.nsis.in0000644000175000017500000005417412257043746017622 0ustar00meebeymeebey00000000000000############################################################################ # NSIS install script for Smuxi # # # # Copyright (C) 2009 Sebastian Schnur # # Copyright (C) 2009-2013 Mirco Bauer # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################ ######################### # main install settings # ######################### # NSIS's zlib implementation is broken SetCompressor lzma !define PRODUCT_NAME "Smuxi" !define PRODUCT_VERSION "@VERSION@@DEV_VERSION_SUFFIX@" !define PRODUCT_PUBLISHER "Mirco Bauer " !define PRODUCT_WEB_SITE "http://www.smuxi.org" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\smuxi-frontend-gnome.exe" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" !define DOTNET_VERSION "4.0" !define GTKSHARP_PRODUCT_GUID "{3CB70B01-4BC8-4C0F-B28F-7C6E33F913CC}" !define GTKSHARP_VERSION "2.12.22" ############################ # MUI 1.67 compatible mode # ############################ !include "MUI.nsh" !include "WinVer.nsh" ; MUI Settings [please make the path relative] !define MUI_ABORTWARNING !define MUI_ICON "../images/icon.ico" !define MUI_UNICON "../images/icon.ico" ###################### # Language Selection # ###################### ; Language Selection Dialog Settings !define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}" !define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}" !define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language" ################# # install pages # ################# ; Welcome page !insertmacro MUI_PAGE_WELCOME ; License page !define MUI_LICENSEPAGE_RADIOBUTTONS !insertmacro MUI_PAGE_LICENSE "../LICENSE" ; Directory page !insertmacro MUI_PAGE_DIRECTORY ; Instfiles page !insertmacro MUI_PAGE_INSTFILES ; Finish page !define MUI_FINISHPAGE_RUN !define MUI_FINISHPAGE_RUN_TEXT "Run Smuxi" !define MUI_FINISHPAGE_RUN_FUNCTION "RunSmuxi" !insertmacro MUI_PAGE_FINISH ; Uninstaller pages !insertmacro MUI_UNPAGE_INSTFILES ################## # Language files # ################## !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "French" !insertmacro MUI_LANGUAGE "German" !insertmacro MUI_LANGUAGE "Italian" ########################### # MUI end # ########################### Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" OutFile "../smuxi-win32-setup.exe" InstallDir "$PROGRAMFILES\Smuxi" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowInstDetails show ShowUnInstDetails show Function .onInit !insertmacro MUI_LANGDLL_DISPLAY FunctionEnd ############ # Macros # ############ !macro CheckXPServicePack ${If} ${IsWinXP} goto CheckXP ${Else} goto CheckXPServicePackEnd ${EndIf} CheckXP: ${If} ${AtLeastServicePack} 2 DetailPrint "Found Windows XP Service Pack 2 or later" goto CheckXPServicePackEnd ${Else} DetailPrint "Found Windows XP without Service Pack 2." MessageBox MB_OK|MB_ICONEXCLAMATION "Smuxi requires Windows XP Service Pack 2 or later." IDOK Abort ${EndIf} Abort: Abort CheckXPServicePackEnd: !macroend !macro CheckGtkSharp GTKSHARP_REQ !define GTKSHARP_FILE "gtk-sharp-2.12.22.msi" !define GTKSHARP_BASE_URL "http://www.smuxi.org/jaws/data/files/" !define GTKSHARP_DOWNLOAD_URL "${GTKSHARP_BASE_URL}${GTKSHARP_FILE}" !define GTKSHARP_TEMP_FILE "$TEMP\${GTKSHARP_FILE}" DetailPrint "Checking your GTK# version..." Var /GLOBAL GTKSHARP_FOUND_VERSION # GTK# 2.12.20 uses a Xamarin key ReadRegStr $GTKSHARP_FOUND_VERSION HKLM \ "SOFTWARE\Xamarin\GtkSharp\Version" "" # GTK# 2.12.10 uses a Novell key ${If} $GTKSHARP_FOUND_VERSION == "" ReadRegStr $GTKSHARP_FOUND_VERSION HKLM \ "SOFTWARE\Novell\GtkSharp\Version" "" ${EndIf} ${VersionCompare} $GTKSHARP_FOUND_VERSION ${GTKSHARP_REQ} $R0 ${If} $GTKSHARP_FOUND_VERSION == "" goto InstallGtkSharpConfirmation ${ElseIf} $R0 == "0" DetailPrint "GTK# already installed" goto End ${ElseIf} $R0 == "1" DetailPrint "Newer GTK# already installed" goto End ${ElseIf} $R0 == "2" DetailPrint "Older GTK# found" goto InstallGtkSharpConfirmation ${EndIf} InstallGtkSharpConfirmation: MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \ "Your GTK# version: $GTKSHARP_FOUND_VERSION $\nRequired Version: ${GTKSHARP_REQ} or greater.$\n$\nDownload GTK# from www.smuxi.org?" \ /SD IDYES IDYES InstallGtkSharp IDNO End goto GiveUp ;IDCANCEL InstallGtkSharp: SetOutPath "$TEMP" SetOverwrite on DetailPrint "Beginning download of GTK#..." NSISDL::download "${GTKSHARP_DOWNLOAD_URL}" "${GTKSHARP_TEMP_FILE}" Pop $0 ${If} $0 == "cancel" DetailPrint "Download failed." MessageBox MB_YESNO|MB_ICONEXCLAMATION \ "Download cancelled. Continue Installation?" \ IDYES End IDNO GiveUp ${ElseIf} $0 != "success" DetailPrint "Download failed." MessageBox MB_YESNO|MB_ICONEXCLAMATION \ "Download failed:$\n$0$\n$\nContinue Installation?" \ IDYES End IDNO GiveUp ${EndIf} DetailPrint "Download completed." DetailPrint "Pausing installation while downloaded GTK# installer runs." ${If} $GTKSHARP_FOUND_VERSION != "" DetailPrint "Beginning uninstall of old GTK#..." ExecWait 'msiexec /x "${GTKSHARP_PRODUCT_GUID}" /passive' $0 DetailPrint "Uninstall completed. Exit code = '$0'" ${EndIf} ExecWait 'msiexec /i "${GTKSHARP_TEMP_FILE}" /passive' $0 DetailPrint "Completed GTK# install. Exit code = '$0'. Removing GTK# installer." Delete "${GTKSHARP_TEMP_FILE}" DetailPrint "GTK# installer removed." # HACK: force reloading the PATH environment variable for the installer Var /GLOBAL PATH ReadRegStr $PATH HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("PATH", "$PATH")' # HACK: announce the PATH change to all other applications SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 goto End GiveUp: Abort "Installation cancelled by user." End: !macroend # DotNET and MSI version checking macro. # Written by AnarkiNet(AnarkiNet@gmail.com) originally, modified by eyal0 (for use in http://www.sourceforge.net/projects/itwister) # MSI check code based on http://www.codeproject.com/useritems/NSIS.asp # 2009-05-26 Mirco Bauer: updated DOTNET_URL location # Downloads the MSI version 3.1 and runs it if the user does not have the correct version. # Downloads and runs the Microsoft .NET Framework version 2.0 Redistributable and runs it if the user does not have the correct version. # To use, call the macro with a string: # Example: non real version numbers # !insertmacro CheckDotNET "2" # !insertmacro CheckDotNET "2.0.9" # (Version 2.0.9 is less than version 2.0.10.) # Example: latest real version number at time of writing # !insertmacro CheckDotNET "2.0.50727" # All register variables are saved and restored by CheckDotNet # No output !macro CheckDotNET DotNetReqVer # .NET 2.0 - 22 MB # http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe # .NET 2.0 SP2 - 24 MB # http://download.microsoft.com/download/c/6/e/c6e88215-0178-4c6c-b5f3-158ff77b1f38/NetFx20SP2_x86.exe # .NET 3.0 - 50 MB # http://go.microsoft.com/fwlink/?LinkId=70848 # .NET 3.5 - 197 MB # http://download.microsoft.com/download/6/0/f/60fc5854-3cb8-4892-b6db-bd4f42510f28/dotnetfx35.exe # .NET 3.5 Web Installer - 2.4 MB # http://download.microsoft.com/download/7/0/3/703455ee-a747-4cc8-bd3e-98a615c3aedb/dotNetFx35setup.exe # .NET 3.5 SP1 - 231 MB # http://download.microsoft.com/download/2/0/e/20e90413-712f-438c-988e-fdaa79a8ac3d/dotnetfx35.exe # .NET 3.5 SP1 Web Installer - 3 MB / .NET 2.0 -> 3.5: 52 MB # http://download.microsoft.com/download/0/6/1/061F001C-8752-4600-A198-53214C69B51F/dotnetfx35setup.exe # .NET 4.0 Client Profile Web Installer - 1 MB # - .NET 3.5 SP1 -> 4.0: 43 MB # http://download.microsoft.com/download/7/B/6/7B629E05-399A-4A92-B5BC-484C74B5124B/dotNetFx40_Client_setup.exe # .NET 4.0 Full Web Installer - 1 MB # - .NET 3.5 SP1 -> 4.0: 54 MB # - .NET 4.0 Client Profile -> 4.0 Full: 15 MB # http://download.microsoft.com/download/1/B/E/1BE39E79-7E39-46A3-96FF-047F95396215/dotNetFx40_Full_setup.exe !define DOTNET_URL "http://download.microsoft.com/download/7/B/6/7B629E05-399A-4A92-B5BC-484C74B5124B/dotNetFx40_Client_setup.exe" !define MSI31_URL "http://download.microsoft.com/download/1/4/7/147ded26-931c-4daf-9095-ec7baf996f46/WindowsInstaller-KB893803-v2-x86.exe" DetailPrint "Checking your .NET Framework version..." ;callee register save Push $0 Push $1 Push $2 Push $3 Push $4 Push $5 Push $6 ;backup of installed ver Push $7 ;backup of DoNetReqVer ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; MSI ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GetDLLVersion "$SYSDIR\msi.dll" $R0 $R1 IntOp $R2 $R0 / 0x00010000 ; $R2 now contains major version IntOp $R3 $R0 & 0x0000FFFF ; $R3 now contains minor version IntOp $R4 $R1 / 0x00010000 ; $R4 now contains release IntOp $R5 $R1 & 0x0000FFFF ; $R5 now contains build StrCpy $0 "$R2.$R3.$R4.$R5" ; $0 now contains string like "1.2.0.192" ${If} $R2 < '3' ;options SetOutPath "$TEMP" SetOverwrite on MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \ "Your MSI version: $0 $\nRequired Version: 3 or greater.$\n$\nDownload MSI version from www.microsoft.com?" \ /SD IDYES IDYES DownloadMSI IDNO NewMSI goto GiveUpDotNET ;IDCANCEL ${Else} DetailPrint "MSI3.1 already installed" goto NewMSI ${EndIf} DownloadMSI: DetailPrint "Beginning download of MSI3.1." NSISDL::download ${MSI31_URL} "$TEMP\WindowsInstaller-KB893803-v2-x86.exe" DetailPrint "Completed download." Pop $0 ${If} $0 == "cancel" MessageBox MB_YESNO|MB_ICONEXCLAMATION \ "Download cancelled. Continue Installation?" \ IDYES NewMSI IDNO GiveUpDotNET ${ElseIf} $0 != "success" MessageBox MB_YESNO|MB_ICONEXCLAMATION \ "Download failed:$\n$0$\n$\nContinue Installation?" \ IDYES NewMSI IDNO GiveUpDotNET ${EndIf} DetailPrint "Pausing installation while downloaded MSI3.1 installer runs." ExecWait '$TEMP\WindowsInstaller-KB893803-v2-x86.exe /quiet /norestart' $0 DetailPrint "Completed MSI3.1 install/update. Exit code = '$0'. Removing MSI3.1 installer." Delete "$TEMP\WindowsInstaller-KB893803-v2-x86.exe" DetailPrint "MSI3.1 installer removed." goto NewMSI NewMSI: DetailPrint "MSI3.1 installation done. Proceeding with remainder of installation." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; NetFX ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; StrCpy $7 "${DotNetReqVer}" System::Call "mscoree::GetCORVersion(w .r0, i ${NSIS_MAX_STRLEN}, *i r2r2) i .r1 ?u" ${If} $0 == 0 DetailPrint ".NET Framework not found, download is required for program to run." Goto NoDotNET ${EndIf} Var /GLOBAL NET35_INSTALL Var /GLOBAL NET35_SP Var /GLOBAL NET4_INSTALL ReadRegStr $NET35_INSTALL HKLM \ "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "Install" ReadRegStr $NET35_SP HKLM \ "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "SP" ReadRegStr $NET4_INSTALL HKLM \ "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" "Install" ${If} $NET4_INSTALL == "1" DetailPrint ".NET Framework Version 4.0 found" goto NewDotNET ${ElseIf} $NET35_INSTALL == "1" StrCpy $6 "$0" DetailPrint ".NET Framework Version found: 3.5, but is older than the required version: $7" goto OldDotNET ${Else} goto NoDotNET ${EndIf} NoDotNET: MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \ ".NET Framework not installed.$\nRequired Version: $7 or greater.$\n$\nDownload .NET Framework $7 from www.microsoft.com?" \ /SD IDYES IDYES DownloadDotNET IDNO NewDotNET goto GiveUpDotNET ;IDCANCEL OldDotNET: MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \ "Your .NET Framework version: $6 $\nRequired Version: $7 or greater.$\n$\nDownload .NET Framework $7 from www.microsoft.com?" \ /SD IDYES IDYES DownloadDotNET IDNO NewDotNET goto GiveUpDotNET ;IDCANCEL DownloadDotNET: DetailPrint "Beginning download of latest .NET Framework version." NSISDL::download ${DOTNET_URL} "$TEMP\dotnetfx.exe" DetailPrint "Completed download." Pop $0 ${If} $0 == "cancel" MessageBox MB_YESNO|MB_ICONEXCLAMATION \ "Download cancelled. Continue Installation?" \ IDYES NewDotNET IDNO GiveUpDotNET ${ElseIf} $0 != "success" MessageBox MB_YESNO|MB_ICONEXCLAMATION \ "Download failed:$\n$0$\n$\nContinue Installation?" \ IDYES NewDotNET IDNO GiveUpDotNET ${EndIf} DetailPrint "Pausing installation while downloaded .NET Framework installer runs." DetailPrint "" DetailPrint "!!! Depending on your internet bandwidth and computer performance" DetailPrint "!!! this can take a while (up to 10 minutes). Please be patient!" ExecWait '$TEMP\dotnetfx.exe /passive /norestart' DetailPrint "Completed .NET Framework install/update. Removing .NET Framework installer." Delete "$TEMP\dotnetfx.exe" DetailPrint ".NET Framework installer removed." goto NewDotNet GiveUpDotNET: Abort "Installation cancelled by user." NewDotNET: DetailPrint "Proceeding with remainder of installation." Pop $7 Pop $6 Pop $5 Pop $4 Pop $3 Pop $2 Pop $1 Pop $0 !macroend Function VersionCompare !define VersionCompare `!insertmacro VersionCompareCall` !macro VersionCompareCall _VER1 _VER2 _RESULT Push `${_VER1}` Push `${_VER2}` Call VersionCompare Pop ${_RESULT} !macroend Exch $1 Exch Exch $0 Exch Push $2 Push $3 Push $4 Push $5 Push $6 Push $7 begin: StrCpy $2 -1 IntOp $2 $2 + 1 StrCpy $3 $0 1 $2 StrCmp $3 '' +2 StrCmp $3 '.' 0 -3 StrCpy $4 $0 $2 IntOp $2 $2 + 1 StrCpy $0 $0 '' $2 StrCpy $2 -1 IntOp $2 $2 + 1 StrCpy $3 $1 1 $2 StrCmp $3 '' +2 StrCmp $3 '.' 0 -3 StrCpy $5 $1 $2 IntOp $2 $2 + 1 StrCpy $1 $1 '' $2 StrCmp $4$5 '' equal StrCpy $6 -1 IntOp $6 $6 + 1 StrCpy $3 $4 1 $6 StrCmp $3 '0' -2 StrCmp $3 '' 0 +2 StrCpy $4 0 StrCpy $7 -1 IntOp $7 $7 + 1 StrCpy $3 $5 1 $7 StrCmp $3 '0' -2 StrCmp $3 '' 0 +2 StrCpy $5 0 StrCmp $4 0 0 +2 StrCmp $5 0 begin newer2 StrCmp $5 0 newer1 IntCmp $6 $7 0 newer1 newer2 StrCpy $4 '1$4' StrCpy $5 '1$5' IntCmp $4 $5 begin newer2 newer1 equal: StrCpy $0 0 goto end newer1: StrCpy $0 1 goto end newer2: StrCpy $0 2 end: Pop $7 Pop $6 Pop $5 Pop $4 Pop $3 Pop $2 Pop $1 Exch $0 FunctionEnd Function RunSmuxi ExecShell "" "$SMPROGRAMS\Smuxi\Smuxi.lnk" FunctionEnd ############ # Sections # ############ Section "Main" SEC01 !insertmacro CheckXPServicePack !insertmacro CheckDotNET "${DOTNET_VERSION}" !insertmacro CheckGtkSharp ${GTKSHARP_VERSION} SetShellVarContext all SetOutPath "$INSTDIR" CreateDirectory "$SMPROGRAMS\Smuxi" CreateShortCut "$SMPROGRAMS\Smuxi\Smuxi.lnk" "$INSTDIR\smuxi-frontend-gnome.exe" CreateShortCut "$DESKTOP\Smuxi.lnk" "$INSTDIR\smuxi-frontend-gnome.exe" # remove obsolete libraries for upgrades from Smuxi < 0.8.10.2 Delete "$INSTDIR\zlib1.dll" Delete "$INSTDIR\MonoPosixHelper.dll" SetOverwrite on File "../bin-win32/log4net.dll" File "../bin-win32/Meebey.SmartIrc4net.dll" File "../bin-win32/StarkSoftProxy.dll" File "../bin-win32/Mono.Posix.dll" File "../bin-win32/Nini.dll" File "../bin-win32/Twitterizer2.dll" File "../bin-win32/Newtonsoft.Json.dll" File "../bin-win32/agsxmpp.dll" File "../bin-win32/Db4objects.Db4o.dll" File "../bin-win32/ServiceStack.Text.dll" File "../bin-win32/ServiceStack.Interfaces.dll" File "../bin-win32/ServiceStack.Common.dll" File "../bin-win32/Microsoft.AspNet.SignalR.Client.dll" File "../bin-win32/JabbR.Client.dll" File "../bin-win32/smuxi-common.dll" File "../bin-win32/smuxi-engine-campfire.dll" File "../bin-win32/smuxi-engine-irc.dll" File "../bin-win32/smuxi-engine-jabbr.dll" File "../bin-win32/smuxi-engine-twitter.dll" File "../bin-win32/smuxi-engine-xmpp.dll" File "../bin-win32/smuxi-engine.dll" File "../bin-win32/smuxi-frontend-gnome-irc.dll" File "../bin-win32/smuxi-frontend-gnome-twitter.dll" File "../bin-win32/smuxi-frontend-gnome-xmpp.dll" File "../bin-win32/smuxi-frontend-gnome.exe" File "../bin-win32/smuxi-frontend-gnome.exe.config" File "../bin-win32/smuxi-frontend.dll" File "../bin-win32/smuxi-server.exe" File "../bin-win32/smuxi-server.exe.config" File "../bin-win32/plink.exe" File "../bin-win32/Fixedsys500c.ttf" File /nonfatal /r "../bin-win32/locale" File /nonfatal /r "../bin-win32/icons" IfFileExists "$FONTS/Fixedsys500c.ttf" SkipFont InstallFont SkipFont: DetailPrint "Fixed-Sys font already installed" goto MainEnd InstallFont: DetailPrint "Installing Fixed-Sys font..." CopyFiles "$INSTDIR\Fixedsys500c.ttf" "$FONTS" System::Call "GDI32::AddFontResourceA(t) i ('Fixedsys500c.ttf') .s" WriteRegStr "HKLM" "Software\Microsoft\Windows NT\CurrentVersion\Fonts" "Fixedsys TTF V5.00c (TrueType)" "Fixedsys500c.ttf" SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000 DetailPrint "Done." goto MainEnd MainEnd: SectionEnd Section -AdditionalIcons WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" CreateShortCut "$SMPROGRAMS\Smuxi\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" CreateShortCut "$SMPROGRAMS\Smuxi\Uninstall.lnk" "$INSTDIR\uninst.exe" SectionEnd Section -Post WriteUninstaller "$INSTDIR\uninst.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\smuxi-frontend-gnome.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\smuxi-frontend-gnome.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" SectionEnd Function un.onUninstSuccess HideWindow MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully uninstalled." FunctionEnd Function un.onInit !insertmacro MUI_UNGETLANGUAGE MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Do you want to unistall $(^Name) and all it's components?" IDYES +2 Abort FunctionEnd Section Uninstall SetShellVarContext all Delete "$INSTDIR\${PRODUCT_NAME}.url" Delete "$INSTDIR\uninst.exe" Delete "$INSTDIR\smuxi-server.exe.config" Delete "$INSTDIR\smuxi-server.exe" Delete "$INSTDIR\smuxi-server.log" Delete "$INSTDIR\smuxi-frontend.dll" Delete "$INSTDIR\smuxi-frontend-gnome.exe.config" Delete "$INSTDIR\smuxi-frontend-gnome.exe" Delete "$INSTDIR\smuxi-frontend-gnome.log" Delete "$INSTDIR\smuxi-frontend-gnome-irc.dll" Delete "$INSTDIR\smuxi-frontend-gnome-twitter.dll" Delete "$INSTDIR\smuxi-frontend-gnome-xmpp.dll" Delete "$INSTDIR\smuxi-engine.dll" Delete "$INSTDIR\smuxi-engine-campfire.dll" Delete "$INSTDIR\smuxi-engine-irc.dll" Delete "$INSTDIR\smuxi-engine-jabbr.dll" Delete "$INSTDIR\smuxi-engine-twitter.dll" Delete "$INSTDIR\smuxi-engine-xmpp.dll" Delete "$INSTDIR\smuxi-common.dll" Delete "$INSTDIR\Twitterizer2.dll" Delete "$INSTDIR\Newtonsoft.Json.dll" Delete "$INSTDIR\agsxmpp.dll" Delete "$INSTDIR\Db4objects.Db4o.dll" Delete "$INSTDIR\Nini.dll" Delete "$INSTDIR\Mono.Posix.dll" Delete "$INSTDIR\Meebey.SmartIrc4net.dll" Delete "$INSTDIR\StarkSoftProxy.dll" Delete "$INSTDIR\ServiceStack.Text.dll" Delete "$INSTDIR\ServiceStack.Interfaces.dll" Delete "$INSTDIR\ServiceStack.Common.dll" Delete "$INSTDIR\Microsoft.AspNet.SignalR.Client.dll" Delete "$INSTDIR\JabbR.Client.dll" Delete "$INSTDIR\log4net.dll" Delete "$INSTDIR\plink.exe" Delete "$INSTDIR\Fixedsys500c.ttf" RMDir /r "$INSTDIR\locale" RMDir /r "$INSTDIR\icons" Delete "$DESKTOP\Smuxi.lnk" Delete "$SMPROGRAMS\Smuxi\Uninstall.lnk" Delete "$SMPROGRAMS\Smuxi\Website.lnk" Delete "$SMPROGRAMS\Smuxi\Smuxi.lnk" RMDir "$SMPROGRAMS\Smuxi" RMDir "$INSTDIR" DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}" SetAutoClose true SectionEnd smuxi-0.11/src/Frontend-GNOME-XMPP/0000755000175000017500000000000012311344241017364 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-GNOME-XMPP/InviteToMenu.cs0000644000175000017500000001066712253423337022324 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; using System.Threading; namespace Smuxi.Frontend.Gnome { public class InviteToMenu : Gtk.Menu { XmppProtocolManager ProtocolManager { get; set; } ChatViewManager ChatViewManager { get; set; } IList Invitees { get; set; } bool IsPopulated { get; set; } public InviteToMenu(XmppProtocolManager protocolManager, ChatViewManager chatViewManager, PersonModel invitee) : this(protocolManager, chatViewManager, new [] { invitee }) { } public InviteToMenu(XmppProtocolManager protocolManager, ChatViewManager chatViewManager, IList invitees) { if (protocolManager == null) { throw new ArgumentNullException("protocolManager"); } if (chatViewManager == null) { throw new ArgumentNullException("chatViewManager"); } if (invitees == null) { throw new ArgumentNullException("invitees"); } ProtocolManager = protocolManager; ChatViewManager = chatViewManager; Invitees = invitees; } protected override void OnShown() { Trace.Call(); if (!IsPopulated) { IsPopulated = true; foreach (var chatView in ChatViewManager.Chats) { if (!(chatView is XmppGroupChatView)) { // only invite to group chats continue; } if (chatView == ChatViewManager.ActiveChat) { // don't need to add current chat to invite list continue; } if (chatView.ProtocolManager != ProtocolManager) { // only add chats from current server continue; } var groupChatView = (XmppGroupChatView) chatView; if (groupChatView.IsContactList) { // ignore our abused groupchatview continue; } var item = new Gtk.ImageMenuItem(chatView.Name); item.Image = new Gtk.Image(GroupChatView.IconPixbuf); var chatid = chatView.ID; item.Activated += delegate { ThreadPool.QueueUserWorkItem(delegate { try { for (int i = 0; i < Invitees.Count; i++) { ProtocolManager.CommandInvite( new CommandModel( Frontend.FrontendManager, ChatViewManager.ActiveChat.ChatModel, chatid + " " + Invitees[i].ID ) ); } } catch (Exception ex) { Frontend.ShowException(ex); } }); }; item.Show(); Append(item); } } base.OnShown(); } } } smuxi-0.11/src/Frontend-GNOME-XMPP/XmppPersonChatView.cs0000644000175000017500000002362212257043746023505 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Oliver Schneider // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using Smuxi.Common; using Smuxi.Engine; using System.Threading; using System.Collections.Generic; namespace Smuxi.Frontend.Gnome { [ChatViewInfo(ChatType = ChatType.Person, ProtocolManagerType = typeof(XmppProtocolManager))] public class XmppPersonChatView : PersonChatView { private static readonly string _LibraryTextDomain = "smuxi-frontend-gnome-xmpp"; private XmppProtocolManager XmppProtocolManager { get; set; } // for finding the position of the dots and removing them Gtk.TextMark ChatStateStartPosition { get; set; } bool ChatStatePositionValid { get; set; } // for drawing the dots int NumberOfTypingDots { get; set; } bool IsDisposed { get; set; } bool IsComposing { get; set; } bool ChatStateTimeoutRunning { get; set; } MessageModel TypingDots { get; set; } // for remembering the presence state MessageModel LastPresenceMessage { get; set; } public XmppPersonChatView(PersonChatModel personChat) : base(personChat) { Trace.Call(personChat); OutputMessageTextView.PopulatePopup += _OnOutputMessageTextViewPopulatePopup; ChatStateStartPosition = new Gtk.TextMark("ChatStateStartPosition", true); IsDisposed = false; } void DeleteOldChatState() { if (!ChatStatePositionValid) { return; } var buffer = OutputMessageTextView.Buffer; var start = buffer.GetIterAtMark(ChatStateStartPosition); var end = buffer.EndIter; buffer.Delete(ref start, ref end); buffer.DeleteMark(ChatStateStartPosition); if (buffer.EndIter.Offset < OutputMessageTextView.MarkerlineBufferPosition) { // in the rare case that the markeline is below the dots, move it to the correct position OutputMessageTextView.UpdateMarkerline(); } ChatStatePositionValid = false; } void UpdateChatState() { DeleteOldChatState(); if (LastPresenceMessage == null && TypingDots == null) { // nothing to display return; } var buffer = OutputMessageTextView.Buffer; buffer.AddMark(ChatStateStartPosition, buffer.EndIter); if (TypingDots != null) { OutputMessageTextView.AddMessage(TypingDots, true, false); } if (LastPresenceMessage != null) { OutputMessageTextView.AddMessage(LastPresenceMessage, false); } ChatStatePositionValid = true; } void SetPresenceStateText(MessageModel msg) { LastPresenceMessage = msg; UpdateChatState(); } void ClearPresenceStateText() { if (LastPresenceMessage == null) { // nothing to do, probably received duplicate available messages return; } LastPresenceMessage = null; UpdateChatState(); } bool TypingDotsCallback() { if (IsDisposed) { return false; } if (IsComposing) { NumberOfTypingDots++; if (NumberOfTypingDots == 4) { NumberOfTypingDots = 0; } } else { NumberOfTypingDots--; if (NumberOfTypingDots <= 0) { // done TypingDots = null; UpdateChatState(); ChatStateTimeoutRunning = false; return false; } } var builder = new MessageBuilder(); builder.AppendText(new string('.', NumberOfTypingDots)); TypingDots = builder.ToMessage(); UpdateChatState(); GLib.Timeout.Add(300, TypingDotsCallback); return false; } void StartMovingDots() { IsComposing = true; if (!ChatStateTimeoutRunning) { ChatStateTimeoutRunning = true; NumberOfTypingDots = 0; TypingDotsCallback(); } } void StopMovingDots() { if (!ChatStateTimeoutRunning) { // already done return; } IsComposing = false; } void AbortMovingDots() { TypingDots = null; UpdateChatState(); if (!ChatStateTimeoutRunning) { // already done return; } // will be removed on next call to UpdateChatState() NumberOfTypingDots = 0; IsComposing = false; } public override void AddMessage(MessageModel msg) { Trace.Call(msg); switch (msg.MessageType) { case MessageType.ChatStateComposing: StartMovingDots(); break; case MessageType.ChatStatePaused: StopMovingDots(); break; case MessageType.ChatStateReset: AbortMovingDots(); break; case MessageType.PresenceStateOnline: ClearPresenceStateText(); break; case MessageType.PresenceStateOffline: case MessageType.PresenceStateAway: SetPresenceStateText(msg); break; default: AbortMovingDots(); DeleteOldChatState(); base.AddMessage(msg); UpdateChatState(); break; } } private void _OnOutputMessageTextViewPopulatePopup (object o, Gtk.PopulatePopupArgs args) { if (OutputMessageTextView.IsAtUrlTag) { return; } Gtk.Menu popup = args.Menu; // minimum version of any command below if (Frontend.EngineVersion < new Version(0, 8, 11)) { return; } popup.Append(new Gtk.SeparatorMenuItem()); if (Frontend.EngineVersion >= new Version(0, 8, 12)) { Gtk.ImageMenuItem whois_item = new Gtk.ImageMenuItem(_("Whois")); whois_item.Activated += _OnMenuWhoisItemActivated; popup.Append(whois_item); } if (Frontend.EngineVersion >= new Version(0, 8, 11)) { Gtk.ImageMenuItem AddToContacts_item = new Gtk.ImageMenuItem(_("Add To Contacts")); AddToContacts_item.Activated += _OnMenuAddToContactsItemActivated; popup.Append(AddToContacts_item); } if (Frontend.EngineVersion >= new Version(0, 8, 12)) { Gtk.ImageMenuItem invite_to_item = new Gtk.ImageMenuItem(_("Invite to")); Gtk.Menu invite_to_menu_item = new InviteToMenu(XmppProtocolManager, Frontend.MainWindow.ChatViewManager, PersonModel); invite_to_item.Submenu = invite_to_menu_item; popup.Append(invite_to_item); } popup.ShowAll(); } void _OnMenuWhoisItemActivated(object sender, EventArgs e) { Trace.Call(sender, e); ThreadPool.QueueUserWorkItem(delegate { try { XmppProtocolManager.CommandWhoIs( new CommandModel( Frontend.FrontendManager, ChatModel, PersonModel.ID ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } void _OnMenuAddToContactsItemActivated(object sender, EventArgs e) { Trace.Call(sender, e); ThreadPool.QueueUserWorkItem(delegate { try { XmppProtocolManager.CommandContact( new CommandModel( Frontend.FrontendManager, ChatModel, "add " + PersonModel.ID ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } private static string _(string msg) { return LibraryCatalog.GetString(msg, _LibraryTextDomain); } public override void Dispose() { Trace.Call(); IsDisposed = true; base.Dispose(); } public override void Sync() { Trace.Call(); base.Sync(); XmppProtocolManager = (XmppProtocolManager) ProtocolManager; } } } smuxi-0.11/src/Frontend-GNOME-XMPP/ChangeLog0000644000175000017500000000165711655545675021177 0ustar00meebeymeebey000000000000002008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-08-28 Mirco Bauer * AssemblyInfo.cs: Set eol-style to native and converted files using dos2unix where needed. 2008-08-25 Mirco Bauer * Makefile.am, smuxi-frontend-gnome-xmpp.pc.in: Removed unneeded pkg-config files. 2008-07-27 Mirco Bauer * Frontend-GNOME-XMPP.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 2008-01-31 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * Frontend-GNOME-XMPP.mdp: Updated using MonoDevelop 0.18.1 smuxi-0.11/src/Frontend-GNOME-XMPP/Makefile.am0000644000175000017500000001111312253423337021426 0ustar00meebeymeebey00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = ../../bin/release/smuxi-frontend-gnome-xmpp.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/release/smuxi-frontend.dll \ ../../bin/release/smuxi-frontend-gnome.exe \ ../../bin/release/smuxi-engine.dll \ ../../bin/release/smuxi-common.dll \ ../../bin/release/smuxi-engine-xmpp.dll BUILD_DIR = ../../bin/release SMUXI_COMMON_DLL_SOURCE=../../bin/release/smuxi-common.dll SMUXI_ENGINE_XMPP_DLL_MDB= SMUXI_ENGINE_XMPP_DLL_SOURCE=../../bin/release/smuxi-engine-xmpp.dll SMUXI_FRONTEND_GNOME_EXE_MDB= SMUXI_FRONTEND_DLL_SOURCE=../../bin/release/smuxi-frontend.dll SMUXI_ENGINE_DLL_MDB= SMUXI_FRONTEND_DLL_MDB= NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_FRONTEND_GNOME_EXE_SOURCE=../../bin/release/smuxi-frontend-gnome.exe LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/release/smuxi-engine.dll endif if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" ASSEMBLY = ../../bin/debug/smuxi-frontend-gnome-xmpp.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/debug/smuxi-frontend.dll \ ../../bin/debug/smuxi-frontend-gnome.exe \ ../../bin/debug/smuxi-engine.dll \ ../../bin/debug/smuxi-common.dll \ ../../bin/debug/smuxi-engine-xmpp.dll BUILD_DIR = ../../bin/debug SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll SMUXI_ENGINE_XMPP_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine-xmpp.dll.mdb SMUXI_ENGINE_XMPP_DLL_MDB=$(BUILD_DIR)/smuxi-engine-xmpp.dll.mdb SMUXI_ENGINE_XMPP_DLL_SOURCE=../../bin/debug/smuxi-engine-xmpp.dll SMUXI_FRONTEND_GNOME_EXE_MDB_SOURCE=../../bin/debug/smuxi-frontend-gnome.exe.mdb SMUXI_FRONTEND_GNOME_EXE_MDB=$(BUILD_DIR)/smuxi-frontend-gnome.exe.mdb SMUXI_FRONTEND_DLL_SOURCE=../../bin/debug/smuxi-frontend.dll SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb SMUXI_FRONTEND_DLL_MDB_SOURCE=../../bin/debug/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_MDB=$(BUILD_DIR)/smuxi-frontend.dll.mdb NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_FRONTEND_GNOME_EXE_SOURCE=../../bin/debug/smuxi-frontend-gnome.exe LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/debug/smuxi-engine.dll endif AL=al2 SATELLITE_ASSEMBLY_NAME=.resources.dll PROGRAMFILES = \ $(SMUXI_COMMON_DLL) \ $(SMUXI_ENGINE_XMPP_DLL_MDB) \ $(SMUXI_ENGINE_XMPP_DLL) \ $(SMUXI_FRONTEND_GNOME_EXE_MDB) \ $(SMUXI_FRONTEND_DLL) \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_FRONTEND_DLL_MDB) \ $(SMUXI_FRONTEND_GNOME_EXE) \ $(SMUXI_ENGINE_DLL) LINUX_PKGCONFIG = \ $(FRONTEND_GNOME_XMPP_PC) all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ InviteToMenu.cs \ XmppGroupChatView.cs \ XmppPersonChatView.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ Mono.Posix \ $(GTK_SHARP_20_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) include $(top_srcdir)/Makefile.include SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll SMUXI_ENGINE_XMPP_DLL = $(BUILD_DIR)/smuxi-engine-xmpp.dll SMUXI_FRONTEND_DLL = $(BUILD_DIR)/smuxi-frontend.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_FRONTEND_GNOME_EXE = $(BUILD_DIR)/smuxi-frontend-gnome.exe LOG4NET_DLL = $(BUILD_DIR)/log4net.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_XMPP_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_XMPP_DLL)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_GNOME_EXE_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_GNOME_EXE)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS) smuxi-0.11/src/Frontend-GNOME-XMPP/AssemblyInfo.cs0000644000175000017500000000271412253423337022323 0ustar00meebeymeebey00000000000000/* * $Id: AssemblyInfo.cs 167 2007-04-17 21:17:37Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/AssemblyInfo.cs $ * $Rev: 167 $ * $Author: meebey $ * $Date: 2007-04-17 23:17:37 +0200 (Tue, 17 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Smuxi - XMPP support for GNOME frontend")] [assembly: AssemblyCopyright("2010 (C) Mirco Bauer , " + "2013 (C) Oliver Schneider ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] smuxi-0.11/src/Frontend-GNOME-XMPP/XmppGroupChatView.cs0000644000175000017500000002302512257043746023330 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Oliver Schneider // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using Smuxi.Common; using Smuxi.Engine; using System.Threading; using System.Collections.Generic; namespace Smuxi.Frontend.Gnome { [ChatViewInfo(ChatType = ChatType.Group, ProtocolManagerType = typeof(XmppProtocolManager))] public class XmppGroupChatView : GroupChatView { private static readonly string _LibraryTextDomain = "smuxi-frontend-gnome-xmpp"; private XmppProtocolManager XmppProtocolManager { get; set; } public bool IsContactList { get { return ID == "Contacts"; } } public XmppGroupChatView(GroupChatModel chat) : base(chat) { Trace.Call(chat); } protected override void OnMessageTextViewMessageAdded(object sender, MessageTextViewMessageAddedEventArgs e) { if (!IsActive) { switch (e.Message.MessageType) { case MessageType.PresenceStateOffline: case MessageType.PresenceStateAway: case MessageType.PresenceStateOnline: HasEvent = true; break; } } base.OnMessageTextViewMessageAdded(sender, e); } void OnPersonRenameEditingStarted(object o, Gtk.EditingStartedArgs e) { Trace.Call(o, e); // only allow editing once from the context menu IdentityNameCellRenderer.Editable = false; Gtk.TreeIter iter; if (!PersonTreeView.Model.GetIterFromString(out iter, e.Path)) { return; } var person = (PersonModel) PersonTreeView.Model.GetValue(iter, 0); var entry = (Gtk.Entry) e.Editable; entry.Text = person.IdentityName; } private static string _(string msg) { return LibraryCatalog.GetString(msg, _LibraryTextDomain); } public override void Sync() { Trace.Call(); base.Sync(); XmppProtocolManager = (XmppProtocolManager) ProtocolManager; } void _OnUserListMenuWhoisActivated(object sender, EventArgs e) { Trace.Call(sender, e); IList persons = GetSelectedPersons(); if (persons == null) { return; } foreach (PersonModel person in persons) { var per = person; ThreadPool.QueueUserWorkItem(delegate { try { XmppProtocolManager.CommandWhoIs( new CommandModel( Frontend.FrontendManager, ChatModel, per.ID ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void _OnUserListMenuQueryActivated (object sender, EventArgs e) { Trace.Call(sender, e); IList persons = GetSelectedPersons(); if (persons == null) { return; } foreach (PersonModel person in persons) { var per = person; ThreadPool.QueueUserWorkItem(delegate { try { XmppProtocolManager.CommandMessageQuery( new CommandModel( Frontend.FrontendManager, ChatModel, per.ID ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void _OnMenuAddToContactsItemActivated(object sender, EventArgs e) { Trace.Call(sender, e); IList persons = GetSelectedPersons(); if (persons == null) { return; } foreach (PersonModel person in persons) { var per = person; // is this a groupchat contact whose real id is unknown if (person.ID.StartsWith(ID)) { continue; } ThreadPool.QueueUserWorkItem(delegate { try { XmppProtocolManager.CommandContact( new CommandModel( Frontend.FrontendManager, ChatModel, "add " + per.ID ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } void OnPersonRenameEdited(object o, Gtk.EditedArgs e) { Trace.Call(o, e); Gtk.TreeIter iter; if (!PersonTreeView.Model.GetIterFromString(out iter, e.Path)) { return; } PersonModel person = (PersonModel) PersonTreeView.Model.GetValue(iter, 0); ThreadPool.QueueUserWorkItem(delegate { try { XmppProtocolManager.CommandContact( new CommandModel( Frontend.FrontendManager, ChatModel, "rename " + person.ID + " " + e.NewText ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } protected override void OnPersonMenuShown(object sender, EventArgs e) { Trace.Call(sender, e); foreach (var child in PersonMenu.Children) { PersonMenu.Remove(child); } base.OnPersonMenuShown(sender, e); // minimum version of any command below if (Frontend.EngineVersion < new Version(0, 8, 9)) { return; } if (Frontend.EngineVersion >= new Version(0, 8, 9)) { Gtk.ImageMenuItem query_item = new Gtk.ImageMenuItem(_("Query")); query_item.Activated += _OnUserListMenuQueryActivated; PersonMenu.Append(query_item); } PersonMenu.Append(new Gtk.SeparatorMenuItem()); if (Frontend.EngineVersion >= new Version(0, 8, 12)) { Gtk.ImageMenuItem whois_item = new Gtk.ImageMenuItem(_("Whois")); whois_item.Activated += _OnUserListMenuWhoisActivated; PersonMenu.Append(whois_item); } if (!IsContactList && Frontend.EngineVersion >= new Version(0, 8, 11)) { var add_to_contacts_item = new Gtk.ImageMenuItem(_("Add To Contacts")); add_to_contacts_item.Activated += _OnMenuAddToContactsItemActivated; PersonMenu.Append(add_to_contacts_item); } if (Frontend.EngineVersion >= new Version(0, 8, 12)) { Gtk.MenuItem invite_to_item = new Gtk.MenuItem(_("Invite to")); Gtk.Menu invite_to_menu_item = new InviteToMenu( XmppProtocolManager, Frontend.MainWindow.ChatViewManager, GetSelectedPersons() ); invite_to_item.Submenu = invite_to_menu_item; PersonMenu.Append(invite_to_item); } if (IsContactList && Frontend.EngineVersion >= new Version(0, 8, 11)) { // cleanup old handlers IdentityNameCellRenderer.EditingStarted -= OnPersonRenameEditingStarted; IdentityNameCellRenderer.Edited -= OnPersonRenameEdited; IdentityNameCellRenderer.EditingStarted += OnPersonRenameEditingStarted; IdentityNameCellRenderer.Edited += OnPersonRenameEdited; var rename_item = new Gtk.ImageMenuItem(_("Rename")); rename_item.Activated += (o, args) => { var paths = PersonTreeView.Selection.GetSelectedRows(); if (paths == null || paths.Length == 0) { return; } var path = paths[0]; IdentityNameCellRenderer.Editable = true; PersonTreeView.SetCursor(path, IdentityNameColumn, true); }; PersonMenu.Append(rename_item); } PersonMenu.ShowAll(); } } } smuxi-0.11/src/Frontend-GNOME-XMPP/Makefile.in0000644000175000017500000010613212311344230021432 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am ChangeLog subdir = src/Frontend-GNOME-XMPP ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ # Warning: This is an automatically generated file, do not edit! @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/debug/smuxi-frontend-gnome-xmpp.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/release/smuxi-frontend-gnome-xmpp.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-frontend.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-frontend-gnome.exe \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-engine.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-common.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-engine-xmpp.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-frontend.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-frontend-gnome.exe \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-engine.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-common.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-engine-xmpp.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin/debug @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin/release @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/release/smuxi-common.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_XMPP_DLL_MDB = $(BUILD_DIR)/smuxi-engine-xmpp.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_XMPP_DLL_MDB = @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_XMPP_DLL_SOURCE = ../../bin/debug/smuxi-engine-xmpp.dll @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_XMPP_DLL_SOURCE = ../../bin/release/smuxi-engine-xmpp.dll @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_GNOME_EXE_MDB = $(BUILD_DIR)/smuxi-frontend-gnome.exe.mdb @ENABLE_RELEASE_TRUE@SMUXI_FRONTEND_GNOME_EXE_MDB = @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_DLL_SOURCE = ../../bin/debug/smuxi-frontend.dll @ENABLE_RELEASE_TRUE@SMUXI_FRONTEND_DLL_SOURCE = ../../bin/release/smuxi-frontend.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB = $(BUILD_DIR)/smuxi-engine.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_MDB = @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_DLL_MDB = $(BUILD_DIR)/smuxi-frontend.dll.mdb @ENABLE_RELEASE_TRUE@SMUXI_FRONTEND_DLL_MDB = @ENABLE_DEBUG_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_RELEASE_TRUE@NINI_DLL_SOURCE = ../../lib/Nini.dll @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_GNOME_EXE_SOURCE = ../../bin/debug/smuxi-frontend-gnome.exe @ENABLE_RELEASE_TRUE@SMUXI_FRONTEND_GNOME_EXE_SOURCE = ../../bin/release/smuxi-frontend-gnome.exe @ENABLE_DEBUG_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_RELEASE_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/debug/smuxi-engine.dll @ENABLE_RELEASE_TRUE@SMUXI_ENGINE_DLL_SOURCE = ../../bin/release/smuxi-engine.dll @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_XMPP_DLL_MDB_SOURCE = ../../bin/debug/smuxi-engine-xmpp.dll.mdb @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_GNOME_EXE_MDB_SOURCE = ../../bin/debug/smuxi-frontend-gnome.exe.mdb @ENABLE_DEBUG_TRUE@SMUXI_ENGINE_DLL_MDB_SOURCE = ../../bin/debug/smuxi-engine.dll.mdb @ENABLE_DEBUG_TRUE@SMUXI_FRONTEND_DLL_MDB_SOURCE = ../../bin/debug/smuxi-frontend.dll.mdb AL = al2 SATELLITE_ASSEMBLY_NAME = .resources.dll PROGRAMFILES = \ $(SMUXI_COMMON_DLL) \ $(SMUXI_ENGINE_XMPP_DLL_MDB) \ $(SMUXI_ENGINE_XMPP_DLL) \ $(SMUXI_FRONTEND_GNOME_EXE_MDB) \ $(SMUXI_FRONTEND_DLL) \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_FRONTEND_DLL_MDB) \ $(SMUXI_FRONTEND_GNOME_EXE) \ $(SMUXI_ENGINE_DLL) LINUX_PKGCONFIG = \ $(FRONTEND_GNOME_XMPP_PC) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ InviteToMenu.cs \ XmppGroupChatView.cs \ XmppPersonChatView.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ Mono.Posix \ $(GTK_SHARP_20_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll SMUXI_ENGINE_XMPP_DLL = $(BUILD_DIR)/smuxi-engine-xmpp.dll SMUXI_FRONTEND_DLL = $(BUILD_DIR)/smuxi-frontend.dll NINI_DLL = $(BUILD_DIR)/Nini.dll SMUXI_FRONTEND_GNOME_EXE = $(BUILD_DIR)/smuxi-frontend-gnome.exe LOG4NET_DLL = $(BUILD_DIR)/log4net.dll SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Frontend-GNOME-XMPP/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Frontend-GNOME-XMPP/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_XMPP_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_XMPP_DLL)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_GNOME_EXE_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_GNOME_EXE)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Frontend-GNOME/0000755000175000017500000000000012311344241016602 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-GNOME/smuxi-frontend-gnome.desktop.in0000644000175000017500000000043211700531605024671 0ustar00meebeymeebey00000000000000[Desktop Entry] Version=1.0 _Name=Smuxi _GenericName=IRC Chat _X-GNOME-FullName=Smuxi IRC Client _Comment=Chat with other people on IRC Exec=smuxi-frontend-gnome Terminal=false Type=Application Categories=Network;GNOME;GTK;Chat;InstantMessaging;IRCClient; Icon=smuxi-frontend-gnome smuxi-0.11/src/Frontend-GNOME/smuxi-frontend-gnome.exe.config0000644000175000017500000000154012250426634024647 0ustar00meebeymeebey00000000000000
    smuxi-0.11/src/Frontend-GNOME/ColorConverter.cs0000644000175000017500000000522011700531605022101 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Globalization; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public static class ColorConverter { public static string GetHexCode(Gdk.Color color) { /* // this approach is changing the color instead of converting it, as byte wraps string hexcode = String.Format("{0}{1}{2}", ((byte) color.Red).ToString("X2"), ((byte) color.Green).ToString("X2"), ((byte) color.Blue).ToString("X2")); */ string hexcode = String.Format("#{0}{1}{2}", (color.Red >> 8).ToString("X2"), (color.Green >> 8).ToString("X2"), (color.Blue >> 8).ToString("X2")); return hexcode; } public static Gdk.Color GetGdkColor(string hexCode) { if (hexCode == null) { throw new ArgumentNullException("hexCode"); } var color = TextColor.Parse(hexCode); return new Gdk.Color(color.Red, color.Green, color.Blue); } public static TextColor GetTextColor(Gdk.Color color) { string hexcode = GetHexCode(color); // remove leading "#" character hexcode = hexcode.Substring(1); int value = Int32.Parse(hexcode, NumberStyles.HexNumber); return new TextColor(value); } public static Gdk.Color GetGdkColor(TextColor textColor) { if (textColor == null) { throw new ArgumentNullException("textColor"); } return GetGdkColor(textColor.HexCode); } } } smuxi-0.11/src/Frontend-GNOME/Main.cs0000644000175000017500000000647612250426606020042 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.Frontend.Gnome { public class MainClass { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public static void Main(string[] args) { bool debug = false; foreach (string arg in args) { switch (arg) { case "-d": case "--debug": debug = true; break; case "-h": case "--help": ShowHelp(); Environment.Exit(0); break; /* // don't block other parameters as we pass them to // GTK+ / GNOME too default: Console.WriteLine("Invalid option: " + arg); Environment.Exit(1); break; */ } } #if LOG4NET // initialize log level log4net.Repository.ILoggerRepository repo = log4net.LogManager.GetRepository(); if (debug) { repo.Threshold = log4net.Core.Level.Debug; } else { repo.Threshold = log4net.Core.Level.Info; } #endif try { Frontend.Init(args); } catch (Exception e) { #if LOG4NET _Logger.Fatal(e); #endif // when Gtk# receives an exception it is not usable/relyable anymore! // except the exception was thrown in Frontend.Init() itself if (Frontend.IsGtkInitialized && !Frontend.InGtkApplicationRun) { Frontend.ShowException(e); } // rethrow the exception for console output throw; } } private static void ShowHelp() { Console.WriteLine("Usage: smuxi-frontend-gnome [options]"); Console.WriteLine(); Console.WriteLine("Options:"); Console.WriteLine(" -h --help Show this help"); Console.WriteLine(" -d --debug Enable debug output"); Console.WriteLine(" -e --engine engine-name Connect to engine"); } } } smuxi-0.11/src/Frontend-GNOME/MainWindow.cs0000644000175000017500000005505112274103742021222 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2014 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Linq; using System.Threading; using System.Reflection; using SysDiag = System.Diagnostics; using Mono.Unix; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public class MainWindow : Gtk.Window { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private bool _IsFullscreen; Gtk.Statusbar NetworkStatusbar { get; set; } Gtk.Statusbar Statusbar { get; set; } public Gtk.ProgressBar ProgressBar { get; private set; } Gtk.HBox StatusHBox { get; set; } public MenuWidget MenuWidget { get; private set; } Gtk.HPaned TreeViewHPaned { get; set; } public IFrontendUI UI { get; private set; } public Entry Entry { get; private set; } public Notebook Notebook { get; private set; } public ChatTreeView ChatTreeView { get; private set; } public ChatViewManager ChatViewManager { get; private set; } public EngineManager EngineManager { get; private set; } #if GTK_SHARP_2_10 StatusIconManager StatusIconManager { get; set; } #endif #if INDICATE_SHARP || MESSAGING_MENU_SHARP IndicateManager IndicateManager { get; set; } #endif #if NOTIFY_SHARP NotifyManager NotifyManager { get; set; } #endif #if IPC_DBUS NetworkManager NetworkManager { get; set; } #endif public NotificationAreaIconMode NotificationAreaIconMode { get; set; } public bool IsMinimized { get; private set; } public bool IsMaximized { get; private set; } public bool CaretMode { get { return MenuWidget.CaretMode; } } public bool ShowMenuBar { get { return MenuWidget.MenuBar.Visible; } set { MenuWidget.ShowMenubarAction.Active = value; } } public bool ShowStatusbar { get { return StatusHBox.Visible; } set { StatusHBox.Visible = value; } } public string NetworkStatus { set { if (value == null) { value = String.Empty; } NetworkStatusbar.Pop(0); NetworkStatusbar.Push(0, value); } } public string Status { set { if (value == null) { value = String.Empty; } Statusbar.Pop(0); Statusbar.Push(0, value); } } public bool IsFullscreen { get { return _IsFullscreen; } set { _IsFullscreen = value; if (value) { Fullscreen(); } else { Unfullscreen(); } } } public EventHandler Minimized; public EventHandler Unminimized; public MainWindow() : base("Smuxi") { // restore window size / position int width, heigth; if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"] != null) { width = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"]; } else { width = 800; } if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"] != null) { heigth = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"]; } else { heigth = 600; } if (width < -1 || heigth < -1) { width = -1; heigth = -1; } if (width == -1 && heigth == -1) { SetDefaultSize(800, 600); Maximize(); } else if (width == 0 && heigth == 0) { // HACK: map 0/0 to default size as it crashes on Windows :/ SetDefaultSize(800, 600); } else { SetDefaultSize(width, heigth); } int x, y; if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"] != null) { x = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"]; } else { x = 0; } if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"] != null) { y = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"]; } else { y = 0; } if (x < 0 || y < 0) { x = 0; y = 0; } if (x == 0 && y == 0) { SetPosition(Gtk.WindowPosition.Center); } else { Move(x, y); } DeleteEvent += OnDeleteEvent; FocusInEvent += OnFocusInEvent; FocusOutEvent += OnFocusOutEvent; WindowStateEvent += OnWindowStateEvent; ChatTreeView = new ChatTreeView(); Notebook = new Notebook(); Notebook.SwitchPage += OnNotebookSwitchPage; Notebook.FocusInEvent += OnNotebookFocusInEvent; ChatViewManager = new ChatViewManager(Notebook, ChatTreeView); Assembly asm = Assembly.GetExecutingAssembly(); ChatViewManager.Load(asm); ChatViewManager.LoadAll(System.IO.Path.GetDirectoryName(asm.Location), "smuxi-frontend-gnome-*.dll"); ChatViewManager.ChatAdded += OnChatViewManagerChatAdded; ChatViewManager.ChatSynced += OnChatViewManagerChatSynced; ChatViewManager.ChatRemoved += OnChatViewManagerChatRemoved; #if GTK_SHARP_2_10 StatusIconManager = new StatusIconManager(this, ChatViewManager); #endif #if INDICATE_SHARP || MESSAGING_MENU_SHARP IndicateManager = new IndicateManager(this, ChatViewManager); #endif #if NOTIFY_SHARP NotifyManager = new NotifyManager(this, ChatViewManager); #endif #if IPC_DBUS NetworkManager = new NetworkManager(ChatViewManager); #endif UI = new GnomeUI(ChatViewManager); // HACK: Frontend.FrontendConfig out of scope EngineManager = new EngineManager(Frontend.FrontendConfig, UI); Entry = new Entry(ChatViewManager); var entryScrolledWindow = new Gtk.ScrolledWindow(); entryScrolledWindow.ShadowType = Gtk.ShadowType.EtchedIn; entryScrolledWindow.HscrollbarPolicy = Gtk.PolicyType.Never; entryScrolledWindow.SizeRequested += delegate(object o, Gtk.SizeRequestedArgs args) { // predict and set useful heigth int lineWidth, lineHeigth; using (var layout = Entry.CreatePangoLayout("Qp")) { layout.GetPixelSize(out lineHeigth, out lineHeigth); } var it = Entry.Buffer.StartIter; int newLines = 1; // move to end of next visual line while (Entry.ForwardDisplayLineEnd(ref it)) { newLines++; // calling ForwardDisplayLineEnd repeatedly stays on the same position // therefor we move one cursor position further it.ForwardCursorPosition(); } newLines = Math.Min(newLines, 3); // use text heigth + a bit extra var bestSize = new Gtk.Requisition() { Height = (lineHeigth * newLines) + 5 }; args.Requisition = bestSize; }; entryScrolledWindow.Add(Entry); ProgressBar = new Gtk.ProgressBar(); StatusHBox = new Gtk.HBox(); MenuWidget = new MenuWidget(this, ChatViewManager); var treeviewScrolledWindow = new Gtk.ScrolledWindow() { ShadowType = Gtk.ShadowType.EtchedIn, HscrollbarPolicy = Gtk.PolicyType.Never, VscrollbarPolicy = Gtk.PolicyType.Automatic }; treeviewScrolledWindow.Add(ChatTreeView); ChatViewManager.ChatAdded += (sender, e) => { treeviewScrolledWindow.CheckResize(); }; var treeviewPaned = new Gtk.HPaned(); treeviewPaned.Pack1(treeviewScrolledWindow, false, false); treeviewPaned.Pack2(Notebook, true, false); TreeViewHPaned = treeviewPaned; var entryPaned = new Gtk.VPaned(); entryPaned.ButtonPressEvent += (sender, e) => { // reset entry size on double click if (e.Event.Type == Gdk.EventType.TwoButtonPress && e.Event.Button == 1) { GLib.Timeout.Add(100, delegate { entryPaned.Position = -1; return false; }); } }; entryPaned.Pack1(treeviewPaned, true, false); entryPaned.Pack2(entryScrolledWindow, false, false); Gtk.VBox vbox = new Gtk.VBox(); vbox.PackStart(MenuWidget, false, false, 0); vbox.PackStart(entryPaned, true, true, 0); NetworkStatusbar = new Gtk.Statusbar(); NetworkStatusbar.WidthRequest = 300; NetworkStatusbar.HasResizeGrip = false; Statusbar = new Gtk.Statusbar(); Statusbar.HasResizeGrip = false; Gtk.HBox status_bar_hbox = new Gtk.HBox(); status_bar_hbox.Homogeneous = true; status_bar_hbox.PackStart(NetworkStatusbar, false, true, 0); status_bar_hbox.PackStart(Statusbar, true, true, 0); StatusHBox.PackStart(status_bar_hbox); StatusHBox.PackStart(ProgressBar, false, false, 0); StatusHBox.ShowAll(); StatusHBox.NoShowAll = true; StatusHBox.Visible = (bool) Frontend.FrontendConfig["ShowStatusBar"]; vbox.PackStart(StatusHBox, false, false, 0); Add(vbox); } public void ApplyConfig(UserConfig userConfig) { Trace.Call(userConfig); if (userConfig == null) { throw new ArgumentNullException("userConfig"); } string modeStr = (string) userConfig["Interface/Notification/NotificationAreaIconMode"]; NotificationAreaIconMode mode = (NotificationAreaIconMode) Enum.Parse( typeof(NotificationAreaIconMode), modeStr ); NotificationAreaIconMode = mode; MenuWidget.OpenLogAction.Visible = Frontend.IsLocalEngine; MenuWidget.OpenLogToolAction.Visible = Frontend.IsLocalEngine; #if GTK_SHARP_2_10 StatusIconManager.ApplyConfig(userConfig); #endif #if INDICATE_SHARP || MESSAGING_MENU_SHARP IndicateManager.ApplyConfig(userConfig); #endif #if NOTIFY_SHARP NotifyManager.ApplyConfig(userConfig); #endif Entry.ApplyConfig(userConfig); Notebook.ApplyConfig(userConfig); ChatTreeView.ApplyConfig(userConfig); ChatViewManager.ApplyConfig(userConfig); MenuWidget.JoinWidget.ApplyConfig(userConfig); } public void UpdateTitle() { UpdateTitle(null, null); } public void UpdateTitle(ChatView chatView, string protocolStatus) { Trace.Call(chatView, protocolStatus); if (chatView == null) { chatView = ChatViewManager.CurrentChatView; } if (chatView == null) { return; } string title; if (chatView is SessionChatView) { title = String.Empty; } else if (chatView is ProtocolChatView) { title = protocolStatus; } else { title = String.Format("{0} @ {1}", chatView.Name, protocolStatus); } if (!String.IsNullOrEmpty(title)) { title += " - "; } title += "Smuxi"; Title = title; } protected override bool OnConfigureEvent(Gdk.EventConfigure e) { Trace.Call(e); TreeViewHPaned.Position = e.Width / 6; return base.OnConfigureEvent(e); } protected virtual void OnDeleteEvent(object sender, Gtk.DeleteEventArgs e) { Trace.Call(sender, e); try { if (NotificationAreaIconMode == NotificationAreaIconMode.Closed) { // showing the tray icon is handled in OnWindowStateEvent Hide(); // don't destroy the window nor quit smuxi! e.RetVal = true; return; } Frontend.Quit(); } catch (Exception ex) { Frontend.ShowException(this, ex); } } protected virtual void OnFocusInEvent(object sender, EventArgs e) { Trace.Call(sender, e); try { UrgencyHint = false; // HACK: users sometimes click into the person list by accident // when they try to bring the focus back to the Smuxi window. // We try to be nice and do what they probably meant and move // the focus to the input entry instead. // HACK: we have to use a timeout here as the ButtonPressEvent // is directly raised _after_ the FocusInEvent. The idle loop // turned out to be too racy and works only sometimes. GLib.Timeout.Add(10, delegate { Entry.GrabFocus(); return false; }); if (Notebook.IsBrowseModeEnabled) { return; } var chatView = ChatViewManager.CurrentChatView; if (chatView != null) { // clear activity and highlight chatView.HasHighlight = false; chatView.HasActivity = false; chatView.HasEvent = false; var lastMsg = chatView.OutputMessageTextView.LastMessage; if (lastMsg == null || Frontend.UseLowBandwidthMode) { return; } // update last seen highlight ThreadPool.QueueUserWorkItem(delegate { try { // REMOTING CALL 1 chatView.ChatModel.LastSeenHighlight = lastMsg.TimeStamp; } catch (Exception ex) { #if LOG4NET f_Logger.Error("OnFocusInEvent(): Exception", ex); #endif } }); } } catch (Exception ex) { Frontend.ShowException(this, ex); } } protected virtual void OnFocusOutEvent(object sender, EventArgs e) { Trace.Call(sender, e); try { if (Notebook.IsBrowseModeEnabled) { return; } var chatView = ChatViewManager.CurrentChatView; if (chatView == null) { return; } chatView.OutputMessageTextView.UpdateMarkerline(); } catch (Exception ex) { Frontend.ShowException(this, ex); } } protected virtual void OnWindowStateEvent(object sender, Gtk.WindowStateEventArgs e) { Trace.Call(sender, e); try { // handle minimize / un-minimize if ((e.Event.ChangedMask & Gdk.WindowState.Iconified) != 0) { IsMinimized = (e.Event.NewWindowState & Gdk.WindowState.Iconified) != 0; #if LOG4NET f_Logger.Debug("OnWindowStateEvent(): IsMinimized: " + IsMinimized); #endif #if DISABLED // BUG: metacity is not allowing us to use the minimize state // to hide and enable the notfication area icon as switching // to a different workspace sets WindowState.Iconified on all // windows, thus this code is disabled. For more details see: // http://projects.qnetp.net/issues/show/158 Hide(); #endif if (IsMinimized) { if (Minimized != null) { Minimized(this, EventArgs.Empty); } } else { if (Unminimized != null) { Unminimized(this, EventArgs.Empty); } } } // handle maximize / un-maximize if ((e.Event.ChangedMask & Gdk.WindowState.Maximized) != 0) { IsMaximized = (e.Event.NewWindowState & Gdk.WindowState.Maximized) != 0; #if LOG4NET f_Logger.Debug("OnWindowStateEvent(): IsMaximized: " + IsMaximized); #endif } } catch (Exception ex) { Frontend.ShowException(this, ex); } } protected virtual void OnNotebookSwitchPage(object sender, EventArgs e) { try { var chatView = ChatViewManager.CurrentChatView; if (chatView == null) { return; } if (!Frontend.IsMacOSX) { MenuWidget.CloseChatAction.Sensitive = !(chatView is SessionChatView); } MenuWidget.FindGroupChatAction.Sensitive = !(chatView is SessionChatView); if (Frontend.IsLocalEngine) { var logExists = File.Exists(chatView.ChatModel.LogFile); MenuWidget.OpenLogAction.Sensitive = logExists; MenuWidget.OpenLogToolAction.Sensitive = logExists; } // find protocol chat parent and update join bar foreach (var view in ChatViewManager.Chats) { if (!(view is ProtocolChatView) || view.ProtocolManager == null) { continue; } if (chatView.ProtocolManager == view.ProtocolManager) { var pView = (ProtocolChatView) view; MenuWidget.JoinWidget.ActiveNetwork = pView.NetworkID; break; } } // HACK: Gtk.Notebook moves the focus to the child after the // page has been switched, so move the focus back to the entry if (!Notebook.IsBrowseModeEnabled) { GLib.Idle.Add(delegate { Entry.GrabFocus(); return false; }); } } catch (Exception ex) { Frontend.ShowException(this, ex); } } protected virtual void OnNotebookFocusInEvent(object sender, Gtk.FocusInEventArgs e) { // HACK: having the focus in the notebook doesn't make any sense, // so move focus back to the entry Entry.GrabFocus(); } protected void OnChatViewManagerChatAdded(object sender, ChatViewManagerChatAddedEventArgs e) { Trace.Call(sender, e); e.ChatView.MessageHighlighted += OnChatViewMessageHighlighted; e.ChatView.StatusChanged += (o, args) => { ChatTreeView.Render(e.ChatView); }; e.ChatView.OutputMessageTextView.FocusInEvent += delegate { if (CaretMode) { return; } Entry.GrabFocus(); }; UpdateProgressBar(); } protected void OnChatViewManagerChatSynced(object sender, ChatViewManagerChatSyncedEventArgs e) { Trace.Call(sender, e); UpdateProgressBar(); } protected void OnChatViewManagerChatRemoved(object sender, ChatViewManagerChatRemovedEventArgs e) { Trace.Call(sender, e); e.ChatView.MessageHighlighted -= OnChatViewMessageHighlighted; UpdateProgressBar(); } protected void OnChatViewMessageHighlighted(object sender, ChatViewMessageHighlightedEventArgs e) { #if MSG_DEBUG Trace.Call(sender, e); #endif if (!HasToplevelFocus) { UrgencyHint = true; } } public void UpdateProgressBar() { var totalChatCount = ChatViewManager.Chats.Count; var syncedChatCount = ChatViewManager.SyncedChats.Count; ProgressBar.Fraction = (double)syncedChatCount / totalChatCount; ProgressBar.Text = String.Format("{0} / {1}", syncedChatCount, totalChatCount); if (syncedChatCount >= totalChatCount) { ProgressBar.Hide(); } else { ProgressBar.Show(); } } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/smuxi-frontend-gnome.10000644000175000017500000000246512257043746022777 0ustar00meebeymeebey00000000000000.Dd $Mdocdate: September 23 2013 $ .Dt smuxi-frontend-gnome 1 .Os .Sh NAME .Nm smuxi-frontend-gnome .Nd GNOME frontend for Smuxi chat client .Sh SYNOPSIS .Nm smuxi-frontend-gnome .Op Fl dh .Op Fl e Ar engine .Sh DESCRIPTION .Nm is a GNOME frontend for the Smuxi chat client, powered by the GTK# library. It can operate standalone or attached to a remote Smuxi engine. .Pp The options are as follows: .Bl -tag -width Ds .It Fl d , Fl \-debug Turn on debugging. Debug logs are sent to .Pa $XDG_DATA_HOME/smuxi/smuxi-frontend-gnome.log , and older logs are moved to the date of usage. .It Fl h , Fl \-help Show the arguments Smuxi takes. .It Fl e Ar engine , Fl \-engine Ns = Ns Ar engine Connect to a remote engine. .Sh FILES .Bl -tag -width -compact .It Pa $XDG_DATA_HOME/smuxi/share/smuxi-frontend-gnome.log smuxi debug log .It Pa $XDG_CONFIG_HOME/smuxi/smuxi-engine.ini smuxi local engine config .It Pa $XDG_CONFIG_HOME/smuxi/smuxi-frontend.ini smuxi frontend configuration and remote engine list .Sh SEE ALSO .Xr smuxi-frontend-stfl 1 , .Xr smuxi-server 1 , .Xr smuxi-message-buffer 1 .Pp Website: http://smuxi.im .Sh AUTHOR/CREDITS Smuxi, including this frontend, was written by Mirco Bauer. Contributions to this frontend were also made by George Karavasilev and Oliver Schneider. .Pp This manpage was written by Calvin Buckley. smuxi-0.11/src/Frontend-GNOME/Entry.cs0000644000175000017500000007512412264346614020260 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Linq; using System.Runtime.InteropServices; using System.Threading; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using Mono.Unix; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend.Gnome { public class Entry : Gtk.TextView { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private StringCollection _History = new StringCollection(); private int _HistoryPosition; private bool _HistoryChangedLine; private CommandManager _CommandManager; private new EntrySettings Settings { get; set; } private NickCompleter NickCompleter { get; set; } ChatViewManager ChatViewManager; event EventHandler Activated; /* public StringCollection History { get { return _History; } } */ /* public int HistoryPosition { get { return _HistoryPosition; } set { _HistoryPosition = value; } } */ /* public bool HistoryChangedLine { get { return _HistoryChangedLine; } set { _HistoryChangedLine = value; } } */ public string Text { get { return Buffer.Text; } set { Buffer.Text = value; } } public int Position { get { return Buffer.CursorPosition; } set { Gtk.TextIter position; if (value < 0) { position = Buffer.EndIter; } else { position = Buffer.GetIterAtOffset(value); } Buffer.PlaceCursor(position); } } public Entry(ChatViewManager chatViewManager) { Trace.Call(chatViewManager); if (chatViewManager == null) { throw new ArgumentNullException("chatViewManager"); } _History.Add(String.Empty); ChatViewManager = chatViewManager; Settings = new EntrySettings(); WrapMode = Gtk.WrapMode.WordChar; InitSpellCheck(); InitCommandManager(); Frontend.SessionPropertyChanged += delegate { InitCommandManager(); }; Activated += _OnActivated; KeyPressEvent += new Gtk.KeyPressEventHandler(_OnKeyPress); PasteClipboard += _OnClipboardPasted; } public void UpdateHistoryChangedLine() { if ((_History.Count > 0) && (Text.Length > 0) && (Text != HistoryCurrent())) { // the entry changed and the entry is not empty _HistoryChangedLine = true; #if LOG4NET //_Logger.Debug("_HistoryChangedLine = true"); #endif } else { _HistoryChangedLine = false; #if LOG4NET //_Logger.Debug("_HistoryChangedLine = false"); #endif } } public void AddToHistory(string data, int positiondiff) { /* // BUG: this code doesnt work well // _History.Count-1 is the last entry, which should be always empty if ((_History.Count > 1) && (data == _History[_History.Count-2])) { // don't add the same value return; } */ _History.Insert(_History.Count-1, data); #if LOG4NET _Logger.Debug("added: '"+data+"' to history"); #endif if (_History.Count > Settings.CommandHistorySize) { _History.RemoveAt(0); } else { _HistoryPosition += positiondiff; } } public string HistoryCurrent() { return _History[_HistoryPosition]; } public void HistoryPrevious() { if (_HistoryChangedLine) { #if LOG4NET _Logger.Debug("entry changed, adding to history"); #endif AddToHistory(Text, 0); _HistoryChangedLine = false; } if (_HistoryPosition > 0) { #if LOG4NET _Logger.Debug("showing previous item"); #endif _HistoryPosition--; Text = HistoryCurrent(); Position = -1; } } public void HistoryNext() { if (_HistoryChangedLine) { #if LOG4NET _Logger.Debug("entry changed, adding to history"); #endif AddToHistory(Text, 0); _HistoryChangedLine = false; } if (_HistoryPosition < _History.Count-1) { #if LOG4NET _Logger.Debug("showing next item"); #endif _HistoryPosition++; Text = HistoryCurrent(); Position = -1; } else if (Text.Length > 0) { #if LOG4NET _Logger.Debug("not empty line, lets add one"); #endif // last position and we went further down _History.Add(String.Empty); _HistoryPosition++; Text = String.Empty; } } [GLib.ConnectBefore] private void _OnKeyPress(object sender, Gtk.KeyPressEventArgs e) { // too much logging noise //Trace.Call(sender, e); #if LOG4NET // too much logging noise /* _Logger.Debug("_OnKeyPress(): Key: " + e.Event.Key.ToString() + " KeyValue: " + e.Event.KeyValue); */ #endif try { ProcessKey(e); } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual void ProcessKey(Gtk.KeyPressEventArgs e) { if (Frontend.IsWindows && String.IsNullOrEmpty(Text)) { // HACK: workaround rendering issue on Windows where the text // cursor and first typed character are not showing up until // a 2nd character is typed, see #810 QueueDraw(); } if (ChatViewManager.CurrentChatView == null) { // we are during a sync, so don't process keys yet return; } int keynumber = (int)e.Event.KeyValue; Gdk.Key key = e.Event.Key; if ((e.Event.State & Gdk.ModifierType.ControlMask) != 0 || (Frontend.IsMacOSX && (e.Event.State & Gdk.ModifierType.MetaMask) != 0)) { // ctrl / cmd is pressed e.RetVal = true; switch (key) { case Gdk.Key.x: case Gdk.Key.X: if (ChatViewManager.CurrentChatView is SessionChatView) { Frontend.FrontendManager.NextProtocolManager(); } else { // don't break cut e.RetVal = false; } break; case Gdk.Key.p: case Gdk.Key.P: ChatViewManager.CurrentChatNumber--; break; case Gdk.Key.n: case Gdk.Key.N: ChatViewManager.CurrentChatNumber++; break; case Gdk.Key.Tab: case Gdk.Key.ISO_Left_Tab: if ((e.Event.State & Gdk.ModifierType.ShiftMask) != 0) { ChatViewManager.CurrentChatNumber--; } else { ChatViewManager.CurrentChatNumber++; } break; case Gdk.Key.c: case Gdk.Key.C: // only use copy if something is selected in the entry if (Buffer.HasSelection) { e.RetVal = false; break; } // copy selection from main chat window var buf = ChatViewManager.CurrentChatView.OutputMessageTextView.Buffer; buf.CopyClipboard(Gtk.Clipboard.Get(Gdk.Selection.Clipboard)); break; // don't break unicode input case Gdk.Key.U: // don't break paste case Gdk.Key.v: case Gdk.Key.V: // don't break select all case Gdk.Key.a: case Gdk.Key.A: // don't break jump one word left/right case Gdk.Key.Right: case Gdk.Key.Left: // don't break delete last word case Gdk.Key.BackSpace: e.RetVal = false; break; case Gdk.Key.Home: ChatViewManager.CurrentChatView.ScrollToStart(); break; case Gdk.Key.End: ChatViewManager.CurrentChatView.ScrollToEnd(); break; // anything else we let GTK+ handle default: e.RetVal = false; break; } } int pagenumber = -1; if ((e.Event.State & Gdk.ModifierType.Mod1Mask) != 0) { // alt is pressed switch (keynumber) { case 49: // 1 case 50: // 2 case 51: // 3 case 52: // 4 case 53: // 5 case 54: // 6 case 55: // 7 case 56: // 8 case 57: // 9 pagenumber = keynumber - 49; break; case 48: // 0 pagenumber = 9; break; case 113: // q pagenumber = 10; break; case 119: // w pagenumber = 11; break; case 101: // e pagenumber = 12; break; case 114: // r pagenumber = 13; break; case 116: // t pagenumber = 14; break; case 121: // y pagenumber = 15; break; case 117: // u pagenumber = 16; break; case 105: // i pagenumber = 17; break; case 111: // o pagenumber = 18; break; case 112: // p pagenumber = 19; break; } switch (key) { case Gdk.Key.h: case Gdk.Key.H: if (Frontend.IsMacOSX) { Frontend.MainWindow.Iconify(); e.RetVal = true; } break; case Gdk.Key.braceleft: case Gdk.Key.Up: if (Frontend.IsMacOSX) { ChatViewManager.CurrentChatNumber--; e.RetVal = true; } break; case Gdk.Key.braceright: case Gdk.Key.Down: if (Frontend.IsMacOSX) { ChatViewManager.CurrentChatNumber++; e.RetVal = true; } break; } if (pagenumber != -1) { ChatViewManager.CurrentChatNumber = pagenumber; } } if ((e.Event.State & Gdk.ModifierType.Mod1Mask) != 0 || (e.Event.State & Gdk.ModifierType.ControlMask) != 0 || (e.Event.State & Gdk.ModifierType.ShiftMask) != 0) { // alt, ctrl or shift pushed, returning return; } UpdateHistoryChangedLine(); switch (key) { case Gdk.Key.Tab: // don't let GTK handle the focus, as we will do it e.RetVal = true; if (Frontend.MainWindow.CaretMode) { // when we are in caret-mode change focus to output textview ChatViewManager.CurrentChatView.HasFocus = true; } else { if (Text.Length > 0) { _NickCompletion(); } } break; case Gdk.Key.Up: // supress widget navigation/jumping (like tab) e.RetVal = true; HistoryPrevious(); break; case Gdk.Key.Down: // supress widget navigation/jumping (like tab) e.RetVal = true; HistoryNext(); break; case Gdk.Key.Page_Up: // supress scrolling ChatViewManager.CurrentChatView.ScrollUp(); e.RetVal = true; break; case Gdk.Key.Page_Down: // supress scrolling ChatViewManager.CurrentChatView.ScrollDown(); e.RetVal = true; break; case Gdk.Key.Return: case Gdk.Key.KP_Enter: case Gdk.Key.ISO_Enter: case Gdk.Key.Key_3270_Enter: // supress adding a newline e.RetVal = true; if (Activated != null) { Activated(this, EventArgs.Empty); } break; } } private void _OnActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { if (!(Text.Length > 0)) { return; } if (ChatViewManager.CurrentChatView == null) { return; } if (Text.IndexOf("\n") != -1) { var text = Text.TrimEnd('\n'); // seems to be a paste, so let's break it apart string[] msgParts = text.Split(new char[] {'\n'}); if (msgParts.Length > 3) { string msg = String.Format(_("You are going to paste {0} lines. Do you want to continue?"), msgParts.Length); Gtk.MessageDialog md = new Gtk.MessageDialog( Frontend.MainWindow, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.YesNo, msg); Gtk.ResponseType res = (Gtk.ResponseType)md.Run(); md.Destroy(); if (res != Gtk.ResponseType.Yes) { Text = String.Empty; return; } } if (Frontend.EngineVersion < new Version(0,8,11)) { foreach (string msg in msgParts) { ExecuteCommand(msg); } } else { // new engines know how to handle messages containing \n ExecuteCommand(text); } } else { ExecuteCommand(Text); AddToHistory(Text, _History.Count - _HistoryPosition); // reset history position to last entry _HistoryPosition = _History.Count - 1; } Text = String.Empty; } catch (Exception ex) { #if LOG4NET _Logger.Error(ex); #endif Frontend.ShowException(null, ex); } } private void _OnClipboardPasted(object sender, EventArgs e) { Trace.Call(sender, e); } public void ExecuteCommand(string cmd) { if (!(cmd.Length > 0)) { return; } CommandModel cd = new CommandModel( Frontend.FrontendManager, ChatViewManager.CurrentChatView.ChatModel, Settings.CommandCharacter, cmd ); if (_Command(cd)) { return; } _CommandManager.Execute(cd); } private bool _Command(CommandModel cd) { bool handled = false; // command that work even without beeing connected if (cd.IsCommand) { switch (cd.Command) { case "help": _CommandHelp(cd); break; case "detach": _CommandDetach(cd); handled = true; break; case "window": _CommandWindow(cd); handled = true; break; case "clear": _CommandClear(cd); handled = true; break; case "list": _CommandList(cd); handled = true; break; case "sync": _CommandSync(cd); handled = true; break; case "sort": CommandSort(cd); handled = true; break; case "gc": GC.Collect(); handled = true; break; case "generate_messages": CommandGenerateMessages(cd); handled = true; break; } } return handled; } private void _CommandHelp(CommandModel cd) { var chatView = ChatViewManager.GetChat(cd.Chat); var builder = new MessageBuilder(); // TRANSLATOR: this line is used as a label / category for a // list of commands below builder.AppendHeader(_("Frontend Commands")); chatView.AddMessage(builder.ToMessage()); string[] help = { "window (number|channelname|queryname|close)", "sync", "sort", "clear", "echo data", "exec command", "detach", "list [search key]", }; foreach (string line in help) { builder = new MessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(line); chatView.AddMessage(builder.ToMessage()); } } private void _CommandList(CommandModel cd) { Frontend.OpenFindGroupChatWindow(cd.Parameter); } private void _CommandDetach(CommandModel cd) { Frontend.Quit(); } private void _CommandWindow(CommandModel cd) { if (cd.DataArray.Length >= 2) { var currentChat = ChatViewManager.CurrentChatView; if (cd.Parameter.ToLower() == "close") { currentChat.Close(); } else { try { int number = Int32.Parse(cd.DataArray[1]); if (number > ChatViewManager.Chats.Count) { return; } ChatViewManager.CurrentChatNumber = number - 1; return; } catch (FormatException) { } // seems to be query- or channelname // let's see if we find something var seachKey = cd.Parameter.ToLower(); var candidates = new List(); foreach (var chatView in ChatViewManager.Chats) { if (chatView.Name.ToLower() != seachKey) { continue; } if (chatView == currentChat) { // we don't want to switch to ourselves continue; } // name matches // let's see if there is an exact match, if so, take it if ((chatView.GetType() == currentChat.GetType()) && (chatView.ProtocolManager == currentChat.ProtocolManager)) { candidates.Add(chatView); break; } else { // there was no exact match candidates.Add(chatView); } } if (candidates.Count == 0) { return; } ChatViewManager.CurrentChatView = candidates[0]; } } } private void _CommandSync(CommandModel cmd) { if (Frontend.IsLocalEngine) { return; } var chatView = ChatViewManager.CurrentChatView; ThreadPool.QueueUserWorkItem(delegate { try { var oldValue = Frontend.UseLowBandwidthMode; // HACK: force a full sync Frontend.UseLowBandwidthMode = false; chatView.Sync(); Frontend.UseLowBandwidthMode = oldValue; Gtk.Application.Invoke(delegate { Frontend.UseLowBandwidthMode = false; chatView.Populate(); Frontend.UseLowBandwidthMode = oldValue; chatView.ScrollToEnd(); }); } catch (Exception ex) { Frontend.ShowError(null, ex); } }); } void CommandSort(CommandModel cmd) { var chats = new List(ChatViewManager.Chats); // as the sorting does 2 remoting calls, we use a background thread ThreadPool.QueueUserWorkItem(delegate { try { chats.Sort((x, y) => { if (x.ProtocolManager != null && y.ProtocolManager != null && x.ProtocolManager != y.ProtocolManager) { // REMOTING CALL 1 var xprot = x.ProtocolManager.Protocol; // REMOTING CALL 2 var yprot = y.ProtocolManager.Protocol; var prot = xprot.CompareTo(yprot); if (prot != 0) { return prot; } // theirs protocols are equal, so their network decide // REMOTING CALL 3 var xnet = x.ProtocolManager.NetworkID; // REMOTING CALL 4 var ynet = y.ProtocolManager.NetworkID; var net = xnet.CompareTo(ynet); if (net != 0) { return net; } } // their networks are equal, so their type decide var type = GetChatSortValue(y).CompareTo(GetChatSortValue(x)); if (type != 0) { return type; } // their types are equal, so their name decides return x.ID.CompareTo(y.ID); }); Gtk.Application.Invoke(delegate { for (int i = 0; i < chats.Count; i++) { Frontend.MainWindow.Notebook.ReorderChild(chats[i], i); } }); } catch (Exception ex) { #if LOG4NET _Logger.Error("CommandSort(): Exception", ex); #endif } }); } int GetChatSortValue(ChatView chat) { int status = 0; if (chat is SessionChatView) { status += 100; } if (chat is ProtocolChatView) { status += 50; } if (chat is GroupChatView) { status += 10; } return status; } private void _CommandClear(CommandModel cd) { ChatViewManager.CurrentChatView.Clear(); } void CommandGenerateMessages(CommandModel cmd) { var chat = ChatViewManager.CurrentChatView; _CommandManager.CommandGenerateMessages(cmd, chat); var builder = new MessageBuilder(); builder.AppendText( "ChatView.AddMessage(): MessageTextTagTable.Size: {0}", chat.OutputMessageTextView.MessageTextTagTable.Size ); chat.AddMessage(builder.ToMessage()); } private void _NickCompletion() { // perform completion string text = Text; int position = Position; NickCompleter.Complete(ref text, ref position, ChatViewManager.CurrentChatView); Text = text; Position = position; } public virtual void ApplyConfig(UserConfig config) { Trace.Call(config); if (config == null) { throw new ArgumentNullException("config"); } var theme = new ThemeSettings(config); if (theme.BackgroundColor == null) { ModifyBase(Gtk.StateType.Normal); } else { ModifyBase(Gtk.StateType.Normal, theme.BackgroundColor.Value); } if (theme.ForegroundColor == null) { ModifyText(Gtk.StateType.Normal); } else { ModifyText(Gtk.StateType.Normal, theme.ForegroundColor.Value); } ModifyFont(theme.FontDescription); Settings.ApplyConfig(config); // replace nick completer if needed if (Settings.BashStyleCompletion && !(NickCompleter is LongestPrefixNickCompleter)) { NickCompleter = new LongestPrefixNickCompleter(); } else if (!Settings.BashStyleCompletion && !(NickCompleter is TabCycleNickCompleter)) { NickCompleter = new TabCycleNickCompleter(); } // set the completion character NickCompleter.CompletionChar = Settings.CompletionCharacter; } private void InitCommandManager() { if (_CommandManager != null) { _CommandManager.Dispose(); } if (Frontend.Session == null) { _CommandManager = null; } else { _CommandManager = new CommandManager(Frontend.Session); _CommandManager.EngineVersion = Frontend.EngineVersion; _CommandManager.ExceptionEvent += delegate(object sender, CommandExceptionEventArgs e) { Gtk.Application.Invoke(delegate { Frontend.ShowException(e.Exception); }); }; } } private void InitSpellCheck() { #if GTKSPELL try { gtkspell_new_attach(Handle, null, IntPtr.Zero); } catch (Exception ex) { _Logger.Error("InitSpellCheck(): gtkspell_new_attach() "+ "threw exception", ex); } #endif } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } #if GTKSPELL [DllImport("gtkspell.dll", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr gtkspell_new_attach(IntPtr text_view, string locale, IntPtr error); [DllImport("gtkspell.dll", CallingConvention = CallingConvention.Cdecl)] static extern void gtkspell_detach(IntPtr obj); #endif } } smuxi-0.11/src/Frontend-GNOME/AboutDialog.cs0000644000175000017500000000701712264335155021343 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2006-2012 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Linq; using Smuxi.Common; namespace Smuxi.Frontend.Gnome { public class AboutDialog : Gtk.AboutDialog { public AboutDialog(Gtk.Window parent) { if (parent == null) { throw new ArgumentNullException("parent"); } TransientFor = parent; ProgramName = Frontend.Name; var version = Frontend.Version.ToString(); var distVersion = Defines.DistVersion; if (!String.IsNullOrEmpty(distVersion)) { Version = String.Format("\n Vendor: {0}", distVersion); } Version += "\n Frontend: " + Frontend.UIName + " " + version + "\n Engine: " + Frontend.EngineVersion; Copyright = "Copyright © 2005-2013 Mirco Bauer "; Authors = new string[] { "Mirco Bauer ", "David Paleino ", "Clément Bourgeois ", "Chris Le Sueur ", "Tuukka Hastrup ", "Bianca Mix ", "Oliver Schneider ", "Carlos Martín Nieto " }; Artists = new string[] { "Jakub Steiner ", "Rodney Dawes ", "Lapo Calamandrei ", "Ahmed Abdellah ", "George Karavasilev ", "Joern Konopka ", "Nuno F. Pinheiro " }; TranslatorCredits = _("translator-credits"); Logo = Frontend.LoadIcon( Frontend.IconName, 256, "icon_256x256.png" ); // HACK: shows "not implemented" error on OS X and // "No application is registered as handling this file" on Windows. // This probably relies on gvfs or similar which isn't available in // the GTK{+,#} ports/installers for OS X and Windows. Thus we only // show the website URL as label instead. if (Frontend.IsMacOSX || Frontend.IsWindows) { WebsiteLabel = "http://www.smuxi.org/"; } else { Website = "http://www.smuxi.org/"; WebsiteLabel = _("Smuxi Website"); } } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/FindGroupChatDialog.cs0000644000175000017500000002220112250426634022754 0ustar00meebeymeebey00000000000000/* * $Id: MainWindow.cs 273 2008-07-12 17:00:51Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/MainWindow.cs $ * $Rev: 273 $ * $Author: meebey $ * $Date: 2008-07-12 19:00:51 +0200 (Sat, 12 Jul 2008) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Threading; using System.Collections.Generic; using Mono.Unix; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public partial class FindGroupChatDialog : Gtk.Dialog { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private IProtocolManager f_ProtocolManager; private Gtk.ListStore f_ListStore; private GroupChatModel f_GroupChatModel; private Thread f_FindThread; public GroupChatModel GroupChat { get { return f_GroupChatModel; } } public Gtk.Entry NameEntry { get { return f_NameEntry; } } public Gtk.Button FindButton { get { return f_FindButton; } } public FindGroupChatDialog(Gtk.Window parent, IProtocolManager protocolManager) : base(null, parent, Gtk.DialogFlags.DestroyWithParent) { Build(); f_ProtocolManager = protocolManager; int columnID = 0; Gtk.TreeViewColumn column; columnID++; column = f_TreeView.AppendColumn("#", new Gtk.CellRendererText(), "text", columnID); column.SortColumnId = columnID; columnID++; column = f_TreeView.AppendColumn(_("Name"), new Gtk.CellRendererText(), "text", columnID); column.SortColumnId = columnID; column.Resizable = true; columnID++; column = f_TreeView.AppendColumn(_("Topic"), new Gtk.CellRendererText(), "markup", columnID); column.SortColumnId = columnID; column.Resizable = true; f_ListStore = new Gtk.ListStore( typeof(GroupChatModel), typeof(int), // person count typeof(string), // name typeof(string) // topic pango markup ); f_TreeView.RowActivated += OnTreeViewRowActivated; f_TreeView.Selection.Changed += OnTreeViewSelectionChanged; f_TreeView.Model = f_ListStore; f_TreeView.SearchColumn = 2; // name } protected virtual void OnFindButtonClicked(object sender, System.EventArgs e) { Trace.Call(sender, e); try { string nameFilter = f_NameEntry.Text.Trim(); if (!(Frontend.EngineVersion >= new Version("0.8.1")) && String.IsNullOrEmpty(nameFilter)) { Gtk.MessageDialog md = new Gtk.MessageDialog( this, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.YesNo, _("Searching for group chats without a filter is not " + "recommended. This may take a while, or may not " + "work at all.\n" + "Do you wish to continue?") ); int result = md.Run(); md.Destroy(); if (result != (int) Gtk.ResponseType.Yes) { return; } } f_ListStore.Clear(); CancelFindThread(); GroupChatModel filter = new GroupChatModel(null, nameFilter, null); f_FindThread = new Thread(new ThreadStart(delegate { try { Gtk.Application.Invoke(delegate { GdkWindow.Cursor = new Gdk.Cursor(Gdk.CursorType.Watch); }); IList chats = f_ProtocolManager.FindGroupChats(filter); Gtk.Application.Invoke(delegate { Gdk.Color bgColor = f_TreeView.Style.Background(Gtk.StateType.Normal); foreach (GroupChatModel chat in chats) { f_ListStore.AppendValues( chat, chat.PersonCount, chat.Name, PangoTools.ToMarkup(chat.Topic, bgColor) ); } }); } catch (ThreadAbortException) { #if LOG4NET f_Logger.Debug("FindThread aborted"); #endif Thread.ResetAbort(); } catch (Exception ex) { Frontend.ShowError(this, _("Error while fetching the list of group chats from the server."), ex); } finally { Gtk.Application.Invoke(delegate { // if the dialog is gone the GdkWindow might be destroyed already if (GdkWindow != null) { GdkWindow.Cursor = null; } }); } })); f_FindThread.IsBackground = true; f_FindThread.Start(); } catch (Exception ex) { Frontend.ShowException(ex); } } private void CancelFindThread() { if (f_FindThread != null && f_FindThread.IsAlive) { try { #if LOG4NET f_Logger.Debug("Aborting FindThread..."); #endif f_FindThread.Abort(); } catch (Exception ex) { #if LOG4NET f_Logger.Error(ex); #endif } f_FindThread = null; GdkWindow.Cursor = null; } } protected virtual GroupChatModel GetCurrentGroupChat() { Trace.Call(); Gtk.TreeIter iter; if (!f_TreeView.Selection.GetSelected(out iter)) { return null; } return (GroupChatModel) f_ListStore.GetValue(iter, 0); } protected virtual void OnTreeViewRowActivated(object sender, Gtk.RowActivatedArgs e) { Trace.Call(sender, e); try { GroupChatModel chat = GetCurrentGroupChat(); if (chat == null) { return; } Respond(Gtk.ResponseType.Ok); } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual void OnTreeViewSelectionChanged(object sender, EventArgs e) { Trace.Call(sender, e); try { f_OKButton.Sensitive = GetCurrentGroupChat() != null; } catch (Exception ex) { Frontend.ShowException(ex); } } protected override void OnResponse(Gtk.ResponseType responseType) { Trace.Call(responseType); switch (responseType) { case Gtk.ResponseType.Ok: f_GroupChatModel = GetCurrentGroupChat(); break; case Gtk.ResponseType.Cancel: CancelFindThread(); break; } base.OnResponse(responseType); } protected virtual void OnNameEntryActivated(object sender, System.EventArgs e) { Trace.Call(sender, e); try { f_FindButton.Click(); } catch (Exception ex) { Frontend.ShowException(ex); } } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/Gtk.WindowExtensions.cs0000644000175000017500000000612212250426550023213 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2012 Mirco Bauer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; using System.Runtime.InteropServices; namespace Gtk.Extensions { public static class WindowExtensions { static bool IsGdkX11Available = true; [DllImport("libgdk-x11-2.0.so.0")] static extern UInt32 gdk_x11_get_server_time(IntPtr gdkWindowHandle); public static void PresentWithServerTime(this Gtk.Window window) { if (window == null) { return; } var gdkWindow = window.GdkWindow; if (gdkWindow == null || !IsGdkX11Available) { window.Present(); return; } // HACK: disabled, see window.AddEvents() below /* if ((gdkWindow.Events & Gdk.EventMask.PropertyChangeMask) == 0) { // GDK_PROPERTY_CHANGE_MASK is not set thus we have to bail out // else gdk_x11_get_server_time() will hang! window.Present(); return; } */ // HACK: we can't obtain and check for GDK_PROPERTY_CHANGE_MASK as // gdk_window_x11_get_events() filters that mask, thus we have to // ignorantly set it using gtk_widget_add_events() else // gdk_x11_get_server_time() would hang if it wasn't set! window.AddEvents((int) Gdk.EventMask.PropertyChangeMask); try { // TODO: should we fallback to gdk_x11_display_get_user_time? var timestamp = gdk_x11_get_server_time(gdkWindow.Handle); window.PresentWithTime(timestamp); } catch (DllNotFoundException) { IsGdkX11Available = false; // no libgdk-x11 available (probably Mac OS X or Windows), thus // fallback to gtk_window_present() without a timestamp as they // don't require a timestamp to change the window focus window.Present(); } } } } smuxi-0.11/src/Frontend-GNOME/NotImplementedMessageDialog.cs0000644000175000017500000000365711655545675024545 0ustar00meebeymeebey00000000000000/* * $Id: PreferencesDialog.cs 73 2005-06-27 12:42:06Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GtkGnome/PreferencesDialog.cs $ * $Rev: 73 $ * $Author: meebey $ * $Date: 2005-06-27 14:42:06 +0200 (Mon, 27 Jun 2005) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Mono.Unix; using Smuxi; namespace Smuxi.Frontend.Gnome { public class NotImplementedMessageDialog : Gtk.MessageDialog { public NotImplementedMessageDialog(Gtk.Window parent) : base(parent, Gtk.DialogFlags.Modal, Gtk.MessageType.Info, Gtk.ButtonsType.Close, _("Sorry, not implemented yet!")) { } public static void Show(Gtk.Window parent) { NotImplementedMessageDialog nimd = new NotImplementedMessageDialog(parent); nimd.Run(); nimd.Destroy(); } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/osx/0000755000175000017500000000000012311344241017413 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-GNOME/osx/CoreFoundation.cs0000644000175000017500000002011512250426634022671 0ustar00meebeymeebey00000000000000// // CoreFoundation.cs // // Author: // Michael Hutchinson // Miguel de Icaza // // Copyright (c) 2009 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Runtime.InteropServices; namespace MonoDevelop.MacInterop { internal static class CoreFoundation { const string CFLib = "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"; const string LSLib = "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices"; [DllImport (CFLib)] static extern IntPtr CFStringCreateWithCString (IntPtr alloc, string str, int encoding); public static IntPtr CreateString (string s) { // The magic value is "kCFStringENcodingUTF8" return CFStringCreateWithCString (IntPtr.Zero, s, 0x08000100); } [DllImport (CFLib, EntryPoint="CFRelease")] public static extern void Release (IntPtr cfRef); struct CFRange { public int Location, Length; public CFRange (int l, int len) { Location = l; Length = len; } } [DllImport (CFLib, CharSet=CharSet.Unicode)] extern static int CFStringGetLength (IntPtr handle); [DllImport (CFLib, CharSet=CharSet.Unicode)] extern static IntPtr CFStringGetCharactersPtr (IntPtr handle); [DllImport (CFLib, CharSet=CharSet.Unicode)] extern static IntPtr CFStringGetCharacters (IntPtr handle, CFRange range, IntPtr buffer); public static string FetchString (IntPtr handle) { if (handle == IntPtr.Zero) return null; string str; int l = CFStringGetLength (handle); IntPtr u = CFStringGetCharactersPtr (handle); IntPtr buffer = IntPtr.Zero; if (u == IntPtr.Zero){ CFRange r = new CFRange (0, l); buffer = Marshal.AllocCoTaskMem (l * 2); CFStringGetCharacters (handle, r, buffer); u = buffer; } /* unsafe { str = new string ((char *) u, 0, l); } */ str = Marshal.PtrToStringUni(u, l); if (buffer != IntPtr.Zero) Marshal.FreeCoTaskMem (buffer); return str; } public static string FSRefToString (ref FSRef fsref) { IntPtr url = IntPtr.Zero; IntPtr str = IntPtr.Zero; try { url = CFURLCreateFromFSRef (IntPtr.Zero, ref fsref); if (url == IntPtr.Zero) return null; str = CFURLCopyFileSystemPath (url, CFUrlPathStyle.Posix); if (str == IntPtr.Zero) return null; return FetchString (str); } finally { if (url != IntPtr.Zero) Release (url); if (str != IntPtr.Zero) Release (str); } } [DllImport (CFLib)] extern static IntPtr CFURLCreateFromFSRef (IntPtr allocator, ref FSRef fsref); [DllImport (CFLib)] extern static IntPtr CFURLCopyFileSystemPath (IntPtr urlRef, CFUrlPathStyle pathStyle); enum CFUrlPathStyle { Posix = 0, Hfs = 1, Windows = 2 }; [DllImport (CFLib)] extern static IntPtr CFURLCreateWithFileSystemPath (IntPtr allocator, IntPtr filePathString, CFUrlPathStyle pathStyle, bool isDirectory); [DllImport (LSLib)] extern static IntPtr LSCopyApplicationURLsForURL (IntPtr urlRef, LSRolesMask roleMask); //CFArrayRef [DllImport (LSLib)] extern static int LSGetApplicationForURL (IntPtr url, LSRolesMask roleMask, IntPtr fsRefZero, ref IntPtr appUrl); [DllImport (CFLib)] extern static int CFArrayGetCount (IntPtr theArray); [DllImport (CFLib)] extern static IntPtr CFArrayGetValueAtIndex (IntPtr theArray, int idx); [Flags] public enum LSRolesMask : uint { None = 0x00000001, Viewer = 0x00000002, Editor = 0x00000004, Shell = 0x00000008, All = 0xFFFFFFFF } static IntPtr CreatePathUrl (string path) { IntPtr str = IntPtr.Zero; IntPtr url = IntPtr.Zero; try { str = CreateString (path); if (str == IntPtr.Zero) throw new Exception ("CreateString failed"); url = CFURLCreateWithFileSystemPath (IntPtr.Zero, str, CFUrlPathStyle.Posix, false); if (url == IntPtr.Zero) throw new Exception ("CFURLCreateWithFileSystemPath failed"); return url; } finally { if (str != IntPtr.Zero) Release (str); } } public static string UrlToPath (IntPtr url) { IntPtr str = IntPtr.Zero; try { str = CFURLCopyFileSystemPath (url, CFUrlPathStyle.Posix); return str == IntPtr.Zero? null : FetchString (str); } finally { if (str != IntPtr.Zero) Release (str); } } public static string GetApplicationUrl (string filePath, LSRolesMask roles) { IntPtr url = IntPtr.Zero; try { url = CreatePathUrl (filePath); IntPtr appUrl = IntPtr.Zero; if (LSGetApplicationForURL (url, roles, IntPtr.Zero, ref appUrl) == 0 && appUrl != IntPtr.Zero) return UrlToPath (appUrl); return null; } finally { if (url != IntPtr.Zero) Release (url); } } public static string[] GetApplicationUrls (string filePath, LSRolesMask roles) { IntPtr url = IntPtr.Zero; IntPtr arr = IntPtr.Zero; try { url = CreatePathUrl (filePath); arr = LSCopyApplicationURLsForURL (url, roles); if (arr == IntPtr.Zero) return new string[0]; int count = CFArrayGetCount (arr); string[] values = new string [count]; for (int i = 0; i < values.Length; i++ ) { var u = CFArrayGetValueAtIndex (arr, i); if (u != IntPtr.Zero) values[i] = UrlToPath (u); } return values; } finally { if (url != IntPtr.Zero) Release (url); if (arr != IntPtr.Zero) Release (arr); } } } }smuxi-0.11/src/Frontend-GNOME/osx/Carbon.cs0000644000175000017500000005142212250426634021163 0ustar00meebeymeebey00000000000000// // Carbon.cs // // Author: // Michael Hutchinson // Geoff Norton // // Copyright (c) 2009 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Runtime.InteropServices; using System.Collections.Generic; using System.Diagnostics; namespace MonoDevelop.MacInterop { internal delegate CarbonEventHandlerStatus EventDelegate (IntPtr callRef, IntPtr eventRef, IntPtr userData); internal delegate CarbonEventHandlerStatus AEHandlerDelegate (IntPtr inEvnt, IntPtr outEvt, uint refConst); internal static class Carbon { public const string CarbonLib = "/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon"; [DllImport (CarbonLib)] static extern int Gestalt (int selector, out int result); public static int Gestalt (string selector) { int cc = ConvertCharCode (selector); int result; int ret = Gestalt (cc, out result); CheckReturn (ret); return result; } [DllImport (CarbonLib)] public static extern IntPtr GetApplicationEventTarget (); [DllImport (CarbonLib)] public static extern IntPtr GetControlEventTarget (IntPtr control); [DllImport (CarbonLib)] public static extern IntPtr GetWindowEventTarget (IntPtr window); [DllImport (CarbonLib)] public static extern IntPtr GetMenuEventTarget (IntPtr menu); [DllImport (CarbonLib)] public static extern CarbonEventClass GetEventClass (IntPtr eventref); [DllImport (CarbonLib)] public static extern uint GetEventKind (IntPtr eventref); #region Event handler installation [DllImport (CarbonLib)] static extern EventStatus InstallEventHandler (IntPtr target, EventDelegate handler, uint count, CarbonEventTypeSpec [] types, IntPtr user_data, out IntPtr handlerRef); [DllImport (CarbonLib)] public static extern EventStatus RemoveEventHandler (IntPtr handlerRef); public static IntPtr InstallEventHandler (IntPtr target, EventDelegate handler, CarbonEventTypeSpec [] types) { IntPtr handlerRef; CheckReturn (InstallEventHandler (target, handler, (uint)types.Length, types, IntPtr.Zero, out handlerRef)); return handlerRef; } public static IntPtr InstallEventHandler (IntPtr target, EventDelegate handler, CarbonEventTypeSpec type) { return InstallEventHandler (target, handler, new CarbonEventTypeSpec[] { type }); } public static IntPtr InstallApplicationEventHandler (EventDelegate handler, CarbonEventTypeSpec [] types) { return InstallEventHandler (GetApplicationEventTarget (), handler, types); } public static IntPtr InstallApplicationEventHandler (EventDelegate handler, CarbonEventTypeSpec type) { return InstallEventHandler (GetApplicationEventTarget (), handler, new CarbonEventTypeSpec[] { type }); } #endregion #region Event parameter extraction [DllImport (CarbonLib)] public static extern EventStatus GetEventParameter (IntPtr eventRef, CarbonEventParameterName name, CarbonEventParameterType desiredType, out CarbonEventParameterType actualType, uint size, ref uint outSize, ref IntPtr outPtr); public static IntPtr GetEventParameter (IntPtr eventRef, CarbonEventParameterName name, CarbonEventParameterType desiredType) { CarbonEventParameterType actualType; uint outSize = 0; IntPtr val = IntPtr.Zero; CheckReturn (GetEventParameter (eventRef, name, desiredType, out actualType, (uint)IntPtr.Size, ref outSize, ref val)); return val; } [DllImport (CarbonLib)] static extern EventStatus GetEventParameter (IntPtr eventRef, CarbonEventParameterName name, CarbonEventParameterType desiredType, out CarbonEventParameterType actualType, uint size, ref uint outSize, IntPtr dataBuffer); [DllImport (CarbonLib)] static extern EventStatus GetEventParameter (IntPtr eventRef, CarbonEventParameterName name, CarbonEventParameterType desiredType, uint zero, uint size, uint zero2, IntPtr dataBuffer); public static T GetEventParameter (IntPtr eventRef, CarbonEventParameterName name, CarbonEventParameterType desiredType) where T : struct { int len = Marshal.SizeOf (typeof (T)); IntPtr bufferPtr = Marshal.AllocHGlobal (len); CheckReturn (GetEventParameter (eventRef, name, desiredType, 0, (uint)len, 0, bufferPtr)); T val = (T)Marshal.PtrToStructure (bufferPtr, typeof (T)); Marshal.FreeHGlobal (bufferPtr); return val; } #endregion #region Sending events [DllImport (CarbonLib)] static extern EventStatus SendEventToEventTarget (IntPtr eventRef, IntPtr eventTarget); [DllImport (CarbonLib)] static extern EventStatus CreateEvent (IntPtr allocator, CarbonEventClass classID, uint kind, double eventTime, CarbonEventAttributes flags, out IntPtr eventHandle); [DllImport (CarbonLib)] static extern void ReleaseEvent (IntPtr eventHandle); static EventStatus SendApplicationEvent (CarbonEventClass classID, uint kind, CarbonEventAttributes flags) { IntPtr eventHandle; EventStatus s = CreateEvent (IntPtr.Zero, classID, kind, 0, flags, out eventHandle); if (s != EventStatus.Ok) return s; s = SendEventToEventTarget (eventHandle, GetApplicationEventTarget ()); ReleaseEvent (eventHandle); return s; } [DllImport (CarbonLib)] public static extern CarbonEventHandlerStatus ProcessHICommand (ref CarbonHICommand command); #endregion #region Error checking public static void CheckReturn (EventStatus status) { int intStatus = (int) status; if (intStatus < 0) throw new EventStatusException (status); } public static void CheckReturn (int osErr) { if (osErr != 0) { string s = GetMacOSStatusCommentString (osErr); throw new SystemException ("Unexpected OS error code " + osErr + ": " + s); } } [DllImport (CarbonLib)] static extern string GetMacOSStatusCommentString (int osErr); #endregion #region Char code conversion internal static int ConvertCharCode (string fourcc) { Debug.Assert (fourcc != null); Debug.Assert (fourcc.Length == 4); return (fourcc[3]) | (fourcc[2] << 8) | (fourcc[1] << 16) | (fourcc[0] << 24); } internal static string UnConvertCharCode (int i) { return new string (new char[] { (char)(i >> 24), (char)(0xFF & (i >> 16)), (char)(0xFF & (i >> 8)), (char)(0xFF & i), }); } #endregion #region Internal Mac API for setting process name [DllImport (CarbonLib)] static extern int GetCurrentProcess (out ProcessSerialNumber psn); [DllImport (CarbonLib)] static extern int CPSSetProcessName (ref ProcessSerialNumber psn, string name); public static void SetProcessName (string name) { try { ProcessSerialNumber psn; if (GetCurrentProcess (out psn) == 0) CPSSetProcessName (ref psn, name); } catch {} //EntryPointNotFoundException? } struct ProcessSerialNumber { #pragma warning disable 0169 ulong highLongOfPSN; ulong lowLongOfPSN; #pragma warning restore 0169 } #endregion public static Dictionary GetFileListFromEventRef (IntPtr eventRef) { AEDesc list = GetEventParameter (eventRef, CarbonEventParameterName.DirectObject, CarbonEventParameterType.AEList); try { int line = 0; try { SelectionRange range = GetEventParameter (eventRef, CarbonEventParameterName.AEPosition, CarbonEventParameterType.Char); line = range.lineNum+1; } catch { } var arr = AppleEvent.GetListFromAEDesc (ref list, CoreFoundation.FSRefToString, (OSType)(int)CarbonEventParameterType.FSRef); var files = new Dictionary (); foreach (var s in arr) { if (!string.IsNullOrEmpty (s)) files[s] = line; } return files; } finally { CheckReturn ((int)AppleEvent.AEDisposeDesc (ref list)); } } public static IList GetUrlListFromEventRef (IntPtr eventRef) { AEDesc list = GetEventParameter (eventRef, CarbonEventParameterName.DirectObject, CarbonEventParameterType.AEList); try { return AppleEvent.GetUtf8StringListFromAEDesc (ref list, true); } finally { Carbon.CheckReturn ((int)AppleEvent.AEDisposeDesc (ref list)); } } } [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 80)] struct FSRef { //this is an 80-char opaque byte array #pragma warning disable 0169 private byte hidden; #pragma warning restore 0169 } [StructLayout(LayoutKind.Sequential)] struct SelectionRange { public short unused1; // 0 (not used) public short lineNum; // line to select (<0 to specify range) public int startRange; // start of selection range (if line < 0) public int endRange; // end of selection range (if line < 0) public int unused2; // 0 (not used) public int theDate; // modification date/time } internal enum CarbonEventHandlerStatus //this is an OSStatus { Handled = 0, NotHandled = -9874, UserCancelled = -128, } internal enum CarbonEventParameterName : uint { DirectObject = 757935405, // '----' AEPosition = 1802530675, // 'kpos' } internal enum CarbonEventParameterType : uint { HICommand = 1751346532, // 'hcmd' MenuRef = 1835363957, // 'menu' WindowRef = 2003398244, // 'wind' Char = 1413830740, // 'TEXT' UInt32 = 1835100014, // 'magn' UnicodeText = 1970567284, // 'utxt' AEList = 1818850164, // 'list' WildCard = 707406378, // '****' FSRef = 1718841958, // 'fsrf' } internal enum CarbonEventClass : uint { Mouse = 1836021107, // 'mous' Keyboard = 1801812322, // 'keyb' TextInput = 1952807028, // 'text' Application = 1634758764, // 'appl' RemoteAppleEvent = 1701867619, //'eppc' //remote apple event? Menu = 1835363957, // 'menu' Window = 2003398244, // 'wind' Control = 1668183148, // 'cntl' Command = 1668113523, // 'cmds' Tablet = 1952607348, // 'tblt' Volume = 1987013664, // 'vol ' Appearance = 1634758765, // 'appm' Service = 1936028278, // 'serv' Toolbar = 1952604530, // 'tbar' ToolbarItem = 1952606580, // 'tbit' Accessibility = 1633903461, // 'acce' HIObject = 1751740258, // 'hiob' AppleEvent = 1634039412, // 'aevt' Internet = 1196773964, // 'GURL' } public enum CarbonCommandID : uint { OK = 1869291552, // 'ok ' Cancel = 1852797985, // 'not!' Quit = 1903520116, // 'quit' Undo = 1970168943, // 'undo' Redo = 1919247471, // 'redo' Cut = 1668641824, // 'cut ' Copy = 1668247673, // 'copy' Paste = 1885434740, // 'past' Clear = 1668048225, // 'clea', SelectAll = 1935764588, // 'sall', Preferences = 1886545254, //'pref' About = 1633841013, // 'abou' New = 1852143392, // 'new ', Open = 1869636974, // 'open' Close = 1668050803, // 'clos' Save = 1935767141, // 'save', SaveAs = 1937138035, // 'svas' Revert = 1920365172, // 'rvrt' Print = 1886547572, // 'prnt' PageSetup = 1885431653, // 'page', AppHelp = 1634233456, //'ahlp' //menu manager handles these automatically Hide = 1751737445, // 'hide' HideOthers = 1751737455, // 'hido' ShowAll = 1936220524, // 'shal' ZoomWindow = 2054123373, // 'zoom' MinimizeWindow = 1835626089, // 'mini' MinimizeAll = 1835626081, // 'mina' MaximizeAll = 1835104353, // 'maxa' ArrangeInFront = 1718775412, // 'frnt' BringAllToFront = 1650881140, // 'bfrt' SelectWindow = 1937205614, // 'swin' RotateWindowsForward = 1919906935, // 'rotw' RotateWindowsBackward = 1919906914, // 'rotb' RotateFloatingWindowsForward = 1920231031, // 'rtfw' RotateFloatingWindowsBackward = 1920231010, // 'rtfb' //created automatically -- used for inserting before/after the default window list WindowListSeparator = 2003592310, // 'wldv' WindowListTerminator = 2003596148, // 'wlst' } internal enum CarbonEventCommand : uint { Process = 1, UpdateStatus = 2, } internal enum CarbonEventMenu : uint { BeginTracking = 1, EndTracking = 2, ChangeTrackingMode = 3, Opening = 4, Closed = 5, TargetItem = 6, MatchKey = 7, } internal enum CarbonEventAttributes : uint { None = 0, UserEvent = (1 << 0), Monitored= 1 << 3, } internal enum CarbonEventApple { OpenApplication = 1868656752, // 'oapp' ReopenApplication = 1918988400, //'rapp' OpenDocuments = 1868853091, // 'odoc' PrintDocuments = 188563030, // 'pdoc' OpenContents = 1868787566, // 'ocon' QuitApplication = 1903520116, // 'quit' ShowPreferences = 1886545254, // 'pref' ApplicationDied = 1868720500, // 'obit' GetUrl = 1196773964, // 'GURL' } [StructLayout(LayoutKind.Sequential, Pack = 2)] struct CarbonEventTypeSpec { public CarbonEventClass EventClass; public uint EventKind; public CarbonEventTypeSpec (CarbonEventClass eventClass, UInt32 eventKind) { this.EventClass = eventClass; this.EventKind = eventKind; } public CarbonEventTypeSpec (CarbonEventMenu kind) : this (CarbonEventClass.Menu, (uint) kind) { } public CarbonEventTypeSpec (CarbonEventCommand kind) : this (CarbonEventClass.Command, (uint) kind) { } public CarbonEventTypeSpec (CarbonEventApple kind) : this (CarbonEventClass.AppleEvent, (uint) kind) { } public static implicit operator CarbonEventTypeSpec (CarbonEventMenu kind) { return new CarbonEventTypeSpec (kind); } public static implicit operator CarbonEventTypeSpec (CarbonEventCommand kind) { return new CarbonEventTypeSpec (kind); } public static implicit operator CarbonEventTypeSpec (CarbonEventApple kind) { return new CarbonEventTypeSpec (kind); } } class EventStatusException : SystemException { public EventStatusException (EventStatus status) { StatusCode = status; } public EventStatus StatusCode { get; private set; } } enum EventStatus // this is an OSStatus { Ok = 0, //event manager EventAlreadyPostedErr = -9860, EventTargetBusyErr = -9861, EventClassInvalidErr = -9862, EventClassIncorrectErr = -9864, EventHandlerAlreadyInstalledErr = -9866, EventInternalErr = -9868, EventKindIncorrectErr = -9869, EventParameterNotFoundErr = -9870, EventNotHandledErr = -9874, EventLoopTimedOutErr = -9875, EventLoopQuitErr = -9876, EventNotInQueueErr = -9877, EventHotKeyExistsErr = -9878, EventHotKeyInvalidErr = -9879, } [StructLayout(LayoutKind.Explicit)] struct CarbonHICommand //technically HICommandExtended, but they're compatible { [FieldOffset(0)] CarbonHICommandAttributes attributes; [FieldOffset(4)] uint commandID; [FieldOffset(8)] IntPtr controlRef; [FieldOffset(8)] IntPtr windowRef; [FieldOffset(8)] HIMenuItem menuItem; public CarbonHICommand (uint commandID, HIMenuItem item) { windowRef = controlRef = IntPtr.Zero; this.commandID = commandID; this.menuItem = item; this.attributes = CarbonHICommandAttributes.FromMenu; } public CarbonHICommandAttributes Attributes { get { return attributes; } } public uint CommandID { get { return commandID; } } public IntPtr ControlRef { get { return controlRef; } } public IntPtr WindowRef { get { return windowRef; } } public HIMenuItem MenuItem { get { return menuItem; } } public bool IsFromMenu { get { return attributes == CarbonHICommandAttributes.FromMenu; } } public bool IsFromControl { get { return attributes == CarbonHICommandAttributes.FromControl; } } public bool IsFromWindow { get { return attributes == CarbonHICommandAttributes.FromWindow; } } } [StructLayout(LayoutKind.Sequential, Pack = 2)] struct HIMenuItem { IntPtr menuRef; ushort index; public HIMenuItem (IntPtr menuRef, ushort index) { this.index = index; this.menuRef = menuRef; } public IntPtr MenuRef { get { return menuRef; } } public ushort Index { get { return index; } } } //*NOT* flags enum CarbonHICommandAttributes : uint { FromMenu = 1, FromControl = 1 << 1, FromWindow = 1 << 2, } struct OSType { int value; public int Value { get { return Value; } } public OSType (int value) { this.value = value; } public OSType (string fourcc) { value = Carbon.ConvertCharCode (fourcc); } public static explicit operator OSType (string fourcc) { return new OSType (fourcc); } public static implicit operator int (OSType o) { return o.value; } public static implicit operator OSType (int i) { return new OSType (i); } } }smuxi-0.11/src/Frontend-GNOME/osx/IgeMacMenu.cs0000644000175000017500000000462712250426634021736 0ustar00meebeymeebey00000000000000using System; using System.Collections; using System.Runtime.InteropServices; namespace IgeMacIntegration { public class IgeMacMenu { [DllImport("libigemacintegration.dylib")] static extern void ige_mac_menu_connect_window_key_handler (IntPtr window); public static void ConnectWindowKeyHandler (Gtk.Window window) { ige_mac_menu_connect_window_key_handler (window.Handle); } [DllImport("libigemacintegration.dylib")] static extern void ige_mac_menu_set_global_key_handler_enabled (bool enabled); public static bool GlobalKeyHandlerEnabled { set { ige_mac_menu_set_global_key_handler_enabled (value); } } [DllImport("libigemacintegration.dylib")] static extern void ige_mac_menu_set_menu_bar(IntPtr menu_shell); public static Gtk.MenuShell MenuBar { set { ige_mac_menu_set_menu_bar(value == null ? IntPtr.Zero : value.Handle); } } [DllImport("libigemacintegration.dylib")] static extern void ige_mac_menu_set_quit_menu_item(IntPtr quit_item); public static Gtk.MenuItem QuitMenuItem { set { ige_mac_menu_set_quit_menu_item(value == null ? IntPtr.Zero : value.Handle); } } [DllImport("libigemacintegration.dylib")] static extern IntPtr ige_mac_menu_add_app_menu_group(); public static IgeMacIntegration.IgeMacMenuGroup AddAppMenuGroup() { IntPtr raw_ret = ige_mac_menu_add_app_menu_group(); IgeMacIntegration.IgeMacMenuGroup ret = raw_ret == IntPtr.Zero ? null : (IgeMacIntegration.IgeMacMenuGroup) GLib.Opaque.GetOpaque (raw_ret, typeof (IgeMacIntegration.IgeMacMenuGroup), false); return ret; } } public class IgeMacMenuGroup : GLib.Opaque { [DllImport("libigemacintegration.dylib")] static extern void ige_mac_menu_add_app_menu_item(IntPtr raw, IntPtr menu_item, IntPtr label); public void AddMenuItem(Gtk.MenuItem menu_item, string label) { IntPtr native_label = GLib.Marshaller.StringToPtrGStrdup (label); ige_mac_menu_add_app_menu_item(Handle, menu_item == null ? IntPtr.Zero : menu_item.Handle, native_label); GLib.Marshaller.Free (native_label); } public IgeMacMenuGroup(IntPtr raw) : base(raw) {} } }smuxi-0.11/src/Frontend-GNOME/osx/AppleEvent.cs0000644000175000017500000002130712250426634022021 0ustar00meebeymeebey00000000000000// // AppleEvent.cs // // Author: // Michael Hutchinson // // Copyright (c) 2010 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Runtime.InteropServices; using System.Collections.Generic; namespace MonoDevelop.MacInterop { internal static class AppleEvent { const string AELib = Carbon.CarbonLib; //FIXME: is "int" correct for size? [DllImport (AELib)] static extern AEDescStatus AECreateDesc (OSType typeCode, IntPtr dataPtr, int dataSize, out AEDesc desc); [DllImport (AELib)] static extern AEDescStatus AECreateDesc (OSType typeCode, byte[] data, int dataSize, out AEDesc desc); [DllImport (AELib)] static extern AEDescStatus AEGetNthPtr (ref AEDesc descList, int index, OSType desiredType, uint keyword, out CarbonEventParameterType actualType, IntPtr buffer, int bufferSize, out int actualSize); [DllImport (AELib)] static extern AEDescStatus AEGetNthPtr (ref AEDesc descList, int index, OSType desiredType, uint keyword, uint zero, IntPtr buffer, int bufferSize, int zero2); [DllImport (AELib)] static extern AEDescStatus AECountItems (ref AEDesc descList, out int count); //return an OSErr [DllImport (AELib)] static extern AEDescStatus AEGetNthPtr (ref AEDesc descList, int index, OSType desiredType, uint keyword, uint zero, out IntPtr outPtr, int bufferSize, int zero2); [DllImport (AELib)] public static extern AEDescStatus AEDisposeDesc (ref AEDesc desc); [DllImport (AELib)] public static extern AEDescStatus AESizeOfNthItem (ref AEDesc descList, int index, ref OSType type, out int size); [DllImport (AELib)] static extern AEDescStatus AEGetDescData (ref AEDesc desc, IntPtr ptr, int maximumSize); [DllImport (AELib)] static extern int AEGetDescDataSize (ref AEDesc desc); [DllImport (AELib)] static extern AEDescStatus AECoerceDesc (ref AEDesc theAEDesc, DescType toType, ref AEDesc result); public static void AECreateDesc (OSType typeCode, byte[] data, out AEDesc result) { CheckReturn (AECreateDesc (typeCode, data, data.Length, out result)); } public static void AECreateDescUtf8 (string value, out AEDesc result) { var type = (OSType)(int)CarbonEventParameterType.UnicodeText; var bytes = System.Text.Encoding.UTF8.GetBytes (value); CheckReturn (AECreateDesc (type, bytes, bytes.Length, out result)); } public static void AECreateDescAscii (string value, out AEDesc result) { var type = (OSType)(int)CarbonEventParameterType.Char; var bytes = System.Text.Encoding.ASCII.GetBytes (value); CheckReturn (AECreateDesc (type, bytes, bytes.Length, out result)); } public static void AECreateDescNull (out AEDesc desc) { CheckReturn (AECreateDesc ((OSType)0, IntPtr.Zero, 0, out desc)); } public static int AECountItems (ref AEDesc descList) { int count; CheckReturn (AECountItems (ref descList, out count)); return count; } public static T AEGetNthPtr (ref AEDesc descList, int index, OSType desiredType) where T : struct { int len = Marshal.SizeOf (typeof (T)); IntPtr bufferPtr = Marshal.AllocHGlobal (len); try { CheckReturn (AEGetNthPtr (ref descList, index, desiredType, 0, 0, bufferPtr, len, 0)); T val = (T)Marshal.PtrToStructure (bufferPtr, typeof (T)); return val; } finally{ Marshal.FreeHGlobal (bufferPtr); } } public static IntPtr AEGetNthPtr (ref AEDesc descList, int index, OSType desiredType) { IntPtr ret; CheckReturn (AEGetNthPtr (ref descList, index, desiredType, 0, 0, out ret, 4, 0)); return ret; } //FIXME: this might not work in some encodings. need to test more. static string GetUtf8StringFromAEPtr (ref AEDesc descList, int index) { int size; var type = (OSType)(int)CarbonEventParameterType.UnicodeText; if (AESizeOfNthItem (ref descList, index, ref type, out size) == AEDescStatus.Ok) { IntPtr buffer = Marshal.AllocHGlobal (size); try { if (AEGetNthPtr (ref descList, index, type, 0, 0, buffer, size, 0) == AEDescStatus.Ok) return Marshal.PtrToStringAuto (buffer, size); } finally { Marshal.FreeHGlobal (buffer); } } return null; } public static string GetStringFromAEDesc (ref AEDesc desc) { int size = AEGetDescDataSize (ref desc); if (size > 0) { IntPtr buffer = Marshal.AllocHGlobal (size); try { if (AEGetDescData (ref desc, buffer, size) == AEDescStatus.Ok) return Marshal.PtrToStringAuto (buffer, size); } finally { Marshal.FreeHGlobal (buffer); } } return null; } public static IList GetUtf8StringListFromAEDesc (ref AEDesc list, bool skipEmpty) { long count = AppleEvent.AECountItems (ref list); var items = new List (); for (int i = 1; i <= count; i++) { string str = AppleEvent.GetUtf8StringFromAEPtr (ref list, i); if (!string.IsNullOrEmpty (str)) items.Add (str); } return items; } public static T[] GetListFromAEDesc (ref AEDesc list, AEDescValueSelector sel, OSType type) where TRef : struct { long count = AppleEvent.AECountItems (ref list); T[] arr = new T[count]; for (int i = 1; i <= count; i++) { TRef r = AppleEvent.AEGetNthPtr (ref list, i, type); arr [i - 1] = sel (ref r); } return arr; } static void CheckReturn (AEDescStatus status) { if (status != AEDescStatus.Ok) throw new Exception ("Failed with code " + status.ToString ()); } } public delegate T AEDescValueSelector (ref TRef desc); [StructLayout(LayoutKind.Sequential, Pack = 2)] public struct AEDesc { public uint descriptorType; public IntPtr dataHandle; } public enum AEDescStatus { Ok = 0, MemoryFull = -108, CoercionFail = -1700, DescRecordNotFound = -1701, WrongDataType = -1703, NotAEDesc = -1704, ReplyNotArrived = -1718, } public enum AESendMode { NoReply = 0x00000001, QueueReply = 0x00000002, WaitReply = 0x00000003, DontReconnect = 0x00000080, WantReceipt = 0x00000200, NeverInteract = 0x00000010, CanInteract = 0x00000020, AlwaysInteract = 0x00000030, CanSwitchLayer = 0x00000040, DontRecord = 0x00001000, DontExecute = 0x00002000, ProcessNonReplyEvents = 0x00008000, } struct DescType { public OSType Value; } }smuxi-0.11/src/Frontend-GNOME/osx/ApplicationEvents.cs0000644000175000017500000002012612250426634023404 0ustar00meebeymeebey00000000000000// // ApplicationEvents.cs // // Author: // Michael Hutchinson // // Copyright (c) 2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace MonoDevelop.MacInterop { public static class ApplicationEvents { static object lockObj = new object (); #region Quit static EventHandler quit; static IntPtr quitHandlerRef = IntPtr.Zero; public static event EventHandler Quit { add { lock (lockObj) { quit += value; if (quitHandlerRef == IntPtr.Zero) quitHandlerRef = Carbon.InstallApplicationEventHandler (HandleQuit, CarbonEventApple.QuitApplication); } } remove { lock (lockObj) { quit -= value; if (quit == null && quitHandlerRef != IntPtr.Zero) { Carbon.RemoveEventHandler (quitHandlerRef); quitHandlerRef = IntPtr.Zero; } } } } static CarbonEventHandlerStatus HandleQuit (IntPtr callRef, IntPtr eventRef, IntPtr user_data) { var args = new ApplicationQuitEventArgs (); quit (null, args); return args.UserCancelled? CarbonEventHandlerStatus.UserCancelled : args.HandledStatus; } #endregion #region Reopen static EventHandler reopen; static IntPtr reopenHandlerRef = IntPtr.Zero; public static event EventHandler Reopen { add { lock (lockObj) { reopen += value; if (reopenHandlerRef == IntPtr.Zero) reopenHandlerRef = Carbon.InstallApplicationEventHandler (HandleReopen, CarbonEventApple.ReopenApplication); } } remove { lock (lockObj) { reopen -= value; if (reopen == null && reopenHandlerRef != IntPtr.Zero) { Carbon.RemoveEventHandler (reopenHandlerRef); reopenHandlerRef = IntPtr.Zero; } } } } static CarbonEventHandlerStatus HandleReopen (IntPtr callRef, IntPtr eventRef, IntPtr user_data) { var args = new ApplicationEventArgs (); reopen (null, args); return args.HandledStatus; } #endregion #region OpenDocuments static EventHandler openDocuments; static IntPtr openDocumentsHandlerRef = IntPtr.Zero; public static event EventHandler OpenDocuments { add { lock (lockObj) { openDocuments += value; if (openDocumentsHandlerRef == IntPtr.Zero) openDocumentsHandlerRef = Carbon.InstallApplicationEventHandler (HandleOpenDocuments, CarbonEventApple.OpenDocuments); } } remove { lock (lockObj) { openDocuments -= value; if (openDocuments == null && openDocumentsHandlerRef != IntPtr.Zero) { Carbon.RemoveEventHandler (openDocumentsHandlerRef); openDocumentsHandlerRef = IntPtr.Zero; } } } } static CarbonEventHandlerStatus HandleOpenDocuments (IntPtr callRef, IntPtr eventRef, IntPtr user_data) { try { var docs = Carbon.GetFileListFromEventRef (eventRef); var args = new ApplicationDocumentEventArgs (docs); openDocuments (null, args); return args.HandledStatus; } catch (Exception ex) { System.Console.WriteLine (ex); return CarbonEventHandlerStatus.NotHandled; } } #endregion #region OpenUrls static EventHandler openUrls; static IntPtr openUrlsHandlerRef = IntPtr.Zero; public static event EventHandler OpenUrls { add { lock (lockObj) { openUrls += value; if (openUrlsHandlerRef == IntPtr.Zero) openUrlsHandlerRef = Carbon.InstallApplicationEventHandler (HandleOpenUrls, new CarbonEventTypeSpec[] { //For some reason GetUrl doesn't take CarbonEventClass.AppleEvent //need to use GURL, GURL new CarbonEventTypeSpec (CarbonEventClass.Internet, (int)CarbonEventApple.GetUrl) } ); } } remove { lock (lockObj) { openUrls -= value; if (openUrls == null && openUrlsHandlerRef != IntPtr.Zero) { Carbon.RemoveEventHandler (openUrlsHandlerRef); openUrlsHandlerRef = IntPtr.Zero; } } } } static CarbonEventHandlerStatus HandleOpenUrls (IntPtr callRef, IntPtr eventRef, IntPtr user_data) { try { var urls = Carbon.GetUrlListFromEventRef (eventRef); var args = new ApplicationUrlEventArgs (urls); openUrls (null, args); return args.HandledStatus; } catch (Exception ex) { System.Console.WriteLine (ex); return CarbonEventHandlerStatus.NotHandled; } } #endregion } public class ApplicationEventArgs : EventArgs { public bool Handled { get; set; } internal CarbonEventHandlerStatus HandledStatus { get { return Handled? CarbonEventHandlerStatus.Handled : CarbonEventHandlerStatus.NotHandled; } } } public class ApplicationQuitEventArgs : ApplicationEventArgs { public bool UserCancelled { get; set; } } public class ApplicationDocumentEventArgs : ApplicationEventArgs { public ApplicationDocumentEventArgs (IDictionary documents) { this.Documents = documents; } public IDictionary Documents { get; private set; } } public class ApplicationUrlEventArgs : ApplicationEventArgs { public ApplicationUrlEventArgs (IList urls) { this.Urls = urls; } public IList Urls { get; private set; } } } smuxi-0.11/src/Frontend-GNOME/Frontend.cs0000644000175000017500000012474012311311336020717 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2014 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Web; using System.Linq; using System.Threading; using System.Reflection; using SysDiag = System.Diagnostics; using MonoDevelop.MacInterop; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend.Gnome { public class Frontend { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string _Name = "Smuxi"; private static readonly string _GladeFilename = "smuxi-frontend-gnome.glade"; private static readonly string _UIName = "GNOME"; private static int _UIThreadID; private static Version _Version; private static string _VersionString; private static Version _EngineVersion; private static SplashScreenWindow _SplashScreenWindow; private static MainWindow _MainWindow; private static FrontendConfig _FrontendConfig; private static Session _LocalSession; private static Session _Session; private static UserConfig _UserConfig; private static FrontendManager _FrontendManager; private static TaskQueue _FrontendManagerCheckerQueue; private static object _UnhandledExceptionSyncRoot = new Object(); private static bool _InCrashHandler; private static bool _InReconnectHandler; public static string IconName { get; private set; } public static bool HasSystemIconTheme { get; private set; } public static bool HadSession { get; private set; } public static bool IsGtkInitialized { get; private set; } public static bool InGtkApplicationRun { get; private set; } public static bool IsWindows { get; private set; } public static bool IsUnity { get; private set; } public static bool IsMacOSX { get; private set; } public static event EventHandler SessionPropertyChanged; public static string Name { get { return _Name; } } public static string GladeFilename { get { return _GladeFilename; } } public static string UIName { get { return _UIName; } } public static Version Version { get { return _Version; } } public static Version EngineVersion { get { return _EngineVersion; } set { _EngineVersion = value; } } public static string VersionString { get { return _VersionString; } } public static MainWindow MainWindow { get { return _MainWindow; } } public static Session Session { get { return _Session; } set { _Session = value; if (value != null) { HadSession = true; } if (SessionPropertyChanged != null) { SessionPropertyChanged(value, EventArgs.Empty); } } } public static bool IsLocalEngine { get { return _LocalSession != null && _Session == _LocalSession; } } public static FrontendManager FrontendManager { get { return _FrontendManager; } } public static Config Config { get { return _Session.Config; } } public static UserConfig UserConfig { get { return _UserConfig; } set { _UserConfig = value; } } public static FrontendConfig FrontendConfig { get { return _FrontendConfig; } } public static bool UseLowBandwidthMode { get { if (_FrontendConfig == null) { return false; } return (bool) _FrontendConfig["UseLowBandwidthMode"]; } set { _FrontendConfig["UseLowBandwidthMode"] = value; } } static Frontend() { IsWindows = Environment.OSVersion.Platform == PlatformID.Win32NT; IsMacOSX = Platform.OperatingSystem == "Darwin"; var desktop = Environment.GetEnvironmentVariable("XDG_CURRENT_DESKTOP"); if (!String.IsNullOrEmpty(desktop) && desktop.ToLower().Contains("unity")) { #if LOG4NET _Logger.Debug("Frontend(): Detected Unity desktop envrionment"); #endif IsUnity = true; } } public static void Init(string[] args) { System.Threading.Thread.CurrentThread.Name = "Main"; Assembly asm = Assembly.GetAssembly(typeof(Frontend)); AssemblyName asm_name = asm.GetName(false); AssemblyProductAttribute pr = (AssemblyProductAttribute)asm. GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]; _Version = asm_name.Version; _VersionString = pr.Product + " - " + _UIName + " frontend " + _Version; #if LOG4NET _Logger.Info(_VersionString + " starting"); #endif InitGtk(args); //_SplashScreenWindow = new SplashScreenWindow(); _FrontendConfig = new FrontendConfig(UIName); // loading and setting defaults _FrontendConfig.Load(); _FrontendConfig.Save(); _MainWindow = new MainWindow(); if (((string[]) FrontendConfig["Engines/Engines"]).Length == 0) { InitLocalEngine(); ConnectEngineToGUI(); } else { // there are remote engines defined, means we have to ask string engine = null; for (int i = 0; i < args.Length; i++) { var arg = args[i]; switch (arg) { case "-e": case "--engine": if (args.Length >= i + 1) { engine = args[i + 1]; } break; } } //_SplashScreenWindow.Destroy(); _SplashScreenWindow = null; try { ShowEngineManagerDialog(engine); } catch (ArgumentException ex) { if (ex.ParamName == "value") { Console.WriteLine(ex.Message); System.Environment.Exit(1); } throw; } } if (_SplashScreenWindow != null) { _SplashScreenWindow.Destroy(); } if (IsMacOSX) { ApplicationEvents.Quit += delegate(object sender, ApplicationQuitEventArgs e) { Quit(); e.Handled = true; }; ApplicationEvents.Reopen += delegate(object sender, ApplicationEventArgs e) { MainWindow.Deiconify(); MainWindow.Visible = true; e.Handled = true; }; ApplicationEvents.OpenUrls += delegate(object sender, ApplicationUrlEventArgs e) { e.Handled = true; if (e.Urls == null || e.Urls.Count == 0) { return; } foreach (var url in e.Urls) { try { OpenChatLink(new Uri(url)); } catch (Exception ex) { #if LOG4NET _Logger.Error("ApplicationEvents.OpenUrls() Exception", ex); #endif } } }; } InGtkApplicationRun = true; Gtk.Application.Run(); InGtkApplicationRun = false; #if LOG4NET _Logger.Warn("Gtk.Application.Run() returned!"); #endif } public static void InitLocalEngine() { if (!Engine.Engine.IsInitialized) { // only initialize a local engine once Engine.Engine.Init(); _LocalSession = new Engine.Session(Engine.Engine.Config, Engine.Engine.ProtocolManagerFactory, "local"); } _EngineVersion = Engine.Engine.Version; Session = _LocalSession; _UserConfig = _Session.UserConfig; } public static void ConnectEngineToGUI() { if (IsLocalEngine) { // HACK: SessionManager.Register() is not used for local engines _LocalSession.RegisterFrontendUI(_MainWindow.UI); } SyncConfig(); _FrontendManager = _Session.GetFrontendManager(_MainWindow.UI); _FrontendManager.Sync(); // MS .NET doesn't like this with Remoting? if (Type.GetType("Mono.Runtime") != null) { // when are running on Mono, all should be good if (_UserConfig.IsCaching) { // when our UserConfig is cached, we need to invalidate the cache // DISABLED: see FrontendManager._OnConfigChanged //_FrontendManager.ConfigChangedDelegate = SyncConfig; } } _MainWindow.ShowAll(); // make sure entry got attention :-P _MainWindow.Entry.HasFocus = true; // local sessions can't have network issues :) if (_Session != _LocalSession) { _FrontendManagerCheckerQueue = new TaskQueue("FrontendManagerCheckerQueue"); _FrontendManagerCheckerQueue.AbortedEvent += delegate { #if LOG4NET _Logger.Debug("_FrontendManagerCheckerQueue.AbortedEvent(): task queue aborted!"); #endif }; _FrontendManagerCheckerQueue.ExceptionEvent += delegate(object sender, TaskQueueExceptionEventArgs e) { #if LOG4NET _Logger.Error("Exception in TaskQueue: ", e.Exception); _Logger.Error("Inner-Exception: ", e.Exception.InnerException); #endif Frontend.ShowException(e.Exception); }; _FrontendManagerCheckerQueue.Queue(delegate { // keep looping as long as the checker returns true while (CheckFrontendManagerStatus()) { // FIXME: bail out somehow when we lost the connection // without an exception in the meantime // only check once per minute Thread.Sleep(60 * 1000); } #if LOG4NET _Logger.Debug("_FrontendManagerCheckerQueue(): " + "CheckFrontendManagerStatus() returned false, "+ "time to say good bye!"); #endif }); } MainWindow.ChatViewManager.IsSensitive = true; } public static void DisconnectEngineFromGUI() { DisconnectEngineFromGUI(true); } public static void DisconnectEngineFromGUI(bool cleanly) { Trace.Call(cleanly); MainWindow.ChatViewManager.IsSensitive = false; if (cleanly) { try { // sync tab positions if (!IsLocalEngine && !UseLowBandwidthMode) { _MainWindow.Notebook.SyncPagePositions(); } if (_FrontendManager != null) { _FrontendManager.IsFrontendDisconnecting = true; } if (_Session != null) { _Session.DeregisterFrontendUI(_MainWindow.UI); } } catch (System.Net.Sockets.SocketException) { // ignore as the connection is maybe already broken } catch (System.Runtime.Remoting.RemotingException) { // ignore as the connection is maybe already broken } } if (_FrontendManagerCheckerQueue != null) { _FrontendManagerCheckerQueue.Dispose(); } _MainWindow.ChatViewManager.Clear(); _MainWindow.UpdateProgressBar(); // make sure no stray SSH tunnel leaves behind _MainWindow.EngineManager.Disconnect(); _MainWindow.NetworkStatus = null; _MainWindow.Status = _("Disconnected from engine."); _FrontendManager = null; Session = null; } public static void ReconnectEngineToGUI() { ReconnectEngineToGUI(true); } public static void ReconnectEngineToGUI(bool cleanly) { Trace.Call(cleanly); if (_InReconnectHandler) { #if LOG4NET _Logger.Debug("ReconnectEngineToGUI(): already in reconnect " + "handler, ignoring reconnect..."); #endif return; } _InReconnectHandler = true; var disconnectedEvent = new AutoResetEvent(false); ThreadPool.QueueUserWorkItem(delegate { try { // delay the disconnect to give the reconnect some extra // time as NetworkManager is not accurate about when the // network is really ready GLib.Timeout.Add(5 * 1000, delegate { Frontend.DisconnectEngineFromGUI(cleanly); disconnectedEvent.Set(); return false; }); var successful = false; var attempt = 1; while (!successful) { Gtk.Application.Invoke(delegate { MainWindow.NetworkStatus = null; MainWindow.Status = String.Format( _("Reconnecting to engine... (attempt {0})"), attempt++ ); }); try { disconnectedEvent.WaitOne(); _MainWindow.EngineManager.Reconnect(); successful = true; } catch (Exception ex) { #if LOG4NET _Logger.Debug("ReconnectEngineToGUI(): Exception", ex); #endif disconnectedEvent.Set(); Thread.Sleep(30 * 1000); } } _UserConfig = _MainWindow.EngineManager.UserConfig; EngineVersion = _MainWindow.EngineManager.EngineVersion; Session = _MainWindow.EngineManager.Session; Gtk.Application.Invoke(delegate { Frontend.ConnectEngineToGUI(); }); } catch (Exception ex) { Frontend.ShowException(ex); } finally { _InReconnectHandler = false; } }); } public static void Quit() { Trace.Call(); // only save windows size when we are not in the engine manager dialog if (_MainWindow.Visible) { // save window size int width, heigth; if (_MainWindow.IsMaximized) { width = -1; heigth = -1; } else { _MainWindow.GetSize(out width, out heigth); } _FrontendConfig[Frontend.UIName + "/Interface/Width"] = width; _FrontendConfig[Frontend.UIName + "/Interface/Heigth"] = heigth; int x, y; _MainWindow.GetPosition(out x, out y); _FrontendConfig[Frontend.UIName + "/Interface/XPosition"] = x; _FrontendConfig[Frontend.UIName + "/Interface/YPosition"] = y; _FrontendConfig.Save(); } if (_FrontendManager != null) { if (IsLocalEngine) { try { // shutdown session (flush message buffers) Session.Shutdown(); } catch (Exception ex) { #if LOG4NET _Logger.Error("Quit(): Exception", ex); #endif } } DisconnectEngineFromGUI(); } #if LOG4NET // HACK: workaround log4net deadlock issue. Not sure if it has any // effect though, see: https://www.smuxi.org/issues/show/876 log4net.Core.LoggerManager.Shutdown(); #endif Gtk.Application.Quit(); Environment.Exit(0); } public static bool IsGuiThread() { return System.Threading.Thread.CurrentThread.ManagedThreadId == _UIThreadID; } public static void ShowError(Gtk.Window parent, string msg, Exception ex) { Trace.Call(parent, msg, ex != null ? ex.GetType() : null); if (!IsGuiThread()) { Gtk.Application.Invoke(delegate { ShowError(parent, msg, ex); }); return; } if (ex != null) { #if LOG4NET _Logger.Error("ShowError(): Exception: ", ex); #endif msg += "\n" + String.Format(_("Cause: {0}"), ex.Message); } if (parent == null) { parent = _MainWindow; } Gtk.MessageDialog md = new Gtk.MessageDialog( parent, Gtk.DialogFlags.Modal, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, false, msg ); md.Run(); md.Destroy(); } public static void ShowError(Gtk.Window parent, string msg) { Trace.Call(parent, msg); ShowError(parent, msg, null); } public static void ShowError(Gtk.Window parent, Exception ex) { Trace.Call(parent, ex != null ? ex.GetType() : null); if (ex == null) { throw new ArgumentNullException("ex"); } #if LOG4NET _Logger.Error("ShowError(): Exception:", ex); #endif ShowError(parent, ex.Message, null); } public static void ShowException(Gtk.Window parent, Exception ex) { Trace.Call(parent, ex != null ? ex.GetType() : null); if (parent == null) { parent = _MainWindow; } if (!IsGuiThread()) { Gtk.Application.Invoke(delegate { ShowException(parent, ex); }); return; } if (ex is NotImplementedException) { // don't quit on NotImplementedException ShowError(parent, ex); return; } #if LOG4NET _Logger.Error("ShowException(): Exception:", ex); #endif // HACK: ugly MS .NET throws underlaying SocketException instead of // wrapping those into a nice RemotingException, see: // http://projects.qnetp.net/issues/show/232 if (ex is System.Runtime.Remoting.RemotingException || ex is System.Net.Sockets.SocketException) { if (_InReconnectHandler || _InCrashHandler) { // one reconnect is good enough and a crash we won't survive return; } Frontend.ReconnectEngineToGUI(); return; } if (_InCrashHandler) { // only show not more than one crash dialog, else the user // will not be able to copy/paste the stack trace and stuff return; } _InCrashHandler = true; CrashDialog cd = new CrashDialog(parent, ex); cd.Run(); cd.Destroy(); if (SysDiag.Debugger.IsAttached) { // allow the debugger to examine the situation //SysDiag.Debugger.Break(); // HACK: Break() would be nicer but crashes the runtime throw ex; } Quit(); } public static void ShowException(Exception ex) { Trace.Call(ex != null ? ex.GetType() : null); ShowException(null, ex); } public static void ShowEngineManagerDialog(string engine) { Trace.Call(engine); var diag = new EngineManagerDialog(_MainWindow, _MainWindow.EngineManager); if (!String.IsNullOrEmpty(engine)) { diag.SelectedEngine = engine; // 1 == connect button diag.Respond(1); } else { diag.Run(); } diag.Destroy(); } public static void ShowEngineManagerDialog() { ShowEngineManagerDialog(null); } public static bool ShowReconnectDialog(Gtk.Window parent) { Trace.Call(parent); Gtk.MessageDialog md = new Gtk.MessageDialog(parent, Gtk.DialogFlags.Modal, Gtk.MessageType.Error, Gtk.ButtonsType.OkCancel, _("The frontend has lost the connection to the server.\nDo you want to reconnect now?")); Gtk.ResponseType res = (Gtk.ResponseType) md.Run(); md.Destroy(); if (res != Gtk.ResponseType.Ok) { Quit(); return false; } while (true) { try { Frontend.ReconnectEngineToGUI(); // yay, we made it _InReconnectHandler = false; break; } catch (Exception e) { #if LOG4NET _Logger.Error("ShowReconnectDialog(): Reconnect failed, exception:", e); #endif var msg = _("Reconnecting to the server has failed.\nDo you want to try again?"); // the parent window is hidden (MainWindow) at this // point thus modal doesn't make sense here md = new Gtk.MessageDialog(parent, Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Error, Gtk.ButtonsType.OkCancel, msg); md.SetPosition(Gtk.WindowPosition.CenterAlways); res = (Gtk.ResponseType) md.Run(); md.Destroy(); if (res != Gtk.ResponseType.Ok) { // give up Quit(); return false; } } } return true; } public static void ApplyConfig(UserConfig userConfig) { Trace.Call(userConfig); if (userConfig == null) { throw new ArgumentNullException("userConfig"); } _MainWindow.ApplyConfig(userConfig); } public static Gdk.Pixbuf LoadIcon(string iconName, int size, string resourceName) { Trace.Call(iconName, size, resourceName); if (iconName == null) { throw new ArgumentNullException("iconName"); } if (resourceName == null) { throw new ArgumentNullException("resourceName"); } try { // we use this method from type initializers so it has to deal // with GDK/GTK thread locking Gdk.Threads.Enter(); var theme = Gtk.IconTheme.Default; if (!theme.HasIcon(iconName) || !theme.GetIconSizes(iconName).Contains(size)) { Gtk.IconTheme.AddBuiltinIcon( iconName, size, new Gdk.Pixbuf(null, resourceName, size, size) ); #if LOG4NET _Logger.DebugFormat( "LoadIcon(): Added '{0}' to built-in icon theme", resourceName ); #endif } return theme.LoadIcon(iconName, size, Gtk.IconLookupFlags.UseBuiltin); } finally { Gdk.Threads.Leave(); } } public static void OpenChatLink(Uri link) { TryOpenChatLink(link); } public static bool TryOpenChatLink(Uri link) { Trace.Call(link); if (Session == null) { return false; } // supported: // smuxi://freenode/#smuxi // smuxi://freenode/#%23csharp (##csharp) // irc://#smuxi // irc://irc.oftc.net/ // irc://irc.oftc.net/#smuxi // irc://irc.oftc.net:6667/#smuxi // not supported (yet): // smuxi:///meebey IProtocolManager manager = null; var linkPort = link.Port; if (linkPort == -1) { switch (link.Scheme) { case "irc": linkPort = 6667; break; case "ircs": linkPort = 6697; break; } } // decode #%23csharp to ##csharp var linkChat = HttpUtility.UrlDecode(link.Fragment); if (String.IsNullOrEmpty(linkChat) && link.AbsolutePath.Length > 0) { linkChat = link.AbsolutePath.Substring(1); } var linkProtocol = link.Scheme; var linkHost = link.Host; string linkNetwork = null; if (!linkHost.Contains(".")) { // this seems to be a network name linkNetwork = linkHost; } // find existing protocol chat foreach (var chatView in MainWindow.ChatViewManager.Chats) { if (!(chatView is ProtocolChatView)) { continue; } var protocolChat = (ProtocolChatView) chatView; var host = protocolChat.Host; var port = protocolChat.Port; var network = protocolChat.NetworkID; // Check first by network name with fallback to host+port. // The network name has to be checked against the NetworkID and // also ChatModel.ID as the user might have entered a different // network name in settings than the server does if (!String.IsNullOrEmpty(network) && (String.Compare(network, linkNetwork, true) == 0 || String.Compare(chatView.ID, linkNetwork, true) == 0)) { manager = protocolChat.ProtocolManager; break; } if (String.Compare(host, linkHost, true) == 0 && port == linkPort) { manager = protocolChat.ProtocolManager; break; } } if (manager == null) { // only irc may autoconnect to a server switch (linkProtocol) { case "irc": case "ircs": case "smuxi": break; default: return false; } ServerModel server = null; if (!String.IsNullOrEmpty(linkNetwork)) { // try to find a server with this network name and connect to it var serverSettings = new ServerListController(UserConfig); server = serverSettings.GetServerByNetwork(linkNetwork); if (server == null) { // in case someone tried an unknown network return false; } // ignore OnConnectCommands server.OnConnectCommands = null; } else if (!String.IsNullOrEmpty(linkHost)) { server = new ServerModel() { Protocol = linkProtocol, Hostname = linkHost, Port = linkPort }; } if (server != null) { manager = Session.Connect(server, FrontendManager); } } if (String.IsNullOrEmpty(linkChat)) { return true; } // switch to existing chat foreach (var chatView in MainWindow.ChatViewManager.Chats) { if (manager != null && chatView.ProtocolManager != manager) { continue; } if (String.Compare(chatView.ID, linkChat, true) == 0) { MainWindow.ChatViewManager.CurrentChatView = chatView; return true; } } // join chat if (manager != null) { var chat = new GroupChatModel(linkChat, linkChat, null); ThreadPool.QueueUserWorkItem(delegate { try { manager.OpenChat(FrontendManager, chat); } catch (Exception ex) { Frontend.ShowException(ex); } }); } return true; } public static void OpenLink(Uri link) { Trace.Call(link); if (link == null) { throw new ArgumentNullException("link"); } if (TryOpenChatLink(link)) { return; } // hopefully MS .NET / Mono finds some way to handle the URL ThreadPool.QueueUserWorkItem(delegate { try { var url = link.ToString(); using (var process = SysDiag.Process.Start(url)) { // Start() might return null in case it re-used a // process instead of starting one if (process != null) { process.WaitForExit(); } } } catch (Exception ex) { // exceptions in the thread pool would kill the process, see: // http://msdn.microsoft.com/en-us/library/0ka9477y.aspx // http://projects.qnetp.net/issues/show/194 #if LOG4NET _Logger.Error("OpenLink(): opening URL: '" + link + "' failed", ex); #endif } }); } public static void OpenFindGroupChatWindow() { OpenFindGroupChatWindow(null); } public static void OpenFindGroupChatWindow(string searchKey) { var chatView = MainWindow.ChatViewManager.CurrentChatView; if (chatView == null) { return; } var manager = chatView.ProtocolManager; if (manager == null) { return; } var dialog = new FindGroupChatDialog( MainWindow, manager ); if (!String.IsNullOrEmpty(searchKey)) { dialog.NameEntry.Text = searchKey; dialog.FindButton.Click(); } var res = dialog.Run(); var groupChat = dialog.GroupChat; dialog.Destroy(); if (res != (int) Gtk.ResponseType.Ok) { return; } ThreadPool.QueueUserWorkItem(delegate { try { manager.OpenChat(Frontend.FrontendManager, groupChat); } catch (Exception ex) { Frontend.ShowException(null, ex); } }); } #if GTK_SHARP_2_10 private static void _OnUnhandledException(GLib.UnhandledExceptionArgs e) { Trace.CallFull(e); lock (_UnhandledExceptionSyncRoot) { if (e.ExceptionObject is Exception) { ShowException((Exception) e.ExceptionObject); } } } #endif private static bool CheckFrontendManagerStatus() { Trace.Call(); if (_FrontendManager == null) { // we lost the frontend manager, nothing to check return false; } if (_FrontendManager.IsAlive) { // everything is fine return true; } #if LOG4NET _Logger.Error("CheckFrontendManagerStatus(): frontend manager is not alive anymore!"); #endif Gtk.Application.Invoke(delegate { Gtk.MessageDialog md = new Gtk.MessageDialog(_MainWindow, Gtk.DialogFlags.Modal, Gtk.MessageType.Error, Gtk.ButtonsType.OkCancel, _("The server has lost the connection to the frontend.\nDo you want to reconnect now?")); Gtk.ResponseType res = (Gtk.ResponseType) md.Run(); md.Destroy(); if (res != Gtk.ResponseType.Ok) { // the frontend is unusable in this state -> say good bye Frontend.Quit(); return; } Frontend.ReconnectEngineToGUI(); }); return false; } private static void InitGtk(string[] args) { if (Environment.OSVersion.Platform == PlatformID.Win32NT) { InitGtkPathWin(); } #if GTK_SHARP_2_8 || GTK_SHARP_2_10 if (!GLib.Thread.Supported) { GLib.Thread.Init(); } #else // with GTK# 2.8 we can do this better, see above // GTK# 2.7.1 for MS .NET doesn't support that though. if (Type.GetType("Mono.Runtime") == null) { // when we don't run on Mono, we need to initialize glib ourself GLib.Thread.Init(); } #endif _UIThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId; string appDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); string localeDir = Path.Combine(appDir, "locale"); if (!Directory.Exists(localeDir)) { localeDir = Path.Combine(Defines.InstallPrefix, "share"); localeDir = Path.Combine(localeDir, "locale"); } LibraryCatalog.Init("smuxi-frontend-gnome", localeDir); #if LOG4NET _Logger.Debug("InitGtk(): Using locale data from: " + localeDir); #endif Gtk.Application.Init(Name, ref args); IsGtkInitialized = true; #if GTK_SHARP_2_10 GLib.ExceptionManager.UnhandledException += _OnUnhandledException; #endif IconName = "smuxi-frontend-gnome"; var iconPath = Path.Combine(Defines.InstallPrefix, "share"); iconPath = Path.Combine(iconPath, "icons"); var theme = Gtk.IconTheme.Default; var settings = Gtk.Settings.Default; var iconInfo = theme.LookupIcon(IconName, -1, 0); HasSystemIconTheme = iconInfo != null && iconInfo.Filename != null && iconInfo.Filename.StartsWith(iconPath); #if LOG4NET _Logger.DebugFormat("InitGtk(): Using {0} icon theme", HasSystemIconTheme ? "system" : "built-in"); #endif var unityWithLightIcons = false; if (Frontend.IsUnity) { var sysGtkTheme = settings.ThemeName ?? String.Empty; var sysIconTheme = GetGtkIconThemeName() ?? String.Empty; #if LOG4NET _Logger.DebugFormat("InitGtk(): Detected GTK+ theme: {0} " + "icon theme: {1}", sysGtkTheme, sysIconTheme); #endif if (sysGtkTheme.StartsWith("Ambiance") && sysIconTheme != "ubuntu-mono-dark") { #if LOG4NET _Logger.Debug("InitGtk(): Detected Ambiance theme with "+ "light icons"); #endif unityWithLightIcons = true; } } var appIconDir = Path.Combine(appDir, "icons"); if (Directory.Exists(appIconDir)) { var iconTheme = "Smuxi-Symbolic"; #if LOG4NET _Logger.InfoFormat("InitGtk(): Setting icon theme to: {0}", iconTheme); #endif var origin = Assembly.GetExecutingAssembly().FullName; settings.SetStringProperty( "gtk-icon-theme-name", iconTheme, origin ); settings.SetLongProperty( "gtk-menu-images", 0, origin ); settings.SetLongProperty( "gtk-button-images", 0, origin ); #if LOG4NET _Logger.InfoFormat("InitGtk(): Prepending {0} to icon search path", appIconDir); #endif theme.PrependSearchPath(appIconDir); } if (HasSystemIconTheme) { Gtk.Window.DefaultIconName = "smuxi-frontend-gnome"; } else { Gtk.Window.DefaultIcon = Frontend.LoadIcon( "smuxi-frontend-gnome", 256, "icon_256x256.png" ); } } private static void InitGtkPathWin() { // HACK: Force GTK# to use the right GTK+ install as the PATH // environment variable might contain other GTK+ installs // GTK# 2.12.20 var installPath = (string) Microsoft.Win32.Registry.GetValue( "HKEY_LOCAL_MACHINE\\SOFTWARE\\Xamarin\\GtkSharp\\InstallFolder", "", null ); if (installPath == null) { // GTK# 2.12.10 installPath = (string) Microsoft.Win32.Registry.GetValue( "HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\GtkSharp\\InstallFolder", "", null ); } if (installPath == null) { #if LOG4NET _Logger.Error("InitGtkPathWin(): couldn't obtain GTK# installation folder from registry. GTK# is probably incorrectly installed!"); #endif return; } var binPath = Path.Combine(installPath, "bin"); var currentPath = Environment.GetEnvironmentVariable("PATH"); var newPath = String.Format("{0}{1}{2}", binPath, Path.PathSeparator, currentPath); #if LOG4NET _Logger.Debug("InitGtkPathWin(): current PATH: " + currentPath); _Logger.Debug("InitGtkPathWin(): new PATH: " + newPath); #endif Environment.SetEnvironmentVariable("PATH", newPath); } static void SyncConfig() { Trace.Call(); if (EngineVersion >= new Version("0.8.1.1")) { var config = UserConfig; ThreadPool.QueueUserWorkItem(delegate { try { config.SyncCache(); } catch (Exception ex) { #if LOG4NET _Logger.Error("SyncConfig(): " + "Exception during config sync", ex); #endif } finally { Gtk.Application.Invoke(delegate { ApplyConfig(config); }); } }); } else { if (!IsGuiThread()) { Gtk.Application.Invoke(delegate { SyncConfig(); }); return; } ApplyConfig(UserConfig); } } static string GetGtkIconThemeName() { // HACK: Gtk.IconTheme is not exposing gtk-icon-theme-name var method = typeof(Gtk.Settings).GetMethod( "GetProperty", BindingFlags.Instance | BindingFlags.NonPublic ); if (method == null) { #if LOG4NET _Logger.Warn("GetGtkIconThemeName(): method is null!"); #endif return String.Empty; } var value = (string)(GLib.Value) method.Invoke( Gtk.Settings.Default, new object[] {"gtk-icon-theme-name"} ); return value; } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/QuickConnectDialog.cs0000644000175000017500000001717312253423337022661 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008, 2010 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public partial class QuickConnectDialog : Gtk.Dialog { private ServerListController f_Controller; private Gtk.TreeStore f_TreeStore; private ServerModel f_ServerModel; public ServerModel Server { get { return f_ServerModel; } } public QuickConnectDialog(Gtk.Window parent) : base(null, parent, Gtk.DialogFlags.DestroyWithParent) { Trace.Call(parent); if (parent == null) { throw new ArgumentNullException("parent"); } Build(); TransientFor = parent; f_Controller = new ServerListController(Frontend.UserConfig); f_TreeView.AppendColumn(_("Protocol"), new Gtk.CellRendererText(), "text", 1); f_TreeView.AppendColumn(_("Hostname"), new Gtk.CellRendererText(), "text", 2); f_TreeStore = new Gtk.TreeStore( typeof(ServerModel), typeof(string), // protocol typeof(string) // hostname ); f_TreeView.RowActivated += OnTreeViewRowActivated; f_TreeView.Selection.Changed += OnTreeViewSelectionChanged; f_TreeView.Model = f_TreeStore; f_Widget.InitProtocols(Frontend.Session.GetSupportedProtocols()); // these fields doesn't make sense here f_Widget.OnStartupConnectCheckButton.Visible = false; f_Widget.NetworkComboBoxEntry.Sensitive = false; f_Widget.ProtocolComboBox.Changed += delegate { CheckConnectButton(); }; f_Widget.HostnameEntry.Changed += delegate { CheckConnectButton(); }; } public virtual void Load() { Trace.Call(); LoadServers(); CheckConnectButton(); } protected void LoadServers() { Trace.Call(); f_TreeStore.Clear(); // group servers by protocol Dictionary> protocols = new Dictionary>(); IList servers = f_Controller.GetServerList(); foreach (ServerModel server in servers) { List protocolServers = null; protocols.TryGetValue(server.Protocol, out protocolServers); if (protocolServers == null) { protocolServers = new List(); protocols.Add(server.Protocol, protocolServers); } protocolServers.Add(server); } // add grouped servers to treeview foreach (KeyValuePair> pair in protocols) { Gtk.TreeIter parentIter = f_TreeStore.AppendValues(null, pair.Key, String.Empty); foreach (ServerModel server in pair.Value) { // a server with an empty hostname has only one default/hardcoded // hostname, thus don't create a sub-node for it if (String.IsNullOrEmpty(server.Hostname)) { f_TreeStore.SetValue(parentIter, 0, server); continue; } f_TreeStore.AppendValues(parentIter, server, String.Empty, server.Hostname); } } f_TreeView.ExpandAll(); } protected virtual ServerModel GetCurrentServer() { Trace.Call(); Gtk.TreeIter iter; if (!f_TreeView.Selection.GetSelected(out iter)) { return null; } return (ServerModel) f_TreeStore.GetValue(iter, 0); } #region Event Handlers protected virtual void OnTreeViewSelectionChanged(object sender, EventArgs e) { Trace.Call(sender, e); try { ServerModel server = GetCurrentServer(); if (server == null) { return; } f_Widget.Load(server); // we are not editing server entries here instead we use // whatever values are entered f_Widget.ProtocolComboBox.Sensitive = true; // this field doesn't make sense here f_Widget.NetworkComboBoxEntry.Sensitive = false; // only enable the hostname field if there it's not empty, as // some protocols don't allow custom hosts, e.g. twitter if (!String.IsNullOrEmpty(f_Widget.HostnameEntry.Text)) { f_Widget.HostnameEntry.Sensitive = true; } } catch (ApplicationException ex) { Frontend.ShowError(this, _("Unable to load server: "), ex); } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual void OnTreeViewRowActivated(object sender, Gtk.RowActivatedArgs e) { Trace.Call(sender, e); try { ServerModel server = GetCurrentServer(); if (server == null) { return; } f_ServerModel = server; Respond(Gtk.ResponseType.Ok); } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual void OnConnectButtonClicked(object sender, EventArgs e) { Trace.Call(sender, e); try { f_ServerModel = f_Widget.GetServer(); } catch (Exception ex) { Frontend.ShowException(ex); } } #endregion private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } protected virtual void CheckConnectButton() { Trace.Call(); f_ConnectButton.Sensitive = !f_Widget.HostnameEntry.Visible || f_Widget.HostnameEntry.Text.Trim().Length > 0; if (f_ConnectButton.Sensitive && f_Widget.ProtocolComboBox.ActiveText == "Campfire" && f_Widget.HostnameEntry.Text == ".campfirenow.com") { f_ConnectButton.Sensitive = false; } } } } smuxi-0.11/src/Frontend-GNOME/Views/0000755000175000017500000000000012311344241017677 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-GNOME/Views/MenuWidget.cs0000644000175000017500000004550512300201464022304 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2012-2014 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Threading; using SysDiag = System.Diagnostics; using IgeMacIntegration; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { [System.ComponentModel.ToolboxItem(true)] public partial class MenuWidget : Gtk.Bin { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif new Gtk.Window Parent { get; set; } MainWindow MainWindow { get; set; } public JoinWidget JoinWidget { get; private set; } ChatViewManager ChatViewManager { get; set; } public bool CaretMode { get { return f_CaretModeAction.Active; } } public Gtk.MenuBar MenuBar { get { return f_MenuBar; } } public Gtk.ToggleAction ShowMenubarAction { get { return f_ShowMenubarAction; } } public Gtk.Action OpenLogAction { get { return f_OpenLogAction; } } public Gtk.Action OpenLogToolAction { get { return f_OpenLogToolAction; } } public Gtk.Action CloseChatAction { get { return f_CloseChatAction; } } public Gtk.Action FindGroupChatAction { get { return f_FindGroupChatAction; } } public MenuWidget(Gtk.Window parent, ChatViewManager chatViewManager) { if (parent == null) { throw new ArgumentNullException("parent"); } if (chatViewManager == null) { throw new ArgumentNullException("chatViewManager"); } Parent = parent; MainWindow = parent as MainWindow; ChatViewManager = chatViewManager; Build(); // Smuxi Menu f_QuitAction.IconName = Gtk.Stock.Quit; // Chat f_JoinChatAction.IconName = Gtk.Stock.Open; f_FindGroupChatAction.IconName = Gtk.Stock.Find; f_OpenLogAction.IconName = Gtk.Stock.Open; f_CloseChatAction.IconName = Gtk.Stock.Close; // Engine f_AddRemoteEngineAction.IconName = Gtk.Stock.Add; f_SwitchRemoteEngineAction.IconName = Gtk.Stock.Refresh; // Toolbar f_ConnectToolAction.IconName = Gtk.Stock.Network; f_OpenLogToolAction.IconName = Gtk.Stock.Open; f_FindGroupChatToolAction.IconName = Gtk.Stock.Find; f_MenuToolbar.ShowAll(); f_MenuToolbar.NoShowAll = true; f_MenuToolbar.Visible = (bool) Frontend.FrontendConfig["ShowToolBar"]; f_MenuBar.ShowAll(); f_MenuBar.NoShowAll = true; f_MenuBar.Visible = (bool) Frontend.FrontendConfig["ShowMenuBar"]; JoinWidget = new JoinWidget(); JoinWidget.NoShowAll = true; JoinWidget.Activated += OnJoinWidgetActivated; var joinToolItem = new Gtk.ToolItem(); joinToolItem.Add(JoinWidget); f_JoinToolbar.Add(joinToolItem); f_JoinToolbar.ShowAll(); f_JoinToolbar.NoShowAll = true; f_JoinToolbar.Visible = f_MenuToolbar.Visible; f_ShowMenubarAction.Active = (bool) Frontend.FrontendConfig["ShowMenuBar"]; f_ShowToolbarAction.Active = (bool) Frontend.FrontendConfig["ShowToolBar"]; f_ShowStatusbarAction.Active = (bool) Frontend.FrontendConfig["ShowStatusBar"]; if (Frontend.IsMacOSX) { // Smuxi menu is already shown as app menu f_SmuxiAction.Visible = false; // About item is already shown in app menu f_AboutAction.Visible = false; IgeMacMenu.GlobalKeyHandlerEnabled = true; IgeMacMenu.MenuBar = f_MenuBar; f_ShowMenubarAction.Active = false; // no need for the menu bar as have the app menu f_ShowMenubarAction.Visible = false; var appGroup = IgeMacMenu.AddAppMenuGroup(); appGroup.AddMenuItem( (Gtk.MenuItem) f_AboutAction.CreateMenuItem(), _("About Smuxi") ); var prefItem = (Gtk.MenuItem) f_PreferencesAction.CreateMenuItem(); // TODO: add cmd+, accelerator appGroup.AddMenuItem(prefItem, _("Preferences")); IgeMacMenu.QuitMenuItem = (Gtk.MenuItem) f_QuitAction.CreateMenuItem(); } } protected void OnAboutActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { var dialog = new AboutDialog(Parent); dialog.Run(); dialog.Destroy(); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnPreferencesActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { var dialog = new PreferencesDialog(Parent); dialog.Show(); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnQuitActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { Frontend.Quit(); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnConnectActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { var dialog = new QuickConnectDialog(Parent); dialog.Load(); int res = dialog.Run(); var server = dialog.Server; dialog.Destroy(); if (res != (int) Gtk.ResponseType.Ok) { return; } if (server == null) { #if LOG4NET f_Logger.Error("OnServerConnectButtonClicked(): server is null!"); return; #endif } // do connect as background task as it might take a while ThreadPool.QueueUserWorkItem(delegate { try { if (Frontend.EngineVersion < new Version(0, 8, 11)) { // HACK: Smuxi < 0.8.11 used auto serialization for // ServerModel and thus breaks on unknown fields, // which we skip by setting this to null, see: // ServerModel.GetObjectData() server.ServerID = null; server.Nickname = null; server.Realname = null; } Frontend.Session.Connect(server, Frontend.FrontendManager); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } }); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnAddServerActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); ServerDialog dialog = null; try { var controller = new ServerListController(Frontend.UserConfig); dialog = new ServerDialog(Parent, null, Frontend.Session.GetSupportedProtocols(), controller.GetNetworks()); int res = dialog.Run(); ServerModel server = dialog.GetServer(); if (res != (int) Gtk.ResponseType.Ok) { return; } controller.AddServer(server); controller.Save(); } catch (InvalidOperationException ex) { Frontend.ShowError(Parent, _("Unable to add server: "), ex); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } finally { if (dialog != null) { dialog.Destroy(); } } } protected void OnManageServerActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { var dialog = new PreferencesDialog(Parent); dialog.CurrentPage = PreferencesDialog.Page.Servers; } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnJoinChatActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { if (!f_ShowToolbarAction.Active) { f_ShowToolbarAction.Activate(); } JoinWidget.HasFocus = true; } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnFindGroupChatActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { Frontend.OpenFindGroupChatWindow(); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnClearAllActivityActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { ChatViewManager.ClearAllActivity(); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnNextChatActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { ChatViewManager.CurrentChatNumber++; } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnPreviousChatActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { ChatViewManager.CurrentChatNumber--; } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnOpenLogActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { ThreadPool.QueueUserWorkItem(delegate { try { SysDiag.Process.Start( ChatViewManager.CurrentChatView.ChatModel.LogFile ); } catch (Exception ex) { Frontend.ShowError(Parent, ex); } }); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnCloseChatActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { ChatViewManager.CurrentChatView.Close(); if (Frontend.IsMacOSX && ChatViewManager.Chats.Count == 1) { ChatViewManager.Minimize(); } } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnUseLocalEngineActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { var dialog = new Gtk.MessageDialog( Parent, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.YesNo, _("Switching to local engine will disconnect you from the current engine!\n"+ "Are you sure you want to do this?") ); int result = dialog.Run(); dialog.Destroy(); if ((Gtk.ResponseType)result == Gtk.ResponseType.Yes) { Frontend.DisconnectEngineFromGUI(); Frontend.InitLocalEngine(); Frontend.ConnectEngineToGUI(); } } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnAddRemoteEngineActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { var assistant = new EngineAssistant( Parent, Frontend.FrontendConfig ); assistant.Cancel += delegate { assistant.Destroy(); }; assistant.Close += delegate { assistant.Destroy(); }; assistant.ShowAll(); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnSwitchRemoteEngineActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { var dialog = new Gtk.MessageDialog( Parent, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.YesNo, _("Switching the remote engine will disconnect you from the current engine!\n"+ "Are you sure you want to do this?") ); int result = dialog.Run(); dialog.Destroy(); if ((Gtk.ResponseType)result == Gtk.ResponseType.Yes) { Frontend.DisconnectEngineFromGUI(); Frontend.ShowEngineManagerDialog(); } } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnCaretModeActionToggled(object sender, EventArgs e) { Trace.Call(sender, e); try { var caretMode = f_CaretModeAction.Active; foreach (var chatView in ChatViewManager.Chats) { chatView.OutputMessageTextView.CursorVisible = caretMode; } if (caretMode) { ChatViewManager.CurrentChatView.OutputMessageTextView.HasFocus = true; } else { MainWindow.Entry.HasFocus = true; } } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnBrowseModeActionToggled(object sender, EventArgs e) { Trace.Call(sender, e); try { var browseMode = f_BrowseModeAction.Active; MainWindow.Notebook.IsBrowseModeEnabled = browseMode; if (browseMode) { MainWindow.ChatTreeView.HasFocus = true; } else { MainWindow.Entry.HasFocus = true; } } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnShowMenubarActionToggled(object sender, EventArgs e) { Trace.Call(sender, e); try { var active = f_ShowMenubarAction.Active; f_MenuBar.Visible = active; Frontend.FrontendConfig["ShowMenuBar"] = active; Frontend.FrontendConfig.Save(); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnShowToolbarActionToggled(object sender, EventArgs e) { Trace.Call(sender, e); try { var active = f_ShowToolbarAction.Active; f_MenuToolbar.Visible = active; // also hide/show join bar f_JoinToolbar.Visible = active; Frontend.FrontendConfig["ShowToolBar"] = active; Frontend.FrontendConfig.Save(); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnShowStatusbarActionToggled(object sender, EventArgs e) { Trace.Call(sender, e); try { var active = f_ShowStatusbarAction.Active; MainWindow.ShowStatusbar = active; Frontend.FrontendConfig["ShowStatusBar"] = active; Frontend.FrontendConfig.Save(); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected virtual void OnJoinWidgetActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { var chatLink = JoinWidget.GetChatLink(); Frontend.OpenChatLink(chatLink); JoinWidget.Clear(); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnFullscreenActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { MainWindow.IsFullscreen = !MainWindow.IsFullscreen; } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } protected void OnWebsiteActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { Frontend.OpenLink(new Uri("http://www.smuxi.org/")); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/Views/ServerDialog.cs0000644000175000017500000000555612253423337022640 0ustar00meebeymeebey00000000000000// $Id$ // // Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public partial class ServerDialog : Gtk.Dialog { public ServerDialog(Gtk.Window parent, ServerModel server, IList supportedProtocols, IList networks) : base(null, parent, Gtk.DialogFlags.DestroyWithParent) { Trace.Call(parent, server, supportedProtocols, networks); if (parent == null) { throw new ArgumentNullException("parent"); } if (supportedProtocols == null) { throw new ArgumentNullException("supportedProtocols"); } if (networks == null) { throw new ArgumentNullException("networks"); } Build(); TransientFor = parent; f_Widget.InitProtocols(supportedProtocols); f_Widget.InitNetworks(networks); f_Widget.ProtocolComboBox.Changed += delegate { CheckOkButton(); }; f_Widget.HostnameEntry.Changed += delegate { CheckOkButton(); }; CheckOkButton(); if (server != null) { try { f_Widget.Load(server); } catch (Exception) { Destroy(); throw; } } } protected virtual void CheckOkButton() { Trace.Call(); f_OkButton.Sensitive = true; switch (f_Widget.ProtocolComboBox.ActiveText) { case "Campfire": if (f_Widget.HostnameEntry.Text == ".campfirenow.com") { f_OkButton.Sensitive = false; } break; } } public ServerModel GetServer() { return f_Widget.GetServer(); } } } smuxi-0.11/src/Frontend-GNOME/Views/Tags/0000755000175000017500000000000012311344241020575 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-GNOME/Views/Tags/PersonTag.cs0000644000175000017500000000262512250426634023044 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2012 // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Frontend.Gnome { public class PersonTag : Gtk.TextTag { public string ID { get; private set; } public string IdentityName { get; private set; } public PersonTag(string id, string identityName) : base(null) { if (id == null) { throw new ArgumentNullException("id"); } if (identityName == null) { throw new ArgumentNullException("identityName"); } ID = id; IdentityName = identityName; } } } smuxi-0.11/src/Frontend-GNOME/Views/Tags/LinkTag.cs0000644000175000017500000000227012250426634022467 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Frontend.Gnome { public class LinkTag : Gtk.TextTag { public Uri Link { get; set; } public LinkTag(Uri link) : base(null) { if (link == null) { throw new ArgumentNullException("link"); } Link = link; } } } smuxi-0.11/src/Frontend-GNOME/Views/Chats/0000755000175000017500000000000012311344241020741 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-GNOME/Views/Chats/PersonChatView.cs0000644000175000017500000000630512257043746024214 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using Smuxi.Engine; using Smuxi.Common; using System.Threading; namespace Smuxi.Frontend.Gnome { [ChatViewInfo(ChatType = ChatType.Person)] public class PersonChatView : ChatView { public static Gdk.Pixbuf IconPixbuf { get; private set; } public PersonChatModel PersonChatModel { get; private set; } public PersonModel PersonModel { get; private set; } protected override Gtk.Image DefaultTabImage { get { return new Gtk.Image(IconPixbuf); } } static PersonChatView() { IconPixbuf = Frontend.LoadIcon( "smuxi-person-chat", 16, "person-chat_256x256.png" ); } public override void AddMessage(MessageModel msg) { switch (msg.MessageType) { case MessageType.PersonChatPersonChanged: ThreadPool.QueueUserWorkItem(delegate { try { // REMOTING CALL PersonModel = PersonChatModel.Person; } catch (Exception ex) { Frontend.ShowException(ex); } }); return; } base.AddMessage(msg); } public PersonChatView(PersonChatModel chat) : base(chat) { Trace.Call(chat); PersonChatModel = chat; Add(OutputScrolledWindow); ShowAll(); } protected PersonChatView(IntPtr handle) : base(handle) { } public override IList Participants { get { var ret = new List(); ret.Add(PersonChatModel.Person); return ret; } } public override void Sync() { Trace.Call(); GLib.Idle.Add(delegate { TabImage.SetFromStock(Gtk.Stock.Refresh, Gtk.IconSize.Menu); OnStatusChanged(EventArgs.Empty); return false; }); // REMOTING CALL 1 PersonModel = PersonChatModel.Person; base.Sync(); } } } smuxi-0.11/src/Frontend-GNOME/Views/Chats/SessionChatView.cs0000644000175000017500000000443612257043746024374 0ustar00meebeymeebey00000000000000/* * $Id: NetworkChatView.cs 218 2007-11-12 19:50:25Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/Chats/NetworkChatView.cs $ * $Rev: 218 $ * $Author: meebey $ * $Date: 2007-11-12 20:50:25 +0100 (Mon, 12 Nov 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend.Gnome { [ChatViewInfo(ChatType = ChatType.Session)] public class SessionChatView : ChatView { public static Gdk.Pixbuf IconPixbuf { get; private set; } protected override Gtk.Image DefaultTabImage { get { return new Gtk.Image(IconPixbuf); } } static SessionChatView() { IconPixbuf = Frontend.LoadIcon( "smuxi-session-chat", 16, "session-chat_256x256.png" ); } public SessionChatView(ChatModel chat) : base(chat) { Trace.Call(chat); OutputMessageTextView.ShowMarkerline = false; OutputMessageTextView.ShowTimestamps = false; Add(OutputScrolledWindow); ShowAll(); } protected SessionChatView(IntPtr handle) : base(handle) { } protected override void OnTabButtonPress(object sender, Gtk.ButtonPressEventArgs e) { Trace.Call(sender, e); // disable menu for session chats } } } smuxi-0.11/src/Frontend-GNOME/Views/Chats/GroupChatView.cs0000644000175000017500000006642612300201645024033 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006, 2009-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Threading; using System.Collections.Generic; using System.Globalization; using System.Linq; using Mono.Unix; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend.Gnome { [ChatViewInfo(ChatType = ChatType.Group)] public class GroupChatView : ChatView { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public static Gdk.Pixbuf IconPixbuf { get; private set; } private bool NickColors { get; set; } private GroupChatModel _GroupChatModel; private Gtk.TreeView _PersonTreeView; private Gtk.ListStore _PersonListStore; private Gtk.Menu _PersonMenu; private Gtk.VBox _OutputVBox; private Gtk.Frame _PersonTreeViewFrame; private Gtk.HPaned _OutputHPaned; private Gtk.ScrolledWindow _TopicScrolledWindow; private MessageTextView _TopicTextView; private MessageModel _Topic; private Gtk.TreeViewColumn _IdentityNameColumn; IDictionary SyncedPersons { get; set; } MessageModel SyncedTopic { get; set; } public override IList Participants { get; protected set; } protected Gtk.CellRendererText IdentityNameCellRenderer { get; set; } Gtk.ScrolledWindow PersonScrolledWindow { get; set; } public override bool HasSelection { get { return base.HasSelection || _PersonTreeView.Selection.CountSelectedRows() > 0 || _TopicTextView.HasTextViewSelection; } } public override bool HasFocus { get { return base.HasFocus || _PersonTreeView.HasFocus || _TopicTextView.HasFocus; } } public MessageModel Topic { get { return _Topic; } set { _Topic = value; _TopicTextView.Clear(); if (value != null) { _TopicTextView.AddMessage(value, false); } _TopicScrolledWindow.Visible = !_TopicTextView.IsEmpty; } } protected Gtk.TreeView PersonTreeView { get { return _PersonTreeView; } } protected Gtk.Menu PersonMenu { get { return _PersonMenu; } } protected Gtk.TreeViewColumn IdentityNameColumn { get { return _IdentityNameColumn; } } protected override Gtk.Image DefaultTabImage { get { return new Gtk.Image(IconPixbuf); } } static GroupChatView() { IconPixbuf = Frontend.LoadIcon( "smuxi-group-chat", 16, "group-chat_256x256.png" ); } public GroupChatView(GroupChatModel groupChat) : base(groupChat) { Trace.Call(groupChat); _GroupChatModel = groupChat; // person list Participants = new List(); _OutputHPaned = new Gtk.HPaned(); _OutputHPaned.ButtonPressEvent += (sender, e) => {; // reset person list size on double click if (e.Event.Type == Gdk.EventType.TwoButtonPress && e.Event.Button == 1) { GLib.Timeout.Add(200, delegate { _OutputHPaned.Position = -1; return false; }); } }; Gtk.TreeView tv = new Gtk.TreeView(); _PersonTreeView = tv; Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow(); PersonScrolledWindow = sw; sw.HscrollbarPolicy = Gtk.PolicyType.Never; sw.SizeRequested += (o, args) => { // predict and set useful treeview width var persons = SyncedPersons; if (persons == null || persons.Count == 0) { return; } int longestNameWidth = 0; foreach (var person in persons.Values) { int lineWidth, lineHeigth; using (var layout = _PersonTreeView.CreatePangoLayout(person.IdentityName)) { layout.GetPixelSize(out lineWidth, out lineHeigth); } if (lineWidth > longestNameWidth) { longestNameWidth = lineWidth; } } var bestSize = new Gtk.Requisition() { Width = longestNameWidth }; args.Requisition = bestSize; }; //tv.CanFocus = false; tv.BorderWidth = 0; tv.Selection.Mode = Gtk.SelectionMode.Multiple; sw.Add(tv); Gtk.TreeViewColumn column; Gtk.CellRendererText cellr = new Gtk.CellRendererText(); IdentityNameCellRenderer = cellr; column = new Gtk.TreeViewColumn(String.Empty, cellr); column.SortColumnId = 0; column.Spacing = 0; column.SortIndicator = false; column.Sizing = Gtk.TreeViewColumnSizing.Autosize; // FIXME: this callback leaks memory column.SetCellDataFunc(cellr, new Gtk.TreeCellDataFunc(RenderPersonIdentityName)); tv.AppendColumn(column); _IdentityNameColumn = column; Gtk.ListStore liststore = new Gtk.ListStore(typeof(PersonModel)); liststore.SetSortColumnId(0, Gtk.SortType.Ascending); liststore.SetSortFunc(0, new Gtk.TreeIterCompareFunc(SortPersonListStore)); _PersonListStore = liststore; tv.Model = liststore; tv.SearchColumn = 0; tv.SearchEqualFunc = (model, col, key, iter) => { var person = (PersonModel) model.GetValue(iter, col); // Ladies and gentlemen welcome to C // 0 means it matched but 0 as bool is false. So if it matches // we have to return false. Still not clear? true is false and // false is true, weirdo! If you think this is retarded, // yes it is. return !person.IdentityName.StartsWith(key, StringComparison.InvariantCultureIgnoreCase); }; tv.EnableSearch = true; tv.RowActivated += new Gtk.RowActivatedHandler(OnPersonsRowActivated); tv.FocusOutEvent += OnPersonTreeViewFocusOutEvent; // popup menu _PersonMenu = new Gtk.Menu(); // don't loose the focus else we lose the selection too! // see OnPersonTreeViewFocusOutEvent() _PersonMenu.TakeFocus = false; _PersonMenu.Shown += OnPersonMenuShown; _PersonTreeView.ButtonPressEvent += _OnPersonTreeViewButtonPressEvent; _PersonTreeView.KeyPressEvent += OnPersonTreeViewKeyPressEvent; // frame needed for events when selecting something in the treeview _PersonTreeViewFrame = new Gtk.Frame(); _PersonTreeViewFrame.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler(_OnUserListButtonReleaseEvent); _PersonTreeViewFrame.Add(sw); // topic // don't worry, ApplyConfig() will add us to the OutputVBox! _OutputVBox = new Gtk.VBox(); _TopicTextView = new MessageTextView(); _TopicTextView.Editable = false; _TopicTextView.WrapMode = Gtk.WrapMode.WordChar; _TopicScrolledWindow = new Gtk.ScrolledWindow(); _TopicScrolledWindow.ShadowType = Gtk.ShadowType.In; _TopicScrolledWindow.HscrollbarPolicy = Gtk.PolicyType.Never; _TopicScrolledWindow.Add(_TopicTextView); // make sure the topic is invisible and remains by default and // visible when a topic gets set _TopicScrolledWindow.ShowAll(); _TopicScrolledWindow.Visible = false; _TopicScrolledWindow.NoShowAll = true; _TopicScrolledWindow.SizeRequested += delegate(object o, Gtk.SizeRequestedArgs args) { // predict and set useful topic heigth int lineWidth, lineHeight; using (var layout = _TopicTextView.CreatePangoLayout("Test Topic")) { layout.GetPixelSize(out lineWidth, out lineHeight); } var lineSpacing = _TopicTextView.PixelsAboveLines + _TopicTextView.PixelsBelowLines; var it = _TopicTextView.Buffer.StartIter; int newLines = 1; // move to end of next visual line while (_TopicTextView.ForwardDisplayLineEnd(ref it)) { newLines++; // calling ForwardDisplayLineEnd repeatedly stays on the same position // therefor we move one cursor position further it.ForwardCursorPosition(); } newLines = Math.Min(newLines, 3); var bestSize = new Gtk.Requisition() { Height = ((lineHeight + lineSpacing) * newLines) + 4 }; args.Requisition = bestSize; }; Add(_OutputHPaned); //ApplyConfig(Frontend.UserConfig); ShowAll(); } protected GroupChatView(IntPtr handle) : base(handle) { } public override void Dispose() { Trace.Call(); // HACK: this shouldn't be needed but GTK# keeps GC handles // these callbacks for some reason and thus leaks :( // release ListStore.SetSortFunc() callback // gtk_list_store_finalize() -> _gtk_tree_data_list_header_free() -> destroy(user_data); _TopicTextView.Dispose(); _PersonListStore.Dispose(); // release TreeViewColumn.SetCellDataFunc() callback // gtk_tree_view_column_finalize -> GtkTreeViewColumnCellInfo -> info->destroy(info->func_data) _IdentityNameColumn.Dispose(); base.Dispose(); } public override void Disable() { Trace.Call(); base.Disable(); _TopicTextView.Buffer.Text = String.Empty; _PersonListStore.Clear(); UpdatePersonCount(); } public override void Sync() { Trace.Call(); GLib.Idle.Add(delegate { TabImage.SetFromStock(Gtk.Stock.Refresh, Gtk.IconSize.Menu); OnStatusChanged(EventArgs.Empty); return false; }); #if LOG4NET _Logger.Debug("Sync() syncing persons"); #endif // REMOTING CALL 1 SyncedPersons = _GroupChatModel.Persons; if (SyncedPersons == null) { SyncedPersons = new Dictionary(0); } #if LOG4NET _Logger.Debug("Sync() syncing topic"); #endif // REMOTING CALL 2 SyncedTopic = _GroupChatModel.Topic; base.Sync(); } public override void Populate() { Trace.Call(); // sync persons var persons = SyncedPersons; if (_PersonTreeView != null && persons != null) { // HACK: out of scope string status = String.Format( _("Retrieving user list for {0}..."), SyncedName); Frontend.MainWindow.Status = status; Gtk.ListStore ls = (Gtk.ListStore) _PersonTreeView.Model; // cleanup, be sure the list is empty ls.Clear(); // detach the model (less CPU load) _PersonTreeView.Model = new Gtk.ListStore(typeof(PersonModel)); Participants = new List(); string longestName = String.Empty; foreach (var person in persons.Values.OrderBy(x => x)) { ls.AppendValues(person); if (person.IdentityName.Length > longestName.Length) { longestName = person.IdentityName; } Participants.Add(person); } // attach the model again // BUG? TreeView doesn't seem to recognize existing values in the model?!? // see: http://www.smuxi.org/issues/show/132 _PersonTreeView.Model = ls; _PersonTreeView.SearchColumn = 0; PersonScrolledWindow.CheckResize(); UpdatePersonCount(); // TRANSLATOR: this string will be appended to the one above status += String.Format(" {0}", _("done.")); Frontend.MainWindow.Status = status; } SyncedPersons = null; Topic = SyncedTopic; base.Populate(); } public override void AddMessage(MessageModel msg) { base.AddMessage(msg); var nick = msg.GetNick(); if (nick == null) { return; } // update who spoke last for (int i = 0; i < Participants.Count; ++i) { var speaker = Participants[i]; if (speaker.IdentityName == nick) { Participants.RemoveAt(i); Participants.Insert(0, speaker); break; } } } protected void UpdatePersonCount() { _IdentityNameColumn.Title = String.Format(_("Person") + " ({0})", _PersonListStore.IterNChildren()); } public void AddPerson(PersonModel person) { Trace.Call(person); if (_PersonListStore == null) { // no liststore, nothing todo return; } _PersonListStore.AppendValues(person); Participants.Add(person); UpdatePersonCount(); } public void UpdatePerson(PersonModel oldPerson, PersonModel newPerson) { Trace.Call(oldPerson, newPerson); if (_PersonListStore == null) { // no liststore, nothing todo return; } Gtk.TreeIter iter; bool res = _PersonListStore.GetIterFirst(out iter); if (!res) { #if LOG4NET _Logger.Error("UpdatePersonModelInChannel(): _PersonsStore.GetIterFirst() returned false, ignoring update..."); #endif return; } do { PersonModel person = (PersonModel) _PersonListStore.GetValue(iter, 0); if (person.ID == oldPerson.ID) { _PersonListStore.SetValue(iter, 0, newPerson); break; } } while (_PersonListStore.IterNext(ref iter)); _PersonTreeView.CheckResize(); //_PersonListStore.Reorder(); for (int i = 0; i < Participants.Count; ++i) { if (Participants[i].ID == oldPerson.ID) { Participants[i] = newPerson; break; } } } public void RemovePerson(PersonModel person) { Trace.Call(person); if (_PersonListStore == null) { // no liststore, nothing todo return; } Gtk.TreeIter iter; bool res = _PersonListStore.GetIterFirst(out iter); if (!res) { #if LOG4NET _Logger.Error("RemovePerson(): GetIterFirst() returned false!"); #endif return; } do { PersonModel currentPerson = (PersonModel) _PersonListStore.GetValue(iter, 0); if (currentPerson.ID == person.ID) { _PersonListStore.Remove(ref iter); break; } } while (_PersonListStore.IterNext(ref iter)); for (int i = 0; i < Participants.Count; ++i) { if (Participants[i].ID == person.ID) { Participants.RemoveAt(i); break; } } UpdatePersonCount(); } public override void ApplyConfig(UserConfig config) { Trace.Call(config); if (config == null) { throw new ArgumentNullException("config"); } base.ApplyConfig(config); // topic _TopicTextView.ApplyConfig(config); string topic_pos = (string) config["Interface/Notebook/Channel/TopicPosition"]; if (_TopicScrolledWindow.IsAncestor(_OutputVBox)) { _OutputVBox.Remove(_TopicScrolledWindow); } if (OutputScrolledWindow.IsAncestor(_OutputVBox)) { _OutputVBox.Remove(OutputScrolledWindow); } if (topic_pos == "top") { _OutputVBox.PackStart(_TopicScrolledWindow, false, false, 2); _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0); } else if (topic_pos == "bottom") { _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0); _OutputVBox.PackStart(_TopicScrolledWindow, false, false, 2); } else if (topic_pos == "none") { _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0); } else { #if LOG4NET _Logger.Error("ApplyConfig(): unsupported value in Interface/Notebook/Channel/TopicPosition: " + topic_pos); #endif } _OutputVBox.ShowAll(); // person list if (ThemeSettings.BackgroundColor == null) { _PersonTreeView.ModifyBase(Gtk.StateType.Normal); } else { _PersonTreeView.ModifyBase(Gtk.StateType.Normal, ThemeSettings.BackgroundColor.Value); } if (ThemeSettings.ForegroundColor == null) { _PersonTreeView.ModifyText(Gtk.StateType.Normal); } else { _PersonTreeView.ModifyText(Gtk.StateType.Normal, ThemeSettings.ForegroundColor.Value); } _PersonTreeView.ModifyFont(ThemeSettings.FontDescription); string userlist_pos = (string) config["Interface/Notebook/Channel/UserListPosition"]; if (userlist_pos == "left") { userlist_pos = "right"; } if (_PersonTreeViewFrame.IsAncestor(_OutputHPaned)) { _OutputHPaned.Remove(_PersonTreeViewFrame); } if (_OutputVBox.IsAncestor(_OutputHPaned)) { _OutputHPaned.Remove(_OutputVBox); } if (userlist_pos == "left") { _OutputHPaned.Pack1(_PersonTreeViewFrame, false, true); _OutputHPaned.Pack2(_OutputVBox, true, true); } else if (userlist_pos == "right") { _OutputHPaned.Pack1(_OutputVBox, true, true); _OutputHPaned.Pack2(_PersonTreeViewFrame, false, true); } else if (userlist_pos == "none") { _OutputHPaned.Pack1(_OutputVBox, true, true); } else { #if LOG4NET _Logger.Error("ApplyConfig(): unsupported value in Interface/Notebook/Channel/UserListPosition: " + userlist_pos); #endif } _OutputHPaned.ShowAll(); NickColors = (bool) config["Interface/Notebook/Channel/NickColors"]; } public virtual void RenderPersonIdentityName(Gtk.TreeViewColumn column, Gtk.CellRenderer cellr, Gtk.TreeModel model, Gtk.TreeIter iter) { PersonModel person = (PersonModel) model.GetValue(iter, 0); var renderer = (Gtk.CellRendererText) cellr; if (NickColors) { // TODO: do we need to optimize this? it's called very often... Gdk.Color bgColor = _PersonTreeView.Style.Base(Gtk.StateType.Normal); var builder = new MessageBuilder(); builder.Settings.NickColors = true; builder.AppendNick(person); renderer.Markup = PangoTools.ToMarkup(builder.ToMessage(), bgColor); } else { renderer.Text = person.IdentityName; } } protected virtual int SortPersonListStore(Gtk.TreeModel model, Gtk.TreeIter iter1, Gtk.TreeIter iter2) { Gtk.ListStore liststore = (Gtk.ListStore) model; PersonModel person1 = (PersonModel) liststore.GetValue(iter1, 0); PersonModel person2 = (PersonModel) liststore.GetValue(iter2, 0); return person1.CompareTo(person2); } protected virtual void OnPersonsRowActivated(object sender, Gtk.RowActivatedArgs e) { Trace.Call(sender, e); IList persons = GetSelectedPersons(); if (persons == null || persons.Count == 0) { return; } var protocolManager = ProtocolManager; if (protocolManager == null) { #if LOG4NET _Logger.WarnFormat( "{0}.OnPersonsRowActivated(): ProtocolManager is null, " + "bailing out!", this ); #endif return; } // jump to person chat if available foreach (var chatView in Frontend.MainWindow.ChatViewManager.Chats) { if (!(chatView is PersonChatView)) { continue; } var personChatView = (PersonChatView) chatView; if (personChatView.PersonModel == persons[0]) { Frontend.MainWindow.ChatViewManager.CurrentChatView = personChatView; return; } } // this is a generic implemention that should be able to open/create // a private chat in most cases, as it depends what OpenChat() // of the specific protocol actually expects/needs foreach (PersonModel person in persons) { PersonChatModel personChat = new PersonChatModel( person, person.ID, person.IdentityName, null ); ThreadPool.QueueUserWorkItem(delegate { try { protocolManager.OpenChat( Frontend.FrontendManager, personChat ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } protected virtual void OnPersonTreeViewFocusOutEvent(object sender, EventArgs e) { Trace.Call(sender, e); // clear the selection when we loose the focus _PersonTreeView.Selection.UnselectAll(); } protected virtual void OnPersonTreeViewKeyPressEvent(object sender, Gtk.KeyPressEventArgs e) { Trace.Call(sender, e); if ((e.Event.State & Gdk.ModifierType.Mod1Mask) != 0 || (e.Event.State & Gdk.ModifierType.ControlMask) != 0 || (e.Event.State & Gdk.ModifierType.ShiftMask) != 0) { // alt, ctrl or shift pushed, returning return; } if (e.Event.Key == Gdk.Key.Menu && _PersonTreeView.Selection.CountSelectedRows() > 0) { _PersonMenu.Popup(null, null, null, 0, e.Event.Time); } } protected virtual void OnPersonMenuShown(object sender, EventArgs e) { } private void _OnUserListButtonReleaseEvent(object sender, Gtk.ButtonReleaseEventArgs e) { Trace.Call(sender, e); if (e.Event.Button == 3 && _PersonTreeView.Selection.CountSelectedRows() > 0) { // HACK: don't pass the real mouse button that was used to // initiate the menu, as sub-menus will only respond to that // button for some reason! As workaround we always pass // 0 == left mouse button here //_PersonMenu.Popup(null, null, null, e.Event.Button, e.Event.Time); _PersonMenu.Popup(null, null, null, 0, e.Event.Time); } } [GLib.ConnectBefore] private void _OnPersonTreeViewButtonPressEvent(object sender, Gtk.ButtonPressEventArgs e) { Trace.Call(sender, e); // If there is an existing selection prevent making a new one using // the right mouse button. // We have to check > 1 though, because you can't undo a single row selection! if (e.Event.Button == 3 && _PersonTreeView.Selection.CountSelectedRows() > 1) { e.RetVal = true; } } protected IList GetSelectedPersons() { Gtk.TreeIter iter; Gtk.TreeModel model; List persons = new List(); Gtk.TreePath[] paths = _PersonTreeView.Selection.GetSelectedRows(out model); foreach (Gtk.TreePath path in paths) { if (model.GetIter(out iter, path)) { persons.Add((PersonModel) model.GetValue(iter, 0)); } } return persons; } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/Views/Chats/ChatView.cs0000644000175000017500000007165112264335155023027 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Text.RegularExpressions; using System.Threading; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; using Smuxi.Frontend; namespace Smuxi.Frontend.Gnome { // TODO: use Gtk.Bin public abstract class ChatView : Gtk.EventBox, IChatView, IDisposable, ITraceable { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public string ID { get; internal set; } public int Position { get; internal set; } private ChatModel _ChatModel; private bool _HasHighlight; public int HighlightCount { get; private set; } private bool _HasActivity; private bool _HasEvent; private bool _IsSynced; private Gtk.TextMark _EndMark; private Gtk.Menu _TabMenu; private Gtk.Label _TabLabel; private Gtk.EventBox _TabEventBox; private Gtk.HBox _TabHBox; private Gtk.ScrolledWindow _OutputScrolledWindow; private MessageTextView _OutputMessageTextView; private ThemeSettings _ThemeSettings; private TaskQueue _LastSeenHighlightQueue; public DateTime SyncedLastSeenHighlight { get; private set; } IList SyncedMessages { get; set; } protected string SyncedName { get; set; } public IProtocolManager ProtocolManager { get; set; } bool UseLowBandwidthMode { get; set; } public Gtk.Image TabImage { get; protected set; } bool IsAutoScrolling { get; set; } public event EventHandler StatusChanged; public ChatModel ChatModel { get { return _ChatModel; } } public new string Name { get { return base.Name; } set { base.Name = value; _TabLabel.Text = value; OnStatusChanged(EventArgs.Empty); } } // this property is thread-safe public bool IsActive { get { // is it really safe to query a property value of glib owned // object?!? return Frontend.MainWindow.HasToplevelFocus && Object.ReferenceEquals( Frontend.MainWindow.ChatViewManager.CurrentChatView, this ); } } public bool HasHighlight { get { return _HasHighlight; } set { if (value) { _HasHighlight = value; HighlightCount++; OnStatusChanged(EventArgs.Empty); } else { if (_HasHighlight == value) { // nothing to update return; } _HasHighlight = value; // clear highlight with "no activity" HasActivity = false; HighlightCount = 0; OnStatusChanged(EventArgs.Empty); return; } var color = TextColorTools.GetBestTextColor( ColorConverter.GetTextColor(_ThemeSettings.HighlightColor), ColorConverter.GetTextColor( Gtk.Rc.GetStyle(_TabLabel).Base(Gtk.StateType.Normal) ), TextColorContrast.High ); if (HighlightCount > 1) { _TabLabel.Markup = String.Format( "{1} ({2})", GLib.Markup.EscapeText(color.ToString()), GLib.Markup.EscapeText(Name), GLib.Markup.EscapeText(HighlightCount.ToString()) ); } else { _TabLabel.Markup = String.Format( "{1}", GLib.Markup.EscapeText(color.ToString()), GLib.Markup.EscapeText(Name) ); } } } public bool HasActivity { get { return _HasActivity; } set { if (_HasActivity == value) { // nothing to update return; } _HasActivity = value; OnStatusChanged(EventArgs.Empty); if (HasHighlight) { // don't show activity if there is a highlight active return; } Gdk.Color colorValue; if (value) { colorValue = _ThemeSettings.ActivityColor; } else { colorValue = _ThemeSettings.NoActivityColor; } var color = TextColorTools.GetBestTextColor( ColorConverter.GetTextColor(colorValue), ColorConverter.GetTextColor( Gtk.Rc.GetStyle(_TabLabel).Base(Gtk.StateType.Normal) ), TextColorContrast.High ); _TabLabel.Markup = String.Format( "{1}", GLib.Markup.EscapeText(color.ToString()), GLib.Markup.EscapeText(Name) ); } } public bool HasEvent { get { return _HasEvent; } set { if (_HasEvent == value) { // nothing to update return; } _HasEvent = value; OnStatusChanged(EventArgs.Empty); if (HasHighlight) { return; } if (HasActivity) { return; } if (!value) { // clear event with "no activity" HasActivity = false; return; } var color = TextColorTools.GetBestTextColor( ColorConverter.GetTextColor(_ThemeSettings.EventColor), ColorConverter.GetTextColor( Gtk.Rc.GetStyle(_TabLabel).Base(Gtk.StateType.Normal) ), TextColorContrast.High ); _TabLabel.Markup = String.Format( "{1}", GLib.Markup.EscapeText(color.ToString()), GLib.Markup.EscapeText(Name) ); } } public virtual bool HasSelection { get { return _OutputMessageTextView.HasTextViewSelection; } } public virtual new bool HasFocus { get { return base.HasFocus || _OutputMessageTextView.HasFocus; } set { _OutputMessageTextView.HasFocus = value; } } // by default: no participants public virtual IList Participants { get { return new List(); } protected set { } } public Gtk.Widget LabelWidget { get { return _TabEventBox; } } public MessageTextView OutputMessageTextView { get { return _OutputMessageTextView; } } protected Gtk.ScrolledWindow OutputScrolledWindow { get { return _OutputScrolledWindow; } } protected Gtk.HBox TabHBox { get { return _TabHBox; } } public Gtk.Menu TabMenu { get { return _TabMenu; } } protected ThemeSettings ThemeSettings { get { return _ThemeSettings; } } protected abstract Gtk.Image DefaultTabImage { get; } public event EventHandler MessageHighlighted; public ChatView(ChatModel chat) { Trace.Call(chat); _ChatModel = chat; IsAutoScrolling = true; MessageTextView tv = new MessageTextView(); _EndMark = tv.Buffer.CreateMark("end", tv.Buffer.EndIter, false); tv.ShowTimestamps = true; tv.ShowMarkerline = true; tv.Editable = false; tv.CursorVisible = true; tv.WrapMode = Gtk.WrapMode.Char; tv.MessageAdded += OnMessageTextViewMessageAdded; tv.MessageHighlighted += OnMessageTextViewMessageHighlighted; tv.PopulatePopup += OnMessageTextViewPopulatePopup; tv.SizeRequested += delegate { AutoScroll(); }; tv.PersonClicked += OnMessageTextViewPersonClicked; _OutputMessageTextView = tv; Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow(); _OutputScrolledWindow = sw; //sw.HscrollbarPolicy = Gtk.PolicyType.Never; sw.HscrollbarPolicy = Gtk.PolicyType.Automatic; sw.VscrollbarPolicy = Gtk.PolicyType.Always; sw.ShadowType = Gtk.ShadowType.In; sw.Vadjustment.ValueChanged += OnVadjustmentValueChanged; sw.Add(_OutputMessageTextView); // popup menu _TabMenu = new Gtk.Menu(); _TabMenu.Shown += OnTabMenuShown; //FocusChild = _OutputTextView; //CanFocus = false; _TabLabel = new Gtk.Label(); TabImage = DefaultTabImage; _TabHBox = new Gtk.HBox(); _TabHBox.PackEnd(new Gtk.Fixed(), true, true, 0); _TabHBox.PackEnd(_TabLabel, false, false, 0); _TabHBox.PackStart(TabImage, false, false, 2); _TabHBox.ShowAll(); _TabEventBox = new Gtk.EventBox(); _TabEventBox.VisibleWindow = false; _TabEventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnTabButtonPress); _TabEventBox.Add(_TabHBox); _TabEventBox.ShowAll(); _ThemeSettings = new ThemeSettings(); // OPT-TODO: this should use a TaskStack instead of TaskQueue _LastSeenHighlightQueue = new TaskQueue("LastSeenHighlightQueue("+ID+")"); _LastSeenHighlightQueue.AbortedEvent += OnLastSeenHighlightQueueAbortedEvent; _LastSeenHighlightQueue.ExceptionEvent += OnLastSeenHighlightQueueExceptionEvent; } protected ChatView(IntPtr handle) : base(handle) { } ~ChatView() { Trace.Call(); Dispose(false); } public override void Dispose() { Trace.Call(); Dispose(true); base.Dispose(); } protected void Dispose(bool disposing) { Trace.Call(disposing); if (disposing) { if (_LastSeenHighlightQueue != null) { _LastSeenHighlightQueue.Dispose(); } _LastSeenHighlightQueue = null; // HACK: this shouldn't be needed but GTK# keeps GC handles // these callbacks for some reason and thus leaks :( _OutputMessageTextView.Dispose(); _TabMenu.Shown -= OnTabMenuShown; _OutputScrolledWindow.Vadjustment.ValueChanged -= OnVadjustmentValueChanged; } } public virtual void ScrollUp() { Trace.Call(); Gtk.Adjustment adj = _OutputScrolledWindow.Vadjustment; adj.Value -= adj.PageSize - adj.StepIncrement; } public virtual void ScrollDown() { Trace.Call(); // note: Upper - PageSize is the farest scrollable position! Gtk.Adjustment adj = _OutputScrolledWindow.Vadjustment; if ((adj.Value + adj.PageSize) <= (adj.Upper - adj.PageSize)) { adj.Value += adj.PageSize - adj.StepIncrement; } else { // there is no page left to scroll, so let's just scroll to the // farest position instead adj.Value = adj.Upper - adj.PageSize; } } public virtual void ScrollToStart() { Trace.Call(); Gtk.Adjustment adj = _OutputScrolledWindow.Vadjustment; adj.Value = adj.Lower; } public virtual void ScrollToEnd() { #if SCROLL_DEBUG Trace.Call(); #endif // BUG? doesn't work always for some reason // seems like GTK+ doesn't update the adjustment till we give back control //Gtk.Adjustment adj = _OutputScrolledWindow.Vadjustment; #if LOG4NET && SCROLL_DEBUG _Logger.Debug("ScrollToEnd(): Vadjustment.Value: " + adj.Value + " Vadjustment.Upper: " + adj.Upper + " Vadjustment.PageSize: " + adj.PageSize); #endif //adj.Value = adj.Upper - adj.PageSize; //_OutputTextView.Buffer.MoveMark(_EndMark, _OutputTextView.Buffer.EndIter); //_OutputTextView.ScrollMarkOnscreen(_EndMark); //_OutputTextView.ScrollToMark(_EndMark, 0.49, true, 0.0, 0.0); //_OutputTextView.ScrollMarkOnscreen(_OutputTextView.Buffer.InsertMark); //_OutputTextView.ScrollMarkOnscreen(_OutputTextView.Buffer.GetMark("tail")); #if SCROLL_DEBUG System.Reflection.MethodBase mb = Trace.GetMethodBase(); #endif // WORKAROUND1: scroll after one second delay /* GLib.Timeout.Add(1000, new GLib.TimeoutHandler(delegate { Trace.Call(mb); _OutputTextView.ScrollMarkOnscreen(_EndMark); return false; })); */ // WORKAROUND2: scroll when GTK+ mainloop is idle GLib.Idle.Add(new GLib.IdleHandler(delegate { #if SCROLL_DEBUG Trace.Call(mb); #endif _OutputMessageTextView.ScrollMarkOnscreen(_EndMark); return false; })); } void CheckAutoScroll() { var vAdjustment = _OutputScrolledWindow.Vadjustment; if (vAdjustment.Upper == (vAdjustment.Value + vAdjustment.PageSize)) { // the scrollbar is way at the end, lets autoscroll IsAutoScrolling = true; } else { IsAutoScrolling = false; } } void AutoScroll() { if (!IsAutoScrolling) { return; } ScrollToEnd(); } public virtual void Enable() { Trace.Call(); } public virtual void Disable() { Trace.Call(); _IsSynced = false; } public virtual void Sync() { Trace.Call(); GLib.Idle.Add(delegate { TabImage.SetFromStock(Gtk.Stock.Refresh, Gtk.IconSize.Menu); OnStatusChanged(EventArgs.Empty); return false; }); // REMOTING CALL SyncedName = _ChatModel.Name; if (!Frontend.IsLocalEngine && Frontend.UseLowBandwidthMode) { // FIXME: set TabImage back to normal return; } // REMOTING CALL SyncedLastSeenHighlight = _ChatModel.LastSeenHighlight; DateTime start, stop; start = DateTime.UtcNow; // REMOTING CALL SyncedMessages = _ChatModel.Messages; stop = DateTime.UtcNow; #if LOG4NET _Logger.Debug( String.Format( "Sync(): retrieving ChatModel.Messages took: {0:0.00} ms", (stop - start).TotalMilliseconds ) ); #endif } public virtual void Populate() { Trace.Call(); Name = SyncedName; // sync messages // cleanup, be sure the output is empty _OutputMessageTextView.Clear(); if (!Frontend.IsLocalEngine && Frontend.UseLowBandwidthMode) { var msg = new MessageBuilder(); msg.AppendEventPrefix(); msg.AppendMessage(_("Low Bandwidth Mode is active: no messages synced.")); AddMessage(msg.ToMessage()); } else { if (SyncedMessages != null) { // TODO: push messages in batches and give back control to // GTK+ in between for blocking the GUI thread less foreach (MessageModel msg in SyncedMessages) { AddMessage(msg); } } } // as we don't track which messages were already seen it would // show all chats with message activity after the frontend connect if (!HasHighlight) { HasActivity = false; HasEvent = false; } // let the user know at which position new messages start _OutputMessageTextView.UpdateMarkerline(); // reset tab icon to normal TabImage.Pixbuf = DefaultTabImage.Pixbuf; OnStatusChanged(EventArgs.Empty); SyncedMessages = null; _IsSynced = true; } public virtual void AddMessage(MessageModel msg) { switch (msg.MessageType) { case MessageType.ChatNameChanged: ThreadPool.QueueUserWorkItem(delegate { try { // REMOTING CALL var newname = ChatModel.Name; Gtk.Application.Invoke(delegate { Name = newname; }); } catch (Exception ex) { Frontend.ShowException(ex); } }); return; } _OutputMessageTextView.AddMessage(msg); } public virtual void Clear() { Trace.Call(); _OutputMessageTextView.Clear(); } public virtual void ApplyConfig(UserConfig config) { Trace.Call(config); if (config == null) { throw new ArgumentNullException("config"); } _ThemeSettings = new ThemeSettings(config); _OutputMessageTextView.ApplyConfig(config); } public virtual void Close() { Trace.Call(); var protocolManager = ProtocolManager; if (protocolManager == null) { #if LOG4NET _Logger.WarnFormat( "{0}.Close(): ProtocolManager is null, bailing out!", this ); #endif return; } ThreadPool.QueueUserWorkItem(delegate { try { protocolManager.CloseChat( Frontend.FrontendManager, ChatModel ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } public override string ToString() { return String.Format("<{0}>", ToTraceString()); } public string ToTraceString() { return ID; } protected virtual void OnTabButtonPress(object sender, Gtk.ButtonPressEventArgs e) { Trace.Call(sender, e); try { if (e.Event.Button == 3) { _TabMenu.Popup(null, null, null, e.Event.Button, e.Event.Time); } } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual void OnTabMenuShown(object sender, EventArgs e) { Trace.Call(sender, e); foreach (var child in _TabMenu.Children) { _TabMenu.Remove(child); } var closeItem = new Gtk.ImageMenuItem(Gtk.Stock.Close, null); closeItem.Activated += OnTabMenuCloseActivated; _TabMenu.Append(closeItem); _TabMenu.ShowAll(); } protected virtual void OnTabMenuCloseActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { Close(); } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual void OnMessageTextViewMessageAdded(object sender, MessageTextViewMessageAddedEventArgs e) { if (!IsActive) { switch (e.Message.MessageType) { case MessageType.Normal: HasActivity = true; break; case MessageType.Event: HasEvent = true; break; } } var buffer = _OutputMessageTextView.Buffer; buffer.MoveMark(_EndMark, buffer.EndIter); AutoScroll(); } protected virtual void OnMessageTextViewMessageHighlighted(object sender, MessageTextViewMessageHighlightedEventArgs e) { if (_IsSynced) { bool isActiveChat = IsActive; if (Frontend.UseLowBandwidthMode && !isActiveChat) { HasHighlight = true; return; } var method = Trace.GetMethodBase(); // update last seen highlight // OPT-TODO: we should use a TaskStack here OR at least a // timeout approach that will only sync once per 30 seconds! _LastSeenHighlightQueue.Queue(delegate { Trace.Call(method, null, null); // unhandled exception here would kill the syncer thread try { if (isActiveChat) { // REMOTING CALL 1 _ChatModel.LastSeenHighlight = e.Message.TimeStamp; } else { // REMOTING CALL 1 if (_ChatModel.LastSeenHighlight < e.Message.TimeStamp) { Gtk.Application.Invoke(delegate { // we have to make sure we only highlight // the chat if it still isn't the active // one as isActiveChat state is probably // obsolete by now if (IsActive) { return; } HasHighlight = true; }); } } } catch (Exception ex) { #if LOG4NET _Logger.Error("OnMessageTextViewMessageHighlighted(): Exception: ", ex); #endif } }); } else { if (e.Message.TimeStamp > SyncedLastSeenHighlight) { HasHighlight = true; } } if (e.Message.TimeStamp > SyncedLastSeenHighlight) { // unseen highlight // HACK: out of scope? // only beep if the main windows has no focus (the user is // elsewhere) and the chat is was already synced, as during sync we // would get insane from all beeping caused by the old highlights if (!Frontend.MainWindow.HasToplevelFocus && _IsSynced && Frontend.UserConfig["Sound/BeepOnHighlight"] != null && (bool) Frontend.UserConfig["Sound/BeepOnHighlight"]) { #if LOG4NET _Logger.Debug("OnMessageTextViewMessageHighlighted(): BEEP!"); #endif try { if (Display != null) { Display.Beep(); } } catch (Exception ex) { #if LOG4NET _Logger.Error("OnMessageTextViewMessageHighlighted(): Exception", ex); #endif } } if (MessageHighlighted != null) { MessageHighlighted(this, new ChatViewMessageHighlightedEventArgs(e.Message)); } } } protected virtual void OnMessageTextViewPopulatePopup(object sender, Gtk.PopulatePopupArgs e) { Trace.Call(sender, e); if (OutputMessageTextView.IsAtUrlTag) { return; } Gtk.Menu popup = e.Menu; // hide menu bar item as it uses the app menu on OS X if (!Frontend.IsMacOSX) { popup.Prepend(new Gtk.SeparatorMenuItem()); var item = new Gtk.CheckMenuItem(_("Show _Menubar")); item.Active = Frontend.MainWindow.ShowMenuBar; item.Activated += delegate { try { Frontend.MainWindow.ShowMenuBar = !Frontend.MainWindow.ShowMenuBar; } catch (Exception ex) { Frontend.ShowException(ex); } }; popup.Prepend(item); } popup.ShowAll(); } protected virtual void OnMessageTextViewPersonClicked(object sender, MessageTextViewPersonClickedEventArgs e) { Trace.Call(sender, e); var entry = Frontend.MainWindow.Entry; var text = entry.Text; var match = Regex.Match(text, "^[^ ]+: "); if (match.Success) { // removing existing nick text = text.Substring(match.Length); } text = String.Format("{0}: {1}", e.IdentityName, text); entry.Text = text; entry.HasFocus = true; } protected virtual void OnLastSeenHighlightQueueExceptionEvent(object sender, TaskQueueExceptionEventArgs e) { Trace.Call(sender, e); #if LOG4NET _Logger.Error("Exception in TaskQueue: ", e.Exception); _Logger.Error("Inner-Exception: ", e.Exception.InnerException); #endif Frontend.ShowException(e.Exception); } protected virtual void OnLastSeenHighlightQueueAbortedEvent(object sender, EventArgs e) { Trace.Call(sender, e); #if LOG4NET _Logger.Debug("OnLastSeenHighlightQueueAbortedEvent(): task queue aborted!"); #endif } protected virtual void OnStatusChanged(EventArgs e) { if (StatusChanged != null) { StatusChanged(this, e); } } void OnVadjustmentValueChanged(object sender, EventArgs e) { CheckAutoScroll(); } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } public class ChatViewMessageHighlightedEventArgs : EventArgs { public MessageModel Message { get; set; } public ChatViewMessageHighlightedEventArgs(MessageModel msg) { Message = msg; } } } smuxi-0.11/src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs0000644000175000017500000003674412300201464024537 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006, 2009-2014 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Net; using System.Net.Security; using System.Web; using System.Linq; using System.Text.RegularExpressions; using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Collections.Generic; using SysPath = System.IO.Path; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend.Gnome { [ChatViewInfo(ChatType = ChatType.Protocol)] public class ProtocolChatView : ChatView { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public static Gdk.Pixbuf IconPixbuf { get; private set; } static Dictionary NetworkWebsiteUrls { get; set; } ProxySettings ProxySettings { get; set; } Gdk.Pixbuf ServerIconPixbuf { get; set; } public string Host { get; private set; } public int Port { get; private set; } public string NetworkID { get; private set; } Gtk.ImageMenuItem ReconnectItem { get; set; } protected override Gtk.Image DefaultTabImage { get { var icon = IconPixbuf; if (ServerIconPixbuf != null) { icon = ServerIconPixbuf; } return new Gtk.Image(icon); } } static ProtocolChatView() { IconPixbuf = Frontend.LoadIcon( "smuxi-protocol-chat", 16, "protocol-chat_256x256.png" ); NetworkWebsiteUrls = new Dictionary( StringComparer.InvariantCultureIgnoreCase ); // IRC NetworkWebsiteUrls.Add("OFTC", "http://www.oftc.net/"); NetworkWebsiteUrls.Add("freenode", "http://freenode.net/"); NetworkWebsiteUrls.Add("QuakeNet", "http://www.quakenet.org/"); NetworkWebsiteUrls.Add("IRCnet", "http://www.ircnet.org/"); NetworkWebsiteUrls.Add("DALnet", "http://www.dal.net/"); NetworkWebsiteUrls.Add("GameSurge", "https://gamesurge.net/"); NetworkWebsiteUrls.Add("EFnet", "http://www.efnet.org/"); NetworkWebsiteUrls.Add("GIMPnet", "http://www.gimp.org/"); NetworkWebsiteUrls.Add("GSDnet", "http://www.gsd-software.net/"); NetworkWebsiteUrls.Add("ustream", "http://www.ustream.tv/"); NetworkWebsiteUrls.Add("Infinity-IRC", "http://www.infinityirc.com/"); NetworkWebsiteUrls.Add("GeekShed", "http://www.geekshed.net/"); // Twitter NetworkWebsiteUrls.Add("Twitter", "http://www.twitter.com/"); // XMPP - with federation NetworkWebsiteUrls.Add("XMPP", "http://xmpp.org/"); NetworkWebsiteUrls.Add("jabber.org", "http://planet.jabber.org/"); NetworkWebsiteUrls.Add("jabber.de", "http://www.jabber.de/"); NetworkWebsiteUrls.Add("jabber.at", "http://planet.jabber.org/"); NetworkWebsiteUrls.Add("jabber.ccc.de", "http://web.jabber.ccc.de/"); NetworkWebsiteUrls.Add("xmpp-gmx.gmx.net", "http://planet.jabber.org/"); NetworkWebsiteUrls.Add("xmpp-webde.gmx.net", "http://planet.jabber.org/"); NetworkWebsiteUrls.Add("jabber.gmx.net", "http://planet.jabber.org/"); // XMPP - without federation NetworkWebsiteUrls.Add("talk.google.com", "http://www.google.com/talk/"); NetworkWebsiteUrls.Add("chat.facebook.com", "http://www.facebook.com/"); // JabbR NetworkWebsiteUrls.Add("jabbr.net", "http://jabbr.net/"); // Campfire NetworkWebsiteUrls.Add("Campfire", "http://campfirenow.com"); // support downloading favicons via https var whitelist = Session.CertificateValidator.HostnameWhitelist; lock (whitelist) { foreach (var url in NetworkWebsiteUrls.Values) { var uri = new Uri(url); var hostname = uri.Host; if (whitelist.Contains(hostname)) { continue; } whitelist.Add(hostname); } } } public ProtocolChatView(ChatModel chat) : base(chat) { Trace.Call(chat); ProxySettings = new ProxySettings(); Add(OutputScrolledWindow); ReconnectItem = new Gtk.ImageMenuItem(_("Reconnect")); ReconnectItem.Image = new Gtk.Image(Gtk.Stock.Refresh, Gtk.IconSize.Menu); ReconnectItem.Activated += new EventHandler(OnTabMenuReconnectActivated); ShowAll(); } protected ProtocolChatView(IntPtr handle) : base(handle) { } public override void Sync() { Trace.Call(); base.Sync(); Host = ProtocolManager.Host; Port = ProtocolManager.Port; NetworkID = ProtocolManager.NetworkID; try { CheckIcon(); } catch (Exception ex) { #if LOG4NET f_Logger.Error("Sync(): CheckIcon() threw exception!", ex); #endif } } public override void Close() { Trace.Call(); // show warning if there are open chats (besides protocol chat) var ownedChats = 0; foreach (var chatView in Frontend.MainWindow.ChatViewManager.Chats) { if (chatView.ProtocolManager == ProtocolManager) { ownedChats++; } } if (ownedChats > 1) { Gtk.MessageDialog md = new Gtk.MessageDialog( Frontend.MainWindow, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.YesNo, _("Closing the protocol chat will also close all open chats connected to it!\n"+ "Are you sure you want to do this?")); int result = md.Run(); md.Destroy(); if ((Gtk.ResponseType) result != Gtk.ResponseType.Yes) { return; } } ThreadPool.QueueUserWorkItem(delegate { try { // no need to call base.Close() as CommandNetwork() will // deal with it Frontend.Session.CommandNetwork( new CommandModel( Frontend.FrontendManager, ChatModel, "close" ) ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } public override void ApplyConfig(UserConfig config) { Trace.Call(config); if (config == null) { throw new ArgumentNullException("config"); } base.ApplyConfig(config); ProxySettings.ApplyConfig(config); } void CheckIcon() { Trace.Call(); var cachePath = Platform.CachePath; var iconPath = SysPath.Combine(cachePath, "server-icons"); // REMOTING CALL var protocol = ProtocolManager.Protocol; iconPath = SysPath.Combine(iconPath, protocol); if (!Directory.Exists(iconPath)) { Directory.CreateDirectory(iconPath); } iconPath = SysPath.Combine(iconPath, String.Format("{0}.ico", ID)); var iconFile = new FileInfo(iconPath); if (iconFile.Exists && iconFile.Length > 0) { // cached icon, use right away UpdateServerIcon(iconPath); } string websiteUrl = null; lock (NetworkWebsiteUrls) { if (!NetworkWebsiteUrls.TryGetValue(ID, out websiteUrl) && !NetworkWebsiteUrls.TryGetValue(protocol, out websiteUrl)) { // unknown network and protocol, nothing to download return; } // download in background so Sync() doesn't get slowed down ThreadPool.QueueUserWorkItem(delegate { try { DownloadServerIcon(websiteUrl, iconFile); iconFile.Refresh(); if (!iconFile.Exists || iconFile.Length == 0) { return; } UpdateServerIcon(iconPath); } catch (Exception ex) { #if LOG4NET f_Logger.Error("CheckIcon(): Exception", ex); #endif } }); } } void DownloadServerIcon(string websiteUrl, FileInfo iconFile) { Trace.Call(websiteUrl, iconFile); var webClient = new WebClient(); // ignore proxy settings of remote engines WebProxy proxy = null; if (Frontend.IsLocalEngine) { proxy = ProxySettings.GetWebProxy(websiteUrl); if (proxy == null) { // HACK: WebClient will always use the system proxy if set to // null so explicitely override this by setting an empty proxy proxy = new WebProxy(); } webClient.Proxy = proxy; } var content = webClient.DownloadString(websiteUrl); var links = new List>(); foreach (Match linkMatch in Regex.Matches(content, @"]*?)/?>")) { var attributes = new Dictionary(); foreach (Match attrMatch in Regex.Matches(linkMatch.Value, @"([\w]+)[\s]*=[\s]*[""']([^""']*)[""'][\s]*")) { var key = attrMatch.Groups[1].Value; var value = attrMatch.Groups[2].Value; attributes.Add(key, value); } links.Add(attributes); } string faviconRel = null; foreach (var link in links) { var iconLink = false; foreach (var attribute in link) { if (attribute.Key != "rel" || !attribute.Value.Split(' ').Contains("icon")) { continue; } iconLink = true; break; } if (!iconLink) { continue; } foreach (var attribute in link) { if (attribute.Key != "href") { continue; } // yay, we have found the favicon in all this junk faviconRel = attribute.Value; break; } } string faviconUrl = null; if (String.IsNullOrEmpty(faviconRel)) { faviconRel = "/favicon.ico"; } faviconUrl = new Uri(new Uri(websiteUrl), faviconRel).ToString(); #if LOG4NET f_Logger.DebugFormat("DownloadServerIcon(): favicon URL: {0}", faviconUrl); #endif var iconRequest = WebRequest.Create(faviconUrl); // ignore proxy settings of remote engines if (Frontend.IsLocalEngine) { iconRequest.Proxy = proxy; } if (iconRequest is HttpWebRequest) { var iconHttpRequest = (HttpWebRequest) iconRequest; if (iconFile.Exists) { iconHttpRequest.IfModifiedSince = iconFile.LastWriteTime; } } WebResponse iconResponse; try { iconResponse = iconRequest.GetResponse(); } catch (WebException ex) { if (ex.Response is HttpWebResponse) { var iconHttpResponse = (HttpWebResponse) ex.Response; if (iconHttpResponse.StatusCode == HttpStatusCode.NotModified) { // icon hasn't changed, nothing to do return; } } throw; } // save new or modified icon file using (var iconStream = iconFile.OpenWrite()) using (var httpStream = iconResponse.GetResponseStream()) { byte[] buffer = new byte[4096]; int read; while ((read = httpStream.Read(buffer, 0, buffer.Length)) > 0) { iconStream.Write(buffer, 0, read); } } } void UpdateServerIcon(string iconPath) { Trace.Call(iconPath); ServerIconPixbuf = new Gdk.Pixbuf(iconPath, 16, 16); GLib.Idle.Add(delegate { TabImage.Pixbuf = ServerIconPixbuf; OnStatusChanged(EventArgs.Empty); return false; }); } protected override void OnTabMenuShown(object sender, EventArgs e) { Trace.Call(sender, e); base.OnTabMenuShown(sender, e); TabMenu.Prepend(ReconnectItem); TabMenu.ShowAll(); } protected virtual void OnTabMenuReconnectActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { var pm = ProtocolManager; if (pm == null) { return; } ThreadPool.QueueUserWorkItem(delegate { try { pm.Reconnect(Frontend.FrontendManager); } catch (Exception ex) { Frontend.ShowException(ex); } }); } catch (Exception ex) { Frontend.ShowException(ex); } } static bool ValidateCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { if (sslPolicyErrors == SslPolicyErrors.None) { return true; } #if LOG4NET f_Logger.Warn( "ValidateCertificate(): Certificate error: " + sslPolicyErrors ); #endif return true; } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/Views/MessageTextView.cs0000644000175000017500000010017412274103742023324 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2009-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Text.RegularExpressions; using System.Threading; using System.Collections.Generic; using System.Globalization; using SysDiag = System.Diagnostics; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public class MessageTextView : Gtk.TextView { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly Gdk.Cursor _NormalCursor = new Gdk.Cursor(Gdk.CursorType.Xterm); private static readonly Gdk.Cursor _LinkCursor = new Gdk.Cursor(Gdk.CursorType.Hand2); static readonly Regex NickRegex = new Regex("^(<([^ ]+)> )"); static bool IsGtk2_17 { get; set; } private Gtk.TextTagTable _MessageTextTagTable; private MessageModel _LastMessage; private bool _ShowTimestamps; private bool _ShowHighlight; private bool _ShowMarkerline; private bool _AtLinkTag; private Uri _ActiveLink; private ThemeSettings _ThemeSettings; private Gdk.Color _MarkerlineColor = new Gdk.Color(255, 0, 0); private int _MarkerlineBufferPosition; private int _BufferLines = -1; Gtk.TextTag BoldTag { get; set; } Gtk.TextTag ItalicTag { get; set; } Gtk.TextTag UnderlineTag { get; set; } Gtk.TextTag LinkTag { get; set; } Gtk.TextTag EventTag { get; set; } Gtk.TextTag PersonTag { get; set; } bool AtPersonTag { get; set; } public event MessageTextViewMessageAddedEventHandler MessageAdded; public event MessageTextViewMessageHighlightedEventHandler MessageHighlighted; public event EventHandler PersonClicked; public int MarkerlineBufferPosition { get { return _MarkerlineBufferPosition; } set { _MarkerlineBufferPosition = value; } } public bool ShowTimestamps { get { return _ShowTimestamps; } set { _ShowTimestamps = value; } } public bool ShowHighlight { get { return _ShowHighlight; } set { _ShowHighlight = value; } } public bool ShowMarkerline { get { return _ShowMarkerline; } set { _ShowMarkerline = value; } } public bool HasTextViewSelection { get { #if GTK_SHARP_2_10 return Buffer.HasSelection; #else Gtk.TextIter start, end; Buffer.GetSelectionBounds(out start, out end); return start.Offset != end.Offset; #endif } } public Gtk.TextTagTable MessageTextTagTable { get { return _MessageTextTagTable; } } public bool IsEmpty { get { return Buffer.CharCount == 0; } } public bool IsAtUrlTag { get { return _AtLinkTag; } } public MessageModel LastMessage { get { return _LastMessage; } } Gdk.Color BackgroundColor { get { if (_ThemeSettings.BackgroundColor == null) { return DefaultAttributes.Appearance.BgColor; } return _ThemeSettings.BackgroundColor.Value; } } static MessageTextView() { IsGtk2_17 = String.IsNullOrEmpty(Gtk.Global.CheckVersion(2, 17, 0)) && !String.IsNullOrEmpty(Gtk.Global.CheckVersion(2, 18, 0)); } public MessageTextView() { Trace.Call(); _MessageTextTagTable = BuildTagTable(); _ThemeSettings = new ThemeSettings(); Buffer = new Gtk.TextBuffer(_MessageTextTagTable); MotionNotifyEvent += OnMotionNotifyEvent; PopulatePopup += OnPopulatePopup; ExposeEvent += OnExposeEvent; Realized += delegate { CheckStyle(); }; StyleSet += delegate(object o, Gtk.StyleSetArgs args) { if (!IsRealized) { // HACK: avoid GTK+ crash in gtk_text_attributes_copy_values() return; } CheckStyle(); }; } public void ApplyConfig(UserConfig config) { _ThemeSettings = new ThemeSettings(config); if (_ThemeSettings.BackgroundColor == null) { ModifyBase(Gtk.StateType.Normal); } else { ModifyBase(Gtk.StateType.Normal, _ThemeSettings.BackgroundColor.Value); } if (_ThemeSettings.ForegroundColor == null) { ModifyText(Gtk.StateType.Normal); } else { ModifyText(Gtk.StateType.Normal, _ThemeSettings.ForegroundColor.Value); } ModifyFont(_ThemeSettings.FontDescription); string wrapModeStr = (string) config["Interface/Chat/WrapMode"]; if (!String.IsNullOrEmpty(wrapModeStr)) { Gtk.WrapMode wrapMode = (Gtk.WrapMode) Enum.Parse( typeof(Gtk.WrapMode), wrapModeStr ); if (wrapMode == Gtk.WrapMode.Word) { wrapMode = Gtk.WrapMode.WordChar; } WrapMode = wrapMode; } _BufferLines = (int) config["Interface/Notebook/BufferLines"]; } void CheckStyle() { Trace.Call(); var bgTextColor = ColorConverter.GetTextColor(BackgroundColor); // get best contrast for the event font color Gdk.Color eventColor = Gdk.Color.Zero; Gdk.Color.Parse("darkgray", ref eventColor); var eventTextColor = TextColorTools.GetBestTextColor( ColorConverter.GetTextColor(eventColor), bgTextColor, TextColorContrast.High ); EventTag.ForegroundGdk = ColorConverter.GetGdkColor( eventTextColor ); // get best contrast for the link font color Gdk.Color linkColor = Gdk.Color.Zero; Gdk.Color.Parse("darkblue", ref linkColor); var linkTextColor = TextColorTools.GetBestTextColor( ColorConverter.GetTextColor(linkColor), bgTextColor ); LinkTag.ForegroundGdk = ColorConverter.GetGdkColor( linkTextColor ); } public void Clear() { Trace.Call(); Buffer.Clear(); } public void AddMessage(MessageModel msg) { AddMessage(msg, true); } public void AddMessage(MessageModel msg, bool addLinebreak) { AddMessage(msg, addLinebreak, _ShowTimestamps); } public void AddMessage(MessageModel msg, bool addLinebreak, bool showTimestamps) { #if MSG_DEBUG Trace.Call(msg, addLinebreak); #endif if (msg == null) { throw new ArgumentNullException("msg"); } var buffer = Buffer; var iter = buffer.EndIter; var startMark = new Gtk.TextMark(null, true); buffer.AddMark(startMark, iter); var senderPrefixWidth = GetSenderPrefixWidth(msg); Gtk.TextTag indentTag = null; if (senderPrefixWidth != 0) { // TODO: re-use text tags that have the same indent width indentTag = new Gtk.TextTag(null) { Indent = -senderPrefixWidth }; _MessageTextTagTable.Add(indentTag); } if (showTimestamps) { var msgTimeStamp = msg.TimeStamp.ToLocalTime(); if (_LastMessage != null) { var lastMsgTimeStamp = _LastMessage.TimeStamp.ToLocalTime(); var span = msgTimeStamp.Date - lastMsgTimeStamp.Date; if (span.Days > 0) { var dayLine = new MessageBuilder(). AppendEventPrefix(); if (span.Days > 1) { dayLine.AppendText(_("Day changed from {0} to {1}"), lastMsgTimeStamp.ToShortDateString(), msgTimeStamp.ToShortDateString()); } else { dayLine.AppendText(_("Day changed to {0}"), msgTimeStamp.ToLongDateString()); } dayLine.AppendText("\n"); var dayLineMsg = dayLine.ToMessage().ToString(); Buffer.InsertWithTags(ref iter, dayLineMsg, EventTag); } } string timestamp = null; try { string format = (string)Frontend.UserConfig["Interface/Notebook/TimestampFormat"]; if (!String.IsNullOrEmpty(format)) { timestamp = msgTimeStamp.ToString(format); } } catch (FormatException e) { timestamp = "Timestamp Format ERROR: " + e.Message; } if (timestamp != null) { timestamp = String.Format("{0} ", timestamp); buffer.Insert(ref iter, timestamp); // apply timestamp width to indent tag if (indentTag != null) { indentTag.Indent -= GetPangoWidth(timestamp); } } } var msgStartMark = new Gtk.TextMark(null, true); buffer.AddMark(msgStartMark, iter); bool hasHighlight = false; foreach (MessagePartModel msgPart in msg.MessageParts) { // supposed to be used only in a ChatView if (msgPart.IsHighlight) { hasHighlight = true; } // TODO: implement all types if (msgPart is UrlMessagePartModel) { var urlPart = (UrlMessagePartModel) msgPart; var linkText = urlPart.Text ?? urlPart.Url; Uri uri; try { uri = new Uri(urlPart.Url); } catch (UriFormatException ex) { #if LOG4NET _Logger.Error("AddMessage(): Invalid URL: " + urlPart.Url, ex); #endif buffer.Insert(ref iter, linkText); continue; } var tags = new List(); // link URI tag var linkTag = new LinkTag(uri); linkTag.TextEvent += OnLinkTagTextEvent; _MessageTextTagTable.Add(linkTag); tags.Add(linkTag); // link style tag tags.Add(LinkTag); buffer.InsertWithTags(ref iter, linkText, tags.ToArray()); } else if (msgPart is TextMessagePartModel) { var tags = new List(); TextMessagePartModel fmsgti = (TextMessagePartModel) msgPart; if (fmsgti.ForegroundColor != TextColor.None) { var bg = ColorConverter.GetTextColor(BackgroundColor); if (fmsgti.BackgroundColor != TextColor.None) { bg = fmsgti.BackgroundColor; } TextColor color = TextColorTools.GetBestTextColor( fmsgti.ForegroundColor, bg ); string tagname = GetTextTagName(color, null); var tag = _MessageTextTagTable.Lookup(tagname); tags.Add(tag); } if (fmsgti.BackgroundColor != TextColor.None) { // TODO: get this from ChatView string tagname = GetTextTagName(null, fmsgti.BackgroundColor); var tag = _MessageTextTagTable.Lookup(tagname); tags.Add(tag); } if (fmsgti.Underline) { #if LOG4NET && MSG_DEBUG _Logger.Debug("AddMessage(): fmsgti.Underline is true"); #endif tags.Add(UnderlineTag); } if (fmsgti.Bold) { #if LOG4NET && MSG_DEBUG _Logger.Debug("AddMessage(): fmsgti.Bold is true"); #endif tags.Add(BoldTag); } if (fmsgti.Italic) { #if LOG4NET && MSG_DEBUG _Logger.Debug("AddMessage(): fmsgti.Italic is true"); #endif tags.Add(ItalicTag); } if (tags.Count > 0) { buffer.InsertWithTags(ref iter, fmsgti.Text, tags.ToArray()); } else { buffer.Insert(ref iter, fmsgti.Text); } } } var startIter = buffer.GetIterAtMark(startMark); if (msg.MessageType == MessageType.Event) { buffer.ApplyTag(EventTag, startIter, iter); } if (indentTag != null) { buffer.ApplyTag(indentTag, startIter, iter); } var nick = msg.GetNick(); if (nick != null) { // TODO: re-use the same person tag for the same nick var personTag = new PersonTag(nick, nick); personTag.TextEvent += OnPersonTagTextEvent; _MessageTextTagTable.Add(personTag); var msgStartIter = buffer.GetIterAtMark(msgStartMark); var nickEndIter = msgStartIter; nickEndIter.ForwardChars(nick.Length + 2); buffer.ApplyTag(PersonTag, msgStartIter, nickEndIter); buffer.ApplyTag(personTag, msgStartIter, nickEndIter); } buffer.DeleteMark(startMark); buffer.DeleteMark(msgStartMark); if (addLinebreak) { buffer.Insert(ref iter, "\n"); } CheckBufferSize(); if (IsGtk2_17) { // HACK: force a redraw of the widget, as for some reason // GTK+ 2.17.6 is not redrawing some lines we add here, especially // for local messages. See: // http://projects.qnetp.net/issues/show/185 QueueDraw(); } if (Frontend.IsWindows && _LastMessage == null) { // HACK: workaround rendering issue on Windows where the // first inserted text is not showing up until the next insert QueueDraw(); } if (MessageAdded != null) { MessageAdded(this, new MessageTextViewMessageAddedEventArgs(msg)); } if (hasHighlight) { if (MessageHighlighted != null) { MessageHighlighted(this, new MessageTextViewMessageHighlightedEventArgs(msg)); } } _LastMessage = msg; } public void UpdateMarkerline() { Trace.Call(); if (IsEmpty) { return; } _MarkerlineBufferPosition = Buffer.EndIter.Offset - 1; QueueDraw(); } public override void Dispose() { // HACK: this shouldn't be needed but GTK# keeps GC handles // these callbacks for some reason and thus leaks :( _MessageTextTagTable.Foreach(tag => { if (tag is LinkTag) { tag.TextEvent -= OnLinkTagTextEvent; } else if (tag is PersonTag) { tag.TextEvent -= OnPersonTagTextEvent; } }); _MessageTextTagTable.Dispose(); base.Dispose(); } /* * Helper methods */ private Gtk.TextTagTable BuildTagTable() { // TextTags Gtk.TextTagTable ttt = new Gtk.TextTagTable(); Gtk.TextTag tt; Pango.FontDescription fd; // WARNING: the insertion order of tags MATTERS! // The attributes of the text tags are applied in the order of // insertion to the text table, and not in which order the tags // applied in the buffer. This is sick IMHO. tt = new Gtk.TextTag("bold"); fd = new Pango.FontDescription(); fd.Weight = Pango.Weight.Bold; tt.FontDesc = fd; BoldTag = tt; ttt.Add(tt); tt = new Gtk.TextTag("italic"); fd = new Pango.FontDescription(); fd.Style = Pango.Style.Italic; tt.FontDesc = fd; ItalicTag = tt; ttt.Add(tt); tt = new Gtk.TextTag("underline"); tt.Underline = Pango.Underline.Single; UnderlineTag = tt; ttt.Add(tt); tt = new Gtk.TextTag("event"); tt.Foreground = "darkgray"; EventTag = tt; ttt.Add(tt); tt = new Gtk.TextTag("link"); tt.Underline = Pango.Underline.Single; tt.Foreground = "darkblue"; LinkTag = tt; ttt.Add(tt); tt = new Gtk.TextTag("person"); PersonTag = tt; ttt.Add(tt); return ttt; } protected virtual void OnMotionNotifyEvent(object sender, Gtk.MotionNotifyEventArgs e) { // GDK is ugly! Gdk.ModifierType modifierType; int windowX, windowY; int bufferX, bufferY; // get the window position of the mouse GdkWindow.GetPointer(out windowX, out windowY, out modifierType); // get buffer position with the window position WindowToBufferCoords(Gtk.TextWindowType.Widget, windowX, windowY, out bufferX, out bufferY); // get TextIter with buffer position Gtk.TextIter iter = GetIterAtLocation(bufferX, bufferY); bool atUrlTag = false; bool atPersonTag = false; foreach (Gtk.TextTag tag in iter.Tags) { if (tag.Name == "link") { atUrlTag = true; break; } if (tag.Name == "person") { atPersonTag = true; break; } } Gdk.Window window = GetWindow(Gtk.TextWindowType.Text); if (atUrlTag != _AtLinkTag) { _AtLinkTag = atUrlTag; if (atUrlTag) { #if LOG4NET _Logger.Debug("OnMotionNotifyEvent(): at url tag"); #endif window.Cursor = _LinkCursor; } else { #if LOG4NET _Logger.Debug("OnMotionNotifyEvent(): not at url tag"); #endif window.Cursor = _NormalCursor; _ActiveLink = null; } } if (atPersonTag != AtPersonTag) { AtPersonTag = atPersonTag; if (atPersonTag) { #if LOG4NET _Logger.Debug("OnMotionNotifyEvent(): at person tag"); #endif window.Cursor = _LinkCursor; } else { #if LOG4NET _Logger.Debug("OnMotionNotifyEvent(): not at person tag"); #endif window.Cursor = _NormalCursor; } } } protected virtual void OnLinkTagTextEvent(object sender, Gtk.TextEventArgs e) { // logging noise //Trace.Call(sender, e); // if something in the textview is selected, bail out if (HasTextViewSelection) { #if LOG4NET _Logger.Debug("OnLinkTagTextEvent(): active selection present, bailing out..."); #endif return; } var tag = (LinkTag) sender; _ActiveLink = tag.Link; if (e.Event.Type != Gdk.EventType.ButtonRelease) { return; } if (_ActiveLink == null) { #if LOG4NET _Logger.Warn("OnLinkTagTextEvent(): _ActiveLink is null, ignoring..."); #endif return; } Frontend.OpenLink(_ActiveLink); } protected virtual void OnPersonTagTextEvent(object sender, Gtk.TextEventArgs e) { // logging noise //Trace.Call(sender, e); // if something in the textview is selected, bail out if (HasTextViewSelection) { #if LOG4NET _Logger.Debug("OnPersonTagTextEvent(): active selection present, bailing out..."); #endif return; } var tag = (PersonTag) sender; if (tag == null) { return; } if (e.Event.Type != Gdk.EventType.ButtonPress) { return; } if (PersonClicked != null) { PersonClicked( this, new MessageTextViewPersonClickedEventArgs(tag.IdentityName) ); } } protected virtual void OnPopulatePopup(object sender, Gtk.PopulatePopupArgs e) { Trace.Call(sender, e); if (!_AtLinkTag) { return; } Gtk.Menu popup = e.Menu; // remove all items foreach (Gtk.Widget children in popup.Children) { popup.Remove(children); } Gtk.ImageMenuItem open_item = new Gtk.ImageMenuItem(Gtk.Stock.Open, null); open_item.Activated += delegate { if (_ActiveLink != null) { Frontend.OpenLink(_ActiveLink); } }; popup.Append(open_item); Gtk.ImageMenuItem copy_item = new Gtk.ImageMenuItem(Gtk.Stock.Copy, null); copy_item.Activated += delegate { if (_ActiveLink == null) { return; } Gdk.Atom clipboardAtom = Gdk.Atom.Intern("CLIPBOARD", false); Gtk.Clipboard clipboard = Gtk.Clipboard.Get(clipboardAtom); clipboard.Text = _ActiveLink.ToString(); }; popup.Append(copy_item); popup.ShowAll(); } private string GetTextTagName(TextColor fgColor, TextColor bgColor) { string hexcode; string tagname; if (fgColor != null) { hexcode = fgColor.HexCode; tagname = "fg_color:" + hexcode; } else if (bgColor != null) { hexcode = bgColor.HexCode; tagname = "bg_color:" + hexcode; } else { return null; } if (_MessageTextTagTable.Lookup(tagname) == null) { int red = Int16.Parse(hexcode.Substring(0, 2), NumberStyles.HexNumber); int green = Int16.Parse(hexcode.Substring(2, 2), NumberStyles.HexNumber); int blue = Int16.Parse(hexcode.Substring(4, 2), NumberStyles.HexNumber); Gdk.Color c = new Gdk.Color((byte)red, (byte)green, (byte)blue); Gtk.TextTag tt = new Gtk.TextTag(tagname); if (fgColor != null) { tt.ForegroundGdk = c; } else if (bgColor != null) { tt.BackgroundGdk = c; } _MessageTextTagTable.Add(tt); } return tagname; } void OnExposeEvent(object sender, Gtk.ExposeEventArgs e) { if (!_ShowMarkerline || _MarkerlineBufferPosition == 0) { return; } var window = e.Event.Window; var gc = new Gdk.GC(window); gc.RgbFgColor = _MarkerlineColor; var iter = Buffer.GetIterAtOffset(_MarkerlineBufferPosition); var location = GetIterLocation(iter); int last_y = location.Y + location.Height; // padding last_y += PixelsAboveLines + PixelsBelowLines / 2; int x, y; BufferToWindowCoords(Gtk.TextWindowType.Text, 0, last_y, out x, out y); if (y < e.Event.Area.Y) { return; } window.DrawLine(gc, 0, y, VisibleRect.Width, y); } void CheckBufferSize() { if (_BufferLines == -1) { // no limit defined return; } var buffer = Buffer; if (buffer.LineCount > _BufferLines) { Gtk.TextIter start_iter = buffer.StartIter; // TODO: maybe we should delete chunks instead of each line Gtk.TextIter end_iter = buffer.GetIterAtLine(buffer.LineCount - _BufferLines); int offset = end_iter.Offset; // release tags var toggled_tags = new List(16); var start_tags = start_iter.GetToggledTags(true); toggled_tags.AddRange(start_tags); var tag_iter = start_iter; while (tag_iter.ForwardToTagToggle(null)) { if (tag_iter.Compare(end_iter) >= 0) { // tag is after line end break; } var iter_tags = tag_iter.GetToggledTags(true); toggled_tags.AddRange(iter_tags); } foreach (var tag in toggled_tags) { // don't remove color tags as they are shared wither other lines var tagName = tag.Name; if (tagName != null && (tagName.StartsWith("fg_color:") || tagName.StartsWith("bg_color:"))) { continue; } if (tag.IndentSet || tag is LinkTag || tag is PersonTag) { buffer.RemoveTag(tag, start_iter, end_iter); _MessageTextTagTable.Remove(tag); tag.Dispose(); } } buffer.Delete(ref start_iter, ref end_iter); // update markerline offset if present if (_MarkerlineBufferPosition != 0) { _MarkerlineBufferPosition -= offset; // remove markerline if it went out of buffer if (_MarkerlineBufferPosition < 0) { _MarkerlineBufferPosition = 0; } } } } int GetSenderPrefixWidth(MessageModel msg) { // HACK: try to obtain the nickname from the message // TODO: extend MessageModel with Origin property var msgText = msg.ToString(); var nickMatch = NickRegex.Match(msgText); if (nickMatch.Success) { // HACK: the nick can be bold if (msg.MessageParts.Count >= 3) { // possibly colored nick, see MessageBuilder.CreateNick() var prefixPart = msg.MessageParts[0]; var nickPart = msg.MessageParts[1]; var suffixPart = msg.MessageParts[2]; if (prefixPart.ToString() == "<" && nickPart is TextMessagePartModel && suffixPart.ToString().StartsWith(">")) { // colored nick var nickTextPart = (TextMessagePartModel) nickPart; if (nickTextPart.Bold) { return GetPangoWidth( String.Format( "{0}{1}{2} ", GLib.Markup.EscapeText("<"), GLib.Markup.EscapeText( nickMatch.Groups[2].Value ), GLib.Markup.EscapeText(">") ), true ); } } } return GetPangoWidth(nickMatch.Groups[1].Value, false); } else { if (msgText.StartsWith("-!- ")) { return GetPangoWidth("-!- ", false); } } return 0; } int GetPangoWidth(string text) { return GetPangoWidth(text, false); } int GetPangoWidth(string text, bool isMarkup) { int width, heigth; using (var layout = CreatePangoLayout(null)) { if (isMarkup) { layout.SetMarkup(text); } else { layout.SetText(text); } layout.GetPixelSize(out width, out heigth); } return width; } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } public delegate void MessageTextViewMessageAddedEventHandler(object sender, MessageTextViewMessageAddedEventArgs e); public class MessageTextViewMessageAddedEventArgs : EventArgs { private MessageModel f_Message; public MessageModel Message { get { return f_Message; } } public MessageTextViewMessageAddedEventArgs(MessageModel message) { f_Message = message; } } public delegate void MessageTextViewMessageHighlightedEventHandler(object sender, MessageTextViewMessageHighlightedEventArgs e); public class MessageTextViewMessageHighlightedEventArgs : EventArgs { private MessageModel f_Message; public MessageModel Message { get { return f_Message; } } public MessageTextViewMessageHighlightedEventArgs(MessageModel message) { f_Message = message; } } public class MessageTextViewPersonClickedEventArgs : EventArgs { public string IdentityName { get; private set; } public MessageTextViewPersonClickedEventArgs(string identityName) { IdentityName = identityName; } } } smuxi-0.11/src/Frontend-GNOME/Views/JoinWidget.cs0000644000175000017500000001625212250426634022310 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2012-2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; using System.Runtime.InteropServices; namespace Smuxi.Frontend.Gnome { [System.ComponentModel.ToolboxItem(true)] public partial class JoinWidget : Gtk.Bin { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private const string ActiveNetworkConfigKey = "GNOME/JoinBar/ActiveNetwork"; public EventHandler Activated; public new bool HasFocus { get { return f_ChatEntry.HasFocus; } set { f_ChatEntry.HasFocus = value; } } public string ActiveNetwork { get { return f_NetworkComboBox.ActiveText; } set { var store = (Gtk.ListStore) f_NetworkComboBox.Model; var idx = 0; foreach (object[] row in store) { if ((string) row[0] == value) { f_NetworkComboBox.Active = idx; break; } idx++; } } } [DllImport("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void gtk_entry_set_icon_from_pixbuf(IntPtr entry, int pos, IntPtr pixbuf); // Since: 2.16 // void gtk_entry_set_icon_tooltip_text(GtkEntry *entry, GtkEntryIconPosition icon_pos, const gchar *tooltip) [DllImport("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void gtk_entry_set_icon_tooltip_text(IntPtr entry, int pos, IntPtr tooltip); // Since: 3.2 // void gtk_entry_set_placeholder_text (GtkEntry *entry, const gchar *text) [DllImport("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void gtk_entry_set_placeholder_text(IntPtr entry, string text); public JoinWidget() { Build(); try { gtk_entry_set_icon_from_pixbuf(f_ChatEntry.Handle, 0, GroupChatView.IconPixbuf.Handle); } catch (Exception ex) { #if LOG4NET f_Logger.Error("JoinWidget(): gtk_entry_set_icon_from_pixbuf() failed!", ex); #endif } try { var text = _("Enter which chat to join"); IntPtr textPtr = GLib.Marshaller.StringToPtrGStrdup(text); gtk_entry_set_icon_tooltip_text(f_ChatEntry.Handle, 0, textPtr); GLib.Marshaller.Free(textPtr); } catch (Exception ex) { #if LOG4NET f_Logger.Error("JoinWidget(): gtk_entry_set_icon_tooltip_text() failed!", ex); #endif } try { //gtk_entry_set_placeholder_text(f_ChatEntry.Handle, "Enter chat name..."); } catch (Exception ex) { #if LOG4NET f_Logger.Error("JoinWidget(): gtk_entry_set_placeholder_text() failed!", ex); #endif } f_ChatEntry.Activated += delegate { OnActivated(EventArgs.Empty); }; f_ChatEntry.KeyPressEvent += OnChatEntryKeyPressEvent; f_JoinButton.Clicked += delegate { OnActivated(EventArgs.Empty); }; } public void InitNetworks(IList networks) { Trace.Call(networks); if (networks == null) { throw new ArgumentNullException("networks"); } f_NetworkComboBox.Clear(); var cell = new Gtk.CellRendererText(); f_NetworkComboBox.PackStart(cell, false); f_NetworkComboBox.AddAttribute(cell, "text", 0); Gtk.ListStore store = new Gtk.ListStore(typeof(string)); foreach (string network in networks) { if (String.IsNullOrEmpty(network)) { continue; } store.AppendValues(network); } store.SetSortColumnId(0, Gtk.SortType.Ascending); f_NetworkComboBox.Model = store; var activeNetwork = (string) Frontend.FrontendConfig[ActiveNetworkConfigKey]; if (String.IsNullOrEmpty(activeNetwork)) { f_NetworkComboBox.Active = 0; } else { ActiveNetwork = activeNetwork; } f_NetworkComboBox.Changed += (sender, e) => { Frontend.FrontendConfig[ActiveNetworkConfigKey] = ActiveNetwork; Frontend.FrontendConfig.Save(); }; } public void ApplyConfig(UserConfig config) { if (config == null) { throw new ArgumentNullException("config"); } var servers = new ServerListController(config); InitNetworks(servers.GetNetworks()); } public Uri GetChatLink() { return new Uri( String.Format("smuxi://{0}/{1}", f_NetworkComboBox.ActiveText, f_ChatEntry.Text) ); } public void Clear() { f_ChatEntry.Text = String.Empty; } protected virtual void OnActivated(EventArgs e) { if (Activated != null) { Activated(this, e); } } [GLib.ConnectBefore] protected void OnChatEntryKeyPressEvent(object o, Gtk.KeyPressEventArgs e) { var key = e.Event.Key; if ((e.Event.State & Gdk.ModifierType.ControlMask) != 0) { switch (key) { case Gdk.Key.x: case Gdk.Key.X: // ctrl + x is pressed e.RetVal = true; if (f_NetworkComboBox.Active == f_NetworkComboBox.Model.IterNChildren() - 1) { f_NetworkComboBox.Active = 0; } else { f_NetworkComboBox.Active++; } break; } } } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/Views/ServerWidget.cs0000644000175000017500000004333112300201464022641 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010-2014 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { [System.ComponentModel.ToolboxItem(true)] public partial class ServerWidget : Gtk.Bin { Gtk.ListStore f_NetworkListStore; string ServerID { get; set; } public Gtk.Entry HostnameEntry { get { return f_HostnameEntry; } } public Gtk.ComboBox ProtocolComboBox { get { return f_ProtocolComboBox; } } public string Protocol { set { Gtk.ListStore store = (Gtk.ListStore) ProtocolComboBox.Model; int protocolPosition = -1; int j = 0; foreach (object[] row in store) { string protocolName = (string) row[0]; if (protocolName == value) { protocolPosition = j; break; } j++; } if (protocolPosition == -1) { throw new ArgumentOutOfRangeException( "Unsupported protocol: " + value ); } f_ProtocolComboBox.Active = protocolPosition; } } public Gtk.ComboBoxEntry NetworkComboBoxEntry { get { return f_NetworkComboBoxEntry; } } public Gtk.Entry NicknameEntry { get { return f_NicknameEntry; } } public Gtk.Entry RealnameEntry { get { return f_RealnameEntry; } } public Gtk.CheckButton OnStartupConnectCheckButton { get { return f_OnStartupConnectCheckButton; } } public bool ShowHostname { set { f_HostnameLabel.Visible = value; f_HostnameEntry.Visible = value; f_PortLabel.Visible = value; f_PortSpinButton.Visible = value; } } public bool ShowNetwork { set { f_NetworkLabel.Visible = value; f_NetworkComboBoxEntry.Visible = value; } } public bool ShowNickname { set { // Smuxi < 0.11 does not support server specific nickname if (Frontend.EngineVersion < new Version(0, 11)) { value = false; } f_NicknameLabel.Visible = value; f_NicknameEntry.Visible = value; } } public bool ShowRealname { set { // Smuxi < 0.11 does not support server specific realname if (Frontend.EngineVersion < new Version(0, 11)) { value = false; } f_RealnameLabel.Visible = value; f_RealnameEntry.Visible = value; } } public bool ShowPassword { set { f_PasswordLabel.Visible = value; f_PasswordEntry.Visible = value; f_ShowPasswordCheckButton.Visible = value; } } public bool SupportUseEncryption { set { f_UseEncryptionCheckButton.Sensitive = value; f_ValidateServerCertificateCheckButton.Sensitive = value; if (!value) { f_UseEncryptionCheckButton.Active = false; f_ValidateServerCertificateCheckButton.Active = false; } CheckUseEncryptionCheckButton(); } } public ServerWidget() { Trace.Call(); f_NetworkListStore = new Gtk.ListStore(typeof(string)); Build(); Init(); } public void Load(ServerModel server) { Trace.Call(server); // protocol is part of the PKEY, not allowed to change f_ProtocolComboBox.Sensitive = false; Protocol = server.Protocol; ServerID = server.ServerID; f_HostnameEntry.Text = server.Hostname; f_NetworkComboBoxEntry.Entry.Text = server.Network; if (String.IsNullOrEmpty(server.Nickname)) { var defaultNicknames = (string[]) Frontend.UserConfig["Connection/Nicknames"]; f_NicknameEntry.Text = String.Join(" ", defaultNicknames); } else { f_NicknameEntry.Text = server.Nickname; } if (String.IsNullOrEmpty(server.Realname)) { var defaultRealname = (string) Frontend.UserConfig["Connection/Realname"]; f_RealnameEntry.Text = defaultRealname; } else { f_RealnameEntry.Text = server.Realname; } f_UsernameEntry.Text = server.Username; // HACK: Twitter username is part of the PKEY, not allowed to change if (server.Protocol == "Twitter") { f_UsernameEntry.Sensitive = false; } else { f_UsernameEntry.Sensitive = true; } f_PasswordEntry.Text = server.Password; f_UseEncryptionCheckButton.Active = server.UseEncryption; f_ValidateServerCertificateCheckButton.Active = server.ValidateServerCertificate; f_PortSpinButton.Value = server.Port; OnStartupConnectCheckButton.Active = server.OnStartupConnect; if (server.OnConnectCommands == null || server.OnConnectCommands.Count == 0) { f_OnConnectCommandsTextView.Buffer.Text = String.Empty; } else { // LAME: replace me when we have .NET 3.0 string[] commands = new string[server.OnConnectCommands.Count]; server.OnConnectCommands.CopyTo(commands, 0); f_OnConnectCommandsTextView.Buffer.Text = String.Join( "\n", commands ); } } public ServerModel GetServer() { ServerModel server = new ServerModel(); server.Protocol = f_ProtocolComboBox.ActiveText; server.ServerID = ServerID; server.Hostname = f_HostnameEntry.Text.Trim(); server.Network = f_NetworkComboBoxEntry.Entry.Text.Trim(); server.Port = f_PortSpinButton.ValueAsInt; server.Username = f_UsernameEntry.Text.Trim(); // HACK: use Twitter username as hostname for multi-account support if (f_ProtocolComboBox.ActiveText == "Twitter") { server.Hostname = server.Username; } server.Password = f_PasswordEntry.Text; server.Nickname = f_NicknameEntry.Text.Trim(); server.Realname = f_RealnameEntry.Text.Trim(); server.UseEncryption = f_UseEncryptionCheckButton.Active; server.ValidateServerCertificate = f_ValidateServerCertificateCheckButton.Active; server.OnStartupConnect = f_OnStartupConnectCheckButton.Active; if (f_OnConnectCommandsTextView.Sensitive) { server.OnConnectCommands = f_OnConnectCommandsTextView.Buffer.Text.Split('\n'); } return server; } public void InitProtocols(IList protocols) { Trace.Call(protocols); if (protocols == null) { throw new ArgumentNullException("protocols"); } f_ProtocolComboBox.Clear(); var cell = new Gtk.CellRendererText(); f_ProtocolComboBox.PackStart(cell, false); f_ProtocolComboBox.AddAttribute(cell, "text", 0); Gtk.ListStore store = new Gtk.ListStore(typeof(string)); // fill protocols in ListStore foreach (string protocol in protocols) { store.AppendValues(protocol); } store.SetSortColumnId(0, Gtk.SortType.Ascending); f_ProtocolComboBox.Model = store; try { // select IRC by default (if available) Protocol = "IRC"; } catch (ArgumentOutOfRangeException) { } } public void InitNetworks(IList networks) { Trace.Call(networks); if (networks == null) { throw new ArgumentNullException("networks"); } f_NetworkComboBoxEntry.Visible = true; // fill protocols in ListStore f_NetworkListStore.Clear(); foreach (string network in networks) { f_NetworkListStore.AppendValues(network); } f_NetworkListStore.SetSortColumnId(0, Gtk.SortType.Ascending); f_NetworkComboBoxEntry.Model = f_NetworkListStore; f_NetworkComboBoxEntry.TextColumn = 0; } private void Init() { f_ProtocolComboBox.Changed += delegate { CheckProtocolComboBox(); }; f_ShowPasswordCheckButton.Clicked += delegate { CheckShowPasswordCheckButton(); }; f_IgnoreOnConnectCommandsCheckButton.Toggled += delegate { CheckIgnoreOnConnectCommandsCheckButton(); }; f_UseEncryptionCheckButton.Clicked += delegate { CheckUseEncryptionCheckButton(); }; var defaultNicknames = (string[]) Frontend.UserConfig["Connection/Nicknames"]; f_NicknameEntry.Text = String.Join(" ", defaultNicknames); var defaultRealname = (string) Frontend.UserConfig["Connection/Realname"]; f_RealnameEntry.Text = defaultRealname; } protected virtual void CheckIgnoreOnConnectCommandsCheckButton() { Trace.Call(); f_OnConnectCommandsTextView.Sensitive = !f_IgnoreOnConnectCommandsCheckButton.Active; } protected virtual void CheckShowPasswordCheckButton() { Trace.Call(); f_PasswordEntry.Visibility = f_ShowPasswordCheckButton.Active; } protected virtual void CheckUseEncryptionCheckButton() { Trace.Call(); var useEncryption = f_UseEncryptionCheckButton.Active; f_ValidateServerCertificateCheckButton.Sensitive = useEncryption; if (!useEncryption) { f_ValidateServerCertificateCheckButton.Active = false; } switch (f_ProtocolComboBox.ActiveText) { case "IRC": if (f_PortSpinButton.Value == 6667 || f_PortSpinButton.Value == 6697) { f_PortSpinButton.Value = useEncryption ? 6697 : 6667; } break; case "JabbR": if (f_PortSpinButton.Value == 80 || f_PortSpinButton.Value == 443) { f_PortSpinButton.Value = useEncryption ? 443 : 80; } break; } } protected virtual void CheckProtocolComboBox() { Trace.Call(); // HACK: hardcoded default list, not so nice // suggest sane port defaults // TODO: this should be replaced with some ProtocolInfo class // that contains exactly this kind of information switch (f_ProtocolComboBox.ActiveText) { case "IRC": ShowHostname = true; ShowNetwork = true; ShowNickname = true; ShowRealname = true; ShowPassword = true; SupportUseEncryption = true; f_HostnameEntry.Sensitive = true; f_NetworkComboBoxEntry.Sensitive = true; f_PortSpinButton.Value = 6667; f_PortSpinButton.Sensitive = true; break; case "Facebook": ShowHostname = false; ShowNetwork = false; ShowNickname = false; ShowRealname = false; ShowPassword = true; SupportUseEncryption = true; f_HostnameEntry.Text = "chat.facebook.com"; f_PortSpinButton.Value = 5222; break; case "XMPP": ShowHostname = true; ShowNetwork = false; ShowNickname = false; ShowRealname = false; ShowPassword = true; SupportUseEncryption = true; f_HostnameEntry.Sensitive = true; f_NetworkComboBoxEntry.Entry.Text = String.Empty; f_NetworkComboBoxEntry.Sensitive = false; f_PortSpinButton.Value = 5222; f_PortSpinButton.Sensitive = true; break; // this protocols have static servers case "AIM": case "ICQ": case "MSNP": ShowHostname = false; ShowNetwork = false; ShowNickname = false; ShowRealname = false; ShowPassword = true; SupportUseEncryption = false; f_HostnameEntry.Text = String.Empty; f_HostnameEntry.Sensitive = false; f_NetworkComboBoxEntry.Entry.Text = String.Empty; f_NetworkComboBoxEntry.Sensitive = false; f_PortSpinButton.Value = 0; f_PortSpinButton.Sensitive = false; break; case "Twitter": ShowHostname = false; ShowNetwork = false; ShowNickname = false; ShowRealname = false; ShowPassword = false; SupportUseEncryption = true; // engine always uses https f_UseEncryptionCheckButton.Active = true; f_UseEncryptionCheckButton.Sensitive = false; f_HostnameEntry.Text = String.Empty; f_PortSpinButton.Value = 443; f_PortSpinButton.Sensitive = false; f_NetworkComboBoxEntry.Entry.Text = String.Empty; f_PasswordEntry.Text = String.Empty; break; case "Campfire": ShowHostname = true; ShowNetwork = false; ShowNickname = false; ShowRealname = false; ShowPassword = true; SupportUseEncryption = true; // engine always uses https f_UseEncryptionCheckButton.Active = true; f_UseEncryptionCheckButton.Sensitive = false; f_HostnameEntry.Text = ".campfirenow.com"; f_HostnameEntry.Sensitive = true; f_PortSpinButton.Value = 443; f_PortSpinButton.Sensitive = false; f_NetworkComboBoxEntry.Entry.Text = String.Empty; f_PasswordEntry.Text = String.Empty; break; case "JabbR": ShowHostname = true; ShowNetwork = false; ShowNickname = false; ShowRealname = false; ShowPassword = true; SupportUseEncryption = true; f_HostnameEntry.Text = "jabbr.net"; f_HostnameEntry.Sensitive = true; f_PortSpinButton.Value = 443; f_PortSpinButton.Sensitive = true; f_UseEncryptionCheckButton.Active = true; f_NetworkComboBoxEntry.Entry.Text = String.Empty; f_PasswordEntry.Text = String.Empty; break; // in case we don't know / handle the protocol here, make // sure we grant maximum flexibility for the input default: ShowHostname = true; ShowNetwork = true; ShowNickname = true; ShowRealname = true; ShowPassword = true; SupportUseEncryption = true; f_HostnameEntry.Sensitive = true; f_PortSpinButton.Sensitive = true; f_UseEncryptionCheckButton.Sensitive = true; f_ValidateServerCertificateCheckButton.Sensitive = true; break; } } } } smuxi-0.11/src/Frontend-GNOME/Views/ChatTreeView.cs0000644000175000017500000004364312274103742022601 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013-2014 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public class ChatTreeView : Gtk.TreeView { public Gtk.TreeStore TreeStore { get; private set; } ThemeSettings ThemeSettings { get; set; } int f_CurrentChatNumber; public ChatView CurrentChatView { get { Gtk.TreeIter iter; if (!Selection.GetSelected(out iter)) { return null; } return (ChatView) TreeStore.GetValue(iter, 0); } set { Gtk.TreeIter iter; if (value == null) { TreeStore.GetIterFirst(out iter); } else { iter = FindChatIter(value); } var path = TreeStore.GetPath(iter); // we have to ensure we can make the new selection ExpandToPath(path); Selection.SelectPath(path); } } public int CurrentChatNumber { get { return f_CurrentChatNumber; } set { var path = GetPath(value); if (path == null) { return; } // we have to ensure we can make the new selection ExpandToPath(path); Selection.SelectPath(path); } } public ChatTreeView() { ThemeSettings = new ThemeSettings(); TreeStore = new Gtk.TreeStore(typeof(ChatView)); TreeStore.SetSortColumnId(0, Gtk.SortType.Ascending); TreeStore.SetSortFunc(0, SortTreeStore); Model = TreeStore; HeadersVisible = false; BorderWidth = 0; ShowExpanders = false; LevelIndentation = 12; Selection.Mode = Gtk.SelectionMode.Browse; Selection.Changed += (sender, e) => { Gtk.TreeIter iter; if (!Selection.GetSelected(out iter) && TreeStore.GetIterFirst(out iter)) { Selection.SelectIter(iter); return; } var path = TreeStore.GetPath(iter); f_CurrentChatNumber = GetRowNumber(path); }; var iconRenderer = new Gtk.CellRendererPixbuf(); var column = new Gtk.TreeViewColumn(null, iconRenderer); column.Spacing = 0; column.Sizing = Gtk.TreeViewColumnSizing.Autosize; column.SetCellDataFunc(iconRenderer, new Gtk.TreeCellDataFunc(RenderChatViewIcon)); AppendColumn(column); var cellRenderer = new Gtk.CellRendererText() { Ellipsize = Pango.EllipsizeMode.End }; column = new Gtk.TreeViewColumn(null, cellRenderer); column.Spacing = 0; column.Expand = true; column.Sizing = Gtk.TreeViewColumnSizing.Autosize; column.SetCellDataFunc(cellRenderer, new Gtk.TreeCellDataFunc(RenderChatViewName)); AppendColumn(column); cellRenderer = new Gtk.CellRendererText(); column = new Gtk.TreeViewColumn(null, cellRenderer); column.Spacing = 0; column.Alignment = 1; column.Sizing = Gtk.TreeViewColumnSizing.Autosize; column.SetCellDataFunc(cellRenderer, new Gtk.TreeCellDataFunc(RenderChatViewActivity)); AppendColumn(column); } public virtual void Append(ChatView chatView) { if (chatView == null) { throw new ArgumentNullException("chatView"); } if (chatView is SessionChatView || chatView is ProtocolChatView) { // top level chats TreeStore.AppendValues(chatView); ReparentOrphans(); if (TreeStore.IterNChildren() == 1) { // first node, usualy Smuxi chat CurrentChatView = chatView; } } else { // childs with parents, hopefully var parentIter = FindProtocolChatIter(chatView); if (TreeStore.IterIsValid(parentIter)) { TreeStore.AppendValues(parentIter, chatView); var path = TreeStore.GetPath(parentIter); ExpandRow(path, true); } else { // parent chat doesn't exist yet, thus it has to become // a top level chat for now and re-parent later TreeStore.AppendValues(chatView); } } } public virtual void Remove(ChatView chatView) { if (chatView == null) { throw new ArgumentNullException("chatView"); } var iter = FindChatIter(chatView); if (!TreeStore.IterIsValid(iter)) { return; } TreeStore.Remove(ref iter); } public virtual void Render(ChatView chatView) { Trace.Call(chatView); if (chatView == null) { throw new ArgumentNullException("chatView"); } var iter = FindChatIter(chatView); //var path = TreeStore.GetPath(iter); //TreeStore.EmitRowChanged(path, iter); // HACK: this emits row_changed _and_ sort_iter_changed and there is // no other public API in GTK+ to trigger a resort of a modified // value in the tree view :/ TreeStore.SetValue(iter, 0, chatView); } public virtual bool IsVisible(ChatView chatView) { if (chatView == null) { throw new ArgumentNullException("chatView"); } Gtk.TreePath visibleStart, visibleEnd; if (!GetVisibleRange(out visibleStart, out visibleEnd)) { return false; } var chatIter = FindChatIter(chatView); var chatPath = TreeStore.GetPath(chatIter); // we ignore 0 on purpose, say if a few pixels of a row are returned // as visible by GetVisibleRange() that is not good enough for us return visibleStart.Compare(chatPath) <= 0 && visibleEnd.Compare(chatPath) >= 0; } public virtual void ApplyConfig(UserConfig config) { Trace.Call(config); if (config == null) { throw new ArgumentNullException("config"); } ThemeSettings = new ThemeSettings(config); if (ThemeSettings.BackgroundColor == null) { ModifyBase(Gtk.StateType.Normal); } else { ModifyBase(Gtk.StateType.Normal, ThemeSettings.BackgroundColor.Value); } if (ThemeSettings.ForegroundColor == null) { ModifyText(Gtk.StateType.Normal); } else { ModifyText(Gtk.StateType.Normal, ThemeSettings.ForegroundColor.Value); } ModifyFont(ThemeSettings.FontDescription); } protected virtual void RenderChatViewIcon(Gtk.TreeViewColumn column, Gtk.CellRenderer cellr, Gtk.TreeModel model, Gtk.TreeIter iter) { var chat = (ChatView) model.GetValue(iter, 0); var renderer = (Gtk.CellRendererPixbuf) cellr; switch (chat.TabImage.StorageType) { case Gtk.ImageType.Pixbuf: renderer.Pixbuf = chat.TabImage.Pixbuf; break; case Gtk.ImageType.Stock: renderer.StockId = chat.TabImage.Stock; break; default: renderer.Pixbuf = null; break; } } protected virtual void RenderChatViewName(Gtk.TreeViewColumn column, Gtk.CellRenderer cellr, Gtk.TreeModel model, Gtk.TreeIter iter) { var chat = (ChatView) model.GetValue(iter, 0); var renderer = (Gtk.CellRendererText) cellr; Gdk.Color color; if (chat.HighlightCount > 1) { color = ThemeSettings.HighlightColor; } else if (chat.HighlightCount == 1) { color = ThemeSettings.HighlightColor; } else if (chat.HasActivity) { color = ThemeSettings.ActivityColor; } else if (chat.HasEvent) { color = ThemeSettings.EventColor; } else { // no activity color = ThemeSettings.NoActivityColor; } var textColor = TextColorTools.GetBestTextColor( ColorConverter.GetTextColor(color), ColorConverter.GetTextColor( Gtk.Rc.GetStyle(this).Base(Gtk.StateType.Normal) ), TextColorContrast.High ); renderer.Markup = String.Format( "{1}", GLib.Markup.EscapeText(textColor.ToString()), GLib.Markup.EscapeText(chat.Name) ); } protected virtual void RenderChatViewActivity(Gtk.TreeViewColumn column, Gtk.CellRenderer cellr, Gtk.TreeModel model, Gtk.TreeIter iter) { var chat = (ChatView) model.GetValue(iter, 0); var renderer = (Gtk.CellRendererText) cellr; Gdk.Color color; string text = null; if (chat.HighlightCount > 1) { color = ThemeSettings.HighlightColor; text = chat.HighlightCount.ToString(); } else { // no highlight counter renderer.Markup = String.Empty; return; } if (text == null) { return; } var textColor = TextColorTools.GetBestTextColor( ColorConverter.GetTextColor(color), ColorConverter.GetTextColor( Gtk.Rc.GetStyle(this).Base(Gtk.StateType.Normal) ), TextColorContrast.High ); renderer.Markup = String.Format( "({1})", GLib.Markup.EscapeText(textColor.ToString()), GLib.Markup.EscapeText(text) ); } protected virtual int SortTreeStore(Gtk.TreeModel model, Gtk.TreeIter iter1, Gtk.TreeIter iter2) { var chat1 = (ChatView) model.GetValue(iter1, 0); var chat2 = (ChatView) model.GetValue(iter2, 0); // Smuxi is always the first item if (chat1 is SessionChatView && chat2 is SessionChatView) { return 0; } else if (chat1 is SessionChatView) { return -1; } else if (chat2 is SessionChatView) { return 1; } else if (chat1 is GroupChatView && chat2 is GroupChatView) { // let Name decide } else if (chat1 is GroupChatView) { return -1; } else if (chat2 is GroupChatView) { return 1; } return chat1.Name.CompareTo(chat2.Name); } protected override bool OnKeyPressEvent(Gdk.EventKey @event) { if ((@event.State & Gdk.ModifierType.Mod1Mask) != 0 || (@event.State & Gdk.ModifierType.ControlMask) != 0 || (@event.State & Gdk.ModifierType.ShiftMask) != 0) { // alt, ctrl or shift pushed, returning return base.OnKeyPressEvent(@event); } if (CurrentChatView is SessionChatView) { // no menu for Smuxi chat return base.OnKeyPressEvent(@event); } if (@event.Key == Gdk.Key.Menu && Selection.CountSelectedRows() > 0) { CurrentChatView.TabMenu.Popup(null, null, null, 0, @event.Time); return true; } return base.OnKeyPressEvent(@event); } protected override bool OnButtonReleaseEvent(Gdk.EventButton @event) { Trace.Call(@event); if (CurrentChatView is SessionChatView) { // no menu for Smuxi chat return base.OnButtonReleaseEvent(@event); } if (@event.Button == 3 && Selection.CountSelectedRows() > 0) { CurrentChatView.TabMenu.Popup(null, null, null, 0, @event.Time); return true; } return base.OnButtonReleaseEvent(@event); } void ReparentOrphans() { Gtk.TreeIter iter; Gtk.TreeIter parentIter = Gtk.TreeIter.Zero; TreeStore.GetIterFirst(out iter); do { var orphan = (ChatView) TreeStore.GetValue(iter, 0); if (orphan is SessionChatView || orphan is ProtocolChatView) { continue; } if (TreeStore.IterParent(out parentIter, iter)) { // already has an parent continue; } // no parent, let's find one! parentIter = FindProtocolChatIter(orphan); if (!TreeStore.IterIsValid(parentIter)) { continue; } // found a parent \o/ TreeStore.Remove(ref iter); TreeStore.AppendValues(parentIter, orphan); var parentPath = TreeStore.GetPath(parentIter); ExpandRow(parentPath, true); // reset iter to first as we changed the store and thus can't // continue the iteration TreeStore.GetIterFirst(out iter); } while (TreeStore.IterNext(ref iter)); } Gtk.TreeIter FindProtocolChatIter(ChatView child) { Gtk.TreeIter iter; Gtk.TreeIter parentIter = Gtk.TreeIter.Zero; TreeStore.GetIterFirst(out iter); do { var candidate = (ChatView) TreeStore.GetValue(iter, 0); if (!(candidate is ProtocolChatView) || candidate.ProtocolManager == null) { continue; } if (child.ProtocolManager != candidate.ProtocolManager) { continue; } parentIter = iter; break; } while (TreeStore.IterNext(ref iter)); return parentIter; } Gtk.TreeIter FindChatIter(ChatView view) { Gtk.TreeIter chatIter = Gtk.TreeIter.Zero; TreeStore.Foreach((model, path, iter) => { var candidate = (ChatView) model.GetValue(iter, 0); if (candidate == view) { chatIter = iter; return true; } return false; }); return chatIter; } int GetRowNumber(Gtk.TreePath path) { Gtk.TreeIter iter; if (!TreeStore.GetIter(out iter, path)) { // invalid path return -1; } Gtk.TreeIter walkerIter; TreeStore.GetIterFirst(out walkerIter); var walker = TreeStore.GetPath(walkerIter); for (var i = 0; TreeStore.GetIter(out walkerIter, walker); i++) { if (walker.Compare(path) == 0) { return i; } if (TreeStore.IterHasChild(walkerIter)) { walker.Down(); } else { walker.Next(); if (!TreeStore.GetIter(out walkerIter, walker)) { // invalid path: reached last row walker.Up(); walker.Next(); } } } return -1; } Gtk.TreePath GetPath(int rowNumber) { Gtk.TreeIter iter; TreeStore.GetIterFirst(out iter); var path = TreeStore.GetPath(iter); // TODO: clamp upper limit int i; for (i = 0; rowNumber >= 0 && i < rowNumber; i++) { TreeStore.GetIter(out iter, path); if (TreeStore.IterHasChild(iter)) { path.Down(); } else { path.Next(); TreeStore.GetIter(out iter, path); if (!TreeStore.IterIsValid(iter)) { // reached last row path.Up(); path.Next(); } } } return path; } } } smuxi-0.11/src/Frontend-GNOME/Views/FilterListWidget.cs0000644000175000017500000004117312250426634023472 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { [System.ComponentModel.ToolboxItem(true)] public partial class FilterListWidget : Gtk.Bin { Gtk.Window f_Parent { get; set; } Gtk.ListStore f_ListStore { get; set; } FilterListController f_Controller { get; set; } Gtk.ListStore f_ChatTypeListStore { get; set; } Gtk.ListStore f_MessageTypeListStore { get; set; } Gtk.ListStore f_ProtocolListStore { get; set; } public event EventHandler Changed; public FilterListWidget(Gtk.Window parent, UserConfig userConfig) { if (parent == null) { throw new ArgumentNullException("parent"); } if (userConfig == null) { throw new ArgumentNullException("userConfig"); } Build(); Init(); f_Parent = parent; f_Controller = new FilterListController(userConfig); } public void InitProtocols(IList protocols) { Trace.Call(protocols); if (protocols == null) { throw new ArgumentNullException("protocols"); } f_ProtocolListStore.Clear(); f_ProtocolListStore.AppendValues(String.Empty); foreach (string protocol in protocols) { f_ProtocolListStore.AppendValues(protocol); } f_ProtocolListStore.SetSortColumnId(0, Gtk.SortType.Ascending); } public void Load() { Trace.Call(); f_ListStore.Clear(); var filters = f_Controller.GetFilterList(); foreach (var filter in filters) { f_ListStore.AppendValues(filter.Value, filter.Key); } f_TreeView.ColumnsAutosize(); } public void Save() { Trace.Call(); // search for removed filters foreach (var filterPair in f_Controller.GetFilterList()) { bool removed = true; foreach (object[] row in f_ListStore) { if ((int) row[1] == filterPair.Key) { removed = false; break; } } if (removed) { f_Controller.RemoveFilter(filterPair.Key); } } Gtk.TreeIter iter; if (!f_ListStore.GetIterFirst(out iter)) { // empty list, nothing to do return; } do { var filter = (FilterModel) f_ListStore.GetValue(iter, 0); var key = (int) f_ListStore.GetValue(iter, 1); // test patterns try { Pattern.IsMatch(String.Empty, filter.ChatID); } catch (ArgumentException ex) { throw new ApplicationException( String.Format( _("Invalid filter regex: '{0}'. Reason: {1}"), filter.ChatID, ex.Message ) ); } try { Pattern.IsMatch(String.Empty, filter.MessagePattern); } catch (ArgumentException ex) { throw new ApplicationException( String.Format( _("Invalid filter regex: '{0}'. Reason: {1}"), filter.MessagePattern, ex.Message ) ); } if (key == -1) { // new filter if (String.IsNullOrEmpty(filter.Protocol) && filter.ChatType == null && String.IsNullOrEmpty(filter.ChatID) && filter.MessageType == null && String.IsNullOrEmpty(filter.MessagePattern)) { // drop empty filters f_ListStore.Remove(ref iter); continue; } key = f_Controller.AddFilter(filter); // write generated key back f_ListStore.SetValue(iter, 1, key); } else { // update filter f_Controller.SetFilter(key, filter); } } while (f_ListStore.IterNext(ref iter)); } protected virtual void OnChanged(EventArgs e) { if (Changed != null) { Changed(this, e); } } protected virtual void OnAddButtonClicked(object sender, System.EventArgs e) { Trace.Call(sender, e); try { var filter = new FilterModel(); filter.Protocol = String.Empty; filter.ChatID = String.Empty; filter.MessagePattern = String.Empty; Gtk.TreeIter iter = f_ListStore.AppendValues(filter, -1); f_TreeView.Selection.SelectIter(iter); OnChanged(EventArgs.Empty); } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual void OnRemoveButtonClicked(object sender, System.EventArgs e) { Trace.Call(sender, e); try { Gtk.TreeIter iter; if (!f_TreeView.Selection.GetSelected(out iter)) { return; } Gtk.MessageDialog md = new Gtk.MessageDialog( f_Parent, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.YesNo, _("Are you sure you want to delete the selected filter?") ); int result = md.Run(); md.Destroy(); if (result != (int) Gtk.ResponseType.Yes) { return; } f_ListStore.Remove(ref iter); OnChanged(EventArgs.Empty); } catch (Exception ex) { Frontend.ShowException(ex); } } void Init() { f_ProtocolListStore = new Gtk.ListStore(typeof(string)); f_ListStore = new Gtk.ListStore( typeof(FilterModel), typeof(int), // filter key typeof(string) // tool tip ); f_TreeView.Model = f_ListStore; Gtk.TreeViewColumn column; Gtk.CellRendererText textCellr; Gtk.CellRendererCombo comboCellr; comboCellr = new Gtk.CellRendererCombo(); comboCellr.Model = f_ProtocolListStore; comboCellr.TextColumn = 0; comboCellr.HasEntry = false; comboCellr.Editable = true; comboCellr.Edited += OnProtocolEdited; column = f_TreeView.AppendColumn(_("Protocol"), comboCellr); column.SetCellDataFunc(comboCellr, RenderProtocol); f_ChatTypeListStore = new Gtk.ListStore(typeof(string), typeof(ChatType?)); f_ChatTypeListStore.AppendValues(String.Empty, null); f_ChatTypeListStore.AppendValues(_("Person / Private"), ChatType.Person); f_ChatTypeListStore.AppendValues(_("Group / Public"), ChatType.Group); f_ChatTypeListStore.AppendValues(_("Protocol / Server"), ChatType.Protocol); comboCellr = new Gtk.CellRendererCombo(); comboCellr.Model = f_ChatTypeListStore; comboCellr.TextColumn = 0; comboCellr.HasEntry = false; comboCellr.Editable = true; comboCellr.Edited += OnChatTypeEdited; column = f_TreeView.AppendColumn(_("Chat Type"), comboCellr); column.Resizable = true; column.Sizing = Gtk.TreeViewColumnSizing.GrowOnly; column.SetCellDataFunc(comboCellr, RenderChatType); textCellr = new Gtk.CellRendererText(); textCellr.Editable = true; textCellr.Edited += delegate(object sender, Gtk.EditedArgs e) { Gtk.TreeIter iter; if (!f_ListStore.GetIterFromString(out iter, e.Path)) { return; } FilterModel filter = (FilterModel) f_ListStore.GetValue(iter, 0); filter.ChatID = e.NewText; f_ListStore.EmitRowChanged(new Gtk.TreePath(e.Path), iter); OnChanged(EventArgs.Empty); }; column = f_TreeView.AppendColumn(_("Name"), textCellr); column.MinWidth = 80; column.Resizable = true; column.Sizing = Gtk.TreeViewColumnSizing.GrowOnly; column.SetCellDataFunc(textCellr, delegate(Gtk.TreeViewColumn col, Gtk.CellRenderer cellr, Gtk.TreeModel model, Gtk.TreeIter iter ) { FilterModel filter = (FilterModel) model.GetValue(iter, 0); (cellr as Gtk.CellRendererText).Text = filter.ChatID; } ); f_MessageTypeListStore = new Gtk.ListStore(typeof(string), typeof(MessageType?)); f_MessageTypeListStore.AppendValues(String.Empty, null); f_MessageTypeListStore.AppendValues(_("Normal"), MessageType.Normal); f_MessageTypeListStore.AppendValues(_("Event"), MessageType.Event); comboCellr = new Gtk.CellRendererCombo(); comboCellr.Model = f_MessageTypeListStore; comboCellr.TextColumn = 0; comboCellr.HasEntry = false; comboCellr.Editable = true; comboCellr.Edited += OnMessageTypeEdited; column = f_TreeView.AppendColumn(_("Type"), comboCellr); column.Resizable = true; column.Sizing = Gtk.TreeViewColumnSizing.GrowOnly; column.SetCellDataFunc(comboCellr, RenderMessageType); /* f_TreeView.HasTooltip = true; f_TreeView.QueryTooltip += delegate(object sender, Gtk.QueryTooltipArgs e) { e.Tooltip.Text = "Message Type"; f_TreeView.SetTooltipCell(e.Tooltip, null, column, null); e.RetVal = true; }; */ textCellr = new Gtk.CellRendererText(); textCellr.Editable = true; textCellr.Edited += delegate(object sender, Gtk.EditedArgs e) { Gtk.TreeIter iter; if (!f_ListStore.GetIterFromString(out iter, e.Path)) { return; } FilterModel filter = (FilterModel) f_ListStore.GetValue(iter, 0); filter.MessagePattern = e.NewText; f_ListStore.EmitRowChanged(new Gtk.TreePath(e.Path), iter); OnChanged(EventArgs.Empty); }; column = f_TreeView.AppendColumn(_("Pattern"), textCellr); column.Resizable = true; column.MinWidth = 80; column.Sizing = Gtk.TreeViewColumnSizing.GrowOnly; column.SetCellDataFunc(textCellr, delegate(Gtk.TreeViewColumn col, Gtk.CellRenderer cellr, Gtk.TreeModel model, Gtk.TreeIter iter) { FilterModel filter = (FilterModel) model.GetValue(iter, 0); (cellr as Gtk.CellRendererText).Text = filter.MessagePattern; } ); } void RenderProtocol(Gtk.TreeViewColumn column, Gtk.CellRenderer cellr, Gtk.TreeModel model, Gtk.TreeIter iter) { FilterModel filter = (FilterModel) model.GetValue(iter, 0); (cellr as Gtk.CellRendererCombo).Text = filter.Protocol; } void OnProtocolEdited(object sender, Gtk.EditedArgs e) { Trace.Call(sender, e); Gtk.TreeIter iter; if (!f_ListStore.GetIterFromString(out iter, e.Path)) { return; } FilterModel filter = (FilterModel) f_ListStore.GetValue(iter, 0); filter.Protocol = e.NewText; f_ListStore.EmitRowChanged(new Gtk.TreePath(e.Path), iter); OnChanged(EventArgs.Empty); } void RenderChatType(Gtk.TreeViewColumn column, Gtk.CellRenderer cellr, Gtk.TreeModel model, Gtk.TreeIter iter) { FilterModel filter = (FilterModel) model.GetValue(iter, 0); foreach (object[] row in f_ChatTypeListStore) { if ((ChatType?) row[1] == filter.ChatType) { (cellr as Gtk.CellRendererCombo).Text = (string) row[0]; break; } } } void OnChatTypeEdited(object sender, Gtk.EditedArgs e) { Trace.Call(sender, e); Gtk.TreeIter iter; if (!f_ListStore.GetIterFromString(out iter, e.Path)) { return; } FilterModel filter = (FilterModel) f_ListStore.GetValue(iter, 0); // HACK: lame GTK+ 2.12 is not exposing the combo box neither // the iterator of the selected row inside the combo box thus // we have lookup the value in the list store using the text :/ // TODO: starting with GTK+ 2.14 the Changed event can be used // see http://git.gnome.org/browse/gtk+/tree/gtk/gtkcellrenderercombo.c#n178 ChatType? newChatType = null; foreach (object[] row in f_ChatTypeListStore) { if ((string) row[0] == e.NewText) { newChatType = (ChatType?) row[1]; break; } } filter.ChatType = newChatType; f_ListStore.EmitRowChanged(new Gtk.TreePath(e.Path), iter); OnChanged(EventArgs.Empty); } void RenderMessageType(Gtk.TreeViewColumn column, Gtk.CellRenderer cellr, Gtk.TreeModel model, Gtk.TreeIter iter) { FilterModel filter = (FilterModel) model.GetValue(iter, 0); foreach (object[] row in f_MessageTypeListStore) { if ((MessageType?) row[1] == filter.MessageType) { (cellr as Gtk.CellRendererCombo).Text = (string) row[0]; break; } } } void OnMessageTypeEdited(object sender, Gtk.EditedArgs e) { Trace.Call(sender, e); Gtk.TreeIter iter; if (!f_ListStore.GetIterFromString(out iter, e.Path)) { return; } FilterModel filter = (FilterModel) f_ListStore.GetValue(iter, 0); // HACK: lame GTK+ 2.12 is not exposing the combo box neither // the iterator of the selected row inside the combo box thus // we have lookup the value in the list store using the text :/ // TODO: starting with GTK+ 2.14 the Changed event can be used // see http://git.gnome.org/browse/gtk+/tree/gtk/gtkcellrenderercombo.c#n178 MessageType? newMsgType = null; foreach (object[] row in f_MessageTypeListStore) { if ((string) row[0] == e.NewText) { newMsgType = (MessageType?) row[1]; break; } } filter.MessageType = newMsgType; f_ListStore.EmitRowChanged(new Gtk.TreePath(e.Path), iter); OnChanged(EventArgs.Empty); } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/Views/Assistants/0000755000175000017500000000000012311344241022033 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-GNOME/Views/Assistants/Engine/0000755000175000017500000000000012311344241023240 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistantIntroWidget.cs0000644000175000017500000000210611655545675031075 0ustar00meebeymeebey00000000000000// $Id$ // // Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2009 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Frontend.Gnome { public partial class EngineAssistantIntroWidget : Gtk.Bin { public EngineAssistantIntroWidget() { Build(); } } } smuxi-0.11/src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistantConnectionWidget.cs0000644000175000017500000000345111655545675032105 0ustar00meebeymeebey00000000000000// $Id$ // // Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2009 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Frontend.Gnome { public partial class EngineAssistantConnectionWidget : Gtk.Bin { public Gtk.CheckButton UseSshTunnelCheckButton { get { return f_UseSshTunnelCheckButton; } } public Gtk.Entry SshHostEntry { get { return f_SshHostEntry; } } public Gtk.SpinButton SshPortSpinButton { get { return f_SshPortSpinButton; } } public Gtk.Entry HostEntry { get { return f_HostEntry; } } public Gtk.SpinButton PortSpinButton { get { return f_PortSpinButton; } } public EngineAssistantConnectionWidget() { Build(); f_SshHostEntry.HasFocus = true; } } } smuxi-0.11/src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistantNameWidget.cs0000644000175000017500000000254411655545675030670 0ustar00meebeymeebey00000000000000// $Id$ // // Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2009 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Frontend.Gnome { public partial class EngineAssistantNameWidget : Gtk.Bin { public Gtk.Entry EngineNameEntry { get { return f_EngineNameEntry; } } public Gtk.CheckButton MakeDefaultEngineCheckButton { get { return f_MakeDefaultEngineCheckButton; } } public EngineAssistantNameWidget() { Build(); } } } smuxi-0.11/src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistantCredentialsWidget.cs0000644000175000017500000000401511700531610032207 0ustar00meebeymeebey00000000000000// $Id$ // // Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2009 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Frontend.Gnome { public partial class EngineAssistantCredentialsWidget : Gtk.Bin { public Gtk.Entry UsernameEntry { get { return f_UsernameEntry; } } public Gtk.Entry PasswordEntry { get { return f_PasswordEntry; } } public Gtk.Entry VerifyPasswordEntry { get { return f_VerifyPasswordEntry; } } public Gtk.Entry SshUsernameEntry { get { return f_SshUsernameEntry; } } public Gtk.Entry SshPasswordEntry { get { return f_SshPasswordEntry; } } public Gtk.VBox SshPasswordVBox { get { return f_SshPasswordVBox; } } public Gtk.FileChooserButton SshKeyfileChooserButton { get { return f_SshKeyfileChooserButton; } } public EngineAssistantCredentialsWidget() { Build(); } } } smuxi-0.11/src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs0000644000175000017500000003442112257043746026711 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2009, 2011, 2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using Smuxi.Common; using Smuxi.Engine; using IOPath = System.IO.Path; namespace Smuxi.Frontend.Gnome { public class EngineAssistant : Gtk.Assistant { private FrontendConfig f_Config; private string f_EngineName; private EngineAssistantIntroWidget f_IntroWidget; private EngineAssistantNameWidget f_NameWidget; private int f_NamePage; private EngineAssistantConnectionWidget f_ConnectionWidget; private EngineAssistantCredentialsWidget f_CredentialsWidget; public EngineAssistant(Gtk.Window parent, FrontendConfig config) : this(parent, config, null) { Trace.Call(parent, config); } public EngineAssistant(Gtk.Window parent, FrontendConfig config, string engineName) { Trace.Call(parent, config, engineName); if (parent == null) { throw new ArgumentNullException("parent"); } if (config == null) { throw new ArgumentNullException("config"); } f_Config = config; f_EngineName = engineName; TransientFor = parent; SetDefaultSize(640, 480); SetPosition(Gtk.WindowPosition.CenterAlways); Title = _("Engine Assistant - Smuxi"); Apply += OnApply; InitPages(); } private void InitPages() { InitIntroPage(); InitNamePage(); InitConnectionPage(); InitCredentialsPage(); InitConfirmPage(); } private void InitIntroPage() { f_IntroWidget = new EngineAssistantIntroWidget(); AppendPage(f_IntroWidget); if (f_EngineName == null) { SetPageTitle(f_IntroWidget, _("Add Smuxi Engine")); } else { SetPageTitle(f_IntroWidget, _("Edit Smuxi Engine")); } SetPageType(f_IntroWidget, Gtk.AssistantPageType.Intro); SetPageComplete(f_IntroWidget, true); } private void InitNamePage() { f_NameWidget = new EngineAssistantNameWidget(); f_NamePage = AppendPage(f_NameWidget); SetPageTitle(f_NameWidget, _("Name")); SetPageType(f_NameWidget, Gtk.AssistantPageType.Content); Prepare += delegate(object sender, Gtk.PrepareArgs e) { if (e.Page != f_NameWidget) { return; } CheckNamePage(); }; f_NameWidget.EngineNameEntry.Changed += delegate { CheckNamePage(); }; if (f_EngineName != null) { // we can't rename engines for now f_NameWidget.EngineNameEntry.Text = f_EngineName; f_NameWidget.EngineNameEntry.Sensitive = false; } } private void CheckNamePage() { bool isComplete = true; if (f_NameWidget.EngineNameEntry.Text.Trim().Length == 0) { isComplete = false; } SetPageComplete(f_NameWidget, isComplete); } private void InitConnectionPage() { f_ConnectionWidget = new EngineAssistantConnectionWidget(); AppendPage(f_ConnectionWidget); SetPageTitle(f_ConnectionWidget, _("Connection")); SetPageType(f_ConnectionWidget, Gtk.AssistantPageType.Content); Prepare += delegate(object sender, Gtk.PrepareArgs e) { if (e.Page != f_ConnectionWidget) { return; } CheckConnectionPage(); }; f_ConnectionWidget.UseSshTunnelCheckButton.Toggled += delegate { bool isActive = f_ConnectionWidget.UseSshTunnelCheckButton.Active; f_ConnectionWidget.SshHostEntry.Sensitive = isActive; f_ConnectionWidget.SshPortSpinButton.Sensitive = isActive; f_ConnectionWidget.HostEntry.Sensitive = !isActive; if (isActive) { f_ConnectionWidget.HostEntry.Text = "localhost"; } else { f_ConnectionWidget.HostEntry.Text = String.Empty; f_ConnectionWidget.SshHostEntry.Text = String.Empty; f_ConnectionWidget.SshPortSpinButton.Value = 22d; } CheckConnectionPage(); }; f_ConnectionWidget.SshHostEntry.Changed += delegate { CheckConnectionPage(); }; f_ConnectionWidget.HostEntry.Changed += delegate { CheckConnectionPage(); }; if (f_EngineName != null) { f_ConnectionWidget.UseSshTunnelCheckButton.Active = (bool) f_Config["Engines/" + f_EngineName + "/UseSshTunnel"]; f_ConnectionWidget.SshHostEntry.Text = (string) f_Config["Engines/" + f_EngineName + "/SshHostname"]; f_ConnectionWidget.SshPortSpinButton.Value = (double)(int) f_Config["Engines/" + f_EngineName + "/SshPort"]; f_ConnectionWidget.HostEntry.Text = (string) f_Config["Engines/" + f_EngineName + "/Hostname"]; f_ConnectionWidget.PortSpinButton.Value = (double)(int) f_Config["Engines/" + f_EngineName + "/Port"]; } } private void CheckConnectionPage() { bool isComplete = true; if (f_ConnectionWidget.UseSshTunnelCheckButton.Active && f_ConnectionWidget.SshHostEntry.Text.Trim().Length == 0) { isComplete = false; } if (f_ConnectionWidget.HostEntry.Text.Trim().Length == 0) { isComplete = false; } SetPageComplete(f_ConnectionWidget, isComplete); } private void InitCredentialsPage() { f_CredentialsWidget = new EngineAssistantCredentialsWidget(); AppendPage(f_CredentialsWidget); SetPageTitle(f_CredentialsWidget, _("Credentials")); SetPageType(f_CredentialsWidget, Gtk.AssistantPageType.Content); Prepare += delegate(object sender, Gtk.PrepareArgs e) { if (e.Page != f_CredentialsWidget) { return; } CheckCredentialsPage(); }; f_CredentialsWidget.SshUsernameEntry.Changed += delegate { CheckCredentialsPage(); }; f_CredentialsWidget.UsernameEntry.Changed += delegate { CheckCredentialsPage(); }; f_CredentialsWidget.PasswordEntry.Changed += delegate { CheckCredentialsPage(); }; f_CredentialsWidget.VerifyPasswordEntry.Changed += delegate { CheckCredentialsPage(); }; // HACK: only show the SSH password field if plink is present as // OpenSSH doesn't support passing passwords via command line f_CredentialsWidget.SshPasswordVBox.Visible = File.Exists("plink.exe"); if (f_EngineName != null) { f_CredentialsWidget.SshUsernameEntry.Text = (string) f_Config["Engines/" + f_EngineName + "/SshUsername"]; f_CredentialsWidget.SshPasswordEntry.Text = (string) f_Config["Engines/" + f_EngineName + "/SshPassword"]; var sshKeyfile = (string) f_Config["Engines/" + f_EngineName + "/SshKeyfile"]; if (!String.IsNullOrEmpty(sshKeyfile)) { f_CredentialsWidget.SshKeyfileChooserButton.SetFilename( sshKeyfile ); } var sshPath = IOPath.Combine( Environment.GetFolderPath( Environment.SpecialFolder.Personal ), ".ssh" ); if (Directory.Exists(sshPath)) { f_CredentialsWidget.SshKeyfileChooserButton.SetCurrentFolder( sshPath ); } f_CredentialsWidget.UsernameEntry.Text = (string) f_Config["Engines/" + f_EngineName + "/Username"]; f_CredentialsWidget.PasswordEntry.Text = (string) f_Config["Engines/" + f_EngineName + "/Password"]; f_CredentialsWidget.VerifyPasswordEntry.Text = (string) f_Config["Engines/" + f_EngineName + "/Password"]; } } private void CheckCredentialsPage() { bool useSsh = f_ConnectionWidget.UseSshTunnelCheckButton.Active; f_CredentialsWidget.SshUsernameEntry.Sensitive = useSsh; if (!useSsh) { f_CredentialsWidget.SshUsernameEntry.Text = String.Empty; } bool isComplete = true; if (f_CredentialsWidget.UsernameEntry.Text.Trim().Length == 0 || f_CredentialsWidget.PasswordEntry.Text.Trim().Length == 0) { isComplete = false; } if (f_CredentialsWidget.PasswordEntry.Text != f_CredentialsWidget.VerifyPasswordEntry.Text) { isComplete = false; } SetPageComplete(f_CredentialsWidget, isComplete); } private void InitConfirmPage() { Gtk.Label page = new Gtk.Label(_("Now you can use the Smuxi Engine")); AppendPage(page); SetPageTitle(page, _("Thank you")); SetPageType(page, Gtk.AssistantPageType.Confirm); SetPageComplete(page, true); } protected virtual void OnApply(object sender, EventArgs e) { Trace.Call(sender, e); string engine = f_NameWidget.EngineNameEntry.Text; if (f_EngineName == null) { // check if an engine wit that name exists already string[] engines = (string[]) f_Config["Engines/Engines"]; foreach (string oldEngine in engines) { if (engine == oldEngine) { Gtk.MessageDialog md = new Gtk.MessageDialog(this, Gtk.DialogFlags.Modal, Gtk.MessageType.Error, Gtk.ButtonsType.Close, _("An engine with this name already exists! Please specify a different one.")); md.Run(); md.Destroy(); // jump back to the name page // HACK: assistant API is buggy here, the "Apply" button // will trigger a next page signal, thus we have to jump // to one page before the name page :( CurrentPage = f_NamePage - 1; return; } } string[] newEngines; if (engines.Length == 0) { // there was no existing engines newEngines = new string[] { engine }; } else { newEngines = new string[engines.Length + 1]; engines.CopyTo(newEngines, 0); newEngines[engines.Length] = engine; } if (engines.Length == 1) { f_Config["Engines/Default"] = engine; } f_Config["Engines/Engines"] = newEngines; } if (f_NameWidget.MakeDefaultEngineCheckButton.Active) { f_Config["Engines/Default"] = engine; } f_Config["Engines/"+engine+"/Username"] = f_CredentialsWidget.UsernameEntry.Text.Trim(); f_Config["Engines/"+engine+"/Password"] = f_CredentialsWidget.PasswordEntry.Text.Trim(); f_Config["Engines/"+engine+"/Hostname"] = f_ConnectionWidget.HostEntry.Text.Trim(); f_Config["Engines/"+engine+"/Port"] = f_ConnectionWidget.PortSpinButton.ValueAsInt; f_Config["Engines/"+engine+"/UseSshTunnel"] = f_ConnectionWidget.UseSshTunnelCheckButton.Active; f_Config["Engines/"+engine+"/SshUsername"] = f_CredentialsWidget.SshUsernameEntry.Text.Trim(); if (f_CredentialsWidget.SshPasswordVBox.Visible) { f_Config["Engines/"+engine+"/SshPassword"] = f_CredentialsWidget.SshPasswordEntry.Text; } f_Config["Engines/"+engine+"/SshKeyfile"] = f_CredentialsWidget.SshKeyfileChooserButton.Filename ?? String.Empty; f_Config["Engines/"+engine+"/SshHostname"] = f_ConnectionWidget.SshHostEntry.Text.Trim(); f_Config["Engines/"+engine+"/SshPort"] = f_ConnectionWidget.SshPortSpinButton.ValueAsInt; // HACK: we don't really support any other channels/formatters (yet) f_Config["Engines/"+engine+"/Channel"] = "TCP"; f_Config["Engines/"+engine+"/Formatter"] = "binary"; f_Config.Save(); } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/NetworkManager.cs0000644000175000017500000001133112253423337022065 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if IPC_DBUS using System; using System.Threading; #if DBUS_SHARP using DBus; #else using NDesk.DBus; #endif using Smuxi.Common; namespace Smuxi.Frontend.Gnome { public enum StateNM8 : int { Unknown = 0, Asleep, Connecting, Connected, Disconnected } public enum StateNM9 : int { Unknown = 0, Asleep = 10, Disconnected = 20, Disconnecting = 30, Connecting = 40, ConnectedLocal = 50, ConnectedSite = 60, ConnectedGlobal = 70 } public delegate void StateChangedEventHandler(int state); [Interface("org.freedesktop.NetworkManager")] public interface INetworkManager { string Version(); event StateChangedEventHandler StateChanged; } public class NetworkManager { #if LOG4NET private static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif const string BusName = "org.freedesktop.NetworkManager"; const string ObjectPath = "/org/freedesktop/NetworkManager"; INetworkManager Manager { get; set; } ChatViewManager ChatViewManager { get; set; } bool IsInitialized { get; set; } bool WasLocalEngine { get; set; } public NetworkManager(ChatViewManager chatViewManager) { if (chatViewManager == null) { throw new ArgumentNullException("mainWindow"); } ChatViewManager = chatViewManager; try { Init(); } catch (Exception ex) { #if LOG4NET Logger.Error("NetworkManager(): initialization failed: ", ex); #endif } } void Init() { BusG.Init(); if (!Bus.System.NameHasOwner(BusName)) { return; } Manager = Bus.System.GetObject( BusName, new ObjectPath(ObjectPath) ); Manager.StateChanged += OnStateChanged; IsInitialized = true; } void OnStateChanged(int state) { Trace.Call(state); if (!Frontend.HadSession) { return; } switch (state) { case (int) StateNM9.Disconnecting: if (!Frontend.IsLocalEngine) { Frontend.DisconnectEngineFromGUI(true); } break; case (int) StateNM8.Disconnected: case (int) StateNM9.Disconnected: WasLocalEngine = Frontend.IsLocalEngine; if (!Frontend.IsLocalEngine) { Frontend.DisconnectEngineFromGUI(false); } break; case (int) StateNM8.Connected: case (int) StateNM9.ConnectedSite: case (int) StateNM9.ConnectedGlobal: if (WasLocalEngine) { // reconnect local protocol managers foreach (var protocolManager in Frontend.Session.ProtocolManagers) { var pm = protocolManager; // run in background so it can't block the GUI ThreadPool.QueueUserWorkItem(delegate { try { pm.Reconnect(Frontend.FrontendManager); } catch (Exception ex) { Frontend.ShowException(ex); } }); } } else { Frontend.ReconnectEngineToGUI(false); } break; } } } } #endif smuxi-0.11/src/Frontend-GNOME/SplashScreenWindow.cs0000644000175000017500000000276711655545675022757 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.Frontend.Gnome { public class SplashScreenWindow : Gtk.Window { public SplashScreenWindow() : base("Smuxi - Splashscreen") { Decorated = false; WindowPosition = Gtk.WindowPosition.Center; Add(new Gtk.Image(new Gdk.Pixbuf(null, "splashscreen.png"))); ShowAll(); // force GTK+ to draw us, regardless if we are in the glib/gtk main-loop while (Gtk.Application.EventsPending()) { Gtk.Application.RunIteration(); } } } } smuxi-0.11/src/Frontend-GNOME/IndicateManager.cs0000644000175000017500000004517212257043746022174 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010-2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if INDICATE_SHARP || MESSAGING_MENU_SHARP using System; using System.IO; using System.Text.RegularExpressions; using System.Collections.Generic; using System.Runtime.InteropServices; #if INDICATE_SHARP using Indicate; #elif MESSAGING_MENU_SHARP using MessagingMenu; #endif #if IPC_DBUS #if DBUS_SHARP using DBus; #else using NDesk.DBus; #endif #endif using Gtk.Extensions; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public class IndicateManager : IDisposable { #if LOG4NET private static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif const string BusName = "com.canonical.indicator.session"; private static string PersonChatIconBase64 { get; set; } private static string GroupChatIconBase64 { get; set; } #if INDICATE_SHARP Server Server { get; set; } Dictionary Indicators { get; set; } #elif MESSAGING_MENU_SHARP private static DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0); App App { get; set; } Dictionary Sources { get; set; } #endif MainWindow MainWindow { get; set; } ChatViewManager ChatViewManager { get; set; } Dictionary HighlightEventHandlers { get; set; } bool IsInitialized { get; set; } bool IsEnabled { get; set; } string DesktopFile { get; set; } static IndicateManager() { PersonChatIconBase64 = Convert.ToBase64String( PersonChatView.IconPixbuf.SaveToBuffer("png") ); GroupChatIconBase64 = Convert.ToBase64String( GroupChatView.IconPixbuf.SaveToBuffer("png") ); } public IndicateManager(MainWindow mainWindow, ChatViewManager chatViewManager) { Trace.Call(mainWindow, chatViewManager); if (mainWindow == null) { throw new ArgumentNullException("mainWindow"); } if (chatViewManager == null) { throw new ArgumentNullException("chatViewManager"); } MainWindow = mainWindow; ChatViewManager = chatViewManager; #if INDICATE_SHARP Indicators = new Dictionary(); #elif MESSAGING_MENU_SHARP Sources = new Dictionary(); #endif HighlightEventHandlers = new Dictionary (); try { Init(); } catch (Exception ex) { #if LOG4NET Logger.Error("IndicateManager(): initialization failed: ", ex); #endif } } public void Dispose() { Trace.Call(); MainWindow.FocusInEvent -= OnMainWindowFocusInEvent; MainWindow.Notebook.SwitchPage -= OnMainWindowNotebookSwitchPage; ChatViewManager.ChatAdded -= OnChatViewManagerChatAdded; ChatViewManager.ChatRemoved -= OnChatViewManagerChatRemoved; #if INDICATE_SHARP Server.Hide(); #elif MESSAGING_MENU_SHARP App.Unregister(); App.Dispose(); #endif } public void ApplyConfig(UserConfig userConfig) { Trace.Call(userConfig); if (userConfig == null) { throw new ArgumentNullException("userConfig"); } if (!IsInitialized) { return; } var home = Environment.GetFolderPath(Environment.SpecialFolder.Personal); var blacklistPath = Path.Combine(home, ".config"); blacklistPath = Path.Combine(blacklistPath, "indicators"); blacklistPath = Path.Combine(blacklistPath, "messages"); blacklistPath = Path.Combine(blacklistPath, "applications-blacklist"); if (!Directory.Exists(blacklistPath)) { Directory.CreateDirectory(blacklistPath); } blacklistPath = Path.Combine(blacklistPath, "smuxi-frontend-gnome"); if ((bool) userConfig["Interface/Notification/MessagingMenuEnabled"]) { // persist in menu if (File.Exists(blacklistPath)) { File.Delete(blacklistPath); } var path = Path.Combine(home, ".config"); path = Path.Combine(path, "indicators"); path = Path.Combine(path, "messages"); path = Path.Combine(path, "applications"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } path = Path.Combine(path, "smuxi-frontend-gnome"); File.WriteAllText(path, DesktopFile + "\n"); #if INDICATE_SHARP Server.Show(); #elif MESSAGING_MENU_SHARP App.Register(); #endif IsEnabled = true; } else { // non-persistent in menu using the blacklist as per // specification: // https://wiki.ubuntu.com/MessagingMenu/#Registration File.WriteAllText(blacklistPath, DesktopFile + "\n"); #if INDICATE_SHARP Server.Hide(); #elif MESSAGING_MENU_SHARP App.Unregister(); #endif IsEnabled = false; } } void OnMainWindowFocusInEvent(object sender, Gtk.FocusInEventArgs e) { if (MainWindow.Notebook.IsBrowseModeEnabled) { return; } var currentChatView = ChatViewManager.CurrentChatView; if (currentChatView == null) { return; } #if INDICATE_SHARP DisposeIndicator(currentChatView); #elif MESSAGING_MENU_SHARP DisposeSource(currentChatView); #endif } void OnMainWindowNotebookSwitchPage(object sender, Gtk.SwitchPageArgs e) { if (MainWindow.Notebook.IsBrowseModeEnabled) { return; } var currentChatView = ChatViewManager.CurrentChatView; if (currentChatView == null) { return; } #if INDICATE_SHARP DisposeIndicator(currentChatView); #elif MESSAGING_MENU_SHARP DisposeSource(currentChatView); #endif } void OnChatViewManagerChatAdded(object sender, ChatViewManagerChatAddedEventArgs e) { // we are only interested in highlights on person and group chats if (!(e.ChatView is PersonChatView) && !(e.ChatView is GroupChatView)) { return; } MessageTextViewMessageHighlightedEventHandler handler = delegate(object o, MessageTextViewMessageHighlightedEventArgs args) { OnChatViewMessageHighlighted(o, args, e.ChatView); }; e.ChatView.OutputMessageTextView.MessageHighlighted += handler; // keep a reference to the handler so we can cleanup it up later // in OnChatViewManagerChatRemoved() HighlightEventHandlers.Add(e.ChatView, handler); } void OnChatViewManagerChatRemoved(object sender, ChatViewManagerChatRemovedEventArgs e) { MessageTextViewMessageHighlightedEventHandler handler; if (!HighlightEventHandlers.TryGetValue(e.ChatView, out handler)) { return; } e.ChatView.OutputMessageTextView.MessageHighlighted -= handler; HighlightEventHandlers.Remove(e.ChatView); // close possibly active indicator #if INDICATE_SHARP DisposeIndicator(e.ChatView); #elif MESSAGING_MENU_SHARP DisposeSource(e.ChatView); #endif } void OnChatViewMessageHighlighted(object sender, MessageTextViewMessageHighlightedEventArgs e, ChatView chatView) { if (!IsEnabled || e.Message.TimeStamp <= chatView.SyncedLastSeenHighlight || MainWindow.HasToplevelFocus) { return; } #if INDICATE_SHARP ShowIndicator(chatView, e.Message); #elif MESSAGING_MENU_SHARP ShowSource(chatView, e.Message); #endif } #if INDICATE_SHARP void Init() { Trace.Call(); #if IPC_DBUS if (!Bus.Session.NameHasOwner(BusName)) { #if LOG4NET Logger.Info("Init(): no DBus provider for messaging menu found, " + "disabling..."); #endif return; } #endif Server = Server.RefDefault(); if (Server == null) { // just in case return; } // all checks return false for some reason /* if (!Server.CheckInterest(Interests.ServerDisplay)) { #if LOG4NET Logger.Info("Init() the indicate server is not interested in " + "us, thus no messaging menu :/"); #endif return; } */ var partialPath = "share"; partialPath = Path.Combine(partialPath, "applications"); partialPath = Path.Combine(partialPath, "smuxi-frontend-gnome.desktop"); var insDesktopFile = Path.Combine(Defines.InstallPrefix, partialPath); var sysDesktopFile = Path.Combine("/usr", partialPath); if (File.Exists(insDesktopFile)) { DesktopFile = insDesktopFile; } else if (File.Exists(sysDesktopFile)) { DesktopFile = sysDesktopFile; } else { #if LOG4NET Logger.Error("Init(): smuxi-frontend-gnome.desktop could not " + " be found, thus no messaging menu :/"); #endif return; } Server.SetType("message.im"); Server.DesktopFile(DesktopFile); Server.ServerDisplay += OnServerServerDisplay; MainWindow.FocusInEvent += OnMainWindowFocusInEvent; MainWindow.Notebook.SwitchPage += OnMainWindowNotebookSwitchPage; ChatViewManager.ChatAdded += OnChatViewManagerChatAdded; ChatViewManager.ChatRemoved += OnChatViewManagerChatRemoved; IsInitialized = true; } void ShowIndicator(ChatView chatView, MessageModel msg) { Indicator indicator; if (Indicators.TryGetValue(chatView, out indicator)) { // update time of existing indicator indicator.SetProperty( "time", msg.TimeStamp.ToLocalTime().ToString("s") ); return; } indicator = new Indicator(); indicator.SetProperty("subtype", "im"); if (chatView is PersonChatView) { indicator.SetProperty("icon", PersonChatIconBase64); indicator.SetProperty("sender", chatView.Name); } if (chatView is GroupChatView) { indicator.SetProperty("icon", GroupChatIconBase64); var nick = GetNick(msg); if (nick == null) { indicator.SetProperty("sender", chatView.Name); } else { indicator.SetProperty("sender", String.Format( "{0} ({1})", chatView.Name, nick ) ); } } indicator.SetProperty( "time", msg.TimeStamp.ToLocalTime().ToString("s") ); indicator.SetPropertyBool("draw-attention", true); indicator.UserDisplay += delegate { try { MainWindow.PresentWithServerTime(); ChatViewManager.CurrentChatView = chatView; DisposeIndicator(chatView); } catch (Exception ex) { #if LOG4NET Logger.Error("OnChatViewMessageHighlighted() " + "indicator.UserDisplay threw exception", ex); #endif } }; try { indicator.Show(); } catch (Exception ex) { #if LOG4NET Logger.Error("OnChatViewMessageHighlighted() " + "indicator.Show() thew exception", ex); #endif } Indicators.Add(chatView, indicator); } void DisposeIndicator(ChatView chatView) { Indicator indicator; if (!Indicators.TryGetValue(chatView, out indicator)) { return; } #if LOG4NET Logger.Debug("DisposeIndicator(): disposing indicator for: " + chatView.Name); #endif try { indicator.Hide(); } catch (Exception ex) { #if LOG4NET Logger.Error("DisposeIndicator(): " + "indicator.Hide() thew exception", ex); #endif } finally { Indicators.Remove(chatView); } } void OnServerServerDisplay(object sender, ServerDisplayArgs e) { Trace.Call(sender, e); MainWindow.PresentWithTime(e.Timestamp); } #elif MESSAGING_MENU_SHARP void Init() { Trace.Call(); #if IPC_DBUS if (!Bus.Session.NameHasOwner(BusName)) { #if LOG4NET Logger.Info("Init(): no DBus provider for messaging menu found, " + "disabling..."); #endif return; } #endif App = new App("smuxi-frontend-gnome.desktop"); App.ActivateSource += OnAppActivateSource; MainWindow.FocusInEvent += OnMainWindowFocusInEvent; MainWindow.Notebook.SwitchPage += OnMainWindowNotebookSwitchPage; ChatViewManager.ChatAdded += OnChatViewManagerChatAdded; ChatViewManager.ChatRemoved += OnChatViewManagerChatRemoved; IsInitialized = true; } void ShowSource(ChatView chatView, MessageModel msg) { Trace.Call(chatView, msg); string sourceId; var time = (Int64) ((msg.TimeStamp - UnixEpoch).TotalMilliseconds * 1000L); if (Sources.TryGetValue(chatView, out sourceId)) { // update time of existing source App.SetSourceTime(sourceId, time); return; } // TODO: TEST ME! sourceId = chatView.ID; string iconName = null; string label = null; if (chatView is PersonChatView) { iconName = "smuxi-person-chat"; label = chatView.Name; } else if (chatView is GroupChatView) { iconName = "smuxi-group-chat"; var nick = GetNick(msg); if (nick == null) { label = chatView.Name; } else { label = String.Format("{0} ({1})", chatView.Name, nick); } } var theme = Gtk.IconTheme.Default; GLib.Icon icon = null; if (Frontend.HasSystemIconTheme && iconName != null && theme.HasIcon(iconName)) { icon = new GLib.ThemedIcon(iconName); } else if (iconName != null && theme.HasIcon(iconName)) { // icon wasn't in the system icon theme var iconInfo = theme.LookupIcon(iconName, 256, Gtk.IconLookupFlags.UseBuiltin); if (!String.IsNullOrEmpty(iconInfo.Filename) && File.Exists(iconInfo.Filename)) { icon = new GLib.FileIcon( GLib.FileFactory.NewForPath(iconInfo.Filename) ); } } App.AppendSource(sourceId, icon, label); App.SetSourceTime(sourceId, time); App.DrawAttention(sourceId); Sources.Add(chatView, sourceId); } void DisposeSource(ChatView chatView) { Trace.Call(chatView); try { string sourceId; if (!Sources.TryGetValue(chatView, out sourceId)) { return; } App.RemoveSource(sourceId); } finally { Sources.Remove(chatView); } } void OnAppActivateSource(object sender, ActivateSourceArgs e) { Trace.Call(sender, e); try { MainWindow.PresentWithServerTime(); ChatView chatView = null; foreach (var kvp in Sources) { if (kvp.Value != e.SourceId) { continue; } chatView = kvp.Key; } if (chatView == null) { return; } ChatViewManager.CurrentChatView = chatView; DisposeSource(chatView); } catch (Exception ex) { #if LOG4NET Logger.Error("OnAppActivateSource(): Exception", ex); #endif } } #endif string GetNick(MessageModel msg) { // HACK: try to obtain the nickname from the message // TODO: extend MessageModel with Origin property var msgText = msg.ToString(); var match = Regex.Match(msgText, "^<([^ ]+)>"); if (match.Success && match.Groups.Count >= 2) { return match.Groups[1].Value; } return null; } } } #endif smuxi-0.11/src/Frontend-GNOME/OpenChatDialog.cs0000644000175000017500000000356111655545675022007 0ustar00meebeymeebey00000000000000// $Id$ // // Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2009 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public partial class OpenChatDialog : Gtk.Dialog { public ChatType ChatType { get { return f_ChatTypeWidget.ChatType; } } public string ChatName { get { return f_NameEntry.Text; } } public OpenChatDialog(Gtk.Window parent) { Trace.Call(parent); if (parent == null) { throw new ArgumentNullException("parent"); } Build(); TransientFor = parent; f_NameEntry.Changed += OnNameEntryChanged; f_NameEntry.HasFocus = true; } protected virtual void OnNameEntryChanged(object sender, EventArgs e) { Trace.Call(sender, e); f_OpenButton.Sensitive = f_NameEntry.Text.Trim().Length > 0; } } } smuxi-0.11/src/Frontend-GNOME/smuxi-frontend-gnome.in0000644000175000017500000000013111700531610023211 0ustar00meebeymeebey00000000000000#!/bin/sh exec mono --debug "@expanded_libdir@/@PACKAGE@/smuxi-frontend-gnome.exe" "$@" smuxi-0.11/src/Frontend-GNOME/ChangeLog0000644000175000017500000004410511655545675020410 0ustar00meebeymeebey000000000000002008-12-31 Mirco Bauer * MainWindow.cs: Use Session.Connect() API instead of faking user input and hoping the protocol manager will like our format. (closes trac bug #141) 2008-12-28 Mirco Bauer * MainWindow.cs: White space fix. 2008-12-28 Mirco Bauer * Frontend.cs: Init(): Pass application name and parameters to GTK initialization. Init(): Set default icon. Quit(): Only store window size / state and position if the MainWindow is visible, else quitting when being in the engine manager dialog would reset the values in the config. Quit(): catch RemotingException when telling the frontend manager that we are disconnecting, else Quit() would throw an exception when we try to quit like when we lost the connection to the server. Only log exception type instead of full message (via ToString) in Trace.Call() else it clutters the log. 2008-12-28 Mirco Bauer * Main.cs: Disabled bailing out when unknown options are passed, as GTK+ and GNOME handles some too. 2008-12-28 Mirco Bauer * Preferences/PreferencesDialog.cs: Disabled Filters in preferences tree view, as it's not implemented anyhow. 2008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-12-28 Mirco Bauer * Chats/ChatView.cs, Notebook.cs: Implemented remembering last seen highlight in chats, so frontends will not re-highlight when re-attaching. (closes trac ticket #97) 2008-12-27 Mirco Bauer * Preferences/PreferencesDialog.cs: Check for empty nickname field. (closes trac bug #123) 2008-12-27 Mirco Bauer * FindGroupChatDialog.cs, Preferences/ServerListView.cs: Pass parent to ShowError. * gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs: lol, useless stetic change again * Frontend.cs: Support parent in ShowError() method and use MainWindow as fallback. Fixed threading bug in ShowError() and ShowException() when marshalling the call into the GUI-thread. 2008-12-26 Mirco Bauer * Frontend.cs: Updated copyright year. 2008-12-26 Mirco Bauer * MainWindow.cs, Frontend.cs: Save / Restore maxmized windows correctly. 2008-12-26 Mirco Bauer * Chats/ChatView.cs: Disabled Console.WriteLine call. * gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs: funny stetic insisting doing useless changes * Frontend.cs: Code clean-up. 2008-12-22 Mirco Bauer * Chats/GroupChatView.cs: Some cleanup. * EngineManagerDialog.cs: Take care of failed Disconnect() attempts. 2008-12-22 Mirco Bauer * Frontend.cs: Made notification area icon configurable, supporting: never, always, minimize to tray, close to tray. (closes trac ticket #137) When a RemotingException happens allow the user to reconnect to the server instead of killing the frontend. Added preferences to notification area icon context menu as per GNOME HIG. * MainWindow.cs, Preferences/PreferencesDialog.cs: Made notification area icon configurable, supporting: never, always, minimize to tray, close to tray. (closes trac ticket #137) 2008-12-19 Mirco Bauer * Preferences/PreferencesDialog.cs, Chats/ChatView.cs: Implemented support for changing the text wrap mode from character to word. (closes trac ticket #5) 2008-12-19 Mirco Bauer * FindGroupChatDialog.cs: Only change cursor back if the GdkWindow is still available. 2008-12-19 Mirco Bauer * MainWindow.cs: Changed the event that quits the application from Destroyed to DeleteEvent, else we can't get the last window size when the window is already gone. (closes trac bug #121) 2008-12-17 Mirco Bauer * Chats/ChatView.cs: Only check if text was selected, instead of checking if the chat has a selection, as the property is overridden in GroupChatView. (part of fixing trac bug #112) * Chats/GroupChatView.cs: Destroy the selection when the treeview looses the focus and don't let the context menu grab the focus. (part of fixing trac bug #112) 2008-12-17 Mirco Bauer * Preferences/PreferencesDialog.cs: Renamed ModeColor to EventColor. * Chats/ChatView.cs: Added HasEvent property and use it in AddMesage() with checking MessageType. 2008-10-08 Mirco Bauer * Entry.cs: support unicode input using ctrl+shift+u+hexnumber 2008-09-04 Mirco Bauer * Preferences/ServerView.cs, gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs, gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs, gtk-gui/gui.stetic, QuickConnectDialog.cs: Implemented hide/unhide password entries. (closes trac ticket #116) 2008-09-03 Mirco Bauer * FindGroupChatDialog.cs: Use a new thread when calling FindGroupChat on the protocol manager, as that one might block and never returns which would let the GUI freeze forever. (closes trac ticket #104) Set mouse cursor to busy when searching for chats. (closes trac bug #115) * Frontend.cs: Support calls from non-GUI threads in ShowException() and ShowError(). Added overload of ShowError() with Exception as parameter. 2008-09-02 Mirco Bauer * AboutDialog.cs: Added credits for British English and French translation. 2008-08-31 Mirco Bauer * Frontend-GNOME.mdp: Added po files to MonoDevelop projects. 2008-08-31 Mirco Bauer * AboutDialog.cs: Added Juan Miguel Carrero to translator credits. 2008-08-28 Mirco Bauer * ColorTools.cs: Set eol-style to native and converted files using dos2unix where needed. 2008-08-28 Mirco Bauer * Frontend.cs, MainWindow.cs, ChatView.cs: Implementated tray icon support (requires GTK# >= 2.10). (closes trac bug #55) 2008-08-27 Mirco Bauer * AboutDialog.cs: Replaced (C) with © (copyright character). Added link to smuxi's website. (thanks to George Retsinas for noticing this) 2008-08-27 Mirco Bauer * MainWindow.cs, Preferences/ServerListView.cs, Preferences/ServerView.cs, Preferences/PreferencesDialog.cs, AboutDialog.cs, QuickConnectDialog.cs: Set TransientFor property correctly for all dialogs. (thanks to George Retsinas for reporting this) 2008-08-25 Mirco Bauer * Makefile.am, smuxi-frontend-gnome.pc.in: Removed unneeded pkg-config files. 2008-08-25 Mirco Bauer * Frontend.cs, EngineManagerDialog.cs, Notebook.cs: Fixed switching between local engine and remote engine back and forth. (closes trac bug #106) 2008-08-25 Mirco Bauer * GnomeUI.cs: Disabled highlight reset hack in SyncChat() as that confuses local engine users (as it causes a bug for the first message) and doesn't really help remote engine users anyway (as they miss highlights they received since the last connect). 2008-08-24 Mirco Bauer * MainWindow.cs, Entry.cs: Moved ctrl+page up/down handling to menu. 2008-08-24 Mirco Bauer * MainWindow.cs, Frontend.cs: Implemented store and restore window size / position. (closes trac ticket #91) 2008-08-24 Mirco Bauer * EngineManagerDialog.cs, Entry.cs, Frontend.cs: Use _() wrapper. 2008-08-24 Mirco Bauer * Frontend.cs: Initialize gettext during startup. 2008-08-22 Mirco Bauer * Chats/ChatView.cs: Disabled console writelines. Use Process.Start() if not compiled with UI_GNOME. 2008-08-22 Mirco Bauer * Frontend.cs: Implemtend ShowError(string) method. * Preferences/ServerListView.cs: Handle InvalidOperationException. 2008-08-22 Mirco Bauer * Chats/ChatView.cs: Support empty timestamp formats. (closes trac bug #84) 2008-08-21 Mirco Bauer * Preferences/PreferencesDialog.cs: Use the more descriptive "" as text for encodings instead of an empty string. (closes trac bug #82) 2008-08-21 Mirco Bauer * ChatViewManager.cs: Fixed sorting order of group and person chats when there is no next protocol chat available. (Closes trac bug #87) 2008-08-05 Mirco Bauer * Preferences/PreferencesDialog.cs: Use ColorTools instead of broken local conversion methods. * Chats/ChatView.cs: Apply overriden background color in AddMessage(). Better debug output for GetBestTextColor(). * ColorTools.cs: Implemented GetHexCodeColor(Gdk.Color). Check hex code length in GetGdkColor(string). Fixed Gdk.Color to hex code conversion using bit shifting. (thanks to Zhila) 2008-08-04 Mirco Bauer * Chats/ChatView.cs, ColorTools.cs: Implemented getting a good color based on the background color for a good contrast. Thanks to Mikael and Zhila for the algorithm! 2008-07-30 Mirco Bauer * Frontend-GNOME.mdp, smuxi-frontend-gnome.exe.config: Added .exe.config for log4net configuration to project. 2008-07-30 Mirco Bauer * QuickConnectDialog.cs: Fixed server selection using "double click", by setting f_ServerModel before confirming the dialog. (closes trac bug #80) 2008-07-28 Mirco Bauer * Frontend-GNOME.mdp: Build as WinExe. 2008-07-27 Mirco Bauer * ChatViewManager.cs: Implemented grouping person and group chats to their protocol chat. (closes trac bug #54) 2008-07-27 Mirco Bauer * Frontend-GNOME.mdp: Removed AssemblyInfo.cs.in from project. 2008-07-27 Mirco Bauer * MainWindow.cs: Use Gtk.Stock.About button. 2008-07-27 Mirco Bauer * Chats/GroupChatView.cs: Implemented applying topic and user list position settings for existing chats. (closes trac bug #56) Refactored code to apply layout changes for topic and user list position. 2008-07-27 Mirco Bauer * ChatViewManager.cs, Makefile.am: Allow re-ordering of tabs if GTK# 2.10 is available. (closes tac bug #68) 2008-07-27 Mirco Bauer * AssemblyInfo.cs.in: Removed AssemblyInfo.cs.in files, not needed anymore as we use a shared AssemblyVersion.cs(.in) now. 2008-07-27 Mirco Bauer * Chats/GroupChatView.cs: Only prevent making a new selection using the right mouse button if the selection is actually multiple (>= 2 persons). 2008-07-27 Mirco Bauer * Chats/GroupChatView.cs, Chats/ChatView.cs: Implemented selecting multiple person in a group chat. (closes trac bug #73) Refactored person context menu commands to support a list of persons. 2008-07-27 Mirco Bauer * Chats/GroupChatView.cs, Chats/ChatView.cs: Initialize _Background and _Foregroundcolor correctly using Nullable as Gdk.Color.Zero == color black. 2008-07-27 Mirco Bauer * Frontend-GNOME.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-25 Mirco Bauer * MainWindow.cs: Allow to close a chat using ctrl+w if it's not the session chat (instead of checking for group chat only) (really closes trac bug #67) Updated copyright year. 2008-07-24 Mirco Bauer * Chats/GroupChatView.cs, Chats/ChatView.cs, Entry.cs: Use monospace bold as default font. Parse pango font description once. 2008-07-22 Mirco Bauer * Makefile.am: Distribute and install .exe.config files. 2008-07-22 Mirco Bauer * Frontend.cs: Disabled splashscreen (we have no current logo anyhow). 2008-07-22 Mirco Bauer * Makefile.am, Main.cs, Frontend-GNOME.mdp, AssemblyInfo.cs.in, AssemblyInfo.cs: Made debug logging an explicit command line parameter (closes trac bug#59). 2008-07-22 Mirco Bauer * Entry.cs: Pass "/window close" to IProtocolManager.CloseChat() instead of doing nothing (before it was a disabled protocol specific hack) (closes trac bug #67). 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-07-17 Mirco Bauer * MainWindow.cs: Added close chat menu item. * Chats/ChatView.cs: Made Close() method public. Removed accelerator from Close menu item, MainWindow handles this now. 2008-07-17 Mirco Bauer * Preferences/ServerView.cs: glade3 renamed some widgets because of a conflict ignoring the fact that it those have different toplevel widgets 2008-07-17 Mirco Bauer * Entry.cs: Reset cursor position to the end when going up in the command history. 2008-07-17 Mirco Bauer * Frontend.cs: Don't rely on Application.Quit(), call Environment.Quit() afterwards to be sure we are quitting. 2008-07-17 Mirco Bauer * MainWindow.cs, EngineManagerDialog.cs, FirstStartDruid.cs, Frontend-GNOME.mdp, EngineDruid.cs, NewEngineDruid.cs: Renamed NewEngineDruid to EngineDruid. Implemented edit mode of EngineDruid (closes trac bug #14). * SteticPreferencesDialog.cs: Added license header. 2008-07-16 Mirco Bauer * MainWindow.cs, Frontend.cs, Preferences/PreferencesDialog.cs, Chats/GroupChatView.cs, Chats/ChatView.cs, Entry.cs, ChatViewManager.cs: Implemented basic theming support (closes trac bug #19). 2008-07-15 Mirco Bauer * MainWindow.cs, Frontend.cs, GnomeUI.cs, ChatViewManager.cs: Failed attempt to fix trac bug #50 2008-07-15 Mirco Bauer * MainWindow.cs, FindGroupChatDialog.cs, gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs, gtk-gui/gui.stetic: Implemented FindGroupChatDialog (closes trac bug #13). 2008-07-15 Mirco Bauer * Chats/SessionChatView.cs, Chats/PersonChatView.cs, Chats/GroupChatView.cs, Chats/ChatView.cs: Fixed icon / label position on tabs. 2008-07-14 Mirco Bauer * Entry.cs: Fixed brace in help output. 2008-07-14 Mirco Bauer * Frontend.cs: Fixed indention. Call Quit() in ShowException, as thats what the message (CrashDialog) says. Don't run first start druid anymore. 2008-07-14 Mirco Bauer * Entry.cs: Fixed loosing the selection issue when bringing focus back to the input entry. 2008-07-12 Mirco Bauer * MainWindow.cs, Frontend-GNOME.mdp, gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs, gtk-gui/Smuxi.Frontend.Gnome.ConnectDialog.cs, gtk-gui/gui.stetic, QuickConnectDialog.cs: Merged ConnectDialog and QuickConnectDialog for sharing more code and better user experience. (closes trac bug #39) 2008-07-07 Mirco Bauer * Notebook.cs: Attempt to get focus faster back when switching a page, but doesn't work. 2008-07-07 Mirco Bauer * Entry.cs: Fixed scrolling notebook tabs (closes: trac bug #11). Fixed indention. Supress up/down GTK+ navigation, trying to leave the entry. * Chats/ChatView.cs: Expose HasFocus and HasSelection as property. 2008-07-07 Mirco Bauer * Frontend-GNOME.mdp, Chats/ProtocolChatView.cs, Chats/SessionChatView.cs, Chats/PersonChatView.cs, Chats/GroupChatView.cs, Chats/ChatView.cs, ChatViewManager.cs: Implemented tab images. 2008-06-30 Mirco Bauer * MainWindow.cs: Enhanced menu. * Preferences/ServerListView.cs: Refactored view-controlling code into own methods. * Preferences/PreferencesDialog.cs: Expose CurrentPage property. * Chats/ProtocolChatView.cs: Only show a warning when closing the protocol chats, if open chats exists. * Chats/ChatView.cs: Refactored activity / highlight code handling. * GnomeUI.cs: Clear highlight after having synced all messages, as it's less confusing when a frontend reconnects to a running smuxi server. * gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs, QuickConnectDialog.cs: Implemented QuickConnectDialog. * gtk-gui/Smuxi.Frontend.Gnome.ConnectDialog.cs, ConnectDialog.cs: Implemented ConnectDialog. 2008-06-02 Mirco Bauer * Chats/ProtocolChatView.cs: Implemented closing of protocol chats. 2008-06-02 Mirco Bauer * MainWindow.cs: Fixed whitespace. * Chats/ProtocolChatView.cs, Chats/SessionChatView.cs, Chats/PersonChatView.cs, Chats/GroupChatView.cs, Chats/ChatView.cs: Refactored tab menu code. Moved tab popup menu to ChatView. Implemented closing tabs using the middle-mouse button. 2008-06-02 Mirco Bauer * Frontend-GNOME.mdp, Chats/ProtocolChatView.cs, Chats/NetworkChatView.cs: Renamed NetworkChatView to ProtocolChatView. 2008-06-02 Mirco Bauer 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 * Frontend-GNOME.mdp: Reference GTK# 2.8 / GNOME# 2.8. 2008-04-01 Mirco Bauer * Entry.cs: Don't prevent ctrl+a/left/right/backspace key shortcuts. 2008-03-04 Mirco Bauer * Preferences/ServerView.cs: Added defaults for ICQ/AIM/MSNP. 2008-03-02 Mirco Bauer * Chats/SessionChatView.cs, Entry.cs: Implemented SessionChat*, abusing NetworkChat* as smuxi chat was a dirty hack. 2008-03-02 Mirco Bauer * Chats/ChatView.cs: Cache chat name, instead of fetching it always from the proxy object. Open URLs in a different thread on Windows (as the call is blocking). * GnomeUI.cs, ChatViewManager.cs: Fixed indention. 2008-01-31 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * Frontend-GNOME.mdp: Updated using MonoDevelop 0.18.1 * Chats/ChatView.cs: added selection fix for GTK# 2.8 smuxi-0.11/src/Frontend-GNOME/ChatTypeWidget.cs0000644000175000017500000000431511655545675022051 0ustar00meebeymeebey00000000000000// $Id$ // // Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2009 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { [System.ComponentModel.ToolboxItem(true)] public partial class ChatTypeWidget : Gtk.Bin { private Gtk.ListStore f_ListStore; public ChatType ChatType { get { Gtk.TreeIter iter; f_ComboBox.GetActiveIter(out iter); return (ChatType) f_ListStore.GetValue(iter, 0); } } public ChatTypeWidget() { Build(); Init(); } private void Init() { f_ListStore = new Gtk.ListStore( typeof(ChatType), typeof(string) ); f_ListStore.AppendValues(ChatType.Person, _("Person / Private")); f_ListStore.AppendValues(ChatType.Group, _("Group / Public")); f_ListStore.SetSortColumnId(1, Gtk.SortType.Ascending); f_ComboBox.Clear(); Gtk.CellRenderer cell = new Gtk.CellRendererText(); f_ComboBox.PackStart(cell, false); f_ComboBox.AddAttribute(cell, "text", 1); f_ComboBox.Model = f_ListStore; f_ComboBox.Active = 0; } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/Makefile.am0000644000175000017500000002443712311311336020647 0ustar00meebeymeebey00000000000000TARGET_DIR = $(top_builddir)/bin/$(PROFILE) EXTRA_DIST = $(WIN_ICON) $(DESKTOP_FILE).in $(man_MANS) man_MANS = smuxi-frontend-gnome.1 ICON_NAME = smuxi-frontend-gnome ICON_NAME_PNG = $(ICON_NAME).png ICON_SVG = $(ICON_NAME).svg GROUP_CHAT_ICON_NAME = smuxi-group-chat PERSON_CHAT_ICON_NAME = smuxi-person-chat ICON_16 = $(top_builddir)/images/16/$(ICON_NAME_PNG) ICON_22 = $(top_builddir)/images/22/$(ICON_NAME_PNG) ICON_24 = $(top_builddir)/images/24/$(ICON_NAME_PNG) ICON_32 = $(top_builddir)/images/32/$(ICON_NAME_PNG) ICON_48 = $(top_builddir)/images/48/$(ICON_NAME_PNG) ICON_128 = $(top_builddir)/images/128/$(ICON_NAME_PNG) ICON_256 = $(top_builddir)/images/256/$(ICON_NAME_PNG) WIN_ICON = $(top_srcdir)/images/icon.ico DESKTOP_FILE = smuxi-frontend-gnome.desktop THEME_DIR = $(datadir)/icons/hicolor svgicondir = $(THEME_DIR)/scalable/apps svgicon_DATA = $(ICON_SVG) icon16dir = $(THEME_DIR)/16x16/apps icon16_DATA = $(ICON_16) icon22dir = $(THEME_DIR)/22x22/apps icon22_DATA = $(ICON_22) icon24dir = $(THEME_DIR)/24x24/apps icon24_DATA = $(ICON_24) icon32dir = $(THEME_DIR)/32x32/apps icon32_DATA = $(ICON_32) icon48dir = $(THEME_DIR)/48x48/apps icon48_DATA = $(ICON_48) icon128dir = $(THEME_DIR)/128x128/apps icon128_DATA = $(ICON_128) icon256dir = $(THEME_DIR)/256x256/apps icon256_DATA = \ $(ICON_256) \ $(top_builddir)/images/256/$(GROUP_CHAT_ICON_NAME).png \ $(top_builddir)/images/256/$(PERSON_CHAT_ICON_NAME).png gtk_update_icon_cache = gtk-update-icon-cache -f -t $(THEME_DIR) desktopdir = $(datadir)/applications desktop_in_files = $(DESKTOP_FILE).in desktop_DATA = $(DESKTOP_FILE) build_datafiles = $(DESKTOP_FILE) FRONTEND_GNOME_EXE_CONFIG_SOURCE = smuxi-frontend-gnome.exe.config FRONTEND_GNOME_EXE_CONFIG = $(BUILD_DIR)/smuxi-frontend-gnome.exe.config ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = @CSC_FLAGS@ -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET,CONFIG_NINI,UI_GNOME,GTK_SHARP_2_8" -win32icon:$(WIN_ICON) @FRONTEND_GNOME_COMPILER_FLAGS@ ASSEMBLY = ../../bin/debug/smuxi-frontend-gnome.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = winexe PROJECT_REFERENCES = \ ../../bin/debug/smuxi-engine.dll \ ../../bin/debug/smuxi-common.dll \ ../../bin/debug/smuxi-frontend.dll BUILD_DIR = ../../bin/debug LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb NINI_DLL_SOURCE=../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE=../../bin/debug/smuxi-engine.dll SMUXI_FRONTEND_DLL_MDB_SOURCE=../../bin/debug/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_MDB=$(BUILD_DIR)/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_SOURCE=../../bin/debug/smuxi-frontend.dll SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll AL=al2 SATELLITE_ASSEMBLY_NAME=.resources.dll PROGRAMFILES = \ $(SMUXI_ENGINE_DLL_MDB) \ $(SMUXI_ENGINE_DLL) \ $(SMUXI_FRONTEND_DLL_MDB) \ $(SMUXI_FRONTEND_DLL) \ $(SMUXI_COMMON_DLL) \ $(FRONTEND_GNOME_EXE_CONFIG) LINUX_DESKTOPAPPLICATIONS = \ $(FRONTEND_GNOME_DESKTOP_DESKTOP) BINARIES = \ $(FRONTEND_GNOME) all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_DESKTOPAPPLICATIONS) $(BINARIES) $(ICON_SVG): $(INSTALL) -m644 $(top_srcdir)/images/icon.svg $@ $(ICON_16): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_16x16.png $@ $(ICON_22): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_22x22.png $@ $(ICON_24): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_24x24.png $@ $(ICON_32): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_32x32.png $@ $(ICON_48): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_48x48.png $@ $(ICON_128): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_128x128.png $@ $(ICON_256): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_256x256.png $@ $(top_builddir)/images/256/$(GROUP_CHAT_ICON_NAME).png: $(INSTALL) -D -m644 $(top_srcdir)/images/group-chat_256x256.png $@ $(top_builddir)/images/256/$(PERSON_CHAT_ICON_NAME).png: $(INSTALL) -D -m644 $(top_srcdir)/images/person-chat_256x256.png $@ FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ AboutDialog.cs \ CrashDialog.cs \ EngineManagerDialog.cs \ Entry.cs \ Frontend.cs \ GnomeUI.cs \ Gtk.WindowExtensions.cs \ IndicateManager.cs \ Main.cs \ MainWindow.cs \ NetworkManager.cs \ NotImplementedMessageDialog.cs \ Notebook.cs \ SplashScreenWindow.cs \ ChatTypeWidget.cs \ ChatViewManager.cs \ ColorConverter.cs \ NotifyManager.cs \ PangoTools.cs \ Preferences/ServerListView.cs \ Preferences/PreferencesDialog.cs \ Views/ChatTreeView.cs \ Views/JoinWidget.cs \ Views/MenuWidget.cs \ Views/MessageTextView.cs \ Views/ServerWidget.cs \ Views/ServerDialog.cs \ Views/FilterListWidget.cs \ Views/Chats/ChatView.cs \ Views/Chats/GroupChatView.cs \ Views/Chats/PersonChatView.cs \ Views/Chats/ProtocolChatView.cs \ Views/Chats/SessionChatView.cs \ Views/Assistants/Engine/EngineAssistantNameWidget.cs \ Views/Assistants/Engine/EngineAssistantCredentialsWidget.cs \ Views/Assistants/Engine/EngineAssistantConnectionWidget.cs \ Views/Assistants/Engine/EngineAssistantIntroWidget.cs \ Views/Assistants/Engine/EngineAssistant.cs \ Views/Tags/LinkTag.cs \ Views/Tags/PersonTag.cs \ QuickConnectDialog.cs \ SteticPreferencesDialog.cs \ FindGroupChatDialog.cs \ ChatFindDialog.cs \ OpenChatDialog.cs \ ThemeSettings.cs \ StatusIconManager.cs \ gtk-gui/generated.cs \ gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs \ gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs \ gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs \ gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs \ gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs \ gtk-gui/Smuxi.Frontend.Gnome.ChatTypeWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs \ gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.FilterListWidget.cs \ osx/AppleEvent.cs \ osx/ApplicationEvents.cs \ osx/Carbon.cs \ osx/CoreFoundation.cs \ osx/IgeMacMenu.cs DATA_FILES = \ $(DESKTOP_FILE) \ $(ICON_SVG) \ $(ICON_16) \ $(ICON_22) \ $(ICON_24) \ $(ICON_32) \ $(ICON_48) \ $(ICON_128) \ $(ICON_256) RESOURCES = \ gtk-gui/gui.stetic \ $(top_srcdir)/glade/smuxi-frontend-gnome.glade \ $(top_srcdir)/images/icon_256x256.png \ $(top_srcdir)/images/group-chat_256x256.png \ $(top_srcdir)/images/person-chat_256x256.png \ $(top_srcdir)/images/protocol-chat_256x256.png \ $(top_srcdir)/images/session-chat_256x256.png EXTRAS = \ smuxi-frontend-gnome.in \ $(FRONTEND_GNOME_EXE_CONFIG_SOURCE) REFERENCES = \ System.Runtime.Remoting \ System \ System.Core \ System.Web \ Mono.Posix \ $(GLIB_SHARP_20_LIBS) \ $(GLADE_SHARP_20_LIBS) \ $(GTK_SHARP_20_LIBS) \ $(GIO_SHARP_LIBS) \ $(LOG4NET_LIBS) \ $(INDICATE_SHARP_LIBS) \ $(MESSAGINGMENU_SHARP_LIBS) \ $(MESSAGINGMENU_SHARP_INCLUDED_LIBS) \ $(NOTIFY_SHARP_LIBS) \ $(DBUS_LIBS) DLL_REFERENCES = $(MESSAGINGMENU_SHARP_INCLUDED_LIBS) CLEANFILES = $(LINUX_DESKTOPAPPLICATIONS) $(PROGRAMFILES) $(BINARIES) \ $(top_builddir)/images/256/$(GROUP_CHAT_ICON_NAME).png \ $(top_builddir)/images/256/$(PERSON_CHAT_ICON_NAME).png include $(top_srcdir)/Makefile.include SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll FRONTEND_GNOME = $(BUILD_DIR)/smuxi-frontend-gnome FRONTEND_GNOME_DESKTOP = $(BUILD_DIR)/$(DESKTOP_FILE) SMUXI_FRONTEND_DLL = $(BUILD_DIR)/smuxi-frontend.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll if WITH_MESSAGINGMENU_SHARP_INCLUDED MESSAGINGMENU_SHARP_DLL = $(TARGET_DIR)/messagingmenu-sharp.dll MESSAGINGMENU_SHARP_DLL_SOURCE = $(top_builddir)/lib/messagingmenu-sharp/messagingmenu-sharp.dll MESSAGINGMENU_SHARP_DLL_CONFIG = $(MESSAGINGMENU_SHARP_DLL).config MESSAGINGMENU_SHARP_DLL_CONFIG_SOURCE = $(MESSAGINGMENU_SHARP_DLL_SOURCE).config $(eval $(call emit-deploy-target,MESSAGINGMENU_SHARP_DLL)) $(eval $(call emit-deploy-target,MESSAGINGMENU_SHARP_DLL_CONFIG)) MESSAGINGMENU_SHARP_INCLUDED_LIBS := $(foreach file, $(MESSAGINGMENU_SHARP_FILES), $(TARGET_DIR)/$(file)) PROGRAMFILES += $(MESSAGINGMENU_SHARP_INCLUDED_LIBS) $(MESSAGINGMENU_SHARP_INCLUDED_LIBS).config GIO_SHARP_DLL = $(TARGET_DIR)/gio-sharp.dll GIO_SHARP_DLL_SOURCE = $(GIO_SHARP_LIBS) GIO_SHARP_DLL_CONFIG = $(TARGET_DIR)/gio-sharp.dll.config GIO_SHARP_DLL_CONFIG_SOURCE = $(GIO_SHARP_LIBS).config $(eval $(call emit-deploy-target,GIO_SHARP_DLL)) $(eval $(call emit-deploy-target,GIO_SHARP_DLL_CONFIG)) GIO_SHARP_PROGRAM_FILES := $(foreach file, $(GIO_SHARP_FILES), $(shell file=$(TARGET_DIR)/$(file); echo $$file; config_file=$${file}.config; if [ -f "$$config_file" ]; then echo $$config_file; fi)) PROGRAMFILES += $(GIO_SHARP_DLL) $(GIO_SHARP_DLL_CONFIG) endif $(eval $(call emit-deploy-wrapper,FRONTEND_GNOME,smuxi-frontend-gnome,x)) $(eval $(call emit-deploy-target,FRONTEND_GNOME_DESKTOP)) $(eval $(call emit-deploy-target,FRONTEND_GNOME_EXE_CONFIG)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) %.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po-Frontend-GNOME/*.po) LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po-Frontend-GNOME/.intltool-merge-cache $(top_srcdir)/po-Frontend-GNOME $< $@ install-data-hook: update-icon-cache uninstall-hook: update-icon-cache update-icon-cache: @-if test -z "$(DESTDIR)"; then \ echo "Updating Gtk icon cache."; \ $(gtk_update_icon_cache); \ else \ echo "*** Icon cache not updated. After (un)install, run this:"; \ echo "*** $(gtk_update_icon_cache)"; \ fi smuxi-0.11/src/Frontend-GNOME/ChatViewManager.cs0000644000175000017500000003701712264335155022161 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using System.Globalization; using Mono.Unix; using Smuxi.Common; using Smuxi.Engine; using Smuxi.Frontend; namespace Smuxi.Frontend.Gnome { public class ChatViewManager : ChatViewManagerBase { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private List f_Chats = new List(); public IList SyncedChats { get; private set; } private Notebook f_Notebook; ChatTreeView TreeView { get; set; } private UserConfig f_Config; ChatViewSyncManager SyncManager { get; set; } bool AutoSwitchPersonChats { get; set; } bool AutoSwitchGroupChats { get; set; } public event ChatViewManagerChatAddedEventHandler ChatAdded; public event ChatViewManagerChatRemovedEventHandler ChatRemoved; public event EventHandler ChatSynced; public override IChatView ActiveChat { get { return CurrentChatView; } } public ChatView CurrentChatView { get { return TreeView.CurrentChatView; } set { if (value == null) { return; } f_Notebook.CurrentChatView = value; TreeView.CurrentChatView = value; } } public int CurrentChatNumber { get { if (CurrentChatView == null) { return -1; } return TreeView.CurrentChatNumber; } set { if (value >= f_Chats.Count) { value = 0; } if (value < 0) { value = f_Chats.Count - 1; } TreeView.CurrentChatNumber = value; } } public IList Chats { get { return f_Chats; } } public bool IsSensitive { set { f_Notebook.Sensitive = value; TreeView.Sensitive = value; Frontend.MainWindow.MenuWidget.Sensitive = value; Frontend.MainWindow.Entry.Sensitive = value; } get { return f_Notebook.Sensitive; } } public ChatViewManager(Notebook notebook, ChatTreeView treeView) { f_Notebook = notebook; TreeView = treeView; TreeView.Selection.Changed += OnTreeViewSelectionChanged; SyncedChats = new List(); SyncManager = new ChatViewSyncManager(); SyncManager.ChatAdded += OnChatAdded; SyncManager.ChatSynced += OnChatSynced; SyncManager.WorkerException += OnWorkerException; } /// /// This method is thread safe. /// public override void AddChat(ChatModel chat) { if (chat == null) { throw new ArgumentNullException("chat"); } SyncManager.QueueAdd(chat); } public override void RemoveChat(ChatModel chat) { ChatView chatView = GetChat(chat); if (chatView == null) { #if LOG4NET f_Logger.Warn("RemoveChat(): chatView is null!"); #endif return; } f_Notebook.RemovePage(f_Notebook.PageNum(chatView)); TreeView.Remove(chatView); f_Chats.Remove(chatView); SyncManager.Remove(chat); SyncedChats.Remove(chatView); if (ChatRemoved != null) { ChatRemoved(this, new ChatViewManagerChatRemovedEventArgs(chatView)); } chatView.Dispose(); } public override void EnableChat(ChatModel chat) { ChatView chatView = GetChat(chat); if (chatView == null) { #if LOG4NET f_Logger.Warn("EnableChat(): chatView is null!"); #endif return; } chatView.Enable(); } public override void DisableChat(ChatModel chat) { ChatView chatView = GetChat(chat); if (chatView == null) { #if LOG4NET f_Logger.Warn("DisableChat(): chatView is null!"); #endif return; } SyncedChats.Remove(chatView); chatView.Disable(); } /// /// This method is thread safe. /// public void SyncChat(ChatModel chat) { if (chat == null) { throw new ArgumentNullException("chat"); } SyncManager.QueueSync(chat); } public ChatView GetChat(ChatModel chatModel) { return f_Notebook.GetChat(chatModel); } public virtual void ApplyConfig(UserConfig config) { Trace.Call(config); if (config == null) { throw new ArgumentNullException("config"); } var prefix = "Interface/Notebook/"; AutoSwitchPersonChats = config[prefix + "AutoSwitchPersonChats"] as bool? ?? false; AutoSwitchGroupChats = config[prefix + "AutoSwitchGroupChats"] as bool? ?? true; f_Config = config; foreach (ChatView chat in f_Chats) { chat.ApplyConfig(f_Config); } } public void Clear() { Trace.Call(); var chats = new List(f_Chats); foreach (var chat in chats) { // clean up ChatView and all notify related resources like // StatusIconManager, NotifyManager and IndicateManager RemoveChat(chat.ChatModel); } f_Config = null; SyncedChats.Clear(); SyncManager.Clear(); } public void ClearAllActivity() { Trace.Call(); f_Notebook.ClearAllActivity(); } public void Minimize() { Trace.Call(); Frontend.MainWindow.Iconify(); } public ProtocolChatView FindProtocolChatViewParent(ChatView child) { foreach (var candidate in Chats) { if (!(candidate is ProtocolChatView) || candidate.ProtocolManager == null) { continue; } if (child.ProtocolManager != candidate.ProtocolManager) { continue; } return (ProtocolChatView) candidate; } return null; } void OnChatAdded(object sender, ChatViewAddedEventArgs e) { Trace.Call(sender, e); GLib.Idle.Add(delegate { var chatView = (ChatView) CreateChatView(e.ChatModel, e.ChatType, e.ProtocolManagerType); chatView.ID = e.ChatID; chatView.Name = e.ChatID; chatView.Position = e.ChatPosition; chatView.ProtocolManager = e.ProtocolManager; f_Chats.Add(chatView); if (f_Config != null) { chatView.ApplyConfig(f_Config); } // POSSIBLE REMOTING CALL int idx = GetSortedChatPosition(chatView); #if LOG4NET f_Logger.Debug("OnChatAdded(): adding " + "<" + chatView.ID + "> at: " + idx); #endif if (idx == -1) { f_Notebook.AppendPage(chatView, chatView.LabelWidget); } else { f_Notebook.InsertPage(chatView, chatView.LabelWidget, idx); } TreeView.Append(chatView); // notify the sync manager that the ChatView is ready to be synced SyncManager.ReleaseSync(chatView); #if GTK_SHARP_2_10 f_Notebook.SetTabReorderable(chatView, true); #endif // we can't do auto switch for remote engines for now as that // kills all unseen highlights, see: // https://www.smuxi.org/issues/show/866 if (Frontend.IsLocalEngine) { if ((chatView is PersonChatView && AutoSwitchPersonChats) || (chatView is GroupChatView && AutoSwitchGroupChats)) { CurrentChatView = chatView; } } if (ChatAdded != null) { ChatAdded(this, new ChatViewManagerChatAddedEventArgs(chatView)); } return false; }); } void OnChatSynced(object sender, ChatViewSyncedEventArgs e) { Trace.Call(sender, e); // FIXME: should we tell the FrontendManager before we sync? // no problem making remoting calls here as this event is called // from worker threads // REMOTING CALL 1 Frontend.FrontendManager.AddSyncedChat(e.ChatView.ChatModel); GLib.Idle.Add(delegate { var chatView = (ChatView) e.ChatView; // we need to bailt out in case the chat was closed during the sync // else chatView.Populate() will die hard, see #635 if (!Chats.Contains(chatView)) { #if LOG4NET f_Logger.Debug("OnChatSynced(): detected closed chat: " + chatView.ID + " during sync, bailing out..."); #endif return false; } // HACK: patch chat position as OnChatAdded is not honoring the // AddChat order nor the complete range of chats if (chatView.Position != -1) { f_Notebook.ReorderChild(chatView, chatView.Position); } #if LOG4NET DateTime start = DateTime.UtcNow; #endif chatView.Populate(); #if LOG4NET DateTime stop = DateTime.UtcNow; double duration = stop.Subtract(start).TotalMilliseconds; f_Logger.Debug("OnChatSynced(): " + "<" + chatView.ID + ">.Populate() " + "Position: " + chatView.Position + " done, took: " + Math.Round(duration) + " ms"); #endif chatView.ScrollToEnd(); SyncedChats.Add(chatView); if (ChatSynced != null) { ChatSynced(this, new ChatViewManagerChatSyncedEventArgs(chatView)); } return false; }); } void OnWorkerException(object sender, WorkerExceptionEventArgs e) { Trace.Call(sender, e); Frontend.ShowException(e.Exception); } void OnTreeViewSelectionChanged(object sender, EventArgs e) { Trace.Call(sender, e); CurrentChatView = TreeView.CurrentChatView; } int GetSortedChatPosition(ChatView chatView) { // starting with > 0.8 the Engine supplies ChatModel.Position for us if (Frontend.EngineVersion > new Version("0.8")) { return chatView.Position; } // COMPAT: Engine <= 0.8 doesn't populate ChatModel.Position thus // _we_ have to find a good position var chat = chatView.ChatModel; // REMOTING CALL 1 int idx = chat.Position; // REMOTING CALL 2 ChatType type = chat.ChatType; // new group person and group chats behind their protocol chat if (idx == -1 && (type == ChatType.Person || type == ChatType.Group)) { // REMOTING CALL 3 IProtocolManager pm = chat.ProtocolManager; for (int i = 0; i < f_Notebook.NPages; i++) { ChatView page = (ChatView) f_Notebook.GetNthPage(i); ChatModel pageChat = page.ChatModel; // REMOTING CALL 4 and 5 if (pageChat.ChatType == ChatType.Protocol && pageChat.ProtocolManager == pm) { idx = i + 1; break; } } if (idx != -1) { // now find the first chat with a different protocol manager bool found = false; for (int i = idx; i < f_Notebook.NPages; i++) { ChatView page = (ChatView) f_Notebook.GetNthPage(i); ChatModel pageChat = page.ChatModel; // REMOTING CALL 6 if (pageChat.ProtocolManager != pm) { found = true; idx = i; break; } } if (!found) { // if there was no next protocol manager, simply append // the chat way to the end idx = -1; } } } return idx; } } public delegate void ChatViewManagerChatAddedEventHandler(object sender, ChatViewManagerChatAddedEventArgs e); public class ChatViewManagerChatAddedEventArgs : EventArgs { private ChatView f_ChatView; public ChatView ChatView { get { return f_ChatView; } } public ChatViewManagerChatAddedEventArgs(ChatView chatView) { f_ChatView = chatView; } } public delegate void ChatViewManagerChatRemovedEventHandler(object sender, ChatViewManagerChatRemovedEventArgs e); public class ChatViewManagerChatRemovedEventArgs : EventArgs { private ChatView f_ChatView; public ChatView ChatView { get { return f_ChatView; } } public ChatViewManagerChatRemovedEventArgs(ChatView chatView) { f_ChatView = chatView; } } public class ChatViewManagerChatSyncedEventArgs : EventArgs { public ChatView ChatView { get; private set; } public ChatViewManagerChatSyncedEventArgs(ChatView chatView) { ChatView = chatView; } } } smuxi-0.11/src/Frontend-GNOME/smuxi-frontend-gnome.desktop0000644000175000017500000000433612311344241024270 0ustar00meebeymeebey00000000000000[Desktop Entry] Version=1.0 Name=Smuxi Name[cs]=Smuxi Name[da]=Smuxi Name[de]=Smuxi Name[es]=Smuxi Name[fi]=Smuxi Name[fr]=Smuxi Name[hr]=Smuxi Name[nl]=Smuxi Name[pt]=Smuxi Name[pt_BR]=Smuxi Name[sv]=Smuxi Name[te]=స్మక్సి Name[tr]=Smuxi Name[zh_CN]=Smuxi GenericName=IRC Chat GenericName[ca]=_Xat a l'IRC GenericName[cs]=IRC Chat GenericName[da]=IRC-snak GenericName[de]=IRC Chat GenericName[es]=Chat IRC GenericName[fi]=IRC-keskustelu GenericName[fr]=Chat IRC GenericName[hr]=IRC Chat GenericName[it]=Chat IRC GenericName[nl]=IRC Chat GenericName[pt]=Conversação de IRC GenericName[pt_BR]=IRC Chat GenericName[ru]=IRC-чат GenericName[sv]=IRC chatt GenericName[zh_CN]=IRC 聊天 X-GNOME-FullName=Smuxi IRC Client X-GNOME-FullName[ca]=Client d'IRC Smuxi X-GNOME-FullName[cs]=Smuxi klient IRC X-GNOME-FullName[da]=Smuxi - IRC-klient X-GNOME-FullName[de]=Smuxi - Chat Client X-GNOME-FullName[es]=Cliente IRC Smuxi X-GNOME-FullName[fi]=Smuxi IRC-asiakasohjelma X-GNOME-FullName[fr]=Client IRC Smuxi X-GNOME-FullName[hr]=Smuxi IRC klijent X-GNOME-FullName[it]=Client di IRC Smuxi X-GNOME-FullName[nl]=Smuxi IRC Client X-GNOME-FullName[pt]=Cliente de IRC Smuxi X-GNOME-FullName[pt_BR]=Smuxi Cliente IRC X-GNOME-FullName[ru]=IRC-клиент Smuxi X-GNOME-FullName[sv]=Smuxi IRC-klient X-GNOME-FullName[tr]=Smuxi IRC İstemci X-GNOME-FullName[zh_CN]=Smuxi IRC 客户端 Comment=Chat with other people on IRC Comment[ca]=Xategeu amb altres persones a l'IRC Comment[cs]=Chatujte s jinými lidmi na IRC Comment[da]=Snak med andre via IRC Comment[de]=Kommuniziere mit anderen Leuten im IRC Comment[es]=Charla con otras personas en IRC Comment[fi]=Juttele muiden kanssa IRC:ssä Comment[fr]=Chatter sur IRC avec d'autres gens Comment[hr]=Chatajte sa drugim ljudima na IRCu Comment[it]=Chiacchiera con altre persone su IRC Comment[nl]=Praat met andere mensen op IRC Comment[pt]=Conversar com outra pessoa no IRC Comment[pt_BR]=Converse com outras pessoas no IRC Comment[ru]=Разговор с людьми в сети IRC Comment[sv]=Chatta med andra människor på IRC Comment[zh_CN]=和 IRC 上的其他人聊天 Exec=smuxi-frontend-gnome Terminal=false Type=Application Categories=Network;GNOME;GTK;Chat;InstantMessaging;IRCClient; Icon=smuxi-frontend-gnome smuxi-0.11/src/Frontend-GNOME/ThemeSettings.cs0000644000175000017500000001775312250426634021742 0ustar00meebeymeebey00000000000000// $Id$ // // Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2009 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.IO; using System.Linq; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public class ThemeSettings { private Gdk.Color? f_BackgroundColor; private Gdk.Color? f_ForegroundColor; private Pango.FontDescription f_FontDescription; private Gdk.Color f_HighlightColor; private Gdk.Color f_ActivityColor; private Gdk.Color f_NoActivityColor; private Gdk.Color f_EventColor; public Nullable BackgroundColor { get { return f_BackgroundColor; } } public Pango.FontDescription FontDescription { get { return f_FontDescription; } } public Nullable ForegroundColor { get { return f_ForegroundColor; } } public Gdk.Color ActivityColor { get { return f_ActivityColor; } } public Gdk.Color EventColor { get { return f_EventColor; } } public Gdk.Color HighlightColor { get { return f_HighlightColor; } } public Gdk.Color NoActivityColor { get { return f_NoActivityColor; } } public ThemeSettings() { } public ThemeSettings(UserConfig config) { if (config == null) { throw new ArgumentNullException("config"); } string bgStr = (string) config["Interface/Chat/BackgroundColor"]; if (!String.IsNullOrEmpty(bgStr)) { Gdk.Color bgColor = Gdk.Color.Zero; if (Gdk.Color.Parse(bgStr, ref bgColor)) { f_BackgroundColor = bgColor; } } else { f_BackgroundColor = null; } string fgStr = (string) config["Interface/Chat/ForegroundColor"]; if (!String.IsNullOrEmpty(fgStr)) { Gdk.Color fgColor = Gdk.Color.Zero; if (Gdk.Color.Parse(fgStr, ref fgColor)) { f_ForegroundColor = fgColor; } } else { f_ForegroundColor = null; } string colorStr; Gdk.Color color; colorStr = (string) config["Interface/Notebook/Tab/HighlightColor"]; color = Gdk.Color.Zero; if (Gdk.Color.Parse(colorStr, ref color)) { f_HighlightColor = color; } colorStr = (string) config["Interface/Notebook/Tab/ActivityColor"]; color = Gdk.Color.Zero; if (Gdk.Color.Parse(colorStr, ref color)) { f_ActivityColor = color; } colorStr = (string) config["Interface/Notebook/Tab/NoActivityColor"]; color = Gdk.Color.Zero; if (Gdk.Color.Parse(colorStr, ref color)) { f_NoActivityColor = color; } colorStr = (string) config["Interface/Notebook/Tab/EventColor"]; color = Gdk.Color.Zero; if (Gdk.Color.Parse(colorStr, ref color)) { f_EventColor = color; } string fontFamily = (string) config["Interface/Chat/FontFamily"]; string fontStyle = (string) config["Interface/Chat/FontStyle"]; int fontSize = 0; if (config["Interface/Chat/FontSize"] != null) { fontSize = (int) config["Interface/Chat/FontSize"]; } Pango.FontDescription fontDescription = new Pango.FontDescription(); if (String.IsNullOrEmpty(fontFamily)) { // HACK: use Consolas or Fixed-Sys on Windows by default if (Environment.OSVersion.Platform == PlatformID.Win32NT) { var osVersion = Environment.OSVersion.Version; var isWinXp = osVersion.Major == 5 && osVersion.Minor > 0; var hasConsolas = false; using (var context = Frontend.MainWindow.CreatePangoContext()) { hasConsolas = context.Families.Any( family => family.Name == "Consolas" ); } if (hasConsolas && !isWinXp) { // this system has Consolas available and is not WinXP, // let's use it! fontDescription.Family = "Consolas, monospace"; // Consolas only looks good in size 11 fontDescription.Size = 11 * 1024; fontDescription.Weight = Pango.Weight.Normal; fontDescription.Style = Pango.Style.Normal; } else { // too bad, fallback to FixedSys then fontDescription.Family = "FixedsysTTF, monospace"; // FixedSys only looks good in size 11 fontDescription.Size = 11 * 1024; fontDescription.Weight = Pango.Weight.Bold; fontDescription.Style = Pango.Style.Normal; } } else if (Frontend.IsMacOSX) { // HACK: family font description with font fallbacks is not // working on OS X, thus we have to probe and decide ourself var ctx = Frontend.MainWindow.CreatePangoContext(); var families = ctx.Families; if (families.Any(family => family.Name == "Menlo")) { fontDescription.Family = "Menlo"; } else if (families.Any(family => family.Name == "Monaco")) { fontDescription.Family = "Monaco"; } else { fontDescription.Family = "monospace"; } } else { // use Monospace and Bold by default fontDescription.Family = "monospace"; // black bold font on white background looks odd //fontDescription.Weight = Pango.Weight.Bold; } } else { fontDescription.Family = fontFamily; string frontWeigth = null; if (fontStyle.Contains(" ")) { int pos = fontStyle.IndexOf(" "); frontWeigth = fontStyle.Substring(0, pos); fontStyle = fontStyle.Substring(pos + 1); } fontDescription.Style = (Pango.Style) Enum.Parse(typeof(Pango.Style), fontStyle); if (frontWeigth != null) { fontDescription.Weight = (Pango.Weight) Enum.Parse(typeof(Pango.Weight), frontWeigth); } fontDescription.Size = fontSize * 1024; } f_FontDescription = fontDescription; } } } smuxi-0.11/src/Frontend-GNOME/Notebook.cs0000644000175000017500000002335012274103742020723 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Threading; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public class Notebook : Gtk.Notebook { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif //private Gtk.Menu _QueryTabMenu; private TaskQueue f_SwitchPageQueue; private bool f_IsBrowseModeEnabled; public ChatView CurrentChatView { get { return (ChatView) base.CurrentPageWidget; } set { if (value == null) { CurrentPage = 0; return; } CurrentPage = GetPageNumber(value); } } public bool IsBrowseModeEnabled { get { return f_IsBrowseModeEnabled; } set { f_IsBrowseModeEnabled = value; if (value) { #if LOG4NET f_Logger.Debug("set_IsBrowseModeEnabled(): enabling browse mode"); #endif } else { #if LOG4NET f_Logger.Debug("set_IsBrowseModeEnabled(): disabling browse mode"); #endif // HACK: force switch page event to clear activity and // update the markerline var chat = CurrentChatView; CurrentChatView = null; CurrentChatView = chat; } } } public Notebook() : base () { Trace.Call(); f_SwitchPageQueue = new TaskQueue("SwitchPage"); f_SwitchPageQueue.AbortedEvent += OnSwitchPageQueueAbortedEvent; f_SwitchPageQueue.ExceptionEvent += OnSwitchPageQueueExceptionEvent; Scrollable = true; SwitchPage += OnSwitchPage; SwitchPage += OnBeforeSwitchPage; PageReordered += OnPageReordered; } public void ApplyConfig(UserConfig userConfig) { switch ((string) userConfig["Interface/Notebook/TabPosition"]) { case "top": TabPos = Gtk.PositionType.Top; ShowTabs = true; break; case "bottom": TabPos = Gtk.PositionType.Bottom; ShowTabs = true; break; case "left": TabPos = Gtk.PositionType.Left; ShowTabs = true; break; case "right": TabPos = Gtk.PositionType.Right; ShowTabs = true; break; case "none": ShowTabs = false; break; } ShowTabs = false; // TODO: Homogeneous = true; } public ChatView GetChat(ChatModel chat) { for (int i=0; i < NPages; i++) { ChatView chatView = (ChatView) GetNthPage(i); if (chatView.ChatModel == chat) { return chatView; } } return null; } public ChatView GetChat(int pageNumber) { return (ChatView) base.GetNthPage(pageNumber); } public int GetPageNumber(ChatView chatView) { for (int i = 0; i < NPages; i++) { ChatView page = (ChatView) GetNthPage(i); if (page == chatView) { return i; } } return -1; } public void SyncPagePositions() { Trace.Call(); if (Frontend.EngineVersion >= new Version("0.8.1.2")) { // no need to sync chat positions with 0.8.1.2 as they get // updated via Session.MoveChat() return; } for (int i = 0; i < NPages; i++) { var chatView = (ChatView) GetNthPage(i); chatView.ChatModel.Position = i; } } public void ClearAllActivity() { Trace.Call(); int npages = NPages; for (int i = 0; i < npages; i++) { ChatView chat = GetChat(i); chat.HasActivity = false; chat.HasEvent = false; } } protected virtual void OnSwitchPageQueueExceptionEvent(object sender, TaskQueueExceptionEventArgs e) { Trace.Call(sender, e); #if LOG4NET f_Logger.Error("Exception in TaskQueue: ", e.Exception); f_Logger.Error("Inner-Exception: ", e.Exception.InnerException); #endif Frontend.ShowException(e.Exception); } protected virtual void OnSwitchPageQueueAbortedEvent(object sender, EventArgs e) { Trace.Call(sender, e); #if LOG4NET f_Logger.Fatal("OnSwitchPageQueueAbortedEvent(): task queue aborted!"); #endif } [GLib.ConnectBefore] protected virtual void OnBeforeSwitchPage(object sender, Gtk.SwitchPageArgs e) { if (f_IsBrowseModeEnabled) { return; } var chatView = CurrentChatView; chatView.OutputMessageTextView.UpdateMarkerline(); } protected virtual void OnSwitchPage(object sender, Gtk.SwitchPageArgs e) { Trace.Call(sender, e); if (f_IsBrowseModeEnabled) { return; } // synchronize FrontManager.CurrenPage ChatView chatView = GetChat((int)e.PageNum); if (chatView == null) { return; } ChatModel chatModel = chatView.ChatModel; // clear activity and highlight chatView.HasHighlight = false; chatView.HasActivity = false; chatView.HasEvent = false; var lastMsg = chatView.OutputMessageTextView.LastMessage; var method = Trace.GetMethodBase(); f_SwitchPageQueue.Queue(delegate { // HACK: don't pass the real parameters are it's unsafe from // a non-main (GUI) thread! Trace.Call(method, null, null); try { DateTime start = DateTime.UtcNow, stop; var fm = Frontend.FrontendManager; if (fm == null) { // in case we are currently reconnecting to a remote engine return; } // OPT-TODO: we could use here a TaskStack instead which // would make sure only the newest task gets executed // instead of every task in the FIFO sequence! var nmanager = chatView.ProtocolManager; // TODO: only set the protocol manager and update network // status if the protocol manager differs from the old one // REMOTING CALL 2 fm.CurrentChat = chatModel; if (nmanager != null) { // REMOTING CALL 3 fm.CurrentProtocolManager = nmanager; } // even when we have no network manager, we still want to update // the network status and title // REMOTING CALL 4 fm.UpdateNetworkStatus(); // update last seen highlight // REMOTING CALL 5 if (lastMsg != null && !Frontend.UseLowBandwidthMode) { chatModel.LastSeenHighlight = lastMsg.TimeStamp; } stop = DateTime.UtcNow; #if LOG4NET f_Logger.Debug("OnSwitchPage(): task took: " + (stop - start).Milliseconds + " ms"); #endif } catch (Exception ex) { #if LOG4NET f_Logger.Error("OnSwitchPage(): Exception", ex); #endif Frontend.ShowException(ex); } }); } protected virtual void OnPageReordered(object sender, Gtk.PageReorderedArgs e) { Trace.Call(sender, e); if (Frontend.EngineVersion < new Version("0.8.1.2")) { // Session.MoveChat() was added in >= 0.8.1.2 return; } var chatView = (ChatView) e.P0; var newPosition = (int) e.P1; ThreadPool.QueueUserWorkItem(delegate { try { Frontend.Session.MoveChat(chatView.ChatModel, newPosition); } catch (Exception ex) { #if LOG4NET f_Logger.Error("OnPageReordered(): Exception", ex); #endif } }); } } } smuxi-0.11/src/Frontend-GNOME/AssemblyInfo.cs0000644000175000017500000000233612253423337021541 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2009 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Smuxi - GNOME frontend")] [assembly: AssemblyCopyright("2005-2013 (C) Mirco Bauer ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] #if LOG4NET // let log4net use .exe.config file [assembly: log4net.Config.XmlConfigurator] #endif smuxi-0.11/src/Frontend-GNOME/SteticPreferencesDialog.cs0000644000175000017500000000264011655545675023720 0ustar00meebeymeebey00000000000000/* * $Id: PreferencesDialog.cs 283 2008-07-16 21:26:07Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/Preferences/PreferencesDialog.cs $ * $Rev: 283 $ * $Author: meebey $ * $Date: 2008-07-16 23:26:07 +0200 (Wed, 16 Jul 2008) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ namespace Smuxi.Frontend.Gnome { public partial class SteticPreferencesDialog : Gtk.Dialog { public SteticPreferencesDialog() { Build(); } protected virtual void _OnChanged(object sender, System.EventArgs e) { } } } smuxi-0.11/src/Frontend-GNOME/smuxi-frontend-gnome.svg0000644000175000017500000037755612311344241023437 0ustar00meebeymeebey00000000000000 Smuxi IRC Client image/svg+xml Smuxi IRC Client 2010-7-28 Ahmed Abdellah Jakub Steiner <jimmac@ximian.com> smuxi-0.11/src/Frontend-GNOME/GnomeUI.cs0000644000175000017500000002603112250426634020447 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2011 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Reflection; using SysDiag = System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.ComponentModel; using Smuxi.Common; using Smuxi.Engine; using Smuxi.Frontend; namespace Smuxi.Frontend.Gnome { public class GnomeUI : PermanentRemoteObject, IFrontendUI { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private int _Version = 0; private ChatViewManager _ChatViewManager; public int Version { get { return _Version; } } public GnomeUI(ChatViewManager chatViewManager) { _ChatViewManager = chatViewManager; } public void AddChat(ChatModel chat) { TraceRemotingCall(chat); try { _ChatViewManager.AddChat(chat); } catch (Exception ex) { Frontend.ShowException(ex); } } private void _AddMessageToChat(ChatModel chatModel, MessageModel msg) { ChatView chatView = _ChatViewManager.GetChat(chatModel); if (chatView == null) { #if LOG4NET _Logger.Fatal( String.Format( "_AddMessageToChat(): " + "_ChatViewManager.GetChat(chatModel) " + "chatModel.Name: {0} returned null!", chatModel.Name ) ); #endif return; } #if LOG4NET && MSG_DEBUG DateTime start, stop; start = DateTime.UtcNow; #endif chatView.AddMessage(msg); #if LOG4NET && MSG_DEBUG stop = DateTime.UtcNow; _Logger.Debug( String.Format( "_AddMessageToChat(): chatView.AddMessage() took: {0:0.00} ms", (stop - start).TotalMilliseconds ) ); #endif } public void AddMessageToChat(ChatModel epage, MessageModel fmsg) { TraceRemotingCall(epage, fmsg); MethodBase mb = Trace.GetMethodBase(); Gtk.Application.Invoke(delegate { TraceRemotingCall(mb, epage, fmsg); try { _AddMessageToChat(epage, fmsg); } catch (Exception ex) { Frontend.ShowException(ex); } }); } public void RemoveChat(ChatModel chat) { TraceRemotingCall(chat); MethodBase mb = Trace.GetMethodBase(); Gtk.Application.Invoke(delegate { TraceRemotingCall(mb, chat); try { _ChatViewManager.RemoveChat(chat); } catch (Exception ex) { Frontend.ShowException(ex); } }); } public void EnableChat(ChatModel chat) { TraceRemotingCall(chat); MethodBase mb = Trace.GetMethodBase(); Gtk.Application.Invoke(delegate { TraceRemotingCall(mb, chat); try { _ChatViewManager.EnableChat(chat); } catch (Exception ex) { Frontend.ShowException(ex); } }); } public void DisableChat(ChatModel chat) { TraceRemotingCall(chat); MethodBase mb = Trace.GetMethodBase(); Gtk.Application.Invoke(delegate { TraceRemotingCall(mb, chat); try { _ChatViewManager.DisableChat(chat); } catch (Exception ex) { Frontend.ShowException(ex); } }); } public void SyncChat(ChatModel chatModel) { TraceRemotingCall(chatModel); try { _ChatViewManager.SyncChat(chatModel); } catch (Exception ex) { Frontend.ShowException(ex); } } public void AddPersonToGroupChat(GroupChatModel groupChat, PersonModel person) { TraceRemotingCall(groupChat, person); MethodBase mb = Trace.GetMethodBase(); Gtk.Application.Invoke(delegate { TraceRemotingCall(mb, groupChat, person); try { GroupChatView groupChatView = (GroupChatView) _ChatViewManager.GetChat(groupChat); if (groupChatView == null) { #if LOG4NET _Logger.Fatal( String.Format( "AddPersonToGroupChat(): " + "_ChatViewManager.GetChat(groupChat) " + "groupChat.Name: {0} returned null!", groupChat.Name ) ); #endif return; } groupChatView.AddPerson(person); } catch (Exception ex) { Frontend.ShowException(ex); } }); } public void UpdatePersonInGroupChat(GroupChatModel groupChat, PersonModel oldPerson, PersonModel newPerson) { TraceRemotingCall(groupChat, oldPerson, newPerson); MethodBase mb = Trace.GetMethodBase(); Gtk.Application.Invoke(delegate { TraceRemotingCall(mb, groupChat, oldPerson, newPerson); try { GroupChatView groupChatView = (GroupChatView) _ChatViewManager.GetChat(groupChat); if (groupChatView == null) { #if LOG4NET _Logger.Fatal( String.Format( "UpdatePersonInGroupChat(): " + "_ChatViewManager.GetChat(groupChat) " + "groupChat.Name: {0} returned null!", groupChat.Name ) ); #endif return; } groupChatView.UpdatePerson(oldPerson, newPerson); } catch (Exception ex) { Frontend.ShowException(ex); } }); } public void UpdateTopicInGroupChat(GroupChatModel groupChat, MessageModel topic) { TraceRemotingCall(groupChat, topic); MethodBase mb = Trace.GetMethodBase(); Gtk.Application.Invoke(delegate { TraceRemotingCall(mb, groupChat, topic); try { GroupChatView groupChatView = (GroupChatView)Frontend.MainWindow.Notebook.GetChat(groupChat); if (groupChatView == null) { #if LOG4NET _Logger.Fatal( String.Format( "UpdateTopicInGroupChat(): " + "_ChatViewManager.GetChat(groupChat) " + "groupChat.Name: {0} returned null!", groupChat.Name ) ); #endif return; } groupChatView.Topic = topic; } catch (Exception ex) { Frontend.ShowException(ex); } }); } public void RemovePersonFromGroupChat(GroupChatModel groupChat, PersonModel person) { TraceRemotingCall(groupChat, person); MethodBase mb = Trace.GetMethodBase(); Gtk.Application.Invoke(delegate { TraceRemotingCall(mb, groupChat, person); try { GroupChatView groupChatView = (GroupChatView) _ChatViewManager.GetChat(groupChat); if (groupChatView == null) { #if LOG4NET _Logger.Fatal( String.Format( "RemovePersonFromGroupChat(): " + "_ChatViewManager.GetChat(groupChat) " + "groupChat.Name: {0} returned null!", groupChat.Name ) ); #endif return; } groupChatView.RemovePerson(person); } catch (Exception ex) { Frontend.ShowException(ex); } }); } public void SetNetworkStatus(string status) { TraceRemotingCall(status); MethodBase mb = Trace.GetMethodBase(); Gtk.Application.Invoke(delegate { TraceRemotingCall(mb, status); try { Frontend.MainWindow.NetworkStatus = status; Frontend.MainWindow.UpdateTitle(null, status); } catch (Exception ex) { Frontend.ShowException(ex); } }); } public void SetStatus(string status) { TraceRemotingCall(status); MethodBase mb = Trace.GetMethodBase(); Gtk.Application.Invoke(delegate { TraceRemotingCall(mb, status); try { Frontend.MainWindow.Status = status; } catch (Exception ex) { Frontend.ShowException(ex); } }); } [SysDiag.Conditional("REMOTING_TRACE")] protected static void TraceRemotingCall(MethodBase mb, params object[] parameters) { Trace.Call(mb, parameters); } [SysDiag.Conditional("REMOTING_TRACE")] protected static void TraceRemotingCall(params object[] parameters) { TraceRemotingCall(Trace.GetMethodBase(), parameters); } } } smuxi-0.11/src/Frontend-GNOME/EngineManagerDialog.cs0000644000175000017500000003510512257043746022774 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections; using System.Collections.Specialized; using Mono.Unix; using Smuxi.Engine; using Smuxi.Common; namespace Smuxi.Frontend.Gnome { public class EngineManagerDialog : Gtk.Dialog { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private Gtk.ComboBox _ComboBox; private Gtk.ListStore _ListStore; private string _SelectedEngine; private EngineManager _EngineManager; private Gtk.Button _EditButton; private Gtk.Button _DeleteButton; new Gtk.Window Parent { get; set; } public string SelectedEngine { get { Gtk.TreeIter iter; if (!_ComboBox.GetActiveIter(out iter)) { return null; } return (string) _ComboBox.Model.GetValue(iter, 0); } set { int i = 0; foreach (object[] row in (Gtk.ListStore) _ComboBox.Model) { if ((string) row[0] == value) { _ComboBox.Active = i; return; } i++; } throw new ArgumentException(_("Engine not found."), "value"); } } public EngineManagerDialog(Gtk.Window parent, EngineManager engineManager) : base(null, parent, Gtk.DialogFlags.Modal) { Trace.Call(parent, engineManager); if (engineManager == null) { throw new ArgumentNullException("engineManager"); } Parent = parent; _EngineManager = engineManager; Title = "Smuxi - " + _("Engine Manager"); SetPosition(Gtk.WindowPosition.CenterAlways); var connect_button = new Gtk.Button(Gtk.Stock.Connect); AddActionWidget(connect_button, 1); AddActionWidget(new Gtk.Button(Gtk.Stock.New), 3); Gtk.Button edit_button = new Gtk.Button(Gtk.Stock.Edit); _EditButton = edit_button; AddActionWidget(edit_button, 2); _DeleteButton = new Gtk.Button(Gtk.Stock.Delete); AddActionWidget(_DeleteButton, 4); AddActionWidget(new Gtk.Button(Gtk.Stock.Quit), 5); Response += new Gtk.ResponseHandler(_OnResponse); Gtk.VBox vbox = new Gtk.VBox(); Gtk.Label label = new Gtk.Label("" + _("Select which Smuxi engine you want to connect to") + ""); label.UseMarkup = true; vbox.PackStart(label, false, false, 5); Gtk.HBox hbox = new Gtk.HBox(); hbox.PackStart(new Gtk.Label(_("Engine:")), false, false, 5); _ListStore = new Gtk.ListStore(typeof(string)); _ComboBox = new Gtk.ComboBox(); Gtk.CellRendererText cell = new Gtk.CellRendererText(); _ComboBox.PackStart(cell, false); _ComboBox.AddAttribute(cell, "text", 0); _ComboBox.Changed += new EventHandler(_OnComboBoxChanged); _ComboBox.Model = _ListStore; _InitEngineList(); var lowBandWidthCheckBox = new Gtk.CheckButton(_("Use Low Bandwidth Mode")); lowBandWidthCheckBox.Active = (bool) Frontend.FrontendConfig["UseLowBandwidthMode"]; lowBandWidthCheckBox.Clicked += delegate { Frontend.FrontendConfig["UseLowBandwidthMode"] = lowBandWidthCheckBox.Active; Frontend.FrontendConfig.Save(); }; hbox.PackStart(_ComboBox, true, true, 10); vbox.PackStart(hbox, false, false, 10); vbox.PackStart(lowBandWidthCheckBox); VBox.Add(vbox); ShowAll(); } private void _InitEngineList() { string[] engines = (string[])Frontend.FrontendConfig["Engines/Engines"]; string default_engine = (string)Frontend.FrontendConfig["Engines/Default"]; int item = 0; _ListStore.Clear(); _ListStore.AppendValues("<" + _("Local Engine") + ">"); item++; foreach (string engine in engines) { _ListStore.AppendValues(engine); if (engine == default_engine) { _ComboBox.Active = item; } item++; } } private void _OnResponse(object sender, Gtk.ResponseArgs e) { Trace.Call(sender, e); try { #if LOG4NET _Logger.Debug("_OnResponse(): ResponseId: "+e.ResponseId); #endif switch ((int)e.ResponseId) { case 1: _OnConnectButtonPressed(); break; case 2: _OnEditButtonPressed(); break; case 3: _OnNewButtonPressed(); break; case 4: _OnDeleteButtonPressed(); break; case 5: _OnQuitButtonPressed(); break; case (int)Gtk.ResponseType.DeleteEvent: _OnDeleteEvent(); break; } } catch (Exception ex) { #if LOG4NET _Logger.Error(ex); #endif CrashDialog.Show(this, ex); } } private void _OnConnectButtonPressed() { if (_SelectedEngine == null || _SelectedEngine == String.Empty) { Gtk.MessageDialog md = new Gtk.MessageDialog(this, Gtk.DialogFlags.Modal, Gtk.MessageType.Error, Gtk.ButtonsType.Close, _("Please select an engine!")); md.Run(); md.Destroy(); // Re-run the Dialog Run(); return; } if (_SelectedEngine == "<" + _("Local Engine") + ">") { Frontend.InitLocalEngine(); Frontend.ConnectEngineToGUI(); Destroy(); return; } string engine = _SelectedEngine; try { _EngineManager.Connect(engine); var engineVersion = _EngineManager.EngineVersion; var frontendVersion = Frontend.Version; if ((engineVersion >= new Version("0.8") && engineVersion.Major != frontendVersion.Major) || (engineVersion < new Version("0.8") && (engineVersion.Major != frontendVersion.Major || engineVersion.Minor != frontendVersion.Minor))) { throw new ApplicationException(String.Format( _("Your frontend version ({0}) does not match the engine version ({1})!"), Frontend.Version, _EngineManager.EngineVersion)); } Frontend.Session = _EngineManager.Session; Frontend.UserConfig = _EngineManager.UserConfig; Frontend.EngineVersion = _EngineManager.EngineVersion; Frontend.ConnectEngineToGUI(); } catch (Exception ex) { #if LOG4NET _Logger.Error(ex); #endif // clean-up try { _EngineManager.Disconnect(); } catch (Exception disEx) { #if LOG4NET _Logger.Error(disEx); #endif } string error_msg = ex.Message + "\n"; if (ex.InnerException != null) { error_msg += " [" + ex.InnerException.Message + "]\n"; } string msg; msg = _("An error occurred while connecting to the engine!") + "\n\n"; msg += String.Format(_("Engine URL: {0}") + "\n", _EngineManager.EngineUrl); msg += String.Format(_("Error: {0}"), error_msg); Gtk.MessageDialog md = new Gtk.MessageDialog(this, Gtk.DialogFlags.Modal, Gtk.MessageType.Error, Gtk.ButtonsType.Close, msg); md.Run(); md.Destroy(); // Re-run the Dialog Run(); } } private void _OnNewButtonPressed() { EngineAssistant assistant = new EngineAssistant( Parent, Frontend.FrontendConfig ); assistant.Cancel += delegate { assistant.Destroy(); // Restart the Dialog // HACK: holy shit, please refactor this mess! var dialog = new EngineManagerDialog(Parent, _EngineManager); dialog.Run(); dialog.Destroy(); }; assistant.Close += delegate { assistant.Destroy(); // Restart the Dialog // HACK: holy shit, please refactor this mess! var dialog = new EngineManagerDialog(Parent, _EngineManager); dialog.Run(); dialog.Destroy(); }; assistant.ShowAll(); } private void _OnEditButtonPressed() { EngineAssistant assistant = new EngineAssistant( Parent, Frontend.FrontendConfig, _SelectedEngine ); assistant.Cancel += delegate { assistant.Destroy(); // Restart the Dialog // HACK: holy shit, please refactor this mess! var dialog = new EngineManagerDialog(Parent, _EngineManager); dialog.Run(); dialog.Destroy(); }; assistant.Close += delegate { assistant.Destroy(); // Restart the Dialog // HACK: holy shit, please refactor this mess! var dialog = new EngineManagerDialog(Parent, _EngineManager); dialog.Run(); dialog.Destroy(); }; assistant.ShowAll(); } private void _OnDeleteButtonPressed() { string msg = String.Format( _("Are you sure you want to delete the engine \"{0}\"?"), _SelectedEngine); Gtk.MessageDialog md = new Gtk.MessageDialog(this, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.YesNo, msg); int res = md.Run(); md.Destroy(); if ((Gtk.ResponseType)res == Gtk.ResponseType.Yes) { _DeleteEngine(_SelectedEngine); _InitEngineList(); // Re-run the Dialog Run(); } } private void _DeleteEngine(string engine) { StringCollection new_engines = new StringCollection(); string[] current_engines = (string[])Frontend.FrontendConfig["Engines/Engines"]; foreach (string eng in current_engines) { if (eng != engine) { new_engines.Add(eng); } } string[] new_engines_array = new string[new_engines.Count]; new_engines.CopyTo(new_engines_array, 0); // UGLY: refactor this to a proper controller class, see ServerListController Frontend.FrontendConfig["Engines/Engines"] = new_engines_array; Frontend.FrontendConfig.Remove("Engines/"+engine+"/Username"); Frontend.FrontendConfig.Remove("Engines/"+engine+"/Password"); Frontend.FrontendConfig.Remove("Engines/"+engine+"/Hostname"); Frontend.FrontendConfig.Remove("Engines/"+engine+"/Port"); Frontend.FrontendConfig.Remove("Engines/"+engine+"/Channel"); Frontend.FrontendConfig.Remove("Engines/"+engine+"/Formatter"); Frontend.FrontendConfig.Remove("Engines/"+engine+"/UseSshTunnel"); Frontend.FrontendConfig.Remove("Engines/"+engine+"/SshHostname"); Frontend.FrontendConfig.Remove("Engines/"+engine+"/SshPort"); Frontend.FrontendConfig.Remove("Engines/"+engine+"/SshUsername"); Frontend.FrontendConfig.Remove("Engines/"+engine); Frontend.FrontendConfig.Save(); Frontend.FrontendConfig.Load(); } private void _OnQuitButtonPressed() { Frontend.Quit(); } private void _OnDeleteEvent() { Frontend.Quit(); } private void _OnComboBoxChanged(object sender, EventArgs e) { Trace.Call(sender, e); Gtk.TreeIter iter; if (_ComboBox.GetActiveIter(out iter)) { _SelectedEngine = (string )_ComboBox.Model.GetValue(iter, 0); } bool isLocalEngine = _SelectedEngine == "<" + _("Local Engine") + ">"; _EditButton.Sensitive = !isLocalEngine; _DeleteButton.Sensitive = !isLocalEngine; } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/0000755000175000017500000000000012311344241020151 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs0000644000175000017500000000173412132611315031712 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class EngineAssistantIntroWidget { private global::Gtk.Label label2; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.EngineAssistantIntroWidget global::Stetic.BinContainer.Attach (this); this.Name = "Smuxi.Frontend.Gnome.EngineAssistantIntroWidget"; // Container child Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.Gtk.Container+ContainerChild this.label2 = new global::Gtk.Label (); this.label2.Name = "label2"; this.label2.Xalign = 0F; this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Welcome to the Smuxi Engine Configuration Assistant.\nYou need to enter some information before you can use the engine.\n\nClick \"Forward\" to begin."); this.Add (this.label2); if ((this.Child != null)) { this.Child.ShowAll (); } this.Hide (); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs0000644000175000017500000025045712132611315031200 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class SteticPreferencesDialog { private global::Gtk.HBox hbox1; private global::Gtk.ScrolledWindow MenuScrolledWindow; private global::Gtk.TreeView MenuTreeView; private global::Gtk.Notebook Notebook; private global::Gtk.VBox vbox1; private global::Gtk.Table table1; private global::Gtk.Entry ConnectionNicknamesEntry; private global::Gtk.Entry ConnectionRealnameEntry; private global::Gtk.Entry ConnectionUsernameEntry; private global::Gtk.ComboBox EncodingComboBox; private global::Gtk.HBox hbox13; private global::Gtk.Label label6; private global::Gtk.Fixed fixed31; private global::Gtk.HBox hbox14; private global::Gtk.Label label7; private global::Gtk.Fixed fixed32; private global::Gtk.HBox hbox15; private global::Gtk.Label label8; private global::Gtk.Fixed fixed33; private global::Gtk.Label label58; private global::Gtk.VBox vbox2; private global::Gtk.VBox vbox3; private global::Gtk.HBox hbox2; private global::Gtk.Label label37; private global::Gtk.Fixed fixed18; private global::Gtk.ScrolledWindow scrolledwindow1; private global::Gtk.TextView OnConnectCommandsTextView; private global::Gtk.VBox vbox4; private global::Gtk.HBox hbox3; private global::Gtk.Label label43; private global::Gtk.Fixed fixed19; private global::Gtk.ScrolledWindow scrolledwindow2; private global::Gtk.TextView OnStartupCommandsTextView; private global::Gtk.Label label44; private global::Gtk.Notebook InterfaceNotebook; private global::Gtk.VBox vbox10; private global::Gtk.Table table5; private global::Gtk.SpinButton BufferLinesSpinButton; private global::Gtk.SpinButton EngineBufferLinesSpinButton; private global::Gtk.HBox hbox7; private global::Gtk.Label label33; private global::Gtk.Fixed fixed25; private global::Gtk.HBox hbox8; private global::Gtk.Label label39; private global::Gtk.Fixed fixed26; private global::Gtk.HBox hbox9; private global::Gtk.Label label40; private global::Gtk.Fixed fixed27; private global::Gtk.Entry TimestampFormatEntry; private global::Gtk.CheckButton StripColorsCheckButton; private global::Gtk.Alignment alignment16; private global::Gtk.HBox hbox17; private global::Gtk.Image image5; private global::Gtk.Label label47; private global::Gtk.CheckButton StripFormattingsCheckButton; private global::Gtk.Alignment alignment15; private global::Gtk.HBox hbox16; private global::Gtk.Image image6; private global::Gtk.Label label46; private global::Gtk.CheckButton checkbutton1; private global::Gtk.Alignment alignment26; private global::Gtk.HBox hbox28; private global::Gtk.Image image7; private global::Gtk.Label label60; private global::Gtk.Label label1; private global::Gtk.VBox vbox5; private global::Gtk.Frame frame1; private global::Gtk.Alignment alignment4; private global::Gtk.VBox vbox6; private global::Gtk.RadioButton TabPositionRadioButtonTop; private global::Gtk.HBox hbox10; private global::Gtk.Image image12; private global::Gtk.Label label5; private global::Gtk.RadioButton TabPositionRadioButtonBottom; private global::Gtk.HBox hbox24; private global::Gtk.Image image9; private global::Gtk.Label label54; private global::Gtk.RadioButton TabPositionRadioButtonLeft; private global::Gtk.Alignment alignment24; private global::Gtk.HBox hbox25; private global::Gtk.Image image10; private global::Gtk.Label label55; private global::Gtk.RadioButton TabPositionRadioButtonRight; private global::Gtk.Alignment alignment25; private global::Gtk.HBox hbox26; private global::Gtk.Image image11; private global::Gtk.Label label56; private global::Gtk.RadioButton TabPositionRadioButtonNone; private global::Gtk.Label label9; private global::Gtk.Frame frame4; private global::Gtk.Alignment alignment8; private global::Gtk.Table table3; private global::Gtk.ColorButton ActivityColorButton; private global::Gtk.ColorButton HighlightColorButton; private global::Gtk.Label label16; private global::Gtk.Label label17; private global::Gtk.Label label18; private global::Gtk.Label label59; private global::Gtk.ColorButton ModeColorButton; private global::Gtk.ColorButton NoActivityColorButton; private global::Gtk.Label label15; private global::Gtk.Label label2; private global::Gtk.Frame frame3; private global::Gtk.Alignment alignment7; private global::Gtk.VBox vbox7; private global::Gtk.Table table4; private global::Gtk.Entry CommandCharacterEntry; private global::Gtk.SpinButton CommandHistorySizeSpinButton; private global::Gtk.Entry CompletionCharacterEntry; private global::Gtk.HBox hbox4; private global::Gtk.Label label13; private global::Gtk.Fixed fixed22; private global::Gtk.HBox hbox5; private global::Gtk.Label label14; private global::Gtk.Fixed fixed23; private global::Gtk.HBox hbox6; private global::Gtk.Label label42; private global::Gtk.Fixed fixed24; private global::Gtk.CheckButton BashStyleCompletionCheckButton; private global::Gtk.Label label12; private global::Gtk.Label label3; private global::Gtk.VBox vbox8; private global::Gtk.Frame frame2; private global::Gtk.Alignment alignment5; private global::Gtk.VBox vbox9; private global::Gtk.CheckButton NickColorsCheckButton; private global::Gtk.Frame frame10; private global::Gtk.Alignment alignment14; private global::Gtk.VBox vbox11; private global::Gtk.RadioButton TopicPositionRadioButtonTop; private global::Gtk.Alignment alignment21; private global::Gtk.HBox hbox22; private global::Gtk.Image image1; private global::Gtk.Label label52; private global::Gtk.RadioButton TopicPositionRadioButtonBottom; private global::Gtk.Alignment alignment20; private global::Gtk.HBox hbox21; private global::Gtk.Image image2; private global::Gtk.Label label51; private global::Gtk.RadioButton TopicPositionRadioButtonNone; private global::Gtk.Label label41; private global::Gtk.Frame frame9; private global::Gtk.Alignment alignment13; private global::Gtk.VBox vbox12; private global::Gtk.RadioButton UserListPositionRadioButtonLeft; private global::Gtk.Alignment alignment17; private global::Gtk.HBox hbox18; private global::Gtk.Image image3; private global::Gtk.Label label48; private global::Gtk.RadioButton UserListPositionRadioButtonRight; private global::Gtk.Alignment alignment18; private global::Gtk.HBox hbox19; private global::Gtk.Image image4; private global::Gtk.Label label49; private global::Gtk.RadioButton UserListPositionRadioButtonNone; private global::Gtk.Label label38; private global::Gtk.Label label10; private global::Gtk.Frame frame11; private global::Gtk.Alignment alignment27; private global::Gtk.VBox vbox13; private global::Gtk.VBox vbox14; private global::Gtk.Label label62; private global::Gtk.ScrolledWindow scrolledwindow4; private global::Gtk.TextView HighlightWordsTextView; private global::Gtk.CheckButton BeepOnHighlightCheckButton; private global::Gtk.Label label61; private global::Gtk.Label label4; private global::Gtk.Label label45; private global::Gtk.HBox hbox27; private global::Gtk.ScrolledWindow scrolledwindow3; private global::Gtk.TreeView ServersTreeView; private global::Gtk.VButtonBox vbuttonbox1; private global::Gtk.Button ServersAddButton; private global::Gtk.Button ServersEditButton; private global::Gtk.Button ServersRemoveButton; private global::Gtk.Label label57; private global::Gtk.VBox vbox15; private global::Gtk.Frame frame12; private global::Gtk.Alignment alignment28; private global::Gtk.VBox vbox16; private global::Gtk.ScrolledWindow scrolledwindow5; private global::Gtk.TreeView ChannelFiltersTreeView; private global::Gtk.HButtonBox hbuttonbox1; private global::Gtk.Button ChannelFiltersAddButton; private global::Gtk.Button ChannelFiltersRemoveButton; private global::Gtk.Label label64; private global::Gtk.Frame frame13; private global::Gtk.Alignment alignment29; private global::Gtk.Label label65; private global::Gtk.Label label63; private global::Gtk.Button CancelButton; private global::Gtk.Button ApplyButton; private global::Gtk.Button OKButton; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.SteticPreferencesDialog this.Name = "Smuxi.Frontend.Gnome.SteticPreferencesDialog"; this.Title = global::Mono.Unix.Catalog.GetString ("Smuxi - Preferences"); this.TypeHint = ((global::Gdk.WindowTypeHint)(1)); // Internal child Smuxi.Frontend.Gnome.SteticPreferencesDialog.VBox global::Gtk.VBox w1 = this.VBox; w1.Name = "dialog-vbox1"; w1.BorderWidth = ((uint)(2)); // Container child dialog-vbox1.Gtk.Box+BoxChild this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; this.hbox1.BorderWidth = ((uint)(10)); // Container child hbox1.Gtk.Box+BoxChild this.MenuScrolledWindow = new global::Gtk.ScrolledWindow (); this.MenuScrolledWindow.WidthRequest = 128; this.MenuScrolledWindow.Name = "MenuScrolledWindow"; this.MenuScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child MenuScrolledWindow.Gtk.Container+ContainerChild this.MenuTreeView = new global::Gtk.TreeView (); this.MenuTreeView.Name = "MenuTreeView"; this.MenuTreeView.EnableSearch = false; this.MenuTreeView.HeadersVisible = false; this.MenuScrolledWindow.Add (this.MenuTreeView); this.hbox1.Add (this.MenuScrolledWindow); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.MenuScrolledWindow])); w3.Position = 0; w3.Expand = false; // Container child hbox1.Gtk.Box+BoxChild this.Notebook = new global::Gtk.Notebook (); this.Notebook.Name = "Notebook"; this.Notebook.CurrentPage = 0; this.Notebook.ShowBorder = false; // Container child Notebook.Gtk.Notebook+NotebookChild this.vbox1 = new global::Gtk.VBox (); this.vbox1.Name = "vbox1"; this.vbox1.Spacing = 5; this.vbox1.BorderWidth = ((uint)(5)); // Container child vbox1.Gtk.Box+BoxChild this.table1 = new global::Gtk.Table (((uint)(4)), ((uint)(2)), false); this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(5)); this.table1.ColumnSpacing = ((uint)(5)); // Container child table1.Gtk.Table+TableChild this.ConnectionNicknamesEntry = new global::Gtk.Entry (); this.ConnectionNicknamesEntry.Name = "ConnectionNicknamesEntry"; this.ConnectionNicknamesEntry.IsEditable = true; this.ConnectionNicknamesEntry.InvisibleChar = '●'; this.table1.Add (this.ConnectionNicknamesEntry); global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.ConnectionNicknamesEntry])); w4.LeftAttach = ((uint)(1)); w4.RightAttach = ((uint)(2)); w4.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table1.Gtk.Table+TableChild this.ConnectionRealnameEntry = new global::Gtk.Entry (); this.ConnectionRealnameEntry.Name = "ConnectionRealnameEntry"; this.ConnectionRealnameEntry.IsEditable = true; this.ConnectionRealnameEntry.InvisibleChar = '●'; this.table1.Add (this.ConnectionRealnameEntry); global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.ConnectionRealnameEntry])); w5.TopAttach = ((uint)(2)); w5.BottomAttach = ((uint)(3)); w5.LeftAttach = ((uint)(1)); w5.RightAttach = ((uint)(2)); w5.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table1.Gtk.Table+TableChild this.ConnectionUsernameEntry = new global::Gtk.Entry (); this.ConnectionUsernameEntry.Name = "ConnectionUsernameEntry"; this.ConnectionUsernameEntry.IsEditable = true; this.ConnectionUsernameEntry.InvisibleChar = '●'; this.table1.Add (this.ConnectionUsernameEntry); global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.ConnectionUsernameEntry])); w6.TopAttach = ((uint)(1)); w6.BottomAttach = ((uint)(2)); w6.LeftAttach = ((uint)(1)); w6.RightAttach = ((uint)(2)); w6.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table1.Gtk.Table+TableChild this.EncodingComboBox = new global::Gtk.ComboBox (); this.EncodingComboBox.Name = "EncodingComboBox"; this.table1.Add (this.EncodingComboBox); global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.EncodingComboBox])); w7.TopAttach = ((uint)(3)); w7.BottomAttach = ((uint)(4)); w7.LeftAttach = ((uint)(1)); w7.RightAttach = ((uint)(2)); // Container child table1.Gtk.Table+TableChild this.hbox13 = new global::Gtk.HBox (); this.hbox13.Name = "hbox13"; // Container child hbox13.Gtk.Box+BoxChild this.label6 = new global::Gtk.Label (); this.label6.Name = "label6"; this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("Nicknames:"); this.hbox13.Add (this.label6); global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox13 [this.label6])); w8.Position = 0; w8.Expand = false; w8.Fill = false; // Container child hbox13.Gtk.Box+BoxChild this.fixed31 = new global::Gtk.Fixed (); this.fixed31.Name = "fixed31"; this.fixed31.HasWindow = false; this.hbox13.Add (this.fixed31); global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox13 [this.fixed31])); w9.Position = 1; this.table1.Add (this.hbox13); // Container child table1.Gtk.Table+TableChild this.hbox14 = new global::Gtk.HBox (); this.hbox14.Name = "hbox14"; // Container child hbox14.Gtk.Box+BoxChild this.label7 = new global::Gtk.Label (); this.label7.Name = "label7"; this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("Username:"); this.hbox14.Add (this.label7); global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox14 [this.label7])); w11.Position = 0; w11.Expand = false; w11.Fill = false; // Container child hbox14.Gtk.Box+BoxChild this.fixed32 = new global::Gtk.Fixed (); this.fixed32.Name = "fixed32"; this.fixed32.HasWindow = false; this.hbox14.Add (this.fixed32); global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox14 [this.fixed32])); w12.Position = 1; this.table1.Add (this.hbox14); global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1 [this.hbox14])); w13.TopAttach = ((uint)(1)); w13.BottomAttach = ((uint)(2)); // Container child table1.Gtk.Table+TableChild this.hbox15 = new global::Gtk.HBox (); this.hbox15.Name = "hbox15"; // Container child hbox15.Gtk.Box+BoxChild this.label8 = new global::Gtk.Label (); this.label8.Name = "label8"; this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Realname:"); this.hbox15.Add (this.label8); global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox15 [this.label8])); w14.Position = 0; w14.Expand = false; w14.Fill = false; // Container child hbox15.Gtk.Box+BoxChild this.fixed33 = new global::Gtk.Fixed (); this.fixed33.Name = "fixed33"; this.fixed33.HasWindow = false; this.hbox15.Add (this.fixed33); global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox15 [this.fixed33])); w15.Position = 1; this.table1.Add (this.hbox15); global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table1 [this.hbox15])); w16.TopAttach = ((uint)(2)); w16.BottomAttach = ((uint)(3)); // Container child table1.Gtk.Table+TableChild this.label58 = new global::Gtk.Label (); this.label58.Name = "label58"; this.label58.Xalign = 0F; this.label58.LabelProp = global::Mono.Unix.Catalog.GetString ("Encoding:"); this.table1.Add (this.label58); global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.table1 [this.label58])); w17.TopAttach = ((uint)(3)); w17.BottomAttach = ((uint)(4)); w17.YOptions = ((global::Gtk.AttachOptions)(0)); this.vbox1.Add (this.table1); global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.table1])); w18.Position = 0; w18.Expand = false; // Container child vbox1.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; // Container child vbox2.Gtk.Box+BoxChild this.vbox3 = new global::Gtk.VBox (); this.vbox3.Name = "vbox3"; // Container child vbox3.Gtk.Box+BoxChild this.hbox2 = new global::Gtk.HBox (); this.hbox2.Name = "hbox2"; // Container child hbox2.Gtk.Box+BoxChild this.label37 = new global::Gtk.Label (); this.label37.Name = "label37"; this.label37.LabelProp = global::Mono.Unix.Catalog.GetString ("On Connect Commands:"); this.hbox2.Add (this.label37); global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label37])); w19.Position = 0; w19.Expand = false; w19.Fill = false; // Container child hbox2.Gtk.Box+BoxChild this.fixed18 = new global::Gtk.Fixed (); this.fixed18.Name = "fixed18"; this.fixed18.HasWindow = false; this.hbox2.Add (this.fixed18); global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.fixed18])); w20.Position = 1; this.vbox3.Add (this.hbox2); global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox2])); w21.Position = 0; w21.Expand = false; w21.Fill = false; // Container child vbox3.Gtk.Box+BoxChild this.scrolledwindow1 = new global::Gtk.ScrolledWindow (); this.scrolledwindow1.WidthRequest = 350; this.scrolledwindow1.HeightRequest = 100; this.scrolledwindow1.Name = "scrolledwindow1"; this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child scrolledwindow1.Gtk.Container+ContainerChild this.OnConnectCommandsTextView = new global::Gtk.TextView (); this.OnConnectCommandsTextView.WidthRequest = 152; this.OnConnectCommandsTextView.HeightRequest = 168; this.OnConnectCommandsTextView.Name = "OnConnectCommandsTextView"; this.OnConnectCommandsTextView.WrapMode = ((global::Gtk.WrapMode)(2)); this.scrolledwindow1.Add (this.OnConnectCommandsTextView); this.vbox3.Add (this.scrolledwindow1); global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.scrolledwindow1])); w23.Position = 1; this.vbox2.Add (this.vbox3); global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.vbox3])); w24.Position = 0; // Container child vbox2.Gtk.Box+BoxChild this.vbox4 = new global::Gtk.VBox (); this.vbox4.Name = "vbox4"; // Container child vbox4.Gtk.Box+BoxChild this.hbox3 = new global::Gtk.HBox (); this.hbox3.Name = "hbox3"; // Container child hbox3.Gtk.Box+BoxChild this.label43 = new global::Gtk.Label (); this.label43.Name = "label43"; this.label43.LabelProp = global::Mono.Unix.Catalog.GetString ("On Startup Commands:"); this.hbox3.Add (this.label43); global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label43])); w25.Position = 0; w25.Expand = false; w25.Fill = false; // Container child hbox3.Gtk.Box+BoxChild this.fixed19 = new global::Gtk.Fixed (); this.fixed19.Name = "fixed19"; this.fixed19.HasWindow = false; this.hbox3.Add (this.fixed19); global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.fixed19])); w26.Position = 1; this.vbox4.Add (this.hbox3); global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.hbox3])); w27.Position = 0; w27.Expand = false; w27.Fill = false; // Container child vbox4.Gtk.Box+BoxChild this.scrolledwindow2 = new global::Gtk.ScrolledWindow (); this.scrolledwindow2.WidthRequest = 350; this.scrolledwindow2.HeightRequest = 100; this.scrolledwindow2.Name = "scrolledwindow2"; this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child scrolledwindow2.Gtk.Container+ContainerChild this.OnStartupCommandsTextView = new global::Gtk.TextView (); this.OnStartupCommandsTextView.WidthRequest = 152; this.OnStartupCommandsTextView.HeightRequest = 168; this.OnStartupCommandsTextView.Name = "OnStartupCommandsTextView"; this.OnStartupCommandsTextView.WrapMode = ((global::Gtk.WrapMode)(2)); this.scrolledwindow2.Add (this.OnStartupCommandsTextView); this.vbox4.Add (this.scrolledwindow2); global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.scrolledwindow2])); w29.Position = 1; this.vbox2.Add (this.vbox4); global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.vbox4])); w30.Position = 1; this.vbox1.Add (this.vbox2); global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.vbox2])); w31.Position = 1; this.Notebook.Add (this.vbox1); // Notebook tab this.label44 = new global::Gtk.Label (); this.label44.Name = "label44"; this.label44.LabelProp = global::Mono.Unix.Catalog.GetString ("C_onnection"); this.label44.UseUnderline = true; this.Notebook.SetTabLabel (this.vbox1, this.label44); this.label44.ShowAll (); // Container child Notebook.Gtk.Notebook+NotebookChild this.InterfaceNotebook = new global::Gtk.Notebook (); this.InterfaceNotebook.Name = "InterfaceNotebook"; this.InterfaceNotebook.CurrentPage = 0; // Container child InterfaceNotebook.Gtk.Notebook+NotebookChild this.vbox10 = new global::Gtk.VBox (); this.vbox10.Name = "vbox10"; // Container child vbox10.Gtk.Box+BoxChild this.table5 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false); this.table5.Name = "table5"; this.table5.RowSpacing = ((uint)(5)); this.table5.ColumnSpacing = ((uint)(5)); this.table5.BorderWidth = ((uint)(5)); // Container child table5.Gtk.Table+TableChild this.BufferLinesSpinButton = new global::Gtk.SpinButton (1, 9999, 1); this.BufferLinesSpinButton.WidthRequest = 60; this.BufferLinesSpinButton.Name = "BufferLinesSpinButton"; this.BufferLinesSpinButton.Adjustment.PageIncrement = 10; this.BufferLinesSpinButton.Adjustment.PageSize = 10; this.BufferLinesSpinButton.ClimbRate = 1; this.BufferLinesSpinButton.Numeric = true; this.BufferLinesSpinButton.Value = 200; this.table5.Add (this.BufferLinesSpinButton); global::Gtk.Table.TableChild w33 = ((global::Gtk.Table.TableChild)(this.table5 [this.BufferLinesSpinButton])); w33.TopAttach = ((uint)(1)); w33.BottomAttach = ((uint)(2)); w33.LeftAttach = ((uint)(1)); w33.RightAttach = ((uint)(2)); w33.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table5.Gtk.Table+TableChild this.EngineBufferLinesSpinButton = new global::Gtk.SpinButton (0, 9999, 1); this.EngineBufferLinesSpinButton.WidthRequest = 60; this.EngineBufferLinesSpinButton.Name = "EngineBufferLinesSpinButton"; this.EngineBufferLinesSpinButton.Adjustment.PageIncrement = 10; this.EngineBufferLinesSpinButton.Adjustment.PageSize = 10; this.EngineBufferLinesSpinButton.ClimbRate = 1; this.EngineBufferLinesSpinButton.Numeric = true; this.EngineBufferLinesSpinButton.Value = 200; this.table5.Add (this.EngineBufferLinesSpinButton); global::Gtk.Table.TableChild w34 = ((global::Gtk.Table.TableChild)(this.table5 [this.EngineBufferLinesSpinButton])); w34.TopAttach = ((uint)(2)); w34.BottomAttach = ((uint)(3)); w34.LeftAttach = ((uint)(1)); w34.RightAttach = ((uint)(2)); w34.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table5.Gtk.Table+TableChild this.hbox7 = new global::Gtk.HBox (); this.hbox7.Name = "hbox7"; // Container child hbox7.Gtk.Box+BoxChild this.label33 = new global::Gtk.Label (); this.label33.Name = "label33"; this.label33.LabelProp = global::Mono.Unix.Catalog.GetString ("Timestamp Format:"); this.hbox7.Add (this.label33); global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.hbox7 [this.label33])); w35.Position = 0; w35.Expand = false; w35.Fill = false; // Container child hbox7.Gtk.Box+BoxChild this.fixed25 = new global::Gtk.Fixed (); this.fixed25.Name = "fixed25"; this.fixed25.HasWindow = false; this.hbox7.Add (this.fixed25); global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.hbox7 [this.fixed25])); w36.Position = 1; this.table5.Add (this.hbox7); // Container child table5.Gtk.Table+TableChild this.hbox8 = new global::Gtk.HBox (); this.hbox8.Name = "hbox8"; // Container child hbox8.Gtk.Box+BoxChild this.label39 = new global::Gtk.Label (); this.label39.Name = "label39"; this.label39.LabelProp = global::Mono.Unix.Catalog.GetString ("Buffer Lines:"); this.hbox8.Add (this.label39); global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.hbox8 [this.label39])); w38.Position = 0; w38.Expand = false; w38.Fill = false; // Container child hbox8.Gtk.Box+BoxChild this.fixed26 = new global::Gtk.Fixed (); this.fixed26.Name = "fixed26"; this.fixed26.HasWindow = false; this.hbox8.Add (this.fixed26); global::Gtk.Box.BoxChild w39 = ((global::Gtk.Box.BoxChild)(this.hbox8 [this.fixed26])); w39.Position = 1; this.table5.Add (this.hbox8); global::Gtk.Table.TableChild w40 = ((global::Gtk.Table.TableChild)(this.table5 [this.hbox8])); w40.TopAttach = ((uint)(1)); w40.BottomAttach = ((uint)(2)); // Container child table5.Gtk.Table+TableChild this.hbox9 = new global::Gtk.HBox (); this.hbox9.Name = "hbox9"; // Container child hbox9.Gtk.Box+BoxChild this.label40 = new global::Gtk.Label (); this.label40.Name = "label40"; this.label40.LabelProp = global::Mono.Unix.Catalog.GetString ("Engine Buffer Lines:"); this.hbox9.Add (this.label40); global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.hbox9 [this.label40])); w41.Position = 0; w41.Expand = false; w41.Fill = false; // Container child hbox9.Gtk.Box+BoxChild this.fixed27 = new global::Gtk.Fixed (); this.fixed27.Name = "fixed27"; this.fixed27.HasWindow = false; this.hbox9.Add (this.fixed27); global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(this.hbox9 [this.fixed27])); w42.Position = 1; this.table5.Add (this.hbox9); global::Gtk.Table.TableChild w43 = ((global::Gtk.Table.TableChild)(this.table5 [this.hbox9])); w43.TopAttach = ((uint)(2)); w43.BottomAttach = ((uint)(3)); // Container child table5.Gtk.Table+TableChild this.TimestampFormatEntry = new global::Gtk.Entry (); this.TimestampFormatEntry.WidthRequest = 60; this.TimestampFormatEntry.Name = "TimestampFormatEntry"; this.TimestampFormatEntry.Text = "HH:mm"; this.TimestampFormatEntry.IsEditable = true; this.TimestampFormatEntry.InvisibleChar = '●'; this.table5.Add (this.TimestampFormatEntry); global::Gtk.Table.TableChild w44 = ((global::Gtk.Table.TableChild)(this.table5 [this.TimestampFormatEntry])); w44.LeftAttach = ((uint)(1)); w44.RightAttach = ((uint)(2)); w44.YOptions = ((global::Gtk.AttachOptions)(0)); this.vbox10.Add (this.table5); global::Gtk.Box.BoxChild w45 = ((global::Gtk.Box.BoxChild)(this.vbox10 [this.table5])); w45.Position = 0; w45.Expand = false; w45.Fill = false; // Container child vbox10.Gtk.Box+BoxChild this.StripColorsCheckButton = new global::Gtk.CheckButton (); this.StripColorsCheckButton.Name = "StripColorsCheckButton"; this.StripColorsCheckButton.DrawIndicator = true; this.StripColorsCheckButton.UseUnderline = true; this.StripColorsCheckButton.Remove (this.StripColorsCheckButton.Child); // Container child StripColorsCheckButton.Gtk.Container+ContainerChild this.alignment16 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); this.alignment16.Name = "alignment16"; // Container child alignment16.Gtk.Container+ContainerChild this.hbox17 = new global::Gtk.HBox (); this.hbox17.Name = "hbox17"; this.hbox17.Spacing = 2; // Container child hbox17.Gtk.Box+BoxChild this.image5 = new global::Gtk.Image (); this.image5.Name = "image5"; this.image5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-cut", global::Gtk.IconSize.Menu); this.hbox17.Add (this.image5); global::Gtk.Box.BoxChild w46 = ((global::Gtk.Box.BoxChild)(this.hbox17 [this.image5])); w46.Position = 0; w46.Expand = false; w46.Fill = false; // Container child hbox17.Gtk.Box+BoxChild this.label47 = new global::Gtk.Label (); this.label47.Name = "label47"; this.label47.LabelProp = global::Mono.Unix.Catalog.GetString ("Strip Colors"); this.label47.UseUnderline = true; this.hbox17.Add (this.label47); global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(this.hbox17 [this.label47])); w47.Position = 1; w47.Expand = false; w47.Fill = false; this.alignment16.Add (this.hbox17); this.StripColorsCheckButton.Add (this.alignment16); this.vbox10.Add (this.StripColorsCheckButton); global::Gtk.Box.BoxChild w50 = ((global::Gtk.Box.BoxChild)(this.vbox10 [this.StripColorsCheckButton])); w50.Position = 1; w50.Expand = false; w50.Fill = false; // Container child vbox10.Gtk.Box+BoxChild this.StripFormattingsCheckButton = new global::Gtk.CheckButton (); this.StripFormattingsCheckButton.Name = "StripFormattingsCheckButton"; this.StripFormattingsCheckButton.DrawIndicator = true; this.StripFormattingsCheckButton.UseUnderline = true; this.StripFormattingsCheckButton.Remove (this.StripFormattingsCheckButton.Child); // Container child StripFormattingsCheckButton.Gtk.Container+ContainerChild this.alignment15 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); this.alignment15.Name = "alignment15"; // Container child alignment15.Gtk.Container+ContainerChild this.hbox16 = new global::Gtk.HBox (); this.hbox16.Name = "hbox16"; this.hbox16.Spacing = 2; // Container child hbox16.Gtk.Box+BoxChild this.image6 = new global::Gtk.Image (); this.image6.Name = "image6"; this.image6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-cut", global::Gtk.IconSize.Menu); this.hbox16.Add (this.image6); global::Gtk.Box.BoxChild w51 = ((global::Gtk.Box.BoxChild)(this.hbox16 [this.image6])); w51.Position = 0; w51.Expand = false; w51.Fill = false; // Container child hbox16.Gtk.Box+BoxChild this.label46 = new global::Gtk.Label (); this.label46.Name = "label46"; this.label46.LabelProp = global::Mono.Unix.Catalog.GetString ("Strip Formattings"); this.label46.UseUnderline = true; this.hbox16.Add (this.label46); global::Gtk.Box.BoxChild w52 = ((global::Gtk.Box.BoxChild)(this.hbox16 [this.label46])); w52.Position = 1; w52.Expand = false; w52.Fill = false; this.alignment15.Add (this.hbox16); this.StripFormattingsCheckButton.Add (this.alignment15); this.vbox10.Add (this.StripFormattingsCheckButton); global::Gtk.Box.BoxChild w55 = ((global::Gtk.Box.BoxChild)(this.vbox10 [this.StripFormattingsCheckButton])); w55.Position = 2; w55.Expand = false; w55.Fill = false; // Container child vbox10.Gtk.Box+BoxChild this.checkbutton1 = new global::Gtk.CheckButton (); this.checkbutton1.Sensitive = false; this.checkbutton1.Name = "checkbutton1"; this.checkbutton1.DrawIndicator = true; this.checkbutton1.UseUnderline = true; this.checkbutton1.Remove (this.checkbutton1.Child); // Container child checkbutton1.Gtk.Container+ContainerChild this.alignment26 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); this.alignment26.Name = "alignment26"; // Container child alignment26.Gtk.Container+ContainerChild this.hbox28 = new global::Gtk.HBox (); this.hbox28.Name = "hbox28"; this.hbox28.Spacing = 2; // Container child hbox28.Gtk.Box+BoxChild this.image7 = new global::Gtk.Image (); this.image7.Name = "image7"; this.image7.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-cut", global::Gtk.IconSize.Menu); this.hbox28.Add (this.image7); global::Gtk.Box.BoxChild w56 = ((global::Gtk.Box.BoxChild)(this.hbox28 [this.image7])); w56.Position = 0; w56.Expand = false; w56.Fill = false; // Container child hbox28.Gtk.Box+BoxChild this.label60 = new global::Gtk.Label (); this.label60.Name = "label60"; this.label60.LabelProp = global::Mono.Unix.Catalog.GetString ("Strip UTF-8"); this.label60.UseUnderline = true; this.hbox28.Add (this.label60); global::Gtk.Box.BoxChild w57 = ((global::Gtk.Box.BoxChild)(this.hbox28 [this.label60])); w57.Position = 1; w57.Expand = false; w57.Fill = false; this.alignment26.Add (this.hbox28); this.checkbutton1.Add (this.alignment26); this.vbox10.Add (this.checkbutton1); global::Gtk.Box.BoxChild w60 = ((global::Gtk.Box.BoxChild)(this.vbox10 [this.checkbutton1])); w60.Position = 3; w60.Expand = false; w60.Fill = false; this.InterfaceNotebook.Add (this.vbox10); // Notebook tab this.label1 = new global::Gtk.Label (); this.label1.Name = "label1"; this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("General"); this.InterfaceNotebook.SetTabLabel (this.vbox10, this.label1); this.label1.ShowAll (); // Container child InterfaceNotebook.Gtk.Notebook+NotebookChild this.vbox5 = new global::Gtk.VBox (); this.vbox5.Name = "vbox5"; this.vbox5.Spacing = 5; // Container child vbox5.Gtk.Box+BoxChild this.frame1 = new global::Gtk.Frame (); this.frame1.Name = "frame1"; // Container child frame1.Gtk.Container+ContainerChild this.alignment4 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); this.alignment4.Name = "alignment4"; this.alignment4.LeftPadding = ((uint)(12)); // Container child alignment4.Gtk.Container+ContainerChild this.vbox6 = new global::Gtk.VBox (); this.vbox6.Name = "vbox6"; // Container child vbox6.Gtk.Box+BoxChild this.TabPositionRadioButtonTop = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("Top")); this.TabPositionRadioButtonTop.CanFocus = true; this.TabPositionRadioButtonTop.Name = "TabPositionRadioButtonTop"; this.TabPositionRadioButtonTop.Active = true; this.TabPositionRadioButtonTop.DrawIndicator = true; this.TabPositionRadioButtonTop.UseUnderline = true; this.TabPositionRadioButtonTop.Group = new global::GLib.SList (global::System.IntPtr.Zero); this.TabPositionRadioButtonTop.Remove (this.TabPositionRadioButtonTop.Child); // Container child TabPositionRadioButtonTop.Gtk.Container+ContainerChild this.hbox10 = new global::Gtk.HBox (); this.hbox10.Name = "hbox10"; this.hbox10.Spacing = 6; // Container child hbox10.Gtk.Box+BoxChild this.image12 = new global::Gtk.Image (); this.image12.Name = "image12"; this.image12.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-top", global::Gtk.IconSize.Menu); this.hbox10.Add (this.image12); global::Gtk.Box.BoxChild w62 = ((global::Gtk.Box.BoxChild)(this.hbox10 [this.image12])); w62.Position = 0; w62.Expand = false; w62.Fill = false; // Container child hbox10.Gtk.Box+BoxChild this.label5 = new global::Gtk.Label (); this.label5.Name = "label5"; this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("Top"); this.hbox10.Add (this.label5); global::Gtk.Box.BoxChild w63 = ((global::Gtk.Box.BoxChild)(this.hbox10 [this.label5])); w63.Position = 1; w63.Expand = false; w63.Fill = false; this.TabPositionRadioButtonTop.Add (this.hbox10); this.vbox6.Add (this.TabPositionRadioButtonTop); global::Gtk.Box.BoxChild w65 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.TabPositionRadioButtonTop])); w65.Position = 0; w65.Expand = false; w65.Fill = false; // Container child vbox6.Gtk.Box+BoxChild this.TabPositionRadioButtonBottom = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("Bottom")); this.TabPositionRadioButtonBottom.Name = "TabPositionRadioButtonBottom"; this.TabPositionRadioButtonBottom.DrawIndicator = true; this.TabPositionRadioButtonBottom.UseUnderline = true; this.TabPositionRadioButtonBottom.Group = this.TabPositionRadioButtonTop.Group; this.TabPositionRadioButtonBottom.Remove (this.TabPositionRadioButtonBottom.Child); // Container child TabPositionRadioButtonBottom.Gtk.Container+ContainerChild this.hbox24 = new global::Gtk.HBox (); this.hbox24.Name = "hbox24"; this.hbox24.Spacing = 2; // Container child hbox24.Gtk.Box+BoxChild this.image9 = new global::Gtk.Image (); this.image9.Name = "image9"; this.image9.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-bottom", global::Gtk.IconSize.Menu); this.hbox24.Add (this.image9); global::Gtk.Box.BoxChild w66 = ((global::Gtk.Box.BoxChild)(this.hbox24 [this.image9])); w66.Position = 0; w66.Expand = false; w66.Fill = false; // Container child hbox24.Gtk.Box+BoxChild this.label54 = new global::Gtk.Label (); this.label54.Name = "label54"; this.label54.LabelProp = global::Mono.Unix.Catalog.GetString ("Bottom"); this.label54.UseUnderline = true; this.hbox24.Add (this.label54); global::Gtk.Box.BoxChild w67 = ((global::Gtk.Box.BoxChild)(this.hbox24 [this.label54])); w67.Position = 1; w67.Expand = false; w67.Fill = false; this.TabPositionRadioButtonBottom.Add (this.hbox24); this.vbox6.Add (this.TabPositionRadioButtonBottom); global::Gtk.Box.BoxChild w69 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.TabPositionRadioButtonBottom])); w69.Position = 1; w69.Expand = false; w69.Fill = false; // Container child vbox6.Gtk.Box+BoxChild this.TabPositionRadioButtonLeft = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("Left")); this.TabPositionRadioButtonLeft.Name = "TabPositionRadioButtonLeft"; this.TabPositionRadioButtonLeft.DrawIndicator = true; this.TabPositionRadioButtonLeft.UseUnderline = true; this.TabPositionRadioButtonLeft.Group = this.TabPositionRadioButtonTop.Group; this.TabPositionRadioButtonLeft.Remove (this.TabPositionRadioButtonLeft.Child); // Container child TabPositionRadioButtonLeft.Gtk.Container+ContainerChild this.alignment24 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); this.alignment24.Name = "alignment24"; // Container child alignment24.Gtk.Container+ContainerChild this.hbox25 = new global::Gtk.HBox (); this.hbox25.Name = "hbox25"; this.hbox25.Spacing = 2; // Container child hbox25.Gtk.Box+BoxChild this.image10 = new global::Gtk.Image (); this.image10.Name = "image10"; this.image10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-first", global::Gtk.IconSize.Menu); this.hbox25.Add (this.image10); global::Gtk.Box.BoxChild w70 = ((global::Gtk.Box.BoxChild)(this.hbox25 [this.image10])); w70.Position = 0; w70.Expand = false; w70.Fill = false; // Container child hbox25.Gtk.Box+BoxChild this.label55 = new global::Gtk.Label (); this.label55.Name = "label55"; this.label55.LabelProp = global::Mono.Unix.Catalog.GetString ("Left"); this.label55.UseUnderline = true; this.hbox25.Add (this.label55); global::Gtk.Box.BoxChild w71 = ((global::Gtk.Box.BoxChild)(this.hbox25 [this.label55])); w71.Position = 1; w71.Expand = false; w71.Fill = false; this.alignment24.Add (this.hbox25); this.TabPositionRadioButtonLeft.Add (this.alignment24); this.vbox6.Add (this.TabPositionRadioButtonLeft); global::Gtk.Box.BoxChild w74 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.TabPositionRadioButtonLeft])); w74.Position = 2; w74.Expand = false; w74.Fill = false; // Container child vbox6.Gtk.Box+BoxChild this.TabPositionRadioButtonRight = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("Right")); this.TabPositionRadioButtonRight.Name = "TabPositionRadioButtonRight"; this.TabPositionRadioButtonRight.DrawIndicator = true; this.TabPositionRadioButtonRight.UseUnderline = true; this.TabPositionRadioButtonRight.Group = this.TabPositionRadioButtonTop.Group; this.TabPositionRadioButtonRight.Remove (this.TabPositionRadioButtonRight.Child); // Container child TabPositionRadioButtonRight.Gtk.Container+ContainerChild this.alignment25 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); this.alignment25.Name = "alignment25"; // Container child alignment25.Gtk.Container+ContainerChild this.hbox26 = new global::Gtk.HBox (); this.hbox26.Name = "hbox26"; this.hbox26.Spacing = 2; // Container child hbox26.Gtk.Box+BoxChild this.image11 = new global::Gtk.Image (); this.image11.Name = "image11"; this.image11.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-last", global::Gtk.IconSize.Menu); this.hbox26.Add (this.image11); global::Gtk.Box.BoxChild w75 = ((global::Gtk.Box.BoxChild)(this.hbox26 [this.image11])); w75.Position = 0; w75.Expand = false; w75.Fill = false; // Container child hbox26.Gtk.Box+BoxChild this.label56 = new global::Gtk.Label (); this.label56.Name = "label56"; this.label56.LabelProp = global::Mono.Unix.Catalog.GetString ("Right"); this.label56.UseUnderline = true; this.hbox26.Add (this.label56); global::Gtk.Box.BoxChild w76 = ((global::Gtk.Box.BoxChild)(this.hbox26 [this.label56])); w76.Position = 1; w76.Expand = false; w76.Fill = false; this.alignment25.Add (this.hbox26); this.TabPositionRadioButtonRight.Add (this.alignment25); this.vbox6.Add (this.TabPositionRadioButtonRight); global::Gtk.Box.BoxChild w79 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.TabPositionRadioButtonRight])); w79.Position = 3; w79.Expand = false; w79.Fill = false; // Container child vbox6.Gtk.Box+BoxChild this.TabPositionRadioButtonNone = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("None")); this.TabPositionRadioButtonNone.Name = "TabPositionRadioButtonNone"; this.TabPositionRadioButtonNone.DrawIndicator = true; this.TabPositionRadioButtonNone.UseUnderline = true; this.TabPositionRadioButtonNone.Group = this.TabPositionRadioButtonTop.Group; this.vbox6.Add (this.TabPositionRadioButtonNone); global::Gtk.Box.BoxChild w80 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.TabPositionRadioButtonNone])); w80.Position = 4; w80.Expand = false; w80.Fill = false; this.alignment4.Add (this.vbox6); this.frame1.Add (this.alignment4); this.label9 = new global::Gtk.Label (); this.label9.Name = "label9"; this.label9.LabelProp = global::Mono.Unix.Catalog.GetString (" Tabs Position "); this.label9.UseMarkup = true; this.frame1.LabelWidget = this.label9; this.vbox5.Add (this.frame1); global::Gtk.Box.BoxChild w83 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.frame1])); w83.Position = 0; w83.Expand = false; // Container child vbox5.Gtk.Box+BoxChild this.frame4 = new global::Gtk.Frame (); this.frame4.Name = "frame4"; // Container child frame4.Gtk.Container+ContainerChild this.alignment8 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); this.alignment8.Name = "alignment8"; this.alignment8.LeftPadding = ((uint)(12)); // Container child alignment8.Gtk.Container+ContainerChild this.table3 = new global::Gtk.Table (((uint)(4)), ((uint)(2)), false); this.table3.Name = "table3"; this.table3.RowSpacing = ((uint)(5)); this.table3.ColumnSpacing = ((uint)(5)); // Container child table3.Gtk.Table+TableChild this.ActivityColorButton = new global::Gtk.ColorButton (); this.ActivityColorButton.Name = "ActivityColorButton"; this.table3.Add (this.ActivityColorButton); global::Gtk.Table.TableChild w84 = ((global::Gtk.Table.TableChild)(this.table3 [this.ActivityColorButton])); w84.TopAttach = ((uint)(1)); w84.BottomAttach = ((uint)(2)); w84.LeftAttach = ((uint)(1)); w84.RightAttach = ((uint)(2)); w84.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table3.Gtk.Table+TableChild this.HighlightColorButton = new global::Gtk.ColorButton (); this.HighlightColorButton.Name = "HighlightColorButton"; this.table3.Add (this.HighlightColorButton); global::Gtk.Table.TableChild w85 = ((global::Gtk.Table.TableChild)(this.table3 [this.HighlightColorButton])); w85.TopAttach = ((uint)(3)); w85.BottomAttach = ((uint)(4)); w85.LeftAttach = ((uint)(1)); w85.RightAttach = ((uint)(2)); w85.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table3.Gtk.Table+TableChild this.label16 = new global::Gtk.Label (); this.label16.Name = "label16"; this.label16.Xalign = 0F; this.label16.LabelProp = global::Mono.Unix.Catalog.GetString ("No Activity"); this.table3.Add (this.label16); global::Gtk.Table.TableChild w86 = ((global::Gtk.Table.TableChild)(this.table3 [this.label16])); w86.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table3.Gtk.Table+TableChild this.label17 = new global::Gtk.Label (); this.label17.Name = "label17"; this.label17.Xalign = 0F; this.label17.LabelProp = global::Mono.Unix.Catalog.GetString ("Activity"); this.table3.Add (this.label17); global::Gtk.Table.TableChild w87 = ((global::Gtk.Table.TableChild)(this.table3 [this.label17])); w87.TopAttach = ((uint)(1)); w87.BottomAttach = ((uint)(2)); w87.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table3.Gtk.Table+TableChild this.label18 = new global::Gtk.Label (); this.label18.Name = "label18"; this.label18.Xalign = 0F; this.label18.LabelProp = global::Mono.Unix.Catalog.GetString ("Join/Part/Mode"); this.table3.Add (this.label18); global::Gtk.Table.TableChild w88 = ((global::Gtk.Table.TableChild)(this.table3 [this.label18])); w88.TopAttach = ((uint)(2)); w88.BottomAttach = ((uint)(3)); w88.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table3.Gtk.Table+TableChild this.label59 = new global::Gtk.Label (); this.label59.Name = "label59"; this.label59.Xalign = 0F; this.label59.LabelProp = global::Mono.Unix.Catalog.GetString ("Highlight"); this.table3.Add (this.label59); global::Gtk.Table.TableChild w89 = ((global::Gtk.Table.TableChild)(this.table3 [this.label59])); w89.TopAttach = ((uint)(3)); w89.BottomAttach = ((uint)(4)); w89.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table3.Gtk.Table+TableChild this.ModeColorButton = new global::Gtk.ColorButton (); this.ModeColorButton.Name = "ModeColorButton"; this.table3.Add (this.ModeColorButton); global::Gtk.Table.TableChild w90 = ((global::Gtk.Table.TableChild)(this.table3 [this.ModeColorButton])); w90.TopAttach = ((uint)(2)); w90.BottomAttach = ((uint)(3)); w90.LeftAttach = ((uint)(1)); w90.RightAttach = ((uint)(2)); w90.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table3.Gtk.Table+TableChild this.NoActivityColorButton = new global::Gtk.ColorButton (); this.NoActivityColorButton.Name = "NoActivityColorButton"; this.table3.Add (this.NoActivityColorButton); global::Gtk.Table.TableChild w91 = ((global::Gtk.Table.TableChild)(this.table3 [this.NoActivityColorButton])); w91.LeftAttach = ((uint)(1)); w91.RightAttach = ((uint)(2)); w91.YOptions = ((global::Gtk.AttachOptions)(0)); this.alignment8.Add (this.table3); this.frame4.Add (this.alignment8); this.label15 = new global::Gtk.Label (); this.label15.Name = "label15"; this.label15.LabelProp = global::Mono.Unix.Catalog.GetString (" Tab Colors "); this.label15.UseMarkup = true; this.frame4.LabelWidget = this.label15; this.vbox5.Add (this.frame4); global::Gtk.Box.BoxChild w94 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.frame4])); w94.Position = 1; w94.Expand = false; this.InterfaceNotebook.Add (this.vbox5); global::Gtk.Notebook.NotebookChild w95 = ((global::Gtk.Notebook.NotebookChild)(this.InterfaceNotebook [this.vbox5])); w95.Position = 1; // Notebook tab this.label2 = new global::Gtk.Label (); this.label2.Name = "label2"; this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Tabs"); this.InterfaceNotebook.SetTabLabel (this.vbox5, this.label2); this.label2.ShowAll (); // Container child InterfaceNotebook.Gtk.Notebook+NotebookChild this.frame3 = new global::Gtk.Frame (); this.frame3.Name = "frame3"; // Container child frame3.Gtk.Container+ContainerChild this.alignment7 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); this.alignment7.Name = "alignment7"; this.alignment7.LeftPadding = ((uint)(12)); // Container child alignment7.Gtk.Container+ContainerChild this.vbox7 = new global::Gtk.VBox (); this.vbox7.Name = "vbox7"; this.vbox7.Spacing = 5; // Container child vbox7.Gtk.Box+BoxChild this.table4 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false); this.table4.Name = "table4"; this.table4.RowSpacing = ((uint)(5)); this.table4.ColumnSpacing = ((uint)(5)); this.table4.BorderWidth = ((uint)(5)); // Container child table4.Gtk.Table+TableChild this.CommandCharacterEntry = new global::Gtk.Entry (); this.CommandCharacterEntry.WidthRequest = 30; this.CommandCharacterEntry.Name = "CommandCharacterEntry"; this.CommandCharacterEntry.Text = "/"; this.CommandCharacterEntry.IsEditable = true; this.CommandCharacterEntry.MaxLength = 1; this.CommandCharacterEntry.InvisibleChar = '●'; this.table4.Add (this.CommandCharacterEntry); global::Gtk.Table.TableChild w96 = ((global::Gtk.Table.TableChild)(this.table4 [this.CommandCharacterEntry])); w96.TopAttach = ((uint)(1)); w96.BottomAttach = ((uint)(2)); w96.LeftAttach = ((uint)(1)); w96.RightAttach = ((uint)(2)); w96.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table4.Gtk.Table+TableChild this.CommandHistorySizeSpinButton = new global::Gtk.SpinButton (1, 9999, 1); this.CommandHistorySizeSpinButton.WidthRequest = 60; this.CommandHistorySizeSpinButton.Name = "CommandHistorySizeSpinButton"; this.CommandHistorySizeSpinButton.Adjustment.PageIncrement = 10; this.CommandHistorySizeSpinButton.Adjustment.PageSize = 10; this.CommandHistorySizeSpinButton.ClimbRate = 1; this.CommandHistorySizeSpinButton.Numeric = true; this.CommandHistorySizeSpinButton.Value = 30; this.table4.Add (this.CommandHistorySizeSpinButton); global::Gtk.Table.TableChild w97 = ((global::Gtk.Table.TableChild)(this.table4 [this.CommandHistorySizeSpinButton])); w97.TopAttach = ((uint)(2)); w97.BottomAttach = ((uint)(3)); w97.LeftAttach = ((uint)(1)); w97.RightAttach = ((uint)(2)); w97.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table4.Gtk.Table+TableChild this.CompletionCharacterEntry = new global::Gtk.Entry (); this.CompletionCharacterEntry.WidthRequest = 30; this.CompletionCharacterEntry.Name = "CompletionCharacterEntry"; this.CompletionCharacterEntry.Text = ":"; this.CompletionCharacterEntry.IsEditable = true; this.CompletionCharacterEntry.MaxLength = 1; this.CompletionCharacterEntry.InvisibleChar = '●'; this.table4.Add (this.CompletionCharacterEntry); global::Gtk.Table.TableChild w98 = ((global::Gtk.Table.TableChild)(this.table4 [this.CompletionCharacterEntry])); w98.LeftAttach = ((uint)(1)); w98.RightAttach = ((uint)(2)); w98.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table4.Gtk.Table+TableChild this.hbox4 = new global::Gtk.HBox (); this.hbox4.Name = "hbox4"; // Container child hbox4.Gtk.Box+BoxChild this.label13 = new global::Gtk.Label (); this.label13.Name = "label13"; this.label13.LabelProp = global::Mono.Unix.Catalog.GetString ("Completion Character:"); this.hbox4.Add (this.label13); global::Gtk.Box.BoxChild w99 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.label13])); w99.Position = 0; w99.Expand = false; w99.Fill = false; // Container child hbox4.Gtk.Box+BoxChild this.fixed22 = new global::Gtk.Fixed (); this.fixed22.Name = "fixed22"; this.fixed22.HasWindow = false; this.hbox4.Add (this.fixed22); global::Gtk.Box.BoxChild w100 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.fixed22])); w100.Position = 1; this.table4.Add (this.hbox4); // Container child table4.Gtk.Table+TableChild this.hbox5 = new global::Gtk.HBox (); this.hbox5.Name = "hbox5"; // Container child hbox5.Gtk.Box+BoxChild this.label14 = new global::Gtk.Label (); this.label14.Name = "label14"; this.label14.LabelProp = global::Mono.Unix.Catalog.GetString ("Command Character:"); this.hbox5.Add (this.label14); global::Gtk.Box.BoxChild w102 = ((global::Gtk.Box.BoxChild)(this.hbox5 [this.label14])); w102.Position = 0; w102.Expand = false; w102.Fill = false; // Container child hbox5.Gtk.Box+BoxChild this.fixed23 = new global::Gtk.Fixed (); this.fixed23.Name = "fixed23"; this.fixed23.HasWindow = false; this.hbox5.Add (this.fixed23); global::Gtk.Box.BoxChild w103 = ((global::Gtk.Box.BoxChild)(this.hbox5 [this.fixed23])); w103.Position = 1; this.table4.Add (this.hbox5); global::Gtk.Table.TableChild w104 = ((global::Gtk.Table.TableChild)(this.table4 [this.hbox5])); w104.TopAttach = ((uint)(1)); w104.BottomAttach = ((uint)(2)); // Container child table4.Gtk.Table+TableChild this.hbox6 = new global::Gtk.HBox (); this.hbox6.Name = "hbox6"; // Container child hbox6.Gtk.Box+BoxChild this.label42 = new global::Gtk.Label (); this.label42.Name = "label42"; this.label42.LabelProp = global::Mono.Unix.Catalog.GetString ("Command History Size:"); this.hbox6.Add (this.label42); global::Gtk.Box.BoxChild w105 = ((global::Gtk.Box.BoxChild)(this.hbox6 [this.label42])); w105.Position = 0; w105.Expand = false; w105.Fill = false; // Container child hbox6.Gtk.Box+BoxChild this.fixed24 = new global::Gtk.Fixed (); this.fixed24.Name = "fixed24"; this.fixed24.HasWindow = false; this.hbox6.Add (this.fixed24); global::Gtk.Box.BoxChild w106 = ((global::Gtk.Box.BoxChild)(this.hbox6 [this.fixed24])); w106.Position = 1; this.table4.Add (this.hbox6); global::Gtk.Table.TableChild w107 = ((global::Gtk.Table.TableChild)(this.table4 [this.hbox6])); w107.TopAttach = ((uint)(2)); w107.BottomAttach = ((uint)(3)); this.vbox7.Add (this.table4); global::Gtk.Box.BoxChild w108 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.table4])); w108.Position = 0; w108.Expand = false; w108.Fill = false; // Container child vbox7.Gtk.Box+BoxChild this.BashStyleCompletionCheckButton = new global::Gtk.CheckButton (); this.BashStyleCompletionCheckButton.Name = "BashStyleCompletionCheckButton"; this.BashStyleCompletionCheckButton.Label = global::Mono.Unix.Catalog.GetString ("Bash-Style Completion"); this.BashStyleCompletionCheckButton.DrawIndicator = true; this.BashStyleCompletionCheckButton.UseUnderline = true; this.vbox7.Add (this.BashStyleCompletionCheckButton); global::Gtk.Box.BoxChild w109 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.BashStyleCompletionCheckButton])); w109.Position = 1; w109.Expand = false; w109.Fill = false; this.alignment7.Add (this.vbox7); this.frame3.Add (this.alignment7); this.label12 = new global::Gtk.Label (); this.label12.Name = "label12"; this.label12.LabelProp = global::Mono.Unix.Catalog.GetString (" Entry Field "); this.label12.UseMarkup = true; this.frame3.LabelWidget = this.label12; this.InterfaceNotebook.Add (this.frame3); global::Gtk.Notebook.NotebookChild w112 = ((global::Gtk.Notebook.NotebookChild)(this.InterfaceNotebook [this.frame3])); w112.Position = 2; // Notebook tab this.label3 = new global::Gtk.Label (); this.label3.Name = "label3"; this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Input"); this.InterfaceNotebook.SetTabLabel (this.frame3, this.label3); this.label3.ShowAll (); // Container child InterfaceNotebook.Gtk.Notebook+NotebookChild this.vbox8 = new global::Gtk.VBox (); this.vbox8.Name = "vbox8"; // Container child vbox8.Gtk.Box+BoxChild this.frame2 = new global::Gtk.Frame (); this.frame2.Name = "frame2"; // Container child frame2.Gtk.Container+ContainerChild this.alignment5 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); this.alignment5.Name = "alignment5"; this.alignment5.LeftPadding = ((uint)(12)); // Container child alignment5.Gtk.Container+ContainerChild this.vbox9 = new global::Gtk.VBox (); this.vbox9.Name = "vbox9"; this.vbox9.Spacing = 5; this.vbox9.BorderWidth = ((uint)(5)); // Container child vbox9.Gtk.Box+BoxChild this.NickColorsCheckButton = new global::Gtk.CheckButton (); this.NickColorsCheckButton.Name = "NickColorsCheckButton"; this.NickColorsCheckButton.Label = global::Mono.Unix.Catalog.GetString ("Nick Colors"); this.NickColorsCheckButton.DrawIndicator = true; this.NickColorsCheckButton.UseUnderline = true; this.vbox9.Add (this.NickColorsCheckButton); global::Gtk.Box.BoxChild w113 = ((global::Gtk.Box.BoxChild)(this.vbox9 [this.NickColorsCheckButton])); w113.Position = 0; w113.Expand = false; // Container child vbox9.Gtk.Box+BoxChild this.frame10 = new global::Gtk.Frame (); this.frame10.Name = "frame10"; // Container child frame10.Gtk.Container+ContainerChild this.alignment14 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); this.alignment14.Name = "alignment14"; this.alignment14.LeftPadding = ((uint)(12)); // Container child alignment14.Gtk.Container+ContainerChild this.vbox11 = new global::Gtk.VBox (); this.vbox11.Name = "vbox11"; // Container child vbox11.Gtk.Box+BoxChild this.TopicPositionRadioButtonTop = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("Top")); this.TopicPositionRadioButtonTop.Name = "TopicPositionRadioButtonTop"; this.TopicPositionRadioButtonTop.Active = true; this.TopicPositionRadioButtonTop.DrawIndicator = true; this.TopicPositionRadioButtonTop.UseUnderline = true; this.TopicPositionRadioButtonTop.Group = new global::GLib.SList (global::System.IntPtr.Zero); this.TopicPositionRadioButtonTop.Remove (this.TopicPositionRadioButtonTop.Child); // Container child TopicPositionRadioButtonTop.Gtk.Container+ContainerChild this.alignment21 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); this.alignment21.Name = "alignment21"; // Container child alignment21.Gtk.Container+ContainerChild this.hbox22 = new global::Gtk.HBox (); this.hbox22.Name = "hbox22"; this.hbox22.Spacing = 2; // Container child hbox22.Gtk.Box+BoxChild this.image1 = new global::Gtk.Image (); this.image1.Name = "image1"; this.image1.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-top", global::Gtk.IconSize.Menu); this.hbox22.Add (this.image1); global::Gtk.Box.BoxChild w114 = ((global::Gtk.Box.BoxChild)(this.hbox22 [this.image1])); w114.Position = 0; w114.Expand = false; w114.Fill = false; // Container child hbox22.Gtk.Box+BoxChild this.label52 = new global::Gtk.Label (); this.label52.Name = "label52"; this.label52.LabelProp = global::Mono.Unix.Catalog.GetString ("Top"); this.label52.UseUnderline = true; this.hbox22.Add (this.label52); global::Gtk.Box.BoxChild w115 = ((global::Gtk.Box.BoxChild)(this.hbox22 [this.label52])); w115.Position = 1; w115.Expand = false; w115.Fill = false; this.alignment21.Add (this.hbox22); this.TopicPositionRadioButtonTop.Add (this.alignment21); this.vbox11.Add (this.TopicPositionRadioButtonTop); global::Gtk.Box.BoxChild w118 = ((global::Gtk.Box.BoxChild)(this.vbox11 [this.TopicPositionRadioButtonTop])); w118.Position = 0; w118.Expand = false; w118.Fill = false; // Container child vbox11.Gtk.Box+BoxChild this.TopicPositionRadioButtonBottom = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("Bottom")); this.TopicPositionRadioButtonBottom.Name = "TopicPositionRadioButtonBottom"; this.TopicPositionRadioButtonBottom.DrawIndicator = true; this.TopicPositionRadioButtonBottom.UseUnderline = true; this.TopicPositionRadioButtonBottom.Group = this.TopicPositionRadioButtonTop.Group; this.TopicPositionRadioButtonBottom.Remove (this.TopicPositionRadioButtonBottom.Child); // Container child TopicPositionRadioButtonBottom.Gtk.Container+ContainerChild this.alignment20 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); this.alignment20.Name = "alignment20"; // Container child alignment20.Gtk.Container+ContainerChild this.hbox21 = new global::Gtk.HBox (); this.hbox21.Name = "hbox21"; this.hbox21.Spacing = 2; // Container child hbox21.Gtk.Box+BoxChild this.image2 = new global::Gtk.Image (); this.image2.Name = "image2"; this.image2.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-bottom", global::Gtk.IconSize.Menu); this.hbox21.Add (this.image2); global::Gtk.Box.BoxChild w119 = ((global::Gtk.Box.BoxChild)(this.hbox21 [this.image2])); w119.Position = 0; w119.Expand = false; w119.Fill = false; // Container child hbox21.Gtk.Box+BoxChild this.label51 = new global::Gtk.Label (); this.label51.Name = "label51"; this.label51.LabelProp = global::Mono.Unix.Catalog.GetString ("Bottom"); this.label51.UseUnderline = true; this.hbox21.Add (this.label51); global::Gtk.Box.BoxChild w120 = ((global::Gtk.Box.BoxChild)(this.hbox21 [this.label51])); w120.Position = 1; w120.Expand = false; w120.Fill = false; this.alignment20.Add (this.hbox21); this.TopicPositionRadioButtonBottom.Add (this.alignment20); this.vbox11.Add (this.TopicPositionRadioButtonBottom); global::Gtk.Box.BoxChild w123 = ((global::Gtk.Box.BoxChild)(this.vbox11 [this.TopicPositionRadioButtonBottom])); w123.Position = 1; w123.Expand = false; w123.Fill = false; // Container child vbox11.Gtk.Box+BoxChild this.TopicPositionRadioButtonNone = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("None")); this.TopicPositionRadioButtonNone.Name = "TopicPositionRadioButtonNone"; this.TopicPositionRadioButtonNone.DrawIndicator = true; this.TopicPositionRadioButtonNone.UseUnderline = true; this.TopicPositionRadioButtonNone.Group = this.TopicPositionRadioButtonTop.Group; this.vbox11.Add (this.TopicPositionRadioButtonNone); global::Gtk.Box.BoxChild w124 = ((global::Gtk.Box.BoxChild)(this.vbox11 [this.TopicPositionRadioButtonNone])); w124.Position = 2; w124.Expand = false; w124.Fill = false; this.alignment14.Add (this.vbox11); this.frame10.Add (this.alignment14); this.label41 = new global::Gtk.Label (); this.label41.Name = "label41"; this.label41.LabelProp = global::Mono.Unix.Catalog.GetString (" Topic Position "); this.label41.UseMarkup = true; this.frame10.LabelWidget = this.label41; this.vbox9.Add (this.frame10); global::Gtk.Box.BoxChild w127 = ((global::Gtk.Box.BoxChild)(this.vbox9 [this.frame10])); w127.Position = 1; w127.Expand = false; // Container child vbox9.Gtk.Box+BoxChild this.frame9 = new global::Gtk.Frame (); this.frame9.WidthRequest = 152; this.frame9.HeightRequest = 96; this.frame9.Name = "frame9"; // Container child frame9.Gtk.Container+ContainerChild this.alignment13 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); this.alignment13.Name = "alignment13"; this.alignment13.LeftPadding = ((uint)(12)); // Container child alignment13.Gtk.Container+ContainerChild this.vbox12 = new global::Gtk.VBox (); this.vbox12.Name = "vbox12"; // Container child vbox12.Gtk.Box+BoxChild this.UserListPositionRadioButtonLeft = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("Left")); this.UserListPositionRadioButtonLeft.Name = "UserListPositionRadioButtonLeft"; this.UserListPositionRadioButtonLeft.Active = true; this.UserListPositionRadioButtonLeft.DrawIndicator = true; this.UserListPositionRadioButtonLeft.UseUnderline = true; this.UserListPositionRadioButtonLeft.Group = new global::GLib.SList (global::System.IntPtr.Zero); this.UserListPositionRadioButtonLeft.Remove (this.UserListPositionRadioButtonLeft.Child); // Container child UserListPositionRadioButtonLeft.Gtk.Container+ContainerChild this.alignment17 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); this.alignment17.Name = "alignment17"; // Container child alignment17.Gtk.Container+ContainerChild this.hbox18 = new global::Gtk.HBox (); this.hbox18.Name = "hbox18"; this.hbox18.Spacing = 2; // Container child hbox18.Gtk.Box+BoxChild this.image3 = new global::Gtk.Image (); this.image3.Name = "image3"; this.image3.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-first", global::Gtk.IconSize.Menu); this.hbox18.Add (this.image3); global::Gtk.Box.BoxChild w128 = ((global::Gtk.Box.BoxChild)(this.hbox18 [this.image3])); w128.Position = 0; w128.Expand = false; w128.Fill = false; // Container child hbox18.Gtk.Box+BoxChild this.label48 = new global::Gtk.Label (); this.label48.Name = "label48"; this.label48.LabelProp = global::Mono.Unix.Catalog.GetString ("Left"); this.label48.UseUnderline = true; this.hbox18.Add (this.label48); global::Gtk.Box.BoxChild w129 = ((global::Gtk.Box.BoxChild)(this.hbox18 [this.label48])); w129.Position = 1; w129.Expand = false; w129.Fill = false; this.alignment17.Add (this.hbox18); this.UserListPositionRadioButtonLeft.Add (this.alignment17); this.vbox12.Add (this.UserListPositionRadioButtonLeft); global::Gtk.Box.BoxChild w132 = ((global::Gtk.Box.BoxChild)(this.vbox12 [this.UserListPositionRadioButtonLeft])); w132.Position = 0; w132.Expand = false; w132.Fill = false; // Container child vbox12.Gtk.Box+BoxChild this.UserListPositionRadioButtonRight = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("Right")); this.UserListPositionRadioButtonRight.Name = "UserListPositionRadioButtonRight"; this.UserListPositionRadioButtonRight.DrawIndicator = true; this.UserListPositionRadioButtonRight.UseUnderline = true; this.UserListPositionRadioButtonRight.Group = this.UserListPositionRadioButtonLeft.Group; this.UserListPositionRadioButtonRight.Remove (this.UserListPositionRadioButtonRight.Child); // Container child UserListPositionRadioButtonRight.Gtk.Container+ContainerChild this.alignment18 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); this.alignment18.Name = "alignment18"; // Container child alignment18.Gtk.Container+ContainerChild this.hbox19 = new global::Gtk.HBox (); this.hbox19.Name = "hbox19"; this.hbox19.Spacing = 2; // Container child hbox19.Gtk.Box+BoxChild this.image4 = new global::Gtk.Image (); this.image4.Name = "image4"; this.image4.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-last", global::Gtk.IconSize.Menu); this.hbox19.Add (this.image4); global::Gtk.Box.BoxChild w133 = ((global::Gtk.Box.BoxChild)(this.hbox19 [this.image4])); w133.Position = 0; w133.Expand = false; w133.Fill = false; // Container child hbox19.Gtk.Box+BoxChild this.label49 = new global::Gtk.Label (); this.label49.Name = "label49"; this.label49.LabelProp = global::Mono.Unix.Catalog.GetString ("Right"); this.label49.UseUnderline = true; this.hbox19.Add (this.label49); global::Gtk.Box.BoxChild w134 = ((global::Gtk.Box.BoxChild)(this.hbox19 [this.label49])); w134.Position = 1; w134.Expand = false; w134.Fill = false; this.alignment18.Add (this.hbox19); this.UserListPositionRadioButtonRight.Add (this.alignment18); this.vbox12.Add (this.UserListPositionRadioButtonRight); global::Gtk.Box.BoxChild w137 = ((global::Gtk.Box.BoxChild)(this.vbox12 [this.UserListPositionRadioButtonRight])); w137.Position = 1; w137.Expand = false; w137.Fill = false; // Container child vbox12.Gtk.Box+BoxChild this.UserListPositionRadioButtonNone = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("None")); this.UserListPositionRadioButtonNone.Name = "UserListPositionRadioButtonNone"; this.UserListPositionRadioButtonNone.DrawIndicator = true; this.UserListPositionRadioButtonNone.UseUnderline = true; this.UserListPositionRadioButtonNone.Group = this.UserListPositionRadioButtonLeft.Group; this.vbox12.Add (this.UserListPositionRadioButtonNone); global::Gtk.Box.BoxChild w138 = ((global::Gtk.Box.BoxChild)(this.vbox12 [this.UserListPositionRadioButtonNone])); w138.Position = 2; w138.Expand = false; w138.Fill = false; this.alignment13.Add (this.vbox12); this.frame9.Add (this.alignment13); this.label38 = new global::Gtk.Label (); this.label38.Name = "label38"; this.label38.LabelProp = global::Mono.Unix.Catalog.GetString (" User List Position "); this.label38.UseMarkup = true; this.frame9.LabelWidget = this.label38; this.vbox9.Add (this.frame9); global::Gtk.Box.BoxChild w141 = ((global::Gtk.Box.BoxChild)(this.vbox9 [this.frame9])); w141.Position = 2; w141.Expand = false; this.alignment5.Add (this.vbox9); this.frame2.Add (this.alignment5); this.label10 = new global::Gtk.Label (); this.label10.Name = "label10"; this.label10.LabelProp = global::Mono.Unix.Catalog.GetString (" Channel "); this.label10.UseMarkup = true; this.frame2.LabelWidget = this.label10; this.vbox8.Add (this.frame2); global::Gtk.Box.BoxChild w144 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.frame2])); w144.Position = 0; w144.Expand = false; // Container child vbox8.Gtk.Box+BoxChild this.frame11 = new global::Gtk.Frame (); this.frame11.Name = "frame11"; // Container child frame11.Gtk.Container+ContainerChild this.alignment27 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); this.alignment27.Name = "alignment27"; this.alignment27.LeftPadding = ((uint)(12)); // Container child alignment27.Gtk.Container+ContainerChild this.vbox13 = new global::Gtk.VBox (); this.vbox13.Name = "vbox13"; this.vbox13.BorderWidth = ((uint)(5)); // Container child vbox13.Gtk.Box+BoxChild this.vbox14 = new global::Gtk.VBox (); this.vbox14.Name = "vbox14"; // Container child vbox14.Gtk.Box+BoxChild this.label62 = new global::Gtk.Label (); this.label62.Name = "label62"; this.label62.Xalign = 0F; this.label62.LabelProp = global::Mono.Unix.Catalog.GetString ("Highlight words:"); this.vbox14.Add (this.label62); global::Gtk.Box.BoxChild w145 = ((global::Gtk.Box.BoxChild)(this.vbox14 [this.label62])); w145.Position = 0; w145.Expand = false; w145.Fill = false; // Container child vbox14.Gtk.Box+BoxChild this.scrolledwindow4 = new global::Gtk.ScrolledWindow (); this.scrolledwindow4.Name = "scrolledwindow4"; this.scrolledwindow4.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child scrolledwindow4.Gtk.Container+ContainerChild this.HighlightWordsTextView = new global::Gtk.TextView (); this.HighlightWordsTextView.Sensitive = false; this.HighlightWordsTextView.Name = "HighlightWordsTextView"; this.scrolledwindow4.Add (this.HighlightWordsTextView); this.vbox14.Add (this.scrolledwindow4); global::Gtk.Box.BoxChild w147 = ((global::Gtk.Box.BoxChild)(this.vbox14 [this.scrolledwindow4])); w147.Position = 1; this.vbox13.Add (this.vbox14); global::Gtk.Box.BoxChild w148 = ((global::Gtk.Box.BoxChild)(this.vbox13 [this.vbox14])); w148.Position = 0; // Container child vbox13.Gtk.Box+BoxChild this.BeepOnHighlightCheckButton = new global::Gtk.CheckButton (); this.BeepOnHighlightCheckButton.Name = "BeepOnHighlightCheckButton"; this.BeepOnHighlightCheckButton.Label = global::Mono.Unix.Catalog.GetString ("Beep on highlight"); this.BeepOnHighlightCheckButton.DrawIndicator = true; this.BeepOnHighlightCheckButton.UseUnderline = true; this.vbox13.Add (this.BeepOnHighlightCheckButton); global::Gtk.Box.BoxChild w149 = ((global::Gtk.Box.BoxChild)(this.vbox13 [this.BeepOnHighlightCheckButton])); w149.Position = 1; w149.Expand = false; w149.Fill = false; this.alignment27.Add (this.vbox13); this.frame11.Add (this.alignment27); this.label61 = new global::Gtk.Label (); this.label61.Name = "label61"; this.label61.LabelProp = global::Mono.Unix.Catalog.GetString (" Highlighting "); this.label61.UseMarkup = true; this.frame11.LabelWidget = this.label61; this.vbox8.Add (this.frame11); global::Gtk.Box.BoxChild w152 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.frame11])); w152.Position = 1; this.InterfaceNotebook.Add (this.vbox8); global::Gtk.Notebook.NotebookChild w153 = ((global::Gtk.Notebook.NotebookChild)(this.InterfaceNotebook [this.vbox8])); w153.Position = 3; // Notebook tab this.label4 = new global::Gtk.Label (); this.label4.Name = "label4"; this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("Output"); this.InterfaceNotebook.SetTabLabel (this.vbox8, this.label4); this.label4.ShowAll (); this.Notebook.Add (this.InterfaceNotebook); global::Gtk.Notebook.NotebookChild w154 = ((global::Gtk.Notebook.NotebookChild)(this.Notebook [this.InterfaceNotebook])); w154.Position = 1; // Notebook tab this.label45 = new global::Gtk.Label (); this.label45.Name = "label45"; this.label45.LabelProp = global::Mono.Unix.Catalog.GetString ("_Interface"); this.label45.UseUnderline = true; this.Notebook.SetTabLabel (this.InterfaceNotebook, this.label45); this.label45.ShowAll (); // Container child Notebook.Gtk.Notebook+NotebookChild this.hbox27 = new global::Gtk.HBox (); this.hbox27.Name = "hbox27"; this.hbox27.BorderWidth = ((uint)(5)); // Container child hbox27.Gtk.Box+BoxChild this.scrolledwindow3 = new global::Gtk.ScrolledWindow (); this.scrolledwindow3.Name = "scrolledwindow3"; this.scrolledwindow3.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child scrolledwindow3.Gtk.Container+ContainerChild this.ServersTreeView = new global::Gtk.TreeView (); this.ServersTreeView.Name = "ServersTreeView"; this.scrolledwindow3.Add (this.ServersTreeView); this.hbox27.Add (this.scrolledwindow3); global::Gtk.Box.BoxChild w156 = ((global::Gtk.Box.BoxChild)(this.hbox27 [this.scrolledwindow3])); w156.Position = 0; // Container child hbox27.Gtk.Box+BoxChild this.vbuttonbox1 = new global::Gtk.VButtonBox (); this.vbuttonbox1.Name = "vbuttonbox1"; this.vbuttonbox1.BorderWidth = ((uint)(5)); this.vbuttonbox1.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(3)); // Container child vbuttonbox1.Gtk.ButtonBox+ButtonBoxChild this.ServersAddButton = new global::Gtk.Button (); this.ServersAddButton.Name = "ServersAddButton"; this.ServersAddButton.UseStock = true; this.ServersAddButton.UseUnderline = true; this.ServersAddButton.Label = "gtk-add"; this.vbuttonbox1.Add (this.ServersAddButton); global::Gtk.ButtonBox.ButtonBoxChild w157 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox1 [this.ServersAddButton])); w157.Expand = false; w157.Fill = false; // Container child vbuttonbox1.Gtk.ButtonBox+ButtonBoxChild this.ServersEditButton = new global::Gtk.Button (); this.ServersEditButton.Name = "ServersEditButton"; this.ServersEditButton.UseStock = true; this.ServersEditButton.UseUnderline = true; this.ServersEditButton.Label = "gtk-edit"; this.vbuttonbox1.Add (this.ServersEditButton); global::Gtk.ButtonBox.ButtonBoxChild w158 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox1 [this.ServersEditButton])); w158.Position = 1; w158.Expand = false; w158.Fill = false; // Container child vbuttonbox1.Gtk.ButtonBox+ButtonBoxChild this.ServersRemoveButton = new global::Gtk.Button (); this.ServersRemoveButton.Name = "ServersRemoveButton"; this.ServersRemoveButton.UseStock = true; this.ServersRemoveButton.UseUnderline = true; this.ServersRemoveButton.Label = "gtk-remove"; this.vbuttonbox1.Add (this.ServersRemoveButton); global::Gtk.ButtonBox.ButtonBoxChild w159 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox1 [this.ServersRemoveButton])); w159.Position = 2; w159.Expand = false; w159.Fill = false; this.hbox27.Add (this.vbuttonbox1); global::Gtk.Box.BoxChild w160 = ((global::Gtk.Box.BoxChild)(this.hbox27 [this.vbuttonbox1])); w160.Position = 1; w160.Expand = false; this.Notebook.Add (this.hbox27); global::Gtk.Notebook.NotebookChild w161 = ((global::Gtk.Notebook.NotebookChild)(this.Notebook [this.hbox27])); w161.Position = 2; // Notebook tab this.label57 = new global::Gtk.Label (); this.label57.Name = "label57"; this.label57.LabelProp = global::Mono.Unix.Catalog.GetString ("_Servers"); this.label57.UseUnderline = true; this.Notebook.SetTabLabel (this.hbox27, this.label57); this.label57.ShowAll (); // Container child Notebook.Gtk.Notebook+NotebookChild this.vbox15 = new global::Gtk.VBox (); this.vbox15.Name = "vbox15"; this.vbox15.BorderWidth = ((uint)(5)); // Container child vbox15.Gtk.Box+BoxChild this.frame12 = new global::Gtk.Frame (); this.frame12.Name = "frame12"; // Container child frame12.Gtk.Container+ContainerChild this.alignment28 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); this.alignment28.Name = "alignment28"; this.alignment28.LeftPadding = ((uint)(12)); // Container child alignment28.Gtk.Container+ContainerChild this.vbox16 = new global::Gtk.VBox (); this.vbox16.Name = "vbox16"; // Container child vbox16.Gtk.Box+BoxChild this.scrolledwindow5 = new global::Gtk.ScrolledWindow (); this.scrolledwindow5.Name = "scrolledwindow5"; this.scrolledwindow5.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child scrolledwindow5.Gtk.Container+ContainerChild this.ChannelFiltersTreeView = new global::Gtk.TreeView (); this.ChannelFiltersTreeView.Name = "ChannelFiltersTreeView"; this.scrolledwindow5.Add (this.ChannelFiltersTreeView); this.vbox16.Add (this.scrolledwindow5); global::Gtk.Box.BoxChild w163 = ((global::Gtk.Box.BoxChild)(this.vbox16 [this.scrolledwindow5])); w163.Position = 0; // Container child vbox16.Gtk.Box+BoxChild this.hbuttonbox1 = new global::Gtk.HButtonBox (); this.hbuttonbox1.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(1)); // Container child hbuttonbox1.Gtk.ButtonBox+ButtonBoxChild this.ChannelFiltersAddButton = new global::Gtk.Button (); this.ChannelFiltersAddButton.Sensitive = false; this.ChannelFiltersAddButton.Name = "ChannelFiltersAddButton"; this.ChannelFiltersAddButton.UseStock = true; this.ChannelFiltersAddButton.UseUnderline = true; this.ChannelFiltersAddButton.Label = "gtk-add"; this.hbuttonbox1.Add (this.ChannelFiltersAddButton); global::Gtk.ButtonBox.ButtonBoxChild w164 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox1 [this.ChannelFiltersAddButton])); w164.Expand = false; w164.Fill = false; // Container child hbuttonbox1.Gtk.ButtonBox+ButtonBoxChild this.ChannelFiltersRemoveButton = new global::Gtk.Button (); this.ChannelFiltersRemoveButton.Sensitive = false; this.ChannelFiltersRemoveButton.Name = "ChannelFiltersRemoveButton"; this.ChannelFiltersRemoveButton.UseStock = true; this.ChannelFiltersRemoveButton.UseUnderline = true; this.ChannelFiltersRemoveButton.Label = "gtk-remove"; this.hbuttonbox1.Add (this.ChannelFiltersRemoveButton); global::Gtk.ButtonBox.ButtonBoxChild w165 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox1 [this.ChannelFiltersRemoveButton])); w165.Position = 1; w165.Expand = false; w165.Fill = false; this.vbox16.Add (this.hbuttonbox1); global::Gtk.Box.BoxChild w166 = ((global::Gtk.Box.BoxChild)(this.vbox16 [this.hbuttonbox1])); w166.Position = 1; w166.Expand = false; this.alignment28.Add (this.vbox16); this.frame12.Add (this.alignment28); this.label64 = new global::Gtk.Label (); this.label64.Name = "label64"; this.label64.LabelProp = global::Mono.Unix.Catalog.GetString ("Channel Filters"); this.label64.UseMarkup = true; this.frame12.LabelWidget = this.label64; this.vbox15.Add (this.frame12); global::Gtk.Box.BoxChild w169 = ((global::Gtk.Box.BoxChild)(this.vbox15 [this.frame12])); w169.Position = 0; // Container child vbox15.Gtk.Box+BoxChild this.frame13 = new global::Gtk.Frame (); this.frame13.Sensitive = false; this.frame13.Name = "frame13"; // Container child frame13.Gtk.Container+ContainerChild this.alignment29 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); this.alignment29.Name = "alignment29"; this.alignment29.LeftPadding = ((uint)(12)); this.frame13.Add (this.alignment29); this.label65 = new global::Gtk.Label (); this.label65.Name = "label65"; this.label65.LabelProp = global::Mono.Unix.Catalog.GetString ("User Filters"); this.label65.UseMarkup = true; this.frame13.LabelWidget = this.label65; this.vbox15.Add (this.frame13); global::Gtk.Box.BoxChild w171 = ((global::Gtk.Box.BoxChild)(this.vbox15 [this.frame13])); w171.Position = 1; this.Notebook.Add (this.vbox15); global::Gtk.Notebook.NotebookChild w172 = ((global::Gtk.Notebook.NotebookChild)(this.Notebook [this.vbox15])); w172.Position = 3; // Notebook tab this.label63 = new global::Gtk.Label (); this.label63.Name = "label63"; this.label63.LabelProp = global::Mono.Unix.Catalog.GetString ("_Filters"); this.label63.UseUnderline = true; this.Notebook.SetTabLabel (this.vbox15, this.label63); this.label63.ShowAll (); this.hbox1.Add (this.Notebook); global::Gtk.Box.BoxChild w173 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.Notebook])); w173.Position = 1; w1.Add (this.hbox1); global::Gtk.Box.BoxChild w174 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); w174.Position = 0; // Internal child Smuxi.Frontend.Gnome.SteticPreferencesDialog.ActionArea global::Gtk.HButtonBox w175 = this.ActionArea; w175.Name = "dialog-action_area1"; w175.Spacing = 6; w175.BorderWidth = ((uint)(5)); w175.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog-action_area1.Gtk.ButtonBox+ButtonBoxChild this.CancelButton = new global::Gtk.Button (); this.CancelButton.Name = "CancelButton"; this.CancelButton.UseStock = true; this.CancelButton.UseUnderline = true; this.CancelButton.Label = "gtk-cancel"; this.AddActionWidget (this.CancelButton, -6); global::Gtk.ButtonBox.ButtonBoxChild w176 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w175 [this.CancelButton])); w176.Expand = false; w176.Fill = false; // Container child dialog-action_area1.Gtk.ButtonBox+ButtonBoxChild this.ApplyButton = new global::Gtk.Button (); this.ApplyButton.Sensitive = false; this.ApplyButton.Name = "ApplyButton"; this.ApplyButton.UseStock = true; this.ApplyButton.UseUnderline = true; this.ApplyButton.Label = "gtk-apply"; this.AddActionWidget (this.ApplyButton, -10); global::Gtk.ButtonBox.ButtonBoxChild w177 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w175 [this.ApplyButton])); w177.Position = 1; w177.Expand = false; w177.Fill = false; // Container child dialog-action_area1.Gtk.ButtonBox+ButtonBoxChild this.OKButton = new global::Gtk.Button (); this.OKButton.Name = "OKButton"; this.OKButton.UseStock = true; this.OKButton.UseUnderline = true; this.OKButton.Label = "gtk-ok"; this.AddActionWidget (this.OKButton, -5); global::Gtk.ButtonBox.ButtonBoxChild w178 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w175 [this.OKButton])); w178.Position = 2; w178.Expand = false; w178.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } this.DefaultWidth = 526; this.DefaultHeight = 579; this.label44.MnemonicWidget = this.Notebook; this.label45.MnemonicWidget = this.Notebook; this.label57.MnemonicWidget = this.Notebook; this.label63.MnemonicWidget = this.Notebook; this.Show (); this.EncodingComboBox.Changed += new global::System.EventHandler (this._OnChanged); this.ConnectionUsernameEntry.Changed += new global::System.EventHandler (this._OnChanged); this.ConnectionRealnameEntry.Changed += new global::System.EventHandler (this._OnChanged); this.ConnectionNicknamesEntry.Changed += new global::System.EventHandler (this._OnChanged); this.TimestampFormatEntry.Changed += new global::System.EventHandler (this._OnChanged); this.EngineBufferLinesSpinButton.Changed += new global::System.EventHandler (this._OnChanged); this.BufferLinesSpinButton.Changed += new global::System.EventHandler (this._OnChanged); this.TabPositionRadioButtonBottom.Toggled += new global::System.EventHandler (this._OnChanged); this.TabPositionRadioButtonLeft.Toggled += new global::System.EventHandler (this._OnChanged); this.TabPositionRadioButtonRight.Toggled += new global::System.EventHandler (this._OnChanged); this.TabPositionRadioButtonNone.Toggled += new global::System.EventHandler (this._OnChanged); this.NoActivityColorButton.ColorSet += new global::System.EventHandler (this._OnChanged); this.ModeColorButton.ColorSet += new global::System.EventHandler (this._OnChanged); this.ActivityColorButton.ColorSet += new global::System.EventHandler (this._OnChanged); this.CompletionCharacterEntry.Changed += new global::System.EventHandler (this._OnChanged); this.CommandHistorySizeSpinButton.Changed += new global::System.EventHandler (this._OnChanged); this.CommandCharacterEntry.Changed += new global::System.EventHandler (this._OnChanged); this.TopicPositionRadioButtonTop.Toggled += new global::System.EventHandler (this._OnChanged); this.TopicPositionRadioButtonBottom.Toggled += new global::System.EventHandler (this._OnChanged); this.TopicPositionRadioButtonNone.Toggled += new global::System.EventHandler (this._OnChanged); this.UserListPositionRadioButtonLeft.Toggled += new global::System.EventHandler (this._OnChanged); this.UserListPositionRadioButtonRight.Toggled += new global::System.EventHandler (this._OnChanged); this.UserListPositionRadioButtonNone.Toggled += new global::System.EventHandler (this._OnChanged); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs0000644000175000017500000000655412250426634026514 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class JoinWidget { private global::Gtk.UIManager UIManager; private global::Gtk.HBox hbox1; private global::Gtk.Entry f_ChatEntry; private global::Gtk.Label label1; private global::Gtk.ComboBox f_NetworkComboBox; private global::Gtk.Button f_JoinButton; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.JoinWidget Stetic.BinContainer w1 = global::Stetic.BinContainer.Attach (this); this.UIManager = new global::Gtk.UIManager (); global::Gtk.ActionGroup w2 = new global::Gtk.ActionGroup ("Default"); this.UIManager.InsertActionGroup (w2, 0); this.Name = "Smuxi.Frontend.Gnome.JoinWidget"; // Container child Smuxi.Frontend.Gnome.JoinWidget.Gtk.Container+ContainerChild this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild this.f_ChatEntry = new global::Gtk.Entry (); this.f_ChatEntry.CanFocus = true; this.f_ChatEntry.Name = "f_ChatEntry"; this.f_ChatEntry.IsEditable = true; this.f_ChatEntry.InvisibleChar = '•'; this.hbox1.Add (this.f_ChatEntry); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.f_ChatEntry])); w3.Position = 0; // Container child hbox1.Gtk.Box+BoxChild this.label1 = new global::Gtk.Label (); this.label1.Name = "label1"; this.label1.LabelProp = "@"; this.hbox1.Add (this.label1); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1])); w4.Position = 1; w4.Expand = false; w4.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.f_NetworkComboBox = global::Gtk.ComboBox.NewText (); this.f_NetworkComboBox.Name = "f_NetworkComboBox"; this.hbox1.Add (this.f_NetworkComboBox); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.f_NetworkComboBox])); w5.Position = 2; w5.Expand = false; w5.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.f_JoinButton = new global::Gtk.Button (); this.f_JoinButton.CanFocus = true; this.f_JoinButton.Name = "f_JoinButton"; this.f_JoinButton.UseUnderline = true; // Container child f_JoinButton.Gtk.Container+ContainerChild global::Gtk.Alignment w6 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); // Container child GtkAlignment.Gtk.Container+ContainerChild global::Gtk.HBox w7 = new global::Gtk.HBox (); w7.Spacing = 2; // Container child GtkHBox.Gtk.Container+ContainerChild global::Gtk.Image w8 = new global::Gtk.Image (); w8.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", global::Gtk.IconSize.Menu); w7.Add (w8); // Container child GtkHBox.Gtk.Container+ContainerChild global::Gtk.Label w10 = new global::Gtk.Label (); w10.LabelProp = global::Mono.Unix.Catalog.GetString ("Join"); w10.UseUnderline = true; w7.Add (w10); w6.Add (w7); this.f_JoinButton.Add (w6); this.hbox1.Add (this.f_JoinButton); global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.f_JoinButton])); w14.Position = 3; w14.Expand = false; w14.Fill = false; this.Add (this.hbox1); if ((this.Child != null)) { this.Child.ShowAll (); } w1.SetUiManager (UIManager); this.Show (); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs0000644000175000017500000002370412132611315032717 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class EngineAssistantConnectionWidget { private global::Gtk.VBox vbox2; private global::Gtk.VBox vbox4; private global::Gtk.CheckButton f_UseSshTunnelCheckButton; private global::Gtk.Label label6; private global::Gtk.Table table1; private global::Gtk.Entry f_HostEntry; private global::Gtk.SpinButton f_PortSpinButton; private global::Gtk.Entry f_SshHostEntry; private global::Gtk.SpinButton f_SshPortSpinButton; private global::Gtk.Label label1; private global::Gtk.Label label10; private global::Gtk.Label label11; private global::Gtk.Label label5; private global::Gtk.Label label7; private global::Gtk.Label label9; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget global::Stetic.BinContainer.Attach (this); this.Name = "Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget"; // Container child Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.Gtk.Container+ContainerChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 10; this.vbox2.BorderWidth = ((uint)(5)); // Container child vbox2.Gtk.Box+BoxChild this.vbox4 = new global::Gtk.VBox (); this.vbox4.Name = "vbox4"; this.vbox4.Spacing = 6; // Container child vbox4.Gtk.Box+BoxChild this.f_UseSshTunnelCheckButton = new global::Gtk.CheckButton (); this.f_UseSshTunnelCheckButton.CanFocus = true; this.f_UseSshTunnelCheckButton.Name = "f_UseSshTunnelCheckButton"; this.f_UseSshTunnelCheckButton.Label = global::Mono.Unix.Catalog.GetString ("Use _SSH Tunnel"); this.f_UseSshTunnelCheckButton.Active = true; this.f_UseSshTunnelCheckButton.DrawIndicator = true; this.f_UseSshTunnelCheckButton.UseUnderline = true; this.vbox4.Add (this.f_UseSshTunnelCheckButton); global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.f_UseSshTunnelCheckButton])); w1.Position = 0; w1.Expand = false; w1.Fill = false; // Container child vbox4.Gtk.Box+BoxChild this.label6 = new global::Gtk.Label (); this.label6.Name = "label6"; this.label6.Xpad = 50; this.label6.Xalign = 0F; this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("Enables the use of SSH for the connection. This has a small performance impact, but is more secure and required when using NAT or port-based firewalls"); this.label6.UseMarkup = true; this.label6.Wrap = true; this.vbox4.Add (this.label6); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.label6])); w2.Position = 1; w2.Expand = false; w2.Fill = false; this.vbox2.Add (this.vbox4); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.vbox4])); w3.Position = 0; w3.Expand = false; w3.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.table1 = new global::Gtk.Table (((uint)(4)), ((uint)(4)), false); this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(5)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild this.f_HostEntry = new global::Gtk.Entry (); this.f_HostEntry.Sensitive = false; this.f_HostEntry.CanFocus = true; this.f_HostEntry.Name = "f_HostEntry"; this.f_HostEntry.Text = "localhost"; this.f_HostEntry.IsEditable = true; this.f_HostEntry.InvisibleChar = '●'; this.table1.Add (this.f_HostEntry); global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.f_HostEntry])); w4.TopAttach = ((uint)(2)); w4.BottomAttach = ((uint)(3)); w4.LeftAttach = ((uint)(1)); w4.RightAttach = ((uint)(2)); w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.f_PortSpinButton = new global::Gtk.SpinButton (1, 65535, 1); this.f_PortSpinButton.CanFocus = true; this.f_PortSpinButton.Name = "f_PortSpinButton"; this.f_PortSpinButton.Adjustment.PageIncrement = 1; this.f_PortSpinButton.ClimbRate = 1; this.f_PortSpinButton.Numeric = true; this.f_PortSpinButton.Value = 7689; this.table1.Add (this.f_PortSpinButton); global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.f_PortSpinButton])); w5.TopAttach = ((uint)(2)); w5.BottomAttach = ((uint)(3)); w5.LeftAttach = ((uint)(3)); w5.RightAttach = ((uint)(4)); w5.XOptions = ((global::Gtk.AttachOptions)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.f_SshHostEntry = new global::Gtk.Entry (); this.f_SshHostEntry.CanFocus = true; this.f_SshHostEntry.Name = "f_SshHostEntry"; this.f_SshHostEntry.IsEditable = true; this.f_SshHostEntry.InvisibleChar = '●'; this.table1.Add (this.f_SshHostEntry); global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.f_SshHostEntry])); w6.LeftAttach = ((uint)(1)); w6.RightAttach = ((uint)(2)); w6.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.f_SshPortSpinButton = new global::Gtk.SpinButton (1, 65535, 1); this.f_SshPortSpinButton.CanFocus = true; this.f_SshPortSpinButton.Name = "f_SshPortSpinButton"; this.f_SshPortSpinButton.Adjustment.PageIncrement = 1; this.f_SshPortSpinButton.ClimbRate = 1; this.f_SshPortSpinButton.Numeric = true; this.f_SshPortSpinButton.Value = 22; this.table1.Add (this.f_SshPortSpinButton); global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.f_SshPortSpinButton])); w7.LeftAttach = ((uint)(3)); w7.RightAttach = ((uint)(4)); w7.XOptions = ((global::Gtk.AttachOptions)(4)); w7.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label1 = new global::Gtk.Label (); this.label1.Name = "label1"; this.label1.Xalign = 0F; this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("SSH _Host:"); this.label1.UseUnderline = true; this.table1.Add (this.label1); global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1 [this.label1])); w8.XOptions = ((global::Gtk.AttachOptions)(4)); w8.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label10 = new global::Gtk.Label (); this.label10.Name = "label10"; this.label10.Xpad = 50; this.label10.Xalign = 0F; this.label10.LabelProp = global::Mono.Unix.Catalog.GetString ("DNS or IP address and port of the SSH server"); this.label10.UseMarkup = true; this.table1.Add (this.label10); global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1 [this.label10])); w9.TopAttach = ((uint)(1)); w9.BottomAttach = ((uint)(2)); w9.RightAttach = ((uint)(4)); w9.XOptions = ((global::Gtk.AttachOptions)(4)); w9.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label11 = new global::Gtk.Label (); this.label11.Name = "label11"; this.label11.Xalign = 0F; this.label11.LabelProp = global::Mono.Unix.Catalog.GetString ("_Port:"); this.label11.UseUnderline = true; this.table1.Add (this.label11); global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1 [this.label11])); w10.TopAttach = ((uint)(2)); w10.BottomAttach = ((uint)(3)); w10.LeftAttach = ((uint)(2)); w10.RightAttach = ((uint)(3)); w10.XOptions = ((global::Gtk.AttachOptions)(4)); w10.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label5 = new global::Gtk.Label (); this.label5.Name = "label5"; this.label5.Xalign = 0F; this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("_Port:"); this.label5.UseUnderline = true; this.table1.Add (this.label5); global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1 [this.label5])); w11.LeftAttach = ((uint)(2)); w11.RightAttach = ((uint)(3)); w11.XOptions = ((global::Gtk.AttachOptions)(4)); w11.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label7 = new global::Gtk.Label (); this.label7.Name = "label7"; this.label7.Xpad = 50; this.label7.Xalign = 0F; this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("DNS or IP address and port of the Smuxi server"); this.label7.UseMarkup = true; this.table1.Add (this.label7); global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1 [this.label7])); w12.TopAttach = ((uint)(3)); w12.BottomAttach = ((uint)(4)); w12.RightAttach = ((uint)(4)); w12.XOptions = ((global::Gtk.AttachOptions)(4)); w12.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label9 = new global::Gtk.Label (); this.label9.Name = "label9"; this.label9.Xalign = 0F; this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("_Smuxi Host:"); this.label9.UseUnderline = true; this.table1.Add (this.label9); global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1 [this.label9])); w13.TopAttach = ((uint)(2)); w13.BottomAttach = ((uint)(3)); w13.XOptions = ((global::Gtk.AttachOptions)(4)); w13.YOptions = ((global::Gtk.AttachOptions)(4)); this.vbox2.Add (this.table1); global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.table1])); w14.Position = 1; w14.Expand = false; w14.Fill = false; this.Add (this.vbox2); if ((this.Child != null)) { this.Child.ShowAll (); } this.label1.MnemonicWidget = this.f_SshHostEntry; this.label11.MnemonicWidget = this.f_PortSpinButton; this.label5.MnemonicWidget = this.f_SshPortSpinButton; this.label9.MnemonicWidget = this.f_HostEntry; this.Hide (); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs0000644000175000017500000000736112250426634030154 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class QuickConnectDialog { private global::Gtk.HBox hbox1; private global::Gtk.ScrolledWindow f_ScrolledWindow; private global::Gtk.TreeView f_TreeView; private global::Smuxi.Frontend.Gnome.ServerWidget f_Widget; private global::Gtk.Button f_CancelButton; private global::Gtk.Button f_ConnectButton; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.QuickConnectDialog this.Name = "Smuxi.Frontend.Gnome.QuickConnectDialog"; this.Title = global::Mono.Unix.Catalog.GetString ("Smuxi - Connect"); this.TypeHint = ((global::Gdk.WindowTypeHint)(1)); this.BorderWidth = ((uint)(5)); this.DefaultWidth = 640; this.DefaultHeight = 480; // Internal child Smuxi.Frontend.Gnome.QuickConnectDialog.VBox global::Gtk.VBox w1 = this.VBox; w1.Name = "dialog-vbox2"; w1.Spacing = 5; w1.BorderWidth = ((uint)(2)); // Container child dialog-vbox2.Gtk.Box+BoxChild this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild this.f_ScrolledWindow = new global::Gtk.ScrolledWindow (); this.f_ScrolledWindow.Name = "f_ScrolledWindow"; this.f_ScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child f_ScrolledWindow.Gtk.Container+ContainerChild this.f_TreeView = new global::Gtk.TreeView (); this.f_TreeView.CanFocus = true; this.f_TreeView.Name = "f_TreeView"; this.f_ScrolledWindow.Add (this.f_TreeView); this.hbox1.Add (this.f_ScrolledWindow); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.f_ScrolledWindow])); w3.Position = 0; // Container child hbox1.Gtk.Box+BoxChild this.f_Widget = new global::Smuxi.Frontend.Gnome.ServerWidget (); this.f_Widget.Events = ((global::Gdk.EventMask)(256)); this.f_Widget.Name = "f_Widget"; this.hbox1.Add (this.f_Widget); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.f_Widget])); w4.Position = 1; w4.Expand = false; w4.Fill = false; w1.Add (this.hbox1); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); w5.Position = 0; // Internal child Smuxi.Frontend.Gnome.QuickConnectDialog.ActionArea global::Gtk.HButtonBox w6 = this.ActionArea; w6.Name = "dialog-action_area2"; w6.Spacing = 6; w6.BorderWidth = ((uint)(5)); w6.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog-action_area2.Gtk.ButtonBox+ButtonBoxChild this.f_CancelButton = new global::Gtk.Button (); this.f_CancelButton.Name = "f_CancelButton"; this.f_CancelButton.UseStock = true; this.f_CancelButton.UseUnderline = true; this.f_CancelButton.Label = "gtk-cancel"; this.AddActionWidget (this.f_CancelButton, -6); global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w6 [this.f_CancelButton])); w7.Expand = false; w7.Fill = false; // Container child dialog-action_area2.Gtk.ButtonBox+ButtonBoxChild this.f_ConnectButton = new global::Gtk.Button (); this.f_ConnectButton.Name = "f_ConnectButton"; this.f_ConnectButton.UseStock = true; this.f_ConnectButton.UseUnderline = true; this.f_ConnectButton.Label = "gtk-connect"; this.AddActionWidget (this.f_ConnectButton, -5); global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w6 [this.f_ConnectButton])); w8.Position = 1; w8.Expand = false; w8.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } this.Show (); this.f_ConnectButton.Clicked += new global::System.EventHandler (this.OnConnectButtonClicked); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs0000644000175000017500000001224112132611315031472 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class EngineAssistantNameWidget { private global::Gtk.VBox vbox2; private global::Gtk.VBox vbox3; private global::Gtk.Label f_EngineNameLabel; private global::Gtk.Entry f_EngineNameEntry; private global::Gtk.Label label2; private global::Gtk.VBox vbox4; private global::Gtk.Label label7; private global::Gtk.CheckButton f_MakeDefaultEngineCheckButton; private global::Gtk.Label label8; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.EngineAssistantNameWidget global::Stetic.BinContainer.Attach (this); this.Name = "Smuxi.Frontend.Gnome.EngineAssistantNameWidget"; // Container child Smuxi.Frontend.Gnome.EngineAssistantNameWidget.Gtk.Container+ContainerChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 10; this.vbox2.BorderWidth = ((uint)(5)); // Container child vbox2.Gtk.Box+BoxChild this.vbox3 = new global::Gtk.VBox (); this.vbox3.Name = "vbox3"; this.vbox3.Spacing = 6; // Container child vbox3.Gtk.Box+BoxChild this.f_EngineNameLabel = new global::Gtk.Label (); this.f_EngineNameLabel.Name = "f_EngineNameLabel"; this.f_EngineNameLabel.Xalign = 0F; this.f_EngineNameLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("_Engine Name:"); this.f_EngineNameLabel.UseUnderline = true; this.vbox3.Add (this.f_EngineNameLabel); global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.f_EngineNameLabel])); w1.Position = 0; w1.Expand = false; w1.Fill = false; // Container child vbox3.Gtk.Box+BoxChild this.f_EngineNameEntry = new global::Gtk.Entry (); this.f_EngineNameEntry.CanFocus = true; this.f_EngineNameEntry.Name = "f_EngineNameEntry"; this.f_EngineNameEntry.IsEditable = true; this.f_EngineNameEntry.InvisibleChar = '●'; this.vbox3.Add (this.f_EngineNameEntry); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.f_EngineNameEntry])); w2.Position = 1; w2.Expand = false; w2.Fill = false; // Container child vbox3.Gtk.Box+BoxChild this.label2 = new global::Gtk.Label (); this.label2.Name = "label2"; this.label2.Xpad = 50; this.label2.Xalign = 0F; this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Profile name of the new engine"); this.label2.UseMarkup = true; this.vbox3.Add (this.label2); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.label2])); w3.Position = 2; w3.Expand = false; w3.Fill = false; this.vbox2.Add (this.vbox3); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.vbox3])); w4.Position = 0; w4.Expand = false; w4.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.vbox4 = new global::Gtk.VBox (); this.vbox4.Name = "vbox4"; this.vbox4.Spacing = 6; this.vbox4.BorderWidth = ((uint)(5)); // Container child vbox4.Gtk.Box+BoxChild this.label7 = new global::Gtk.Label (); this.label7.Name = "label7"; this.label7.Xalign = 0F; this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("_Default Engine:"); this.label7.UseUnderline = true; this.vbox4.Add (this.label7); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.label7])); w5.Position = 0; w5.Expand = false; w5.Fill = false; // Container child vbox4.Gtk.Box+BoxChild this.f_MakeDefaultEngineCheckButton = new global::Gtk.CheckButton (); this.f_MakeDefaultEngineCheckButton.CanFocus = true; this.f_MakeDefaultEngineCheckButton.Name = "f_MakeDefaultEngineCheckButton"; this.f_MakeDefaultEngineCheckButton.Label = global::Mono.Unix.Catalog.GetString ("Use as new default engine"); this.f_MakeDefaultEngineCheckButton.DrawIndicator = true; this.f_MakeDefaultEngineCheckButton.UseUnderline = true; this.vbox4.Add (this.f_MakeDefaultEngineCheckButton); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.f_MakeDefaultEngineCheckButton])); w6.Position = 1; w6.Expand = false; w6.Fill = false; // Container child vbox4.Gtk.Box+BoxChild this.label8 = new global::Gtk.Label (); this.label8.Name = "label8"; this.label8.Xpad = 50; this.label8.Xalign = 0F; this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("If enabled, the current engine will be the default next time Smuxi is started"); this.label8.UseMarkup = true; this.label8.Wrap = true; this.vbox4.Add (this.label8); global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.label8])); w7.Position = 2; w7.Expand = false; w7.Fill = false; this.vbox2.Add (this.vbox4); global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.vbox4])); w8.Position = 1; w8.Expand = false; w8.Fill = false; this.Add (this.vbox2); if ((this.Child != null)) { this.Child.ShowAll (); } this.f_EngineNameLabel.MnemonicWidget = this.f_EngineNameEntry; this.label7.MnemonicWidget = this.f_MakeDefaultEngineCheckButton; this.Hide (); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs0000644000175000017500000003265312132611315033060 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class EngineAssistantCredentialsWidget { private global::Gtk.VBox vbox12; private global::Gtk.VBox vbox13; private global::Gtk.Label label6; private global::Gtk.Entry f_SshUsernameEntry; private global::Gtk.Label label9; private global::Gtk.VBox f_SshPasswordVBox; private global::Gtk.Label label14; private global::Gtk.Entry f_SshPasswordEntry; private global::Gtk.Label label15; private global::Gtk.VBox vbox17; private global::Gtk.Label label16; private global::Gtk.FileChooserButton f_SshKeyfileChooserButton; private global::Gtk.Label label17; private global::Gtk.VBox vbox16; private global::Gtk.Label label12; private global::Gtk.Entry f_UsernameEntry; private global::Gtk.Label label13; private global::Gtk.VBox vbox14; private global::Gtk.Label label7; private global::Gtk.Entry f_PasswordEntry; private global::Gtk.Label label10; private global::Gtk.VBox vbox15; private global::Gtk.Label label8; private global::Gtk.Entry f_VerifyPasswordEntry; private global::Gtk.Label label11; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget global::Stetic.BinContainer.Attach (this); this.Name = "Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget"; // Container child Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.Gtk.Container+ContainerChild this.vbox12 = new global::Gtk.VBox (); this.vbox12.Name = "vbox12"; this.vbox12.Spacing = 10; this.vbox12.BorderWidth = ((uint)(5)); // Container child vbox12.Gtk.Box+BoxChild this.vbox13 = new global::Gtk.VBox (); this.vbox13.Name = "vbox13"; this.vbox13.Spacing = 6; // Container child vbox13.Gtk.Box+BoxChild this.label6 = new global::Gtk.Label (); this.label6.Name = "label6"; this.label6.Xalign = 0F; this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("_SSH Username: (optional)"); this.label6.UseUnderline = true; this.vbox13.Add (this.label6); global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox13 [this.label6])); w1.Position = 0; w1.Expand = false; w1.Fill = false; // Container child vbox13.Gtk.Box+BoxChild this.f_SshUsernameEntry = new global::Gtk.Entry (); this.f_SshUsernameEntry.CanFocus = true; this.f_SshUsernameEntry.Name = "f_SshUsernameEntry"; this.f_SshUsernameEntry.IsEditable = true; this.f_SshUsernameEntry.InvisibleChar = '●'; this.vbox13.Add (this.f_SshUsernameEntry); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox13 [this.f_SshUsernameEntry])); w2.Position = 1; w2.Expand = false; w2.Fill = false; // Container child vbox13.Gtk.Box+BoxChild this.label9 = new global::Gtk.Label (); this.label9.Name = "label9"; this.label9.Xpad = 50; this.label9.Xalign = 0F; this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("Username which will be used to log into the SSH server"); this.label9.UseMarkup = true; this.vbox13.Add (this.label9); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox13 [this.label9])); w3.Position = 2; w3.Expand = false; w3.Fill = false; this.vbox12.Add (this.vbox13); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox12 [this.vbox13])); w4.Position = 0; w4.Expand = false; w4.Fill = false; // Container child vbox12.Gtk.Box+BoxChild this.f_SshPasswordVBox = new global::Gtk.VBox (); this.f_SshPasswordVBox.Name = "f_SshPasswordVBox"; this.f_SshPasswordVBox.Spacing = 6; // Container child f_SshPasswordVBox.Gtk.Box+BoxChild this.label14 = new global::Gtk.Label (); this.label14.Name = "label14"; this.label14.Xalign = 0F; this.label14.LabelProp = global::Mono.Unix.Catalog.GetString ("_SSH Password: (optional)"); this.label14.UseUnderline = true; this.f_SshPasswordVBox.Add (this.label14); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.f_SshPasswordVBox [this.label14])); w5.Position = 0; w5.Expand = false; w5.Fill = false; // Container child f_SshPasswordVBox.Gtk.Box+BoxChild this.f_SshPasswordEntry = new global::Gtk.Entry (); this.f_SshPasswordEntry.CanFocus = true; this.f_SshPasswordEntry.Name = "f_SshPasswordEntry"; this.f_SshPasswordEntry.IsEditable = true; this.f_SshPasswordEntry.Visibility = false; this.f_SshPasswordEntry.InvisibleChar = '●'; this.f_SshPasswordVBox.Add (this.f_SshPasswordEntry); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.f_SshPasswordVBox [this.f_SshPasswordEntry])); w6.Position = 1; w6.Expand = false; w6.Fill = false; // Container child f_SshPasswordVBox.Gtk.Box+BoxChild this.label15 = new global::Gtk.Label (); this.label15.Name = "label15"; this.label15.Xpad = 50; this.label15.Xalign = 0F; this.label15.LabelProp = global::Mono.Unix.Catalog.GetString ("Password which will be used to log into the SSH server. The password is optional if SSH key authorization is used (see below)."); this.label15.UseMarkup = true; this.label15.Wrap = true; this.f_SshPasswordVBox.Add (this.label15); global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.f_SshPasswordVBox [this.label15])); w7.Position = 2; w7.Expand = false; w7.Fill = false; this.vbox12.Add (this.f_SshPasswordVBox); global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox12 [this.f_SshPasswordVBox])); w8.Position = 1; w8.Expand = false; w8.Fill = false; // Container child vbox12.Gtk.Box+BoxChild this.vbox17 = new global::Gtk.VBox (); this.vbox17.Name = "vbox17"; this.vbox17.Spacing = 6; // Container child vbox17.Gtk.Box+BoxChild this.label16 = new global::Gtk.Label (); this.label16.Name = "label16"; this.label16.Xalign = 0F; this.label16.LabelProp = global::Mono.Unix.Catalog.GetString ("_SSH Keyfile: (optional)"); this.label16.UseUnderline = true; this.vbox17.Add (this.label16); global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox17 [this.label16])); w9.Position = 0; w9.Expand = false; w9.Fill = false; // Container child vbox17.Gtk.Box+BoxChild this.f_SshKeyfileChooserButton = new global::Gtk.FileChooserButton (global::Mono.Unix.Catalog.GetString ("Select a File"), ((global::Gtk.FileChooserAction)(0))); this.f_SshKeyfileChooserButton.Name = "f_SshKeyfileChooserButton"; this.f_SshKeyfileChooserButton.ShowHidden = true; this.vbox17.Add (this.f_SshKeyfileChooserButton); global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox17 [this.f_SshKeyfileChooserButton])); w10.Position = 1; w10.Expand = false; w10.Fill = false; // Container child vbox17.Gtk.Box+BoxChild this.label17 = new global::Gtk.Label (); this.label17.Name = "label17"; this.label17.Xpad = 50; this.label17.Xalign = 0F; this.label17.LabelProp = global::Mono.Unix.Catalog.GetString ("SSH private keyfile which will be used to log into the SSH server"); this.label17.UseMarkup = true; this.vbox17.Add (this.label17); global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox17 [this.label17])); w11.Position = 2; w11.Expand = false; w11.Fill = false; this.vbox12.Add (this.vbox17); global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox12 [this.vbox17])); w12.Position = 2; w12.Expand = false; w12.Fill = false; // Container child vbox12.Gtk.Box+BoxChild this.vbox16 = new global::Gtk.VBox (); this.vbox16.Name = "vbox16"; this.vbox16.Spacing = 6; // Container child vbox16.Gtk.Box+BoxChild this.label12 = new global::Gtk.Label (); this.label12.Name = "label12"; this.label12.Xalign = 0F; this.label12.LabelProp = global::Mono.Unix.Catalog.GetString ("_Username:"); this.label12.UseUnderline = true; this.vbox16.Add (this.label12); global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox16 [this.label12])); w13.Position = 0; w13.Expand = false; w13.Fill = false; // Container child vbox16.Gtk.Box+BoxChild this.f_UsernameEntry = new global::Gtk.Entry (); this.f_UsernameEntry.CanFocus = true; this.f_UsernameEntry.Name = "f_UsernameEntry"; this.f_UsernameEntry.IsEditable = true; this.f_UsernameEntry.InvisibleChar = '●'; this.vbox16.Add (this.f_UsernameEntry); global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox16 [this.f_UsernameEntry])); w14.Position = 1; w14.Expand = false; w14.Fill = false; // Container child vbox16.Gtk.Box+BoxChild this.label13 = new global::Gtk.Label (); this.label13.Name = "label13"; this.label13.Xpad = 50; this.label13.Xalign = 0F; this.label13.LabelProp = global::Mono.Unix.Catalog.GetString ("Username which will be used to log into the Smuxi server"); this.label13.UseMarkup = true; this.vbox16.Add (this.label13); global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox16 [this.label13])); w15.Position = 2; w15.Expand = false; w15.Fill = false; this.vbox12.Add (this.vbox16); global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox12 [this.vbox16])); w16.Position = 3; w16.Expand = false; w16.Fill = false; // Container child vbox12.Gtk.Box+BoxChild this.vbox14 = new global::Gtk.VBox (); this.vbox14.Name = "vbox14"; this.vbox14.Spacing = 6; // Container child vbox14.Gtk.Box+BoxChild this.label7 = new global::Gtk.Label (); this.label7.Name = "label7"; this.label7.Xalign = 0F; this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("_Password:"); this.label7.UseUnderline = true; this.vbox14.Add (this.label7); global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox14 [this.label7])); w17.Position = 0; w17.Expand = false; w17.Fill = false; // Container child vbox14.Gtk.Box+BoxChild this.f_PasswordEntry = new global::Gtk.Entry (); this.f_PasswordEntry.CanFocus = true; this.f_PasswordEntry.Name = "f_PasswordEntry"; this.f_PasswordEntry.IsEditable = true; this.f_PasswordEntry.Visibility = false; this.f_PasswordEntry.InvisibleChar = '●'; this.vbox14.Add (this.f_PasswordEntry); global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox14 [this.f_PasswordEntry])); w18.Position = 1; w18.Expand = false; w18.Fill = false; // Container child vbox14.Gtk.Box+BoxChild this.label10 = new global::Gtk.Label (); this.label10.Name = "label10"; this.label10.Xpad = 50; this.label10.Xalign = 0F; this.label10.LabelProp = global::Mono.Unix.Catalog.GetString ("Password of the user"); this.label10.UseMarkup = true; this.vbox14.Add (this.label10); global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox14 [this.label10])); w19.Position = 2; w19.Expand = false; w19.Fill = false; this.vbox12.Add (this.vbox14); global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox12 [this.vbox14])); w20.Position = 4; w20.Expand = false; w20.Fill = false; // Container child vbox12.Gtk.Box+BoxChild this.vbox15 = new global::Gtk.VBox (); this.vbox15.Name = "vbox15"; this.vbox15.Spacing = 6; // Container child vbox15.Gtk.Box+BoxChild this.label8 = new global::Gtk.Label (); this.label8.Name = "label8"; this.label8.Xalign = 0F; this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("_Verify Password:"); this.label8.UseUnderline = true; this.vbox15.Add (this.label8); global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox15 [this.label8])); w21.Position = 0; w21.Expand = false; w21.Fill = false; // Container child vbox15.Gtk.Box+BoxChild this.f_VerifyPasswordEntry = new global::Gtk.Entry (); this.f_VerifyPasswordEntry.CanFocus = true; this.f_VerifyPasswordEntry.Name = "f_VerifyPasswordEntry"; this.f_VerifyPasswordEntry.IsEditable = true; this.f_VerifyPasswordEntry.Visibility = false; this.f_VerifyPasswordEntry.InvisibleChar = '●'; this.vbox15.Add (this.f_VerifyPasswordEntry); global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox15 [this.f_VerifyPasswordEntry])); w22.Position = 1; w22.Expand = false; w22.Fill = false; // Container child vbox15.Gtk.Box+BoxChild this.label11 = new global::Gtk.Label (); this.label11.Name = "label11"; this.label11.Xpad = 50; this.label11.Xalign = 0F; this.label11.LabelProp = global::Mono.Unix.Catalog.GetString ("Repeat the password for verification"); this.label11.UseMarkup = true; this.vbox15.Add (this.label11); global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox15 [this.label11])); w23.Position = 2; w23.Expand = false; w23.Fill = false; this.vbox12.Add (this.vbox15); global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox12 [this.vbox15])); w24.Position = 5; w24.Expand = false; w24.Fill = false; this.Add (this.vbox12); if ((this.Child != null)) { this.Child.ShowAll (); } this.label6.MnemonicWidget = this.f_SshUsernameEntry; this.label14.MnemonicWidget = this.f_SshUsernameEntry; this.label16.MnemonicWidget = this.f_SshKeyfileChooserButton; this.label12.MnemonicWidget = this.f_UsernameEntry; this.label7.MnemonicWidget = this.f_PasswordEntry; this.label8.MnemonicWidget = this.f_VerifyPasswordEntry; this.Hide (); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs0000644000175000017500000001332312132611315030245 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class FindGroupChatDialog { private global::Gtk.VBox vbox2; private global::Gtk.HBox hbox1; private global::Gtk.HBox hbox2; private global::Gtk.Label label1; private global::Gtk.Entry f_NameEntry; private global::Gtk.Button f_FindButton; private global::Gtk.ScrolledWindow GtkScrolledWindow; private global::Gtk.TreeView f_TreeView; private global::Gtk.Button f_CancelButton; private global::Gtk.Button f_OKButton; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.FindGroupChatDialog this.Name = "Smuxi.Frontend.Gnome.FindGroupChatDialog"; this.Title = global::Mono.Unix.Catalog.GetString ("Smuxi - Find Group Chat"); this.Icon = global::Stetic.IconLoader.LoadIcon (this, "gtk-find", global::Gtk.IconSize.Menu); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.DefaultWidth = 640; this.DefaultHeight = 480; // Internal child Smuxi.Frontend.Gnome.FindGroupChatDialog.VBox global::Gtk.VBox w1 = this.VBox; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 6; // Container child vbox2.Gtk.Box+BoxChild this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild this.hbox2 = new global::Gtk.HBox (); this.hbox2.Name = "hbox2"; this.hbox2.Spacing = 6; // Container child hbox2.Gtk.Box+BoxChild this.label1 = new global::Gtk.Label (); this.label1.Name = "label1"; this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Name:"); this.label1.UseUnderline = true; this.hbox2.Add (this.label1); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label1])); w2.Position = 0; w2.Expand = false; w2.Fill = false; // Container child hbox2.Gtk.Box+BoxChild this.f_NameEntry = new global::Gtk.Entry (); this.f_NameEntry.CanDefault = true; this.f_NameEntry.CanFocus = true; this.f_NameEntry.Name = "f_NameEntry"; this.f_NameEntry.IsEditable = true; this.f_NameEntry.InvisibleChar = '●'; this.hbox2.Add (this.f_NameEntry); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.f_NameEntry])); w3.Position = 1; this.hbox1.Add (this.hbox2); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.hbox2])); w4.Position = 0; // Container child hbox1.Gtk.Box+BoxChild this.f_FindButton = new global::Gtk.Button (); this.f_FindButton.CanFocus = true; this.f_FindButton.Name = "f_FindButton"; this.f_FindButton.UseStock = true; this.f_FindButton.UseUnderline = true; this.f_FindButton.Label = "gtk-find"; this.hbox1.Add (this.f_FindButton); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.f_FindButton])); w5.Position = 1; w5.Expand = false; w5.Fill = false; this.vbox2.Add (this.hbox1); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); w6.Position = 0; w6.Expand = false; w6.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); this.GtkScrolledWindow.Name = "GtkScrolledWindow"; this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow.Gtk.Container+ContainerChild this.f_TreeView = new global::Gtk.TreeView (); this.f_TreeView.CanFocus = true; this.f_TreeView.Name = "f_TreeView"; this.GtkScrolledWindow.Add (this.f_TreeView); this.vbox2.Add (this.GtkScrolledWindow); global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow])); w8.Position = 1; w1.Add (this.vbox2); global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w9.Position = 0; // Internal child Smuxi.Frontend.Gnome.FindGroupChatDialog.ActionArea global::Gtk.HButtonBox w10 = this.ActionArea; w10.Name = "dialog1_ActionArea"; w10.Spacing = 6; w10.BorderWidth = ((uint)(5)); w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.f_CancelButton = new global::Gtk.Button (); this.f_CancelButton.CanDefault = true; this.f_CancelButton.CanFocus = true; this.f_CancelButton.Name = "f_CancelButton"; this.f_CancelButton.UseStock = true; this.f_CancelButton.UseUnderline = true; this.f_CancelButton.Label = "gtk-cancel"; this.AddActionWidget (this.f_CancelButton, -6); global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.f_CancelButton])); w11.Expand = false; w11.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.f_OKButton = new global::Gtk.Button (); this.f_OKButton.CanDefault = true; this.f_OKButton.CanFocus = true; this.f_OKButton.Name = "f_OKButton"; this.f_OKButton.UseStock = true; this.f_OKButton.UseUnderline = true; this.f_OKButton.Label = "gtk-ok"; this.AddActionWidget (this.f_OKButton, -5); global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.f_OKButton])); w12.Position = 1; w12.Expand = false; w12.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } this.label1.MnemonicWidget = this.f_NameEntry; this.Show (); this.f_NameEntry.Activated += new global::System.EventHandler (this.OnNameEntryActivated); this.f_FindButton.Clicked += new global::System.EventHandler (this.OnFindButtonClicked); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs0000644000175000017500000004343212300201464027043 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class ServerWidget { private global::Gtk.VBox vbox16; private global::Gtk.Table table2; private global::Gtk.Label f_HostnameLabel; private global::Gtk.ComboBoxEntry f_NetworkComboBoxEntry; private global::Gtk.Label f_NetworkLabel; private global::Gtk.Entry f_NicknameEntry; private global::Gtk.Label f_NicknameLabel; private global::Gtk.Label f_PasswordLabel; private global::Gtk.ComboBox f_ProtocolComboBox; private global::Gtk.Entry f_RealnameEntry; private global::Gtk.Label f_RealnameLabel; private global::Gtk.Entry f_UsernameEntry; private global::Gtk.HBox hbox10; private global::Gtk.Entry f_HostnameEntry; private global::Gtk.HBox hbox11; private global::Gtk.Label f_PortLabel; private global::Gtk.SpinButton f_PortSpinButton; private global::Gtk.HBox hbox2; private global::Gtk.Entry f_PasswordEntry; private global::Gtk.CheckButton f_ShowPasswordCheckButton; private global::Gtk.Label label21; private global::Gtk.Label label5; private global::Gtk.CheckButton f_OnStartupConnectCheckButton; private global::Gtk.CheckButton f_UseEncryptionCheckButton; private global::Gtk.CheckButton f_ValidateServerCertificateCheckButton; private global::Gtk.VBox vbox2; private global::Gtk.HBox hbox3; private global::Gtk.Label label37; private global::Gtk.CheckButton f_IgnoreOnConnectCommandsCheckButton; private global::Gtk.ScrolledWindow scrolledwindow1; private global::Gtk.TextView f_OnConnectCommandsTextView; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.ServerWidget global::Stetic.BinContainer.Attach (this); this.Name = "Smuxi.Frontend.Gnome.ServerWidget"; // Container child Smuxi.Frontend.Gnome.ServerWidget.Gtk.Container+ContainerChild this.vbox16 = new global::Gtk.VBox (); this.vbox16.Name = "vbox16"; this.vbox16.Spacing = 5; // Container child vbox16.Gtk.Box+BoxChild this.table2 = new global::Gtk.Table (((uint)(7)), ((uint)(2)), false); this.table2.Name = "table2"; this.table2.RowSpacing = ((uint)(5)); this.table2.ColumnSpacing = ((uint)(5)); // Container child table2.Gtk.Table+TableChild this.f_HostnameLabel = new global::Gtk.Label (); this.f_HostnameLabel.Name = "f_HostnameLabel"; this.f_HostnameLabel.Xalign = 0F; this.f_HostnameLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("_Hostname:"); this.f_HostnameLabel.UseUnderline = true; this.table2.Add (this.f_HostnameLabel); global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table2 [this.f_HostnameLabel])); w1.TopAttach = ((uint)(1)); w1.BottomAttach = ((uint)(2)); // Container child table2.Gtk.Table+TableChild this.f_NetworkComboBoxEntry = global::Gtk.ComboBoxEntry.NewText (); this.f_NetworkComboBoxEntry.Name = "f_NetworkComboBoxEntry"; this.table2.Add (this.f_NetworkComboBoxEntry); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table2 [this.f_NetworkComboBoxEntry])); w2.TopAttach = ((uint)(2)); w2.BottomAttach = ((uint)(3)); w2.LeftAttach = ((uint)(1)); w2.RightAttach = ((uint)(2)); w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.f_NetworkLabel = new global::Gtk.Label (); this.f_NetworkLabel.Name = "f_NetworkLabel"; this.f_NetworkLabel.Xalign = 0F; this.f_NetworkLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("_Network:"); this.f_NetworkLabel.UseUnderline = true; this.table2.Add (this.f_NetworkLabel); global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table2 [this.f_NetworkLabel])); w3.TopAttach = ((uint)(2)); w3.BottomAttach = ((uint)(3)); w3.XOptions = ((global::Gtk.AttachOptions)(4)); w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.f_NicknameEntry = new global::Gtk.Entry (); this.f_NicknameEntry.CanFocus = true; this.f_NicknameEntry.Name = "f_NicknameEntry"; this.f_NicknameEntry.IsEditable = true; this.f_NicknameEntry.InvisibleChar = '●'; this.table2.Add (this.f_NicknameEntry); global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table2 [this.f_NicknameEntry])); w4.TopAttach = ((uint)(3)); w4.BottomAttach = ((uint)(4)); w4.LeftAttach = ((uint)(1)); w4.RightAttach = ((uint)(2)); w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.f_NicknameLabel = new global::Gtk.Label (); this.f_NicknameLabel.Name = "f_NicknameLabel"; this.f_NicknameLabel.Xalign = 0F; this.f_NicknameLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Nickname:"); this.table2.Add (this.f_NicknameLabel); global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table2 [this.f_NicknameLabel])); w5.TopAttach = ((uint)(3)); w5.BottomAttach = ((uint)(4)); w5.XOptions = ((global::Gtk.AttachOptions)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.f_PasswordLabel = new global::Gtk.Label (); this.f_PasswordLabel.Name = "f_PasswordLabel"; this.f_PasswordLabel.Xalign = 0F; this.f_PasswordLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("_Password:"); this.f_PasswordLabel.UseUnderline = true; this.table2.Add (this.f_PasswordLabel); global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table2 [this.f_PasswordLabel])); w6.TopAttach = ((uint)(6)); w6.BottomAttach = ((uint)(7)); // Container child table2.Gtk.Table+TableChild this.f_ProtocolComboBox = new global::Gtk.ComboBox (); this.f_ProtocolComboBox.Name = "f_ProtocolComboBox"; this.table2.Add (this.f_ProtocolComboBox); global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table2 [this.f_ProtocolComboBox])); w7.LeftAttach = ((uint)(1)); w7.RightAttach = ((uint)(2)); // Container child table2.Gtk.Table+TableChild this.f_RealnameEntry = new global::Gtk.Entry (); this.f_RealnameEntry.CanFocus = true; this.f_RealnameEntry.Name = "f_RealnameEntry"; this.f_RealnameEntry.IsEditable = true; this.f_RealnameEntry.InvisibleChar = '●'; this.table2.Add (this.f_RealnameEntry); global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table2 [this.f_RealnameEntry])); w8.TopAttach = ((uint)(4)); w8.BottomAttach = ((uint)(5)); w8.LeftAttach = ((uint)(1)); w8.RightAttach = ((uint)(2)); w8.XOptions = ((global::Gtk.AttachOptions)(4)); w8.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.f_RealnameLabel = new global::Gtk.Label (); this.f_RealnameLabel.Name = "f_RealnameLabel"; this.f_RealnameLabel.Xalign = 0F; this.f_RealnameLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Realname:"); this.table2.Add (this.f_RealnameLabel); global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table2 [this.f_RealnameLabel])); w9.TopAttach = ((uint)(4)); w9.BottomAttach = ((uint)(5)); w9.XOptions = ((global::Gtk.AttachOptions)(4)); w9.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.f_UsernameEntry = new global::Gtk.Entry (); this.f_UsernameEntry.Name = "f_UsernameEntry"; this.f_UsernameEntry.IsEditable = true; this.f_UsernameEntry.InvisibleChar = '●'; this.table2.Add (this.f_UsernameEntry); global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table2 [this.f_UsernameEntry])); w10.TopAttach = ((uint)(5)); w10.BottomAttach = ((uint)(6)); w10.LeftAttach = ((uint)(1)); w10.RightAttach = ((uint)(2)); // Container child table2.Gtk.Table+TableChild this.hbox10 = new global::Gtk.HBox (); this.hbox10.Name = "hbox10"; // Container child hbox10.Gtk.Box+BoxChild this.f_HostnameEntry = new global::Gtk.Entry (); this.f_HostnameEntry.Name = "f_HostnameEntry"; this.f_HostnameEntry.IsEditable = true; this.f_HostnameEntry.InvisibleChar = '●'; this.hbox10.Add (this.f_HostnameEntry); global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox10 [this.f_HostnameEntry])); w11.Position = 0; // Container child hbox10.Gtk.Box+BoxChild this.hbox11 = new global::Gtk.HBox (); this.hbox11.Name = "hbox11"; this.hbox11.Spacing = 5; // Container child hbox11.Gtk.Box+BoxChild this.f_PortLabel = new global::Gtk.Label (); this.f_PortLabel.Name = "f_PortLabel"; this.f_PortLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("_Port:"); this.f_PortLabel.UseUnderline = true; this.hbox11.Add (this.f_PortLabel); global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox11 [this.f_PortLabel])); w12.Position = 0; // Container child hbox11.Gtk.Box+BoxChild this.f_PortSpinButton = new global::Gtk.SpinButton (0, 65535, 1); this.f_PortSpinButton.Name = "f_PortSpinButton"; this.f_PortSpinButton.Adjustment.PageIncrement = 10; this.f_PortSpinButton.Adjustment.PageSize = 10; this.f_PortSpinButton.ClimbRate = 1; this.f_PortSpinButton.Numeric = true; this.hbox11.Add (this.f_PortSpinButton); global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox11 [this.f_PortSpinButton])); w13.Position = 1; this.hbox10.Add (this.hbox11); global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox10 [this.hbox11])); w14.Position = 1; this.table2.Add (this.hbox10); global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table2 [this.hbox10])); w15.TopAttach = ((uint)(1)); w15.BottomAttach = ((uint)(2)); w15.LeftAttach = ((uint)(1)); w15.RightAttach = ((uint)(2)); // Container child table2.Gtk.Table+TableChild this.hbox2 = new global::Gtk.HBox (); this.hbox2.Name = "hbox2"; this.hbox2.Spacing = 6; // Container child hbox2.Gtk.Box+BoxChild this.f_PasswordEntry = new global::Gtk.Entry (); this.f_PasswordEntry.Name = "f_PasswordEntry"; this.f_PasswordEntry.IsEditable = true; this.f_PasswordEntry.Visibility = false; this.f_PasswordEntry.InvisibleChar = '●'; this.hbox2.Add (this.f_PasswordEntry); global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.f_PasswordEntry])); w16.Position = 0; // Container child hbox2.Gtk.Box+BoxChild this.f_ShowPasswordCheckButton = new global::Gtk.CheckButton (); this.f_ShowPasswordCheckButton.CanFocus = true; this.f_ShowPasswordCheckButton.Name = "f_ShowPasswordCheckButton"; this.f_ShowPasswordCheckButton.Label = global::Mono.Unix.Catalog.GetString ("Show Password"); this.f_ShowPasswordCheckButton.DrawIndicator = true; this.f_ShowPasswordCheckButton.UseUnderline = true; this.hbox2.Add (this.f_ShowPasswordCheckButton); global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.f_ShowPasswordCheckButton])); w17.Position = 1; this.table2.Add (this.hbox2); global::Gtk.Table.TableChild w18 = ((global::Gtk.Table.TableChild)(this.table2 [this.hbox2])); w18.TopAttach = ((uint)(6)); w18.BottomAttach = ((uint)(7)); w18.LeftAttach = ((uint)(1)); w18.RightAttach = ((uint)(2)); w18.XOptions = ((global::Gtk.AttachOptions)(4)); w18.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.label21 = new global::Gtk.Label (); this.label21.Name = "label21"; this.label21.Xalign = 0F; this.label21.LabelProp = global::Mono.Unix.Catalog.GetString ("_Username:"); this.label21.UseUnderline = true; this.table2.Add (this.label21); global::Gtk.Table.TableChild w19 = ((global::Gtk.Table.TableChild)(this.table2 [this.label21])); w19.TopAttach = ((uint)(5)); w19.BottomAttach = ((uint)(6)); // Container child table2.Gtk.Table+TableChild this.label5 = new global::Gtk.Label (); this.label5.Name = "label5"; this.label5.Xalign = 0F; this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("_Protocol:"); this.label5.UseUnderline = true; this.table2.Add (this.label5); this.vbox16.Add (this.table2); global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox16 [this.table2])); w21.Position = 0; w21.Expand = false; // Container child vbox16.Gtk.Box+BoxChild this.f_OnStartupConnectCheckButton = new global::Gtk.CheckButton (); this.f_OnStartupConnectCheckButton.CanFocus = true; this.f_OnStartupConnectCheckButton.Name = "f_OnStartupConnectCheckButton"; this.f_OnStartupConnectCheckButton.Label = global::Mono.Unix.Catalog.GetString ("Automatically connect to server at startup"); this.f_OnStartupConnectCheckButton.DrawIndicator = true; this.f_OnStartupConnectCheckButton.UseUnderline = true; this.f_OnStartupConnectCheckButton.Xalign = 0F; this.vbox16.Add (this.f_OnStartupConnectCheckButton); global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox16 [this.f_OnStartupConnectCheckButton])); w22.Position = 1; w22.Expand = false; w22.Fill = false; // Container child vbox16.Gtk.Box+BoxChild this.f_UseEncryptionCheckButton = new global::Gtk.CheckButton (); this.f_UseEncryptionCheckButton.CanFocus = true; this.f_UseEncryptionCheckButton.Name = "f_UseEncryptionCheckButton"; this.f_UseEncryptionCheckButton.Label = global::Mono.Unix.Catalog.GetString ("Use Encryption"); this.f_UseEncryptionCheckButton.DrawIndicator = true; this.f_UseEncryptionCheckButton.UseUnderline = true; this.vbox16.Add (this.f_UseEncryptionCheckButton); global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox16 [this.f_UseEncryptionCheckButton])); w23.Position = 2; w23.Expand = false; w23.Fill = false; // Container child vbox16.Gtk.Box+BoxChild this.f_ValidateServerCertificateCheckButton = new global::Gtk.CheckButton (); this.f_ValidateServerCertificateCheckButton.CanFocus = true; this.f_ValidateServerCertificateCheckButton.Name = "f_ValidateServerCertificateCheckButton"; this.f_ValidateServerCertificateCheckButton.Label = global::Mono.Unix.Catalog.GetString ("Validate Server Certificate"); this.f_ValidateServerCertificateCheckButton.DrawIndicator = true; this.f_ValidateServerCertificateCheckButton.UseUnderline = true; this.vbox16.Add (this.f_ValidateServerCertificateCheckButton); global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox16 [this.f_ValidateServerCertificateCheckButton])); w24.Position = 3; w24.Expand = false; w24.Fill = false; // Container child vbox16.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 5; // Container child vbox2.Gtk.Box+BoxChild this.hbox3 = new global::Gtk.HBox (); this.hbox3.Name = "hbox3"; this.hbox3.Spacing = 6; // Container child hbox3.Gtk.Box+BoxChild this.label37 = new global::Gtk.Label (); this.label37.Name = "label37"; this.label37.Xalign = 0F; this.label37.LabelProp = global::Mono.Unix.Catalog.GetString ("_On Connect Commands:"); this.label37.UseUnderline = true; this.hbox3.Add (this.label37); global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label37])); w25.Position = 0; w25.Expand = false; w25.Fill = false; // Container child hbox3.Gtk.Box+BoxChild this.f_IgnoreOnConnectCommandsCheckButton = new global::Gtk.CheckButton (); this.f_IgnoreOnConnectCommandsCheckButton.CanFocus = true; this.f_IgnoreOnConnectCommandsCheckButton.Name = "f_IgnoreOnConnectCommandsCheckButton"; this.f_IgnoreOnConnectCommandsCheckButton.Label = global::Mono.Unix.Catalog.GetString ("_Ignore Commands"); this.f_IgnoreOnConnectCommandsCheckButton.DrawIndicator = true; this.f_IgnoreOnConnectCommandsCheckButton.UseUnderline = true; this.hbox3.Add (this.f_IgnoreOnConnectCommandsCheckButton); global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.f_IgnoreOnConnectCommandsCheckButton])); w26.Position = 1; this.vbox2.Add (this.hbox3); global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox3])); w27.Position = 0; w27.Expand = false; w27.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.scrolledwindow1 = new global::Gtk.ScrolledWindow (); this.scrolledwindow1.WidthRequest = 350; this.scrolledwindow1.HeightRequest = 100; this.scrolledwindow1.Name = "scrolledwindow1"; this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child scrolledwindow1.Gtk.Container+ContainerChild this.f_OnConnectCommandsTextView = new global::Gtk.TextView (); this.f_OnConnectCommandsTextView.WidthRequest = 152; this.f_OnConnectCommandsTextView.HeightRequest = 168; this.f_OnConnectCommandsTextView.Name = "f_OnConnectCommandsTextView"; this.f_OnConnectCommandsTextView.WrapMode = ((global::Gtk.WrapMode)(2)); this.scrolledwindow1.Add (this.f_OnConnectCommandsTextView); this.vbox2.Add (this.scrolledwindow1); global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow1])); w29.Position = 1; this.vbox16.Add (this.vbox2); global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.vbox16 [this.vbox2])); w30.Position = 4; this.Add (this.vbox16); if ((this.Child != null)) { this.Child.ShowAll (); } this.f_HostnameLabel.MnemonicWidget = this.f_HostnameEntry; this.f_NetworkLabel.MnemonicWidget = this.f_NetworkComboBoxEntry; this.f_NicknameLabel.MnemonicWidget = this.f_NicknameEntry; this.f_PasswordLabel.MnemonicWidget = this.f_PasswordEntry; this.f_RealnameLabel.MnemonicWidget = this.f_RealnameEntry; this.f_PortLabel.MnemonicWidget = this.f_PortSpinButton; this.label21.MnemonicWidget = this.f_UsernameEntry; this.label5.MnemonicWidget = this.f_ProtocolComboBox; this.label37.MnemonicWidget = this.f_OnConnectCommandsTextView; this.Hide (); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs0000644000175000017500000000514612253423337027033 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class ServerDialog { private global::Smuxi.Frontend.Gnome.ServerWidget f_Widget; private global::Gtk.Button buttonCancel; private global::Gtk.Button f_OkButton; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.ServerDialog this.Name = "Smuxi.Frontend.Gnome.ServerDialog"; this.Title = global::Mono.Unix.Catalog.GetString ("Smuxi - Server"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child Smuxi.Frontend.Gnome.ServerDialog.VBox global::Gtk.VBox w1 = this.VBox; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.f_Widget = new global::Smuxi.Frontend.Gnome.ServerWidget (); this.f_Widget.Events = ((global::Gdk.EventMask)(256)); this.f_Widget.Name = "f_Widget"; w1.Add (this.f_Widget); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(w1 [this.f_Widget])); w2.Position = 0; w2.Padding = ((uint)(5)); // Internal child Smuxi.Frontend.Gnome.ServerDialog.ActionArea global::Gtk.HButtonBox w3 = this.ActionArea; w3.Name = "dialog1_ActionArea"; w3.Spacing = 10; w3.BorderWidth = ((uint)(5)); w3.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; this.buttonCancel.CanFocus = true; this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.UseStock = true; this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); global::Gtk.ButtonBox.ButtonBoxChild w4 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w3 [this.buttonCancel])); w4.Expand = false; w4.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.f_OkButton = new global::Gtk.Button (); this.f_OkButton.CanDefault = true; this.f_OkButton.CanFocus = true; this.f_OkButton.Name = "f_OkButton"; this.f_OkButton.UseStock = true; this.f_OkButton.UseUnderline = true; this.f_OkButton.Label = "gtk-ok"; this.AddActionWidget (this.f_OkButton, -5); global::Gtk.ButtonBox.ButtonBoxChild w5 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w3 [this.f_OkButton])); w5.Position = 1; w5.Expand = false; w5.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } this.DefaultWidth = 392; this.DefaultHeight = 410; this.Show (); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.FilterListWidget.cs0000644000175000017500000000634112132611315027657 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class FilterListWidget { private global::Gtk.HBox hbox1; private global::Gtk.ScrolledWindow scrolledwindow1; private global::Gtk.TreeView f_TreeView; private global::Gtk.VButtonBox vbuttonbox1; private global::Gtk.Button f_AddButton; private global::Gtk.Button f_RemoveButton; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.FilterListWidget global::Stetic.BinContainer.Attach (this); this.Name = "Smuxi.Frontend.Gnome.FilterListWidget"; // Container child Smuxi.Frontend.Gnome.FilterListWidget.Gtk.Container+ContainerChild this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 5; // Container child hbox1.Gtk.Box+BoxChild this.scrolledwindow1 = new global::Gtk.ScrolledWindow (); this.scrolledwindow1.Name = "scrolledwindow1"; this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child scrolledwindow1.Gtk.Container+ContainerChild this.f_TreeView = new global::Gtk.TreeView (); this.f_TreeView.CanFocus = true; this.f_TreeView.Name = "f_TreeView"; this.scrolledwindow1.Add (this.f_TreeView); this.hbox1.Add (this.scrolledwindow1); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.scrolledwindow1])); w2.Position = 0; // Container child hbox1.Gtk.Box+BoxChild this.vbuttonbox1 = new global::Gtk.VButtonBox (); this.vbuttonbox1.Name = "vbuttonbox1"; this.vbuttonbox1.BorderWidth = ((uint)(5)); this.vbuttonbox1.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(3)); // Container child vbuttonbox1.Gtk.ButtonBox+ButtonBoxChild this.f_AddButton = new global::Gtk.Button (); this.f_AddButton.CanFocus = true; this.f_AddButton.Name = "f_AddButton"; this.f_AddButton.UseStock = true; this.f_AddButton.UseUnderline = true; this.f_AddButton.Label = "gtk-add"; this.vbuttonbox1.Add (this.f_AddButton); global::Gtk.ButtonBox.ButtonBoxChild w3 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox1 [this.f_AddButton])); w3.Expand = false; w3.Fill = false; // Container child vbuttonbox1.Gtk.ButtonBox+ButtonBoxChild this.f_RemoveButton = new global::Gtk.Button (); this.f_RemoveButton.CanFocus = true; this.f_RemoveButton.Name = "f_RemoveButton"; this.f_RemoveButton.UseStock = true; this.f_RemoveButton.UseUnderline = true; this.f_RemoveButton.Label = "gtk-remove"; this.vbuttonbox1.Add (this.f_RemoveButton); global::Gtk.ButtonBox.ButtonBoxChild w4 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox1 [this.f_RemoveButton])); w4.Position = 1; w4.Expand = false; w4.Fill = false; this.hbox1.Add (this.vbuttonbox1); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbuttonbox1])); w5.Position = 1; w5.Expand = false; w5.Fill = false; this.Add (this.hbox1); if ((this.Child != null)) { this.Child.ShowAll (); } this.Hide (); this.f_AddButton.Clicked += new global::System.EventHandler (this.OnAddButtonClicked); this.f_RemoveButton.Clicked += new global::System.EventHandler (this.OnRemoveButtonClicked); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatTypeWidget.cs0000644000175000017500000000132312132611315027312 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class ChatTypeWidget { private global::Gtk.ComboBox f_ComboBox; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.ChatTypeWidget global::Stetic.BinContainer.Attach (this); this.Name = "Smuxi.Frontend.Gnome.ChatTypeWidget"; // Container child Smuxi.Frontend.Gnome.ChatTypeWidget.Gtk.Container+ContainerChild this.f_ComboBox = global::Gtk.ComboBox.NewText (); this.f_ComboBox.Name = "f_ComboBox"; this.Add (this.f_ComboBox); if ((this.Child != null)) { this.Child.ShowAll (); } this.Hide (); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs0000644000175000017500000004576312253423337026526 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class MenuWidget { private global::Gtk.UIManager UIManager; private global::Gtk.Action f_SmuxiAction; private global::Gtk.Action ServerAction; private global::Gtk.Action ChatAction; private global::Gtk.Action EngineAction; private global::Gtk.Action ViewAction; private global::Gtk.Action f_HelpAction; private global::Gtk.Action f_ConnectToolAction; private global::Gtk.Action f_OpenLogToolAction; private global::Gtk.Action f_FullscreenToolAction; private global::Gtk.Action f_PreferencesToolAction; private global::Gtk.Action f_PreferencesAction; private global::Gtk.Action f_QuitAction; private global::Gtk.Action f_ConnectAction; private global::Gtk.Action f_AddServerAction; private global::Gtk.Action f_ManageServerAction; private global::Gtk.Action f_JoinChatAction; private global::Gtk.Action f_FindGroupChatAction; private global::Gtk.Action f_ClearAllActivityAction; private global::Gtk.Action f_NextChatAction; private global::Gtk.Action f_PreviousChatAction; private global::Gtk.Action f_CloseChatAction; private global::Gtk.Action f_UseLocalEngineAction; private global::Gtk.Action f_AddRemoteEngineAction; private global::Gtk.Action f_SwitchRemoteEngineAction; private global::Gtk.ToggleAction f_CaretModeAction; private global::Gtk.ToggleAction f_BrowseModeAction; private global::Gtk.ToggleAction f_ShowMenubarAction; private global::Gtk.ToggleAction f_ShowStatusbarAction; private global::Gtk.Action f_FullscreenAction; private global::Gtk.Action f_AboutAction; private global::Gtk.Action f_OpenLogAction; private global::Gtk.Action f_FindGroupChatToolAction; private global::Gtk.Action f_WebsiteAction; private global::Gtk.ToggleAction f_ShowToolbarAction; private global::Gtk.VBox vbox2; private global::Gtk.MenuBar f_MenuBar; private global::Gtk.HBox hbox1; private global::Gtk.Toolbar f_MenuToolbar; private global::Gtk.Toolbar f_JoinToolbar; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.MenuWidget Stetic.BinContainer w1 = global::Stetic.BinContainer.Attach (this); this.UIManager = new global::Gtk.UIManager (); global::Gtk.ActionGroup w2 = new global::Gtk.ActionGroup ("Default"); this.f_SmuxiAction = new global::Gtk.Action ("f_SmuxiAction", global::Mono.Unix.Catalog.GetString ("_Smuxi"), null, null); this.f_SmuxiAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Smuxi"); w2.Add (this.f_SmuxiAction, null); this.ServerAction = new global::Gtk.Action ("ServerAction", global::Mono.Unix.Catalog.GetString ("_Server"), null, null); this.ServerAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Server"); w2.Add (this.ServerAction, null); this.ChatAction = new global::Gtk.Action ("ChatAction", global::Mono.Unix.Catalog.GetString ("_Chat"), null, null); this.ChatAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Chat"); w2.Add (this.ChatAction, null); this.EngineAction = new global::Gtk.Action ("EngineAction", global::Mono.Unix.Catalog.GetString ("_Engine"), null, null); this.EngineAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Engine"); w2.Add (this.EngineAction, null); this.ViewAction = new global::Gtk.Action ("ViewAction", global::Mono.Unix.Catalog.GetString ("_View"), null, null); this.ViewAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_View"); w2.Add (this.ViewAction, null); this.f_HelpAction = new global::Gtk.Action ("f_HelpAction", global::Mono.Unix.Catalog.GetString ("_Help"), null, null); this.f_HelpAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Help"); w2.Add (this.f_HelpAction, null); this.f_ConnectToolAction = new global::Gtk.Action ("f_ConnectToolAction", global::Mono.Unix.Catalog.GetString ("Connect"), null, "gtk-network"); this.f_ConnectToolAction.IsImportant = true; this.f_ConnectToolAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Connect"); w2.Add (this.f_ConnectToolAction, null); this.f_OpenLogToolAction = new global::Gtk.Action ("f_OpenLogToolAction", global::Mono.Unix.Catalog.GetString ("Open Log"), null, "gtk-open"); this.f_OpenLogToolAction.IsImportant = true; this.f_OpenLogToolAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Open Log"); w2.Add (this.f_OpenLogToolAction, null); this.f_FullscreenToolAction = new global::Gtk.Action ("f_FullscreenToolAction", null, null, "gtk-fullscreen"); this.f_FullscreenToolAction.IsImportant = true; w2.Add (this.f_FullscreenToolAction, null); this.f_PreferencesToolAction = new global::Gtk.Action ("f_PreferencesToolAction", null, null, "gtk-preferences"); this.f_PreferencesToolAction.IsImportant = true; w2.Add (this.f_PreferencesToolAction, null); this.f_PreferencesAction = new global::Gtk.Action ("f_PreferencesAction", global::Mono.Unix.Catalog.GetString ("_Preferences"), null, "gtk-preferences"); this.f_PreferencesAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Preferences"); w2.Add (this.f_PreferencesAction, null); this.f_QuitAction = new global::Gtk.Action ("f_QuitAction", global::Mono.Unix.Catalog.GetString ("_Quit"), null, null); this.f_QuitAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Quit"); w2.Add (this.f_QuitAction, "q"); this.f_ConnectAction = new global::Gtk.Action ("f_ConnectAction", global::Mono.Unix.Catalog.GetString ("_Connect"), null, "gtk-network"); this.f_ConnectAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Connect"); w2.Add (this.f_ConnectAction, null); this.f_AddServerAction = new global::Gtk.Action ("f_AddServerAction", global::Mono.Unix.Catalog.GetString ("_Add"), null, "gtk-add"); this.f_AddServerAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Add"); w2.Add (this.f_AddServerAction, null); this.f_ManageServerAction = new global::Gtk.Action ("f_ManageServerAction", global::Mono.Unix.Catalog.GetString ("_Manage"), null, "gtk-edit"); this.f_ManageServerAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Manage"); w2.Add (this.f_ManageServerAction, null); this.f_JoinChatAction = new global::Gtk.Action ("f_JoinChatAction", global::Mono.Unix.Catalog.GetString ("_Open / Join Chat"), null, null); this.f_JoinChatAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Open / Join Chat"); w2.Add (this.f_JoinChatAction, "l"); this.f_FindGroupChatAction = new global::Gtk.Action ("f_FindGroupChatAction", global::Mono.Unix.Catalog.GetString ("_Find Group Chat"), null, null); this.f_FindGroupChatAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Find Group Chat"); w2.Add (this.f_FindGroupChatAction, null); this.f_ClearAllActivityAction = new global::Gtk.Action ("f_ClearAllActivityAction", global::Mono.Unix.Catalog.GetString ("C_lear All Activity"), null, "gtk-clear"); this.f_ClearAllActivityAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("C_lear All Activity"); w2.Add (this.f_ClearAllActivityAction, null); this.f_NextChatAction = new global::Gtk.Action ("f_NextChatAction", global::Mono.Unix.Catalog.GetString ("_Next Chat"), null, "gtk-go-forward"); this.f_NextChatAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Next Chat"); w2.Add (this.f_NextChatAction, "Page_Down"); this.f_PreviousChatAction = new global::Gtk.Action ("f_PreviousChatAction", global::Mono.Unix.Catalog.GetString ("_Previous Chat"), null, "gtk-go-back"); this.f_PreviousChatAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Previous Chat"); w2.Add (this.f_PreviousChatAction, "Page_Up"); this.f_CloseChatAction = new global::Gtk.Action ("f_CloseChatAction", global::Mono.Unix.Catalog.GetString ("_Close"), null, null); this.f_CloseChatAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Close"); w2.Add (this.f_CloseChatAction, "w"); this.f_UseLocalEngineAction = new global::Gtk.Action ("f_UseLocalEngineAction", global::Mono.Unix.Catalog.GetString ("_Use Local Engine"), null, null); this.f_UseLocalEngineAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Use Local Engine"); w2.Add (this.f_UseLocalEngineAction, null); this.f_AddRemoteEngineAction = new global::Gtk.Action ("f_AddRemoteEngineAction", global::Mono.Unix.Catalog.GetString ("_Add Remote Engine"), null, null); this.f_AddRemoteEngineAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Add Remote Engine"); w2.Add (this.f_AddRemoteEngineAction, null); this.f_SwitchRemoteEngineAction = new global::Gtk.Action ("f_SwitchRemoteEngineAction", global::Mono.Unix.Catalog.GetString ("Switch Remote Engine"), null, null); this.f_SwitchRemoteEngineAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Switch Remote Engine"); w2.Add (this.f_SwitchRemoteEngineAction, null); this.f_CaretModeAction = new global::Gtk.ToggleAction ("f_CaretModeAction", global::Mono.Unix.Catalog.GetString ("_Caret Mode"), null, null); this.f_CaretModeAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Caret Mode"); w2.Add (this.f_CaretModeAction, "F7"); this.f_BrowseModeAction = new global::Gtk.ToggleAction ("f_BrowseModeAction", global::Mono.Unix.Catalog.GetString ("_Browse Mode"), null, null); this.f_BrowseModeAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Browse Mode"); w2.Add (this.f_BrowseModeAction, "F8"); this.f_ShowMenubarAction = new global::Gtk.ToggleAction ("f_ShowMenubarAction", global::Mono.Unix.Catalog.GetString ("Show _Menubar"), null, null); this.f_ShowMenubarAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Show _Menubar"); w2.Add (this.f_ShowMenubarAction, null); this.f_ShowStatusbarAction = new global::Gtk.ToggleAction ("f_ShowStatusbarAction", global::Mono.Unix.Catalog.GetString ("Show _Statusbar"), null, null); this.f_ShowStatusbarAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Show _Statusbar"); w2.Add (this.f_ShowStatusbarAction, null); this.f_FullscreenAction = new global::Gtk.Action ("f_FullscreenAction", global::Mono.Unix.Catalog.GetString ("_Fullscreen"), null, "gtk-fullscreen"); this.f_FullscreenAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Fullscreen"); w2.Add (this.f_FullscreenAction, "F11"); this.f_AboutAction = new global::Gtk.Action ("f_AboutAction", global::Mono.Unix.Catalog.GetString ("_About"), null, "gtk-about"); this.f_AboutAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_About"); w2.Add (this.f_AboutAction, null); this.f_OpenLogAction = new global::Gtk.Action ("f_OpenLogAction", global::Mono.Unix.Catalog.GetString ("Open Log"), null, null); this.f_OpenLogAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Open Log"); w2.Add (this.f_OpenLogAction, null); this.f_FindGroupChatToolAction = new global::Gtk.Action ("f_FindGroupChatToolAction", global::Mono.Unix.Catalog.GetString ("Find Group Chat"), null, null); this.f_FindGroupChatToolAction.IsImportant = true; this.f_FindGroupChatToolAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Find Group Chat"); w2.Add (this.f_FindGroupChatToolAction, null); this.f_WebsiteAction = new global::Gtk.Action ("f_WebsiteAction", global::Mono.Unix.Catalog.GetString ("_Website"), null, null); this.f_WebsiteAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Website"); w2.Add (this.f_WebsiteAction, null); this.f_ShowToolbarAction = new global::Gtk.ToggleAction ("f_ShowToolbarAction", global::Mono.Unix.Catalog.GetString ("Show _Toolbar"), null, null); this.f_ShowToolbarAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Show _Toolbar"); w2.Add (this.f_ShowToolbarAction, null); this.UIManager.InsertActionGroup (w2, 0); this.Name = "Smuxi.Frontend.Gnome.MenuWidget"; // Container child Smuxi.Frontend.Gnome.MenuWidget.Gtk.Container+ContainerChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; // Container child vbox2.Gtk.Box+BoxChild this.UIManager.AddUiFromString (""); this.f_MenuBar = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/f_MenuBar"))); this.f_MenuBar.Name = "f_MenuBar"; this.vbox2.Add (this.f_MenuBar); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.f_MenuBar])); w3.Position = 0; w3.Expand = false; w3.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; // Container child hbox1.Gtk.Box+BoxChild this.UIManager.AddUiFromString (""); this.f_MenuToolbar = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/f_MenuToolbar"))); this.f_MenuToolbar.Name = "f_MenuToolbar"; this.f_MenuToolbar.ShowArrow = false; this.f_MenuToolbar.ToolbarStyle = ((global::Gtk.ToolbarStyle)(3)); this.f_MenuToolbar.IconSize = ((global::Gtk.IconSize)(3)); this.hbox1.Add (this.f_MenuToolbar); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.f_MenuToolbar])); w4.Position = 0; // Container child hbox1.Gtk.Box+BoxChild this.UIManager.AddUiFromString (""); this.f_JoinToolbar = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/f_JoinToolbar"))); this.f_JoinToolbar.Name = "f_JoinToolbar"; this.f_JoinToolbar.ShowArrow = false; this.hbox1.Add (this.f_JoinToolbar); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.f_JoinToolbar])); w5.PackType = ((global::Gtk.PackType)(1)); w5.Position = 1; w5.Expand = false; this.vbox2.Add (this.hbox1); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); w6.Position = 1; w6.Expand = false; w6.Fill = false; this.Add (this.vbox2); if ((this.Child != null)) { this.Child.ShowAll (); } w1.SetUiManager (UIManager); this.Hide (); this.f_ConnectToolAction.Activated += new global::System.EventHandler (this.OnConnectActionActivated); this.f_OpenLogToolAction.Activated += new global::System.EventHandler (this.OnOpenLogActionActivated); this.f_FullscreenToolAction.Activated += new global::System.EventHandler (this.OnFullscreenActionActivated); this.f_PreferencesToolAction.Activated += new global::System.EventHandler (this.OnPreferencesActionActivated); this.f_PreferencesAction.Activated += new global::System.EventHandler (this.OnPreferencesActionActivated); this.f_QuitAction.Activated += new global::System.EventHandler (this.OnQuitActionActivated); this.f_ConnectAction.Activated += new global::System.EventHandler (this.OnConnectActionActivated); this.f_AddServerAction.Activated += new global::System.EventHandler (this.OnAddServerActionActivated); this.f_ManageServerAction.Activated += new global::System.EventHandler (this.OnManageServerActionActivated); this.f_JoinChatAction.Activated += new global::System.EventHandler (this.OnJoinChatActionActivated); this.f_FindGroupChatAction.Activated += new global::System.EventHandler (this.OnFindGroupChatActionActivated); this.f_ClearAllActivityAction.Activated += new global::System.EventHandler (this.OnClearAllActivityActionActivated); this.f_NextChatAction.Activated += new global::System.EventHandler (this.OnNextChatActionActivated); this.f_PreviousChatAction.Activated += new global::System.EventHandler (this.OnPreviousChatActionActivated); this.f_CloseChatAction.Activated += new global::System.EventHandler (this.OnCloseChatActionActivated); this.f_UseLocalEngineAction.Activated += new global::System.EventHandler (this.OnUseLocalEngineActionActivated); this.f_AddRemoteEngineAction.Activated += new global::System.EventHandler (this.OnAddRemoteEngineActionActivated); this.f_SwitchRemoteEngineAction.Activated += new global::System.EventHandler (this.OnSwitchRemoteEngineActionActivated); this.f_CaretModeAction.Toggled += new global::System.EventHandler (this.OnCaretModeActionToggled); this.f_BrowseModeAction.Toggled += new global::System.EventHandler (this.OnBrowseModeActionToggled); this.f_ShowMenubarAction.Toggled += new global::System.EventHandler (this.OnShowMenubarActionToggled); this.f_ShowStatusbarAction.Toggled += new global::System.EventHandler (this.OnShowStatusbarActionToggled); this.f_FullscreenAction.Activated += new global::System.EventHandler (this.OnFullscreenActionActivated); this.f_AboutAction.Activated += new global::System.EventHandler (this.OnAboutActionActivated); this.f_OpenLogAction.Activated += new global::System.EventHandler (this.OnOpenLogActionActivated); this.f_FindGroupChatToolAction.Activated += new global::System.EventHandler (this.OnFindGroupChatActionActivated); this.f_WebsiteAction.Activated += new global::System.EventHandler (this.OnWebsiteActionActivated); this.f_ShowToolbarAction.Toggled += new global::System.EventHandler (this.OnShowToolbarActionToggled); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs0000644000175000017500000001654712132611315027243 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class ChatFindDialog { private global::Gtk.VBox vbox2; private global::Gtk.HBox hbox1; private global::Gtk.Label label1; private global::Gtk.Entry f_SearchForEntry; private global::Gtk.VBox vbox3; private global::Gtk.CheckButton f_MatchCaseCheckButton; private global::Gtk.CheckButton f_SearchBackwardsCheckButton; private global::Gtk.CheckButton f_WrapAroundCheckButton; private global::Gtk.CheckButton f_UseRegularExpressionsCheckButton; private global::Gtk.Button f_CloseButton; private global::Gtk.Button f_FindButton; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.ChatFindDialog this.Name = "Smuxi.Frontend.Gnome.ChatFindDialog"; this.Title = global::Mono.Unix.Catalog.GetString ("Find"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.Resizable = false; this.AllowGrow = false; // Internal child Smuxi.Frontend.Gnome.ChatFindDialog.VBox global::Gtk.VBox w1 = this.VBox; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 6; this.vbox2.BorderWidth = ((uint)(10)); // Container child vbox2.Gtk.Box+BoxChild this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild this.label1 = new global::Gtk.Label (); this.label1.Name = "label1"; this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Search for:"); this.label1.UseUnderline = true; this.hbox1.Add (this.label1); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1])); w2.Position = 0; w2.Expand = false; w2.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.f_SearchForEntry = new global::Gtk.Entry (); this.f_SearchForEntry.CanFocus = true; this.f_SearchForEntry.Name = "f_SearchForEntry"; this.f_SearchForEntry.IsEditable = true; this.f_SearchForEntry.InvisibleChar = '●'; this.hbox1.Add (this.f_SearchForEntry); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.f_SearchForEntry])); w3.Position = 1; this.vbox2.Add (this.hbox1); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); w4.Position = 0; w4.Expand = false; w4.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.vbox3 = new global::Gtk.VBox (); this.vbox3.Name = "vbox3"; this.vbox3.Spacing = 6; // Container child vbox3.Gtk.Box+BoxChild this.f_MatchCaseCheckButton = new global::Gtk.CheckButton (); this.f_MatchCaseCheckButton.CanFocus = true; this.f_MatchCaseCheckButton.Name = "f_MatchCaseCheckButton"; this.f_MatchCaseCheckButton.Label = global::Mono.Unix.Catalog.GetString ("_Match Case"); this.f_MatchCaseCheckButton.DrawIndicator = true; this.f_MatchCaseCheckButton.UseUnderline = true; this.vbox3.Add (this.f_MatchCaseCheckButton); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.f_MatchCaseCheckButton])); w5.Position = 0; w5.Expand = false; w5.Fill = false; // Container child vbox3.Gtk.Box+BoxChild this.f_SearchBackwardsCheckButton = new global::Gtk.CheckButton (); this.f_SearchBackwardsCheckButton.CanFocus = true; this.f_SearchBackwardsCheckButton.Name = "f_SearchBackwardsCheckButton"; this.f_SearchBackwardsCheckButton.Label = global::Mono.Unix.Catalog.GetString ("Search _Backwards"); this.f_SearchBackwardsCheckButton.DrawIndicator = true; this.f_SearchBackwardsCheckButton.UseUnderline = true; this.vbox3.Add (this.f_SearchBackwardsCheckButton); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.f_SearchBackwardsCheckButton])); w6.Position = 1; w6.Expand = false; w6.Fill = false; // Container child vbox3.Gtk.Box+BoxChild this.f_WrapAroundCheckButton = new global::Gtk.CheckButton (); this.f_WrapAroundCheckButton.CanFocus = true; this.f_WrapAroundCheckButton.Name = "f_WrapAroundCheckButton"; this.f_WrapAroundCheckButton.Label = global::Mono.Unix.Catalog.GetString ("_Wrap Around"); this.f_WrapAroundCheckButton.Active = true; this.f_WrapAroundCheckButton.DrawIndicator = true; this.f_WrapAroundCheckButton.UseUnderline = true; this.vbox3.Add (this.f_WrapAroundCheckButton); global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.f_WrapAroundCheckButton])); w7.Position = 2; w7.Expand = false; w7.Fill = false; // Container child vbox3.Gtk.Box+BoxChild this.f_UseRegularExpressionsCheckButton = new global::Gtk.CheckButton (); this.f_UseRegularExpressionsCheckButton.CanFocus = true; this.f_UseRegularExpressionsCheckButton.Name = "f_UseRegularExpressionsCheckButton"; this.f_UseRegularExpressionsCheckButton.Label = global::Mono.Unix.Catalog.GetString ("Use _Regular Expressions"); this.f_UseRegularExpressionsCheckButton.DrawIndicator = true; this.f_UseRegularExpressionsCheckButton.UseUnderline = true; this.vbox3.Add (this.f_UseRegularExpressionsCheckButton); global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.f_UseRegularExpressionsCheckButton])); w8.PackType = ((global::Gtk.PackType)(1)); w8.Position = 3; w8.Expand = false; w8.Fill = false; this.vbox2.Add (this.vbox3); global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.vbox3])); w9.Position = 1; w9.Expand = false; w9.Fill = false; w1.Add (this.vbox2); global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w10.Position = 0; w10.Expand = false; w10.Fill = false; // Internal child Smuxi.Frontend.Gnome.ChatFindDialog.ActionArea global::Gtk.HButtonBox w11 = this.ActionArea; w11.Name = "dialog1_ActionArea"; w11.Spacing = 6; w11.BorderWidth = ((uint)(5)); w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.f_CloseButton = new global::Gtk.Button (); this.f_CloseButton.CanDefault = true; this.f_CloseButton.CanFocus = true; this.f_CloseButton.Name = "f_CloseButton"; this.f_CloseButton.UseStock = true; this.f_CloseButton.UseUnderline = true; this.f_CloseButton.Label = "gtk-close"; this.AddActionWidget (this.f_CloseButton, -7); global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.f_CloseButton])); w12.Expand = false; w12.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.f_FindButton = new global::Gtk.Button (); this.f_FindButton.CanDefault = true; this.f_FindButton.CanFocus = true; this.f_FindButton.Name = "f_FindButton"; this.f_FindButton.UseStock = true; this.f_FindButton.UseUnderline = true; this.f_FindButton.Label = "gtk-find"; this.AddActionWidget (this.f_FindButton, 0); global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.f_FindButton])); w13.Position = 1; w13.Expand = false; w13.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } this.DefaultWidth = 400; this.DefaultHeight = 300; this.label1.MnemonicWidget = this.f_SearchForEntry; this.Show (); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs0000644000175000017500000001236312132611315027254 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Smuxi.Frontend.Gnome { public partial class OpenChatDialog { private global::Gtk.Table table1; private global::Smuxi.Frontend.Gnome.ChatTypeWidget f_ChatTypeWidget; private global::Gtk.Entry f_NameEntry; private global::Gtk.Label label1; private global::Gtk.Label label2; private global::Gtk.Button f_CancelButton; private global::Gtk.Button f_OpenButton; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Smuxi.Frontend.Gnome.OpenChatDialog this.Name = "Smuxi.Frontend.Gnome.OpenChatDialog"; this.Title = global::Mono.Unix.Catalog.GetString ("Smuxi - Open Chat"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.Resizable = false; this.AllowGrow = false; // Internal child Smuxi.Frontend.Gnome.OpenChatDialog.VBox global::Gtk.VBox w1 = this.VBox; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.table1 = new global::Gtk.Table (((uint)(2)), ((uint)(2)), false); this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); this.table1.BorderWidth = ((uint)(5)); // Container child table1.Gtk.Table+TableChild this.f_ChatTypeWidget = new global::Smuxi.Frontend.Gnome.ChatTypeWidget (); this.f_ChatTypeWidget.Events = ((global::Gdk.EventMask)(256)); this.f_ChatTypeWidget.Name = "f_ChatTypeWidget"; this.table1.Add (this.f_ChatTypeWidget); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.f_ChatTypeWidget])); w2.LeftAttach = ((uint)(1)); w2.RightAttach = ((uint)(2)); w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.f_NameEntry = new global::Gtk.Entry (); this.f_NameEntry.CanFocus = true; this.f_NameEntry.Name = "f_NameEntry"; this.f_NameEntry.IsEditable = true; this.f_NameEntry.ActivatesDefault = true; this.f_NameEntry.InvisibleChar = '●'; this.table1.Add (this.f_NameEntry); global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.f_NameEntry])); w3.TopAttach = ((uint)(1)); w3.BottomAttach = ((uint)(2)); w3.LeftAttach = ((uint)(1)); w3.RightAttach = ((uint)(2)); w3.XOptions = ((global::Gtk.AttachOptions)(4)); w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label1 = new global::Gtk.Label (); this.label1.Name = "label1"; this.label1.Xalign = 0F; this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Type:"); this.label1.UseUnderline = true; this.table1.Add (this.label1); global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.label1])); w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label2 = new global::Gtk.Label (); this.label2.Name = "label2"; this.label2.Xalign = 0F; this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("_Name:"); this.label2.UseUnderline = true; this.table1.Add (this.label2); global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.label2])); w5.TopAttach = ((uint)(1)); w5.BottomAttach = ((uint)(2)); w5.XOptions = ((global::Gtk.AttachOptions)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); w1.Add (this.table1); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.table1])); w6.Position = 0; w6.Expand = false; w6.Fill = false; // Internal child Smuxi.Frontend.Gnome.OpenChatDialog.ActionArea global::Gtk.HButtonBox w7 = this.ActionArea; w7.Name = "dialog1_ActionArea"; w7.Spacing = 6; w7.BorderWidth = ((uint)(5)); w7.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.f_CancelButton = new global::Gtk.Button (); this.f_CancelButton.CanFocus = true; this.f_CancelButton.Name = "f_CancelButton"; this.f_CancelButton.UseStock = true; this.f_CancelButton.UseUnderline = true; this.f_CancelButton.Label = "gtk-cancel"; this.AddActionWidget (this.f_CancelButton, -6); global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.f_CancelButton])); w8.Expand = false; w8.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.f_OpenButton = new global::Gtk.Button (); this.f_OpenButton.Sensitive = false; this.f_OpenButton.CanDefault = true; this.f_OpenButton.CanFocus = true; this.f_OpenButton.Name = "f_OpenButton"; this.f_OpenButton.UseStock = true; this.f_OpenButton.UseUnderline = true; this.f_OpenButton.Label = "gtk-open"; this.AddActionWidget (this.f_OpenButton, -5); global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.f_OpenButton])); w9.Position = 1; w9.Expand = false; w9.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } this.DefaultWidth = 236; this.DefaultHeight = 153; this.f_OpenButton.HasDefault = true; this.Show (); } } } smuxi-0.11/src/Frontend-GNOME/gtk-gui/gui.stetic0000644000175000017500000100522412300201464022153 0ustar00meebeymeebey00000000000000 .. 2.12 Smuxi - Preferences Dialog 3 False 2 10 128 In False False 0 False False 0 False 5 5 4 2 5 5 True 1 2 False 0 True True False False False False True 2 3 1 2 False 0 True True False False False False True 1 2 1 2 False 0 True True False False False False False 3 4 1 2 False True True False True True False Nicknames: 0 False False False False 1 False False True True False True True False Username: 0 False False False False 1 False 1 2 False True True False True True False Realname: 0 False False False False 1 False 2 3 False True True False True True False 0 Encoding: 3 4 False 0 True True False False False False 0 False False On Connect Commands: 0 False False False False 1 False 0 False False False 350 100 In 152 168 Word 1 False 0 False On Startup Commands: 0 False False False False 1 False 0 False False False 350 100 In 152 168 Word 1 False 1 False 1 False C_onnection True Notebook tab 0 3 2 5 5 5 60 1 9999 10 10 1 1 True 200 1 2 1 2 False 0 True True False False False False 60 9999 10 10 1 1 True 200 2 3 1 2 False 0 True True False False False False Timestamp Format: 0 False False False False 1 False False True True False True True False Buffer Lines: 0 False False False False 1 False 1 2 False True True False True True False Engine Buffer Lines: 0 False False False False 1 False 2 3 False True True False True True False 60 HH:mm True 1 2 False 0 True True False False False False 0 False False False True False True 0 0 2 stock:gtk-cut Menu 0 True False False Strip Colors True 1 False False False 1 False False False True False True 0 0 2 stock:gtk-cut Menu 0 True False False Strip Formattings True 1 False False False 2 False False False False True False True 0 0 2 stock:gtk-cut Menu 0 True False False Strip UTF-8 True 1 False False False 3 False False False General tab 5 12 True Top True True False True TabPositionRadioButtonTop 6 stock:gtk-goto-top Menu 0 True False False Top 1 True False False 0 True False False Bottom True False True TabPositionRadioButtonTop 2 stock:gtk-goto-bottom Menu 0 True False False Bottom True 1 False False False 1 False False False Left True False True TabPositionRadioButtonTop 0 0 2 stock:gtk-goto-first Menu 0 True False False Left True 1 False False False 2 False False False Right True False True TabPositionRadioButtonTop 0 0 2 stock:gtk-goto-last Menu 0 True False False Right True 1 False False False 3 False False False None True True True TabPositionRadioButtonTop 4 False False False <b> Tabs Position </b> True label_item 0 False False 12 4 2 5 5 -1 1 2 1 2 False 0 True True False False False False -1 3 4 1 2 False 0 True True False False False False 0 No Activity False 0 True True False False False False 0 Activity 1 2 False 0 True True False False False False 0 Join/Part/Mode 2 3 False 0 True True False False False False 0 Highlight 3 4 False 0 True True False False False False -1 2 3 1 2 False 0 True True False False False False -1 1 2 False 0 True True False False False False <b> Tab Colors </b> True label_item 1 False False 1 Tabs tab 12 5 3 2 5 5 5 30 / True 1 1 2 1 2 False 0 True True False False False False 60 1 9999 10 10 1 1 True 30 2 3 1 2 False 0 True True False False False False 30 : True 1 1 2 False 0 True True False False False False Completion Character: 0 False False False False 1 False False True True False True True False Command Character: 0 False False False False 1 False 1 2 False True True False True True False Command History Size: 0 False False False False 1 False 2 3 False True True False True True False 0 False False False Bash-Style Completion True True True 1 False False False <b> Entry Field </b> True label_item 2 Input tab 12 5 5 Nick Colors True True True 0 False False 12 Top True True False True TopicPositionRadioButtonTop 0 0 2 stock:gtk-goto-top Menu 0 True False False Top True 1 False False False 0 False False False Bottom True False True TopicPositionRadioButtonTop 0 0 2 stock:gtk-goto-bottom Menu 0 True False False Bottom True 1 False False False 1 False False False None True True True TopicPositionRadioButtonTop 2 False False False <b> Topic Position </b> True label_item 1 False False 152 96 12 Left True True False True UserListPositionRadioButtonLeft 0 0 2 stock:gtk-goto-first Menu 0 True False False Left True 1 False False False 0 False False False Right True False True UserListPositionRadioButtonLeft 0 0 2 stock:gtk-goto-last Menu 0 True False False Right True 1 False False False 1 False False False None True True True UserListPositionRadioButtonLeft 2 False False False <b> User List Position </b> True label_item 2 False False <b> Channel </b> True label_item 0 False False 12 5 0 Highlight words: 0 False False False In False 1 False 0 False Beep on highlight True True True 1 False False False <b> Highlighting </b> True label_item 1 False 3 Output tab 1 _Interface True Notebook tab 5 In 0 False 5 3 Start True StockItem gtk-add gtk-add False False True StockItem gtk-edit gtk-edit 1 False False True StockItem gtk-remove gtk-remove 2 False False 1 False False 2 _Servers True Notebook tab 5 12 In 0 False 2 Spread False True StockItem gtk-add gtk-add False False False True StockItem gtk-remove gtk-remove 1 False False 1 False False <b>Channel Filters</b> True label_item 0 False False 12 <b>User Filters</b> True label_item 1 False 3 _Filters True Notebook tab 1 False 0 False 6 5 3 End True StockItem gtk-cancel -6 gtk-cancel False False False True StockItem gtk-apply -10 gtk-apply 1 False False True StockItem gtk-ok -5 gtk-ok 2 False False Smuxi - Connect Dialog 5 640 480 2 False 5 2 6 In True True 0 True ButtonPressMask 1 True False False 0 False 6 5 2 End True StockItem gtk-cancel -6 gtk-cancel False False True StockItem gtk-connect -5 gtk-connect 1 False False Smuxi - Find Group Chat stock:gtk-find Menu CenterOnParent 640 480 2 False 2 6 6 6 _Name: True f_NameEntry 0 True False False True True True 1 True 0 True True True StockItem gtk-find gtk-find 1 True False False 0 True False False In True True 1 True 0 True 6 5 2 End True True True StockItem gtk-cancel -6 gtk-cancel False False True True True StockItem gtk-ok -5 gtk-ok 1 False False Find CenterOnParent False False 2 False 2 6 10 6 _Search for: True f_SearchForEntry 0 True False False True True 1 True 0 True False False 6 True _Match Case True True True 0 True False False True Search _Backwards True True True 1 True False False True _Wrap Around True True True True 2 True False False True Use _Regular Expressions True True True End 3 True False False 1 True False False 0 True False False 6 5 2 End True True True StockItem gtk-close -7 gtk-close False False True True True StockItem gtk-find 0 gtk-find 1 False False Smuxi - Open Chat CenterOnParent False False 2 False 2 2 2 6 6 5 ButtonPressMask 1 2 True Fill Fill False True False False True False True True True 1 2 1 2 True Fill Fill False True False False True False 0 _Type: True True Fill Fill False True False False True False 0 _Name: True 1 2 True Fill Fill False True False False True False 0 True False False 6 5 2 End True True StockItem gtk-cancel -6 gtk-cancel False False False True True True True StockItem gtk-open -5 gtk-open 1 False False False True False 0 Welcome to the Smuxi Engine Configuration Assistant. You need to enter some information before you can use the engine. Click "Forward" to begin. False 10 5 6 0 _Engine Name: True f_EngineNameEntry 0 True False False True True 1 True False False 50 0 <span size="small">Profile name of the new engine</span> True 2 True False False 0 True False False 6 5 0 _Default Engine: True f_MakeDefaultEngineCheckButton 0 True False False True Use as new default engine True True True 1 True False False 50 0 <span size="small">If enabled, the current engine will be the default next time Smuxi is started</span> True True 2 True False False 1 True False False False 10 5 6 True Use _SSH Tunnel True True True True 0 True False False 50 0 <span size="small">Enables the use of SSH for the connection. This has a small performance impact, but is more secure and required when using NAT or port-based firewalls</span> True True 1 True False False 0 True False False 4 4 5 6 False True localhost True 2 3 1 2 True Fill Fill False True False False True False True 1 65535 1 1 1 True 7689 2 3 3 4 True Fill Fill False True False False True False True True 1 2 False Fill True True False False True False True 1 65535 1 1 1 True 22 3 4 True Fill Fill False True False False True False 0 SSH _Host: True f_SshHostEntry True Fill Fill False True False False True False 50 0 <span size="small">DNS or IP address and port of the SSH server</span> True 1 2 4 True Fill Fill False True False False True False 0 _Port: True f_PortSpinButton 2 3 2 3 True Fill Fill False True False False True False 0 _Port: True f_SshPortSpinButton 2 3 True Fill Fill False True False False True False 50 0 <span size="small">DNS or IP address and port of the Smuxi server</span> True 3 4 4 True Fill Fill False True False False True False 0 _Smuxi Host: True f_HostEntry 2 3 True Fill Fill False True False False True False 1 True False False False 10 5 6 0 _SSH Username: (optional) True f_SshUsernameEntry 0 True False False True True 1 True False False 50 0 <span size="small">Username which will be used to log into the SSH server</span> True 2 True False False 0 True False False 6 0 _SSH Password: (optional) True f_SshUsernameEntry 0 True False False True True False 1 True False False 50 0 <span size="small">Password which will be used to log into the SSH server. The password is optional if SSH key authorization is used (see below).</span> True True 2 True False False 1 True False False 6 0 _SSH Keyfile: (optional) True f_SshKeyfileChooserButton 0 True False False True 1 True False False 50 0 <span size="small">SSH private keyfile which will be used to log into the SSH server</span> True 2 True False False 2 True False False 6 0 _Username: True f_UsernameEntry 0 True False False True True 1 True False False 50 0 <span size="small">Username which will be used to log into the Smuxi server</span> True 2 True False False 3 True False False 6 0 _Password: True f_PasswordEntry 0 True False False True True False 1 True False False 50 0 <span size="small">Password of the user</span> True 2 True False False 4 True False False 6 0 _Verify Password: True f_VerifyPasswordEntry 0 True False False True True False 1 True False False 50 0 <span size="small">Repeat the password for verification</span> True 2 True False False 5 True False False Smuxi - Server CenterOnParent 2 False 2 ButtonPressMask 0 False 5 10 5 2 End True True True StockItem gtk-cancel -6 gtk-cancel False False True True True StockItem gtk-ok -5 gtk-ok 1 False False False 5 7 2 5 5 0 _Hostname: True f_HostnameEntry 1 2 False True True False True True False True 2 3 1 2 True Fill Fill False True False False True False 0 _Network: True f_NetworkComboBoxEntry 2 3 True Fill Fill False True False False True False True True 3 4 1 2 True Fill Fill False True False False True False 0 Nickname: f_NicknameEntry 3 4 True Fill Fill False True False False True False 0 _Password: True f_PasswordEntry 6 7 False True True False True True False False 1 2 False True True False True True False True True 4 5 1 2 True Fill Fill False True False False True False 0 Realname: f_RealnameEntry 4 5 True Fill Fill False True False False True False True 5 6 1 2 False True True False True True False True 0 False 5 _Port: True f_PortSpinButton 0 False 65535 10 10 1 1 True 1 False 1 False 1 2 1 2 False True True False True True False 6 True False 0 True True Show Password True True True 1 True 6 7 1 2 True Fill Fill False True False False True False 0 _Username: True f_UsernameEntry 5 6 False True True False True True False 0 _Protocol: True f_ProtocolComboBox False True True False True True False 0 False False True Automatically connect to server at startup True True True 0 1 True False False True Use Encryption True True True 2 True False False True Validate Server Certificate True True True 3 True False False 5 6 0 _On Connect Commands: True f_OnConnectCommandsTextView 0 True False False True _Ignore Commands True True True 1 True 0 True False False 350 100 In 152 168 Word 1 True 4 True False 5 In True True 0 True 5 2 Start True True StockItem gtk-add gtk-add False False True True StockItem gtk-remove gtk-remove 1 False False 1 True False False 6 True True 0 True @ 1 True False False True 2 True False False True TextAndIcon stock:gtk-go-forward Menu Join True 3 True False False Action _Smuxi _Smuxi Action _Server _Server Action _Chat _Chat Action _Engine _Engine Action _View _View Action _Help _Help Action True Connect Connect gtk-network Action True Open Log Open Log gtk-open Action True gtk-fullscreen Action True gtk-preferences Action _Preferences _Preferences gtk-preferences Action <Control>q _Quit _Quit Action _Connect _Connect gtk-network Action _Add _Add gtk-add Action _Manage _Manage gtk-edit Action <Control>l _Open / Join Chat _Open / Join Chat Action _Find Group Chat _Find Group Chat Action C_lear All Activity C_lear All Activity gtk-clear Action <Control>Page_Down _Next Chat _Next Chat gtk-go-forward Action <Control>Page_Up _Previous Chat _Previous Chat gtk-go-back Action <Control>w _Close _Close Action _Use Local Engine _Use Local Engine Action _Add Remote Engine _Add Remote Engine Action Switch Remote Engine Switch Remote Engine Toggle F7 _Caret Mode _Caret Mode False False Toggle F8 _Browse Mode _Browse Mode False False Toggle Show _Menubar Show _Menubar False False Toggle Show _Statusbar Show _Statusbar False False Action F11 _Fullscreen _Fullscreen gtk-fullscreen Action _About _About gtk-about Action Open Log Open Log Action True Find Group Chat Find Group Chat Action _Website _Website Toggle Show _Toolbar Show _Toolbar False False False 0 True False False False BothHoriz LargeToolbar 0 True False End 1 False False 1 True False False smuxi-0.11/src/Frontend-GNOME/gtk-gui/generated.cs0000644000175000017500000000631512132611314022442 0ustar00meebeymeebey00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Stetic { internal class Gui { private static bool initialized; internal static void Initialize (Gtk.Widget iconRenderer) { if ((Stetic.Gui.initialized == false)) { Stetic.Gui.initialized = true; } } } internal class IconLoader { public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size) { Gdk.Pixbuf res = widget.RenderIcon (name, size, null); if ((res != null)) { return res; } else { int sz; int sy; global::Gtk.Icon.SizeLookup (size, out sz, out sy); try { return Gtk.IconTheme.Default.LoadIcon (name, sz, 0); } catch (System.Exception) { if ((name != "gtk-missing-image")) { return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size); } else { Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz); Gdk.GC gc = new Gdk.GC (pmap); gc.RgbFgColor = new Gdk.Color (255, 255, 255); pmap.DrawRectangle (gc, true, 0, 0, sz, sz); gc.RgbFgColor = new Gdk.Color (0, 0, 0); pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1)); gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); gc.RgbFgColor = new Gdk.Color (255, 0, 0); pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4))); pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4))); return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); } } } } } internal class BinContainer { private Gtk.Widget child; private Gtk.UIManager uimanager; public static BinContainer Attach (Gtk.Bin bin) { BinContainer bc = new BinContainer (); bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); bin.Added += new Gtk.AddedHandler (bc.OnAdded); return bc; } private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) { if ((this.child != null)) { args.Requisition = this.child.SizeRequest (); } } private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) { if ((this.child != null)) { this.child.Allocation = args.Allocation; } } private void OnAdded (object sender, Gtk.AddedArgs args) { this.child = args.Widget; } public void SetUiManager (Gtk.UIManager uim) { this.uimanager = uim; this.child.Realized += new System.EventHandler (this.OnRealized); } private void OnRealized (object sender, System.EventArgs args) { if ((this.uimanager != null)) { Gtk.Widget w; w = this.child.Toplevel; if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) { ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup); this.uimanager = null; } } } } internal class ActionGroups { public static Gtk.ActionGroup GetActionGroup (System.Type type) { return Stetic.ActionGroups.GetActionGroup (type.FullName); } public static Gtk.ActionGroup GetActionGroup (string name) { return null; } } } smuxi-0.11/src/Frontend-GNOME/ChatFindDialog.cs0000644000175000017500000000244011655545675021761 0ustar00meebeymeebey00000000000000/* * $Id: AboutDialog.cs 415 2008-09-02 20:49:58Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/AboutDialog.cs $ * $Rev: 415 $ * $Author: meebey $ * $Date: 2008-09-02 22:49:58 +0200 (Tue, 02 Sep 2008) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.Frontend.Gnome { public partial class ChatFindDialog : Gtk.Dialog { public ChatFindDialog() { Build(); } } } smuxi-0.11/src/Frontend-GNOME/PangoTools.cs0000644000175000017500000001247512250426606021237 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010 David Paleino // Copyright (c) 2010 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; using System.Text; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public class PangoTools { public static string ToMarkup(MessageModel msg) { return ToMarkup(msg, null); } public static string ToMarkup(MessageModel msg, Gdk.Color? bgColor) { if (msg == null) { return String.Empty; } /* Pango Markup doesn't support hyperlinks: * (smuxi-frontend-gnome:9824): Gtk-WARNING **: Failed to set * text from markup due to error parsing markup: Unknown tag * 'a' on line 1 char 59 * * For this reason, for UrlMessagePartModels, we'll render them as * plaintext. * * Here we loop over the MessageModel to build up a proper Pango * Markup. * * The colour codes/values have been taken from BuildTagTable(), in * MessageTextView.cs. * * Documentation for Pango Markup is located at: * http://library.gnome.org/devel/pango/unstable/PangoMarkupFormat.html */ StringBuilder markup = new StringBuilder (); foreach (MessagePartModel msgPart in msg.MessageParts) { if (msgPart is UrlMessagePartModel) { UrlMessagePartModel url = (UrlMessagePartModel) msgPart; string str = GLib.Markup.EscapeText(url.Url); Gdk.Color gdkColor = Gdk.Color.Zero; Gdk.Color.Parse("darkblue", ref gdkColor); TextColor urlColor = ColorConverter.GetTextColor(gdkColor); if (bgColor != null) { // we have a bg color so lets try to get a url color // with a good contrast urlColor = TextColorTools.GetBestTextColor( urlColor, ColorConverter.GetTextColor(bgColor.Value) ); } str = String.Format("{1}", urlColor.HexCode, str); markup.Append(str); } else if (msgPart is TextMessagePartModel) { TextMessagePartModel text = (TextMessagePartModel) msgPart; List tags = new List(); string str = GLib.Markup.EscapeText(text.Text); if (text.ForegroundColor != TextColor.None) { TextColor fgColor; if (bgColor == null) { fgColor = text.ForegroundColor; } else { var bgTextColor = ColorConverter.GetTextColor( bgColor.Value ); fgColor = TextColorTools.GetBestTextColor( text.ForegroundColor, bgTextColor ); } tags.Add(String.Format("span color='#{0}'", fgColor.HexCode)); } if (text.Underline) { tags.Add("u"); } if (text.Bold) { tags.Add("b"); } if (text.Italic) { tags.Add("i"); } if (tags.Count > 0) { tags.Reverse(); foreach (string tag in tags) { string endTag; if (tag.Contains(" ")) { // tag contains attributes, only get tag name endTag = tag.Split(' ')[0]; } else { endTag = tag; } str = String.Format("<{0}>{1}", tag, str, endTag); } } markup.Append(str); } } return markup.ToString(); } } } smuxi-0.11/src/Frontend-GNOME/CrashDialog.cs0000644000175000017500000001357711700531605021331 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006, 2010 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Mono.Unix; using Smuxi.Common; namespace Smuxi.Frontend.Gnome { public class CrashDialog : Gtk.Dialog { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif string ReportSubject { get; set; } string ReportDescription { get; set; } public CrashDialog(Gtk.Window parent, Exception e) : base(null, parent, Gtk.DialogFlags.Modal) { SetDefaultSize(640, 480); Title = "Smuxi - " + _("Oops, I did it again..."); Gtk.HBox hbox = new Gtk.HBox(); Gtk.Image image = new Gtk.Image(Gtk.Stock.DialogError, Gtk.IconSize.Dialog); hbox.PackStart(image, false, false, 2); Gtk.VBox label_vbox = new Gtk.VBox(); Gtk.Label label1 = new Gtk.Label(); Gtk.Label label2 = new Gtk.Label(); label1.Markup = String.Format( "{0}", GLib.Markup.EscapeText( _("Smuxi crashed because an unhandled exception was thrown!") ) ); label2.Markup = GLib.Markup.EscapeText( _("Here is the stacktrace, please report this bug!") ); label_vbox.PackStart(label1, false, false, 0); label_vbox.PackStart(new Gtk.Fixed(), true, true, 0); label_vbox.PackStart(label2, false, false, 0); hbox.PackStart(label_vbox, true, true, 0); Gtk.VBox vbox = new Gtk.VBox(); vbox.PackStart(hbox, false, false, 2); Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow(); sw.ShadowType = Gtk.ShadowType.In; Gtk.TextView tv = new Gtk.TextView(); tv.Editable = false; tv.CursorVisible = false; sw.Add(tv); vbox.PackStart(sw, true, true, 2); // add to the dialog VBox.PackStart(vbox, true, true, 2); AddButton(_("_Report Bug"), -1); AddButton(Gtk.Stock.Quit, 0); string message = String.Empty; if (e.InnerException != null) { message = "Inner-Exception Type:\n"+e.InnerException.GetType()+"\n\n"+ "Inner-Exception Message:\n"+e.InnerException.Message+"\n\n"+ "Inner-Exception StackTrace:\n"+e.InnerException.StackTrace+"\n\n"; if (e.StackTrace != null && e.InnerException.StackTrace.Contains("System.Runtime.Remoting")) { message += "Inner-Exception.ToString():\n"+e.InnerException.ToString()+"\n\n"; } } message += "Exception Type:\n"+e.GetType()+"\n\n"+ "Exception Message:\n"+e.Message+"\n\n"+ "Exception StackTrace:\n"+e.StackTrace+"\n\n"; if (e.StackTrace != null && e.StackTrace.Contains("System.Runtime.Remoting")) { message += "Exception.ToString():\n"+e.ToString()+"\n\n"; } tv.Buffer.Text = message; ReportSubject = "Exception: " + HtmlEncodeLame(e.Message); ReportDescription = String.Format( "
    {0}
    ", HtmlEncodeLame("\n" + message) ); ShowAll(); } private string HtmlEncodeLame(string text) { if (text == null) { return String.Empty; } return text.Replace("&", "%26"). Replace(" ", "%20"). Replace("\n", "%0A"). Replace("<", "%3C"). Replace(">", "%3E"); } public static void Show(Gtk.Window parent, Exception ex) { CrashDialog cd = new CrashDialog(parent, ex); cd.Run(); cd.Destroy(); } public new int Run() { int res; do { res = base.Run(); if (res == -1) { try { System.Diagnostics.Process.Start( String.Format( "http://www.smuxi.org/issues/new" + "?issue[tracker_id]=1" + "&issue[subject]={0}" + "&issue[description]={1}", ReportSubject, ReportDescription ) ); } catch (Exception ex) { #if LOG4NET f_Logger.Error(ex); #endif } } } while (res == -1); return res; } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/StatusIconManager.cs0000644000175000017500000001735511700531610022532 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010-2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { #if GTK_SHARP_2_10 public class StatusIconManager { Gtk.StatusIcon f_StatusIcon; MainWindow f_MainWindow; ChatViewManager f_ChatViewManager; NotificationAreaIconMode f_NotificationAreaIconMode; public StatusIconManager(MainWindow mainWindow, ChatViewManager chatViewManager) { if (mainWindow == null) { throw new ArgumentNullException("mainWindow"); } if (chatViewManager == null) { throw new ArgumentNullException("chatViewManager"); } f_MainWindow = mainWindow; f_MainWindow.FocusInEvent += OnMainWindowFocusInEvent; f_MainWindow.Minimized += delegate { CheckMainWindowState(); }; f_MainWindow.Unminimized += delegate { CheckMainWindowState(); }; f_MainWindow.Hidden += delegate { CheckMainWindowState(); }; f_MainWindow.Shown += delegate { CheckMainWindowState(); }; f_ChatViewManager = chatViewManager; f_ChatViewManager.ChatAdded += OnChatViewManagerChatAdded; f_ChatViewManager.ChatRemoved += OnChatViewManagerChatRemoved; } public void ApplyConfig(UserConfig userConfig) { Trace.Call(userConfig); if (userConfig == null) { throw new ArgumentNullException("userConfig"); } string modeStr = (string) userConfig["Interface/Notification/NotificationAreaIconMode"]; f_NotificationAreaIconMode = (NotificationAreaIconMode) Enum.Parse( typeof(NotificationAreaIconMode), modeStr ); // initialize status icon for the first time if (f_NotificationAreaIconMode != NotificationAreaIconMode.Never && f_StatusIcon == null) { f_StatusIcon = new Gtk.StatusIcon(); if (Frontend.HasSystemIconTheme) { f_StatusIcon.IconName = Frontend.IconName; } else { f_StatusIcon.Pixbuf = Frontend.LoadIcon( Frontend.IconName, 256, "icon_256x256.png" ); } f_StatusIcon.Activate += OnStatusIconActivated; f_StatusIcon.PopupMenu += OnStatusIconPopupMenu; f_StatusIcon.Tooltip = "Smuxi"; } if (f_NotificationAreaIconMode == NotificationAreaIconMode.Never && !f_MainWindow.Visible) { // force window unhide as the user would not be able to bring // it back without a notification icon! f_MainWindow.Visible = true; } CheckMainWindowState(); } private void CheckMainWindowState() { Trace.Call(); if (f_StatusIcon == null) { return; } switch (f_NotificationAreaIconMode) { case NotificationAreaIconMode.Never: f_StatusIcon.Visible = false; break; case NotificationAreaIconMode.Always: f_StatusIcon.Visible = true; break; case NotificationAreaIconMode.Minimized: f_StatusIcon.Visible = f_MainWindow.IsMinimized; break; case NotificationAreaIconMode.Closed: f_StatusIcon.Visible = !f_MainWindow.Visible; break; } } private void OnStatusIconActivated(object sender, EventArgs e) { Trace.Call(sender, e); if (f_StatusIcon == null) { return; } try { if (f_StatusIcon.Blinking) { f_MainWindow.Present(); return; } // not everyone uses a window list applet thus we have to // restore from minimized state here, see: // http://projects.qnetp.net/issues/show/159 if (f_MainWindow.IsMinimized) { f_MainWindow.Present(); return; } f_MainWindow.Visible = !f_MainWindow.Visible; } catch (Exception ex) { Frontend.ShowException(ex); } } private void OnStatusIconPopupMenu(object sender, EventArgs e) { Trace.Call(sender, e); Gtk.Menu menu = new Gtk.Menu(); Gtk.ImageMenuItem preferencesItem = new Gtk.ImageMenuItem( Gtk.Stock.Preferences, null ); preferencesItem.Activated += delegate { try { PreferencesDialog dialog = new PreferencesDialog(f_MainWindow); dialog.CurrentPage = PreferencesDialog.Page.Interface; dialog.CurrentInterfacePage = PreferencesDialog.InterfacePage.Notification; } catch (Exception ex) { Frontend.ShowException(ex); } }; menu.Add(preferencesItem); menu.Add(new Gtk.SeparatorMenuItem()); Gtk.ImageMenuItem quitItem = new Gtk.ImageMenuItem( Gtk.Stock.Quit, null ); quitItem.Activated += delegate { try { Frontend.Quit(); } catch (Exception ex) { Frontend.ShowException(ex); } }; menu.Add(quitItem); menu.ShowAll(); menu.Popup(); } private void OnMainWindowFocusInEvent(object sender, EventArgs e) { Trace.Call(sender, e); if (f_StatusIcon == null) { return; } f_StatusIcon.Blinking = false; } protected void OnChatViewManagerChatAdded(object sender, ChatViewManagerChatAddedEventArgs e) { e.ChatView.MessageHighlighted += OnChatViewMessageHighlighted; } protected void OnChatViewManagerChatRemoved(object sender, ChatViewManagerChatRemovedEventArgs e) { e.ChatView.MessageHighlighted -= OnChatViewMessageHighlighted; } private void OnChatViewMessageHighlighted(object sender, ChatViewMessageHighlightedEventArgs e) { #if MSG_DEBUG Trace.Call(sender, e); #endif if (f_StatusIcon == null) { return; } if (!f_MainWindow.HasToplevelFocus) { f_StatusIcon.Blinking = true; } } } #endif } smuxi-0.11/src/Frontend-GNOME/NotifyManager.cs0000644000175000017500000004455512257043746021730 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010-2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if NOTIFY_SHARP using System; using System.IO; using System.Collections.Generic; using Notifications; using Gtk.Extensions; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public class NotifyManager { #if LOG4NET private static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static Gdk.Pixbuf PersonChatIconPixbuf { get; set; } private static string PersonChatIconName { get; set; } private static Gdk.Pixbuf GroupChatIconPixbuf { get; set; } private static string GroupChatIconName { get; set; } private static List Capabilites { get; set; } private static string SoundFile { get; set; } private static Version SpecificationVersion { get; set; } private static string ServerVendor { get; set; } private static string ServerName { get; set; } Dictionary Notifications { get; set; } MainWindow MainWindow { get; set; } ChatViewManager ChatViewManager { get; set; } Dictionary HighlightEventHandlers { get; set; } bool IsInitialized { get; set; } bool IsEnabled { get; set; } static NotifyManager() { // image size >= 128 pixels as per notify-osd guidelines: // https://wiki.ubuntu.com/NotificationDevelopmentGuidelines PersonChatIconPixbuf = Frontend.LoadIcon( "smuxi-person-chat", 256, "person-chat_256x256.png" ); GroupChatIconPixbuf = Frontend.LoadIcon( "smuxi-group-chat", 256, "group-chat_256x256.png" ); var partialPath = "share"; partialPath = Path.Combine(partialPath, "sounds"); partialPath = Path.Combine(partialPath, "freedesktop"); partialPath = Path.Combine(partialPath, "stereo"); partialPath = Path.Combine(partialPath, "message-new-instant.oga"); var soundFile = Path.Combine(Defines.InstallPrefix, partialPath); var sysSoundFile = Path.Combine("/usr", partialPath); if (File.Exists(soundFile)) { SoundFile = soundFile; } else if (File.Exists(sysSoundFile)) { // fallback to system-wide install SoundFile = sysSoundFile; } } public NotifyManager(MainWindow mainWindow, ChatViewManager chatViewManager) { Trace.Call(mainWindow, chatViewManager); if (mainWindow == null) { throw new ArgumentNullException("mainWindow"); } if (chatViewManager == null) { throw new ArgumentNullException("chatViewManager"); } MainWindow = mainWindow; ChatViewManager = chatViewManager; Notifications = new Dictionary(); HighlightEventHandlers = new Dictionary (); try { Init(); } catch (Exception ex) { #if LOG4NET Logger.Error("NotifyManager(): initialization failed: ", ex); #endif } } public void Dispose() { Trace.Call(); } public void ApplyConfig(UserConfig userConfig) { Trace.Call(userConfig); if (userConfig == null) { throw new ArgumentNullException("userConfig"); } if (!IsInitialized) { return; } IsEnabled = (bool) userConfig["Interface/Notification/PopupsEnabled"]; } void Init() { Trace.Call(); Capabilites = new List(Global.Capabilities); var version = Global.ServerInformation.SpecVersion; try { SpecificationVersion = new Version(version); } catch (Exception ex) { #if LOG4NET Logger.Error("Init(): couldn't parse specification version: " + "'" + version + "'", ex); #endif } ServerVendor = Global.ServerInformation.Vendor; ServerName = Global.ServerInformation.Name; #if LOG4NET Logger.Debug( String.Format( "Init(): Name: '{0}' Vendor: '{1}' Version: '{2}' " + "SpecVersion: '{3}' Capabilities: '{4}'", Global.ServerInformation.Name, Global.ServerInformation.Vendor, Global.ServerInformation.Version, Global.ServerInformation.SpecVersion, String.Join(", ", Global.Capabilities) ) ); #endif // HACK: a bug in notification-daemon-xfce skips the reason field // in NotificationClosed which leads to an exception: // System.IndexOutOfRangeException: Array index is out of range. // at NDesk.DBus.MessageReader.MarshalUInt (byte*) // see: http://bugzilla.xfce.org/show_bug.cgi?id=5339 if (Global.ServerInformation.Name == "Notification Daemon" && Global.ServerInformation.Vendor == "Galago Project") { #if LOG4NET Logger.Warn("Init(): detected buggy Xfce notification daemon, " + "suppressing notifications..."); #endif return; } MainWindow.FocusInEvent += OnMainWindowFocusInEvent; MainWindow.Notebook.SwitchPage += OnMainWindowNotebookSwitchPage; ChatViewManager.ChatAdded += OnChatViewManagerChatAdded; ChatViewManager.ChatRemoved += OnChatViewManagerChatRemoved; IsInitialized = true; } void OnChatViewManagerChatAdded(object sender, ChatViewManagerChatAddedEventArgs e) { // we are only interested in highlights on person and group chats if (!(e.ChatView is PersonChatView) && !(e.ChatView is GroupChatView)) { return; } MessageTextViewMessageHighlightedEventHandler handler = delegate(object o, MessageTextViewMessageHighlightedEventArgs args) { OnChatViewMessageHighlighted(o, args, e.ChatView); }; e.ChatView.OutputMessageTextView.MessageHighlighted += handler; // keep a reference to the handler so we can cleanup it up later // in OnChatViewManagerChatRemoved() HighlightEventHandlers.Add(e.ChatView, handler); } void OnChatViewManagerChatRemoved(object sender, ChatViewManagerChatRemovedEventArgs e) { MessageTextViewMessageHighlightedEventHandler handler; if (!HighlightEventHandlers.TryGetValue(e.ChatView, out handler)) { return; } e.ChatView.OutputMessageTextView.MessageHighlighted -= handler; HighlightEventHandlers.Remove(e.ChatView); } void OnChatViewMessageHighlighted(object sender, MessageTextViewMessageHighlightedEventArgs e, ChatView chatView) { #if MSG_DEBUG Trace.Call(sender, e, chatView); #endif if (!IsEnabled || e.Message.TimeStamp <= chatView.SyncedLastSeenHighlight || (MainWindow.HasToplevelFocus && (ChatViewManager.CurrentChatView == chatView || MainWindow.ChatTreeView.IsVisible(chatView)))) { // no need to show a notification for: // - disabled chats // - seen highlights // - main window has focus and the chat is active or the chat // row is visible return; } try { ShowNotification(chatView, e.Message); } catch (Exception ex) { #if LOG4NET Logger.Error("OnChatViewMessageHighlighted(): " + "ShowNotification() threw exception", ex); #endif } } void ShowNotification(ChatView chatView, MessageModel msg) { Notification notification; if (!Capabilites.Contains("append") && Notifications.TryGetValue(chatView, out notification)) { // no support for append, update the existing notification notification.Body = GLib.Markup.EscapeText( msg.ToString() ); return; } notification = new Notification() { Summary = chatView.Name, Category = "im.received" }; notification.AddHint("desktop-entry", "smuxi-frontend-gnome"); if (Capabilites.Contains("body")) { // notify-osd doesn't like unknown tags when appending notification.Body = GLib.Markup.EscapeText( msg.ToString() ); } if (Capabilites.Contains("icon-static")) { Gdk.Pixbuf iconData = null; string iconName = null; if (chatView is PersonChatView) { iconData = PersonChatIconPixbuf; iconName = "smuxi-person-chat"; } else if (chatView is GroupChatView) { iconData = GroupChatIconPixbuf; iconName = "smuxi-group-chat"; } var theme = Gtk.IconTheme.Default; #if DISABLED // OPT: use icon path/name if we can, so the image (26K) is not // send over D-Bus. Especially with the gnome-shell this is a // serious performance issue, see: // https://bugzilla.gnome.org/show_bug.cgi?id=683829 if (iconName != null && theme.HasIcon(iconName)) { // HACK: use icon path instead of name as gnome-shell does // not support icon names correctly, see: // https://bugzilla.gnome.org/show_bug.cgi?id=665957 var iconInfo = theme.LookupIcon(iconName, 256, Gtk.IconLookupFlags.UseBuiltin); if (!String.IsNullOrEmpty(iconInfo.Filename) && File.Exists(iconInfo.Filename) && ServerVendor == "GNOME" && (ServerName == "Notification Daemon" || ServerName == "gnome-shell")) { // HACK: notification-daemon 0.7.5 seems to ignore // the image_path hint for some reason, thus we have to // rely on app_icon instead, see: // https://bugzilla.gnome.org/show_bug.cgi?id=684653 // HACK: gnome-shell 3.4.2 shows no notification at all // with image_path and stops responding to further // notifications which freezes Smuxi completely! notification.IconName = "file://" + iconInfo.Filename; } else if (!String.IsNullOrEmpty(iconInfo.Filename) && File.Exists(iconInfo.Filename) && SpecificationVersion >= new Version("1.1")) { // starting with DNS >= 1.1 we can use the image-path // hint instead of icon_data or app_icon var hintName = "image_path"; if (SpecificationVersion >= new Version("1.2")) { hintName = "image-path"; } notification.AddHint(hintName, "file://" + iconInfo.Filename); } else { // fallback to icon_data as defined in DNS 0.9 notification.Icon = iconData; } #endif if (Frontend.HasSystemIconTheme && iconName != null && theme.HasIcon(iconName)) { notification.IconName = iconName; } else if (iconName != null && theme.HasIcon(iconName)) { // icon wasn't in the system icon theme var iconInfo = theme.LookupIcon(iconName, 256, Gtk.IconLookupFlags.UseBuiltin); if (!String.IsNullOrEmpty(iconInfo.Filename) && File.Exists(iconInfo.Filename)) { notification.IconName = "file://" + iconInfo.Filename; } } else if (iconData != null) { // fallback to icon_data as the icon is not available in // the theme notification.Icon = iconData; } else { // fallback for non-group/person messages notification.IconName = "notification-message-im"; } } else { // fallback to generic icon notification.IconName = "notification-message-im"; } if (Capabilites.Contains("actions")) { notification.AddAction("show", _("Show"), delegate { try { MainWindow.PresentWithServerTime(); ChatViewManager.CurrentChatView = chatView; notification.Close(); } catch (Exception ex) { #if LOG4NET Logger.Error("OnChatViewMessageHighlighted() " + "notification.Show threw exception", ex); #endif } }); } if (Capabilites.Contains("append")) { notification.AddHint("append", String.Empty); } if (Capabilites.Contains("sound")) { // DNS 0.9 only supports sound-file which is a file path // http://www.galago-project.org/specs/notification/0.9/x344.html // DNS 1.1 supports sound-name which is an id, see: // http://people.canonical.com/~agateau/notifications-1.1/spec/ar01s08.html // http://0pointer.de/public/sound-naming-spec.html // LAMESPEC: We can't tell which of those are actually // supported by this version as hint are totally optional :/ // HACK: always pass both hints when possible notification.AddHint("sound-name", "message-new-instant"); if (SoundFile != null) { notification.AddHint("sound-file", SoundFile); } } notification.Closed += delegate { try { #if LOG4NET Logger.Debug("OnChatViewMessageHighlighted(): received " + "notification.Closed signal for: " + chatView.Name); #endif Notifications.Remove(chatView); } catch (Exception ex) { #if LOG4NET Logger.Error("OnChatViewMessageHighlighted(): " + "Exception in notification.Closed handler", ex); #endif } }; notification.Show(); if (!Notifications.ContainsKey(chatView)) { Notifications.Add(chatView, notification); } } void OnMainWindowFocusInEvent(object sender, Gtk.FocusInEventArgs e) { Trace.Call(sender, e); if (MainWindow.Notebook.IsBrowseModeEnabled) { return; } var currentChatView = ChatViewManager.CurrentChatView; if (currentChatView == null) { return; } DisposeNotification(currentChatView); } void OnMainWindowNotebookSwitchPage(object sender, Gtk.SwitchPageArgs e) { Trace.Call(sender, e); if (MainWindow.Notebook.IsBrowseModeEnabled) { return; } var currentChatView = ChatViewManager.CurrentChatView; if (currentChatView == null) { return; } DisposeNotification(currentChatView); } void DisposeNotification(ChatView chatView) { Notification notification; if (!Notifications.TryGetValue(chatView, out notification)) { return; } #if LOG4NET Logger.Debug("DisposeNotification(): disposing notification for: " + chatView.Name); #endif try { // don't try to close already closed notifications (timeout) if (notification.Id == 0) { #if LOG4NET Logger.Debug("DisposeNotification(): notification already " + "closed for: " + chatView.Name); #endif return; } notification.Close(); } catch (Exception ex) { #if LOG4NET Logger.Error("DisposeNotification(): " + "notification.Close() thew exception", ex); #endif } finally { Notifications.Remove(chatView); } } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } #endif smuxi-0.11/src/Frontend-GNOME/Makefile.in0000644000175000017500000014562512311344230020662 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/smuxi-frontend-gnome.in \ ChangeLog @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@am__append_1 = $(MESSAGINGMENU_SHARP_INCLUDED_LIBS) \ @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@ $(MESSAGINGMENU_SHARP_INCLUDED_LIBS).config \ @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@ $(GIO_SHARP_DLL) \ @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@ $(GIO_SHARP_DLL_CONFIG) subdir = src/Frontend-GNOME ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = smuxi-frontend-gnome CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(desktopdir)" \ "$(DESTDIR)$(icon128dir)" "$(DESTDIR)$(icon16dir)" \ "$(DESTDIR)$(icon22dir)" "$(DESTDIR)$(icon24dir)" \ "$(DESTDIR)$(icon256dir)" "$(DESTDIR)$(icon32dir)" \ "$(DESTDIR)$(icon48dir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" "$(DESTDIR)$(svgicondir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DATA = $(desktop_DATA) $(icon128_DATA) $(icon16_DATA) $(icon22_DATA) \ $(icon24_DATA) $(icon256_DATA) $(icon32_DATA) $(icon48_DATA) \ $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) $(programfilesicons_DATA) $(svgicon_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ TARGET_DIR = $(top_builddir)/bin/$(PROFILE) EXTRA_DIST = $(WIN_ICON) $(DESKTOP_FILE).in $(man_MANS) \ $(build_sources) $(build_resx_files) $(build_others_files) \ $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) $(DATA_FILES) \ $(build_culture_res_files) man_MANS = smuxi-frontend-gnome.1 ICON_NAME = smuxi-frontend-gnome ICON_NAME_PNG = $(ICON_NAME).png ICON_SVG = $(ICON_NAME).svg GROUP_CHAT_ICON_NAME = smuxi-group-chat PERSON_CHAT_ICON_NAME = smuxi-person-chat ICON_16 = $(top_builddir)/images/16/$(ICON_NAME_PNG) ICON_22 = $(top_builddir)/images/22/$(ICON_NAME_PNG) ICON_24 = $(top_builddir)/images/24/$(ICON_NAME_PNG) ICON_32 = $(top_builddir)/images/32/$(ICON_NAME_PNG) ICON_48 = $(top_builddir)/images/48/$(ICON_NAME_PNG) ICON_128 = $(top_builddir)/images/128/$(ICON_NAME_PNG) ICON_256 = $(top_builddir)/images/256/$(ICON_NAME_PNG) WIN_ICON = $(top_srcdir)/images/icon.ico DESKTOP_FILE = smuxi-frontend-gnome.desktop THEME_DIR = $(datadir)/icons/hicolor svgicondir = $(THEME_DIR)/scalable/apps svgicon_DATA = $(ICON_SVG) icon16dir = $(THEME_DIR)/16x16/apps icon16_DATA = $(ICON_16) icon22dir = $(THEME_DIR)/22x22/apps icon22_DATA = $(ICON_22) icon24dir = $(THEME_DIR)/24x24/apps icon24_DATA = $(ICON_24) icon32dir = $(THEME_DIR)/32x32/apps icon32_DATA = $(ICON_32) icon48dir = $(THEME_DIR)/48x48/apps icon48_DATA = $(ICON_48) icon128dir = $(THEME_DIR)/128x128/apps icon128_DATA = $(ICON_128) icon256dir = $(THEME_DIR)/256x256/apps icon256_DATA = \ $(ICON_256) \ $(top_builddir)/images/256/$(GROUP_CHAT_ICON_NAME).png \ $(top_builddir)/images/256/$(PERSON_CHAT_ICON_NAME).png gtk_update_icon_cache = gtk-update-icon-cache -f -t $(THEME_DIR) desktopdir = $(datadir)/applications desktop_in_files = $(DESKTOP_FILE).in desktop_DATA = $(DESKTOP_FILE) build_datafiles = $(DESKTOP_FILE) FRONTEND_GNOME_EXE_CONFIG_SOURCE = smuxi-frontend-gnome.exe.config FRONTEND_GNOME_EXE_CONFIG = $(BUILD_DIR)/smuxi-frontend-gnome.exe.config ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = @CSC_FLAGS@ -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET,CONFIG_NINI,UI_GNOME,GTK_SHARP_2_8" -win32icon:$(WIN_ICON) @FRONTEND_GNOME_COMPILER_FLAGS@ ASSEMBLY = ../../bin/debug/smuxi-frontend-gnome.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = winexe PROJECT_REFERENCES = \ ../../bin/debug/smuxi-engine.dll \ ../../bin/debug/smuxi-common.dll \ ../../bin/debug/smuxi-frontend.dll BUILD_DIR = ../../bin/debug LOG4NET_DLL_SOURCE = ../../lib/log4net.dll SMUXI_ENGINE_DLL_MDB_SOURCE = ../../bin/debug/smuxi-engine.dll.mdb SMUXI_ENGINE_DLL_MDB = $(BUILD_DIR)/smuxi-engine.dll.mdb NINI_DLL_SOURCE = ../../lib/Nini.dll SMUXI_ENGINE_DLL_SOURCE = ../../bin/debug/smuxi-engine.dll SMUXI_FRONTEND_DLL_MDB_SOURCE = ../../bin/debug/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_MDB = $(BUILD_DIR)/smuxi-frontend.dll.mdb SMUXI_FRONTEND_DLL_SOURCE = ../../bin/debug/smuxi-frontend.dll SMUXI_COMMON_DLL_SOURCE = ../../bin/debug/smuxi-common.dll AL = al2 SATELLITE_ASSEMBLY_NAME = .resources.dll PROGRAMFILES = $(SMUXI_ENGINE_DLL_MDB) $(SMUXI_ENGINE_DLL) \ $(SMUXI_FRONTEND_DLL_MDB) $(SMUXI_FRONTEND_DLL) \ $(SMUXI_COMMON_DLL) $(FRONTEND_GNOME_EXE_CONFIG) \ $(am__append_1) LINUX_DESKTOPAPPLICATIONS = \ $(FRONTEND_GNOME_DESKTOP_DESKTOP) BINARIES = \ $(FRONTEND_GNOME) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ AboutDialog.cs \ CrashDialog.cs \ EngineManagerDialog.cs \ Entry.cs \ Frontend.cs \ GnomeUI.cs \ Gtk.WindowExtensions.cs \ IndicateManager.cs \ Main.cs \ MainWindow.cs \ NetworkManager.cs \ NotImplementedMessageDialog.cs \ Notebook.cs \ SplashScreenWindow.cs \ ChatTypeWidget.cs \ ChatViewManager.cs \ ColorConverter.cs \ NotifyManager.cs \ PangoTools.cs \ Preferences/ServerListView.cs \ Preferences/PreferencesDialog.cs \ Views/ChatTreeView.cs \ Views/JoinWidget.cs \ Views/MenuWidget.cs \ Views/MessageTextView.cs \ Views/ServerWidget.cs \ Views/ServerDialog.cs \ Views/FilterListWidget.cs \ Views/Chats/ChatView.cs \ Views/Chats/GroupChatView.cs \ Views/Chats/PersonChatView.cs \ Views/Chats/ProtocolChatView.cs \ Views/Chats/SessionChatView.cs \ Views/Assistants/Engine/EngineAssistantNameWidget.cs \ Views/Assistants/Engine/EngineAssistantCredentialsWidget.cs \ Views/Assistants/Engine/EngineAssistantConnectionWidget.cs \ Views/Assistants/Engine/EngineAssistantIntroWidget.cs \ Views/Assistants/Engine/EngineAssistant.cs \ Views/Tags/LinkTag.cs \ Views/Tags/PersonTag.cs \ QuickConnectDialog.cs \ SteticPreferencesDialog.cs \ FindGroupChatDialog.cs \ ChatFindDialog.cs \ OpenChatDialog.cs \ ThemeSettings.cs \ StatusIconManager.cs \ gtk-gui/generated.cs \ gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantConnectionWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantCredentialsWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantIntroWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.EngineAssistantNameWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.JoinWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.MenuWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.OpenChatDialog.cs \ gtk-gui/Smuxi.Frontend.Gnome.SteticPreferencesDialog.cs \ gtk-gui/Smuxi.Frontend.Gnome.QuickConnectDialog.cs \ gtk-gui/Smuxi.Frontend.Gnome.FindGroupChatDialog.cs \ gtk-gui/Smuxi.Frontend.Gnome.ChatFindDialog.cs \ gtk-gui/Smuxi.Frontend.Gnome.ChatTypeWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.ServerDialog.cs \ gtk-gui/Smuxi.Frontend.Gnome.ServerWidget.cs \ gtk-gui/Smuxi.Frontend.Gnome.FilterListWidget.cs \ osx/AppleEvent.cs \ osx/ApplicationEvents.cs \ osx/Carbon.cs \ osx/CoreFoundation.cs \ osx/IgeMacMenu.cs DATA_FILES = \ $(DESKTOP_FILE) \ $(ICON_SVG) \ $(ICON_16) \ $(ICON_22) \ $(ICON_24) \ $(ICON_32) \ $(ICON_48) \ $(ICON_128) \ $(ICON_256) RESOURCES = \ gtk-gui/gui.stetic \ $(top_srcdir)/glade/smuxi-frontend-gnome.glade \ $(top_srcdir)/images/icon_256x256.png \ $(top_srcdir)/images/group-chat_256x256.png \ $(top_srcdir)/images/person-chat_256x256.png \ $(top_srcdir)/images/protocol-chat_256x256.png \ $(top_srcdir)/images/session-chat_256x256.png EXTRAS = \ smuxi-frontend-gnome.in \ $(FRONTEND_GNOME_EXE_CONFIG_SOURCE) REFERENCES = \ System.Runtime.Remoting \ System \ System.Core \ System.Web \ Mono.Posix \ $(GLIB_SHARP_20_LIBS) \ $(GLADE_SHARP_20_LIBS) \ $(GTK_SHARP_20_LIBS) \ $(GIO_SHARP_LIBS) \ $(LOG4NET_LIBS) \ $(INDICATE_SHARP_LIBS) \ $(MESSAGINGMENU_SHARP_LIBS) \ $(MESSAGINGMENU_SHARP_INCLUDED_LIBS) \ $(NOTIFY_SHARP_LIBS) \ $(DBUS_LIBS) DLL_REFERENCES = $(MESSAGINGMENU_SHARP_INCLUDED_LIBS) CLEANFILES = $(LINUX_DESKTOPAPPLICATIONS) $(PROGRAMFILES) $(BINARIES) \ $(top_builddir)/images/256/$(GROUP_CHAT_ICON_NAME).png \ $(top_builddir)/images/256/$(PERSON_CHAT_ICON_NAME).png \ $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) \ $(build_resx_resources) $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) SMUXI_ENGINE_DLL = $(BUILD_DIR)/smuxi-engine.dll FRONTEND_GNOME = $(BUILD_DIR)/smuxi-frontend-gnome FRONTEND_GNOME_DESKTOP = $(BUILD_DIR)/$(DESKTOP_FILE) SMUXI_FRONTEND_DLL = $(BUILD_DIR)/smuxi-frontend.dll SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@MESSAGINGMENU_SHARP_DLL = $(TARGET_DIR)/messagingmenu-sharp.dll @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@MESSAGINGMENU_SHARP_DLL_SOURCE = $(top_builddir)/lib/messagingmenu-sharp/messagingmenu-sharp.dll @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@MESSAGINGMENU_SHARP_DLL_CONFIG = $(MESSAGINGMENU_SHARP_DLL).config @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@MESSAGINGMENU_SHARP_DLL_CONFIG_SOURCE = $(MESSAGINGMENU_SHARP_DLL_SOURCE).config @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@MESSAGINGMENU_SHARP_INCLUDED_LIBS := $(foreach file, $(MESSAGINGMENU_SHARP_FILES), $(TARGET_DIR)/$(file)) @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@GIO_SHARP_DLL = $(TARGET_DIR)/gio-sharp.dll @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@GIO_SHARP_DLL_SOURCE = $(GIO_SHARP_LIBS) @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@GIO_SHARP_DLL_CONFIG = $(TARGET_DIR)/gio-sharp.dll.config @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@GIO_SHARP_DLL_CONFIG_SOURCE = $(GIO_SHARP_LIBS).config @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@GIO_SHARP_PROGRAM_FILES := $(foreach file, $(GIO_SHARP_FILES), $(shell file=$(TARGET_DIR)/$(file); echo $$file; config_file=$${file}.config; if [ -f "$$config_file" ]; then echo $$config_file; fi)) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Frontend-GNOME/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Frontend-GNOME/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): smuxi-frontend-gnome: $(top_builddir)/config.status $(srcdir)/smuxi-frontend-gnome.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-desktopDATA: $(desktop_DATA) @$(NORMAL_INSTALL) @list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(desktopdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(desktopdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(desktopdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(desktopdir)" || exit $$?; \ done uninstall-desktopDATA: @$(NORMAL_UNINSTALL) @list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(desktopdir)'; $(am__uninstall_files_from_dir) install-icon128DATA: $(icon128_DATA) @$(NORMAL_INSTALL) @list='$(icon128_DATA)'; test -n "$(icon128dir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(icon128dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(icon128dir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icon128dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(icon128dir)" || exit $$?; \ done uninstall-icon128DATA: @$(NORMAL_UNINSTALL) @list='$(icon128_DATA)'; test -n "$(icon128dir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(icon128dir)'; $(am__uninstall_files_from_dir) install-icon16DATA: $(icon16_DATA) @$(NORMAL_INSTALL) @list='$(icon16_DATA)'; test -n "$(icon16dir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(icon16dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(icon16dir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icon16dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(icon16dir)" || exit $$?; \ done uninstall-icon16DATA: @$(NORMAL_UNINSTALL) @list='$(icon16_DATA)'; test -n "$(icon16dir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(icon16dir)'; $(am__uninstall_files_from_dir) install-icon22DATA: $(icon22_DATA) @$(NORMAL_INSTALL) @list='$(icon22_DATA)'; test -n "$(icon22dir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(icon22dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(icon22dir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icon22dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(icon22dir)" || exit $$?; \ done uninstall-icon22DATA: @$(NORMAL_UNINSTALL) @list='$(icon22_DATA)'; test -n "$(icon22dir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(icon22dir)'; $(am__uninstall_files_from_dir) install-icon24DATA: $(icon24_DATA) @$(NORMAL_INSTALL) @list='$(icon24_DATA)'; test -n "$(icon24dir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(icon24dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(icon24dir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icon24dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(icon24dir)" || exit $$?; \ done uninstall-icon24DATA: @$(NORMAL_UNINSTALL) @list='$(icon24_DATA)'; test -n "$(icon24dir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(icon24dir)'; $(am__uninstall_files_from_dir) install-icon256DATA: $(icon256_DATA) @$(NORMAL_INSTALL) @list='$(icon256_DATA)'; test -n "$(icon256dir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(icon256dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(icon256dir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icon256dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(icon256dir)" || exit $$?; \ done uninstall-icon256DATA: @$(NORMAL_UNINSTALL) @list='$(icon256_DATA)'; test -n "$(icon256dir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(icon256dir)'; $(am__uninstall_files_from_dir) install-icon32DATA: $(icon32_DATA) @$(NORMAL_INSTALL) @list='$(icon32_DATA)'; test -n "$(icon32dir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(icon32dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(icon32dir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icon32dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(icon32dir)" || exit $$?; \ done uninstall-icon32DATA: @$(NORMAL_UNINSTALL) @list='$(icon32_DATA)'; test -n "$(icon32dir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(icon32dir)'; $(am__uninstall_files_from_dir) install-icon48DATA: $(icon48_DATA) @$(NORMAL_INSTALL) @list='$(icon48_DATA)'; test -n "$(icon48dir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(icon48dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(icon48dir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icon48dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(icon48dir)" || exit $$?; \ done uninstall-icon48DATA: @$(NORMAL_UNINSTALL) @list='$(icon48_DATA)'; test -n "$(icon48dir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(icon48dir)'; $(am__uninstall_files_from_dir) install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) install-svgiconDATA: $(svgicon_DATA) @$(NORMAL_INSTALL) @list='$(svgicon_DATA)'; test -n "$(svgicondir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(svgicondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(svgicondir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(svgicondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(svgicondir)" || exit $$?; \ done uninstall-svgiconDATA: @$(NORMAL_UNINSTALL) @list='$(svgicon_DATA)'; test -n "$(svgicondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(svgicondir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(icon128dir)" "$(DESTDIR)$(icon16dir)" "$(DESTDIR)$(icon22dir)" "$(DESTDIR)$(icon24dir)" "$(DESTDIR)$(icon256dir)" "$(DESTDIR)$(icon32dir)" "$(DESTDIR)$(icon48dir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)" "$(DESTDIR)$(svgicondir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-desktopDATA install-icon128DATA \ install-icon16DATA install-icon22DATA install-icon24DATA \ install-icon256DATA install-icon32DATA install-icon48DATA \ install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA \ install-svgiconDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-desktopDATA \ uninstall-icon128DATA uninstall-icon16DATA \ uninstall-icon22DATA uninstall-icon24DATA \ uninstall-icon256DATA uninstall-icon32DATA \ uninstall-icon48DATA uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-man \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA uninstall-svgiconDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-data-hook install-desktopDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-icon128DATA \ install-icon16DATA install-icon22DATA install-icon24DATA \ install-icon256DATA install-icon32DATA install-icon48DATA \ install-info install-info-am \ install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-man1 \ install-pdf install-pdf-am install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA \ install-ps install-ps-am install-strip install-svgiconDATA \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-binSCRIPTS uninstall-desktopDATA \ uninstall-hook uninstall-icon128DATA uninstall-icon16DATA \ uninstall-icon22DATA uninstall-icon24DATA \ uninstall-icon256DATA uninstall-icon32DATA \ uninstall-icon48DATA uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-man uninstall-man1 \ uninstall-pkgappSCRIPTS uninstall-programfilesDATA \ uninstall-programfilesiconsDATA uninstall-svgiconDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_DESKTOPAPPLICATIONS) $(BINARIES) $(ICON_SVG): $(INSTALL) -m644 $(top_srcdir)/images/icon.svg $@ $(ICON_16): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_16x16.png $@ $(ICON_22): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_22x22.png $@ $(ICON_24): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_24x24.png $@ $(ICON_32): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_32x32.png $@ $(ICON_48): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_48x48.png $@ $(ICON_128): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_128x128.png $@ $(ICON_256): $(INSTALL) -D -m644 $(top_srcdir)/images/icon_256x256.png $@ $(top_builddir)/images/256/$(GROUP_CHAT_ICON_NAME).png: $(INSTALL) -D -m644 $(top_srcdir)/images/group-chat_256x256.png $@ $(top_builddir)/images/256/$(PERSON_CHAT_ICON_NAME).png: $(INSTALL) -D -m644 $(top_srcdir)/images/person-chat_256x256.png $@ # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@$(eval $(call emit-deploy-target,MESSAGINGMENU_SHARP_DLL)) @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@$(eval $(call emit-deploy-target,MESSAGINGMENU_SHARP_DLL_CONFIG)) @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@$(eval $(call emit-deploy-target,GIO_SHARP_DLL)) @WITH_MESSAGINGMENU_SHARP_INCLUDED_TRUE@$(eval $(call emit-deploy-target,GIO_SHARP_DLL_CONFIG)) $(eval $(call emit-deploy-wrapper,FRONTEND_GNOME,smuxi-frontend-gnome,x)) $(eval $(call emit-deploy-target,FRONTEND_GNOME_DESKTOP)) $(eval $(call emit-deploy-target,FRONTEND_GNOME_EXE_CONFIG)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_ENGINE_DLL)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL_MDB)) $(eval $(call emit-deploy-target,SMUXI_FRONTEND_DLL)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) %.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po-Frontend-GNOME/*.po) LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po-Frontend-GNOME/.intltool-merge-cache $(top_srcdir)/po-Frontend-GNOME $< $@ install-data-hook: update-icon-cache uninstall-hook: update-icon-cache update-icon-cache: @-if test -z "$(DESTDIR)"; then \ echo "Updating Gtk icon cache."; \ $(gtk_update_icon_cache); \ else \ echo "*** Icon cache not updated. After (un)install, run this:"; \ echo "*** $(gtk_update_icon_cache)"; \ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Frontend-GNOME/Preferences/0000755000175000017500000000000012311344241021043 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Frontend-GNOME/Preferences/ServerListView.cs0000644000175000017500000002630112250426634024342 0ustar00meebeymeebey00000000000000/* * $Id: PreferencesDialog.cs 142 2007-01-02 22:19:08Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/PreferencesDialog.cs $ * $Rev: 142 $ * $Author: meebey $ * $Date: 2007-01-02 23:19:08 +0100 (Tue, 02 Jan 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2008 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Frontend.Gnome { public class ServerListView { private ServerListController _Controller; private Gtk.Window _Parent; #region Widgets [Glade.Widget("ServersTreeView")] private Gtk.TreeView _TreeView; private Gtk.TreeStore _TreeStore; [Glade.Widget("ServersAddButton")] private Gtk.Button _AddButton; [Glade.Widget("ServersEditButton")] private Gtk.Button _EditButton; [Glade.Widget("ServersRemoveButton")] private Gtk.Button _RemoveButton; #endregion public ServerListView(Gtk.Window parent, Glade.XML gladeXml) { Trace.Call(parent, gladeXml); if (parent == null) { throw new ArgumentNullException("parent"); } _Parent = parent; _Controller = new ServerListController(Frontend.UserConfig); gladeXml.BindFields(this); _AddButton.Clicked += new EventHandler(OnAddButtonClicked); _EditButton.Clicked += new EventHandler(OnEditButtonClicked); _RemoveButton.Clicked += new EventHandler(OnRemoveButtonClicked); _TreeView.AppendColumn(_("Protocol"), new Gtk.CellRendererText(), "text", 1); _TreeView.AppendColumn(_("Hostname"), new Gtk.CellRendererText(), "text", 2); _TreeStore = new Gtk.TreeStore(typeof(ServerModel), typeof(string), // protocol typeof(string) // hostname ); _TreeStore.SetSortColumnId(0, Gtk.SortType.Ascending); _TreeStore.SetSortFunc(0, SortTreeStore); _TreeView.RowActivated += OnTreeViewRowActivated; _TreeView.Selection.Changed += OnTreeViewSelectionChanged; _TreeView.Model = _TreeStore; } public virtual void Load() { Trace.Call(); _TreeStore.Clear(); // group servers by protocol Dictionary> protocols = new Dictionary>(); IList servers = _Controller.GetServerList(); foreach (ServerModel server in servers) { List protocolServers = null; protocols.TryGetValue(server.Protocol, out protocolServers); if (protocolServers == null) { protocolServers = new List(); protocols.Add(server.Protocol, protocolServers); } protocolServers.Add(server); } // add grouped servers to treeview foreach (KeyValuePair> pair in protocols) { Gtk.TreeIter parentIter = _TreeStore.AppendValues(null, pair.Key, String.Empty); foreach (ServerModel server in pair.Value) { // a server with an empty hostname has only one default/hardcoded // hostname, thus don't create a sub-node for it if (String.IsNullOrEmpty(server.Hostname)) { _TreeStore.SetValue(parentIter, 0, server); continue; } _TreeStore.AppendValues(parentIter, server, String.Empty, server.Hostname); } } _TreeView.ExpandAll(); } public virtual ServerModel GetCurrentServer() { Trace.Call(); Gtk.TreeIter iter; if (!_TreeView.Selection.GetSelected(out iter)) { return null; } return (ServerModel) _TreeStore.GetValue(iter, 0); } public virtual void Add() { Trace.Call(); ServerDialog dialog = new ServerDialog(_Parent, null, Frontend.Session.GetSupportedProtocols(), _Controller.GetNetworks()); try { int res = dialog.Run(); ServerModel server = dialog.GetServer(); if (res != (int) Gtk.ResponseType.Ok) { return; } _Controller.AddServer(server); _Controller.Save(); // refresh view Load(); } finally { dialog.Destroy(); } } public virtual void Edit(ServerModel server) { Trace.Call(server); if (server == null) { throw new ArgumentNullException("server"); } ServerDialog dialog = new ServerDialog(_Parent, server, Frontend.Session.GetSupportedProtocols(), _Controller.GetNetworks()); int res = dialog.Run(); server = dialog.GetServer(); dialog.Destroy(); if (res != (int) Gtk.ResponseType.Ok) { return; } _Controller.SetServer(server); _Controller.Save(); // refresh the view Load(); } public virtual void Remove(ServerModel server) { Trace.Call(server); if (server == null) { throw new ArgumentNullException("server"); } Gtk.MessageDialog md = new Gtk.MessageDialog(null, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.YesNo, _("Are you sure you want to delete the selected server?")); int result = md.Run(); md.Destroy(); if (result != (int) Gtk.ResponseType.Yes) { return; } _Controller.RemoveServer(server.Protocol, server.ServerID); _Controller.Save(); // refresh the view Load(); } protected virtual void OnTreeViewSelectionChanged(object sender, EventArgs e) { Trace.Call(sender, e); try { if (GetCurrentServer() == null) { _EditButton.Sensitive = false; _RemoveButton.Sensitive = false; } else { _EditButton.Sensitive = true; _RemoveButton.Sensitive = true; } } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual void OnAddButtonClicked(object sender, EventArgs e) { Trace.Call(sender, e); try { Add(); } catch (InvalidOperationException ex) { Frontend.ShowError(_Parent, _("Unable to add server: "), ex); } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual void OnEditButtonClicked(object sender, EventArgs e) { Trace.Call(sender, e); try { ServerModel server = GetCurrentServer(); if (server == null) { return; } Edit(server); } catch (ApplicationException ex) { Frontend.ShowError(_Parent, _("Unable to edit server: "), ex); } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual void OnRemoveButtonClicked(object sender, EventArgs e) { Trace.Call(sender, e); try { ServerModel server = GetCurrentServer(); if (server == null) { return; } Remove(server); } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual void OnTreeViewRowActivated(object sender, Gtk.RowActivatedArgs e) { Trace.Call(sender, e); try { ServerModel server = GetCurrentServer(); if (server == null) { return; } Edit(server); } catch (ApplicationException ex) { Frontend.ShowError(_Parent, _("Unable to edit server: "), ex); } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual int SortTreeStore(Gtk.TreeModel model, Gtk.TreeIter iter1, Gtk.TreeIter iter2) { var server1 = (ServerModel) model.GetValue(iter1, 0); var server2 = (ServerModel) model.GetValue(iter2, 0); // protocol nodes don't have a ServerModel if (server1 == null && server2 == null) { return 0; } if (server2 == null) { return 1; } if (server1 == null) { return -1; } var s1 = String.Format("{0}/{1}:{2} ({3})", server1.Protocol, server1.Hostname, server1.Port, server1.ServerID); var s2 = String.Format("{0}/{1}:{2} ({3})", server2.Protocol, server2.Hostname, server2.Port, server2.ServerID); return s1.CompareTo(s2); } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Frontend-GNOME/Preferences/PreferencesDialog.cs0000644000175000017500000015223312257043746025000 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Text; using System.Threading; using System.Collections; using System.Globalization; using Process = System.Diagnostics.Process; using Smuxi; using Smuxi.Common; using Smuxi.Engine; using System.Text.RegularExpressions; namespace Smuxi.Frontend.Gnome { public class PreferencesDialog { public enum Page : int { Connection = 0, Interface, Servers, Filters, Logging, } public enum InterfacePage : int { General = 0, Tabs, Input, Output, Notification } #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private Gtk.Dialog _Dialog; private Glade.XML _Glade; #region Widgets [Glade.Widget("Notebook")] private Gtk.Notebook _Notebook; [Glade.Widget("InterfaceNotebook")] private Gtk.Notebook _InterfaceNotebook; [Glade.Widget("MenuTreeView")] private Gtk.TreeView _MenuTreeView; [Glade.Widget("FilterListEventBox")] private Gtk.EventBox _FilterListEventBox; #endregion private FilterListWidget _FilterListWidget; private ServerListView _ServerListView; public Page CurrentPage { get { return (Page) _Notebook.CurrentPage; } set { Gtk.TreeIter iter; _MenuTreeView.Model.GetIterFirst(out iter); do { Page page = (Page) _MenuTreeView.Model.GetValue(iter, 0); if (value == page) { _MenuTreeView.Selection.SelectIter(iter); break; } } while (_MenuTreeView.Model.IterNext(ref iter)); } } public InterfacePage CurrentInterfacePage { get { return (InterfacePage) _InterfaceNotebook.CurrentPage; } set { _InterfaceNotebook.CurrentPage = (int) value; } } public PreferencesDialog(Gtk.Window parent) { Trace.Call(parent); if (parent == null) { throw new ArgumentNullException("parent"); } _Glade = new Glade.XML(null, Frontend.GladeFilename, "PreferencesDialog", null); //_Glade.BindFields(this); // changed signal is used in all settings, so use glade for now _Glade.Autoconnect(this); _Dialog = (Gtk.Dialog)_Glade["PreferencesDialog"]; _Dialog.TransientFor = parent; if (Frontend.IsMacOSX) { // HACK: center on parent is not working for this dialog _Dialog.SetPosition(Gtk.WindowPosition.CenterAlways); } else { _Dialog.SetPosition(Gtk.WindowPosition.CenterOnParent); } ((Gtk.Button)_Glade["OKButton"]).Clicked += new EventHandler(_OnOKButtonClicked); ((Gtk.Button)_Glade["ApplyButton"]).Clicked += new EventHandler(_OnApplyButtonClicked); ((Gtk.Button)_Glade["CancelButton"]).Clicked += new EventHandler(_OnCancelButtonClicked); ((Gtk.TextView)_Glade["OnConnectCommandsTextView"]).Buffer.Changed += new EventHandler(_OnChanged); ((Gtk.TextView)_Glade["OnStartupCommandsTextView"]).Buffer.Changed += new EventHandler(_OnChanged); ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Toggled += OnNotificationAreaIconCheckButtonToggled; ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Toggled += _OnChanged; ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonAlways"]).Toggled += _OnChanged; ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonMinimized"]).Toggled += _OnChanged; // we can't support minimize for now, see: http://projects.qnetp.net/issues/show/158 ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonMinimized"]).Visible = false; ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonClosed"]).Toggled += _OnChanged; ((Gtk.CheckButton)_Glade["OverrideForegroundColorCheckButton"]).Toggled += OnOverrideForegroundColorCheckButtonToggled; ((Gtk.CheckButton)_Glade["OverrideBackgroundColorCheckButton"]).Toggled += OnOverrideBackgroundColorCheckButtonToggled; ((Gtk.CheckButton)_Glade["OverrideFontCheckButton"]).Toggled += OnOverrideFontCheckButtonToggled; ((Gtk.FontButton)_Glade["FontButton"]).FontSet += _OnChanged; ((Gtk.CheckButton)_Glade["ShowAdvancedSettingsCheckButton"]).Toggled += delegate { CheckShowAdvancedSettingsCheckButton(); }; ((Gtk.CheckButton)_Glade["ProxyShowPasswordCheckButton"]).Toggled += delegate { CheckProxyShowPasswordCheckButton(); }; ((Gtk.TextView)_Glade["HighlightWordsTextView"]).Buffer.Changed += _OnChanged; if (Frontend.EngineVersion < new Version("0.7.2")) { // feature introduced in >= 0.7.2 ((Gtk.TextView)_Glade["HighlightWordsTextView"]).Sensitive = false; } ((Gtk.Button)_Glade["LoggingOpenButton"]).Clicked += delegate { ThreadPool.QueueUserWorkItem(delegate { try { var logPath = Platform.LogPath; if (!Directory.Exists(logPath)) { Directory.CreateDirectory(logPath); } Process.Start(logPath); } catch (Exception ex) { Frontend.ShowError(parent, ex); } }); }; Gtk.ComboBox wrapModeComboBox = (Gtk.ComboBox)_Glade["WrapModeComboBox"]; // initialize wrap modes // glade might initialize it already! wrapModeComboBox.Clear(); wrapModeComboBox.Changed += _OnChanged; Gtk.CellRendererText cell = new Gtk.CellRendererText(); wrapModeComboBox.PackStart(cell, false); wrapModeComboBox.AddAttribute(cell, "text", 1); Gtk.ListStore store = new Gtk.ListStore(typeof(Gtk.WrapMode), typeof(string)); // fill ListStore store.AppendValues(Gtk.WrapMode.Char, _("Character")); store.AppendValues(Gtk.WrapMode.WordChar, _("Word")); wrapModeComboBox.Model = store; wrapModeComboBox.Active = 0; Gtk.ComboBox persistencyTypeComboBox = (Gtk.ComboBox) _Glade["PersistencyTypeComboBox"]; // glade might initialize it already! persistencyTypeComboBox.Clear(); persistencyTypeComboBox.Changed += _OnChanged; cell = new Gtk.CellRendererText(); persistencyTypeComboBox.PackStart(cell, false); persistencyTypeComboBox.AddAttribute(cell, "text", 1); store = new Gtk.ListStore( typeof(MessageBufferPersistencyType), typeof(string) ); // fill ListStore store.AppendValues(MessageBufferPersistencyType.Volatile, _("Volatile")); store.AppendValues(MessageBufferPersistencyType.Persistent, _("Persistent")); persistencyTypeComboBox.Model = store; persistencyTypeComboBox.Active = 0; if (Frontend.EngineVersion < new Version("0.8.1")) { persistencyTypeComboBox.Sensitive = false; ((Gtk.SpinButton) _Glade["VolatileMaxCapacitySpinButton"]).Sensitive = false; ((Gtk.SpinButton) _Glade["PersistentMaxCapacitySpinButton"]).Sensitive = false; } Gtk.ComboBox proxyTypeComboBox = (Gtk.ComboBox)_Glade["ProxyTypeComboBox"]; // initialize wrap modes // glade might initialize it already! proxyTypeComboBox.Clear(); proxyTypeComboBox.Changed += _OnChanged; proxyTypeComboBox.Changed += delegate { CheckProxyTypeComBoBox(); }; cell = new Gtk.CellRendererText(); proxyTypeComboBox.PackStart(cell, false); proxyTypeComboBox.AddAttribute(cell, "text", 1); store = new Gtk.ListStore(typeof(ProxyType), typeof(string)); // fill ListStore store.AppendValues(ProxyType.None, String.Format("<{0}>", _("No Proxy"))); store.AppendValues(ProxyType.System, String.Format("<{0}>", _("System Default"))); store.AppendValues(ProxyType.Http, "HTTP"); store.AppendValues(ProxyType.Socks4, "SOCK 4"); store.AppendValues(ProxyType.Socks4a, "SOCK 4a"); store.AppendValues(ProxyType.Socks5, "SOCK 5"); proxyTypeComboBox.Model = store; proxyTypeComboBox.Active = 0; _Notebook.ShowTabs = false; Gtk.ListStore ls = new Gtk.ListStore(typeof(Page), typeof(Gdk.Pixbuf), typeof(string)); ls.AppendValues(Page.Connection, _Dialog.RenderIcon( Gtk.Stock.Connect, Gtk.IconSize.SmallToolbar, null), _("Connection")); ls.AppendValues(Page.Interface, _Dialog.RenderIcon( Gtk.Stock.SelectFont, Gtk.IconSize.SmallToolbar, null), _("Interface")); ls.AppendValues(Page.Servers, _Dialog.RenderIcon( Gtk.Stock.Network, Gtk.IconSize.SmallToolbar, null), _("Servers")); if (Frontend.EngineVersion >= new Version("0.7.2")) { // features introduced in >= 0.7.2 ls.AppendValues(Page.Filters, _Dialog.RenderIcon( Gtk.Stock.Delete, Gtk.IconSize.SmallToolbar, null), _("Filters")); ls.AppendValues(Page.Logging, _Dialog.RenderIcon( Gtk.Stock.JustifyLeft, Gtk.IconSize.SmallToolbar, null), _("Logging")); } int i = 1; _MenuTreeView.AppendColumn(null, new Gtk.CellRendererPixbuf(), "pixbuf",i++); _MenuTreeView.AppendColumn(null, new Gtk.CellRendererText(), "text", i++); _MenuTreeView.Selection.Changed += new EventHandler(_MenuTreeViewSelectionChanged); _MenuTreeView.Selection.Mode = Gtk.SelectionMode.Browse; _MenuTreeView.Model = ls; // select the first item Gtk.TreeIter iter; ls.GetIterFirst(out iter); _MenuTreeView.Selection.SelectIter(iter); _ServerListView = new ServerListView(_Dialog, _Glade); _FilterListWidget = new FilterListWidget(_Dialog, Frontend.UserConfig); _FilterListWidget.Changed += _OnChanged; _FilterListEventBox.Add(_FilterListWidget); _FilterListEventBox.ShowAll(); _Load(); } public void Show() { _Dialog.Show(); } private void _Load() { Trace.Call(); // root string startup_commands = String.Join("\n", (string[])Frontend.UserConfig["OnStartupCommands"]); ((Gtk.TextView)_Glade["OnStartupCommandsTextView"]).Buffer.Text = startup_commands; // Connection string nicknames = String.Join(" ", (string[])Frontend.UserConfig["Connection/Nicknames"]); ((Gtk.Entry)_Glade["ConnectionNicknamesEntry"]).Text = nicknames; ((Gtk.Entry)_Glade["ConnectionUsernameEntry"]).Text = (string)Frontend.UserConfig["Connection/Username"]; ((Gtk.Entry)_Glade["ConnectionRealnameEntry"]).Text = (string)Frontend.UserConfig["Connection/Realname"]; string connect_commands = String.Join("\n", (string[])Frontend.UserConfig["Connection/OnConnectCommands"]); ((Gtk.TextView)_Glade["OnConnectCommandsTextView"]).Buffer.Text = connect_commands; var autoConvertUTF8CheckButton = (Gtk.CheckButton) _Glade["AutoConvertUTF8CheckButton"]; if (Frontend.EngineVersion >= new Version("0.8.12")) { autoConvertUTF8CheckButton.Active = (bool) Frontend.UserConfig["Connection/AutoConvertUTF8"]; } else { autoConvertUTF8CheckButton.Sensitive = false; } string encoding = (string)Frontend.UserConfig["Connection/Encoding"]; encoding = encoding.ToUpper(); Gtk.ComboBox cb = (Gtk.ComboBox)_Glade["EncodingComboBox"]; // glade might initialize it already! cb.Clear(); Gtk.CellRendererText cell = new Gtk.CellRendererText(); cb.PackStart(cell, false); cb.AddAttribute(cell, "text", 0); Gtk.ListStore store = new Gtk.ListStore(typeof(string), typeof(string)); store.AppendValues(String.Format("<{0}>", _("System Default")), String.Empty); ArrayList encodingList = new ArrayList(); ArrayList bodyNameList = new ArrayList(); foreach (EncodingInfo encInfo in Encoding.GetEncodings()) { try { Encoding enc = Encoding.GetEncoding(encInfo.CodePage); string encodingName = enc.EncodingName.ToUpper(); if (!enc.IsSingleByte && enc != Encoding.UTF8) { // ignore multi byte encodings except UTF-8 continue; } // filter noise and duplicates if (encodingName.IndexOf("DOS") != -1 || encodingName.IndexOf("MAC") != -1 || encodingName.IndexOf("EBCDIC") != -1 || encodingName.IndexOf("ISCII") != -1 || encodingList.Contains(encodingName) || bodyNameList.Contains(enc.BodyName)) { continue; } #if LOG4NET _Logger.Debug("_Load(): adding encoding: " + enc.BodyName); #endif encodingList.Add(encodingName); bodyNameList.Add(enc.BodyName); encodingName = enc.EncodingName; // remove all (DOS) / (Windows) / (Mac) crap from the encoding name if (enc.EncodingName.Contains(" (")) { encodingName = encodingName.Substring(0, enc.EncodingName.IndexOf(" (")); } var normalizedBodyName = enc.BodyName.ToUpper(); if (normalizedBodyName.StartsWith("KOI8")) { // this is the only non-ISO encoding that doesn't use // WINDOWS as prefix and confuses users normalizedBodyName = String.Format("WINDOWS-{0} / {1}", enc.CodePage, normalizedBodyName); } store.AppendValues(normalizedBodyName + " - " + encodingName, enc.BodyName.ToUpper()); } catch (NotSupportedException) { } } cb.Model = store; cb.Active = 0; store.SetSortColumnId(0, Gtk.SortType.Ascending); int j = 0; foreach (object[] row in store) { string encodingName = (string) row[1]; if (encodingName == encoding) { cb.Active = j; break; } j++; } // Connection - Proxy Gtk.ComboBox proxyTypeComboBox = ((Gtk.ComboBox)_Glade["ProxyTypeComboBox"]); ProxyType proxyType = (ProxyType) Enum.Parse( typeof(ProxyType), (string) Frontend.UserConfig["Connection/ProxyType"] ); int i = 0; foreach (object[] row in (Gtk.ListStore) proxyTypeComboBox.Model) { if (((ProxyType) row[0]) == proxyType) { proxyTypeComboBox.Active = i; break; } i++; } ((Gtk.Entry) _Glade["ProxyHostEntry"]).Text = (string) Frontend.UserConfig["Connection/ProxyHostname"]; int proxyPort = (int) Frontend.UserConfig["Connection/ProxyPort"]; if (proxyPort == -1) { proxyPort = 0; } ((Gtk.SpinButton) _Glade["ProxyPortSpinButton"]).Value = proxyPort; ((Gtk.Entry) _Glade["ProxyUsernameEntry"]).Text = (string) Frontend.UserConfig["Connection/ProxyUsername"]; ((Gtk.Entry) _Glade["ProxyPasswordEntry"]).Text = (string) Frontend.UserConfig["Connection/ProxyPassword"]; CheckProxyShowPasswordCheckButton(); // MessageBuffer if (Frontend.EngineVersion >= new Version("0.8.1")) { // feature introduced in >= 0.8.1 Gtk.ComboBox persistencyTypeComboBox = ((Gtk.ComboBox)_Glade["PersistencyTypeComboBox"]); try { var persistencyType = (MessageBufferPersistencyType) Enum.Parse( typeof(MessageBufferPersistencyType), (string) Frontend.UserConfig["MessageBuffer/PersistencyType"] ); i = 0; foreach (object[] row in (Gtk.ListStore) persistencyTypeComboBox.Model) { if (((MessageBufferPersistencyType) row[0]) == persistencyType) { persistencyTypeComboBox.Active = i; break; } i++; } } catch (ArgumentException) { // for forward compatibility with newer engines persistencyTypeComboBox.Active = -1; } ((Gtk.SpinButton)_Glade["VolatileMaxCapacitySpinButton"]).Value = (double)(int)Frontend.UserConfig["MessageBuffer/Volatile/MaxCapacity"]; ((Gtk.SpinButton)_Glade["PersistentMaxCapacitySpinButton"]).Value = (double)(int)Frontend.UserConfig["MessageBuffer/Persistent/MaxCapacity"]; } // Interface ((Gtk.CheckButton) _Glade["ShowAdvancedSettingsCheckButton"]).Active = (bool) Frontend.UserConfig["Interface/ShowAdvancedSettings"]; CheckShowAdvancedSettingsCheckButton(); // Interface/Notebook ((Gtk.Entry)_Glade["TimestampFormatEntry"]).Text = (string)Frontend.UserConfig["Interface/Notebook/TimestampFormat"]; ((Gtk.SpinButton)_Glade["BufferLinesSpinButton"]).Value = (double)(int)Frontend.UserConfig["Interface/Notebook/BufferLines"]; ((Gtk.SpinButton)_Glade["EngineBufferLinesSpinButton"]).Value = (double)(int)Frontend.UserConfig["Interface/Notebook/EngineBufferLines"]; ((Gtk.CheckButton)_Glade["StripColorsCheckButton"]).Active = (bool)Frontend.UserConfig["Interface/Notebook/StripColors"]; ((Gtk.CheckButton)_Glade["StripFormattingsCheckButton"]).Active = (bool)Frontend.UserConfig["Interface/Notebook/StripFormattings"]; switch ((string)Frontend.UserConfig["Interface/Notebook/TabPosition"]) { case "top": ((Gtk.RadioButton)_Glade["TabPositionRadioButtonTop"]).Active = true; break; case "bottom": ((Gtk.RadioButton)_Glade["TabPositionRadioButtonBottom"]).Active = true; break; case "left": ((Gtk.RadioButton)_Glade["TabPositionRadioButtonLeft"]).Active = true; break; case "right": ((Gtk.RadioButton)_Glade["TabPositionRadioButtonRight"]).Active = true; break; case "none": ((Gtk.RadioButton)_Glade["TabPositionRadioButtonNone"]).Active = true; break; } if (Frontend.UserConfig["Interface/Notebook/AutoSwitchPersonChats"] != null) { ((Gtk.CheckButton) _Glade["AutoSwitchPersonChatsCheckButton"]).Active = (bool) Frontend.UserConfig["Interface/Notebook/AutoSwitchPersonChats"]; } if (Frontend.UserConfig["Interface/Notebook/AutoSwitchGroupChats"] != null) { ((Gtk.CheckButton) _Glade["AutoSwitchGroupChatsCheckButton"]).Active = (bool) Frontend.UserConfig["Interface/Notebook/AutoSwitchGroupChats"]; } // Interface/Notebook/Channel switch ((string)Frontend.UserConfig["Interface/Notebook/Channel/UserListPosition"]) { case "left": ((Gtk.RadioButton)_Glade["UserListPositionRadioButtonLeft"]).Active = true; break; case "right": ((Gtk.RadioButton)_Glade["UserListPositionRadioButtonRight"]).Active = true; break; case "none": ((Gtk.RadioButton)_Glade["UserListPositionRadioButtonNone"]).Active = true; break; } switch ((string)Frontend.UserConfig["Interface/Notebook/Channel/TopicPosition"]) { case "top": ((Gtk.RadioButton)_Glade["TopicPositionRadioButtonTop"]).Active = true; break; case "bottom": ((Gtk.RadioButton)_Glade["TopicPositionRadioButtonBottom"]).Active = true; break; case "none": ((Gtk.RadioButton)_Glade["TopicPositionRadioButtonNone"]).Active = true; break; } ((Gtk.CheckButton) _Glade["NickColorsCheckButton"]).Active = (bool) Frontend.UserConfig["Interface/Notebook/Channel/NickColors"]; // Interface/Notebook/Tab Gtk.ColorButton colorButton; string colorHexCode; colorButton = (Gtk.ColorButton)_Glade["NoActivityColorButton"]; colorHexCode = (string)Frontend.UserConfig["Interface/Notebook/Tab/NoActivityColor"]; colorButton.Color = ColorConverter.GetGdkColor(colorHexCode); colorButton = (Gtk.ColorButton)_Glade["ActivityColorButton"]; colorHexCode = (string)Frontend.UserConfig["Interface/Notebook/Tab/ActivityColor"]; colorButton.Color = ColorConverter.GetGdkColor(colorHexCode); colorButton = (Gtk.ColorButton)_Glade["ModeColorButton"]; colorHexCode = (string)Frontend.UserConfig["Interface/Notebook/Tab/EventColor"]; colorButton.Color = ColorConverter.GetGdkColor(colorHexCode); colorButton = (Gtk.ColorButton)_Glade["HighlightColorButton"]; colorHexCode = (string)Frontend.UserConfig["Interface/Notebook/Tab/HighlightColor"]; colorButton.Color = ColorConverter.GetGdkColor(colorHexCode); // Interface/Chat colorButton = (Gtk.ColorButton)_Glade["ForegroundColorButton"]; colorHexCode = (string)Frontend.UserConfig["Interface/Chat/ForegroundColor"]; if (String.IsNullOrEmpty(colorHexCode)) { ((Gtk.CheckButton)_Glade["OverrideForegroundColorCheckButton"]).Active = false; } else { ((Gtk.CheckButton)_Glade["OverrideForegroundColorCheckButton"]).Active = true; colorButton.Color = ColorConverter.GetGdkColor(colorHexCode); } colorButton = (Gtk.ColorButton)_Glade["BackgroundColorButton"]; colorHexCode = (string)Frontend.UserConfig["Interface/Chat/BackgroundColor"]; if (String.IsNullOrEmpty(colorHexCode)) { ((Gtk.CheckButton)_Glade["OverrideBackgroundColorCheckButton"]).Active = false; } else { ((Gtk.CheckButton)_Glade["OverrideBackgroundColorCheckButton"]).Active = true; colorButton.Color = ColorConverter.GetGdkColor(colorHexCode); } Gtk.FontButton fontButton = (Gtk.FontButton)_Glade["FontButton"]; string fontFamily = (string)Frontend.UserConfig["Interface/Chat/FontFamily"]; string fontStyle = (string)Frontend.UserConfig["Interface/Chat/FontStyle"]; int fontSize = 0; if (Frontend.UserConfig["Interface/Chat/FontSize"] != null) { fontSize = (int) Frontend.UserConfig["Interface/Chat/FontSize"]; } if (String.IsNullOrEmpty(fontFamily) && String.IsNullOrEmpty(fontStyle) && fontSize == 0) { ((Gtk.CheckButton)_Glade["OverrideFontCheckButton"]).Active = false; } else { ((Gtk.CheckButton)_Glade["OverrideFontCheckButton"]).Active = true; Pango.FontDescription fontDescription = new Pango.FontDescription(); fontDescription.Family = fontFamily; string frontWeigth = null; if (fontStyle.Contains(" ")) { int pos = fontStyle.IndexOf(" "); frontWeigth = fontStyle.Substring(0, pos); fontStyle = fontStyle.Substring(pos + 1); } fontDescription.Style = (Pango.Style) Enum.Parse(typeof(Pango.Style), fontStyle); if (frontWeigth != null) { fontDescription.Weight = (Pango.Weight) Enum.Parse(typeof(Pango.Weight), frontWeigth); } fontDescription.Size = fontSize * 1024; fontButton.FontName = fontDescription.ToString(); } Gtk.ComboBox wrapModeComboBox = ((Gtk.ComboBox)_Glade["WrapModeComboBox"]); Gtk.WrapMode wrapMode = (Gtk.WrapMode) Enum.Parse( typeof(Gtk.WrapMode), (string) Frontend.UserConfig["Interface/Chat/WrapMode"] ); if (wrapMode == Gtk.WrapMode.Word) { wrapMode = Gtk.WrapMode.WordChar; } i = 0; foreach (object[] row in (Gtk.ListStore) wrapModeComboBox.Model) { if (((Gtk.WrapMode) row[0]) == wrapMode) { wrapModeComboBox.Active = i; break; } i++; } // Interface/Entry ((Gtk.Entry)_Glade["CompletionCharacterEntry"]).Text = (string)Frontend.UserConfig["Interface/Entry/CompletionCharacter"]; ((Gtk.Entry)_Glade["CommandCharacterEntry"]).Text = (string)Frontend.UserConfig["Interface/Entry/CommandCharacter"]; ((Gtk.CheckButton)_Glade["BashStyleCompletionCheckButton"]).Active = (bool)Frontend.UserConfig["Interface/Entry/BashStyleCompletion"]; ((Gtk.SpinButton)_Glade["CommandHistorySizeSpinButton"]).Value = (double)(int)Frontend.UserConfig["Interface/Entry/CommandHistorySize"]; var highlight_words = (string[]) Frontend.UserConfig["Interface/Chat/HighlightWords"]; // backwards compatibility with 0.7.x servers if (highlight_words == null) { highlight_words = new string[] {}; } ((Gtk.TextView)_Glade["HighlightWordsTextView"]).Buffer.Text = String.Join("\n", highlight_words); ((Gtk.CheckButton)_Glade["BeepOnHighlightCheckButton"]).Active = (bool)Frontend.UserConfig["Sound/BeepOnHighlight"]; // Interface/Notification string modeStr = (string) Frontend.UserConfig["Interface/Notification/NotificationAreaIconMode"]; NotificationAreaIconMode mode = (NotificationAreaIconMode) Enum.Parse( typeof(NotificationAreaIconMode), modeStr ); switch (mode) { case NotificationAreaIconMode.Never: ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Active = false; ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonClosed"]).Active = true; // the toggle event is not raised as the checkbox is already unchecked by default // thus we have to disable the radio buttons by hand ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonAlways"]).Sensitive = false; ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonMinimized"]).Sensitive = false; ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonClosed"]).Sensitive = false; break; case NotificationAreaIconMode.Always: ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Active = true; ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonAlways"]).Active = true; break; case NotificationAreaIconMode.Minimized: // can't support this for now, see: http://projects.qnetp.net/issues/show/158 goto case NotificationAreaIconMode.Never; /* ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Active = true; ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonMinimized"]).Active = true; break; */ case NotificationAreaIconMode.Closed: ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Active = true; ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonClosed"]).Active = true; break; } ((Gtk.CheckButton) _Glade["MessagingMenuCheckButton"]).Active = (bool) Frontend.UserConfig["Interface/Notification/MessagingMenuEnabled"]; ((Gtk.CheckButton) _Glade["NotificationPopupsCheckButton"]).Active = (bool) Frontend.UserConfig["Interface/Notification/PopupsEnabled"]; // Filters _FilterListWidget.InitProtocols(Frontend.Session.GetSupportedProtocols()); _FilterListWidget.Load(); // Servers _ServerListView.Load(); // Logging ((Gtk.Button) _Glade["LoggingOpenButton"]).Visible = false; if (Frontend.UserConfig["Logging/Enabled"] != null) { ((Gtk.CheckButton) _Glade["LoggingEnabledCheckButton"]).Active = (bool) Frontend.UserConfig["Logging/Enabled"]; if (Frontend.IsLocalEngine) { ((Gtk.Button) _Glade["LoggingOpenButton"]).Visible = true; } } if (Frontend.UserConfig["Logging/LogFilteredMessages"] != null) { ((Gtk.CheckButton) _Glade["LoggingLogFilteredMessagesCheckButton"]).Active = (bool) Frontend.UserConfig["Logging/LogFilteredMessages"]; } ((Gtk.Button)_Glade["ApplyButton"]).Sensitive = false; } private void _Save() { Trace.Call(); if (((Gtk.Entry)_Glade["ConnectionNicknamesEntry"]).Text.Trim().Length == 0) { throw new ApplicationException(_("Nicknames(s) field must not be empty.")); } string prefix; // root Frontend.UserConfig["OnStartupCommands"] = ((Gtk.TextView)_Glade["OnStartupCommandsTextView"]).Buffer.Text.Split(new char[] {'\n'}); // Connection Frontend.UserConfig["Connection/Nicknames"] = ((Gtk.Entry)_Glade["ConnectionNicknamesEntry"]).Text.Split(new char[] {' '}); Frontend.UserConfig["Connection/Username"] = ((Gtk.Entry)_Glade["ConnectionUsernameEntry"]).Text; Frontend.UserConfig["Connection/Realname"] = ((Gtk.Entry)_Glade["ConnectionRealnameEntry"]).Text; Frontend.UserConfig["Connection/OnConnectCommands"] = ((Gtk.TextView)_Glade["OnConnectCommandsTextView"]).Buffer.Text.Split(new char[] {'\n'}); if (Frontend.EngineVersion >= new Version("0.8.12")) { Frontend.UserConfig["Connection/AutoConvertUTF8"] = ((Gtk.CheckButton)_Glade["AutoConvertUTF8CheckButton"]).Active; } Gtk.ComboBox cb = (Gtk.ComboBox)_Glade["EncodingComboBox"]; Gtk.TreeIter iter; cb.GetActiveIter(out iter); string bodyName = (string) cb.Model.GetValue(iter, 1); Frontend.UserConfig["Connection/Encoding"] = bodyName; // Connection - Proxy cb = (Gtk.ComboBox) _Glade["ProxyTypeComboBox"]; cb.GetActiveIter(out iter); var proxyType = (ProxyType) cb.Model.GetValue(iter, 0); Frontend.UserConfig["Connection/ProxyType"] = proxyType.ToString(); Frontend.UserConfig["Connection/ProxyHostname"] = ((Gtk.Entry) _Glade["ProxyHostEntry"]).Text; Frontend.UserConfig["Connection/ProxyPort"] = ((Gtk.SpinButton) _Glade["ProxyPortSpinButton"]).ValueAsInt; Frontend.UserConfig["Connection/ProxyUsername"] = ((Gtk.Entry) _Glade["ProxyUsernameEntry"]).Text; Frontend.UserConfig["Connection/ProxyPassword"] = ((Gtk.Entry) _Glade["ProxyPasswordEntry"]).Text; int i; // MessageBuffer if (Frontend.EngineVersion >= new Version("0.8.1")) { var persistencyTypeComboBox = (Gtk.ComboBox) _Glade["PersistencyTypeComboBox"]; // for forward compatibility with newer engines if (persistencyTypeComboBox.Active != -1) { var persistencyType = MessageBufferPersistencyType.Volatile; i = 0; foreach (object[] row in (Gtk.ListStore) persistencyTypeComboBox.Model) { if (persistencyTypeComboBox.Active == i) { persistencyType = (MessageBufferPersistencyType) row[0]; break; } i++; } Frontend.UserConfig["MessageBuffer/PersistencyType"] = persistencyType.ToString(); } Frontend.UserConfig["MessageBuffer/Volatile/MaxCapacity"] = (int)((Gtk.SpinButton)_Glade["VolatileMaxCapacitySpinButton"]).Value; Frontend.UserConfig["MessageBuffer/Persistent/MaxCapacity"] = (int)((Gtk.SpinButton)_Glade["PersistentMaxCapacitySpinButton"]).Value; } // Interface Frontend.UserConfig["Interface/ShowAdvancedSettings"] = ((Gtk.CheckButton)_Glade["ShowAdvancedSettingsCheckButton"]).Active; // Interface/Notebook Frontend.UserConfig["Interface/Notebook/TimestampFormat"] = ((Gtk.Entry)_Glade["TimestampFormatEntry"]).Text; Frontend.UserConfig["Interface/Notebook/BufferLines"] = (int)((Gtk.SpinButton)_Glade["BufferLinesSpinButton"]).Value; Frontend.UserConfig["Interface/Notebook/EngineBufferLines"] = (int)((Gtk.SpinButton)_Glade["EngineBufferLinesSpinButton"]).Value; Frontend.UserConfig["Interface/Notebook/StripColors"] = ((Gtk.CheckButton)_Glade["StripColorsCheckButton"]).Active; Frontend.UserConfig["Interface/Notebook/StripFormattings"] = ((Gtk.CheckButton)_Glade["StripFormattingsCheckButton"]).Active; string tab_position = null; if (((Gtk.RadioButton)_Glade["TabPositionRadioButtonTop"]).Active) { tab_position = "top"; } else if (((Gtk.RadioButton)_Glade["TabPositionRadioButtonBottom"]).Active) { tab_position = "bottom"; } else if (((Gtk.RadioButton)_Glade["TabPositionRadioButtonLeft"]).Active) { tab_position = "left"; } else if (((Gtk.RadioButton)_Glade["TabPositionRadioButtonRight"]).Active) { tab_position = "right"; } else if (((Gtk.RadioButton)_Glade["TabPositionRadioButtonNone"]).Active) { tab_position = "none"; } Frontend.UserConfig["Interface/Notebook/TabPosition"] = tab_position; Frontend.UserConfig["Interface/Notebook/AutoSwitchPersonChats"] = ((Gtk.CheckButton)_Glade["AutoSwitchPersonChatsCheckButton"]).Active; Frontend.UserConfig["Interface/Notebook/AutoSwitchGroupChats"] = ((Gtk.CheckButton)_Glade["AutoSwitchGroupChatsCheckButton"]).Active; // Interface/Notebook/Channel string userlist_position = null; if (((Gtk.RadioButton)_Glade["UserListPositionRadioButtonLeft"]).Active) { userlist_position = "left"; } else if (((Gtk.RadioButton)_Glade["UserListPositionRadioButtonRight"]).Active) { userlist_position = "right"; } else if (((Gtk.RadioButton)_Glade["UserListPositionRadioButtonNone"]).Active) { userlist_position = "none"; } Frontend.UserConfig["Interface/Notebook/Channel/UserListPosition"] = userlist_position; Frontend.UserConfig["Interface/Notebook/Channel/NickColors"] = ((Gtk.CheckButton) _Glade["NickColorsCheckButton"]).Active; string topic_position = null; if (((Gtk.RadioButton)_Glade["TopicPositionRadioButtonTop"]).Active) { topic_position = "top"; } else if (((Gtk.RadioButton)_Glade["TopicPositionRadioButtonBottom"]).Active) { topic_position = "bottom"; } else if (((Gtk.RadioButton)_Glade["TopicPositionRadioButtonNone"]).Active) { topic_position = "none"; } Frontend.UserConfig["Interface/Notebook/Channel/TopicPosition"] = topic_position; // Interface/Notebook/Tab prefix = "Interface/Notebook/Tab/"; Frontend.UserConfig[prefix + "NoActivityColor"] = ColorConverter.GetHexCode(((Gtk.ColorButton)_Glade["NoActivityColorButton"]).Color); Frontend.UserConfig[prefix + "ActivityColor"] = ColorConverter.GetHexCode(((Gtk.ColorButton)_Glade["ActivityColorButton"]).Color); Frontend.UserConfig[prefix + "EventColor"] = ColorConverter.GetHexCode(((Gtk.ColorButton)_Glade["ModeColorButton"]).Color); Frontend.UserConfig[prefix + "HighlightColor"] = ColorConverter.GetHexCode(((Gtk.ColorButton)_Glade["HighlightColorButton"]).Color); // Interface/Chat prefix = "Interface/Chat/"; if (((Gtk.CheckButton)_Glade["OverrideForegroundColorCheckButton"]).Active) { Frontend.UserConfig[prefix + "ForegroundColor"] = ColorConverter.GetHexCode(((Gtk.ColorButton)_Glade["ForegroundColorButton"]).Color); } else { Frontend.UserConfig[prefix + "ForegroundColor"] = String.Empty; } if (((Gtk.CheckButton)_Glade["OverrideBackgroundColorCheckButton"]).Active) { Frontend.UserConfig[prefix + "BackgroundColor"] = ColorConverter.GetHexCode(((Gtk.ColorButton)_Glade["BackgroundColorButton"]).Color); } else { Frontend.UserConfig[prefix + "BackgroundColor"] = String.Empty; } if (((Gtk.CheckButton)_Glade["OverrideFontCheckButton"]).Active) { string fontName = ((Gtk.FontButton)_Glade["FontButton"]).FontName; Pango.FontDescription fontDescription = Pango.FontDescription.FromString(fontName); Frontend.UserConfig[prefix + "FontFamily"] = fontDescription.Family; Frontend.UserConfig[prefix + "FontStyle"] = fontDescription.Weight + " " + fontDescription.Style; Frontend.UserConfig[prefix + "FontSize"] = fontDescription.Size / 1024; } else { Frontend.UserConfig[prefix + "FontFamily"] = String.Empty; Frontend.UserConfig[prefix + "FontStyle"] = String.Empty; Frontend.UserConfig[prefix + "FontSize"] = 0; } Gtk.ComboBox wrapModeComboBox = (Gtk.ComboBox) _Glade["WrapModeComboBox"]; Gtk.WrapMode wrapMode = Gtk.WrapMode.Char; i = 0; foreach (object[] row in (Gtk.ListStore) wrapModeComboBox.Model) { if (wrapModeComboBox.Active == i) { wrapMode = (Gtk.WrapMode) row[0]; break; } i++; } Frontend.UserConfig[prefix + "WrapMode"] = wrapMode.ToString(); // Entry Frontend.UserConfig["Interface/Entry/CompletionCharacter"] = ((Gtk.Entry)_Glade["CompletionCharacterEntry"]).Text; Frontend.UserConfig["Interface/Entry/CommandCharacter"] = ((Gtk.Entry)_Glade["CommandCharacterEntry"]).Text; Frontend.UserConfig["Interface/Entry/BashStyleCompletion"] = ((Gtk.CheckButton)_Glade["BashStyleCompletionCheckButton"]).Active; Frontend.UserConfig["Interface/Entry/CommandHistorySize"] = (int)((Gtk.SpinButton)_Glade["CommandHistorySizeSpinButton"]).Value; Frontend.UserConfig["Interface/Chat/HighlightWords"] = null; string[] highlight_words = ((Gtk.TextView) _Glade["HighlightWordsTextView"]).Buffer.Text.Split(new char[] { '\n' }); foreach (string word in highlight_words) { if (word.StartsWith("/") && word.EndsWith("/")) { try { new Regex(word.Substring(1, word.Length - 2)); } catch (ArgumentException ex) { throw new ApplicationException( String.Format( _("Invalid highlight regex: '{0}'. Reason: {1}"), word, ex.Message ) ); } } } Frontend.UserConfig["Interface/Chat/HighlightWords"] = highlight_words; Frontend.UserConfig["Sound/BeepOnHighlight"] = ((Gtk.CheckButton)_Glade["BeepOnHighlightCheckButton"]).Active; // Interface/Notification if (((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Active) { if (((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonAlways"]).Active) { Frontend.UserConfig["Interface/Notification/NotificationAreaIconMode"] = NotificationAreaIconMode.Always.ToString(); } else if (((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonMinimized"]).Active) { Frontend.UserConfig["Interface/Notification/NotificationAreaIconMode"] = NotificationAreaIconMode.Minimized.ToString(); } else if (((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonClosed"]).Active) { Frontend.UserConfig["Interface/Notification/NotificationAreaIconMode"] = NotificationAreaIconMode.Closed.ToString(); } } else { Frontend.UserConfig["Interface/Notification/NotificationAreaIconMode"] = NotificationAreaIconMode.Never.ToString(); } Frontend.UserConfig["Interface/Notification/MessagingMenuEnabled"] = ((Gtk.CheckButton)_Glade["MessagingMenuCheckButton"]).Active; Frontend.UserConfig["Interface/Notification/PopupsEnabled"] = ((Gtk.CheckButton)_Glade["NotificationPopupsCheckButton"]).Active; // Filters _FilterListWidget.Save(); // Servers // _ServerListView saves directly after each change //_ServerListView.Save(); // Logging Frontend.UserConfig["Logging/Enabled"] = ((Gtk.CheckButton) _Glade["LoggingEnabledCheckButton"]).Active; Frontend.UserConfig["Logging/LogFilteredMessages"] = ((Gtk.CheckButton) _Glade["LoggingLogFilteredMessagesCheckButton"]).Active; Frontend.Config.Save(); } protected virtual void _OnChanged(object sender, EventArgs e) { ((Gtk.Button)_Glade["ApplyButton"]).Sensitive = true; } private void _OnOKButtonClicked(object sender, EventArgs e) { Trace.Call(sender, e); try { _Save(); Frontend.Config.Load(); Frontend.ApplyConfig(Frontend.UserConfig); _Dialog.Destroy(); } catch (ApplicationException ex) { Frontend.ShowError(_Dialog, ex.Message); } catch (Exception ex) { #if LOG4NET _Logger.Error(ex); #endif Frontend.ShowException(_Dialog, ex); } } private void _OnApplyButtonClicked(object sender, EventArgs e) { Trace.Call(sender, e); try { _Save(); Frontend.Config.Load(); _Load(); Frontend.ApplyConfig(Frontend.UserConfig); } catch (ApplicationException ex) { Frontend.ShowError(_Dialog, ex.Message); } catch (Exception ex) { #if LOG4NET _Logger.Error(ex); #endif Frontend.ShowException(_Dialog, ex); } } private void _OnCancelButtonClicked(object sender, EventArgs e) { Trace.Call(sender, e); try { _Dialog.Destroy(); } catch (Exception ex) { #if LOG4NET _Logger.Error(ex); #endif Frontend.ShowException(_Dialog, ex); } } private void _MenuTreeViewSelectionChanged(object sender, EventArgs e) { Trace.Call(sender, e); Gtk.TreeIter iter; Gtk.TreeModel model; if (_MenuTreeView.Selection.GetSelected(out model, out iter)) { Page activePage = (Page)model.GetValue(iter, 0); _Notebook.CurrentPage = (int)activePage; } } private void OnOverrideForegroundColorCheckButtonToggled(object sender, EventArgs e) { Trace.Call(sender, e); try { ((Gtk.ColorButton) _Glade["ForegroundColorButton"]).Sensitive = ((Gtk.CheckButton) _Glade["OverrideForegroundColorCheckButton"]).Active; } catch (Exception ex) { Frontend.ShowException(ex); } } private void OnOverrideBackgroundColorCheckButtonToggled(object sender, EventArgs e) { Trace.Call(sender, e); try { ((Gtk.ColorButton) _Glade["BackgroundColorButton"]).Sensitive = ((Gtk.CheckButton) _Glade["OverrideBackgroundColorCheckButton"]).Active; } catch (Exception ex) { Frontend.ShowException(ex); } } private void OnOverrideFontCheckButtonToggled(object sender, EventArgs e) { Trace.Call(sender, e); try { ((Gtk.FontButton) _Glade["FontButton"]).Sensitive = ((Gtk.CheckButton) _Glade["OverrideFontCheckButton"]).Active; } catch (Exception ex) { Frontend.ShowException(ex); } } protected virtual void OnNotificationAreaIconCheckButtonToggled(object sender, EventArgs e) { Trace.Call(sender, e); try { bool isActive = ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Active; if (!isActive) { ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonClosed"]).Active = true; } ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonAlways"]).Sensitive = isActive; ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonMinimized"]).Sensitive = isActive; ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonClosed"]).Sensitive = isActive; } catch (Exception ex) { Frontend.ShowException(ex); } } private void CheckShowAdvancedSettingsCheckButton() { Trace.Call(); bool showAdvanced = ((Gtk.CheckButton) _Glade["ShowAdvancedSettingsCheckButton"]).Active; ((Gtk.Label) _Glade["ConnectionUsernameLabel"]).Visible = showAdvanced; ((Gtk.Entry) _Glade["ConnectionUsernameEntry"]).Visible = showAdvanced; ((Gtk.Label) _Glade["EncodingLabel"]).Visible = showAdvanced; ((Gtk.ComboBox) _Glade["EncodingComboBox"]).Visible = showAdvanced; ((Gtk.CheckButton) _Glade["AutoConvertUTF8CheckButton"]).Visible = showAdvanced; ((Gtk.Frame) _Glade["NetworkProxyFrame"]).Visible = showAdvanced; ((Gtk.Frame) _Glade["GlobalCommandsFrame"]).Visible = showAdvanced; } private void CheckProxyShowPasswordCheckButton() { Trace.Call(); ((Gtk.Entry) _Glade["ProxyPasswordEntry"]).Visibility = ((Gtk.CheckButton) _Glade["ProxyShowPasswordCheckButton"]).Active; } private void CheckProxyTypeComBoBox() { Trace.Call(); var typoComboBox = (Gtk.ComboBox) _Glade["ProxyTypeComboBox"]; var hostEntry = (Gtk.Entry) _Glade["ProxyHostEntry"]; var portSpinButton = (Gtk.SpinButton) _Glade["ProxyPortSpinButton"]; var userEntry = (Gtk.Entry) _Glade["ProxyUsernameEntry"]; var passEntry = (Gtk.Entry) _Glade["ProxyPasswordEntry"]; Gtk.TreeIter iter; typoComboBox.GetActiveIter(out iter); var proxyType = (ProxyType) typoComboBox.Model.GetValue(iter, 0); switch (proxyType) { case ProxyType.None: case ProxyType.System: hostEntry.Sensitive = false; portSpinButton.Sensitive = false; userEntry.Sensitive = false; passEntry.Sensitive = false; break; case ProxyType.Http: hostEntry.Sensitive = true; portSpinButton.Sensitive = true; userEntry.Sensitive = false; userEntry.Text = String.Empty; passEntry.Sensitive = false; passEntry.Text = String.Empty; break; case ProxyType.Socks4: case ProxyType.Socks4a: case ProxyType.Socks5: hostEntry.Sensitive = true; portSpinButton.Sensitive = true; userEntry.Sensitive = true; passEntry.Sensitive = true; break; } } private static string _(string msg) { return Mono.Unix.Catalog.GetString(msg); } } } smuxi-0.11/src/Makefile.in0000644000175000017500000005711712311344231016237 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/AssemblyVersion.cs.in $(srcdir)/smuxi-win32.nsis.in \ ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = AssemblyVersion.cs smuxi-win32.nsis CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = Common Engine Engine-IRC Engine-Twitter Engine-Campfire \ Engine-JabbR Engine-XMPP Server Frontend Frontend-GNOME \ Frontend-GNOME-IRC Frontend-GNOME-Twitter Frontend-GNOME-XMPP \ Frontend-STFL Frontend-Curses Frontend-SWF Frontend-Test DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ # Engines @ENABLE_ENGINE_IRC_TRUE@ENGINE_IRC = Engine-IRC @ENABLE_ENGINE_XMPP_TRUE@ENGINE_XMPP = Engine-XMPP @ENABLE_ENGINE_TWITTER_TRUE@ENGINE_TWITTER = Engine-Twitter @ENABLE_ENGINE_CAMPFIRE_TRUE@ENGINE_CAMPFIRE = Engine-Campfire @ENABLE_ENGINE_JABBR_TRUE@ENGINE_JABBR = Engine-JabbR # Frontends @ENABLE_FRONTEND_GNOME_TRUE@FRONTEND_GNOME = Frontend-GNOME @ENABLE_FRONTEND_GNOME_IRC_TRUE@FRONTEND_GNOME_IRC = Frontend-GNOME-IRC @ENABLE_FRONTEND_GNOME_TWITTER_TRUE@FRONTEND_GNOME_TWITTER = Frontend-GNOME-Twitter @ENABLE_FRONTEND_GNOME_XMPP_TRUE@FRONTEND_GNOME_XMPP = Frontend-GNOME-XMPP @ENABLE_FRONTEND_STFL_TRUE@FRONTEND_STFL = Frontend-STFL @ENABLE_FRONTEND_CURSES_TRUE@FRONTEND_CURSES = Frontend-Curses @ENABLE_FRONTEND_SWF_TRUE@FRONTEND_SWF = Frontend-SWF #FRONTEND_WPF = Frontend-WPF @ENABLE_FRONTEND_TEST_TRUE@FRONTEND_TEST = Frontend-Test SUBDIRS = Common \ Engine \ $(ENGINE_IRC) \ $(ENGINE_TWITTER) \ $(ENGINE_CAMPFIRE) \ $(ENGINE_JABBR) \ $(ENGINE_XMPP) \ Server \ Frontend \ $(FRONTEND_GNOME) \ $(FRONTEND_GNOME_IRC) \ $(FRONTEND_GNOME_TWITTER) \ $(FRONTEND_GNOME_XMPP) \ $(FRONTEND_STFL) \ $(FRONTEND_CURSES) \ $(FRONTEND_SWF) \ $(FRONTEND_WPF) \ $(FRONTEND_TEST) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): AssemblyVersion.cs: $(top_builddir)/config.status $(srcdir)/AssemblyVersion.cs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ smuxi-win32.nsis: $(top_builddir)/config.status $(srcdir)/smuxi-win32.nsis.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: smuxi-0.11/src/Engine/0000755000175000017500000000000012311344240015364 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine/Chats/0000755000175000017500000000000012311344240016426 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine/Chats/PersonChatModel.cs0000644000175000017500000000351212257043746022025 0ustar00meebeymeebey00000000000000/* * $Id: ChannelPage.cs 137 2006-11-06 18:49:57Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/ChannelPage.cs $ * $Rev: 137 $ * $Author: meebey $ * $Date: 2006-11-06 19:49:57 +0100 (Mon, 06 Nov 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Smuxi.Common; namespace Smuxi.Engine { public class PersonChatModel : ChatModel { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private PersonModel _Person; public PersonModel Person { get { return _Person; } set { _Person = value; } } public PersonChatModel(PersonModel person, string id, string name, IProtocolManager networkManager) : base(id, name, ChatType.Person, networkManager) { _Person = person; } } } smuxi-0.11/src/Engine/Chats/ChatType.cs0000644000175000017500000000233011655545675020525 0ustar00meebeymeebey00000000000000/* * $Id: PageType.cs 149 2007-04-11 16:47:52Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/PageType.cs $ * $Rev: 149 $ * $Author: meebey $ * $Date: 2007-04-11 18:47:52 +0200 (Wed, 11 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ namespace Smuxi.Engine { public enum ChatType { Session, Protocol, Person, Group, } } smuxi-0.11/src/Engine/Chats/ChatModel.cs0000644000175000017500000002666112257043746020650 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2008, 2010-2011 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Collections; using System.Collections.Generic; using Smuxi.Common; namespace Smuxi.Engine { public abstract class ChatModel : PermanentRemoteObject, ITraceable { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif const string LibraryTextDomain = "smuxi-engine"; private string _ID; private string _Name; private ChatType _ChatType; private IProtocolManager _ProtocolManager; //private List _Messages = new List(); private bool _IsEnabled = true; // TODO: make persistent private DateTime _LastSeenHighlight; private string _LogFile; // TODO: make persistent public int Position { get; set; } public IMessageBuffer MessageBuffer { get; private set; } public int MessagesSyncCount { get; set; } public string ID { get { return _ID; } } public string Name { get { return _Name; } set { _Name = value; } } public ChatType ChatType { get { return _ChatType; } } public IProtocolManager ProtocolManager { get { return _ProtocolManager; } } [Obsolete("Use ChatModel.MessageBuffer instead.")] public IList Messages { get { try { return GetSyncMessages(); } catch (Exception ex) { #if LOG4NET _Logger.Error( String.Format( "{0}.get_Messages(): " + "GetSyncMessages() threw exception!", this ), ex ); #endif if (MessageBuffer is Db4oMessageBuffer) { #if LOG4NET _Logger.Error( String.Format( "{0}.get_Messages(): " + "Falling back to volatile message buffer...", this ) ); #endif ResetMessageBuffer(); InitMessageBuffer(MessageBufferPersistencyType.Volatile); var builder = new MessageBuilder(); builder.AppendEventPrefix(); builder.AppendErrorText( _("Failed to load chat history. " + "Your chat history will not be preserved. " + "Reason: {0}"), ex.Message ); MessageBuffer.Add(builder.ToMessage()); return GetSyncMessages(); } throw; } } } public virtual bool IsEnabled { get { return _IsEnabled; } internal set { _IsEnabled = value; } } public DateTime LastSeenHighlight { get { return _LastSeenHighlight; } set { _LastSeenHighlight = value; } } public string LogFile { get { if (_LogFile == null) { _LogFile = GetLogFile(); } return _LogFile; } } protected ChatModel(string id, string name, ChatType chatType, IProtocolManager networkManager) { _ID = id; _Name = name; _ChatType = chatType; _ProtocolManager = networkManager; Position = -1; if (ProtocolManager == null) { InitMessageBuffer(MessageBufferPersistencyType.Volatile); } } public override string ToString() { return String.Format("<{0}>", ToTraceString()); } public string ToTraceString() { string nm; if (_ProtocolManager == null) { nm = "(null)"; } else { nm = String.Format("{0}/{1}", _ProtocolManager.Protocol, _ProtocolManager.NetworkID ); } return nm + "/" + _Name; } public void ApplyConfig(UserConfig config) { Trace.Call(config); if (config == null) { throw new ArgumentNullException("config"); } MessagesSyncCount = (int) config["Interface/Notebook/EngineBufferLines"]; var enumStr = (string) config["MessageBuffer/PersistencyType"]; MessageBufferPersistencyType persistency; try { persistency = (MessageBufferPersistencyType) Enum.Parse( typeof(MessageBufferPersistencyType), enumStr, true ); } catch (ArgumentException ex) { #if LOG4NET _Logger.Error("ApplyConfig(): failed to parse " + "PersistencyType: " + enumStr, ex); #endif persistency = MessageBufferPersistencyType.Volatile; } InitMessageBuffer(persistency); var maxCapacityKey = String.Format("MessageBuffer/{0}/MaxCapacity", persistency.ToString()); MessageBuffer.MaxCapacity = (int) config[maxCapacityKey]; } public void Close() { if (MessageBuffer != null) { MessageBuffer.Dispose(); } } private string GetLogFile() { if (_ProtocolManager == null) { return null; } var logPath = Platform.LogPath; var protocol = _ProtocolManager.Protocol.ToLower(); var network = _ProtocolManager.NetworkID.ToLower(); logPath = Path.Combine(logPath, protocol); if (network != protocol) { logPath = Path.Combine(logPath, network); } logPath = IOSecurity.GetFilteredPath(logPath); if (!Directory.Exists(logPath)) { Directory.CreateDirectory(logPath); } var chatId = IOSecurity.GetFilteredFileName(ID.ToLower()); logPath = Path.Combine(logPath, String.Format("{0}.log", chatId)); return logPath; } IList GetSyncMessages() { // during cloning, someone could modify it and break the enumerator lock (MessageBuffer) { if (MessageBuffer.Count == 0) { return new List(0); } if (MessagesSyncCount <= 0) { return new List(MessageBuffer); } else { var offset = MessageBuffer.Count - MessagesSyncCount; if (offset < 0) { offset = 0; } return MessageBuffer.GetRange(offset, MessagesSyncCount); } } } public void InitMessageBuffer(MessageBufferPersistencyType persistency) { Trace.Call(persistency); if (MessageBuffer != null) { return; } switch (persistency) { case MessageBufferPersistencyType.Volatile: MessageBuffer = new ListMessageBuffer(); break; case MessageBufferPersistencyType.Persistent: try { var start = DateTime.UtcNow; MessageBuffer = new Db4oMessageBuffer( ProtocolManager.Session.Username, ProtocolManager.Protocol, ProtocolManager.NetworkID, ID ); var stop = DateTime.UtcNow; #if LOG4NET _Logger.DebugFormat( "InitMessageBuffer(): initializing " + "Db4oMessageBuffer({0}, {1}, {2}, {3}) " + "took: {4:0.00} ms", ProtocolManager.Session.Username, ProtocolManager.Protocol, ProtocolManager.NetworkID, ID, (stop - start).TotalMilliseconds ); #endif } catch (Exception ex) { #if LOG4NET _Logger.Error( "InitMessageBuffer(): Db4oMessageBuffer() threw " + "exception, falling back to memory backend!", ex ); #endif MessageBuffer = new ListMessageBuffer(); var builder = new MessageBuilder(); builder.AppendEventPrefix(); builder.AppendErrorText( _("Failed to open chat history for writing. " + "Your chat history will not be preserved. " + "Reason: {0}"), ex.Message ); MessageBuffer.Add(builder.ToMessage()); } break; } } public void ResetMessageBuffer() { Trace.Call(); if (MessageBuffer == null) { // nothing to reset return; } lock (MessageBuffer) { try { MessageBuffer.Dispose(); } catch (Exception ex) { #if LOG4NET _Logger.Warn( "ResetMessageBuffer(): MessageBuffer.Dispose() " + "threw exception!", ex ); #endif } } MessageBuffer = null; } static string _(string msg) { return LibraryCatalog.GetString(msg, LibraryTextDomain); } } } smuxi-0.11/src/Engine/Chats/ProtocolChatModel.cs0000644000175000017500000000310111655545675022363 0ustar00meebeymeebey00000000000000/* * $Id: ChannelPage.cs 137 2006-11-06 18:49:57Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/ChannelPage.cs $ * $Rev: 137 $ * $Author: meebey $ * $Date: 2006-11-06 19:49:57 +0100 (Mon, 06 Nov 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Smuxi.Common; namespace Smuxi.Engine { public class ProtocolChatModel : ChatModel { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public ProtocolChatModel(string id, string name, IProtocolManager networkManager) : base(id, name, ChatType.Protocol, networkManager) { } } } smuxi-0.11/src/Engine/Chats/GroupChatModel.cs0000644000175000017500000001767411700531610021651 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2009, 2011 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using System.Collections.Specialized; using Smuxi.Common; namespace Smuxi.Engine { public class GroupChatModel : ChatModel { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif //private Hashtable _Persons = Hashtable.Synchronized(new Hashtable()); // shouldn't need threadsafe wrapper, only the "owning" IRC thread should write to it private Dictionary _Persons = new Dictionary(); private bool _IsSynced; // HACK: IRC specific? private MessageModel _Topic; private int _PersonCount = -1; public override bool IsEnabled { get { return base.IsEnabled; } internal set { base.IsEnabled = value; if (!value) { _Topic = null; _Persons.Clear(); _IsSynced = false; } } } public MessageModel Topic { get { return _Topic; } set { _Topic = value; } } // safe version public IDictionary Persons { get { // during cloning, someone could modify it and break the enumerator lock (_Persons) { // HACK: return null if the dictionary is empty as MS .NET // deserializer doesn't like the Mono one, see: // http://projects.qnetp.net/issues/show/198 if (_Persons.Count == 0) { return null; } return new Dictionary(_Persons, _Persons.Comparer); } } } // ProtocolManagers need access to this public IDictionary UnsafePersons { get { lock (_Persons) { return _Persons; } } } public IEqualityComparer UnsafePersonsComparer { get { lock (_Persons) { return _Persons.Comparer; } } set { if (value == null) { return; } lock (_Persons) { _Persons = new Dictionary(_Persons, value); } } } public int PersonCount { get { if (_PersonCount != -1) { return _PersonCount; } return _Persons.Count; } set { _PersonCount = value; } } public bool IsSynced { get { return _IsSynced; } set { _IsSynced = value; } } public GroupChatModel(string id, string name, IProtocolManager networkManager) : base(id, name, ChatType.Group, networkManager) { } public PersonModel GetPerson(string id) { if (id == null) { throw new ArgumentNullException("id"); } PersonModel personModel; _Persons.TryGetValue(id, out personModel); return personModel; } public PersonModel PersonLookup(string identityName) { Trace.Call(identityName); #if LOG4NET _Logger.Debug("PersonLookup(): GroupChatModel.Name: " + Name); #endif int identityNameLength = identityName.Length; // must use a safe version (copy) here of Users, public methods which can be used by a frontend (or many) var persons = Persons; if (persons == null) { return null; } foreach (PersonModel person in persons.Values) { if ((person.IdentityName.Length >= identityNameLength) && (person.IdentityName.Substring(0, identityNameLength).ToLower() == identityName.ToLower())) { #if LOG4NET _Logger.Debug("PersonLookup(): found: " + person.IdentityName); #endif return person; } } #if LOG4NET _Logger.Debug("PersonLookup() no matching identityName found"); #endif return null; } public IList PersonLookupAll(string identityName) { Trace.Call(identityName); //IList foundPersons = new List(); IList foundIdentityNames = new List(); int identityNameLength = identityName.Length; string longestIdentityName = String.Empty; // must use a copy here of Users, public method which can be used by a frontend (or many) var persons = Persons; if (persons == null) { return foundIdentityNames; } foreach (PersonModel person in persons.Values) { if ((person.IdentityName.Length >= identityNameLength) && (person.IdentityName.Substring(0, identityNameLength).ToLower() == identityName.ToLower())) { foundIdentityNames.Add(person.IdentityName); if (person.IdentityName.Length > longestIdentityName.Length) { longestIdentityName = person.IdentityName; } } } // guess the common part of the found nicknames string common_nick = identityName; bool match = true; while (match) { if (common_nick.Length >= longestIdentityName.Length) { break; } common_nick += longestIdentityName[common_nick.Length]; foreach (string name in foundIdentityNames) { if (!name.ToLower().StartsWith(common_nick.ToLower())) { common_nick = common_nick.Substring(0, common_nick.Length - 1); match = false; } } } if (foundIdentityNames.Count == 0) { #if LOG4NET _Logger.Debug("PersonLookupAll(): no matching identityName found"); #endif } else if (foundIdentityNames.Count == 1) { #if LOG4NET _Logger.Debug("PersonLookupAll(): found exact match: " + foundIdentityNames[0]); #endif } else { #if LOG4NET _Logger.Debug("PersonLookupAll(): found " + foundIdentityNames.Count + " matches"); #endif foundIdentityNames.Insert(0, common_nick); } return foundIdentityNames; } } } smuxi-0.11/src/Engine/Chats/SessionChatModel.cs0000644000175000017500000000245711700531605022175 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008, 2011 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.Engine { public class SessionChatModel : ChatModel { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public SessionChatModel(string id, string name) : base(id, name, ChatType.Session, null) { Position = 0; } } } smuxi-0.11/src/Engine/SessionManager.cs0000644000175000017500000001006512307031750020637 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections; using Smuxi.Common; namespace Smuxi.Engine { public class SessionManager : PermanentRemoteObject { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private Hashtable _Sessions = Hashtable.Synchronized(new Hashtable()); private Version _EngineVersion; private Config _Config; private ProtocolManagerFactory _ProtocolManagerFactory; public Version EngineVersion { get { return _EngineVersion; } } public SessionManager(Config config, ProtocolManagerFactory protocolManagerFactory) { Trace.Call(config, protocolManagerFactory); if (config == null) { throw new ArgumentNullException("config"); } if (protocolManagerFactory == null) { throw new ArgumentNullException("protocolManagerFactory"); } _Config = config; _ProtocolManagerFactory = protocolManagerFactory; // BUG: out of scope? _EngineVersion = Engine.Version; string[] users = (string[])Engine.Config["Engine/Users/Users"]; if (users == null) { Console.WriteLine("No Engine/Users/*, aborting...\n"); Environment.Exit(1); } foreach (string user in users) { // skip local session if (user == "local") { continue; } #if LOG4NET _Logger.Debug("Creating Session for User "+user); #endif _Sessions.Add(user, new Session(_Config, _ProtocolManagerFactory, user)); } } public Session Register(string username, string password, IFrontendUI ui) { Trace.Call(username, "XXX", ui); if (username == null) { throw new ArgumentNullException("username"); } if (password == null) { throw new ArgumentNullException("password"); } if (ui == null) { throw new ArgumentNullException("ui"); } string configPassword = (string)Engine.Config["Engine/Users/"+username+"/Password"]; if (configPassword == null || configPassword == String.Empty) { return null; } // calculate MD5 string from config password configPassword = MD5.FromString(configPassword); if (configPassword == password) { Session sess = (Session)_Sessions[username]; sess.RegisterFrontendUI(ui); return sess; } return null; } internal void Shutdown() { lock (_Sessions) { foreach (Session session in _Sessions.Values) { session.Shutdown(); } } } } } smuxi-0.11/src/Engine/TextColor.cs0000644000175000017500000001240412250426550017646 0ustar00meebeymeebey00000000000000/* * $Id: Config.cs 100 2005-08-07 14:54:22Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/Config.cs $ * $Rev: 100 $ * $Author: meebey $ * $Date: 2005-08-07 16:54:22 +0200 (Sun, 07 Aug 2005) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Runtime.Serialization; using System.Globalization; using Smuxi.Common; namespace Smuxi.Engine { [Serializable] public class TextColor : ISerializable { public static readonly TextColor None = new TextColor(); public static readonly TextColor Black = new TextColor(0, 0, 0); public static readonly TextColor White = new TextColor(255, 255, 255); public static readonly TextColor Grey = new TextColor(128, 128, 128); private int f_Value; public int Value { get { return f_Value; } set { f_Value = value; } } public string HexCode { get { return f_Value.ToString("X6"); } } public byte Red { get { return (byte) ((f_Value & 0xFF0000) >> 16); } } public byte Green { get { return (byte) ((f_Value & 0xFF00) >> 8); } } public byte Blue { get { return (byte) (f_Value & 0xFF); } } public TextColor() { f_Value = -1; } public TextColor(int value) { f_Value = value; } public TextColor(uint value) { f_Value = checked((int) value); } public TextColor(byte red, byte green, byte blue) { f_Value = red << 16 | green << 8 | blue; } protected TextColor(SerializationInfo info, StreamingContext ctx) { SerializationReader sr = SerializationReader.GetReader(info); SetObjectData(sr); } protected virtual void SetObjectData(SerializationReader sr) { f_Value = sr.ReadInt32(); } protected virtual void GetObjectData(SerializationWriter sw) { sw.Write(f_Value); } public virtual void GetObjectData(SerializationInfo info, StreamingContext ctx) { SerializationWriter sw = SerializationWriter.GetWriter(); GetObjectData(sw); sw.AddToInfo(info); } public static TextColor Parse(string hexCode) { if (hexCode == null) { throw new ArgumentNullException("hexCode"); } if (hexCode.StartsWith("#")) { // remove leading "#" character hexCode = hexCode.Substring(1); } if (hexCode.Length != 6) { throw new ArgumentException("Hexcode value must be exact 6 characters long (without prefix).", "hexCode"); } int red = Int16.Parse(hexCode.Substring(0, 2), NumberStyles.HexNumber); int green = Int16.Parse(hexCode.Substring(2, 2), NumberStyles.HexNumber); int blue = Int16.Parse(hexCode.Substring(4, 2), NumberStyles.HexNumber); return new TextColor((byte) red, (byte) green, (byte) blue); } public override string ToString() { return String.Format("#{0}", HexCode); } public override bool Equals(object obj) { TextColor value = obj as TextColor; return Equals(value); } public bool Equals(TextColor value) { if ((object) value == null) { return false; } return f_Value == value.Value; } public override int GetHashCode() { return f_Value.GetHashCode(); } public static bool operator ==(TextColor x, TextColor y) { if (Object.ReferenceEquals(x, y)) { return true; } if (((object) x == null) || ((object) y == null)) { return false; } return x.Equals(y); } public static bool operator !=(TextColor x, TextColor y) { return !(x == y); } } } smuxi-0.11/src/Engine/IFrontendUI.cs0000644000175000017500000000346611655545675020103 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ namespace Smuxi.Engine { public interface IFrontendUI { int Version { get; } void AddChat(ChatModel chat); void EnableChat(ChatModel chat); void DisableChat(ChatModel chat); void AddMessageToChat(ChatModel chat, MessageModel msg); void RemoveChat(ChatModel chat); void SyncChat(ChatModel chat); void AddPersonToGroupChat(GroupChatModel groupChat, PersonModel person); void UpdatePersonInGroupChat(GroupChatModel groupChat, PersonModel oldPerson, PersonModel newPerson); void UpdateTopicInGroupChat(GroupChatModel groupChat, MessageModel topic); void RemovePersonFromGroupChat(GroupChatModel groupChat, PersonModel person); void SetNetworkStatus(string status); void SetStatus(string status); // Presence? // File Transfer? } } smuxi-0.11/src/Engine/Engine.cs0000644000175000017500000000737312257043746017152 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using Smuxi.Common; namespace Smuxi.Engine { public class Engine { private static bool _IsInitialized; private static Version _Version; private static string _VersionNumber; private static string _VersionString; private static Config _Config; private static SessionManager _SessionManager; private static ProtocolManagerFactory _ProtocolManagerFactory; public static Version Version { get { return _Version; } } public static string VersionString { get { return _VersionString; } } public static Config Config { get { return _Config; } } public static ProtocolManagerFactory ProtocolManagerFactory { get { return _ProtocolManagerFactory; } } public static SessionManager SessionManager { get { return _SessionManager; } } public static bool IsInitialized { get { return _IsInitialized; } } public static void Init() { if (_IsInitialized) { return; } _IsInitialized = true; var asm = Assembly.GetEntryAssembly(); if (asm == null) { asm = Assembly.GetAssembly(typeof(Engine)); } var asm_name = asm.GetName(false); _Version = asm_name.Version; _VersionNumber = asm_name.Version.ToString(); var distVersion = Defines.DistVersion; if (!String.IsNullOrEmpty(distVersion)) { distVersion = String.Format(" ({0})", distVersion); } _VersionString = String.Format( "{0} {1}{2} - running on {3} {4}", Path.GetFileNameWithoutExtension(asm_name.Name), _Version, distVersion, Platform.OperatingSystem, Platform.Architecture ); _Config = new Config(); _Config.Load(); _Config.Save(); string location = Assembly.GetExecutingAssembly().Location; _ProtocolManagerFactory = new ProtocolManagerFactory(); _ProtocolManagerFactory.LoadAllProtocolManagers(Path.GetDirectoryName(location)); _SessionManager = new SessionManager(_Config, _ProtocolManagerFactory); } public static void Shutdown() { SessionManager.Shutdown(); Environment.Exit(0); } } } smuxi-0.11/src/Engine/CertificateValidator.cs0000644000175000017500000000766012253423337022026 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; using System.Collections.Generic; using Smuxi.Common; namespace Smuxi.Engine { public class CertificateValidator { #if LOG4NET static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public List HostnameWhitelist { get; private set; } public List HashWhitelist { get; private set; } public CertificateValidator() { HostnameWhitelist = new List(); HashWhitelist = new List(); #if LOG4NET if (ServicePointManager.ServerCertificateValidationCallback != null) { Logger.Warn( "CertificateValidator.ctor(): overwriting existing " + "ServicePointManager.ServerCertificateValidationCallback" ); } #endif ServicePointManager.ServerCertificateValidationCallback = ValidateCertificate; } bool ValidateCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { Trace.Call(sender, "(X509Certificate)", chain, sslPolicyErrors); if (sslPolicyErrors == SslPolicyErrors.None) { return true; } var hash = certificate.GetCertHashString(); string hostname = null; if (sender is HttpWebRequest) { var request = (HttpWebRequest) sender; hostname = request.RequestUri.Host; } var certInfo = String.Format( "\n Subject: '{0}'" + "\n Issuer: '{1}'" + "\n Hash: '{2}'" + "\n Hostname: '{3}'", certificate.Subject, certificate.Issuer, hash, hostname ); lock (HashWhitelist) { if (HashWhitelist.Contains(hash)) { #if LOG4NET Logger.DebugFormat( "ValidateCertificate(): Validated certificate " + "via hash whitelist: {0}", certInfo ); #endif return true; } } if (hostname != null) { lock (HostnameWhitelist) { if (HostnameWhitelist.Contains(hostname)) { #if LOG4NET Logger.DebugFormat( "ValidateCertificate(): Validated certificate " + "via hostname whitelist: {0}", certInfo ); #endif return true; } } } #if LOG4NET Logger.ErrorFormat( "ValidateCertificate(): Validation failed: {0}" + "\n SslPolicyErrors: {1}", certInfo, sslPolicyErrors ); #endif return false; } } } smuxi-0.11/src/Engine/ChangeLog0000644000175000017500000002015611655545675017173 0ustar00meebeymeebey000000000000002009-01-01 Mirco Bauer * Session.cs: use variable in translatable strings 2009-01-01 Mirco Bauer * Session.cs: nicer message 2009-01-01 Mirco Bauer * FrontendManager.cs: Don't prevent removing chats when they are not synced yet, as that causes a race condition when someone enters and leaves right-away a chat and thus is not being on the frontend side. Also problematic servers (like psyBNC) could cause such "enter chat, no sync, can't remove chat" situation. (closes trac bug #144) 2008-12-31 Mirco Bauer * Session.cs: Added Connect() method that allows frontends to create new connections in a protocol neutral way. 2008-12-28 Mirco Bauer * Config/Config.cs: Make sure Username and Password are initialized empty, as there can't be default values in the config for those. 2008-12-28 Mirco Bauer * Makefile.am: Replaced hardcoded gmcs calls with configure variable. 2008-12-28 Mirco Bauer * Chats/ChatModel.cs: Implemented remembering last seen highlight in chats, so frontends will not re-highlight when re-attaching. (closes trac ticket #97) 2008-12-26 Mirco Bauer 2008-12-26 Mirco Bauer * Session.cs: Added GetUri() method. Moved smuxi welcome message code to RegisterFrontendUI(). Added IsLocal property. * FrontendManager.cs: Fixed TaskQueue usage, AbortedEvent was not used. Use Finalizer/Dispose pattern to shut-down TaskQueue. Removed some unneeded casts. Refactored some if () blocks to if (!) return. 2008-12-22 Mirco Bauer * Messages/MessageType.cs: Ups forgot to commit this one. 2008-12-22 Mirco Bauer * Config/Config.cs, Config/NotificationAreaIconMode.cs, Engine.mdp: Made notification area icon configurable, supporting: never, always, minimize to tray, close to tray. (closes trac ticket #137) 2008-12-19 Mirco Bauer * Protocols/ProtocolManagerBase.cs: Ignore case for matching URLs. (closes trac bug #131) 2008-12-19 Mirco Bauer * Config/Config.cs: Implemented support for changing the text wrap mode from character to word. (closes trac ticket #5) 2008-12-18 Mirco Bauer * Config/Config.cs: Increased default buffer lines from 100 to 500, else we have almost no backlog. 2008-12-18 Mirco Bauer * Session.cs: Limit engine buffer lines to 10 for local sessions. (closes trac ticket #114) Fixed help message on the smuxi page. 2008-12-17 Mirco Bauer * Messages/MessagePartModel.cs, Messages/TextMessagePartModel.cs: Use nicer field name convention. 2008-12-17 Mirco Bauer * Config/Config.cs: Renamed ModeColor to EventColor. * Messages/MessageModel.cs: Added MessageType. 2008-09-28 Mirco Bauer * Session.cs: Don't throw exception in DeregisterFrontendManager(FrontendManager) as the frontend manager might be cleanly gone already at that point. (closes trac ticket #117) 2008-09-28 Mirco Bauer * Config/FrontendConfig.cs: Implemented SSH tunnel support. (closes trac ticket #64) 2008-09-23 Mirco Bauer * FrontendManager.cs: Replaced poor mans Queue in FrontendManager with TaskQueue from Alan McGovern . 2008-09-04 Mirco Bauer * Session.cs: Added hint about /help command to smuxi page. 2008-08-31 Mirco Bauer * Engine.mdp: Added po files to MonoDevelop projects. 2008-08-25 Mirco Bauer * Engine.cs: Show platform and CPU bit count in version string. 2008-08-25 Mirco Bauer * Engine.cs: Fixed switching between local engine and remote engine back and forth. (closes trac bug #106) 2008-08-24 Mirco Bauer * Messages/UrlMessagePartModel.cs: Fallback to HTTP. 2008-08-24 Mirco Bauer * FrontendManager.cs, Protocols/ProtocolManagerBase.cs, Session.cs: Using LibraryCatalog now. 2008-08-22 Mirco Bauer * Config/ServerListController.cs: Throw exception in AddServer() if the server exists already. (closes trac bug #100) Added null checks to all methods. 2008-08-21 Mirco Bauer * Persons/ContactModel.cs, Persons/PersonModel.cs: Fixed whitespace (replaced \t with 4 spaces). 2008-08-21 Mirco Bauer * Session.cs: Don't handle quit command in session. (closes trac bug #92) 2008-08-04 Mirco Bauer * TextColor.cs: Renamed HexCode to Value. Added HexCode property returning a #XXXXXX string. Implemented ToString(), GetHashCode(), Equals(), ==, and !=. Added ctor with RGB as byte parameters. 2008-07-27 Mirco Bauer * AssemblyInfo.cs, AssemblyInfo.cs.in: Removed AssemblyInfo.cs.in files, not needed anymore as we use a shared AssemblyVersion.cs(.in) now. 2008-07-27 Mirco Bauer * Engine.mdp: Removed assembly attributes that are now part of the shared AssemblyVersion.cs file. 2008-07-17 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.6.0. 2008-07-16 Mirco Bauer * Config/Config.cs: Implemented basic theming support (closes trac bug #19). 2008-07-15 Mirco Bauer * Protocols/IProtocolManager.cs, Protocols/ProtocolManagerBase.cs: Added FindGroupChats(). Added OpenChat(). Added CloseChat(). * Chats/GroupChatModel.cs: Added PersonCount property. * Chats/ChatModel.cs: Made ctor protected. 2008-07-14 Mirco Bauer 2008-07-14 Mirco Bauer * Config/Config.cs: Added OFTC, GIMPNet, EFnet, IRCnet and freenode as default IRC servers. New users will join #smuxi on the first start automatically. 2008-06-30 Mirco Bauer * Session.cs: Expose session chat as property. Added check for auto-connect that /connect was passed, as required by the protocol manager implementations. Only pass password to IProtocolManager.Connect() if it's not null and not empty. 2008-06-25 Mirco Bauer * Protocols/IProtocolManager.cs, Protocols/ProtocolManagerBase.cs: Expose chats owned by the protocol manager. 2008-06-02 Mirco Bauer * Session.cs: Nicer code path. 2008-06-02 Mirco Bauer * Engine.mdp, Chats/ChatType.cs, Chats/ProtocolChatModel.cs, Chats/NetworkChatModel.cs: Renamed confusing NetworkChatModel to ProtocolChatModel and ChatType.Network to ChatType.Protocol. 2008-04-01 Mirco Bauer * AssemblyInfo.cs: Bumped version to 0.5.31 2008-03-04 Mirco Bauer * Protocols/ProtocolManagerFactory.cs: Skip abstract classes that implement IProtocolManager. 2008-03-02 Mirco Bauer * Session.cs: Implemented SessionChat*, abusing NetworkChat* as smuxi chat was a dirty hack. Register ProtocolManagers when connecting automatically to servers. * Chats/ChatModel.cs: Fixed indention. * Chats/ChatType.cs, Chats/SessionChatModel.cs: Implemented SessionChat*, abusing NetworkChat* as smuxi chat was a dirty hack. 2008-03-02 Mirco Bauer * Protocols/ProtocolManagerBase.cs: Fixed highlight, formatting and colors of messages that contain URLs. 2008-03-02 Mirco Bauer * Protocols/ProtocolManagerBase.cs: Fixed parsing of URLs. 2008-01-31 Mirco Bauer * Session.cs, FrontendManager.cs: Deregister the FrontendManager by using the FrontendManager instance instead of the remoting URI which caused an unhandled exception. The the UI object is usually unusable in that stage (the frontend is disconnected), this fixes the crash bug with Mono 1.2.6 after a frontend disconnects. * AssemblyInfo.cs: Bumped version to 0.5.30. 2007-12-25 Mirco Bauer * Engine.mdp: Updated using MonoDevelop 0.18.1 smuxi-0.11/src/Engine/Messages/0000755000175000017500000000000012311344240017133 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine/Messages/MessageBuilder.cs0000644000175000017500000010220312300201645022352 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010-2014 Mirco Bauer // Copyright (c) 2013 Oliver Schneider // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Collections.Generic; using System.IO; using System.Xml; using System.Web; using Smuxi.Common; namespace Smuxi.Engine { public class MessageBuilder { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif static readonly string LibraryTextDomain = "smuxi-engine"; MessageModel Message { get; set; } public PersonModel Me { get; set; } public MessageBuilderSettings Settings { get; set; } public MessageType MessageType { get { return Message.MessageType; } set { Message.MessageType = value; } } public DateTime TimeStamp { get { return Message.TimeStamp; } set { Message.TimeStamp = value; } } public bool IsEmpty { get { return Message.IsEmpty; } } public MessageBuilder() { Message = new MessageModel(); Settings = new MessageBuilderSettings(); } public MessageModel ToMessage() { Message.Compact(); return Message; } public virtual void ApplyConfig(UserConfig userConfig) { if (userConfig == null) { throw new ArgumentNullException("userConfig"); } Settings.ApplyConfig(userConfig); } public virtual MessageBuilder Append(MessagePartModel msgPart) { if (msgPart == null) { throw new ArgumentNullException("msgPart"); } Message.MessageParts.Add(msgPart); return this; } public virtual MessageBuilder Append(IEnumerable msgParts) { if (msgParts == null) { throw new ArgumentNullException("msgParts"); } foreach (var part in msgParts) { Append(part); } return this; } public virtual MessageBuilder Append(MessageModel msg) { if (msg == null) { throw new ArgumentNullException("msg"); } foreach (var part in msg.MessageParts) { Append(part); } return this; } public virtual TextMessagePartModel CreateText(TextMessagePartModel text) { if (text == null) { throw new ArgumentNullException("text"); } return new TextMessagePartModel(text); } public virtual TextMessagePartModel CreateText(string text, params object[] args) { if (text == null) { throw new ArgumentNullException("text"); } if (args != null && args.Length > 0) { text = String.Format(text, args); } return new TextMessagePartModel(text); } public virtual TextMessagePartModel CreateText() { return new TextMessagePartModel(); } public virtual MessageBuilder AppendText(TextMessagePartModel textPart) { return Append(textPart); } public MessageBuilder AppendText(IEnumerable text) { if (text == null) { throw new ArgumentNullException("text"); } foreach (var textPart in text) { AppendText(textPart); } return this; } public virtual MessageBuilder AppendText(string text, params object[] args) { text = text ?? String.Empty; if (text.Length == 0) { return this; } var textPart = CreateText(text, args); return AppendText(textPart); } public virtual TextMessagePartModel CreateSpace() { return CreateText(" "); } public MessageBuilder AppendSpace() { return AppendText(CreateSpace()); } public virtual TextMessagePartModel CreateEventPrefix() { return CreateText("-!- "); } public virtual MessageBuilder AppendEventPrefix() { MessageType = MessageType.Event; return AppendText(CreateEventPrefix()); } public virtual TextMessagePartModel CreateActionPrefix() { return CreateText(" * "); } public virtual MessageBuilder AppendActionPrefix() { return AppendText(CreateActionPrefix()); } public virtual UrlMessagePartModel CreateUrl(string url, string text) { if (url == null) { throw new ArgumentNullException("url"); } return new UrlMessagePartModel(url, text); } public UrlMessagePartModel CreateUrl(string url) { return CreateUrl(url, null); } public virtual MessageBuilder AppendUrl(string url, string text) { return Append(CreateUrl(url, text)); } public MessageBuilder AppendUrl(string url) { return AppendUrl(url, null); } public virtual IList CreateHeader(string text, params object[] args) { if (text == null) { throw new ArgumentNullException("text"); } var prefix = CreateText("["); var suffix = CreateText("]"); var headerText = CreateText(text, args); headerText.Bold = true; var header = new List(3); header.Add(prefix); header.Add(headerText); header.Add(suffix); return header; } public virtual MessageBuilder AppendHeader(string text, params object[] args) { text = text ?? String.Empty; return AppendText(CreateHeader(text, args)); } public virtual MessageBuilder AppendMessage(string msg) { return Append(ParsePatterns(CreateText(msg))); } public MessageBuilder AppendMessage(ContactModel sender, string msg) { if (sender != null) { AppendSenderPrefix(sender); } return AppendMessage(msg); } public virtual MessageBuilder AppendWarningText(string errorText, params object[] args) { var text = CreateText(errorText, args); text.Bold = true; return AppendText(text); } public virtual MessageBuilder AppendErrorText(string errorText, params object[] args) { var text = CreateText(errorText, args); text.ForegroundColor = new TextColor(255, 0, 0); text.Bold = true; text.IsHighlight = true; return AppendText(text); } public virtual TextMessagePartModel CreateIdendityName(ContactModel identity) { if (identity == null) { throw new ArgumentNullException("identity"); } if (!Settings.NickColors) { return CreateText(identity.IdentityName); } var identityName = CreateText(identity.IdentityNameColored); // don't clutter with the bg color identityName.BackgroundColor = TextColor.None; return identityName; } public virtual MessageBuilder AppendIdendityName(ContactModel identity, bool isHighlight) { if (identity == null) { throw new ArgumentNullException("identity"); } var identityName = CreateIdendityName(identity); identityName.IsHighlight = isHighlight; return AppendText(identityName); } public MessageBuilder AppendIdendityName(ContactModel identity) { return AppendIdendityName(identity, false); } public virtual IList CreateNick(ContactModel contact) { if (contact == null) { throw new ArgumentNullException("contact"); } var prefix = CreateText("<"); var suffix = CreateText(">"); var nick = CreateIdendityName(contact); if (Settings.NickColors) { // using bg colors for the nick texts are too intrusive, thus // map the bg color to the fg color of the surrounding tags var senderBgColor = contact.IdentityNameColored.BackgroundColor; if (senderBgColor != TextColor.None) { prefix.ForegroundColor = senderBgColor; suffix.ForegroundColor = senderBgColor; nick.BackgroundColor = TextColor.None; } } var senderMsg = new List(3); senderMsg.Add(prefix); senderMsg.Add(nick); senderMsg.Add(suffix); return senderMsg; } public virtual MessageBuilder AppendNick(ContactModel contact) { if (contact == null) { throw new ArgumentNullException("contact"); } return AppendText(CreateNick(contact)); } public virtual IList CreateSenderPrefix(ContactModel contact) { if (contact == null) { throw new ArgumentNullException("contact"); } var sender = CreateNick(contact); sender.Add(CreateSpace()); return sender; } public virtual MessageBuilder AppendSenderPrefix(ContactModel contact, bool isHighlight) { if (contact == null) { throw new ArgumentNullException("sender"); } var senderMsg = CreateSenderPrefix(contact); /* // 1st element is prefix // 3rdt element is prefix if (isHighlight) { // HACK: reset fg color of prefix and suffix so highlight color // will be applied instead senderMsg[0].ForegroundColor = TextColor.None; senderMsg[2].ForegroundColor = TextColor.None; } */ // 2nd element is the nick senderMsg[1].IsHighlight = isHighlight; foreach (var senderPart in senderMsg) { AppendText(senderPart); } return this; } public MessageBuilder AppendSenderPrefix(ContactModel sender) { return AppendSenderPrefix(sender, false); } public bool ContainsHighlight() { return ContainsHighlight(Message.ToString()); } public virtual bool ContainsHighlight(string text) { Regex regex; if (Me != null) { // First check to see if our current nick is in there. regex = new Regex( String.Format( "(^|\\W){0}($|\\W)", Regex.Escape(Me.IdentityName) ), RegexOptions.IgnoreCase ); if (regex.Match(text).Success) { return true; } } // go through the user's custom highlight words and check for them. foreach (string highLightWord in Settings.HighlightWords) { if (String.IsNullOrEmpty(highLightWord)) { continue; } if (highLightWord.StartsWith("/") && highLightWord.EndsWith("/")) { // This is a regex, so just build a regex out of the string. regex = new Regex( highLightWord.Substring(1, highLightWord.Length - 2) ); } else { // Plain text - make a regex that matches the word as long as it's separated properly. string regex_string = String.Format( "(^|\\W){0}($|\\W)", Regex.Escape(highLightWord) ); regex = new Regex(regex_string, RegexOptions.IgnoreCase); } if (regex.Match(text).Success) { return true; } } return false; } public virtual void MarkHighlights() { bool containsHighlight = false; foreach (var part in Message.MessageParts) { if (!(part is TextMessagePartModel)) { continue; } var textPart = (TextMessagePartModel) part; if (String.IsNullOrEmpty(textPart.Text)) { // URLs without a link name don't have text continue; } if (ContainsHighlight(textPart.Text)) { containsHighlight = true; } } if (!containsHighlight) { // nothing to do return; } MarkAsHighlight(); } public virtual void MarkAsHighlight() { // colorize the whole message foreach (MessagePartModel msgPart in Message.MessageParts) { if (!(msgPart is TextMessagePartModel)) { continue; } TextMessagePartModel textMsg = (TextMessagePartModel) msgPart; if (textMsg.ForegroundColor != null && textMsg.ForegroundColor != TextColor.None) { // HACK: don't overwrite colors as that would replace // nick-colors for example continue; } // HACK: we have to mark all parts as highlight else // ClearHighlights() has no chance to properly undo all // highlights textMsg.IsHighlight = true; textMsg.ForegroundColor = Settings.HighlightColor; } } public virtual void ClearHighlights() { foreach (var msgPart in Message.MessageParts) { if (!msgPart.IsHighlight || !(msgPart is TextMessagePartModel)) { continue; } var textMsg = (TextMessagePartModel) msgPart; textMsg.IsHighlight = false; textMsg.ForegroundColor = null; } return; } void ParseStyle(XmlNode style, TextMessagePartModel submodel) { if (style == null) return; var properties = style.InnerText.Split(';'); foreach (string property in properties) { var colonpos = property.IndexOf(':'); if (colonpos == -1) continue; string name = property.Substring(0, colonpos).Trim(); string value = property.Substring(colonpos+1).Trim(); switch (name) { case "background": value = value.Split(' ')[0]; submodel.BackgroundColor = TextColor.Parse(value); break; case "background-color": submodel.BackgroundColor = TextColor.Parse(value); break; case "color": submodel.ForegroundColor = TextColor.Parse(value); break; case "font-style": if (value == "normal") { submodel.Italic = false; } else if (value == "inherit") { } else { submodel.Italic = true; } break; case "font-weight": if (value == "normal") { submodel.Bold = false; } else if (value == "inherit") { } else { submodel.Bold = true; } break; case "text-decoration": { foreach (string val in value.Split(' ')) { if (val == "underline") { submodel.Underline = true; } } } break; case "font-family": case "font-size": case "text-align": case "margin-left": case "margin-right": default: // ignore formatting break; } } } void ParseHtml(XmlNode node, TextMessagePartModel model) { TextMessagePartModel submodel; string nodetype = node.Name.ToLower(); if (model is UrlMessagePartModel) { submodel = new UrlMessagePartModel(model); } else if (nodetype == "a") { submodel = new UrlMessagePartModel(model); (submodel as UrlMessagePartModel).Url = node.Attributes.GetNamedItem("href").Value; } else { submodel = new TextMessagePartModel(model); } switch (nodetype) { case "b": case "strong": submodel.Bold = true; break; case "i": case "em": submodel.Italic = true; break; case "u": submodel.Underline = true; break; default: break; } if (node.Attributes != null) { ParseStyle(node.Attributes.GetNamedItem("style"), submodel); } if (node.HasChildNodes) { foreach (XmlNode child in node.ChildNodes) { // clone this model TextMessagePartModel nextmodel; if (submodel is UrlMessagePartModel) { nextmodel = new UrlMessagePartModel(submodel); } else { nextmodel = new TextMessagePartModel(submodel); } ParseHtml(child, nextmodel); } } else { // final node if (nodetype == "br") { AppendText("\n"); } else if (nodetype == "img") { AppendUrl(node.Attributes.GetNamedItem("src").Value, "[image placeholder - UNIMPLEMENTED]"); } else { model.Text = HttpUtility.HtmlDecode(node.Value); AppendText(model); } } } public virtual MessageBuilder AppendHtmlMessage(string html) { html = NormalizeNewlines(html); XmlDocument doc = new XmlDocument(); try { // wrap in div to prevent messages beginning with text from failing "to be xml" doc.Load(new StringReader(""+html+"")); } catch (XmlException ex) { #if LOG4NET f_Logger.Error("AppendHtmlMessage(): error parsing html: " + html, ex); #endif AppendText(html); return this; } ParseHtml(doc, new TextMessagePartModel()); return this; } public virtual IList CreateFormat(string format, params object[] objs) { if (format == null) { throw new ArgumentNullException("format"); } if (objs == null) { throw new ArgumentNullException("objs"); } var parts = new List(); var assembling = new StringBuilder(format.Length); var inPlaceholder = false; for (int i = 0; i < format.Length; ++i) { char c = format[i]; char peek = (i < format.Length-1) ? format[i+1] : '\0'; if (c == '{') { if (peek == '{') { // escaped brace assembling.Append('{'); // skip the second brace too ++i; } else if (!inPlaceholder) { // we're parsing a placeholder here // first, append the currently assembled string parts.Add(CreateText(assembling.ToString())); // we will now assemble the placeholder text assembling.Length = 0; inPlaceholder = true; } else { // nested formatting?! throw new System.FormatException("nested formatting is forbidden"); } } else if (c == '}') { if (peek == '}') { // escaped brace assembling.Append('}'); // skip the second brace too ++i; } else if (inPlaceholder) { // substitute the placeholder var placeholderText = assembling.ToString(); uint placeholderInt; if (!uint.TryParse(placeholderText, out placeholderInt)) { // that's not even an integer... throw new System.FormatException("format placeholder must be an integer >= 0 in braces"); } if (placeholderInt >= objs.Length) { // placeholder out of bounds throw new System.FormatException("format placeholder number is greater than the array"); } var placeMe = objs[placeholderInt]; if (placeMe == null) { throw new System.FormatException("null object in objs array"); } else if (placeMe is String) { // append strings as-is parts.Add(CreateText((String) placeMe)); } else if (placeMe is ContactModel) { // append contacts as their identity names parts.Add(CreateIdendityName((ContactModel) placeMe)); } else if (placeMe is MessagePartModel) { // append the part verbatim parts.Add((MessagePartModel) placeMe); } else if (placeMe is MessageModel) { // append all parts of the message foreach (var part in ((MessageModel) placeMe).MessageParts) { parts.Add(part); } } else { // no idea how to format this throw new System.FormatException("unknown object type to format: " + placeMe.GetType().ToString()); } // we are done with this placeholder assembling.Length = 0; inPlaceholder = false; } else { // closing brace without opening brace throw new System.FormatException("format placeholder closing brace without corresponding opening brace"); } } else { // simply append assembling.Append(c); } } // done parsing if (inPlaceholder) { // unterminated brace throw new System.FormatException("format placeholder opening brace without corresponding closing brace"); } if (assembling.Length > 0) { // bit of text at the end parts.Add(CreateText(assembling.ToString())); } return parts; } public virtual MessageBuilder AppendFormat(string format, params object[] objs) { foreach (var part in CreateFormat(format, objs)) { Append(part); } return this; } public virtual MessageBuilder AppendChatState(ContactModel contact, MessageType state) { switch (state) { case MessageType.ChatStateComposing: if (Message.IsEmpty) { AppendActionPrefix(); AppendFormat(_("{0} is typing..."), contact); } break; case MessageType.ChatStatePaused: if (Message.IsEmpty) { AppendActionPrefix(); AppendFormat(_("{0} has stopped typing..."), contact); } break; case MessageType.ChatStateReset: break; default: throw new ArgumentException("state is not a ChatState", "state"); } MessageType = state; return this; } protected static string NormalizeNewlines(string text) { if (text == null) { throw new ArgumentNullException("text"); } if (!text.Contains("\n")) { // nothing to normalize return text; } var normalized = new StringBuilder(text.Length); text = text.Replace("\r\n", "\n"); foreach (var textPart in text.Split('\n')) { var trimmed = textPart.TrimEnd(' '); if (trimmed.Length == 0) { // skip empty lines continue; } normalized.AppendFormat("{0} ", trimmed); } // remove trailing space normalized.Length--; return normalized.ToString(); } public virtual MessageBuilder AppendPresenceState(ContactModel contact, MessageType state) { switch (state) { case MessageType.PresenceStateAway: if (Message.IsEmpty) { AppendActionPrefix(); AppendFormat(_("{0} is away"), contact); } break; case MessageType.PresenceStateOffline: if (Message.IsEmpty) { AppendActionPrefix(); AppendFormat(_("{0} is offline"), contact); } break; case MessageType.PresenceStateOnline: if (Message.IsEmpty) { AppendActionPrefix(); AppendFormat(_("{0} is online"), contact); } break; default: throw new ArgumentException("state is not a PresenceState", "state"); } MessageType = state; return this; } static string _(string msg) { return LibraryCatalog.GetString(msg, LibraryTextDomain); } public static IList ParsePatterns(TextMessagePartModel textPart, List patterns) { if (textPart == null) { throw new ArgumentNullException("textPart"); } if (patterns == null) { throw new ArgumentNullException("patterns"); } var msgParts = new List(); if (patterns.Count == 0) { // all patterns have been tried -> this text is PURE text msgParts.Add(textPart); return msgParts; } var remainingPatterns = new List(patterns); var pattern = remainingPatterns.First(); remainingPatterns.Remove(pattern); var match = pattern.MessagePartPattern.Match(textPart.Text); if (!match.Success) { // no matches in this MessagePart, try other smartlinks return ParsePatterns(textPart, remainingPatterns); } int lastindex = 0; do { var groupValues = new string[match.Groups.Count]; int i = 0; foreach (Group @group in match.Groups) { groupValues[i++] = @group.Value; } string url; if (String.IsNullOrEmpty(pattern.LinkFormat)) { url = match.Value; } else { url = String.Format(pattern.LinkFormat, groupValues); } string text; if (String.IsNullOrEmpty(pattern.TextFormat)) { text = match.Value; } else { text = String.Format(pattern.TextFormat, groupValues); } if (lastindex != match.Index) { // there were some non-matching-chars before the match // copy that to a TextMessagePartModel var notMatchPart = new TextMessagePartModel(textPart); // only take the proper chunk of text notMatchPart.Text = textPart.Text.Substring(lastindex, match.Index - lastindex); // and try other patterns on this part var parts = ParsePatterns(notMatchPart, remainingPatterns); foreach (var part in parts) { msgParts.Add(part); } } MessagePartModel msgPart; if (pattern.MessagePartType == typeof(UrlMessagePartModel)) { // no need to set URL and text if they are the same text = text == url ? null : text; msgPart = new UrlMessagePartModel(url, text); } else if (pattern.MessagePartType == typeof(ImageMessagePartModel)) { msgPart = new ImageMessagePartModel(url, text); } else { msgPart = new TextMessagePartModel(text); } msgParts.Add(msgPart); lastindex = match.Index + match.Length; match = match.NextMatch(); } while (match.Success); if (lastindex != textPart.Text.Length) { // there were some non-url-chars before this url // copy TextMessagePartModel var notMatchPart = new TextMessagePartModel(textPart); // only take the proper chunk of text notMatchPart.Text = textPart.Text.Substring(lastindex); // and try other smartlinks on this part var parts = ParsePatterns(notMatchPart, remainingPatterns); foreach (var part in parts) { msgParts.Add(part); } } return msgParts; } public IEnumerable ParsePatterns(TextMessagePartModel part) { return ParsePatterns(part, Settings.Patterns); } } } smuxi-0.11/src/Engine/Messages/MessageType.cs0000644000175000017500000000263712257043746021740 0ustar00meebeymeebey00000000000000/* * $Id: Config.cs 100 2005-08-07 14:54:22Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/Config.cs $ * $Rev: 100 $ * $Author: meebey $ * $Date: 2005-08-07 16:54:22 +0200 (Sun, 07 Aug 2005) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.Engine { public enum MessageType { Normal, Event, ChatStateComposing, ChatStatePaused, ChatStateReset, PresenceStateOffline, PresenceStateAway, PresenceStateOnline, ChatNameChanged, PersonChatPersonChanged } } smuxi-0.11/src/Engine/Messages/UrlMessagePartModel.cs0000644000175000017500000001003012264335155023347 0ustar00meebeymeebey00000000000000/* * $Id: Config.cs 100 2005-08-07 14:54:22Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/Config.cs $ * $Rev: 100 $ * $Author: meebey $ * $Date: 2005-08-07 16:54:22 +0200 (Sun, 07 Aug 2005) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Runtime.Serialization; using System.Text.RegularExpressions; using Smuxi.Common; namespace Smuxi.Engine { public enum UrlProtocol { None, Unknown, Irc, Http, Https, Ftp, Ftps, Telnet, MailTo } [Serializable] public class UrlMessagePartModel : TextMessagePartModel { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private string _Url; public string Url { get { if (_Url == null) { return Text; } return _Url; } set { _Url = value; } } public UrlMessagePartModel(string url) : this(url, null) { } public UrlMessagePartModel(TextMessagePartModel model) : base(model) { if (model is UrlMessagePartModel) { _Url = (model as UrlMessagePartModel)._Url; } } public UrlMessagePartModel(string url, string text): base(text) { _Url = url; } protected UrlMessagePartModel(SerializationInfo info, StreamingContext ctx) : base(info, ctx) { } protected override void SetObjectData(SerializationReader sr) { base.SetObjectData(sr); sr.ReadInt32(); _Url = sr.ReadString(); } protected override void GetObjectData(SerializationWriter sw) { base.GetObjectData(sw); sw.Write((Int32) UrlProtocol.Unknown); sw.Write(_Url); } public override string ToString() { if (Text == null) { return _Url; } else if (_Url == null) { return Text; } else if (Text == _Url) { return _Url; } else if (Text.Contains(_Url)) { return Text; } else { return "[" + _Url + " " + Text + "]"; } } public override bool Equals(object obj) { if (!(obj is UrlMessagePartModel)) { return false; } var urlPart = (UrlMessagePartModel) obj; return Equals(urlPart); } public override bool Equals(MessagePartModel part) { var urlPart = part as UrlMessagePartModel; if ((object) urlPart == null) { return false; } if (_Url != urlPart._Url) { return false; } return base.Equals(urlPart); } } } smuxi-0.11/src/Engine/Messages/MessagePartModel.cs0000644000175000017500000000674412250426550022700 0ustar00meebeymeebey00000000000000/* * $Id: Config.cs 100 2005-08-07 14:54:22Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/Config.cs $ * $Rev: 100 $ * $Author: meebey $ * $Date: 2005-08-07 16:54:22 +0200 (Sun, 07 Aug 2005) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Runtime.Serialization; using Smuxi.Common; namespace Smuxi.Engine { [Serializable] public abstract class MessagePartModel : ISerializable { private bool f_IsHighlight; public bool IsHighlight { get { return f_IsHighlight; } set { f_IsHighlight = value; } } protected MessagePartModel() { } protected MessagePartModel(bool highlight) { f_IsHighlight = highlight; } protected MessagePartModel(SerializationInfo info, StreamingContext ctx) { SerializationReader sr = SerializationReader.GetReader(info); SetObjectData(sr); } protected virtual void SetObjectData(SerializationReader sr) { f_IsHighlight = sr.ReadBoolean(); } protected virtual void GetObjectData(SerializationWriter sw) { sw.Write(f_IsHighlight); } public virtual void GetObjectData(SerializationInfo info, StreamingContext ctx) { SerializationWriter sw = SerializationWriter.GetWriter(); GetObjectData(sw); sw.AddToInfo(info); } public override int GetHashCode() { return f_IsHighlight.GetHashCode(); } public override bool Equals(object obj) { if (!(obj is MessagePartModel)) { return false; } var part = (MessagePartModel) obj; return Equals(part); } public virtual bool Equals(MessagePartModel part) { if ((object) part == null) { return false; } if (f_IsHighlight != part.IsHighlight) { return false; } return true; } public static bool operator ==(MessagePartModel a, MessagePartModel b) { if (System.Object.ReferenceEquals(a, b)) { return true; } if ((object) a == null || (object) b == null) { return false; } return a.Equals(b); } public static bool operator !=(MessagePartModel a, MessagePartModel b) { return !(a == b); } } } smuxi-0.11/src/Engine/Messages/FeedMessageBuilder.cs0000644000175000017500000000370212253423337023155 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Text; using System.Text.RegularExpressions; using Smuxi.Common; namespace Smuxi.Engine { public class FeedMessageBuilder : MessageBuilder { public FeedMessageBuilder() : base() { } public MessageBuilder Append(AtomEntry entry) { AppendEventPrefix(); AppendUrl(entry.Link[0].Url, entry.Title.Text); AppendText(" ({0})\n", entry.Published.ToShortDateString()); foreach (var content in entry.Content) { // TODO: convert HTML: to AppendHeader, and more // HACK: align with action prefix AppendText(" "); AppendMessage(HtmlToText(content.Text)); } return this; } string HtmlToText(string html) { html = NormalizeNewlines(html); // strip all HTML tags var text = Regex.Replace(html, "<[^>]+>", String.Empty); // strip leading and trailing whitespace text = text.Trim(); return text; } } } smuxi-0.11/src/Engine/Messages/TextMessagePartModel.cs0000644000175000017500000002074412250426550023541 0ustar00meebeymeebey00000000000000/* * $Id: Config.cs 100 2005-08-07 14:54:22Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/Config.cs $ * $Rev: 100 $ * $Author: meebey $ * $Date: 2005-08-07 16:54:22 +0200 (Sun, 07 Aug 2005) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Runtime.Serialization; using Smuxi.Common; namespace Smuxi.Engine { [Serializable] public class TextMessagePartModel : MessagePartModel { private TextColor f_ForegroundColor; private TextColor f_BackgroundColor; private bool f_Underline; private bool f_Bold; private bool f_Italic; private string f_Text; public TextColor ForegroundColor { get { return f_ForegroundColor; } set { if (value == null) { value = TextColor.None; } f_ForegroundColor = value; } } public TextColor BackgroundColor { get { return f_BackgroundColor; } set { if (value == null) { value = TextColor.None; } f_BackgroundColor = value; } } public bool Underline { get { return f_Underline; } set { f_Underline = value; } } public bool Bold { get { return f_Bold; } set { f_Bold = value; } } public bool Italic { get { return f_Italic; } set { f_Italic = value; } } public string Text { get { return f_Text; } set { f_Text = value; } } public int Length { get { if (f_Text == null) { return 0; } return f_Text.Length; } } public TextMessagePartModel() : base() { f_ForegroundColor = new TextColor(); f_BackgroundColor = new TextColor(); } public TextMessagePartModel(string text) : this(null, null, false, false, false, text, false) { } public TextMessagePartModel(string text, bool highlight) : this(null, null, false, false, false, text, highlight) { } public TextMessagePartModel(TextColor fgColor, TextColor bgColor, bool underline, bool bold, bool italic, string text, bool highlight) : base(highlight) { if (fgColor != null) { f_ForegroundColor = fgColor; } else { f_ForegroundColor = TextColor.None; } if (bgColor != null) { f_BackgroundColor = bgColor; } else { f_BackgroundColor = TextColor.None; } f_Underline = underline; f_Bold = bold; f_Italic = italic; f_Text = text; } public TextMessagePartModel(TextColor fgColor, TextColor bgColor, bool underline, bool bold, bool italic, string text) : this(fgColor, bgColor, underline, bold, italic, text, false) { } public TextMessagePartModel(TextMessagePartModel msgPart) { if (msgPart == null) { throw new ArgumentNullException("msgPart"); } f_ForegroundColor = msgPart.ForegroundColor; f_BackgroundColor = msgPart.BackgroundColor; f_Underline = msgPart.Underline; f_Bold = msgPart.Bold; f_Italic = msgPart.Italic; f_Text = msgPart.Text; } public override string ToString() { return Text; } public override int GetHashCode() { int hash = base.GetHashCode(); hash ^= ForegroundColor.GetHashCode(); hash ^= BackgroundColor.GetHashCode(); hash ^= Underline.GetHashCode(); hash ^= Bold.GetHashCode(); hash ^= Italic.GetHashCode(); if (Text != null) { hash ^= Text.GetHashCode(); } return hash; } public override bool Equals(object obj) { if (!(obj is TextMessagePartModel)) { return false; } var textPart = (TextMessagePartModel) obj; return Equals(textPart); } public bool AttributesEquals(TextMessagePartModel textPart) { if ((object) textPart == null) { return false; } if (f_ForegroundColor != textPart.ForegroundColor) { return false; } if (f_BackgroundColor != textPart.BackgroundColor) { return false; } if (f_Underline != textPart.Underline) { return false; } if (f_Bold != textPart.Bold) { return false; } if (f_Italic != textPart.Italic) { return false; } return base.Equals(textPart); } public override bool Equals(MessagePartModel part) { var textPart = part as TextMessagePartModel; if ((object) textPart == null) { return false; } if (!AttributesEquals(textPart)) { return false; } if (f_Text != textPart.Text) { return false; } return base.Equals(textPart); } protected TextMessagePartModel(SerializationInfo info, StreamingContext ctx) : base(info, ctx) { } protected override void SetObjectData(SerializationReader sr) { base.SetObjectData(sr); f_ForegroundColor = new TextColor(sr.ReadInt32()); f_BackgroundColor = new TextColor(sr.ReadInt32()); f_Underline = sr.ReadBoolean(); f_Bold = sr.ReadBoolean(); f_Italic = sr.ReadBoolean(); f_Text = sr.ReadString(); } protected override void GetObjectData(SerializationWriter sw) { base.GetObjectData(sw); sw.Write(f_ForegroundColor.Value); sw.Write(f_BackgroundColor.Value); sw.Write(f_Underline); sw.Write(f_Bold); sw.Write(f_Italic); sw.Write(f_Text); } public static bool operator ==(TextMessagePartModel a, TextMessagePartModel b) { if (System.Object.ReferenceEquals(a, b)) { return true; } if ((object) a == null || (object) b == null) { return false; } return a.Equals(b); } public static bool operator !=(TextMessagePartModel a, TextMessagePartModel b) { return !(a == b); } } } smuxi-0.11/src/Engine/Messages/ImageMessagePartModel.cs0000644000175000017500000000614111655545675023654 0ustar00meebeymeebey00000000000000/* * $Id: Config.cs 100 2005-08-07 14:54:22Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/Config.cs $ * $Rev: 100 $ * $Author: meebey $ * $Date: 2005-08-07 16:54:22 +0200 (Sun, 07 Aug 2005) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Runtime.Serialization; using System.Text.RegularExpressions; using Smuxi.Common; namespace Smuxi.Engine { [Serializable] public class ImageMessagePartModel : MessagePartModel { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private string f_ImageFileName; private string f_AlternativeText; public string ImageFileName { get { return f_ImageFileName; } set { f_ImageFileName = value; } } public string AlternativeText { get { return f_AlternativeText; } set { f_AlternativeText = value; } } public ImageMessagePartModel(string imageFileName, string alternativeText) { if (imageFileName == null) { throw new ArgumentNullException("imageFileName"); } f_ImageFileName = imageFileName; f_AlternativeText = alternativeText; } public ImageMessagePartModel(string imageFileName) : this(imageFileName, null) { } public override string ToString() { return AlternativeText; } protected ImageMessagePartModel(SerializationInfo info, StreamingContext ctx) : base(info, ctx) { } protected override void SetObjectData(SerializationReader sr) { base.SetObjectData(sr); f_ImageFileName = sr.ReadString(); f_AlternativeText = sr.ReadString(); } protected override void GetObjectData(SerializationWriter sw) { base.GetObjectData(sw); sw.Write( f_ImageFileName); sw.Write( f_AlternativeText); } } } smuxi-0.11/src/Engine/Messages/MessageModel.cs0000644000175000017500000002137212274103742022044 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2010 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Text; using System.Text.RegularExpressions; using System.Collections; using System.Collections.Generic; using System.Runtime.Serialization; using Smuxi.Common; namespace Smuxi.Engine { [Serializable] public class MessageModel : ISerializable { static readonly Regex NickRegex = new Regex("^<([^ ]+)> "); private DateTime f_TimeStamp; private IList f_MessageParts; private MessageType f_MessageType; [NonSerialized] private bool f_IsCompactable; public DateTime TimeStamp { get { return f_TimeStamp; } set { f_TimeStamp = value; } } public IList MessageParts { get { return f_MessageParts; } } public bool IsEmpty { get { return f_MessageParts.Count == 0; } } public MessageType MessageType { get { return f_MessageType; } set { f_MessageType = value; } } public bool IsCompactable { get { return f_IsCompactable; } set { f_IsCompactable = value; } } public MessageModel() { f_TimeStamp = DateTime.UtcNow; f_MessageParts = new List(); IsCompactable = true; } public MessageModel(string text, MessageType msgType) : this() { f_MessageParts.Add(new TextMessagePartModel(null, null, false, false, false, text)); f_MessageType = msgType; } public MessageModel(string text) : this(text, MessageType.Normal) { } public MessageModel(MessageModel msg) : this() { if (msg == null) { throw new ArgumentNullException("msg"); } var writer = SerializationWriter.GetWriter(); msg.GetObjectData(writer); var data = writer.GetData(); var reader = SerializationReader.GetReader(data); SetObjectData(reader); } protected MessageModel(SerializationInfo info, StreamingContext ctx) { SerializationReader sr = SerializationReader.GetReader(info); SetObjectData(sr); } protected virtual void SetObjectData(SerializationReader sr) { f_TimeStamp = sr.ReadDateTime(); f_MessageParts = sr.ReadList(); f_MessageType = (MessageType) sr.ReadInt32(); } protected virtual void GetObjectData(SerializationWriter sw) { if (IsCompactable) { // OPT: compact all parts before serialization Compact(); } sw.Write(f_TimeStamp); sw.Write(f_MessageParts); sw.Write((Int32) f_MessageType); } public virtual void GetObjectData(SerializationInfo info, StreamingContext ctx) { SerializationWriter sw = SerializationWriter.GetWriter(); GetObjectData(sw); sw.AddToInfo(info); } public override string ToString() { // OPT: StringBuilder's default of 16 chars is way too short for // a regular message. A regular message should be around 128 to // 256 chars StringBuilder sb = new StringBuilder(256); foreach (MessagePartModel part in MessageParts) { sb.Append(part.ToString()); } return sb.ToString(); } public override int GetHashCode() { return f_TimeStamp.GetHashCode(); } public override bool Equals(object obj) { if (!(obj is MessageModel)) { return false; } var msg = (MessageModel) obj; return Equals(msg); } public bool Equals(MessageModel msg) { if ((object) msg == null) { return false; } if (f_TimeStamp != msg.TimeStamp) { return false; } if (f_MessageType != msg.MessageType) { return false; } if (f_MessageParts.Count != msg.MessageParts.Count) { return false; } for (int i = 0; i < f_MessageParts.Count; i++) { if (f_MessageParts[i] != msg.MessageParts[i]) { return false; } } return true; } public void Compact() { // the idea is to glue each text part that has the same attributes // to a combined new one to reduce the number of parts as they are // expensive when serialized // nothing to glue if (MessageParts.Count <= 1) { return; } var parts = new List(MessageParts.Count); StringBuilder gluedText = null; bool dontMoveNext = false; var iter = MessageParts.GetEnumerator(); while (dontMoveNext || iter.MoveNext()) { dontMoveNext = false; var current = iter.Current; parts.Add(current); // we can only glue pure text (not URLs etc) if (current.GetType() != typeof(TextMessagePartModel)) { continue; } var currentText = (TextMessagePartModel) current; while (iter.MoveNext()) { var next = iter.Current; if (next.GetType() != typeof(TextMessagePartModel)) { parts.Add(next); break; } var nextText = (TextMessagePartModel) next; if (!currentText.AttributesEquals(nextText)) { // they aren't the same! no candidate for glueing :/ // but maybe the next part is dontMoveNext = true; break; } // glue time! if (gluedText == null) { // this is the first element of the gluing gluedText = new StringBuilder(256); gluedText.Append(currentText.Text); } gluedText.Append(nextText.Text); } if (gluedText != null) { currentText.Text = gluedText.ToString(); gluedText = null; } } f_MessageParts = parts; } public string GetNick() { // HACK: MessageModel doesn't contain a Sender/Origin property // yet, thus we have to retrieve the information from the // meesage itself // TODO: extend MessageModel with Origin property var msgText = ToString(); var match = NickRegex.Match(msgText); if (match.Success && match.Groups.Count >= 2) { return match.Groups[1].Value; } return null; } public static bool operator ==(MessageModel a, MessageModel b) { if (System.Object.ReferenceEquals(a, b)) { return true; } if ((object) a == null || (object) b == null) { return false; } return a.Equals(b); } public static bool operator !=(MessageModel a, MessageModel b) { return !(a == b); } } } smuxi-0.11/src/Engine/Makefile.am0000644000175000017500000001112212300201645017414 0ustar00meebeymeebey00000000000000TARGET_DIR = $(top_builddir)/bin/$(PROFILE) EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:CONFIG_NINI" -define:DB4O,DB4O_8_0 ASSEMBLY = ../../bin/release/smuxi-engine.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/release/smuxi-common.dll BUILD_DIR = ../../bin/release LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_COMMON_DLL_SOURCE=../../bin/release/smuxi-common.dll endif if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = @MCS@ ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET,CONFIG_NINI" -define:DB4O,DB4O_8_0 ASSEMBLY = ../../bin/debug/smuxi-engine.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/debug/smuxi-common.dll BUILD_DIR = ../../bin/debug LOG4NET_DLL_SOURCE=../../lib/log4net.dll SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll endif AL=al2 SATELLITE_ASSEMBLY_NAME=.resources.dll PROGRAMFILES = \ $(SMUXI_COMMON_DLL) LINUX_PKGCONFIG = \ $(ENGINE_PC) all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ CertificateValidator.cs \ CommandModel.cs \ Engine.cs \ FrontendManager.cs \ IFrontendUI.cs \ PermanentRemoteObject.cs \ PresenceStatus.cs \ Session.cs \ SessionManager.cs \ TextColor.cs \ TextColorContrast.cs \ TextColorPalettes.cs \ TextColorTools.cs \ MessageBuffers/Db4oMessageBuffer.cs \ MessageBuffers/IMessageBuffer.cs \ MessageBuffers/ListMessageBuffer.cs \ MessageBuffers/MessageBufferBase.cs \ MessageBuffers/MessageBufferPersistencyType.cs \ Messages/FeedMessageBuilder.cs \ Messages/MessageBuilder.cs \ Messages/MessageModel.cs \ Messages/MessagePartModel.cs \ Messages/TextMessagePartModel.cs \ Messages/UrlMessagePartModel.cs \ Messages/ImageMessagePartModel.cs \ Messages/MessageType.cs \ Chats/ChatType.cs \ Chats/ChatModel.cs \ Chats/GroupChatModel.cs \ Chats/PersonChatModel.cs \ Chats/SessionChatModel.cs \ Chats/ProtocolChatModel.cs \ Config/FrontendConfig.cs \ Config/NotificationAreaIconMode.cs \ Config/UserConfig.cs \ Config/Config.cs \ Config/ServerModel.cs \ Config/ServerListController.cs \ Config/UserListController.cs \ Config/FilterListController.cs \ Config/FilterModel.cs \ Config/ProxySettings.cs \ Config/ProxyType.cs \ Config/EntrySettings.cs \ Config/MessageBuilderSettings.cs \ Config/MessagePatternListController.cs \ Config/MessagePatternModel.cs \ Protocols/ProtocolManagerBase.cs \ Protocols/ProtocolManagerFactory.cs \ Protocols/ProtocolManagerInfoModel.cs \ Protocols/ProtocolManagerInfoAttribute.cs \ Protocols/IProtocolManager.cs \ Persons/PersonModel.cs \ Persons/ContactModel.cs \ Hooks/HookRunner.cs \ Hooks/Commands/HookCommand.cs \ Hooks/Commands/ProtocolManagerHookCommand.cs \ Hooks/Commands/SessionHookCommand.cs \ Hooks/Environments/ChatHookEnvironment.cs \ Hooks/Environments/CommandHookEnvironment.cs \ Hooks/Environments/HookEnvironment.cs \ Hooks/Environments/MessageHookEnvironment.cs \ Hooks/Environments/PersonHookEnvironment.cs \ Hooks/Environments/ProtocolManagerHookEnvironment.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-engine.pc.in REFERENCES = \ System.Runtime.Remoting \ System \ System.Core \ System.Web \ System.Xml \ Mono.Posix \ $(NINI_LIBS) \ $(LOG4NET_LIBS) \ $(DB4O_LIBS) \ $(DB4O_INCLUDED_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) include $(top_srcdir)/Makefile.include ENGINE_PC = $(BUILD_DIR)/smuxi-engine.pc SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll $(eval $(call emit-deploy-wrapper,ENGINE_PC,smuxi-engine.pc)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) if BUNDLE_NINI NINI_DLL = $(BUILD_DIR)/Nini.dll NINI_DLL_SOURCE = $(NINI_LIBS) PROGRAMFILES += $(NINI_DLL) $(eval $(call emit-deploy-target,NINI_DLL)) endif if BUNDLE_DB4O DB4O_INCLUDED_LIBS := $(foreach file, $(DB4O_FILES), $(TARGET_DIR)/$(file)) PROGRAMFILES += $(DB4O_INCLUDED_LIBS) endif $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) smuxi-0.11/src/Engine/AssemblyInfo.cs0000644000175000017500000000234512253423337020324 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Smuxi - engine")] [assembly: AssemblyCopyright("2005-2013 (C) Mirco Bauer ")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] smuxi-0.11/src/Engine/TextColorPalettes.cs0000644000175000017500000000377312253423337021364 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2012 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; namespace Smuxi.Engine { public static class TextColorPalettes { public static List LinuxConsole { get; set; } public static List Xterm { get; set; } static TextColorPalettes() { var hexColors = new string[] { "#000000", "#800000", "#008000", "#808000", "#000080", "#800080", "#008080", "#c0c0c0", "#808080", "#ff0000", "#00ff00", "#ffff00", "#0000ff", "#ff00ff", "#00ffff", "#ffffff" }; LinuxConsole = new List(16); foreach (var hexColor in hexColors) { LinuxConsole.Add(TextColor.Parse(hexColor)); } Xterm = new List(256); Xterm.AddRange(LinuxConsole); // TODO: add all xterm colors // http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html } } } smuxi-0.11/src/Engine/TextColorTools.cs0000644000175000017500000002336612253423337020703 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using System.Globalization; using Smuxi.Common; namespace Smuxi.Engine { public static class TextColorTools { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static Dictionary f_BestContrastColors; static Dictionary> NearestColors { get; set; } static TextColorTools() { f_BestContrastColors = new Dictionary(1024); NearestColors = new Dictionary>(16); } public static TextColor GetBestTextColor(TextColor fgColor, TextColor bgColor) { return GetBestTextColor(fgColor, bgColor, TextColorContrast.Medium); } public static TextColor GetBestTextColor(TextColor fgColor, TextColor bgColor, TextColorContrast neededContrast) { if (fgColor == null) { throw new ArgumentNullException("fgColor"); } if (bgColor == null) { throw new ArgumentNullException("bgColor"); } TextColor bestColor; int key = fgColor.Value ^ bgColor.Value ^ (int) neededContrast; if (f_BestContrastColors.TryGetValue(key, out bestColor)) { return bestColor; } double brDiff = GetBritnessDifference(bgColor, TextColor.White); int modifier = 0; // for bright backgrounds we need to go from bright to dark colors // for better contrast and for dark backgrounds the opposite if (brDiff < 127) { // bright background modifier = -10; } else { // dark background modifier = 10; } double lastDifference = 0; bestColor = fgColor; int attempts = 1; while (true) { double difference = GetLuminanceDifference(bestColor, bgColor); double needed = ((int) neededContrast) / 10d; if (difference > needed) { break; } #if LOG4NET && COLOR_DEBUG f_Logger.Debug("GetBestTextColor(): color has bad contrast: " + bestColor + " difference: " + difference + " needed: " + needed); #endif // change the fg color int red = bestColor.Red + modifier; int green = bestColor.Green + modifier; int blue = bestColor.Blue + modifier; // cap to allowed values if (modifier > 0) { if (red > 255) { red = 255; } if (green > 255) { green = 255; } if (blue > 255) { blue = 255; } } else { if (red < 0) { red = 0; } if (green < 0) { green = 0; } if (blue < 0) { blue = 0; } } bestColor = new TextColor((byte) red, (byte) green, (byte) blue); // in case we found no good color if (bestColor == TextColor.White || bestColor == TextColor.Black) { break; } attempts++; } #if LOG4NET && COLOR_DEBUG f_Logger.Debug( String.Format( "GetBestTextColor(): found good contrast: {0}|{1}={2} " + "({3}) attempts: {4}", fgColor, bgColor, bestColor, neededContrast, attempts ) ); #endif f_BestContrastColors.Add(key, bestColor); return bestColor; } // algorithm ported from PHP to C# from: // http://www.splitbrain.org/blog/2008-09/18-calculating_color_contrast_with_php public static double GetLuminanceDifference(TextColor color1, TextColor color2) { double L1 = 0.2126d * Math.Pow(color1.Red / 255d, 2.2d) + 0.7152d * Math.Pow(color1.Green / 255d, 2.2d) + 0.0722d * Math.Pow(color1.Blue / 255d, 2.2d); double L2 = 0.2126d * Math.Pow(color2.Red / 255d, 2.2d) + 0.7152d * Math.Pow(color2.Green / 255d, 2.2d) + 0.0722d * Math.Pow(color2.Blue / 255d, 2.2d); if (L1 > L2) { return (L1 + 0.05d) / (L2 + 0.05d); } else { return (L2 + 0.05d) / (L1 + 0.05d); } } public static double GetBritnessDifference(TextColor color1, TextColor color2) { double br1 = (299d * color1.Red + 587d * color1.Green + 114d * color1.Blue) / 1000d; double br2 = (299d * color2.Red + 587d * color2.Green + 114d * color2.Blue) / 1000d; return Math.Abs(br1 - br2); } // algorithm ported from JavaScript to C# from: // http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript internal static HslColor ToHSL(TextColor color) { var R = color.Red / 255d; var G = color.Green / 255d; var B = color.Blue / 255d; var max = Math.Max(Math.Max(R, G), B); var min = Math.Min(Math.Min(R, G), B); double H = 0d, S, L; var range = max + min; L = range / 2d; if (max == min) { S = 0d; // achromatic } else { var diff = max - min; S = L > 0.5d ? diff / (2 - diff) : diff / range; if (max == R) { H = (G - B) / diff + (G < B ? 6d : 0d); } else if (max == G) { H = (B - R) / diff + 2; } else if (max == B) { H = (R - G) / diff + 4; } H /= 6; } return new HslColor(H, S, L); } public static TextColor GetNearestColor(TextColor color, IEnumerable palette) { if (palette == null) { throw new ArgumentNullException("palette"); } TextColor nearestColor = null; Dictionary cache; if (NearestColors.TryGetValue(palette, out cache)) { if (cache.TryGetValue(color, out nearestColor)) { return nearestColor; } } else { cache = new Dictionary(1024); NearestColors.Add(palette, cache); } var hslColor1 = ToHSL(color); double nearestDifference = Double.MaxValue; foreach (var color2 in palette) { // compute the Euclidean distance between the two HSL colors // without root square as we only compare the values // see http://en.wikipedia.org/wiki/Color_difference#Delta_E var hslColor2 = ToHSL(color2); var H1 = hslColor1.Hue; var S1 = hslColor1.Saturation; var L1 = hslColor1.Lightness; var H2 = hslColor2.Hue; var S2 = hslColor2.Saturation; var L2 = hslColor2.Lightness; var Hdelta = H1 - H2; var Sdelta = S1 - S2; var Ldelta = L1 - L2; var deltaE = (Hdelta * Hdelta) + (Sdelta * Sdelta) + (Ldelta * Ldelta); if (deltaE < nearestDifference) { nearestDifference = deltaE; nearestColor = color2; } if (deltaE == 0d) { // found perfect match, can't get better than that break; } } cache.Add(color, nearestColor); return nearestColor; } internal class HslColor { public double Hue { get; set; } public double Saturation { get; set; } public double Lightness { get; set; } public HslColor(double H, double S, double L) { Hue = H; Saturation = S; Lightness = L; } } } } smuxi-0.11/src/Engine/smuxi-engine.pc.in0000644000175000017500000000023011655545675020751 0ustar00meebeymeebey00000000000000Name: smuxi-engine Description: smuxi's engine library Version: @VERSION@ Requires: smuxi-common Libs: -r:@expanded_libdir@/@PACKAGE@/smuxi-engine.dll smuxi-0.11/src/Engine/Protocols/0000755000175000017500000000000012311344240017350 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine/Protocols/ProtocolManagerInfoAttribute.cs0000644000175000017500000000445411655545675025533 0ustar00meebeymeebey00000000000000/* * $Id: CommandModel.cs 179 2007-04-21 15:01:29Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/CommandModel.cs $ * $Rev: 179 $ * $Author: meebey $ * $Date: 2007-04-21 17:01:29 +0200 (Sat, 21 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Smuxi.Common; namespace Smuxi.Engine { public class ProtocolManagerInfoAttribute : Attribute { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private string _Name; private string _Description; private string _Alias; public string Name { get { return _Name; } set { _Name = value; } } public string Description { get { return _Description; } set { _Description = value; } } public string Alias { get { return _Alias; } set { _Alias = value; } } public ProtocolManagerInfoAttribute() { } public ProtocolManagerInfoAttribute(string name, string description, string alias) { _Name = name; _Description = description; _Alias = alias; } } } smuxi-0.11/src/Engine/Protocols/IProtocolManager.cs0000644000175000017500000000432712257043746023132 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2008, 2010, 2011, 2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; namespace Smuxi.Engine { public interface IProtocolManager : IDisposable { Session Session { get; } string NetworkID { get; } string Protocol { get; } string Host { get; } int Port { get; } bool IsConnected { get; } PersonModel Me { get; } ChatModel Chat { get; } IList Chats { get; } PresenceStatus PresenceStatus { get; } void Connect(FrontendManager frontendManager, ServerModel server); void Disconnect(FrontendManager frontendManager); void Reconnect(FrontendManager frontendManager); bool Command(CommandModel command); string ToString(); event EventHandler Connected; event EventHandler Disconnected; IList FindGroupChats(GroupChatModel filter); void OpenChat(FrontendManager fm, ChatModel chat); void CloseChat(FrontendManager fm, ChatModel chat); void SetPresenceStatus(PresenceStatus status, string message); } } smuxi-0.11/src/Engine/Protocols/ProtocolManagerBase.cs0000644000175000017500000003276112300201645023576 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007-2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using SysDiag = System.Diagnostics; using System.Text; using System.Text.RegularExpressions; using System.Collections.Generic; using Smuxi.Common; namespace Smuxi.Engine { public abstract class ProtocolManagerBase : PermanentRemoteObject, IProtocolManager { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string _LibraryTextDomain = "smuxi-engine"; private Session _Session; private string _Host; private int _Port; private bool _IsConnected; private PresenceStatus _PresenceStatus; public PersonModel Me { get; protected set; } public event EventHandler Connected; public event EventHandler Disconnected; public event EventHandler MessageSent; public event EventHandler MessageReceived; public virtual string Host { get { return _Host; } protected set { _Host = value; } } public virtual int Port { get { return _Port; } protected set { _Port = value; } } public virtual bool IsConnected { get { return _IsConnected; } protected set { _IsConnected = value; } } public virtual PresenceStatus PresenceStatus { get { return _PresenceStatus; } set { _PresenceStatus = value; SetPresenceStatus(value, null); } } public abstract string NetworkID { get; } public abstract string Protocol { get; } public abstract ChatModel Chat { get; } public virtual IList Chats { get { IList chats = new List(); lock (_Session.Chats) { foreach (ChatModel chat in _Session.Chats) { if (chat.ProtocolManager == this) { chats.Add(chat); } } } return chats; } } public virtual Session Session { get { return _Session; } } protected bool DebugProtocol { get { #if LOG4NET var repo = log4net.LogManager.GetRepository(); // info is higher than debug return repo.Threshold <= log4net.Core.Level.Debug; #else return false; #endif } } protected ProtocolManagerBase(Session session) { Trace.Call(session); if (session == null) { throw new ArgumentNullException("session"); } _Session = session; } public virtual void Dispose() { Trace.Call(); foreach (ChatModel chat in Chats) { _Session.RemoveChat(chat); } } public override string ToString() { string result; if (Chat == null) { result = NetworkID; } else { result = Chat.Name; } if (!IsConnected) { result += " (" + _("not connected") + ")"; } return result; } public abstract bool Command(CommandModel cmd); public abstract void Connect(FrontendManager fm, ServerModel server); public abstract void Reconnect(FrontendManager fm); public abstract void Disconnect(FrontendManager fm); public abstract IList FindGroupChats(GroupChatModel filter); public abstract void OpenChat(FrontendManager fm, ChatModel chat); public abstract void CloseChat(FrontendManager fm, ChatModel chat); public abstract void SetPresenceStatus(PresenceStatus status, string message); protected void NotConnected(CommandModel cmd) { var msg = CreateMessageBuilder(); msg.AppendEventPrefix(); msg.AppendText(_("Not connected to server")); Session.AddMessageToFrontend(cmd, msg.ToMessage()); } protected void NotEnoughParameters(CommandModel cmd) { var msg = CreateMessageBuilder(); msg.AppendEventPrefix(); msg.AppendText(_("Not enough parameters for {0} command"), cmd.Command); Session.AddMessageToFrontend(cmd, msg.ToMessage()); } protected virtual void OnConnected(EventArgs e) { Trace.Call(e); var msg = CreateMessageBuilder(); msg.AppendEventPrefix(); msg.AppendText(_("Connected to {0}"), NetworkID); Session.AddMessageToChat(Chat, msg.ToMessage()); _PresenceStatus = PresenceStatus.Online; Session.UpdateNetworkStatus(); if (Connected != null) { Connected(this, e); } var hooks = new HookRunner("engine", "protocol-manager", "on-connected"); hooks.Environments.Add(new ChatHookEnvironment(Chat)); hooks.Environments.Add(new ProtocolManagerHookEnvironment(this)); var cmdChar = (string) Session.UserConfig["Interface/Entry/CommandCharacter"]; hooks.Commands.Add(new SessionHookCommand(Session, Chat, cmdChar)); hooks.Commands.Add(new ProtocolManagerHookCommand(this, Chat, cmdChar)); // show time hooks.Init(); hooks.Run(); } protected virtual void OnDisconnected(EventArgs e) { Trace.Call(e); var msg = CreateMessageBuilder(); msg.AppendEventPrefix(); msg.AppendText(_("Disconnected from {0}"), NetworkID); Session.AddMessageToChat(Chat, msg.ToMessage()); _PresenceStatus = PresenceStatus.Offline; Session.UpdateNetworkStatus(); if (Disconnected != null) { Disconnected(this, e); } var hooks = new HookRunner("engine", "protocol-manager", "on-disconnected"); hooks.Environments.Add(new ChatHookEnvironment(Chat)); hooks.Environments.Add(new ProtocolManagerHookEnvironment(this)); var cmdChar = (string) Session.UserConfig["Interface/Entry/CommandCharacter"]; hooks.Commands.Add(new SessionHookCommand(Session, Chat, cmdChar)); hooks.Commands.Add(new ProtocolManagerHookCommand(this, Chat, cmdChar)); // show time hooks.Init(); hooks.Run(); } protected virtual void OnMessageSent(MessageEventArgs e) { Trace.Call(e); if (MessageSent != null) { MessageSent(this, e); } var hooks = new HookRunner("engine", "protocol-manager", "on-message-sent"); hooks.Environments.Add(new ChatHookEnvironment(e.Chat)); var sender = e.Sender; if (String.IsNullOrEmpty(sender)) { sender = Me.ID; } hooks.Environments.Add(new MessageHookEnvironment(e.Message, sender, e.Receiver)); hooks.Environments.Add(new ProtocolManagerHookEnvironment(this)); var cmdChar = (string) Session.UserConfig["Interface/Entry/CommandCharacter"]; hooks.Commands.Add(new SessionHookCommand(Session, e.Chat, cmdChar)); hooks.Commands.Add(new ProtocolManagerHookCommand(this, e.Chat, cmdChar)); // show time hooks.Init(); hooks.Run(); } protected virtual void OnMessageReceived(MessageEventArgs e) { Trace.Call(e); if (MessageReceived != null) { MessageReceived(this, e); } var hooks = new HookRunner("engine", "protocol-manager", "on-message-received"); hooks.Environments.Add(new ChatHookEnvironment(e.Chat)); var receiver = e.Receiver; if (String.IsNullOrEmpty(receiver)) { receiver = Me.ID; } hooks.Environments.Add(new MessageHookEnvironment(e.Message, e.Sender, receiver)); hooks.Environments.Add(new ProtocolManagerHookEnvironment(this)); var cmdChar = (string) Session.UserConfig["Interface/Entry/CommandCharacter"]; hooks.Commands.Add(new SessionHookCommand(Session, e.Chat, cmdChar)); hooks.Commands.Add(new ProtocolManagerHookCommand(this, e.Chat, cmdChar)); // show time hooks.Init(); hooks.Run(); } private static string _(string msg) { return LibraryCatalog.GetString(msg, _LibraryTextDomain); } protected ChatModel GetChat(string id, ChatType chatType) { return _Session.GetChat(id, chatType, this); } protected virtual T GetPerson(ChatModel chat, string personId) where T : PersonModel { if (personId == null) { throw new ArgumentNullException("personId"); } T person = null; if (chat is GroupChatModel) { var groupChat = (GroupChatModel) chat; person = (T) groupChat.GetPerson(personId); } else if (chat is PersonChatModel) { var personChat = (PersonChatModel) chat; if (personId == personChat.Person.ID) { person = (T) personChat.Person; } else if (personId == Me.ID) { person = (T) Me; } } return person; } protected MessageBuilder CreateMessageBuilder() { return CreateMessageBuilder(); } protected virtual T CreateMessageBuilder() where T : MessageBuilder, new() { var builder = new T(); builder.Me = Me; // copy settings so the caller can override settings without // changing the settings of the complete session builder.Settings = new MessageBuilderSettings(Session.MessageBuilderSettings); return builder; } protected virtual void DebugRead(string data) { if (data == null) { throw new ArgumentNullException("data"); } if (Chat == null) { return; } if (!DebugProtocol) { return; } var msgBuilder = CreateMessageBuilder(); msgBuilder.MessageType = MessageType.Event; // HACK: extra leading space to align with "-!- " // HACK: extra trailing space to align with "WRITE: " msgBuilder.AppendText(" READ: "); msgBuilder.AppendText(data); Session.AddMessageToChat(Chat, msgBuilder.ToMessage()); } protected virtual void DebugWrite(string data) { if (data == null) { throw new ArgumentNullException("data"); } if (Chat == null) { return; } if (!DebugProtocol) { return; } var msgBuilder = CreateMessageBuilder(); msgBuilder.MessageType = MessageType.Event; // HACK: extra leading space to align with "-!- " msgBuilder.AppendText(" WRITE: "); msgBuilder.AppendText(data); Session.AddMessageToChat(Chat, msgBuilder.ToMessage()); } } public class MessageEventArgs : EventArgs { public ChatModel Chat { get; protected set; } public MessageModel Message { get; protected set; } public string Sender { get; protected set; } public string Receiver { get; protected set; } public MessageEventArgs(ChatModel chat, MessageModel msg, string sender, string receiver) { Chat = chat; Message = msg; Sender = sender; Receiver = receiver; } } } smuxi-0.11/src/Engine/Protocols/ProtocolManagerInfoModel.cs0000644000175000017500000000403311655545675024621 0ustar00meebeymeebey00000000000000/* * $Id: CommandModel.cs 179 2007-04-21 15:01:29Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/CommandModel.cs $ * $Rev: 179 $ * $Author: meebey $ * $Date: 2007-04-21 17:01:29 +0200 (Sat, 21 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Smuxi.Common; namespace Smuxi.Engine { [Serializable] public class ProtocolManagerInfoModel { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private string _Name; private string _Description; private string _Alias; public string Name { get { return _Name; } } public string Description { get { return _Description; } } public string Alias { get { return _Alias; } } public ProtocolManagerInfoModel(string name, string description, string alias) { _Name = name; _Description = description; _Alias = alias; } } } smuxi-0.11/src/Engine/Protocols/ProtocolManagerFactory.cs0000644000175000017500000001355312264335155024346 0ustar00meebeymeebey00000000000000/* * $Id: IrcProtocolManager.cs 149 2007-04-11 16:47:52Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/IrcProtocolManager.cs $ * $Rev: 149 $ * $Author: meebey $ * $Date: 2007-04-11 18:47:52 +0200 (Wed, 11 Apr 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Reflection; using System.Collections.Generic; using Smuxi.Common; namespace Smuxi.Engine { public class ProtocolManagerFactory { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private IDictionary _ProtocolManagerTypes = new Dictionary(); public IList ProtocolManagerInfos { get { return new List(_ProtocolManagerTypes.Keys); } } public ProtocolManagerFactory() { } public void LoadProtocolManager(string filename) { Trace.Call(filename); Assembly asm = Assembly.LoadFile(filename); Type[] types; try { types = asm.GetTypes(); } catch (ReflectionTypeLoadException ex) { #if LOG4NET _Logger.WarnFormat( "LoadProtocolManager(): GetTypes() on {0} threw exceptions", filename ); foreach (var loaderEx in ex.LoaderExceptions) { _Logger.Warn( "LoadProtocolManager(): LoaderException: ", loaderEx ); _Logger.Warn( "LoadProtocolManager(): LoaderException.InnerException: ", loaderEx.InnerException ); } #endif types = ex.Types; } foreach (Type type in types) { if (type.IsAbstract) { continue; } Type foundType = null; Type[] interfaceTypes = type.GetInterfaces(); foreach (Type interfaceType in interfaceTypes) { if (interfaceType == typeof(IProtocolManager)) { #if LOG4NET _Logger.Debug("LoadProtocolManager(): found " + type); #endif foundType = type; break; } } if (foundType == null) { continue; } // let's get the info attribute object[] attrs = foundType.GetCustomAttributes(typeof(ProtocolManagerInfoAttribute), true); if (attrs == null || attrs.Length == 0) { throw new ArgumentException("Assembly contains IProtocolManager but misses ProtocolManagerInfoAttribute", "filename"); //continue; } ProtocolManagerInfoAttribute attr = (ProtocolManagerInfoAttribute) attrs[0]; ProtocolManagerInfoModel info = new ProtocolManagerInfoModel(attr.Name, attr.Description, attr.Alias); _ProtocolManagerTypes.Add(info, foundType); } } public void LoadAllProtocolManagers(string path) { Trace.Call(path); string[] filenames = Directory.GetFiles(path, "smuxi-engine*.dll"); foreach (string filename in filenames) { LoadProtocolManager(filename); } } public ProtocolManagerInfoModel GetProtocolManagerInfoByAlias(string alias) { foreach (ProtocolManagerInfoModel info in _ProtocolManagerTypes.Keys) { if (info.Alias.Equals(alias, StringComparison.InvariantCultureIgnoreCase) || info.Name.Equals(alias, StringComparison.InvariantCultureIgnoreCase)) { return info; } } return null; } public IList GetProtocols() { IList protocols = new List(); foreach (ProtocolManagerInfoModel info in _ProtocolManagerTypes.Keys) { if (!protocols.Contains(info.Name)) { protocols.Add(info.Name); } } return protocols; } public IProtocolManager CreateProtocolManager(ProtocolManagerInfoModel info, Session session) { if (info == null) { throw new ArgumentNullException("info"); } if (session == null) { throw new ArgumentNullException("session"); } Type type = _ProtocolManagerTypes[info]; return (IProtocolManager) Activator.CreateInstance(type, session); } } } smuxi-0.11/src/Engine/Hooks/0000755000175000017500000000000012311344240016447 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine/Hooks/Commands/0000755000175000017500000000000012311344240020210 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine/Hooks/Commands/SessionHookCommand.cs0000644000175000017500000000327412257043746024330 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public class SessionHookCommand : HookCommand { Session Session { get; set; } ChatModel Chat { get; set; } string CommandCharacter { get; set; } public SessionHookCommand(Session session, ChatModel chat, string commandCharacter) { if (session == null) { throw new ArgumentNullException("session"); } Session = session; Chat = chat; CommandCharacter = commandCharacter; CommandName = "Session.Command"; } public override void Run(string commandLine) { var cmd = new CommandModel(null, Chat, CommandCharacter, commandLine); Session.Command(cmd); } } } smuxi-0.11/src/Engine/Hooks/Commands/ProtocolManagerHookCommand.cs0000644000175000017500000000345612257043746026003 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public class ProtocolManagerHookCommand : HookCommand { IProtocolManager ProtocolManager { get; set; } ChatModel Chat { get; set; } string CommandCharacter { get; set; } public ProtocolManagerHookCommand(IProtocolManager protocolManager, ChatModel chat, string commandCharacter) { if (protocolManager == null) { throw new ArgumentNullException("protocolManager"); } ProtocolManager = protocolManager; Chat = chat; CommandCharacter = commandCharacter; CommandName = "ProtocolManager.Command"; } public override void Run(string commandLine) { var cmd = new CommandModel(null, Chat, CommandCharacter, commandLine); ProtocolManager.Command(cmd); } } } smuxi-0.11/src/Engine/Hooks/Commands/HookCommand.cs0000644000175000017500000000214512257043746022760 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public abstract class HookCommand { public string CommandName { get; protected set; } protected HookCommand() { } public abstract void Run(string commandLine); } } smuxi-0.11/src/Engine/Hooks/Environments/0000755000175000017500000000000012311344240021136 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine/Hooks/Environments/CommandHookEnvironment.cs0000644000175000017500000000243112264335155026125 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public class CommandHookEnvironment : HookEnvironment { public CommandHookEnvironment(CommandModel cmd) { if (cmd == null) { throw new ArgumentNullException("cmd"); } this["CMD"] = cmd.Command; this["CMD_PARAMETER"] = cmd.Parameter; this["CMD_CHARACTER"] = cmd.CommandCharacter; } } } smuxi-0.11/src/Engine/Hooks/Environments/MessageHookEnvironment.cs0000644000175000017500000000431512257043746026142 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public class MessageHookEnvironment : HookEnvironment { static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0); public MessageHookEnvironment(MessageModel msg, string sender, string receiver) { if (msg == null) { throw new ArgumentNullException("msg"); } if (sender == null) { throw new ArgumentNullException("sender"); } if (receiver == null) { throw new ArgumentNullException("receiver"); } var nick = msg.GetNick(); var message = msg.ToString(); if (String.IsNullOrEmpty(nick)) { this["MSG"] = message; } else { this["MSG"] = message.Substring(nick.Length + 3); } this["MSG_TYPE"] = msg.MessageType.ToString(); var timestamp = (Int64) (msg .TimeStamp - UnixEpoch).TotalSeconds; this["MSG_TIMESTAMP_UNIX"] = timestamp.ToString(); this["MSG_TIMESTAMP_ISO_UTC"] = msg.TimeStamp.ToString("u").Replace('Z', ' ').TrimEnd(); this["MSG_TIMESTAMP_ISO_LOCAL"] = msg.TimeStamp.ToLocalTime().ToString("u").Replace('Z', ' ').TrimEnd(); this["SENDER"] = sender; this["RECEIVER"] = receiver; } } } smuxi-0.11/src/Engine/Hooks/Environments/PersonHookEnvironment.cs0000644000175000017500000000305412264335155026017 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2014 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public class PersonHookEnvironment : HookEnvironment { public PersonHookEnvironment(PersonModel person) : this(null, person) { } public PersonHookEnvironment(string prefix, PersonModel person) { if (person == null) { throw new ArgumentNullException("person"); } this[prefix + "PERSON_ID"] = person.ID; this[prefix + "PERSON_IDENTITY_NAME"] = person.IdentityName; this[prefix + "PERSON_NETWORK_ID"] = person.NetworkID; this[prefix + "PERSON_NETWORK_PROTOCOL"] = person.NetworkProtocol; } } } smuxi-0.11/src/Engine/Hooks/Environments/ProtocolManagerHookEnvironment.cs0000644000175000017500000000327712264335155027654 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public class ProtocolManagerHookEnvironment : HookEnvironment { public ProtocolManagerHookEnvironment(IProtocolManager protocolManager) { if (protocolManager == null) { throw new ArgumentNullException("protocolManager"); } this["PROTOCOL_MANAGER_PROTOCOL"] = protocolManager.Protocol; this["PROTOCOL_MANAGER_NETWORK"] = protocolManager.NetworkID; this["PROTOCOL_MANAGER_HOST"] = protocolManager.Host; this["PROTOCOL_MANAGER_PORT"] = protocolManager.Port.ToString(); if (protocolManager.Me != null) { this["PROTOCOL_MANAGER_ME_ID"] = protocolManager.Me.ID; } this["PROTOCOL_PRESENCE_STATUS"] = protocolManager.PresenceStatus.ToString(); } } } smuxi-0.11/src/Engine/Hooks/Environments/HookEnvironment.cs0000644000175000017500000000205612257043746024635 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; namespace Smuxi.Engine { public class HookEnvironment : Dictionary { public HookEnvironment() { } } } smuxi-0.11/src/Engine/Hooks/Environments/ChatHookEnvironment.cs0000644000175000017500000000241412257043746025433 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public class ChatHookEnvironment : HookEnvironment { public ChatHookEnvironment(ChatModel chat) { if (chat == null) { throw new ArgumentNullException("chat"); } this["CHAT_ID"] = chat.ID; this["CHAT_NAME"] = chat.Name; this["CHAT_TYPE"] = chat.ChatType.ToString(); } } } smuxi-0.11/src/Engine/Hooks/HookRunner.cs0000644000175000017500000001430512264335155021107 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2013 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.IO; using System.Linq; using System.Text; using System.Collections.Generic; using SysDiag = System.Diagnostics; namespace Smuxi.Engine { public class HookRunner { #if LOG4NET static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public Dictionary EnvironmentVariables { get; private set; } public List Environments { get; private set; } public List Commands { get; set; } public List Arguments { get; set; } List Hooks { get; set; } string[] PathElements { get; set; } string StateBasePath { get; set; } public bool HasHooks { get { return Hooks.Count > 0; } } public HookRunner(params string[] path) { if (path == null) { throw new ArgumentNullException("path"); } PathElements = path; EnvironmentVariables = new Dictionary(); Hooks = new List(); Environments = new List(); Commands = new List(); } public void Init() { var appData = Environment.GetFolderPath( Environment.SpecialFolder.LocalApplicationData ); StateBasePath = Path.Combine(appData, "smuxi"); StateBasePath = Path.Combine(StateBasePath, "hook-state"); foreach (var path in PathElements) { StateBasePath = Path.Combine(StateBasePath, path); } var hookPath = Path.Combine(appData, "smuxi"); hookPath = Path.Combine(hookPath, "hooks"); foreach (var path in PathElements) { hookPath = Path.Combine(hookPath, path); } if (!Directory.Exists(hookPath)) { return; } foreach (var file in Directory.GetFiles(hookPath).OrderBy(x => x)) { try { File.OpenRead(file).Close(); } catch (Exception ex) { #if LOG4NET Logger.Error("Init(): error opening " + file, ex); #endif continue; } Hooks.Add(file); } if (!HasHooks) { return; } var env = EnvironmentVariables; if (Engine.Version != null) { env.Add("ENGINE_VERSION", Engine.Version.ToString()); } foreach (var environment in Environments) { foreach (var entry in environment) { env.Add(entry.Key, entry.Value); } } } public void Run() { if (!HasHooks) { return; } foreach (var hook in Hooks) { RunHook(hook); } } void RunHook(string hookPath) { var hookFilename = Path.GetFileName(hookPath); var statePath = Path.Combine(StateBasePath, hookFilename); if (!Directory.Exists(statePath)) { Directory.CreateDirectory(statePath); } string hookArgs = null; if (Arguments != null && Arguments.Count > 0) { var args = new StringBuilder(256); foreach (var arg in Arguments) { // quote because of potential spaces and retarded Process API args.AppendFormat(@"""{0}"" ", arg); } // remove trailing space args.Length--; hookArgs = args.ToString(); } var startInfo = new SysDiag.ProcessStartInfo() { FileName = hookPath, Arguments = hookArgs, WorkingDirectory = statePath, UseShellExecute = false, RedirectStandardOutput = true }; // HACK: retarded API doesn't allow us to set the dictionary, // thus we have to copy all key/values into it var startEnv = startInfo.EnvironmentVariables; foreach (var entry in EnvironmentVariables) { startEnv.Add(String.Concat("SMUXI_", entry.Key), entry.Value); } #if LOG4NET Logger.Debug("Run(): executing " + hookPath); #endif var process = SysDiag.Process.Start(startInfo); while (!process.StandardOutput.EndOfStream) { var line = process.StandardOutput.ReadLine(); if (String.IsNullOrEmpty(line)) { continue; } try { // find matching hook command foreach (var cmd in Commands) { if (!line.StartsWith(cmd.CommandName + " ")) { continue; } var cmdLine = line.Substring(cmd.CommandName.Length + 1); cmd.Run(cmdLine); break; } } catch (Exception ex) { #if LOG4NET Logger.Error("Run(): error processing " + line, ex); #endif } } process.WaitForExit(); } } } smuxi-0.11/src/Engine/Config/0000755000175000017500000000000012311344240016571 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine/Config/Config.cs0000644000175000017500000010313312300201645020325 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2014 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Collections; using System.Collections.Generic; using Mono.Unix.Native; #if CONFIG_NINI using Nini.Config; using Nini.Ini; #endif using Smuxi.Common; namespace Smuxi.Engine { public class Config : PermanentRemoteObject { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif //protected int m_PreferencesVersion = 0; #if CONFIG_GCONF private GConf.Client _GConf = new GConf.Client(); private string _GConfPrefix = "/apps/smuxi/"; #elif CONFIG_NINI protected string m_ConfigPath; protected IniDocument m_IniDocument; //protected IConfigSource m_IniConfigSource; //protected IConfig m_IniConfig; protected string m_IniFilename; #endif protected bool m_IsCleanConfig; protected Hashtable m_Preferences = Hashtable.Synchronized(new Hashtable()); public event EventHandler Changed; public object this[string key] { get { return m_Preferences[key]; } set { if (value == null) { #if LOG4NET _Logger.Error("Passed null to indexer with key: " + key + ", ignored."); #endif return; } var oldValue = m_Preferences[key]; m_Preferences[key] = value; // only raise event if the value changed if (!value.Equals(oldValue)) { if (Changed != null) { Changed(this, new ConfigChangedEventArgs(key, value)); } } } } public bool IsCleanConfig { get { return m_IsCleanConfig; } } public Config() { #if CONFIG_NINI m_ConfigPath = Path.Combine(Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData), "smuxi"); if (!Directory.Exists(m_ConfigPath)) { Directory.CreateDirectory(m_ConfigPath); } m_IniFilename = Path.Combine(m_ConfigPath, "smuxi-engine.ini"); if (!File.Exists(m_IniFilename)) { #if LOG4NET _Logger.Debug("creating file: "+m_IniFilename); #endif File.Create(m_IniFilename).Close(); m_IsCleanConfig = true; } m_IniDocument = new IniDocument(m_IniFilename); //m_IniConfigSource = new IniConfigSource(m_IniFilename); #endif } protected T Get(string key, T defaultvalue) { #if CONFIG_DEBUG Trace.Call(key, defaultvalue); #endif string inisection = _IniGetSection(key); string inikey = _IniGetKey(key); IniSection section = m_IniDocument.Sections[inisection]; if ((section == null) || (!section.Contains(inikey))) { if (defaultvalue != null) { _Set(key, defaultvalue); } return defaultvalue; } else { // the section and key exist string strValue = section.GetValue(inikey); Type targetType = typeof(T); if (targetType == typeof(string)) { return (T)(object) strValue; } if (targetType == typeof(string[])) { return (T)(object) GetList(key); } // handle empty booleans and integers if (targetType.IsValueType && String.IsNullOrEmpty(strValue)) { return default(T); } return (T) Convert.ChangeType(strValue, targetType); } } protected object Get(string key, object defaultvalue) { #if CONFIG_DEBUG Trace.Call(key, defaultvalue); #endif #if CONFIG_GCONF try { return _GConf.Get(_GConfPrefix+key); } catch (GConf.NoSuchKeyException) { if (defaultvalue != null) { _Set(key, defaultvalue); } return defaultvalue; } #elif CONFIG_NINI string inisection = _IniGetSection(key); string inikey = _IniGetKey(key); IniSection section = m_IniDocument.Sections[inisection]; if ((section == null) || (!section.Contains(inikey))) { if (defaultvalue != null) { _Set(key, defaultvalue); } return defaultvalue; } else { // the section and key exist return _Parse(section.GetValue(inikey)); } #endif } protected string[] GetList(string key) { string[] result = null; #if CONFIG_GCONF // Gconf# bug, it doesn't like empty string lists. result = (string[])Get(key, new string[] { String.Empty }); if (result.Length == 1 && result[0] == String.Empty) { // don't return workaround list, instead a clean empty list result = new string[] {}; } #elif CONFIG_NINI // Nini does not support native string lists, have to emulate them string result_str = Get(key, null); if (result_str != null) { if (result_str.Length > 0) { result = result_str.Split('|'); } else { result = new string[] {}; } } #endif return result; } private void _Set(string key, object valueobj) { #if CONFIG_DEBUG Trace.Call(key, valueobj); #endif #if CONFIG_GCONF _GConf.Set(_GConfPrefix+key, valueobj); #elif CONFIG_NINI string inisection = _IniGetSection(key); string inikey = _IniGetKey(key); IniSection section = m_IniDocument.Sections[inisection]; if (section == null) { m_IniDocument.Sections.Add(new IniSection(inisection)); section = m_IniDocument.Sections[inisection]; } if (valueobj is string[]) { // Nini does not support native string lists, have to emulate them section.Set(inikey, String.Join("|", (string[])valueobj)); } else { section.Set(inikey, valueobj.ToString()); } #endif } public void Load() { Trace.Call(); #if LOG4NET _Logger.Debug("Loading config"); #endif string prefix; // setting required default values prefix = "Server/"; Get(prefix+"BindAddress", "127.0.0.1"); Get(prefix+"Port", 7689); Get(prefix+"Channel", "TCP"); Get(prefix+"Formatter", "binary"); prefix = "Engine/Users/DEFAULT/Interface/"; Get(prefix+"ShowAdvancedSettings", false); prefix = "Engine/Users/DEFAULT/Interface/Notebook/"; Get(prefix+"TimestampFormat", "HH:mm"); Get(prefix+"TabPosition", "top"); Get(prefix+"BufferLines", 500); Get(prefix+"EngineBufferLines", 100); Get(prefix+"StripColors", false); Get(prefix+"StripFormattings", false); Get(prefix+"AutoSwitchPersonChats", false); Get(prefix+"AutoSwitchGroupChats", true); prefix = "Engine/Users/DEFAULT/Interface/Notebook/Tab/"; Get(prefix+"NoActivityColor", "#000000"); Get(prefix+"ActivityColor", "#0080FF"); Get(prefix+"EventColor", "#2020C0"); Get(prefix+"HighlightColor", "#E80000"); prefix = "Engine/Users/DEFAULT/Interface/Notebook/Channel/"; Get(prefix+"UserListPosition", "left"); Get(prefix+"TopicPosition", "top"); Get(prefix+"NickColors", true); prefix = "Engine/Users/DEFAULT/Interface/Chat/"; Get(prefix+"BackgroundColor", String.Empty); Get(prefix+"ForegroundColor", String.Empty); Get(prefix+"FontFamily", String.Empty); Get(prefix+"FontStyle", String.Empty); Get(prefix+"FontSize", 0); Get(prefix+"WrapMode", "Word"); prefix = "Engine/Users/DEFAULT/Interface/Entry/"; Get(prefix+"CompletionCharacter", ":"); Get(prefix+"CommandCharacter", "/"); Get(prefix+"BashStyleCompletion", false); Get(prefix+"CommandHistorySize", 30); prefix = "Engine/Users/DEFAULT/Interface/Notification/"; Get(prefix+"NotificationAreaIconMode", "Never"); Get(prefix+"MessagingMenuEnabled", true); Get(prefix+"PopupsEnabled", true); prefix = "Engine/Users/DEFAULT/Sound/"; Get(prefix+"BeepOnHighlight", false); prefix = "Engine/Users/DEFAULT/Connection/"; Get(prefix+"Encoding", "ISO-8859-1"); Get(prefix+"AutoConvertUTF8", true); Get(prefix+"ProxyType", "System"); Get(prefix+"ProxyHostname", String.Empty); Get(prefix+"ProxyPort", -1); Get(prefix+"ProxyUsername", String.Empty); Get(prefix+"ProxyPassword", String.Empty); prefix = "Engine/Users/DEFAULT/Logging/"; Get(prefix+"Enabled", false); Get(prefix+"LogFilteredMessages", false); prefix = "Engine/Users/DEFAULT/MessageBuffer/"; Get(prefix+"PersistencyType", "Volatile"); prefix = "Engine/Users/DEFAULT/MessageBuffer/Volatile/"; Get(prefix+"MaxCapacity", 200); prefix = "Engine/Users/DEFAULT/MessageBuffer/Persistent/"; Get(prefix+"MaxCapacity", 50 * 1000); prefix = "Engine/Users/DEFAULT/Servers/"; Get(prefix + "Servers", new string[] { "IRC/irc.oftc.net", "IRC/irc.gimp.org", "IRC/irc.geekshed.net", "IRC/irc.efnet.org", "IRC/irc.ircnet.org", "IRC/irc.freenode.net" }); prefix = "Engine/Users/DEFAULT/Servers/IRC/irc.oftc.net/"; Get(prefix + "Hostname", "irc.oftc.net"); Get(prefix + "Port", 6667); Get(prefix + "Network", "OFTC"); Get(prefix + "Nickname", String.Empty); Get(prefix + "Realname", String.Empty); Get(prefix + "Username", String.Empty); Get(prefix + "Password", String.Empty); Get(prefix + "UseEncryption", false); Get(prefix + "ValidateServerCertificate", false); Get(prefix + "OnStartupConnect", true); Get(prefix + "OnConnectCommands", new string[] { "/join #smuxi", } ); prefix = "Engine/Users/DEFAULT/Servers/IRC/irc.gimp.org/"; Get(prefix + "Hostname", "irc.gimp.org"); Get(prefix + "Port", 6667); Get(prefix + "Network", "GIMPNet"); Get(prefix + "Nickname", String.Empty); Get(prefix + "Realname", String.Empty); Get(prefix + "Username", String.Empty); Get(prefix + "Password", String.Empty); Get(prefix + "UseEncryption", false); Get(prefix + "ValidateServerCertificate", false); prefix = "Engine/Users/DEFAULT/Servers/IRC/irc.geekshed.net/"; Get(prefix + "Hostname", "irc.geekshed.net"); Get(prefix + "Port", 6667); Get(prefix + "Network", "GeekShed"); Get(prefix + "Nickname", String.Empty); Get(prefix + "Realname", String.Empty); Get(prefix + "Username", String.Empty); Get(prefix + "Password", String.Empty); Get(prefix + "UseEncryption", false); Get(prefix + "ValidateServerCertificate", false); prefix = "Engine/Users/DEFAULT/Servers/IRC/irc.efnet.org/"; Get(prefix + "Hostname", "irc.efnet.org"); Get(prefix + "Port", 6667); Get(prefix + "Network", "EFnet"); Get(prefix + "Nickname", String.Empty); Get(prefix + "Realname", String.Empty); Get(prefix + "Username", String.Empty); Get(prefix + "Password", String.Empty); Get(prefix + "UseEncryption", false); Get(prefix + "ValidateServerCertificate", false); prefix = "Engine/Users/DEFAULT/Servers/IRC/irc.ircnet.org/"; Get(prefix + "Hostname", "irc.ircnet.org"); Get(prefix + "Port", 6667); Get(prefix + "Network", "IRCnet"); Get(prefix + "Nickname", String.Empty); Get(prefix + "Realname", String.Empty); Get(prefix + "Username", String.Empty); Get(prefix + "Password", String.Empty); Get(prefix + "UseEncryption", false); Get(prefix + "ValidateServerCertificate", false); prefix = "Engine/Users/DEFAULT/Servers/IRC/irc.freenode.net/"; Get(prefix + "Hostname", "irc.freenode.net"); Get(prefix + "Port", 6667); Get(prefix + "Network", "freenode"); Get(prefix + "Nickname", String.Empty); Get(prefix + "Realname", String.Empty); Get(prefix + "Username", String.Empty); Get(prefix + "Password", String.Empty); Get(prefix + "UseEncryption", false); Get(prefix + "ValidateServerCertificate", false); prefix = "Engine/Users/"; Get(prefix+"Users", new string[] { "local" }); /* prefix = "Engine/Users/local/"; Get(prefix+"Password", String.Empty); prefix = "Engine/Users/local/Servers/"; Get(prefix+"Servers", new string[] {}); */ prefix = "Server/"; LoadEntry(prefix+"Port", 7689); LoadEntry(prefix+"Formatter", "binary"); LoadEntry(prefix+"Channel", "TCP"); LoadEntry(prefix+"BindAddress", null); // loading defaults LoadAllEntries("Engine/Users/DEFAULT"); prefix = "Engine/Users/"; string[] users = GetList(prefix+"Users"); m_Preferences[prefix + "Users"] = users; foreach (string user in users) { LoadUserEntry(user, "Password", "smuxi"); string[] startup_commands = GetList(prefix+user+"/OnStartupCommands"); if (startup_commands != null) { m_Preferences[prefix+user+"/OnStartupCommands"] = startup_commands; } else { m_Preferences[prefix+user+"/OnStartupCommands"] = new string[] {}; } string[] nick_list = GetList(prefix+user+"/Connection/Nicknames"); if (nick_list != null) { m_Preferences[prefix+user+"/Connection/Nicknames"] = nick_list; } else { string nick = Environment.UserName; // clean typical disallowed characters nick = nick.Replace(" ", String.Empty); if (String.IsNullOrEmpty(nick)) { nick = "Smuxi"; } m_Preferences[prefix+user+"/Connection/Nicknames"] = new string[] { nick }; } LoadUserEntry(user, "Connection/Username", String.Empty); string realname = null; try { string gecos = Mono.Unix.UnixUserInfo.GetRealUser().RealName; if (gecos == null) { gecos = String.Empty; } int pos = gecos.IndexOf(","); if (pos != -1) { realname = gecos.Substring(0, pos); } else { realname = gecos; } } catch (Exception ex) { #if LOG4NET _Logger.Warn("Load(): error getting realname from gecos (ignoring)", ex); #endif } if (String.IsNullOrEmpty(realname)) { realname = "Your Name"; } LoadUserEntry(user, "Connection/Realname", realname); LoadUserEntry(user, "Connection/Encoding", String.Empty); if (Get(prefix+user+"/Connection/AutoConvertUTF8", null) == null) { // upgrade path var enc = Get(prefix+user+"/Connection/Encoding", String.Empty); if (((enc == String.Empty) && (System.Text.Encoding.Default.WebName.ToUpper() == "UTF-8")) || (enc.ToUpper() == "UTF-8")) { this[prefix+user+"/Connection/Encoding"] = "ISO-8859-1"; this[prefix+user+"/Connection/AutoConvertUTF8"] = true; } } LoadUserEntry(user, "Connection/AutoConvertUTF8", true); LoadUserEntry(user, "Connection/ProxyType", "System"); LoadUserEntry(user, "Connection/ProxyHostname", String.Empty); LoadUserEntry(user, "Connection/ProxyPort", -1); LoadUserEntry(user, "Connection/ProxyUsername", null); LoadUserEntry(user, "Connection/ProxyPassword", null); string[] command_list = GetList(prefix+user+"/Connection/OnConnectCommands"); if (command_list != null) { m_Preferences[prefix+user+"/Connection/OnConnectCommands"] = command_list; } else { m_Preferences[prefix+user+"/Connection/OnConnectCommands"] = new string[] {}; } string[] highlight_words = GetList(prefix+user+"/Interface/Chat/HighlightWords"); if (highlight_words != null) { m_Preferences[prefix+user+"/Interface/Chat/HighlightWords"] = highlight_words; } else { m_Preferences[prefix+user+"/Interface/Chat/HighlightWords"] = new string[] {}; } LoadUserEntry(user, "Interface/ShowAdvancedSettings", null); LoadUserEntry(user, "Interface/Notebook/TimestampFormat", null); LoadUserEntry(user, "Interface/Notebook/TabPosition", null); LoadUserEntry(user, "Interface/Notebook/BufferLines", null); LoadUserEntry(user, "Interface/Notebook/EngineBufferLines", null); LoadUserEntry(user, "Interface/Notebook/StripColors", null); LoadUserEntry(user, "Interface/Notebook/StripFormattings", null); LoadUserEntry(user, "Interface/Notebook/AutoSwitchPersonChats", null); LoadUserEntry(user, "Interface/Notebook/AutoSwitchGroupChats", null); LoadUserEntry(user, "Interface/Notebook/Tab/NoActivityColor", null); LoadUserEntry(user, "Interface/Notebook/Tab/ActivityColor", null); LoadUserEntry(user, "Interface/Notebook/Tab/EventColor", null); LoadUserEntry(user, "Interface/Notebook/Tab/HighlightColor", null); LoadUserEntry(user, "Interface/Notebook/Channel/UserListPosition", null); LoadUserEntry(user, "Interface/Notebook/Channel/TopicPosition", null); LoadUserEntry(user, "Interface/Notebook/Channel/NickColors", null); LoadUserEntry(user, "Interface/Chat/ForegroundColor", null); LoadUserEntry(user, "Interface/Chat/BackgroundColor", null); LoadUserEntry(user, "Interface/Chat/FontFamily", null); LoadUserEntry(user, "Interface/Chat/FontStyle", null); LoadUserEntry(user, "Interface/Chat/FontSize", null); LoadUserEntry(user, "Interface/Chat/WrapMode", null); LoadUserEntry(user, "Interface/Entry/CompletionCharacter", null); LoadUserEntry(user, "Interface/Entry/CommandCharacter", null); LoadUserEntry(user, "Interface/Entry/BashStyleCompletion", null); LoadUserEntry(user, "Interface/Entry/CommandHistorySize", null); LoadUserEntry(user, "Interface/Notification/NotificationAreaIconMode", null); LoadUserEntry(user, "Interface/Notification/MessagingMenuEnabled", null); LoadUserEntry(user, "Interface/Notification/PopupsEnabled", null); LoadUserEntry(user, "Sound/BeepOnHighlight", null); LoadUserEntry(user, "Logging/Enabled", null); LoadUserEntry(user, "Logging/LogFilteredMessages", null); LoadUserEntry(user, "MessageBuffer/PersistencyType", null); LoadUserEntry(user, "MessageBuffer/Volatile/MaxCapacity", null); LoadUserEntry(user, "MessageBuffer/Persistent/MaxCapacity", null); string[] servers = null; string sprefix = prefix + user + "/Servers/"; servers = GetList(sprefix + "Servers"); if (servers == null) { // this user has no servers string dprefix = prefix + "DEFAULT/Servers/"; servers = GetList(dprefix + "Servers"); if (servers == null) { // no default servers, use empty list servers = new string[] {}; } else { // we have default servers, so lets copy them foreach (string server in servers) { LoadEntry(sprefix + server + "/Hostname", Get(dprefix + server + "/Hostname", null)); LoadEntry(sprefix + server + "/Port", Get(dprefix + server + "/Port", null)); LoadEntry(sprefix + server + "/Network", Get(dprefix + server + "/Network", null)); LoadEntry(sprefix + server + "/Encoding", Get(dprefix + server + "/Encoding", null)); LoadEntry(sprefix + server + "/AutoConvertUTF8", Get(dprefix + server + "/AutoConvertUTF8", null)); LoadEntry(sprefix + server + "/Nickname", Get(dprefix + server + "/Nickname", null)); LoadEntry(sprefix + server + "/Realname", Get(dprefix + server + "/Realname", null)); LoadEntry(sprefix + server + "/Username", Get(dprefix + server + "/Username", null)); LoadEntry(sprefix + server + "/Password", Get(dprefix + server + "/Password", null)); LoadEntry(sprefix + server + "/UseEncryption", Get(dprefix + server + "/UseEncryption", null)); LoadEntry(sprefix + server + "/ValidateServerCertificate", Get(dprefix + server + "/ValidateServerCertificate", null)); LoadEntry(sprefix + server + "/OnStartupConnect", Get(dprefix + server + "/OnStartupConnect", null)); LoadEntry(sprefix + server + "/OnConnectCommands", Get(dprefix + server + "/OnConnectCommands", null)); } } m_Preferences[sprefix + "Servers"] = servers; } else { // this user has servers m_Preferences[sprefix + "Servers"] = servers; } foreach (string server in servers) { sprefix = prefix + user + "/Servers/" + server + "/"; LoadEntry(sprefix+"Hostname", null); LoadEntry(sprefix+"Port", null); LoadEntry(sprefix+"Network", String.Empty); LoadEntry(sprefix+"Encoding", null); LoadEntry(sprefix+"AutoConvertUTF8", null); LoadEntry(sprefix+"Nickname", String.Empty); LoadEntry(sprefix+"Realname", String.Empty); LoadEntry(sprefix+"Username", String.Empty); LoadEntry(sprefix+"Password", String.Empty); LoadEntry(sprefix+"UseEncryption", false); LoadEntry(sprefix+"ValidateServerCertificate", false); LoadEntry(sprefix+"OnStartupConnect", false); string[] commands = GetList(sprefix + "OnConnectCommands"); if (commands == null) { commands = new string[] {}; m_Preferences[sprefix + "OnConnectCommands"] = new string[] {}; } else { m_Preferences[sprefix + "OnConnectCommands"] = commands; } // HACK: XMPP specific values LoadEntry(sprefix+"Resource", null); LoadEntry(sprefix+"PriorityAvailable", null); LoadEntry(sprefix+"PriorityAway", null); } string[] filters = null; string cprefix = "Filters/"; filters = GetList(prefix + user + "/" + cprefix + "Filters"); if (filters == null) { filters = new string[] {}; m_Preferences[prefix + user + "/" + cprefix + "Filters"] = new string[] {}; } else { m_Preferences[prefix + user + "/" + cprefix + "Filters"] = filters; } foreach (string filter in filters) { cprefix = "Filters/" + filter + "/"; LoadUserEntry(user, cprefix + "Protocol", null); LoadUserEntry(user, cprefix + "ChatType", null); LoadUserEntry(user, cprefix + "ChatID", null); LoadUserEntry(user, cprefix + "MessageType", null); LoadUserEntry(user, cprefix + "MessagePattern", null); } string lprefix = "MessagePatterns/"; var linkKeys = GetList(prefix + user + "/" + lprefix + "MessagePatterns"); if (linkKeys == null) { linkKeys = new string[] {}; m_Preferences[prefix + user + "/" + lprefix + "MessagePatterns"] = new string[] {}; } else { m_Preferences[prefix + user + "/" + lprefix + "MessagePatterns"] = linkKeys; } foreach (var linkKey in linkKeys) { lprefix = "MessagePatterns/" + linkKey + "/"; LoadUserEntry(user, lprefix + "MessagePartPattern", String.Empty); LoadUserEntry(user, lprefix + "MessagePartType", String.Empty); LoadUserEntry(user, lprefix + "LinkFormat", String.Empty); LoadUserEntry(user, lprefix + "TextFormat", String.Empty); } } } public IDictionary GetAll() { lock (m_Preferences) { var dict = new Dictionary(m_Preferences.Count); foreach (DictionaryEntry entry in m_Preferences) { dict.Add((string) entry.Key, entry.Value); } return dict; } } public void Save() { Trace.Call(); #if LOG4NET _Logger.Debug("Saving config"); #endif // update values in backend foreach (string key in m_Preferences.Keys) { object obj = m_Preferences[key]; _Set(key, obj); } #if CONFIG_GCONF _GConf.SuggestSync(); #elif CONFIG_NINI // StreamWriter sr = File.CreateText(m_IniFilename); // m_IniDocument.Save(sr); m_IniDocument.Save(m_IniFilename); #endif } public void Remove(string key) { #if CONFIG_DEBUG Trace.Call(key); #endif bool isSection = false; if (key.EndsWith("/")) { isSection = true; ArrayList keys = new ArrayList(m_Preferences.Keys); foreach (string pkey in keys) { if (pkey.StartsWith(key)) { m_Preferences.Remove(pkey); } } } else { m_Preferences.Remove(key); } #if CONFIG_GCONF //_GConf. #elif CONFIG_NINI string iniSection = _IniGetSection(key); string iniKey = _IniGetKey(key); if (isSection) { m_IniDocument.Sections.Remove(iniSection); } else { if (m_IniDocument.Sections[key] == null) { return; } m_IniDocument.Sections[key].Remove(key); } #endif if (Changed != null) { Changed(this, new ConfigChangedEventArgs(key, null)); } } protected void LoadUserEntry(string user, string key, object defaultvalue) { #if CONFIG_DEBUG Trace.Call(user, key, defaultvalue); #endif string prefix = "Engine/Users/"; string ukey = prefix+user+"/"+key; object obj; if (defaultvalue is string) { obj = Get(ukey, (string) defaultvalue); } else { obj = Get(ukey, defaultvalue); } if (obj != null) { m_Preferences[ukey] = obj; } } protected void LoadEntry(string key, object defaultvalue) { #if CONFIG_DEBUG Trace.Call(key, defaultvalue); #endif object obj; if (defaultvalue is string) { obj = Get(key, (string) defaultvalue); } else { obj = Get(key, defaultvalue); } if (obj != null) { m_Preferences[key] = obj; } } protected void LoadAllEntries(string basepath) { Trace.Call(basepath); #if CONFIG_GCONF // TODO: GConf# has no way yet to get the sub-paths of a given path! // So we have to use Nini as primary config backend for now... #elif CONFIG_NINI foreach (DictionaryEntry dec in m_IniDocument.Sections) { IniSection inisection = (IniSection)dec.Value; if (inisection.Name.StartsWith(basepath)) { foreach (string key in inisection.GetKeys()) { m_Preferences[inisection.Name+"/"+key] = _Parse(inisection.GetValue(key)); } } } #endif } #if CONFIG_NINI private object _Parse(string data) { // since INI files are plain text, all data will be string, // must convert here when possible (via guessing) try { int number = Int32.Parse(data); return number; } catch (FormatException) { } try { bool boolean = Boolean.Parse(data); return boolean; } catch (FormatException) { } // no convert worked, let's leave it as string return data; } private string _IniGetKey(string key) { string[] keys = key.Split(new char[] {'/'}); // nothing but the last part string inikey = String.Join("/", keys, keys.Length - 1, 1); return inikey; } private string _IniGetSection(string key) { string[] keys = key.Split(new char[] {'/'}); // everything except the last part string inisection = String.Join("/", keys, 0, keys.Length - 1); return inisection; } #endif } public class ConfigChangedEventArgs : EventArgs { public string Key { get; private set; } public object Value { get; private set; } public ConfigChangedEventArgs(string key, object value) { Key = key; Value = value; } } } smuxi-0.11/src/Engine/Config/EntrySettings.cs0000644000175000017500000000372211700531605021752 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public class EntrySettings { public string CommandCharacter { get; set; } public string CompletionCharacter { get; set; } public bool BashStyleCompletion { get; set; } public int CommandHistorySize { get; set; } public EntrySettings() { // internal defaults CommandCharacter = "/"; CompletionCharacter = ":"; BashStyleCompletion = false; CommandHistorySize = 30; } public void ApplyConfig(UserConfig config) { if (config == null) { throw new ArgumentNullException("config"); } CommandCharacter = (string) config["Interface/Entry/CommandCharacter"]; CompletionCharacter = (string) config["Interface/Entry/CompletionCharacter"]; BashStyleCompletion = (bool) config["Interface/Entry/BashStyleCompletion"]; CommandHistorySize = (int) config["Interface/Entry/CommandHistorySize"]; } } } smuxi-0.11/src/Engine/Config/ProxySettings.cs0000644000175000017500000001736412253423337022007 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Net; using System.Text.RegularExpressions; using System.Collections.Generic; namespace Smuxi.Engine { public class ProxySettings { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif public ProxyType ProxyType { get; set; } public string ProxyHostname { get; set; } public int ProxyPort { get; set; } public string ProxyUsername { get; set; } public string ProxyPassword { get; set; } public IWebProxy SystemWebProxy { get; set; } public WebProxy DefaultWebProxy { get; set; } static ProxySettings() { try { WorkaroundNoProxyMonoBug(); } catch { } } public ProxySettings() { ProxyType = ProxyType.None; } public WebProxy GetWebProxy(Uri destination) { if (destination == null) { throw new ArgumentNullException("destination"); } if (SystemWebProxy == null && DefaultWebProxy == null) { #if LOG4NET f_Logger.DebugFormat("GetWebProxy(<{0}>): returning no proxy", destination); #endif // no proxy return null; } if (SystemWebProxy == null) { if (DefaultWebProxy.Address.Scheme.StartsWith("socks") && destination.Scheme.StartsWith("http")) { #if LOG4NET f_Logger.DebugFormat("GetWebProxy(<{0}>): ignoring " + "SOCKS proxy for HTTP destination: {1}", destination, DefaultWebProxy.Address); #endif return null; } #if LOG4NET f_Logger.DebugFormat("GetWebProxy(<{0}>): returning default proxy: {1}", destination, DefaultWebProxy.Address); #endif return DefaultWebProxy; } var proxyUri = SystemWebProxy.GetProxy(destination); if (proxyUri == destination) { #if LOG4NET f_Logger.DebugFormat("GetWebProxy(<{0}>): returning no proxy", destination); #endif // no proxy return null; } #if LOG4NET f_Logger.DebugFormat("GetWebProxy(<{0}>): returning system proxy: {1}", destination, proxyUri); #endif return new WebProxy(proxyUri); } public WebProxy GetWebProxy(string destination) { if (destination == null) { throw new ArgumentNullException("destination"); } return GetWebProxy(new Uri(destination)); } public void ApplyConfig(UserConfig config) { if (config == null) { throw new ArgumentNullException("config"); } var proxyType = (string) config["Connection/ProxyType"]; ProxyType = (ProxyType) Enum.Parse(typeof(ProxyType), proxyType, true); ProxyHostname = (string) config["Connection/ProxyHostname"]; ProxyPort = (int) config["Connection/ProxyPort"]; ProxyUsername = (string) config["Connection/ProxyUsername"]; ProxyPassword = (string) config["Connection/ProxyPassword"]; switch (ProxyType) { case ProxyType.None: DefaultWebProxy = null; SystemWebProxy = null; break; case ProxyType.System: // TODO: add GNOME (gconf) support var no_proxy = Environment.GetEnvironmentVariable("no_proxy"); var proxy = WebRequest.GetSystemWebProxy(); if (!String.IsNullOrEmpty(no_proxy) && proxy is WebProxy) { var webProxy = (WebProxy) proxy; // BypassArrayList expects regexes while no_proxy // contains domains var bypassUriRegexes = new List(); foreach (var domain in no_proxy.Split(',')) { string domainRegex = null; if (domain.StartsWith(".")) { domainRegex = String.Format( @"^[a-z]+://(.+\.)?{0}", Regex.Escape(domain.Substring(1)) ); } else if (!Regex.IsMatch(domain, @"^[a-z]+://")) { domainRegex = String.Format( @"^[a-z]+://{0}", Regex.Escape(domain) ); } else { domainRegex = Regex.Escape(domain); } bypassUriRegexes.Add(domainRegex); } webProxy.BypassArrayList.AddRange(bypassUriRegexes); } DefaultWebProxy = null; SystemWebProxy = proxy; break; default: var uriBuilder = new UriBuilder(); uriBuilder.Scheme = ProxyType.ToString().ToLower(); uriBuilder.Host = ProxyHostname; uriBuilder.Port = ProxyPort; uriBuilder.UserName = ProxyUsername; uriBuilder.Password = ProxyPassword; var proxyUri = uriBuilder.ToString(); DefaultWebProxy = new WebProxy(proxyUri); SystemWebProxy = null; break; } } static void WorkaroundNoProxyMonoBug() { // HACK: workaround bug in Mono 2.10.8 throwing // ArgumentOutOfRangeException because it always tries to remove // *.local from the no_proxy envrionment variable, see: // https://www.smuxi.org/issues/show/873 var no_proxy = Environment.GetEnvironmentVariable("no_proxy"); if (no_proxy == null) { // nothing to workaround return; } try { WebRequest.GetSystemWebProxy(); } catch (ArgumentOutOfRangeException) { #if LOG4NET f_Logger.Debug("WorkaroundNoProxyMonoBug(): enabling no_proxy workaround..."); #endif if (!no_proxy.Contains("*.local")) { var no_proxy_with_local = no_proxy + ",*.local"; Environment.SetEnvironmentVariable("no_proxy", no_proxy_with_local); } } } } } smuxi-0.11/src/Engine/Config/FilterListController.cs0000644000175000017500000001454711655545675023311 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006, 2010 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Engine { public class FilterListController { UserConfig f_UserConfig; public FilterListController(UserConfig userConfig) { if (userConfig == null) { throw new ArgumentNullException("userConfig"); } f_UserConfig = userConfig; } public IDictionary GetFilterList() { string[] filterKeys = (string[]) f_UserConfig["Filters/Filters"]; var filters = new Dictionary(); if (filterKeys == null) { return filters; } foreach (string filterKey in filterKeys) { int key = Int32.Parse(filterKey); var filter = GetFilter(key); if (filter == null) { continue; } filters.Add(key, filter); } return filters; } public FilterModel GetFilter(int key) { Trace.Call(key); string prefix = "Filters/" + key + "/"; if (f_UserConfig[prefix + "MessagePattern"] == null) { // filter does not exist return null; } FilterModel filter = new FilterModel(); filter.Protocol = (string) f_UserConfig[prefix + "Protocol"]; var chatType = (string) f_UserConfig[prefix + "ChatType"]; if (!String.IsNullOrEmpty(chatType)) { filter.ChatType = (ChatType) Enum.Parse( typeof(ChatType), chatType ); } filter.ChatID = (string) f_UserConfig[prefix + "ChatID"]; var msgType = (string) f_UserConfig[prefix + "MessageType"]; if (!String.IsNullOrEmpty(msgType)) { filter.MessageType = (MessageType) Enum.Parse( typeof(MessageType), msgType ); } filter.MessagePattern = (string) f_UserConfig[prefix + "MessagePattern"]; return filter; } public int AddFilter(FilterModel filter) { Trace.Call(filter); if (filter == null) { throw new ArgumentNullException("filter"); } string[] filterKeys = (string[]) f_UserConfig["Filters/Filters"]; if (filterKeys == null) { filterKeys = new string[] {}; } int highestKey = 0; foreach (string filterKey in filterKeys) { int key = Int32.Parse(filterKey); if (key > highestKey) { highestKey = key; } } int newKey = ++highestKey; string prefix = "Filters/" + newKey + "/"; f_UserConfig[prefix + "Protocol"] = filter.Protocol; if (filter.ChatType == null) { f_UserConfig[prefix + "ChatType"] = String.Empty; } else { f_UserConfig[prefix + "ChatType"] = filter.ChatType.ToString(); } f_UserConfig[prefix + "ChatID"] = filter.ChatID; if (filter.MessageType == null) { f_UserConfig[prefix + "MessageType"] = String.Empty; } else { f_UserConfig[prefix + "MessageType"] = filter.MessageType.ToString(); } f_UserConfig[prefix + "MessagePattern"] = filter.MessagePattern; List filterKeyList = new List(filterKeys); filterKeyList.Add(newKey.ToString()); f_UserConfig["Filters/Filters"] = filterKeyList.ToArray(); return newKey; } public void SetFilter(int key, FilterModel filter) { Trace.Call(key, filter); if (filter == null) { throw new ArgumentNullException("filter"); } string prefix = "Filters/" + key + "/"; f_UserConfig[prefix + "Protocol"] = filter.Protocol; if (filter.ChatType == null) { f_UserConfig[prefix + "ChatType"] = String.Empty; } else { f_UserConfig[prefix + "ChatType"] = filter.ChatType.ToString(); } f_UserConfig[prefix + "ChatID"] = filter.ChatID; if (filter.MessageType == null) { f_UserConfig[prefix + "MessageType"] = String.Empty; } else { f_UserConfig[prefix + "MessageType"] = filter.MessageType.ToString(); } f_UserConfig[prefix + "MessagePattern"] = filter.MessagePattern; } public void RemoveFilter(int key) { Trace.Call(key); string filterSection = "Filters/" + key + "/"; string[] filterKeys = (string[]) f_UserConfig["Filters/Filters"]; if (filterKeys == null) { filterKeys = new string[] {}; } List filterKeyList = new List(filterKeys); int idx = filterKeyList.IndexOf(key.ToString()); if (idx == -1) { // key not found return; } filterKeyList.RemoveAt(idx); f_UserConfig.Remove(filterSection); f_UserConfig["Filters/Filters"] = filterKeyList.ToArray(); } public void Save() { Trace.Call(); f_UserConfig.Save(); } } } smuxi-0.11/src/Engine/Config/MessagePatternListController.cs0000644000175000017500000001072312300201645024744 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2014 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using Smuxi.Common; using Smuxi.Engine; namespace Smuxi.Engine { public class MessagePatternListController { UserConfig UserConfig { get; set; } protected string[] PatternIDs { get { return (string[]) UserConfig["MessagePatterns/MessagePatterns"]; } set { UserConfig["MessagePatterns/MessagePatterns"] = value; } } public MessagePatternListController(UserConfig userConfig) { if (userConfig == null) { throw new ArgumentNullException("userConfig"); } UserConfig = userConfig; } public List GetList() { var keys = PatternIDs; var list = new List(keys.Length); if (keys == null) { return list; } foreach (var key in keys) { int parsedKey = Int32.Parse(key); var link = Get(parsedKey); if (link == null) { continue; } list.Add(link); } return list; } public MessagePatternModel Get(int id) { Trace.Call(id); string prefix = "MessagePatterns/" + id + "/"; if (UserConfig[prefix + "MessagePartPattern"] == null) { // link does not exist return null; } var link = new MessagePatternModel(id); link.Load(UserConfig); return link; } public int Add(MessagePatternModel link) { return Add(link, -1); } public int Add(MessagePatternModel link, int id) { Trace.Call(link, id); if (link == null) { throw new ArgumentNullException("link"); } string[] keys = PatternIDs; if (keys == null) { keys = new string[] {}; } int highestKey = 0; int newKey = id; if (id == -1) { foreach (string key in keys) { int parsedKey = Int32.Parse(key); if (parsedKey > highestKey) { highestKey = parsedKey; } } newKey = ++highestKey; } link.ID = newKey; link.Save(UserConfig); var keyList = new List(keys); keyList.Add(link.ID.ToString()); PatternIDs = keyList.ToArray(); return newKey; } public void Set(MessagePatternModel link) { Trace.Call(link); if (link == null) { throw new ArgumentNullException("link"); } link.Save(UserConfig); } public void Remove(int key) { Trace.Call(key); string section = "MessagePatterns/" + key + "/"; string[] keys = PatternIDs; if (keys == null) { keys = new string[] {}; } var keyList = new List(keys); int idx = keyList.IndexOf(key.ToString()); if (idx == -1) { // key not found return; } keyList.RemoveAt(idx); UserConfig.Remove(section); PatternIDs = keyList.ToArray(); } public void Save() { Trace.Call(); UserConfig.Save(); } } } smuxi-0.11/src/Engine/Config/UserConfig.cs0000644000175000017500000001665112253423337021207 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006, 2010-2011, 2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Runtime.Remoting; using System.Collections; using System.Collections.Generic; using Smuxi.Common; namespace Smuxi.Engine { public class UserConfig : PermanentRemoteObject, IEnumerable> { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private Config _Config; private string _UserPrefix; private string _DefaultPrefix = "Engine/Users/DEFAULT/"; private Hashtable _Cache; public FrontendConfig FrontendConfig { get; set; } public event EventHandler Changed; public bool IsCaching { get { return _Cache != null; } set { if (value) { _Cache = new Hashtable(); } else { _Cache = null; } } } public object this[string key] { get { object obj = null; // allow engine config to be overriden by frontend config if (FrontendConfig != null) { obj = FrontendConfig[key]; if (obj != null) { return obj; } } if (IsCaching) { if (_Cache.Contains(key)) { return _Cache[key]; } } obj = _Config[_UserPrefix + key]; if (obj != null) { if (IsCaching) { _Cache.Add(key, obj); } return obj; } obj = _Config[_DefaultPrefix + key]; #if LOG4NET if (obj == null) { _Logger.Error("get_Item[]: default value is null for key: " + key); } #endif if (IsCaching) { _Cache.Add(key, obj); } return obj; } set { // ignore writing back overridden config keys if (FrontendConfig != null && FrontendConfig[key] != null) { return; } // TODO: make remoting calls after a timeout and batch the update _Config[_UserPrefix + key] = value; // update entry in cache if (IsCaching) { _Cache[key] = value; } } } public UserConfig(Config config, string username) { _Config = config; // HACK: The Changed event was introduced in 0.7.2, for backwards // compatibility with 0.7.x server we need to suppress remoting // exceptions here try { // we can't use events over remoting if (!RemotingServices.IsTransparentProxy(config)) { _Config.Changed += OnConfigChanged; } } catch (Exception ex) { #if LOG4NET _Logger.Warn( "UserConfig() registration of Config.Changed event failed, " + "ignoring for backwards compatibility with 0.7.x servers...", ex ); #endif } _UserPrefix = "Engine/Users/"+username+"/"; } public void ClearCache() { if (IsCaching) { #if LOG4NET _Logger.Debug("Clearing cache"); #endif _Cache.Clear(); } } public void Remove(string key) { _Config.Remove(_UserPrefix + key); if (!IsCaching) { return; } if (key.EndsWith("/")) { // invalidate all cache keys of this section var cachedKeys = new List(); foreach (string cacheKey in _Cache.Keys) { if (cacheKey.StartsWith(key)) { cachedKeys.Add(cacheKey); } } foreach (string cacheKey in cachedKeys) { _Cache.Remove(cacheKey); } } else { // deleting the single entry is enough _Cache.Remove(key); } } public void Save() { _Config.Save(); } public void SyncCache() { Trace.Call(); if (!IsCaching) { return; } var start = DateTime.UtcNow; var conf = _Config.GetAll(); var cache = new Hashtable(conf.Count); foreach (var entry in conf) { if (!entry.Key.StartsWith(_UserPrefix)) { // no need to cache values of other users continue; } // remove user prefix from key var userKey = entry.Key.Substring(_UserPrefix.Length); cache.Add(userKey, entry.Value); } var stop = DateTime.UtcNow; #if LOG4NET _Logger.Debug( String.Format( "SyncCache(): syncing config took: {0:0.00} ms", (stop - start).TotalMilliseconds ) ); #endif _Cache = cache; } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } public IEnumerator> GetEnumerator() { foreach (var entry in _Config.GetAll()) { if (!entry.Key.StartsWith(_UserPrefix)) { continue; } // remove user prefix from key var userKey = entry.Key.Substring(_UserPrefix.Length); yield return new KeyValuePair(userKey, entry.Value); } } void OnConfigChanged(object sender, ConfigChangedEventArgs e) { if (Changed == null) { // no listeners return; } if (!e.Key.StartsWith(_UserPrefix)) { // setting for some other user has changed return; } var key = e.Key.Substring(_UserPrefix.Length); Changed(this, new ConfigChangedEventArgs(key, e.Value)); } } } smuxi-0.11/src/Engine/Config/ServerListController.cs0000644000175000017500000001666512250426634023316 0ustar00meebeymeebey00000000000000/* * $Id: PreferencesDialog.cs 142 2007-01-02 22:19:08Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Frontend-GNOME/PreferencesDialog.cs $ * $Rev: 142 $ * $Author: meebey $ * $Date: 2007-01-02 23:19:08 +0100 (Tue, 02 Jan 2007) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using Smuxi.Common; namespace Smuxi.Engine { public class ServerListController { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string _LibraryTextDomain = "smuxi-engine"; private UserConfig _UserConfig; public ServerListController(UserConfig userConfig) { if (userConfig == null) { throw new ArgumentNullException("userConfig"); } _UserConfig = userConfig; } public IList GetServerList() { // load user servers string[] servers = (string[]) _UserConfig["Servers/Servers"]; IList serverList = new List(); if (servers == null) { return serverList; } foreach (string server in servers) { string[] serverParts = server.Split(new char[] {'/'}); string protocol = serverParts[0]; string serverId = serverParts[1]; ServerModel ser = GetServer(protocol, serverId); if (ser == null) { #if LOG4NET _Logger.Error("GetServerList(): GetServer(" + protocol + ", " + serverId +") returned null! ignoring..."); #endif continue; } serverList.Add(ser); } return serverList; } public ServerModel GetServer(string protocol, string servername) { Trace.Call(protocol, servername); if (protocol == null) { throw new ArgumentNullException("protocol"); } if (servername == null) { throw new ArgumentNullException("servername"); } ServerModel server = new ServerModel(); try { server.Load(_UserConfig, protocol, servername); } catch (ArgumentException) { return null; } return server; } public IList GetNetworks() { Trace.Call(); IList networks = new List(); IList servers = GetServerList(); foreach (ServerModel server in servers) { if (!networks.Contains(server.Network)) { networks.Add(server.Network); } } return networks; } public ServerModel GetServerByNetwork(string network) { Trace.Call(network); if (network == null) { throw new ArgumentNullException("network"); } if (network.Trim().Length == 0) { throw new InvalidOperationException(_("Network must not be empty.")); } var servers = GetServerList(); foreach (var server in servers) { if (String.Compare(server.Network, network, true) == 0) { return server; } } return null; } public void AddServer(ServerModel server) { Trace.Call(server); if (server == null) { throw new ArgumentNullException("server"); } if (String.IsNullOrEmpty(server.Hostname)) { throw new InvalidOperationException(_("Server hostname must not be empty.")); } if (server.Hostname.Contains("\n")) { throw new InvalidOperationException(_("Server hostname contains invalid characters (newline).")); } var highestServerId = -1; foreach (var s in GetServerList()) { if (s.Protocol == server.Protocol && s.ServerID == server.ServerID) { throw new InvalidOperationException( String.Format(_("Server ID '{0}' already exists."), server.ServerID) ); } int id; if (Int32.TryParse(s.ServerID, out id) && id > highestServerId) { highestServerId = id; } } if (String.IsNullOrEmpty(server.ServerID)) { server.ServerID = (++highestServerId).ToString(); } server.Save(_UserConfig); string[] servers = (string[]) _UserConfig["Servers/Servers"]; if (servers == null) { servers = new string[] {}; } List serverList = new List(servers); serverList.Add(server.Protocol + "/" + server.ServerID); _UserConfig["Servers/Servers"] = serverList.ToArray(); } public void SetServer(ServerModel server) { Trace.Call(server); if (server == null) { throw new ArgumentNullException("server"); } server.Save(_UserConfig); } public void RemoveServer(string protocol, string servername) { Trace.Call(protocol, servername); if (protocol == null) { throw new ArgumentNullException("protocol"); } if (servername == null) { throw new ArgumentNullException("servername"); } string server = "Servers/" + protocol + "/" + servername + "/"; _UserConfig.Remove(server); string[] servers = (string[]) _UserConfig["Servers/Servers"]; if (servers == null) { servers = new string[] {}; } List serverList = new List(servers); int idx = serverList.IndexOf(protocol + "/" + servername); serverList.RemoveAt(idx); _UserConfig["Servers/Servers"] = serverList.ToArray(); } public void Save() { _UserConfig.Save(); } private static string _(string msg) { return LibraryCatalog.GetString(msg, _LibraryTextDomain); } } } smuxi-0.11/src/Engine/Config/UserListController.cs0000644000175000017500000001140511655545675022770 0ustar00meebeymeebey00000000000000// $Id$ // // Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010 Clement Bourgeois // Copyright (c) 2010 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; using Smuxi.Common; namespace Smuxi.Engine { public class UserListController { private static readonly string f_LibraryTextDomain = "smuxi-engine"; private Config f_Config; private string f_Prefix; public UserListController(Config config) { if (config == null) { throw new ArgumentNullException("config"); } f_Config = config; f_Prefix = "Engine/Users"; } public void AddUser(string username, string password) { if (username == null) { throw new ArgumentNullException("username"); } if (password == null) { throw new ArgumentNullException("password"); } CheckUsername(username); CheckPassword(password); CheckUserNotExists(username); List userList = GetUsers(); userList.Add(username); f_Config[f_Prefix + "/Users"] = userList.ToArray(); f_Config[f_Prefix + "/" + username + "/Password"] = password; } public void ModifyUser(string username, string password) { if (username == null) { throw new ArgumentNullException("username"); } if (password == null) { throw new ArgumentNullException("password"); } CheckUsername(username); CheckPassword(password); CheckUserExists(username); f_Config[f_Prefix + "/" + username + "/Password"] = password; } public void DeleteUser(string username) { if (username == null) { throw new ArgumentNullException("username"); } CheckUsername(username); CheckUserExists(username); List userList = GetUsers(); userList.Remove(username); f_Config[f_Prefix + "/Users"] = userList.ToArray(); f_Config.Remove(f_Prefix + "/" + username + "/"); } public bool UserExists(string username) { if (username == null) { throw new ArgumentNullException("username"); } List usersList = GetUsers(); return usersList.Contains(username); } public List GetUsers() { return new List((string[]) f_Config[f_Prefix + "/Users"]); } protected void CheckUsername(string username) { if (String.IsNullOrEmpty(username) || username.Trim().Length == 0) { throw new ApplicationException( String.Format(_("Username must not be empty."), username) ); } } protected void CheckPassword(string password) { if (String.IsNullOrEmpty(password) || password.Trim().Length == 0) { throw new ApplicationException( String.Format(_("Password must not be empty."), password) ); } } protected void CheckUserExists(string username) { if (!UserExists(username)) { throw new ApplicationException( String.Format(_("User \"{0}\" doesn't exist."), username) ); } } protected void CheckUserNotExists(string username) { if (UserExists(username)) { throw new ApplicationException( String.Format(_("User \"{0}\" already exists."), username) ); } } private static string _(string msg) { return LibraryCatalog.GetString(msg, f_LibraryTextDomain); } } } smuxi-0.11/src/Engine/Config/MessagePatternModel.cs0000644000175000017500000001165712300201645023034 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2014 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Text.RegularExpressions; namespace Smuxi.Engine { public class MessagePatternModel { public int? ID { get; set; } public Regex MessagePartPattern { get; set; } public Type MessagePartType { get; set; } // what is linked to public string LinkFormat { get; set; } // what is displayed public string TextFormat { get; set; } protected string ConfigKeyPrefix { get { if (ID == null) { throw new ArgumentNullException("ID"); } return "MessagePatterns/" + ID + "/"; } } public MessagePatternModel(Regex pattern) { if (pattern == null) { throw new ArgumentNullException("pattern"); } MessagePartPattern = pattern; MessagePartType = typeof(UrlMessagePartModel); } public MessagePatternModel(int id) { ID = id; } public void Load(UserConfig config) { if (ID == null) { throw new InvalidOperationException("ID must not be null."); } Load(config, ID.Value); } public virtual void Load(UserConfig config, int id) { if (config == null) { throw new ArgumentNullException("config"); } // don't use ConfigKeyPrefix, so exception guarantees can be kept string prefix = "MessagePatterns/" + id + "/"; if (config[prefix + "MessagePartPattern"] == null) { // SmartLink does not exist throw new ArgumentException("MessagePattern ID not found in config", "id"); } ID = id; // now we have a valid ID, ConfigKeyPrefix works var messagePartPattern = (string) config[ConfigKeyPrefix + "MessagePartPattern"]; if (messagePartPattern.StartsWith("/") && messagePartPattern.EndsWith("/i")) { var regexPattern = messagePartPattern.Substring(1, messagePartPattern.Length - 3); MessagePartPattern = new Regex(regexPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); } else { MessagePartPattern = new Regex(messagePartPattern, RegexOptions.Compiled); } var messagePartType = (string) config[ConfigKeyPrefix + "MessagePartType"]; switch (messagePartType.ToLower()) { case "url": MessagePartType = typeof(UrlMessagePartModel); break; case "image": MessagePartType = typeof(ImageMessagePartModel); break; } LinkFormat = (string) config[ConfigKeyPrefix + "LinkFormat"]; TextFormat = (string) config[ConfigKeyPrefix + "TextFormat"]; } public virtual void Save(UserConfig config) { if (config == null) { throw new ArgumentNullException("config"); } if (MessagePartPattern == null) { config[ConfigKeyPrefix + "MessagePartPattern"] = String.Empty; } else { config[ConfigKeyPrefix + "MessagePartPattern"] = MessagePartPattern.ToString(); } if (MessagePartType == typeof(ImageMessagePartModel)) { config[ConfigKeyPrefix + "MessagePartType"] = "Image"; } else if (MessagePartType == typeof(UrlMessagePartModel)) { config[ConfigKeyPrefix + "MessagePartType"] = "Url"; } else { config[ConfigKeyPrefix + "MessagePartType"] = String.Empty; } config[ConfigKeyPrefix + "LinkFormat"] = LinkFormat ?? String.Empty; config[ConfigKeyPrefix + "TextFormat"] = TextFormat ?? String.Empty; } public override string ToString() { return String.Format("<{0}>", ToTraceString()); } public string ToTraceString() { return String.Format("{0}", ID); } } } smuxi-0.11/src/Engine/Config/ServerModel.cs0000644000175000017500000002160712300201464021353 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2007, 2010, 2012-2014 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Runtime.Serialization; using System.Collections.Generic; using Smuxi.Common; namespace Smuxi.Engine { [Serializable] public class ServerModel : ISerializable { public bool UseEncryption { get; set; } public bool ValidateServerCertificate { get; set; } public string Protocol { get; set; } public string Hostname { get; set; } public int Port { get; set; } public string Network { get; set; } public string Nickname { get; set; } public string Realname { get; set; } public string Username { get; set; } public string Password { get; set; } public bool OnStartupConnect { get; set; } public IList OnConnectCommands { get; set; } public string ServerID { get; set; } protected string ConfigKeyPrefix { get { if (String.IsNullOrEmpty(Protocol)) { throw new ArgumentNullException("Protocol"); } if (String.IsNullOrEmpty(ServerID)) { throw new ArgumentNullException("ServerID"); } return "Servers/" + Protocol + "/" + ServerID + "/"; } } public ServerModel() { } protected ServerModel(SerializationInfo info, StreamingContext ctx) { Protocol = info.GetString("_Protocol"); Hostname = info.GetString("_Hostname"); Port = info.GetInt32("_Port"); Network = info.GetString("_Network"); Username = info.GetString("_Username"); Password = info.GetString("_Password"); OnStartupConnect = info.GetBoolean("_OnStartupConnect"); //ServerID = info.GetString("_ServerID"); bool foundServerID = false; bool foundEncryption = false; bool foundValidation = false; foreach(SerializationEntry e in info) { switch (e.Name) { case "_ServerID": ServerID = (string)e.Value; foundServerID = true; break; case "_Username": Username = (string) e.Value; break; case "_Realname": Realname = (string) e.Value; break; // UseEncryption and ValidateServerCertificate were forgotten // when moving from autoserialization to manual serialization. // To prevent crashes when git users' updated engines receive a ServerModel // from an older git frontend, we manually check for the fields' existance case "k__BackingField": UseEncryption = (bool)e.Value; foundEncryption = true; break; case "k__BackingField": ValidateServerCertificate = (bool)e.Value; foundValidation = true; break; } } if (foundServerID == false) { // this is from an old frontend/engine that doesn't know about ServerID yet ServerID = Hostname; } if (!foundEncryption) { UseEncryption = false; } if (!foundValidation) { ValidateServerCertificate = false; } OnConnectCommands = (IList) info.GetValue( "_OnConnectCommands", typeof(IList) ); } public virtual void GetObjectData(SerializationInfo info, StreamingContext ctx) { // HACK: skip ServerID if it has no value as it breaks older // ServerModel implementations that relied on automatic // serialization which was the case in < 0.8.11 if (ServerID != null) { info.AddValue("_ServerID", ServerID); } if (Nickname != null) { info.AddValue("_Nickname", Nickname); } if (Realname != null) { info.AddValue("_Realname", Realname); } info.AddValue("_Protocol", Protocol); info.AddValue("_Hostname", Hostname); info.AddValue("_Port", Port); info.AddValue("_Network", Network); info.AddValue("_Username", Username); info.AddValue("_Password", Password); info.AddValue("_OnStartupConnect", OnStartupConnect); info.AddValue("_OnConnectCommands", OnConnectCommands); // oddball names are necessary because the fields always were auto properties info.AddValue("k__BackingField", UseEncryption); info.AddValue("k__BackingField", ValidateServerCertificate); } public virtual void Load(UserConfig config, string protocol, string id) { if (config == null) { throw new ArgumentNullException("config"); } if (String.IsNullOrEmpty(protocol)) { throw new ArgumentNullException("protocol"); } if (String.IsNullOrEmpty(id)) { throw new ArgumentNullException("id"); } // don't use ConfigKeyPrefix, so exception guarantees can be kept string prefix = "Servers/" + protocol + "/" + id + "/"; if (config[prefix + "Hostname"] == null) { // server does not exist throw new ArgumentException("ServerID not found in config", id); } ServerID = id; Protocol = protocol; // now we have a valid ServerID and Protocol, ConfigKeyPrefix works Hostname = (string) config[ConfigKeyPrefix + "Hostname"]; Port = (int) config[ConfigKeyPrefix + "Port"]; Network = (string) config[ConfigKeyPrefix + "Network"]; Nickname = (string) config[ConfigKeyPrefix + "Nickname"]; Realname = (string) config[ConfigKeyPrefix + "Realname"]; Username = (string) config[ConfigKeyPrefix + "Username"]; Password = (string) config[ConfigKeyPrefix + "Password"]; UseEncryption = (bool) config[ConfigKeyPrefix + "UseEncryption"]; ValidateServerCertificate = (bool) config[ConfigKeyPrefix + "ValidateServerCertificate"]; if (config[ConfigKeyPrefix + "OnStartupConnect"] != null) { OnStartupConnect = (bool) config[ConfigKeyPrefix + "OnStartupConnect"]; } OnConnectCommands = config[ConfigKeyPrefix + "OnConnectCommands"] as IList; } public virtual void Save(UserConfig config) { if (config == null) { throw new ArgumentNullException("config"); } config[ConfigKeyPrefix + "Hostname"] = Hostname; config[ConfigKeyPrefix + "Port"] = Port; config[ConfigKeyPrefix + "Network"] = Network; config[ConfigKeyPrefix + "Nickname"] = Nickname; config[ConfigKeyPrefix + "Realname"] = Realname; config[ConfigKeyPrefix + "Username"] = Username; config[ConfigKeyPrefix + "Password"] = Password; config[ConfigKeyPrefix + "UseEncryption"] = UseEncryption; config[ConfigKeyPrefix + "ValidateServerCertificate"] = ValidateServerCertificate; config[ConfigKeyPrefix + "OnStartupConnect"] = OnStartupConnect; config[ConfigKeyPrefix + "OnConnectCommands"] = OnConnectCommands; } public override string ToString() { return String.Format("<{0}>", ToTraceString()); } public string ToTraceString() { return String.Format("{0}/{1}", Protocol, ServerID); } } } smuxi-0.11/src/Engine/Config/NotificationAreaIconMode.cs0000644000175000017500000000240411655545675024006 0ustar00meebeymeebey00000000000000/* * $Id: FrontendConfig.cs 427 2008-09-27 23:50:51Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/Config/FrontendConfig.cs $ * $Rev: 427 $ * $Author: meebey $ * $Date: 2008-09-28 01:50:51 +0200 (Sun, 28 Sep 2008) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2008 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; namespace Smuxi.Engine { public enum NotificationAreaIconMode { Never, Always, Minimized, Closed } } smuxi-0.11/src/Engine/Config/FilterModel.cs0000644000175000017500000000237211655545675021363 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006, 2010 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using Smuxi.Common; namespace Smuxi.Engine { public class FilterModel { public string Protocol { get; set; } public string ChatID { get; set; } public ChatType? ChatType { get; set; } public MessageType? MessageType { get; set; } public string MessagePattern { get; set; } } } smuxi-0.11/src/Engine/Config/MessageBuilderSettings.cs0000644000175000017500000004060612301210101023525 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011, 2014 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Text.RegularExpressions; using System.Collections.Generic; using Smuxi.Common; namespace Smuxi.Engine { public class MessageBuilderSettings { static List BuiltinPatterns { get; set; } public List UserPatterns { get; set; } public List Patterns { get; set; } public bool NickColors { get; set; } public bool StripFormattings { get; set; } public bool StripColors { get; set; } public TextColor HighlightColor { get; set; } public List HighlightWords { get; set; } static MessageBuilderSettings() { BuiltinPatterns = new List(); InitBuiltinSmartLinks(); } public MessageBuilderSettings() { NickColors = true; // No need to lock BuiltinPatterns as List is thread-safe for // multiple readers as long as there is no writer at the same time. // BuiltinPatterns is only written once before the first instance // of MessageBuilderSettings is created via the static initializer. Patterns = new List(BuiltinPatterns); } public MessageBuilderSettings(MessageBuilderSettings settings) { if (settings == null) { throw new ArgumentNullException("settings"); } UserPatterns = new List(settings.UserPatterns); Patterns = new List(settings.Patterns); NickColors = settings.NickColors; StripFormattings = settings.StripFormattings; StripColors = settings.StripColors; HighlightColor = settings.HighlightColor; HighlightWords = settings.HighlightWords; } static void InitBuiltinSmartLinks() { string path_last_chars = @"a-zA-Z0-9#/%&@=\-_+;:~"; string path_chars = path_last_chars + @")(?!.,"; string domainchars = @"[a-z0-9\-]+"; string subdomain = domainchars + @"\."; string common_tld = @"de|es|im|us|com|net|org|info|biz|gov|name|edu|onion|museum"; string any_tld = @"[a-z]+"; string domain = @"(?:(?:" + subdomain + ")+(?:" + any_tld + ")|localhost)"; string short_number = "[1-9][0-9]{,4}"; string port = ":" + short_number; string user = "[a-z0-9._%+-]+@"; string domain_port = domain + "(?:" + port + ")?"; string user_domain = user + domain; string user_domain_port = "(?:" + user + ")?" + domain_port; string path = @"/(?:["+ path_chars +"]*["+ path_last_chars +"]+)?"; string protocol = @"[a-z][a-z0-9\-+]*://"; string protocol_user_domain_port_path = protocol + user_domain_port + "(?:" + path + ")?"; // facebook attachment var regex = new Regex( @"(<[1-9][0-9]* attachments?>) (http://www\.facebook\.com/messages/\?action=read&tid=[0-9a-f]+)", RegexOptions.Compiled ); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "{2}", TextFormat = "{1}", }); // protocol://user@domain:port/path regex = new Regex( protocol_user_domain_port_path, RegexOptions.IgnoreCase | RegexOptions.Compiled ); BuiltinPatterns.Add(new MessagePatternModel(regex)); // email regex = new Regex( @"(?:mailto:)?(" + user_domain + ")", RegexOptions.IgnoreCase | RegexOptions.Compiled ); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "mailto:{1}" }); // addresses without protocol (heuristical) // include well known TLDs to prevent autogen.sh, configure.ac or // Gst.Buffer.Unref() from matching string heuristic_domain = @"(?:(?:" + subdomain + ")+(?:" + common_tld + ")|localhost)"; string heuristic_address = heuristic_domain + "(?:" + path + ")?"; regex = new Regex(heuristic_address, RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://{0}" }); // Smuxi bugtracker regex = new Regex(@"smuxi#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://www.smuxi.org/issues/show/{1}" }); // RFCs regex = new Regex(@"RFC[ -]?([0-9]+) (?:s\.|ss\.|sec\.|sect\.|section) ?([1-9][0-9.]*)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://tools.ietf.org/html/rfc{1}#section-{2}" }); regex = new Regex(@"RFC[ -]?([0-9]+) (?:p\.|pp\.|page) ?(" + short_number + ")", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://tools.ietf.org/html/rfc{1}#page-{2}" }); regex = new Regex(@"RFC[ -]?([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://www.ietf.org/rfc/rfc{1}.txt" }); // XEPs regex = new Regex(@"XEP[ -]?([0-9]{4})", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://xmpp.org/extensions/xep-{1}.html" }); // ISO regex = new Regex(@"ISO[ -]?([0-9]{4,5}(?:-[0-9]+)?(?::[0-9]{4})?)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://www.iso.org/iso/home/search.htm?qt={1}&published=on" }); // ECMA regex = new Regex(@"ECMA[ -]?([0-9]{1,4})", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://www.ecma-international.org/publications/standards/ECMA-{1}.htm" }); // IEEE: IEEE-1394b, IEEE 802.11, IEEE 802.1ap-2008, IEEE 802.1AEbn-2011 regex = new Regex(@"IEEE[ -]?([0-9]{1,4}(?:\.[0-9]{1,4})?(?:[a-z]{1,4})?(?:-[0-9]{4})?)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://odysseus.ieee.org/query.html?qt={1}&style=standard" }); // bugtracker prefixes are taken from: // http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines#Current_set_of_abbreviations // boost bugtracker regex = new Regex(@"boost#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "https://svn.boost.org/trac/boost/ticket/{1}" }); // Claws bugtracker regex = new Regex(@"claws#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id={1}" }); // CVE list regex = new Regex(@"CVE-[0-9]{4}-[0-9]{4,}", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://cve.mitre.org/cgi-bin/cvename.cgi?name={0}" }); // CPAN bugtracker regex = new Regex(@"RT#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://rt.cpan.org/Public/Bug/Display.html?id={1}" }); // Debian bugtracker regex = new Regex(@"deb#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://bugs.debian.org/{1}" }); // Debian Security Advisories (DSA) regex = new Regex(@"DSA-([0-9]{4})(-[0-9]{1,2})?", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://www.debian.org/security/dsa-{1}" }); // openSUSE feature tracker regex = new Regex(@"fate#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://features.opensuse.org/{1}" }); // freedesktop bugtracker regex = new Regex(@"fdo#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://bugs.freedesktop.org/{1}" }); // GNU bugtracker regex = new Regex(@"gnu#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://debbugs.gnu.org/{1}" }); // GCC bugtracker regex = new Regex(@"gcc#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://gcc.gnu.org/bugzilla/show_bug.cgi?id={1}" }); // GNOME bugtracker regex = new Regex(@"bgo#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://bugzilla.gnome.org/{1}" }); // KDE bugtracker regex = new Regex(@"kde#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://bugs.kde.org/{1}" }); // kernel bugtracker regex = new Regex(@"bko#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://bugzilla.kernel.org/show_bug.cgi?id={1}" }); // launchpad bugtracker regex = new Regex(@"LP#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://launchpad.net/bugs/{1}" }); // Mozilla bugtracker regex = new Regex(@"bmo#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://bugzilla.mozilla.org/{1}" }); // Novell bugtracker regex = new Regex(@"bnc#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://bugzilla.novell.com/{1}" }); // Redhat bugtracker regex = new Regex(@"rh#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://bugzilla.redhat.com/{1}" }); // Samba bugtracker regex = new Regex(@"bso#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://bugzilla.samba.org/show_bug.cgi?id={1}" }); // sourceforge bugtracker regex = new Regex(@"sf#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://sf.net/support/tracker.php?aid={1}" }); // Xfce bugtracker regex = new Regex(@"bxo#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://bugzilla.xfce.org/show_bug.cgi?id={1}" }); // Xamarin bugtracker regex = new Regex(@"bxc#([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); BuiltinPatterns.Add(new MessagePatternModel(regex) { LinkFormat = "http://bugzilla.xamarin.com/show_bug.cgi?id={1}" }); // TODO: msgid -> http://mid.gmane.org/{1} // TODO: ISSN/ISBN // TODO: Path: / or X:\ // TODO: GPS -> Google Maps // TODO: IP -> Browser / Whois // TODO: Domain -> Browser / Whois // TODO: ANSI // TODO: maybe more on http://ikiwiki.info/shortcuts/ // TODO: JID } public void ApplyConfig(UserConfig userConfig) { if (userConfig == null) { throw new ArgumentNullException("userConfig"); } NickColors = (bool) userConfig["Interface/Notebook/Channel/NickColors"]; StripColors = (bool) userConfig["Interface/Notebook/StripColors"]; StripFormattings = (bool) userConfig["Interface/Notebook/StripFormattings"]; HighlightColor = TextColor.Parse( (string) userConfig["Interface/Notebook/Tab/HighlightColor"] ); HighlightWords = new List( (string[]) userConfig["Interface/Chat/HighlightWords"] ); var patternController = new MessagePatternListController(userConfig); var userPatterns = patternController.GetList(); var builtinPatterns = BuiltinPatterns; var patterns = new List(builtinPatterns.Count + userPatterns.Count); // No need to lock BuiltinPatterns as List is thread-safe for // multiple readers as long as there is no writer at the same time. // BuiltinPatterns is only written once before the first instance // of MessageBuilderSettings is created via the static initializer. patterns.AddRange(builtinPatterns); patterns.AddRange(userPatterns); Patterns = patterns; UserPatterns = userPatterns; } } } smuxi-0.11/src/Engine/Config/ProxyType.cs0000644000175000017500000000202111700531610021076 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public enum ProxyType { None, System, Http, Socks4, Socks4a, Socks5 } } smuxi-0.11/src/Engine/Config/FrontendConfig.cs0000644000175000017500000001030512253423337022036 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; #if CONFIG_NINI using Nini.Ini; #endif namespace Smuxi.Engine { public class FrontendConfig : Config { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private string _Prefix; private string _UIName; public new object this[string key] { get { var value = base["Engine/" + key]; if (value != null) { return value; } return base[_Prefix+key]; } set { base[_Prefix+key] = value; } } public FrontendConfig(string uiName) : base() { _UIName = uiName; _Prefix = "Frontend/"; #if CONFIG_NINI m_IniFilename = m_ConfigPath+"/smuxi-frontend.ini"; if (!File.Exists(m_IniFilename)) { #if LOG4NET _Logger.Debug("creating file: "+m_IniFilename); #endif File.Create(m_IniFilename).Close(); m_IsCleanConfig = true; } m_IniDocument = new IniDocument(m_IniFilename); #endif } public new void Load() { string prefix; #if LOG4NET _Logger.Info("Loading config (FrontendConfig)"); #endif // setting required default values prefix = "Frontend/"; LoadEntry(prefix+"UseLowBandwidthMode", false); LoadEntry(prefix+"ShowMenuBar", true); LoadEntry(prefix+"ShowToolBar", true); LoadEntry(prefix+"ShowStatusBar", true); prefix = "Frontend/Engines/"; Get(prefix+"Engines", new string[] {}); Get(prefix+"Default", String.Empty); prefix = "Frontend/Engines/"; LoadEntry(prefix+"Default", String.Empty); string[] engines = GetList(prefix+"Engines"); m_Preferences[prefix+"Engines"] = engines; foreach (string engine in engines) { string eprefix = prefix+engine+"/"; LoadEntry(eprefix+"Username", String.Empty); LoadEntry(eprefix+"Password", String.Empty); LoadEntry(eprefix+"Hostname", String.Empty); LoadEntry(eprefix+"BindAddress", null); LoadEntry(eprefix+"Port", null); LoadEntry(eprefix+"Channel", null); LoadEntry(eprefix+"Formatter", null); LoadEntry(eprefix+"UseSshTunnel", false); LoadEntry(eprefix+"SshProgram", null); LoadEntry(eprefix+"SshParameters", null); LoadEntry(eprefix+"SshHostname", String.Empty); LoadEntry(eprefix+"SshPort", 22); LoadEntry(eprefix+"SshUsername", String.Empty); LoadEntry(eprefix+"SshPassword", String.Empty); LoadEntry(eprefix+"SshKeyfile", String.Empty); } LoadAllEntries("Frontend/"+_UIName); LoadAllEntries("Engine"); } public new void Remove(string key) { base.Remove(_Prefix+key); } } } smuxi-0.11/src/Engine/FrontendManager.cs0000644000175000017500000003547212253423337021012 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2011 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections; using System.Collections.Generic; using System.Threading; using Smuxi.Common; namespace Smuxi.Engine { public delegate void SimpleDelegate(); public class FrontendManager : PermanentRemoteObject, IFrontendUI, IDisposable { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string _LibraryTextDomain = "smuxi-engine"; private Session _Session; private IFrontendUI _UI; private ChatModel _CurrentChat; private IProtocolManager _CurrentProtocolManager; private bool _IsFrontendDisconnecting; private SimpleDelegate _ConfigChangedDelegate; private bool _IsFrontendSynced; private IList _SyncedChats = new List(); private TaskQueue f_TaskQueue; DateTime LastConfigChange; public int Version { get { return 0; } } public SimpleDelegate ConfigChangedDelegate { set { _ConfigChangedDelegate = value; } } public ChatModel CurrentChat { get { return _CurrentChat; } set { _CurrentChat = value; } } public IProtocolManager CurrentProtocolManager { get { return _CurrentProtocolManager; } set { _CurrentProtocolManager = value; } } public bool IsFrontendDisconnecting { get { return _IsFrontendDisconnecting; } set { _IsFrontendDisconnecting = value; } } public bool IsAlive { get { return !f_TaskQueue.Disposed; } } public FrontendManager(Session session, IFrontendUI ui) { Trace.Call(session, ui); if (session == null) { throw new ArgumentNullException("session"); } if (ui == null) { throw new ArgumentNullException("ui"); } _Session = session; _UI = ui; f_TaskQueue = new TaskQueue("FrontendManager"); f_TaskQueue.ExceptionEvent += OnTaskQueueExceptionEvent; f_TaskQueue.AbortedEvent += OnTaskQueueAbortedEvent; // register event for config invalidation _Session.Config.Changed += _OnConfigChanged; } ~FrontendManager() { Trace.Call(); Dispose(false); } public void Dispose() { Trace.Call(); Dispose(true); GC.SuppressFinalize(this); } protected void Dispose(bool disposing) { Trace.Call(disposing); if (disposing) { f_TaskQueue.Dispose(); _Session.Config.Changed -= _OnConfigChanged; } } public void Sync() { Trace.Call(); // sync current page List chats; lock (_Session.Chats) { _CurrentChat = _Session.Chats[0]; chats = new List(_Session.Chats); } // restore page positions if (_CurrentChat.Position != -1) { // looks like the positions were synced, sort it good chats.Sort( (a, b) => (a.Position.CompareTo(b.Position)) ); } // sync pages foreach (ChatModel chat in chats) { _AddChat(chat); } // sync current network manager (if any exists) IProtocolManager nm = _Session.FirstProtocolManager; if (nm != null) { CurrentProtocolManager = nm; } // sync content of pages foreach (ChatModel chat in chats) { _SyncChat(chat); } _IsFrontendSynced = true; _Session.CheckPresenceStatus(); } /// /// This method is thread safe. /// public void AddSyncedChat(ChatModel chatModel) { Trace.Call(chatModel); if (!chatModel.IsEnabled) { // The frontend synced a disabled chat, this means the content // was is not in a clean state and thus we need to ignore this // sync so that a "re-sync" will bring the chat into a clean // state again. If we would not do this a re-sync would be // ignored, see SyncChat() and // http://www.smuxi.org/issues/show/132 return; } // this method must be thread-safe as the frontend might sync // multiple chats at the same time lock (_SyncedChats) { _SyncedChats.Add(chatModel); } } public void NextProtocolManager() { Trace.Call(); CurrentProtocolManager = _Session.NextProtocolManager(CurrentProtocolManager); UpdateNetworkStatus(); } public void UpdateNetworkStatus() { if (CurrentProtocolManager != null) { SetNetworkStatus(CurrentProtocolManager.ToString()); } else { SetNetworkStatus(String.Format("({0})", _("No network connections"))); } } public void AddChat(ChatModel chat) { if (!IsSynced(chat) && _IsFrontendSynced) { _AddChat(chat); } } private void _AddChat(ChatModel chat) { f_TaskQueue.Queue(delegate { _UI.AddChat(chat); }); } [Obsolete("This method is deprecated, use AddMessageToChat(cmd.Chat, MessageModel) instead!")] public void AddTextToChat(ChatModel chat, string text) { AddMessageToChat(chat, new MessageModel(text)); } [Obsolete("This method is unsafe, use AddMessageToChat(cmd.Chat, MessageModel) instead!", true)] public void AddTextToCurrentChat(string text) { AddTextToChat(CurrentChat, text); } public void EnableChat(ChatModel chat) { f_TaskQueue.Queue(delegate { _UI.EnableChat(chat); }); } public void DisableChat(ChatModel chat) { lock (_SyncedChats) { _SyncedChats.Remove(chat); } f_TaskQueue.Queue(delegate { _UI.DisableChat(chat); }); } public void AddMessageToChat(ChatModel chat, MessageModel msg) { if (!IsSynced(chat)) { #if LOG4NET // too much logging noise //_Logger.Warn("AddMessageToChat(): chat: " + chat + " is not synced yet, ignoring call..."); #endif return; } // BUG: if the frontend is syncing this chat, he probably will lose // messages heres! _AddMessageToChat(chat, msg); } private void _AddMessageToChat(ChatModel chat, MessageModel msg) { f_TaskQueue.Queue(delegate { _UI.AddMessageToChat(chat, msg); }); } [Obsolete("This method is unsafe, use AddMessageToChat(cmd.Chat, msg) instead!", true)] public void AddMessageToCurrentChat(MessageModel msg) { AddMessageToChat(CurrentChat, msg); } public void RemoveChat(ChatModel chat) { lock (_SyncedChats) { _SyncedChats.Remove(chat); } // switch to next protocol manager if the current one was closed if (chat is ProtocolChatModel && chat.ProtocolManager == CurrentProtocolManager) { NextProtocolManager(); } f_TaskQueue.Queue(delegate { _UI.RemoveChat(chat); }); } public void SyncChat(ChatModel chat) { if (!IsSynced(chat) && _IsFrontendSynced) { _SyncChat(chat); } } private void _SyncChat(ChatModel chat) { f_TaskQueue.Queue(delegate { _UI.SyncChat(chat); }); } public void AddPersonToGroupChat(GroupChatModel groupChat, PersonModel person) { if (!IsSynced(groupChat)) { return; } _AddPersonToGroupChat(groupChat, person); } private void _AddPersonToGroupChat(GroupChatModel groupChat, PersonModel person) { f_TaskQueue.Queue(delegate { _UI.AddPersonToGroupChat(groupChat, person); }); } public void UpdatePersonInGroupChat(GroupChatModel groupChat, PersonModel oldPerson, PersonModel newPerson) { if (!IsSynced(groupChat)) { return; } _UpdatePersonInGroupChat(groupChat, oldPerson, newPerson); } private void _UpdatePersonInGroupChat(GroupChatModel groupChat, PersonModel oldPerson, PersonModel newPerson) { f_TaskQueue.Queue(delegate { _UI.UpdatePersonInGroupChat(groupChat, oldPerson, newPerson); }); } public void UpdateTopicInGroupChat(GroupChatModel groupChat, MessageModel topic) { if (!IsSynced(groupChat)) { return; } _UpdateTopicInGroupChat(groupChat, topic); } private void _UpdateTopicInGroupChat(GroupChatModel groupChat, MessageModel topic) { f_TaskQueue.Queue(delegate { _UI.UpdateTopicInGroupChat(groupChat, topic); }); } public void RemovePersonFromGroupChat(GroupChatModel groupChat, PersonModel person) { if (!IsSynced(groupChat)) { return; } _RemovePersonFromGroupChat(groupChat, person); } private void _RemovePersonFromGroupChat(GroupChatModel groupChat, PersonModel person) { f_TaskQueue.Queue(delegate { _UI.RemovePersonFromGroupChat(groupChat, person); }); } public void SetNetworkStatus(string status) { f_TaskQueue.Queue(delegate { _UI.SetNetworkStatus(status); }); } public void SetStatus(string status) { f_TaskQueue.Queue(delegate { _UI.SetStatus(status); }); } private void _OnConfigChanged(object sender, EventArgs e) { Trace.Call(sender, e); // only push config changes once per 30 seconds if ((DateTime.UtcNow - LastConfigChange).TotalSeconds < 30) { return; } try { // DISABLED: delegate is not reliable enough, this needs to be // replaced with an IChatConfig API /* if (_ConfigChangedDelegate != null) { _ConfigChangedDelegate(); } */ } catch (Exception ex) { #if LOG4NET _Logger.Error(ex); #endif } LastConfigChange = DateTime.UtcNow; } /// /// This method is thread safe. /// bool IsSynced(ChatModel chatModel) { if (chatModel == null) { throw new ArgumentNullException("chatModel"); } lock (_SyncedChats) { return _SyncedChats.Contains(chatModel); } } protected virtual void OnTaskQueueExceptionEvent(object sender, TaskQueueExceptionEventArgs e) { Trace.Call(sender, e); if (e.Exception is System.Runtime.Remoting.RemotingException) { #if LOG4NET if (!_IsFrontendDisconnecting) { // we didn't expect this problem _Logger.Error("RemotingException in TaskQueue: ", e.Exception); _Logger.Error("Inner-Exception: ", e.Exception.InnerException); } #endif // TODO: setup a timer and wait up to 10 minutes to let // the frontend resume the session, after that timeout // clean it good } else { #if LOG4NET _Logger.Error("Exception in TaskQueue: ", e.Exception); _Logger.Error("Inner-Exception: ", e.Exception.InnerException); #endif } // no need to remove us from the Session here as // OnTaskQueueAbortedEvent will be raised after this and handle it } protected virtual void OnTaskQueueAbortedEvent(object sender, EventArgs e) { Trace.Call(sender, e); // we can't rely on the UI (proxy) object here, the connection is probably // gone and doesn't come back //_Session.DeregisterFrontendUI(_UI); // thus we can deregister the hardway (by using our instance) _Session.DeregisterFrontendManager(this); } private static string _(string msg) { return LibraryCatalog.GetString(msg, _LibraryTextDomain); } } } smuxi-0.11/src/Engine/PermanentRemoteObject.cs0000644000175000017500000000324211655545675022201 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Runtime.Remoting.Lifetime; namespace Smuxi.Engine { public abstract class PermanentRemoteObject : MarshalByRefObject { public override object InitializeLifetimeService() { // no, please, nooooo, don't kill us! // both ways will cause an infinitive lifetime for the object /* Console.WriteLine("InitializeLifetimeService()"); ILease lease = (ILease)base.InitializeLifetimeService(); if (lease.CurrentState == LeaseState.Initial) { Console.WriteLine("LeaseState.Initial!"); lease.InitialLeaseTime = TimeSpan.Zero; } return lease; */ return null; } } } smuxi-0.11/src/Engine/Persons/0000755000175000017500000000000012311344240017015 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine/Persons/PersonModel.cs0000644000175000017500000000621711700531605021605 0ustar00meebeymeebey00000000000000/* * $Id: NetworkType.cs 141 2006-12-31 02:09:01Z meebey $ * $URL: svn+ssh://svn.qnetp.net/svn/smuxi/smuxi/trunk/src/Engine/NetworkType.cs $ * $Rev: 141 $ * $Author: meebey $ * $Date: 2006-12-31 03:09:01 +0100 (Sun, 31 Dec 2006) $ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Runtime.Remoting; using System.Runtime.Serialization; using Smuxi.Common; namespace Smuxi.Engine { [Serializable] public class PersonModel : ContactModel { private IProtocolManager _ProtocolManager; public IProtocolManager ProtocolManager { get { return _ProtocolManager; } } public PersonModel(string id, string displayName, string networkID, string networkProtocol, IProtocolManager protocolManager) : base(id, displayName, networkID, networkProtocol) { if (protocolManager == null) { throw new ArgumentNullException("protocolManager"); } _ProtocolManager = protocolManager; } protected PersonModel(SerializationInfo info, StreamingContext ctx) : base(info, ctx) { if (info == null) { throw new ArgumentNullException("info"); } // TODO: we might optimize this away, causes 800 bytes per remoting call _ProtocolManager = (IProtocolManager) info.GetValue("_ProtocolManager", typeof(IProtocolManager)); } public override void GetObjectData(SerializationInfo info, StreamingContext ctx) { if (info == null) { throw new ArgumentNullException("info"); } base.GetObjectData(info, ctx); info.AddValue("_ProtocolManager", _ProtocolManager); } public override string ToTraceString() { if (_ProtocolManager == null || RemotingServices.IsTransparentProxy(_ProtocolManager)) { // avoids remoting call return base.ToTraceString(); } // REMOTING CALL return _ProtocolManager.ToString() + "/" + IdentityName; } } } smuxi-0.11/src/Engine/Persons/ContactModel.cs0000644000175000017500000002014312253423337021732 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2007, 2010-2011, 2013 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Text; using System.Runtime.Serialization; using System.Security.Cryptography; using System.Threading; using System.Globalization; using Smuxi.Common; namespace Smuxi.Engine { [Serializable] public class ContactModel : ITraceable, ISerializable, IComparable, IComparable { private string _ID; private string _IdentityName; private string _NetworkID; private string _NetworkProtocol; private TextMessagePartModel _IdentityNameColored; object IdentityNameSyncRoot { get; set; } public string ID { get { return _ID; } } /// /// This property is thread safe. /// public string IdentityName { get { return _IdentityName; } set { lock (IdentityNameSyncRoot) { _IdentityName = value; _IdentityNameColored = null; } } } /// /// This property is thread safe. /// public TextMessagePartModel IdentityNameColored { get { if (_IdentityNameColored == null) { lock (IdentityNameSyncRoot) { _IdentityNameColored = GetColoredIdentityName( _IdentityName, null ); } } return _IdentityNameColored; } set { _IdentityNameColored = value; } } public string NetworkID { get { return _NetworkID; } } public string NetworkProtocol { get { return _NetworkProtocol; } } public ContactModel(string id, string identityName, string networkID, string networkProtocol) { Trace.Call(id, identityName, networkID, networkProtocol); if (id == null) { throw new ArgumentNullException("id"); } if (identityName == null) { throw new ArgumentNullException("identityName"); } if (networkID == null) { throw new ArgumentNullException("networkID"); } if (networkProtocol == null) { throw new ArgumentNullException("networkProtocol"); } _ID = id; _IdentityName = identityName; _NetworkID = networkID; _NetworkProtocol = networkProtocol; IdentityNameSyncRoot = new Object(); } protected ContactModel(SerializationInfo info, StreamingContext ctx) { if (info == null) { throw new ArgumentNullException("info"); } IdentityNameSyncRoot = new Object(); SerializationReader sr = SerializationReader.GetReader(info); SetObjectData(sr); } public virtual void GetObjectData(SerializationInfo info, StreamingContext ctx) { if (info == null) { throw new ArgumentNullException("info"); } SerializationWriter sw = SerializationWriter.GetWriter(); GetObjectData(sw); sw.AddToInfo(info); } protected virtual void SetObjectData(SerializationReader sr) { if (sr == null) { throw new ArgumentNullException("sr"); } _ID = sr.ReadString(); _IdentityName = sr.ReadString(); _NetworkID = sr.ReadString(); _NetworkProtocol = sr.ReadString(); } protected virtual void GetObjectData(SerializationWriter sw) { if (sw == null) { throw new ArgumentNullException("sw"); } sw.Write(_ID); sw.Write(_IdentityName); sw.Write(_NetworkID); sw.Write(_NetworkProtocol); } protected virtual TextMessagePartModel GetColoredIdentityName( string idendityName, string normalized) { var name = new TextMessagePartModel(idendityName); if (normalized == null) { normalized = idendityName; } var crc = new Crc32(); crc.ComputeHash(Encoding.UTF8.GetBytes(normalized)); var hash = crc.CrcValue; var upper24 = hash >> 8; /* var lower24 = hash & 0xFFFFFFU; var merged = upper24 ^ lower24; var rotated = (hash >> 16) | ((hash & 0xFFFFU) << 16); */ uint flippedHash = (hash >> 16) | (hash << 16); var flippedMergedHash = (flippedHash >> 8) ^ (flippedHash & 0xFFFFFFU); name.ForegroundColor = new TextColor(upper24); name.BackgroundColor = new TextColor(flippedMergedHash); /* MD5CryptoServiceProvider csp = new MD5CryptoServiceProvider(); var md5hash = csp.ComputeHash(Encoding.UTF8.GetBytes(normalized)); var fgHash = BitConverter.ToUInt32(md5hash, 0); var bgHash = BitConverter.ToUInt32(md5hash, 4); name.ForegroundColor = new TextColor(fgHash >> 8); name.BackgroundColor = new TextColor(bgHash >> 8); */ return name; } public virtual string ToTraceString() { return _NetworkID + "/" + _IdentityName; } public virtual int CompareTo(ContactModel contact) { if (contact == null) { return 1; } return String.Compare(IdentityName, contact.IdentityName, true, CultureInfo.InvariantCulture); } int IComparable.CompareTo(object contact) { return CompareTo(contact as ContactModel); } public override bool Equals(object obj) { var value = obj as ContactModel; if (value == null) { return false; } return Equals(value); } public virtual bool Equals(ContactModel model) { if (model == null) { return false; } if (ID != model.ID) { return false; } if (NetworkID != model.NetworkID) { return false; } if (NetworkProtocol != model.NetworkProtocol) { return false; } return true; } public static bool operator ==(ContactModel a, ContactModel b) { if (System.Object.ReferenceEquals(a, b)) { return true; } if ((object) a == null || (object) b == null) { return false; } return a.Equals(b); } public static bool operator !=(ContactModel a, ContactModel b) { return !(a == b); } } } smuxi-0.11/src/Engine/TextColorContrast.cs0000644000175000017500000000211711700531605021361 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public enum TextColorContrast : int { None = 0, VeryLow = 10, Low = 20, Medium = 35, High = 50, VeryHigh = 60 } } smuxi-0.11/src/Engine/CommandModel.cs0000644000175000017500000001676712257043746020313 0ustar00meebeymeebey00000000000000/* * $Id$ * $URL$ * $Rev$ * $Author$ * $Date$ * * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2006 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections.Generic; using System.Runtime.Serialization; using Smuxi.Common; using System.Text.RegularExpressions; namespace Smuxi.Engine { [Serializable] public class CommandModel : ITraceable, ISerializable { #if LOG4NET private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private string _Data; private string[] _DataArray; private string _Parameter; private bool _IsCommand; private string _CommandCharacter; private string _Command; private FrontendManager _FrontendManager; private ChatModel _Chat; public string Data { get { return _Data; } } public string[] DataArray { get { return _DataArray; } } public string Parameter { get { return _Parameter; } } public bool IsCommand { get { return _IsCommand; } } public string CommandCharacter { get { return _CommandCharacter; } } public string Command { get { return _Command; } } public FrontendManager FrontendManager { get { return _FrontendManager; } } public ChatModel Chat { get { return _Chat; } } public CommandModel(FrontendManager fm, ChatModel chat, string cmdChar, string data) { Trace.Call(fm, chat == null ? "(null)" : chat.GetType().ToString(), cmdChar, data); _Data = data; _CommandCharacter = cmdChar; _FrontendManager = fm; _Chat = chat; try { EnhancedParse(data); } catch (FormatException) { SimpleParse(data); } } public CommandModel(FrontendManager fm, ChatModel chat, string parameter) : this(fm, chat, "/", "/cmd " + parameter) { } protected CommandModel(SerializationInfo info, StreamingContext ctx) { SerializationReader sr = SerializationReader.GetReader(info); SetObjectData(sr); _FrontendManager = (FrontendManager) info.GetValue("_FrontendManager", typeof(FrontendManager)); _Chat = (ChatModel) info.GetValue("_Chat", typeof(ChatModel)); } protected virtual void SetObjectData(SerializationReader sr) { // FIXME: optimize this by re-parsing instead of deserializing _Data = sr.ReadString(); _DataArray = _Data.Split(new char[] {' '}); _Parameter = sr.ReadString(); _IsCommand = sr.ReadBoolean(); _CommandCharacter = sr.ReadString(); _Command = sr.ReadString(); //_FrontendManager = (FrontendManager) sr.ReadObject(); //_Chat = (ChatModel) sr.ReadObject(); } protected virtual void GetObjectData(SerializationWriter sw) { sw.Write(_Data); //sw.Write(_DataArray); sw.Write(_Parameter); sw.Write(_IsCommand); sw.Write(_CommandCharacter); sw.Write(_Command); //sw.WriteObject(_FrontendManager); //sw.WriteObject(_Chat); } public virtual void GetObjectData(SerializationInfo info, StreamingContext ctx) { SerializationWriter sw = SerializationWriter.GetWriter(); GetObjectData(sw); sw.AddToInfo(info); info.AddValue("_FrontendManager", _FrontendManager); info.AddValue("_Chat", _Chat); } public string ToTraceString() { return _Data; } void EnhancedParse(string data) { string regex = Regex.Escape(_CommandCharacter); regex += "(?[a-z_-]+)"; // commands can only contain english keyboard letters string quoted_parameter = @"""(?[^""]*)"""; string normal_parameter = @"(?[^ ]+)"; string parameters = @"( +(" + quoted_parameter + "|" + normal_parameter + "))*"; regex += parameters + " *"; // may end with spaces regex = "^" + regex + "$"; // parse full string var match = Regex.Match(data, regex, RegexOptions.IgnoreCase); if (data.Contains(" ")) { _Parameter = data.Substring(data.IndexOf(' ') + 1); } else { _Parameter = ""; } if (match.Success) { _IsCommand = true; _Command = match.Groups["command"].Value; var list = new List(); list.Add(_CommandCharacter + _Command); foreach (Capture cap in match.Groups["parameters"].Captures) { list.Add(cap.Value); } _DataArray = list.ToArray(); } else { if (data.StartsWith(_CommandCharacter + _CommandCharacter)) { _Data = data.Substring(_CommandCharacter.Length); } else if (data.StartsWith(_CommandCharacter)) { throw new FormatException("command could not be parsed by command regex, regex must be broken"); } _DataArray = new string[1]; _DataArray[0] = _Data; } } void SimpleParse(string data) { _DataArray = data.Split(new char[] {' '}); _Parameter = String.Join(" ", _DataArray, 1, _DataArray.Length - 1); if (data.StartsWith(_CommandCharacter) && !data.StartsWith(_CommandCharacter + _CommandCharacter)) { _Command = (_DataArray [0].Length > _CommandCharacter.Length) ? _DataArray [0].Substring(_CommandCharacter.Length).ToLower() : String.Empty; } else if (data.StartsWith(_CommandCharacter + _CommandCharacter)) { _Data = data.Substring(_CommandCharacter.Length); _DataArray [0] = _DataArray [0].Substring(_CommandCharacter.Length); } } } } smuxi-0.11/src/Engine/MessageBuffers/0000755000175000017500000000000012311344240020265 5ustar00meebeymeebey00000000000000smuxi-0.11/src/Engine/MessageBuffers/MessageBufferBase.cs0000644000175000017500000000434411700531605024136 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections; using System.Collections.Generic; using Smuxi.Common; namespace Smuxi.Engine { public abstract class MessageBufferBase : IMessageBuffer { protected string Protocol { get; set; } protected string NetworkID { get; set; } protected string ChatID { get; set; } public int MaxCapacity { get; set; } public bool IsReadOnly { get { return false; } } protected MessageBufferBase() { } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } public abstract int Count { get; } public abstract MessageModel this[int index] { get; set; } public abstract void Add(MessageModel item); public abstract void Clear(); public abstract bool Contains(MessageModel item); public abstract void CopyTo(MessageModel[] array, int arrayIndex); public abstract bool Remove(MessageModel item); public abstract IEnumerator GetEnumerator(); public abstract int IndexOf(MessageModel item); public abstract void Insert(int index, MessageModel item); public abstract void RemoveAt(int index); public abstract IList GetRange(int offset, int limit); public abstract void Dispose(); } } smuxi-0.11/src/Engine/MessageBuffers/ListMessageBuffer.cs0000644000175000017500000000354111700531605024175 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010-2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; namespace Smuxi.Engine { public class ListMessageBuffer : List, IMessageBuffer { int f_MaxCapacity; public int MaxCapacity { get { return f_MaxCapacity; } set { f_MaxCapacity = value; Capacity = f_MaxCapacity; } } public ListMessageBuffer() { } public new void Add(MessageModel item) { if (MaxCapacity > 0 && Count >= MaxCapacity) { RemoveAt(0); } base.Add(item); } IList IMessageBuffer.GetRange(int offset, int limit) { // clamp limit to count if (offset + limit > Count) { limit = Count - offset; } return base.GetRange(offset, limit); } public void Dispose() { // NOOP } } } smuxi-0.11/src/Engine/MessageBuffers/IMessageBuffer.cs0000644000175000017500000000217311700531605023452 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010-2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; namespace Smuxi.Engine { public interface IMessageBuffer : IList, IDisposable { IList GetRange(int offset, int limit); int MaxCapacity { get; set; } } } smuxi-0.11/src/Engine/MessageBuffers/Db4oMessageBuffer.cs0000644000175000017500000005334412307031750024060 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.IO; using System.Collections.Generic; using Db4objects.Db4o; using Db4objects.Db4o.Config; using Db4objects.Db4o.Defragment; using Db4objects.Db4o.Diagnostic; using Smuxi.Common; namespace Smuxi.Engine { public class Db4oMessageBuffer : MessageBufferBase { #if LOG4NET static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif const string LibraryTextDomain = "smuxi-engine"; const int DefaultFlushInterval = 16; List f_Index; int FlushInterval { get; set; } int FlushCounter { get; set; } IObjectContainer Database { get; set; } string DatabaseFile { get; set; } bool IsEmptyDatabase { get; set; } string SessionUsername { get; set; } bool AggressiveGC { get; set; } #if DB4O_8_0 IEmbeddedConfiguration DatabaseConfiguration { get; set; } #else IConfiguration DatabaseConfiguration { get; set; } #endif private List Index { get { InitIndex(); return f_Index; } } public override MessageModel this[int index] { get { var dbId = Index[index]; return GetMessage(dbId); } set { throw new NotImplementedException(); } } public override int Count { get { return Index.Count; } } private Db4oMessageBuffer() { FlushInterval = DefaultFlushInterval; } public Db4oMessageBuffer(string sessionUsername, string protocol, string networkId, string chatId) : this() { if (sessionUsername == null) { throw new ArgumentNullException("sessionUsername"); } if (protocol == null) { throw new ArgumentNullException("protocol"); } if (networkId == null) { throw new ArgumentNullException("networkId"); } if (chatId == null) { throw new ArgumentNullException("chatId"); } SessionUsername = sessionUsername; Protocol = protocol; NetworkID = networkId; ChatID = chatId; AggressiveGC = true; DatabaseFile = GetDatabaseFile(); InitDatabase(); } public Db4oMessageBuffer(string dbPath) : this() { if (dbPath == null) { throw new ArgumentNullException("dbPath"); } DatabaseFile = dbPath; InitDatabase(); } ~Db4oMessageBuffer() { Dispose(false); } public override void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected void Dispose(bool disposing) { if (Database == null) { return; } CloseDatabase(); Database = null; ResetIndex(); } public override void Add(MessageModel item) { if (item == null) { throw new ArgumentNullException("item"); } // make sure the index is initialized at this point else we will // load the 1st added item of db4o and end up with a duplicate here InitIndex(); if (MaxCapacity > 0 && Index.Count >= MaxCapacity) { RemoveAt(0); } // TODO: auto-flush every 60 seconds var dbMsg = new MessageModel(item); Database.Store(dbMsg); Database.Deactivate(dbMsg, 5); var dbId = Database.Ext().GetID(dbMsg); Index.Add(dbId); FlushCounter++; if (FlushCounter >= FlushInterval) { Flush(); } } public override void Clear() { foreach (var dbId in Index) { var dbMsg = Database.Ext().GetByID(dbId); Database.Delete(dbMsg); } ResetIndex(); } public override bool Contains(MessageModel item) { if (item == null) { throw new ArgumentNullException("item"); } // TODO: benchmark me! //return Database.Query().Contains(item); return IndexOf(item) != -1; } public override void CopyTo(MessageModel[] array, int arrayIndex) { if (array == null) { throw new ArgumentNullException("array"); } int i = arrayIndex; foreach (var msg in this) { array[i++] = msg; } } public override IEnumerator GetEnumerator() { foreach (var dbId in Index) { yield return GetMessage(dbId); } } public override int IndexOf(MessageModel item) { if (item == null) { throw new ArgumentNullException("item"); } var res = Database.QueryByExample(item); // return -1 if not found if (res.Count == 0) { return -1; } var dbMsg = (MessageModel) res[0]; var dbId = Database.Ext().GetID(dbMsg); return Index.IndexOf(dbId); } public override void Insert(int index, MessageModel item) { throw new NotSupportedException(); } public override void RemoveAt(int index) { if (index < 0 || index >= Index.Count) { throw new ArgumentOutOfRangeException("index"); } var dbId = Index[index]; Index.RemoveAt(index); var dbMsg = Database.Ext().GetByID(dbId); if (dbMsg == null) { #if LOG4NET Logger.Error( String.Format("RemoveAt(): Database.Ext().GetByID({0}) " + "with index {1} returned null!", dbId, index) ); #endif return; } Database.Delete(dbMsg); // TODO: auto-commit after some timeout } public override bool Remove(MessageModel item) { if (item == null) { throw new ArgumentNullException("item"); } if (!Contains(item)) { return false; } var dbId = Database.Ext().GetID(item); Index.Remove(dbId); Database.Delete(item); return true; } public override IList GetRange(int offset, int limit) { if (offset < 0) { throw new ArgumentException( "offset must be greater than or equal to 0.", "offset" ); } // Neither Count nor the Indexer have to be synchronized as the // messages might move from the buffer to the db4o index but that // doesn't change the Count neither affects the combined indexer // BUG?: but what about MaxCapacity which will remove oldest items // when new messages are added, our loop here would become // inconsistent! // Session.AddMessageToChat() and ChatModel.get_Messages lock()s // us though thus newly added messages are waiting for us to finish var bufferCount = Count; var rangeCount = Math.Min(bufferCount, limit); var range = new List(rangeCount); for (int i = offset; i < offset + limit && i < bufferCount; i++) { range.Add(this[i]); } return range; } public static int OptimizeAllBuffers(Db4oMessageBufferOptimizationTypes opts) { DateTime start = DateTime.UtcNow, stop; var dbPath = Platform.GetBuffersBasePath(); var dbFiles = Directory.GetFiles(dbPath, "*.db4o", SearchOption.AllDirectories); foreach (var dbFile in dbFiles) { #if LOG4NET Logger.Info(String.Format(_("Optimizing: {0}..."), dbFile)); #endif try { using (var buffer = new Db4oMessageBuffer(dbFile)) { buffer.AggressiveGC = false; if ((opts & Db4oMessageBufferOptimizationTypes.Defrag) != 0) { buffer.CloseDatabase(); buffer.DefragDatabase(); buffer.InitDatabase(); } if ((opts & Db4oMessageBufferOptimizationTypes.Index) != 0) { buffer.RebuildIndex(); } } } catch (Exception ex) { #if LOG4NET Logger.Debug("OptimizeAllBuffers(): Failed to optimize: " + dbFile + " Exception: ", ex); Logger.InfoFormat(_("Failed to optimize: {0}. Reason: {1}"), dbFile, ex.Message); #endif } } stop = DateTime.UtcNow; #if LOG4NET Logger.Debug( String.Format( "OptimizeAllBuffers(): optimizing buffers took: {0:0} second(s)", (stop - start).TotalSeconds ) ); #endif return dbFiles.Length; } private void InitDatabase() { ConfigureDatabase(); try { OpenDatabase(); } catch (Exception ex) { #if LOG4NET Logger.Error("InitDatabase(): failed to open message " + "database: " + DatabaseFile, ex); #endif FixDatabase(ex); // WORXNOWPLX OpenDatabase(); var builder = new MessageBuilder(); builder.AppendEventPrefix(); builder.AppendErrorText( _("Your chat history is no longer available because of " + "an error but will be preserved from now on.") ); Add(builder.ToMessage()); } } void ConfigureDatabase() { #if DB4O_8_0 DatabaseConfiguration = Db4oEmbedded.NewConfiguration(); DatabaseConfiguration.Common.AllowVersionUpdates = true; DatabaseConfiguration.Common.ActivationDepth = 0; //DatabaseConfiguration.Common.Queries.EvaluationMode(QueryEvaluationMode.Lazy); DatabaseConfiguration.Common.WeakReferenceCollectionInterval = 60 * 1000; //DatabaseConfiguration.Common.Diagnostic.AddListener(new DiagnosticToConsole()); var msgConf = DatabaseConfiguration.Common.ObjectClass(typeof(MessageModel)); msgConf.CascadeOnActivate(true); msgConf.CascadeOnDelete(true); msgConf.Indexed(true); msgConf.ObjectField("f_TimeStamp").Indexed(true); #else DatabaseConfiguration = Db4oFactory.Configure(); DatabaseConfiguration.AllowVersionUpdates(true); DatabaseConfiguration.ObjectClass(typeof(MessageModel)). ObjectField("f_TimeStamp").Indexed(true); #endif } string GetDatabaseFile() { var dbPath = Platform.GetBuffersPath(SessionUsername); var protocol = Protocol.ToLower(); var network = NetworkID.ToLower(); dbPath = Path.Combine(dbPath, protocol); if (network != protocol) { dbPath = Path.Combine(dbPath, network); } dbPath = IOSecurity.GetFilteredPath(dbPath); if (!Directory.Exists(dbPath)) { Directory.CreateDirectory(dbPath); } var chatId = IOSecurity.GetFilteredFileName(ChatID.ToLower()); dbPath = Path.Combine(dbPath, String.Format("{0}.db4o", chatId)); return dbPath; } void OpenDatabase() { IsEmptyDatabase = !File.Exists(DatabaseFile); #if DB4O_8_0 Database = Db4oEmbedded.OpenFile(DatabaseConfiguration, DatabaseFile); #else Database = Db4oFactory.OpenFile(DatabaseConfiguration, DatabaseFile); #endif } void CloseDatabase() { if (Database.Ext().IsClosed()) { return; } Flush(); FlushIndex(); Database.Close(); Database.Dispose(); } void FixDatabase(Exception ex) { try { CloseDatabase(); } catch { } // do some sanity checks before we assume the database is // really broken if (!File.Exists(DatabaseFile)) { throw new FileNotFoundException(DatabaseFile); } try { using (File.OpenWrite(DatabaseFile)); } catch { throw; } var timestamp = DateTime.Now.ToString("s"); timestamp = timestamp.Replace("T", "_").Replace(":", "_"); var brokenDbFile = String.Format("{0}_{1}_broken", DatabaseFile, timestamp); var brokenLogFile = String.Format("{0}.log", brokenDbFile); File.WriteAllText(brokenLogFile, ex.ToString()); #if LOG4NET Logger.DebugFormat("FixDatabase(): moving broken database " + "from: {0} to: {1}", DatabaseFile, brokenDbFile); #endif File.Move(DatabaseFile, brokenDbFile); ConfigureDatabase(); } void DefragDatabase() { if (!File.Exists(DatabaseFile)) { return; } DateTime start = DateTime.UtcNow, stop; var backupFile = String.Format( "{0}.bak_{1}.{2}", DatabaseFile, Db4oVersion.Major, Db4oVersion.Minor ); var defragConfig = new DefragmentConfig( DatabaseFile, backupFile ); defragConfig.ForceBackupDelete(true); Defragment.Defrag(defragConfig); stop = DateTime.UtcNow; #if LOG4NET Logger.Debug( String.Format( "DefragDatabase(): defrag took: {0:0.0} ms", (stop - start).TotalMilliseconds ) ); #endif } MessageModel GetMessage(MessageModel dbMsg) { Database.Activate(dbMsg, 10); var msg = new MessageModel(dbMsg); Database.Deactivate(dbMsg, 10); return msg; } MessageModel GetMessage(Int64 dbId) { var dbMsg = (MessageModel) Database.Ext().GetByID(dbId); return GetMessage(dbMsg); } void InitIndex() { if (f_Index != null) { return; } if (IsEmptyDatabase) { #if LOG4NET Logger.Debug("InitIndex(): Creating initial index..."); #endif f_Index = new List(MaxCapacity); return; } var index = FetchIndex(); if (index == null) { #if LOG4NET Logger.Info("InitIndex(): No index found, building..."); #endif RebuildIndex(); return; } f_Index = index; } List FetchIndex() { DateTime start = DateTime.UtcNow, stop; var indexes = Database.Query>(); if (indexes.Count == 0) { return null; } if (indexes.Count > 1) { #if LOG4NET Logger.Warn( "FetchIndex(): found multiple indexes, dropping them..." ); #endif // we can't deal with multiple indexes, so drop them all foreach (var idx in indexes) { Database.Delete(idx); } Database.Commit(); return null; } var index = indexes[0]; Database.Activate(index, 10); var msgCount = Database.Query().Count; if (index.Count != msgCount) { #if LOG4NET Logger.Warn( String.Format( "FetchIndex(): index out of sync! index count: {0} " + "vs message count: {1}", index.Count, msgCount ) ); #endif Database.Delete(index); return null; } stop = DateTime.UtcNow; #if LOG4NET Logger.Debug( String.Format( "FetchIndex(): query, activation and validation took: " + "{0:0.00} ms, items: {1}", (stop - start).TotalMilliseconds, index.Count ) ); #endif return index; } List BuildIndex() { DateTime start = DateTime.UtcNow, stop; var query = Database.Query(); query.Constrain(typeof(MessageModel)); query.Descend("f_TimeStamp").OrderAscending(); var dbIndex = query.Execute(); stop = DateTime.UtcNow; #if LOG4NET Logger.Debug( String.Format( "BuildIndex(): query took: {0:0.00} ms, items: {1}", (stop - start).TotalMilliseconds, dbIndex.Count ) ); #endif start = DateTime.UtcNow; var indexCapacity = Math.Max(dbIndex.Count, MaxCapacity); var index = new List(indexCapacity); int purgeCounter = 0; int purgeInterval = 1000; foreach (var dbMsg in dbIndex) { var dbId = Database.Ext().GetID(dbMsg); index.Add(dbId); if (purgeCounter++ >= purgeInterval) { purgeCounter = 0; if (AggressiveGC) { Database.Ext().Purge(); } } } Database.Ext().Purge(); stop = DateTime.UtcNow; #if LOG4NET Logger.Debug( String.Format( "BuildIndex(): building index took: {0:0.00} ms", (stop - start).TotalMilliseconds ) ); #endif return index; } void RebuildIndex() { var indexes = Database.Query>(); if (indexes.Count > 0) { // we can't deal with multiple indexes, so drop them all foreach (var idx in indexes) { Database.Delete(idx); } Database.Commit(); } f_Index = BuildIndex(); FlushIndex(); } void ResetIndex() { f_Index = null; } void FlushIndex() { if (f_Index == null || f_Index.Count == 0) { // don't waste our time return; } DateTime start = DateTime.UtcNow, stop; Database.Store(f_Index); Database.Commit(); stop = DateTime.UtcNow; #if LOG4NET && MSGBUF_DEBUG Logger.Debug( String.Format( "FlushIndex(): flushing index with {0} items took: {1} ms", f_Index.Count, (stop - start).TotalMilliseconds ) ); #endif } void Flush() { var counter = FlushCounter; if (counter == 0) { // nothing to flush return; } DateTime start = DateTime.UtcNow, stop; FlushCounter = 0; Database.Commit(); stop = DateTime.UtcNow; #if LOG4NET && MSGBUF_DEBUG Logger.Debug( String.Format( "Flush(): flushing {0} items took: {1} ms", counter, (stop - start).TotalMilliseconds ) ); #endif } static string _(string msg) { return LibraryCatalog.GetString(msg, LibraryTextDomain); } } [Flags] public enum Db4oMessageBufferOptimizationTypes : ushort { None = ushort.MinValue, Defrag = 0x1, Index = 0x2, All = ushort.MaxValue } } smuxi-0.11/src/Engine/MessageBuffers/MessageBufferPersistencyType.cs0000644000175000017500000000175411700531605026440 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2011 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public enum MessageBufferPersistencyType { Volatile, Persistent } } smuxi-0.11/src/Engine/Session.cs0000644000175000017500000022330512307031750017347 0ustar00meebeymeebey00000000000000/* * Smuxi - Smart MUltipleXed Irc * * Copyright (c) 2005-2014 Mirco Bauer * * Full GPL License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.IO; using System.Net; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Collections; using System.Collections.Generic; using System.Runtime.Remoting; using System.Threading; using Smuxi.Common; namespace Smuxi.Engine { public class Session : PermanentRemoteObject, IFrontendUI { #if LOG4NET private static readonly log4net.ILog f_Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endif private static readonly string _LibraryTextDomain = "smuxi-engine"; public static CertificateValidator CertificateValidator { get; private set; } private int _Version = 0; private IDictionary _FrontendManagers; private IList _ProtocolManagers; private List _Chats; private SessionChatModel _SessionChat; private Config _Config; private string _Username; private ProtocolManagerFactory _ProtocolManagerFactory; private UserConfig _UserConfig; private FilterListController _FilterListController; private ICollection _Filters; private bool _OnStartupCommandsProcessed; Timer NewsFeedTimer { get; set; } List SeenNewsFeedIds { get; set; } DateTime NewsFeedLastModified { get; set; } TimeSpan NewsFeedUpdateInterval { get; set; } TimeSpan NewsFeedRetryInterval { get; set; } internal MessageBuilderSettings MessageBuilderSettings { get; private set; } public event EventHandler GroupChatPersonAdded; public event EventHandler GroupChatPersonRemoved; public event EventHandler GroupChatPersonUpdated; public IList ProtocolManagers { get { return _ProtocolManagers; } } public IProtocolManager FirstProtocolManager { get { lock (_ProtocolManagers) { if (_ProtocolManagers.Count == 0) { return null; } else { return _ProtocolManagers[0]; } } } } public IList Chats { get { return _Chats; } } public SessionChatModel SessionChat { get { return _SessionChat; } } public int Version { get { return _Version; } } public Config Config { get { return _Config; } } public UserConfig UserConfig { get { return _UserConfig; } } public string Username { get { return _Username; } } public bool IsLocal { get { return _Username == "local"; } } static Session() { CertificateValidator = new CertificateValidator(); } public Session(Config config, ProtocolManagerFactory protocolManagerFactory, string username) { Trace.Call(config, protocolManagerFactory, username); if (config == null) { throw new ArgumentNullException("config"); } if (protocolManagerFactory == null) { throw new ArgumentNullException("protocolManagerFactory"); } if (username == null) { throw new ArgumentNullException("username"); } _Config = config; _ProtocolManagerFactory = protocolManagerFactory; _Username = username; _FrontendManagers = new Dictionary(); _ProtocolManagers = new List(); _UserConfig = new UserConfig(config, username); _UserConfig.Changed += OnUserConfigChanged; _FilterListController = new FilterListController(_UserConfig); _Filters = _FilterListController.GetFilterList().Values; MessageBuilderSettings = new MessageBuilderSettings(); MessageBuilderSettings.ApplyConfig(_UserConfig); _Chats = new List(); InitSessionChat(); SeenNewsFeedIds = new List(); NewsFeedUpdateInterval = TimeSpan.FromHours(12); NewsFeedRetryInterval = TimeSpan.FromMinutes(5); NewsFeedTimer = new Timer(delegate { UpdateNewsFeed(); }, null, TimeSpan.Zero, NewsFeedUpdateInterval); } public IProtocolManager NextProtocolManager(IProtocolManager currentProtocolManager) { lock (_ProtocolManagers) { if (_ProtocolManagers.Count == 0) { return null; } int pos = 0; if (currentProtocolManager != null) { pos = _ProtocolManagers.IndexOf(currentProtocolManager); } if (pos < _ProtocolManagers.Count - 1) { pos++; } else { pos = 0; } return _ProtocolManagers[pos]; } } protected MessageBuilder CreateMessageBuilder() { var builder = new MessageBuilder(); // copy settings so the caller can override settings without // changing the settings of the complete session builder.Settings = new MessageBuilderSettings(MessageBuilderSettings); return builder; } public void RegisterFrontendUI(IFrontendUI ui) { Trace.Call(ui); if (ui == null) { throw new ArgumentNullException("ui"); } string uri = GetUri(ui); #if LOG4NET f_Logger.Debug("Registering UI with URI: " + uri); #endif // add the FrontendManager to the hashtable with an unique .NET remoting identifier FrontendManager fm = new FrontendManager(this, ui); lock (_FrontendManagers) { _FrontendManagers[uri] = fm; } // if this is the first frontend, we process OnStartupCommands if (!_OnStartupCommandsProcessed) { _OnStartupCommandsProcessed = true; foreach (string command in (string[])_UserConfig["OnStartupCommands"]) { if (command.Length == 0) { continue; } CommandModel cd = new CommandModel(fm, _SessionChat, (string)_UserConfig["Interface/Entry/CommandCharacter"], command); bool handled; handled = Command(cd); if (!handled) { if (fm.CurrentProtocolManager != null) { fm.CurrentProtocolManager.Command(cd); } } } // process server specific connects/commands ServerListController serverCon = new ServerListController(_UserConfig); IList servers = serverCon.GetServerList(); foreach (ServerModel server in servers) { if (!server.OnStartupConnect) { continue; } var msg = String.Format( _("Automatically connecting to {0}..."), String.Format("{0}/{1} ({2}:{3})", server.Protocol, server.Network, server.Hostname, server.Port) ); #if LOG4NET f_Logger.Info(msg); #endif fm.SetStatus(msg); var srv = server; // run connects in background threads as they block ThreadPool.QueueUserWorkItem(delegate { bool isError = false; try { IProtocolManager protocolManager = Connect(srv, fm); // if the connect command was correct, we should be // able to get the chat model if (protocolManager.Chat == null) { isError = true; } } catch (Exception ex) { #if LOG4NET f_Logger.Error("RegisterFrontendUI(): Exception during "+ "automatic connect: ", ex); #endif isError = true; } if (isError) { var builder = CreateMessageBuilder(); builder.AppendErrorText( _("Automatic connect to {0} failed!"), srv.Hostname + ":" + srv.Port ); fm.AddMessageToChat(_SessionChat, builder.ToMessage()); } }); } } } internal void DeregisterFrontendManager(FrontendManager fm) { Trace.Call(fm); if (fm == null) { throw new ArgumentNullException("fm"); } string key = null; lock (_FrontendManagers) { foreach (KeyValuePair kv in _FrontendManagers) { if (kv.Value == fm) { key = kv.Key; break; } } } if (key == null) { #if LOG4NET f_Logger.Debug("DeregisterFrontendManager(fm): could not find " + "frontend manager (probably already cleanly " + " deregistered), ignoring..."); #endif return; } lock (_FrontendManagers) { _FrontendManagers.Remove(key); } #if LOG4NET f_Logger.Debug("DeregisterFrontendUI(fm): disposing FrontendManager"); #endif fm.Dispose(); CheckPresenceStatus(); } public void DeregisterFrontendUI(IFrontendUI ui) { Trace.Call(ui); if (ui == null) { throw new ArgumentNullException("ui"); } string uri = GetUri(ui); #if LOG4NET f_Logger.Debug("DeregisterFrontendUI(ui): deregistering UI with URI: "+uri); #endif FrontendManager manager; lock (_FrontendManagers) { _FrontendManagers.TryGetValue(uri, out manager); _FrontendManagers.Remove(uri); } if (manager == null) { #if LOG4NET f_Logger.Error("DeregisterFrontendUI(ui): can't dispose as FrontendManager not found with URI: " + uri); #endif } else { #if LOG4NET f_Logger.Debug("DeregisterFrontendUI(ui): disposing FrontendManager with URI: " + uri); #endif manager.Dispose(); } CheckPresenceStatus(); } public FrontendManager GetFrontendManager(IFrontendUI ui) { Trace.Call(ui); if (ui == null) { throw new ArgumentNullException("ui"); } lock (_FrontendManagers) { return _FrontendManagers[GetUri(ui)]; } } private string GetUri(IFrontendUI ui) { if (ui == null) { throw new ArgumentNullException("ui"); } if (IsLocal) { return "local"; } return RemotingServices.GetObjectUri((MarshalByRefObject)ui); } public static bool IsLocalFrontend(IFrontendUI ui) { if (ui == null) { throw new ArgumentNullException("ui"); } return RemotingServices.GetObjectUri((MarshalByRefObject)ui) == null; } public ChatModel GetChat(string id, ChatType chatType, IProtocolManager networkManager) { if (id == null) { throw new ArgumentNullException("id"); } lock (_Chats) { foreach (ChatModel chat in _Chats) { if ((chat.ID.ToLower() == id.ToLower()) && (chat.ChatType == chatType) && (chat.ProtocolManager == networkManager)) { return chat; } } } return null; } public bool Command(CommandModel cd) { Trace.Call(cd); if (cd == null) { throw new ArgumentNullException("cd"); } bool handled = false; if (cd.IsCommand) { switch (cd.Command) { case "help": CommandHelp(cd); if (cd.Chat.ChatType == ChatType.Session) { handled = true; } break; case "server": case "connect": CommandConnect(cd); handled = true; break; case "disconnect": CommandDisconnect(cd); handled = true; break; case "reconnect": CommandReconnect(cd); handled = true; break; case "network": CommandNetwork(cd); handled = true; break; case "config": CommandConfig(cd); handled = true; break; case "shutdown": CommandShutdown(cd); handled = true; break; case "echo": CommandEcho(cd); handled = true; break; } } else { // normal text if (cd.Chat.ChatType == ChatType.Session && cd.FrontendManager != null && cd.FrontendManager.CurrentProtocolManager == null) { _NotConnected(cd); handled = true; } } return handled; } public void CommandHelp(CommandModel cd) { Trace.Call(cd); if (cd == null) { throw new ArgumentNullException("cd"); } var builder = CreateMessageBuilder(); // TRANSLATOR: this line is used as a label / category for a // list of commands below builder.AppendHeader(_("Engine Commands")); AddMessageToFrontend(cd, builder.ToMessage()); string[] help = { "connect/server protocol [protocol-parameters]", "connect/server network", "disconnect [server]", "network list", "network close [network]", "network switch [network]", "config (save|load|list)", "config get key", "config set key=value", "config remove key", "shutdown" }; foreach (string line in help) { builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText(line); AddMessageToFrontend(cd, builder.ToMessage()); } } public void CommandConnect(CommandModel cd) { Trace.Call(cd); if (cd == null) { throw new ArgumentNullException("cd"); } FrontendManager fm = cd.FrontendManager; MessageBuilder builder = null; string protocol = null; ServerModel server = null; // first lookup by network name if (cd.DataArray.Length == 2) { var network = cd.Parameter; var serverSettings = new ServerListController(UserConfig); server = serverSettings.GetServerByNetwork(network); if (server == null) { // HACK: simply assume the user meant irc if not specified // as Smuxi is still primarly an IRC client protocol = "irc"; string cmd = String.Format("{0}connect irc {1}", cd.CommandCharacter, cd.Parameter); cd = new CommandModel(fm, cd.Chat, cd.CommandCharacter, cmd); } } else if (cd.DataArray.Length >= 3) { protocol = cd.DataArray[1]; } else { _NotEnoughParameters(cd); return; } IProtocolManager protocolManager = null; // TODO: detect matching protocol managers, how to parse host and port // though in a protocol neutral ? /* foreach (IProtocolManager nm in _ProtocolManagers) { if (nm.Host == server && nm.Port == port) { // reuse network manager if (nm.IsConnected) { fm.AddTextToCurrentChat("-!- " + String.Format( _("Already connected to: {0}:{1}"), server, port)); return; } networkManager = nm; break; } } */ if (protocolManager == null && server == null) { try { protocolManager = CreateProtocolManager(protocol); lock (_ProtocolManagers) { _ProtocolManagers.Add(protocolManager); } } catch (ArgumentException ex) { if (ex.ParamName != "protocol") { throw; } // this is an unknown protocol error builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendErrorText(ex.Message); AddMessageToFrontend(cd, builder.ToMessage()); return; } } // HACK: this is hacky as the Command parser of the protocol manager // will pass this command to it's connect method only if cd was // constructed correctly beginning with /connect // So make sure it's like it needs to be! if (cd.Command != "connect") { string cmd = String.Format("{0}connect {1}", cd.CommandCharacter, String.Join(" ", cd.DataArray, 1, cd.DataArray.Length - 1)); cd = new CommandModel(fm, cd.Chat, cd.CommandCharacter, cmd); } // run in background so it can't block the command queue ThreadPool.QueueUserWorkItem(delegate { try { if (protocolManager == null && server != null) { protocolManager = Connect(server, fm); } else { protocolManager.Command(cd); } // set this as current protocol manager // but only if there was none set (we might be on a chat for example) // or if this is the neutral "smuxi" tab if (fm.CurrentProtocolManager == null || (fm.CurrentChat != null && fm.CurrentChat.ChatType == ChatType.Session)) { fm.CurrentProtocolManager = protocolManager; fm.UpdateNetworkStatus(); } } catch (Exception ex) { #if LOG4NET f_Logger.Error("CommandConnect(): ", ex); #endif builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendErrorText(_("Connect failed!")); fm.AddMessageToChat(cd.Chat, builder.ToMessage()); } }); } public void CommandDisconnect(CommandModel cd) { Trace.Call(cd); if (cd == null) { throw new ArgumentNullException("cd"); } FrontendManager fm = cd.FrontendManager; IProtocolManager victim = null; if (cd.DataArray.Length >= 2) { string server = cd.DataArray[1]; victim = GetProtocolManagerByHost(server); if (victim == null) { var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendErrorText( _("Disconnect failed - could not find server: {0}"), server ); AddMessageToFrontend(cd, builder.ToMessage()); return; } } else { victim = cd.Chat.ProtocolManager; } if (victim == null) { return; } victim.Disconnect(fm); victim.Dispose(); lock (_ProtocolManagers) { _ProtocolManagers.Remove(victim); } } public void CommandReconnect(CommandModel cd) { Trace.Call(cd); if (cd == null) { throw new ArgumentNullException("cd"); } var pm = cd.Chat.ProtocolManager; if (pm == null) { return; } ThreadPool.QueueUserWorkItem(delegate { try { pm.Reconnect(cd.FrontendManager); } catch (Exception ex) { #if LOG4NET f_Logger.Error("CommandReconnect(): ", ex); #endif var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendErrorText(_("Reconnect failed!")); AddMessageToFrontend(cd, builder.ToMessage()); } }); } public void CommandConfig(CommandModel cd) { Trace.Call(cd); if (cd == null) { throw new ArgumentNullException("cd"); } if (cd.DataArray.Length < 2) { _NotEnoughParameters(cd); return; } var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); var action = cd.DataArray[1].ToLower(); switch (action) { case "load": _Config.Load(); builder.AppendText(_("Configuration reloaded")); break; case "save": _Config.Save(); builder.AppendText(_("Configuration saved")); break; case "get": case "list": string key = null; if (action == "get" && cd.DataArray.Length >= 3) { key = cd.DataArray[2]; } foreach (var entry in _UserConfig.OrderBy(kvp => kvp.Key)) { if (key != null && entry.Key.IndexOf(key, StringComparison.InvariantCultureIgnoreCase) == -1) { continue; } builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText("{0} = {1}", entry.Key, entry.Value); AddMessageToFrontend(cd, builder.ToMessage()); } return; case "set": if (cd.DataArray.Length < 3) { _NotEnoughParameters(cd); return; } var setParam = String.Join(" ", cd.DataArray.Skip(2).ToArray()); if (!setParam.Contains("=")) { builder.AppendErrorText( _("Invalid key/value format.") ); AddMessageToFrontend(cd, builder.ToMessage()); return; } var setKey = setParam.Split('=')[0].Trim(); var setValue = String.Join( "=", setParam.Split('=').Skip(1).ToArray() ).Trim(); object oldValue = _UserConfig[setKey]; if (oldValue == null && setKey.StartsWith("MessagePatterns/")) { var id = setKey.Split('/')[1]; var parsedId = Int32.Parse(id); var msgPatternSettings = new MessagePatternListController(_UserConfig); var pattern = msgPatternSettings.Get(parsedId); if (pattern == null) { // pattern does not exist, create it with default values pattern = new MessagePatternModel(parsedId); msgPatternSettings.Add(pattern, parsedId); oldValue = _UserConfig[setKey]; } } if (oldValue == null) { builder.AppendErrorText( _("Invalid config key: '{0}'"), setKey ); AddMessageToFrontend(cd, builder.ToMessage()); return; } try { object newValue = Convert.ChangeType(setValue, oldValue.GetType()); _UserConfig[setKey] = newValue; builder.AppendText("{0} = {1}", setKey, newValue.ToString()); if (setKey.StartsWith("MessagePatterns/")) { MessageBuilderSettings.ApplyConfig(UserConfig); } } catch (InvalidCastException) { builder.AppendErrorText( _("Could not convert config value: '{0}' to type: {1}"), setValue, oldValue.GetType().Name ); } catch (FormatException) { builder.AppendErrorText( _("Could not convert config value: '{0}' to type: {1}"), setValue, oldValue.GetType().Name ); } break; case "remove": { if (cd.DataArray.Length < 3) { _NotEnoughParameters(cd); return; } var removeParam = cd.DataArray[2]; if (!removeParam.StartsWith("MessagePatterns/")) { builder.AppendErrorText( _("Invalid config remove key: '{0}'. Valid remove " + "keys: MessagePatterns/{{ID}}."), removeParam ); AddMessageToFrontend(cd, builder.ToMessage()); return; } var id = removeParam.Split('/')[1]; var parsedId = Int32.Parse(id); var patternController = new MessagePatternListController(_UserConfig); var pattern = patternController.Get(parsedId); if (pattern == null) { builder.AppendErrorText( _("Message pattern with ID: '{0}' does not exist."), id ); } else { patternController.Remove(parsedId); MessageBuilderSettings.ApplyConfig(UserConfig); builder.AppendText( _("Message pattern with ID: '{0}' removed."), id ); } break; } default: builder.AppendErrorText( _("Invalid parameter for config; use load, save, get or set.") ); break; } AddMessageToFrontend(cd, builder.ToMessage()); } public void CommandShutdown(CommandModel cmd) { Trace.Call(cmd); #if LOG4NET f_Logger.Info("Shutting down..."); #endif var frontendMgr = cmd != null ? cmd.FrontendManager : null; Shutdown(true, frontendMgr); if (IsLocal) { // allow the frontend to cleanly terminate return; } #if LOG4NET f_Logger.Debug("Terminating process..."); #endif Environment.Exit(0); } public void CommandEcho(CommandModel cmd) { Trace.Call(cmd); if (cmd == null) { throw new ArgumentNullException("cmd"); } var msg = new MessageBuilder(). AppendEventPrefix(). AppendText(cmd.Parameter). ToMessage(); if (cmd.FrontendManager == null) { AddMessageToChat(cmd.Chat, msg, true); } else { cmd.FrontendManager.AddMessageToChat(cmd.Chat, msg); } } public void CommandNetwork(CommandModel cd) { Trace.Call(cd); if (cd == null) { throw new ArgumentNullException("cd"); } if (cd.DataArray.Length == 1) { // no parameter given, fallback to list _CommandNetworkList(cd); return; } if (cd.DataArray.Length >= 2) { switch (cd.DataArray[1].ToLower()) { case "list": _CommandNetworkList(cd); break; case "switch": _CommandNetworkSwitch(cd); break; case "close": _CommandNetworkClose(cd); break; default: var builder = CreateMessageBuilder(); builder.AppendEventPrefix(); builder.AppendText( _("Invalid parameter for network; use list, " + "switch, or close") ); AddMessageToFrontend(cd, builder.ToMessage()); break; } } else { _NotEnoughParameters(cd); } } private void _CommandNetworkList(CommandModel cmd) { var servers = new ServerListController(UserConfig); var availableNetworks = servers.GetNetworks(); var connectedNetworks = new List(); lock (_ProtocolManagers) { foreach (IProtocolManager pm in _ProtocolManagers) { if (pm.IsConnected) { connectedNetworks.Add(pm); if (!String.IsNullOrEmpty(pm.NetworkID)) { availableNetworks.Remove(pm.NetworkID); } } } } var msg = CreateMessageBuilder(); // TRANSLATOR: this line is used as a label / category for a // list of networks below msg.AppendHeader(_("Connected Networks")); AddMessageToFrontend(cmd, msg.ToMessage()); foreach (var network in connectedNetworks) { msg = CreateMessageBuilder(); msg.AppendEventPrefix(); msg.AppendText("{0}: {1} ", _("Network"), network.NetworkID); msg.AppendText("{0}: {1} ", _("Protocol"), network.Protocol); msg.AppendText("{0}: {1} ", _("Host"), network.Host); msg.AppendText("{0}: {1}", _("Port"), network.Port); AddMessageToFrontend(cmd, msg.ToMessage()); } if (connectedNetworks.Count == 0) { msg = CreateMessageBuilder(); // TRANSLATOR: no connected networks msg.AppendEventPrefix().AppendText("<{0}>", _("None")); AddMessageToFrontend(cmd, msg.ToMessage()); } msg = CreateMessageBuilder(); // TRANSLATOR: this line is used as a label / category for a // list of networks below msg.AppendHeader(_("Available Networks")); AddMessageToFrontend(cmd, msg.ToMessage()); foreach (var network in availableNetworks) { if (network == null || network.Trim().Length == 0) { continue; } msg = CreateMessageBuilder(); msg.AppendEventPrefix(); msg.AppendText("{0}: {1}", _("Network"), network); AddMessageToFrontend(cmd, msg.ToMessage()); } if (availableNetworks.Count == 0) { msg = CreateMessageBuilder(); // TRANSLATOR: no available networks msg.AppendEventPrefix().AppendText("<{0}>", _("None")); AddMessageToFrontend(cmd, msg.ToMessage()); } } private void _CommandNetworkClose(CommandModel cd) { IProtocolManager pm = null; if (cd.DataArray.Length >= 3) { // named protocol manager string network = cd.DataArray[2]; pm = GetProtocolManagerByNetwork(network); if (pm == null) { var builder = CreateMessageBuilder(); builder.AppendText(_("Network close failed - could not " + "find network: {0}"), network); AddMessageToFrontend(cd, builder.ToMessage()); return; } } else if (cd.DataArray.Length >= 2) { // network manager of chat pm = cd.Chat.ProtocolManager; } if (pm == null) { return; } // disconnect in background as could be blocking ThreadPool.QueueUserWorkItem(delegate { try { pm.Disconnect(cd.FrontendManager); pm.Dispose(); // Dispose() takes care of removing the chat from session (frontends) lock (_ProtocolManagers) { _ProtocolManagers.Remove(pm); } } catch (Exception ex) { #if LOG4NET f_Logger.Error("_CommandNetworkClose(): Exception", ex); #endif } }); } private void _CommandNetworkSwitch(CommandModel cd) { FrontendManager fm = cd.FrontendManager; if (fm == null) { _NotEnoughParameters(cd); return; } if (cd.DataArray.Length >= 3) { // named network manager string network = cd.DataArray[2]; var pm = GetProtocolManagerByNetwork(network); if (pm == null) { var builder = CreateMessageBuilder(); builder.AppendText(_("Network switch failed - could not " + "find network: {0}"), network); fm.AddMessageToChat(cd.Chat, builder.ToMessage()); return; } fm.CurrentProtocolManager = pm; fm.UpdateNetworkStatus(); } else if (cd.DataArray.Length >= 2) { // next network manager fm.NextProtocolManager(); } else { _NotEnoughParameters(cd); } } private void _NotConnected(CommandModel cd) { var builder = CreateMessageBuilder(); builder.AppendText(_("Not connected to any network")); AddMessageToFrontend(cd, builder.ToMessage()); } private void _NotEnoughParameters(CommandModel cd) { var builder = CreateMessageBuilder(); builder.AppendText(_("Not enough parameters for {0} command"), cd.Command); AddMessageToFrontend(cd, builder.ToMessage()); } public void UpdateNetworkStatus() { Trace.Call(); lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.UpdateNetworkStatus(); } } } public T CreateChat(string id, string name, IProtocolManager protocolManager) where T : ChatModel { Trace.Call(id, name, protocolManager); T chat; Type chatType = typeof(T); if (chatType == typeof(SessionChatModel)) { chat = (T) Activator.CreateInstance(chatType, id, name); } else if (chatType == typeof(PersonChatModel)) { throw new NotSupportedException( "PersonModel is not supported, use " + "Session.CreatePersionChat() instead" ); } else { chat = (T) Activator.CreateInstance(chatType, id, name, protocolManager); } chat.ApplyConfig(UserConfig); return chat; } public PersonChatModel CreatePersonChat(PersonModel person, IProtocolManager protocolManager) { Trace.Call(person, protocolManager); if (person == null) { throw new ArgumentNullException("person"); } return CreatePersonChat(person, person.ID, person.IdentityName, protocolManager); } public PersonChatModel CreatePersonChat(PersonModel person, string id, string name, IProtocolManager protocolManager) { Trace.Call(person, id, name, protocolManager); var chat = new PersonChatModel(person, id, name, protocolManager); chat.ApplyConfig(UserConfig); return chat; } public void AddChat(ChatModel chat) { Trace.Call(chat); if (chat == null) { throw new ArgumentNullException("chat"); } chat.Position = GetSortedChatPosition(chat); lock (_Chats) { _Chats.Add(chat); if (chat.Position == -1) { chat.Position = _Chats.IndexOf(chat); } else { MoveChat(chat, chat.Position); } } lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.AddChat(chat); } } } public void RemoveChat(ChatModel chat) { Trace.Call(chat); if (chat == null) { throw new ArgumentNullException("chat"); } lock (_Chats) { if (!_Chats.Remove(chat)) { #if LOG4NET f_Logger.Warn("RemoveChat(): _Chats.Remove(" + chat + ") failed, ignoring..."); #endif chat.Close(); return; } chat.Close(); // refresh chat positions foreach (var schat in _Chats) { schat.Position = _Chats.IndexOf(schat); } } lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.RemoveChat(chat); } } } public void EnableChat(ChatModel chat) { Trace.Call(chat); if (chat == null) { throw new ArgumentNullException("chat"); } chat.IsEnabled = true; lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.EnableChat(chat); } } } public void DisableChat(ChatModel chat) { Trace.Call(chat); if (chat == null) { throw new ArgumentNullException("chat"); } chat.IsEnabled = false; lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.DisableChat(chat); } } } public void SyncChat(ChatModel chat) { Trace.Call(chat); if (chat == null) { throw new ArgumentNullException("chat"); } lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.SyncChat(chat); } } } public void MoveChat(ChatModel chat, int newPosition) { Trace.Call(chat, newPosition); if (chat == null) { throw new ArgumentNullException("chat"); } lock (_Chats) { _Chats.Remove(chat); _Chats.Insert(newPosition, chat); foreach (var schat in _Chats) { schat.Position = _Chats.IndexOf(schat); } } } [Obsolete("This method is deprecated, use AddMessageToChat(ChatModel, MessageModel) instead!")] public void AddTextToChat(ChatModel chat, string text) { AddTextToChat(chat, text, false); } [Obsolete("This method is deprecated, use AddMessageToChat(ChatModel, MessageModel, bool) instead!")] public void AddTextToChat(ChatModel chat, string text, bool ignoreFilters) { if (chat == null) { throw new ArgumentNullException("chat"); } if (text == null) { throw new ArgumentNullException("text"); } AddMessageToChat(chat, new MessageModel(text), ignoreFilters); } public void AddMessageToChat(ChatModel chat, MessageModel msg) { AddMessageToChat(chat, msg, false); } public void AddMessageToChat(ChatModel chat, MessageModel msg, bool ignoreFilters) { if (chat == null) { throw new ArgumentNullException("chat"); } if (msg == null) { throw new ArgumentNullException("msg"); } bool isFiltered = !ignoreFilters && IsFilteredMessage(chat, msg); LogMessage(chat, msg, isFiltered); if (isFiltered) { return; } lock (chat.MessageBuffer) { try { chat.MessageBuffer.Add(msg); } catch (Exception ex) { #if LOG4NET Trace.Call(chat, msg, ignoreFilters); f_Logger.Error( "AddMessageToChat(): " + "chat.MessageBuffer.Add() threw exception!", ex ); #endif if (chat.MessageBuffer is Db4oMessageBuffer) { #if LOG4NET f_Logger.Error( "AddMessageToChat(): " + "Falling back to volatile message buffer..." ); #endif chat.ResetMessageBuffer(); chat.InitMessageBuffer(MessageBufferPersistencyType.Volatile); var builder = new MessageBuilder(); builder.AppendEventPrefix(); builder.AppendErrorText( _("Failed to write to chat history. " + "Your chat history will not be preserved. " + "Reason: {0}"), ex.Message ); chat.MessageBuffer.Add(builder.ToMessage()); chat.MessageBuffer.Add(msg); } } } lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.AddMessageToChat(chat, msg); } } } public void AddPersonToGroupChat(GroupChatModel groupChat, PersonModel person) { if (groupChat == null) { throw new ArgumentNullException("groupChat"); } if (person == null) { throw new ArgumentNullException("person"); } #if LOG4NET f_Logger.Debug("AddPersonToGroupChat() groupChat.Name: "+groupChat.Name+" person.IdentityName: "+person.IdentityName); #endif groupChat.UnsafePersons.Add(person.ID, person); lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.AddPersonToGroupChat(groupChat, person); } } OnGroupChatPersonAdded( new GroupChatPersonAddedEventArgs(groupChat, person) ); } public void UpdatePersonInGroupChat(GroupChatModel groupChat, PersonModel oldPerson, PersonModel newPerson) { if (groupChat == null) { throw new ArgumentNullException("groupChat"); } if (oldPerson == null) { throw new ArgumentNullException("oldPerson"); } if (newPerson == null) { throw new ArgumentNullException("newPerson"); } #if LOG4NET f_Logger.Debug("UpdatePersonInGroupChat()" + " groupChat.Name: " + groupChat.Name + " oldPerson.IdentityName: " + oldPerson.IdentityName + " newPerson.IdentityName: " + newPerson.IdentityName); #endif // FIXME: do we have to lock groupChat.UnsafePersons here? // probably not, as long as the ProtocolManager who owns this chat // is only running one thread groupChat.UnsafePersons.Remove(oldPerson.ID); groupChat.UnsafePersons.Add(newPerson.ID, newPerson); lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.UpdatePersonInGroupChat(groupChat, oldPerson, newPerson); } } OnGroupChatPersonUpdated( new GroupChatPersonUpdatedEventArgs(groupChat, oldPerson, newPerson) ); } public void UpdateTopicInGroupChat(GroupChatModel groupChat, MessageModel topic) { if (groupChat == null) { throw new ArgumentNullException("groupChat"); } if (topic == null) { throw new ArgumentNullException("topic"); } #if LOG4NET f_Logger.Debug("UpdateTopicInGroupChat() groupChat.Name: " + groupChat.Name + " topic: " + topic.ToString()); #endif groupChat.Topic = topic; lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.UpdateTopicInGroupChat(groupChat, topic); } } } public void RemovePersonFromGroupChat(GroupChatModel groupChat, PersonModel person) { if (groupChat == null) { throw new ArgumentNullException("groupChat"); } if (person == null) { throw new ArgumentNullException("person"); } #if LOG4NET f_Logger.Debug("RemovePersonFromGroupChat() groupChat.Name: " + groupChat.Name + " person.ID: "+person.ID); #endif groupChat.UnsafePersons.Remove(person.ID); lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.RemovePersonFromGroupChat(groupChat, person); } } OnGroupChatPersonRemoved( new GroupChatPersonRemovedEventArgs(groupChat, person) ); } public void SetNetworkStatus(string status) { if (status == null) { throw new ArgumentNullException("status"); } #if LOG4NET f_Logger.Debug("SetNetworkStatus() status: "+status); #endif lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.SetNetworkStatus(status); } } } public void SetStatus(string status) { if (status == null) { throw new ArgumentNullException("status"); } #if LOG4NET f_Logger.Debug("SetStatus() status: "+status); #endif lock (_FrontendManagers) { foreach (FrontendManager fm in _FrontendManagers.Values) { fm.SetStatus(status); } } } public IList GetSupportedProtocols() { return _ProtocolManagerFactory.GetProtocols(); } public IProtocolManager Connect(ServerModel server, FrontendManager frontendManager) { Trace.Call(server, frontendManager); if (server == null) { throw new ArgumentNullException("server"); } if (String.IsNullOrEmpty(server.Protocol)) { throw new ArgumentNullException("server.Protocol"); } if (frontendManager == null) { throw new ArgumentNullException("frontendManager"); } IProtocolManager protocolManager = CreateProtocolManager( server.Protocol ); lock (_ProtocolManagers) { _ProtocolManagers.Add(protocolManager); } string password = null; // only pass non-empty passwords to Connect() if (!String.IsNullOrEmpty(server.Password)) { password = server.Password; } if (server.OnConnectCommands != null && server.OnConnectCommands.Count > 0) { protocolManager.Connected += delegate { ThreadPool.QueueUserWorkItem(delegate { try { foreach (string command in server.OnConnectCommands) { if (command.Length == 0) { continue; } CommandModel cd = new CommandModel( frontendManager, protocolManager.Chat, (string) _UserConfig["Interface/Entry/CommandCharacter"], command ); protocolManager.Command(cd); } } catch (Exception ex) { #if LOG4NET f_Logger.Error("Connected event: Exception", ex); #endif } }); }; } protocolManager.Connect(frontendManager, server); if (protocolManager.Chat == null) { // just in case the ProtocolManager is not setting the // protocol chat throw new ApplicationException(_("Connect failed.")); } return protocolManager; } private IProtocolManager CreateProtocolManager(string protocol) { ProtocolManagerInfoModel info = _ProtocolManagerFactory.GetProtocolManagerInfoByAlias(protocol); if (info == null) { if (_ProtocolManagerFactory.ProtocolManagerInfos.Count != 1) { throw new ArgumentException( String.Format( _("No protocol manager found for the protocol: {0}"), protocol ), "protocol" ); } // ok, we forgive the user not passing a valid protocol by // falling back to the only available protocol info = _ProtocolManagerFactory.ProtocolManagerInfos[0]; } return _ProtocolManagerFactory.CreateProtocolManager(info, this); } public void LogMessage(ChatModel chat, MessageModel msg, bool isFiltered) { if (chat == null) { throw new ArgumentNullException("chat"); } if (msg == null) { throw new ArgumentNullException("msg"); } if (!(bool) UserConfig["Logging/Enabled"]) { return; } if (isFiltered && !(bool) UserConfig["Logging/LogFilteredMessages"]) { return; } if (chat.ChatType == ChatType.Session || chat.ChatType == ChatType.Protocol) { return; } try { // HACK: twitter retrieves older messages and we don't want to // re-log those when the twitter connection is re-opened var protocol = chat.ProtocolManager.Protocol.ToLower(); if (protocol == "twitter") { return; } // don't log chatstates switch (msg.MessageType) { case MessageType.ChatStateComposing: case MessageType.ChatStatePaused: case MessageType.ChatStateReset: return; } using (var stream = File.AppendText(chat.LogFile)) { stream.WriteLine( String.Format( "[{0:yyyy-MM-dd HH:mm:ss}] {1}", msg.TimeStamp.ToLocalTime(), msg.ToString() ) ); } } catch (Exception ex) { #if LOG4NET f_Logger.Error("LogMessage(): logging error", ex); #endif } } public bool IsFilteredMessage(ChatModel chat, MessageModel msg) { if (chat == null) { throw new ArgumentNullException("chat"); } if (msg == null) { throw new ArgumentNullException("msg"); } return IsFilteredMessage(chat, msg.ToString(), msg.MessageType); } public bool IsFilteredMessage(ChatModel chat, string msg, MessageType msgType) { if (chat == null) { throw new ArgumentNullException("chat"); } if (msg == null) { throw new ArgumentNullException("msg"); } lock (_Filters) { foreach (var filter in _Filters) { if (!String.IsNullOrEmpty(filter.Protocol) && chat.ProtocolManager != null && filter.Protocol != chat.ProtocolManager.Protocol) { continue; } if (filter.ChatType.HasValue && filter.ChatType != chat.ChatType) { continue; } if (!String.IsNullOrEmpty(filter.ChatID) && !Pattern.IsMatch(chat.ID, filter.ChatID)) { continue; } if (filter.MessageType.HasValue && filter.MessageType != msgType) { continue; } if (!String.IsNullOrEmpty(filter.MessagePattern)) { var pattern = filter.MessagePattern; if (!Pattern.ContainsPatternCharacters(pattern)) { // use globbing by default pattern = String.Format("*{0}*", pattern); } if (!Pattern.IsMatch(msg, pattern)) { continue; } } return true; } } return false; } public void AddMessageToFrontend(CommandModel cmd, MessageModel msg) { if (cmd == null) { throw new ArgumentNullException("cmd"); } AddMessageToFrontend(cmd.FrontendManager, cmd.Chat, msg); } public void AddMessageToFrontend(FrontendManager fm, ChatModel chat, MessageModel msg) { if (chat == null) { throw new ArgumentNullException("chat"); } if (msg == null) { throw new ArgumentNullException("msg"); } if (fm == null) { // fallback to session AddMessageToChat(chat, msg); } else { fm.AddMessageToChat(chat, msg); } } void OnUserConfigChanged(object sender, ConfigChangedEventArgs e) { if (e.Key.StartsWith("Filters/")) { #if LOG4NET f_Logger.Debug("OnUserConfigChanged(): refreshing filters"); #endif // referesh filters // TODO: use a timeout here to only refresh once in 1 second _Filters = _FilterListController.GetFilterList().Values; } if (e.Key == "Interface/Notebook/EngineBufferLines") { lock (_Chats) { foreach (var chat in _Chats) { chat.ApplyConfig(UserConfig); } } } } public void CheckPresenceStatus() { Trace.Call(); var newStatus = PresenceStatus.Unknown; var newMessage = String.Empty; lock (_FrontendManagers) { if (_FrontendManagers.Count == 0) { newStatus = PresenceStatus.Away; newMessage = "away from keyboard"; } else { newStatus = PresenceStatus.Online; } } if (newStatus == PresenceStatus.Unknown) { return; } UpdatePresenceStatus(newStatus, newMessage); } public void Shutdown() { Shutdown(false, null); } public void Shutdown(bool clean, FrontendManager frontendManager) { Trace.Call(clean, frontendManager); lock (_ProtocolManagers) { foreach (var protocolManager in _ProtocolManagers) { try { if (clean) { protocolManager.Disconnect(frontendManager); } protocolManager.Dispose(); } catch (Exception ex) { #if LOG4NET f_Logger.ErrorFormat( "Shutdown(): {0}.Disconnect/Dispose() " + "failed, continuing with shutdown...", protocolManager.ToString() ); f_Logger.Error("Shutdown(): Exception", ex); #endif } } } } void UpdatePresenceStatus(PresenceStatus status, string message) { lock (_ProtocolManagers) { foreach (var manager in _ProtocolManagers) { manager.SetPresenceStatus(status, message); } } } IProtocolManager GetProtocolManagerByHost(string network) { lock (_ProtocolManagers) { foreach (var manager in _ProtocolManagers) { if (String.Compare(manager.Host, network, true) == 0) { return manager; } } } return null; } IProtocolManager GetProtocolManagerByNetwork(string network) { lock (_ProtocolManagers) { foreach (var manager in _ProtocolManagers) { if (String.Compare(manager.NetworkID, network, true) == 0) { return manager; } } } return null; } int GetSortedChatPosition(ChatModel chatModel) { int position = chatModel.Position; if (position != -1) { return position; } ChatType type = chatModel.ChatType; if (type != ChatType.Person && type != ChatType.Group) { return position; } // new group person and group chats behind their protocol chat IProtocolManager pm = chatModel.ProtocolManager; lock (_Chats) { foreach (var chat in _Chats) { if (chat.ChatType == ChatType.Protocol && chat.ProtocolManager == pm) { position = _Chats.IndexOf(chat) + 1; break; } } if (position == -1) { return position; } // now find the first chat with a different protocol manager foreach (var chat in _Chats.Skip(position)) { if (chat.ProtocolManager != pm) { return _Chats.IndexOf(chat); } } } // if there was no next protocol manager, simply append // the chat way to the end return -1; } void InitSessionChat() { _SessionChat = new SessionChatModel("smuxi", "Smuxi"); _Chats.Add(_SessionChat); var builder = CreateMessageBuilder(); var text = builder.CreateText(_("Welcome to Smuxi")); text.ForegroundColor = new TextColor(255, 0, 0); text.Bold = true; builder.AppendText(text); builder.AppendText(Environment.NewLine); text = builder.CreateText( _("Type /help to get a list of available commands.") ); text.Bold = true; builder.AppendText(text); builder.AppendText(Environment.NewLine); text = builder.CreateText(_("After you have made a connection " + "the list of available commands changes. Go to the newly " + "opened connection tab and use the /help command again to " + "see the extended command list.")); text.Bold = true; builder.AppendText(text); builder.AppendText(Environment.NewLine); builder.AppendText(Environment.NewLine); builder.AppendHeader("Smuxi News"); AddMessageToChat(_SessionChat,builder.ToMessage()); } void UpdateNewsFeed() { Trace.Call(); try { var proxySettings = new ProxySettings(); proxySettings.ApplyConfig(UserConfig); var url = "http://news.smuxi.org/feed.php"; var req = WebRequest.Create(url); req.Proxy = proxySettings.GetWebProxy(url); if (req is HttpWebRequest) { var httpReq = (HttpWebRequest) req; httpReq.UserAgent = Engine.VersionString; if (NewsFeedLastModified != DateTime.MinValue) { httpReq.IfModifiedSince = NewsFeedLastModified; } } var res = req.GetResponse(); if (res is HttpWebResponse) { var httpRes = (HttpWebResponse) res; if (httpRes.StatusCode == HttpStatusCode.NotModified) { return; } NewsFeedLastModified = httpRes.LastModified; } var feed = AtomFeed.Load(res.GetResponseStream()); var sortedEntries = feed.Entry.OrderBy(x => x.Published); foreach (var entry in sortedEntries) { if (SeenNewsFeedIds.Contains(entry.Id)) { continue; } SeenNewsFeedIds.Add(entry.Id); var msg = new FeedMessageBuilder(); msg.Append(entry); if (!msg.IsEmpty) { msg.AppendText("\n"); AddMessageToChat(SessionChat, msg.ToMessage()); } } } catch (WebException ex) { switch (ex.Status) { case WebExceptionStatus.ConnectFailure: case WebExceptionStatus.ConnectionClosed: case WebExceptionStatus.Timeout: case WebExceptionStatus.ReceiveFailure: case WebExceptionStatus.NameResolutionFailure: case WebExceptionStatus.ProxyNameResolutionFailure: #if LOG4NET f_Logger.Warn( String.Format( "UpdateNewsFeed(): Temporarily issue " + "detected, retrying in {0} min...", NewsFeedRetryInterval.Minutes ), ex ); #endif NewsFeedTimer.Change(NewsFeedRetryInterval, NewsFeedUpdateInterval); break; } } catch (Exception ex) { #if LOG4NET f_Logger.Error("UpdateNewsFeed(): Exception, ignored...", ex); #endif } } protected virtual void OnGroupChatPersonAdded(GroupChatPersonAddedEventArgs e) { if (GroupChatPersonAdded != null) { GroupChatPersonAdded(this, e); } var pm = e.GroupChat.ProtocolManager; var hooks = new HookRunner("engine", "session", "on-group-chat-person-added"); hooks.Environments.Add(new ChatHookEnvironment(e.GroupChat)); if (pm != null) { hooks.Environments.Add(new ProtocolManagerHookEnvironment(pm)); } hooks.Environments.Add(new PersonHookEnvironment(e.AddedPerson)); var cmdChar = (string) UserConfig["Interface/Entry/CommandCharacter"]; hooks.Commands.Add(new SessionHookCommand(this, e.GroupChat, cmdChar)); if (pm != null) { hooks.Commands.Add(new ProtocolManagerHookCommand(pm, e.GroupChat, cmdChar)); } // show time hooks.Init(); hooks.Run(); } protected virtual void OnGroupChatPersonRemoved(GroupChatPersonRemovedEventArgs e) { if (GroupChatPersonRemoved != null) { GroupChatPersonRemoved(this, e); } var pm = e.GroupChat.ProtocolManager; var hooks = new HookRunner("engine", "session", "on-group-chat-person-removed"); hooks.Environments.Add(new ChatHookEnvironment(e.GroupChat)); if (pm != null) { hooks.Environments.Add(new ProtocolManagerHookEnvironment(pm)); } hooks.Environments.Add(new PersonHookEnvironment(e.RemovedPerson)); var cmdChar = (string) UserConfig["Interface/Entry/CommandCharacter"]; hooks.Commands.Add(new SessionHookCommand(this, e.GroupChat, cmdChar)); if (pm != null) { hooks.Commands.Add(new ProtocolManagerHookCommand(pm, e.GroupChat, cmdChar)); } // show time hooks.Init(); hooks.Run(); } protected virtual void OnGroupChatPersonUpdated(GroupChatPersonUpdatedEventArgs e) { if (GroupChatPersonUpdated != null) { GroupChatPersonUpdated(this, e); } var pm = e.GroupChat.ProtocolManager; var hooks = new HookRunner("engine", "session", "on-group-chat-person-updated"); hooks.Environments.Add(new ChatHookEnvironment(e.GroupChat)); if (pm != null) { hooks.Environments.Add(new ProtocolManagerHookEnvironment(pm)); } hooks.Environments.Add(new PersonHookEnvironment("OLD_", e.OldPerson)); hooks.Environments.Add(new PersonHookEnvironment("NEW_", e.NewPerson)); var cmdChar = (string) UserConfig["Interface/Entry/CommandCharacter"]; hooks.Commands.Add(new SessionHookCommand(this, e.GroupChat, cmdChar)); if (pm != null) { hooks.Commands.Add(new ProtocolManagerHookCommand(pm, e.GroupChat, cmdChar)); } // show time hooks.Init(); hooks.Run(); } private static string _(string msg) { return LibraryCatalog.GetString(msg, _LibraryTextDomain); } } public abstract class GroupChatEventArgs : EventArgs { public GroupChatModel GroupChat { get; protected set; } } public class GroupChatPersonAddedEventArgs : GroupChatEventArgs { public PersonModel AddedPerson { get; private set; } public GroupChatPersonAddedEventArgs(GroupChatModel groupChat, PersonModel addedPerson) { GroupChat = groupChat; AddedPerson = addedPerson; } } public class GroupChatPersonRemovedEventArgs : GroupChatEventArgs { public PersonModel RemovedPerson { get; private set; } public GroupChatPersonRemovedEventArgs(GroupChatModel groupChat, PersonModel removedPerson) { GroupChat = groupChat; RemovedPerson = removedPerson; } } public class GroupChatPersonUpdatedEventArgs : GroupChatEventArgs { public PersonModel OldPerson { get; private set; } public PersonModel NewPerson { get; private set; } public GroupChatPersonUpdatedEventArgs(GroupChatModel groupChat, PersonModel oldPerson, PersonModel newPerson) { GroupChat = groupChat; OldPerson = oldPerson; NewPerson = newPerson; } } } smuxi-0.11/src/Engine/PresenceStatus.cs0000644000175000017500000000177011655545675020721 0ustar00meebeymeebey00000000000000// Smuxi - Smart MUltipleXed Irc // // Copyright (c) 2010 Mirco Bauer // // Full GPL License: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace Smuxi.Engine { public enum PresenceStatus { Unknown, Offline, Online, Away } } smuxi-0.11/src/Engine/Makefile.in0000644000175000017500000010531412311344230017434 0ustar00meebeymeebey00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/smuxi-engine.pc.in ChangeLog @BUNDLE_NINI_TRUE@am__append_1 = $(NINI_DLL) @BUNDLE_DB4O_TRUE@am__append_2 = $(DB4O_INCLUDED_LIBS) subdir = src/Engine ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/intltool.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/mono.m4 $(top_srcdir)/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = smuxi-engine.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" \ "$(DESTDIR)$(linuxdesktopapplicationsdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" \ "$(DESTDIR)$(programfilesiconsdir)" SCRIPTS = $(bin_SCRIPTS) $(pkgapp_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(linuxdesktopapplications_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) $(programfilesicons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CSC_FLAGS = @CSC_FLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DB4O_CFLAGS = @DB4O_CFLAGS@ DB4O_FILES = @DB4O_FILES@ DB4O_LIBS = @DB4O_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SHARP_CFLAGS = @DBUS_SHARP_CFLAGS@ DBUS_SHARP_GLIB_CFLAGS = @DBUS_SHARP_GLIB_CFLAGS@ DBUS_SHARP_GLIB_LIBS = @DBUS_SHARP_GLIB_LIBS@ DBUS_SHARP_LIBS = @DBUS_SHARP_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEV_VERSION_SUFFIX = @DEV_VERSION_SUFFIX@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FRONTEND_GNOME_COMPILER_FLAGS = @FRONTEND_GNOME_COMPILER_FLAGS@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GETTEXT_PACKAGE_ENGINE = @GETTEXT_PACKAGE_ENGINE@ GETTEXT_PACKAGE_ENGINE_CAMPFIRE = @GETTEXT_PACKAGE_ENGINE_CAMPFIRE@ GETTEXT_PACKAGE_ENGINE_IRC = @GETTEXT_PACKAGE_ENGINE_IRC@ GETTEXT_PACKAGE_ENGINE_JABBR = @GETTEXT_PACKAGE_ENGINE_JABBR@ GETTEXT_PACKAGE_ENGINE_TWITTER = @GETTEXT_PACKAGE_ENGINE_TWITTER@ GETTEXT_PACKAGE_ENGINE_XMPP = @GETTEXT_PACKAGE_ENGINE_XMPP@ GETTEXT_PACKAGE_FRONTEND = @GETTEXT_PACKAGE_FRONTEND@ GETTEXT_PACKAGE_FRONTEND_CURSES = @GETTEXT_PACKAGE_FRONTEND_CURSES@ GETTEXT_PACKAGE_FRONTEND_GNOME = @GETTEXT_PACKAGE_FRONTEND_GNOME@ GETTEXT_PACKAGE_FRONTEND_GNOME_IRC = @GETTEXT_PACKAGE_FRONTEND_GNOME_IRC@ GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER = @GETTEXT_PACKAGE_FRONTEND_GNOME_TWITTER@ GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP = @GETTEXT_PACKAGE_FRONTEND_GNOME_XMPP@ GETTEXT_PACKAGE_FRONTEND_STFL = @GETTEXT_PACKAGE_FRONTEND_STFL@ GETTEXT_PACKAGE_FRONTEND_SWF = @GETTEXT_PACKAGE_FRONTEND_SWF@ GETTEXT_PACKAGE_FRONTEND_WPF = @GETTEXT_PACKAGE_FRONTEND_WPF@ GETTEXT_PACKAGE_SERVER = @GETTEXT_PACKAGE_SERVER@ GIO_SHARP_CFLAGS = @GIO_SHARP_CFLAGS@ GIO_SHARP_FILES = @GIO_SHARP_FILES@ GIO_SHARP_LIBS = @GIO_SHARP_LIBS@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@ GTKSPELL_LIBS = @GTKSPELL_LIBS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INDICATE_SHARP_CFLAGS = @INDICATE_SHARP_CFLAGS@ INDICATE_SHARP_LIBS = @INDICATE_SHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOG4NET_CFLAGS = @LOG4NET_CFLAGS@ LOG4NET_LIBS = @LOG4NET_LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MESSAGINGMENU_SHARP_CFLAGS = @MESSAGINGMENU_SHARP_CFLAGS@ MESSAGINGMENU_SHARP_FILES = @MESSAGINGMENU_SHARP_FILES@ MESSAGINGMENU_SHARP_LIBS = @MESSAGINGMENU_SHARP_LIBS@ MESSAGING_MENU_CFLAGS = @MESSAGING_MENU_CFLAGS@ MESSAGING_MENU_LIBS = @MESSAGING_MENU_LIBS@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NDESK_DBUS_CFLAGS = @NDESK_DBUS_CFLAGS@ NDESK_DBUS_GLIB_CFLAGS = @NDESK_DBUS_GLIB_CFLAGS@ NDESK_DBUS_GLIB_LIBS = @NDESK_DBUS_GLIB_LIBS@ NDESK_DBUS_LIBS = @NDESK_DBUS_LIBS@ NINI_CFLAGS = @NINI_CFLAGS@ NINI_LIBS = @NINI_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NOTIFY_SHARP_CFLAGS = @NOTIFY_SHARP_CFLAGS@ NOTIFY_SHARP_LIBS = @NOTIFY_SHARP_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PROFILE = @PROFILE@ RANLIB = @RANLIB@ SED = @SED@ SERVER_COMPILER_FLAGS = @SERVER_COMPILER_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STFL_CFLAGS = @STFL_CFLAGS@ STFL_LIBS = @STFL_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XBUILD = @XBUILD@ XBUILD_FLAGS = @XBUILD_FLAGS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dist_version = @dist_version@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_libdir = @expanded_libdir@ git_branch = @git_branch@ git_commit_hash = @git_commit_hash@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ twitter_api_key = @twitter_api_key@ TARGET_DIR = $(top_builddir)/bin/$(PROFILE) EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ # Warning: This is an automatically generated file, do not edit! @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = @MCS@ @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG "-define:DEBUG,TRACE,LOG4NET,CONFIG_NINI" -define:DB4O,DB4O_8_0 @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:CONFIG_NINI" -define:DB4O,DB4O_8_0 @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/debug/smuxi-engine.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/release/smuxi-engine.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/release/smuxi-common.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin/debug @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin/release @ENABLE_DEBUG_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_RELEASE_TRUE@LOG4NET_DLL_SOURCE = ../../lib/log4net.dll @ENABLE_DEBUG_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/debug/smuxi-common.dll @ENABLE_RELEASE_TRUE@SMUXI_COMMON_DLL_SOURCE = ../../bin/release/smuxi-common.dll AL = al2 SATELLITE_ASSEMBLY_NAME = .resources.dll PROGRAMFILES = $(SMUXI_COMMON_DLL) $(am__append_1) $(am__append_2) LINUX_PKGCONFIG = \ $(ENGINE_PC) FILES = \ $(top_srcdir)/src/AssemblyVersion.cs \ AssemblyInfo.cs \ CertificateValidator.cs \ CommandModel.cs \ Engine.cs \ FrontendManager.cs \ IFrontendUI.cs \ PermanentRemoteObject.cs \ PresenceStatus.cs \ Session.cs \ SessionManager.cs \ TextColor.cs \ TextColorContrast.cs \ TextColorPalettes.cs \ TextColorTools.cs \ MessageBuffers/Db4oMessageBuffer.cs \ MessageBuffers/IMessageBuffer.cs \ MessageBuffers/ListMessageBuffer.cs \ MessageBuffers/MessageBufferBase.cs \ MessageBuffers/MessageBufferPersistencyType.cs \ Messages/FeedMessageBuilder.cs \ Messages/MessageBuilder.cs \ Messages/MessageModel.cs \ Messages/MessagePartModel.cs \ Messages/TextMessagePartModel.cs \ Messages/UrlMessagePartModel.cs \ Messages/ImageMessagePartModel.cs \ Messages/MessageType.cs \ Chats/ChatType.cs \ Chats/ChatModel.cs \ Chats/GroupChatModel.cs \ Chats/PersonChatModel.cs \ Chats/SessionChatModel.cs \ Chats/ProtocolChatModel.cs \ Config/FrontendConfig.cs \ Config/NotificationAreaIconMode.cs \ Config/UserConfig.cs \ Config/Config.cs \ Config/ServerModel.cs \ Config/ServerListController.cs \ Config/UserListController.cs \ Config/FilterListController.cs \ Config/FilterModel.cs \ Config/ProxySettings.cs \ Config/ProxyType.cs \ Config/EntrySettings.cs \ Config/MessageBuilderSettings.cs \ Config/MessagePatternListController.cs \ Config/MessagePatternModel.cs \ Protocols/ProtocolManagerBase.cs \ Protocols/ProtocolManagerFactory.cs \ Protocols/ProtocolManagerInfoModel.cs \ Protocols/ProtocolManagerInfoAttribute.cs \ Protocols/IProtocolManager.cs \ Persons/PersonModel.cs \ Persons/ContactModel.cs \ Hooks/HookRunner.cs \ Hooks/Commands/HookCommand.cs \ Hooks/Commands/ProtocolManagerHookCommand.cs \ Hooks/Commands/SessionHookCommand.cs \ Hooks/Environments/ChatHookEnvironment.cs \ Hooks/Environments/CommandHookEnvironment.cs \ Hooks/Environments/HookEnvironment.cs \ Hooks/Environments/MessageHookEnvironment.cs \ Hooks/Environments/PersonHookEnvironment.cs \ Hooks/Environments/ProtocolManagerHookEnvironment.cs DATA_FILES = RESOURCES = EXTRAS = \ smuxi-engine.pc.in REFERENCES = \ System.Runtime.Remoting \ System \ System.Core \ System.Web \ System.Xml \ Mono.Posix \ $(NINI_LIBS) \ $(LOG4NET_LIBS) \ $(DB4O_LIBS) \ $(DB4O_INCLUDED_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT build_sources = $(FILES) $(GENERATED_FILES) build_sources_embed = $(build_sources:%='$(srcdir)/%') comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources = $(build_resx_files:.resx=.resources) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) build_others_resources = $(build_others_files) build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter \ -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), \ -r:$(ref)))) $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) \ $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) pkgappdir = $(pkglibdir) pkgapp_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) programfilesiconsdir = @libdir@/@PACKAGE@/icons programfilesicons_DATA = $(PROGRAMFILES_ICONS) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) linuxdesktopapplicationsdir = @prefix@/share/applications linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) ENGINE_PC = $(BUILD_DIR)/smuxi-engine.pc SMUXI_COMMON_DLL = $(BUILD_DIR)/smuxi-common.dll @BUNDLE_NINI_TRUE@NINI_DLL = $(BUILD_DIR)/Nini.dll @BUNDLE_NINI_TRUE@NINI_DLL_SOURCE = $(NINI_LIBS) @BUNDLE_DB4O_TRUE@DB4O_INCLUDED_LIBS := $(foreach file, $(DB4O_FILES), $(TARGET_DIR)/$(file)) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Engine/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Engine/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): smuxi-engine.pc: $(top_builddir)/config.status $(srcdir)/smuxi-engine.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-pkgappSCRIPTS: $(pkgapp_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgappdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgappdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgappdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgappdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkgappSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkgapp_SCRIPTS)'; test -n "$(pkgappdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkgappdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-linuxdesktopapplicationsDATA: $(linuxdesktopapplications_DATA) @$(NORMAL_INSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxdesktopapplicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxdesktopapplicationsdir)" || exit $$?; \ done uninstall-linuxdesktopapplicationsDATA: @$(NORMAL_UNINSTALL) @list='$(linuxdesktopapplications_DATA)'; test -n "$(linuxdesktopapplicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxdesktopapplicationsdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) install-programfilesiconsDATA: $(programfilesicons_DATA) @$(NORMAL_INSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(programfilesiconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(programfilesiconsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesiconsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesiconsdir)" || exit $$?; \ done uninstall-programfilesiconsDATA: @$(NORMAL_UNINSTALL) @list='$(programfilesicons_DATA)'; test -n "$(programfilesiconsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesiconsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgappdir)" "$(DESTDIR)$(linuxdesktopapplicationsdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)" "$(DESTDIR)$(programfilesiconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-pkgappSCRIPTS \ install-programfilesDATA install-programfilesiconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-linuxdesktopapplicationsDATA \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-pkgappSCRIPTS install-programfilesDATA \ install-programfilesiconsDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-linuxdesktopapplicationsDATA \ uninstall-linuxpkgconfigDATA uninstall-pkgappSCRIPTS \ uninstall-programfilesDATA uninstall-programfilesiconsDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p $$(dir $($1)) cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(@D)' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(eval $(call emit-deploy-wrapper,ENGINE_PC,smuxi-engine.pc)) $(eval $(call emit-deploy-target,SMUXI_COMMON_DLL)) @BUNDLE_NINI_TRUE@$(eval $(call emit-deploy-target,NINI_DLL)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx resgen2 '$<' '$@' $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(dir $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: